From d3ebdba42e9838ca65268bf72db70b8def16e2ab Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Sat, 28 Aug 2021 07:57:08 +0200
Subject: [PATCH 001/347] Added option to force phi bin size below the
 hardcoded limit

---
 .../IDScanZFinder/python/ZFinderAlgConfig.py  | 32 +++++++++----------
 .../IDScanZFinder/src/IDScanZFinder.cxx       |  2 +-
 .../IDScanZFinder/src/IDScanZFinderInternal.h |  6 ++--
 .../IDScanZFinder/src/TrigZFinder.cxx         |  3 +-
 .../IDScanZFinder/src/TrigZFinderInternal.cxx |  2 +-
 .../IDScanZFinder/src/TrigZFinderInternal.h   |  1 +
 6 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/Trigger/TrigTools/IDScanZFinder/python/ZFinderAlgConfig.py b/Trigger/TrigTools/IDScanZFinder/python/ZFinderAlgConfig.py
index 95e98ad5549a..7c6ac2943092 100644
--- a/Trigger/TrigTools/IDScanZFinder/python/ZFinderAlgConfig.py
+++ b/Trigger/TrigTools/IDScanZFinder/python/ZFinderAlgConfig.py
@@ -6,22 +6,22 @@ from IDScanZFinder.IDScanZFinderConf import TrigZFinder
 
 MinBiasZFinderAlg = TrigZFinderAlg("TrigZFinderAlg", vertexKey=recordable("HLT_vtx_z"))
 MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("default")]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike", TripletMode=1, TripletDZ=1, PhiBinSize=0.1, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike1", TripletMode=1, TripletDZ=1, PhiBinSize=0.05, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike2", TripletMode=1, TripletDZ=1, PhiBinSize=0.02, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike3", TripletMode=1, TripletDZ=1, PhiBinSize=0.01, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike4", TripletMode=1, TripletDZ=0.5, PhiBinSize=0.1, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike5", TripletMode=1, TripletDZ=0.5, PhiBinSize=0.05, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike6", TripletMode=1, TripletDZ=0.5, PhiBinSize=0.02, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike7", TripletMode=1, TripletDZ=0.5, PhiBinSize=0.01, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike8", TripletMode=1, TripletDZ=1.5, PhiBinSize=0.1, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike9", TripletMode=1, TripletDZ=1.5, PhiBinSize=0.05, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike10", TripletMode=1, TripletDZ=1.5, PhiBinSize=0.02, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike11", TripletMode=1, TripletDZ=1.5, PhiBinSize=0.01, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike12", TripletMode=1, TripletDZ=2, PhiBinSize=0.1, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike13", TripletMode=1, TripletDZ=2, PhiBinSize=0.05, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike14", TripletMode=1, TripletDZ=2, PhiBinSize=0.02, UseOnlyPixels=True, MaxLayer=3)]
-MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike15", TripletMode=1, TripletDZ=2, PhiBinSize=0.01, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike", TripletMode=1, TripletDZ=1, ForcePhiBinSize =True, PhiBinSize=0.1, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike1", TripletMode=1, TripletDZ=1, ForcePhiBinSize =True, PhiBinSize=0.05, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike2", TripletMode=1, TripletDZ=1, ForcePhiBinSize =True, PhiBinSize=0.02, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike3", TripletMode=1, TripletDZ=1, ForcePhiBinSize =True, PhiBinSize=0.01, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike4", TripletMode=1, TripletDZ=0.5, ForcePhiBinSize =True, PhiBinSize=0.1, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike5", TripletMode=1, TripletDZ=0.5, ForcePhiBinSize =True, PhiBinSize=0.05, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike6", TripletMode=1, TripletDZ=0.5, ForcePhiBinSize =True, PhiBinSize=0.02, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike7", TripletMode=1, TripletDZ=0.5, ForcePhiBinSize =True, PhiBinSize=0.01, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike8", TripletMode=1, TripletDZ=1.5, ForcePhiBinSize =True, PhiBinSize=0.1, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike9", TripletMode=1, TripletDZ=1.5, ForcePhiBinSize =True, PhiBinSize=0.05, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike10", TripletMode=1, TripletDZ=1.5, ForcePhiBinSize =True, PhiBinSize=0.02, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike11", TripletMode=1, TripletDZ=1.5, ForcePhiBinSize =True, PhiBinSize=0.01, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike12", TripletMode=1, TripletDZ=2, ForcePhiBinSize =True, PhiBinSize=0.1, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike13", TripletMode=1, TripletDZ=2, ForcePhiBinSize =True, PhiBinSize=0.05, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike14", TripletMode=1, TripletDZ=2, ForcePhiBinSize =True, PhiBinSize=0.02, UseOnlyPixels=True, MaxLayer=3)]
+MinBiasZFinderAlg.ZFinderTools += [TrigZFinder("BeamSpotLike15", TripletMode=1, TripletDZ=2, ForcePhiBinSize =True, PhiBinSize=0.01, UseOnlyPixels=True, MaxLayer=3)]
 
 
 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
diff --git a/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinder.cxx b/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinder.cxx
index 3b3a27f101ca..1ff46d87c99e 100755
--- a/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinder.cxx
+++ b/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinder.cxx
@@ -68,7 +68,7 @@ StatusCode IDScanZFinder::initialize()
 
   /// NB: These only have to go here, because they need to write to the msgsvc, and because 
   ///     is rubbish, we can't pass in a pointer to a (non-athena) sub algorithm.
-  if ( m_phiBinSize < ZFinder_MinPhiSliceSize ){
+  if ( m_phiBinSize < ZFinder_MinPhiSliceSize and ! m_forcePhiBinSize ){
     ATH_MSG_WARNING("Requested PhiBinSize of "  << m_phiBinSize
                     << " degrees is smaller than the minimum allowed (" << ZFinder_MinPhiSliceSize
                     << " degrees). Set to the minimum value.");
diff --git a/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinderInternal.h b/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinderInternal.h
index 9d608fe54b19..ae1f2949c858 100644
--- a/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinderInternal.h
+++ b/Trigger/TrigTools/IDScanZFinder/src/IDScanZFinderInternal.h
@@ -100,7 +100,8 @@ protected:  // data members
   double m_invPhiSliceSize;     // the inverse size of the phi slices 
   long   m_NumPhiSlices;        // the number of phi slices, given the width of the RoI 
   
-  double m_phiBinSize;          // the size of the phi slices 
+  double m_phiBinSize;          // the size of the phi slices
+  bool   m_forcePhiBinSize;     // forces the phi bin size to be be used as configured even if below reasonable limit 
   double m_usedphiBinSize;      // the size of the phi slices 
   double m_ROIphiWidth;         // the phi width of the ROI 
   double m_usedROIphiWidth;     // the phi width of the ROI 
@@ -174,6 +175,7 @@ IDScanZFinderInternal<SpacePoint>::IDScanZFinderInternal( const std::string& typ
   m_Name = name;
   
   m_phiBinSize       = 0.2   ;
+  m_forcePhiBinSize  = false ;
   m_usedphiBinSize   = m_phiBinSize   ;
   m_pixOnly          = false ;
   m_ROIphiWidth      = 0.2   ;
@@ -234,7 +236,7 @@ void IDScanZFinderInternal<SpacePoint>::initializeInternal(long maxLayers, long
   
   // from IDScanZFinder::initialize
   m_usedphiBinSize = m_phiBinSize;
-  if ( m_usedphiBinSize < ZFinder_MinPhiSliceSize ) m_usedphiBinSize = ZFinder_MinPhiSliceSize;
+  if ( m_usedphiBinSize < ZFinder_MinPhiSliceSize and ! m_forcePhiBinSize) m_usedphiBinSize = ZFinder_MinPhiSliceSize;
   if ( m_dphideta > 0 )                             m_dphideta *= -m_dphideta;
   
   m_invPhiSliceSize = 180./(M_PI*m_usedphiBinSize);
diff --git a/Trigger/TrigTools/IDScanZFinder/src/TrigZFinder.cxx b/Trigger/TrigTools/IDScanZFinder/src/TrigZFinder.cxx
index 216fa629c16f..1e807574d4ea 100755
--- a/Trigger/TrigTools/IDScanZFinder/src/TrigZFinder.cxx
+++ b/Trigger/TrigTools/IDScanZFinder/src/TrigZFinder.cxx
@@ -33,6 +33,7 @@ TrigZFinder::TrigZFinder( const std::string& type, const std::string& name, cons
   //  std::cout << "ZFinder::ZFinder() version " << name << " " << type << "\tTrigZFinder-00-00-62"<< std::endl;
 
   declareProperty( "PhiBinSize",         m_phiBinSize       = 0.2   );
+  declareProperty( "ForcePhiBinSize",    m_forcePhiBinSize  = false );
   declareProperty( "UseOnlyPixels",      m_pixOnly          = false );
   declareProperty( "MinZBinSize",        m_minZBinSize      = 0.2   );
   declareProperty( "nFirstLayers",       m_nFirstLayers     = 3     );
@@ -76,7 +77,7 @@ StatusCode TrigZFinder::initialize()
 
   /// NB: These only have to go here, because they need to write to the msgsvc, and because 
   ///     is rubbish, we can't pass in a pointer to a (non-athena) sub algorithm.
-  if ( m_phiBinSize < ZFinder_MinPhiSliceSize ){
+  if ( m_phiBinSize < ZFinder_MinPhiSliceSize and ! m_forcePhiBinSize ){
     ATH_MSG_WARNING("Requested PhiBinSize of "  << m_phiBinSize
                     << " degrees is smaller than the minimum allowed (" << ZFinder_MinPhiSliceSize
                     << " degrees). Set to the minimum value.");
diff --git a/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.cxx b/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.cxx
index c5d948b4edb8..ac74bb46e346 100644
--- a/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.cxx
+++ b/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.cxx
@@ -96,7 +96,7 @@ void TrigZFinderInternal::initializeInternal(long maxLayers, long lastBarrel )
 
   // from TrigZFinder::initialize
   m_usedphiBinSize = m_phiBinSize;
-  if ( m_usedphiBinSize < ZFinder_MinPhiSliceSize ) m_usedphiBinSize = ZFinder_MinPhiSliceSize;
+  if ( m_usedphiBinSize < ZFinder_MinPhiSliceSize and ! m_forcePhiBinSize) m_usedphiBinSize = ZFinder_MinPhiSliceSize;
   if ( m_dphideta > 0 )                             m_dphideta *= -m_dphideta;
 
   m_invPhiSliceSize = 180./(M_PI*m_usedphiBinSize);
diff --git a/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.h b/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.h
index 8c3f70481277..346d37ff4b11 100644
--- a/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.h
+++ b/Trigger/TrigTools/IDScanZFinder/src/TrigZFinderInternal.h
@@ -91,6 +91,7 @@ protected:  // data members
     long   m_NumPhiSlices = 0L;        // the number of phi slices, given the width of the RoI 
 
     double m_phiBinSize;          // the size of the phi slices 
+    bool   m_forcePhiBinSize;     // respect the config of phi bin even if below reasonable threshold
     double m_usedphiBinSize;      // the size of the phi slices 
     double m_ROIphiWidth;         // the phi width of the ROI 
     double m_usedROIphiWidth;     // the phi width of the ROI 
-- 
GitLab


From 7d28fab9b605c8a2cfef69922041c31248ccb905 Mon Sep 17 00:00:00 2001
From: "Ewelina.Maria.Lobodzinska" <ewelina.maria.lobodzinska@cern.ch>
Date: Tue, 7 Sep 2021 15:47:18 +0200
Subject: [PATCH 002/347] GeneratorFilters: fix DirectPhotonFilter

---
 Generators/GeneratorFilters/src/DirectPhotonFilter.cxx | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/Generators/GeneratorFilters/src/DirectPhotonFilter.cxx b/Generators/GeneratorFilters/src/DirectPhotonFilter.cxx
index 43b783f44970..29502e6e7e36 100644
--- a/Generators/GeneratorFilters/src/DirectPhotonFilter.cxx
+++ b/Generators/GeneratorFilters/src/DirectPhotonFilter.cxx
@@ -16,8 +16,6 @@ DirectPhotonFilter::DirectPhotonFilter(const std::string& name, ISvcLocator* pSv
   declareProperty("Etacut", m_EtaRange = 2.50);
   declareProperty("AllowSUSYDecay",m_AllowSUSYDecay = false);
 
-  // Backward compatibility aliases
-  declareProperty("Ptcut", m_Ptmin);
 }
 
 StatusCode DirectPhotonFilter::filterInitialize() {
@@ -62,7 +60,6 @@ StatusCode DirectPhotonFilter::filterEvent() {
   for (McEventCollection::const_iterator itr = events_const()->begin(); itr!=events_const()->end(); ++itr) {
     const HepMC::GenEvent* genEvt = (*itr);
     ATH_MSG_DEBUG("----->>> Process : " << HepMC::signal_process_id(genEvt));
-
     // Find all prompt photons with within given eta range
     for (auto pitr: *genEvt) {
       if (pitr->pdg_id() == 22 &&
@@ -87,7 +84,7 @@ StatusCode DirectPhotonFilter::filterEvent() {
         }
         phot++;
         if (!fromHadron) promptPhotonsInEta.push_back(pitr);
-        else ATH_MSG_INFO("non-prompt photon ignored");
+        else ATH_MSG_DEBUG("non-prompt photon ignored");
       }
     }
   }
@@ -115,7 +112,9 @@ StatusCode DirectPhotonFilter::filterEvent() {
         }
       }
 
-      if (pass) ATH_MSG_DEBUG("Passed!");
+      if (pass) {
+         ATH_MSG_DEBUG("Passed!");
+         }
       setFilterPassed(pass);
     }
     else { // just require NPhotons to pass m_Ptmin/max[0]
-- 
GitLab


From 3c1e8aff4804869eb2c4a74fc1c0b85e77f20f20 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Tue, 7 Sep 2021 16:09:37 +0200
Subject: [PATCH 003/347] Upgraded diffing in confTool to take into account
 that the components are also values

---
 .../python/iconfTool/models/loaders.py        | 11 ++++++++-
 Control/AthenaConfiguration/share/confTool.py | 24 ++++++++++++++++---
 2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/Control/AthenaConfiguration/python/iconfTool/models/loaders.py b/Control/AthenaConfiguration/python/iconfTool/models/loaders.py
index ffd594ddc167..94a9449094ed 100755
--- a/Control/AthenaConfiguration/python/iconfTool/models/loaders.py
+++ b/Control/AthenaConfiguration/python/iconfTool/models/loaders.py
@@ -138,7 +138,16 @@ def renameComps(dic, args) -> Dict:
     })
 
     def rename_comps(comp_name):
-        return componentRenamingDict.get(comp_name, comp_name) # get new name or default to original when no renaming for that name
+        """Renames component if it is in the dict or, when name fragment is in the dict
+        The later is for cases like: ToolSvc.ToolA.X.Y is renamed to ToolSvc.ToolB.X.Y
+        """
+        renamed = componentRenamingDict.get(comp_name, comp_name) # get new name or default to original when no renaming for that name
+        if renamed != comp_name: 
+            return renamed
+        for k,v in componentRenamingDict.items():
+            if f"{k}." in comp_name or f".{k}" in comp_name:
+                return v.replace(k, v)
+        return comp_name
 
     conf = {}
     for (key, value) in dic.items():
diff --git a/Control/AthenaConfiguration/share/confTool.py b/Control/AthenaConfiguration/share/confTool.py
index 2f65811d8c31..6272a35a28e2 100755
--- a/Control/AthenaConfiguration/share/confTool.py
+++ b/Control/AthenaConfiguration/share/confTool.py
@@ -12,6 +12,7 @@ import pickle
 import pprint
 import re
 import sys
+import collections
 
 from AthenaConfiguration.iconfTool.models.loaders import loadConfigFile, baseParser, componentRenamingDict, loadDifferencesFile
 class color:
@@ -208,6 +209,23 @@ def _knownDifference(comp, prop, chkVal, refVal):
                 return refVal == acceptedDifference[0] and chkVal == acceptedDifference[1]
     return False
 
+def _handleComponentsReanaming( refVal ):
+    """ Rename values in reference as long as they are hashable (and in renamingDict)
+        It is a bit of heuristics that is invoved, the assumption is that the property has value of the form A/B if it is name of the compoemnt or it is a just single string"""
+    refList = refVal if isinstance(refVal, list) else [refVal]
+    updatedRef = []
+    for v in refList:
+        if  isinstance(v, str):
+            if "/" in v and len(v.split("/")) == 2:
+                compType,compName = v.split("/")
+                newName = componentRenamingDict.get(compName, compName)
+                updatedRef.append( f"{compType}/{newName}" )
+            else:
+                updatedRef.append( componentRenamingDict.get(v, v) )
+        else:
+            updatedRef.append(v)
+    return updatedRef if isinstance(refVal, list) else updatedRef[0]
+
 def _compareComponent(compRef, compChk, prefix, args, component):
 
     if isinstance(compRef, dict):
@@ -241,6 +259,8 @@ def _compareComponent(compRef, compChk, prefix, args, component):
             except ValueError:
                 pass  # literal_eval exception when parsing particular strings
 
+            refVal = _handleComponentsReanaming( refVal )
+
             refVal, chkVal = _parseNumericalValues(refVal, chkVal)
             diffmarker = ""
             if str(chkVal) == str(refVal):
@@ -256,9 +276,7 @@ def _compareComponent(compRef, compChk, prefix, args, component):
             if not (component == "IOVDbSvc" and prop == "Folders"):
                 print(f"{prefix}{color.property}{prop} = {color.first} {refVal} {color.reset} vs {color.second} {chkVal} {color.reset} {diffmarker}")
 
-            if refVal and (
-                isinstance(refVal, list) or isinstance(refVal, dict)
-            ):
+            if refVal and ( isinstance(refVal, list) or isinstance(refVal, dict) ):
                 if component == "IOVDbSvc" and prop == "Folders":
                     _compareIOVDbFolders(refVal, chkVal, "\t", args)
                 else:
-- 
GitLab


From 69462fa61032fe7b6683c4b1971bad32c86f53bb Mon Sep 17 00:00:00 2001
From: Edward Moyse <edward.moyse@cern.ch>
Date: Tue, 7 Sep 2021 16:31:55 +0200
Subject: [PATCH 004/347] Reduce visibility of debug message.

---
 graphics/VP1/VP1Base/src/VP1MaterialButton.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/graphics/VP1/VP1Base/src/VP1MaterialButton.cxx b/graphics/VP1/VP1Base/src/VP1MaterialButton.cxx
index 929fb13c504f..a6c965c25e27 100644
--- a/graphics/VP1/VP1Base/src/VP1MaterialButton.cxx
+++ b/graphics/VP1/VP1Base/src/VP1MaterialButton.cxx
@@ -653,7 +653,7 @@ QList<SoMaterial*> VP1MaterialButton::handledMaterials() const
 void VP1MaterialButton::setText ( const QString & s )
 {
   if (!s.isEmpty())
-    message("VP1MaterialButton::setText() called (with '"+s+"'), but not allowed");
+    messageDebug("VP1MaterialButton::setText() called (with '"+s+"'), but not allowed");
 	//Forbidden!! Only here since Designer generated code needs it in public.
 }
 
-- 
GitLab


From c9a8623fb19c45d6e9c58131225a10aad63ac491 Mon Sep 17 00:00:00 2001
From: Peter Berta <peter.berta@cern.ch>
Date: Mon, 30 Aug 2021 16:33:50 +0200
Subject: [PATCH 005/347] Merge branch '22.0-mc20-dq-newconfig-dataflow' into
 '22.0-mc20'

Fixes for DATREP-210

See merge request atlas/athena!46046

(cherry picked from commit 7a3f53c01be01ec5baa22b7deb786c4b059c4c68)

8921b39f Decouple data flow monitoring from global mon in new config
d2f018fb Add potential transform step to run DQHistogramMerge in AODtoHIST
Conflicts:
	Control/AthenaMonitoring/python/DQConfigFlags.py
---
 Control/AthenaMonitoring/python/AthenaMonitoringCfg.py       | 5 +++++
 Control/AthenaMonitoring/python/DQConfigFlags.py             | 2 +-
 .../AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py    | 1 +
 .../DataQualityTools/python/DataQualityToolsConfig.py        | 3 ---
 Reconstruction/RecJobTransforms/python/recTransformUtils.py  | 2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py b/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py
index 17efcdd5f24f..68602c3dfad0 100644
--- a/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py
+++ b/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py
@@ -90,6 +90,11 @@ def AthenaMonitoringCfg(flags):
         from MissingETMonitoring.METMonitorAlgorithm import METMonitoringConfig
         result.merge(METMonitoringConfig(flags))
 
+    if flags.DQ.Steering.doDataFlowMon:
+        info('Set up Data Flow monitoring')
+        from DataQualityTools.DQTDataFlowMonAlg import DQTDataFlowMonAlgConfig
+        result.merge(DQTDataFlowMonAlgConfig(flags))
+
     if flags.DQ.Steering.doGlobalMon:
         info('Set up Global monitoring')
         from DataQualityTools.DataQualityToolsConfig import DataQualityToolsConfig
diff --git a/Control/AthenaMonitoring/python/DQConfigFlags.py b/Control/AthenaMonitoring/python/DQConfigFlags.py
index 99398ace8761..b76cc75f52bc 100644
--- a/Control/AthenaMonitoring/python/DQConfigFlags.py
+++ b/Control/AthenaMonitoring/python/DQConfigFlags.py
@@ -11,7 +11,7 @@ _steeringFlags = [ 'doGlobalMon', 'doLVL1CaloMon', 'doCTPMon', 'doHLTMon',
                    'doLucidMon', 'doAFPMon',
                    'doHIMon', 'doEgammaMon', 'doJetMon', 'doMissingEtMon',
                    'doJetInputsMon',
-                   'doTauMon', 'doJetTagMon' ]
+                   'doTauMon', 'doJetTagMon', 'doDataFlowMon' ]
 
 _lowLevelSteeringFlags = [ 'InDet.doGlobalMon', 'InDet.doAlignMon',
                            'InDet.doPerfMon',  'Muon.doRawMon',
diff --git a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
index d1eb5f757ce7..2708f69f9396 100644
--- a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
@@ -506,6 +506,7 @@ from AthenaMonitoring.DQConfigFlags import allSteeringFlagsOff
 from AthenaMonitoring import AthenaMonitoringConf
 
 Steering = ConfigFlags.DQ.Steering
+Steering.doDataFlowMon=DQMonFlags.doDataFlowMon()
 Steering.doGlobalMon=DQMonFlags.doGlobalMon()
 # do not enable new trigger monitoring in mixed mode if we are not in Run 3 EDM
 mixedModeFlag = (DQMonFlags.triggerMixedMode() and ConfigFlags.Trigger.EDMVersion == 2)
diff --git a/DataQuality/DataQualityTools/python/DataQualityToolsConfig.py b/DataQuality/DataQualityTools/python/DataQualityToolsConfig.py
index 34d2ae7b29ce..beec7691cdb6 100644
--- a/DataQuality/DataQualityTools/python/DataQualityToolsConfig.py
+++ b/DataQuality/DataQualityTools/python/DataQualityToolsConfig.py
@@ -4,14 +4,11 @@
 
 def DataQualityToolsConfig(flags):
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-    from .DQTDataFlowMonAlg import DQTDataFlowMonAlgConfig
     from .DQTLumiMonAlg import DQTLumiMonAlgConfig
     from .DQTBackgroundMon import DQTBackgroundMonAlgConfig
     from .DQTDetSynchMonAlg import DQTDetSynchMonAlgConfig
 
     result = ComponentAccumulator()
-    # the following should run in all configurations
-    result.merge(DQTDataFlowMonAlgConfig(flags))
 
     # the following should not run in RAW to ESD, if we're in two-step
     if flags.DQ.Environment != 'tier0Raw':
diff --git a/Reconstruction/RecJobTransforms/python/recTransformUtils.py b/Reconstruction/RecJobTransforms/python/recTransformUtils.py
index 1b318fd958f9..a0175293f720 100644
--- a/Reconstruction/RecJobTransforms/python/recTransformUtils.py
+++ b/Reconstruction/RecJobTransforms/python/recTransformUtils.py
@@ -108,7 +108,7 @@ def addRecoSubsteps(executorSet):
                                    outData = ['ESD', 'HIST_ESD_INT', 'TXT_JIVEXMLTGZ'],))
     executorSet.add(athenaExecutor(name = 'ESDtoAOD', skeletonFile = 'RecJobTransforms/skeleton.ESDtoAOD_tf.py',
                                    substep = 'e2a', inData = ['ESD'], outData = ['AOD', 'HIST_AOD_INT']))
-    executorSet.add(DQMergeExecutor(name = 'DQHistogramMerge', inData = [('HIST_ESD_INT', 'HIST_AOD_INT'), 'HIST_R2A'], outData = ['HIST']))
+    executorSet.add(DQMergeExecutor(name = 'DQHistogramMerge', inData = [('HIST_ESD_INT', 'HIST_AOD_INT'), 'HIST_R2A', 'HIST_AOD'], outData = ['HIST']))
     executorSet.add(athenaExecutor(name = 'ESDtoDPD', skeletonFile = 'PATJobTransforms/skeleton.ESDtoDPD_tf.py',
                                    substep = 'e2d', inData = ['ESD'], outData = []))
     executorSet.add(athenaExecutor(name = 'AODtoDPD', skeletonFile = 'PATJobTransforms/skeleton.AODtoDPD_tf.py',
-- 
GitLab


From 6fa12afe93bb5fdfd0a7a0416de43d04bfb9af81 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 21 Jul 2021 10:47:55 -0400
Subject: [PATCH 006/347] EventAthenaPool: Enable thread-safety checking.

Enable thread-safety checking and clean up warnings.
---
 .../EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY |  1 +
 Event/EventAthenaPool/src/EventInfoCnv.cxx    | 30 +++++++--------
 .../src/EventStreamInfoCnv.cxx                |  8 ++--
 .../src/MergedEventInfoCnv.cxx                | 20 +++++-----
 .../EventAthenaPool/src/MergedEventInfoCnv.h  |  2 +-
 .../src/PileUpEventInfoCnv.cxx                | 38 +++++++++----------
 6 files changed, 50 insertions(+), 49 deletions(-)
 create mode 100644 Event/EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Event/EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY b/Event/EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..1b84dd66f9f1
--- /dev/null
+++ b/Event/EventAthenaPool/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Event/EventAthenaPool
diff --git a/Event/EventAthenaPool/src/EventInfoCnv.cxx b/Event/EventAthenaPool/src/EventInfoCnv.cxx
index 949849843fa3..072d39e0541f 100755
--- a/Event/EventAthenaPool/src/EventInfoCnv.cxx
+++ b/Event/EventAthenaPool/src/EventInfoCnv.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
 */
 
 /**
@@ -20,10 +20,10 @@
 
 #include "AthenaKernel/IEvtIdModifierSvc.h"
 
-static EventInfoCnv_p4   TPconverter_p4;
-static EventInfoCnv_p3   TPconverter_p3;
-static EventInfoCnv_p2   TPconverter_p2;
-static EventInfoCnv_p1   TPconverter_p1;
+static const EventInfoCnv_p4   TPconverter_p4;
+static const EventInfoCnv_p3   TPconverter_p3;
+static const EventInfoCnv_p2   TPconverter_p2;
+static const EventInfoCnv_p1   TPconverter_p1;
 
 EventInfoCnv::EventInfoCnv(ISvcLocator* svcloc) 
   : 
@@ -49,45 +49,45 @@ EventInfoCnv::EventInfoCnv(ISvcLocator* svcloc)
 
 EventInfo_PERS* EventInfoCnv::createPersistent(EventInfo* transObj) {
     MsgStream log(msgSvc(), "EventInfoCnv" ); 
-    EventInfo_PERS *persObj = TPconverter_p4.createPersistent( transObj, log );
+    EventInfo_PERS *persObj = TPconverter_p4.createPersistentConst( transObj, log );
     log << MSG::DEBUG << "EventInfo write Success" << endmsg;
     return persObj; 
 }
     
 EventInfo* EventInfoCnv::createTransient() {
 
-    static pool::Guid   p4_guid("C634FDB6-CC4B-4BA2-B8F9-A84BE6A786C7");
-    static pool::Guid   p3_guid("3E240CA8-5124-405B-9059-FAFC4C5954C6");
-    static pool::Guid   p2_guid("22006E19-F0DA-4EFB-AF55-6FBDA421BF06");
-    static pool::Guid   p1_guid("A3053CD9-47F4-4C0F-B73A-A6F93F5CC7B7");
-    static pool::Guid   p0_guid("380D8BB9-B34F-470F-92CC-06C3D60F7BE4");
+    static const pool::Guid   p4_guid("C634FDB6-CC4B-4BA2-B8F9-A84BE6A786C7");
+    static const pool::Guid   p3_guid("3E240CA8-5124-405B-9059-FAFC4C5954C6");
+    static const pool::Guid   p2_guid("22006E19-F0DA-4EFB-AF55-6FBDA421BF06");
+    static const pool::Guid   p1_guid("A3053CD9-47F4-4C0F-B73A-A6F93F5CC7B7");
+    static const pool::Guid   p0_guid("380D8BB9-B34F-470F-92CC-06C3D60F7BE4");
     if( compareClassGuid(p4_guid) ) {
         // using unique_ptr ensures deletion of the persistent object
         std::unique_ptr< EventInfo_p4 > col_vect( poolReadObject< EventInfo_p4 >() );
         MsgStream log(msgSvc(), "EventInfoCnv" );
         //log << MSG::DEBUG << "Reading EventInfo_p4" << endmsg; 
-        return massageEventInfo(TPconverter_p4.createTransient( col_vect.get(), log ));
+        return massageEventInfo(TPconverter_p4.createTransientConst( col_vect.get(), log ));
     }
     else if( compareClassGuid(p3_guid) ) {
         // using unique_ptr ensures deletion of the persistent object
         std::unique_ptr< EventInfo_p3 > col_vect( poolReadObject< EventInfo_p3 >() );
         MsgStream log(msgSvc(), "EventInfoCnv" );
         //log << MSG::DEBUG << "Reading EventInfo_p3" << endmsg; 
-        return massageEventInfo(TPconverter_p3.createTransient( col_vect.get(), log ));
+        return massageEventInfo(TPconverter_p3.createTransientConst( col_vect.get(), log ));
     }
     else if( compareClassGuid(p2_guid) ) {
         // using unique_ptr ensures deletion of the persistent object
         std::unique_ptr< EventInfo_p2 > col_vect( poolReadObject< EventInfo_p2 >() );
         MsgStream log(msgSvc(), "EventInfoCnv" );
         // log << MSG::DEBUG << "ILIJA Reading EventInfo_p2" << endmsg; 
-        return massageEventInfo(TPconverter_p2.createTransient( col_vect.get(), log ));
+        return massageEventInfo(TPconverter_p2.createTransientConst( col_vect.get(), log ));
     }
     else if( compareClassGuid(p1_guid) ) {
         // using unique_ptr ensures deletion of the persistent object
         std::unique_ptr< EventInfo_p1 > col_vect( poolReadObject< EventInfo_p1 >() );
         MsgStream log(msgSvc(), "EventInfoCnv" );
         //log << MSG::DEBUG << "Reading EventInfo_p1" << endmsg; 
-        return massageEventInfo(TPconverter_p1.createTransient( col_vect.get(), log ));
+        return massageEventInfo(TPconverter_p1.createTransientConst( col_vect.get(), log ));
     }
     else if( compareClassGuid(p0_guid) ) {
         // regular object from before TP separation, just return it
diff --git a/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx b/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx
index 55258af6c034..d2db891d1d90 100755
--- a/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx
+++ b/Event/EventAthenaPool/src/EventStreamInfoCnv.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
 */
 
 /** @file EventStreamInfoCnv.cxx
@@ -27,9 +27,9 @@ EventStreamInfo_PERS* EventStreamInfoCnv::createPersistent(EventStreamInfo* tran
 }
 //______________________________________________________________________________
 EventStreamInfo* EventStreamInfoCnv::createTransient() {
-   static pool::Guid p3_guid("11DF1B8C-0DEE-4687-80D7-E74B520ACBB4");
-   static pool::Guid p2_guid("9AD4889D-C8EB-4F3B-9920-D37FF092CAB6");
-   static pool::Guid p1_guid("9998C282-403B-4EA5-A795-C8C9BA9909C3");
+   static const pool::Guid p3_guid("11DF1B8C-0DEE-4687-80D7-E74B520ACBB4");
+   static const pool::Guid p2_guid("9AD4889D-C8EB-4F3B-9920-D37FF092CAB6");
+   static const pool::Guid p1_guid("9998C282-403B-4EA5-A795-C8C9BA9909C3");
    if (compareClassGuid(p3_guid)) {
       // using unique_ptr ensures deletion of the persistent object
       std::unique_ptr<EventStreamInfo_p3> esi_p3(poolReadObject<EventStreamInfo_p3>());
diff --git a/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx b/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx
index 2780dc12bf0e..3bfdc89587f8 100755
--- a/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx
+++ b/Event/EventAthenaPool/src/MergedEventInfoCnv.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
 */
 
 /**
@@ -12,29 +12,29 @@
 
 MergedEventInfo_PERS* MergedEventInfoCnv::createPersistent(MergedEventInfo* transObj) {
     MsgStream log(msgSvc(), "MergedEventInfoConverter" ); 
-	static MergedEventInfoCnv_p2  TPconv;
-    MergedEventInfo_PERS *persObj = TPconv.createPersistent( transObj, log );
+    static const MergedEventInfoCnv_p2  TPconv;
+    MergedEventInfo_PERS *persObj = TPconv.createPersistentConst( transObj, log );
     //log << MSG::DEBUG << "Success" << endmsg;
     return persObj; 
 }
     
 MergedEventInfo* MergedEventInfoCnv::createTransient() {
-   static pool::Guid   p2_guid("5B0C1A92-6836-4B3C-9EE6-5E69792A28B5");
-   static pool::Guid   p1_guid("9540DED6-51E8-48A3-8F86-05CB1D9CC812");
-   static pool::Guid   p0_guid("FA93B80D-82C7-4096-8A04-62885A679A6F");
+   static const pool::Guid   p2_guid("5B0C1A92-6836-4B3C-9EE6-5E69792A28B5");
+   static const pool::Guid   p1_guid("9540DED6-51E8-48A3-8F86-05CB1D9CC812");
+   static const pool::Guid   p0_guid("FA93B80D-82C7-4096-8A04-62885A679A6F");
    if( compareClassGuid(p2_guid) ) {
       std::unique_ptr< MergedEventInfo_p2 > col_vect( poolReadObject< MergedEventInfo_p2 >() );
       MsgStream log(msgSvc(), "MergedEventInfoConverter" );
       //log << MSG::DEBUG << "Reading MergedEventInfo_p2" << endmsg; 
-      static MergedEventInfoCnv_p2   TPconverter;
-      return TPconverter.createTransient( col_vect.get(), log );
+      static const MergedEventInfoCnv_p2   TPconverter;
+      return TPconverter.createTransientConst( col_vect.get(), log );
    } else 
    if( compareClassGuid(p1_guid) ) {
       std::unique_ptr< MergedEventInfo_p1 > col_vect( poolReadObject< MergedEventInfo_p1 >() );
       MsgStream log(msgSvc(), "MergedEventInfoConverter" );
       //log << MSG::DEBUG << "Reading MergedEventInfo_p1" << endmsg; 
-	  static MergedEventInfoCnv_p1   TPconverter;
-      return TPconverter.createTransient( col_vect.get(), log );
+      static const MergedEventInfoCnv_p1   TPconverter;
+      return TPconverter.createTransientConst( col_vect.get(), log );
    }
    else if( compareClassGuid(p0_guid) ) {
       // regular object from before TP separation, just return it
diff --git a/Event/EventAthenaPool/src/MergedEventInfoCnv.h b/Event/EventAthenaPool/src/MergedEventInfoCnv.h
index 2ca49a1ea56a..b3c7dfe89fe9 100644
--- a/Event/EventAthenaPool/src/MergedEventInfoCnv.h
+++ b/Event/EventAthenaPool/src/MergedEventInfoCnv.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
 */
 
 /** 
diff --git a/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx b/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx
index 223805e46421..07a678a7be63 100755
--- a/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx
+++ b/Event/EventAthenaPool/src/PileUpEventInfoCnv.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
 */
 
 /**
@@ -13,58 +13,58 @@
 
 PileUpEventInfo_PERS* PileUpEventInfoCnv::createPersistent(PileUpEventInfo* transObj) {
     MsgStream log(msgSvc(), "PileUpEventInfoConverter" ); 
-    static PileUpEventInfoCnv_p5   TPconverter;
-    PileUpEventInfo_PERS *persObj = TPconverter.createPersistent( transObj, log );
+    static const PileUpEventInfoCnv_p5   TPconverter;
+    PileUpEventInfo_PERS *persObj = TPconverter.createPersistentConst( transObj, log );
     //log << MSG::DEBUG << "Success" << endmsg;
     return persObj; 
 }
     
 PileUpEventInfo* PileUpEventInfoCnv::createTransient() {
-   static pool::Guid   p5_guid("F53A1735-F61A-4CA4-B25F-DB0E277E2DDC");
-   static pool::Guid   p4_guid("7D72CE05-E814-4A70-B3B2-B54B05069103");
-   static pool::Guid   p3_guid("32A54198-BCDF-0AB5-DC0B-542CAE9866C2");
-   static pool::Guid   p2_guid("C2A54FC3-759C-4F01-AF7E-668D9198E10F");
-   static pool::Guid   p1_guid("1A399605-8E31-4150-B766-2049FD689485");
-   static pool::Guid   p0_guid("6A58157B-6B6E-430F-A72A-EAAA4BDC4AE2");
+   static const pool::Guid   p5_guid("F53A1735-F61A-4CA4-B25F-DB0E277E2DDC");
+   static const pool::Guid   p4_guid("7D72CE05-E814-4A70-B3B2-B54B05069103");
+   static const pool::Guid   p3_guid("32A54198-BCDF-0AB5-DC0B-542CAE9866C2");
+   static const pool::Guid   p2_guid("C2A54FC3-759C-4F01-AF7E-668D9198E10F");
+   static const pool::Guid   p1_guid("1A399605-8E31-4150-B766-2049FD689485");
+   static const pool::Guid   p0_guid("6A58157B-6B6E-430F-A72A-EAAA4BDC4AE2");
    if( compareClassGuid(p5_guid) ) {
       // using unique_ptr ensures deletion of the persistent object
       std::unique_ptr< PileUpEventInfo_p5 > col_vect( poolReadObject< PileUpEventInfo_p5 >() );
       MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
       //log << MSG::DEBUG << "Reading PileUpEventInfo_p5" << endmsg; 
-	  static PileUpEventInfoCnv_p5   TPconverter;
-      return TPconverter.createTransient( col_vect.get(), log );
+      static const PileUpEventInfoCnv_p5   TPconverter;
+      return TPconverter.createTransientConst( col_vect.get(), log );
    }	
    else if( compareClassGuid(p4_guid) ) {
       // using unique_ptr ensures deletion of the persistent object
       std::unique_ptr< PileUpEventInfo_p4 > col_vect( poolReadObject< PileUpEventInfo_p4 >() );
       MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
       //log << MSG::DEBUG << "Reading PileUpEventInfo_p4" << endmsg; 
-	  static PileUpEventInfoCnv_p4   TPconverter;
-      return TPconverter.createTransient( col_vect.get(), log );
+      static const PileUpEventInfoCnv_p4   TPconverter;
+      return TPconverter.createTransientConst( col_vect.get(), log );
    }	
   if( compareClassGuid(p3_guid) ) {
       // using unique_ptr ensures deletion of the persistent object
       std::unique_ptr< PileUpEventInfo_p3 > col_vect( poolReadObject< PileUpEventInfo_p3 >() );
       MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
       //log << MSG::DEBUG << "Reading PileUpEventInfo_p3" << endmsg; 
-      static PileUpEventInfoCnv_p3   TPconverter;
-      return TPconverter.createTransient( col_vect.get(), log );
+      static const PileUpEventInfoCnv_p3   TPconverter;
+      return TPconverter.createTransientConst( col_vect.get(), log );
    }
    else if( compareClassGuid(p2_guid) ) {
       // using unique_ptr ensures deletion of the persistent object
       std::unique_ptr< PileUpEventInfo_p2 > col_vect( poolReadObject< PileUpEventInfo_p2 >() );
       MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
       //log << MSG::DEBUG << "Reading PileUpEventInfo_p2" << endmsg; 
-	  static PileUpEventInfoCnv_p2   TPconverter;
-      return TPconverter.createTransient( col_vect.get(), log );
+      static const PileUpEventInfoCnv_p2   TPconverter;
+      return TPconverter.createTransientConst( col_vect.get(), log );
    }
    else if( compareClassGuid(p1_guid) ) {
       // using unique_ptr ensures deletion of the persistent object
       std::unique_ptr< PileUpEventInfo_p1 > col_vect( poolReadObject< PileUpEventInfo_p1 >() );
       MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
       //log << MSG::DEBUG << "Reading PileUpEventInfo_p1" << endmsg; 
-	  static PileUpEventInfoCnv_p1   TPconverter;
-      return TPconverter.createTransient( col_vect.get(), log );
+      static const PileUpEventInfoCnv_p1   TPconverter;
+      return TPconverter.createTransientConst( col_vect.get(), log );
    }
    else if( compareClassGuid(p0_guid) ) {
       // regular object from before TP separation, just return it
-- 
GitLab


From f91af7a1cd55122046f468983c9cb9219d7c172a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 15 Jul 2021 19:57:05 -0400
Subject: [PATCH 007/347] VP1PRDSystems: Fix cppcheck warnings.

Fix cppcheck warnings.
---
 .../VP1PRDSystems/src/PRDHandleBase.cxx        |  4 ++--
 .../VP1PRDSystems/src/PRDHandle_CSC.cxx        | 18 ++++++++----------
 .../VP1PRDSystems/src/PRDHandle_CSC_Strip.cxx  |  4 ++--
 .../VP1PRDSystems/src/PRDHandle_Pixel.cxx      | 10 ++++------
 .../VP1PRDSystems/src/PRDHandle_RPC.cxx        | 10 ++++------
 .../VP1PRDSystems/src/PRDHandle_SCT.cxx        | 10 ++++------
 .../VP1PRDSystems/src/PRDHandle_TGC.cxx        | 10 ++++------
 7 files changed, 28 insertions(+), 38 deletions(-)

diff --git a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandleBase.cxx b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandleBase.cxx
index 51c4942c7c5d..f016200aac10 100644
--- a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandleBase.cxx
+++ b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandleBase.cxx
@@ -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
 */
 
 #include "VP1PRDSystems/PRDHandleBase.h"
@@ -289,7 +289,7 @@ Amg::Vector3D PRDHandleBase::Imp::positionPRD(const Trk::PrepRawData* prd)
 {
   if (!prd)
     return Amg::Vector3D(0,0,0);
-  if (!prd||!prd->detectorElement())
+  if (!prd->detectorElement())
     return Amg::Vector3D(0.0,0.0,0.0);
   const Trk::Surface& theSurface = prd->detectorElement()->surface(prd->identify());
 
diff --git a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_CSC.cxx b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_CSC.cxx
index 13e2ae34afff..18301bb5ac1b 100644
--- a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_CSC.cxx
+++ b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_CSC.cxx
@@ -98,16 +98,14 @@ void PRDHandle_CSC::buildShapes(SoNode*&shape_simple, SoNode*&shape_detailed)
     transparent->transparency.setValue(0.5);
     rdos->addChild( transparent );
     Amg::Vector2D localposOLD = *localposHIT;
-    std::vector<Identifier>::const_iterator st = rdolist.begin();
-    std::vector<Identifier>::const_iterator en = rdolist.end();
-    for( std::vector<Identifier>::const_iterator it = st; it!=en; it++)
+    for (const Identifier& rdo_id : rdolist)
     {
-      if (*it == id )
+      if (rdo_id == id )
         continue;
-      const Amg::Vector3D& globalposRDO = m_csc->detectorElement()->stripPos( *it );
+      const Amg::Vector3D& globalposRDO = m_csc->detectorElement()->stripPos( rdo_id );
 
-      //      const Amg::Vector2D * localposRDO = m_csc->detectorElement()->surface( *it ).globalToLocal(globalposRDO,tolerance);
-      std::optional<Amg::Vector2D>  localposRDO = m_csc->detectorElement()->surface( *it ).Trk::Surface::globalToLocal(globalposRDO,tolerance);
+      //      const Amg::Vector2D * localposRDO = m_csc->detectorElement()->surface( rdo_id ).globalToLocal(globalposRDO,tolerance);
+      std::optional<Amg::Vector2D>  localposRDO = m_csc->detectorElement()->surface( rdo_id ).Trk::Surface::globalToLocal(globalposRDO,tolerance);
 
       if (!localposRDO)
       {
@@ -118,11 +116,11 @@ void PRDHandle_CSC::buildShapes(SoNode*&shape_simple, SoNode*&shape_detailed)
       SoTranslation * localtrans = new SoTranslation;
       localtrans->translation.setValue((*localposRDO)[Trk::locX]-localposOLD[Trk::locX],(*localposRDO)[Trk::locY]-localposOLD[Trk::locY],0);
       rdos->addChild(localtrans);
-      double striplengthRDO = m_csc->detectorElement()->stripLength( *it );
+      double striplengthRDO = m_csc->detectorElement()->stripLength( rdo_id );
 
       rdos->addChild(common()->nodeManager()->getShapeNode_Strip(striplengthRDO,
-                     m_csc->detectorElement()->cathodeReadoutPitch(idhelper->chamberLayer( *it ),
-                     idhelper->measuresPhi( *it )), stripHeightRDOs));
+                     m_csc->detectorElement()->cathodeReadoutPitch(idhelper->chamberLayer( rdo_id ),
+                     idhelper->measuresPhi( rdo_id )), stripHeightRDOs));
 
       localposOLD = *localposRDO;
     }
diff --git a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_CSC_Strip.cxx b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_CSC_Strip.cxx
index aaf74c3e3cc9..287af2a7475b 100644
--- a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_CSC_Strip.cxx
+++ b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_CSC_Strip.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 "VP1PRDSystems/PRDHandle_CSC_Strip.h"
@@ -84,7 +84,7 @@ void PRDHandle_CSC_Strip::buildShapes(SoNode*&shape_simple, SoNode*&shape_detail
     localtrans->translation.setValue(0.0,ypos,0.0);
     rdos->addChild(localtrans);
 
-    for( std::vector<float>::const_iterator it = st; it!=en; it++, i++){
+    for( std::vector<float>::const_iterator it = st; it!=en; ++it, ++i){
             // std::cout<<"Charge: "<<i<<" \ty="<<ypos<<" has charge=:"<<*it<<std::endl;  
       float charge = std::max(1.0f,(*it)); // keep charges positive until I understand if it is okay to be -ve
       const double stripHeightCharge = (1.0 + 4*sqrt(charge/maxCharge))*CLHEP::mm;
diff --git a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_Pixel.cxx b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_Pixel.cxx
index c798244c83ad..7656ce7ff18c 100644
--- a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_Pixel.cxx
+++ b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_Pixel.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 "VP1PRDSystems/PRDHandle_Pixel.h"
@@ -80,14 +80,12 @@ void PRDHandle_Pixel::buildShapes(SoNode*&shape_simple, SoNode*&shape_detailed)
     transparent->transparency.setValue(0.5);
     rdos->addChild( transparent );
     Amg::Vector2D localposOLD = localposHIT;
-    std::vector<Identifier>::const_iterator st = rdolist.begin();
-    std::vector<Identifier>::const_iterator en = rdolist.end();
-    for( std::vector<Identifier>::const_iterator it = st; it!=en; it++)
+    for (const Identifier& rdo_id : rdolist)
     {
-      if (*it == m_cluster->identify() )
+      if (rdo_id == m_cluster->identify() )
         continue;
 
-      const Amg::Vector2D localposRDO = m_cluster->detectorElement()->rawLocalPositionOfCell(*it); // Lorentz shift is not corrected because this class cannot use SiLorentzAngleTool
+      const Amg::Vector2D localposRDO = m_cluster->detectorElement()->rawLocalPositionOfCell(rdo_id); // Lorentz shift is not corrected because this class cannot use SiLorentzAngleTool
 
       SoTranslation * localtrans = new SoTranslation;
       localtrans->translation.setValue(localposRDO[Trk::locX]-localposOLD[Trk::locX],
diff --git a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_RPC.cxx b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_RPC.cxx
index 919f1a3df956..7f590d8ce3eb 100644
--- a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_RPC.cxx
+++ b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_RPC.cxx
@@ -83,14 +83,12 @@ void PRDHandle_RPC::buildShapes(SoNode*&shape_simple, SoNode*&shape_detailed)
     transparent->transparency.setValue(0.5);
     rdos->addChild( transparent );
     Amg::Vector2D localposOLD = *localposHIT;
-    std::vector<Identifier>::const_iterator st = rdolist.begin();
-    std::vector<Identifier>::const_iterator en = rdolist.end();
-    for( std::vector<Identifier>::const_iterator it = st; it!=en; it++)
+    for (const Identifier& rdo_id : rdolist)
     {
-      if (*it == id )
+      if (rdo_id == id )
         continue;
-      const Amg::Vector3D& globalposRDO = m_rpc->detectorElement()->stripPos( *it );
-      std::optional<Amg::Vector2D> localposRDO = m_rpc->detectorElement()->surface( *it ).Trk::Surface::globalToLocal(globalposRDO,tolerance); 
+      const Amg::Vector3D& globalposRDO = m_rpc->detectorElement()->stripPos( rdo_id );
+      std::optional<Amg::Vector2D> localposRDO = m_rpc->detectorElement()->surface( rdo_id ).Trk::Surface::globalToLocal(globalposRDO,tolerance); 
       if (!localposRDO)
       {
         VP1Msg::message("Warning: Local wire position is NULL");
diff --git a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_SCT.cxx b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_SCT.cxx
index b7b5c3d8a8d9..b1cc2a1f25db 100644
--- a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_SCT.cxx
+++ b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_SCT.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 "VP1PRDSystems/PRDHandle_SCT.h"
@@ -68,14 +68,12 @@ void PRDHandle_SCT::buildShapes(SoNode*&shape_simple, SoNode*&shape_detailed)
     transparent->transparency.setValue(0.5);
     rdos->addChild( transparent );
     Amg::Vector2D localposOLD = localposHIT;
-    std::vector<Identifier>::const_iterator st = rdolist.begin();
-    std::vector<Identifier>::const_iterator en = rdolist.end();
-    for( std::vector<Identifier>::const_iterator it = st; it!=en; it++)
+    for (const Identifier& rdo_id : rdolist)
     {
-      if (*it == m_cluster->identify() )
+      if (rdo_id == m_cluster->identify() )
         continue;
 
-      const Amg::Vector2D& localposRDO = m_cluster->detectorElement()->rawLocalPositionOfCell(*it); // Lorentz shift is not corrected because this class cannot use SiLorentzAngleTool
+      const Amg::Vector2D& localposRDO = m_cluster->detectorElement()->rawLocalPositionOfCell(rdo_id); // Lorentz shift is not corrected because this class cannot use SiLorentzAngleTool
 
       SoTranslation * localtrans = new SoTranslation;
       localtrans->translation.setValue(localposRDO[Trk::locX]-localposOLD[Trk::locX],localposRDO[Trk::locY]-localposOLD[Trk::locY],0);
diff --git a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_TGC.cxx b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_TGC.cxx
index d39f41e90d75..8ac3ced79013 100644
--- a/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_TGC.cxx
+++ b/graphics/VP1/VP1Systems/VP1PRDSystems/src/PRDHandle_TGC.cxx
@@ -176,14 +176,12 @@ void PRDHandle_TGC::buildShapes(SoNode*&shape_simple, SoNode*&shape_detailed)
       transparent->transparency.setValue(0.5);
       rdos->addChild( transparent );
       Amg::Vector2D localposOLD = *localposHIT;
-      std::vector<Identifier>::const_iterator st = rdolist.begin();
-      std::vector<Identifier>::const_iterator en = rdolist.end();
-      for( std::vector<Identifier>::const_iterator it = st; it!=en; it++)
+      for (const Identifier& rdo_id : rdolist)
       {
-        if (*it == id )
+        if (rdo_id == id )
           continue;
-        const Amg::Vector3D& globalposRDO = m_tgc->detectorElement()->channelPos( *it );
-        std::optional<Amg::Vector2D> localposRDO = m_tgc->detectorElement()->surface( *it ).Trk::Surface::globalToLocal(globalposRDO,tolerance);
+        const Amg::Vector3D& globalposRDO = m_tgc->detectorElement()->channelPos( rdo_id );
+        std::optional<Amg::Vector2D> localposRDO = m_tgc->detectorElement()->surface( rdo_id ).Trk::Surface::globalToLocal(globalposRDO,tolerance);
         if (!localposRDO)
         {
           VP1Msg::message("Warning: Local wire position is NULL");
-- 
GitLab


From 81dfdea9254cb09346346d935a0bff3f68a820ba Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 31 Aug 2021 17:29:56 -0400
Subject: [PATCH 008/347] AmdcAth: Fix cppcheck warnings.

Fix cppcheck warnings.
---
 .../Amdcsimrec/AmdcAth/src/AmdcsimrecAthenaSvc.cxx         | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/MuonSpectrometer/Amdcsimrec/AmdcAth/src/AmdcsimrecAthenaSvc.cxx b/MuonSpectrometer/Amdcsimrec/AmdcAth/src/AmdcsimrecAthenaSvc.cxx
index 57ee88cbbe69..8f0d8d0d7a02 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcAth/src/AmdcsimrecAthenaSvc.cxx
+++ b/MuonSpectrometer/Amdcsimrec/AmdcAth/src/AmdcsimrecAthenaSvc.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 "StoreGate/StoreGateSvc.h"
@@ -57,11 +57,6 @@ AmdcsimrecAthenaSvc::AmdcsimrecAthenaSvc(const std::string& name,ISvcLocator* sv
    p_AmdcBlineStoreExternal = new AmdcBlineStore;
    p_AmdcIlineStoreExternal = new AmdcIlineStore ;
 
-   m_LocationOfTheFile = "" ;
-
-   m_AmdcString = "" ;
-   m_AgddString = "" ;
-
    m_AmdcABlinesStamp = 1;
    
    m_AGDD2GeoSwitchesStamp = -1 ;
-- 
GitLab


From 4a906c5d41e9889feb7bbd3ea975a5877ccf8f2d Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 7 Sep 2021 16:49:25 +0200
Subject: [PATCH 009/347] ISF_Geant4CommonTools: Fix clang warning.

Missing override keyword.
---
 .../ISF_Geant4/ISF_Geant4CommonTools/src/EntryLayerToolMT.h   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/src/EntryLayerToolMT.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/src/EntryLayerToolMT.h
index 94f76af8f951..c4661934131c 100644
--- a/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/src/EntryLayerToolMT.h
+++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/src/EntryLayerToolMT.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 ISF_GEANT4COMMONTOOLS_ENTRYLAYERTOOLMT_H
@@ -67,7 +67,7 @@ namespace ISF {
     /** Register the TrackRecordCollection pointer for a layer */
     virtual StatusCode registerTrackRecordCollection(TrackRecordCollection* collection, EntryLayer layer) override final;
 
-    virtual void setupEvent() { return; }
+    virtual void setupEvent() override { return; }
 
   private:
     /** GeoIDSvc will be used to determine the entry layer surface, the particle is on */
-- 
GitLab


From 2e64b6a4a315ec39ad5d15b74735beb7e36d6206 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 27 Aug 2021 14:11:46 -0400
Subject: [PATCH 010/347] CxxUtils: Add ATH_MEMBER_REQUIRES.

Add ATH_MEMBER_REQUIRES/ATH_MEMBER_REQUIRES_DEF to concepts.h.
---
 Control/CxxUtils/CxxUtils/concepts.h | 38 +++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/Control/CxxUtils/CxxUtils/concepts.h b/Control/CxxUtils/CxxUtils/concepts.h
index 2aa50223e22a..b32d1850fa0a 100644
--- a/Control/CxxUtils/CxxUtils/concepts.h
+++ b/Control/CxxUtils/CxxUtils/concepts.h
@@ -1,6 +1,6 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 /*
- * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
+ * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
  */
 /**
  * @file CxxUtils/concepts.h
@@ -18,6 +18,21 @@
  *
  * The body of the ATH_REQUIRES will be hidden for compilers
  * that don't support concepts.
+ *
+ * ATH_MEMBER_REQUIRES can be used to selectively enable a member function.
+ * Example:
+ *@code
+ *  template <class T>
+ *  class C { ...
+ *
+ *    ATH_MEMBER_REQUIRES(std::is_same_v<T,int>, double) foo (double x) { ... }
+ @endcode
+ * declares a function @c foo returning @c double that is enabled
+ * only if @c T is an @c int.   If you have a definition separate
+ * from the declaration, then use ATH_MEMBER_REQUIRES_DEF in the definition
+ * instead.
+ *
+ * Will use a @c requires clause with C++20 and @c enable_if otherwise.
  */
 
 
@@ -25,15 +40,36 @@
 #define CXXUTILS_CONCEPTS_H
 
 
+#include <type_traits>
+
+
 #ifdef __cpp_concepts
 
 #include <concepts>
 #define ATH_REQUIRES(...) requires __VA_ARGS__
 
+#define ATH_MEMBER_REQUIRES(CONDITION, RETTYPE) \
+  template <bool = true> \
+  requires (CONDITION)   \
+  RETTYPE
+
+#define ATH_MEMBER_REQUIRES_DEF(CONDITION, RETTYPE) \
+  template <bool> \
+  requires (CONDITION)   \
+  RETTYPE
+
 #else
 
 #define ATH_REQUIRES(...)
 
+#define ATH_MEMBER_REQUIRES(CONDITION, RETTYPE) \
+  template <bool Enable = true> \
+  std::enable_if_t<Enable && (CONDITION), RETTYPE>
+
+#define ATH_MEMBER_REQUIRES_DEF(CONDITION, RETTYPE) \
+  template <bool Enable> \
+  std::enable_if_t<Enable && (CONDITION), RETTYPE>
+
 #endif
 
 
-- 
GitLab


From 225cf434aa4c3f1f2322493f43a77bc64a7399a6 Mon Sep 17 00:00:00 2001
From: Sergi Rodriguez Bosca <sergi.rodriguez@cern.ch>
Date: Wed, 8 Sep 2021 10:07:58 +0200
Subject: [PATCH 011/347] Changing eFEX FindTower function and eTowerContainer
 map

---
 .../L1CaloFEXSim/eTowerContainer.h            |  4 ++-
 .../L1CaloFEXSim/src/eTowerContainer.cxx      | 28 +++++++++----------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eTowerContainer.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eTowerContainer.h
index 384c9bbc27c7..abfcc899678a 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eTowerContainer.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eTowerContainer.h
@@ -27,6 +27,8 @@
 #include "CxxUtils/CachedValue.h"
 #include "AthLinks/tools/findInContainer.h"
 
+#include <unordered_map>
+
 namespace LVL1 {
 
 class eTowerContainer : public DataVector<LVL1::eTower>
@@ -74,7 +76,7 @@ class eTowerContainer : public DataVector<LVL1::eTower>
   IMessageSvc* msgSvc() const;
 
   //* @brief Keeps track of the towerID of each eTower associated to each MAP index *.
-  std::map<int,int> m_map_towerID_containerIndex;
+  std::unordered_map<int,int> m_map_towerID_containerIndex;
 };
 
 }
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eTowerContainer.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eTowerContainer.cxx
index fa33867d63a1..e67927a06de7 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eTowerContainer.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eTowerContainer.cxx
@@ -29,24 +29,24 @@ void eTowerContainer::print() const {
 }
 
 
-const LVL1::eTower * eTowerContainer::findTower(int towerID) const
-{
-  int container_index = -1;
-  container_index = m_map_towerID_containerIndex.find(towerID)->second;
-  if(container_index >= 0){
+const LVL1::eTower * eTowerContainer::findTower(int towerID) const{
+    const auto it = m_map_towerID_containerIndex.find(towerID);
+
+    const int container_index = it->second;
+    if (container_index < 0) {
+        return nullptr;
+    }
     return (*this)[container_index];
-  }
-  return nullptr;
 }
 
-LVL1::eTower * eTowerContainer::findTower(int towerID)
-{
-  int container_index = -1;
-  container_index = m_map_towerID_containerIndex.find(towerID)->second;
-  if(container_index >= 0){
+LVL1::eTower * eTowerContainer::findTower(int towerID){
+    const auto it = m_map_towerID_containerIndex.find(towerID);
+
+    const int container_index = it->second;
+    if (container_index < 0) {
+        return nullptr;
+    }
     return (*this)[container_index];
-  }
-  return nullptr;
 }
 
 void eTowerContainer::clearContainerMap()
-- 
GitLab


From 8dc37617a05ab171e5fe6c2a5d136b0faeebce9f Mon Sep 17 00:00:00 2001
From: Teng Jian Khoo <teng.jian.khoo@cern.ch>
Date: Wed, 8 Sep 2021 10:22:01 +0200
Subject: [PATCH 012/347] Correct Jpsiee mass cut with generic topo selector

---
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 32 +++++++++----------
 .../share/ref_v1Dev_decodeBS_build.ref        | 32 +++++++++----------
 .../python/HLTMenuConfig/Menu/LS2_v1.py       | 32 +++++++++----------
 .../HLTMenuConfig/Menu/SignatureDicts.py      |  2 +-
 4 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 513686981c28..897758612a16 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -1624,17 +1624,17 @@ HLT_e140_lhloose_noringer_L1EM22VHI:
     1: 31
     2: 3
     3: 3
-HLT_e14_lhtight_e4_etcut_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e14_lhtight_e4_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
 HLT_e14_lhtight_e4_etcut_Jpsiee_L1JPSI-1M5-EM12:
   eventCount: 0
-HLT_e14_lhtight_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e14_lhtight_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
-HLT_e14_lhtight_noringer_e4_etcut_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e14_lhtight_noringer_e4_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
 HLT_e14_lhtight_noringer_e4_etcut_Jpsiee_L1JPSI-1M5-EM12:
   eventCount: 0
-HLT_e14_lhtight_noringer_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e14_lhtight_noringer_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
 HLT_e15_lhvloose_L1EM10VH:
   eventCount: 7
@@ -3365,29 +3365,29 @@ HLT_e5_idperf_tight_L1EM3:
     2: 24
     3: 22
     4: 22
-HLT_e5_lhtight_e14_etcut_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e5_lhtight_e14_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
 HLT_e5_lhtight_e14_etcut_Jpsiee_L1JPSI-1M5-EM12:
   eventCount: 0
-HLT_e5_lhtight_e14_etcut_probe_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e5_lhtight_e14_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
-HLT_e5_lhtight_e9_etcut_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e5_lhtight_e9_etcut_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e5_lhtight_e9_etcut_Jpsiee_L1JPSI-1M5-EM7:
   eventCount: 0
-HLT_e5_lhtight_e9_etcut_probe_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e5_lhtight_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
-HLT_e5_lhtight_noringer_e14_etcut_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e5_lhtight_noringer_e14_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
 HLT_e5_lhtight_noringer_e14_etcut_Jpsiee_L1JPSI-1M5-EM12:
   eventCount: 0
-HLT_e5_lhtight_noringer_e14_etcut_probe_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e5_lhtight_noringer_e14_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
-HLT_e5_lhtight_noringer_e9_etcut_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e5_lhtight_noringer_e9_etcut_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e5_lhtight_noringer_e9_etcut_Jpsiee_L1JPSI-1M5-EM7:
   eventCount: 0
-HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e5_lhvloose_j70_0eta320_j50_0eta490_j0_DJMASS1000j50_xe50_tcpufit_L1MJJ-500-NFF:
   eventCount: 0
@@ -3571,19 +3571,19 @@ HLT_e80_lhvloose_L1EM22VHI:
     2: 1
     3: 1
     4: 1
-HLT_e9_lhtight_e4_etcut_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e9_lhtight_e4_etcut_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e9_lhtight_e4_etcut_Jpsiee_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e9_lhtight_e4_etcut_L1JPSI-1M5-EM7:
   eventCount: 0
-HLT_e9_lhtight_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e9_lhtight_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
-HLT_e9_lhtight_noringer_e4_etcut_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e9_lhtight_noringer_e4_etcut_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e9_lhtight_noringer_e4_etcut_Jpsiee_L1JPSI-1M5-EM7:
   eventCount: 0
-HLT_e9_lhtight_noringer_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e9_lhtight_noringer_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e9_lhvloose_mu20_mu8noL1_L1MU14FCH:
   eventCount: 0
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 2734885ae3ce..7a1c496380da 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -600,7 +600,7 @@ HLT_e140_lhloose_L1eEM22M:
   eventCount: 0
 HLT_e140_lhloose_noringer_L1EM22VHI:
   eventCount: 0
-HLT_e14_lhtight_e4_etcut_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e14_lhtight_e4_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
   stepFeatures:
     0: 6
@@ -608,9 +608,9 @@ HLT_e14_lhtight_e4_etcut_Jpsiee_L1JPSI-1M5-EM12:
   eventCount: 0
   stepFeatures:
     0: 6
-HLT_e14_lhtight_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e14_lhtight_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
-HLT_e14_lhtight_noringer_e4_etcut_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e14_lhtight_noringer_e4_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
   stepFeatures:
     0: 6
@@ -618,7 +618,7 @@ HLT_e14_lhtight_noringer_e4_etcut_Jpsiee_L1JPSI-1M5-EM12:
   eventCount: 0
   stepFeatures:
     0: 6
-HLT_e14_lhtight_noringer_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e14_lhtight_noringer_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
 HLT_e15_lhvloose_L1EM10VH:
   eventCount: 0
@@ -950,7 +950,7 @@ HLT_e5_idperf_tight_L1EM3:
     2: 14
     3: 13
     4: 13
-HLT_e5_lhtight_e14_etcut_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e5_lhtight_e14_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
   stepCounts:
     0: 1
@@ -964,13 +964,13 @@ HLT_e5_lhtight_e14_etcut_Jpsiee_L1JPSI-1M5-EM12:
   stepFeatures:
     0: 2
     1: 7
-HLT_e5_lhtight_e14_etcut_probe_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e5_lhtight_e14_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
   stepCounts:
     0: 1
   stepFeatures:
     0: 1
-HLT_e5_lhtight_e9_etcut_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e5_lhtight_e9_etcut_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
   stepCounts:
     0: 1
@@ -984,7 +984,7 @@ HLT_e5_lhtight_e9_etcut_Jpsiee_L1JPSI-1M5-EM7:
   stepFeatures:
     0: 5
     1: 7
-HLT_e5_lhtight_e9_etcut_probe_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e5_lhtight_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
   stepCounts:
     0: 2
@@ -996,7 +996,7 @@ HLT_e5_lhtight_e9_etcut_probe_1invmAB3_L1JPSI-1M5-EM7:
     1: 6
     2: 1
     3: 1
-HLT_e5_lhtight_noringer_e14_etcut_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e5_lhtight_noringer_e14_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
   stepCounts:
     0: 1
@@ -1020,7 +1020,7 @@ HLT_e5_lhtight_noringer_e14_etcut_Jpsiee_L1JPSI-1M5-EM12:
     1: 11
     2: 2
     3: 2
-HLT_e5_lhtight_noringer_e14_etcut_probe_1invmAB3_L1JPSI-1M5-EM12:
+HLT_e5_lhtight_noringer_e14_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
   stepCounts:
     0: 1
@@ -1032,7 +1032,7 @@ HLT_e5_lhtight_noringer_e14_etcut_probe_1invmAB3_L1JPSI-1M5-EM12:
     1: 4
     2: 1
     3: 1
-HLT_e5_lhtight_noringer_e9_etcut_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e5_lhtight_noringer_e9_etcut_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
   stepCounts:
     0: 1
@@ -1056,7 +1056,7 @@ HLT_e5_lhtight_noringer_e9_etcut_Jpsiee_L1JPSI-1M5-EM7:
     1: 11
     2: 4
     3: 2
-HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
   stepCounts:
     0: 2
@@ -1096,7 +1096,7 @@ HLT_e7_lhmedium_mu24_L1MU14FCH:
   eventCount: 0
 HLT_e80_lhvloose_L1EM22VHI:
   eventCount: 0
-HLT_e9_lhtight_e4_etcut_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e9_lhtight_e4_etcut_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
   stepFeatures:
     0: 11
@@ -1108,9 +1108,9 @@ HLT_e9_lhtight_e4_etcut_L1JPSI-1M5-EM7:
   eventCount: 0
   stepFeatures:
     0: 11
-HLT_e9_lhtight_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e9_lhtight_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
-HLT_e9_lhtight_noringer_e4_etcut_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e9_lhtight_noringer_e4_etcut_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
   stepFeatures:
     0: 11
@@ -1118,7 +1118,7 @@ HLT_e9_lhtight_noringer_e4_etcut_Jpsiee_L1JPSI-1M5-EM7:
   eventCount: 0
   stepFeatures:
     0: 11
-HLT_e9_lhtight_noringer_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM7:
+HLT_e9_lhtight_noringer_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e9_lhvloose_mu20_mu8noL1_L1MU14FCH:
   eventCount: 0
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index ad6d04068a65..0f20464dc93b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -303,23 +303,23 @@ def setupMenu():
         ChainProp(name='HLT_e26_lhtight_e15_etcut_probe_50invmAB130_L1EM22VHI', l1SeedThresholds=['EM22VHI','EM7'], groups=TagAndProbeLegGroup+SingleElectronGroup), 
         ChainProp(name='HLT_e26_lhtight_e15_etcut_50invmAB130_L1EM22VHI', l1SeedThresholds=['EM22VHI','EM7'], groups=MultiElectronGroup), 
         # Jpsiee
-        ChainProp(name='HLT_e9_lhtight_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM7', l1SeedThresholds=['EM7','EM3'], groups=SupportLegGroup+MultiElectronGroup), 
-        ChainProp(name='HLT_e5_lhtight_e9_etcut_probe_1invmAB3_L1JPSI-1M5-EM7', l1SeedThresholds=['EM3','EM7'], groups=SupportLegGroup+MultiElectronGroup), 
-        ChainProp(name='HLT_e14_lhtight_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM12', l1SeedThresholds=['EM12','EM3'], groups=SupportLegGroup+MultiElectronGroup), 
-        ChainProp(name='HLT_e5_lhtight_e14_etcut_probe_1invmAB3_L1JPSI-1M5-EM12', l1SeedThresholds=['EM3','EM12'], groups=SupportLegGroup+MultiElectronGroup), 
-        ChainProp(name='HLT_e9_lhtight_noringer_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM7', l1SeedThresholds=['EM7','EM3'], groups=SupportLegGroup+MultiElectronGroup), 
-        ChainProp(name='HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB3_L1JPSI-1M5-EM7', l1SeedThresholds=['EM3','EM7'], groups=SupportLegGroup+MultiElectronGroup), 
-        ChainProp(name='HLT_e14_lhtight_noringer_e4_etcut_probe_1invmAB3_L1JPSI-1M5-EM12', l1SeedThresholds=['EM12','EM3'], groups=SupportLegGroup+MultiElectronGroup), 
-        ChainProp(name='HLT_e5_lhtight_noringer_e14_etcut_probe_1invmAB3_L1JPSI-1M5-EM12', l1SeedThresholds=['EM3','EM12'], groups=SupportLegGroup+MultiElectronGroup), 
+        ChainProp(name='HLT_e9_lhtight_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM7', l1SeedThresholds=['EM7','EM3'], groups=SupportLegGroup+MultiElectronGroup),
+        ChainProp(name='HLT_e5_lhtight_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7', l1SeedThresholds=['EM3','EM7'], groups=SupportLegGroup+MultiElectronGroup),
+        ChainProp(name='HLT_e14_lhtight_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM12', l1SeedThresholds=['EM12','EM3'], groups=SupportLegGroup+MultiElectronGroup),
+        ChainProp(name='HLT_e5_lhtight_e14_etcut_probe_1invmAB5_L1JPSI-1M5-EM12', l1SeedThresholds=['EM3','EM12'], groups=SupportLegGroup+MultiElectronGroup),
+        ChainProp(name='HLT_e9_lhtight_noringer_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM7', l1SeedThresholds=['EM7','EM3'], groups=SupportLegGroup+MultiElectronGroup),
+        ChainProp(name='HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7', l1SeedThresholds=['EM3','EM7'], groups=SupportLegGroup+MultiElectronGroup),
+        ChainProp(name='HLT_e14_lhtight_noringer_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM12', l1SeedThresholds=['EM12','EM3'], groups=SupportLegGroup+MultiElectronGroup),
+        ChainProp(name='HLT_e5_lhtight_noringer_e14_etcut_probe_1invmAB5_L1JPSI-1M5-EM12', l1SeedThresholds=['EM3','EM12'], groups=SupportLegGroup+MultiElectronGroup),
         #
-        ChainProp(name='HLT_e9_lhtight_e4_etcut_1invmAB3_L1JPSI-1M5-EM7', l1SeedThresholds=['EM7','EM3'], groups=MultiElectronGroup), 
-        ChainProp(name='HLT_e5_lhtight_e9_etcut_1invmAB3_L1JPSI-1M5-EM7', l1SeedThresholds=['EM3','EM7'], groups=MultiElectronGroup), 
-        ChainProp(name='HLT_e14_lhtight_e4_etcut_1invmAB3_L1JPSI-1M5-EM12', l1SeedThresholds=['EM12','EM3'], groups=MultiElectronGroup), 
-        ChainProp(name='HLT_e5_lhtight_e14_etcut_1invmAB3_L1JPSI-1M5-EM12', l1SeedThresholds=['EM3','EM12'], groups=MultiElectronGroup), 
-        ChainProp(name='HLT_e9_lhtight_noringer_e4_etcut_1invmAB3_L1JPSI-1M5-EM7', l1SeedThresholds=['EM7','EM3'], groups=MultiElectronGroup), 
-        ChainProp(name='HLT_e5_lhtight_noringer_e9_etcut_1invmAB3_L1JPSI-1M5-EM7', l1SeedThresholds=['EM3','EM7'], groups=MultiElectronGroup), 
-        ChainProp(name='HLT_e14_lhtight_noringer_e4_etcut_1invmAB3_L1JPSI-1M5-EM12', l1SeedThresholds=['EM12','EM3'], groups=MultiElectronGroup), 
-        ChainProp(name='HLT_e5_lhtight_noringer_e14_etcut_1invmAB3_L1JPSI-1M5-EM12', l1SeedThresholds=['EM3','EM12'], groups=MultiElectronGroup), 
+        ChainProp(name='HLT_e9_lhtight_e4_etcut_1invmAB5_L1JPSI-1M5-EM7', l1SeedThresholds=['EM7','EM3'], groups=MultiElectronGroup),
+        ChainProp(name='HLT_e5_lhtight_e9_etcut_1invmAB5_L1JPSI-1M5-EM7', l1SeedThresholds=['EM3','EM7'], groups=MultiElectronGroup),
+        ChainProp(name='HLT_e14_lhtight_e4_etcut_1invmAB5_L1JPSI-1M5-EM12', l1SeedThresholds=['EM12','EM3'], groups=MultiElectronGroup),
+        ChainProp(name='HLT_e5_lhtight_e14_etcut_1invmAB5_L1JPSI-1M5-EM12', l1SeedThresholds=['EM3','EM12'], groups=MultiElectronGroup),
+        ChainProp(name='HLT_e9_lhtight_noringer_e4_etcut_1invmAB5_L1JPSI-1M5-EM7', l1SeedThresholds=['EM7','EM3'], groups=MultiElectronGroup),
+        ChainProp(name='HLT_e5_lhtight_noringer_e9_etcut_1invmAB5_L1JPSI-1M5-EM7', l1SeedThresholds=['EM3','EM7'], groups=MultiElectronGroup),
+        ChainProp(name='HLT_e14_lhtight_noringer_e4_etcut_1invmAB5_L1JPSI-1M5-EM12', l1SeedThresholds=['EM12','EM3'], groups=MultiElectronGroup),
+        ChainProp(name='HLT_e5_lhtight_noringer_e14_etcut_1invmAB5_L1JPSI-1M5-EM12', l1SeedThresholds=['EM3','EM12'], groups=MultiElectronGroup),
     ]
 
     TriggerFlags.METSlice.signatures = TriggerFlags.METSlice.signatures() + [
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index bcd95b2c7592..123e1efc5b28 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -1032,7 +1032,7 @@ UnconventionalTrackingChainParts_Default = {
 #==========================================================
 AllowedTopos_comb = [
     '03dRAB','03dRAB30','dRAB03','02dRAB','02dRAC','50invmAB','60invmAB','afpdijet','18dphiAB','18dphiAC','80mTAC',
-    '1invmAB3','50invmAB130', # Jpsiee, Zee/Zeg
+    '1invmAB5','50invmAB130', # Jpsiee, Zee/Zeg
     '25dphiAA','invmAA80', # Low-mass diphoton
     '10invmAA70', # Low-mass dimuon
     ]
-- 
GitLab


From 74cd3c11ad6f501e19077c54aa4fe7bedd585fd4 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Wed, 8 Sep 2021 10:40:26 +0200
Subject: [PATCH 013/347] suppress cppcheck warning in root script

---
 .../InDetCalibAlgs/TRT_CalibAlgs/share/CalibrateTRT.cpp       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/share/CalibrateTRT.cpp b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/share/CalibrateTRT.cpp
index e63fd451b01d..e8bf78f53fcc 100644
--- a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/share/CalibrateTRT.cpp
+++ b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/share/CalibrateTRT.cpp
@@ -35,12 +35,12 @@ int Simple2dHist(float minx, float maxx, int nbinsx, float miny, float maxy, int
   int binnoy=(nbinsy*((valuey-miny)/(maxy-miny)));
   return binnoy*nbinsx+binnox;
 }
-
+//cppcheck-suppress ctuOneDefinitionRuleViolation
 struct databundle{
   int det{}, lay{}, mod{}, brd{}, chp{}, stl{}, stw{}, sid{}, ievt{};
   float tres{}, weight{}, res{}, t{}, r{}, t0{}, x{}, y{}, z{}, rt0{};
 };
-
+//cppcheck-suppress ctuOneDefinitionRuleViolation
 struct caldata{
   int det{}, lay{}, mod{}, brd{}, chp{}, stl{}, stw{};
   int sid{}, nres{}, minntres{}, maxntres{}, minnres{}, maxnres{}, minnrt{}, maxnrt{}, t0fittype{};
-- 
GitLab


From bb048017bb005054e85cdbfeb9e28986bf7b877b Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Tue, 7 Sep 2021 14:58:17 +0200
Subject: [PATCH 014/347] Add RenameHitCollectionAlg

This Algorithm is used to rename Hit collections back to their original names in ReSimulation jobs.
It is used in the case that the current event does not need to be resimulated and so the original
HitCollections are still valid.
---
 .../ISF_Core/ISF_Algorithms/CMakeLists.txt    |   8 +-
 .../python/ISF_AlgorithmsConfig.py            |  79 +++++
 .../python/ISF_AlgorithmsConfigDb.py          |   1 +
 .../python/ISF_AlgorithmsConfigNew.py         |  88 ++++++
 .../src/RenameHitCollectionsAlg.cxx           | 155 ++++++++++
 .../src/RenameHitCollectionsAlg.h             | 277 ++++++++++++++++++
 .../src/components/ISF_Algorithms_entries.cxx |   2 +
 7 files changed, 606 insertions(+), 4 deletions(-)
 create mode 100644 Simulation/ISF/ISF_Core/ISF_Algorithms/src/RenameHitCollectionsAlg.cxx
 create mode 100644 Simulation/ISF/ISF_Core/ISF_Algorithms/src/RenameHitCollectionsAlg.h

diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt
index 771eaa0a0356..7036f3cc549c 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt
@@ -18,16 +18,16 @@ atlas_add_component( ISF_Algorithms
    INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
    LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} GaudiKernel
    AthenaBaseComps StoreGateLib AtlasDetDescr GeneratorObjects HepMC_InterfacesLib
-   ISF_Event ISF_InterfacesLib ISF_HepMC_Interfaces PmbCxxUtils InDetSimEvent LArSimEvent TileSimEvent
-   MuonSimEvent TrackRecordLib )
+   ISF_Event ISF_InterfacesLib ISF_HepMC_Interfaces PmbCxxUtils InDetSimEvent
+   CaloSimEvent LArSimEvent TileSimEvent MuonSimEvent TrackRecordLib RecEvent )
 
 atlas_add_test( CollectionMerger_test
    SOURCES test/CollectionMerger_test.cxx src/CollectionMerger.h
    src/CollectionMerger.cxx
    INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} #${GMOCK_INCLUDE_DIRS}
    LINK_LIBRARIES TestTools GaudiKernel AthenaBaseComps AtlasDetDescr
-   ISF_Event ISF_InterfacesLib PmbCxxUtils InDetSimEvent LArSimEvent TileSimEvent
-   MuonSimEvent ${GTEST_LIBRARIES} #${GMOCK_LIBRARIES}
+   ISF_Event ISF_InterfacesLib PmbCxxUtils InDetSimEvent CaloSimEvent LArSimEvent
+   TileSimEvent MuonSimEvent RecEvent ${GTEST_LIBRARIES} #${GMOCK_LIBRARIES}
    ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share" )
 
 atlas_add_test(collection_merger_helpers_tests
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py
index d55cb9b7538c..41bcba5f3151 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py
@@ -62,3 +62,82 @@ def getSimEventFilter(name="ISF_SimEventFilter", **kwargs):
 def getInvertedSimEventFilter(name="ISF_InvertedSimEventFilter", **kwargs):
     kwargs.setdefault("InvertFilter", True)
     return getSimEventFilter(name, **kwargs)
+
+def getRenameHitCollections(name="RenameHitCollections", **kwargs):
+    kwargs.setdefault( "InputMcEventCollection",    "TruthEventOLD" )
+    kwargs.setdefault( "OutputMcEventCollection",   "TruthEvent"          )
+    kwargs.setdefault( "InputCaloEntryLayer",       "CaloEntryLayerOLD" )
+    kwargs.setdefault( "InputMuonEntryLayer",       "MuonEntryLayerOLD" )
+    kwargs.setdefault( "InputMuonExitLayer",        "MuonExitLayerOLD" )
+    kwargs.setdefault( "OutputCaloEntryLayer",      "CaloEntryLayer" )
+    kwargs.setdefault( "OutputMuonEntryLayer",      "MuonEntryLayer" )
+    kwargs.setdefault( "OutputMuonExitLayer",       "MuonExitLayer" )
+
+    from AthenaCommon.DetFlags import DetFlags
+    if DetFlags.simulate.BCM_on():
+        kwargs.setdefault( "InputBCMHits",              "BCMHitsOLD" )
+        kwargs.setdefault( "InputBLMHits",              "BLMHitsOLD" )
+        kwargs.setdefault( "OutputBCMHits",             "BCMHits"             )
+        kwargs.setdefault( "OutputBLMHits",             "BLMHits"             )
+    if DetFlags.simulate.Pixel_on():
+        kwargs.setdefault( "InputPixelHits",            "PixelHitsOLD" )
+        kwargs.setdefault( "OutputPixelHits",           "PixelHits"           )
+    if DetFlags.simulate.SCT_on():
+        kwargs.setdefault( "InputSCTHits",              "SCT_HitsOLD" )
+        kwargs.setdefault( "OutputSCTHits",             "SCT_Hits"            )
+    if DetFlags.simulate.TRT_on():
+        kwargs.setdefault( "InputTRTUncompressedHits",  "TRTUncompressedHitsOLD" )
+        kwargs.setdefault( "OutputTRTUncompressedHits", "TRTUncompressedHits" )
+
+    if DetFlags.simulate.LAr_on():
+        kwargs.setdefault( "InputLArEMBHits",           "LArHitEMBOLD" )
+        kwargs.setdefault( "InputLArEMECHits",          "LArHitEMECOLD" )
+        kwargs.setdefault( "InputLArFCALHits",          "LArHitFCALOLD" )
+        kwargs.setdefault( "InputLArHECHits",           "LArHitHECOLD" )
+        kwargs.setdefault( "OutputLArEMBHits",          "LArHitEMB"           )
+        kwargs.setdefault( "OutputLArEMECHits",         "LArHitEMEC"          )
+        kwargs.setdefault( "OutputLArFCALHits",         "LArHitFCAL"          )
+        kwargs.setdefault( "OutputLArHECHits",          "LArHitHEC"           )
+        #TODO: proper treatment of calibration hits
+        #kwargs.setdefault( "InputLArActiveCalibHits", "LArCalibrationHitActive")
+        #kwargs.setdefault( "InputLArInactiveCalibHits", "LArCalibrationHitInactive")
+        #kwargs.setdefault( "InputLArDeadCalibHits", "LArCalibrationHitDeadMaterial")
+        kwargs.setdefault( "OutputLArActiveCalibHits", "LArCalibrationHitActive")
+        kwargs.setdefault( "OutputLArInactiveCalibHits", "LArCalibrationHitInactive")
+        kwargs.setdefault( "OutputLArDeadCalibHits", "LArCalibrationHitDeadMaterial")
+
+    if DetFlags.simulate.Tile_on():
+        kwargs.setdefault( "InputTileHits",             "TileHitVecOLD" )
+        kwargs.setdefault( "OutputTileHits",            "TileHitVec"          )
+        #TODO: proper treatment of calibration hits
+        #kwargs.setdefault( "InputTileActiveCalibHits", "TileCalibHitActiveCellOLD")
+        #kwargs.setdefault( "InputTileInactiveCalibHits", "TileCalibHitInactiveCellOLD")
+        #kwargs.setdefault( "InputTileDeadCalibHits", "TileCalibHitDeadMaterialOLD")
+        kwargs.setdefault( "OutputTileActiveCalibHits", "TileCalibHitActiveCell")
+        kwargs.setdefault( "OutputTileInactiveCalibHits", "TileCalibHitInactiveCell")
+        kwargs.setdefault( "OutputTileDeadCalibHits", "TileCalibHitDeadMaterial")
+    if DetFlags.simulate.Tile_on() and not DetFlags.simulate.HGTD_on():
+        kwargs.setdefault( "InputMBTSHits",             "MBTSHitsOLD" )
+        kwargs.setdefault( "OutputMBTSHits",            "MBTSHits"            )
+
+    if DetFlags.simulate.CSC_on():
+        kwargs.setdefault( "InputCSCHits",              "CSC_HitsOLD" )
+        kwargs.setdefault( "OutputCSCHits",             "CSC_Hits"            )
+    if DetFlags.simulate.MDT_on():
+        kwargs.setdefault( "InputMDTHits",              "MDT_HitsOLD" )
+        kwargs.setdefault( "OutputMDTHits",             "MDT_Hits"            )
+    if DetFlags.simulate.RPC_on():
+        kwargs.setdefault( "InputRPCHits",              "RPC_HitsOLD" )
+        kwargs.setdefault( "OutputRPCHits",             "RPC_Hits"            )
+    if DetFlags.simulate.TGC_on():
+        kwargs.setdefault( "InputTGCHits",              "TGC_HitsOLD" )
+        kwargs.setdefault( "OutputTGCHits",             "TGC_Hits"            )
+    if DetFlags.simulate.Micromegas_on():
+        kwargs.setdefault( "InputMMHits",              "MicromegasSensitiveDetectorOLD" )
+        kwargs.setdefault( "OutputMMHits",              "MicromegasSensitiveDetector"  )
+    if DetFlags.simulate.sTGC_on():
+        kwargs.setdefault( "InputsTGCHits",              "sTGCSensitiveDetectorOLD" )
+        kwargs.setdefault( "OutputsTGCHits",           "sTGCSensitiveDetector"           )
+
+    from ISF_Algorithms.ISF_AlgorithmsConf import ISF__RenameHitCollectionsAlg
+    return ISF__RenameHitCollectionsAlg(name, **kwargs)
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigDb.py b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigDb.py
index 8e555d5f45d2..482a27e002dc 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigDb.py
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigDb.py
@@ -11,3 +11,4 @@ addAlgorithm("ISF_Algorithms.ISF_AlgorithmsConfig.getCollectionMerger",  "ISF_Co
 addAlgorithm("ISF_Algorithms.ISF_AlgorithmsConfig.getSimHitTreeCreator", "ISF_SimHitTreeCreator")
 addAlgorithm("ISF_Algorithms.ISF_AlgorithmsConfig.getSimEventFilter",    "ISF_SimEventFilter")
 addAlgorithm("ISF_Algorithms.ISF_AlgorithmsConfig.getInvertedSimEventFilter", "ISF_InvertedSimEventFilter")
+addAlgorithm("ISF_Algorithms.ISF_AlgorithmsConfig.getRenameHitCollections", "RenameHitCollections")
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigNew.py b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigNew.py
index e97539bc0dbd..b2f095b0519e 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigNew.py
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigNew.py
@@ -20,3 +20,91 @@ def SimEventFilterCfg(flags, name="ISF_SimEventFilter", sequenceName='SimSequenc
 def InvertedSimEventFilterCfg(flags, name="ISF_InvertedSimEventFilter", sequenceName='CopyHitSequence', **kwargs):
     kwargs.setdefault("InvertFilter", True)
     return SimEventFilterCfg(flags, name, sequenceName, **kwargs)
+
+def RenameHitCollectionsCfg(flags, name="RenameHitCollections", sequenceName='CopyHitSequence', **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault( "InputMcEventCollection",    "TruthEventOLD" )
+    kwargs.setdefault( "OutputMcEventCollection",   "TruthEvent"          )
+    kwargs.setdefault( "InputCaloEntryLayer",       "CaloEntryLayerOLD" )
+    kwargs.setdefault( "InputMuonEntryLayer",       "MuonEntryLayerOLD" )
+    kwargs.setdefault( "InputMuonExitLayer",        "MuonExitLayerOLD" )
+    kwargs.setdefault( "OutputCaloEntryLayer",      "CaloEntryLayer" )
+    kwargs.setdefault( "OutputMuonEntryLayer",      "MuonEntryLayer" )
+    kwargs.setdefault( "OutputMuonExitLayer",       "MuonExitLayer" )
+
+    if flags.Detector.EnableBCM:
+        kwargs.setdefault( "InputBCMHits",              "BCMHitsOLD" )
+        kwargs.setdefault( "InputBLMHits",              "BLMHitsOLD" )
+        kwargs.setdefault( "OutputBCMHits",             "BCMHits"             )
+        kwargs.setdefault( "OutputBLMHits",             "BLMHits"             )
+    if flags.Detector.EnablePixel:
+        kwargs.setdefault( "InputPixelHits",            "PixelHitsOLD" )
+        kwargs.setdefault( "OutputPixelHits",           "PixelHits"           )
+    if flags.Detector.EnableSCT:
+        kwargs.setdefault( "InputSCTHits",              "SCT_HitsOLD" )
+        kwargs.setdefault( "OutputSCTHits",             "SCT_Hits"            )
+    if flags.Detector.EnableTRT:
+        kwargs.setdefault( "InputTRTUncompressedHits",  "TRTUncompressedHitsOLD" )
+        kwargs.setdefault( "OutputTRTUncompressedHits", "TRTUncompressedHits" )
+    if flags.Detector.EnableITkPixel:
+        kwargs.setdefault( "InputITkPixelHits",            "ITkPixelHitsOLD" )
+        kwargs.setdefault( "OutputITkPixelHits",          "ITkPixelHits"           )
+    if flags.Detector.EnableITkStrip:
+        kwargs.setdefault( "InputITkStripHits",              "ITkStripHitsOLD" )
+        kwargs.setdefault( "OutputITkStripHits",             "ITkStripHits"            )
+
+    if flags.Detector.EnableLAr:
+        kwargs.setdefault( "InputLArEMBHits",           "LArHitEMBOLD" )
+        kwargs.setdefault( "InputLArEMECHits",          "LArHitEMECOLD" )
+        kwargs.setdefault( "InputLArFCALHits",          "LArHitFCALOLD" )
+        kwargs.setdefault( "InputLArHECHits",           "LArHitHECOLD" )
+        kwargs.setdefault( "OutputLArEMBHits",          "LArHitEMB"           )
+        kwargs.setdefault( "OutputLArEMECHits",         "LArHitEMEC"          )
+        kwargs.setdefault( "OutputLArFCALHits",         "LArHitFCAL"          )
+        kwargs.setdefault( "OutputLArHECHits",          "LArHitHEC"           )
+        #TODO: proper treatment of calibration hits
+        #kwargs.setdefault( "InputLArActiveCalibHits", "LArCalibrationHitActive")
+        #kwargs.setdefault( "InputLArInactiveCalibHits", "LArCalibrationHitInactive")
+        #kwargs.setdefault( "InputLArDeadCalibHits", "LArCalibrationHitDeadMaterial")
+        kwargs.setdefault( "OutputLArActiveCalibHits", "LArCalibrationHitActive")
+        kwargs.setdefault( "OutputLArInactiveCalibHits", "LArCalibrationHitInactive")
+        kwargs.setdefault( "OutputLArDeadCalibHits", "LArCalibrationHitDeadMaterial")
+
+    if flags.Detector.EnableTile:
+        kwargs.setdefault( "InputTileHits",             "TileHitVecOLD" )
+        kwargs.setdefault( "OutputTileHits",            "TileHitVec"          )
+        #TODO: proper treatment of calibration hits
+        #kwargs.setdefault( "InputTileActiveCalibHits", "TileCalibHitActiveCellOLD")
+        #kwargs.setdefault( "InputTileInactiveCalibHits", "TileCalibHitInactiveCellOLD")
+        #kwargs.setdefault( "InputTileDeadCalibHits", "TileCalibHitDeadMaterialOLD")
+        kwargs.setdefault( "OutputTileActiveCalibHits", "TileCalibHitActiveCell")
+        kwargs.setdefault( "OutputTileInactiveCalibHits", "TileCalibHitInactiveCell")
+        kwargs.setdefault( "OutputTileDeadCalibHits", "TileCalibHitDeadMaterial")
+    if flags.Detector.EnableMBTS:
+        kwargs.setdefault( "InputMBTSHits",             "MBTSHitsOLD" )
+        kwargs.setdefault( "OutputMBTSHits",          "MBTSHits"        )
+    if flags.Detector.EnableHGTD:
+        kwargs.setdefault( "InputHGTDHits",             "HGTD_HitsOLD" )
+        kwargs.setdefault( "OutputHGTDHits",          "HGTD_Hits"        )
+
+    if flags.Detector.EnableCSC:
+        kwargs.setdefault( "InputCSCHits",              "CSC_HitsOLD" )
+        kwargs.setdefault( "OutputCSCHits",             "CSC_Hits"            )
+    if flags.Detector.EnableMDT:
+        kwargs.setdefault( "InputMDTHits",              "MDT_HitsOLD" )
+        kwargs.setdefault( "OutputMDTHits",             "MDT_Hits"            )
+    if flags.Detector.EnableRPC:
+        kwargs.setdefault( "InputRPCHits",              "RPC_HitsOLD" )
+        kwargs.setdefault( "OutputRPCHits",             "RPC_Hits"            )
+    if flags.Detector.EnableTGC:
+        kwargs.setdefault( "InputTGCHits",              "TGC_HitsOLD" )
+        kwargs.setdefault( "OutputTGCHits",             "TGC_Hits"            )
+    if flags.Detector.EnableMM:
+        kwargs.setdefault( "InputMMHits",              "MicromegasSensitiveDetectorOLD" )
+        kwargs.setdefault( "OutputMMHits",              "MicromegasSensitiveDetector"  )
+    if flags.Detector.EnablesTGC:
+        kwargs.setdefault( "InputsTGCHits",              "sTGCSensitiveDetectorOLD" )
+        kwargs.setdefault( "OutputsTGCHits",           "sTGCSensitiveDetector"           )
+
+    result.addEventAlgo(CompFactory.ISF.RenameHitCollectionsAlg(name, **kwargs), sequenceName) # TODO Need to ensure that sequence has been created
+    return result
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/RenameHitCollectionsAlg.cxx b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/RenameHitCollectionsAlg.cxx
new file mode 100644
index 000000000000..d9bf93577568
--- /dev/null
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/RenameHitCollectionsAlg.cxx
@@ -0,0 +1,155 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "RenameHitCollectionsAlg.h"
+
+/** Constructor */
+ISF::RenameHitCollectionsAlg::RenameHitCollectionsAlg( const std::string& name, ISvcLocator* pSvcLocator ) :
+  ::AthReentrantAlgorithm( name, pSvcLocator )
+{
+}
+
+
+/** Athena Algorithm initialize */
+StatusCode ISF::RenameHitCollectionsAlg::initialize()
+{
+  ATH_CHECK( initializeVarHandleKey(m_inputMcEventCollection  ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputBCMHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputBLMHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputPixelHits          ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputSCTHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputTRTUncompressedHits) );
+
+  ATH_CHECK( initializeVarHandleKey(m_inputLArEMBHits         ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputLArEMECHits        ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputLArFCALHits        ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputLArHECHits         ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputLArActiveCalibHits ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputLArInactiveCalibHits ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputLArDeadCalibHits ) );
+
+  ATH_CHECK( initializeVarHandleKey(m_inputTileHits           ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputMBTSHits           ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputTileActiveCalibHits ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputTileInactiveCalibHits ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputTileDeadCalibHits ) );
+
+  ATH_CHECK( initializeVarHandleKey(m_inputCSCHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputMDTHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputRPCHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputTGCHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputMMHits             ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputsTGCHits           ) );
+
+  ATH_CHECK( initializeVarHandleKey(m_inputITkPixelHits          ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputITkStripHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputHGTDHits) );
+
+  ATH_CHECK( initializeVarHandleKey(m_inputCaloEntryLayer ) );
+  ATH_CHECK( initializeVarHandleKey(m_inputMuonEntryLayer) );
+  ATH_CHECK( initializeVarHandleKey(m_inputMuonExitLayer  ) );
+
+  ATH_CHECK( initializeVarHandleKey(m_outputMcEventCollection  ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputBCMHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputBLMHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputPixelHits          ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputSCTHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputTRTUncompressedHits) );
+
+  ATH_CHECK( initializeVarHandleKey(m_outputLArEMBHits         ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputLArEMECHits        ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputLArFCALHits        ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputLArHECHits         ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputLArActiveCalibHits ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputLArInactiveCalibHits ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputLArDeadCalibHits ) );
+
+  ATH_CHECK( initializeVarHandleKey(m_outputTileHits           ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputMBTSHits           ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputTileActiveCalibHits ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputTileInactiveCalibHits ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputTileDeadCalibHits ) );
+
+  ATH_CHECK( initializeVarHandleKey(m_outputCSCHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputMDTHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputRPCHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputTGCHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputMMHits             ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputsTGCHits           ) );
+
+  ATH_CHECK( initializeVarHandleKey(m_outputITkPixelHits          ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputITkStripHits            ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputHGTDHits) );
+
+  ATH_CHECK( initializeVarHandleKey(m_outputCaloEntryLayer ) );
+  ATH_CHECK( initializeVarHandleKey(m_outputMuonEntryLayer) );
+  ATH_CHECK( initializeVarHandleKey(m_outputMuonExitLayer  ) );
+
+  return StatusCode::SUCCESS;
+}
+
+
+/** Athena Algorithm execute */
+StatusCode ISF::RenameHitCollectionsAlg::execute(const EventContext &ctx) const
+{
+  SG::ReadHandle<McEventCollection> inputMcEventCollection(m_inputMcEventCollection, ctx);
+  if (!inputMcEventCollection.isValid()) {
+    ATH_MSG_ERROR("Could not find input McEventCollection called " << inputMcEventCollection.name() << " in store " << inputMcEventCollection.store() << ".");
+    return StatusCode::FAILURE;
+  }
+  SG::WriteHandle<McEventCollection> outputMcEventCollection(m_outputMcEventCollection, ctx);
+  ATH_CHECK(outputMcEventCollection.record(std::make_unique<McEventCollection>(*inputMcEventCollection)));
+  if (!outputMcEventCollection.isValid()) {
+    ATH_MSG_ERROR("Could not record output McEventCollection called " << outputMcEventCollection.name() << " in store " << outputMcEventCollection.store() << ".");
+    return StatusCode::FAILURE;
+  }
+
+  ATH_CHECK(copyCollections( m_inputBCMHits,             m_outputBCMHits             , ctx ));
+  ATH_CHECK(copyCollections( m_inputBLMHits,             m_outputBLMHits             , ctx ));
+  ATH_CHECK(copyCollections( m_inputPixelHits,           m_outputPixelHits           , ctx ));
+  ATH_CHECK(copyCollections( m_inputSCTHits,             m_outputSCTHits             , ctx ));
+  ATH_CHECK(copyCollections( m_inputTRTUncompressedHits, m_outputTRTUncompressedHits , ctx ));
+
+  ATH_CHECK(copyCollections( m_inputLArEMBHits,          m_outputLArEMBHits          , ctx ));
+  ATH_CHECK(copyCollections( m_inputLArEMECHits,         m_outputLArEMECHits         , ctx ));
+  ATH_CHECK(copyCollections( m_inputLArFCALHits,         m_outputLArFCALHits         , ctx ));
+  ATH_CHECK(copyCollections( m_inputLArHECHits,          m_outputLArHECHits          , ctx ));
+  ATH_CHECK(copyCollections( m_inputLArActiveCalibHits,  m_outputLArActiveCalibHits  , ctx ));
+  ATH_CHECK(copyCollections( m_inputLArInactiveCalibHits,m_outputLArInactiveCalibHits, ctx ));
+  ATH_CHECK(copyCollections( m_inputLArDeadCalibHits,    m_outputLArDeadCalibHits    , ctx ));
+
+  ATH_CHECK(copyCollections( m_inputTileHits,            m_outputTileHits            , ctx ));
+  ATH_CHECK(copyCollections( m_inputMBTSHits,            m_outputMBTSHits            , ctx ));
+  ATH_CHECK(copyCollections( m_inputTileActiveCalibHits, m_outputTileActiveCalibHits , ctx ));
+  ATH_CHECK(copyCollections( m_inputTileInactiveCalibHits,m_outputTileInactiveCalibHits, ctx ));
+  ATH_CHECK(copyCollections( m_inputTileDeadCalibHits,   m_outputTileDeadCalibHits   , ctx ));
+
+  ATH_CHECK(copyCollections( m_inputCSCHits,             m_outputCSCHits             , ctx ));
+  ATH_CHECK(copyCollections( m_inputMDTHits,             m_outputMDTHits             , ctx ));
+  ATH_CHECK(copyCollections( m_inputRPCHits,             m_outputRPCHits             , ctx ));
+  ATH_CHECK(copyCollections( m_inputTGCHits,             m_outputTGCHits             , ctx ));
+  ATH_CHECK(copyCollections( m_inputMMHits,              m_outputMMHits               , ctx ));
+  ATH_CHECK(copyCollections( m_inputsTGCHits,            m_outputsTGCHits            , ctx ));
+
+  ATH_CHECK(copyCollections( m_inputITkPixelHits,        m_outputITkPixelHits           , ctx ));
+  ATH_CHECK(copyCollections( m_inputITkStripHits,        m_outputITkStripHits             , ctx ));
+  ATH_CHECK(copyCollections( m_inputHGTDHits,           m_outputHGTDHits , ctx ));
+
+  ATH_CHECK(copyCollections(m_inputCaloEntryLayer ,m_outputCaloEntryLayer , ctx ));
+  ATH_CHECK(copyCollections(m_inputMuonEntryLayer,m_outputMuonEntryLayer, ctx ));
+  ATH_CHECK(copyCollections(m_inputMuonExitLayer  ,m_outputMuonExitLayer  , ctx ));
+
+
+
+  return StatusCode::SUCCESS;
+}
+
+
+/** Initialize the given VarHandleKey */
+StatusCode ISF::RenameHitCollectionsAlg::initializeVarHandleKey( SG::VarHandleKey& varHandleKey ) const {
+  if ( varHandleKey.key().empty() )
+    return StatusCode::SUCCESS;
+
+  return varHandleKey.initialize();
+}
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/RenameHitCollectionsAlg.h b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/RenameHitCollectionsAlg.h
new file mode 100644
index 000000000000..372b56fa59ac
--- /dev/null
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/RenameHitCollectionsAlg.h
@@ -0,0 +1,277 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ISF_ALGORITHMS_RENAMEHITCOLLECTIONSALG_H
+#define ISF_ALGORITHMS_RENAMEHITCOLLECTIONSALG_H 1
+
+// STL includes
+#include <string>
+#include <memory>
+
+// Framework includes
+#include <AthenaBaseComps/AthReentrantAlgorithm.h>
+#include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/WriteHandleKey.h"
+
+#include "GeneratorObjects/McEventCollection.h"
+#include "CaloSimEvent/CaloCalibrationHitContainer.h"
+#include "CaloSimEvent/CaloCalibrationHit.h"
+#include "TrackRecord/TrackRecordCollection.h"
+
+// SimHit EDM includes
+//    InnerDetector
+#include "InDetSimEvent/SiHitCollection.h"
+#include "InDetSimEvent/TRTUncompressedHitCollection.h"
+//    Calorimeter
+#include "LArSimEvent/LArHitContainer.h"
+#include "TileSimEvent/TileHitVector.h"
+//    Muon Spectrometer
+#include "MuonSimEvent/CSCSimHitCollection.h"
+#include "MuonSimEvent/MDTSimHitCollection.h"
+#include "MuonSimEvent/RPCSimHitCollection.h"
+#include "MuonSimEvent/TGCSimHitCollection.h"
+#include <MuonSimEvent/MMSimHitCollection.h>
+#include <MuonSimEvent/sTGCSimHitCollection.h>
+
+// forward declarations
+namespace ISFTesting {
+  class RenameHitCollectionsAlg_test;
+}
+
+
+namespace ISF {
+
+  /** @class RenameHitCollectionsAlg
+
+      @brief Athena Algorithm that makes copies of existing
+      collections in StoreGate and stores them under new keys.
+
+  */
+  class RenameHitCollectionsAlg final : public AthReentrantAlgorithm {
+
+    /** Allow the test class access to all methods */
+    friend class ISFTesting::RenameHitCollectionsAlg_test;
+
+  public:
+    /** Constructor */
+    RenameHitCollectionsAlg( const std::string& name, ISvcLocator* pSvcLocator );
+
+    /** Destructor */
+    virtual ~RenameHitCollectionsAlg() = default;
+
+    /** Athena algorithm's interface methods */
+    virtual StatusCode  initialize() override final;
+    virtual StatusCode  execute(const EventContext &ctx) const    override final;
+
+  private:
+    /** Initialize the given VarHandleKey */
+    StatusCode initializeVarHandleKey( SG::VarHandleKey& varHandleKey ) const;
+
+    /** Merge all hits of inputReadHandleKeys's collections into outputWriteHandleKey */
+    template <typename T>
+      StatusCode copyCollections( const SG::ReadHandleKey<T>& inputReadHandleKeys,
+                                  const SG::WriteHandleKey<T>& outputWriteHandleKey, const EventContext &ctx) const;
+
+    /** Copy the given hit into the given output collection, container or DataHandle */
+    template <typename HitType_t, typename OutputType_t>
+      void insertCopy(const HitType_t& hit, OutputType_t& outputHandle) const;
+
+    /** Copy the given const pointer to a hit into the given output collection,
+        container or DataHandle */
+    template <typename HitType_t, typename OutputType_t>
+      void insertCopy(HitType_t * const hit, OutputType_t& outputHandle) const;
+
+
+    /** Input collection ReadHandleKeys */
+    SG::ReadHandleKey<McEventCollection>        m_inputMcEventCollection {this, "InputMcEventCollection", "", "Input truth collection name"};
+    SG::ReadHandleKey<SiHitCollection>              m_inputBCMHits{this, "InputBCMHits", "", ""};
+    SG::ReadHandleKey<SiHitCollection>              m_inputBLMHits{this, "InputBLMHits", "", ""};
+    SG::ReadHandleKey<SiHitCollection>              m_inputPixelHits{this, "InputPixelHits", "", ""};
+    SG::ReadHandleKey<SiHitCollection>              m_inputSCTHits{this, "InputSCTHits", "", ""};
+    SG::ReadHandleKey<TRTUncompressedHitCollection> m_inputTRTUncompressedHits{this, "InputTRTUncompressedHits", "", ""};
+
+    SG::ReadHandleKey<LArHitContainer>              m_inputLArEMBHits{this, "InputLArEMBHits", "", ""};
+    SG::ReadHandleKey<LArHitContainer>              m_inputLArEMECHits{this, "InputLArEMECHits", "", ""};
+    SG::ReadHandleKey<LArHitContainer>              m_inputLArFCALHits{this, "InputLArFCALHits", "", ""};
+    SG::ReadHandleKey<LArHitContainer>              m_inputLArHECHits{this, "InputLArHECHits", "", ""};
+    SG::ReadHandleKey<CaloCalibrationHitContainer>  m_inputLArActiveCalibHits{this, "InputLArActiveCalibHits", "", ""};
+    SG::ReadHandleKey<CaloCalibrationHitContainer>  m_inputLArInactiveCalibHits{this, "InputLArInactiveCalibHits", "", ""};
+    SG::ReadHandleKey<CaloCalibrationHitContainer>  m_inputLArDeadCalibHits{this, "InputLArDeadCalibHits", "", ""};
+
+    SG::ReadHandleKey<TileHitVector>                m_inputTileHits{this, "InputTileHits", "", ""};
+    SG::ReadHandleKey<TileHitVector>                m_inputMBTSHits{this, "InputMBTSHits", "", ""};
+    SG::ReadHandleKey<CaloCalibrationHitContainer>  m_inputTileActiveCalibHits{this, "InputTileActiveCalibHits", "", ""};
+    SG::ReadHandleKey<CaloCalibrationHitContainer>  m_inputTileInactiveCalibHits{this, "InputTileInactiveCalibHits", "", ""};
+    SG::ReadHandleKey<CaloCalibrationHitContainer>  m_inputTileDeadCalibHits{this, "InputTileDeadCalibHits", "", ""};
+
+    SG::ReadHandleKey<CSCSimHitCollection>          m_inputCSCHits{this, "InputCSCHits", "", ""};
+    SG::ReadHandleKey<MDTSimHitCollection>         m_inputMDTHits{this, "InputMDTHits", "", ""};
+    SG::ReadHandleKey<RPCSimHitCollection>          m_inputRPCHits{this, "InputRPCHits", "", ""};
+    SG::ReadHandleKey<TGCSimHitCollection>          m_inputTGCHits{this, "InputTGCHits", "", ""};
+    SG::ReadHandleKey<MMSimHitCollection> m_inputMMHits{this, "InputMMHits", "", "Input MM hits name"};
+    SG::ReadHandleKey<sTGCSimHitCollection> m_inputsTGCHits{this, "InputsTGCHits", "", "Input TGC hits name"};
+
+    // Phase 2 Upgrade HitCollections
+    SG::ReadHandleKey<SiHitCollection>              m_inputITkPixelHits{this, "InputITkPixelHits", "", ""};
+    SG::ReadHandleKey<SiHitCollection>              m_inputITkStripHits{this, "InputITkStripHits", "", ""};
+    SG::ReadHandleKey<SiHitCollection>              m_inputHGTDHits{this, "InputHGTDHits", "", ""};
+
+    SG::ReadHandleKey<TrackRecordCollection>      m_inputCaloEntryLayer{this, "InputCaloEntryLayer", "", ""};
+    SG::ReadHandleKey<TrackRecordCollection>      m_inputMuonEntryLayer{this, "InputMuonEntryLayer", "", ""};
+    SG::ReadHandleKey<TrackRecordCollection>      m_inputMuonExitLayer{this, "InputMuonExitLayer", "", ""};
+
+    /** Output collection WriteHandleKeys */
+    SG::WriteHandleKey<McEventCollection>               m_outputMcEventCollection{this, "OutputMcEventCollection", "", ""};
+    SG::WriteHandleKey<SiHitCollection>                 m_outputBCMHits{this, "OutputBCMHits", "", ""};
+    SG::WriteHandleKey<SiHitCollection>                 m_outputBLMHits{this, "OutputBLMHits", "", ""};
+    SG::WriteHandleKey<SiHitCollection>                 m_outputPixelHits{this, "OutputPixelHits", "", ""};
+    SG::WriteHandleKey<SiHitCollection>                 m_outputSCTHits{this, "OutputSCTHits", "", ""};
+    SG::WriteHandleKey<TRTUncompressedHitCollection>    m_outputTRTUncompressedHits{this, "OutputTRTUncompressedHits", "", ""};
+
+    SG::WriteHandleKey<LArHitContainer>                 m_outputLArEMBHits{this, "OutputLArEMBHits", "", ""};
+    SG::WriteHandleKey<LArHitContainer>                 m_outputLArEMECHits{this, "OutputLArEMECHits", "", ""};
+    SG::WriteHandleKey<LArHitContainer>                 m_outputLArFCALHits{this, "OutputLArFCALHits", "", ""};
+    SG::WriteHandleKey<LArHitContainer>                 m_outputLArHECHits{this, "OutputLArHECHits", "", ""};
+    SG::WriteHandleKey<CaloCalibrationHitContainer>     m_outputLArActiveCalibHits{this, "OutputLArActiveCalibHits", "", ""};
+    SG::WriteHandleKey<CaloCalibrationHitContainer>     m_outputLArInactiveCalibHits{this, "OutputLArInactiveCalibHits", "", ""};
+    SG::WriteHandleKey<CaloCalibrationHitContainer>     m_outputLArDeadCalibHits{this, "OutputLArDeadCalibHits", "", ""};
+
+    SG::WriteHandleKey<TileHitVector>                   m_outputTileHits{this, "OutputTileHits", "", ""};
+    SG::WriteHandleKey<TileHitVector>                   m_outputMBTSHits{this, "OutputMBTSHits", "", ""};
+    SG::WriteHandleKey<CaloCalibrationHitContainer>     m_outputTileActiveCalibHits{this, "OutputTileActiveCalibHits", "", ""};
+    SG::WriteHandleKey<CaloCalibrationHitContainer>     m_outputTileInactiveCalibHits{this, "OutputTileInactiveCalibHits", "", ""};
+    SG::WriteHandleKey<CaloCalibrationHitContainer>     m_outputTileDeadCalibHits{this, "OutputTileDeadCalibHits", "", ""};
+
+    SG::WriteHandleKey<CSCSimHitCollection>             m_outputCSCHits{this, "OutputCSCHits", "", ""};
+    SG::WriteHandleKey<MDTSimHitCollection>            m_outputMDTHits{this, "OutputMDTHits", "", ""};
+    SG::WriteHandleKey<RPCSimHitCollection>             m_outputRPCHits{this, "OutputRPCHits", "", ""};
+    SG::WriteHandleKey<TGCSimHitCollection>             m_outputTGCHits{this, "OutputTGCHits", "", ""};
+    SG::WriteHandleKey<MMSimHitCollection> m_outputMMHits{this, "OutputHits", "", "Output MM hits name"};
+    SG::WriteHandleKey<sTGCSimHitCollection> m_outputsTGCHits{this, "OutputsTGCHits", "", "Output TGC hits name"};
+
+    // Phase 2 Upgrade HitCollections
+    SG::WriteHandleKey<SiHitCollection>              m_outputITkPixelHits{this, "OutputITkPixelHits", "", ""};
+    SG::WriteHandleKey<SiHitCollection>              m_outputITkStripHits{this, "OutputITkStripHits", "", ""};
+    SG::WriteHandleKey<SiHitCollection>              m_outputHGTDHits{this, "OutputHGTDHits", "", ""};
+
+    SG::WriteHandleKey<TrackRecordCollection>      m_outputCaloEntryLayer{this, "OutputCaloEntryLayer", "", ""};
+    SG::WriteHandleKey<TrackRecordCollection>      m_outputMuonEntryLayer{this, "OutputMuonEntryLayer", "", ""};
+    SG::WriteHandleKey<TrackRecordCollection>      m_outputMuonExitLayer{this, "OutputMuonExitLayer", "", ""};
+  };
+
+
+  //
+  // templated methods below
+  //
+
+  /** Copy all hits of inputReadHandleKey collection into outputWriteHandleKey */
+  template <typename T>
+  inline StatusCode ISF::RenameHitCollectionsAlg::copyCollections( const SG::ReadHandleKey<T>& inputReadHandleKey,
+                                                                   const SG::WriteHandleKey<T>& outputWriteHandleKey, const EventContext &ctx ) const {
+    // skip if not input collection
+    if ( inputReadHandleKey.key().empty() ) {
+      return StatusCode::SUCCESS;
+    }
+    // TODO: is there a way to conveniently get the total number of hits in all inputReadHandleKeys
+    //       and reserve the corresponding size in the outputHandle
+    SG::WriteHandle<T> outputHandle{outputWriteHandleKey, ctx};
+    ATH_CHECK( outputHandle.record(std::make_unique<T>()) );
+
+    SG::ReadHandle<T> inputHandle{inputReadHandleKey, ctx};
+    for ( const auto& hit: *inputHandle ) {
+      this->insertCopy(hit, outputHandle);
+    }
+
+    return StatusCode::SUCCESS;
+  }
+
+
+  template <>
+  inline StatusCode ISF::RenameHitCollectionsAlg::copyCollections( const SG::ReadHandleKey<LArHitContainer>& inputReadHandleKey,
+                                                                   const SG::WriteHandleKey<LArHitContainer>& outputWriteHandleKey, const EventContext &ctx ) const {
+    // skip if not input collection
+    if ( inputReadHandleKey.key().empty() ) {
+      return StatusCode::SUCCESS;
+    }
+    // TODO: is there a way to conveniently get the total number of hits in all inputReadHandleKeys
+    //       and reserve the corresponding size in the outputHandle
+    SG::WriteHandle<LArHitContainer> outputHandle{outputWriteHandleKey, ctx};
+    ATH_CHECK( outputHandle.record(std::make_unique<LArHitContainer>()) );
+
+    SG::ReadHandle<LArHitContainer> inputHandle{inputReadHandleKey, ctx};
+    for ( const auto& hit: *inputHandle ) {
+      this->insertCopy(hit, outputHandle);
+    }
+    outputHandle->setName(inputHandle->Name());
+
+    return StatusCode::SUCCESS;
+  }
+
+
+  template <>
+  inline StatusCode ISF::RenameHitCollectionsAlg::copyCollections( const SG::ReadHandleKey<TileHitVector>& inputReadHandleKey,
+                                                                   const SG::WriteHandleKey<TileHitVector>& outputWriteHandleKey, const EventContext &ctx ) const {
+    // skip if not input collection
+    if ( inputReadHandleKey.key().empty() ) {
+      return StatusCode::SUCCESS;
+    }
+    // TODO: is there a way to conveniently get the total number of hits in all inputReadHandleKeys
+    //       and reserve the corresponding size in the outputHandle
+    SG::WriteHandle<TileHitVector> outputHandle{outputWriteHandleKey, ctx};
+    ATH_CHECK( outputHandle.record(std::make_unique<TileHitVector>()) );
+
+    SG::ReadHandle<TileHitVector> inputHandle{inputReadHandleKey, ctx};
+    for ( const auto& hit: *inputHandle ) {
+      this->insertCopy(hit, outputHandle);
+    }
+    outputHandle->setName(inputHandle->Name());
+
+    return StatusCode::SUCCESS;
+  }
+
+
+  template <>
+  inline StatusCode ISF::RenameHitCollectionsAlg::copyCollections( const SG::ReadHandleKey<TrackRecordCollection>& inputReadHandleKey,
+                                                                   const SG::WriteHandleKey<TrackRecordCollection>& outputWriteHandleKey, const EventContext &ctx ) const {
+    // skip if not input collection
+    if ( inputReadHandleKey.key().empty() ) {
+      return StatusCode::SUCCESS;
+    }
+    // TODO: is there a way to conveniently get the total number of hits in all inputReadHandleKeys
+    //       and reserve the corresponding size in the outputHandle
+    SG::WriteHandle<TrackRecordCollection> outputHandle{outputWriteHandleKey, ctx};
+    ATH_CHECK( outputHandle.record(std::make_unique<TrackRecordCollection>()) );
+
+    SG::ReadHandle<TrackRecordCollection> inputHandle{inputReadHandleKey, ctx};
+    for ( const auto& hit: *inputHandle ) {
+      this->insertCopy(hit, outputHandle);
+    }
+    outputHandle->setName(inputHandle->Name());
+
+    return StatusCode::SUCCESS;
+  }
+
+
+  /** Copy the given hit into the given output collection, container or DataHandle */
+  template <typename HitType_t, typename OutputType_t>
+  inline void ISF::RenameHitCollectionsAlg::insertCopy(const HitType_t& hit,
+                                                       OutputType_t& outputHandle) const {
+    static_assert(!std::is_pointer<HitType_t>::value,
+                  "The hit provided to ISF::RenameHitCollectionsAlg::insertCopy(..) must not be a pointer!");
+    outputHandle->Emplace( hit );
+  }
+
+
+  /** Copy the given const pointer to a hit into the given output collection, container or DataHandle */
+  template <typename HitType_t, typename OutputType_t>
+  inline void ISF::RenameHitCollectionsAlg::insertCopy(HitType_t * const hit,
+                                                       OutputType_t& outputHandle) const {
+    auto&& hitCopy = std::make_unique<HitType_t>(*hit);
+    outputHandle->push_back( hitCopy.release() );
+  }
+
+
+}
+
+#endif //> !ISF_ALGORITHMS_RENAMEHITCOLLECTIONSALG_H
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/components/ISF_Algorithms_entries.cxx b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/components/ISF_Algorithms_entries.cxx
index dfcaf38ee4bb..d6a02d0890b9 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/components/ISF_Algorithms_entries.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/components/ISF_Algorithms_entries.cxx
@@ -3,9 +3,11 @@
 #include "../CollectionMerger.h"
 #include "../SimHitTreeCreator.h"
 #include "../SimEventFilter.h"
+#include "../RenameHitCollectionsAlg.h"
 
 DECLARE_COMPONENT( ISF::SimKernel )
 DECLARE_COMPONENT( ISF::SimKernelMT )
 DECLARE_COMPONENT( ISF::CollectionMerger )
 DECLARE_COMPONENT( ISF::SimHitTreeCreator )
 DECLARE_COMPONENT( ISF::SimEventFilter )
+DECLARE_COMPONENT( ISF::RenameHitCollectionsAlg )
-- 
GitLab


From 6c2fec1c6453de70aa56e6502f31f4fee97c8b4a Mon Sep 17 00:00:00 2001
From: Edward Moyse <edward.moyse@cern.ch>
Date: Tue, 7 Sep 2021 16:35:48 +0200
Subject: [PATCH 015/347] Add ability to filter tracks by detector element
 identifier.

Improve debugging output.
---
 graphics/VP1/VP1Base/src/PhiSectionWidget.cxx |  3 +
 .../VP1TrackSystems/TrackCollHandleBase.h     |  4 +-
 .../TrackCollectionSettingsButton.h           |  3 +
 .../VP1TrackSystems/TrackHandleBase.h         |  1 +
 .../VP1TrackSystems/TrackHandle_TrkTrack.h    |  1 +
 .../VP1TrackSystems/TrackSystemController.h   |  3 +
 .../VP1TrackSystems/src/AscObj_TSOS.cxx       |  1 +
 .../src/TrackCollHandleBase.cxx               | 26 ++++--
 .../src/TrackCollectionSettingsButton.cxx     | 18 ++++
 .../src/TrackHandle_TrkTrack.cxx              | 25 +++++
 .../src/TrackSystemController.cxx             | 12 +++
 .../src/pertrackcollectionsettings_form.ui    | 91 +++++++++++--------
 .../VP1TrackSystems/src/settings_cuts_form.ui | 63 ++++++++-----
 13 files changed, 182 insertions(+), 69 deletions(-)

diff --git a/graphics/VP1/VP1Base/src/PhiSectionWidget.cxx b/graphics/VP1/VP1Base/src/PhiSectionWidget.cxx
index ecc23cc998b7..19a4090caf7c 100644
--- a/graphics/VP1/VP1Base/src/PhiSectionWidget.cxx
+++ b/graphics/VP1/VP1Base/src/PhiSectionWidget.cxx
@@ -400,6 +400,9 @@ void PhiSectionWidget::mousePressEvent(QMouseEvent *event)
     return;
   }
   m_d->sectorstatus[isector]=!(m_d->sectorstatus.at(isector));
+  if(VP1Msg::verbose()){
+	 messageVerbose("Turning on sector"+QString::number(isector));
+  }
   m_d->cacheValid=false;
   m_d->checkForChanges();
 }
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackCollHandleBase.h b/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackCollHandleBase.h
index 8a05d207301b..0fa8f28510d5 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackCollHandleBase.h
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackCollHandleBase.h
@@ -29,7 +29,7 @@
 #include "VP1TrackSystems/TrackSystemController.h"
 #include <QColor>
 #include <iostream>
-
+#include "Identifier/Identifier.h"
 
 class TrackSystemController;
 class TrackHandleBase;
@@ -195,6 +195,7 @@ public slots:
   void setMaterialEffectsOnTrackScale(double);
   void setParTubeErrorsDrawCylinders(bool);
   void setRequiredNHits(const QList<unsigned>&);
+  void setRequiredDetectorElement(const QString& id);
   void setOnlyVertexAssocTracks(bool);
   void extrapolateToThisVolumeChanged(void);
   void clipVolumeChanged(double);
@@ -222,6 +223,7 @@ private:
   VP1Interval m_cut_allowedEta;
   QList<VP1Interval> m_cut_allowedPhi;
   QList<unsigned> m_cut_requiredNHits;
+  QString m_requiredDetectorElement;
   bool m_cut_pt_allowall;
   bool m_cut_eta_allowall;
   bool m_cut_phi_allowall;
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackCollectionSettingsButton.h b/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackCollectionSettingsButton.h
index 79f8ad3e3c5c..6ae319a2592c 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackCollectionSettingsButton.h
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackCollectionSettingsButton.h
@@ -41,6 +41,7 @@ public:
   //Cuts for number of hits per subsystem:
   QList<unsigned> cutRequiredNHits() const;//Empty list: no requirements. Otherwise a list
                                           // with a length of four (pixel,sct,trt,muon)
+  QString cutRequiredDetectorElement() const;  //Null string, no requirement. Otherwise the string is converted into an identifier.
   //Truth cuts:
   bool cutTruthFromIROnly() const;
   bool cutExcludeBarcodeZero() const;
@@ -63,6 +64,7 @@ public:
     void cutAllowedEtaChanged(const VP1Interval&);
     void cutAllowedPhiChanged(const QList<VP1Interval>&);
     void cutRequiredNHitsChanged(const QList<unsigned>&);
+    void cutRequiredDetectorElementChanged(const QString&);
     void cutTruthFromIROnlyChanged(bool);
     void cutExcludeBarcodeZeroChanged(bool);
     void cutTruthExcludeNeutralsChanged(bool);
@@ -96,6 +98,7 @@ public:
     void possibleChange_cutAllowedEta();
     void possibleChange_cutAllowedPhi();
     void possibleChange_cutRequiredNHits();
+    void possibleChange_cutRequiredDetectorElement();
     void possibleChange_cutTruthFromIROnly();
     void possibleChange_cutExcludeBarcodeZero();
     void possibleChange_cutTruthExcludeNeutrals();
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackHandleBase.h b/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackHandleBase.h
index 6952361d6675..f9d54e85c544 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackHandleBase.h
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackHandleBase.h
@@ -151,6 +151,7 @@ protected:
 
   QList<AssociatedObjectHandleBase*> getAllAscObjHandles() const; //!< Return list of all AscObj handles. Not guaranteed to be filled unless tsoses are visible.
 
+  virtual bool containsDetElement(const QString&) const {return false; }
 private:
 
   // It is illegal to copy/assign a TrackHandleBase:
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackHandle_TrkTrack.h b/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackHandle_TrkTrack.h
index 5cf284ee6852..be175384e9f2 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackHandle_TrkTrack.h
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackHandle_TrkTrack.h
@@ -52,6 +52,7 @@ public:
   virtual unsigned getNTGCHits() const { ensureInitSubSysHitInfo(); return m_nhits_tgc; }
   virtual unsigned getNCSCHits() const { ensureInitSubSysHitInfo(); return m_nhits_csc; }
   virtual const Trk::FitQuality* getFitQuality() const ;
+  virtual bool containsDetElement(const QString&) const;
 
   virtual void fillObjectBrowser(QList<QTreeWidgetItem *>& list); 
   void updateObjectBrowser();
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackSystemController.h b/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackSystemController.h
index cc4f49600aba..51b0dfa391d7 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackSystemController.h
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/VP1TrackSystems/TrackSystemController.h
@@ -123,6 +123,7 @@ public:
   //Cuts for number of hits per subsystem:
   QList<unsigned> cutRequiredNHits() const;//Empty list: no requirements. Otherwise a list
                                            // with a length of four (pixel,sct,trt,muon)
+  QString cutRequiredDetectorElement() const;  //Null string, no requirement. Otherwise the string is converted into an identifier.
 
   void vertexCutsAllowed(bool); // called if vertex system is available.
   bool cutOnlyVertexAssocTracks() const;
@@ -216,6 +217,7 @@ signals:
   void cutAllowedEtaChanged(const VP1Interval&);
   void cutAllowedPhiChanged(const QList<VP1Interval>&);
   void cutRequiredNHitsChanged(const QList<unsigned>&);
+  void cutRequiredDetectorElementChanged(const QString&);
   void cutTruthFromIROnlyChanged(bool);
   void cutExcludeBarcodeZeroChanged(bool);
   void cutTruthExcludeNeutralsChanged(bool);
@@ -272,6 +274,7 @@ private slots:
   void possibleChange_cutAllowedEta();
   void possibleChange_cutAllowedPhi();
   void possibleChange_cutRequiredNHits();
+  void possibleChange_cutRequiredDetectorElement();
   void possibleChange_cutTruthFromIROnly();
   void possibleChange_cutExcludeBarcodeZero();
   void possibleChange_cutTruthExcludeNeutrals();
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/AscObj_TSOS.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/AscObj_TSOS.cxx
index 0e6b24337355..d728d2cd1ee5 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/AscObj_TSOS.cxx
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/AscObj_TSOS.cxx
@@ -1142,6 +1142,7 @@ QStringList AscObj_TSOS::clicked()
       std::ostringstream s;
       s << *(surface());
       l << QString(s.str().c_str()).split('\n');
+      s << "Identfier:"<<surface()->associatedDetectorElementIdentifier();
     }
   }
 
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollHandleBase.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollHandleBase.cxx
index 3d2d5d02054a..864eb1c0957d 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollHandleBase.cxx
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollHandleBase.cxx
@@ -112,6 +112,7 @@ TrackCollHandleBase::TrackCollHandleBase( TrackSysCommonData * cd,
     m_cut_allowedEta(VP1Interval()),
     m_cut_allowedPhi(QList<VP1Interval>()),
     m_cut_requiredNHits(QList<unsigned>()),
+    m_requiredDetectorElement(),
     m_cut_pt_allowall(false),
     m_cut_eta_allowall(false),
     m_cut_phi_allowall(false),
@@ -250,6 +251,9 @@ void TrackCollHandleBase::setupSettingsFromController(TrackSystemController* con
   connect(m_d->matButton,SIGNAL(cutRequiredNHitsChanged(const QList<unsigned>&)),this,SLOT(setRequiredNHits(const QList<unsigned>&)));
   setRequiredNHits(useDefaultCuts()?controller->cutRequiredNHits():m_d->matButton->cutRequiredNHits());
   
+  connect(controller,SIGNAL(cutRequiredDetectorElementChanged(const QString&)),this,SLOT(setRequiredDetectorElement(const QString&)));
+  connect(m_d->matButton,SIGNAL(cutRequiredDetectorElementChanged(const QString&)),this,SLOT(setRequiredDetectorElement(const QString&)));  
+
   connect(controller,SIGNAL(cutOnlyVertexAssocTracksChanged(bool)),this,SLOT(setOnlyVertexAssocTracks(bool)));
   connect(m_d->matButton,SIGNAL(cutOnlyVertexAssocTracksChanged(bool)),this,SLOT(setOnlyVertexAssocTracks(bool)));
   setOnlyVertexAssocTracks(useDefaultCuts()?controller->cutOnlyVertexAssocTracks():m_d->matButton->cutOnlyVertexAssocTracks());
@@ -314,7 +318,7 @@ bool TrackCollHandleBase::cut(TrackHandleBase* handle)
    if (m_cut_etaptphi_allwillfail)
     return false;
 
-  messageVerbose("TrackCollHandleBase::cut - checking hit cuts.");
+  // messageVerbose("TrackCollHandleBase::cut - checking hit cuts.");
   if (mightHaveSubSystemHitInfo()&&!m_cut_requiredNHits.isEmpty()&&handle->hasSubSystemHitInfo()) {
     //assert(m_cut_requiredNHits.count()==4); // for old code
     assert(m_cut_requiredNHits.count()==5);
@@ -323,17 +327,15 @@ bool TrackCollHandleBase::cut(TrackHandleBase* handle)
       if (handle->getNPixelHits()<m_cut_requiredNHits[0]) return false;
       if (handle->getNSCTHits()<m_cut_requiredNHits[1]) return false;
       if (handle->getNTRTHits()<m_cut_requiredNHits[2]) return false;
-    }
-    // Probably we should only be applying these to MS tracks?
-    messageVerbose("TrackCollHandleBase::cut : "+QString::number(handle->getNMuonPrecisionHits())+" / "+ QString::number(m_cut_requiredNHits[4]));
-    
+    } else {
+      messageVerbose("Not an ID track, so not applying ID cuts.");
+    }    
     if (handle->getNMuonHits()<m_cut_requiredNHits[3]) return false;
     if (handle->getNMuonPrecisionHits()<m_cut_requiredNHits[4]) return false;
   }
 
   if (!m_cut_pt_allowall||!m_cut_eta_allowall||!m_cut_phi_allowall)
   {
-//    Trk::GlobalMomentum mom(handle->momentum());
 	  Amg::Vector3D mom(handle->momentum());
     
     // convention is that if interval is real and negative, then P cut rather than pT
@@ -346,8 +348,7 @@ bool TrackCollHandleBase::cut(TrackHandleBase* handle)
       if (!m_cut_pt_allowall&& isPCut && !m_cut_allowedPtSq.contains(-mom.mag2()))
         return false;
         
-//      if (!m_cut_eta_allowall&&!m_cut_allowedEta.contains(mom.pseudoRapidity())){
-      if (!m_cut_eta_allowall&&!m_cut_allowedEta.contains(mom.eta())){ // migration to Amg (Eigen)
+      if (!m_cut_eta_allowall&&!m_cut_allowedEta.contains(mom.eta())){ 
         return false;
       }
       if (!m_cut_phi_allowall) {
@@ -364,6 +365,10 @@ bool TrackCollHandleBase::cut(TrackHandleBase* handle)
       }
     }
   }
+
+  // Cut on specific det element identifier
+  if (!m_requiredDetectorElement.isEmpty()) 
+    return handle->containsDetElement(m_requiredDetectorElement);
   
   if (cutOnlyVertexAssocTracks()){
     // std::cout<<"cutOnlyVertexAssocTracks: "<<handle<<",\t: "<<common()->system()->materialFromVertex(handle)<<std::endl;
@@ -867,6 +872,11 @@ void TrackCollHandleBase::setRequiredNHits(const QList<unsigned>& l)
   }
 }
 
+void TrackCollHandleBase::setRequiredDetectorElement(const QString& id){
+  m_requiredDetectorElement=id;
+  recheckCutStatusOfAllHandles();
+}
+
 //____________________________________________________________________
 void TrackCollHandleBase::setOnlyVertexAssocTracks(bool b){
   messageVerbose("setOnlyVertexAssocTracks changed to "+str(b));
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollectionSettingsButton.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollectionSettingsButton.cxx
index 6e87028de565..1d24de1a4748 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollectionSettingsButton.cxx
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollectionSettingsButton.cxx
@@ -54,6 +54,7 @@ public:
   VP1Interval last_cutAllowedEta;
   QList<VP1Interval> last_cutAllowedPhi;
   QList<unsigned> last_cutRequiredNHits;
+  QString last_cutRequiredDetectorElement;
   bool last_cutTruthFromIROnly;
   bool last_cutExcludeBarcodeZero;
   bool last_cutTruthExcludeNeutrals;
@@ -156,6 +157,10 @@ TrackCollectionSettingsButton::TrackCollectionSettingsButton(QWidget * parent,in
   connect(m_d->editwindow_ui.spinBox_cut_nhits_muon,SIGNAL(valueChanged(int)),this,SLOT(possibleChange_cutRequiredNHits()));
   connect(m_d->editwindow_ui.spinBox_cut_nprecisionhits_muon,SIGNAL(valueChanged(int)),this,SLOT(possibleChange_cutRequiredNHits()));
 
+  // Required detector element
+  connect(m_d->editwindow_ui.checkBox_requireDetectorElement,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutRequiredDetectorElement()));
+  connect(m_d->editwindow_ui.lineEdit_detectorElementId,SIGNAL(textChanged(QString)),this,SLOT(possibleChange_cutRequiredDetectorElement()));
+
   // -> cutTruthFromIROnly
   connect(m_d->editwindow_ui.checkBox_cut_truthtracks_creationvertexinIR,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutTruthFromIROnly()));
   
@@ -542,6 +547,10 @@ QList<unsigned> TrackCollectionSettingsButton::cutRequiredNHits() const
   return l;
 }
 
+QString TrackCollectionSettingsButton::cutRequiredDetectorElement() const {
+  return m_d->editwindow_ui.checkBox_requireDetectorElement->isChecked() ? m_d->editwindow_ui.lineEdit_detectorElementId->text(): QString();
+}
+
 //____________________________________________________________________
 bool TrackCollectionSettingsButton::cutTruthFromIROnly() const
 {
@@ -607,6 +616,15 @@ void TrackCollectionSettingsButton::possibleChange_cutRequiredNHits()
   emit cutRequiredNHitsChanged(m_d->last_cutRequiredNHits);
 }
 //____________________________________________________________________
+void TrackCollectionSettingsButton::possibleChange_cutRequiredDetectorElement()
+{  
+  messageVerbose("TrackCollectionSettingsButton::possibleChange_cutRequiredDetectorElement");
+  if (m_d->last_cutRequiredDetectorElement==cutRequiredDetectorElement()) return;
+  messageVerbose("cutRequiredDetectorElement() changed");
+  m_d->last_cutRequiredDetectorElement=cutRequiredDetectorElement();
+  emit cutRequiredDetectorElementChanged(m_d->last_cutRequiredDetectorElement);
+}
+//____________________________________________________________________
 void TrackCollectionSettingsButton::possibleChange_cutTruthFromIROnly()
 {
   if (m_d->last_cutTruthFromIROnly==cutTruthFromIROnly()) return;
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackHandle_TrkTrack.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackHandle_TrkTrack.cxx
index 08303ede0475..6783e063d355 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackHandle_TrkTrack.cxx
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackHandle_TrkTrack.cxx
@@ -387,3 +387,28 @@ const Trk::FitQuality* TrackHandle_TrkTrack::getFitQuality() const {
   return m_trk ? m_trk->fitQuality ():nullptr;
 }
 
+bool TrackHandle_TrkTrack::containsDetElement(const QString &id) const
+{
+  VP1Msg::messageVerbose("TrackHandle_TrkTrack::containsDetElement looking for " + id);
+  IDENTIFIER_TYPE tmpInt = id.toLong(nullptr,10);
+  IDENTIFIER_TYPE tmpInt2 = id.toLong(nullptr,16);
+
+  VP1Msg::messageVerbose("TrackHandle_TrkTrack::looping over TSOS ");
+
+  DataVector<const Trk::TrackStateOnSurface>::const_iterator it = trkTrackPointer()->trackStateOnSurfaces()->begin(),
+                                                             itE = trkTrackPointer()->trackStateOnSurfaces()->end();
+  for (; it != itE; ++it)
+  {
+    // Still debugging, so leaving this in for now...
+    // std::cout<<(*it)->surface().associatedDetectorElementIdentifier()<<std::endl;      
+    if ((*it)->surface().associatedDetectorElementIdentifier()==tmpInt) {
+      VP1Msg::messageVerbose("TrackHandle_TrkTrack::containsDetElement FOUND " + id + "!");
+      return true;  
+    }
+    if ((*it)->surface().associatedDetectorElementIdentifier()==tmpInt2) {
+      VP1Msg::messageVerbose("TrackHandle_TrkTrack::containsDetElement FOUND 2 " + id + "!");
+      return true;  
+    }
+  }
+  return false;
+}
\ No newline at end of file
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackSystemController.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackSystemController.cxx
index 8e3a21d8bd40..0f91252fa8cc 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackSystemController.cxx
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackSystemController.cxx
@@ -134,6 +134,7 @@ public:
   VP1Interval last_cutAllowedEta;
   QList<VP1Interval> last_cutAllowedPhi;
   QList<unsigned> last_cutRequiredNHits;
+  QString last_cutRequiredDetectorElement;
   bool last_cutTruthFromIROnly = false;
   bool last_cutExcludeBarcodeZero = false;
   bool last_cutTruthExcludeNeutrals = false;
@@ -469,6 +470,10 @@ TrackSystemController::TrackSystemController(IVP1System * sys)
   connectToLastUpdateSlot(m_d->ui_cuts.spinBox_cut_nhits_muon);
   connectToLastUpdateSlot(m_d->ui_cuts.spinBox_cut_nprecisionhits_muon);
 
+// Required detector element
+  connect(m_d->ui_cuts.checkBox_requireDetectorElement,SIGNAL(toggled(bool)),this,SLOT(possibleChange_cutRequiredDetectorElement()));
+  connect(m_d->ui_cuts.lineEdit_detectorElementId,SIGNAL(textChanged(QString)),this,SLOT(possibleChange_cutRequiredDetectorElement()));
+
   // -> cutTruthFromIROnly
   addUpdateSlot(SLOT(possibleChange_cutTruthFromIROnly()));
   connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_truthtracks_creationvertexinIR);
@@ -1839,6 +1844,12 @@ QList<unsigned> TrackSystemController::cutRequiredNHits() const
   return l;
 }
 
+QString TrackSystemController::cutRequiredDetectorElement() const {
+  QString tmp = m_d->ui_cuts.checkBox_requireDetectorElement->isChecked() ? m_d->ui_cuts.lineEdit_detectorElementId->text(): QString();
+  return tmp;
+}
+
+
 //____________________________________________________________________
 bool TrackSystemController::cutTruthFromIROnly() const
 {
@@ -2249,6 +2260,7 @@ POSSIBLECHANGE_IMP(cutAllowedPt)
 POSSIBLECHANGE_IMP(cutAllowedEta)
 POSSIBLECHANGE_IMP(cutAllowedPhi)
 POSSIBLECHANGE_IMP(cutRequiredNHits)
+POSSIBLECHANGE_IMP(cutRequiredDetectorElement)
 POSSIBLECHANGE_IMP(cutTruthFromIROnly)
 POSSIBLECHANGE_IMP(cutExcludeBarcodeZero)
 POSSIBLECHANGE_IMP(cutTruthExcludeNeutrals)
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/pertrackcollectionsettings_form.ui b/graphics/VP1/VP1Systems/VP1TrackSystems/src/pertrackcollectionsettings_form.ui
index b7ab8c2fb649..365692606d4a 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/pertrackcollectionsettings_form.ui
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/pertrackcollectionsettings_form.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>492</width>
-    <height>640</height>
+    <height>669</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -279,36 +279,17 @@
            <property name="spacing">
             <number>1</number>
            </property>
-           <item row="1" column="0">
-            <widget class="QCheckBox" name="checkBox_cut_nhits_pixel">
-             <property name="toolTip">
-              <string>Hide tracks without this many pixel hits. Only applies to tracks with ID information.</string>
-             </property>
+           <item row="6" column="0">
+            <widget class="QCheckBox" name="checkBox_requireDetectorElement">
              <property name="text">
-              <string>Require Pixel hits:</string>
+              <string>Require Detector Element</string>
              </property>
             </widget>
            </item>
-           <item row="1" column="1">
-            <widget class="QSpinBox" name="spinBox_cut_nhits_pixel"/>
-           </item>
-           <item row="2" column="0">
-            <widget class="QCheckBox" name="checkBox_cut_nhits_sct">
-             <property name="toolTip">
-              <string>Hide tracks without this many SCT hits. Only applies to tracks with ID information.</string>
-             </property>
+           <item row="4" column="0">
+            <widget class="QCheckBox" name="checkBox_cut_nhits_muon">
              <property name="text">
-              <string>Require SCT hits:</string>
-             </property>
-             <property name="checked">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="1">
-            <widget class="QSpinBox" name="spinBox_cut_nhits_sct">
-             <property name="value">
-              <number>1</number>
+              <string>Require Muon hits:</string>
              </property>
             </widget>
            </item>
@@ -325,13 +306,13 @@
            <item row="4" column="1">
             <widget class="QSpinBox" name="spinBox_cut_nhits_muon"/>
            </item>
-           <item row="3" column="1">
-            <widget class="QSpinBox" name="spinBox_cut_nhits_trt"/>
-           </item>
-           <item row="4" column="0">
-            <widget class="QCheckBox" name="checkBox_cut_nhits_muon">
+           <item row="1" column="0">
+            <widget class="QCheckBox" name="checkBox_cut_nhits_pixel">
+             <property name="toolTip">
+              <string>Hide tracks without this many pixel hits. Only applies to tracks with ID information.</string>
+             </property>
              <property name="text">
-              <string>Require Muon hits:</string>
+              <string>Require Pixel hits:</string>
              </property>
             </widget>
            </item>
@@ -342,9 +323,45 @@
              </property>
             </widget>
            </item>
+           <item row="1" column="1">
+            <widget class="QSpinBox" name="spinBox_cut_nhits_pixel"/>
+           </item>
+           <item row="2" column="1">
+            <widget class="QSpinBox" name="spinBox_cut_nhits_sct">
+             <property name="value">
+              <number>1</number>
+             </property>
+            </widget>
+           </item>
+           <item row="2" column="0">
+            <widget class="QCheckBox" name="checkBox_cut_nhits_sct">
+             <property name="toolTip">
+              <string>Hide tracks without this many SCT hits. Only applies to tracks with ID information.</string>
+             </property>
+             <property name="text">
+              <string>Require SCT hits:</string>
+             </property>
+             <property name="checked">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item row="3" column="1">
+            <widget class="QSpinBox" name="spinBox_cut_nhits_trt"/>
+           </item>
            <item row="5" column="1">
             <widget class="QSpinBox" name="spinBox_cut_nprecisionhits_muon"/>
            </item>
+           <item row="6" column="1">
+            <widget class="QLineEdit" name="lineEdit_detectorElementId">
+             <property name="toolTip">
+              <string>Only show tracks which contain this detector element. So will not select tracks with no parameter on this detector element.</string>
+             </property>
+             <property name="placeholderText">
+              <string>Identifier</string>
+             </property>
+            </widget>
+           </item>
           </layout>
          </item>
          <item>
@@ -506,17 +523,17 @@ p, li { white-space: pre-wrap; }
   </layout>
  </widget>
  <customwidgets>
-  <customwidget>
-   <class>VP1MaterialButton</class>
-   <extends>QPushButton</extends>
-   <header>VP1Base/VP1MaterialButton.h</header>
-  </customwidget>
   <customwidget>
    <class>VP1EtaPhiCutWidget</class>
    <extends>QWidget</extends>
    <header>VP1Base/VP1EtaPhiCutWidget.h</header>
    <container>1</container>
   </customwidget>
+  <customwidget>
+   <class>VP1MaterialButton</class>
+   <extends>QPushButton</extends>
+   <header>VP1Base/VP1MaterialButton.h</header>
+  </customwidget>
  </customwidgets>
  <resources/>
  <connections>
diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/settings_cuts_form.ui b/graphics/VP1/VP1Systems/VP1TrackSystems/src/settings_cuts_form.ui
index c330815f3e07..860ae8d809be 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/settings_cuts_form.ui
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/settings_cuts_form.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>390</width>
-    <height>464</height>
+    <width>407</width>
+    <height>550</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -139,19 +139,13 @@
         <property name="spacing">
          <number>1</number>
         </property>
-        <item row="0" column="0">
-         <widget class="QCheckBox" name="checkBox_cut_nhits_pixel">
-          <property name="toolTip">
-           <string>Hide tracks without this many pixel hits. Only applies to tracks with ID information.</string>
-          </property>
+        <item row="4" column="0">
+         <widget class="QCheckBox" name="checkBox_cut_nprecisionhits_muon">
           <property name="text">
-           <string>Require Pixel hits:</string>
+           <string>Require Precision Muon hits:</string>
           </property>
          </widget>
         </item>
-        <item row="0" column="1">
-         <widget class="QSpinBox" name="spinBox_cut_nhits_pixel"/>
-        </item>
         <item row="1" column="0">
          <widget class="QCheckBox" name="checkBox_cut_nhits_sct">
           <property name="toolTip">
@@ -165,13 +159,6 @@
           </property>
          </widget>
         </item>
-        <item row="1" column="1">
-         <widget class="QSpinBox" name="spinBox_cut_nhits_sct">
-          <property name="value">
-           <number>1</number>
-          </property>
-         </widget>
-        </item>
         <item row="2" column="0">
          <widget class="QCheckBox" name="checkBox_cut_nhits_trt">
           <property name="toolTip">
@@ -182,12 +169,23 @@
           </property>
          </widget>
         </item>
-        <item row="2" column="1">
-         <widget class="QSpinBox" name="spinBox_cut_nhits_trt"/>
+        <item row="5" column="0">
+         <widget class="QCheckBox" name="checkBox_requireDetectorElement">
+          <property name="text">
+           <string>Require Detector Element</string>
+          </property>
+         </widget>
         </item>
         <item row="3" column="1">
          <widget class="QSpinBox" name="spinBox_cut_nhits_muon"/>
         </item>
+        <item row="1" column="1">
+         <widget class="QSpinBox" name="spinBox_cut_nhits_sct">
+          <property name="value">
+           <number>1</number>
+          </property>
+         </widget>
+        </item>
         <item row="3" column="0">
          <widget class="QCheckBox" name="checkBox_cut_nhits_muon">
           <property name="text">
@@ -195,16 +193,35 @@
           </property>
          </widget>
         </item>
-        <item row="4" column="0">
-         <widget class="QCheckBox" name="checkBox_cut_nprecisionhits_muon">
+        <item row="0" column="0">
+         <widget class="QCheckBox" name="checkBox_cut_nhits_pixel">
+          <property name="toolTip">
+           <string>Hide tracks without this many pixel hits. Only applies to tracks with ID information.</string>
+          </property>
           <property name="text">
-           <string>Require Precision Muon hits:</string>
+           <string>Require Pixel hits:</string>
           </property>
          </widget>
         </item>
         <item row="4" column="1">
          <widget class="QSpinBox" name="spinBox_cut_nprecisionhits_muon"/>
         </item>
+        <item row="0" column="1">
+         <widget class="QSpinBox" name="spinBox_cut_nhits_pixel"/>
+        </item>
+        <item row="2" column="1">
+         <widget class="QSpinBox" name="spinBox_cut_nhits_trt"/>
+        </item>
+        <item row="5" column="1">
+         <widget class="QLineEdit" name="lineEdit_detectorElementId">
+          <property name="toolTip">
+           <string>Only show tracks which contain this detector element. So will not select tracks with no parameter on this detector element.</string>
+          </property>
+          <property name="placeholderText">
+           <string>Identifier</string>
+          </property>
+         </widget>
+        </item>
        </layout>
       </item>
       <item>
-- 
GitLab


From 960183c1a77ecb63d5bd8f577c5f20866f2cc902 Mon Sep 17 00:00:00 2001
From: Edward Moyse <edward.moyse@cern.ch>
Date: Wed, 8 Sep 2021 14:21:03 +0200
Subject: [PATCH 016/347] Fix for ATLASVPONE-529

---
 graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackHandleBase.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackHandleBase.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackHandleBase.cxx
index a593cb534480..1c44f5250fea 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackHandleBase.cxx
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackHandleBase.cxx
@@ -1604,7 +1604,7 @@ bool TrackHandleBase::isIDTrack() const
 {
   std::optional<Amg::Vector3D> start = startPoint();
   if (!start) return false;
-  return start->perp()<1100 &&fabs( start->z())>3500;
+  return start->perp()<1100 &&fabs( start->z())<3500;
 }
 
 //____________________________________________________________________
-- 
GitLab


From 20f6339287af8642446c5a1dccb94eddc31ebfed Mon Sep 17 00:00:00 2001
From: Harry Simpson <harry.simpson@cern.ch>
Date: Wed, 8 Sep 2021 16:04:07 +0200
Subject: [PATCH 017/347] Update Tag and Probe Job

---
 .../TrigInDetValidation/python/TrigInDetArtSteps.py  |  9 ++++-----
 .../TrigInDetValidation/share/comparitor.json        |  5 ++++-
 .../test/test_trigID_el_zee_pu40_TnP.py              | 12 ++++++++----
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index 07cf0387241c..f9c3bba04f9c 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -93,18 +93,17 @@ class TrigInDetReco(ExecStep):
                 chains += "'HLT_e5_idperf_loose_lrtloose_L1EM3',"
                 chains += "'HLT_e26_idperf_loose_lrtloose_L1EM22VHI',"
                 flags += 'doEgammaSlice=True;'
-            if (i=='electron') :
+            if ('electron' in i) :
                 # chains +=  "'HLT_e5_etcut_L1EM3',"  ## need an idperf chain once one is in the menu
-                # chains +=  "'HLT_e17_lhvloose_nod0_L1EM15VH'," 
+                # chains +=  "'HLT_e17_lhvloose_nod0_L1EM15VH',"
                 chains += "'HLT_e26_gsf_lhtight_ivarloose_L1EM22VHI',"
                 chains += "'HLT_e26_idperf_loose_L1EM24VHI',"
                 chains += "'HLT_e28_idperf_loose_L1EM24VHI',"
                 chains += "'HLT_e5_idperf_loose_L1EM3',"
                 chains += "'HLT_e5_idperf_tight_L1EM3',"
                 flags += 'doEgammaSlice=True;'
-            if (i=='electron-tnp') :
-                chains += "'HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI',"
-                flags += 'doEgammaSlice=True;'
+                if ('tnp' in i) :
+                    chains += "'HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI',"
             if (i=='tau') :
                 chains +=  "'HLT_tau25_idperf_tracktwo_L1TAU12IM',"
                 chains +=  "'HLT_tau25_idperf_tracktwoMVA_L1TAU12IM',"
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
index 9864f4586ba7..932670d8ca21 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
@@ -77,7 +77,10 @@
     "EFbphys":{ 
 	"chains" : "HLT_2mu4_bBmumux_BsmumuPhi_L12MU4:HLT_IDTrack_Bmumux_FTF  HLT_2mu4_bBmumux_BsmumuPhi_L12MU4:HLT_IDTrack_Bmumux_IDTrig"
     },
-    "TagnProbe":{
+    "L2electronTnP":{
+	"chains" : "HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1"
+    },
+    "EFelectronTnP":{
 	"chains" : "HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1 HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:HLT_Roi_FastElectron:1"
     }
 }
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py
index e62281e68546..670bde036701 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py
@@ -36,12 +36,16 @@ Release = "current"
 GridFiles = True
 preinclude_file = 'all:TrigInDetValidation/TIDV_cond_fix.py' #conditions fix for ATR-23982. In future find a more recent RDO 
 
-Jobs = [( "Offline",     " TIDAdata-run3-offline-TnP.dat -r Offline -o data-hists-offline-TnP.root" ) ]
-
-Comp = [( "TagnProbe",          "TagnProbe",       "data-hists-offline-TnP.root", " -c TIDAhisto-panel-TnP.dat  -d HLT-plots-TnP " ) ]
-
+Jobs = [( "Truth",       " TIDAdata-run3.dat                        -o data-hists.root -p 11" ),
+        ( "Offline",     " TIDAdata-run3-offline-TnP.dat -r Offline -o data-hists-offline.root" )] 
+ 
+Comp = [( "L2ele",              "L2electron",      "data-hists.root",         " -c TIDAhisto-panel.dat      -d HLTL2-plots " ),
+        ( "L2eleoffline",       "L2electronTnP",      "data-hists-offline.root", " -c TIDAhisto-panel-TnP.dat  -d HLTL2-plots-offline " ),
+        ( "EFele",              "EFelectron",      "data-hists.root",         " -c TIDAhisto-panel.dat      -d HLTEF-plots " ),
+        ( "EFeleoffline",       "EFelectronTnP",      "data-hists-offline.root", " -c TIDAhisto-panel-TnP.dat  -d HLTEF-plots-offline " ) ]
 
 
+    
 
 from AthenaCommon.Include import include 
 include("TrigInDetValidation/TrigInDetValidation_Base.py")
-- 
GitLab


From e4ba540d56c62f2e65e86b3dea87247399f8e4bf Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Wed, 8 Sep 2021 16:28:36 +0200
Subject: [PATCH 018/347] 22.0-cppcheck-InDetCoolCoralClientUtils

---
 .../src/CoolCoralClient.cpp                   | 391 +++---------------
 1 file changed, 47 insertions(+), 344 deletions(-)

diff --git a/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp b/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp
index cddbeea1bc71..05b4a3dec3bc 100644
--- a/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp
+++ b/InnerDetector/InDetConditions/InDetCoolCoralClientUtils/src/CoolCoralClient.cpp
@@ -72,12 +72,9 @@
 #include "CoolKernel/RecordSpecification.h"
 #include "CoolKernel/FolderSpecification.h"
 
-//#include "CoolKernel/ExtendedAttributeListSpecification.h"
-//#include "CoolKernel/AttributeListSpecification.h"
+
 #include "InDetCoolCoralClientUtils/CORAL-utils.h"
-//#include "TRT_defs.h"
 
-//#include "RCDConnectionService.h"
 #include "InDetCoolCoralClientUtils/ConfDBif.h"
 
 #include "InDetCoolCoralClientUtils/CoolCoralClient.h"
@@ -247,7 +244,6 @@ void COOLCORALClient::printTables()
   for ( std::set<std::string>::const_iterator tName = tables.begin(); tName != tables.end(); ++tName ){
     if(m_verbose) std::cout << "\t" << *tName << std::endl;
   }
-  //    if(m_verbose) std::cout << std::endl;
 }
 
 
@@ -255,10 +251,8 @@ void COOLCORALClient::printTables()
 /// Get the content of a table identified by an input string on the database and print it on stdout.
 void COOLCORALClient::printTableContent(const std::string& tableName){
     
-  //    std::string tableName = "BDTMROC";
-  //    std::string colName = "Thresh0_Low_FE";
+
   if(m_verbose) std::cout << "\nCOOLCORAL Client:" << tableName <<" Table content" << std::endl;
-  //    short T;
    
   m_session->transaction().start();
     
@@ -268,14 +262,6 @@ void COOLCORALClient::printTableContent(const std::string& tableName){
   coral::ICursor& cursor = query->execute();
   int nRows = 0;
   while ( cursor.next() ) {
-    //    cursor.currentRow().toOutputStream( std::cout ) << std::endl;
-    //    if(m_verbose) std::cout<<std::endl;
-    /*
-      coral::AttributeList sel = cursor.currentRow();
-      if(m_verbose) std::cout<< "Column   "<< colName << "  contain : ";
-      T = sel[colName].data<short>();
-      printf("%d \n", T);
-    */
     ++nRows;
   }
   delete query;
@@ -283,8 +269,7 @@ void COOLCORALClient::printTableContent(const std::string& tableName){
   printf("Total  %d    records\n", nRows);
   m_session->transaction().commit();
 
-  //if(m_verbose) std::cout<< "Column   "<< colName << "  contain : ";
-  //printf("%d",thresh[1]);
+
     
 
 }
@@ -375,13 +360,7 @@ void COOLCORALClient::createTables(const std::string& part_trt){
   // Unfortunately, there is no easy/standard way of having the
   // database server automatically assigning a value to a PK
 
-  /*
-    tmp_strings.clear();
-    tmp_strings.push_back ("ttc_iovfk");
-    // Define primary key
-    ttc_columns.setPrimaryKey( tmp_string );
-    ttc_columns->setNotNullConstraint ("ttc_iovfk");
-  */
+ 
   // put an index on const
   if (part_trt=="barrel"){
     tmp_strings.clear();
@@ -390,9 +369,7 @@ void COOLCORALClient::createTables(const std::string& part_trt){
 
     tmp_strings.clear();
     tmp_strings.emplace_back("ttc_iovfk");
-    // Define primary key
-    //	      ttc_columns.setPrimaryKey( tmp_strings );
-    // ttc_columns.setNotNullConstraint ("ttc_iovfk");
+   
     // Define index
     ttc_columns.createIndex ("bttcio_idx", tmp_strings);
 
@@ -407,9 +384,7 @@ void COOLCORALClient::createTables(const std::string& part_trt){
 
     tmp_strings.clear();
     tmp_strings.emplace_back("ttc_iovfk");
-    // Define primary key
-    //	      ttc_columns.setPrimaryKey( tmp_strings );
-    //  ttc_columns.setNotNullConstraint ("ttc_iovfk");
+   
     // Define index
     ttc_columns.createIndex ("ettcio_idx", tmp_strings);
 
@@ -457,13 +432,7 @@ void COOLCORALClient::createTables(const std::string& part_trt){
   // Unfortunately, there is no easy/standard way of having the
   // database server automatically assigning a value to a PK
 
-  /*
-    tmp_strings.clear();
-    tmp_strings.push_back ("ttc_iovfk");
-    // Define primary key
-    ttc_columns.setPrimaryKey( tmp_string );
-    ttc_columns->setNotNullConstraint ("ttc_iovfk");
-  */
+ 
   // put an index on const
   if (part_trt=="barrel"){
     tmp_strings.clear();
@@ -544,15 +513,7 @@ void COOLCORALClient::createTables(const std::string& part_trt){
   rod_columns.insertColumn( "rod_tag",
 			    coral::AttributeSpecification::typeNameForId( typeid(std::string) ) );
 
-  // Use creationTime as primary key
-  // Unfortunately, there is no easy/standard way of having the
-  // database server automatically assigning a value to a PK
-  /*
-    tmp_strings.clear();
-    tmp_strings.push_back ("rod_iovfk");
-    rod_columns.setPrimaryKey (tmp_strings);
-    rod_columns.setNotNullConstraint ("rod_iovfk");
-  */
+ 
   // put an index on const
   if (part_trt=="barrel"){
     tmp_strings.clear();
@@ -643,15 +604,7 @@ void COOLCORALClient::createTables(const std::string& part_trt){
 			       coral::AttributeSpecification::typeNameForId( typeid(std::string) ) );
 
 
-  // Use creationTime as primary key
-  // Unfortunately, there is no easy/standard way of having the
-  // database server automatically assigning a value to a PK
-  /*
-    tmp_strings.clear();
-    tmp_strings.push_back ("dtmroc_iovfk");
-    dtmroc_columns.setPrimaryKey (tmp_strings);
-    dtmroc_columns.setNotNullConstraint ("dtmroc_iovfk");
-  */
+
   // put an index on const
   if (part_trt=="barrel"){
     tmp_strings.clear();
@@ -776,8 +729,7 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
 
   // iovfk is time in nanoseconds
   nunc_usecs = (nunc_time.tv_sec) * 1000000 + (nunc_time.tv_usec);
-  //nunc_usecs = (nunc_time.tv_usec);
-  //    iovfkttc = (unsigned long long) nunc_usecs/10;
+ 
 
   std::string TTC_TABLE;
   std::string TTCGR_TABLE;
@@ -803,7 +755,7 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
   coral::ITableDataEditor& ttc_editor = m_session->nominalSchema().tableHandle(TTC_TABLE ).dataEditor();
   coral::AttributeList ttc_row ATLAS_THREAD_SAFE; // Not shared, so ok.
   ttc_editor.rowBuffer(ttc_row);
-  // ttc_row.toOutputStream( std::cout ) << std::endl;
+ 
   //--------
   // TRT-TTC quantities
 
@@ -831,7 +783,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
   const char* filename="ttc.dat";
   if (part_trt=="barrel"){
     filename = "RCDTTC.dat";
-    //filename = "TTC06.dat";
   }
   else if (part_trt=="endcap"){
     filename = "ECRCDTTC.dat";
@@ -851,7 +802,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
 	   >>  clocksource >> ttcname 
 	   >>  tfragtype >> tcomment;
 	    
-      //	    if(m_verbose) std::cout << "Read TTC data done..." << std::endl;
 	
 
       ttc_row["ttc_UID"].setValue <int> (tuid);
@@ -871,7 +821,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
 
       run++;
 	    
-      //ttc_editor.insertRow(ttc_row);
       ttc_bulk->processNextIteration();
     }
   } 
@@ -891,7 +840,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
   coral::ITableDataEditor& ttcgr_editor = m_session->nominalSchema().tableHandle(TTCGR_TABLE ).dataEditor();
   coral::AttributeList ttcgr_row ATLAS_THREAD_SAFE; // Not shared, so ok.
   ttcgr_editor.rowBuffer(ttcgr_row);
-  // ttc_row.toOutputStream( std::cout ) << std::endl;
   //--------
   // TRT-TTC quantities
 
@@ -926,20 +874,15 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
 	
   run=0;	
 	
-  //		ifstream itGRfile ("RCDTTCGROUP.dat");
-  //		ifstream itGRfile ("TTCGROUPTEMP.dat");
-
+ 
   if (part_trt=="barrel"){
     filename = "RCDTTCGROUP.dat";
-    // filename = "TTCGROUPTEMP.dat";
   }
   else if (part_trt=="endcap"){
     filename = "ECRCDTTCGROUP.dat";
   }
 
   ifstream itGRfile (filename);
-  //	ifstream itGRfile ("ECRCDTTCGROUP.dat");
-  //	std::vector<char> buffer(999);
   if (itGRfile.is_open()){
     while (itGRfile.getline(&buffer[0],999,'\n')) {
       std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0]));
@@ -981,7 +924,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
 
       run++;
 	    
-      //ttc_editor.insertRow(ttcgr_row);
       ttcgr_bulk->processNextIteration();
     }
   } 
@@ -1033,7 +975,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
   run=0;
   if (part_trt=="barrel"){
     filename = "RCDROD.dat";
-    //filename = "ROD06.dat";
   }
   else if (part_trt=="endcap"){
     filename = "ECRCDROD.dat";
@@ -1099,7 +1040,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
   coral::ITableDataEditor& dtmroc_editor = m_session->nominalSchema().tableHandle(DTMROC_TABLE ).dataEditor();
   coral::AttributeList dtmroc_row ATLAS_THREAD_SAFE; // Not shared, so ok.
   dtmroc_editor.rowBuffer(dtmroc_row);
-  //    dtmroc_row.toOutputStream( std::cout ) << std::endl;
   coral::IBulkOperation* dtmroc_bulk= dtmroc_editor.bulkInsert(dtmroc_row,32);
 	
   unsigned int uid;
@@ -1124,7 +1064,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
   run=0;
   if (part_trt=="barrel"){
     filename = "RCDDTMROC.dat";
-    //filename = "DTMROC06.dat";
   }
   else if (part_trt=="endcap"){
     filename = "ECRCDDTMROC.dat";
@@ -1206,7 +1145,6 @@ void COOLCORALClient::fillTables(const std::string& part_trt){
 
 
   printf("Total: %d  rows\n",run);
-  //if(m_verbose) std::cout<<std::endl;
 
 
   // measuring elapsed time
@@ -1287,13 +1225,7 @@ void COOLCORALClient::createConnect(const std::string& part_trt){
   // Unfortunately, there is no easy/standard way of having the
   // database server automatically assigning a value to a PK
 
-  /*
-    tmp_strings.clear();
-    tmp_strings.push_back ("ttc_iovfk");
-    // Define primary key
-    bconn_columns.setPrimaryKey( tmp_string );
-    bconn_columns->setNotNullConstraint ("ttc_iovfk");
-  */
+  
   // put an index on const
   if (part_trt=="barrel"){
     tmp_strings.clear();
@@ -1368,7 +1300,6 @@ void COOLCORALClient::createConnect(const std::string& part_trt){
   ifstream itAfile (filename);
 
 	
-  //ifstream itAfile ("ConnectTable.dat");
   std::vector<char> buffer(999);
   if (itAfile.is_open()){
     while (itAfile.getline(&buffer[0],999,'\n')) {
@@ -1398,12 +1329,9 @@ void COOLCORALClient::createConnect(const std::string& part_trt){
 	bconn_row["phi2"].setValue <int> (phi[1]);
       }
 	    
-      //	    bconn_row["phi3"].setValue <int> (0);
-      //  bconn_row["phi4"].setValue <int> (0);
-
+   
       run++;
 	    
-      //ttc_editor.insertRow(ttc_row);
       bconn_bulk->processNextIteration();
     }
   } 
@@ -1411,7 +1339,6 @@ void COOLCORALClient::createConnect(const std::string& part_trt){
 
   itAfile.close();
 
-  //	ttc_fld->flushStorageBuffer();	    
 
   bconn_bulk->flush();
   delete bconn_bulk;
@@ -1554,7 +1481,6 @@ int COOLCORALClient::GetTTCdummy(int ttc_id){
   query0->setCondition( ttc_cond, ttc_condData);
         
 
-  //ttc_id = (part_nr+4)*10000+crate_id*100+slot_id;    
   ttc_condData[0].data<int>() = ttc_id;
 
   if(m_verbose) std::cout << "TTC ID = " << ttc_id << std::endl;
@@ -1726,10 +1652,7 @@ int COOLCORALClient::GetTTCdummy(int ttc_id){
     (end_time.tv_usec-start_time.tv_usec);
   if(m_verbose) std::cout << "Total time was " << total_usecs << " usec" << std::endl;
 
-  // 	for (size_t k = 0; k < ttc_params.size(); k++) {
-  // 	  delete ttc_params[k];
-  // 	}
-
+ 
   return 1;
 
 }
@@ -1778,11 +1701,7 @@ TTCobj_t* COOLCORALClient::GetTTC(int ttc_id){
   coral::IQuery* query00 = m_session->nominalSchema().tableHandle(BCONNECT_TABLE).newQuery();
 
   query00->addToOutputList("phi" ); 
-  //   query00->addToOutputList("phi2" ); 
-  //    if (part_nr <33){
-  //   query00->addToOutputList("phi3" ); 
-  //  query00->addToOutputList("phi4" ); 
-  // }
+
 
   std::string conn_cond = BCONNECT_TABLE;
   conn_cond += ".Partition = :part_nr AND ";
@@ -1812,12 +1731,7 @@ TTCobj_t* COOLCORALClient::GetTTC(int ttc_id){
 
       
     if ( row00[0].data<int>()>0) phi.push_back(row00[0].data<int>());
-    //       if ( row00[1].data<int>()>0) phi.push_back(row00[1].data<int>());
-    //       if (part_nr<33){
-    // 	if ( row00[2].data<int>()>0) phi.push_back(row00[2].data<int>());
-    // 	if ( row00[3].data<int>()>0) phi.push_back(row00[3].data<int>());
-    //       }
-
+   
     nRowsM++;
   }
   delete query00;
@@ -1848,7 +1762,6 @@ TTCobj_t* COOLCORALClient::GetTTC(int ttc_id){
 
   ttc_condData[0].data<int>() = ttc_id;
 
-  //    if(m_verbose) std::cout << "TTC ID = " << ttc_id << std::endl;
 
   // query on TTCGROUP
 
@@ -1867,7 +1780,6 @@ TTCobj_t* COOLCORALClient::GetTTC(int ttc_id){
   ttcgr_cond +=  ".ttcgr_UID <= :ttcgr1";
 
 
-  //"BTTCGR.ttcgr_UID >= :ttcgr0 AND BTTCGR.ttcgr_UID <= :ttcgr1";
 
   coral::AttributeList ttcgr_condData ATLAS_THREAD_SAFE; // Not shared, so ok.
   ttcgr_condData.extend<int>( "ttcgr0" );
@@ -1931,19 +1843,10 @@ TTCobj_t* COOLCORALClient::GetTTC(int ttc_id){
     ttcgr_condData[0].data<int>() = ttc_id*10;
 
     int nrgroups=3;
-    // dangerous fixed number: to be understood
-
-    //      if (part_nr<33){
-    //	nrgroups = phi.size() - 1;
-    // }
-    // else if (part_nr>=33){
-    //	nrgroups = 2*phi.size()-1;
-    // }
+   
 
     ttcgr_condData[1].data<int>() = ttc_id*10 + nrgroups;
 
-    //      if(m_verbose) std::cout << "TTCGROUP = " << ttcgr_condData[0].data<int>() << std::endl;
-    // if(m_verbose) std::cout << "TTCGROUP = " << ttcgr_condData[1].data<int>() << std::endl;
     coral::ICursor& cursor1 = query1->execute();
     while ( cursor1.next() ) {
       const coral::AttributeList &row1 = cursor1.currentRow();
@@ -1989,12 +1892,7 @@ TTCobj_t* COOLCORALClient::GetTTC(int ttc_id){
     dtmroc_condData[1].data<int>() = part_nr*100000+phi[phi.size()-1]*1000+
       (nrdtmrocs-1);
     
-    //    if(m_verbose) std::cout << "DTMROC from " << part_nr*100000+phi[0]*1000+1 
-    //   	      << " to " << part_nr*100000+phi[phi.size()-1]*1000+nrdtmrocs 
-    //   	      << std::endl;
-
-    
-    
+ 
 
     coral::ICursor& cursor2 = query2->execute();
     while ( cursor2.next() ) {
@@ -2024,7 +1922,6 @@ TTCobj_t* COOLCORALClient::GetTTC(int ttc_id){
     delete query2;query2=nullptr;
  
 
-    //      ttc_params.push_back(ttc_param);
     ++nRows;
   }
   delete query0;
@@ -2038,10 +1935,7 @@ TTCobj_t* COOLCORALClient::GetTTC(int ttc_id){
     (end_time.tv_usec-start_time.tv_usec);
   if(m_verbose) std::cout << "Total time was " << total_usecs << " usec" << std::endl;
 
-  // 	for (size_t k = 0; k < ttc_params.size(); k++) {
-  // 	  delete ttc_params[k];
-  // 	}
-
+ 
 
   if(m_verbose) std::cout << "****************************" << std::endl;
   if(m_verbose) std::cout << "* Total " << nRowsM << " Mapping records  *" << std::endl;
@@ -2061,7 +1955,6 @@ TTCobj_t* COOLCORALClient::GetTTC(int ttc_id){
 /// data structure, therefore also info from DTMROCs connected
 /// are retrieved
 RODobj_t* COOLCORALClient::GetROD(int rod_id){
-  //    if(m_verbose) std::cout << "\nGet ROD Queries and SubQueries"  << std::endl;
 
 
   struct timeval start_time{}, end_time{};
@@ -2080,10 +1973,7 @@ RODobj_t* COOLCORALClient::GetROD(int rod_id){
   if (part_nr<33) {
     nrdtmrocs = 104;
   }
-  //    else if (part_nr>=33) {
-  //   nrdtmrocs = 120;
-  //  }
-
+  
   if (part_nr>=33) {
     if (rod_id%2==0){
       phi_id = phi_id/2;
@@ -2097,11 +1987,7 @@ RODobj_t* COOLCORALClient::GetROD(int rod_id){
     }
   }
 
-  //     if(m_verbose) std::cout << "ROD_ID = " << rod_id << std::endl;
-  //     if(m_verbose) std::cout << "phi_id = " << phi_id << std::endl;
-  //     if(m_verbose) std::cout << "first roc = " << firstroc << std::endl;
-  //     if(m_verbose) std::cout << "nr of roc = " << nrdtmrocs << std::endl;
-
+ 
 
   std::string TTC_TABLE;
   std::string TTCGR_TABLE;
@@ -2133,12 +2019,10 @@ RODobj_t* COOLCORALClient::GetROD(int rod_id){
   query0->addToOutputList("GolDelay2" ); 
   query0->addToOutputList("GolDelay3" ); 
   query0->addToOutputList("RODDetID" ); 
-  //    query0->addToOutputList("FEMode" ); 
 
   std::string rod_cond = ROD_TABLE;
   rod_cond += ".rod_UID = :rodnr";
 
-  //"BROD.rod_UID = :rodnr";
   coral::AttributeList rod_condData ATLAS_THREAD_SAFE; // Not shared, so ok.
   rod_condData.extend<int>( "rodnr" );
     
@@ -2147,7 +2031,6 @@ RODobj_t* COOLCORALClient::GetROD(int rod_id){
 
   rod_condData[0].data<int>() = rod_id;
 
-  //    if(m_verbose) std::cout << "ROD ID = " << rod_id << std::endl;
 
     
   // query on dtmroc
@@ -2174,7 +2057,6 @@ RODobj_t* COOLCORALClient::GetROD(int rod_id){
   dtmroc_cond += ".dtmroc_UID >= :roc1 AND ";
   dtmroc_cond += DTMROC_TABLE;
   dtmroc_cond += ".dtmroc_UID <= :roc104";
-  //    std::string dtmroc_cond = "BDTMROC.dtmroc_UID >= :roc1 AND BDTMROC.dtmroc_UID <= :roc104";
   coral::AttributeList dtmroc_condData ATLAS_THREAD_SAFE; // Not shared, so ok.
   dtmroc_condData.extend<int>( "roc1" );
   dtmroc_condData.extend<int>( "roc104" );
@@ -2289,17 +2171,12 @@ void COOLCORALClient::dropFolders(const std::string& part_trt){
   if(m_verbose) std::cout <<  ROD_FOLDER << std::endl;
   if(m_verbose) std::cout <<  DTMROC_FOLDER << std::endl;
   if(m_verbose) std::cout <<  ROOT_FOLDER << std::endl;
-    
 
-  //if(m_db->existsFolder("/folder1")) m_db->dropNode("/folder1");
-  //m_db->createFolderSet("/folder1");
   m_db->dropNode(TTC_FOLDER);
   m_db->dropNode(TTCGR_FOLDER);
   m_db->dropNode(ROD_FOLDER);
   m_db->dropNode(DTMROC_FOLDER);
-  //    dbSvc.dropDatabase( m_dbId );
   m_db->dropNode(ROOT_FOLDER);
-  //    m_db->dropDatabase();
 
   gettimeofday(&end_time, nullptr);
   total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 +
@@ -2366,22 +2243,15 @@ void COOLCORALClient::createFolders(const std::string& part_trt){
     m_db->createFolderSet(ROOT_FOLDER);
   }
 
-  //    cool::ExtendedAttributeListSpecification spec_ttc;
-  //    spec_ttc.push_back("ttc_UID","unsigned int");
-  //    spec_ttc.push_back("ttc_iovfk","unsigned long long");
-  //    spec_ttc.push_back("tag","string");
+  
   cool::RecordSpecification spec_ttc;
   spec_ttc.extend("ttc_UID",cool::StorageType::UInt32);
   spec_ttc.extend("ttc_iovfk",cool::StorageType::UInt63);
   spec_ttc.extend("tag",cool::StorageType::String4k);
-  //   coral::AttributeSpecification::typeNameForId( typeid(std::string) ) 
   cool::FolderSpecification ttcFolderSpec(cool::FolderVersioning::SINGLE_VERSION,spec_ttc);
   m_db->createFolder(TTC_FOLDER, ttcFolderSpec , "TTC" );//why is description not athena standard?
 
-  //    cool::ExtendedAttributeListSpecification spec_ttcgr;
-  //    spec_ttcgr.push_back("ttcgr_UID","unsigned int");
-  //    spec_ttcgr.push_back("ttcgr_iovfk","unsigned long long");
-  //    spec_ttcgr.push_back("tag","string");
+  
   cool::RecordSpecification spec_ttcgr;
   spec_ttcgr.extend("ttcgr_UID",cool::StorageType::UInt32);
   spec_ttcgr.extend("ttcgr_iovfk",cool::StorageType::UInt63);
@@ -2390,10 +2260,7 @@ void COOLCORALClient::createFolders(const std::string& part_trt){
   cool::FolderSpecification ttcgrFolderSpec(cool::FolderVersioning::SINGLE_VERSION,spec_ttcgr);  
   m_db->createFolder(TTCGR_FOLDER, ttcgrFolderSpec, "TTCGR");
     
-  //    cool::ExtendedAttributeListSpecification spec_rod;
-  //    spec_rod.push_back("rod_UID","unsigned int");
-  //    spec_rod.push_back("rod_iovfk","unsigned long long");
-  //    spec_rod.push_back("tag","string");
+ 
   cool::RecordSpecification spec_rod;
   spec_rod.extend("rod_UID",cool::StorageType::UInt32);
   spec_rod.extend("rod_iovfk",cool::StorageType::UInt63);
@@ -2401,10 +2268,7 @@ void COOLCORALClient::createFolders(const std::string& part_trt){
   cool::FolderSpecification rodFolderSpec(cool::FolderVersioning::SINGLE_VERSION,spec_rod);  
   m_db->createFolder(ROD_FOLDER, rodFolderSpec, "ROD");
 
-  //    cool::ExtendedAttributeListSpecification spec_dtmroc;
-  //    spec_dtmroc.push_back("dtmroc_UID","unsigned int");
-  //    spec_dtmroc.push_back("dtmroc_iovfk","unsigned long long");
-  //    spec_dtmroc.push_back("tag","string");
+ 
   cool::RecordSpecification spec_dtmroc;
   spec_dtmroc.extend("dtmroc_UID",cool::StorageType::UInt32);
   spec_dtmroc.extend("dtmroc_iovfk",cool::StorageType::UInt63);
@@ -2455,20 +2319,16 @@ void COOLCORALClient::printFoldersContent(const std::string& part_trt){
   gettimeofday(&start_time, nullptr);
 
   if(m_verbose) std::cout << "Print folder content: " << TTC_FOLDER << std::endl;
-  //cool::IFolderPtr f1 = m_db->getFolder(TTC_FOLDER );
   cool::ValidityKey since = 0;
   cool::ValidityKey until = cool::ValidityKeyMax;
    
 
-  //printf("Max Key %d\n", until );
   cool::IObjectIteratorPtr objects = ttc_fld->browseObjects( since, until, ChannelSelection::all() );
-  //  cool::IObjectIteratorPtr objects = ttc_fld->browseObjects( since, until, 0 );
   if(m_verbose) std::cout
     << "         Id  Ch  IOV       Payload             Insertion time"
     << std::endl;
   int run=0;
   while ( objects->goToNext() ) {
-    // cool::IObjectPtr obj = objects->next();
     if(m_verbose) std::cout << objects->currentRef() << std::endl;
     run++;
   }
@@ -2479,8 +2339,7 @@ void COOLCORALClient::printFoldersContent(const std::string& part_trt){
   objects = ttcgr_fld->browseObjects( since, until, ChannelSelection::all() );
   run=0;
   while ( objects->goToNext() ) {
-    //const cool::IObject& obj = objects->currentRef();
-    //   if(m_verbose) std::cout << objects->next() << std::endl;
+   
     run++;
   }
   printf("Total: %d  rows\n",run);
@@ -2489,8 +2348,7 @@ void COOLCORALClient::printFoldersContent(const std::string& part_trt){
   objects = rod_fld->browseObjects( since, until, ChannelSelection::all() );
   run=0;
   while ( objects->goToNext() ) {
-    //const cool::IObject& obj = objects->currentRef();
-    //   if(m_verbose) std::cout << objects->next() << std::endl;
+   
     run++;
   }
   printf("Total: %d  rows\n",run);
@@ -2500,8 +2358,7 @@ void COOLCORALClient::printFoldersContent(const std::string& part_trt){
   objects = dtmroc_fld->browseObjects( since, until, ChannelSelection::all() );
   run=0;
   while ( objects->goToNext() ) {
-    //const cool::IObject& obj = objects->currentRef();
-    //      if(m_verbose) std::cout << objects->next() << std::endl;
+   
     run++;
   }
   printf("Total: %d  rows\n",run);
@@ -2587,7 +2444,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 
   gettimeofday(&nunc_time, nullptr);
 
-  //    nunc_usecs = (nunc_time.tv_sec) * 1000000 + (nunc_time.tv_usec);
   nunc_usecs = nunc_time.tv_sec;
 
 
@@ -2632,7 +2488,7 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
     
   conn_condData[0].data<long long>() = 999;
 
-  long long key;
+  long long key{0};
 
   coral::ICursor& cursor00 = query00->execute();
   while ( cursor00.next() ) {
@@ -2672,30 +2528,7 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 
   ValidityKey until = ValidityKeyMax;
 
-  //    coral::AttributeList ttc_cool_row(ttc_fld->payloadSpecification());
-  //    coral::AttributeList ttcgr_cool_row(ttcgr_fld->payloadSpecification());
-  //    coral::AttributeList rod_cool_row(rod_fld->payloadSpecification());
-  //    coral::AttributeList dtmroc_cool_row(dtmroc_fld->payloadSpecification());
-
-  //(ttc_fld->folderAttributes()).attributeList() ;
-  //coral::AttributeList ttcgr_cool_row=(ttcgr_fld->folderAttributes()).attributeList() ;
-  //coral::AttributeList rod_cool_row=(rod_fld->folderAttributes()).attributeList();
-  //coral::AttributeList dtmroc_cool_row=(dtmroc_fld->folderAttributes()).attributeList();
-  //ttc_cool_row.toOutputStream(std::cout);
-  //coral::AttributeListSpecification ttc_spec;
-  //ttc_spec.extend("ttc_UID",
-  //                     coral::AttributeSpecification::typeNameForId( typeid(unsigned int) ) );
-  //coral::AttributeList ttc_cool_row(ttc_spec);
-  /*
-    coral::AttributeList ttc_cool_row;
-    cool::Record ttc_rec(ttc_fld->payloadSpecification(),ttc_cool_row); 
-    coral::AttributeList ttcgr_cool_row;
-    cool::Record ttcgr_rec(ttcgr_fld->payloadSpecification(),ttcgr_cool_row); 
-    coral::AttributeList rod_cool_row;
-    cool::Record rod_rec(rod_fld->payloadSpecification(),rod_cool_row); 
-    coral::AttributeList dtmroc_cool_row;
-    cool::Record dtmroc_rec(dtmroc_fld->payloadSpecification(),dtmroc_cool_row); 
-  */
+ 
 
   cool::RecordSpecification ttc_rec =(ttc_fld->payloadSpecification());
   coral::AttributeList ttc_cool_row ATLAS_THREAD_SAFE = Record(ttc_rec).attributeList(); // ok
@@ -2712,7 +2545,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
   coral::ITableDataEditor& ttc_editor = m_session->nominalSchema().tableHandle(TTC_TABLE ).dataEditor();
   coral::AttributeList ttc_row ATLAS_THREAD_SAFE; // Not shared, so ok.
   ttc_editor.rowBuffer(ttc_row);
-  // ttc_row.toOutputStream( std::cout ) << std::endl;
   //--------
   // TRT-TTC quantities
 
@@ -2740,7 +2572,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
   const char* filename="ttc.dat";
   if (part_trt=="barrel"){
     filename = "RCDTTC.dat";
-    //filename = "TTC06.dat";
   }
   else if (part_trt=="endcap"){
     filename = "ECRCDTTC.dat";
@@ -2760,11 +2591,9 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 	   >>  clocksource >> ttcname 
 	   >>  tfragtype >> tcomment;
 	    
-      //	    if(m_verbose) std::cout << "Read TTC data done..." << std::endl;
 	
       ttc_row["ttc_UID"].setValue <int> (tuid);
-      // 	    ttc_row["ttc_iovfk"].setValue <long long> (iovfkttc);
-      // 	    ttc_row["ttc_iovfk"].setValue <long long> (nunc_usecs/10);
+
       ttc_row["ttc_iovfk"].setValue <long long> (key);
       ttc_row["ByteSwapping"].setValue <short> (tbyteswap);
       ttc_row["PhysicalAddress"].setValue <int> (tphysaddr);
@@ -2781,9 +2610,7 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 	    
 
       ttc_cool_row["ttc_UID"].setValue <unsigned int> (tuid);
-      // 
-      //	    ttc_cool_row["ttc_iovfk"].setValue <unsigned long long> (iovfkttc);
-      //	    ttc_cool_row["ttc_iovfk"].setValue <unsigned long long> (nunc_usecs/10);
+
       ttc_cool_row["ttc_iovfk"].setValue <unsigned long long> (key);
       ttc_cool_row["tag"].setValue <std::string> (tag);
       cool::Record ttcRecord(ttc_rec,ttc_cool_row); 
@@ -2791,7 +2618,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 
       run++;
 	    
-      //ttc_editor.insertRow(ttc_row);
       ttc_bulk->processNextIteration();
     }
   } 
@@ -2812,7 +2638,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
   coral::ITableDataEditor& ttcgr_editor = m_session->nominalSchema().tableHandle(TTCGR_TABLE ).dataEditor();
   coral::AttributeList ttcgr_row ATLAS_THREAD_SAFE; // Not shared, so ok.
   ttcgr_editor.rowBuffer(ttcgr_row);
-  // ttc_row.toOutputStream( std::cout ) << std::endl;
   //--------
   // TRT-TTC quantities
 
@@ -2846,21 +2671,17 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
   std::vector <unsigned int> tdmdelayv(10);
 	
   run=0;	
-	
-  //		ifstream itGRfile ("RCDTTCGROUP.dat");
-  //		ifstream itGRfile ("TTCGROUPTEMP.dat");
+
 
   if (part_trt=="barrel"){
     filename = "RCDTTCGROUP.dat";
-    // filename = "TTCGROUPTEMP.dat";
   }
   else if (part_trt=="endcap"){
     filename = "ECRCDTTCGROUP.dat";
   }
 
   ifstream itGRfile (filename);
-  //		ifstream itGRfile ("ECRCDTTCGROUP.dat");
-  //	std::vector<char> buffer(999);
+
   if (itGRfile.is_open()){
     while (itGRfile.getline(&buffer[0],999,'\n')) {
       std::string sline(buffer.begin(),buffer.begin()+strlen(&buffer[0]));
@@ -2890,8 +2711,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 	    
 	
       ttcgr_row["ttcgr_UID"].setValue <int> (tgruid);
-      //	    ttcgr_row["ttcgr_iovfk"].setValue <long long> (iovfkttc);
-      //	    ttcgr_row["ttcgr_iovfk"].setValue <long long> (nunc_usecs/10);
       ttcgr_row["ttcgr_iovfk"].setValue <long long> (key);
       ttcgr_row["Group"].setValue <int> (group);
       ttcgr_row["DutyCycle"].setValue <int> (duty);
@@ -2904,8 +2723,7 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 	    
 
       ttcgr_cool_row["ttcgr_UID"].setValue <unsigned int> (tgruid);
-      //   ttcgr_cool_row["ttcgr_iovfk"].setValue <unsigned long long> (iovfkttc);
-      //   ttcgr_cool_row["ttcgr_iovfk"].setValue <unsigned long long> (nunc_usecs/10);
+
       ttcgr_cool_row["ttcgr_iovfk"].setValue <unsigned long long> (key);
       ttcgr_cool_row["tag"].setValue <std::string> (tag);
       cool::Record ttcgrRecord(ttcgr_rec, ttcgr_cool_row);
@@ -2914,7 +2732,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 
       run++;
 	    
-      //ttc_editor.insertRow(ttcgr_row);
       ttcgr_bulk->processNextIteration();
     }
   } 
@@ -2938,7 +2755,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
   coral::ITableDataEditor& rod_editor = m_session->nominalSchema().tableHandle(ROD_TABLE ).dataEditor();
   coral::AttributeList rod_row ATLAS_THREAD_SAFE; // Not shared, so ok.
   rod_editor.rowBuffer(rod_row);
-  //  rod_row.toOutputStream( std::cout ) << std::endl;
   coral::IBulkOperation* rod_bulk= rod_editor.bulkInsert(rod_row,32);
 
 
@@ -2967,7 +2783,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
   run=0;
   if (part_trt=="barrel"){
     filename = "RCDROD.dat";
-    //filename = "ROD06.dat";
   }
   else if (part_trt=="endcap"){
     filename = "ECRCDROD.dat";
@@ -2992,8 +2807,7 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 	   >> rodname >> rcomment;
 
       rod_row["rod_UID"].setValue <int> (rodid);
-      //    rod_row["rod_iovfk"].setValue <long long> (iovfkttc);
-      // rod_row["rod_iovfk"].setValue <long long> (nunc_usecs/10);
+
       rod_row["rod_iovfk"].setValue <long long> (key);
       rod_row["RODByteSwapping"].setValue <short> (rodbyteswap);
       rod_row["RODPhysicalAddress"].setValue <int> (rodphysaddr);
@@ -3015,8 +2829,7 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
       rod_row["rod_tag"].setValue <std::string> (tag);
 	    
       rod_cool_row["rod_UID"].setValue <unsigned int> (rodid);
-      //	    rod_cool_row["rod_iovfk"].setValue <unsigned long long> (iovfkttc);
-      //	    rod_cool_row["rod_iovfk"].setValue <unsigned long long> (nunc_usecs/10);
+
       rod_cool_row["rod_iovfk"].setValue <unsigned long long> (key);
       rod_cool_row["tag"].setValue <std::string> (tag);
       cool::Record rodRecord(rod_rec, rod_cool_row);
@@ -3043,7 +2856,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
   coral::ITableDataEditor& dtmroc_editor = m_session->nominalSchema().tableHandle(DTMROC_TABLE ).dataEditor();
   coral::AttributeList dtmroc_row ATLAS_THREAD_SAFE; // Not shared, so ok.
   dtmroc_editor.rowBuffer(dtmroc_row);
-  //    dtmroc_row.toOutputStream( std::cout ) << std::endl;
   coral::IBulkOperation* dtmroc_bulk= dtmroc_editor.bulkInsert(dtmroc_row,32);
 	
   unsigned int uid;
@@ -3068,7 +2880,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
   run=0;
   if (part_trt=="barrel"){
     filename = "RCDDTMROC.dat";
-    //filename = "DTMROC06.dat";
   }
   else if (part_trt=="endcap"){
     filename = "ECRCDDTMROC.dat";
@@ -3110,8 +2921,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 
 
       dtmroc_row["dtmroc_UID"].setValue <int> (chipID);
-      //	    dtmroc_row["dtmroc_iovfk"].setValue <long long> (iovfkttc);
-      //	    dtmroc_row["dtmroc_iovfk"].setValue <long long> (nunc_usecs/10);
       dtmroc_row["dtmroc_iovfk"].setValue <long long> (key);
       dtmroc_row["DTMROCByteSwapping"].setValue <short> (byteswap);
       dtmroc_row["DTMROCPhysicalAddress"].setValue <int> 
@@ -3139,8 +2948,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 	    
       dtmroc_cool_row["dtmroc_UID"].setValue <unsigned int> (uid);
       dtmroc_cool_row["dtmroc_iovfk"].setValue <unsigned long long> (key);
-      //	    dtmroc_cool_row["dtmroc_iovfk"].setValue <unsigned long long> (nunc_usecs/10);
-      //	    dtmroc_cool_row["dtmroc_iovfk"].setValue <unsigned long long> (iovfkttc);
       dtmroc_cool_row["tag"].setValue <std::string> (tag);
       cool::Record dtmrocRecord(dtmroc_rec, dtmroc_cool_row);
       dtmroc_fld->storeObject( since, until, dtmrocRecord, chipID);
@@ -3158,7 +2965,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 
 
   printf("Total: %d  rows\n",run);
-  //if(m_verbose) std::cout<<std::endl;
 
 
   // measuring elapsed time
@@ -3184,7 +2990,6 @@ void COOLCORALClient::fillFolderTables(const std::string& part_trt, const std::s
 /// all info about the relevant TTCGROUPs and all the connected
 /// DTMROCs
 TTCobj_t* COOLCORALClient::GetTTCOOL(int ttc_id){
-  //    if(m_verbose) std::cout << "\nGet TTC Queries and SubQueries"  << std::endl;
 
 
   struct timeval start_time{}, end_time{};
@@ -3225,8 +3030,6 @@ TTCobj_t* COOLCORALClient::GetTTCOOL(int ttc_id){
     
   gettimeofday(&nunc_time, nullptr);
 
-  // iovfk is time in nanoseconds
-  //    nunc_usecs = (nunc_time.tv_sec) * 1000000 + (nunc_time.tv_usec);
   nunc_usecs = (nunc_time.tv_sec);
 
   cool::ValidityKey since = nunc_usecs;
@@ -3294,12 +3097,10 @@ TTCobj_t* COOLCORALClient::GetTTCOOL(int ttc_id){
   while ( objects->goToNext() ) {
     const cool::IObject& obj = objects->currentRef();
     FromString(fk,obj.payloadValue("ttc_iovfk"));
-    //      if(m_verbose) std::cout << "FK = " << fk << std::endl;
   }
     
      
   std::string ttc_cond = TTC_TABLE;
-  //    ttc_cond += ".ttc_UID = :ttcnr";
   ttc_cond += ".ttc_UID = :ttcnr AND ";
   ttc_cond += TTC_TABLE;
   ttc_cond += ".ttc_iovfk = :ttcio";
@@ -3313,7 +3114,6 @@ TTCobj_t* COOLCORALClient::GetTTCOOL(int ttc_id){
   ttc_condData[0].data<int>() = ttc_id;
   ttc_condData[1].data<long long>() = fk;
 
-  //    if(m_verbose) std::cout << "TTC ID = " << ttc_id << std::endl;
 
   // query on TTCGROUP
 
@@ -3331,13 +3131,11 @@ TTCobj_t* COOLCORALClient::GetTTCOOL(int ttc_id){
   std::string ttcgr_cond = TTCGR_TABLE;
   ttcgr_cond += ".ttcgr_UID >= :ttcgr0 AND ";
   ttcgr_cond +=  TTCGR_TABLE;
-  //    ttcgr_cond +=  ".ttcgr_UID <= :ttcgr1";
   ttcgr_cond +=  ".ttcgr_UID <= :ttcgr1 AND ";
   ttcgr_cond +=  TTCGR_TABLE;
   ttcgr_cond +=  ".ttcgr_iovfk = :ttcgrio";
 
 
-  //"BTTCGR.ttcgr_UID >= :ttcgr0 AND BTTCGR.ttcgr_UID <= :ttcgr1";
 
   coral::AttributeList ttcgr_condData ATLAS_THREAD_SAFE; // Not shared, so ok.
   ttcgr_condData.extend<int>( "ttcgr0" );
@@ -3375,7 +3173,6 @@ TTCobj_t* COOLCORALClient::GetTTCOOL(int ttc_id){
   dtmroc_cond += DTMROC_TABLE;
   dtmroc_cond += ".dtmroc_iovfk = :rocio";
 
-  //"BDTMROC.dtmroc_UID >= :roc1 AND BDTMROC.dtmroc_UID <= :roc104";
 
   coral::AttributeList dtmroc_condData ATLAS_THREAD_SAFE; // Not shared, so ok.
   dtmroc_condData.extend<int>( "roc1" );
@@ -3652,25 +3449,16 @@ void COOLCORALClient::UpdateKey(){
 /// Fill TTC table with one entry
 void COOLCORALClient::fillTTC(const TTC_t& ttc){
 
-  //    if(m_verbose) std::cout << "\nCOOLCORAL Client: Fill TTC info" << std::endl;
-
-  //    struct timeval start_time, end_time;
-  //  int total_usecs;
-  //  gettimeofday(&start_time, NULL);
-
+ 
   m_session->transaction().start();
 
 
 
   struct timeval nunc_time{};
-  //unsigned long long nunc_usecs;
     
   gettimeofday(&nunc_time, nullptr);
 
-  // iovfk is time in nanoseconds
-  //nunc_usecs = (nunc_time.tv_sec) * 1000000 + (nunc_time.tv_usec);
-  //nunc_usecs = (nunc_time.tv_usec);
-  //    iovfkttc = (unsigned long long) nunc_usecs/10;
+ 
   unsigned long long nunc_sec = nunc_time.tv_sec;
   std::string tag = "DAQ";
 
@@ -3680,7 +3468,6 @@ void COOLCORALClient::fillTTC(const TTC_t& ttc){
 
  
 
-  //    if(m_verbose) std::cout << "Filling table " << TTC_TABLE  << std::endl;
   coral::ITableDataEditor& ttc_editor = m_session->nominalSchema().tableHandle(TTC_TABLE ).dataEditor();
   coral::AttributeList ttc_row ATLAS_THREAD_SAFE; // Not shared, so ok.
   ttc_editor.rowBuffer(ttc_row);
@@ -3688,7 +3475,6 @@ void COOLCORALClient::fillTTC(const TTC_t& ttc){
 
 
 	
-  //    coral::IBulkOperation* ttc_bulk= ttc_editor.bulkInsert(ttc_row,32);
 
   ttc_row["ttc_UID"].setValue <int> (ttc.ttc_UID);
   ttc_row["ttc_iovfk"].setValue <long long> (nunc_sec);
@@ -3930,20 +3716,7 @@ void COOLCORALClient::fillRODV(const std::vector<ROD_t>& rodv){
 
   rod_bulk->flush();
   delete rod_bulk;
-    
-
-  // measuring elapsed time
-  //     gettimeofday(&end_time, NULL);
-  //         total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 +
-  //                  (end_time.tv_usec-start_time.tv_usec);
-  //         if(m_verbose) std::cout << "Total time was " << total_usecs << " usec" << std::endl;
-
-
-
-
-
-
-
+  
   m_session->transaction().commit();
 
 }
@@ -4049,10 +3822,6 @@ void COOLCORALClient::fillTTCGRV(const std::vector<TTCGroup_t>& ttcgrv){
 void COOLCORALClient::fillTTCV(const std::vector<TTC_t>& ttcv){
 
 
-  //     struct timeval start_time, end_time;
-  //     int total_usecs;
-  //     gettimeofday(&start_time, NULL);
-
   m_session->transaction().start();
 
 
@@ -4067,7 +3836,6 @@ void COOLCORALClient::fillTTCV(const std::vector<TTC_t>& ttcv){
     
  
 
-  //    if(m_verbose) std::cout << "Filling table " << TTC_TABLE  << std::endl;
   coral::ITableDataEditor& ttc_editor = m_session->nominalSchema().tableHandle(TTC_TABLE ).dataEditor();
   coral::AttributeList ttc_row ATLAS_THREAD_SAFE; // Not shared, so ok.
   ttc_editor.rowBuffer(ttc_row);
@@ -4236,12 +4004,7 @@ void COOLCORALClient::fillBarrel(const Barrel_t& Barrel){
   delete roc_bulk;
 
 
-  // measuring elapsed time
-  //     gettimeofday(&end_time, NULL);
-  //         total_usecs = (end_time.tv_sec-start_time.tv_sec) * 1000000 +
-  //                  (end_time.tv_usec-start_time.tv_usec);
-  //         if(m_verbose) std::cout << "Total time was " << total_usecs << " usec" << std::endl;
-
+ 
   m_session->transaction().commit();
 
 }
@@ -4291,8 +4054,6 @@ void COOLCORALClient::createMap(){
   // Unfortunately, there is no easy/standard way of having the
   // database server automatically assigning a value to a PK
 
-  // put an index on const
-  //    if (part_trt=="barrel"){
   tmp_strings.clear();
   tmp_strings.emplace_back("Partition");
   bconn_columns.createIndex ("bpart_idx", tmp_strings);
@@ -5656,7 +5417,6 @@ void COOLCORALClient::UpdateGol(const GOL* golinp,int goltype){
 
   rowBuffer.extend<short>( extension );
 
-  //     std::string updateAction1 = "EdgeSelect = :value";
   std::string updateAction1 = extension;
   updateAction1 += " = :value";
 
@@ -5767,9 +5527,7 @@ void COOLCORALClient::createHistTables(bool coolswitch){
   
   tmp_strings.clear();
   tmp_strings.emplace_back("ttc_iovfk");
-  // Define primary key
-  //	      ttc_columns.setPrimaryKey( tmp_strings );
-  // ttc_columns.setNotNullConstraint ("ttc_iovfk");
+ 
   // Define index
   ttc_columns.createIndex ("httcio_idx", tmp_strings);
   
@@ -6179,14 +5937,7 @@ int COOLCORALClient::GetLastTTC(){
   query0->addToOutputList("Comment" ); 
   query0->addToOutputList("ttc_tag" ); 
     
-//   std::string ttc_cond = " ";
-//   coral::AttributeList ttc_condData;
-//   ttc_condData.extend<int>( "ttcnr" );
-    
-//   query0->setCondition( ttc_cond, ttc_condData);
-    
-//   ttc_condData[0].data<int>() = ttc_id;
-    
+
   coral::ICursor& cursor0 = query0->execute();
     
   int count=0;
@@ -6234,11 +5985,7 @@ void COOLCORALClient::GetLastValues(Detector_t& detector){
   TTCGroup_t ttcgr;
   ROD_t rod;
   DTMROC_t dtmroc;
-  
-//   std::vector<TTC_t> ttcv;
-//   std::vector<TTCGR_t> ttcgrv;
-//   std::vector<ROD_t> rodv;
-//   std::vector<DTMROC_t> dtmrocv;
+ 
 
   m_session->transaction().start(true);
 
@@ -6436,13 +6183,6 @@ void COOLCORALClient::GetLastValues(Detector_t& detector){
   delete query3;
 
 
-
-  
-//   if(m_verbose) std::cout << "Number of ttcv elements = " << detector.ttc.size() << std::endl;
-//   if(m_verbose) std::cout << "Number of ttcgrv elements = " << detector.ttcgr.size() << std::endl;
-//   if(m_verbose) std::cout << "Number of rodv elements = " << detector.rod.size() << std::endl;
-//   if(m_verbose) std::cout << "Number of dtmrocv elements = " << detector.dtmroc.size() << std::endl;
-
   m_session->transaction().commit();
     
 }
@@ -6458,13 +6198,11 @@ void COOLCORALClient::fillDetector(const Detector_t& Detector){
   struct timeval nunc_time{};
   struct timeval start_time{};
   struct timeval end_time{};
-  //unsigned long long nunc_usecs;
   unsigned long long total_usecs;
     
   gettimeofday(&nunc_time, nullptr);
   gettimeofday(&start_time, nullptr);
 
-  //nunc_usecs = (nunc_time.tv_sec) * 1000000 + (nunc_time.tv_usec);
 
   std::string TTC_TABLE="HIST_TTC";
   std::string TTCGR_TABLE="HIST_TTCGR";
@@ -6718,7 +6456,7 @@ void COOLCORALClient::fillHistDetector(const Detector_t& Detector, const std::st
     
   conn_condData[0].data<long long>() = 999;
 
-  long long key;
+  long long key{0};
 
   coral::ICursor& cursor00 = query00->execute();
   while ( cursor00.next() ) {
@@ -6789,7 +6527,6 @@ void COOLCORALClient::fillHistDetector(const Detector_t& Detector, const std::st
 
   for (v_iter0 = (Detector.ttc).begin(); v_iter0 != (Detector.ttc).end(); ++v_iter0) {   
     ttc_row["ttc_UID"].setValue <int> ((*v_iter0).ttc_UID);
-    //    ttc_row["ttc_iovfk"].setValue <long long> ((*v_iter0).ttc_iovfk);
     ttc_row["ttc_iovfk"].setValue <long long> (key);
     ttc_row["ByteSwapping"].setValue <short> ((*v_iter0).ByteSwapping);
     ttc_row["PhysicalAddress"].setValue <int> ((*v_iter0).PhysicalAddress);
@@ -6802,7 +6539,6 @@ void COOLCORALClient::fillHistDetector(const Detector_t& Detector, const std::st
     ttc_row["ClockSource"].setValue <std::string> ((*v_iter0).ClockSource);
     ttc_row["InputFragmentType"].setValue <std::string> ((*v_iter0).InputFragmentType);
     ttc_row["Comment"].setValue <std::string> ((*v_iter0).Comment);
-    //    ttc_row["ttc_tag"].setValue <std::string> ((*v_iter0).ttc_tag);
     ttc_row["ttc_tag"].setValue <std::string> (tag);
 
 
@@ -6823,7 +6559,6 @@ void COOLCORALClient::fillHistDetector(const Detector_t& Detector, const std::st
 
   for (v_iter1 = (Detector.ttcgr).begin(); v_iter1 != (Detector.ttcgr).end(); ++v_iter1) {   
     ttcgr_row["ttcgr_UID"].setValue <int> ((*v_iter1).ttcgr_UID);
-    //    ttcgr_row["ttcgr_iovfk"].setValue <long long> ((*v_iter1).ttcgr_iovfk);
     ttcgr_row["ttcgr_iovfk"].setValue <long long> (key);
     ttcgr_row["Group"].setValue <int> ((*v_iter1).Group);
     ttcgr_row["DutyCycle"].setValue <int> ((*v_iter1).DutyCycle);
@@ -6832,7 +6567,6 @@ void COOLCORALClient::fillHistDetector(const Detector_t& Detector, const std::st
     ttcgr_row["finedx"].setValue <std::string> ((*v_iter1).finedx);
     ttcgr_row["TDMdelay"].setValue <std::string> ((*v_iter1).TDMdelay);
     ttcgr_row["TTCGRNAME"].setValue <std::string> ((*v_iter1).TTCGRNAME);
-    //    ttcgr_row["ttcgr_tag"].setValue <std::string> ((*v_iter1).ttcgr_tag);
     ttcgr_row["ttcgr_tag"].setValue <std::string> (tag);
       
     ttcgr_cool_row["ttcgr_iovfk"].setValue <unsigned long long> (key);
@@ -6887,7 +6621,6 @@ void COOLCORALClient::fillHistDetector(const Detector_t& Detector, const std::st
 
   for (v_iter3 = (Detector.dtmroc).begin(); v_iter3 != (Detector.dtmroc).end(); ++v_iter3) {
     roc_row["dtmroc_UID"].setValue <int> ((*v_iter3).dtmroc_UID);
-    //    roc_row["dtmroc_iovfk"].setValue <long long> ((*v_iter3).dtmroc_iovfk);
     roc_row["dtmroc_iovfk"].setValue <long long> (key);
     roc_row["DTMROCByteSwapping"].setValue <short> ((*v_iter3).DTMROCByteSwapping);
     roc_row["DTMROCPhysicalAddress"].setValue <int> ((*v_iter3).DTMROCPhysicalAddress);
@@ -6909,7 +6642,6 @@ void COOLCORALClient::fillHistDetector(const Detector_t& Detector, const std::st
     roc_row["DTMROCInputFragmentType"].setValue <std::string> ((*v_iter3).DTMROCInputFragmentType);
     roc_row["Clock_FE"].setValue <std::string> ((*v_iter3).Clock_FE);
     roc_row["Comment"].setValue <std::string> ((*v_iter3).Comment);
-    //    roc_row["roc_tag"].setValue <std::string> ((*v_iter3).roc_tag);
     roc_row["roc_tag"].setValue <std::string> (tag);
 
     dtmroc_cool_row["dtmroc_iovfk"].setValue <unsigned long long> (key);
@@ -7319,7 +7051,7 @@ void COOLCORALClient::GenIoVROCTable(){
   coral::ICursor& cursor0 = query0->execute();
 
   int uid;
-  long long key;
+  long long key{0};
   std::string tag;
 
   //int result = -1;
@@ -7345,7 +7077,6 @@ void COOLCORALClient::GenIoVROCTable(){
     roc_editor.insertRow(roc_row);
 
 
-    //result = 1;
   }
 
   delete query0;
@@ -7361,7 +7092,6 @@ void COOLCORALClient::UpdateIoVROCTable(int uid,long long time, const std::strin
 
   std::string DTMROCIOV_TABLE="DTMROC_IOVS";
 
-  //  cool::ValidityKey since = 0;
   cool::ValidityKey until = cool::ValidityKeyMax;
 
   m_session->transaction().start();
@@ -7516,7 +7246,6 @@ Detector_t COOLCORALClient::GetHistValues(const std::string& tag,long long tstam
   
   coral::ICursor& cursor00 = query00->execute();
     
-  //  std::cout << "TAG\t Key \t Time" << std::endl;
   while ( cursor00.next() ) {
     const coral::AttributeList &row00 = cursor00.currentRow();
 
@@ -7831,7 +7560,6 @@ int COOLCORALClient::fillLastDetector(const Detector_t& Detector){
   for (v_iter0 = (Detector.ttc).begin(); v_iter0 != (Detector.ttc).end(); ++v_iter0) {   
     ttc_row["ttc_UID"].setValue <int> ((*v_iter0).ttc_UID);
     ttc_row["ttc_iovfk"].setValue <long long> ((*v_iter0).ttc_iovfk);
-    //    ttc_row["ttc_iovfk"].setValue <long long> (key);
     ttc_row["ByteSwapping"].setValue <short> ((*v_iter0).ByteSwapping);
     ttc_row["PhysicalAddress"].setValue <int> ((*v_iter0).PhysicalAddress);
     ttc_row["DetID"].setValue <int> ((*v_iter0).DetID);
@@ -7844,7 +7572,6 @@ int COOLCORALClient::fillLastDetector(const Detector_t& Detector){
     ttc_row["InputFragmentType"].setValue <std::string> ((*v_iter0).InputFragmentType);
     ttc_row["Comment"].setValue <std::string> ((*v_iter0).Comment);
     ttc_row["ttc_tag"].setValue <std::string> ((*v_iter0).ttc_tag);
-    //    ttc_row["ttc_tag"].setValue <std::string> (tag);
 
 
     ttc_bulk->processNextIteration();   
@@ -7858,7 +7585,6 @@ int COOLCORALClient::fillLastDetector(const Detector_t& Detector){
   for (v_iter1 = (Detector.ttcgr).begin(); v_iter1 != (Detector.ttcgr).end(); ++v_iter1) {   
     ttcgr_row["ttcgr_UID"].setValue <int> ((*v_iter1).ttcgr_UID);
     ttcgr_row["ttcgr_iovfk"].setValue <long long> ((*v_iter1).ttcgr_iovfk);
-    //    ttcgr_row["ttcgr_iovfk"].setValue <long long> (key);
     ttcgr_row["Group"].setValue <int> ((*v_iter1).Group);
     ttcgr_row["DutyCycle"].setValue <int> ((*v_iter1).DutyCycle);
     ttcgr_row["EdgeSelect"].setValue <std::string> ((*v_iter1).EdgeSelect);
@@ -7867,7 +7593,6 @@ int COOLCORALClient::fillLastDetector(const Detector_t& Detector){
     ttcgr_row["TDMdelay"].setValue <std::string> ((*v_iter1).TDMdelay);
     ttcgr_row["TTCGRNAME"].setValue <std::string> ((*v_iter1).TTCGRNAME);
     ttcgr_row["ttcgr_tag"].setValue <std::string> ((*v_iter1).ttcgr_tag);
-    // ttcgr_row["ttcgr_tag"].setValue <std::string> (tag);
 
     ttcgr_bulk->processNextIteration();    
   }
@@ -7880,7 +7605,6 @@ int COOLCORALClient::fillLastDetector(const Detector_t& Detector){
   for (v_iter2 = (Detector.rod).begin(); v_iter2 != (Detector.rod).end(); ++v_iter2) {
     rod_row["rod_UID"].setValue <int> ((*v_iter2).rod_UID);
     rod_row["rod_iovfk"].setValue <long long> ((*v_iter2).rod_iovfk);
-    //    rod_row["rod_iovfk"].setValue <long long> (key);
     rod_row["RODByteSwapping"].setValue <short> ((*v_iter2).RODByteSwapping);
     rod_row["RODPhysicalAddress"].setValue <int> ((*v_iter2).RODPhysicalAddress);
     rod_row["RODDetID"].setValue <int> ((*v_iter2).RODDetID);
@@ -7899,7 +7623,6 @@ int COOLCORALClient::fillLastDetector(const Detector_t& Detector){
     rod_row["RODName"].setValue <std::string> ((*v_iter2).RODName);
     rod_row["Comment"].setValue <std::string> ((*v_iter2).Comment);
     rod_row["rod_tag"].setValue <std::string> ((*v_iter2).rod_tag);
-    //    rod_row["rod_tag"].setValue <std::string> (tag);
 
 
 
@@ -7915,7 +7638,6 @@ int COOLCORALClient::fillLastDetector(const Detector_t& Detector){
   for (v_iter3 = (Detector.dtmroc).begin(); v_iter3 != (Detector.dtmroc).end(); ++v_iter3) {
     roc_row["dtmroc_UID"].setValue <int> ((*v_iter3).dtmroc_UID);
     roc_row["dtmroc_iovfk"].setValue <long long> ((*v_iter3).dtmroc_iovfk);
-    //    roc_row["dtmroc_iovfk"].setValue <long long> (key);
     roc_row["DTMROCByteSwapping"].setValue <short> ((*v_iter3).DTMROCByteSwapping);
     roc_row["DTMROCPhysicalAddress"].setValue <int> ((*v_iter3).DTMROCPhysicalAddress);
     roc_row["ChipID"].setValue <int> ((*v_iter3).ChipID);
@@ -7937,7 +7659,6 @@ int COOLCORALClient::fillLastDetector(const Detector_t& Detector){
     roc_row["Clock_FE"].setValue <std::string> ((*v_iter3).Clock_FE);
     roc_row["Comment"].setValue <std::string> ((*v_iter3).Comment);
     roc_row["roc_tag"].setValue <std::string> ((*v_iter3).roc_tag);
-    //roc_row["roc_tag"].setValue <std::string> (tag);
 
       
     roc_bulk->processNextIteration();    
@@ -8140,9 +7861,6 @@ void COOLCORALClient::fillHistory(const Detector_t& Detector, const std::string&
   long long& cqkey = rowBuffer1[ "Key" ].data<long long>(); 
   long long& cqtime = rowBuffer1[ "Time" ].data<long long>(); 
 
-//   gettimeofday(&nunc_time, NULL);
-//   //  nunc_usecs = (nunc_time.tv_sec) * 1000000 + (nunc_time.tv_usec);
-  //nunc_usecs = (nunc_time.tv_sec);
 
   gettimeofday(&nunc_time, nullptr);
 
@@ -8180,7 +7898,6 @@ void COOLCORALClient::fillHistory(const Detector_t& Detector, const std::string&
 
   for (v_iter0 = (Detector.ttc).begin(); v_iter0 != (Detector.ttc).end(); ++v_iter0) {   
     ttc_row["ttc_UID"].setValue <int> ((*v_iter0).ttc_UID);
-    //    ttc_row["ttc_iovfk"].setValue <long long> ((*v_iter0).ttc_iovfk);
     ttc_row["ttc_iovfk"].setValue <long long> (key);
     ttc_row["ByteSwapping"].setValue <short> ((*v_iter0).ByteSwapping);
     ttc_row["PhysicalAddress"].setValue <int> ((*v_iter0).PhysicalAddress);
@@ -8193,7 +7910,6 @@ void COOLCORALClient::fillHistory(const Detector_t& Detector, const std::string&
     ttc_row["ClockSource"].setValue <std::string> ((*v_iter0).ClockSource);
     ttc_row["InputFragmentType"].setValue <std::string> ((*v_iter0).InputFragmentType);
     ttc_row["Comment"].setValue <std::string> ((*v_iter0).Comment);
-    //    ttc_row["ttc_tag"].setValue <std::string> ((*v_iter0).ttc_tag);
     ttc_row["ttc_tag"].setValue <std::string> (tag);
 
 
@@ -8226,7 +7942,6 @@ void COOLCORALClient::fillHistory(const Detector_t& Detector, const std::string&
 
   for (v_iter1 = (Detector.ttcgr).begin(); v_iter1 != (Detector.ttcgr).end(); ++v_iter1) {   
     ttcgr_row["ttcgr_UID"].setValue <int> ((*v_iter1).ttcgr_UID);
-    //    ttcgr_row["ttcgr_iovfk"].setValue <long long> ((*v_iter1).ttcgr_iovfk);
     ttcgr_row["ttcgr_iovfk"].setValue <long long> (key);
     ttcgr_row["Group"].setValue <int> ((*v_iter1).Group);
     ttcgr_row["DutyCycle"].setValue <int> ((*v_iter1).DutyCycle);
@@ -8235,7 +7950,6 @@ void COOLCORALClient::fillHistory(const Detector_t& Detector, const std::string&
     ttcgr_row["finedx"].setValue <std::string> ((*v_iter1).finedx);
     ttcgr_row["TDMdelay"].setValue <std::string> ((*v_iter1).TDMdelay);
     ttcgr_row["TTCGRNAME"].setValue <std::string> ((*v_iter1).TTCGRNAME);
-    //    ttcgr_row["ttcgr_tag"].setValue <std::string> ((*v_iter1).ttcgr_tag);
     ttcgr_row["ttcgr_tag"].setValue <std::string> (tag);
 
     updateData[1].data <long long>() = key;
@@ -8268,7 +7982,6 @@ void COOLCORALClient::fillHistory(const Detector_t& Detector, const std::string&
 
   for (v_iter2 = (Detector.rod).begin(); v_iter2 != (Detector.rod).end(); ++v_iter2) {
     rod_row["rod_UID"].setValue <int> ((*v_iter2).rod_UID);
-    //    rod_row["rod_iovfk"].setValue <long long> ((*v_iter2).rod_iovfk);
     rod_row["rod_iovfk"].setValue <long long> (key);
     rod_row["RODByteSwapping"].setValue <short> ((*v_iter2).RODByteSwapping);
     rod_row["RODPhysicalAddress"].setValue <int> ((*v_iter2).RODPhysicalAddress);
@@ -8287,7 +8000,6 @@ void COOLCORALClient::fillHistory(const Detector_t& Detector, const std::string&
     rod_row["RODInputFragmentType"].setValue <std::string> ((*v_iter2).RODInputFragmentType);
     rod_row["RODName"].setValue <std::string> ((*v_iter2).RODName);
     rod_row["Comment"].setValue <std::string> ((*v_iter2).Comment);
-    //    rod_row["rod_tag"].setValue <std::string> ((*v_iter2).rod_tag);
     rod_row["rod_tag"].setValue <std::string> (tag);
 
     updateData[1].data <long long>() = key;
@@ -8320,7 +8032,6 @@ void COOLCORALClient::fillHistory(const Detector_t& Detector, const std::string&
 
   for (v_iter3 = (Detector.dtmroc).begin(); v_iter3 != (Detector.dtmroc).end(); ++v_iter3) {
     roc_row["dtmroc_UID"].setValue <int> ((*v_iter3).dtmroc_UID);
-    //    roc_row["dtmroc_iovfk"].setValue <long long> ((*v_iter3).dtmroc_iovfk);
     roc_row["dtmroc_iovfk"].setValue <long long> (key);
     roc_row["DTMROCByteSwapping"].setValue <short> ((*v_iter3).DTMROCByteSwapping);
     roc_row["DTMROCPhysicalAddress"].setValue <int> ((*v_iter3).DTMROCPhysicalAddress);
@@ -8342,7 +8053,6 @@ void COOLCORALClient::fillHistory(const Detector_t& Detector, const std::string&
     roc_row["DTMROCInputFragmentType"].setValue <std::string> ((*v_iter3).DTMROCInputFragmentType);
     roc_row["Clock_FE"].setValue <std::string> ((*v_iter3).Clock_FE);
     roc_row["Comment"].setValue <std::string> ((*v_iter3).Comment);
-    //    roc_row["roc_tag"].setValue <std::string> ((*v_iter3).roc_tag);
     roc_row["roc_tag"].setValue <std::string> (tag);
 
 
@@ -8993,12 +8703,6 @@ COOLCORALClient::CompHistValues(const std::string& tag1,long long tstamp1, const
 
 
 
-  
-//   if(m_verbose) std::cout << "Number of ttcv elements = " << detector.ttc.size() << std::endl;
-//   if(m_verbose) std::cout << "Number of ttcgrv elements = " << detector.ttcgr.size() << std::endl;
-//   if(m_verbose) std::cout << "Number of rodv elements = " << detector.rod.size() << std::endl;
-//   if(m_verbose) std::cout << "Number of dtmrocv elements = " << detector.dtmroc.size() << std::endl;
-
   m_session->transaction().commit();
 
   // measuring elapsed time
@@ -9304,7 +9008,6 @@ int COOLCORALClient::GetRichTags (){ // Thread unsafe ctime is used.
   std::cout << "\t -----------------------------------------------------------------"<< std::endl;
   std::cout << std::endl;
   while ( cursor0.next() ) {
-    //  cursor0.next();
     const coral::AttributeList &row0 = cursor0.currentRow();
     
     time_t tempo = row0[2].data<long long>();
-- 
GitLab


From ee66b816d5206bf618204a5d28f4fa5794edee6c Mon Sep 17 00:00:00 2001
From: tbuanes <trygve@buanes.net>
Date: Wed, 8 Sep 2021 17:31:59 +0200
Subject: [PATCH 019/347] Reduce number of test events to 150 to get acceptable
 processing time

---
 .../TriggerTest/test/test_trig_data_v1Dev_slice_bjet_build.py   | 2 +-
 .../test/test_trig_data_v1Dev_slice_bphysics_build.py           | 2 +-
 .../TriggerTest/test/test_trig_data_v1Dev_slice_egamma_build.py | 2 +-
 .../TriggerTest/test/test_trig_data_v1Dev_slice_jet_build.py    | 2 +-
 .../TriggerTest/test/test_trig_data_v1Dev_slice_met_build.py    | 2 +-
 .../TriggerTest/test/test_trig_data_v1Dev_slice_muon_build.py   | 2 +-
 .../TriggerTest/test/test_trig_data_v1Dev_slice_tau_build.py    | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_bjet_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_bjet_build.py
index 19bb410f2b08..cbaf3ef4ffb9 100755
--- a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_bjet_build.py
+++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_bjet_build.py
@@ -13,7 +13,7 @@ ex = ExecStep.ExecStep()
 ex.type = 'athena'
 ex.job_options = 'TriggerJobOpts/runHLT_standalone.py'
 ex.input = 'data_Main'
-ex.max_events = 500
+ex.max_events = 150
 ex.threads = 1
 # LS2_v1 soon to be renamed to Dev_pp_run3_v1
 ex.args = '-c "setMenu=\'LS2_v1\';doEmptyMenu=True;doBjetSlice=True;doL1Sim=True;doWriteBS=False;doWriteRDOTrigger=True;"'
diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_bphysics_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_bphysics_build.py
index 5a10665cee27..b4cfa5a68258 100755
--- a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_bphysics_build.py
+++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_bphysics_build.py
@@ -13,7 +13,7 @@ ex = ExecStep.ExecStep()
 ex.type = 'athena'
 ex.job_options = 'TriggerJobOpts/runHLT_standalone.py'
 ex.input = 'data_Main'
-ex.max_events = 1000
+ex.max_events = 150
 ex.threads = 1
 # LS2_v1 soon to be renamed to Dev_pp_run3_v1
 ex.args = '-c "setMenu=\'LS2_v1\';doEmptyMenu=True;doBphysicsSlice=True;doL1Sim=True;doWriteBS=False;doWriteRDOTrigger=True;"'
diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_egamma_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_egamma_build.py
index 56eb5bd1630c..8947414a0725 100755
--- a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_egamma_build.py
+++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_egamma_build.py
@@ -13,7 +13,7 @@ ex = ExecStep.ExecStep()
 ex.type = 'athena'
 ex.job_options = 'TriggerJobOpts/runHLT_standalone.py'
 ex.input = 'data'
-ex.max_events = 500
+ex.max_events = 150
 ex.threads = 1
 # LS2_v1 soon to be renamed to Dev_pp_run3_v1
 ex.args = '-c "setMenu=\'LS2_v1\';doEmptyMenu=True;doEgammaSlice=True;doL1Sim=True;doWriteBS=False;doWriteRDOTrigger=True;"'
diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_jet_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_jet_build.py
index 6261569f4e1c..e43fe7dd086b 100755
--- a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_jet_build.py
+++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_jet_build.py
@@ -13,7 +13,7 @@ ex = ExecStep.ExecStep()
 ex.type = 'athena'
 ex.job_options = 'TriggerJobOpts/runHLT_standalone.py'
 ex.input = 'data'
-ex.max_events = 1000
+ex.max_events = 150
 ex.threads = 1
 # LS2_v1 soon to be renamed to Dev_pp_run3_v1
 ex.args = '-c "setMenu=\'LS2_v1\';doEmptyMenu=True;doJetSlice=True;doL1Sim=True;doWriteBS=False;doWriteRDOTrigger=True;"'
diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_met_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_met_build.py
index 18968610c519..5576abca111b 100755
--- a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_met_build.py
+++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_met_build.py
@@ -13,7 +13,7 @@ ex = ExecStep.ExecStep()
 ex.type = 'athena'
 ex.job_options = 'TriggerJobOpts/runHLT_standalone.py'
 ex.input = 'data'
-ex.max_events = 500
+ex.max_events = 150
 ex.threads = 1
 # LS2_v1 soon to be renamed to Dev_pp_run3_v1
 ex.args = '-c "setMenu=\'LS2_v1\';doEmptyMenu=True;doMETSlice=True;doL1Sim=True;doWriteBS=False;doWriteRDOTrigger=True;"'
diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_muon_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_muon_build.py
index bfa018d45267..7a8bc46313db 100755
--- a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_muon_build.py
+++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_muon_build.py
@@ -13,7 +13,7 @@ ex = ExecStep.ExecStep()
 ex.type = 'athena'
 ex.job_options = 'TriggerJobOpts/runHLT_standalone.py'
 ex.input = 'data'
-ex.max_events = 500
+ex.max_events = 150
 ex.threads = 1
 # LS2_v1 soon to be renamed to Dev_pp_run3_v1
 ex.args = '-c "setMenu=\'LS2_v1\';doEmptyMenu=True;doMuonSlice=True;doL1Sim=True;doWriteBS=False;doWriteRDOTrigger=True;"'
diff --git a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_tau_build.py b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_tau_build.py
index 7d783c4407c7..673d2bc20d8e 100755
--- a/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_tau_build.py
+++ b/Trigger/TrigValidation/TriggerTest/test/test_trig_data_v1Dev_slice_tau_build.py
@@ -13,7 +13,7 @@ ex = ExecStep.ExecStep()
 ex.type = 'athena'
 ex.job_options = 'TriggerJobOpts/runHLT_standalone.py'
 ex.input = 'data'
-ex.max_events = 500
+ex.max_events = 150
 ex.threads = 1
 # LS2_v1 soon to be renamed to Dev_pp_run3_v1
 ex.args = '-c "setMenu=\'LS2_v1\';doEmptyMenu=True;doTauSlice=True;doL1Sim=True;doWriteBS=False;doWriteRDOTrigger=True;"'
-- 
GitLab


From 8393ba1796f348d2cfa5e73e6611e36d52a1d5f2 Mon Sep 17 00:00:00 2001
From: Goetz Gaycken <goetz.gaycken@cern.ch>
Date: Wed, 8 Sep 2021 14:50:18 +0200
Subject: [PATCH 020/347] Ensure consistency between number of brems and brem
 states.

For electrons the number of brems was forced to one or zero, neglecting that
elsewhere the number of brems was determined from the states of a trajectory.
In some cases there were more than one brem-states for electron trajectories
which caused range errors. These range errors are addressed here by ensuring
that the number of brems
---
 .../TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx     | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
index fc13abfc4448..6b0898afe58b 100644
--- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
+++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx
@@ -2070,6 +2070,7 @@ namespace Trk {
       int nscats = 0;
       bool isbrem = false;
       double bremdp = 0;
+      unsigned int n_brem=0;
       
       for (std::unique_ptr<GXFTrackState> & state : trajectory.trackStates()) {
         GXFMaterialEffects *meff = state->materialEffects();
@@ -2110,6 +2111,7 @@ namespace Trk {
             sigmascat
           );
 
+
           if (matEffects == electron) {
             state->resetStateType(TrackStateOnSurface::Scatterer);
             meff->setDeltaE(oldde);
@@ -2122,6 +2124,9 @@ namespace Trk {
           } else if (eloss != nullptr) {
             meff->setSigmaDeltaE(eloss->sigmaDeltaE());
           }
+          if (meff->sigmaDeltaE() > 0) {
+             ++n_brem;
+          }
         }
       }
       
@@ -2140,10 +2145,12 @@ namespace Trk {
           trajectory.brems().resize(1);
           trajectory.brems()[0] = bremdp;
         }
-        
+
         cache.m_asymeloss = false;
         trajectory.setNumberOfScatterers(nscats);
-        trajectory.setNumberOfBrems((isbrem ? 1 : 0));
+        // @TODO fillResiduals assumes that numberOfBrems == number of states with material effects and sigmaDeltaE() > 0
+        //       not clear whether fillResiduals has to be adjusted for electrons rather than this
+        trajectory.setNumberOfBrems(n_brem);
       }
     }
 
@@ -7794,6 +7801,7 @@ __attribute__ ((flatten))
         forward ? (hitno < hit_end) : (hitno >= hit_end); 
         hitno += (forward ? 1 : -1)
       ) {
+
         state = states[hitno].get();
         
         bool fillderivmat = (!state->getStateType(TrackStateOnSurface::Scatterer) && !state->getStateType(TrackStateOnSurface::BremPoint));
-- 
GitLab


From 12e76dc4de2b98a2b06172bac643e59d0351b8ad Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 7 Sep 2021 23:16:15 +0200
Subject: [PATCH 021/347] AFP_EventTPCnv: Add TPCNV declarations.

Add missing TPCnv.cxx file.
See ATLASRECTS-6266.
---
 .../AFP_EventTPCnv/src/AFP_EventTPCnv.cxx     | 81 +++++++++++++++++++
 1 file changed, 81 insertions(+)
 create mode 100644 ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_EventTPCnv.cxx

diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_EventTPCnv.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_EventTPCnv.cxx
new file mode 100644
index 000000000000..1fcfbe77fe7f
--- /dev/null
+++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_EventTPCnv.cxx
@@ -0,0 +1,81 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+// generate the T/P converter entries
+#include "AthenaKernel/TPCnvFactory.h"
+
+#include "AFP_EventTPCnv/AFP_SIDLocRecoEvCollectionCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_SIDLocRecoEventCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_SIDSimHitCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_SIDSimHitCollectionCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_SiDigiCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_SiDigiCollectionCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_TDDigiCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_TDDigiCollectionCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_TDLocRecoEvCollectionCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_TDLocRecoEventCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_TDSimHitCnv_p1.h"
+#include "AFP_EventTPCnv/AFP_TDSimHitCollectionCnv_p1.h"
+
+
+DECLARE_TPCNV_FACTORY (AFP_SIDLocRecoEvCollectionCnv_p1,
+                       AFP_SIDLocRecoEvCollection,
+                       AFP_SIDLocRecoEvCollection_p1,
+                       Athena::TPCnvVers::Current)
+
+
+DECLARE_TPCNV_FACTORY (AFP_SIDLocRecoEventCnv_p1,
+                       AFP_SIDLocRecoEvent,
+                       AFP_SIDLocRecoEvent_p1,
+                       Athena::TPCnvVers::Current)
+
+DECLARE_TPCNV_FACTORY (AFP_SIDSimHitCnv_p1,
+                       AFP_SIDSimHit,
+                       AFP_SIDSimHit_p1,
+                       Athena::TPCnvVers::Current)
+
+DECLARE_TPCNV_FACTORY (AFP_SIDSimHitCollectionCnv_p1,
+                       AFP_SIDSimHitCollection,
+                       AFP_SIDSimHitCollection_p1,
+                       Athena::TPCnvVers::Current)
+
+DECLARE_TPCNV_FACTORY (AFP_SiDigiCnv_p1,
+                       AFP_SiDigi,
+                       AFP_SiDigi_p1,
+                       Athena::TPCnvVers::Current)
+
+DECLARE_TPCNV_FACTORY (AFP_SiDigiCollectionCnv_p1,
+                       AFP_SiDigiCollection,
+                       AFP_SiDigiCollection_p1,
+                       Athena::TPCnvVers::Current)
+
+DECLARE_TPCNV_FACTORY (AFP_TDDigiCnv_p1,
+                       AFP_TDDigi,
+                       AFP_TDDigi_p1,
+                       Athena::TPCnvVers::Current)
+
+DECLARE_TPCNV_FACTORY (AFP_TDDigiCollectionCnv_p1,
+                       AFP_TDDigiCollection,
+                       AFP_TDDigiCollection_p1,
+                       Athena::TPCnvVers::Current)
+
+DECLARE_TPCNV_FACTORY (AFP_TDLocRecoEvCollectionCnv_p1,
+                       AFP_TDLocRecoEvCollection,
+                       AFP_TDLocRecoEvCollection_p1,
+                       Athena::TPCnvVers::Current)
+
+DECLARE_TPCNV_FACTORY (AFP_TDLocRecoEventCnv_p1,
+                       AFP_TDLocRecoEvent,
+                       AFP_TDLocRecoEvent_p1,
+                       Athena::TPCnvVers::Current)
+                      
+DECLARE_TPCNV_FACTORY (AFP_TDSimHitCnv_p1,
+                       AFP_TDSimHit,
+                       AFP_TDSimHit_p1,
+                       Athena::TPCnvVers::Current)
+
+DECLARE_TPCNV_FACTORY (AFP_TDSimHitCollectionCnv_p1,
+                       AFP_TDSimHitCollection,
+                       AFP_TDSimHitCollection_p1,
+                       Athena::TPCnvVers::Current)
-- 
GitLab


From f3c3da02f080a61bfe67c58a79d6a3c6a31de673 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 2 Sep 2021 13:25:53 -0400
Subject: [PATCH 022/347] CxxUtils: Add LockedPointer.

LockedPointer template class, to allow returning a held lock along
with a pointer in a movable object.
---
 Control/CxxUtils/CMakeLists.txt               |  2 +-
 Control/CxxUtils/CxxUtils/LockedPointer.h     | 55 +++++++++++++++++++
 Control/CxxUtils/share/LockedPointer_test.ref |  2 +
 Control/CxxUtils/test/LockedPointer_test.cxx  | 46 ++++++++++++++++
 4 files changed, 104 insertions(+), 1 deletion(-)
 create mode 100644 Control/CxxUtils/CxxUtils/LockedPointer.h
 create mode 100644 Control/CxxUtils/share/LockedPointer_test.ref
 create mode 100644 Control/CxxUtils/test/LockedPointer_test.cxx

diff --git a/Control/CxxUtils/CMakeLists.txt b/Control/CxxUtils/CMakeLists.txt
index e7899bebc55c..04e050bf1f22 100644
--- a/Control/CxxUtils/CMakeLists.txt
+++ b/Control/CxxUtils/CMakeLists.txt
@@ -132,7 +132,7 @@ foreach( test sincos_test ArrayScanner_test Arrayrep_test
       restrict_test vectorize_test get_unaligned_test aligned_vector_test
       vec_int_test vec_float_test vec_fb_int_test vec_fb_float_test
       ConcurrentHashmapImpl_test SimpleUpdater_test hexdump_test
-      FPControl_test )
+      FPControl_test LockedPointer_test )
    atlas_add_test( ${test}
       SOURCES test/${test}.cxx
       LOG_IGNORE_PATTERN "no version information available"
diff --git a/Control/CxxUtils/CxxUtils/LockedPointer.h b/Control/CxxUtils/CxxUtils/LockedPointer.h
new file mode 100644
index 000000000000..efccbc849919
--- /dev/null
+++ b/Control/CxxUtils/CxxUtils/LockedPointer.h
@@ -0,0 +1,55 @@
+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+/*
+ * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file CxxUtils/LockedPointer.h
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Sep, 2021
+ * @brief A pointer together with a movable lock.
+ */
+
+
+#ifndef CXXUTILS_LOCKEDPOINTER_H
+#define CXXUTILS_LOCKEDPOINTER_H
+
+
+#include <mutex>
+
+
+namespace CxxUtils {
+
+
+/**
+ * @brief A pointer together with a movable lock.
+ *
+ * This class holds a pointer to T along with a unique_lock.
+ * It can be used where we want to return a pointer to an object
+ * protected by a lock, and so want to return the lock along
+ * with the pointer.
+ *
+ * Objects of this class may be moved but not copied (like unique_ptr).
+ */
+template <class T, class MUTEX=std::recursive_mutex>
+class LockedPointer
+{
+public:
+  LockedPointer (T& p, std::unique_lock<MUTEX>&& lock)
+    : m_lock (std::move (lock)),
+      m_p (p)
+  {
+  }
+
+  T* get() { return &m_p; }
+  T* operator->() { return &m_p; }
+  T& operator*() { return m_p; }
+
+private:
+  std::unique_lock<MUTEX> m_lock;
+  T& m_p;
+};
+
+} // namespace CxxUtils
+
+
+#endif // not CXXUTILS_LOCKEDPOINTER_H
diff --git a/Control/CxxUtils/share/LockedPointer_test.ref b/Control/CxxUtils/share/LockedPointer_test.ref
new file mode 100644
index 000000000000..562d2b65fa11
--- /dev/null
+++ b/Control/CxxUtils/share/LockedPointer_test.ref
@@ -0,0 +1,2 @@
+CxxUtils/LockedPointer_test
+test1
diff --git a/Control/CxxUtils/test/LockedPointer_test.cxx b/Control/CxxUtils/test/LockedPointer_test.cxx
new file mode 100644
index 000000000000..531d71d9106e
--- /dev/null
+++ b/Control/CxxUtils/test/LockedPointer_test.cxx
@@ -0,0 +1,46 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+/**
+ * @file CxxUtils/test/LockedPointer_test.cxx
+ * @author scott snyder
+ * @date Sep 2021
+ * @brief Regression tests for LockedPointer.
+ */
+
+
+#undef NDEBUG
+#include "CxxUtils/LockedPointer.h"
+#include <mutex>
+#include <iostream>
+#include <cassert>
+
+
+void test1a (CxxUtils::LockedPointer<int> p)
+{
+  assert (*p == 42);
+}
+
+void test1()
+{
+  std::cout << "test1\n";
+
+  std::recursive_mutex m;
+  int x = 42;
+
+  {
+    std::unique_lock l (m);
+    CxxUtils::LockedPointer<int> p (x, std::move(l));
+    assert (*p == 42);
+    assert (*p.get() == 42);
+    test1a (std::move (p));
+  }
+}
+
+
+int main()
+{
+  std::cout << "CxxUtils/LockedPointer_test\n";
+  test1();
+  return 0;
+}
-- 
GitLab


From e193c3aba580674084460257691b380c5a37709f Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 7 Sep 2021 22:48:23 +0200
Subject: [PATCH 023/347] TrackingGeometryCondAlg: Configuration workaround.

Rename AtlasMaterialProvider to AtlasMaterialCondProvider to avoid
inadvertently clobbering the TrackingGeometrySvc configuration.
See ATLASSIM-5374.
---
 .../python/AtlasTrackingGeometryCondAlg.py                      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlg.py b/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlg.py
index 669fd6e3b84a..3168de231737 100644
--- a/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlg.py
+++ b/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlg.py
@@ -166,7 +166,7 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) :
         if TrkDetFlags.MaterialSource() == 'COOL':
             # the material provider
             from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerMaterialProvider as LayerMaterialProvider
-            AtlasMaterialProvider = LayerMaterialProvider('AtlasMaterialProvider')
+            AtlasMaterialProvider = LayerMaterialProvider('AtlasMaterialCondProvider')
             AtlasMaterialProvider.OutputLevel           = TrkDetFlags.ConfigurationOutputLevel()
             AtlasMaterialProvider.LayerMaterialMapKey   = TrkDetFlags.MaterialStoreGateKey()
         
-- 
GitLab


From a87d9d30f9ad99ea3a0ef52723c204554793c456 Mon Sep 17 00:00:00 2001
From: Will Leight <wleight@cern.ch>
Date: Wed, 8 Sep 2021 19:05:13 +0200
Subject: [PATCH 024/347] Fix for hit sorting issue

On rare occasions there can be issues with sorting RPC and MDT hits in the same station.
This fix uses id-based sorting to ensure that RPC and MDT hits are handled correctly, thus avoiding the addition of duplicate hits to the track in the hit recovery, as reported in ATLASRECTS-6410.
---
 .../MuPatPrimitives/CMakeLists.txt            |  2 +-
 .../MuPatPrimitives/SortMuPatHits.h           | 34 ++++++++++++++++++-
 .../src/MuPatHitTool.cxx                      | 26 +++++++-------
 3 files changed, 47 insertions(+), 15 deletions(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuPatPrimitives/CMakeLists.txt b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuPatPrimitives/CMakeLists.txt
index 3347cb848e84..c74632ff1bbb 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuPatPrimitives/CMakeLists.txt
+++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuPatPrimitives/CMakeLists.txt
@@ -11,7 +11,7 @@ atlas_add_library( MuPatPrimitives
                    src/*.cxx
                    PUBLIC_HEADERS MuPatPrimitives
                    LINK_LIBRARIES CxxUtils EventPrimitives TrkMeasurementBase TrkParameters MuonStationIndexLib 
-			          MuonSegment TrkSegment TrkTrack TrkTrackSummary)
+			          MuonSegment TrkSegment TrkTrack TrkTrackSummary MuonIdHelpersLib)
 
 # Install files from the package:
 #atlas_install_joboptions( share/*.py )
diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuPatPrimitives/MuPatPrimitives/SortMuPatHits.h b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuPatPrimitives/MuPatPrimitives/SortMuPatHits.h
index d0a70c3bb424..c3b99d8173ed 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuPatPrimitives/MuPatPrimitives/SortMuPatHits.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuPatPrimitives/MuPatPrimitives/SortMuPatHits.h
@@ -9,6 +9,7 @@
 #include "TrkMeasurementBase/MeasurementBase.h"
 #include "TrkParameters/TrackParameters.h"
 #include "TrkSurfaces/Surface.h"
+#include "MuonIdHelpers/IMuonIdHelperSvc.h"
 
 namespace Muon {
 
@@ -39,7 +40,38 @@ namespace Muon {
 
     class SortMuPatHits {
     public:
-        bool operator()(const MuPatHit* hit1, const MuPatHit* hit2) const {
+      bool operator()(const MuPatHit* hit1, const MuPatHit* hit2, const IMuonIdHelperSvc* idh) const {
+	    //first, check if both hits are in the same chamber, and at least one is an RPC
+	    //if so, do some ID-based sorting
+	    if(idh->chamberIndex(hit1->info().id) == idh->chamberIndex(hit2->info().id) && (hit1->info().type==1 || hit2->info().type==1)){
+	        if(hit1->info().type==0){
+		    if (idh->rpcIdHelper().doubletR(hit2->info().id) == 1) {
+		        if (idh->stationIndex(hit1->info().id) == MuonStationIndex::StIndex::BM || idh->isSmallChamber(hit1->info().id))
+		            return true;
+		        else return false;
+		    } 
+		    else return false;
+                }
+		else if(hit2->info().type==0){
+		    if (idh->rpcIdHelper().doubletR(hit1->info().id) == 1) {
+		        if (idh->stationIndex(hit2->info().id) == MuonStationIndex::StIndex::BM || idh->isSmallChamber(hit2->info().id))
+			    return false;
+			else return true;
+		    }
+		    else return true;
+		}
+		else{ //both hits are RPC
+		    Identifier id1=hit1->info().id;
+		    Identifier id2=hit2->info().id;
+		    if (idh->rpcIdHelper().doubletR(id1) != idh->rpcIdHelper().doubletR(id2)) {
+		        return idh->rpcIdHelper().doubletR(id1) > idh->rpcIdHelper().doubletR(id2);
+		    } else if (idh->rpcIdHelper().doubletZ(id1) != idh->rpcIdHelper().doubletZ(id2)) {
+		        return idh->rpcIdHelper().doubletZ(id1) > idh->rpcIdHelper().doubletZ(id2);
+		    } else if (idh->rpcIdHelper().doubletPhi(id1) != idh->rpcIdHelper().doubletPhi(id2)) {
+		        return idh->rpcIdHelper().doubletPhi(id1) > idh->rpcIdHelper().doubletPhi(id2);
+		    } //last case can be handled below
+		}
+	    }
             double dist = distanceCalculator(hit1->parameters(), hit2->parameters());
             if (dist < -0.01)
                 return true;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MuPatHitTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MuPatHitTool.cxx
index eecaad1371d4..8ee1c0b7e02a 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MuPatHitTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MuPatHitTool.cxx
@@ -404,7 +404,7 @@ namespace Muon {
         if (pos == list.end()) { --pos; }
 
         SortMuPatHits isLargerCal{};
-        bool isLarger = isLargerCal(hit, *pos);  // check whether the hit is larger that the current list item
+        bool isLarger = isLargerCal(hit, *pos, &*m_idHelperSvc);  // check whether the hit is larger that the current list item
         bool isLargerInit = isLarger;            // to know which direction we moved
 
         // check whether the hit is larger that the current list item
@@ -415,7 +415,7 @@ namespace Muon {
                 // if we reached the end of the list, insert the hit at the end
                 if (pos == list.end()) {
                     // check whether hit duplicate of last hit in list
-                    if (isLargerCal(list.back(), hit) != isLargerCal(hit, list.back()) ||
+		    if (isLargerCal(list.back(), hit, &*m_idHelperSvc) != isLargerCal(hit, list.back(), &*m_idHelperSvc) ||
                         (hit->info().type == MuPatHit::MM && hit->info().id != list.back()->info().id)) {
                         ATH_MSG_VERBOSE(" inserting hit at back   " << m_idHelperSvc->toString(hit->info().id) << " "
                                                                     << m_printer->print(hit->parameters()));
@@ -429,18 +429,18 @@ namespace Muon {
                     }
                     return --pos;
                 }
-                isLarger = isLargerCal(hit, *pos);  // recalculate distance
+                isLarger = isLargerCal(hit, *pos, &*m_idHelperSvc);  // recalculate distance
             }
         } else {
             // as long as the hit is smaller and we didn't reach the beginning of the list take a step back
             while (pos != list.begin() && !isLarger) {
                 --pos;                              // take a step back
-                isLarger = isLargerCal(hit, *pos);  // recalculate distance
+                isLarger = isLargerCal(hit, *pos, &*m_idHelperSvc);  // recalculate distance
             }
             // if we reached the first list item, check whether current hit is smaller. If so insert before first.
             if (pos == list.begin() && !isLarger) {
                 // check whether hit duplicate of last hit in list
-                if (isLargerCal(list.front(), hit) != isLargerCal(hit, list.front()) ||
+	        if (isLargerCal(list.front(), hit, &*m_idHelperSvc) != isLargerCal(hit, list.front(), &*m_idHelperSvc) ||
                     (hit->info().type == MuPatHit::MM && hit->info().id != list.front()->info().id)) {
                     ATH_MSG_VERBOSE(" inserting hit at front  " << m_idHelperSvc->toString(hit->info().id) << " "
                                                                 << m_printer->print(hit->parameters()));
@@ -460,7 +460,7 @@ namespace Muon {
             ++pos;
             if (pos == list.end()) {
                 // check whether hit duplicate of last hit in list
-                if (isLargerCal(list.back(), hit) != isLargerCal(hit, list.back()) ||
+	        if (isLargerCal(list.back(), hit, &*m_idHelperSvc) != isLargerCal(hit, list.back(), &*m_idHelperSvc) ||
                     (hit->info().type == MuPatHit::MM && hit->info().id != list.back()->info().id)) {
                     ATH_MSG_VERBOSE(" inserting hit at back   " << m_idHelperSvc->toString(hit->info().id) << " "
                                                                 << m_printer->print(hit->parameters()));
@@ -473,7 +473,7 @@ namespace Muon {
                 }
                 return --pos;
             }
-            isLarger = isLargerCal(hit, *pos);  // recalculate distance
+            isLarger = isLargerCal(hit, *pos, &*m_idHelperSvc);  // recalculate distance
         }
         // check for chamber sorting issues
         if (m_idHelperSvc->chamberIndex(hit->info().id) != m_idHelperSvc->chamberIndex((*pos)->info().id) && pos != list.begin()) {
@@ -510,7 +510,7 @@ namespace Muon {
         // remove duplicates
 
         // check whether hit and entry at pos are a duplicate
-        if (isLarger == isLargerCal(*pos, hit) && (hit->info().type != MuPatHit::MM || hit->info().id == (*pos)->info().id)) {
+        if (isLarger == isLargerCal(*pos, hit, &*m_idHelperSvc) && (hit->info().type != MuPatHit::MM || hit->info().id == (*pos)->info().id)) {
             // hit is a duplicate
             ATH_MSG_VERBOSE(" NOT inserting duplicate hit  " << m_idHelperSvc->toString(hit->info().id) << " "
                                                              << m_printer->print(hit->parameters()));
@@ -522,7 +522,7 @@ namespace Muon {
             --pos;  // move to previous hit
 
             // check whether hit and entry at pos are a duplicate
-            if (isLargerCal(hit, *pos) == isLargerCal(*pos, hit) &&
+            if (isLargerCal(hit, *pos, &*m_idHelperSvc) == isLargerCal(*pos, hit, &*m_idHelperSvc) &&
                 (hit->info().type != MuPatHit::MM || hit->info().id == (*pos)->info().id)) {
                 ++pos;  // move forward to insert position for pos
                 // hit is a duplicate
@@ -610,10 +610,10 @@ namespace Muon {
             dataOss << "  " << result << " dist " << distance;
             dataStrings.push_back(dataOss.str());
             if (itNext != it_end) {
-                isLarger = isLargerCal(*itNext, *it);
+	        isLarger = isLargerCal(*itNext, *it, &*m_idHelperSvc);
                 distance = distCal(*it, *itNext);
                 result = isLarger ? "larger " : "smaller";
-                if (isLarger == isLargerCal(*it, *itNext)) {
+                if (isLarger == isLargerCal(*it, *itNext, &*m_idHelperSvc)) {
                     result = "duplicate";
                 } else if (!isLarger) {
                     result += "   sorting problem ";
@@ -718,8 +718,8 @@ namespace Muon {
         if (itNext != it_end) ++itNext;
         bool isLarger = true;
         for (; itNext != it_end; ++it, ++itNext) {
-            isLarger = isLargerCal(*it, *itNext);
-            bool sameSurface = (isLarger == isLargerCal(*it, *itNext));  // same surface
+	    isLarger = isLargerCal(*it, *itNext, &*m_idHelperSvc);
+            bool sameSurface = (isLarger == isLargerCal(*it, *itNext, &*m_idHelperSvc));  // same surface
             if (!isLarger && !sameSurface) return false;
             if (sameSurface) return false;
         }
-- 
GitLab


From b402bdc0aa410d2c198efc11cc8683b4654c8eb1 Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <smh@cern.ch>
Date: Wed, 8 Sep 2021 19:08:19 +0200
Subject: [PATCH 025/347] Move to unordered_map and add reserve()

---
 .../L1CaloFEXSim/L1CaloFEXSim/jFEXSysSim.h    |  12 +-
 .../L1CaloFEX/L1CaloFEXSim/src/jFEXSysSim.cxx | 130 +++++++++---------
 2 files changed, 72 insertions(+), 70 deletions(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSysSim.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSysSim.h
index cd46c6a2189c..4564e35b51e7 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSysSim.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSysSim.h
@@ -88,12 +88,12 @@ namespace LVL1 {
     SG::WriteHandleKey< xAOD::jFexSumETRoIContainer> m_jFexSumETOutKey {this,"Key_jFexSumETOutputContainer","L1_jFexSumETRoI","Output jFexEDM SumET container"};
     SG::WriteHandleKey< xAOD::jFexMETRoIContainer>   m_jFexMETOutKey   {this,"Key_jFexMETOutputContainer","L1_jFexMETRoI","Output jFexEDM Met container"};
 
-    std::map<int,jTower> m_jTowersColl;
-    std::map<uint8_t, std::vector<std::vector<uint32_t>> > m_allSmallRJetTobs; 
-    std::map<uint8_t, std::vector<std::vector<uint32_t>> > m_allLargeRJetTobs;
-    std::map<uint8_t, std::vector<std::vector<uint32_t>> > m_alltauTobs;
-    std::map<uint8_t, std::vector<std::vector<uint32_t>> > m_allsumEtTobs;
-    std::map<uint8_t, std::vector<std::vector<uint32_t>> > m_allMetTobs;
+    std::unordered_map<int,jTower> m_jTowersColl;
+    std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> > m_allSmallRJetTobs; 
+    std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> > m_allLargeRJetTobs;
+    std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> > m_alltauTobs;
+    std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> > m_allsumEtTobs;
+    std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> > m_allMetTobs;
   };
   
 } // end of namespace
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSysSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSysSim.cxx
index 72268f2f4883..7bd260a758f7 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSysSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSysSim.cxx
@@ -158,7 +158,8 @@ namespace LVL1 {
     // let's work fully out to in (sort of)
     // Let's go with FCAL2 first
     // decide which subset of towers (and therefore supercells) should go to the jFEX
-    std::map<int,jTower> tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL;
+    std::unordered_map<int,jTower> tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL;
+    tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.reserve(1600);
 
     // let's try doing this with an array initially just containing tower IDs.
     int tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL [2*FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width];
@@ -180,7 +181,7 @@ namespace LVL1 {
         int towerid = initialFCAL2 - (thisCol * 64) + thisRow;
 
         tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL[thisRow][thisCol] = towerid;
-        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
@@ -193,7 +194,7 @@ namespace LVL1 {
         int towerid = initialFCAL1 - ((thisCol-4) * 64) + thisRow;
 
         tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL[thisRow][thisCol] = towerid;
-        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
@@ -206,7 +207,7 @@ namespace LVL1 {
         int towerid = initialFCAL0 - ((thisCol-12) * 64) + thisRow;
 
         tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL[thisRow][thisCol] = towerid;
-        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
@@ -219,7 +220,7 @@ namespace LVL1 {
         int towerid = initialEMEC - ((thisCol-24) * 64) + thisRow;
 
         tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL[thisRow][thisCol] = towerid;
-        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
@@ -230,7 +231,7 @@ namespace LVL1 {
 	int towerid = initialEMEC - ((thisCol-24) * 64) + thisRow; //note special case -24 rather than -28, this *is* deliberate
 
 	tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL[thisRow][thisCol] = towerid;
-	tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+	tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 	
       }
     }
@@ -240,7 +241,7 @@ namespace LVL1 {
       int towerid = initialTRANS + thisRow;
 
       tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL[thisRow][38] = towerid;
-      tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+      tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
     }
     // set the EMB part
@@ -250,10 +251,11 @@ namespace LVL1 {
         int towerid = initialEMB - ( (thisCol-39) * 64) + thisRow;
 
         tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL[thisRow][thisCol] = towerid;
-        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
+
     if (msgLvl(MSG::DEBUG)) {
       ATH_MSG_DEBUG("CONTENTS OF jFEX " << thisJFEX << " :");
       for (int thisRow=rows-1; thisRow>=0; thisRow--) {
@@ -274,11 +276,11 @@ namespace LVL1 {
     }
     m_jFEXSimTool->init(thisJFEX);
     ATH_CHECK(m_jFEXSimTool->ExecuteForwardASide(tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL));
-    m_allSmallRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) ));
-    m_allLargeRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
-    m_alltauTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
-    m_allsumEtTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
-    m_allMetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
+    m_allSmallRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) ));
+    m_allLargeRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
+    m_alltauTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
+    m_allsumEtTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
+    m_allMetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
     m_jFEXSimTool->reset();
     
     //--------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -299,7 +301,7 @@ namespace LVL1 {
     // jFEX 1
     thisJFEX = 1;
     // decide which subset of towers (and therefore supercells) should go to the jFEX
-    std::map<int,jTower> tmp_jTowersColl_subset_1;
+    std::unordered_map<int,jTower> tmp_jTowersColl_subset_1;
     
     // let's try doing this with an array initially just containing tower IDs.
     int tmp_jTowersIDs_subset_1 [2*FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width];
@@ -321,7 +323,7 @@ namespace LVL1 {
 	int towerid = initialEMEC - (thisCol * 64) + thisRow;
 	
 	tmp_jTowersIDs_subset_1[thisRow][thisCol] = towerid;
-	tmp_jTowersColl_subset_1.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+	tmp_jTowersColl_subset_1.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 	
       }
     }
@@ -332,7 +334,7 @@ namespace LVL1 {
         int towerid = initialTRANS + thisRow;
 
         tmp_jTowersIDs_subset_1[thisRow][9] = towerid;
-        tmp_jTowersColl_subset_1.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_1.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
     }
 
@@ -343,7 +345,7 @@ namespace LVL1 {
             int towerid = initialEMB - ( (thisCol-10) * 64) + thisRow ;
 
             tmp_jTowersIDs_subset_1[thisRow][thisCol] = towerid;
-            tmp_jTowersColl_subset_1.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+            tmp_jTowersColl_subset_1.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
         }
     }
@@ -368,11 +370,11 @@ namespace LVL1 {
     }
     m_jFEXSimTool->init(thisJFEX);
     ATH_CHECK(m_jFEXSimTool->ExecuteBarrel(tmp_jTowersIDs_subset_1));
-    m_allSmallRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) ));
-    m_allLargeRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
-    m_alltauTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
-    m_allsumEtTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
-    m_allMetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
+    m_allSmallRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) ));
+    m_allLargeRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
+    m_alltauTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
+    m_allsumEtTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
+    m_allMetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
     m_jFEXSimTool->reset();
     
     //--------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -393,7 +395,7 @@ namespace LVL1 {
     // jFEX 2
     thisJFEX = 2;
     // decide which subset of towers (and therefore supercells) should go to the jFEX
-    std::map<int,jTower> tmp_jTowersColl_subset_2;
+    std::unordered_map<int,jTower> tmp_jTowersColl_subset_2;
     
     // doing this with an array initially just containing tower IDs.
     int tmp_jTowersIDs_subset_2 [2*FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width];
@@ -415,7 +417,7 @@ namespace LVL1 {
         int towerid = initialEMEC /*- (thisCol * 64)*/  + thisRow;
 
         tmp_jTowersIDs_subset_2[thisRow][0] = towerid;
-        tmp_jTowersColl_subset_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
     }
 
@@ -425,7 +427,7 @@ namespace LVL1 {
         int towerid = initialTRANS + thisRow;
 
         tmp_jTowersIDs_subset_2[thisRow][1] = towerid;
-        tmp_jTowersColl_subset_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
     }
 
@@ -439,7 +441,7 @@ namespace LVL1 {
             towerid = tmp_initEMB - ( (thisCol-2) * 64) + thisRow;
             tmp_jTowersIDs_subset_2[thisRow][thisCol] = towerid;
             
-            tmp_jTowersColl_subset_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+            tmp_jTowersColl_subset_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
         }
     }
@@ -457,7 +459,7 @@ namespace LVL1 {
             towerid = tmp_initEMB + ( (thisCol-16) * 64) + thisRow;
             tmp_jTowersIDs_subset_2[thisRow][thisCol] = towerid;
 
-            tmp_jTowersColl_subset_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+            tmp_jTowersColl_subset_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
         }
     }
@@ -484,11 +486,11 @@ namespace LVL1 {
     //tool use instead
     m_jFEXSimTool->init(thisJFEX);
     ATH_CHECK(m_jFEXSimTool->ExecuteBarrel(tmp_jTowersIDs_subset_2));
-    m_allSmallRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) )); 
-    m_allLargeRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
-    m_alltauTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
-    m_allsumEtTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
-    m_allMetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
+    m_allSmallRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) )); 
+    m_allLargeRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
+    m_alltauTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
+    m_allsumEtTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
+    m_allMetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
     m_jFEXSimTool->reset();
     
     //--------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -509,7 +511,7 @@ namespace LVL1 {
     // jFEX 3
     thisJFEX = 3;
     // decide which subset of towers (and therefore supercells) should go to the jFEX
-    std::map<int,jTower> tmp_jTowersColl_subset_3;
+    std::unordered_map<int,jTower> tmp_jTowersColl_subset_3;
     
     // doing this with an array initially just containing tower IDs.
     int tmp_jTowersIDs_subset_3 [2*FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width];
@@ -536,7 +538,7 @@ namespace LVL1 {
 
         tmp_jTowersIDs_subset_3[thisRow][thisCol] = towerid;
 
-        tmp_jTowersColl_subset_3.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_3.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
@@ -554,7 +556,7 @@ namespace LVL1 {
 	
 	tmp_jTowersIDs_subset_3[thisRow][thisCol] = towerid;
 	
-	tmp_jTowersColl_subset_3.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+	tmp_jTowersColl_subset_3.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 	
       }
     }
@@ -564,7 +566,7 @@ namespace LVL1 {
       int towerid = initialTRANS + thisRow;
 
       tmp_jTowersIDs_subset_3[thisRow][22] = towerid;
-      tmp_jTowersColl_subset_3.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+      tmp_jTowersColl_subset_3.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
     }
 
@@ -573,7 +575,7 @@ namespace LVL1 {
       int towerid = initialEMEC + /*( (thisCol-8) * 64)*/ + thisRow;
 
       tmp_jTowersIDs_subset_3[thisRow][23] = towerid;
-      tmp_jTowersColl_subset_3.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+      tmp_jTowersColl_subset_3.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
     }
 
@@ -599,11 +601,11 @@ namespace LVL1 {
     //tool use instead
     m_jFEXSimTool->init(thisJFEX);
     ATH_CHECK(m_jFEXSimTool->ExecuteBarrel(tmp_jTowersIDs_subset_3));
-    m_allSmallRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) ));
-    m_allLargeRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
-    m_alltauTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
-    m_allsumEtTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
-    m_allMetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
+    m_allSmallRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) ));
+    m_allLargeRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
+    m_alltauTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
+    m_allsumEtTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
+    m_allMetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
     m_jFEXSimTool->reset();
     
     //--------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -623,7 +625,7 @@ namespace LVL1 {
     // jFEX 4
     thisJFEX = 4;
     // decide which subset of towers (and therefore supercells) should go to the jFEX
-    std::map<int,jTower> tmp_jTowersColl_subset_4;
+    std::unordered_map<int,jTower> tmp_jTowersColl_subset_4;
     
     // doing this with an array initially just containing tower IDs.
     int tmp_jTowersIDs_subset_4 [2*FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width];
@@ -644,7 +646,7 @@ namespace LVL1 {
 	int towerid = initialEMB + ( (thisCol) * 64) + thisRow;
 	
 	tmp_jTowersIDs_subset_4[thisRow][thisCol] = towerid;
-	tmp_jTowersColl_subset_4.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+	tmp_jTowersColl_subset_4.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 	
       }
     }
@@ -653,7 +655,7 @@ namespace LVL1 {
       int towerid = initialTRANS + thisRow;
       
       tmp_jTowersIDs_subset_4[thisRow][14] = towerid;
-      tmp_jTowersColl_subset_4.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+      tmp_jTowersColl_subset_4.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
       
     }
     // set the EMEC part
@@ -662,7 +664,7 @@ namespace LVL1 {
 	int towerid = initialEMEC + ( (thisCol-15) * 64) + thisRow;
 	
 	tmp_jTowersIDs_subset_4[thisRow][thisCol] = towerid;
-	tmp_jTowersColl_subset_4.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+	tmp_jTowersColl_subset_4.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 	
       }
     }
@@ -689,11 +691,11 @@ namespace LVL1 {
     //tool use instead
     m_jFEXSimTool->init(thisJFEX);
     ATH_CHECK(m_jFEXSimTool->ExecuteBarrel(tmp_jTowersIDs_subset_4));
-    m_allSmallRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) ));
-    m_allLargeRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
-    m_alltauTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
-    m_allsumEtTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
-    m_allMetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
+    m_allSmallRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) ));
+    m_allLargeRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
+    m_alltauTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
+    m_allsumEtTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
+    m_allMetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
     m_jFEXSimTool->reset();
     //--------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
@@ -721,7 +723,7 @@ namespace LVL1 {
     
     
     // decide which subset of towers (and therefore supercells) should go to the jFEX
-    std::map<int,jTower> tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2;
+    std::unordered_map<int,jTower> tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2;
 
     // let's try doing this with an array initially just containing tower IDs.
     int tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL_2 [2*FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width];
@@ -742,7 +744,7 @@ namespace LVL1 {
         int towerid = initialEMB + ( (thisCol) * 64) + thisRow;
 
         tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL_2[thisRow][thisCol] = towerid;
-        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
@@ -752,7 +754,7 @@ namespace LVL1 {
       int towerid = initialTRANS + thisRow;
 
       tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL_2[thisRow][6] = towerid;
-      tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+      tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
     }
 
@@ -763,7 +765,7 @@ namespace LVL1 {
 	int towerid = initialEMEC + ((thisCol-7) * 64) + thisRow;
 	
 	tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL_2[thisRow][thisCol] = towerid;
-	tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+	tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 	
       }
     }
@@ -775,7 +777,7 @@ namespace LVL1 {
         int towerid = initialEMEC + ((thisCol-7) * 64) + thisRow; //note special case -7 rather than -17, this *is* deliberate
 
         tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL_2[thisRow][thisCol] = towerid;
-        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
@@ -789,7 +791,7 @@ namespace LVL1 {
         int towerid = initialFCAL0 + ((thisCol-21) * 64) + thisRow;
 
         tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL_2[thisRow][thisCol] = towerid;
-        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
@@ -803,7 +805,7 @@ namespace LVL1 {
         int towerid = initialFCAL1 + ((thisCol-33) * 64) + thisRow;
 
         tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL_2[thisRow][thisCol] = towerid;
-        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
@@ -817,7 +819,7 @@ namespace LVL1 {
         int towerid = initialFCAL2 + ((thisCol-41) * 64) + thisRow;
 
         tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL_2[thisRow][thisCol] = towerid;
-        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
+        tmp_jTowersColl_subset_ENDCAP_AND_EMB_AND_FCAL_2.insert( std::unordered_map<int, jTower>::value_type(towerid,  *(this_jTowerContainer->findTower(towerid))));
 
       }
     }
@@ -844,11 +846,11 @@ namespace LVL1 {
 
     m_jFEXSimTool->init(thisJFEX);
     ATH_CHECK(m_jFEXSimTool->ExecuteForwardCSide(tmp_jTowersIDs_subset_ENDCAP_AND_EMB_AND_FCAL_2));
-    m_allSmallRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) ));
-    m_allLargeRJetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
-    m_alltauTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
-    m_allsumEtTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
-    m_allMetTobs.insert(std::map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
+    m_allSmallRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSmallRJetTOBs() ) ));
+    m_allLargeRJetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getLargeRJetTOBs() ) ));
+    m_alltauTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getTauTOBs() ) ));
+    m_allsumEtTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getSumEtTOBs() ) ));
+    m_allMetTobs.insert(std::unordered_map<uint8_t, std::vector<std::vector<uint32_t>> >::value_type(thisJFEX,(m_jFEXSimTool->getMetTOBs() ) ));
     m_jFEXSimTool->reset();
 
     
-- 
GitLab


From 5cefcafd4866e919ef7c9d243c8b93bae9a72e1a Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Wed, 8 Sep 2021 21:03:53 +0200
Subject: [PATCH 026/347] solve all cppcheck warnings

---
 .../TRT_ConditionsAlgs/src/TRTActiveCondAlg.cxx           | 8 ++++----
 .../TRT_ConditionsAlgs/src/TRTActiveCondAlg.h             | 2 +-
 .../TRT_ConditionsAlgs/src/TRTPhaseCondAlg.cxx            | 2 +-
 .../TRT_ConditionsAlgs/src/TRTStrawCondAlg.cxx            | 2 +-
 .../TRT_ConditionsAlgs/src/TRTStrawStatusWrite.cxx        | 1 +
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.cxx b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.cxx
index c55fde194b25..92183773786a 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.cxx
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.cxx
@@ -107,7 +107,7 @@ StatusCode TRTActiveCondAlg::execute()
   float rMinEndcap = 617.; 
   float rMaxEndcap = 1106.;
   int countAll(0), countDead(0), countSaved(0), countPhiSkipped(0), countEtaSkipped(0), countInvalidEtaValues(0); 
-  for (std::vector<Identifier>::const_iterator it = m_trtId->straw_layer_begin(); it != m_trtId->straw_layer_end(); it++  ) {
+  for (std::vector<Identifier>::const_iterator it = m_trtId->straw_layer_begin(); it != m_trtId->straw_layer_end(); ++it  ) {
      int nStrawsInLayer = m_trtId->straw_max(*it);
      for (int i=0; i<=nStrawsInLayer; i++) { 
 
@@ -121,7 +121,7 @@ StatusCode TRTActiveCondAlg::execute()
         countAll++; if (status) countDead++;
 
         const Amg::Vector3D &strawPosition = elements->getDetectorElement(hashId)->center(id);
-        double phi = atan2( strawPosition.y(), strawPosition.x() );
+        double phi = std::atan2( strawPosition.y(), strawPosition.x() );
         int phiBin = writeCdo->findPhiBin( phi );
 	if (phiBin<0) { 
            ATH_MSG_DEBUG("TRTCond::ActiveFraction phiBin<0: " << phi << " " << phiBin);
@@ -131,7 +131,7 @@ StatusCode TRTActiveCondAlg::execute()
 
 	// calculate etaMin, etaMax
 	int side = m_trtId->barrel_ec(id);
-        float z = fabs( strawPosition.z() );
+        float z = std::abs( strawPosition.z() );
 	float thetaMin(0.), thetaMax(0.);
 	if (abs(side)==1) { // barrel
            float zRange = 360.; // straw length / 2  
@@ -153,7 +153,7 @@ StatusCode TRTActiveCondAlg::execute()
         float etaCheck[] = {0., 0.};
         for (int ti=0; ti<2; ti++) {
            if (thetaCheck[ti]<=0.||thetaCheck[ti]>=M_PI) ATH_MSG_DEBUG("TRTCond::ActiveFraction: theta " << ti << " " << thetaCheck[ti]);
-           float tanTheta = tan(thetaCheck[ti]/2.);
+           float tanTheta = std::tan(thetaCheck[ti]/2.);
            if (tanTheta<=0.) {
               ATH_MSG_DEBUG("TRTCond::ActiveFraction: theta tan " << ti << " " << tanTheta );
               countInvalidEtaValues++;
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.h b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.h
index 114f0d7c83b7..2f977d196044 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.h
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.h
@@ -37,7 +37,7 @@ class TRTActiveCondAlg : public AthAlgorithm
   SG::WriteCondHandleKey<TRTCond::ActiveFraction> m_strawWriteKey{this,"ActiveWriteKey","ActiveFraction","ActiveFraction out-key"};
 
   ToolHandle<ITRT_StrawStatusSummaryTool> m_strawStatus;
-  const TRT_ID *m_trtId;
+  const TRT_ID *m_trtId{};
 
 };
 #endif
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTPhaseCondAlg.cxx b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTPhaseCondAlg.cxx
index 221b135554a7..97c2d81df533 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTPhaseCondAlg.cxx
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTPhaseCondAlg.cxx
@@ -72,7 +72,7 @@ StatusCode TRTPhaseCondAlg::execute()
   double rtShift = 0.;
   double averageT0 = 0.;
 
-  for (std::vector<Identifier>::const_iterator it = m_trtId->straw_layer_begin(); it != m_trtId->straw_layer_end(); it++  ) {
+  for (std::vector<Identifier>::const_iterator it = m_trtId->straw_layer_begin(); it != m_trtId->straw_layer_end(); ++it  ) {
 
     int nStrawsInLayer = m_trtId->straw_max(*it);
 
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawCondAlg.cxx b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawCondAlg.cxx
index 89a37a84a6bc..bcc466e93d67 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawCondAlg.cxx
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawCondAlg.cxx
@@ -78,7 +78,7 @@ StatusCode TRTStrawCondAlg::execute()
 
   // ____________ Compute number of alive straws for Write Cond object  ____________
 
-  for (std::vector<Identifier>::const_iterator it = m_trtId->straw_layer_begin(); it != m_trtId->straw_layer_end(); it++  ) {
+  for (std::vector<Identifier>::const_iterator it = m_trtId->straw_layer_begin(); it != m_trtId->straw_layer_end(); ++it ) {
 
    // Make sure it is a straw_layer id                                                                                                                   
    Identifier strawLayerId = m_trtId->layer_id(*it);
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawStatusWrite.cxx b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawStatusWrite.cxx
index 9bf7ac6064f5..95c36dca954a 100755
--- a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawStatusWrite.cxx
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawStatusWrite.cxx
@@ -158,6 +158,7 @@ int TRTStrawStatusWrite::getStatus(Identifier offlineID){
 
    if (!strawstatuscontainer) {
      ATH_MSG_WARNING( "::getStatus, strawstatuscontainer == 0, dead straws not set"); 
+     return stat;
   }
   stat=int((*strawstatuscontainer).get(id).getstatus());
   return stat;
-- 
GitLab


From a0b6a2773ea4ddf06033b23982b0881c41fe956f Mon Sep 17 00:00:00 2001
From: Paula Martinez Suarez <paula.martinez.suarez@cern.ch>
Date: Wed, 8 Sep 2021 21:46:04 +0200
Subject: [PATCH 027/347] Update algo name

---
 ...BsIncl.h => InvariantMassThreeTOBsIncl1.h} | 12 +++----
 ....h => InvariantMassThreeTOBsIncl1Charge.h} | 12 +++----
 ...cl.cxx => InvariantMassThreeTOBsIncl1.cxx} | 24 ++++++-------
 ... => InvariantMassThreeTOBsIncl1Charge.cxx} | 36 +++++++++----------
 .../python/L1/Config/TopoAlgoDef.py           |  2 +-
 .../LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py  |  2 +-
 6 files changed, 44 insertions(+), 44 deletions(-)
 rename Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/{InvariantMassThreeTOBsIncl.h => InvariantMassThreeTOBsIncl1.h} (78%)
 rename Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/{InvariantMassThreeTOBsInclCharge.h => InvariantMassThreeTOBsIncl1Charge.h} (76%)
 rename Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/{InvariantMassThreeTOBsIncl.cxx => InvariantMassThreeTOBsIncl1.cxx} (89%)
 rename Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/{InvariantMassThreeTOBsInclCharge.cxx => InvariantMassThreeTOBsIncl1Charge.cxx} (87%)

diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl1.h
similarity index 78%
rename from Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl.h
rename to Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl1.h
index f2836d898d8d..31b95956db28 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl1.h
@@ -1,22 +1,22 @@
 /*
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
-//  InvariantMassThreeTOBsIncl.h
+//  InvariantMassThreeTOBsIncl1.h
 //  TopoCore
 //  Created by Carlos Moreno based on InvariantMassInclusive1 by Joerg Stelzer on 11/16/12.
 
-#ifndef __TopoCore__InvariantMassThreeTOBsIncl__
-#define __TopoCore__InvariantMassThreeTOBsIncl__
+#ifndef L1TOPOALGORITHMS_INVARIANTMASSTHREETOBSINCL1_H
+#define L1TOPOALGORITHMS_INVARIANTMASSTHREETOBSINCL1_H
 
 #include <iostream>
 #include "L1TopoInterfaces/DecisionAlg.h"
 
 namespace TCS {
    
-   class InvariantMassThreeTOBsIncl : public DecisionAlg {
+   class InvariantMassThreeTOBsIncl1 : public DecisionAlg {
    public:
-      InvariantMassThreeTOBsIncl(const std::string & name);
-      virtual ~InvariantMassThreeTOBsIncl();
+      InvariantMassThreeTOBsIncl1(const std::string & name);
+      virtual ~InvariantMassThreeTOBsIncl1();
 
       virtual StatusCode initialize() override final;
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsInclCharge.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl1Charge.h
similarity index 76%
rename from Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsInclCharge.h
rename to Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl1Charge.h
index 982e30de033e..8486b7ac09fb 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsInclCharge.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassThreeTOBsIncl1Charge.h
@@ -1,22 +1,22 @@
 /*
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-//  InvariantMassThreeTOBsInclCharge.h
+//  InvariantMassThreeTOBsIncl1Charge.h
 //  TopoCore
 //  Created by Paula Martinez based on InvariantMassInclusive1 by Joerg Stelzer on 11/16/12.
 
-#ifndef L1TOPOALGORITHMS_INVARIANTMASSTHREETOBSINCLCHARGE_H
-#define L1TOPOALGORITHMS_INVARIANTMASSTHREETOBSINCLCHARGE_H
+#ifndef L1TOPOALGORITHMS_INVARIANTMASSTHREETOBSINCL1CHARGE_H
+#define L1TOPOALGORITHMS_INVARIANTMASSTHREETOBSINCL1CHARGE_H
 
 #include <iostream>
 #include "L1TopoInterfaces/DecisionAlg.h"
 
 namespace TCS {
    
-   class InvariantMassThreeTOBsInclCharge : public DecisionAlg {
+   class InvariantMassThreeTOBsIncl1Charge : public DecisionAlg {
    public:
-      InvariantMassThreeTOBsInclCharge(const std::string & name);
-      virtual ~InvariantMassThreeTOBsInclCharge();
+      InvariantMassThreeTOBsIncl1Charge(const std::string & name);
+      virtual ~InvariantMassThreeTOBsIncl1Charge();
 
       virtual StatusCode initialize() override final;
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl1.cxx
similarity index 89%
rename from Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl.cxx
rename to Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl1.cxx
index 9c1280e5378f..2167676143de 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl1.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 /*********************************
- * InvariantMassThreeTOBsIncl.cxx
+ * InvariantMassThreeTOBsIncl1.cxx
  * Created by Carlos Moreno based on InvariantMassInclusive1 by V Sorin
  * 
  * For questions contact atlas-trig-l1topo-algcom@cern.ch. 
@@ -24,14 +24,14 @@
 #include <sstream>
 #include <vector>
 
-#include "L1TopoAlgorithms/InvariantMassThreeTOBsIncl.h"
+#include "L1TopoAlgorithms/InvariantMassThreeTOBsIncl1.h"
 #include "L1TopoCommon/Exception.h"
 #include "L1TopoInterfaces/Decision.h"
 
-REGISTER_ALG_TCS(InvariantMassThreeTOBsIncl)
+REGISTER_ALG_TCS(InvariantMassThreeTOBsIncl1)
 
 
-TCS::InvariantMassThreeTOBsIncl::InvariantMassThreeTOBsIncl(const std::string & name) : DecisionAlg(name)
+TCS::InvariantMassThreeTOBsIncl1::InvariantMassThreeTOBsIncl1(const std::string & name) : DecisionAlg(name)
 {
    defineParameter("InputWidth", 3);
    defineParameter("MaxTob", 0); 
@@ -59,11 +59,11 @@ TCS::InvariantMassThreeTOBsIncl::InvariantMassThreeTOBsIncl(const std::string &
    setNumberOutputBits(6);
 }
 
-TCS::InvariantMassThreeTOBsIncl::~InvariantMassThreeTOBsIncl(){}
+TCS::InvariantMassThreeTOBsIncl1::~InvariantMassThreeTOBsIncl1(){}
 
 
 TCS::StatusCode
-TCS::InvariantMassThreeTOBsIncl::initialize() {
+TCS::InvariantMassThreeTOBsIncl1::initialize() {
   if(parameter("MaxTob").value() > 0) {
       p_NumberLeading1 = parameter("MaxTob").value();
    } else {
@@ -90,8 +90,8 @@ TCS::InvariantMassThreeTOBsIncl::initialize() {
 
    // book histograms
    for(unsigned int i=0; i<numberOutputBits(); ++i) {
-       std::string hname_accept = "hInvariantMassThreeTOBsIncl_accept_bit"+std::to_string((int)i);
-       std::string hname_reject = "hInvariantMassThreeTOBsIncl_reject_bit"+std::to_string((int)i);
+       std::string hname_accept = "hInvariantMassThreeTOBsIncl1_accept_bit"+std::to_string((int)i);
+       std::string hname_reject = "hInvariantMassThreeTOBsIncl1_reject_bit"+std::to_string((int)i);
        // mass
        bookHist(m_histAccept, hname_accept, "INVM", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]));
        bookHist(m_histReject, hname_reject, "INVM", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]));
@@ -105,7 +105,7 @@ TCS::InvariantMassThreeTOBsIncl::initialize() {
 
 
 TCS::StatusCode
-TCS::InvariantMassThreeTOBsIncl::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
+TCS::InvariantMassThreeTOBsIncl1::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
 						 const std::vector<TCS::TOBArray *> & output,
 						 Decision & decision )
 {
@@ -167,7 +167,7 @@ TCS::InvariantMassThreeTOBsIncl::processBitCorrect( const std::vector<TCS::TOBAr
          }
    } else {
 
-      TCS_EXCEPTION("InvariantMassThreeTOBsIncl alg must have 1 input list, but got " << input.size());
+      TCS_EXCEPTION("InvariantMassThreeTOBsIncl1 alg must have 1 input list, but got " << input.size());
 
    }
 
@@ -176,7 +176,7 @@ TCS::InvariantMassThreeTOBsIncl::processBitCorrect( const std::vector<TCS::TOBAr
 }
 
 TCS::StatusCode
-TCS::InvariantMassThreeTOBsIncl::process( const std::vector<TCS::TOBArray const *> & input,
+TCS::InvariantMassThreeTOBsIncl1::process( const std::vector<TCS::TOBArray const *> & input,
 					  const std::vector<TCS::TOBArray *> & output,
 					  Decision & decision )
 {
@@ -239,7 +239,7 @@ TCS::InvariantMassThreeTOBsIncl::process( const std::vector<TCS::TOBArray const
 	 }
    } else {
 
-      TCS_EXCEPTION("InvariantMassThreeTOBsIncl alg must have either 1 input list, but got " << input.size());
+      TCS_EXCEPTION("InvariantMassThreeTOBsIncl1 alg must have either 1 input list, but got " << input.size());
 
    }
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsInclCharge.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl1Charge.cxx
similarity index 87%
rename from Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsInclCharge.cxx
rename to Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl1Charge.cxx
index 0a35a2c926d5..477676f7df41 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsInclCharge.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassThreeTOBsIncl1Charge.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 /*********************************
- * InvariantMassThreeTOBsInclCharge.cxx
+ * InvariantMassThreeTOBsIncl1Charge.cxx
  * Created by Paula Martinez based on InvariantMassInclusive1 by V Sorin
  * 
  * For questions contact atlas-trig-l1topo-algcom@cern.ch. 
@@ -22,15 +22,15 @@
 #include <sstream>
 #include <vector>
 
-#include "L1TopoAlgorithms/InvariantMassThreeTOBsInclCharge.h"
+#include "L1TopoAlgorithms/InvariantMassThreeTOBsIncl1Charge.h"
 #include "L1TopoCommon/Exception.h"
 #include "L1TopoInterfaces/Decision.h"
 
 
-REGISTER_ALG_TCS(InvariantMassThreeTOBsInclCharge)
+REGISTER_ALG_TCS(InvariantMassThreeTOBsIncl1Charge)
 
 
-TCS::InvariantMassThreeTOBsInclCharge::InvariantMassThreeTOBsInclCharge(const std::string & name) : DecisionAlg(name)
+TCS::InvariantMassThreeTOBsIncl1Charge::InvariantMassThreeTOBsIncl1Charge(const std::string & name) : DecisionAlg(name)
 {
    defineParameter("InputWidth", 3);
    defineParameter("MaxTob", 0); 
@@ -58,11 +58,11 @@ TCS::InvariantMassThreeTOBsInclCharge::InvariantMassThreeTOBsInclCharge(const st
    setNumberOutputBits(6);
 }
 
-TCS::InvariantMassThreeTOBsInclCharge::~InvariantMassThreeTOBsInclCharge(){}
+TCS::InvariantMassThreeTOBsIncl1Charge::~InvariantMassThreeTOBsIncl1Charge(){}
 
 
 TCS::StatusCode
-TCS::InvariantMassThreeTOBsInclCharge::initialize() {
+TCS::InvariantMassThreeTOBsIncl1Charge::initialize() {
   if(parameter("MaxTob").value() > 0) {
       p_NumberLeading1 = parameter("MaxTob").value();
    } else {
@@ -89,14 +89,14 @@ TCS::InvariantMassThreeTOBsInclCharge::initialize() {
 
    // book histograms
    for(unsigned int i=0; i<numberOutputBits(); ++i) {
-       std::string hname_accept = "hInvariantMassThreeTOBsInclCharge_accept_bit"+std::to_string(static_cast<int>(i));
-       std::string hname_reject = "hInvariantMassThreeTOBsInclCharge_reject_bit"+std::to_string(static_cast<int>(i));
-       std::string hname_acceptEta1Eta2 = "hInvariantMassThreeTOBsInclCharge_acceptEta1Eta2_bit"+std::to_string(static_cast<int>(i));
-       std::string hname_rejectEta1Eta2 = "hInvariantMassThreeTOBsInclCharge_rejectEta1Eta2_bit"+std::to_string(static_cast<int>(i));
-       std::string hname_acceptEta2Eta3 = "hInvariantMassThreeTOBsInclCharge_acceptEta2Eta3_bit"+std::to_string(static_cast<int>(i));
-       std::string hname_rejectEta2Eta3 = "hInvariantMassThreeTOBsInclCharge_rejectEta2Eta3_bit"+std::to_string(static_cast<int>(i));
-       std::string hname_acceptEta3Eta1 = "hInvariantMassThreeTOBsInclCharge_acceptEta3Eta1_bit"+std::to_string(static_cast<int>(i));
-       std::string hname_rejectEta3Eta1 = "hInvariantMassThreeTOBsInclCharge_rejectEta3Eta1_bit"+std::to_string(static_cast<int>(i));
+       std::string hname_accept = "hInvariantMassThreeTOBsIncl1Charge_accept_bit"+std::to_string(static_cast<int>(i));
+       std::string hname_reject = "hInvariantMassThreeTOBsIncl1Charge_reject_bit"+std::to_string(static_cast<int>(i));
+       std::string hname_acceptEta1Eta2 = "hInvariantMassThreeTOBsIncl1Charge_acceptEta1Eta2_bit"+std::to_string(static_cast<int>(i));
+       std::string hname_rejectEta1Eta2 = "hInvariantMassThreeTOBsIncl1Charge_rejectEta1Eta2_bit"+std::to_string(static_cast<int>(i));
+       std::string hname_acceptEta2Eta3 = "hInvariantMassThreeTOBsIncl1Charge_acceptEta2Eta3_bit"+std::to_string(static_cast<int>(i));
+       std::string hname_rejectEta2Eta3 = "hInvariantMassThreeTOBsIncl1Charge_rejectEta2Eta3_bit"+std::to_string(static_cast<int>(i));
+       std::string hname_acceptEta3Eta1 = "hInvariantMassThreeTOBsIncl1Charge_acceptEta3Eta1_bit"+std::to_string(static_cast<int>(i));
+       std::string hname_rejectEta3Eta1 = "hInvariantMassThreeTOBsIncl1Charge_rejectEta3Eta1_bit"+std::to_string(static_cast<int>(i));
        // mass
        bookHist(m_histAccept, hname_accept, "INVM", 100, std::sqrt(p_InvMassMin[i]), std::sqrt(p_InvMassMax[i]));
        bookHist(m_histReject, hname_reject, "INVM", 100, std::sqrt(p_InvMassMin[i]), std::sqrt(p_InvMassMax[i]));
@@ -117,7 +117,7 @@ TCS::InvariantMassThreeTOBsInclCharge::initialize() {
 
 
 TCS::StatusCode
-TCS::InvariantMassThreeTOBsInclCharge::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
+TCS::InvariantMassThreeTOBsIncl1Charge::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
 						 const std::vector<TCS::TOBArray *> & output,
 						 Decision & decision )
 {
@@ -191,7 +191,7 @@ TCS::InvariantMassThreeTOBsInclCharge::processBitCorrect( const std::vector<TCS:
           }
    } else {
 
-      TCS_EXCEPTION("InvariantMassThreeTOBsInclCharge alg must have 1 input list, but got " << input.size());
+      TCS_EXCEPTION("InvariantMassThreeTOBsIncl1Charge alg must have 1 input list, but got " << input.size());
 
    }
 
@@ -200,7 +200,7 @@ TCS::InvariantMassThreeTOBsInclCharge::processBitCorrect( const std::vector<TCS:
 }
 
 TCS::StatusCode
-TCS::InvariantMassThreeTOBsInclCharge::process( const std::vector<TCS::TOBArray const *> & input,
+TCS::InvariantMassThreeTOBsIncl1Charge::process( const std::vector<TCS::TOBArray const *> & input,
 					  const std::vector<TCS::TOBArray *> & output,
 					  Decision & decision )
 {
@@ -274,7 +274,7 @@ TCS::InvariantMassThreeTOBsInclCharge::process( const std::vector<TCS::TOBArray
 	  }
    } else {
 
-      TCS_EXCEPTION("InvariantMassThreeTOBsInclCharge alg must have either 1 input list, but got " << input.size());
+      TCS_EXCEPTION("InvariantMassThreeTOBsIncl1Charge alg must have either 1 input list, but got " << input.size());
 
    }
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
index 4f17b22af6be..07ef9637c9f5 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
@@ -1133,7 +1133,7 @@ class TopoAlgoDef:
         toponame = "0INVM10-3MU4ab"
         log.debug("Define %s", toponame)
         inputList = 'MUab'
-        alg = AlgConf.InvariantMassThreeTOBsIncl( name = toponame, inputs = inputList, outputs = toponame )
+        alg = AlgConf.InvariantMassThreeTOBsIncl1( name = toponame, inputs = inputList, outputs = toponame )
         alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
         alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
         alg.addgeneric('NumResultBits', 1)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py
index 6e9e91166343..2e63df0429f0 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py
@@ -1033,7 +1033,7 @@ class TopoAlgoDef(object):
         toponame = "0INVM10-3MU4ab"      # noqa: F821
         log.info("Define %s" % toponame)    
         inputList = 'MUab'        
-        alg = AlgConf.InvariantMassThreeTOBsIncl( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
+        alg = AlgConf.InvariantMassThreeTOBsIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
         alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
         alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
         alg.addgeneric('NumResultBits', 1)
-- 
GitLab


From b8b2eb866d97ee96e720bf121f546c18a34593d5 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Wed, 8 Sep 2021 22:01:10 +0200
Subject: [PATCH 028/347] 22.0-cppcheck-InDetTrackSelectionTool

---
 .../Root/InDetAccessor.h                      | 53 ++++++++++---------
 .../util/InDetTrackSelectionToolTester.cxx    |  2 +
 2 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/Root/InDetAccessor.h b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/Root/InDetAccessor.h
index 2988113d4a50..4f79d083614e 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/Root/InDetAccessor.h
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/Root/InDetAccessor.h
@@ -114,10 +114,10 @@ namespace InDetAccessor {
 
    // summary accessor
    template <typename T_TrkHelper>
-   uint8_t getSummary(const T_TrkHelper helper, asg::AsgMessaging &msgHelper, xAOD::SummaryType sumType);
+   uint8_t getSummary(const T_TrkHelper & helper, asg::AsgMessaging &msgHelper, xAOD::SummaryType sumType);
 
    template <>
-   inline uint8_t getSummary(const TrackParticleHelper helper, asg::AsgMessaging &msgHelper, xAOD::SummaryType summaryType) {
+   inline uint8_t getSummary(const TrackParticleHelper & helper, asg::AsgMessaging &msgHelper, xAOD::SummaryType summaryType) {
       uint8_t summaryValue = 0;
       if (!helper.track().summaryValue(summaryValue, summaryType)) {
          IDTRKSEL_MSG_DEBUG( "Failed to get SummaryType " << std::to_string(summaryType) << " from xAOD::TrackParticle summary. A value of zero will be used instead." );
@@ -128,7 +128,7 @@ namespace InDetAccessor {
 
 #ifndef XAOD_ANALYSIS
    template <>
-   inline uint8_t getSummary(const TrkTrackHelper helper, asg::AsgMessaging &msgHelper, xAOD::SummaryType summaryType) {
+   inline uint8_t getSummary(const TrkTrackHelper & helper, asg::AsgMessaging &msgHelper, xAOD::SummaryType summaryType) {
       Int_t summaryTypeInt = static_cast<Int_t>(summaryType);
       Int_t checkSummaryValue = helper.summary().get( static_cast<Trk::SummaryType>(summaryTypeInt) );
       if (checkSummaryValue < 0) {
@@ -152,16 +152,16 @@ namespace InDetAccessor {
 
    // fit quality accessor
    template <typename Trk_Helper>
-   double getFitChiSquare(const Trk_Helper helper, asg::AsgMessaging &msgHelper);
+   double getFitChiSquare(const Trk_Helper & helper, asg::AsgMessaging &msgHelper);
 
    template <>
-   inline double getFitChiSquare(const TrackParticleHelper helper, asg::AsgMessaging &) {
+   inline double getFitChiSquare(const TrackParticleHelper & helper, asg::AsgMessaging &) {
       return helper.track().chiSquared();
    }
 
 #ifndef XAOD_ANALYSIS
    template <>
-   inline double getFitChiSquare(const TrkTrackHelper helper, asg::AsgMessaging &msgHelper) {
+   inline double getFitChiSquare(const TrkTrackHelper & helper, asg::AsgMessaging &msgHelper) {
       if (!helper.track().fitQuality()) {
          IDTRKSEL_MSG_WARNING( "Zero pointer to fit quality received." );
          return std::nan("");
@@ -171,16 +171,16 @@ namespace InDetAccessor {
 #endif
 
    template <typename TrkHelper>
-   double getFitNDoF(const TrkHelper helper, asg::AsgMessaging &msgHelper);
+   double getFitNDoF(const TrkHelper & helper, asg::AsgMessaging &msgHelper);
 
    template <>
-   inline double getFitNDoF(const TrackParticleHelper helper, asg::AsgMessaging &) {
+   inline double getFitNDoF(const TrackParticleHelper & helper, asg::AsgMessaging &) {
       return helper.track().numberDoF();
    }
 
 #ifndef XAOD_ANALYSIS
    template <>
-   inline double getFitNDoF(const TrkTrackHelper helper, asg::AsgMessaging &msgHelper) {
+   inline double getFitNDoF(const TrkTrackHelper & helper, asg::AsgMessaging &msgHelper) {
       if (!helper.track().fitQuality()) {
          IDTRKSEL_MSG_WARNING( "Zero pointer to fit quality received." );
          return std::nan("");
@@ -192,10 +192,10 @@ namespace InDetAccessor {
 
    // eProbabilityHT accessor
    template <typename Trk_Helper>
-   float getEProbabilityHT(const Trk_Helper helper, asg::AsgMessaging &msgHelper);
+   float getEProbabilityHT(const Trk_Helper & helper, asg::AsgMessaging &msgHelper);
 
    template <>
-   inline float getEProbabilityHT(const TrackParticleHelper helper, asg::AsgMessaging &msgHelper) {
+   inline float getEProbabilityHT(const TrackParticleHelper & helper, asg::AsgMessaging &msgHelper) {
       float eProbHT =0.f;
       if (!helper.track().summaryValue(eProbHT, xAOD::SummaryType::eProbabilityHT)) {
          IDTRKSEL_MSG_DEBUG( "Failed to get eProbabilityHT from xAOD::TrackParticle summary. A value of zero will be used instead." );
@@ -206,7 +206,7 @@ namespace InDetAccessor {
 
 #ifndef XAOD_ANALYSIS
    template <>
-   inline float getEProbabilityHT(const TrkTrackHelper helper, asg::AsgMessaging &msgHelper) {
+   inline float getEProbabilityHT(const TrkTrackHelper & helper, asg::AsgMessaging &msgHelper) {
       float eProbHT;
       if (!helper.hasSummaryOrError(msgHelper)) {
          eProbHT = 0.f;
@@ -225,7 +225,7 @@ namespace InDetAccessor {
    //defining parameters accessor
 
    template <short index>
-   inline double getDefiningParameters(TrackParticleHelper helper, asg::AsgMessaging &) {
+   inline double getDefiningParameters(TrackParticleHelper  helper, asg::AsgMessaging &) {
       static_assert(index<5);
       double param = helper.track().definingParameters()[index];
       if (index==1) {
@@ -238,7 +238,8 @@ namespace InDetAccessor {
 
 #ifndef XAOD_ANALYSIS
    template <short index>
-   inline double getDefiningParameters(TrkTrackHelper helper, asg::AsgMessaging &msgHelper) {
+   //cppcheck-suppress passedByValue
+   inline double getDefiningParameters(TrkTrackHelper  helper, asg::AsgMessaging &msgHelper) {
       assert(index<5);
       return helper.hasPerigeeOrError(msgHelper) ? helper.perigee()->parameters()[index] : std::nan("");
    }
@@ -246,33 +247,33 @@ namespace InDetAccessor {
 
    // defining parameters covariance accessor
    template <typename Trk_Helper>
-   inline double getDefiningParametersCov(Trk_Helper helper, [[maybe_unused]] asg::AsgMessaging &msgHelper, unsigned int index_i, unsigned int index_j);
+   inline double getDefiningParametersCov(Trk_Helper & helper, [[maybe_unused]] asg::AsgMessaging &msgHelper, unsigned int index_i, unsigned int index_j);
 
    template <>
-   inline double getDefiningParametersCov(TrackParticleHelper helper, [[maybe_unused]] asg::AsgMessaging &msgHelper, unsigned int index_i, unsigned int index_j) {
+   inline double getDefiningParametersCov(TrackParticleHelper & helper, [[maybe_unused]] asg::AsgMessaging &msgHelper, unsigned int index_i, unsigned int index_j) {
       assert( index_i<5 && index_j<5);
       return helper.track().definingParametersCovMatrix()(index_i, index_j);
    }
 
 #ifndef XAOD_ANALYSIS
    template <>
-   inline double getDefiningParametersCov(TrkTrackHelper helper, asg::AsgMessaging &msgHelper, unsigned int index_i, unsigned int index_j) {
+   inline double getDefiningParametersCov(TrkTrackHelper & helper, asg::AsgMessaging &msgHelper, unsigned int index_i, unsigned int index_j) {
       assert( index_i<5 && index_j<5);
       return helper.hasPerigeeOrError(msgHelper) ? (*helper.perigee()->covariance())(index_i, index_j) : std::nan("");
    }
 #endif
 
    template <typename Trk_Helper>
-   inline Int_t getNumberOfUsedHitsdEdx(Trk_Helper helper, asg::AsgMessaging &msgHelper);
+   inline Int_t getNumberOfUsedHitsdEdx(Trk_Helper & helper, asg::AsgMessaging &msgHelper);
 
    template <>
-   inline Int_t getNumberOfUsedHitsdEdx(TrackParticleHelper helper, [[maybe_unused]] asg::AsgMessaging &msgHelper) {
+   inline Int_t getNumberOfUsedHitsdEdx(TrackParticleHelper & helper, [[maybe_unused]] asg::AsgMessaging &msgHelper) {
       return helper.track().numberOfUsedHitsdEdx();
    }
 
 #ifndef XAOD_ANALYSIS
    template <>
-   inline Int_t getNumberOfUsedHitsdEdx(TrkTrackHelper helper, asg::AsgMessaging &msgHelper) {
+   inline Int_t getNumberOfUsedHitsdEdx(TrkTrackHelper & helper, asg::AsgMessaging &msgHelper) {
       int n_used_hits;
       if (!helper.hasSummaryOrError(msgHelper)) {
          n_used_hits=0;
@@ -290,16 +291,16 @@ namespace InDetAccessor {
 #endif
 
    template <typename Trk_Helper>
-   inline Int_t getNumberOfIBLOverflowsdEdx(Trk_Helper helper, asg::AsgMessaging &msgHelper);
+   inline Int_t getNumberOfIBLOverflowsdEdx(Trk_Helper & helper, asg::AsgMessaging &msgHelper);
 
    template <>
-   inline Int_t getNumberOfIBLOverflowsdEdx(TrackParticleHelper helper, [[maybe_unused]] asg::AsgMessaging &msgHelper) {
+   inline Int_t getNumberOfIBLOverflowsdEdx(TrackParticleHelper & helper, [[maybe_unused]] asg::AsgMessaging &msgHelper) {
       return helper.track().numberOfUsedHitsdEdx();
    }
 
 #ifndef XAOD_ANALYSIS
    template <>
-   inline Int_t getNumberOfIBLOverflowsdEdx(TrkTrackHelper helper, asg::AsgMessaging &msgHelper) {
+   inline Int_t getNumberOfIBLOverflowsdEdx(TrkTrackHelper & helper, asg::AsgMessaging &msgHelper) {
       int n_overflow_hits;
       if (!helper.hasSummaryOrError(msgHelper)) {
          n_overflow_hits=0;
@@ -320,10 +321,10 @@ namespace InDetAccessor {
    std::tuple<uint8_t,uint8_t> getSiHitsTopBottom( const Trk::Track& track, asg::AsgMessaging &msgHelper);
 
    template <typename Trk_Helper>
-   inline std::tuple<uint8_t,uint8_t> getSiHitsTopBottom(Trk_Helper helper, asg::AsgMessaging &msgHelper);
+   inline std::tuple<uint8_t,uint8_t> getSiHitsTopBottom(Trk_Helper & helper, asg::AsgMessaging &msgHelper);
 
    template <>
-   inline std::tuple<uint8_t,uint8_t> getSiHitsTopBottom(TrackParticleHelper helper, asg::AsgMessaging &msgHelper) {
+   inline std::tuple<uint8_t,uint8_t> getSiHitsTopBottom(TrackParticleHelper & helper, asg::AsgMessaging &msgHelper) {
       const Trk::Track* trkTrack = helper.track().track();
       if (!trkTrack) {
          IDTRKSEL_MSG_WARNING( "xAOD::TrackParticle has a null pointer to a Trk::Track." );
@@ -336,7 +337,7 @@ namespace InDetAccessor {
    }
 
    template <>
-   inline std::tuple<uint8_t,uint8_t> getSiHitsTopBottom(TrkTrackHelper helper, asg::AsgMessaging &msgHelper) {
+   inline std::tuple<uint8_t,uint8_t> getSiHitsTopBottom(TrkTrackHelper & helper, asg::AsgMessaging &msgHelper) {
       return getSiHitsTopBottom(helper.track(),msgHelper);
    }
 #endif
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/util/InDetTrackSelectionToolTester.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/util/InDetTrackSelectionToolTester.cxx
index a1261c039ef2..70d6c2415f65 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/util/InDetTrackSelectionToolTester.cxx
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/util/InDetTrackSelectionToolTester.cxx
@@ -32,6 +32,8 @@ struct HistFamily
 public:
   HistFamily(const string&);
   void fill(const xAOD::TrackParticle&, const xAOD::Vertex*);
+  HistFamily(const HistFamily &) = delete;
+  HistFamily & operator =(const HistFamily &) = delete;
 private:
   TH2* h_pt = nullptr; // these show eta dependence
   TH2* h_si_hits_phys = nullptr;
-- 
GitLab


From 99e30ef3ed6757ad51f78ed3dd800a44c1c61a70 Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Thu, 9 Sep 2021 01:01:54 +0200
Subject: [PATCH 029/347] Link ID global and jet inputs monitoring to old-style
 flags

---
 Control/AthenaMonitoring/python/DQMonFlags.py              | 7 +++++++
 .../AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py  | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/Control/AthenaMonitoring/python/DQMonFlags.py b/Control/AthenaMonitoring/python/DQMonFlags.py
index 9129c8086dd5..b7edcfb4e150 100644
--- a/Control/AthenaMonitoring/python/DQMonFlags.py
+++ b/Control/AthenaMonitoring/python/DQMonFlags.py
@@ -153,6 +153,13 @@ class doJetMon(JobProperty):
     StoredValue=True
 list+=[doJetMon]
 
+class doJetInputsMon(JobProperty):
+    """ Switch for jet monitoring """
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=True
+list+=[doJetInputsMon]
+
 class doMissingEtMon(JobProperty):
     """ Switch for missing E_T monitoring"""
     statusOn=True
diff --git a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
index 2708f69f9396..2c958d49fa28 100644
--- a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
@@ -516,6 +516,8 @@ Steering.doCTPMon=DQMonFlags.doCTPMon() and not mixedModeFlag
 Steering.doPixelMon=DQMonFlags.doPixelMon()
 Steering.doSCTMon=DQMonFlags.doSCTMon()
 Steering.doTRTMon=DQMonFlags.doTRTMon()
+Steering.InDet.doGlobalMon=DQMonFlags.doInDetGlobalMon()
+Steering.InDet.doAlignMon=DQMonFlags.doInDetAlignMon()
 Steering.doInDetMon = Steering.InDet.doGlobalMon or Steering.InDet.doAlignMon
 Steering.doLArMon=DQMonFlags.doLArMon()
 Steering.doTileMon=DQMonFlags.doTileMon()
@@ -531,5 +533,6 @@ Steering.doJetMon=DQMonFlags.doJetMon()
 Steering.doMissingEtMon=DQMonFlags.doMissingEtMon()
 Steering.doTauMon=DQMonFlags.doTauMon()
 Steering.doJetTagMon=DQMonFlags.doJetTagMon()
+Steering.doJetInputsMon=DQMonFlags.doJetInputsMon()
 
 del local_logger
-- 
GitLab


From fe626d3a0d8915fa31f11eb934a57844f6f61658 Mon Sep 17 00:00:00 2001
From: Ewelina Maria Lobodzinska <ewelina.maria.lobodzinska@cern.ch>
Date: Wed, 8 Sep 2021 15:07:34 +0200
Subject: [PATCH 030/347] Merge branch 'jk_update_phttbb' into '21.6'

add hdamp steering params for Powheg ttbb module

See merge request atlas/athena!46372

(cherry picked from commit 1a09740c106c83e7d805cc52f2867707ebb3f2e3)

4201870f add hdamp steering params for Powheg ttbb module
---
 Generators/PowhegControl/python/parameters/registry.py   | 2 ++
 Generators/PowhegControl/python/processes/powheg/ttbb.py | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/Generators/PowhegControl/python/parameters/registry.py b/Generators/PowhegControl/python/parameters/registry.py
index 8ea2af249327..94e56e639726 100644
--- a/Generators/PowhegControl/python/parameters/registry.py
+++ b/Generators/PowhegControl/python/parameters/registry.py
@@ -133,6 +133,8 @@ class Registry(metaclass=Singleton):
         self.add_default("dronly", 0, description="include only double resonant diagrams. [1:enabled]")
         self.add_default("dummyvirtual", 1, description="run with dummy virtual. [1:enabled]")
         self.add_default("dynamic_hdamp", 0, description="if 1, use hdamp = HT/2 (overwrites hdamp), if 0 use fixed hdamp")
+        self.add_default("dynhdamp", 0, description="ttbb: if 1, use hdamp = HT/2 (overwrites hdamp), if 0 use fixed hdamp")
+        self.add_default("dynhdampPF", -1, description="ttbb: prefactor for dynamic hdamp")
         self.add_default("e+e-", 0, hidden=True, description="WWj decay mode [1:enabled]")
         self.add_default("e+mu-", 0, hidden=True, description="WWj decay mode [1:enabled]")
         self.add_default("ebeam1", 6500, name="beam_energy", frozen=True, description="energy of beam in GeV")
diff --git a/Generators/PowhegControl/python/processes/powheg/ttbb.py b/Generators/PowhegControl/python/processes/powheg/ttbb.py
index 6c7ecf510518..58f8a2a84952 100644
--- a/Generators/PowhegControl/python/processes/powheg/ttbb.py
+++ b/Generators/PowhegControl/python/processes/powheg/ttbb.py
@@ -129,6 +129,10 @@ class ttbb(PowhegRES):
         self.add_keyword("withdamp", 1)
         self.add_keyword("xgriditeration")
         self.add_keyword("xupbound", 2)
+        self.add_keyword("hdamp", -1)
+        self.add_keyword("dynhdamp", 1)
+        self.add_keyword("dynhdampPF", 0.5)
+
 
     def validate_decays(self):
         """
-- 
GitLab


From fe0072f729070f53df7e8a305434d2838650e48c Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Wed, 8 Sep 2021 01:14:28 +0200
Subject: [PATCH 031/347] Prepared Calo Descriptors and Elements to work with
 yet-to-be-implemented CaloAlignCondAlg

Added a pointer to GeoAlignmentStore as an optional argument to the constructors
of Calo descriptor and element objects. As a result, these objects now can access mis-aligned
positions of LAr volumes.

Also dropped several obsolete methods of the descriptor and element classes, and migrated
CaloDetDescrBuilder to the updated CaloDetDescr interface.
---
 Calorimeter/CaloDetDescr/CMakeLists.txt       |   2 +-
 .../CaloDetDescr/CaloDescriptors.h            | 216 ++++------
 .../CaloDetDescr/CaloDetectorElements.h       | 402 ++++++++++--------
 .../CaloDetDescr/src/CaloDescriptors.cxx      | 287 +++----------
 .../CaloDetDescr/src/CaloDetectorElements.cxx | 194 +++++----
 .../src/CaloDetDescrBuilder.cxx               |  39 +-
 6 files changed, 479 insertions(+), 661 deletions(-)

diff --git a/Calorimeter/CaloDetDescr/CMakeLists.txt b/Calorimeter/CaloDetDescr/CMakeLists.txt
index 74154f2e1490..f56bb8416c01 100644
--- a/Calorimeter/CaloDetDescr/CMakeLists.txt
+++ b/Calorimeter/CaloDetDescr/CMakeLists.txt
@@ -14,7 +14,7 @@ atlas_add_library( CaloDetDescrLib
    LINK_LIBRARIES ${Boost_LIBRARIES} GaudiKernel AthenaKernel AthContainers
    AthenaBaseComps CxxUtils GeoModelInterfaces Identifier CaloIdentifier
    CaloGeoHelpers GeoPrimitives LArReadoutGeometry
-   PRIVATE_LINK_LIBRARIES CaloConditions StoreGateLib )
+   PRIVATE_LINK_LIBRARIES CaloConditions StoreGateLib GeoModelUtilities)
 
 atlas_add_component( CaloDetDescr
    src/components/*.cxx
diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDescriptors.h b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDescriptors.h
index 1c741db19817..79e7a4886faf 100755
--- a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDescriptors.h
+++ b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDescriptors.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
 */
 
 /**
@@ -7,13 +7,13 @@
  *
  * @brief LAr subsystem specific descriptors
  *
- * @author Vakho Tsulaia (tsulaia@mail.cern.ch)
+ * @author Vakho Tsulaia
  *
  * $Id: CaloDescriptors.h,v 1.3 2009-04-22 19:54:16 ssnyder Exp $
  */
 
-#ifndef CALODESCRIPTORS_H
-#define CALODESCRIPTORS_H
+#ifndef CALODETDESCR_CALODESCRIPTORS_H
+#define CALODETDESCR_CALODESCRIPTORS_H
 
 #include "CaloDetDescr/CaloDetDescriptor.h"
 
@@ -22,6 +22,8 @@ class EMECDetectorRegion;
 class HECDetectorRegion;
 class FCALModule;
 
+class GeoAlignmentStore;
+
 /**
  * @class EMBDescriptor
  *
@@ -31,47 +33,34 @@ class FCALModule;
 class EMBDescriptor : public CaloDetDescriptor
 {
  public:
-  /** @brief Constructor
-      @param id [IN] region identifier (for base class constructor)
-      @param helper [IN] ID helper (for base class constructor)
-      @param calo_helper [IN] ID helper (for base class constructor)
-      @param embRegion [IN] EMB Region Descriptor from LArReadoutGeometry
-   */
-  EMBDescriptor(const Identifier& id, 
-		const AtlasDetectorID* helper,
-		const CaloCell_ID* calo_helper,
-		const EMBDetectorRegion* embRegion);
-  /** @brief Destructor
+  /**
+   * @brief Constructor
+   * @param id [IN] region identifier (for base class constructor)
+   * @param helper [IN] ID helper (for base class constructor)
+   * @param calo_helper [IN] ID helper (for base class constructor)
+   * @param embRegion [IN] EMB Region Descriptor from LArReadoutGeometry
    */
-  ~EMBDescriptor();
+  EMBDescriptor(const Identifier& id
+		, const AtlasDetectorID* helper
+		, const CaloCell_ID* calo_helper
+		, const EMBDetectorRegion* embRegion
+		, const GeoAlignmentStore* alignStore = nullptr);
 
-  /** @brief get pointer to the EMB Region object (from LArReadoutGeometry)
+  /**
+   * @brief Destructor
    */
-  inline const EMBDetectorRegion* getEMBDetectorRegion() const
-  {return m_region;} 
+  virtual ~EMBDescriptor();
 
  private:
-  /** @brief pointer to the EMB Region object (from LArReadoutGeometry)
-   */
-  const EMBDetectorRegion* m_region;
-
-  /** @brief default constructor hidden
+  /**
+   * @brief default constructor hidden
    */
   EMBDescriptor() = delete;
 
-  /** @brief copy constructor hidden
+  /**
+   * @brief copy constructor hidden
    */
   EMBDescriptor & operator=(const EMBDescriptor &right) = delete;
-
-  /** @brief initialize base description
-   */
-  void init_description();
-
-
-  /** @brief Fill all missing fields of CaloDetDescriptor which
-      have not been filled by init_description()
-   */
-  void init_interpretation();
 };
 
 /**
@@ -82,48 +71,34 @@ class EMBDescriptor : public CaloDetDescriptor
 class EMECDescriptor : public CaloDetDescriptor
 {
  public:
-  /** @brief Constructor
-      @param id [IN] region identifier (for base class constructor)
-      @param helper [IN] ID helper (for base class constructor)
-      @param calo_helper [IN] ID helper (for base class constructor)
-      @param emecRegion [IN] EMEC Region Descriptor from LArReadoutGeometry
-   */
-  EMECDescriptor(const Identifier& id,
-		 const AtlasDetectorID* helper, 
-		 const CaloCell_ID* calo_helper,
-		 const EMECDetectorRegion* emecRegion);
-
-  /** @brief Destructor
+  /**
+   * @brief Constructor
+   * @param id [IN] region identifier (for base class constructor)
+   * @param helper [IN] ID helper (for base class constructor)
+   * @param calo_helper [IN] ID helper (for base class constructor)
+   * @param emecRegion [IN] EMEC Region Descriptor from LArReadoutGeometry
    */
-  ~EMECDescriptor();
+  EMECDescriptor(const Identifier& id
+		 , const AtlasDetectorID* helper
+		 , const CaloCell_ID* calo_helper
+		 , const EMECDetectorRegion* emecRegion
+		 , const GeoAlignmentStore* alignStore = nullptr);
 
-  /** @brief get pointer to the EMEC Region object (from LArReadoutGeometry)
+  /**
+   * @brief Destructor
    */
-  inline const EMECDetectorRegion* getEMECDetectorRegion() const
-  {return m_region;}
+  virtual ~EMECDescriptor();
 
  private:
-  /** @brief pointer to the EMEC Region object (from LArReadoutGeometry)
-   */
-  const EMECDetectorRegion* m_region;
-
-  /** @brief default constructor hidden
+  /**
+   * @brief default constructor hidden
    */
   EMECDescriptor() = delete;
 
-  /** @brief copy constructor hidden
+  /**
+   * @brief copy constructor hidden
    */
   EMECDescriptor & operator=(const EMECDescriptor &right) = delete;
-
-  /** @brief initialize base description
-   */
-  void init_description();
-
-  /** @brief Fill all missing fields of CaloDetDescriptor which
-      have not been filled by init_description()
-   */
-  void init_interpretation();
-
 };
 
 /**
@@ -134,50 +109,33 @@ class EMECDescriptor : public CaloDetDescriptor
 class HECDescriptor : public CaloDetDescriptor
 {
  public:
-  /** @brief Constructor
-      @param id [IN] region identifier (for base class constructor)
-      @param helper [IN] ID helper (for base class constructor)
-      @param calo_helper [IN] ID helper (for base class constructor)
-      @param hecRegion [IN] HEC Region Descriptor from LArReadoutGeometry
-   */
-  HECDescriptor(const Identifier& id,
-		const AtlasDetectorID* helper, 
-		const CaloCell_ID* calo_helper,
-		const HECDetectorRegion* hecRegion);
-
-  /** @brief Destructor
-   */
-  ~HECDescriptor();
-
-  /** @brief get pointer to the HEC Region object (from LArReadoutGeometry)
-   */
-  inline const HECDetectorRegion* getHECDetectorRegion() const 
-  {return m_region;}
- 
+  /**
+   * @brief Constructor
+   * @param id [IN] region identifier (for base class constructor)
+   * @param helper [IN] ID helper (for base class constructor)
+   * @param calo_helper [IN] ID helper (for base class constructor)
+   * @param hecRegion [IN] HEC Region Descriptor from LArReadoutGeometry
+   */
+  HECDescriptor(const Identifier& id
+		, const AtlasDetectorID* helper
+		, const CaloCell_ID* calo_helper
+		, const HECDetectorRegion* hecRegion
+		, const GeoAlignmentStore* alignStore = nullptr);
+  /**
+   * @brief Destructor
+   */
+  virtual ~HECDescriptor();
 
  private:
-  /** @brief pointer to the HEC Region object (from LArReadoutGeometry)
-   */
-  const HECDetectorRegion* m_region;
-
-  /** @brief default constructor hidden
+  /**
+   * @brief default constructor hidden
    */
   HECDescriptor() = delete;
 
-  /** @brief copy constructor hidden
+  /**
+   * @brief copy constructor hidden
    */
   HECDescriptor & operator=(const HECDescriptor &right) = delete;
-
-
-  /** @brief initialize base description
-   */
-  void init_description();
-
-  /** @brief Fill all missing fields of CaloDetDescriptor which
-      have not been filled by init_description()
-   */
-  void init_interpretation();
-
 };
 
 /**
@@ -188,48 +146,34 @@ class HECDescriptor : public CaloDetDescriptor
 class FCALDescriptor : public CaloDetDescriptor
 {
  public:
-  /** @brief Constructor
-      @param id [IN] region identifier (for base class constructor)
-      @param helper [IN] ID helper (for base class constructor)
-      @param calo_helper [IN] ID helper (for base class constructor)
-      @param fcalModule [IN] FCAL Module Descriptor from LArReadoutGeometry
-   */
-  FCALDescriptor(const Identifier& id,
-		 const AtlasDetectorID* helper, 
-		 const CaloCell_ID* calo_helper,
-		 const FCALModule* fcalModule);
-
-  /** @brief Destructor
+  /**
+   * @brief Constructor
+   * @param id [IN] region identifier (for base class constructor)
+   * @param helper [IN] ID helper (for base class constructor)
+   * @param calo_helper [IN] ID helper (for base class constructor)
+   * @param fcalModule [IN] FCAL Module Descriptor from LArReadoutGeometry
    */
-  ~FCALDescriptor();
+  FCALDescriptor(const Identifier& id
+		 , const AtlasDetectorID* helper
+		 , const CaloCell_ID* calo_helper
+		 , const FCALModule* fcalModule
+		 , const GeoAlignmentStore* alignStore = nullptr);
 
-  /** @brief get pointer to the FCAL Module object (from LArReadoutGeometry)
+  /**
+   * @brief Destructor
    */
-  inline const FCALModule* getFCALModule() const
-  {return m_module;}
+  virtual ~FCALDescriptor();
 
  private:
-  /** @brief pointer to the FCAL Module object (from LArReadoutGeometry)
-   */
-  const FCALModule* m_module;
-
-  /** @brief default constructor hidden
+  /**
+   * @brief default constructor hidden
    */
   FCALDescriptor() = delete;
 
-  /** @brief copy constructor hidden
+  /**
+   * @brief copy constructor hidden
    */
   FCALDescriptor & operator=(const FCALDescriptor &right) = delete;
-
-  /** @brief initialize base description
-   */
-  void init_description();
-
-  /** @brief Fill all missing fields of CaloDetDescriptor which
-      have not been filled by init_description()
-   */
-  void init_interpretation();
-
 };
 
 #endif
diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetectorElements.h b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetectorElements.h
index f7eef7dfa274..5b249fa6467e 100755
--- a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetectorElements.h
+++ b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetectorElements.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
 */
 
 /**
@@ -10,8 +10,8 @@
  * $Id: CaloDetectorElements.h,v 1.13 2009-04-22 19:54:16 ssnyder Exp $
  */
 
-#ifndef CALODETECTORELEMENTS_H
-#define CALODETECTORELEMENTS_H
+#ifndef CALODETDESCR_CALODETECTORELEMENTS_H
+#define CALODETDESCR_CALODETECTORELEMENTS_H
 
 #include "CaloDetDescr/CaloDetDescrElement.h"
 
@@ -28,6 +28,7 @@
 #include "Identifier/Identifier.h"
 
 class CaloDetDescriptor;
+class GeoAlignmentStore;
 
 /**
  * @struct CaloElementPositionShift
@@ -50,66 +51,69 @@ typedef struct
 class EMBDetectorElement : public CaloDetDescrElement
 {
  public:
-  /** @brief Constructor, takes all necessary parameters for the base class constructor 
-      plus some specific parameters for this class
-      @param subcaloHash [IN] for the base class
-      @param onl1 [IN] for the base class
-      @param onl2 [IN] for the base class
-      @param descriptor [IN] for the base class
-      @param embCell [IN] EMB Cell description from LArReadoutGeometry
-      @param embRegion [IN] EMB Region description from LArReadoutGeometry
-   */
-  EMBDetectorElement(const IdentifierHash subcaloHash,
-		     const IdentifierHash onl1,
-		     const IdentifierHash onl2,
-		     const CaloDetDescriptor* descriptor,
-		     EMBCellConstLink& embCell,
-		     const EMBDetectorRegion* embRegion,
-		     bool isTestBeam);
+  /**
+   * @brief Constructor, takes all necessary parameters for the base class constructor 
+   *        plus some specific parameters for this class
+   * @param subcaloHash [IN] for the base class
+   * @param onl1 [IN] for the base class
+   * @param onl2 [IN] for the base class
+   * @param descriptor [IN] for the base class
+   * @param embCell [IN] EMB Cell description from LArReadoutGeometry
+   * @param embRegion [IN] EMB Region description from LArReadoutGeometry
+   */
+  EMBDetectorElement(const IdentifierHash subcaloHash
+		     , const IdentifierHash onl1
+		     , const IdentifierHash onl2
+		     , const CaloDetDescriptor* descriptor
+		     , EMBCellConstLink& embCell
+		     , const EMBDetectorRegion* embRegion
+		     , bool isTestBeam
+		     , const GeoAlignmentStore* geoAlignStore = nullptr
+                     , const CaloElementPositionShift* posShift = nullptr);
   
-  /** @brief EMB Cell description from LArReadoutGeometry
-   */
-  inline EMBCellConstLink         getEMBCell() const          {return m_cell;}
-  /** @brief EMB Region description from LArReadoutGeometry
+  /**
+   * @brief EMB Cell description from LArReadoutGeometry
    */
-  inline const EMBDetectorRegion* getEMBDetectorRegion() const
-  {return m_region;}
+  inline EMBCellConstLink getEMBCell() const {return m_cell;}
   
-  /** @brief the method called by CaloAlignTool, updates alignment information
-      @param embCell [IN] misaligned EMB Cell description from LArReadoutGeometry
-      @param embRegion [IN] misaligned EMB Region description from LArReadoutGeometry
+  /**
+   * @brief the method called by CaloAlignTool, updates alignment information
+   * @param embCell [IN] misaligned EMB Cell description from LArReadoutGeometry
+   * @param embRegion [IN] misaligned EMB Region description from LArReadoutGeometry
    */
-  void updateAlignment(EMBCellConstLink& embCell,
-		       const EMBDetectorRegion* embRegion,
-		       const CaloElementPositionShift* posShift = nullptr);
+  void updateAlignment(EMBCellConstLink& embCell
+		       , const EMBDetectorRegion* embRegion
+		       , const CaloElementPositionShift* posShift = nullptr);
 
-  /** @brief get layer
+  /**
+   * @brief get layer
    */
-  int getLayer() const;
+  virtual int getLayer() const override;
 
  private:
-  /** @brief EMB Cell description from LArReadoutGeometry
+  /**
+   * @brief EMB Cell description from LArReadoutGeometry
    */
   EMBCellConstLink m_cell;
-  /** @brief EMB Region description from LArReadoutGeometry
+  /**
+   * @brief EMB Region description from LArReadoutGeometry
    */
   const EMBDetectorRegion* m_region;
   
-  /** @brief default constructor hidden
+  /**
+   * @brief default constructor hidden
    */
   EMBDetectorElement() = delete;
-  /** @brief copy constructor hidden
+  /**
+   * @brief copy constructor hidden
    */
   EMBDetectorElement & operator=(const EMBDetectorElement &right) = delete;
   
-  /** @brief initialize base description
-   */
-  void init_description(const CaloElementPositionShift* posShift = nullptr);
-
-  /** @brief Fill all missing fields of CaloDetDescrElement which
-      have not been filled by init_description()
+  /**
+   * @brief initialize base description
    */
-  void init_interpretation();  
+  void init_description(const GeoAlignmentStore* geoAlignStore
+			, const CaloElementPositionShift* posShift);
 };
 
 /**
@@ -120,65 +124,74 @@ class EMBDetectorElement : public CaloDetDescrElement
 class EMECDetectorElement : public CaloDetDescrElement
 {
  public:
-  /** @brief Constructor, takes all necessary parameters for the base class constructor 
-      plus some specific parameters for this class
-      @param subcaloHash [IN] for the base class
-      @param onl1 [IN] for the base class
-      @param onl2 [IN] for the base class
-      @param descriptor [IN] for the base class
-      @param emecCell [IN] EMEC Cell description from LArReadoutGeometry
-      @param emecRegion [IN] EMEC Region description from LArReadoutGeometry
-   */
-  EMECDetectorElement(const IdentifierHash subcaloHash,
-		      const IdentifierHash onl1,
-		      const IdentifierHash onl2,
-		      const CaloDetDescriptor* descriptor,
-		      EMECCellConstLink& emecCell,
-		      const EMECDetectorRegion* emecRegion,
-		      bool isTestBeam);
+  /**
+   * @brief Constructor, takes all necessary parameters for the base class constructor 
+   *        plus some specific parameters for this class
+   *  @param subcaloHash [IN] for the base class
+   *  @param onl1 [IN] for the base class
+   *  @param onl2 [IN] for the base class
+   *  @param descriptor [IN] for the base class
+   *  @param emecCell [IN] EMEC Cell description from LArReadoutGeometry
+   *  @param emecRegion [IN] EMEC Region description from LArReadoutGeometry
+   */
+  EMECDetectorElement(const IdentifierHash subcaloHash
+		      , const IdentifierHash onl1
+		      , const IdentifierHash onl2
+		      , const CaloDetDescriptor* descriptor
+		      , EMECCellConstLink& emecCell
+		      , const EMECDetectorRegion* emecRegion
+		      , bool isTestBeam
+		      , const GeoAlignmentStore* geoAlignStore = nullptr
+                      , const CaloElementPositionShift* posShift = nullptr);
 
-  /** @brief EMEC Cell description from LArReadoutGeometry
-   */
-  inline EMECCellConstLink         getEMECCell() const         {return m_cell;}
-  /** @brief EMEC Region description from LArReadoutGeometry
+  /**
+   * @brief EMEC Cell description from LArReadoutGeometry
    */
-  inline const EMECDetectorRegion* getEMECDetectorRegion() const
-  {return m_region;}
+  inline EMECCellConstLink getEMECCell() const {return m_cell;}
 
-  /** @brief the method called by CaloAlignTool, updates alignment information
-      @param emecCell [IN] misaligned EMEC Cell description from LArReadoutGeometry
-      @param emecRegion [IN] misaligned EMEC Region description from LArReadoutGeometry
+  /**
+   * @brief the method called by CaloAlignTool, updates alignment information
+   * @param emecCell [IN] misaligned EMEC Cell description from LArReadoutGeometry
+   * @param emecRegion [IN] misaligned EMEC Region description from LArReadoutGeometry
    */
-  void updateAlignment(EMECCellConstLink& emecCell,
-		       const EMECDetectorRegion* emecRegion,
-		       const CaloElementPositionShift* posShift = nullptr);
+  void updateAlignment(EMECCellConstLink& emecCell
+		       , const EMECDetectorRegion* emecRegion
+		       , const CaloElementPositionShift* posShift = nullptr);
 
-  /** @brief get layer
+  /**
+   * @brief get layer
    */
-  int getLayer() const;
+  virtual int getLayer() const override;
 
  private:
-  /** @brief EMEC Cell description from LArReadoutGeometry
+  /**
+   * @brief EMEC Cell description from LArReadoutGeometry
    */
   EMECCellConstLink m_cell;
-  /** @brief EMEC Region description from LArReadoutGeometry
+  /**
+   * @brief EMEC Region description from LArReadoutGeometry
    */
   const EMECDetectorRegion* m_region;
  
-  /** @brief default constructor hidden
+  /**
+   * @brief default constructor hidden
    */
   EMECDetectorElement() = delete;
-  /** @brief copy constructor hidden
+  /**
+   * @brief copy constructor hidden
    */
   EMECDetectorElement & operator=(const EMECDetectorElement &right) = delete;
 
-  /** @brief initialize base description
+  /**
+   * @brief initialize base description
    */
-  void init_description(bool isTestBeam,
-			const CaloElementPositionShift* posShift = nullptr);
+  void init_description(bool isTestBeam
+			, const GeoAlignmentStore* geoAlignStore
+			, const CaloElementPositionShift* posShift);
 
-  /** @brief Fill all missing fields of CaloDetDescrElement which
-      have not been filled by init_description()
+  /**
+   * @brief Fill all missing fields of CaloDetDescrElement which
+   * have not been filled by init_description()
    */
   void init_interpretation();
 
@@ -193,65 +206,74 @@ class EMECDetectorElement : public CaloDetDescrElement
 class HECDetectorElement : public CaloDetDescrElement
 {
  public:
-  /** @brief Constructor, takes all necessary parameters for the base class constructor 
-      plus some specific parameters for this class
-      @param subcaloHash [IN] for the base class
-      @param onl1 [IN] for the base class
-      @param onl2 [IN] for the base class
-      @param descriptor [IN] for the base class
-      @param hecCell [IN] HEC Cell description from LArReadoutGeometry
-      @param hecRegion [IN] HEC Region description from LArReadoutGeometry
-   */
-  HECDetectorElement(const IdentifierHash subcaloHash,
-		     const IdentifierHash onl1,
-		     const IdentifierHash onl2,
-		     const CaloDetDescriptor* descriptor,
-		     HECCellConstLink& hecCell,
-		     const HECDetectorRegion* hecRegion,
-		     bool isTestBeam);
+  /**
+   * @brief Constructor, takes all necessary parameters for the base class constructor 
+   *        plus some specific parameters for this class
+   *  @param subcaloHash [IN] for the base class
+   *  @param onl1 [IN] for the base class
+   *  @param onl2 [IN] for the base class
+   *  @param descriptor [IN] for the base class
+   *  @param hecCell [IN] HEC Cell description from LArReadoutGeometry
+   *  @param hecRegion [IN] HEC Region description from LArReadoutGeometry
+   */
+  HECDetectorElement(const IdentifierHash subcaloHash
+		     , const IdentifierHash onl1
+		     , const IdentifierHash onl2
+		     , const CaloDetDescriptor* descriptor
+		     , HECCellConstLink& hecCell
+		     , const HECDetectorRegion* hecRegion
+		     , bool isTestBeam
+		     , const GeoAlignmentStore* geoAlignStore = nullptr
+		     , const CaloElementPositionShift* posShift = nullptr);
 
-  /** @brief HEC Cell description from LArReadoutGeometry
-   */
-  inline HECCellConstLink         getHECCell()    const       {return m_cell;}
-  /** @brief HEC Region description from LArReadoutGeometry
+  /**
+   * @brief HEC Cell description from LArReadoutGeometry
    */
-  inline const HECDetectorRegion* getHECDetectorRegion() const
-  {return m_region;}
+  inline HECCellConstLink getHECCell() const {return m_cell;}
 
-  /** @brief the method called by CaloAlignTool, updates alignment information
-      @param hecCell [IN] misaligned HEC Cell description from LArReadoutGeometry
-      @param hecRegion [IN] misaligned HEC Region description from LArReadoutGeometry
+  /**
+   * @brief the method called by CaloAlignTool, updates alignment information
+   *  @param hecCell [IN] misaligned HEC Cell description from LArReadoutGeometry
+   *  @param hecRegion [IN] misaligned HEC Region description from LArReadoutGeometry
    */
-  void updateAlignment(HECCellConstLink& hecCell,
-		       const HECDetectorRegion* hecRegion,
-		       const CaloElementPositionShift* posShift = nullptr);
+  void updateAlignment(HECCellConstLink& hecCell
+		       , const HECDetectorRegion* hecRegion
+		       , const CaloElementPositionShift* posShift = nullptr);
 
-  /** @brief get layer
+  /**
+   * @brief get layer
    */
-  int getLayer() const;
+  virtual int getLayer() const override;
 
  private:
-  /** @brief HEC Cell description from LArReadoutGeometry
+  /**
+   * @brief HEC Cell description from LArReadoutGeometry
    */
   HECCellConstLink m_cell;
-  /** @brief HEC Region description from LArReadoutGeometry
+  /**
+   * @brief HEC Region description from LArReadoutGeometry
    */
   const HECDetectorRegion* m_region;
   
-  /** @brief default constructor hidden
+  /**
+   * @brief default constructor hidden
    */
   HECDetectorElement() = delete;
-  /** @brief copy constructor hidden
+  /**
+   * @brief copy constructor hidden
    */
   HECDetectorElement & operator=(const HECDetectorElement &right) = delete;
 
-  /** @brief initialize base description
+  /**
+   * @brief initialize base description
    */
-  void init_description(bool isTestBeam,
-			const CaloElementPositionShift* posShift = nullptr);
+  void init_description(bool isTestBeam
+			, const GeoAlignmentStore* geoAlignStore
+			, const CaloElementPositionShift* posShift);
 
-  /** @brief Fill all missing fields of CaloDetDescrElement which
-      have not been filled by init_description()
+  /**
+   * @brief Fill all missing fields of CaloDetDescrElement which
+   *  have not been filled by init_description()
    */
   void init_interpretation();
 
@@ -265,66 +287,70 @@ class HECDetectorElement : public CaloDetDescrElement
 class FCALDetectorElement : public CaloDetDescrElement
 {
  public:
-  /** @brief Constructor, takes all necessary parameters for the base class constructor 
-      plus some specific parameters for this class
-      @param subcaloHash [IN] for the base class
-      @param onl1 [IN] for the base class
-      @param onl2 [IN] for the base class
-      @param descriptor [IN] for the base class
-      @param fcalTile [IN] FCAL Tile description from LArReadoutGeometry
-      @param fcalModule [IN] FCAL Module description from LArReadoutGeometry
-   */
-  FCALDetectorElement(const IdentifierHash subcaloHash,
-		      const IdentifierHash onl1,
-		      const IdentifierHash onl2,
-		      const CaloDetDescriptor* descriptor,
-		      const FCALTile* fcalTile,
-		      const FCALModule* fcalModule,
-		      bool isTestBeam);
+  /**
+   * @brief Constructor, takes all necessary parameters for the base class constructor 
+   *        plus some specific parameters for this class
+   * @param subcaloHash [IN] for the base class
+   * @param onl1 [IN] for the base class
+   * @param onl2 [IN] for the base class
+   * @param descriptor [IN] for the base class
+   * @param fcalTile [IN] FCAL Tile description from LArReadoutGeometry
+   * @param fcalModule [IN] FCAL Module description from LArReadoutGeometry
+   */
+  FCALDetectorElement(const IdentifierHash subcaloHash
+		      , const IdentifierHash onl1
+		      , const IdentifierHash onl2
+		      , const CaloDetDescriptor* descriptor
+		      , const FCALTile* fcalTile
+		      , const FCALModule* fcalModule
+		      , bool isTestBeam
+		      , const GeoAlignmentStore* geoAlignStore = nullptr
+		      , const CaloElementPositionShift* posShift = nullptr);
 
-  /** @brief FCAL Tile description from LArReadoutGeometry
-   */
-  inline const FCALTile*    getFCALTile()  const  {return m_tile;}
-  /** @brief FCAL Module description from LArReadoutGeometry
+  /**
+   * @brief FCAL Tile description from LArReadoutGeometry
    */
-  inline const FCALModule*  getFCALModule() const {return m_module;}
+  inline const FCALTile* getFCALTile() const {return m_tile;}
 
-  /** @brief the method called by CaloAlignTool, updates alignment information
-      @param fcalTile [IN] misaligned FCAL Tile description from LArReadoutGeometry
-      @param fcalModule [IN] misaligned FCAL Module description from LArReadoutGeometry
+  /**
+   * @brief the method called by CaloAlignTool, updates alignment information
+   * @param fcalTile [IN] misaligned FCAL Tile description from LArReadoutGeometry
+   * @param fcalModule [IN] misaligned FCAL Module description from LArReadoutGeometry
    */
-  void updateAlignment(const FCALTile* fcalTile,
-		       const FCALModule* fcalModule,
-		       const CaloElementPositionShift* posShift = nullptr);
+  void updateAlignment(const FCALTile* fcalTile
+		       , const FCALModule* fcalModule
+		       , const CaloElementPositionShift* posShift = nullptr);
 
-  /** @brief get layer
+  /**
+   * @brief get layer
    */
-  int getLayer() const;
+  virtual int getLayer() const override;
 
  private:
-  /** @brief FCAL Tile description from LArReadoutGeometry
+  /**
+   * @brief FCAL Tile description from LArReadoutGeometry
    */
   const FCALTile*   m_tile;
-  /** @brief FCAL Module description from LArReadoutGeometry
+  /**
+   * @brief FCAL Module description from LArReadoutGeometry
    */
   const FCALModule* m_module;
   
-  /** @brief default constructor hidden
+  /**
+   * @brief default constructor hidden
    */
   FCALDetectorElement() = delete;
-  /** @brief copy constructor hidden
+  /**
+   * @brief copy constructor hidden
    */
   FCALDetectorElement & operator=(const FCALDetectorElement &right) = delete;
 
-  /** @brief initialize base description
-   */
-  void init_description(bool isTestBeam,
-			const CaloElementPositionShift* posShift = nullptr);
-
-  /** @brief Fill all missing fields of CaloDetDescrElement which
-      have not been filled by init_description()
+  /**
+   * @brief initialize base description
    */
-  void init_interpretation();
+  void init_description(bool isTestBeam
+			, const GeoAlignmentStore* geoAlignStore
+			, const CaloElementPositionShift* posShift);
 
 };
 
@@ -336,41 +362,50 @@ class FCALDetectorElement : public CaloDetDescrElement
 class TileDetectorElement : public CaloDetDescrElement
 {
  public:
-  /** @brief Constructor, takes all necessary parameters for the base class constructor 
+  /**
+   * @brief Constructor, takes all necessary parameters for the base class constructor 
    */
-  TileDetectorElement(const IdentifierHash subcaloHash,
-		      const IdentifierHash onl1,
-		      const IdentifierHash onl2,
-		      const CaloDetDescriptor* descriptor);
+  TileDetectorElement(const IdentifierHash subcaloHash
+		      , const IdentifierHash onl1
+		      , const IdentifierHash onl2
+		      , const CaloDetDescriptor* descriptor);
 
-  /** @brief set raw cylindric coordinates
+  /**
+   * @brief set raw cylindric coordinates
    */
-  void set_cylindric_raw(double eta_raw, 
-			 double phi_raw, 
-			 double r_raw);
+  void set_cylindric_raw(double eta_raw
+			 , double phi_raw
+			 , double r_raw);
 
-  /** @brief set cylindric coordinates
+  /**
+   * @brief set cylindric coordinates
    */
-  void set_cylindric(double eta, 
-                     double phi, 
-                     double r);
+  void set_cylindric(double eta
+                     , double phi
+                     , double r);
 
-  /** @brief set cylindric size deta
+  /**
+   * @brief set cylindric size deta
    */
   inline void set_deta(double deta) {m_deta = static_cast<float> (deta);}
-  /** @brief set cylindric size dphi
+  /**
+   * @brief set cylindric size dphi
    */
   inline void set_dphi(double dphi) {m_dphi = static_cast<float> (dphi);}
-  /** @brief set cartezian size dz
+  /**
+   * @brief set cartezian size dz
    */
   inline void set_dz(double dz) {m_dz = static_cast<float> (dz);}
-  /** @brief set cylindric size dr
+  /**
+   * @brief set cylindric size dr
    */
   inline void set_dr(double dr) {m_dr = static_cast<float> (dr);}
-  /** @brief set z
+  /**
+   * @brief set z
    */
   inline void set_z(double z) {m_z = static_cast<float> (z);}
-  /** @brief set r
+  /**
+   * @brief set r
    */
   inline void set_r(double r) {
     m_r = static_cast<float> (r);
@@ -387,7 +422,8 @@ class TileDetectorElement : public CaloDetDescrElement
 class MbtsDetectorElement : public CaloDetDescrElement
 {
  public:
-  /** @brief Constructor, initializes base class constructor parameters with default values
+  /**
+   * @brief Constructor, initializes base class constructor parameters with default values
    */
   MbtsDetectorElement();
 
diff --git a/Calorimeter/CaloDetDescr/src/CaloDescriptors.cxx b/Calorimeter/CaloDetDescr/src/CaloDescriptors.cxx
index e70ddf73cd13..e7e972b96968 100755
--- a/Calorimeter/CaloDetDescr/src/CaloDescriptors.cxx
+++ b/Calorimeter/CaloDetDescr/src/CaloDescriptors.cxx
@@ -12,281 +12,104 @@
 #include "LArReadoutGeometry/HECDetectorRegion.h"
 #include "LArReadoutGeometry/FCALTile.h"
 #include "LArReadoutGeometry/FCALModule.h"
+#include "GeoModelUtilities/GeoAlignmentStore.h"
 #include "GaudiKernel/SystemOfUnits.h"
 
-
-// To Define Globally:
-//
-// m_lar_*
-//
-
 // -- EMBDescriptor --
-EMBDescriptor::EMBDescriptor(const Identifier& id, 
-			     const AtlasDetectorID* helper,
-			     const CaloCell_ID* calo_helper,
-			     const EMBDetectorRegion* embRegion):
-  CaloDetDescriptor(id,helper,calo_helper),
-  m_region(embRegion)
-{
-  init_description();
-  init_interpretation();
-}
-
-EMBDescriptor::~EMBDescriptor()
+EMBDescriptor::EMBDescriptor(const Identifier& id
+			     , const AtlasDetectorID* helper
+			     , const CaloCell_ID* calo_helper
+			     , const EMBDetectorRegion* embRegion
+			     , const GeoAlignmentStore* alignStore)
+  : CaloDetDescriptor(id,helper,calo_helper)
 {
-}
-
-void EMBDescriptor::init_description()
-{
-  // -- m_calo_phi_min/m_calo_phi_max 
-  // -- m_calo_z_min/m_calo_z_max
-  // -- m_calo_r_min/m_calo_r_max
-  /*
-  m_calo_phi_min = 10000.;
-  m_calo_phi_max = -10000.;
-  m_calo_z_min = 10000.;
-  m_calo_z_max = -10000.;
-
-  double eta_min = 10000.;
-  double eta_max = -10000.;
-
-  for (unsigned int iPhi=m_region->beginPhiIndex();iPhi<m_region->endPhiIndex();iPhi++) 
-    for (unsigned int iEta=m_region->beginEtaIndex();iEta<m_region->endEtaIndex();iEta++) 
-    {	
-      EMBCellConstLink cellPtr = m_region->getEMBCell(iEta,iPhi);
-
-      if(cellPtr)
-      { 
-	if(cellPtr->getPhiLocalLower() < m_calo_phi_min)
-	  m_calo_phi_min = cellPtr->getPhiLocalLower();
-	if(cellPtr->getPhiLocalUpper() > m_calo_phi_max)
-	  m_calo_phi_max = cellPtr->getPhiLocalUpper();
-
-	if(eta_min > cellPtr->getEtaMin())
-	  eta_min = cellPtr->getEtaMin();
-	if(eta_max < cellPtr->getEtaMax())
-	  eta_max = cellPtr->getEtaMax();
-	
-	if(m_calo_z_min > cellPtr->getZMinLocal(EMBCell::FRONT))
-	  m_calo_z_min = cellPtr->getZMinLocal(EMBCell::FRONT);
-	if(m_calo_z_min > cellPtr->getZMinLocal(EMBCell::BACK))
-	  m_calo_z_min = cellPtr->getZMinLocal(EMBCell::BACK);
-	if(m_calo_z_max < cellPtr->getZMaxLocal(EMBCell::FRONT))
-	  m_calo_z_max = cellPtr->getZMaxLocal(EMBCell::FRONT);
-	if(m_calo_z_max < cellPtr->getZMaxLocal(EMBCell::BACK))
-	  m_calo_z_max = cellPtr->getZMaxLocal(EMBCell::BACK);
-      }
-    }
-
-  m_calo_r_min = m_calo_z_min/sinh(eta_max);
-  m_calo_r_max = m_calo_z_min/sinh(eta_min);
-  */
-
-  // -- m_transform
-  const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform();
-  const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform();
+  const Amg::Transform3D &xfDef = embRegion->getDefAbsoluteTransform(alignStore);
+  const Amg::Transform3D &xfAbs = embRegion->getAbsoluteTransform(alignStore);
 
   m_transform = xfAbs*xfDef.inverse();
 }
 
-void EMBDescriptor::init_interpretation()
+EMBDescriptor::~EMBDescriptor()
 {
 }
 
-
 // -- EMECDescriptor --
-EMECDescriptor::EMECDescriptor(const Identifier& id, 
-			       const AtlasDetectorID* helper,
-			       const CaloCell_ID* calo_helper,
-			       const EMECDetectorRegion* emecRegion):
-  CaloDetDescriptor(id,helper,calo_helper),
-  m_region(emecRegion)
-{
-  init_description();
-  init_interpretation();
-}
-
-EMECDescriptor::~EMECDescriptor()
+EMECDescriptor::EMECDescriptor(const Identifier& id
+			       , const AtlasDetectorID* helper
+			       , const CaloCell_ID* calo_helper
+			       , const EMECDetectorRegion* emecRegion
+			       , const GeoAlignmentStore* alignStore)
+  : CaloDetDescriptor(id,helper,calo_helper)
 {
-}
-
-void EMECDescriptor::init_description()
-{
-  // -- m_calo_phi_min/m_calo_phi_max 
-  // -- m_calo_z_min/m_calo_z_max
-  // -- m_calo_r_min/m_calo_r_max
-  /*
-  m_calo_phi_min = 10000.;
-  m_calo_phi_max = -10000.;
-  m_calo_z_min = 10000.;
-  m_calo_z_max = -10000.;
-
-  double eta_min = 10000.;
-  double eta_max = -10000.;
-
-  for (unsigned int iPhi=m_region->beginPhiIndex();iPhi<m_region->endPhiIndex();iPhi++) 
-    for (unsigned int iEta=m_region->beginEtaIndex();iEta<m_region->endEtaIndex();iEta++) 
-    {	
-      EMECCellConstLink cellPtr = m_region->getEMECCell(iEta,iPhi);
-
-      if(cellPtr)
-      { 
-	if(cellPtr->getPhiLocalLower()<m_calo_phi_min)
-	  m_calo_phi_min = cellPtr->getPhiLocalLower();
-	if(cellPtr->getPhiLocalUpper()>m_calo_phi_max)
-	  m_calo_phi_max = cellPtr->getPhiLocalUpper();
-
-	if(eta_min > cellPtr->getEtaMin())
-	  eta_min = cellPtr->getEtaMin();
-	if(eta_max < cellPtr->getEtaMax())
-	  eta_max = cellPtr->getEtaMax();
-	
-	if(m_calo_z_min > cellPtr->getZLocal(EMECCell::FRONT))
-	  m_calo_z_min = cellPtr->getZLocal(EMECCell::FRONT);
-	if(m_calo_z_min > cellPtr->getZLocal(EMECCell::BACK))
-	  m_calo_z_min = cellPtr->getZLocal(EMECCell::BACK);
-	if(m_calo_z_max < cellPtr->getZLocal(EMECCell::FRONT))
-	  m_calo_z_max = cellPtr->getZLocal(EMECCell::FRONT);
-	if(m_calo_z_max < cellPtr->getZLocal(EMECCell::BACK))
-	  m_calo_z_max = cellPtr->getZLocal(EMECCell::BACK);
-      }
-    }
-
-  m_calo_r_min = m_calo_z_min/sinh(eta_max);
-  m_calo_r_max = m_calo_z_min/sinh(eta_min);
-  */
   // -- m_transform
-  const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform();
+  const Amg::Transform3D &xfDef = emecRegion->getDefAbsoluteTransform(alignStore);
   // we need to apply the famous ZShift. 
   Amg::Transform3D xfNominal;
-  if(m_region->getEndcapIndex()==0)
-    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,m_region->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative EMEC
-  else
-    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-m_region->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive EMEC
-
-  const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform();
+  if(emecRegion->getEndcapIndex()==0) {
+    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,emecRegion->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative EMEC
+  }
+  else {
+    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-emecRegion->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive EMEC
+  }
+  const Amg::Transform3D &xfAbs = emecRegion->getAbsoluteTransform(alignStore);
 
   m_transform = xfAbs*xfNominal.inverse();
 }
 
-void EMECDescriptor::init_interpretation()
+EMECDescriptor::~EMECDescriptor()
 {
 }
 
 // -- HECDescriptor --
-HECDescriptor::HECDescriptor(const Identifier& id, 
-			     const AtlasDetectorID* helper,
-			     const CaloCell_ID* calo_helper,
-			     const HECDetectorRegion* hecRegion):
-  CaloDetDescriptor(id,helper,calo_helper),
-  m_region(hecRegion)
-{
-  init_description();
-  init_interpretation();
-}
-
-HECDescriptor::~HECDescriptor()
+HECDescriptor::HECDescriptor(const Identifier& id
+			     , const AtlasDetectorID* helper
+			     , const CaloCell_ID* calo_helper
+			     , const HECDetectorRegion* hecRegion
+			     , const GeoAlignmentStore* alignStore)
+  : CaloDetDescriptor(id,helper,calo_helper)
 {
-}
-
-void HECDescriptor::init_description()
-{
-  // -- m_calo_phi_min/m_calo_phi_max 
-  // -- m_calo_z_min/m_calo_z_max
-  // -- m_calo_r_min/m_calo_r_max
-  /*
-  m_calo_phi_min = 10000.;
-  m_calo_phi_max = -10000.;
-  m_calo_z_min = 10000.;
-  m_calo_z_max = -10000.;
-
-  double eta_min = 10000.;
-  double eta_max = -10000.;
-
-  for (unsigned int iPhi=m_region->beginPhiIndex();iPhi<m_region->endPhiIndex();iPhi++) 
-    for (unsigned int iEta=m_region->beginEtaIndex();iEta<m_region->endEtaIndex();iEta++) 
-    {	
-      HECCellConstLink cellPtr = m_region->getHECCell(iEta,iPhi);
-
-      if(cellPtr)
-      { 
-	if(cellPtr->getPhiLocalLower()<m_calo_phi_min)
-	  m_calo_phi_min = cellPtr->getPhiLocalLower();
-	if(cellPtr->getPhiLocalUpper()>m_calo_phi_max)
-	  m_calo_phi_max = cellPtr->getPhiLocalUpper();
-
-	if(eta_min > cellPtr->getEtaMinNominal())
-	  eta_min = cellPtr->getEtaMinNominal();
-	if(eta_max < cellPtr->getEtaMaxNominal())
-	  eta_max = cellPtr->getEtaMaxNominal();
-	
-	if(m_calo_z_min > cellPtr->getZLocal(HECCell::FRONT))
-	  m_calo_z_min = cellPtr->getZLocal(HECCell::FRONT);
-	if(m_calo_z_min > cellPtr->getZLocal(HECCell::BACK))
-	  m_calo_z_min = cellPtr->getZLocal(HECCell::BACK);
-	if(m_calo_z_max < cellPtr->getZLocal(HECCell::FRONT))
-	  m_calo_z_max = cellPtr->getZLocal(HECCell::FRONT);
-	if(m_calo_z_max < cellPtr->getZLocal(HECCell::BACK))
-	  m_calo_z_max = cellPtr->getZLocal(HECCell::BACK);
-      }
-    }
-
-  m_calo_r_min = m_calo_z_min/sinh(eta_max);
-  m_calo_r_max = m_calo_z_min/sinh(eta_min);
-
-  */
-
   // -- m_transform
-  const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform();
+  const Amg::Transform3D &xfDef = hecRegion->getDefAbsoluteTransform(alignStore);
   // we need to apply the famous ZShift
   Amg::Transform3D xfNominal;
-  if(m_region->getEndcapIndex()==0)
-    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,m_region->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative HEC
-  else
-    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-m_region->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive HEC
-
-  const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform();
+  if(hecRegion->getEndcapIndex()==0) {
+    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,hecRegion->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative HEC
+  }
+  else {
+    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-hecRegion->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive HEC
+  }
+  const Amg::Transform3D &xfAbs = hecRegion->getAbsoluteTransform(alignStore);
 
   m_transform = xfAbs*xfNominal.inverse();
 }
 
-void HECDescriptor::init_interpretation()
+HECDescriptor::~HECDescriptor()
 {
 }
 
 // -- FCALDescriptor --
-FCALDescriptor::FCALDescriptor(const Identifier& id, 
-			       const AtlasDetectorID* helper,
-			       const CaloCell_ID* calo_helper,
-			       const FCALModule* fcalModule):
-  CaloDetDescriptor(id,helper,calo_helper),
-  m_module(fcalModule)
-{
-  init_description();
-  init_interpretation();
-}
-
-FCALDescriptor::~FCALDescriptor()
-{
-}
-
-void FCALDescriptor::init_description()
+FCALDescriptor::FCALDescriptor(const Identifier& id
+			       , const AtlasDetectorID* helper
+			       , const CaloCell_ID* calo_helper
+			       , const FCALModule* fcalModule
+			       , const GeoAlignmentStore* alignStore)
+  : CaloDetDescriptor(id,helper,calo_helper)
 {
   // -- m_transform
-  const Amg::Transform3D &xfDef = m_module->getDefAbsoluteTransform();
+  const Amg::Transform3D &xfDef = fcalModule->getDefAbsoluteTransform(alignStore);
   // we need to apply the famous ZShift.
   Amg::Transform3D xfNominal;
-  if(m_module->getEndcapIndex()==FCALModule::POS)
-    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,m_module->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative FCAL
-  else
-    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-m_module->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive FCAL
-
-  const Amg::Transform3D &xfAbs = m_module->getAbsoluteTransform();
+  if(fcalModule->getEndcapIndex()==FCALModule::POS) {
+    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,fcalModule->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Negative FCAL
+  }
+  else {
+    xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,-fcalModule->getProjectivityDisplacement()*Gaudi::Units::cm))*xfDef; // Positive FCAL
+  }
+  const Amg::Transform3D &xfAbs = fcalModule->getAbsoluteTransform(alignStore);
 
   m_transform = xfAbs*xfNominal.inverse();
 }
 
-void FCALDescriptor::init_interpretation()
+FCALDescriptor::~FCALDescriptor()
 {
 }
-
diff --git a/Calorimeter/CaloDetDescr/src/CaloDetectorElements.cxx b/Calorimeter/CaloDetDescr/src/CaloDetectorElements.cxx
index 0d3a50d76142..c935aa1a20fe 100755
--- a/Calorimeter/CaloDetDescr/src/CaloDetectorElements.cxx
+++ b/Calorimeter/CaloDetDescr/src/CaloDetectorElements.cxx
@@ -10,6 +10,8 @@
 
 #include "CaloGeoHelpers/CaloPhiRange.h"
 
+#include "GeoModelUtilities/GeoAlignmentStore.h"
+
 #include "GaudiKernel/SystemOfUnits.h"
 
 namespace {
@@ -53,26 +55,25 @@ void fcal_deta_dphi (const CaloDetDescrElement& elt,
 
 
 // -- EMBDetectorElement --
-
-EMBDetectorElement::EMBDetectorElement(const IdentifierHash subcaloHash,
-				       const IdentifierHash onl1,
-				       const IdentifierHash onl2,
-				       const CaloDetDescriptor* descriptor,
-				       EMBCellConstLink& embCell,
-				       const EMBDetectorRegion* embRegion,
-				       bool isTestBeam):
-  CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor),
-  m_cell(embCell),
-  m_region(embRegion)
+EMBDetectorElement::EMBDetectorElement(const IdentifierHash subcaloHash
+				       , const IdentifierHash onl1
+				       , const IdentifierHash onl2
+				       , const CaloDetDescriptor* descriptor
+				       , EMBCellConstLink& embCell
+				       , const EMBDetectorRegion* embRegion
+				       , bool isTestBeam
+				       , const GeoAlignmentStore* geoAlignStore
+                                       , const CaloElementPositionShift* posShift)
+  : CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor)
+  , m_cell(embCell)
+  , m_region(embRegion)
 {
-  init_description();
-  init_interpretation();
-
-  if(isTestBeam)
-    propagateRaw();
+  init_description(geoAlignStore,posShift);
+  if(isTestBeam) propagateRaw();
 }
 
-void EMBDetectorElement::init_description(const CaloElementPositionShift* posShift)
+void EMBDetectorElement::init_description(const GeoAlignmentStore* geoAlignStore
+					  , const CaloElementPositionShift* posShift)
 {
   m_eta_raw = static_cast<float> ((m_cell->getEtaMin() + m_cell->getEtaMax())/2.);
   if(m_cell->getEndcapIndex()==0)
@@ -81,8 +82,8 @@ void EMBDetectorElement::init_description(const CaloElementPositionShift* posShi
   const double phi_loc = (m_cell->getPhiLocalLower() + m_cell->getPhiLocalUpper())/2.;
 
   double x_loc, y_loc, z_loc, r_loc;
-  const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform();
-  const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform();
+  const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(geoAlignStore);
+  const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(geoAlignStore);
 
   z_loc = (m_cell->getZMaxLocal(EMBCell::CENTER) + m_cell->getZMinLocal(EMBCell::CENTER))/2.;
   r_loc = m_cell->getRLocal(EMBCell::CENTER);
@@ -91,9 +92,9 @@ void EMBDetectorElement::init_description(const CaloElementPositionShift* posShi
   y_loc = r_loc*sin(phi_loc);
 
   Amg::Vector3D globalDefCoords = xfDef*Amg::Vector3D(x_loc,y_loc,z_loc);
-  Amg::Vector3D globalAbsCoords = (posShift!=nullptr ?
-				xfAbs*Amg::Vector3D(x_loc+posShift->dx,y_loc+posShift->dy,z_loc+posShift->dz) :
-				xfAbs*Amg::Vector3D(x_loc,y_loc,z_loc));
+  Amg::Vector3D globalAbsCoords = posShift
+    ? xfAbs*Amg::Vector3D(x_loc+posShift->dx,y_loc+posShift->dy,z_loc+posShift->dz)
+    : xfAbs*Amg::Vector3D(x_loc,y_loc,z_loc);
 
   m_x_raw = static_cast<float> (globalDefCoords.x());
   m_y_raw = static_cast<float> (globalDefCoords.y());
@@ -142,20 +143,15 @@ void EMBDetectorElement::init_description(const CaloElementPositionShift* posShi
 
 }
 
-void EMBDetectorElement::init_interpretation()
-{
-  // TO DO 
-  // Divide previous method into description and interpretation
-}
-
-void EMBDetectorElement::updateAlignment(EMBCellConstLink& embCell,
-					 const EMBDetectorRegion* embRegion,
-					 const CaloElementPositionShift* posShift)
+void EMBDetectorElement::updateAlignment(EMBCellConstLink& embCell
+					 , const EMBDetectorRegion* embRegion
+					 , const CaloElementPositionShift* posShift)
 {
   m_cell = embCell;
   m_region = embRegion;
-  init_description(posShift);
-  init_interpretation();
+  // updateAlignment() is called only from CaloAlignTool::align() callback
+  // This is why we explicitly use nullptr as first argument to init_description()
+  init_description(nullptr,posShift);
 }
 
 int EMBDetectorElement::getLayer() const
@@ -165,25 +161,27 @@ int EMBDetectorElement::getLayer() const
 
 // -- EMECDetectorElement --
 
-EMECDetectorElement::EMECDetectorElement(const IdentifierHash subcaloHash,
-					 const IdentifierHash onl1,
-					 const IdentifierHash onl2,
-					 const CaloDetDescriptor* descriptor,
-					 EMECCellConstLink& emecCell,
-					 const EMECDetectorRegion* emecRegion,
-					 bool isTestBeam):
-  CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor),
-  m_cell(emecCell),
-  m_region(emecRegion)
+EMECDetectorElement::EMECDetectorElement(const IdentifierHash subcaloHash
+					 , const IdentifierHash onl1
+					 , const IdentifierHash onl2
+					 , const CaloDetDescriptor* descriptor
+					 , EMECCellConstLink& emecCell
+					 , const EMECDetectorRegion* emecRegion
+					 , bool isTestBeam
+					 , const GeoAlignmentStore* geoAlignStore
+					 , const CaloElementPositionShift* posShift)
+  : CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor)
+  , m_cell(emecCell)
+  , m_region(emecRegion)
 {
-  init_description(isTestBeam);
+  init_description(isTestBeam,geoAlignStore,posShift);
   init_interpretation();
-
-  if(isTestBeam)
-    propagateRaw();
+  if(isTestBeam) propagateRaw();
 }
 
-void EMECDetectorElement::init_description(bool isTestBeam, const CaloElementPositionShift* posShift)
+void EMECDetectorElement::init_description(bool isTestBeam
+					   , const GeoAlignmentStore* geoAlignStore
+					   , const CaloElementPositionShift* posShift)
 {
   m_eta_raw = static_cast<float> ((m_cell->getEtaMin() + m_cell->getEtaMax())/2.);
   if(m_cell->getEndcapIndex()==0)
@@ -192,7 +190,7 @@ void EMECDetectorElement::init_description(bool isTestBeam, const CaloElementPos
   m_phi_raw = static_cast<float> ((m_cell->getPhiLocalLower() + m_cell->getPhiLocalUpper())/2.);
 
   double x_loc, y_loc, z_loc, r_loc;
-  const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform();
+  const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(geoAlignStore);
 
 // we need to apply the famous ZShift. 
   Amg::Transform3D xfNominal;
@@ -205,7 +203,7 @@ void EMECDetectorElement::init_description(bool isTestBeam, const CaloElementPos
     xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0.,3689.5*Gaudi::Units::mm));
   }
 
-  const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform();
+  const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(geoAlignStore);
 
   z_loc = m_cell->getZLocal(EMECCell::CENTER);
   r_loc = (m_cell->getRMinLocal(EMECCell::CENTER) + m_cell->getRMaxLocal(EMECCell::CENTER))/2.;
@@ -281,13 +279,15 @@ void EMECDetectorElement::init_interpretation()
   }
 }
 
-void EMECDetectorElement::updateAlignment(EMECCellConstLink& emecCell,
-					  const EMECDetectorRegion* emecRegion,
-					  const CaloElementPositionShift* posShift)
+void EMECDetectorElement::updateAlignment(EMECCellConstLink& emecCell
+					  , const EMECDetectorRegion* emecRegion
+					  , const CaloElementPositionShift* posShift)
 {
   m_cell = emecCell;
   m_region = emecRegion;
-  init_description(false,posShift);
+  // updateAlignment() is called only from CaloAlignTool::align() callback
+  // This is why we explicitly use nullptr as first argument to init_description()
+  init_description(false,nullptr,posShift);
   init_interpretation();
 }
 
@@ -297,25 +297,29 @@ int EMECDetectorElement::getLayer() const
 }
 
 // -- HECDetectorElement --
-HECDetectorElement::HECDetectorElement(const IdentifierHash subcaloHash,
-				       const IdentifierHash onl1,
-				       const IdentifierHash onl2,
-				       const CaloDetDescriptor* descriptor,
-				       HECCellConstLink& hecCell,
-				       const HECDetectorRegion* hecRegion,
-				       bool isTestBeam):
-  CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor),
-  m_cell(hecCell),
-  m_region(hecRegion)
+HECDetectorElement::HECDetectorElement(const IdentifierHash subcaloHash
+				       , const IdentifierHash onl1
+				       , const IdentifierHash onl2
+				       , const CaloDetDescriptor* descriptor
+				       , HECCellConstLink& hecCell
+				       , const HECDetectorRegion* hecRegion
+				       , bool isTestBeam
+				       , const GeoAlignmentStore* geoAlignStore
+				       , const CaloElementPositionShift* posShift)
+  : CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor)
+  , m_cell(hecCell)
+  , m_region(hecRegion)
 {
-  init_description(isTestBeam);
+  init_description(isTestBeam,geoAlignStore,posShift);
   init_interpretation();
 
   if(isTestBeam)
     propagateRaw();
 }
 
-void HECDetectorElement::init_description(bool isTestBeam, const CaloElementPositionShift* posShift)
+void HECDetectorElement::init_description(bool isTestBeam
+					  , const GeoAlignmentStore* geoAlignStore
+					  , const CaloElementPositionShift* posShift)
 {
   // take PHI_RAW from LAr Readout geometry and use it xor calculations of x_loc and y_loc
   m_phi_raw = static_cast<float> ((m_cell->getPhiLocalLower() + m_cell->getPhiLocalUpper())/2.);
@@ -329,7 +333,7 @@ void HECDetectorElement::init_description(bool isTestBeam, const CaloElementPosi
   z_loc = m_cell->getZLocal(HECCell::CENTER);
 
 
-  const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform();
+  const Amg::Transform3D &xfDef = m_region->getDefAbsoluteTransform(geoAlignStore);
 
   // we need to apply the famous ZShift.
   Amg::Transform3D xfNominal;
@@ -342,7 +346,7 @@ void HECDetectorElement::init_description(bool isTestBeam, const CaloElementPosi
     xfNominal = Amg::Translation3D(Amg::Vector3D(0.,0., 4277.*Gaudi::Units::mm));
   }
 
-  const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform();
+  const Amg::Transform3D &xfAbs = m_region->getAbsoluteTransform(geoAlignStore);
 
   x_loc = r_loc*cos(m_phi_raw);
   y_loc = r_loc*sin(m_phi_raw);
@@ -420,13 +424,13 @@ void HECDetectorElement::init_interpretation()
     m_phi_raw = static_cast<float> (m_phi_raw + (2*M_PI));
 }
 
-void HECDetectorElement::updateAlignment(HECCellConstLink& hecCell,
-					 const HECDetectorRegion* hecRegion,
-					 const CaloElementPositionShift* posShift)
+void HECDetectorElement::updateAlignment(HECCellConstLink& hecCell
+					 , const HECDetectorRegion* hecRegion
+					 , const CaloElementPositionShift* posShift)
 {
   m_cell = hecCell;
   m_region = hecRegion;
-  init_description(false,posShift);
+  init_description(false,nullptr,posShift);
   init_interpretation();
 }
 
@@ -437,32 +441,33 @@ int HECDetectorElement::getLayer() const
 
 // -- FCALDetectorElement --
 
-FCALDetectorElement::FCALDetectorElement(const IdentifierHash subcaloHash,
-					 const IdentifierHash onl1,
-					 const IdentifierHash onl2,
-					 const CaloDetDescriptor* descriptor,
-					 const FCALTile* fcalTile,
-					 const FCALModule* fcalModule,
-					 bool isTestBeam):
-  CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor),
-  m_tile(fcalTile),
-  m_module(fcalModule)
+FCALDetectorElement::FCALDetectorElement(const IdentifierHash subcaloHash
+					 , const IdentifierHash onl1
+					 , const IdentifierHash onl2
+					 , const CaloDetDescriptor* descriptor
+					 , const FCALTile* fcalTile
+					 , const FCALModule* fcalModule
+					 , bool isTestBeam
+					 , const GeoAlignmentStore* geoAlignStore
+					 , const CaloElementPositionShift* posShift)
+  : CaloDetDescrElement(subcaloHash,onl1,onl2,descriptor)
+  , m_tile(fcalTile)
+  , m_module(fcalModule)
 {
-  init_description(isTestBeam);
-  init_interpretation();
-
-  if(isTestBeam)
-    propagateRaw();
+  init_description(isTestBeam,geoAlignStore,posShift);
+  if(isTestBeam) propagateRaw();
 }
 
-void FCALDetectorElement::init_description(bool isTestBeam, const CaloElementPositionShift* posShift)
+void FCALDetectorElement::init_description(bool isTestBeam
+					   , const GeoAlignmentStore* geoAlignStore
+					   , const CaloElementPositionShift* posShift)
 {
   double x_loc = m_tile->getX();
   double y_loc = m_tile->getY();
   //  double z_loc = -m_module->getFullDepthZ(*m_tile)/2.;
   double z_loc = 0.;
 
-  const Amg::Transform3D &xfDef = m_module->getDefAbsoluteTransform();
+  const Amg::Transform3D &xfDef = m_module->getDefAbsoluteTransform(geoAlignStore);
 // we need to apply the famous ZShift. 
   Amg::Transform3D xfNominal;
   if(m_module->getEndcapIndex()==FCALModule::POS)
@@ -481,7 +486,7 @@ void FCALDetectorElement::init_description(bool isTestBeam, const CaloElementPos
      }
   }
 
-  const Amg::Transform3D &xfAbs = m_module->getAbsoluteTransform();
+  const Amg::Transform3D &xfAbs = m_module->getAbsoluteTransform(geoAlignStore);
 
   Amg::Vector3D globalDefCoords = xfNominal*Amg::Vector3D(x_loc,y_loc,z_loc);
   Amg::Vector3D globalAbsCoords = (posShift!=nullptr ?
@@ -555,20 +560,13 @@ void FCALDetectorElement::init_description(bool isTestBeam, const CaloElementPos
 
 }
 
-void FCALDetectorElement::init_interpretation()
-{
-  // TO DO 
-  // Divide previous method into description and interpretation
-}
-
 void FCALDetectorElement::updateAlignment(const FCALTile* fcalTile,
 					  const FCALModule* fcalModule,
 					  const CaloElementPositionShift* posShift)
 {
   m_tile = fcalTile;
   m_module = fcalModule;
-  init_description(false,posShift);
-  init_interpretation();
+  init_description(false,nullptr,posShift);
 }
 
 int FCALDetectorElement::getLayer() const
diff --git a/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx b/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx
index ea36850618ae..521076a4a80d 100644
--- a/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx
+++ b/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx
@@ -43,7 +43,7 @@
 
 std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 						       , IMessageSvc* msgSvc
-						       , const GeoAlignmentStore* /*geoAlignStore*/
+						       , const GeoAlignmentStore* geoAlignStore
 						       , const CaloRec::CaloCellPositionShift* /*cellPosShift*/)
 {
   MsgStream log(msgSvc, "buildCaloDetDescr"); 
@@ -138,7 +138,11 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 					  , embRegion->getSamplingIndex()
 					  , embRegion->getRegionIndex());
 
-      EMBDescriptor* embDescr = new EMBDescriptor(regId,(AtlasDetectorID *)cell_id,cell_id,embRegion);
+      EMBDescriptor* embDescr = new EMBDescriptor(regId
+						  , (AtlasDetectorID *)cell_id
+						  , cell_id
+						  , embRegion
+						  , geoAlignStore);
       caloMgr->add(embDescr);
 
       double phi_min = 0.;
@@ -176,7 +180,8 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 								  , embDescr
 								  , cellPtr
 								  , embRegion
-								  , isTestBeam);
+								  , isTestBeam
+								  , geoAlignStore);
 	  if(iPhi==embRegion->beginPhiIndex()) {
 	    phi_min = embElement->phi() - 0.5*embElement->dphi();
 	  }
@@ -296,7 +301,11 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 					  , emecRegion->getSamplingIndex()
 					  , emecRegion->getRegionIndex());
 
-      EMECDescriptor* emecDescr = new EMECDescriptor(regId,(AtlasDetectorID *)cell_id,cell_id,emecRegion);
+      EMECDescriptor* emecDescr = new EMECDescriptor(regId
+						     , (AtlasDetectorID *)cell_id
+						     , cell_id
+						     , emecRegion
+						     , geoAlignStore);
       caloMgr->add(emecDescr);
 
       double phi_min = 0.;
@@ -332,7 +341,8 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 								     , emecDescr
 								     , cellPtr
 								     , emecRegion
-								     , isTestBeam);
+								     , isTestBeam
+								     , geoAlignStore);
 	  if(iPhi==emecRegion->beginPhiIndex()) {
 	    phi_min = emecElement->phi() - 0.5*emecElement->dphi();
 	  }
@@ -424,7 +434,11 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 					   , hecregion->getSamplingIndex()
 					   , hecregion->getRegionIndex());
 
-      HECDescriptor* hecDescr = new HECDescriptor(regId,(AtlasDetectorID *)cell_id,cell_id,hecregion);
+      HECDescriptor* hecDescr = new HECDescriptor(regId
+						  , (AtlasDetectorID *)cell_id
+						  , cell_id
+						  , hecregion
+						  , geoAlignStore);
       caloMgr->add(hecDescr);
 
       double phi_min = 0.;
@@ -462,7 +476,8 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 								    , hecDescr
 								    , cellPtr
 								    , hecregion
-								    , isTestBeam);
+								    , isTestBeam
+								    , geoAlignStore);
 	    if(iPhi==hecregion->beginPhiIndex()) {
 	      phi_min = hecElement->phi() - 0.5*hecElement->dphi();
 	    }
@@ -557,9 +572,10 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
       Identifier regId = fcal_id->module_id(pos_neg,(int)fcalmodule->getModuleIndex());
 
       FCALDescriptor* fcalDescr = new FCALDescriptor(regId
-						     ,(AtlasDetectorID *)cell_id
-						     ,cell_id
-						     ,fcalmodule);
+						     , (AtlasDetectorID *)cell_id
+						     , cell_id
+						     , fcalmodule
+						     , geoAlignStore);
       caloMgr->add(fcalDescr);
 
       double eta_min = 10000.;
@@ -591,7 +607,8 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 								   , fcalDescr
 								   , &(*fcaltileIt)
 								   , fcalmodule
-								   , isTestBeam);
+								   , isTestBeam
+								   , geoAlignStore);
 	// calculate cell volume
 	double tubeSpacing = cellVol.getFcalTubeSpacing((int)fcalmodule->getModuleIndex());
 	unsigned int numTubes = fcaltileIt->getNumTubes();
-- 
GitLab


From 9957928795f7ef1d941c3bf21bd9bba6b891a124 Mon Sep 17 00:00:00 2001
From: Witold Wojciech Przygoda <witold.wojciech.przygoda@cern.ch>
Date: Thu, 9 Sep 2021 09:25:01 +0200
Subject: [PATCH 032/347] Bug fix, node compression optimization, test units
 implemented

---
 Trigger/TrigEvent/TrigNavTools/CMakeLists.txt |   22 +-
 ...NavConverter_electron_multichains_test.ref | 4192 +++++++++++++++++
 .../share/NavConverter_muon_chains_test.ref   |  120 +
 .../NavConverter_muon_multichains_test.ref    |  507 ++
 .../TrigNavTools/share/navGraphDump.py        |    0
 .../share/testTrigR2ToR3NavGraphConversion.py |   26 +-
 .../src/Run2ToRun3TrigNavConverter.cxx        |  362 +-
 .../src/Run2ToRun3TrigNavConverter.h          |   11 +-
 8 files changed, 5103 insertions(+), 137 deletions(-)
 create mode 100644 Trigger/TrigEvent/TrigNavTools/share/NavConverter_electron_multichains_test.ref
 create mode 100644 Trigger/TrigEvent/TrigNavTools/share/NavConverter_muon_chains_test.ref
 create mode 100644 Trigger/TrigEvent/TrigNavTools/share/NavConverter_muon_multichains_test.ref
 mode change 100644 => 100755 Trigger/TrigEvent/TrigNavTools/share/navGraphDump.py

diff --git a/Trigger/TrigEvent/TrigNavTools/CMakeLists.txt b/Trigger/TrigEvent/TrigNavTools/CMakeLists.txt
index acd0c08a2fc7..3c667adf1929 100644
--- a/Trigger/TrigEvent/TrigNavTools/CMakeLists.txt
+++ b/Trigger/TrigEvent/TrigNavTools/CMakeLists.txt
@@ -8,7 +8,7 @@ atlas_add_library( TrigNavToolsLib
                    src/*.cxx
                    PUBLIC_HEADERS TrigNavTools
                    PRIVATE_LINK_LIBRARIES AthenaBaseComps AthenaKernel CxxUtils TrigConfHLTData TrigSteeringEvent xAODTrigger
-                   LINK_LIBRARIES GaudiKernel TrigDecisionToolLib TrigNavigationLib )
+                   LINK_LIBRARIES GaudiKernel TrigDecisionToolLib TrigNavigationLib AnalysisTriggerEvent AthAnalysisBaseCompsLib AthContainers AthViews AthenaBaseComps AthenaKernel CxxUtils EventInfo GaudiKernel MuonCombinedToolInterfaces Particle StoreGateLib TrigCaloEvent TrigCompositeUtilsLib TrigConfHLTData TrigConfInterfaces TrigDecisionToolLib TrigInDetEvent TrigInDetTruthEvent TrigMissingEtEvent TrigMuonEvent TrigNavStructure TrigNavigationLib TrigParticle TrigRoiConversionLib TrigSteeringEvent TrigT1Interfaces VxSecVertex tauEvent xAODBTagging xAODCore xAODEgamma xAODJet xAODMuon xAODTau xAODTracking xAODTrigBphys xAODTrigCalo xAODTrigEgamma xAODTrigMinBias xAODTrigMissingET xAODTrigMuon xAODTrigger xAODEventInfo )
 
 atlas_add_component( TrigNavTools
                      src/components/*.cxx
@@ -21,4 +21,22 @@ atlas_install_scripts( share/*.py )
 
 atlas_add_test(NavConverterTest
     SCRIPT python -m TrigNavTools.NavConverterConfig
-    POST_EXEC_SCRIPT nopost.sh)
\ No newline at end of file
+    POST_EXEC_SCRIPT nopost.sh)
+
+# atlas_add_test(NavConverter_muon_chains_test
+#     SCRIPT testTrigR2ToR3NavGraphConversion.py --evtMax=10 
+#     TestNavConversion.Chains='["HLT_mu4"]' 
+#     TestNavConversion.Collections='["xAOD::MuonContainer","xAOD::L2StandAloneMuonContainer","xAOD::TrigMissingET","xAOD::JetContainer"]' 
+#     LOG_SELECT_PATTERN "REGTEST")
+
+# atlas_add_test(NavConverter_muon_multichains_test
+#     SCRIPT testTrigR2ToR3NavGraphConversion.py --evtMax=10 
+#     TestNavConversion.Chains='["HLT_mu4","HLT_mu6","HLT_mu10","HLT_mu6_2mu4","HLT_mu22"]' 
+#     TestNavConversion.Collections='["xAOD::MuonContainer","xAOD::L2StandAloneMuonContainer","xAOD::TrigMissingET","xAOD::JetContainer"]' 
+#     LOG_SELECT_PATTERN "REGTEST")
+
+    atlas_add_test(NavConverter_electron_multichains_test
+    SCRIPT testTrigR2ToR3NavGraphConversion.py --evtMax=10 
+    TestNavConversion.Chains='["HLT_e5_lhvloose_nod0","HLT_e9_etcut","HLT_e26_lhtight_nod0","HLT_e28_lhtight_nod0"]' 
+    TestNavConversion.Collections='["xAOD::ElectronContainer","xAOD::TrigEMClusterContainer","xAOD::TrigEMCluster","xAOD::TrigElectron","xAOD::TrigElectronContainer","xAOD::CaloCluster","xAOD::CaloClusterContainer"]' 
+    LOG_SELECT_PATTERN "REGTEST")
\ No newline at end of file
diff --git a/Trigger/TrigEvent/TrigNavTools/share/NavConverter_electron_multichains_test.ref b/Trigger/TrigEvent/TrigNavTools/share/NavConverter_electron_multichains_test.ref
new file mode 100644
index 000000000000..fee89fa0f6a3
--- /dev/null
+++ b/Trigger/TrigEvent/TrigNavTools/share/NavConverter_electron_multichains_test.ref
@@ -0,0 +1,4192 @@
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (11) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (10) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (11) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (10) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (12)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (13 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (13) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (12) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (13) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (12) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (15 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (15) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (14) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (16 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (16) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (14) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (17 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (14) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (18)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (18 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (18) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (14) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (19 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (14) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (21)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (21 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (21) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (22 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (23 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (24)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (24 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (25 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (25) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (26 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (27)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (27 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (27) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (28 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (28) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (29 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (30 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (30) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (31 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (32 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (33 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (33) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (35 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (35) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (36 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (38 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (40 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (40) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (39) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (41 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (41) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (39) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (43 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (43) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (42) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (45)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (44)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (45 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (45) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (44) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (45) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (44) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (47 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (46) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (48 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (46) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (50)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (49)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (50 -> 49)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (49) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (51) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (51 -> 50)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (53)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (52)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (53 -> 52)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (52) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (54) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (54 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 54)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (56)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (55)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (56 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (55) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (57) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (57 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (8) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (59)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (58)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (59 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (59) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (59) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (59) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (61)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (60)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (61 -> 60)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (61) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (61) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (61) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (15) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (16) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (18) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (19) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (21) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (22) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (25) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (27) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (28) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (29) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (33) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (63)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (63 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (63) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (64 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (65)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (65 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (65) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (35) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (34) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (34) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (67)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (66)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (67 -> 66)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (67) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (66) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (68)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (68 -> 66)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (68) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (66) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (39) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (41) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (39) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (43) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (42) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (70)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (70 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (71)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (71 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (73)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (72)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (73 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (48) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (50) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (49) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (74)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (75 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (75) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (74) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (76) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (76 -> 75)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 76)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (10 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (10 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (14 -> 61)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (20 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (20 -> 61)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (39 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (39 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (42 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 45)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (49 -> 45)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (49 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (52 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (55 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (60 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (62 -> 61)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (66 -> 63)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (66 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (66 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (72 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (72 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (72 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (72 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (72 -> 71)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (74 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (8) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (13) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (15) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (13 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (20 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (22 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (21) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (21) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (24)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (24 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (25 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (25) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (26 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (27)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (28 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (27) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (30 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (30) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (32 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (34 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (33) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (36 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (35) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (37 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (39 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (39) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (38) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (41 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (41) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (40) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (43 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (42) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (44) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (44 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (46)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (45)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (46 -> 45)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (46) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (45) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (48)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (47)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (48 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (48) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (47) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (50)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (49)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (50 -> 49)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (49) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (51) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (51 -> 50)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (8) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (13) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (15) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (13 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (53)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (52)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (53 -> 52)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (52) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (52) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (52) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (52) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (55)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (54)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (55 -> 54)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (25) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (57)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (57 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (58 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (59)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (59 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (59) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (60 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (61)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (61 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (62 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (63)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (63 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (63) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (65)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (65 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (65) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (66)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (66 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (66) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (67)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (67 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (67) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (68)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (68 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (68) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (69 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (70)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (70 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (71)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (71 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (72)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (72 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (73 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (75)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (74)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (75 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (75) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (74) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (29) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (77)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (76)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (77 -> 76)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (77) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (76) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (78)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (78 -> 76)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (78) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (76) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (80)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (79)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (80 -> 79)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (80) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (79) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (81)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (81 -> 79)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (81) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (79) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (82)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (82 -> 79)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (82) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (79) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (84)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (84 -> 83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (84) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (83) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (86)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (85)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (86 -> 85)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (86) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (85) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (87)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (87 -> 85)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (87) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (85) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (89)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (88)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (89 -> 88)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (89) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (88) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (90)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (90 -> 88)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (90) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (88) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (91)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (91 -> 88)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (91) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (88) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (93)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (92)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (93 -> 92)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (92) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (95)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (94)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (95 -> 94)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (35) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (96)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (97 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (98)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (98 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (98) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (100)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (99)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (100 -> 99)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (102)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (101)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (102 -> 101)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (103) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (103 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 103)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (101 -> 95)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (19 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (19 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (21 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (23 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (23 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (27 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (29 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (29 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (29 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (31 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (33 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (35 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (35 -> 95)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (38 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (42 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (45 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (47 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (49 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (52 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (52 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (52 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (52 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (54 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (56 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (64 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (74 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 60)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 61)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 63)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (79 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (79 -> 66)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (79 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (79 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (79 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (79 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (79 -> 71)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (79 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (79 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (83 -> 75)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 77)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 78)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (88 -> 80)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (88 -> 81)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (88 -> 82)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (92 -> 84)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (94 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (94 -> 86)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (94 -> 87)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (94 -> 89)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (94 -> 90)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (94 -> 91)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (94 -> 93)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (96 -> 95)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (99 -> 95)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (8) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (7) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (10 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (10) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (9) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (12 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (12) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (11) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (13 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (11) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (14 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (14) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (11) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (16 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (16) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (15) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (18)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (18 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (18) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (20 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (21)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (22 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (21) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (23 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (24) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (24 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (25) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (25 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (27)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (27 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (27) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (26) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (27) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (26) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (29 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (29) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (28) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (29) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (28) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (31 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (32 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (33 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (33) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (34 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (34) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (35 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (35) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (36 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (37 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (37) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (38 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (39 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (39) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (40 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (41 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (41) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (42 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (42) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (43 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (43) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (44)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (44 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (44) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (45)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (45 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (45) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (46 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (47 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (48 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (48) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (49)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (49 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (49) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (50)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (50 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (50) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (51 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (51) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (52)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (52 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (52) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (53 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (54)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (54 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (55)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (55 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (56 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (57)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (57 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (58 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (59)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (59 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (59) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (60 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (61)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (61 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (62 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (63)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (63 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (63) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (64 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (65)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (65 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (65) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (66)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (66 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (66) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (12) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (11) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (11) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (11) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (68)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (67)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (68 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (68) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (67) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (69 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (67) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (16) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (15) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (71)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (70)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (71 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (72)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (72 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (18) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (74)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (73)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (74 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (74) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (74) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (76)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (76 -> 75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (76) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (75) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (77)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (77 -> 75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (77) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (75) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (22) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (21) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (78) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (78 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 78)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (11 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (15 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (15 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (15 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (19 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (21 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (21 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (26 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (26 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (28 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (30 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 45)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 49)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 50)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 51)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 52)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 54)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 60)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 61)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 63)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 66)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (7 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (70 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (70 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (73 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (73 -> 71)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (73 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (75 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (9 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (14)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (14) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (13) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (14) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (13) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (16 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (18)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (18 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (18) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (19 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (20 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (21)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (21 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (21) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (23 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (24)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (24 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (26 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (25) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (27)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (28 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (28) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (27) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (30 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (30) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (32 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (34 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (33) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (33) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (36 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (35) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (38 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (39) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (39 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (41 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (41) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (40) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (43 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (43) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (42) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (28) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (27) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (45)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (44)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (45 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (45) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (44) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (46) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (46 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (48)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (47)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (48 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (48) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (47) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (50)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (49)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (50 -> 49)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (50) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (49) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (28) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (27) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (52)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (51)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (52 -> 51)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (52) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (51) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (53) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (53 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (8) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (55)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (54)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (55 -> 54)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (57)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (56)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (57 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (59)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (59 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (59) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (60 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (61)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (61 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (62 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (63)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (63 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (63) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (64 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (65)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (65 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (65) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (66)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (66 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (66) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (67)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (67 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (67) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (68)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (68 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (68) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (18) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (19) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (21) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (70)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (70 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (71)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (71 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (72)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (72 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (73 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (74)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (74 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (74) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (75 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (75) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (76)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (76 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (76) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (77)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (77 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (77) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (78)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (78 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (78) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (79)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (79 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (79) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (80)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (80 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (80) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (81)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (81 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (81) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (82)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (83 -> 82)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (83) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (82) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (84)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (84 -> 82)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (84) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (82) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (25) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (86)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (85)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (86 -> 85)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (86) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (85) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (28) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (27) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (88)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (87)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (88 -> 87)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (88) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (87) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (89)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (89 -> 87)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (89) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (87) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (29) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (91)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (90)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (91 -> 90)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (91) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (90) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (93)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (92)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (93 -> 92)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (92) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (92) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (92) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (92) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (95)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (94)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (95 -> 94)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (96)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (96 -> 94)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (35) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (98)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (98 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (98) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (99 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 99)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (13 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (13 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (15 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (17 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (22 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (22 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (22 -> 50)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (22 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (25 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (25 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (25 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (25 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (27 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (27 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (29 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (31 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (33 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (33 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (35 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (35 -> 93)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 45)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 52)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 93)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (42 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (47 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (49 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (51 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (54 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (54 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (54 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (54 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (56 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 60)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 61)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 63)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 66)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 71)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 75)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 76)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 77)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 78)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 79)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 80)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 81)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (87 -> 83)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (87 -> 84)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (90 -> 86)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (92 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (92 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (92 -> 88)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (92 -> 89)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (92 -> 91)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (94 -> 93)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (97 -> 93)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (14) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (13) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (15) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (13 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (20 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (22 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (21) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (21) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (21) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (24)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (24 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (25 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (25) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (26 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (27)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (27 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (27) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (28 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (28) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (29 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (30 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (30) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (32 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (33 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (33) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (34 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (35 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (35) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (36 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (37 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (38 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (39 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (39) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (40 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (40) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (41 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (41) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (43 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (43) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (42) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (45)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (44)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (45 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (45) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (44) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (47 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (47) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (46) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (48 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (48) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (46) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (50)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (49)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (50 -> 49)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (50) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (49) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (52)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (52 -> 51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (52) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (51) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (54)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (54 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (54) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (55)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (55 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (55) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (57)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (57 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (59)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (58)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (59 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (59) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (58) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (59) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (58) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (59) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (58) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (61)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (61 -> 60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (60) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (63)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (63 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (62) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (65)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (65 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (66) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (66 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 66)
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (67) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (67 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (68) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (68 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (13) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (15) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (13 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (70)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (69)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (70 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (72)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (71)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (72 -> 71)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (25) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (27) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (28) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (29) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (74)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (74 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (74) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (75 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (75) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (76)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (76 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (76) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (77)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (77 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (77) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (78)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (78 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (78) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (79)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (79 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (79) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (80)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (80 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (80) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (81)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (81 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (81) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (82)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (82 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (82) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (33) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (34) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (35) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (37) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (39) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (41) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (43) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (42) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (84)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (84 -> 83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (84) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (83) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (85)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (85 -> 83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (85) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (83) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (86)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (86 -> 83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (86) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (83) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (87)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (87 -> 83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (87) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (83) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (88)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (88 -> 83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (88) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (83) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (45) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (44) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (90)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (89)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (90 -> 89)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (90) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (89) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (48) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (50) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (49) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (92)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (91)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (92 -> 91)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (92) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (91) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (93)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (93 -> 91)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (91) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (94)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (94 -> 91)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (91) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (52) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (51) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (96)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (95)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (96 -> 95)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (98)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (98 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (98) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (99)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (99 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (100)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (100 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (102)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (101)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (102 -> 101)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (104)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (103)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (104 -> 103)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (104) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (103) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (63) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (65) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (106)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (105)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (106 -> 105)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (106) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (105) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (107)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (107 -> 105)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (107) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (105) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (108 -> 107)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (101 -> 100)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (101 -> 52)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (101 -> 54)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (101 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (101 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (101 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (101 -> 98)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (101 -> 99)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (103 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (105 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (19 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (19 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (19 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (21 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (23 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (23 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (31 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (31 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (42 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (42 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (49 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (51 -> 45)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (56 -> 50)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 52)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 54)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (60 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (60 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (62 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (62 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (64 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (64 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (71 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (73 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (83 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 75)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 76)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 77)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 78)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 79)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 80)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 81)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 82)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (91 -> 84)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (91 -> 85)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (91 -> 86)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (91 -> 87)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (91 -> 88)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (95 -> 90)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (97 -> 92)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (97 -> 93)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (97 -> 94)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (13) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (15) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (13 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (20 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (21) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (19 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (23 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (24) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (22 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (26 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (25) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (27) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (25 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (29 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (28) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (28) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (28) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (28) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (31 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (30) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (30) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (30) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (30) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (33 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (33) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (32) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (34 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (32) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (35 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (35) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (32) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (36 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (32) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (38 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (39 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (39) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (40 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (40) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (42 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (42) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (41) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (43 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (43) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (41) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (44)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (44 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (44) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (41) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (45)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (45 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (45) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (41) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (46 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (46) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (41) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (48 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (48) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (49)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (49 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (49) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (50)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (50 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (50) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (51 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (51) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (52)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (52 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (52) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (54)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (54 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (54) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (55)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (55 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (55) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (57)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (57 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (59)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (59 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (59) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (61)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (61 -> 60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (60) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (62 -> 60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (62) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (60) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (63)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (64 -> 63)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (64) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (63) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (65)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (65 -> 63)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (65) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (63) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (67)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (66)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (67 -> 66)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (67) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (66) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (68)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (69 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (69) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (68) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (71)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (70)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (71 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (71) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (70) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (72)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (72 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (72) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (70) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (74)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (73)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (74 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (74) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (73) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (74) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (73) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (74) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (73) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (74) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (73) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (76)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (76 -> 75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (75) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (77)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (77 -> 75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (75) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (79)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (78)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (79 -> 78)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (79) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (78) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (81)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (80)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (81 -> 80)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (80) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (82)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (83 -> 82)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (82) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (84) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (84 -> 83)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 84)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (86)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (85)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (86 -> 85)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (86) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (85) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (88)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (87)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (88 -> 87)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (88) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (87) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (39) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (40) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (67) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (66) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (90)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (89)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (90 -> 89)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (90) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (89) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (79) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (78) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (91) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (91 -> 79)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 91)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (93)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (92)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (93 -> 92)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (93) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (92) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (95)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (94)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (95 -> 94)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (95) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (94) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (39) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (40) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (67) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (66) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (97)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (96)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (97 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (97) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (96) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (79) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (78) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (98) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (98 -> 79)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 98)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (13) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (15) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (13 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (19) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (21) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (19 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (24) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (22 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (25) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (27) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (25 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (100)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (99)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (100 -> 99)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (102)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (101)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (102 -> 101)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (33) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (34) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (35) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (104)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (103)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (104 -> 103)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (104) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (103) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (105)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (105 -> 103)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (105) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (103) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (106)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (106 -> 103)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (106) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (103) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (107)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (107 -> 103)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (107) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (103) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (109)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (109 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (109) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (110)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (110 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (110) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (111)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (111 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (111) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (112)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (112 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (112) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (113)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (113 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (113) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (114)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (114 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (114) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (115)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (115 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (115) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (116)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (116 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (116) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (117)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (117 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (117) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (118)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (118 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (118) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (120)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (120 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (120) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (121)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (121 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (121) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (122)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (122 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (122) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (123)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (123 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (123) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (124)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (124 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (124) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (125)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (125 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (125) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (126)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (126 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (126) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (127)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (127 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (127) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (128)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (128 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (128) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (129)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (129 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (129) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (130)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (130 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (130) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (131)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (131 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (131) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (39) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (37) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (42) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (41) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (43) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (41) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (44) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (41) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (45) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (41) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (41) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (48) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (49) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (50) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (51) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (52) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (133)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (132)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (133 -> 132)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (133) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (132) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (134)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (134 -> 132)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (134) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (132) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (135)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (135 -> 132)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (135) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (132) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (136)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (136 -> 132)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (136) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (132) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (137)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (137 -> 132)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (137) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (132) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (139)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (138)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (139 -> 138)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (139) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (138) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (140)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (140 -> 138)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (140) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (138) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (141)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (141 -> 138)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (141) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (138) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (143)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (142)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (143 -> 142)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (143) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (142) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (145)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (144)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (145 -> 144)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (145) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (144) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (146)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (146 -> 144)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (146) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (144) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (59) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (148)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (147)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (148 -> 147)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (148) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (147) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (63) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (65) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (63) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (150)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (149)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (150 -> 149)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (149) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (151)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (151 -> 149)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (149) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (152)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (152 -> 149)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (149) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (154)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (153)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (154 -> 153)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (154) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (153) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (156)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (155)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (156 -> 155)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (156) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (155) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (157)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (157 -> 155)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (157) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (155) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (67) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (66) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (68) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (159)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (158)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (159 -> 158)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (159) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (158) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (161)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (160)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (161 -> 160)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (161) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (160) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (161) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (160) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (161) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (160) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (161) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (160) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (161) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (160) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (161) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (160) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (161) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (160) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (76) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (75) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (77) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (75) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (163)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (162)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (163 -> 162)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (163) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (162) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (165)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (164)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (165 -> 164)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (165) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (164) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (79) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (78) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (81) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (80) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (83) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (82) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (167)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (166)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (167 -> 166)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (167) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (166) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (168) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (168 -> 167)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 168)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (101 -> 100)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (103 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (108 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (119 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (132 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (138 -> 104)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (138 -> 105)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (138 -> 106)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (138 -> 107)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (142 -> 109)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (142 -> 110)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (142 -> 111)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (142 -> 112)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (142 -> 113)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (142 -> 114)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (142 -> 115)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (142 -> 116)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (142 -> 117)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (142 -> 118)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 120)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 121)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 122)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 123)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 124)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 125)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 126)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 127)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 128)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 129)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 130)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (144 -> 131)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (147 -> 133)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (147 -> 134)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (147 -> 135)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (147 -> 136)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (147 -> 137)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (149 -> 139)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (149 -> 140)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (149 -> 141)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (153 -> 143)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 145)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 146)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (158 -> 148)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (160 -> 154)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (160 -> 156)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (160 -> 157)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (160 -> 159)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (160 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (160 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (160 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (160 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (160 -> 71)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (160 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (162 -> 161)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (164 -> 161)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (166 -> 161)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (28 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (28 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (28 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (28 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (30 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (32 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (32 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 88)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (37 -> 95)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (41 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (41 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (47 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (47 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (56 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (56 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (56 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 45)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (60 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (60 -> 49)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (60 -> 50)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (60 -> 51)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (60 -> 52)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (63 -> 54)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (63 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (66 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (68 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (70 -> 61)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (70 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (73 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (73 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (73 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (73 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (73 -> 71)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (73 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (75 -> 161)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (75 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (78 -> 161)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (78 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (78 -> 90)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (78 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (80 -> 161)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (80 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 161)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (82 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (87 -> 86)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (92 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (94 -> 93)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (96 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (99 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (99 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (99 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (99 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (99 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (99 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (99 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (99 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (13) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (15) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (13 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (20 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (21) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (19 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (23 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (24) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (22 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (26 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (25) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (27) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (25 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (29 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (28) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (30) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (28 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (32 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (33) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (31 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (35)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (35 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (35) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (35) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (35) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (35) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (35) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (37)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (37 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (36) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (36) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (36) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (36) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (36) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (39 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (38) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (38) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (41 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (41) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (42 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (42) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (43 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (43) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (44)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (44 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (44) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (45)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (45 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (45) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (46 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (46) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (47 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (47) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (49)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (49 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (49) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (48) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (50)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (50 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (50) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (48) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (51 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (51) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (48) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (52)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (52 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (52) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (48) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (54)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (54 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (54) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (55)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (56 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (56) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (55) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (57)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (57 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (55) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (59)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (59 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (59) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (61)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (61 -> 60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (60) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (63)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (63 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (63) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (62) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (64 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (64) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (62) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (66)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (65)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (66 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (66) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (65) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (68)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (67)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (68 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (68) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (67) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (70)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (69)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (70 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (70) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (69) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (70) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (69) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (70) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (69) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (72)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (71)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (72 -> 71)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (71) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (73 -> 71)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (71) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (74)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (75 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (74) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (77)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (76)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (77 -> 76)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (77) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (76) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (78) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (78 -> 77)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 78)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (33) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (31 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (80)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (79)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (80 -> 79)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (80) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (79) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (82)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (81)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (82 -> 81)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (82) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (81) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (54) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (60) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (68) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (67) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (84)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (83)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (84 -> 83)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (84) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (83) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (77) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (76) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (85) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (85 -> 77)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 85)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (33) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (31 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (87)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (86)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (87 -> 86)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (87) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (86) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (89)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (88)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (89 -> 88)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (89) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (88) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (54) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (60) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (68) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (67) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (91)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (90)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (91 -> 90)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (91) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (90) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (77) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (76) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (92) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (92 -> 77)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 92)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (13) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (15) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (13 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (16) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (18) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (16 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (19) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (21) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (19 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (24) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (22 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (25) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (27) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (25 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (33) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (31 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (94)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (93)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (94 -> 93)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (96)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (95)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (96 -> 95)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (98)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (98 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (98) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (99)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (99 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (100)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (100 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (101)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (101 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (102)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (102 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (102) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (103)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (103 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (103) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (104)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (104 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (104) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (105)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (105 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (105) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (106)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (106 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (106) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (107)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (107 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (107) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (108)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (108 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (108) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (109)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (109 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (109) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (110)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (110 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (110) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (112)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (111)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (112 -> 111)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (112) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (111) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (113)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (113 -> 111)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (113) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (111) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (115)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (114)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (115 -> 114)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (115) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (114) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (116)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (116 -> 114)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (116) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (114) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (41) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (42) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (43) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (44) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (45) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (118)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (117)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (118 -> 117)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (118) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (117) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (119)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (119 -> 117)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (119) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (117) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (120)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (120 -> 117)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (120) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (117) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (121)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (121 -> 117)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (121) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (117) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (122)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (122 -> 117)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (122) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (117) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (123)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (123 -> 117)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (123) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (117) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (124)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (124 -> 117)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (124) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (117) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (126)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (125)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (126 -> 125)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (126) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (125) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (128)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (127)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (128 -> 127)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (128) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (127) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (129)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (129 -> 127)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (129) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (127) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (130)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (130 -> 127)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (130) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (127) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (132)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (131)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (132 -> 131)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (132) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (131) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (133)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (133 -> 131)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (133) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (131) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (134)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (134 -> 131)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (134) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (131) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (136)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (135)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (136 -> 135)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (136) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (135) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (138)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (137)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (138 -> 137)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (138) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (137) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (140)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (139)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (140 -> 139)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (140) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (139) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (142)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (141)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (142 -> 141)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (142) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (141) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (143)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (143 -> 141)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (143) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (141) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (144)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (144 -> 141)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (144) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (141) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (146)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (145)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (146 -> 145)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (146) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (145) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (147)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (147 -> 145)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (147) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (145) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (148)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (148 -> 145)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (148) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (145) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (150)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (149)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (150 -> 149)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (150) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (149) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (63) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (152)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (151)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (152 -> 151)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (152) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (151) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (154)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (153)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (154 -> 153)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (154) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (153) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (68) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (67) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (156)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (155)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (156 -> 155)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (156) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (155) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (156) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (155) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (156) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (155) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (156) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (155) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (156) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (155) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (156) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (155) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (156) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (155) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (158)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (157)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (158 -> 157)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (158) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (157) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (160)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (159)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (160 -> 159)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (160) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (159) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (162)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (161)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (162 -> 161)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (162) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (161) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (164)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (163)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (164 -> 163)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (164) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (163) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (166)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (165)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (166 -> 165)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (166) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (165) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (77) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (76) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (167) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (167 -> 77)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 167)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (111 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (114 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (117 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (125 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 100)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 101)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 102)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 103)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 104)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 105)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 106)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 107)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 108)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 109)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 110)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 98)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (127 -> 99)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (131 -> 112)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (131 -> 113)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (135 -> 115)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (135 -> 116)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (137 -> 118)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (137 -> 119)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (137 -> 120)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (137 -> 121)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (137 -> 122)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (137 -> 123)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (137 -> 124)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (139 -> 126)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (141 -> 128)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (141 -> 129)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (141 -> 130)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (145 -> 132)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (145 -> 133)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (145 -> 134)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (149 -> 136)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (151 -> 138)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (153 -> 140)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 142)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 143)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 144)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 146)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 147)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 148)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 150)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 152)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 154)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 63)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (155 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (157 -> 156)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (159 -> 156)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (161 -> 156)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (163 -> 156)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (165 -> 156)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (36 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (38 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (48 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 82)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 89)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (55 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (55 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (55 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (55 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (55 -> 45)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (55 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (55 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 49)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 50)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 51)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 52)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (60 -> 54)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (62 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (62 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (65 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (67 -> 61)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 63)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 66)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (69 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (71 -> 156)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (71 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (74 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 156)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 84)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (76 -> 91)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (79 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (81 -> 80)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (83 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (86 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (88 -> 87)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (90 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (93 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (93 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (93 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (93 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (93 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (93 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (93 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (95 -> 94)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (97 -> 96)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (10) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (10 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (11) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (11 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (12) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (12 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (8) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (14)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (13) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (13) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (14) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (13) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (16 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (18)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (18 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (18) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (19 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (19) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (20 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (20) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (21)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (21 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (21) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (22 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (22) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (23 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (24)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (24 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (25 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (25) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (26 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (26) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (17) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (27)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (28 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (28) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (27) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (29 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (29) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (27) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (31 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (31) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (32 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (32) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (33 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (33) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (34 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (34) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (35 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (35) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (36 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (36) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (37 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (37) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (38 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (38) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (39 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (39) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (30) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (41 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (41) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (40) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (43 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (43) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (42) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (45)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (44)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (45 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (45) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (44) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (46)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (46 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (44) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (48 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (48) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (50)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (49)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (50 -> 49)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (50) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (49) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (52)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (52 -> 51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (51) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (53 -> 51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (51) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (55)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (54)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (55 -> 54)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (57)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (57 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (59)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (59 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (59) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (60 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 60)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (13 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (13 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (13 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (15 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (27 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (30 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (42 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (42 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (47 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (49 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (51 -> 45)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (51 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (54 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (54 -> 50)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (56 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (58 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (14) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (13) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (15) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (13 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (17) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (16) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (17) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (16) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (19 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (18) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (19) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (18) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (21 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (20) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (23 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (23) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (24)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (24 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (24) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (25 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (25) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (22) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (27)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (27 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (27) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (26) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (28 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (28) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (26) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (30 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (30) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (31 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (31) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (29) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (32)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (33 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (33) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (32) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (35 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (36 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (34) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (37) [Chain ID] HLT_e5_lhvloose_nod0 ID#4084356060
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (37 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (39 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (38) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (40) [Chain ID] HLT_e26_lhtight_nod0 ID#2236040290
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (40 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (42 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (41) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (43) [Chain ID] HLT_e28_lhtight_nod0 ID#187495958
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (43 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (5) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (4) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (6) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (4 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (8) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (7) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (9) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (7 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (11) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (10) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (12) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (10 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (45)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (44)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (45 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (45) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (44) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (45) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (44) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (45) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (44) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (47)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (46)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (47 -> 46)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (47) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (46) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (49)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (49 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (49) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (48) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (50)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (50 -> 48)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (50) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (48) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (52)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (52 -> 51)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (52) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (51) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (54)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (54 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (54) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (55)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (55 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (55) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (56)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (56 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (56) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (57)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (57 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (57) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (58)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (58 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (58) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (59)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (59 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (59) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (60)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (60 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (60) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (61)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (61 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (61) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (62)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (62 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (62) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (63)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (63 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (63) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (64)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (64 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (64) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (65)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (65 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (65) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (66)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (66 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (66) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (67)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (67 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (67) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (68)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (68 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (68) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (69)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (69 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (69) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (70)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (70 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (70) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (71)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (71 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (71) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (72)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (72 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (72) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (73)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (73 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (73) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (74)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (74 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (74) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (75)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (75 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (75) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (76)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (76 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (76) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (77)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (77 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (77) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (78)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (78 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (78) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (79)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (79 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (79) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (80)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (80 -> 53)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (80) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (53) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (82)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (81)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (82 -> 81)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (82) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (81) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (84)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (84 -> 83)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (84) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (83) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (86)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (85)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (86 -> 85)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (86) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (85) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (88)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (87)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (88 -> 87)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (88) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (87) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (90)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (89)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (90 -> 89)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (90) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (89) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (92)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (91)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (92 -> 91)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (92) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (91) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (94)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (93)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (94 -> 93)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (94) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (93) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (96)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (95)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (96 -> 95)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (96) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (95) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (98)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (98 -> 97)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (98) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (97) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (100)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (99)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (100 -> 99)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (100) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (99) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (101) [Chain ID] HLT_e9_etcut ID#2951537560
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (101 -> 100)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 101)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (16 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (16 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (18 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (20 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (22 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (26 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (26 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (26 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (29 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (29 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (32 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (32 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (34 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (38 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (41 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (44 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (46 -> 45)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (48 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (51 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (53 -> 47)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (81 -> 49)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (81 -> 50)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (83 -> 52)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 54)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 55)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 56)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 57)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 58)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 59)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 60)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 61)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 62)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 63)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 64)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 65)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 66)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 67)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 68)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 69)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 70)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 71)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 72)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 73)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 74)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 75)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 76)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 77)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 78)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 79)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (85 -> 80)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (87 -> 82)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (89 -> 84)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (91 -> 86)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (93 -> 88)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (93 -> 90)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (93 -> 92)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (95 -> 94)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (97 -> 94)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (99 -> 94)
\ No newline at end of file
diff --git a/Trigger/TrigEvent/TrigNavTools/share/NavConverter_muon_chains_test.ref b/Trigger/TrigEvent/TrigNavTools/share/NavConverter_muon_chains_test.ref
new file mode 100644
index 000000000000..39280ba97ea7
--- /dev/null
+++ b/Trigger/TrigEvent/TrigNavTools/share/NavConverter_muon_chains_test.ref
@@ -0,0 +1,120 @@
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (5) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (4) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (7 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (7) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (6) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (9 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (9) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (8) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (11) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (10) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (13 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (14) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (10 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (4 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (6 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (5) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (4) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (7 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (7) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (6) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (9 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (9) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (8) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (11) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (10) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (13 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (14) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (10 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (4 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (6 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (5) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (4) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (7 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (7) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (6) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (9 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (9) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (8) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (11) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (10) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (13 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (14) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (10 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (4 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (6 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (8 -> 7)
\ No newline at end of file
diff --git a/Trigger/TrigEvent/TrigNavTools/share/NavConverter_muon_multichains_test.ref b/Trigger/TrigEvent/TrigNavTools/share/NavConverter_muon_multichains_test.ref
new file mode 100644
index 000000000000..e7803d3869ca
--- /dev/null
+++ b/Trigger/TrigEvent/TrigNavTools/share/NavConverter_muon_multichains_test.ref
@@ -0,0 +1,507 @@
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (5) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (4) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (7 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (7) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (6) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (9 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (9) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (8) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (11) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (10) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (13 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (14) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (16 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (18 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (18) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (17) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (20 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (20) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (19) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (22 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (22) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (21) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (23) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (23 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (24)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (25 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (25) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (24) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (27)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (27 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (27) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (26) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (29 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (29) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (28) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (31 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (31) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (30) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (32) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (32 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (25) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (24) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (25) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (24) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (34 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (34) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (33) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (35) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (35 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (37)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (37 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (37) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (36) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (39 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (39) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (38) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (41 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (41) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (40) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (43 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (43) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (42) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (44) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (44 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (10 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (15 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (19 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (21 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (24 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (26 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (28 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (30 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (33 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (36 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (38 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (4 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (42 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (6 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (5) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (4) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (7 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (7) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (6) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (9 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (9) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (8) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (11) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (10) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (13 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (14) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (16 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (18 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (18) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (17) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (20 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (20) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (19) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (22 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (22) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (21) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (23) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (23 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (24)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (25 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (25) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (24) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (27)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (27 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (27) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (26) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (29 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (29) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (28) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (31 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (31) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (30) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (32) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (32 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (25) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (24) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (25) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (24) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (34 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (34) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (33) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (35) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (35 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (37)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (37 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (37) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (36) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (39 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (39) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (38) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (41 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (41) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (40) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (43 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (43) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (42) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (44) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (44 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (10 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (15 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (19 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (21 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (24 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (26 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (28 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (30 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (33 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (36 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (38 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (4 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (42 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (6 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (8 -> 7)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (2)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (2 -> 1)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (5)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (5 -> 4)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (5) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (4) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (7)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (7 -> 6)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (7) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (6) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (9)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (9 -> 8)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (9) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (8) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (11)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (11 -> 10)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (11) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (10) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H creation] (13)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM creation] (12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H -> IM seed link] (13 -> 12)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (14) [Chain ID] HLT_mu22 ID#1380057117
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (14 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 14)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (16)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (16 -> 15)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (18)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (17)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (18 -> 17)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (18) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (17) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (20)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (20 -> 19)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (20) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (19) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (22)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (22 -> 21)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (22) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (21) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (23) [Chain ID] HLT_mu6 ID#1672162766
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (23 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 23)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (25)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (24)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (25 -> 24)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (25) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (24) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (27)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (26)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (27 -> 26)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (27) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (26) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (29)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (29 -> 28)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (29) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (28) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (31)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (30)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (31 -> 30)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (31) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (30) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (32) [Chain ID] HLT_mu4 ID#3019590550
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (32 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 32)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (16) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (15) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (25) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (24) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (25) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (24) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (34)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (34 -> 33)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (34) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (33) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (35) [Chain ID] HLT_mu6_2mu4 ID#421338277
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (35 -> 34)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 35)
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (2) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (1) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [L1 creation] (3) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM -> L1 seed link] (1 -> 3)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (37)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (36)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (37 -> 36)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (37) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (36) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (39)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (39 -> 38)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (39) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (38) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (41)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (40)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (41 -> 40)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (41) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (40) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H creation] (43)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM creation] (42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H -> IM seed link] (43 -> 42)
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [H Index] (43) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE featureless] [IM Index] (42) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [H Index] (13) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [TE feature] [IM Index] (12) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [SF creation] (44) [Chain ID] HLT_mu10 ID#89686459
+TrigNavCnv                                          DEBUG REGTEST [SF -> H seed link] (44 -> 13)
+TrigNavCnv                                          DEBUG REGTEST [RAW -> SF seed link] (0 -> 44)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (10 -> 9)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 11)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 22)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 31)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (12 -> 43)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (15 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (17 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (19 -> 18)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (21 -> 20)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (24 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (26 -> 25)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (28 -> 27)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (30 -> 29)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (33 -> 16)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (36 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (38 -> 37)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (4 -> 2)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (40 -> 39)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (42 -> 41)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (6 -> 5)
+TrigNavCnv                                          DEBUG REGTEST [IM -> H seed link] (8 -> 7)
\ No newline at end of file
diff --git a/Trigger/TrigEvent/TrigNavTools/share/navGraphDump.py b/Trigger/TrigEvent/TrigNavTools/share/navGraphDump.py
old mode 100644
new mode 100755
diff --git a/Trigger/TrigEvent/TrigNavTools/share/testTrigR2ToR3NavGraphConversion.py b/Trigger/TrigEvent/TrigNavTools/share/testTrigR2ToR3NavGraphConversion.py
index f5203912e9bd..8573af20d03d 100755
--- a/Trigger/TrigEvent/TrigNavTools/share/testTrigR2ToR3NavGraphConversion.py
+++ b/Trigger/TrigEvent/TrigNavTools/share/testTrigR2ToR3NavGraphConversion.py
@@ -16,17 +16,23 @@ if __name__=='__main__':
     Configurable.configurableRun3Behavior = 1
 
     # Set the Athena configuration flags
+    from AthenaCommon.Constants import WARNING
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    parser = ConfigFlags.getArgumentParser()
-    args = parser.parse_args()
 
-    #test input file: --filesInput='/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/q221/21.0/myAOD.pool.root'
+    ###test input file: --filesInput='/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/q221/21.0/myAOD.pool.root'
 
     # Set the Athena configuration flags
-    ConfigFlags.fillFromArgs()
+    ConfigFlags.Input.Files=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/q221/21.0/myAOD.pool.root"]
     ConfigFlags.Output.AODFileName = "outAOD.pool.root"
     ConfigFlags.Detector.GeometryLAr=True
     ConfigFlags.Detector.GeometryTile=True
+    # useful examples: test units based on them
+    #ConfigFlags.addFlag("TestNavConversion.Chains",["HLT_mu4"])
+    #ConfigFlags.addFlag("TestNavConversion.Chains",["HLT_mu4","HLT_mu6","HLT_mu10","HLT_mu6_2mu4","HLT_mu22"])
+    ConfigFlags.addFlag("TestNavConversion.Chains",["HLT_e5_lhvloose_nod0","HLT_e9_etcut","HLT_e26_lhtight_nod0","HLT_e28_lhtight_nod0"])
+    #ConfigFlags.addFlag("TestNavConversion.Collections",["xAOD::MuonContainer","xAOD::L2StandAloneMuonContainer","xAOD::TrigMissingET","xAOD::JetContainer"])
+    ConfigFlags.addFlag("TestNavConversion.Collections",["xAOD::ElectronContainer","xAOD::TrigEMClusterContainer","xAOD::TrigEMCluster","xAOD::TrigElectron","xAOD::TrigElectronContainer","xAOD::CaloCluster","xAOD::CaloClusterContainer"])
+    ConfigFlags.fillFromArgs()
     ConfigFlags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
@@ -46,13 +52,11 @@ if __name__=='__main__':
     from AthenaCommon.Constants import DEBUG
     alg = CompFactory.Run2ToRun3TrigNavConverter("TrigNavCnv", OutputLevel=DEBUG, TrigConfigSvc=confSvc)
     alg.doPrint = False
-    #alg.Collections = ["xAOD::MuonContainer","xAOD::L2StandAloneMuonContainer"]
-    alg.Collections = ["xAOD::ElectronContainer","xAOD::TrigEMClusterContainer","xAOD::TrigEMCluster","xAOD::TrigElectron","xAOD::TrigElectronContainer","xAOD::CaloCluster","xAOD::CaloClusterContainer"]
     
-    # EXAMPLES OF CHAINS 
-    #alg.Chains = ["HLT_mu4"]
-    alg.Chains = ["HLT_e5_lhvloose_nod0","HLT_e9_etcut","HLT_e26_lhtight_nod0","HLT_e28_lhtight_nod0"]
-    alg.Rois = ["forID","forID1","forID2","forMS","forSA","forTB","forMT","forCB"]
+    alg.Chains = ConfigFlags.TestNavConversion.Chains
+    alg.Collections = ConfigFlags.TestNavConversion.Collections
+    
+    alg.Rois = ["initialRoI","forID","forID1","forID2","forMS","forSA","forTB","forMT","forCB"]
 
     cfg.addEventAlgo(alg, sequenceName="AthAlgSeq")
     from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
@@ -76,5 +80,5 @@ if __name__=='__main__':
     cfg.merge(TileGMCfg(ConfigFlags))
 
     cfg.printConfig(withDetails=True, summariseProps=False) # set True for exhaustive info
-    sc = cfg.run(args.evtMax, args.loglevel)
+    sc = cfg.run(ConfigFlags.Exec.MaxEvents, ConfigFlags.Exec.OutputLevel)
     sys.exit(0 if sc.isSuccess() else 1)
diff --git a/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx b/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx
index a454e27798b5..75f1e62069a2 100644
--- a/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx
+++ b/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx
@@ -7,6 +7,11 @@
 #include "TrigConfHLTData/HLTSignature.h"
 #include "TrigConfHLTData/HLTTriggerElement.h"
 #include "TrigNavStructure/TriggerElement.h"
+#include "xAODTrigger/TriggerMenu.h"
+#include "xAODTrigger/TriggerMenuContainer.h"
+#include "TrigConfHLTData/HLTUtils.h"
+#include "AthAnalysisBaseComps/AthAnalysisAlgorithm.h"
+#include <AsgTools/AsgMetadataTool.h>
 #include "TrigNavStructure/StandaloneNavigation.h"
 #include "xAODTracking/TrackParticleContainerFwd.h"
 #include "xAODTracking/versions/TrackParticle_v1.h"
@@ -14,6 +19,7 @@
 #include <functional>
 #include <random>
 
+
 Run2ToRun3TrigNavConverter::Run2ToRun3TrigNavConverter(const std::string &name, ISvcLocator *pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator)
 {
 }
@@ -89,6 +95,18 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
   }
   const HLT::TrigNavStructure& navDecoder = *navDecoderPtr;
 
+
+  // string identifier for TE
+  std::map< int, std::string > hash2string;
+  for (auto p : m_configSvc->chains()) { 
+    for (auto s_iter = p->signatures().begin(); s_iter != p->signatures().end(); ++s_iter) { 
+      for (auto te : (*s_iter)->outputTEs()) { 
+          int hash = TrigConf::HLTUtils::string2hash( te->name() );
+          hash2string[ hash ] = te->name();
+      }
+    }
+  } 
+
   if (m_onlyFeaturePriting)
     return printFeatures(navDecoder);
 
@@ -103,6 +121,10 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
     ATH_MSG_INFO(dump);
   }
 
+  // auxiliary random objects
+  std::random_device rd;
+  std::mt19937_64 gen(rd());
+  std::uniform_int_distribution<uint32_t> dis;
 
   std::vector<HLT::TriggerElement *> tes;
   TE_Decision_map mapTEtoDecision;                          // TE - Decision (xAOD::TrigComposite)
@@ -110,16 +132,13 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
   std::vector<TrigCompositeUtils::Decision *> decisionLast; // storing "last" decision in a chain
 
   DecisionObjMap decisionObj;
-  DecisionObjMap decisionObjFeatureless;
+  DecisionObjStringMap decisionObjFeatureless;
   L1ObjMap l1Obj;
-  TEObjMap teObj;
-  FElessObjMap feObj; // this is only for FEless H nodes -> pair(IM node, TEptr)
-  TEMap teMap;        // TEptr - bool, true if FE
-
+  
   std::vector<HLT::TriggerElement::FeatureAccessHelper> featureRoI; // for keeping predecessing TE with RoI
 
   // @@@@@@@@@@@@@@@@@@@@@@@@@@ getDecisionObject @@@@@@@@@@@@@@@@@@@@@@@@@@
-  auto getDecisionObject = [&](const HLT::TriggerElement::FeatureAccessHelper &elemFE, size_t idx, TrigCompositeUtils::DecisionContainer *dOutput, size_t &kIn) {
+  auto getDecisionObject = [&](const HLT::TriggerElement::FeatureAccessHelper &elemFE, size_t idx, TrigCompositeUtils::DecisionContainer *dOutput, size_t &kIn, HLT::TriggerElement* ptrTE = nullptr) {
   // kIn: flag with the information about the decision objects (DO)
   // 0: DO pair has been found and returned (no new pair created)
   // 1: H node created for a feature unit from collection, IM retrieved (not created)
@@ -131,21 +150,31 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
       kIn = 0;
       return it->second;
     }
-    kIn = 2;
 
+    kIn = 2;
     if (idx == elemFE.getIndex().objectsBegin())
     {
-      auto d1 = TrigCompositeUtils::newDecisionIn(dOutput);
-      d1->setName(TrigCompositeUtils::hypoAlgNodeName());
-      auto d2 = TrigCompositeUtils::newDecisionIn(dOutput);
+      auto d2 = TrigCompositeUtils::newDecisionIn(dOutput); // IM
       d2->setName(TrigCompositeUtils::inputMakerNodeName());
+      auto d1 = TrigCompositeUtils::newDecisionIn(dOutput); // H
+      d1->setName(TrigCompositeUtils::hypoAlgNodeName());
+      TrigCompositeUtils::linkToPrevious(d1, d2, context); // H low IM up
+      ATH_MSG_DEBUG("TE FE link creator H lower IM upper = " << ptrTE << " " << d1 << " " << d2);
+      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H creation] " << "(" << d1->index() << ")");
+      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[IM creation] " << "(" << d2->index() << ")");
+      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H -> IM seed link] " << "(" << d1->index() << " -> " << d2->index() << ")");
       return std::make_pair(d1, d2);
     }
 
     kIn = 1;
-    auto d1 = TrigCompositeUtils::newDecisionIn(dOutput);
+    auto d1 = TrigCompositeUtils::newDecisionIn(dOutput); // H
     d1->setName(TrigCompositeUtils::hypoAlgNodeName());
-    return std::make_pair(d1, (decisionObj.find(sgKey + elemFE.getIndex().objectsBegin())->second).second);
+    auto d2 = (decisionObj.find(sgKey + elemFE.getIndex().objectsBegin())->second).second;
+    ATH_MSG_DEBUG("TE FE link creator H lower IM upper = " << ptrTE << " " << d1 << " " << d2);
+    TrigCompositeUtils::linkToPrevious(d1, d2, context); // H low IM up
+    ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H creation] " << "(" << d1->index() << ")");
+    ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H -> IM seed link] " << "(" << d1->index() << " -> " << d2->index() << ")");
+    return std::make_pair(d1, d2);
   };
 
   // @@@@@@@@@@@@@@@@@@@@@@@@@@ getL1Object @@@@@@@@@@@@@@@@@@@@@@@@@@
@@ -157,8 +186,8 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
       kIn = 0;
       return it->second;
     }
-    kIn = 1;
 
+    kIn = 1;
     auto d1 = TrigCompositeUtils::newDecisionIn(dOutput);
     d1->setName(TrigCompositeUtils::hltSeedingNodeName());
     return d1;
@@ -180,17 +209,24 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
         std::map<std::string, HLT::TriggerElement::FeatureAccessHelper, decltype(ordered_sorter)> mp(ordered_sorter);
         // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
+      ATH_MSG_DEBUG(" CHAIN name " << chainName);
+      bool kTErejection { false };
       for (auto s_iter = c->signatures().begin(), first_s_iter = s_iter; s_iter != c->signatures().end(); ++s_iter)
       {
-
+        if (kTErejection) break;
         std::vector<TrigCompositeUtils::Decision *> tempDecisionVector;
-
         for (auto te : (*s_iter)->outputTEs())
         {
           tes.clear();
           navDecoder.getAllOfType(te->id(), tes, false);
-          if (tes.empty() == false)
+          ATH_MSG_DEBUG(" TE size " << tes.size());
+          if (tes.size()==0) {
+            kTErejection = true;
+            break;
+          }
+          if (tes.empty() == false) {
             decisionLast.clear();
+          }
 
           for (auto teptr : tes)
           {
@@ -207,7 +243,7 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
             std::function<void(HLT::TriggerElement*)> roiFinder = [&](HLT::TriggerElement* ptrTE) {
                 auto vecTEpred = navDecoder.getDirectPredecessors(ptrTE);
                 if (vecTEpred.empty()) {
-                  return;
+                  return nullptr;
                 } else {
                   for (auto pred : vecTEpred) { // vector predecessors TE
                     auto vectorTEROIfeatures_ptr = getTEROIfeatures( pred, navDecoder );
@@ -222,24 +258,23 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
                     }
                   }
                 }
-                return; 
+                return nullptr; 
             };
 
             // @@@@@@@@@@@@@@@@@@@@@@@@@@ featureFinder @@@@@@@@@@@@@@@@@@@@@@@@@@
             std::function<uint32_t(HLT::TriggerElement*,uint32_t&)> featureFinder = [&](HLT::TriggerElement* ptrTE, uint32_t& deepLvl) {
-                auto  vecTEpred = navDecoder.getDirectPredecessors(ptrTE);
-                if (vecTEpred.empty()) // no TE predecessor, no FE at all                    
-                { 
-                  return (uint32_t)0;
-                } else {
+                auto vecTEpred = navDecoder.getDirectPredecessors(ptrTE);
+                if (vecTEpred.empty()==false)                     
+                {
                   for (auto pred : vecTEpred) { // vector predecessors TE
-                    auto vectorTEfeatures_ptr = getTEfeatures( pred, navDecoder );
+                    auto vectorTEfeatures_ptr = getTEfeatures( pred, navDecoder, false ); // any feature collection
                     if (vectorTEfeatures_ptr.size()==1 && (vectorTEfeatures_ptr.front().getIndex().objectsBegin()==vectorTEfeatures_ptr.front().getIndex().objectsEnd())) {
-                      break; // this is empty FE, treat it is as zero FE
+                    //if (vectorTEfeatures_ptr.front().getIndex().objectsBegin()==vectorTEfeatures_ptr.front().getIndex().objectsEnd()) {
+                       break; // this is empty FE, treat it is as zero FE
                     }
                     if (vectorTEfeatures_ptr.empty()==false) 
                     {
-                      auto featureBegin = 1000*vectorTEfeatures_ptr.front().getIndex().objectsBegin();
+                      auto featureBegin = 10000*vectorTEfeatures_ptr.front().getIndex().objectsBegin();
                       auto [sgKey, sgCLID, sgName] = getSgKey(navDecoder,vectorTEfeatures_ptr.front());
                       return sgKey+featureBegin+deepLvl; // first found 
                     } 
@@ -252,29 +287,43 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
                     if (keySearch != 0) return keySearch; // first found
                   }
                 }
-                return (uint32_t)0; 
+                return (uint32_t)0; // no TE predecessor, no FE at all or recursive search failed
             };
 
             // @@@@@@@@@@@@@@@@@@@@@@@@@@ getTEObject @@@@@@@@@@@@@@@@@@@@@@@@@@
-            auto getTEObject = [&](HLT::TriggerElement* ptrTE, uint32_t& deepLevel, TrigCompositeUtils::DecisionContainer *dOutput) {
+            auto getTEObject = [&](HLT::TriggerElement* ptrTE, uint32_t& deepLevel, TrigCompositeUtils::DecisionContainer *dOutput) -> DecisionPair& {
                 // this is featureless case
+                std::string teName = hash2string[ ptrTE->getId() ];
+                if (teName != "") {
+                  auto it = decisionObjFeatureless.find(teName);
+                  if (it != decisionObjFeatureless.end()) return it->second;
+                }
+
+                deepLevel = 0; // at this moment obsolte, but see below
+/*
+                // THIS BLOCK is left intetionally here as an alternative approach.
+
                 uint32_t sgKeyProxy = featureFinder(ptrTE,deepLevel);
                 if (sgKeyProxy != 0) {
                   auto it = decisionObjFeatureless.find(sgKeyProxy);
                   if (it != decisionObjFeatureless.end()) return it->second;
                 }
-                
-                auto d1 = TrigCompositeUtils::newDecisionIn(dOutput);
-                d1->setName(TrigCompositeUtils::hypoAlgNodeName());
-                auto d2 = TrigCompositeUtils::newDecisionIn(dOutput);
-                d2->setName(TrigCompositeUtils::inputMakerNodeName());
-                if (sgKeyProxy==0) { // let us random it
-                  std::random_device rd;
-                  std::mt19937_64 gen(rd());
-                  std::uniform_int_distribution<uint32_t> dis;
-                  sgKeyProxy = 1000000 + dis(gen);
+                if (sgKeyProxy==0) {
+                  ATH_MSG_DEBUG("ZERO sgKeyProxy");
+                  sgKeyProxy = 1000000 + dis(gen); // let us random it
                 }
-                return decisionObjFeatureless[sgKeyProxy] = std::make_pair(d1, d2);
+*/
+                auto d2 = TrigCompositeUtils::newDecisionIn(dOutput); // IM
+                d2->setName(TrigCompositeUtils::inputMakerNodeName());
+                auto d1 = TrigCompositeUtils::newDecisionIn(dOutput); // H
+                d1->setName(TrigCompositeUtils::hypoAlgNodeName());
+                TrigCompositeUtils::linkToPrevious(d1, d2, context);
+                ATH_MSG_DEBUG("TE link creator H lower IM upper = " << ptrTE << " " << d1 << " " << d2);
+                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[H creation] " << "(" << d1->index() << ")");
+                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[IM creation] " << "(" << d2->index() << ")");
+                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[H -> IM seed link] " << "(" << d1->index() << " -> " << d2->index() << ")");
+                //return decisionObjFeatureless[sgKeyProxy] = std::make_pair(d1, d2); // intentionally left, see above
+                return decisionObjFeatureless[teName] = std::make_pair(d1, d2);
             };
 
 
@@ -288,24 +337,34 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
 
             // @@@@@@@@@@@@@@@@@@@@@@@@@@ vector TE - EMPTY @@@@@@@@@@@@@@@@@@@@@@@@@@
             if ( vectorTEfeatures_ptr.empty() || 
-               ( vectorTEfeatures_ptr.size() == 1 && 
+               ( /*vectorTEfeatures_ptr.size() == 1 && */ // alternative check
                  (vectorTEfeatures_ptr[0].getIndex().objectsBegin() == vectorTEfeatures_ptr[0].getIndex().objectsEnd()) )
                ) 
             {
 
 
-              uint32_t dLevel { 0 };
-              auto [ decisionFeature, decisionPtr ] = getTEObject(teptr,dLevel,decisionOutput);
-              auto decision = decisionPtr;
+              uint32_t dLevel { 1 };
+              auto [ decisionFeature, decisionPtr ] = getTEObject(teptr,dLevel,decisionOutput); // H IM
+              ATH_MSG_DEBUG("JUST AFTER " << "[TE] " << teptr <<  " [H] " << decisionFeature->index() << " [IM] " << decisionPtr->index() << " dLevel=" << dLevel);
+              auto decision = decisionPtr; // IM
 
               tempDecisionVector.push_back(decisionFeature);
 
-              if (teptr->getActiveState())
-                TrigCompositeUtils::addDecisionID(chainId, decisionFeature);
+              if (teptr->getActiveState()) {
+                TrigCompositeUtils::addDecisionID(chainId, decisionFeature); // H
+                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[H Index] (" << decisionFeature->index() << ") [Chain ID] " << chainId);
+              }
+              TrigCompositeUtils::addDecisionID(chainId, decision); // IM
+              ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[IM Index] (" << decision->index() << ") [Chain ID] " << chainId);
+              
               ElementLink<xAOD::TrigCompositeContainer> linkToSelf = TrigCompositeUtils::decisionToElementLink(decisionFeature, context);
               decisionFeature->setObjectLink<xAOD::TrigCompositeContainer>(TrigCompositeUtils::featureString(), linkToSelf);
-              mapTEtoDecision[teptr].push_back(decisionFeature);
-              TrigCompositeUtils::addDecisionID(chainId, decision);
+              if ( std::find(begin(mapTEtoDecision[teptr]),end(mapTEtoDecision[teptr]),decisionFeature) == mapTEtoDecision[teptr].end() ) {
+                mapTEtoDecision[teptr].push_back(decisionFeature); // H
+              }
+              if ( std::find(begin(mapTEtoDecisionActive[teptr]),end(mapTEtoDecisionActive[teptr]),decision) == mapTEtoDecisionActive[teptr].end() ) {
+                mapTEtoDecisionActive[teptr].push_back(decision); // IM
+              }
 
               TrigCompositeUtils::Decision *l1_decision{nullptr};
               if (s_iter == first_s_iter)
@@ -314,6 +373,8 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
                 l1_decision->setName(TrigCompositeUtils::hltSeedingNodeName());
                 TrigCompositeUtils::addDecisionID(chainId, l1_decision);
                 TrigCompositeUtils::linkToPrevious(decision, l1_decision, context);
+                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[L1 creation] " << "(" << l1_decision->index() << ") [Chain ID] " << chainId);
+                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[IM -> L1 seed link] " << "(" << decision->index() << " -> " << l1_decision->index() << ")");
               }
 
 
@@ -321,12 +382,12 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
                 ATH_CHECK(addTEROIfeatures(navDecoder, (mp.begin())->second, decision)); 
               }
 
-
               for (const auto &rNodes : HLT::TrigNavStructure::getRoINodes(teptr))
               {
                 if (HLT::TrigNavStructure::isRoINode(rNodes))
                 {
-                  auto vectorROIfeatures_ptr = getROIfeatures(rNodes, navDecoder);
+                  //////////////////auto vectorROIfeatures_ptr = getROIfeatures(rNodes, navDecoder);
+                  auto vectorROIfeatures_ptr = getTEROIfeatures(rNodes, navDecoder);
                   for (auto featureRoI : vectorROIfeatures_ptr)
                   {
                     if (mp.empty()) {
@@ -334,13 +395,12 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
                     }
                   }
 
-                  // ### TRACKS ### check for track features and connect the same RoI
+                  //### TRACKS ### check for track features and connect the same RoI
                   if (!vectorROIfeatures_ptr.empty())
                     for (const auto &elemTRACK : vectorTRACKfeatures_ptr)
                     {
                       for (size_t i{elemTRACK.getIndex().objectsBegin()}; i < elemTRACK.getIndex().objectsEnd(); ++i)
                       {
-
                         ElementLink<TrigRoiDescriptorCollection> ROIElementLink = decision->objectLink<TrigRoiDescriptorCollection>(TrigCompositeUtils::roiString());
                         if (ROIElementLink.isValid())
                         {
@@ -350,16 +410,14 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
                     }
                 }
               }
-
-              for (const auto &p : tempDecisionVector)
-              {
-                TrigCompositeUtils::linkToPrevious(p, decision, context);
-              }
-
-              mapTEtoDecisionActive[teptr].push_back(decision);
             }
 
 
+           // @@@@@@@@@@@@@@@@@@@@@@@@@@ vector TE - FULL @@@@@@@@@@@@@@@@@@@@@@@@@@
+            if ( vectorTEfeatures_ptr.empty()==false &&
+                 vectorTEfeatures_ptr[0].getIndex().objectsBegin() < vectorTEfeatures_ptr[0].getIndex().objectsEnd() )
+            {
+
             for (const auto &elemFE : vectorTEfeatures_ptr)
             {
               TrigCompositeUtils::Decision *decision{nullptr};
@@ -367,33 +425,43 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
               for (size_t i{elemFE.getIndex().objectsBegin()}; i < elemFE.getIndex().objectsEnd(); ++i)
               {
                 size_t kInsert{0};
-                auto [decisionFeature, decisionPtr] = getDecisionObject(elemFE, i, decisionOutput, kInsert);
-                decision = decisionPtr;
+                auto [decisionFeature, decisionPtr] = getDecisionObject(elemFE, i, decisionOutput, kInsert, teptr); // H IM
+                decision = decisionPtr; // IM
 
                 if (mp.empty() == false) {
                       ATH_CHECK(addTEROIfeatures(navDecoder, (mp.begin())->second, decision)); // updated roi on the way
                 }
 
 
-                if (teptr->getActiveState()) TrigCompositeUtils::addDecisionID(chainId, decisionFeature);
-                TrigCompositeUtils::addDecisionID(chainId, decision);
-                TrigCompositeUtils::linkToPrevious(decisionFeature, decision, context);
+                if (teptr->getActiveState()) {
+                  TrigCompositeUtils::addDecisionID(chainId, decisionFeature); // H
+                  ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H Index] (" << decisionFeature->index() << ") [Chain ID] " << chainId);
+                }
+                TrigCompositeUtils::addDecisionID(chainId, decision); // IM
+                ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[IM Index] (" << decision->index() << ") [Chain ID] " << chainId);
+
 
                 tempDecisionVector.push_back(decisionFeature);
+
                 if (kInsert)
                 {
                   auto mp = std::make_pair(decisionFeature, decision);
                   ATH_CHECK(addTEfeatures(navDecoder, elemFE, mp, i, &decisionObj));
                 }
-                mapTEtoDecision[teptr].push_back(decisionFeature);
-                mapTEtoDecisionActive[teptr].push_back(decision);
+                if ( std::find(begin(mapTEtoDecision[teptr]),end(mapTEtoDecision[teptr]),decisionFeature) == mapTEtoDecision[teptr].end() ) {
+                  mapTEtoDecision[teptr].push_back(decisionFeature); // H
+                }
+                if ( std::find(begin(mapTEtoDecisionActive[teptr]),end(mapTEtoDecisionActive[teptr]),decision) == mapTEtoDecisionActive[teptr].end() ) {
+                  mapTEtoDecisionActive[teptr].push_back(decision); // IM
+                }
               }
 
               for (const auto &rNodes : HLT::TrigNavStructure::getRoINodes(teptr))
               {
                 if (HLT::TrigNavStructure::isRoINode(rNodes))
                 {
-                  auto vectorROIfeatures_ptr = getROIfeatures(rNodes,navDecoder);
+                  ///////////////auto vectorROIfeatures_ptr = getROIfeatures(rNodes,navDecoder);
+                  auto vectorROIfeatures_ptr = getTEROIfeatures(rNodes,navDecoder);
                   for (auto featureRoI : vectorROIfeatures_ptr)
                   {
                     if (s_iter == first_s_iter)
@@ -410,6 +478,8 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
                         ATH_CHECK(addTEROIfeatures(navDecoder, featureRoI, decision)); // roi link to initialRoi
                       }
                       TrigCompositeUtils::linkToPrevious(decision, l1_decision, context);
+                      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[L1 creation] " << "(" << l1_decision->index() << ") [Chain ID] " << chainId);
+                      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[IM -> L1 seed link] " << "(" << decision->index() << " -> " << l1_decision->index() << ")");
                     }
                     else
                     {
@@ -419,7 +489,7 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
                       }
                     }
                   }
-                  // ### TRACKS ### check for track features and connect the same RoI
+                  //### TRACKS ### check for track features and connect the same RoI
                   if (!vectorROIfeatures_ptr.empty())
                   for (const auto &elemTRACK : vectorTRACKfeatures_ptr)
                   {
@@ -437,47 +507,89 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
                 }
               }
             }
+            } // eof if - TE full
 
             decisionLast.insert(decisionLast.end(), tempDecisionVector.begin(), tempDecisionVector.end());
           }
         }
       }
 
-      for (auto &[teptr, decisions] : mapTEtoDecisionActive)
-      { // loop over all IM nodes
+      //std::set<TrigCompositeUtils::Decision *> decisionLastUnique(decisionLast.begin(), decisionLast.end());
+      //decisionLast.assign(decisionLastUnique.begin(), decisionLastUnique.end());
+
+      //for (const auto &last : decisionLast)
+      //{
+        if (decisionLast.empty()==false) {
+          auto last = decisionLast.back();
+          auto sf_decision = TrigCompositeUtils::newDecisionIn(decisionOutput);
+          sf_decision->setName("SF");
+          TrigCompositeUtils::addDecisionID(chainId, sf_decision);
+          TrigCompositeUtils::linkToPrevious(sf_decision, last, context);
+          TrigCompositeUtils::linkToPrevious(passRawOutput, sf_decision, context);
+          ATH_MSG_DEBUG("REGTEST " << "[SF creation] " << "(" << sf_decision->index() << ") [Chain ID] " << chainId);
+          ATH_MSG_DEBUG("REGTEST " << "[SF -> H seed link] " << "(" << sf_decision->index() << " -> " << last->index() << ")");
+          ATH_MSG_DEBUG("REGTEST " << "[RAW -> SF seed link] " << "(" << passRawOutput->index() << " -> " << sf_decision->index() << ")");
+        }
+      //}
+      
+      TrigCompositeUtils::decisionIDs(passRawOutput).push_back(chainId);
+    }
+  }
 
-        for (auto prep_ptr : navDecoder.getDirectPredecessors(teptr))
-        {
 
-          if (mapTEtoDecision.find(prep_ptr) != mapTEtoDecision.end())
-          {
-            for (auto d : decisions)
-            { // this is IM loop
+  for (auto &[teptr, decisions] : mapTEtoDecisionActive) {
+    if (decisions.size()==1) {
+      ATH_MSG_DEBUG("TE IMs = " << teptr << " IM Index=" << decisions[0]->index() << " " << decisions);
+    }
+    else {
+      ATH_MSG_DEBUG("TE IMs = " << teptr << " IM " << decisions);
+      for (const auto& p : decisions) ATH_MSG_DEBUG("TE IMs ... IM Index=" << p->index());
+    }
+  }
 
-              for (auto pd : mapTEtoDecision[prep_ptr])
-              { // this is H loop
-                TrigCompositeUtils::linkToPrevious(d, pd, context);
-              }
-            }
-          }
-        } // for (auto prep_ptr : navDecoder....
-      }
+  for (auto &[teptr, decisions] : mapTEtoDecision) {
+    if (decisions.size()==1) {
+      ATH_MSG_DEBUG("TE Hs = " << teptr << " H Index=" << decisions[0]->index() << " " << decisions);
+    }
+    else {
+      ATH_MSG_DEBUG("TE Hs = " << teptr << " H " << decisions);
+      for (const auto& p : decisions) ATH_MSG_DEBUG("TE Hs ... H Index=" << p->index());
+    }
+  }
 
-      std::set<TrigCompositeUtils::Decision *> decisionLastUnique(decisionLast.begin(), decisionLast.end());
-      decisionLast.assign(decisionLastUnique.begin(), decisionLastUnique.end());
+  for (auto &[teptr, decisions] : mapTEtoDecisionActive) {
+    for (auto prep_ptr : navDecoder.getDirectPredecessors(teptr)) {
+      ATH_MSG_DEBUG("TE predTE (from IM) = " << teptr << " " << prep_ptr);
+    }
+  }
 
-      for (const auto &last : decisionLast)
+  std::set<std::string> regtestSorted;
+  for (auto &[teptr, decisions] : mapTEtoDecisionActive)
+  { // loop over all IM nodes
+
+    for (auto prep_ptr : navDecoder.getDirectPredecessors(teptr))
+    {
+      if (teptr != prep_ptr)
+      if (mapTEtoDecision.find(prep_ptr) != mapTEtoDecision.end())
       {
-        auto sf_decision = TrigCompositeUtils::newDecisionIn(decisionOutput);
-        sf_decision->setName("SF");
-        TrigCompositeUtils::addDecisionID(chainId, sf_decision);
-        TrigCompositeUtils::linkToPrevious(sf_decision, last, context);
-        TrigCompositeUtils::linkToPrevious(passRawOutput, sf_decision, context);
+        for (auto& d : decisions)
+        { // this is IM loop
+          ATH_MSG_DEBUG("TE predTE linking pre = " << teptr << " " << prep_ptr << " " << d);
+          for (auto& pd : mapTEtoDecision[prep_ptr])
+          { // this is H loop
+            TrigCompositeUtils::linkToPrevious(d, pd, context);
+            ATH_MSG_DEBUG("TE predTE linking IM lower H upper = " << teptr << " " << prep_ptr << " " << d << " " << pd);
+            regtestSorted.insert("REGTEST [IM -> H seed link] (" + std::to_string(d->index()) + " -> " + std::to_string(pd->index()) + ")");
+          }
+        }
       }
-      TrigCompositeUtils::decisionIDs(passRawOutput).push_back(chainId);
-    }
+    } // for (auto prep_ptr : navDecoder....
+  }
+  for (const auto& p : regtestSorted) {
+    ATH_MSG_DEBUG(p);
   }
 
+
   return StatusCode::SUCCESS;
 }
 
@@ -486,6 +598,7 @@ std::tuple<uint32_t, CLID, std::string> Run2ToRun3TrigNavConverter::getSgKey(con
 {
   const std::string hltLabel = navigationDecoder.label(helper.getCLID(), helper.getIndex().subTypeIndex());
 
+
   const CLID saveCLID = [&](const CLID& clid) {
     if (clid == m_roIDescriptorCLID) return m_roIDescriptorCollectionCLID;
     if (clid == m_TrigEMClusterCLID) return m_TrigEMClusterContainerCLID;
@@ -508,6 +621,7 @@ std::tuple<uint32_t, CLID, std::string> Run2ToRun3TrigNavConverter::getSgKey(con
 
   const auto sgIntKey = evtStore()->stringToKey(sgStringKey, saveCLID);
 
+  ATH_MSG_DEBUG(" getSgKey: sgKey, sgCLID, sgName " << sgIntKey << " " <<  saveCLID << " " << hltLabel);
   return { sgIntKey, saveCLID, hltLabel }; // sgKey, sgCLID, sgName
 }
 
@@ -515,8 +629,10 @@ std::tuple<uint32_t, CLID, std::string> Run2ToRun3TrigNavConverter::getSgKey(con
 StatusCode Run2ToRun3TrigNavConverter::addTEROIfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper &helper, TrigCompositeUtils::Decision *&decisionPtr) const
 {
   auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder, helper);
-
-  decisionPtr->typelessSetObjectLink(TrigCompositeUtils::roiString(), sgKey, sgCLID, helper.getIndex().objectsBegin());
+  ATH_MSG_DEBUG("In addTEROIfeatures sgKey, sgCLID, sgName index-begin " << sgKey << " " <<  sgCLID << " " << sgName << " " << helper.getIndex().objectsBegin());
+  if (sgKey != 0) {
+    decisionPtr->typelessSetObjectLink(TrigCompositeUtils::roiString(), sgKey, sgCLID, helper.getIndex().objectsBegin());
+  }
 
   return StatusCode::SUCCESS;
 }
@@ -526,18 +642,20 @@ StatusCode Run2ToRun3TrigNavConverter::addROIfeatures(const HLT::TrigNavStructur
 {
   auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder, helper);
 
-  if (idx == -1)
-  {
-    if (om)
+  if (sgKey != 0) {
+    if (idx == -1)
     {
-      auto fHash = sgKey + helper.getIndex().objectsBegin();
-      (*om)[fHash] = decisionPtr;
+      if (om)
+      {
+        auto fHash = sgKey + helper.getIndex().objectsBegin();
+        (*om)[fHash] = decisionPtr;
+      }
+      decisionPtr->typelessSetObjectLink(TrigCompositeUtils::initialRoIString(), sgKey, sgCLID, helper.getIndex().objectsBegin());
+    }
+    else
+    {
+      decisionPtr->typelessSetObjectLink(TrigCompositeUtils::roiString(), sgKey, sgCLID, helper.getIndex().objectsBegin());
     }
-    decisionPtr->typelessSetObjectLink(TrigCompositeUtils::initialRoIString(), sgKey, sgCLID, helper.getIndex().objectsBegin());
-  }
-  else
-  {
-    decisionPtr->typelessSetObjectLink(TrigCompositeUtils::roiString(), sgKey, sgCLID, helper.getIndex().objectsBegin());
   }
 
   return StatusCode::SUCCESS;
@@ -548,22 +666,18 @@ StatusCode Run2ToRun3TrigNavConverter::addTRACKfeatures(const HLT::TrigNavStruct
 {
   SG::AuxElement::Decorator<ElementLink<TrigRoiDescriptorCollection>> viewBookkeeper("viewIndex");
   auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder, helper);
-
-  if (sgKey != 0)
+  ATH_MSG_DEBUG("sgKey, sgCLID, sgName " << sgKey << " " << sgCLID << " " << sgName);
+  if (decisionPtr != nullptr && sgCLID==1287425431) // CLASS_DEF( xAOD::TrackParticleContainer, 1287425431, 1 )
   {
     decisionPtr->typelessSetObjectLink("TEMP_TRACKS", sgKey, sgCLID, helper.getIndex().objectsBegin(), helper.getIndex().objectsEnd());
-    if (decisionPtr != nullptr)
+    ElementLinkVector<xAOD::TrackParticleContainer> tracks = decisionPtr->objectCollectionLinks<xAOD::TrackParticleContainer>("TEMP_TRACKS");
+    decisionPtr->removeObjectCollectionLinks("TEMP_TRACKS");
+    for (const ElementLink<xAOD::TrackParticleContainer> &track : tracks)
     {
-      ElementLinkVector<xAOD::TrackParticleContainer> tracks = decisionPtr->objectCollectionLinks<xAOD::TrackParticleContainer>("TEMP_TRACKS");
-
-      decisionPtr->removeObjectCollectionLinks("TEMP_TRACKS");
-      for (ElementLink<xAOD::TrackParticleContainer> track : tracks)
+      if (track.isValid())
       {
-        if (track.isValid())
-        {
-          const xAOD::TrackParticle *t = *track;
-          viewBookkeeper(*t) = rLink;
-        }
+        const xAOD::TrackParticle *t = *track;
+        viewBookkeeper(*t) = rLink;
       }
     }
   }
@@ -593,13 +707,13 @@ StatusCode Run2ToRun3TrigNavConverter::addTEfeatures(const HLT::TrigNavStructure
 }
 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ getTEfeatures @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavConverter::getTEfeatures(const HLT::TriggerElement *te_ptr, const HLT::TrigNavStructure &navigationDecoder) const
+const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavConverter::getTEfeatures(const HLT::TriggerElement *te_ptr, const HLT::TrigNavStructure &navigationDecoder, bool filterOnCLID) const
 {
   std::vector<HLT::TriggerElement::FeatureAccessHelper> ptrFAHelper;
   for (HLT::TriggerElement::FeatureAccessHelper helper : te_ptr->getFeatureAccessHelpers())
   {
     auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder, helper);
-    if (m_setCLID.find(helper.getCLID()) == m_setCLID.end())
+    if (filterOnCLID && m_setCLID.find(helper.getCLID()) == m_setCLID.end())
     {
       continue;
     }
@@ -622,12 +736,20 @@ const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavCon
   for (HLT::TriggerElement::FeatureAccessHelper helper : te_ptr->getFeatureAccessHelpers())
   {
     auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder,helper);
+    ATH_MSG_DEBUG(" getTEROIfeatures name " << sgName);
        if (std::find(m_setRoiName.begin(), m_setRoiName.end(), sgName) == m_setRoiName.end()) {
-        continue;
+       // do not filter continue;
+       continue;
        }
+       ATH_MSG_DEBUG(" getTEROIfeatures name accepted " << sgName);
       mp[sgName] = helper;
   }
 
+  for (const auto& p : mp) {
+    auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder,p.second);
+    ATH_MSG_DEBUG("CHECK getTEROIfeatures name accepted " << sgName);
+  }
+
   std::vector<HLT::TriggerElement::FeatureAccessHelper> ptrFAHelper;
   std::transform(cbegin(mp),cend(mp),back_inserter(ptrFAHelper),
   [](const std::map<std::string, HLT::TriggerElement::FeatureAccessHelper>::value_type& p ){return p.second;});
diff --git a/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.h b/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.h
index 918671b15966..cf40997e583e 100644
--- a/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.h
+++ b/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.h
@@ -61,18 +61,20 @@ private:
     std::set<std::string> m_setChainName;
     std::vector<std::string> m_setRoiName;
 
-    using DecisionObjMap = std::map<uint32_t,std::pair<TrigCompositeUtils::Decision*,TrigCompositeUtils::Decision*>>; // decisionFeature, decision
-    using TEObjMap = std::map<const HLT::TriggerElement*,std::pair<TrigCompositeUtils::Decision*,TrigCompositeUtils::Decision*>>; // decisionFeature, decision
+    using DecisionPair = std::pair<TrigCompositeUtils::Decision*,TrigCompositeUtils::Decision*>;
+    using DecisionObjMap = std::map<uint32_t,DecisionPair>; // decisionFeature, decision
+    using DecisionObjStringMap = std::map<std::string,DecisionPair>; // decisionFeature, decision but key=string
+    using TEObjMap = std::map<const HLT::TriggerElement*,DecisionPair>; // decisionFeature, decision
     using FElessObjMap = std::map<TrigCompositeUtils::Decision*,std::pair<TrigCompositeUtils::Decision*,const HLT::TriggerElement*>>; // decisionFeature-H no FE ->, decision,TEptr
     using L1ObjMap = std::map<uint32_t,TrigCompositeUtils::Decision*>; // L1decision
     using TEMap = std::map<const HLT::TriggerElement*, bool>; // map of TEs (true FE, false FE-less)
 
     std::tuple<uint32_t,CLID,std::string> getSgKey(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper) const;
-    StatusCode addTEfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper, std::pair<TrigCompositeUtils::Decision*,TrigCompositeUtils::Decision*>&  decisionPtr, int idx, DecisionObjMap* om) const;
+    StatusCode addTEfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper, DecisionPair&  decisionPtr, int idx, DecisionObjMap* om) const;
     StatusCode addTEROIfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper, TrigCompositeUtils::Decision*&  decisionPtr) const;
     StatusCode addROIfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper, TrigCompositeUtils::Decision*&  decisionPtr, int idx, L1ObjMap* om) const;
     StatusCode addTRACKfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper, TrigCompositeUtils::Decision*&  decisionPtr, ElementLink<TrigRoiDescriptorCollection>& rLink) const;
-    const std::vector<HLT::TriggerElement::FeatureAccessHelper> getTEfeatures(const HLT::TriggerElement *te_ptr, const HLT::TrigNavStructure &navigationDecoder) const;
+    const std::vector<HLT::TriggerElement::FeatureAccessHelper> getTEfeatures(const HLT::TriggerElement *te_ptr, const HLT::TrigNavStructure &navigationDecoder, bool filterOnCLID=true) const;
     const std::vector<HLT::TriggerElement::FeatureAccessHelper> getTEROIfeatures(const HLT::TriggerElement *te_ptr, const HLT::TrigNavStructure &navigationDecoder) const;
     const std::vector<HLT::TriggerElement::FeatureAccessHelper> getROIfeatures(const HLT::TriggerElement *te_ptr, const HLT::TrigNavStructure &navigationDecoder) const;
     const std::vector<HLT::TriggerElement::FeatureAccessHelper> getTRACKfeatures(const HLT::TriggerElement *te_ptr) const;
@@ -89,6 +91,7 @@ private:
     CLID m_TrackParticleContainerCLID { 0 };
     CLID m_TauTrackContainerCLID { 0 };
 
+
     using TE_Decision_map = std::map<HLT::TriggerElement*, std::vector<TrigCompositeUtils::Decision*>>;
     StatusCode printFeatures(const HLT::TrigNavStructure& ) const;
 };
-- 
GitLab


From 164bd67b5d7faeac8f96967f28fda7f1f34556d1 Mon Sep 17 00:00:00 2001
From: Marco Valente <marco.valente@cern.ch>
Date: Thu, 9 Sep 2021 09:29:46 +0200
Subject: [PATCH 033/347] Add asymmetric capabilities to jet trigger
 preselections

---
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 24 +++++++
 .../share/ref_v1Dev_decodeBS_build.ref        | 18 ++++++
 .../Jet/JetChainConfiguration.py              | 63 ++++++++++++-------
 .../python/HLTMenuConfig/Menu/LS2_v1.py       |  5 ++
 .../HLTMenuConfig/Menu/SignatureDicts.py      | 43 +++++++------
 5 files changed, 112 insertions(+), 41 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 513686981c28..af672668a351 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -202,6 +202,30 @@ HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_L1J100:
   stepFeatures:
     0: 10
     1: 7
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j135XXj60_L1J100:
+  eventCount: 1
+  stepCounts:
+    0: 2
+    1: 1
+  stepFeatures:
+    0: 4
+    1: 7
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100:
+  eventCount: 1
+  stepCounts:
+    0: 2
+    1: 1
+  stepFeatures:
+    0: 4
+    1: 7
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100:
+  eventCount: 1
+  stepCounts:
+    0: 1
+    1: 1
+  stepFeatures:
+    0: 2
+    1: 7
 HLT_2j330_a10sd_cssk_pf_jes_ftf_35smcINF_L1J100:
   eventCount: 0
   stepCounts:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 2734885ae3ce..138ff535996a 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -87,6 +87,24 @@ HLT_2j250_ftf_0eta240_j120_ftf_0eta240_L1J100:
   eventCount: 0
 HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_L1J100:
   eventCount: 0
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j135XXj60_L1J100:
+  eventCount: 0
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100:
+  eventCount: 0
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100:
+  eventCount: 0
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j135XXj60_L1J100:
+  eventCount: 0
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100:
+  eventCount: 0
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100:
+  eventCount: 0
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j135XXj60_L1J100:
+  eventCount: 0
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100:
+  eventCount: 0
+HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100:
+  eventCount: 0
 HLT_2j330_a10sd_cssk_pf_jes_ftf_35smcINF_L1J100:
   eventCount: 0
 HLT_2j330_a10sd_cssk_pf_jes_ftf_35smcINF_L1SC111-CJ15:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
index 7b477dc3ac66..84ae7d7c9372 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Jet/JetChainConfiguration.py
@@ -72,6 +72,7 @@ class JetChainConfiguration(ChainConfigurationBase):
             if p["trkpresel"]!="nopresel":
                 if ip+1==len(jChainParts): # Last jet chainPart, presel should go here
                     self.trkpresel=p["trkpresel"]
+                    self.trkpresel_parsed_reco = {key:p[key] for key in ['recoAlg']} #Storing here the reco options from last chain part that we want to propagate to preselection (e.g. jet radius)
                 else:
                     log.error("Likely inconsistency encountered in preselection specification for %s",self.chainName)
                     raise RuntimeError("Preselection %s specified earlier than in the last chainPart!",p["trkpresel"])
@@ -158,36 +159,56 @@ class JetChainConfiguration(ChainConfigurationBase):
         return str(clustersKey), ChainStep(stepName, [jetSeq], multiplicity=[1], chainDicts=[self.dict])
 
     def getJetCaloPreselChainStep(self):
+        #Find if a a4 or a10 calo jet needs to be used in the pre-selection from the last chain dict
+        import re
+        assert 'recoAlg' in self.trkpresel_parsed_reco.keys(), "Impossible to find \'recoAlg\' key in last chain dictionary for preselection"
+        #Want to match now only a4 and a10 in the original reco algorithm. We don't want to use a10sd or a10t in the preselection
+        matched_reco = re.match(r'^a\d?\d?',self.trkpresel_parsed_reco['recoAlg'])
+        assert matched_reco is not None, "Impossible to get matched reco algorithm for jet trigger preselectiona The reco expression {0} seems to be impossible to be parsed.".format(self.trkpresel_parsed_reco['recoAlg'])
+
         # Define a fixed preselection dictionary for prototyping -- we may expand the options
         preselRecoDict = {
-            'recoAlg':'a4',
+            'recoAlg':matched_reco.group(), #Getting the outcome of the regex reco option (it should correspond to a4 or a10 depending by which chain you are configuring)
             'constitType':'tc',
             'clusterCalib':'em',
             'constitMod':'',
-            'jetCalib':'subjesIS',
             'trkopt':'notrk',
         }
+        if preselRecoDict['recoAlg']=='a10': #Setting LC calibrations for large-R jets
+            preselRecoDict['clusterCalib']='lcw'
+        from .JetRecoConfiguration import interpretJetCalibDefault
+        preselRecoDict.update({'jetCalib':interpretJetCalibDefault(preselRecoDict)}) #Adding default calibration for corresponding chain
         from ..Menu.SignatureDicts import JetChainParts_Default
-        preselJetParts = dict(JetChainParts_Default)
-        # Get from the last chainPart... trying to anticipate potential developments
-        # For now they are only in single-threshold chains anyway
-        preselParts    = self.trkpresel.split('j')
-        multiplicity   = preselParts[0].split('presel')[1] if preselParts[0] != 'presel' else '1'
-        threshold      = preselParts[1]
-        chainPartName  = multiplicity+'j'+threshold if multiplicity != '1' else 'j'+threshold
-        preselJetParts.update(preselRecoDict)
-        preselJetParts.update(
-            {'L1threshold': 'FSNOSEED',
-             'chainPartName': chainPartName,
-             'multiplicity': multiplicity,
-             'threshold': threshold,
-             # fix selections that we don't want even if they
-             # become default
-             'jvt':'',
-             }
-        )
+        preselCommonJetParts = dict(JetChainParts_Default)
+        preselCommonJetParts.update(preselRecoDict)
+
         preselChainDict = dict(self.dict)
-        preselChainDict['chainParts'] = [preselJetParts]
+        preselChainDict['chainParts']=[]
+
+        # Get from the last chainPart in order to avoid to specify preselection for every leg
+        #TODO: add protection for cases where the preselection is not specified in the last chainPart
+        presel_matched = re.match(r'presel(?P<cut>\d?\d?j[\d\D]+)', self.trkpresel)
+        assert presel_matched is not None, "Impossible to match preselection pattern for self.trkpresel=\'{0}\'.".format(self.trkpresel)
+        presel_cut_str = presel_matched.groupdict()['cut'] #This is the cut string you want to parse. For example 'presel2j50XXj40'
+
+        for p in presel_cut_str.split('XX'):
+            matched = re.match(r'(?P<mult>\d?\d?)j(?P<cut>\d+)', p)
+            assert matched is not None, "Impossible to extract preselection cut for \'{0}\' substring. Please investigate.".format(p)
+            cut_dict = matched.groupdict()
+            mult,cut=cut_dict['mult'],cut_dict['cut']
+            chainPartName=f'{mult}j{cut}'
+            if mult=='': mult='1'
+
+            tmpChainDict = dict(preselCommonJetParts) 
+            tmpChainDict.update(
+                {'L1threshold': 'FSNOSEED',
+                 'chainPartName': chainPartName,
+                 'multiplicity': mult,
+                 'threshold': cut,
+                 'jvt':'',
+                 }
+            )
+            preselChainDict['chainParts'] += [tmpChainDict]
 
         jetDefStr = jetRecoDictToString(preselRecoDict)
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index ad6d04068a65..66ad254038d8 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -519,6 +519,11 @@ def setupMenu():
 
 
         ChainProp(name='HLT_5j70_ftf_0eta240_L14J15', l1SeedThresholds=['FSNOSEED'],     groups=MultiJetGroup+SupportLegGroup),
+
+        ChainProp(name='HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j135XXj60_L1J100', l1SeedThresholds=['FSNOSEED']*2, groups=MultiJetGroup + PrimaryLegGroup),
+        ChainProp(name='HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100', l1SeedThresholds=['FSNOSEED']*2, groups=MultiJetGroup + PrimaryLegGroup),
+        ChainProp(name='HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100', l1SeedThresholds=['FSNOSEED']*2, groups=MultiJetGroup + PrimaryLegGroup),
+
         #Adding testing chains for Tight,Medium,Loose preselections (ATR-23547) and also corresponding emtopo chain
         ChainProp(name='HLT_4j115_pf_ftf_presel4j55_L13J50', l1SeedThresholds=['FSNOSEED'], groups=MultiJetGroup+SupportLegGroup),
         ChainProp(name='HLT_4j115_pf_ftf_presel4j85_L13J50', l1SeedThresholds=['FSNOSEED'], groups=MultiJetGroup+SupportLegGroup),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index bcd95b2c7592..657e842bd383 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -133,28 +133,31 @@ JetChainParts = {
     'trkpresel'    : # Tracking preselection
       ['nopresel',
        #Loose
-       'preselj20',  #L1J15, L1J20
-       'preselj60',  #L1J30
-       'preselj135', #L1J50, #L1J100
-       'presel2j135', #L1J50, L1J100
-       'presel4j33', #L13J50
-       'presel5j24', #L14J15
-       'presel6j36', #L14J15
-       'presel7j21', #L14J15
+       'preselj20',        #L1J15, L1J20
+       'preselj60',        #L1J30
+       'preselj135',       #L1J50, #L1J100
+       'presel2j135',      #L1J50, L1J100
+       'presel2j135XXj60', #L1J50, L1J100
+       'presel4j33',       #L13J50
+       'presel5j24',       #L14J15
+       'presel6j36',       #L14J15
+       'presel7j21',       #L14J15
        #Medium
-       'preselj180',  #L1J100
-       'presel2j180', #L1J100
-       'presel4j55',  #L13J50
-       'presel5j35',  #L14J15
-       'presel6j40',  #L14J15
-       'presel7j28',  #L14J15
+       'preselj180',       #L1J100
+       'presel2j180',      #L1J100
+       'presel2j180XXj80', #L1J100
+       'presel4j55',       #L13J50
+       'presel5j35',       #L14J15
+       'presel6j40',       #L14J15
+       'presel7j28',       #L14J15
        #Tight
-       'preselj225', #L1J100
-       'presel2j225', #L1J100
-       'presel4j85', #L13J50
-       'presel5j50', #L14J15
-       'presel6j45', #L14J15
-       'presel7j35', #L14j15
+       'preselj225',        #L1J100
+       'presel2j225',       #L1J100
+       'presel2j225XXj100', #L1J100
+       'presel4j85',        #L13J50
+       'presel5j50',        #L14J15
+       'presel6j45',        #L14J15
+       'presel7j35',        #L14j15
      ],
     # Hypo information
     #   If hypoScenario is 'simple', then hypo configuration is handled based on the
-- 
GitLab


From 29b695f2b74b65d581bc8f455ad69e3edd191650 Mon Sep 17 00:00:00 2001
From: Cecilia Tosciri <cecilia.tosciri@cern.ch>
Date: Thu, 9 Sep 2021 09:44:49 +0200
Subject: [PATCH 034/347] gFEX Jets without Jets algorithm

---
 .../L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJAlgo.h  |  81 +++++
 .../L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJTOB.h   |  55 +++
 .../L1CaloFEXSim/gFEXNtupleWriter.h           |  12 +
 .../L1CaloFEXSim/gFEXOutputCollection.h       |  16 +-
 .../L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h       |  14 +-
 .../L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h    |  12 +
 .../share/gFEXDriverJobOptions.py             |   1 -
 .../src/components/FEXDriver_entries.cxx      |   2 +
 .../L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx |   3 +-
 .../L1CaloFEXSim/src/gFEXJwoJAlgo.cxx         | 312 ++++++++++++++++++
 .../L1CaloFEXSim/src/gFEXJwoJTOB.cxx          |  61 ++++
 .../L1CaloFEXSim/src/gFEXNtupleWriter.cxx     |  41 ++-
 .../L1CaloFEXSim/src/gFEXOutputCollection.cxx |  47 ++-
 .../L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx    |  33 ++
 .../L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx |  43 ++-
 .../L1CaloFEXToolInterfaces/IgFEXJwoJAlgo.h   |  45 +++
 .../L1CaloFEXToolInterfaces/IgFEXSim.h        |   2 +
 .../L1CaloFEXToolInterfaces/IgFEXSysSim.h     |   2 +
 18 files changed, 748 insertions(+), 34 deletions(-)
 create mode 100644 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJAlgo.h
 create mode 100644 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJTOB.h
 create mode 100644 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx
 create mode 100644 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJTOB.cxx
 create mode 100644 Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXJwoJAlgo.h

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJAlgo.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJAlgo.h
new file mode 100644
index 000000000000..b520dafc181e
--- /dev/null
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJAlgo.h
@@ -0,0 +1,81 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+//***************************************************************************
+//    gFEXJwoJAlgo - Jets without jets algorithm for gFEX
+//                              -------------------
+//     begin                : 10 08 2021
+//     email                : cecilia.tosciri@cern.ch
+//***************************************************************************
+
+#ifndef gFEXJwoJAlgo_H
+#define gFEXJwoJAlgo_H
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "L1CaloFEXToolInterfaces/IgFEXJwoJAlgo.h"
+#include "AthenaKernel/CLASS_DEF.h"
+#include "L1CaloFEXSim/gFEXJwoJTOB.h"
+#include "L1CaloFEXSim/gTowerContainer.h"
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "StoreGate/StoreGateSvc.h"
+#include "L1CaloFEXSim/FEXAlgoSpaceDefs.h"
+
+
+
+namespace LVL1 {
+
+  class gFEXJwoJAlgo : public AthAlgTool, virtual public IgFEXJwoJAlgo {
+
+  public:
+    /** Constructors */
+    gFEXJwoJAlgo(const std::string& type, const std::string& name, const IInterface* parent);
+
+    /** standard Athena-Algorithm method */
+    virtual StatusCode initialize() override;
+
+
+    virtual void setAlgoConstant(unsigned int aFPGA_A, unsigned int bFPGA_A,
+                                 unsigned int aFPGA_B, unsigned int bFPGA_B,
+                                 int gblockThreshold) override;
+
+    virtual std::vector<std::unique_ptr<gFEXJwoJTOB>> jwojAlgo(gTowersCentral Atwr, gTowersCentral Btwr,
+                                                               std::array<uint32_t, 4> & outTOB) override;
+
+
+
+  private:
+
+    unsigned int m_aFPGA_A;
+    unsigned int m_bFPGA_A;
+    unsigned int m_aFPGA_B;
+    unsigned int m_bFPGA_B;
+    int m_gBlockthreshold;
+
+
+    virtual void gBlockAB(gTowersCentral twrs, gTowersCentral & gBlkSum);
+
+    virtual void metFPGA(gTowersCentral twrs, gTowersCentral & gBlkSum,
+                           unsigned short & MHT_x, unsigned short & MHT_y,
+                           unsigned short & MST_x, unsigned short & MST_y,
+                           unsigned short & MET_x, unsigned short & MET_y);
+
+    virtual void metTotal(unsigned short A_MET_x, unsigned short A_MET_y,
+                          unsigned short B_MET_x, unsigned short B_MET_y,
+                          unsigned short & MET_x, unsigned short & MET_y, unsigned short & MET);
+
+    virtual void sumEtFPGA(gTowersCentral twrs, unsigned int & partial_sumEt);
+
+    virtual void sumEt(unsigned int  A_sumEt, unsigned int  B_sumEt, unsigned int & total_sumEt);
+
+    virtual unsigned short sinLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw);
+
+    virtual unsigned short cosLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw);
+
+
+  };
+
+} // end of namespace
+
+
+#endif
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJTOB.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJTOB.h
new file mode 100644
index 000000000000..f61e3cdcd50f
--- /dev/null
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJTOB.h
@@ -0,0 +1,55 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+//***************************************************************************
+//    gFEXJwoJTOB - Forms the JwoJ TOBs for gFEX
+//                              -------------------
+//     begin                : 10 08 2021
+//     email                : cecilia.tosciri@cern.ch
+//***************************************************************************
+
+#pragma once
+#include "AthenaKernel/CLASS_DEF.h"
+
+namespace LVL1 {
+  class gFEXJwoJTOB
+  {
+    //gFEXJwoJTOB class description below:
+    /** The gFEXJwoJTOB.h class stores the energy, the eta, phi coordinate,
+     * the status and the type (gRho, gBlock, gJwoJ) of the gFEX JwoJ TOBs
+     */
+  private:
+    uint32_t     m_word;
+    unsigned int m_quantity1;
+    unsigned int m_quantity2;
+    unsigned int m_st1;
+    unsigned int m_st2;
+    unsigned int m_satur;
+    unsigned int m_tobID;
+
+
+  public:
+    gFEXJwoJTOB();
+    ~gFEXJwoJTOB() {};
+
+    inline uint32_t      getWord() const {return m_word;}
+    inline unsigned  int getQuantity1() const {return m_quantity1;}
+    inline unsigned  int getQuantity2() const {return m_quantity2;}
+    inline unsigned  int getStatus1() const {return m_st1;}
+    inline unsigned  int getStatus2() const {return m_st2;}
+    inline unsigned  int getSaturation() const {return m_satur;}
+    inline unsigned  int getTobID() const {return m_tobID;}
+
+
+    void setWord(uint32_t);
+    void setQuantity1(unsigned int);
+    void setQuantity2(unsigned int);
+    void setStatus1(unsigned int);
+    void setStatus2(unsigned int);
+    void setSaturation(unsigned int);
+    void setTobID(unsigned int);
+  };
+
+} // end of namespace
+
+CLASS_DEF( LVL1::gFEXJwoJTOB, 2352924 , 1 )
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXNtupleWriter.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXNtupleWriter.h
index 028a7319277e..9d24e718222c 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXNtupleWriter.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXNtupleWriter.h
@@ -31,11 +31,13 @@ public:
 private:
   gFEXOutputCollection* m_gFEXOutputCollection;
   float m_jet_nTOBs;
+  float m_global_nTOBs;
   bool m_load_truth_jet;
 
   std::vector<float> m_truth_jet_eta;
   std::vector<float> m_truth_jet_phi;
   std::vector<float> m_truth_jet_ET;
+
   std::vector<float> m_jet_TOB;
   std::vector<float> m_jet_TOB_Eta;
   std::vector<float> m_jet_TOB_Phi;
@@ -43,10 +45,20 @@ private:
   std::vector<float> m_jet_TOB_ID;
   std::vector<float> m_jet_TOB_Status;
 
+
+  std::vector<float> m_global_TOB;
+  std::vector<float> m_global_TOB_Quantity1;
+  std::vector<float> m_global_TOB_Quantity2;
+  std::vector<float> m_global_TOB_Saturation;
+  std::vector<float> m_global_TOB_ID;
+  std::vector<float> m_global_TOB_Status1;
+  std::vector<float> m_global_TOB_Status2;
+
   std::string m_jet_container_name = "AntiKt10TruthJets";
   TTree *m_myTree;
 
   StatusCode loadJetAlgoVariables();
+  StatusCode loadGlobalAlgoVariables();
   StatusCode loadTruthElectron();
   StatusCode loadTruthJets();
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXOutputCollection.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXOutputCollection.h
index d794848d943f..77f0d7815a0d 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXOutputCollection.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXOutputCollection.h
@@ -31,7 +31,8 @@ namespace LVL1 {
     ~gFEXOutputCollection();
 
 
-    void clear();
+    void clearJets();
+    void clearGlobals();
 
     /**
      * @brief add a value related to the jet finder algorithm for a TOB
@@ -41,29 +42,38 @@ namespace LVL1 {
      *
      */
     void addValueJet(std::string key, float value);
+    void addValueGlobal(std::string key, float value);
 
     //Save all jet values. Use only after finishing defining all jet values for one TOB.
     void fillJet();
+    void fillGlobal();
 
     //Get total number of TOBs saved
-    int size();
+    int jetsSize();
+    int globalsSize();
 
-    //Get all jeta related values the ith TOB
+    //Get all jets related values
     std::unordered_map<std::string, float> getJet(int) const;
+    std::unordered_map<std::string, float> getGlobal(int) const;
 
     //Add a 32-bit jet TOB word
     void addJetTob(uint32_t);
+    void addGlobalTob(uint32_t);
 
     //Get all jet TOB words of an event
     std::vector<uint32_t> getJetTob() const;
+    std::vector<uint32_t> getGlobalTob() const;
 
   private:
     //vector of TOB words
     std::vector<uint32_t> m_jettob;
+    std::vector<uint32_t> m_globaltob;
     // /// jet related values of a TOB
     std::unordered_map<std::string, float> m_values_gFEXJet;
+    std::unordered_map<std::string, float> m_values_gFEXGlobal;
     /// jet related values of all TOBs in an event
     std::vector<std::unordered_map<std::string, float>> m_allvalues_gFEXjet;
+    std::vector<std::unordered_map<std::string, float>> m_allvalues_gFEXglobal;
 
   };
 }
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h
index abf5683b0a20..8822ebb4698a 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h
@@ -17,6 +17,8 @@
 #include "L1CaloFEXSim/gFEXFPGA.h"
 #include "L1CaloFEXSim/gFEXJetAlgo.h"
 #include "L1CaloFEXSim/gFEXJetTOB.h"
+#include "L1CaloFEXSim/gFEXJwoJAlgo.h"
+#include "L1CaloFEXSim/gFEXJwoJTOB.h"
 #include "L1CaloFEXSim/gFEXOutputCollection.h"
 
 
@@ -39,14 +41,10 @@ namespace LVL1 {
     /** Destructor */
     virtual ~gFEXSim();
 
-    //virtual void init (int id) override ;
-
     virtual void reset () override ;
 
     virtual void execute() override ;
 
-    //virtual int ID() override {return m_id;}
-
     virtual StatusCode executegFEXSim(gTowersIDs tmp) override;
 
     virtual std::vector<uint32_t> getgRhoTOBs() const override;
@@ -55,6 +53,8 @@ namespace LVL1 {
 
     virtual std::vector<uint32_t> getgJetTOBs() const override;
 
+    virtual std::vector<uint32_t> getgGlobalTOBs() const override;
+
     /** Internal data */
   private:
 
@@ -68,15 +68,15 @@ namespace LVL1 {
 
     std::vector<uint32_t>  m_gJetTobWords;
 
-    // std::array<uint32_t>  m_gRhoTobWords;
+    std::vector<uint32_t>  m_gGlobalTobWords;
 
-    // std::array<uint32_t>  m_gBlockTobWords;
 
-    // std::array<uint32_t>  m_gJetTobWords;
 
     ToolHandle<IgFEXFPGA> m_gFEXFPGA_Tool {this, "gFEXFPGATool", "LVL1::gFEXFPGA", "Tool that simulates the FPGA hardware"};
 
     ToolHandle<IgFEXJetAlgo> m_gFEXJetAlgoTool {this, "gFEXJetAlgoTool", "LVL1::gFEXJetAlgo", "Tool that runs the gFEX jet algorithm"};
+
+    ToolHandle<IgFEXJwoJAlgo> m_gFEXJwoJAlgoTool {this, "gFEXJwoJAlgoTool", "LVL1::gFEXJwoJAlgo", "Tool that runs the gFEX Jets without Jets algorithm"};
   };
 
 } // end of namespace
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h
index 8a10da2b0141..4be59907783a 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h
@@ -20,6 +20,10 @@
 #include "xAODTrigger/gFexJetRoIContainer.h"
 #include "xAODTrigger/gFexJetRoIAuxContainer.h"
 
+#include "xAODTrigger/gFexGlobalRoI.h"
+#include "xAODTrigger/gFexGlobalRoIContainer.h"
+#include "xAODTrigger/gFexGlobalRoIAuxContainer.h"
+
 namespace LVL1 {
 
   //Doxygen class description below:
@@ -56,6 +60,8 @@ namespace LVL1 {
 
     virtual StatusCode fillgJetEDM(uint32_t tobWord) override ;
 
+    virtual StatusCode fillgGlobalEDM(uint32_t tobWord) override ;
+
     /** Internal data */
   private:
     std::unique_ptr< xAOD::gFexJetRoIContainer > m_gRhoContainer;
@@ -67,6 +73,10 @@ namespace LVL1 {
     std::unique_ptr< xAOD::gFexJetRoIContainer > m_gJetContainer;
     std::unique_ptr< xAOD::gFexJetRoIAuxContainer > m_gJetAuxContainer;
 
+    std::unique_ptr< xAOD::gFexGlobalRoIContainer > m_gGlobalContainer;
+    std::unique_ptr< xAOD::gFexGlobalRoIAuxContainer > m_gGlobalAuxContainer;
+
+
     std::vector<gFEXSim*> m_gFEXCollection;
 
     ToolHandle<IgFEXSim> m_gFEXSimTool       {this, "gFEXSimTool",    "LVL1::gFEXSim",    "Tool that creates the gFEX Simulation"};
@@ -75,10 +85,12 @@ namespace LVL1 {
     SG::ReadHandleKey<CaloCellContainer> m_scellsCollectionSGKey {this, "SCell", "SCell", "SCell"};
 
     SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetOutKey {this,"Key_gFexJetOutputContainer","L1_gJetRoI","Output gFexJet container"};
+    SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gFexGlobalOutKey {this,"Key_gFexGlobalOutputContainer","L1_gJetRoI","Output gFexGlobal container"};
 
     std::vector<uint32_t>  m_allgRhoTobs;
     std::vector<uint32_t>  m_allgBlockTobs;
     std::vector<uint32_t>  m_allgJetTobs;
+    std::vector<uint32_t>  m_allgGlobalTobs;
 
   };
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/share/gFEXDriverJobOptions.py b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/share/gFEXDriverJobOptions.py
index 931b4c1b0530..36ac564ea3be 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/share/gFEXDriverJobOptions.py
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/share/gFEXDriverJobOptions.py
@@ -40,6 +40,5 @@ svcMgr.THistSvc.Output += ["ANALYSIS DATAFILE='myfile.root' OPT='RECREATE'"]
 log.info("==========================================================")
 log.info("Scheduling gFEXDriver")
 athAlgSeq += CfgMgr.LVL1__gFEXDriver('MygFEXDriver')
-#athAlgSeq += CfgMgr.LVL1__gFEXNtupleWriter('MygFEXNtupleWriter')
 log.info("==========================================================")
 #######################################################
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/components/FEXDriver_entries.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/components/FEXDriver_entries.cxx
index c94b2ccb0b9e..2d053fcc4c03 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/components/FEXDriver_entries.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/components/FEXDriver_entries.cxx
@@ -32,6 +32,7 @@
 #include "L1CaloFEXSim/gFEXSim.h"
 #include "L1CaloFEXSim/gFEXFPGA.h"
 #include "L1CaloFEXSim/gFEXJetAlgo.h"
+#include "L1CaloFEXSim/gFEXJwoJAlgo.h"
 #include "L1CaloFEXSim/gFEXNtupleWriter.h"
 
 
@@ -75,5 +76,6 @@ DECLARE_COMPONENT(gTowerBuilder)
 DECLARE_COMPONENT(gSuperCellTowerMapper)
 DECLARE_COMPONENT(gFEXFPGA)
 DECLARE_COMPONENT(gFEXJetAlgo)
+DECLARE_COMPONENT(gFEXJwoJAlgo)
 DECLARE_COMPONENT(gFEXNtupleWriter)
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx
index e0e745ebcad6..6a6d1cdb1f63 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx
@@ -11,6 +11,7 @@
 #include "L1CaloFEXSim/gFEXSim.h"
 #include "L1CaloFEXSim/gFEXOutputCollection.h"
 #include "L1CaloFEXSim/gFEXJetTOB.h"
+#include "L1CaloFEXSim/gFEXJwoJTOB.h"
 
 #include "StoreGate/WriteHandle.h"
 #include "StoreGate/ReadHandle.h"
@@ -83,7 +84,7 @@ StatusCode gFEXDriver::initialize()
   //STEP 1 - Do some monitoring
   gFEXOutputCollection* my_gFEXOutputCollection = new gFEXOutputCollection();
   ATH_CHECK( evtStore()->record(my_gFEXOutputCollection,"gFEXOutputCollection") );
-  
+
   // SG::WriteHandle<LVL1::gFEXOutputCollection> gFEXOutputCollectionSG(m_gFEXOutputCollectionSGKey);
   // ATH_CHECK(gFEXOutputCollectionSG.record(std::move(my_gFEXOutputCollection)));
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx
new file mode 100644
index 000000000000..6a2d1baea8fc
--- /dev/null
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx
@@ -0,0 +1,312 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+//***************************************************************************
+//    gFEXJwoJAlg - Jets without jets algorithm for gFEX
+//                              -------------------
+//     begin                : 10 08 2021
+//     email                : cecilia.tosciri@cern.ch
+//***************************************************************************
+
+#define _USE_MATH_DEFINES
+#include <cmath>
+#include <vector>
+
+#include "L1CaloFEXSim/gFEXJwoJAlgo.h"
+#include "L1CaloFEXSim/gFEXJwoJTOB.h"
+#include "L1CaloFEXSim/gTowerContainer.h"
+#include "L1CaloFEXSim/gTower.h"
+
+namespace LVL1 {
+
+  // default constructor for persistency
+gFEXJwoJAlgo::gFEXJwoJAlgo(const std::string& type, const std::string& name, const IInterface* parent):
+    AthAlgTool(type, name, parent)
+  {
+    declareInterface<IgFEXJwoJAlgo>(this);
+  }
+
+
+StatusCode gFEXJwoJAlgo::initialize(){
+
+  return StatusCode::SUCCESS;
+
+}
+
+
+void gFEXJwoJAlgo::setAlgoConstant(unsigned int aFPGA_A, unsigned int bFPGA_A,
+                                  unsigned int aFPGA_B, unsigned int bFPGA_B,
+                                  int gblockThreshold) {
+  m_aFPGA_A = aFPGA_A;
+  m_bFPGA_A = bFPGA_A;
+  m_aFPGA_B = aFPGA_B;
+  m_bFPGA_B = bFPGA_B;
+  m_gBlockthreshold = gblockThreshold;
+}
+
+
+
+std::vector<std::unique_ptr<gFEXJwoJTOB>> gFEXJwoJAlgo::jwojAlgo(gTowersCentral Atwr, gTowersCentral Btwr,
+                                                                std::array<uint32_t, 4> & outTOB) {
+
+
+  // find gBlocks
+  gTowersCentral gBLKA;
+  gBlockAB(Atwr, gBLKA);
+
+
+  gTowersCentral gBLKB;
+  gBlockAB(Btwr, gBLKB);
+
+  //FPGA A observables
+  unsigned short A_MHT_x = 0x0;
+  unsigned short A_MHT_y = 0x0;
+  unsigned short A_MST_x = 0x0;
+  unsigned short A_MST_y = 0x0;
+  unsigned short A_MET_x = 0x0;
+  unsigned short A_MET_y = 0x0;
+
+  unsigned int A_sumEt = 0x0;
+
+  //FPGA B observables
+  unsigned short B_MHT_x = 0x0;
+  unsigned short B_MHT_y = 0x0;
+  unsigned short B_MST_x = 0x0;
+  unsigned short B_MST_y = 0x0;
+  unsigned short B_MET_x = 0x0;
+  unsigned short B_MET_y = 0x0;
+
+  unsigned int B_sumEt = 0x0;
+
+  //Global observables
+  unsigned short MET_x = 0x0;
+  unsigned short MET_y = 0x0;
+  unsigned short MET = 0x0;
+
+  unsigned int total_sumEt = 0x0;
+  unsigned int MHT_x = 0x0;
+  unsigned int MHT_y = 0x0;
+  unsigned int MST_x = 0x0;
+  unsigned int MST_y = 0x0;
+
+
+  metFPGA(Atwr, gBLKA, A_MHT_x, A_MHT_y, A_MST_x, A_MST_y, A_MET_x, A_MET_y);
+  metFPGA(Btwr, gBLKB, B_MHT_x, B_MHT_y, B_MST_x, B_MST_y, B_MET_x, B_MET_y);
+
+  metTotal(A_MET_x, A_MET_y, B_MET_x, B_MET_y, MET_x, MET_y, MET);
+
+  sumEtFPGA(Atwr, A_sumEt);
+  sumEtFPGA(Btwr, B_sumEt);
+
+  sumEt(A_sumEt, B_sumEt, total_sumEt);
+  sumEt(A_MHT_x, B_MHT_x, MHT_x);
+  sumEt(A_MHT_y, B_MHT_y, MHT_y);
+  sumEt(A_MST_x, B_MST_x, MST_x);
+  sumEt(A_MST_y, B_MST_y, MST_y);
+
+  //Define a vector to be filled with all the TOBs of one event
+  std::vector<std::unique_ptr<gFEXJwoJTOB>> tobs_v;
+  tobs_v.resize(4);
+
+
+  // fill in TOBs
+  // The order of the TOBs is given according to the TOB ID (TODO: check how it's done in fw)
+
+  // First TOB is (MET, SumEt)
+  outTOB[0] = total_sumEt; //set the Quantity2 to the corresponding slot (LSB)
+  outTOB[0] = outTOB[0] | (MET  &  0x00000FFF) << 12;//Quantity 1 (in bit number 12)
+  if (total_sumEt != 0) outTOB[0] = outTOB[0] | 0x00000001 << 24;//Status bit for Quantity 2 (0 if quantity is null)
+  if (MET != 0) outTOB[0] = outTOB[0] | 0x00000001 << 25;//Status bit for Quantity 1 (0 if quantity is null)
+  outTOB[0] = outTOB[0] | (1  &  0x0000001F) << 26;//TOB ID is 1 for scalar values (5 bits starting at 26)
+
+// Second TOB is (MET_x, MET_y)
+  outTOB[1] = MET_y; //set the Quantity2 to the corresponding slot (LSB)
+  outTOB[1] = outTOB[1] | (MET_x  &  0x00000FFF) << 12;//Quantity 1 (in bit number 12)
+  if (MET_y != 0) outTOB[1] = outTOB[1] | 0x00000001 << 24;//Status bit for Quantity 2 (0 if quantity is null)
+  if (MET_x != 0) outTOB[1] = outTOB[1] | 0x00000001 << 25;//Status bit for Quantity 1 (0 if quantity is null)
+  outTOB[1] = outTOB[1] | (2  &  0x0000001F) << 26;//TOB ID is 2 for MET_x, MET_y (5 bits starting at 26)
+
+// Third TOB is hard components (MHT_x, MHT_y)
+  outTOB[2] = MHT_y; //set the Quantity2 to the corresponding slot (LSB)
+  outTOB[2] = outTOB[2] | (MHT_x  &  0x00000FFF) << 12;//Quantity 1 (in bit number 12)
+  if (MHT_y != 0) outTOB[2] = outTOB[2] | 0x00000001 << 24;//Status bit for Quantity 2 (0 if quantity is null)
+  if (MHT_x != 0) outTOB[2] = outTOB[2] | 0x00000001 << 25;//Status bit for Quantity 1 (0 if quantity is null)
+  outTOB[2] = outTOB[2] | (3  &  0x0000001F) << 26;//TOB ID is 3 for hard components (5 bits starting at 26)
+
+  // Fourth TOB is hard components (MHT_x, MHT_y)
+  outTOB[3] = MST_y; //set the Quantity2 to the corresponding slot (LSB)
+  outTOB[3] = outTOB[3] | (MST_x  &  0x00000FFF) << 12;//Quantity 1 (in bit number 12)
+  if (MST_y != 0) outTOB[3] = outTOB[3] | 0x00000001 << 24;//Status bit for Quantity 2 (0 if quantity is null)
+  if (MST_x != 0) outTOB[3] = outTOB[3] | 0x00000001 << 25;//Status bit for Quantity 1 (0 if quantity is null)
+  outTOB[3] = outTOB[3] | (4  &  0x0000001F) << 26;//TOB ID is 4 for soft components (5 bits starting at 26)
+
+
+  tobs_v[0] = std::make_unique<gFEXJwoJTOB>();
+  tobs_v[0]->setWord(outTOB[0]);
+  tobs_v[0]->setQuantity1(MET);
+  tobs_v[0]->setQuantity2(total_sumEt);
+  tobs_v[0]->setSaturation(0); //Always 0 for now, need a threshold?
+  tobs_v[0]->setTobID(1);
+  if( MET != 0 ) tobs_v[0]->setStatus1(1);
+  else tobs_v[0]->setStatus1(0);
+  if(total_sumEt!= 0) tobs_v[0]->setStatus2(1);
+  else tobs_v[0]->setStatus2(0);
+
+  tobs_v[1] = std::make_unique<gFEXJwoJTOB>();
+  tobs_v[1]->setWord(outTOB[1]);
+  tobs_v[1]->setQuantity1(MET_x);
+  tobs_v[1]->setQuantity2(MET_y);
+  tobs_v[1]->setSaturation(0); //Always 0 for now, need a threshold?
+  tobs_v[1]->setTobID(2);
+  if( MET_x != 0 ) tobs_v[1]->setStatus1(1);
+  else tobs_v[1]->setStatus1(0);
+  if(MET_y!= 0) tobs_v[1]->setStatus2(1);
+  else tobs_v[1]->setStatus2(0);
+
+  tobs_v[2] = std::make_unique<gFEXJwoJTOB>();
+  tobs_v[2]->setWord(outTOB[2]);
+  tobs_v[2]->setQuantity1(MHT_x);
+  tobs_v[2]->setQuantity2(MHT_y);
+  tobs_v[2]->setSaturation(0); //Always 0 for now, need a threshold?
+  tobs_v[2]->setTobID(3);
+  if( MHT_x != 0 ) tobs_v[2]->setStatus1(1);
+  else tobs_v[2]->setStatus1(0);
+  if(MHT_y!= 0) tobs_v[2]->setStatus2(1);
+  else tobs_v[2]->setStatus2(0);
+
+  tobs_v[3] = std::make_unique<gFEXJwoJTOB>();
+  tobs_v[3]->setWord(outTOB[3]);
+  tobs_v[3]->setQuantity1(MST_x);
+  tobs_v[3]->setQuantity2(MST_y);
+  tobs_v[3]->setSaturation(0); //Always 0 for now, need a threshold?
+  tobs_v[3]->setTobID(4);
+  if( MST_x != 0 ) tobs_v[3]->setStatus1(1);
+  else tobs_v[2]->setStatus1(0);
+  if(MST_y!= 0) tobs_v[3]->setStatus2(1);
+  else tobs_v[3]->setStatus2(0);
+
+
+  return tobs_v;
+
+}
+
+
+
+void gFEXJwoJAlgo::gBlockAB(gTowersCentral twrs, gTowersCentral & gBlkSum){
+
+  int rows = twrs.size();
+  int cols = twrs[0].size();
+
+  for( int irow = 0; irow < rows; irow++ ){
+    for(int jcolumn = 0; jcolumn<cols; jcolumn++){
+      // zero jet sum here
+      gBlkSum[irow][jcolumn] = 0;
+      int krowUp = (irow + 1)%32;
+      int krowDn = (irow - 1 +32)%32;
+      if( (jcolumn == 0) || (jcolumn == 6) ) {
+        //left edge case
+        gBlkSum[irow][jcolumn] =
+          twrs[irow][jcolumn]   + twrs[krowUp][jcolumn]   + twrs[krowDn][jcolumn]   +
+          twrs[irow][jcolumn+1] + twrs[krowUp][jcolumn+1] + twrs[krowDn][jcolumn+1];
+            } else if( (jcolumn == 5) || (jcolumn == 11)) {
+        //  right edge case
+        gBlkSum[irow][jcolumn] =
+          twrs[irow][jcolumn]   + twrs[krowUp][jcolumn]   + twrs[krowDn][jcolumn]   +
+          twrs[irow][jcolumn-1] + twrs[krowUp][jcolumn-1] + twrs[krowDn][jcolumn-1];
+            } else{
+        // normal case
+        gBlkSum[irow][jcolumn] =
+          twrs[irow][jcolumn]   + twrs[krowUp][jcolumn]   + twrs[krowDn][jcolumn]   +
+          twrs[irow][jcolumn-1] + twrs[krowUp][jcolumn-1] + twrs[krowDn][jcolumn-1] +
+          twrs[irow][jcolumn+1] + twrs[krowUp][jcolumn+1] + twrs[krowDn][jcolumn+1];
+        }
+    }
+  }
+
+}
+
+
+void gFEXJwoJAlgo::metFPGA(gTowersCentral twrs, gTowersCentral & gBlkSum,
+                           unsigned short & MHT_x, unsigned short & MHT_y,
+                           unsigned short & MST_x, unsigned short & MST_y,
+                           unsigned short & MET_x, unsigned short & MET_y){
+
+  int rows = twrs.size();
+  int cols = twrs[0].size();
+
+  for( int irow = 0; irow < rows; irow++ ){
+    for(int jcolumn = 0; jcolumn<cols; jcolumn++){
+      if(gBlkSum[irow][jcolumn] > m_gBlockthreshold){
+        MHT_x += (twrs[irow][jcolumn])*cosLUT(irow, 5, 6);
+        MHT_y += (twrs[irow][jcolumn])*sinLUT(irow, 5, 6);
+      }
+      else{
+       MST_x += (twrs[irow][jcolumn])*cosLUT(irow, 5, 6);
+       MST_y += (twrs[irow][jcolumn])*sinLUT(irow, 5, 6);
+      }
+    }
+  }
+
+  MET_x = m_aFPGA_A * MHT_x + m_bFPGA_A * MST_x;
+  MET_y = m_aFPGA_B * MHT_y + m_bFPGA_B * MST_y;
+
+}
+
+void gFEXJwoJAlgo::metTotal(unsigned short A_MET_x, unsigned short A_MET_y,
+                            unsigned short B_MET_x, unsigned short B_MET_y,
+                            unsigned short & MET_x, unsigned short & MET_y, unsigned short & MET){
+
+  MET_x = A_MET_x + B_MET_x;
+  MET_y = A_MET_y + B_MET_y;
+  MET   = sqrt((MET_x * MET_x) + (MET_y * MET_y));
+
+}
+
+
+void gFEXJwoJAlgo::sumEtFPGA(gTowersCentral twrs, unsigned int & partial_sumEt ){
+
+  int rows = twrs.size();
+  int cols = twrs[0].size();
+
+  for( int irow = 0; irow < rows; irow++ ){
+    for(int jcolumn = 0; jcolumn<cols; jcolumn++){
+      partial_sumEt += twrs[irow][jcolumn];
+    }
+  }
+
+}
+
+void gFEXJwoJAlgo::sumEt(unsigned int  A_sumEt, unsigned int  B_sumEt, unsigned int & total_sumEt ){
+
+  total_sumEt = A_sumEt + B_sumEt;
+
+}
+
+//----------------------------------------------------------------------------------
+// bitwise simulation of sine LUT in firmware
+//----------------------------------------------------------------------------------
+unsigned short gFEXJwoJAlgo::sinLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw)
+{
+  float c = ((float)phiIDX)/pow(2,aw);
+  float rad = 2*M_PI*c;
+  float rsin = sin(rad);
+
+  return static_cast<unsigned short>(round((pow(2.0,dw-1)-1.0)*rsin));
+}
+
+//----------------------------------------------------------------------------------
+// bitwise simulation cosine LUT in firmware
+//----------------------------------------------------------------------------------
+unsigned short gFEXJwoJAlgo::cosLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw)
+{
+  float c = ((float)phiIDX)/pow(2,aw);
+  float rad = 2*M_PI*c;
+  float rcos = cos(rad);
+
+  return static_cast<unsigned short>(round((pow(2.0,dw-1)-1.0)*rcos));
+}
+
+
+
+
+} // namespace LVL1
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJTOB.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJTOB.cxx
new file mode 100644
index 000000000000..4db19172c4f7
--- /dev/null
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJTOB.cxx
@@ -0,0 +1,61 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+//***************************************************************************
+//    gFEXJwoJTOB - Forms the Jets without Jets TOBs for gFEX
+//                              -------------------
+//     begin                : 11 08 2021
+//     email                : cecilia.tosciri@cern.ch
+//***************************************************************************
+
+#include "L1CaloFEXSim/gFEXJwoJTOB.h"
+
+
+LVL1::gFEXJwoJTOB::gFEXJwoJTOB():
+  m_word{99999},
+  m_quantity1{99999},
+  m_quantity2{99999},
+  m_st1{99999},
+  m_st2{99999},
+  m_satur{99999},
+  m_tobID{99999}
+{}
+
+ void setWord(uint32_t);
+    void setQuantity1(unsigned int);
+    void setQuantity2(unsigned int);
+    void setStatus1(unsigned int);
+    void setStatus2(unsigned int);
+    void setSaturation(unsigned int);
+    void setTobID(unsigned int);
+
+
+void LVL1::gFEXJwoJTOB::setWord(uint32_t word) {
+  m_word = word;
+}
+
+void LVL1::gFEXJwoJTOB::setQuantity1(unsigned int quantity1) {
+  m_quantity1 = quantity1;
+}
+
+void LVL1::gFEXJwoJTOB::setQuantity2(unsigned int quantity2) {
+  m_quantity2 = quantity2;
+}
+
+void LVL1::gFEXJwoJTOB::setStatus1(unsigned int st1) {
+  m_st1 = st1;
+}
+
+void LVL1::gFEXJwoJTOB::setStatus2(unsigned int st2) {
+  m_st2 = st2;
+}
+
+void LVL1::gFEXJwoJTOB::setSaturation(unsigned int satur) {
+  m_satur = satur;
+}
+
+void LVL1::gFEXJwoJTOB::setTobID(unsigned int tobID) {
+  m_tobID = tobID;
+}
+
+
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXNtupleWriter.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXNtupleWriter.cxx
index 89fbb74ea9cf..65bf4216f4cb 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXNtupleWriter.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXNtupleWriter.cxx
@@ -12,6 +12,8 @@
 #include "StoreGate/StoreGateSvc.h"
 #include "L1CaloFEXSim/gFEXJetTOB.h"
 #include "L1CaloFEXSim/gFEXJetAlgo.h"
+#include "L1CaloFEXSim/gFEXJwoJTOB.h"
+#include "L1CaloFEXSim/gFEXJwoJAlgo.h"
 #include "L1CaloFEXSim/gFEXOutputCollection.h"
 #include <vector>
 #include "TTree.h"
@@ -51,6 +53,15 @@ StatusCode LVL1::gFEXNtupleWriter::initialize () {
   m_myTree->Branch ("jet_TOB_Status",  &m_jet_TOB_Status);
   m_myTree->Branch ("jet_nTOBs",  &m_jet_nTOBs);
 
+  m_myTree->Branch ("global_TOB", &m_global_TOB);
+  m_myTree->Branch ("global_TOB_Quantity1", &m_global_TOB_Quantity1);
+  m_myTree->Branch ("global_TOB_Quantity2", &m_global_TOB_Quantity2);
+  m_myTree->Branch ("global_TOB_Saturation", &m_global_TOB_Saturation);
+  m_myTree->Branch ("global_TOB_ID",  &m_global_TOB_ID);
+  m_myTree->Branch ("global_TOB_Status1",  &m_global_TOB_Status1);
+  m_myTree->Branch ("global_TOB_Status2",  &m_global_TOB_Status2);
+  m_myTree->Branch ("global_nTOBs",  &m_global_nTOBs);
+
   return StatusCode::SUCCESS;
 }
 
@@ -66,6 +77,8 @@ StatusCode LVL1::gFEXNtupleWriter::execute () {
     CHECK(loadTruthJets());
   }
 
+  CHECK(loadGlobalAlgoVariables());
+
   m_myTree->Fill();
   return StatusCode::SUCCESS;
 }
@@ -84,8 +97,8 @@ StatusCode LVL1::gFEXNtupleWriter::loadJetAlgoVariables() {
   m_jet_TOB_Status.clear();
 
 
-  m_jet_nTOBs = m_gFEXOutputCollection->size();
-  for (int i = 0; i < m_gFEXOutputCollection->size(); i++)
+  m_jet_nTOBs = m_gFEXOutputCollection->jetsSize();
+  for (int i = 0; i < m_gFEXOutputCollection->jetsSize(); i++)
   {
     uint32_t TOB = m_gFEXOutputCollection->getJetTob()[i];
     m_jet_TOB.push_back(TOB);
@@ -100,6 +113,30 @@ StatusCode LVL1::gFEXNtupleWriter::loadJetAlgoVariables() {
   return StatusCode::SUCCESS;
 }
 
+StatusCode LVL1::gFEXNtupleWriter::loadGlobalAlgoVariables() {
+  m_global_TOB.clear();
+  m_global_TOB_Quantity1.clear();
+  m_global_TOB_Quantity2.clear();
+  m_global_TOB_Saturation.clear();
+  m_global_TOB_ID.clear();
+  m_global_TOB_Status1.clear();
+  m_global_TOB_Status2.clear();
+
+  m_global_nTOBs = m_gFEXOutputCollection->globalsSize();
+  for (int i = 0; i < m_gFEXOutputCollection->globalsSize(); i++)
+  {
+    uint32_t TOB = m_gFEXOutputCollection->getGlobalTob()[i];
+    m_global_TOB.push_back(TOB);
+    std::unordered_map<std::string, float> gFEXglobalvalue = (m_gFEXOutputCollection->getGlobal(i));
+    m_global_TOB_Quantity1.push_back(gFEXglobalvalue["GlobalQuantity1"]);
+    m_global_TOB_Quantity2.push_back(gFEXglobalvalue["GlobalQuantity2"]);
+    m_global_TOB_Saturation.push_back(gFEXglobalvalue["SaturationGlobal"]);
+    m_global_TOB_ID.push_back(gFEXglobalvalue["TobIDJet"]);
+    m_global_TOB_Status1.push_back(gFEXglobalvalue["GlobalStatus1"]);
+    m_global_TOB_Status2.push_back(gFEXglobalvalue["GlobalStatus2"]);
+  }
+  return StatusCode::SUCCESS;
+}
 
 StatusCode LVL1::gFEXNtupleWriter::loadTruthJets() {
   m_truth_jet_eta.clear();
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXOutputCollection.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXOutputCollection.cxx
index 15d35fb5d3dd..54f5c89ec428 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXOutputCollection.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXOutputCollection.cxx
@@ -14,7 +14,7 @@ LVL1::gFEXOutputCollection::~gFEXOutputCollection()
 {
 }
 
-void LVL1::gFEXOutputCollection::clear()
+void LVL1::gFEXOutputCollection::clearJets()
 {
   for (auto iValues : m_allvalues_gFEXjet) {
     iValues.clear();
@@ -22,21 +22,26 @@ void LVL1::gFEXOutputCollection::clear()
   m_jettob.clear();
 }
 
+void LVL1::gFEXOutputCollection::clearGlobals()
+{
+  for (auto iValues : m_allvalues_gFEXglobal) {
+    iValues.clear();
+  }
+  m_globaltob.clear();
+}
 
 void LVL1::gFEXOutputCollection::addValueJet(std::string key, float value)
 {
   m_values_gFEXJet.emplace(std::move(key), value);
 }
 
-
 void LVL1::gFEXOutputCollection::fillJet()
 {
   m_allvalues_gFEXjet.push_back(std::move(m_values_gFEXJet));
   m_values_gFEXJet.clear();
 }
 
-
-int LVL1::gFEXOutputCollection::size()
+int LVL1::gFEXOutputCollection::jetsSize()
 {
   return m_allvalues_gFEXjet.size();
 }
@@ -46,7 +51,6 @@ std::unordered_map<std::string, float> LVL1::gFEXOutputCollection::getJet(int lo
   return m_allvalues_gFEXjet[location];
 }
 
-
 void LVL1::gFEXOutputCollection::addJetTob(uint32_t jettob)
 {
   m_jettob.push_back(jettob);
@@ -56,3 +60,36 @@ std::vector<uint32_t> LVL1::gFEXOutputCollection::getJetTob() const
 {
   return m_jettob;
 }
+
+
+
+void LVL1::gFEXOutputCollection::addValueGlobal(std::string key, float value)
+{
+  m_values_gFEXGlobal.emplace(std::move(key), value);
+}
+
+void LVL1::gFEXOutputCollection::fillGlobal()
+{
+  m_allvalues_gFEXglobal.push_back(std::move(m_values_gFEXGlobal));
+  m_values_gFEXGlobal.clear();
+}
+
+int LVL1::gFEXOutputCollection::globalsSize()
+{
+  return m_allvalues_gFEXglobal.size();
+}
+
+std::unordered_map<std::string, float> LVL1::gFEXOutputCollection::getGlobal(int location) const
+{
+  return m_allvalues_gFEXglobal[location];
+}
+
+void LVL1::gFEXOutputCollection::addGlobalTob(uint32_t globaltob)
+{
+  m_globaltob.push_back(globaltob);
+}
+
+std::vector<uint32_t> LVL1::gFEXOutputCollection::getGlobalTob() const
+{
+  return m_globaltob;
+}
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
index fc4179692af6..ee6e2ed98123 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
@@ -187,6 +187,21 @@ StatusCode gFEXSim::executegFEXSim(gTowersIDs tmp_gTowersIDs_subset){
    m_gJetTobWords[2] = BTOB1_dat[3];//leading gJet in FPGA B, eta bins (0--5)
    m_gJetTobWords[3] = BTOB2_dat[3];//leading gJet in FPGA B, eta bins (6--11)
 
+
+   // Retrieve the gFEXJetAlgoTool
+   ATH_CHECK( m_gFEXJwoJAlgoTool.retrieve() );
+   std::array<uint32_t, 4> outTOB = {0};
+
+   auto global_tobs = m_gFEXJwoJAlgoTool->jwojAlgo(Atwr, Btwr, outTOB);
+
+   m_gGlobalTobWords.resize(4);
+
+//Placing the global TOBs into a dedicated array
+   m_gGlobalTobWords[0] = outTOB[0];//
+   m_gGlobalTobWords[1] = outTOB[1];//
+   m_gGlobalTobWords[2] = outTOB[2];//
+   m_gGlobalTobWords[3] = outTOB[3];//
+
    gFEXOutputCollection* gFEXOutputs;
    ATH_CHECK(evtStore()->retrieve(gFEXOutputs, "gFEXOutputCollection"));
 
@@ -200,12 +215,25 @@ StatusCode gFEXSim::executegFEXSim(gTowersIDs tmp_gTowersIDs_subset){
      gFEXOutputs->addValueJet("TobIDJet", tobs_v[i]->getTobID());
      gFEXOutputs->fillJet();
 
+   }
+
+   for (int i = 0; i <4; i++){
+     gFEXOutputs->addGlobalTob(global_tobs[i]->getWord());
+     gFEXOutputs->addValueGlobal("GlobalQuantity1", global_tobs[i]->getQuantity1());
+     gFEXOutputs->addValueGlobal("GlobalQuantity2", global_tobs[i]->getQuantity2());
+     gFEXOutputs->addValueGlobal("SaturationGlobal", global_tobs[i]->getSaturation());
+     gFEXOutputs->addValueGlobal("TobIDGlobal", global_tobs[i]->getTobID());
+     gFEXOutputs->addValueGlobal("GlobalStatus1", global_tobs[i]->getStatus1());
+     gFEXOutputs->addValueGlobal("GlobalStatus2", global_tobs[i]->getStatus2());
+     gFEXOutputs->fillGlobal();
+
    }
 
     return StatusCode::SUCCESS;
 
 }
 
+
 std::vector<uint32_t> gFEXSim::getgRhoTOBs() const
 {
   return m_gRhoTobWords;
@@ -221,5 +249,10 @@ std::vector<uint32_t> gFEXSim::getgJetTOBs() const
   return m_gJetTobWords;
 }
 
+std::vector<uint32_t> gFEXSim::getgGlobalTOBs() const
+{
+  return m_gGlobalTobWords;
+}
+
 
 } // end of namespace bracket
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
index 0f2cf72858c3..31dcc398e367 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
@@ -75,6 +75,7 @@ namespace LVL1 {
       m_allgRhoTobs.clear();
       m_allgBlockTobs.clear();
       m_allgJetTobs.clear();
+      m_allgGlobalTobs.clear();
 
 
       // int centralNphi = 32;
@@ -229,6 +230,7 @@ namespace LVL1 {
       m_allgRhoTobs = m_gFEXSimTool->getgRhoTOBs();
       m_allgBlockTobs = m_gFEXSimTool->getgBlockTOBs();
       m_allgJetTobs = m_gFEXSimTool->getgJetTOBs();
+      m_allgGlobalTobs = m_gFEXSimTool->getgGlobalTOBs();
       m_gFEXSimTool->reset();
 
 
@@ -244,6 +246,10 @@ namespace LVL1 {
       m_gJetAuxContainer = std::make_unique<xAOD::gFexJetRoIAuxContainer> ();
       m_gJetContainer->setStore(m_gJetAuxContainer.get());
 
+      m_gGlobalContainer = std::make_unique<xAOD::gFexGlobalRoIContainer> ();
+      m_gGlobalAuxContainer = std::make_unique<xAOD::gFexGlobalRoIAuxContainer> ();
+      m_gGlobalContainer->setStore(m_gGlobalAuxContainer.get());
+
       //iterate over all gRho Tobs and fill EDM with them
       for(auto &tob : m_allgRhoTobs){
          ATH_CHECK(fillgRhoEDM(tob));
@@ -257,6 +263,10 @@ namespace LVL1 {
       for(auto &tob : m_allgJetTobs){
          ATH_CHECK(fillgJetEDM(tob));
       }
+      //iterate over all Global Tobs and fill EDM with them
+      for(auto &tob : m_allgGlobalTobs){
+         ATH_CHECK(fillgGlobalEDM(tob));
+      }
 
       SG::WriteHandle<xAOD::gFexJetRoIContainer> outputgFexJetHandle(m_gFexJetOutKey/*, ctx*/);
       ATH_MSG_DEBUG("   write: " << outputgFexJetHandle.key() << " = " << "..." );
@@ -266,36 +276,39 @@ namespace LVL1 {
    }
 
    StatusCode gFEXSysSim::fillgRhoEDM(uint32_t tobWord){
-      xAOD::gFexJetRoI* myEDM = new xAOD::gFexJetRoI();
-      m_gRhoContainer->push_back( myEDM );
-      myEDM->initialize(tobWord);
-      ATH_MSG_DEBUG(" setting gRho : " << myEDM->tobEt()  );
 
-      return StatusCode::SUCCESS;
+      std::unique_ptr<xAOD::gFexJetRoI> myEDM (new xAOD::gFexJetRoI());
+      m_gRhoContainer->push_back(std::move(myEDM));
+      m_gRhoContainer->back()->initialize(tobWord);
 
+      return StatusCode::SUCCESS;
    }
 
    StatusCode gFEXSysSim::fillgBlockEDM(uint32_t tobWord){
-      xAOD::gFexJetRoI* myEDM = new xAOD::gFexJetRoI();
-      m_gBlockContainer->push_back( myEDM );
 
-      myEDM->initialize(tobWord);
-      ATH_MSG_DEBUG(" setting gBlock et: " << myEDM->tobEt() << " eta: " << myEDM->iEta() <<   " phi: " << myEDM->iPhi() );
+      std::unique_ptr<xAOD::gFexJetRoI> myEDM (new xAOD::gFexJetRoI());
+      m_gBlockContainer->push_back(std::move(myEDM));
+      m_gBlockContainer->back()->initialize(tobWord);
 
       return StatusCode::SUCCESS;
-
    }
 
    StatusCode gFEXSysSim::fillgJetEDM(uint32_t tobWord){
 
-      xAOD::gFexJetRoI* myEDM = new xAOD::gFexJetRoI();
-      m_gJetContainer->push_back( myEDM );
-
-      myEDM->initialize(tobWord);
-      ATH_MSG_DEBUG(" setting gJet et: " << myEDM->tobEt() << " eta: " << myEDM->iEta() <<   " phi: " << myEDM->iPhi() );
+      std::unique_ptr<xAOD::gFexJetRoI> myEDM (new xAOD::gFexJetRoI());
+      m_gJetContainer->push_back(std::move(myEDM));
+      m_gJetContainer->back()->initialize(tobWord);
 
       return StatusCode::SUCCESS;
+   }
+
+   StatusCode gFEXSysSim::fillgGlobalEDM(uint32_t tobWord){
 
+      std::unique_ptr<xAOD::gFexGlobalRoI> myEDM (new xAOD::gFexGlobalRoI());
+      m_gGlobalContainer->push_back(std::move(myEDM));
+      m_gGlobalContainer->back()->initialize(tobWord);
+
+      return StatusCode::SUCCESS;
    }
 
 
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXJwoJAlgo.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXJwoJAlgo.h
new file mode 100644
index 000000000000..8fb4d469fa7d
--- /dev/null
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXJwoJAlgo.h
@@ -0,0 +1,45 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+
+#ifndef IgFEXJwoJAlgo_H
+#define IgFEXJwoJAlgo_H
+
+#include "GaudiKernel/IAlgTool.h"
+#include "L1CaloFEXSim/gFEXJwoJTOB.h"
+#include "L1CaloFEXSim/FEXAlgoSpaceDefs.h"
+
+namespace LVL1 {
+
+/*
+Interface definition for gFEXJwoJAlgo
+*/
+
+  static const InterfaceID IID_IgFEXJwoJAlgo("LVL1::IgFEXJwoJAlgo", 1, 0);
+  typedef  std::array<std::array<int, 12>, 32> gTowersCentral;
+  typedef  std::array<std::array<int, 7>, 32> gTowersForward;
+
+  class IgFEXJwoJAlgo : virtual public IAlgTool {
+  public:
+    static const InterfaceID& interfaceID( ) ;
+
+
+    virtual void setAlgoConstant(unsigned int aFPGA_A, unsigned int bFPGA_A,
+                                 unsigned int aFPGA_B, unsigned int bFPGA_B,
+                                 int gblockThreshold) = 0;
+
+    virtual std::vector<std::unique_ptr<gFEXJwoJTOB>> jwojAlgo(gTowersCentral Atwr, gTowersCentral Btwr,
+                                                                            std::array<uint32_t, 4> & outTOB) = 0;
+
+
+  };
+
+  inline const InterfaceID& LVL1::IgFEXJwoJAlgo::interfaceID()
+  {
+    return IID_IgFEXJwoJAlgo;
+  }
+
+} // end of namespace
+
+#endif
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSim.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSim.h
index 329dfe560afc..38c70ed13c27 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSim.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSim.h
@@ -36,6 +36,8 @@ Interface definition for gFEXSim
 
     virtual std::vector<uint32_t> getgJetTOBs() const =0;
 
+    virtual std::vector<uint32_t> getgGlobalTOBs() const =0;
+
   private:
 
   };
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSysSim.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSysSim.h
index a42656e6be15..24c9469abd6e 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSysSim.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSysSim.h
@@ -33,6 +33,8 @@ Interface definition for gFEXSysSim
 
     virtual StatusCode fillgJetEDM(uint32_t tobWord) = 0;
 
+    virtual StatusCode fillgGlobalEDM(uint32_t tobWord) = 0;
+
   private:
 
   };
-- 
GitLab


From a066d4ff52cc0b5f4b67c64b2bf5d2cc25d38781 Mon Sep 17 00:00:00 2001
From: Christian Sander <christian.sander@desy.de>
Date: Thu, 9 Sep 2021 12:00:10 +0200
Subject: [PATCH 035/347] Modificatins after Tzero check of rel22

---
 .../SCT_CalibAlgs/python/runSelector.py       |  2 +-
 .../SCT_CalibAlgs/scripts/sct_calib_tf.py     | 55 +++++++-------
 .../SCT_CalibAlgs/share/ReadCoolUPD4.py       | 44 +++++++-----
 .../SCT_CalibAlgs/share/skeleton.sct_calib.py | 72 ++++++++++---------
 .../SCT_CalibAlgs/src/SCTCalib.cxx            |  4 +-
 5 files changed, 99 insertions(+), 78 deletions(-)

diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/python/runSelector.py b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/python/runSelector.py
index 513a1d4bc3a2..86d069fa5d3e 100755
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/python/runSelector.py
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/python/runSelector.py
@@ -165,7 +165,7 @@ def main( runNum = None, procType = None, forceSkipQueue = 0, Stream = None ):
                 if 'Project tag:' in line and runPro=='':
                     runPro = line.split('\'')[1]
                 if runNum!='' and runPro!='':
-                    if 'data15_cos' in runPro or 'data15_13TeV' in runPro or 'data15_hi' in runPro or 'data15_5TeV' in runPro:
+                    if 'data' in runPro:
                         runList.append(runNum)
                         runDict[runNum] = runPro
                     runNum=''
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/scripts/sct_calib_tf.py b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/scripts/sct_calib_tf.py
index 1e866866da36..aca2aaa9ee69 100755
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/scripts/sct_calib_tf.py
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/scripts/sct_calib_tf.py
@@ -505,31 +505,41 @@ class SCTCalibExecutor( athenaExecutor ):
                 rootBSerrFiles.append(inputFileName)
 
         if runArgs['splitHitMap']._value ==2 :
-            if len(rootBSerrFiles) == len(rootHitmapFiles) and len(rootHitmapFiles) > 0 :
-
+            
+            if len(rootHitmapFiles) > 0 :
+                
                 fileutil.remove('SCTHitMaps.root')
-                fileutil.remove('SCTLB.root')
-                fileutil.remove('SCTBSErrors.root')
 
                 cmd = "cp -v $ROOTSYS/bin/hadd . \n"
-                cmd += "hadd SCTHitMaps.root " 
+                cmd += "hadd -n 10 SCTHitMaps.root " 
                 for inputFileName in rootHitmapFiles :
                     cmd += "%s " %(inputFileName)
                 cmd += "\n"
-#                cmd += " >> /dev/null 2>&1 \n"
-                cmd += "hadd SCTLB.root "
+            
+                print (cmd)
+                self._echologger.info('Merging Hitmap files!')
+                retcode=1
+                try:
+                    retcode = os.system(cmd)
+                except (OSError, e):
+                    retcode = 1
+                if retcode == 0:
+                    self._echologger.info('Root merge successful')
+                else:
+                    self._echologger.error("FAILED to merge root files")
+            
+            if ( len(rootLbFiles) > 0 and (len(rootLbFiles) == len(rootHitmapFiles)) ):
+                
+                fileutil.remove('SCTLB.root')
+
+                cmd = "cp -v $ROOTSYS/bin/hadd . \n"
+                cmd += "hadd -n 10 SCTLB.root " 
                 for inputFileName in rootLbFiles :
                     cmd += "%s " %(inputFileName)
                 cmd += "\n"
-#                cmd += " >> /dev/null 2>&1 \n"
-                cmd += "hadd SCTBSErrors.root "
-                for inputFileName in rootBSerrFiles :
-                    cmd += "%s " %(inputFileName)
-                cmd += "\n"
-#                cmd += " >> /dev/null 2>&1 \n"
             
                 print (cmd)
-                self._echologger.info('Merging Hitmap, LB and BSerr files!')
+                self._echologger.info('Merging LBHitmap files!')
                 retcode=1
                 try:
                     retcode = os.system(cmd)
@@ -540,25 +550,18 @@ class SCTCalibExecutor( athenaExecutor ):
                 else:
                     self._echologger.error("FAILED to merge root files")
 
-            elif len(rootLbFiles) == len(rootHitmapFiles) and len(rootHitmapFiles) > 0 :
+            if ( len(rootBSerrFiles) > 0 and (len(rootBSerrFiles) == len(rootHitmapFiles)) ):
 
-                fileutil.remove('SCTHitMaps.root')
-                fileutil.remove('SCTLB.root')
+                fileutil.remove('SCTBSErrors.root')
 
                 cmd = "cp -v $ROOTSYS/bin/hadd . \n"
-                cmd += "hadd SCTHitMaps.root " 
-                for inputFileName in rootHitmapFiles :
-                    cmd += "%s " %(inputFileName)
-                cmd += "\n"
-#                cmd += " >> /dev/null 2>&1 \n"
-                cmd += "hadd SCTLB.root "
-                for inputFileName in rootLbFiles :
+                cmd += "hadd -n 10 SCTBSErrors.root " 
+                for inputFileName in rootBSerrFiles :
                     cmd += "%s " %(inputFileName)
                 cmd += "\n"
-#                cmd += " >> /dev/null 2>&1 \n"
             
                 print (cmd)
-                self._echologger.info('Merging Hitmap and LB files!')
+                self._echologger.info('Merging BSerr files!')
                 retcode=1
                 try:
                     retcode = os.system(cmd)
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCoolUPD4.py b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCoolUPD4.py
index 844bc1541e0d..e23665cb12dc 100755
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCoolUPD4.py
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCoolUPD4.py
@@ -27,21 +27,31 @@ def openDatabase(dbstring):
       print(e)
       sys.exit(-1)
   return db
-  
-#def formIov(runNumber):
-#  s,u=(runNumber << 32), ((runNumber + 1) << 32) - 1
-#  print ("formIOV: ", s, u)
-#  return s,u
-  
-#CS: this version is needed if previous runs are processed (make sure runNumberSave is small enough)
+
 def formIov(runNumber):
-  #runNumberSave = 364160
-  #runNumberSave = 364076
-  #runNumberSave = 359398
-  runNumberSave = 364214
-  s,u=(runNumberSave << 32), ((runNumber + 1) << 32) - 1
+  s,u=((runNumber-1 ) << 32), ((runNumber + 1) << 32) - 1
+  print ("formIOV: ", s, u)
   return s,u
 
+def formIovFromTo(runNumberStart, runNumber):
+  s,u=((runNumberStart ) << 32), ((runNumber + 1) << 32) - 1
+  print ("formIOV: ", s, u)
+  return s,u
+  
+#CS this modification checks which was the k-last run before the processed one
+def getRunNumberStart(runNumber, k):
+    runlistfile = open("/afs/cern.ch/user/s/sctcalib/public/runlist.txt", "r")
+    content = runlistfile.read()
+    runlistfile.close()
+    content_list = content.split("\n")
+    content_list = [line for line in content_list if line.strip()]
+    integer_int_list = list(map(int, content_list))
+    if (runNumber >= integer_int_list[-1]):
+        RNS = integer_int_list[len(integer_int_list)-k]
+    else:
+        RNS = integer_int_list[integer_int_list.index(runNumber)-k]
+    return RNS
+  
 #############################################################################################
 def GetRunList(dbstring, folder, tag, runNumber, k):
     db=openDatabase(dbstring)
@@ -56,7 +66,9 @@ def GetRunList(dbstring, folder, tag, runNumber, k):
     print('    taglist=myfolder.listTags()')
     for i in taglist: print(i)
     
-    iovSince, iovUntil = formIov(runNumber)
+    runNumberStart = getRunNumberStart(runNumber, k)
+    
+    iovSince, iovUntil = formIovFromTo(runNumberStart,runNumber)
  
     temp=[]
     objs=myfolder.browseObjects(iovSince,iovUntil,cool.ChannelSelection.all(),tag)
@@ -77,10 +89,10 @@ def GetRunList(dbstring, folder, tag, runNumber, k):
     #ls.append(Temp[len(Temp)-1])
     print(ls)
 
-    list=[]
-    for i in range(k): list.append( ls[len(ls)-i-1] )
+    mylist=[]
+    for i in range(k): mylist.append( ls[len(ls)-i-1] )
         
-    return list
+    return mylist
 
 #############################################################################################
 def GetNumNoisyMods(dbstring, folder, tag, runNumber):
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/skeleton.sct_calib.py b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/skeleton.sct_calib.py
index 222bfdeee5ed..eefb9ce134f3 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/skeleton.sct_calib.py
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/skeleton.sct_calib.py
@@ -14,7 +14,7 @@ import os,sys,time,glob,fnmatch
 import AthenaCommon.AtlasUnixStandardJob
 
 #--- McEventSelector
-if runArgs.InputType is not 'RAW':
+if runArgs.InputType != 'RAW':
     import AthenaCommon.AtlasUnixGeneratorJob
 
 #--- get a handle to the default top-level algorithm sequence
@@ -75,36 +75,16 @@ if hasattr( runArgs, 'maxEvents' ) :
     EvtMax = runArgs.maxEvents
 
 #--- Setting output prefix
-if hasattr( runArgs, 'prefix' ) and runArgs.prefix is not '' :
+if hasattr( runArgs, 'prefix' ) and runArgs.prefix != '' :
     prefix = runArgs.prefix+'.'
 else :
     prefix=''
     
 
-if hasattr( runArgs, 'InputType' ) and runArgs.InputType is 'RAW' :
+if hasattr( runArgs, 'InputType' ) and runArgs.InputType == 'RAW' :
     ReadBS = True
 else :
     ReadBS = False
-
-if hasattr( runArgs, 'splitHitMap' ) :
-    if runArgs.splitHitMap == 0:
-      DoHitMapsLB = True
-      DoHitMaps   = True
-      ReadHitMaps = False
-    elif runArgs.splitHitMap == 1:
-      DoHitMapsLB = True
-      DoHitMaps   = True
-      ReadHitMaps = True
-    elif runArgs.splitHitMap == 2:
-      DoHitMapsLB = False
-      DoHitMaps   = False
-      ReadHitMaps = True
-      if EvtMax != 1 :
-        print("WARNING! EvtMax is not 1, although HitMap analysis is run!")
-else :
-      DoHitMapsLB = False
-      DoHitMaps   = False
-      ReadHitMaps = False
     
 
 #--- Setting which algorithms to be run
@@ -155,6 +135,32 @@ if hasattr( runArgs, 'part' ) :
         DoLorentzAngle = False
 
 
+if hasattr( runArgs, 'splitHitMap' ) :
+    if runArgs.splitHitMap == 0 :
+        if DoNoisyStrip :
+            DoHitMapsLB = True
+        else :
+            DoHitMapsLB = False
+        DoHitMaps   = True
+        ReadHitMaps = False
+    elif runArgs.splitHitMap == 1:
+        if DoNoisyStrip:
+            DoHitMapsLB = True
+        else :
+            DoHitMapsLB = False
+        DoHitMaps   = True
+        ReadHitMaps = True
+    elif runArgs.splitHitMap == 2:
+      DoHitMapsLB = False
+      DoHitMaps   = False
+      ReadHitMaps = True
+      if EvtMax != 1 :
+        print("WARNING! EvtMax is not 1, although HitMap analysis is run!")
+else :
+      DoHitMapsLB = False
+      DoHitMaps   = False
+      ReadHitMaps = False
+
 #--------------------------------------------------------------
 # Read start/end time stamp and LB for HIST
 #--------------------------------------------------------------
@@ -166,12 +172,12 @@ DAQConfig = ''
 
 if os.path.exists("./runInfo.txt") :
     runInfo = open( './runInfo.txt', 'r' ).read()
-    list  = runInfo.split( ' ' )
-    ProjTag   = list[1]
-    SORTime   = list[2]
-    EORTime   = list[3]
-    nLB       = list[4]
-    DAQConfig = list[5]
+    RIlist  = runInfo.split( ' ' )
+    ProjTag   = RIlist[1]
+    SORTime   = RIlist[2]
+    EORTime   = RIlist[3]
+    nLB       = RIlist[4]
+    DAQConfig = RIlist[5]
 else :
     ProjTag   = 'cannot retrieve ProjTag'
     SORTime   = 'cannot retrieve SORTime'
@@ -183,7 +189,7 @@ else :
 #--------------------------------------------------------------
 # Set up RunNo/initial timestamp when running over HIST
 #--------------------------------------------------------------
-if runArgs.InputType is not 'RAW':
+if runArgs.InputType != 'RAW':
     ServiceMgr.EventSelector.RunNumber         = runArgs.RunNumber
     ServiceMgr.EventSelector.FirstEvent        = runArgs.EventNumber
     ServiceMgr.EventSelector.FirstLB           = 0
@@ -526,11 +532,11 @@ SCTCalib.DoBSErrors       = DoBSErrors       # True  in default
 SCTCalib.ReadBS         = ReadBS
 #--- Input files
 if hasattr( runArgs, 'InputType' ) :
-    if runArgs.InputType is 'RAW' :
+    if runArgs.InputType == 'RAW' :
         ServiceMgr.EventSelector.Input = runArgs.inputNames
-    elif runArgs.InputType is 'NTUP_TRKVALID' :
+    elif runArgs.InputType == 'NTUP_TRKVALID' :
         SCTCalib.InputTrkVal                       = runArgs.inputNames
-    elif runArgs.InputType is 'HIST' :
+    elif runArgs.InputType == 'HIST' :
         SCTCalib.InputHist                         = runArgs.inputNames
 else :
     if DoNoisyStrip or DoHV or DoDeadStrip or DoDeadChip :
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
index ee45f3d3b296..8e287a7c6d0e 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
@@ -695,11 +695,11 @@ StatusCode SCTCalib::getDeadStrip ATLAS_NOT_THREAD_SAFE () { // Thread unsafe SC
    unsigned int minStat{busyStream ? static_cast<unsigned int>(m_deadStripMinStatBusy) : static_cast<unsigned int>(m_deadStripMinStat)};
    if (m_doDeadStrip and m_numberOfEvents<minStat) {
       ATH_MSG_WARNING("required minimum statistics is " << minStat/1E3 << "k events for DeadStrip search with this stream");
-      m_doDeadStrip = false;
+      m_doDeadStrip = true; // CS: do it anyway
    }
    if (m_doDeadChip and m_numberOfEvents<m_deadChipMinStat) {
       ATH_MSG_WARNING("required minimum statistics is " << static_cast<unsigned int>(m_deadChipMinStat) << " events for DeadChip search");
-      m_doDeadChip = false;
+      m_doDeadChip = true; // CS: do it anyway
    }
    if (m_doDeadStrip==false and m_doDeadChip==false) {
       ATH_MSG_ERROR("Number of events "  << m_numberOfEvents << " is less than the required minimum number of events... exit getDeadStrip()");
-- 
GitLab


From 75cc43ef1bc366d0fb275389f3533f04077ca863 Mon Sep 17 00:00:00 2001
From: Andrii Verbytskyi <andrii.verbytskyi@cern.ch>
Date: Thu, 9 Sep 2021 12:02:44 +0200
Subject: [PATCH 036/347] Updates of Simulation codes for HepMC3 compatibility

---
 .../src/TruthClosureCheck.cxx                 | 221 ++++++++++++++++--
 .../src/TruthClosureCheck.h                   |  13 +-
 2 files changed, 218 insertions(+), 16 deletions(-)

diff --git a/Simulation/Tools/McEventCollectionFilter/src/TruthClosureCheck.cxx b/Simulation/Tools/McEventCollectionFilter/src/TruthClosureCheck.cxx
index 3d8d00a0b9ba..4d7f27bf4e5b 100644
--- a/Simulation/Tools/McEventCollectionFilter/src/TruthClosureCheck.cxx
+++ b/Simulation/Tools/McEventCollectionFilter/src/TruthClosureCheck.cxx
@@ -1,11 +1,11 @@
 /*
-  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 "TruthClosureCheck.h"
 //
-#include "HepMC/GenEvent.h"
-#include "HepMC/GenVertex.h"
+#include "AtlasHepMC/GenEvent.h"
+#include "AtlasHepMC/GenVertex.h"
 #include "GeneratorObjects/McEventCollection.h"
 
 #include "StoreGate/ReadHandle.h"
@@ -40,32 +40,28 @@ StatusCode TruthClosureCheck::initialize() {
 
 StatusCode TruthClosureCheck::sanityCheck(const HepMC::GenEvent& event) const {
   //Sanity check
-  HepMC::GenEvent::particle_const_iterator partIter = event.particles_begin();
-  const HepMC::GenEvent::particle_const_iterator partEnd = event.particles_end();
   bool resetProblem(false);
-  while (partIter!=partEnd) {
-    const HepMC::GenParticle& particle(**partIter);
-    if (particle.status()==1) {
-      if (!particle.production_vertex()) {
+  for (auto particle: event) {
+    if (particle->status() == 1) {
+      if (!particle->production_vertex()) {
         ATH_MSG_ERROR("Status 1 particle without a production vertex!! " << particle);
         resetProblem = true;
       }
-      if (!m_postSimulation && particle.end_vertex()) {
+      if (!m_postSimulation && particle->end_vertex()) {
         ATH_MSG_ERROR("Status 1 particle with an end vertex!! " << particle);
         resetProblem = true;
       }
     }
-    else if (particle.status()==2) {
-      if (!particle.production_vertex()) {
+    else if (particle->status() == 2) {
+      if (!particle->production_vertex()) {
         ATH_MSG_ERROR("Status 2 particle without a production vertex!! " << particle);
         resetProblem = true;
       }
-      if (!particle.end_vertex()) {
+      if (!particle->end_vertex()) {
         ATH_MSG_ERROR("Status 2 particle without an end vertex!! " << particle);
         resetProblem = true;
       }
     }
-    ++partIter;
   }
   if (resetProblem) {
     return StatusCode::FAILURE;
@@ -74,6 +70,28 @@ StatusCode TruthClosureCheck::sanityCheck(const HepMC::GenEvent& event) const {
   return StatusCode::SUCCESS;
 }
 
+#ifdef HEPMC3
+void TruthClosureCheck::printGenVertex(HepMC::ConstGenVertexPtr origVertex,
+                                       HepMC::ConstGenVertexPtr resetVertex) const
+{
+  ATH_MSG_INFO("----------------------------------");
+  ATH_MSG_INFO("Original Vertex:");
+  ATH_MSG_INFO( origVertex );
+  ATH_MSG_INFO("Particles In:");
+  for (auto originalPartIn: origVertex->particles_in()) ATH_MSG_INFO( originalPartIn );
+  ATH_MSG_INFO("Particles Out:");
+  for (auto originalPartOut: origVertex->particles_out()) ATH_MSG_INFO( originalPartOut );
+  ATH_MSG_INFO("----------------------------------");
+  ATH_MSG_INFO("Reset Vertex:");
+  ATH_MSG_INFO( resetVertex );
+  ATH_MSG_INFO("Particles In:");
+  for (auto resetPartIn: resetVertex->particles_in()) ATH_MSG_INFO( resetPartIn );
+  ATH_MSG_INFO("Particles Out:");
+  for (auto resetPartOut: resetVertex->particles_out()) ATH_MSG_INFO( resetPartOut );
+  ATH_MSG_INFO("----------------------------------");
+  return;
+}
+#else
 
 void TruthClosureCheck::printGenVertex(const HepMC::GenVertex& origVertex,
                                        const HepMC::GenVertex& resetVertex) const
@@ -115,7 +133,69 @@ void TruthClosureCheck::printGenVertex(const HepMC::GenVertex& origVertex,
   ATH_MSG_INFO("----------------------------------");
   return;
 }
+#endif
 
+#ifdef HEPMC3
+StatusCode TruthClosureCheck::compareGenVertex(HepMC::ConstGenVertexPtr origVertex,
+                                               HepMC::ConstGenVertexPtr resetVertex) const
+{
+  if (!origVertex && !resetVertex) return StatusCode::SUCCESS;
+  if (!origVertex || !resetVertex) return StatusCode::FAILURE;
+  bool pass{true};
+
+  if (HepMC::barcode(origVertex) != HepMC::barcode(resetVertex)) {
+    ATH_MSG_ERROR ("vertex barcode differs! Original: "<<HepMC::barcode(origVertex)<<", Reset: "<<HepMC::barcode(resetVertex));
+    pass = false;
+  }
+  if (origVertex->position() != resetVertex->position()) {
+    const HepMC::FourVector& oP = origVertex->position();
+    const HepMC::FourVector& rP = resetVertex->position();
+    ATH_MSG_ERROR("vertex position differs! Original: ("<<oP.x()<<","<<oP.y()<<","<<oP.z()<<","<<oP.t()<<"), Reset: ("<<rP.x()<<","<<rP.y()<<","<<rP.z()<<","<<rP.t()<<")");
+    pass = false;
+  }
+  if (origVertex->particles_in().size() != resetVertex->particles_in().size() ) {
+    ATH_MSG_ERROR ("particles_in_size differs! Original: "<<origVertex->particles_in().size()<<", Reset: "<<resetVertex->particles_in().size());
+    pass = false;
+  }
+  if (origVertex->particles_out().size() != resetVertex->particles_out().size() ) {
+    ATH_MSG_ERROR ("particles_out_size differs! Original: "<<origVertex->particles_out().size()<<", Reset: "<<resetVertex->particles_out().size());
+    pass = false;
+  }
+  std::vector<HepMC::ConstGenParticlePtr> OriginalListOfParticlesIn = origVertex->particles_in();
+  std::vector<HepMC::ConstGenParticlePtr> ResetListOfParticlesIn = resetVertex->particles_in();
+  for ( std::vector<HepMC::ConstGenParticlePtr>::iterator originalPartInIter(OriginalListOfParticlesIn.begin()),resetPartInIter(ResetListOfParticlesIn.begin()); 
+        originalPartInIter != OriginalListOfParticlesIn.end() && resetPartInIter != ResetListOfParticlesIn.end(); 
+        ++originalPartInIter, ++resetPartInIter
+       ) {
+    if (compareGenParticle(*originalPartInIter,*resetPartInIter).isFailure()) {
+      ATH_MSG_ERROR ( "input particle properties differ!" );
+      pass &= false;
+    }
+    ATH_MSG_VERBOSE ( "particles match!" );
+  }
+
+
+  std::vector<HepMC::ConstGenParticlePtr> OriginalListOfParticlesOut = origVertex->particles_out();
+  std::vector<HepMC::ConstGenParticlePtr> ResetListOfParticlesOut = resetVertex->particles_out();
+  std::sort(OriginalListOfParticlesOut.begin(), OriginalListOfParticlesOut.end(), [](auto& a, auto& b) -> bool{return HepMC::barcode(a) > HepMC::barcode(b); });
+  std::sort(ResetListOfParticlesOut.begin(), ResetListOfParticlesOut.end(), [](auto& a, auto& b) -> bool{return HepMC::barcode(a) > HepMC::barcode(b); });
+
+  for ( std::vector<HepMC::ConstGenParticlePtr>::iterator originalPartOutIter(OriginalListOfParticlesOut.begin()), resetPartOutIter(ResetListOfParticlesOut.begin()); 
+        originalPartOutIter != OriginalListOfParticlesOut.end() && resetPartOutIter != ResetListOfParticlesOut.end(); 
+        ++originalPartOutIter, ++resetPartOutIter
+       ) {
+    if (compareGenParticle(*originalPartOutIter,*resetPartOutIter).isFailure()) {
+      ATH_MSG_ERROR ( "output particle properties differ!" );
+      pass &= false;
+    }
+    ATH_MSG_VERBOSE ( "particles match!" );
+  }
+  if(!pass) { return StatusCode::FAILURE; }
+  return StatusCode::SUCCESS;
+}
+
+
+#else
 StatusCode TruthClosureCheck::compareGenVertex(const HepMC::GenVertex& origVertex,
                                                const HepMC::GenVertex& resetVertex) const
 {
@@ -181,6 +261,7 @@ StatusCode TruthClosureCheck::compareGenVertex(const HepMC::GenVertex& origVerte
   if(!pass) { return StatusCode::FAILURE; }
   return StatusCode::SUCCESS;
 }
+#endif
 
 
 StatusCode TruthClosureCheck::compareMomenta(const HepMC::FourVector& origMomenta,
@@ -209,6 +290,37 @@ StatusCode TruthClosureCheck::compareMomenta(const HepMC::FourVector& origMoment
   return StatusCode::SUCCESS;
 }
 
+#ifdef HEPMC3
+StatusCode TruthClosureCheck::compareGenParticle(HepMC::ConstGenParticlePtr origParticle,
+                                                 HepMC::ConstGenParticlePtr resetParticle) const
+{
+  if (!origParticle && !resetParticle) return StatusCode::SUCCESS;
+  if (!origParticle || !resetParticle) return StatusCode::FAILURE;
+  
+  bool pass{true};
+  if (HepMC::barcode(origParticle) != HepMC::barcode(resetParticle)) {
+    ATH_MSG_ERROR ("particle barcode differs! Original: "<<HepMC::barcode(origParticle)<<", Reset: "<<HepMC::barcode(resetParticle));
+    pass &= false;
+  }
+  if (origParticle->status() != resetParticle->status()) {
+    ATH_MSG_ERROR ("particle status differs! Original: "<<origParticle->status()<<", Reset: "<<resetParticle->status());
+    pass &= false;
+  }
+  if (origParticle->pdg_id() != resetParticle->pdg_id()) {
+    ATH_MSG_ERROR ("particle pdg_id differs! Original: "<<origParticle->pdg_id()<<", Reset: "<<resetParticle->pdg_id());
+    pass &= false;
+  }
+  if (compareMomenta(origParticle->momentum(), resetParticle->momentum()).isFailure()) {
+    const HepMC::FourVector& oM = origParticle->momentum();
+    const HepMC::FourVector& rM = resetParticle->momentum();
+    ATH_MSG_DEBUG("particle momentum differs! Original: ("<<oM.x()<<","<<oM.y()<<","<<oM.z()<<","<<oM.t()<<"), Reset: ("<<rM.x()<<","<<rM.y()<<","<<rM.z()<<","<<rM.t()<<")");
+    pass &= false;
+  }
+  if(!pass) { return StatusCode::FAILURE; }
+  return StatusCode::SUCCESS;
+}
+
+#else
 StatusCode TruthClosureCheck::compareGenParticle(const HepMC::GenParticle& origParticle,
                                                  const HepMC::GenParticle& resetParticle) const
 {
@@ -234,6 +346,86 @@ StatusCode TruthClosureCheck::compareGenParticle(const HepMC::GenParticle& origP
   if(!pass) { return StatusCode::FAILURE; }
   return StatusCode::SUCCESS;
 }
+#endif
+
+#ifdef HEPMC3
+//-------------------------------------------------
+StatusCode TruthClosureCheck::execute() {
+//-------------------------------------------------
+
+  ATH_MSG_DEBUG( " execute..... " );
+  SG::ReadHandle<McEventCollection> originalMcEventCollection(m_originalMcEventCollection);
+  if (!originalMcEventCollection.isValid()) {
+    ATH_MSG_ERROR("Could not find original McEventCollection called " << originalMcEventCollection.name() << " in store " << originalMcEventCollection.store() << ".");
+    return StatusCode::FAILURE;
+  }
+  const HepMC::GenEvent& originalEvent(**(originalMcEventCollection->begin()));
+
+  if (sanityCheck(originalEvent).isFailure()) {
+    ATH_MSG_FATAL("Problems in original GenEvent - bailing out.");
+    return StatusCode::FAILURE;
+  }
+
+  SG::ReadHandle<McEventCollection> resetMcEventCollection(m_resetMcEventCollection);
+  if (!resetMcEventCollection.isValid()) {
+    ATH_MSG_ERROR("Could not find reset McEventCollection called " << resetMcEventCollection.name() << " in store " << resetMcEventCollection.store() << ".");
+    return StatusCode::FAILURE;
+  }
+  const HepMC::GenEvent& resetEvent(**(resetMcEventCollection->begin()));
+
+  if (sanityCheck(resetEvent).isFailure()) {
+    ATH_MSG_FATAL("Problems in reset GenEvent - bailing out.");
+    return StatusCode::FAILURE;
+  }
+
+  if (originalEvent.event_number() != resetEvent.event_number() ) {
+    ATH_MSG_ERROR ("event_number differs! Original: "<<originalEvent.event_number()<<", Reset: "<<resetEvent.event_number());
+  }
+
+  if (HepMC::signal_process_id(originalEvent) != HepMC::signal_process_id(resetEvent) ) {
+    ATH_MSG_ERROR ("signal_process_id differs! Original: "<<HepMC::signal_process_id(originalEvent)<<", Reset: "<<HepMC::signal_process_id(resetEvent));
+  }
+///->
+  std::vector<HepMC::ConstGenParticlePtr> OriginalBeams = originalEvent.beams();
+  std::vector<HepMC::ConstGenParticlePtr> ResetBeams = resetEvent.beams();
+
+  for ( std::vector<HepMC::ConstGenParticlePtr>::iterator originalBeamIter(OriginalBeams.begin()), resetBeamIter(ResetBeams.begin()); 
+        originalBeamIter != OriginalBeams.end() && resetBeamIter != ResetBeams.end(); 
+        ++originalBeamIter, ++resetBeamIter
+       ) {
+    if (compareGenParticle(*originalBeamIter,*resetBeamIter).isFailure()) {
+      ATH_MSG_ERROR ( "Beam particle properties differ!" );
+    }
+///<=
+    if (originalEvent.particles().size() != resetEvent.particles().size() ) {
+      ATH_MSG_ERROR ("particles_size differs! Original: "<<originalEvent.particles().size()<<", Reset: "<<resetEvent.particles().size());
+    }
+
+    if (originalEvent.vertices().size() != resetEvent.vertices().size() ) {
+      ATH_MSG_ERROR ("vertices_size differs! Original: "<<originalEvent.vertices().size()<<", Reset: "<<resetEvent.vertices().size());
+    }
+  }
+
+  //loop over vertices in Background GenEvent
+  std::vector<HepMC::ConstGenVertexPtr> OriginalListOfVertices = originalEvent.vertices();
+  std::vector<HepMC::ConstGenVertexPtr> ResetListOfVertices = resetEvent.vertices();
+
+  for( std::vector<HepMC::ConstGenVertexPtr>::iterator origVertexIter(OriginalListOfVertices.begin()),resetVertexIter(ResetListOfVertices.begin()); 
+       origVertexIter != OriginalListOfVertices.end() && resetVertexIter != ResetListOfVertices.end(); 
+       ++origVertexIter, ++resetVertexIter
+       ) {
+    if (compareGenVertex(*origVertexIter,*resetVertexIter).isFailure()) {
+      ATH_MSG_ERROR ( "vertices differ!" );
+      printGenVertex(*origVertexIter,*resetVertexIter);
+    }
+  }
+  ATH_MSG_INFO( "Completed Truth reset closure check ..... " );
+
+  return StatusCode::SUCCESS;
+
+}
+
+#else
 
 
 //-------------------------------------------------
@@ -318,3 +510,4 @@ StatusCode TruthClosureCheck::execute() {
   return StatusCode::SUCCESS;
 
 }
+#endif
diff --git a/Simulation/Tools/McEventCollectionFilter/src/TruthClosureCheck.h b/Simulation/Tools/McEventCollectionFilter/src/TruthClosureCheck.h
index ed51fe64686a..653dcdf56eab 100644
--- a/Simulation/Tools/McEventCollectionFilter/src/TruthClosureCheck.h
+++ b/Simulation/Tools/McEventCollectionFilter/src/TruthClosureCheck.h
@@ -22,14 +22,23 @@ public:
 
   private:
    StatusCode sanityCheck(const HepMC::GenEvent& event) const;
+#ifdef HEPMC3
+   StatusCode compareGenVertex(HepMC::ConstGenVertexPtr origVertex,
+                               HepMC::ConstGenVertexPtr resetVertex) const;
+   StatusCode compareGenParticle(HepMC::ConstGenParticlePtr origParticle,
+                                 HepMC::ConstGenParticlePtr resetParticle) const;
+   void printGenVertex(HepMC::ConstGenVertexPtr origVertex,
+                       HepMC::ConstGenVertexPtr resetVertex) const;
+#else
    StatusCode compareGenVertex(const HepMC::GenVertex& origVertex,
                                const HepMC::GenVertex& resetVertex) const;
    StatusCode compareGenParticle(const HepMC::GenParticle& origParticle,
                                  const HepMC::GenParticle& resetParticle) const;
-   StatusCode compareMomenta(const HepMC::FourVector& origMomenta,
-                             const HepMC::FourVector& resetMomenta) const;
    void printGenVertex(const HepMC::GenVertex& origVertex,
                        const HepMC::GenVertex& resetVertex) const;
+#endif
+   StatusCode compareMomenta(const HepMC::FourVector& origMomenta,
+                             const HepMC::FourVector& resetMomenta) const;
 
    SG::ReadHandleKey<McEventCollection> m_originalMcEventCollection;
    SG::ReadHandleKey<McEventCollection> m_resetMcEventCollection;
-- 
GitLab


From 2f2aa319ccae38c5f85e234a3f5052eedfa370f5 Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Thu, 9 Sep 2021 12:04:50 +0200
Subject: [PATCH 037/347] Development towards new style config of LAr
 Calibration jobs

---
 .../LArCalibTools/src/LArOFC2Ntuple.cxx       |  12 +-
 .../python/LArCalibBaseConfig.py              |  27 +++
 .../python/LArCalibConfigFlags.py             |  38 +++-
 .../python/LArCalib_Delay_OFCCali.py          | 163 ++++++++++++++++++
 .../python/LArCalib_PedestalAutoCorrConfig.py |  41 ++---
 .../python/LArStripsXtalkCorrConfig.py        |  22 +++
 .../LArCalib_Delay_OFC_Cali_jobOptions.py     |   6 +-
 .../share/LArCalib_Ramp_testing.py            |   5 +-
 .../test/test_larcalib_ramp.sh                |   2 +-
 .../share/LArMinimalSetup.py                  |   1 +
 10 files changed, 278 insertions(+), 39 deletions(-)
 create mode 100644 LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibBaseConfig.py
 create mode 100644 LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
 create mode 100644 LArCalorimeter/LArExample/LArCalibProcessing/python/LArStripsXtalkCorrConfig.py

diff --git a/LArCalorimeter/LArCalibTools/src/LArOFC2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArOFC2Ntuple.cxx
index 255952820ad6..379933f3ed01 100644
--- a/LArCalorimeter/LArCalibTools/src/LArOFC2Ntuple.cxx
+++ b/LArCalorimeter/LArCalibTools/src/LArOFC2Ntuple.cxx
@@ -46,7 +46,17 @@ StatusCode LArOFC2Ntuple::stop() {
   ATH_CHECK( m_nt->addItem("OFCb",m_nSamples,OFCb) );
   
   // retrieve OFC object
-  SG::ReadCondHandle<ILArOFC> larOFC (m_ofcKey, ctx);
+
+  const ILArOFC* larOFC=nullptr;
+  //Try Det-Store (real data, elec-calib case)
+  if (detStore()->contains<ILArOFC>(m_ofcKey.key())) {
+    ATH_CHECK(detStore()->retrieve(larOFC,m_ofcKey.key()));
+  }
+  else {//Via ReadCondHandle from CondStore (MC case)
+    SG::ReadCondHandle<ILArOFC> larOFCHdl (m_ofcKey, ctx);  
+    larOFC=larOFCHdl.cptr();
+  }
+
   
   const LArOnOffIdMapping *cabling=0;
   if(m_isSC) {
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibBaseConfig.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibBaseConfig.py
new file mode 100644
index 000000000000..6a8a3cb71a80
--- /dev/null
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibBaseConfig.py
@@ -0,0 +1,27 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+
+def LArCalibBaseCfg(flags):  
+    result=ComponentAccumulator()
+    from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
+    result.merge(ByteStreamReadCfg(flags))
+
+    from DetDescrCnvSvc.DetDescrCnvSvcConfig import DetDescrCnvSvcCfg
+    result.merge(DetDescrCnvSvcCfg(flags))
+
+    from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg, LArCalibIdMappingCfg, LArOnOffIdMappingSCCfg#, LArCalibIdMappingSCCfg
+    if flags.LArCalib.isSC:
+        #Setup SuperCell cabling
+        result.merge(LArOnOffIdMappingSCCfg(flags))
+    else:
+        #Setup regular cabling
+
+        result.merge(LArOnOffIdMappingCfg(flags))
+        result.merge(LArCalibIdMappingCfg(flags))
+    
+    #Set up bad-channel config
+    from LArCalibProcessing.LArCalib_BadChannelConfig import LArCalibBadChannelCfg
+
+    result.merge(LArCalibBadChannelCfg(flags))
+    return result
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
index 81154177e121..50d9144ce145 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
@@ -3,11 +3,32 @@
 def addLArCalibFlags(flags):
     
     flags.Input.isMC=False
+    flags.addFlag("LArCalib.isSC",False)
     flags.addFlag("LArCalib.BadChannelDB","COOLOFL_LAR/COMP200")
     flags.addFlag("LArCalib.BadChannelTag","-UPD3-00")
-    flags.addFlag("LArCalib.Pedestal.Folder","/LAr/ElecCalibOfl/Pedestals/Pedestal")
-    flags.addFlag("LArCalib.AutoCorr.Folder","/LAr/ElecCalibOfl/AutoCorrs/AutoCorr")
-    flags.addFlag("LArCalib.GroupingType","ExtendedSubDetector")
+
+    #Folders:
+    def _prefix(prevFlags):
+        if prevFlags.LArCalib.isSC:
+            return "/LAR/ElecCalibOflSC/"
+        else:
+            return "/LAR/ElecCalibOfl/"
+
+    flags.addFlag("LArCalib.Pedestal.Folder", lambda prevFlags: _prefix(prevFlags)+"Pedestals/Pedestal")
+    flags.addFlag("LArCalib.AutoCorr.Folder", lambda prevFlags: _prefix(prevFlags)+"AutoCorrs/AutoCorr")
+    flags.addFlag("LArCalib.CaliWave.Folder", lambda prevFlags: _prefix(prevFlags)+"CaliWaves/CaliWave")
+    flags.addFlag("LArCalib.OFCCali.Folder",  lambda prevFlags: _prefix(prevFlags)+"OFC/CaliWave")
+    flags.addFlag("LArCalib.PhysWave.Folder", lambda prevFlags: _prefix(prevFlags)+"PhysWaves/RTM")
+    flags.addFlag("LArCalib.Ramp.Folder",     lambda prevFlags: _prefix(prevFlags)+"Ramps/RampLinea")
+    flags.addFlag("LArCalib.OFCPhys.Folder",  lambda prevFlags: _prefix(prevFlags)+"OFC/PhysWave/RTM/")
+    flags.addFlag("LArCalib.LArShapeFolder",  lambda prevFlags: _prefix(prevFlags)+"Shape/RTM/")
+
+    flags.addFlag("LArCalib.MPhysOverMCal.Folder", lambda prevFlags: _prefix(prevFlags)+"MphysOverMcal/RTM")
+
+    
+    
+
+    flags.addFlag("LArCalib.GroupingType",lambda prevFlags: "SuperCells" if prevFlags.LArCalib.isSC else "ExtendedSubDetector")
     flags.addFlag("LArCalib.Output.POOLFile","ouput.pool.root")
     flags.addFlag("LArCalib.Output.ROOTFile","")
 
@@ -15,11 +36,20 @@ def addLArCalibFlags(flags):
 
     flags.addFlag("LArCalib.doValidation",True)
 
-    #Flags to find the input files
+    #Flags to find the input files/databases
     flags.addFlag("LArCalib.Input.Dir",".")
     flags.addFlag("LArCalib.Input.RunNumbers",[])
     flags.addFlag("LArCalib.Input.Type","calibration_LArElec-Pedestal")
     flags.addFlag("LArCalib.Input.Files",_getInputFiles)
+    
+    flags.addFlag("LArCalib.Input.Database","LAR_OFL") #In practice, a sqlite file
+
+
+    flags.addFlag("LArCalib.Preselection.Side",[])
+    flags.addFlag("LArCalib.Preselection.BEC",[])
+    flags.addFlag("LArCalib.Preselection.FT",[])
+
+    flags.addFlag("LArCalib.GlobalTag","LARCALIB-RUN2-00")
 
 
 def _getInputFiles(prevFlags):
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
new file mode 100644
index 000000000000..89a7238fa0a0
--- /dev/null
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
@@ -0,0 +1,163 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentFactory import CompFactory 
+from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+
+def LArDelay_OFCCaliCfg(flags):
+
+    #Get basic services and cond-algos
+    from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg
+    result=LArCalibBaseCfg(flags)
+
+    #Calibration runs are taken in fixed gain. 
+    #The SG key of the digit-container is name of the gain
+    gainStrMap={0:"HIGH",1:"MEDIUM",2:"LOW"}
+    digKey=gainStrMap[flags.LArCalib.Gain]
+
+    from LArCalibProcessing.utils import FolderTagResolver
+    FolderTagResolver._globalTag=flags.LArCalib.GlobalTag
+    tagResolver=FolderTagResolver()
+    pedestalTag=tagResolver.getFolderTag(flags.LArCalib.Pedestal.Folder)
+    caliWaveTag=tagResolver.getFolderTag(flags.LArCalib.CaliWave.Folder)
+    caliOFCTag=tagResolver.getFolderTag(flags.LArCalib.OFCCali.Folder)
+    acTag=tagResolver.getFolderTag(flags.LArCalib.AutoCorr.Folder)
+    del tagResolver
+    
+    print("pedestalTag",pedestalTag)
+    print("acTag",acTag)
+
+
+    from IOVDbSvc.IOVDbSvcConfig import addFolders
+    result.merge(addFolders(flags,flags.LArCalib.Pedestal.Folder,detDb=flags.LArCalib.Input.Database, tag=pedestalTag))
+    result.merge(addFolders(flags,flags.LArCalib.AutoCorr.Folder,detDb=flags.LArCalib.Input.Database, tag=acTag))
+    
+
+    result.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArAccCalibDigitKey=digKey,
+                                                              LArFebHeaderKey="LArFebHeader",
+                                                              PosNegPreselection=flags.LArCalib.Preselection.Side,
+                                                              BEPreselection=flags.LArCalib.Preselection.BEC,
+                                                              FTNumPreselection=flags.LArCalib.Preselection.FT))
+    
+    from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
+    result.merge(LArFebErrorSummaryMakerCfg(flags))
+    result.getEventAlgo("LArFebErrorSummaryMaker").CheckAllFEB=False
+
+    from LArCalibProcessing.LArStripsXtalkCorrConfig import LArStripsXtalkCorrCfg
+    result.merge(LArStripsXtalkCorrCfg(flags,[digKey,]))
+    
+    
+    theLArCalibShortCorrector = CompFactory.LArCalibShortCorrector(KeyList = [digKey,])
+    result.addEventAlgo(theLArCalibShortCorrector)
+
+
+    theLArCaliWaveBuilder = CompFactory.LArCaliWaveBuilder()
+    theLArCaliWaveBuilder.KeyList= [digKey,]
+    theLArCaliWaveBuilder.KeyOutput="LArCaliWave"
+    theLArCaliWaveBuilder.GroupingType     = flags.LArCalib.GroupingType
+    theLArCaliWaveBuilder.SubtractPed      = True
+    theLArCaliWaveBuilder.CheckEmptyPhases = True
+    theLArCaliWaveBuilder.NBaseline        = 0 # to avoid the use of the baseline when Pedestal are missing
+    theLArCaliWaveBuilder.UseDacAndIsPulsedIndex = False # should have an impact only for HEC
+    theLArCaliWaveBuilder.RecAllCells      = False
+    theLArCaliWaveBuilder.isSC       = flags.LArCalib.isSC
+    result.addEventAlgo(theLArCaliWaveBuilder)
+    
+    
+
+    result.addPublicTool(CompFactory.LArAutoCorrDecoderTool(isSC=flags.LArCalib.isSC))
+
+    LArCaliOFCAlg = CompFactory.LArOFCAlg("LArCaliOFCAlg")
+    LArCaliOFCAlg.ReadCaliWave = True
+    LArCaliOFCAlg.KeyList   = [ "LArCaliWave" ]
+    LArCaliOFCAlg.Nphase    = 50
+    LArCaliOFCAlg.Dphase    = 1
+    LArCaliOFCAlg.Ndelay    = 24
+    LArCaliOFCAlg.Nsample   = 4
+    LArCaliOFCAlg.Normalize = True
+    LArCaliOFCAlg.TimeShift = False
+    LArCaliOFCAlg.TimeShiftByIndex = -1
+    LArCaliOFCAlg.Verify    = True
+    LArCaliOFCAlg.FillShape = False
+    #LArCaliOFCAlg.DumpOFCfile = "LArOFCCali.dat"
+    LArCaliOFCAlg.GroupingType = flags.LArCalib.GroupingType
+    LArCaliOFCAlg.isSC = flags.LArCalib.isSC
+    LArCaliOFCAlg.DecoderTool='LArAutoCorrDecoderTool/LArAutoCorrDecoderTool'
+    result.addEventAlgo(LArCaliOFCAlg)
+
+
+    #ROOT ntuple writing:
+    rootfile=flags.LArCalib.Output.ROOTFile
+    if rootfile != "":
+        result.addEventAlgo(CompFactory.LArCaliWaves2Ntuple(KeyList = ["LArCaliWave",],
+                                                            AddFEBTempInfo = False
+                                                        ))
+
+        result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC",
+                                                      AddFEBTempInfo  = False
+                                                  ))
+
+        import os
+        if os.path.exists(rootfile):
+            os.remove(rootfile)
+        result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
+        result.setAppProperty("HistogramPersistency","ROOT")
+        pass # end if ROOT ntuple writing
+
+
+
+    #Get the current folder tag by interrogating the database:
+    from LArCalibProcessing.utils import FolderTagResolver
+    tagResolver=FolderTagResolver()
+    caliWaveTag=tagResolver.getFolderTag(flags.LArCalib.CaliWave.Folder)
+    caliOFCTag=tagResolver.getFolderTag(flags.LArCalib.OFCCali.Folder)
+    del tagResolver
+
+
+    #Output (POOL + sqlite) file writing:
+    from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
+    result.merge(OutputConditionsAlgCfg(flags,
+                                        outputFile=flags.LArCalib.Output.POOLFile,
+                                        ObjectList=["LArCaliWaveContainer#LArCaliWave#"+flags.LArCalib.CaliWave.Folder,
+                                                    "LArOFCComplete#LArOFC#"+flags.LArCalib.OFCCali.Folder],
+                                        IOVTagList=[caliWaveTag,caliOFCTag]
+                                    ))
+
+    #RegistrationSvc    
+    result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False))
+
+
+    result.getService("IOVDbSvc").DBInstance=""
+
+    return result
+
+
+if __name__ == "__main__":
+
+
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from LArCalibProcessing.LArCalibConfigFlags import addLArCalibFlags
+    addLArCalibFlags(ConfigFlags)
+
+
+    ConfigFlags.LArCalib.Input.Dir = "/scratch/wlampl/calib21/Aug27"
+    ConfigFlags.LArCalib.Input.Type="calibration_LArElec-Delay"
+    ConfigFlags.LArCalib.Input.RunNumbers=[400268,]
+    ConfigFlags.LArCalib.Input.Database="db.sqlite"
+    ConfigFlags.Input.Files=ConfigFlags.LArCalib.Input.Files
+    ConfigFlags.LArCalib.Preselection.BEC=[1]
+    ConfigFlags.LArCalib.Preselection.Side=[0]
+
+
+    ConfigFlags.LArCalib.Output.ROOTFile="ofccali.root"
+
+    ConfigFlags.IOVDb.DBConnection="sqlite://;schema=output.sqlite;dbname=CONDDBR2"
+    ConfigFlags.IOVDb.GlobalTag="LARCALIB-RUN2-02"
+    #ConfigFlags.Exec.OutputLevel=1
+    print ("Input files to be processed:")
+    for f in ConfigFlags.Input.Files:
+        print (f)
+
+    cfg=MainServicesCfg(ConfigFlags)
+    cfg.merge(LArDelay_OFCCaliCfg(ConfigFlags))
+    print("Start running...")
+    cfg.run()
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_PedestalAutoCorrConfig.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_PedestalAutoCorrConfig.py
index c0347073a7e0..c3635e336dfa 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_PedestalAutoCorrConfig.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_PedestalAutoCorrConfig.py
@@ -1,24 +1,12 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory 
 
 def LArPedestalAutoCorrCfg(flags):
 
-    result=ComponentAccumulator()
-
-    from DetDescrCnvSvc.DetDescrCnvSvcConfig import DetDescrCnvSvcCfg
-    result.merge(DetDescrCnvSvcCfg(flags))
-
-    #Setup cabling
-    from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg, LArCalibIdMappingCfg
-    result.merge(LArOnOffIdMappingCfg(flags))
-    result.merge(LArCalibIdMappingCfg(flags))
-    
-    #Set up bad-channel config
-    from LArCalibProcessing.LArCalib_BadChannelConfig import LArCalibBadChannelCfg
-
-    result.merge(LArCalibBadChannelCfg(flags))
+    #Get basic services and cond-algos
+    from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg
+    result=LArCalibBaseCfg(flags)
 
     #Calibration runs are taken in fixed gain. 
     #The SG key of the digit-container is name of the gain
@@ -63,8 +51,8 @@ def LArPedestalAutoCorrCfg(flags):
     #Get the current folder tag by interrogating the database:
     from LArCalibProcessing.utils import FolderTagResolver
     tagResolver=FolderTagResolver()
-    pedestalTag=tagResolver.getFolderTag(flags.LArCalib.Pedestal.Folder,flags.IOVDb.GlobalTag)
-    autocorrTag=tagResolver.getFolderTag(flags.LArCalib.AutoCorr.Folder,flags.IOVDb.GlobalTag)
+    pedestalTag=tagResolver.getFolderTag(flags.LArCalib.Pedestal.Folder)
+    autocorrTag=tagResolver.getFolderTag(flags.LArCalib.AutoCorr.Folder)
     del tagResolver
 
 
@@ -104,7 +92,7 @@ def LArPedestalAutoCorrCfg(flags):
         thePedestalValidationAlg.ListOfDevFEBs="pedFebs.txt"
         thePedestalValidationAlg.CheckCompletness=True
         thePedestalValidationAlg.PatchMissingFEBs=True
-        thePedestalValidationAlg.CheckNumberOfCoolChannels=True
+        thePedestalValidationAlg.CheckNumberOfCoolChannels=False
         thePedestalValidationAlg.UseCorrChannels=False #Corrections go into the regular data channels
         result.addEventAlgo(thePedestalValidationAlg)
 
@@ -138,7 +126,7 @@ def LArPedestalAutoCorrCfg(flags):
         theAutoCorrValidationAlg.ListOfDevFEBs="ACFebs.txt"
         theAutoCorrValidationAlg.CheckCompletness=True
         theAutoCorrValidationAlg.PatchMissingFEBs=True
-        theAutoCorrValidationAlg.CheckNumberOfCoolChannels=True
+        theAutoCorrValidationAlg.CheckNumberOfCoolChannels=False
         theAutoCorrValidationAlg.UseCorrChannels=False #Corrections go into the regular data channels
         result.addEventAlgo(theAutoCorrValidationAlg)
       
@@ -156,12 +144,14 @@ def LArPedestalAutoCorrCfg(flags):
         theBadAutoCorr.CheckNumberOfCoolChannels=False
         result.addEventAlgo(theBadAutoCorr)
 
+        result.getService("IOVDbSvc").DBInstance=""
+
     return result
 
 
 if __name__ == "__main__":
 
-
+    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     from LArCalibProcessing.LArCalibConfigFlags import addLArCalibFlags
     addLArCalibFlags(ConfigFlags)
@@ -176,22 +166,15 @@ if __name__ == "__main__":
     ConfigFlags.LArCalib.Output.ROOTFile="ped.root"
 
     ConfigFlags.IOVDb.DBConnection="sqlite://;schema=output.sqlite;dbname=CONDDBR2"
-    ConfigFlags.IOVDb.GlobalTag="LARCALIB-RUN2-00"
+    ConfigFlags.IOVDb.GlobalTag="LARCALIB-000-02"
 
     print ("Input files to be processed:")
     for f in ConfigFlags.Input.Files:
         print (f)
-    
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
-    cfg=MainServicesCfg(ConfigFlags)
 
-    from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
-
-    cfg.merge(ByteStreamReadCfg(ConfigFlags))
+    cfg=MainServicesCfg(ConfigFlags)
     cfg.merge(LArPedestalAutoCorrCfg(ConfigFlags))
 
-    cfg.getService("IOVDbSvc").DBInstance=""
-
     print("Start running...")
 
     cfg.run()
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArStripsXtalkCorrConfig.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArStripsXtalkCorrConfig.py
new file mode 100644
index 000000000000..147c3c68edf2
--- /dev/null
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArStripsXtalkCorrConfig.py
@@ -0,0 +1,22 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentFactory import CompFactory 
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+
+def LArStripsXtalkCorrCfg(flags,KeyList):
+    result=ComponentAccumulator()
+    
+    #Need geometry for neighbors
+    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
+    result.merge(LArGMCfg(flags))
+
+    theLArStripsCrossTalkCorrector = CompFactory.LArStripsCrossTalkCorrector()
+    theLArStripsCrossTalkCorrector.KeyList = KeyList
+    theLArStripsCrossTalkCorrector.ADCsaturation = 4095
+    theLArStripsCrossTalkCorrector.NoXtalkCorr=["deadReadout","deadPhys","deadCalib","almostDead"]
+    theLArStripsCrossTalkCorrector.DontUseForXtalkCorr=["short","peculiarCalibrationLine", "deadReadout", "deadPhys"]
+    theLArStripsCrossTalkCorrector.AcceptableDifference=25.0 #in per-cent
+    #theLArStripsCrossTalkCorrector.PedestalKey="LArPedestal"
+    result.addEventAlgo(theLArStripsCrossTalkCorrector)
+    
+    return result
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py
index 7fa29329d572..62039d934b70 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py
@@ -506,9 +506,9 @@ from IOVDbSvc.CondDB import conddb
 PoolFileList     = []
 
 if 'BadChannelsFolder' not in dir():
-   BadChannelsFolder="/LAR/BadChannels/BadChannels"
+   BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels"
 if 'MissingFEBsFolder' not in dir():
-   MissingFEBsFolder="/LAR/BadChannels/MissingFEBs"
+   MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs"
 
 if not 'InputBadChannelSQLiteFile' in dir():
    DelayOFCLog.info( "Read Bad Channels from Oracle DB")
@@ -793,7 +793,7 @@ if ( doMonitoring ) :
       os.remove(OutputRootFileDir + "/" +RootHistOutputFileName)
    ServiceMgr += THistSvc()
 
-   ServiceMgr.THistSvc.Output =  ["GLOBAL DATAFILE='"+OutputRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"]
+   ServiceMgr.THistSvc.Output =  ["GLOBAL DATAFILE='"+OutputRootFileDir+ "/" +RootHistOutputFileName+"', OPT='RECREATE'"]
 
 
 if (WriteNtuple):
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_testing.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_testing.py
index 3b9f04e3f277..183a56d3f3f3 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_testing.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_testing.py
@@ -20,7 +20,10 @@ theRampValidationAlg.RawRampTimeTolerance=20.
 theRampValidationAlg.UseCorrChannels=False
 
 theLArRampPatcher.OutputLevel = INFO
-theLArRCBMasker.OutputLevel = INFO
 
 svcMgr.MessageSvc.OutputLevel = WARNING
 svcMgr.MessageSvc.defaultLimit = 9999999  # all messages
+
+conddb.addOverride("/LAR/Align","LARAlign-UPD4-00")
+conddb.addOverride("/LAR/LArCellPositionShift","LArCellPositionShift-ideal")
+print(svcMgr.IOVDbSvc.Folders)
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/test/test_larcalib_ramp.sh b/LArCalorimeter/LArExample/LArCalibProcessing/test/test_larcalib_ramp.sh
index baba662fe7a3..1faaa08ba8ad 100755
--- a/LArCalorimeter/LArExample/LArCalibProcessing/test/test_larcalib_ramp.sh
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/test/test_larcalib_ramp.sh
@@ -5,6 +5,6 @@
 # art-include: 21.0/Athena
 # art-include: master/Athena
  
-athena.py -c 'doMonitoring=False; doLArCalibDataQuality=True; CorrectBadChannels=True; ApplyAdHocCorrection=False; GainList=["HIGH"]; PartitionType="EMB"; Partition="EB-EMBA"; PartitionTypeGeneric="EMBPS"; RunNumberList=[174586]; RunNumberFlag=int(RunNumberList[0]); InputDir=" "; FullFileName=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/LArCalibProcessing/data11_calib.00174586.calibration_LArElec-Ramp-7s-High-BarrelPS.daq.RAW._lb0000._EB-EMBA._0001.data"]; GroupingType="ExtendedSubDetector"; from AthenaCommon.GlobalFlags import globalflags; globalflags.DatabaseInstance.set_Value_and_Lock ("COMP200"); from AthenaCommon.JobProperties import jobproperties; jobproperties.Global.DetDescrVersion.set_Value_and_Lock ("ATLAS-R1-2011-02-00-00"); DBConnectionCOOL="COOLOFL_LAR/COMP200"; InputDBConnectionOFC="COOLONL_LAR/COMP200"; CaliOFCFolder="/LAR/ElecCalibOnl/OFC"; CaliOFCTagSpec="HEAD" ' LArCalibProcessing/UseLArExtendedSubDetGrouping.py  LArCalibProcessing/LArCalib_Ramp_jobOptions.py LArCalibProcessing/LArCalib_Ramp_testing.py
+athena.py -c 'doMonitoring=False; doLArCalibDataQuality=True; CorrectBadChannels=True; ApplyAdHocCorrection=False; GainList=["HIGH"]; PartitionType="EMB"; Partition="EB-EMBA"; PartitionTypeGeneric="EMBPS"; RunNumberList=[174586]; RunNumberFlag=int(RunNumberList[0]); InputDir=" "; FullFileName=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/LArCalibProcessing/data11_calib.00174586.calibration_LArElec-Ramp-7s-High-BarrelPS.daq.RAW._lb0000._EB-EMBA._0001.data"]; GroupingType="ExtendedSubDetector"; from AthenaCommon.GlobalFlags import globalflags; globalflags.DatabaseInstance.set_Value_and_Lock ("COMP200"); from AthenaCommon.JobProperties import jobproperties; jobproperties.Global.DetDescrVersion.set_Value_and_Lock ("ATLAS-R1-2011-02-00-00"); DBConnectionCOOL="COOLOFL_LAR/COMP200"; InputDBConnectionOFC="COOLONL_LAR/COMP200";InputDBConnectionBadChannel="COOLOFL_LAR/COMP200";CaliOFCFolder="/LAR/ElecCalibOnl/OFC"; CaliOFCTagSpec="HEAD" ' LArCalibProcessing/UseLArExtendedSubDetGrouping.py  LArCalibProcessing/LArCalib_Ramp_jobOptions.py LArCalibProcessing/LArCalib_Ramp_testing.py
  
 echo  "art-result: $? ramp"
diff --git a/LArCalorimeter/LArExample/LArConditionsCommon/share/LArMinimalSetup.py b/LArCalorimeter/LArExample/LArConditionsCommon/share/LArMinimalSetup.py
index 59e10b1b5fe2..f8b1f33282a8 100644
--- a/LArCalorimeter/LArExample/LArConditionsCommon/share/LArMinimalSetup.py
+++ b/LArCalorimeter/LArExample/LArConditionsCommon/share/LArMinimalSetup.py
@@ -30,6 +30,7 @@ DetFlags.digitize.all_setOff()
 #Set up GeoModel (not really needed but crashes without)
 from AtlasGeoModel import SetGeometryVersion
 from AtlasGeoModel import GeoModelInit
+svcMgr.GeoModelSvc.DetectorTools["LArDetectorToolNV"].ApplyAlignments=False
 
 #Get identifier mapping
 include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" )
-- 
GitLab


From c4138d5d5f6e882a9ea2eec1129e5aa4acfa1b5d Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <m.hodgkinson@sheffield.ac.uk>
Date: Thu, 9 Sep 2021 13:01:43 +0200
Subject: [PATCH 038/347] Update config to silence a WARNING about a
 misconfiguration of a tool.

---
 Reconstruction/eflowRec/share/PFlowMTConfig.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Reconstruction/eflowRec/share/PFlowMTConfig.py b/Reconstruction/eflowRec/share/PFlowMTConfig.py
index 66f1673eaf3f..b1fe4e5c3ccd 100644
--- a/Reconstruction/eflowRec/share/PFlowMTConfig.py
+++ b/Reconstruction/eflowRec/share/PFlowMTConfig.py
@@ -146,7 +146,6 @@ PFClusterMomentsMaker.MomentsNames = [
    ,"FIRST_ENG_DENS"
    ,"SECOND_ENG_DENS"
    ,"ISOLATION"
-   ,"EM_PROBABILITY"
    ,"ENG_POS"
    ,"ENG_BAD_CELLS"
    ,"N_BAD_CELLS"
-- 
GitLab


From bbd72afe6fda2a7380ab15376a99d4ec66c9fcaa Mon Sep 17 00:00:00 2001
From: Andrew Mehta <andrew.mehta@cern.ch>
Date: Thu, 9 Sep 2021 13:19:33 +0200
Subject: [PATCH 039/347] Update version.txt

---
 Projects/AnalysisBase/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/AnalysisBase/version.txt b/Projects/AnalysisBase/version.txt
index 63a22bbc4eba..4e6c0846b4b0 100644
--- a/Projects/AnalysisBase/version.txt
+++ b/Projects/AnalysisBase/version.txt
@@ -1 +1 @@
-22.2.41
+22.2.42
-- 
GitLab


From 0b4606ade0706118364db17e40a50cf82451a8b6 Mon Sep 17 00:00:00 2001
From: Andrew Mehta <andrew.mehta@cern.ch>
Date: Thu, 9 Sep 2021 13:19:47 +0200
Subject: [PATCH 040/347] Update version.txt

---
 Projects/AthAnalysis/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/AthAnalysis/version.txt b/Projects/AthAnalysis/version.txt
index 63a22bbc4eba..4e6c0846b4b0 100644
--- a/Projects/AthAnalysis/version.txt
+++ b/Projects/AthAnalysis/version.txt
@@ -1 +1 @@
-22.2.41
+22.2.42
-- 
GitLab


From 4954a515c84358f8e255478a08b58dc8a9f62ef1 Mon Sep 17 00:00:00 2001
From: abarton <Adam.Edward.Barton@cern.ch>
Date: Thu, 9 Sep 2021 12:30:57 +0100
Subject: [PATCH 041/347] String optimizations in Control

---
 Control/AthenaKernel/src/DsoDb.cxx         |  6 +-
 Control/AthenaServices/src/AthReadAlg.cxx  |  2 +-
 Control/AthenaServices/src/DecisionSvc.cxx | 79 ++++++++++++----------
 Control/StoreGate/src/SGImplSvc.cxx        | 11 ++-
 4 files changed, 52 insertions(+), 46 deletions(-)

diff --git a/Control/AthenaKernel/src/DsoDb.cxx b/Control/AthenaKernel/src/DsoDb.cxx
index 9a386c58e4c1..657f1676d053 100644
--- a/Control/AthenaKernel/src/DsoDb.cxx
+++ b/Control/AthenaKernel/src/DsoDb.cxx
@@ -94,7 +94,7 @@ namespace {
       lib = std::string("lib") + lib;
     }
     if (!boost::algorithm::ends_with(lib, SHLIB_SUFFIX)) {
-      lib = lib + SHLIB_SUFFIX;
+      lib += SHLIB_SUFFIX;
     }
     return lib;
   }
@@ -590,7 +590,7 @@ DsoDb::content(bool pedantic) const
             baselibs.insert(baselib);
           }
         }
-        db[idb->first] = libs;
+        db[idb->first] = std::move(libs);
       }
     }
   }
@@ -627,7 +627,7 @@ DsoDb::get_dups(DsoMap_t& dups, const DsoMap_t& db, bool pedantic) const
       }
     }
     if (libs.size() > 1) {
-      dups[idb->first] = Libs_t(libs.begin(), libs.end());
+      dups[idb->first] = std::move(libs);
     }
   }
 }
diff --git a/Control/AthenaServices/src/AthReadAlg.cxx b/Control/AthenaServices/src/AthReadAlg.cxx
index d08394a4186e..ea834ec1b9bc 100644
--- a/Control/AthenaServices/src/AthReadAlg.cxx
+++ b/Control/AthenaServices/src/AthReadAlg.cxx
@@ -90,7 +90,7 @@ StatusCode AthReadAlg::execute (const EventContext& ctx) const
 #if __cplusplus >= 201709
       if (a.ends_with ("_DELETED"))
 #else
-      if (a.substr (a.size() - 8, 8) == "_DELETED")
+      if (a.compare (a.size() - 8, 8, "_DELETED") == 0)
 #endif
       {
         a.erase (a.size() - 8, 8);
diff --git a/Control/AthenaServices/src/DecisionSvc.cxx b/Control/AthenaServices/src/DecisionSvc.cxx
index 263962d55bda..29fd096f8fd6 100644
--- a/Control/AthenaServices/src/DecisionSvc.cxx
+++ b/Control/AthenaServices/src/DecisionSvc.cxx
@@ -259,7 +259,7 @@ DecisionSvc::isEventAccepted( const std::string& stream,
   if(itAlgs != m_stream_accept.end()){
     found_accept = true;
     // get a handle of the streams' algos vector
-    auto vecAlgs = itAlgs->second;
+    const auto &vecAlgs = itAlgs->second;
     // Loop over all Algorithms in the list to see
     // whether any have been executed and have their filter
     // passed flag set. Any match causes the event to be
@@ -283,7 +283,7 @@ DecisionSvc::isEventAccepted( const std::string& stream,
   if(itAlgs != m_stream_require.end()){
     found_require = true;
     // get a handle of the streams' algos vector
-    auto vecAlgs = itAlgs->second;
+    const auto &vecAlgs = itAlgs->second;
     // Loop over all Algorithms in the list to see
     // whether any have been executed and have their filter
     // passed flag set. Any match causes the event to be
@@ -306,7 +306,7 @@ DecisionSvc::isEventAccepted( const std::string& stream,
   if(itAlgs != m_stream_veto.end()){
     found_veto = true;
     // get a handle of the streams' algos vector
-    auto vecAlgs = itAlgs->second;
+    const auto &vecAlgs = itAlgs->second;
     // Loop over all Algorithms in the list to see
     // whether any have been executed and have their filter
     // passed flag set. Any match causes the event to be
@@ -370,59 +370,66 @@ void DecisionSvc::DeclareToCutFlowSvc()
   // Loop over all streams
   for(auto ait  = m_streamNames.begin();
            ait != m_streamNames.end(); ++ait) {
-    std::string streamName=*ait;
-    std::vector<std::string> accFilt;
-    std::vector<std::string> reqFilt;
-    std::vector<std::string> vetFilt;
-    std::vector< std::vector<std::string>* > totFilt;
-    if (m_stream_accept.find(streamName) != m_stream_accept.end())  {
-      accFilt = m_stream_accept[streamName];
-      totFilt.push_back(&accFilt);
+    const std::string &streamName=*ait;
+    const std::vector<std::string> *accFilt=nullptr;
+    const std::vector<std::string> *reqFilt=nullptr;
+    const std::vector<std::string> *vetFilt=nullptr;
+    std::vector< const std::vector<std::string>* > totFilt;
+    if (auto itr = m_stream_accept.find(streamName); itr != m_stream_accept.end())  {
+      accFilt = &itr->second;
+      totFilt.push_back(accFilt);
     }
-    if (m_stream_require.find(streamName)!= m_stream_require.end()) {
-      reqFilt = m_stream_require[streamName];
-      totFilt.push_back(&reqFilt);
+    if (auto itr = m_stream_require.find(streamName); itr != m_stream_require.end()) {
+      reqFilt = &itr->second;
+      totFilt.push_back(reqFilt);
     }
-    if (m_stream_veto.find(streamName)   != m_stream_veto.end())    {
-      vetFilt = m_stream_veto[streamName];
-      totFilt.push_back(&vetFilt);
+    if (auto itr = m_stream_veto.find(streamName); itr != m_stream_veto.end())    {
+      vetFilt = &itr->second;
+      totFilt.push_back(vetFilt);
     }
 
     // Now build logicalKey as string of filt ||, &&, ! based on 
     // whether it is accept, require, veto
     std::string accstring(""), reqstring(""), vetstring("");
-    for (auto it = accFilt.begin(); it != accFilt.end(); ++it) {
-      if(accstring.size()>0) accstring += "||";
-      else accstring += '(';
-      accstring+=*it;
+    if(accFilt){
+       for (auto it = accFilt->begin(); it != accFilt->end(); ++it) {
+         if(!accstring.empty()) accstring += "||";
+         else accstring += '(';
+         accstring+=*it;
+       }
     }
-    for (auto it = reqFilt.begin(); it != reqFilt.end(); ++it) {
-      if(reqstring.size()>0) reqstring += "&&";
-      else reqstring += '(';
-      reqstring+=*it;
+    if(reqFilt){
+       for (auto it = reqFilt->begin(); it != reqFilt->end(); ++it) {
+         if(!reqstring.empty()) reqstring += "&&";
+         else reqstring += '(';
+         reqstring+=*it;
+       }
     }
-    for (auto it = vetFilt.begin(); it != vetFilt.end(); ++it) {
-      if(vetstring.size()>0) vetstring += "||";
-      else vetstring += '(';
-      vetstring+=*it;
+    if(vetFilt){
+       for (auto it = vetFilt->begin(); it != vetFilt->end(); ++it) {
+         if(!vetstring.empty()) vetstring += "||";
+         else vetstring += '(';
+         vetstring+=*it;
+       }
     }
     std::string logicalKey("");
-    if(accstring.size()>0) {
+    if(!accstring.empty()) {
       accstring += ')';
       logicalKey += accstring;
     }
-    if(reqstring.size()>0) {
+    if(!reqstring.empty()) {
       reqstring += ')';
-      if (logicalKey.size()>0) logicalKey += "&&";
+      if (!logicalKey.empty()) logicalKey += "&&";
       logicalKey += reqstring;
     }
-    if(vetstring.size()>0) {
+    if(!vetstring.empty()) {
       vetstring += ')';
-      if (logicalKey.size()>0) logicalKey += "&&";
-      logicalKey = logicalKey + "!" + vetstring;
+      if (!logicalKey.empty()) logicalKey += "&&";
+      logicalKey += '!';
+      logicalKey += vetstring;
     }
     // If no filters, mark as PasThru
-    if (logicalKey.size()==0) logicalKey="PassThru";
+    if (logicalKey.empty()) logicalKey="PassThru";
     ATH_MSG_DEBUG("stream " << streamName << " uses logic " << logicalKey);
 
     // Now actually declare to the cutflowsvc
diff --git a/Control/StoreGate/src/SGImplSvc.cxx b/Control/StoreGate/src/SGImplSvc.cxx
index 06bed0ac2d31..a07299aec259 100644
--- a/Control/StoreGate/src/SGImplSvc.cxx
+++ b/Control/StoreGate/src/SGImplSvc.cxx
@@ -1471,11 +1471,10 @@ SGImplSvc::record_HistObj(const CLID& id, const std::string& key,
   std::string idname;
   StatusCode sc = m_pCLIDSvc->getTypeNameOfID(id, idname);
   if (sc.isFailure() || idname.empty() ) { 
-    std::ostringstream ost;
-    ost << id;
-    idname = ost.str();
+    idname = std::to_string(id);
   }
-  idname = idname + '/' + key;
+  idname += '/';
+  idname += key;
 
   DataObject* obj = SG::asStorable(dho);
   
@@ -1714,7 +1713,7 @@ CLID SGImplSvc::clid( const std::string& key ) const
 std::vector<CLID> SGImplSvc::clids( const std::string& key ) const
 {
   lock_t lock (m_mutex);
-  std::list<CLID> clids;
+  std::vector<CLID> clids;
   SG::DataStore::ConstStoreIterator s_iter, s_end;
   store()->tRange(s_iter, s_end).ignore();
   
@@ -1724,7 +1723,7 @@ std::vector<CLID> SGImplSvc::clids( const std::string& key ) const
     }
   }
   
-  return std::vector<CLID>(clids.begin(), clids.end());
+  return clids;
 }
 
 
-- 
GitLab


From 2e00bb27d50b1fbee32438f90610224b83cfdfb0 Mon Sep 17 00:00:00 2001
From: abarton <Adam.Edward.Barton@cern.ch>
Date: Thu, 9 Sep 2021 12:31:12 +0100
Subject: [PATCH 042/347] String optimizations in Database

---
 .../AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx | 61 +++++++++++--------
 Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx   | 25 ++++----
 Database/IOVDbSvc/src/Cool2Json.cxx           | 21 ++++---
 Database/IOVDbSvc/src/IOVDbCoolFunctions.cxx  |  4 +-
 Database/IOVDbSvc/src/IOVDbParser.cxx         |  2 +-
 Database/IOVDbSvc/src/IOVDbParser.h           |  2 +-
 .../IOVDbSvc/src/IOVDbStringFunctions.cxx     | 22 ++++---
 Database/IOVDbSvc/src/IOVDbStringFunctions.h  |  2 +-
 .../PersistentDataModel/src/Placement.cxx     | 10 ++-
 Database/PersistentDataModel/src/Token.cxx    |  2 +-
 10 files changed, 90 insertions(+), 61 deletions(-)

diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx
index 5160927a0ba4..394b223ba519 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolCnvSvc.cxx
@@ -75,15 +75,14 @@ StatusCode AthenaPoolCnvSvc::initialize() {
    // Extracting MaxFileSizes for global default and map by Database name.
    for (std::vector<std::string>::const_iterator iter = m_maxFileSizes.value().begin(),
 	   last = m_maxFileSizes.value().end(); iter != last; ++iter) {
-      if (iter->find('=') != std::string::npos) {
-         long long maxFileSize = atoll(iter->substr(iter->find('=') + 1).c_str());
+      if (auto p = iter->find('='); p != std::string::npos) {
+         long long maxFileSize = atoll(iter->data() + (p + 1));
          if (maxFileSize > 15000000000LL) {
             ATH_MSG_INFO("Files larger than 15GB are disallowed by ATLAS policy.");
             ATH_MSG_INFO("They should only be produced for private use or in special cases.");
          }
          std::string databaseName = iter->substr(0, iter->find_first_of(" 	="));
-         std::pair<std::string, long long> entry(databaseName, maxFileSize);
-         m_databaseMaxFileSize.insert(entry);
+         m_databaseMaxFileSize.insert(std::make_pair(databaseName, maxFileSize));
       } else {
          m_domainMaxFileSize = atoll(iter->c_str());
          if (m_domainMaxFileSize > 15000000000LL) {
@@ -187,7 +186,8 @@ StatusCode AthenaPoolCnvSvc::createObj(IOpaqueAddress* pAddress, DataObject*& re
          oss << std::dec << pAddress->clID();
          objName = oss.str();
       }
-      objName += "#" + *(pAddress->par() + 1);
+      objName += '#';
+      objName += *(pAddress->par() + 1);
    }
    if (m_doChronoStat) {
       m_chronoStatSvc->chronoStart("cObj_" + objName);
@@ -217,7 +217,8 @@ StatusCode AthenaPoolCnvSvc::createRep(DataObject* pObject, IOpaqueAddress*& ref
          oss << std::dec << pObject->clID();
          objName = oss.str();
       }
-      objName += "#" + pObject->registry()->name();
+      objName += '#';
+      objName += pObject->registry()->name();
    }
    if (m_doChronoStat) {
       m_chronoStatSvc->chronoStart("cRep_" + objName);
@@ -253,7 +254,8 @@ StatusCode AthenaPoolCnvSvc::fillRepRefs(IOpaqueAddress* pAddress, DataObject* p
          oss << std::dec << pObject->clID();
          objName = oss.str();
       }
-      objName += "#" + pObject->registry()->name();
+      objName += '#';
+      objName += pObject->registry()->name();
    }
    if (m_doChronoStat) {
       m_chronoStatSvc->chronoStart("fRep_" + objName);
@@ -322,7 +324,7 @@ StatusCode AthenaPoolCnvSvc::connectOutput(const std::string& outputConnectionSp
    }
 
    if (!m_outputStreamingTool.empty() && m_outputStreamingTool[0]->isClient() && m_parallelCompression) {
-      outputConnection = outputConnection + m_streamPortString.value();
+      outputConnection +=  m_streamPortString.value();
    }
    unsigned int contextId = outputContextId(outputConnection);
    try {
@@ -344,7 +346,7 @@ StatusCode AthenaPoolCnvSvc::connectOutput(const std::string& outputConnectionSp
       std::vector<std::string> maxFileSize;
       maxFileSize.push_back("TREE_MAX_SIZE");
       maxFileSize.push_back("1099511627776L");
-      m_domainAttr.push_back(maxFileSize);
+      m_domainAttr.emplace_back(std::move(maxFileSize));
       // Extracting OUTPUT POOL ItechnologySpecificAttributes for Domain, Database and Container.
       extractPoolAttributes(m_poolAttr, &m_containerAttr, &m_databaseAttr, &m_domainAttr);
       for (std::vector<std::vector<std::string> >::iterator iter = m_databaseAttr.begin(), last = m_databaseAttr.end();
@@ -359,7 +361,8 @@ StatusCode AthenaPoolCnvSvc::connectOutput(const std::string& outputConnectionSp
          std::size_t colon = m_containerPrefixProp.value().find(':');
          if (colon == std::string::npos) colon = 0; // Used to remove leading technology
          else colon++;
-         if (merge != std::string::npos && opt == "TREE_AUTO_FLUSH" && file == outputConnection.substr(0, merge) && cont.substr(equal) == m_containerPrefixProp.value().substr(colon) && data != "int" && data != "DbLonglong" && data != "double" && data != "string") {
+         const auto& strProp = m_containerPrefixProp.value();
+         if (merge != std::string::npos && opt == "TREE_AUTO_FLUSH" && 0 == outputConnection.compare(0, merge, file) && cont.compare(equal, std::string::npos, strProp, colon) == 0 && data != "int" && data != "DbLonglong" && data != "double" && data != "string") {
             flush = atoi(data.c_str());
             if (flush < 0 && m_numberEventsPerWrite.value() > 0) {
                flush = m_numberEventsPerWrite.value();
@@ -458,7 +461,8 @@ StatusCode AthenaPoolCnvSvc::commitOutput(const std::string& outputConnectionSpe
             }
             std::string tokenStr = placementStr;
             std::string contName = strstr(placementStr, "[CONT=");
-            tokenStr = tokenStr.substr(0, tokenStr.find("[CONT=")) + contName.substr(contName.find(']') + 1);
+            tokenStr = tokenStr.substr(0, tokenStr.find("[CONT="));
+            tokenStr.append(contName, contName.find(']') + 1);
             contName = contName.substr(6, contName.find(']') - 6);
             std::string className = strstr(placementStr, "[PNAME=");
             className = className.substr(7, className.find(']') - 7);
@@ -467,8 +471,8 @@ StatusCode AthenaPoolCnvSvc::commitOutput(const std::string& outputConnectionSpe
             std::ostringstream oss2;
             oss2 << std::dec << num;
             std::string::size_type len = m_metadataContainerProp.value().size();
-            if (len > 0 && contName.substr(0, len) == m_metadataContainerProp.value()
-		            && contName.substr(len, 1) == "(") {
+            if (len > 0 && contName.compare(0, len, m_metadataContainerProp.value()) == 0
+		            && contName[len] == '(') {
                ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", name());
                // For Metadata, before moving to next client, fire file incidents
                if (m_metadataClient != num) {
@@ -495,7 +499,7 @@ StatusCode AthenaPoolCnvSvc::commitOutput(const std::string& outputConnectionSpe
                readToken.setOid(Token::OID_t(num, 0));
                readToken.setAuxString("[PNAME=" + className + "]");
                this->setObjPtr(obj, &readToken); // Pull/read Object out of shared memory
-               if (len == 0 || contName.substr(0, len) != m_metadataContainerProp.value()) {
+               if (len == 0 || contName.compare(0, len, m_metadataContainerProp.value()) != 0) {
                   // Write object
                   Placement placement;
                   placement.fromString(placementStr); placementStr = nullptr;
@@ -515,7 +519,9 @@ StatusCode AthenaPoolCnvSvc::commitOutput(const std::string& outputConnectionSpe
                         return abortSharedWrClients(num);
                      }
                      dataHeaderSeen = true;
-                     dataHeaderID = token->contID() + "/" + oss2.str();
+                     dataHeaderID = token->contID();
+                     dataHeaderID += '/';
+                     dataHeaderID += oss2.str();
                   } else if (dataHeaderSeen) {
                      dataHeaderSeen = false;
                      // next object after DataHeader - may be a DataHeaderForm
@@ -618,7 +624,7 @@ StatusCode AthenaPoolCnvSvc::commitOutput(const std::string& outputConnectionSpe
          doCommit = true;
          ATH_MSG_DEBUG("commitOutput sending data.");
       }
-      outputConnection = outputConnection + m_streamPortString.value();
+      outputConnection += m_streamPortString.value();
    }
    unsigned int contextId = outputContextId(outputConnection);
    if (!processPoolAttributes(m_domainAttr, outputConnection, contextId).isSuccess()) {
@@ -694,7 +700,7 @@ StatusCode AthenaPoolCnvSvc::disconnectOutput(const std::string& outputConnectio
       ATH_MSG_DEBUG("disconnectOutput not SKIPPED for server: " << m_streamServer);
    }
    if (!m_outputStreamingTool.empty() && m_outputStreamingTool[0]->isClient() && m_parallelCompression) {
-      outputConnection = outputConnection + m_streamPortString.value();
+      outputConnection += m_streamPortString.value();
    }
    unsigned int contextId = outputContextId(outputConnection);
    StatusCode sc = m_poolSvc->disconnect(contextId);
@@ -724,8 +730,8 @@ Token* AthenaPoolCnvSvc::registerForWrite(Placement* placement, const void* obj,
    }
    Token* token = nullptr;
    if (!m_outputStreamingTool.empty() && m_outputStreamingTool[0]->isClient()
-	   && (!m_parallelCompression || placement->containerName().substr(0, m_metadataContainerProp.value().size()) == m_metadataContainerProp.value())) {
-      std::string fileName = placement->fileName();
+	   && (!m_parallelCompression || placement->containerName().compare(0, m_metadataContainerProp.value().size(), m_metadataContainerProp.value()) == 0)) {
+      const std::string &fileName = placement->fileName();
       auto it = std::find (m_streamClientFiles.begin(),
                            m_streamClientFiles.end(),
                            fileName);
@@ -737,7 +743,10 @@ Token* AthenaPoolCnvSvc::registerForWrite(Placement* placement, const void* obj,
          streamClient = 0;
       }
       // Lock object
-      std::string placementStr = placement->toString() + "[PNAME=" + classDesc.Name() + "]";
+      std::string placementStr = placement->toString();
+      placementStr += "[PNAME=";
+      placementStr += classDesc.Name();
+      placementStr += ']';
       ATH_MSG_VERBOSE("Requesting write object for: " << placementStr);
       StatusCode sc = m_outputStreamingTool[streamClient]->lockObject(placementStr.c_str());
       while (sc.isRecoverable()) {
@@ -822,7 +831,7 @@ Token* AthenaPoolCnvSvc::registerForWrite(Placement* placement, const void* obj,
          tempToken->setClassID(pool::DbReflex::guid(classDesc));
          token = tempToken; tempToken = nullptr;
       } else if (!m_outputStreamingTool.empty() && !m_outputStreamingTool[0]->isClient() && m_streamServer == m_outputStreamingTool.size()) {
-         std::string fileName = placement->fileName();
+         const std::string &fileName = placement->fileName();
          auto it = std::find (m_streamClientFiles.begin(),
                               m_streamClientFiles.end(),
                               fileName);
@@ -959,7 +968,7 @@ StatusCode AthenaPoolCnvSvc::createAddress(long svcType,
       }
    }
    Token* token = nullptr;
-   if (par[0].substr(0, 3) == "SHM") {
+   if (par[0].compare(0, 3, "SHM") == 0) {
       token = new Token();
       token->setOid(Token::OID_t(ip[0], ip[1]));
       token->setAuxString("[PNAME=" + par[2] + "]");
@@ -1275,7 +1284,7 @@ void AthenaPoolCnvSvc::extractPoolAttributes(const StringArrayProperty& property
             opt.push_back(databaseName);
             if (!containerName.empty()) {
                opt.push_back(containerName);
-               if (containerName.substr(0, 6) == "TTree=") {
+               if (containerName.compare(0, 6, "TTree=") == 0) {
                   dbAttr->push_back(opt);
                } else {
                   contAttr->push_back(opt);
@@ -1332,8 +1341,8 @@ StatusCode AthenaPoolCnvSvc::processPoolAttributes(std::vector<std::vector<std::
          std::string data = (*iter)[1];
          const std::string& file = (*iter)[2];
          const std::string& cont = (*iter)[3];
-         if (!fileName.empty() && (file == fileName.substr(0, fileName.find('?'))
-	         || (file.substr(0, 1) == "*" && file.find("," + fileName + ",") == std::string::npos))) {
+         if (!fileName.empty() && (0 == fileName.compare(0, fileName.find('?'), file)
+	         || (file[0] == '*' && file.find("," + fileName + ",") == std::string::npos))) {
             if (data == "int" || data == "DbLonglong" || data == "double" || data == "string") {
                if (doGet) {
                   if (!m_poolSvc->getAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), fileName, cont, contextId).isSuccess()) {
@@ -1345,7 +1354,7 @@ StatusCode AthenaPoolCnvSvc::processPoolAttributes(std::vector<std::vector<std::
                if (m_poolSvc->setAttribute(opt, data, pool::DbType(pool::ROOTTREE_StorageType).type(), fileName, cont, contextId).isSuccess()) {
                   ATH_MSG_DEBUG("setAttribute " << opt << " to " << data << " for db: " << fileName << " and cont: " << cont);
                   if (doClear) {
-                     if (file.substr(0, 1) == "*" && !m_persSvcPerOutput) {
+                     if (file[0] == '*' && !m_persSvcPerOutput) {
                         (*iter)[2] += "," + fileName + ",";
                      } else {
                         iter->clear();
diff --git a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx
index 9c6a333179cf..f033136bd114 100644
--- a/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx
+++ b/Database/AthenaPOOL/PoolSvc/src/PoolSvc.cxx
@@ -822,18 +822,18 @@ StatusCode PoolSvc::setAttribute(const std::string& optName,
          ATH_MSG_DEBUG("Failed to get ContainerHandle to set POOL property.");
          return(StatusCode::FAILURE);
       }
-      if (contName.find('(') != std::string::npos) {
-         objName = contName.substr(contName.find('(') + 1); // Get BranchName between parenthesis
+      if (auto p = contName.find('('); p != std::string::npos) {
+         objName = contName.substr(p + 1); // Get BranchName between parenthesis
          objName = objName.substr(0, objName.find(')'));
-      } else if (contName.find("::") != std::string::npos) {
-         objName = contName.substr(contName.find("::") + 2); // Split off Tree name
-      } else if (contName.find('_') != std::string::npos) {
-         objName = contName.substr(contName.find('_') + 1); // Split off "POOLContainer"
+      } else if (auto p = contName.find("::"); p != std::string::npos) {
+         objName = contName.substr(p + 2); // Split off Tree name
+      } else if (auto p = contName.find('_'); p != std::string::npos) {
+         objName = contName.substr(p + 1); // Split off "POOLContainer"
          objName = objName.substr(0, objName.find('/')); // Split off key
       }
       std::string::size_type off = 0;
       while ((off = objName.find_first_of("<>/")) != std::string::npos) {
-         objName.replace(off, 1, "_"); // Replace special chars (e.g. templates)
+         objName[off] = '_'; // Replace special chars (e.g. templates)
       }
       if (data[data.size() - 1] == 'L') {
          retError = contH->technologySpecificAttributes().setAttribute<long long int>(optName, atoll(data.c_str()), objName);
@@ -970,11 +970,11 @@ std::unique_ptr<pool::IDatabase> PoolSvc::getDbHandle(unsigned int contextId, co
          return(nullptr);
       }
    }
-   if (dbName.find("PFN:") == 0) {
+   if (dbName.compare(0, 4,"PFN:") == 0) {
       dbH = sesH.databaseHandle(dbName.substr(4), pool::DatabaseSpecification::PFN);
-   } else if (dbName.find("LFN:") == 0) {
+   } else if (dbName.compare(0, 4, "LFN:") == 0) {
       dbH = sesH.databaseHandle(dbName.substr(4), pool::DatabaseSpecification::LFN);
-   } else if (dbName.find("FID:") == 0) {
+   } else if (dbName.compare(0, 4,"FID:") == 0) {
       dbH = sesH.databaseHandle(dbName.substr(4), pool::DatabaseSpecification::FID);
    } else {
       dbH = sesH.databaseHandle(dbName, pool::DatabaseSpecification::PFN);
@@ -1006,11 +1006,12 @@ std::string PoolSvc::poolCondPath(const std::string& leaf) {
    const char* cpath = getenv("ATLAS_POOLCOND_PATH");
    if (cpath && strcmp(cpath, "") != 0) {
       std::string testpath = cpath;
-      testpath += "/" + leaf;
+      testpath += '/';
+      testpath += leaf;
       struct stat stFileInfo;
       // try to retrieve file attribute - success indicates file exists
       if (stat(testpath.c_str(), &stFileInfo) == 0) {
-         respath = testpath;
+         respath = std::move(testpath);
       }
    }
    return(respath);
diff --git a/Database/IOVDbSvc/src/Cool2Json.cxx b/Database/IOVDbSvc/src/Cool2Json.cxx
index 979fea669722..57b9fa13ba98 100644
--- a/Database/IOVDbSvc/src/Cool2Json.cxx
+++ b/Database/IOVDbSvc/src/Cool2Json.cxx
@@ -43,9 +43,13 @@ namespace {
     for (unsigned int i(0); i<rspec.size();++i){
       if (i==1) sep=", ";
       const auto & f = rspec[i];
-      result+=sep+f.name()+": "+f.storageType().name();
+      result+=sep;
+      result+=f.name();
+      result+=": ";
+      result+=f.storageType().name();
     }
-    result+="\""+cb;
+    result+='\"';
+    result+=cb;
     return result;
   }
 }
@@ -75,7 +79,10 @@ namespace IOVDbNamespace {
   std::string 
   Cool2Json::description() const{
     std::string saneXml=sanitiseXml(m_desc);
-    return "\"node_description\" : \""+saneXml+"\"";
+    std::string out = "\"node_description\" : \"";
+    out += saneXml;
+    out += '\"';
+    return out;
   }
 
   std::string 
@@ -132,9 +139,9 @@ namespace IOVDbNamespace {
         result+=" a_data_value";
       }
       if (sep.empty()) sep=",";
-      result+="}";
+      result+='}';
     }
-    result+="]";
+    result+=']';
     itr->close();
     return result;
   }
@@ -166,14 +173,14 @@ namespace IOVDbNamespace {
     cool::IRecordIterator& pitr=ref.payloadIterator();
     auto pvec=pitr.fetchAllAsVector();
     std::string sep="";
-    os+="[";//vector of vectors
+    os+='[';//vector of vectors
     for (const auto & vitr:*pvec){
       os+=sep;
       const coral::AttributeList& atrlist=(vitr)->attributeList();
       os+=jsonAttributeList(atrlist);
       if (sep.empty()) sep =", ";
     }
-    os+="]";
+    os+=']';
     return os;
   }
   
diff --git a/Database/IOVDbSvc/src/IOVDbCoolFunctions.cxx b/Database/IOVDbSvc/src/IOVDbCoolFunctions.cxx
index 1339aec4d69d..68d698ff7826 100644
--- a/Database/IOVDbSvc/src/IOVDbCoolFunctions.cxx
+++ b/Database/IOVDbSvc/src/IOVDbCoolFunctions.cxx
@@ -151,7 +151,7 @@ namespace IOVDbNamespace{
     multiversion=(fldPtr->versioningMode()==cool::FolderVersioning::MULTI_VERSION);
     // read and process description string
     folderdesc=fldPtr->description();
-    return std::make_pair(multiversion, folderdesc);
+    return std::make_pair(multiversion, std::move(folderdesc));
   }
   
   
@@ -180,7 +180,7 @@ namespace IOVDbNamespace{
     } else {
       channelNumbers=fldPtr->listChannels();
     }
-    return std::make_pair(channelNumbers, channelNames);
+    return std::make_pair(std::move(channelNumbers), std::move(channelNames));
   }
   
 }
diff --git a/Database/IOVDbSvc/src/IOVDbParser.cxx b/Database/IOVDbSvc/src/IOVDbParser.cxx
index e6ce1b1fa1e0..5fd9f2756770 100644
--- a/Database/IOVDbSvc/src/IOVDbParser.cxx
+++ b/Database/IOVDbSvc/src/IOVDbParser.cxx
@@ -9,7 +9,7 @@
 #include "IOVDbParser.h"
 #include "IOVDbStringFunctions.h"
 
-IOVDbParser::IOVDbParser(const std::string& input, MsgStream& log) :
+IOVDbParser::IOVDbParser(std::string_view input, MsgStream& log) :
   m_msg(log),
   m_valid(true)
 {
diff --git a/Database/IOVDbSvc/src/IOVDbParser.h b/Database/IOVDbSvc/src/IOVDbParser.h
index 6a1d4f6d238a..dc68fb53d3a5 100644
--- a/Database/IOVDbSvc/src/IOVDbParser.h
+++ b/Database/IOVDbSvc/src/IOVDbParser.h
@@ -20,7 +20,7 @@ class IOVDbParser {
 public:
 
   IOVDbParser() = delete; 
-  IOVDbParser(const std::string& input, MsgStream& log);
+  IOVDbParser( std::string_view input, MsgStream& log);
   bool isValid() const;
   ///'at' accessor with an optional default; the bool is true if the key was found
   std::pair<std::string, bool>
diff --git a/Database/IOVDbSvc/src/IOVDbStringFunctions.cxx b/Database/IOVDbSvc/src/IOVDbStringFunctions.cxx
index 29fd17833019..d668c54b4a01 100644
--- a/Database/IOVDbSvc/src/IOVDbStringFunctions.cxx
+++ b/Database/IOVDbSvc/src/IOVDbStringFunctions.cxx
@@ -8,14 +8,14 @@
 
 namespace IOVDbNamespace{
   std::string 
-  spaceStrip(const std::string& input){
+  spaceStrip( std::string_view input){
     // return the input string stripped of leading/trailing spaces
     std::string::size_type idx1=input.find_first_not_of(" \n\r\t");
     std::string::size_type idx2=input.find_last_not_of(" \n\r\t");
     if (idx1==std::string::npos || idx2==std::string::npos) {
       return "";
     } else {
-      return input.substr(idx1,1+idx2-idx1);
+      return std::string(input.substr(idx1,1+idx2-idx1));
     }
   }
   
@@ -85,8 +85,12 @@ namespace IOVDbNamespace{
   
   std::string
   quote(const std::string & sentence){
-    const std::string q("\"");
-    return q+sentence+q;
+    std::string out;
+    out.reserve(sentence.size() + 2);
+    out += '\"';
+    out += sentence;
+    out += '\"';
+    return out;
   }
   
   std::string
@@ -111,7 +115,7 @@ namespace IOVDbNamespace{
   
   std::string
   replaceNULL(const std::string & possibleNULL){
-    std::string original{possibleNULL};
+    const std::string &original{possibleNULL};
     const std::string regex=R"delim( NULL)delim";
     const std::regex nullre(regex);
     const std::string result = std::regex_replace(original,nullre," null");
@@ -168,7 +172,7 @@ namespace IOVDbNamespace{
     //regex: 
     //(anything except colon, multiple times) then _possibly_ (two colons and string of anything except colons)
     // anything except colon) then (colon or end-of-line)
-    std::string linkRegexStr{"([^:]*(::[^:]*)?)(:|$)"};
+    const std::string linkRegexStr{"([^:]*(::[^:]*)?)(:|$)"};
     std::regex linkMatchSpec(linkRegexStr); 
     //give a token iterator using the regex and returning the first substring (i.e. the 
     //bit before a single colon or line end, which would be for example "ALink" or "MyContext::AnotherLink" )
@@ -183,14 +187,16 @@ namespace IOVDbNamespace{
   
   std::pair<std::string, std::string>
   tag2PrefixTarget(const std::vector<std::string> & tagParseResults){
-    std::string prefix{}, target{};
+    std::pair<std::string, std::string> pair;
+    std::string &prefix{pair.first};
+    std::string &target{pair.second};
     if (tagParseResults.size() == 4){ //4 is the size of result set if there is a prefix
       prefix = tagParseResults[2]; //index of first path
       target = tagParseResults[3]; //index of second path
     } else {
       target = tagParseResults[2];
     }
-    return std::make_pair(prefix, target);
+    return pair;
   }
   
   bool
diff --git a/Database/IOVDbSvc/src/IOVDbStringFunctions.h b/Database/IOVDbSvc/src/IOVDbStringFunctions.h
index 4cdaf2da193c..13f6ce0f9ea5 100644
--- a/Database/IOVDbSvc/src/IOVDbStringFunctions.h
+++ b/Database/IOVDbSvc/src/IOVDbStringFunctions.h
@@ -21,7 +21,7 @@ namespace IOVDbNamespace{
 
   ///Trim leading and trailing spaces,return a new trimmed string
   std::string 
-  spaceStrip(const std::string& input);
+  spaceStrip( std::string_view input);
   
   ///Produce a channel number from the string; default to 'defchan' if empty
   int 
diff --git a/Database/PersistentDataModel/src/Placement.cxx b/Database/PersistentDataModel/src/Placement.cxx
index 084d642ff6a5..98d4fff4306e 100755
--- a/Database/PersistentDataModel/src/Placement.cxx
+++ b/Database/PersistentDataModel/src/Placement.cxx
@@ -15,7 +15,13 @@ Placement::Placement() : m_technology(0L), m_fileName(""), m_containerName("") {
 const std::string Placement::toString() const {
    char text[128];
    sprintf(text, fmt_tech, m_technology);
-   std::string str = "[FILE=" + m_fileName + "][CONT=" + m_containerName + "]" + text + m_auxString;
+   std::string str = "[FILE=";
+   str += m_fileName;
+   str += "][CONT=";
+   str += m_containerName;
+   str += ']';
+   str += text;
+   str += m_auxString;
    return str;
 }
 
@@ -36,7 +42,7 @@ Placement& Placement::fromString(const std::string& source) {
             }
             if (!p3) p3 = source.c_str() + source.size();
             m_auxString.append (p1, p3-p1);
-            m_auxString += "]";
+            m_auxString += ']';
          }
       }
    }
diff --git a/Database/PersistentDataModel/src/Token.cxx b/Database/PersistentDataModel/src/Token.cxx
index 32275c402348..0746e15a60d4 100755
--- a/Database/PersistentDataModel/src/Token.cxx
+++ b/Database/PersistentDataModel/src/Token.cxx
@@ -151,7 +151,7 @@ Token& Token::fromString(const std::string& source)    {
             }
             if (!p3) p3 = source.c_str() + source.size();
             m_auxString.append (p1, p3-p1);
-            m_auxString += "]";
+            m_auxString += ']';
          }
       }
    }
-- 
GitLab


From b23751addf3939cb28b610f268ee766b7b0debb7 Mon Sep 17 00:00:00 2001
From: abarton <Adam.Edward.Barton@cern.ch>
Date: Thu, 9 Sep 2021 12:31:23 +0100
Subject: [PATCH 043/347] String optimizations in Trigger

---
 Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTChain.cxx | 6 +++---
 Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTUtils.cxx | 2 +-
 Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx             | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTChain.cxx b/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTChain.cxx
index 1967aae12aab..732e62f27509 100644
--- a/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTChain.cxx
+++ b/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTChain.cxx
@@ -186,9 +186,9 @@ namespace {
             return stream;
       }
       for(auto stream : streams) {
-         string s(stream->name());
-         if( (s.find('.') != string::npos) && 
-             (s.substr(s.find('.')+1) == streamName) )
+         const string &s(stream->name());
+         if( auto p = s.find('.'); (p != string::npos) && 
+             (s.compare(p+1, streamName.size(), streamName) == 0) )
             return stream;
       }
       return nullptr;
diff --git a/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTUtils.cxx b/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTUtils.cxx
index d29913281613..9d17634d35f4 100644
--- a/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTUtils.cxx
+++ b/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTUtils.cxx
@@ -589,7 +589,7 @@ TrigConf::HLTTEUtils::mergeHLTChainList2( HLTFrame& frame) {
       // if name starts with EF_ it is replace with HLT_, otherwise HLT_ is prepended
       hltChain->set_level("HLT");
       string oldname = chain->name();
-      unsigned int basepos = (oldname.substr(0,3)=="EF_")?3:0; 
+      unsigned int basepos = (oldname.compare(0,3,"EF_")==0)?3:0;
       hltChain->setName( "HLT_" + oldname.substr(basepos) );
 
       
diff --git a/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx b/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx
index 47573a8639d2..2dff583b7c7f 100644
--- a/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx
+++ b/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx
@@ -1021,7 +1021,7 @@ void LVL1TGCTrigger::recordRdoSL(TGCSector* sector)
     if (fname.empty()) return StatusCode::SUCCESS;
     
     std::string fullName = PathResolver::find_file (fname.c_str(), "PWD");
-    if( fullName.length() == 0 )
+    if( fullName.empty())
       fullName =  PathResolver::find_file (fname.c_str(), "DATAPATH");
     
     std::ifstream fin(fullName.c_str());
@@ -1035,7 +1035,7 @@ void LVL1TGCTrigger::recordRdoSL(TGCSector* sector)
     std::vector<std::string> mask;
     std::string aLine;
     while(getline(fin,aLine)) {
-      if (aLine.substr(0,3)!="///") break;
+      if (aLine.compare(0,3,"///")!=0) break;
     }
     int id_type = atoi(aLine.c_str());
     while(getline(fin,aLine)) {
-- 
GitLab


From e7007e88471b228d0ae51739e07497a953d34ab6 Mon Sep 17 00:00:00 2001
From: Peter Berta <peter.berta@cern.ch>
Date: Wed, 8 Sep 2021 14:07:49 +0200
Subject: [PATCH 044/347] Merge branch '22.0-mc20-pberta-fixing-q221-8.9.2021'
 into '22.0-mc20'

TCT: Adding the correct preExec to the q221 tests

See merge request atlas/athena!46367

(cherry picked from commit d1bfb1b7c7f2e267e090c601f810b1b4a230dad8)

02597695 adding the correct preexec to the q221 tests
---
 Tools/Tier0ChainTests/test/test_q221.sh     | 7 ++++---
 Tools/Tier0ChainTests/test/test_q221_mp.sh  | 2 +-
 Tools/Tier0ChainTests/test/test_q221_mt1.sh | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/Tools/Tier0ChainTests/test/test_q221.sh b/Tools/Tier0ChainTests/test/test_q221.sh
index f9939169cb86..b33aada4c9fe 100755
--- a/Tools/Tier0ChainTests/test/test_q221.sh
+++ b/Tools/Tier0ChainTests/test/test_q221.sh
@@ -8,14 +8,15 @@
 # art-include: 22.0-mc20/Athena
 # art-include: 21.3/Athena
 # art-include: 21.9/Athena
-# art-athena-mt: 8                                                                                                                                     
+# art-athena-mt: 8
+
 Reco_tf.py \
 --AMI=q221 \
 --athenaopts='--threads=8' \
 --conditionsTag 'all:OFLCOND-MC16-SDR-RUN2-08' \
---preExec="all:from IOVDbSvc.CondDB import conddb; conddb.addOverride('/PIXEL/PixMapOverlay','PixMapOverlay-SIM-MC16-000-03');" \
+--preExec 'all:from IOVDbSvc.CondDB import conddb; conddb.addOverride("/PIXEL/PixMapOverlay","PixMapOverlay-SIM-MC16-000-03"); rec.Commissioning.set_Value_and_Lock(True); from AthenaCommon.BeamFlags import jobproperties; jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.); from LArROD.LArRODFlags import larRODFlags; larRODFlags.nSamples.set_Value_and_Lock(4); from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet="AODFULL"' 'HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=["PhysicsList"]' 'RAWtoESD:from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False' \
 --maxEvents=500 \
---outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --imf False 
+--outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --imf False
 
 rc1=$?
 echo "art-result: $rc1 Reco"
diff --git a/Tools/Tier0ChainTests/test/test_q221_mp.sh b/Tools/Tier0ChainTests/test/test_q221_mp.sh
index 2fc09afda970..eac2a257c047 100755
--- a/Tools/Tier0ChainTests/test/test_q221_mp.sh
+++ b/Tools/Tier0ChainTests/test/test_q221_mp.sh
@@ -8,7 +8,7 @@ Reco_tf.py \
 --AMI=q221 \
 --athenaopts='--nprocs=2' \
 --conditionsTag 'all:OFLCOND-MC16-SDR-RUN2-08' \
---preExec="all:from IOVDbSvc.CondDB import conddb; conddb.addOverride('/PIXEL/PixMapOverlay','PixMapOverlay-SIM-MC16-000-03');" \
+--preExec 'all:from IOVDbSvc.CondDB import conddb; conddb.addOverride("/PIXEL/PixMapOverlay","PixMapOverlay-SIM-MC16-000-03"); rec.Commissioning.set_Value_and_Lock(True); from AthenaCommon.BeamFlags import jobproperties; jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.); from LArROD.LArRODFlags import larRODFlags; larRODFlags.nSamples.set_Value_and_Lock(4); from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet="AODFULL"' 'HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=["PhysicsList"]' 'RAWtoESD:from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False' \
 --maxEvents=100 \
 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --imf False
 
diff --git a/Tools/Tier0ChainTests/test/test_q221_mt1.sh b/Tools/Tier0ChainTests/test/test_q221_mt1.sh
index 606daf593422..b3cf564e99d0 100755
--- a/Tools/Tier0ChainTests/test/test_q221_mt1.sh
+++ b/Tools/Tier0ChainTests/test/test_q221_mt1.sh
@@ -3,13 +3,13 @@
 # art-description: RecoTrf
 # art-type: grid
 # art-include: master/Athena
-# art-include: 22.0-mc20/Athena                                                                                                                           
+# art-include: 22.0-mc20/Athena
 
 Reco_tf.py \
 --AMI=q221 \
 --athenaopts='--threads=1' \
 --conditionsTag 'all:OFLCOND-MC16-SDR-RUN2-08' \
---preExec="all:from IOVDbSvc.CondDB import conddb; conddb.addOverride('/PIXEL/PixMapOverlay','PixMapOverlay-SIM-MC16-000-03');" \
+--preExec 'all:from IOVDbSvc.CondDB import conddb; conddb.addOverride("/PIXEL/PixMapOverlay","PixMapOverlay-SIM-MC16-000-03"); rec.Commissioning.set_Value_and_Lock(True); from AthenaCommon.BeamFlags import jobproperties; jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.); from LArROD.LArRODFlags import larRODFlags; larRODFlags.nSamples.set_Value_and_Lock(4); from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet="AODFULL"' 'HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=["PhysicsList"]' 'RAWtoESD:from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False' \
 --maxEvents=100 \
 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --outputHISTFile=myHIST.root --imf False
 
-- 
GitLab


From 359468fcfb8ee2c3a1806d68fc416b8f5276e62b Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 9 Sep 2021 14:08:03 +0200
Subject: [PATCH 045/347] Share common configuration between
 G4AtlasAlg_Skeleton and ISF_Skeleton

---
 .../python/CommonSimulationSteering.py        | 81 +++++++++++++++++++
 .../python/G4AtlasAlg_Skeleton.py             | 59 ++------------
 .../SimuJobTransforms/python/ISF_Skeleton.py  | 51 +-----------
 3 files changed, 88 insertions(+), 103 deletions(-)
 create mode 100644 Simulation/SimuJobTransforms/python/CommonSimulationSteering.py

diff --git a/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py b/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
new file mode 100644
index 000000000000..3ba30b6774e3
--- /dev/null
+++ b/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
@@ -0,0 +1,81 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+# Possible cases:
+# 1) inputEVNTFile (normal)
+# 2) inputEVNT_TRFile (TrackRecords from pre-simulated events,
+# used with TrackRecordGenerator)
+# Three common cases here:
+# 2a) Cosmics simulation
+# 2b) Stopped particle simulation
+# 2c) Cavern background simulation
+# 3) no input file (on-the-fly generation)
+# Common cases
+# 3a) ParticleGun
+# 3b) CosmicGenerator
+# 4) inputHITSFile (re-simulation)
+
+def CommonSimulationCfg(ConfigFlags, log):
+    # Configure main services and input reading (if required)
+    if ConfigFlags.Input.Files == '':
+        # Cases 3a, 3b
+        from AthenaConfiguration.MainServicesConfig import MainEvgenServicesCfg
+        cfg = MainEvgenServicesCfg(ConfigFlags)
+        from AthenaKernel.EventIdOverrideConfig import EvtIdModifierSvcCfg
+        cfg.merge(EvtIdModifierSvcCfg(ConfigFlags))
+        if ConfigFlags.Beam.Type == 'cosmics':
+            # Case 3b: Configure the cosmic Generator
+            from CosmicGenerator.CosmicGeneratorConfig import CosmicGeneratorCfg
+            cfg.merge(CosmicGeneratorCfg(ConfigFlags))
+        else:
+            # Case 3a: Configure ParticleGun
+            log.error("On-the-fly generation other than with CosmicGenerator is not supported yet!")
+            pass
+    else:
+        # Cases 1, 2a, 2b, 2c, 4
+        from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+        cfg = MainServicesCfg(ConfigFlags)
+        from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+        cfg.merge(PoolReadCfg(ConfigFlags))
+        if ConfigFlags.Sim.ReadTR:
+            # Cases 2a, 2b, 2c
+            from TrackRecordGenerator.TrackRecordGeneratorConfigNew import Input_TrackRecordGeneratorCfg
+            cfg.merge(Input_TrackRecordGeneratorCfg(ConfigFlags))
+
+    from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
+    cfg.merge(PoolWriteCfg(ConfigFlags))
+
+    # add BeamEffectsAlg
+    from BeamEffects.BeamEffectsAlgConfig import BeamEffectsAlgCfg
+    cfg.merge(BeamEffectsAlgCfg(ConfigFlags))
+
+    AcceptAlgName=''
+    if ConfigFlags.Sim.ISFRun:
+    # add the ISF_MainConfig
+        from ISF_Config.ISF_MainConfigNew import ISF_KernelCfg
+        cfg.merge(ISF_KernelCfg(ConfigFlags))
+        if 'MT' in  ConfigFlags.Sim.ISF.Simulator:
+            AcceptAlgName = 'SimKernelMT'
+        else:
+            AcceptAlgName = 'SimKernel'
+    else:
+        AcceptAlgName = 'G4AtlasAlg'
+        #add the G4AtlasAlg
+        from G4AtlasAlg.G4AtlasAlgConfigNew import G4AtlasAlgCfg
+        cfg.merge(G4AtlasAlgCfg(ConfigFlags))
+
+    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
+    from SimuJobTransforms.SimOutputConfig import getStreamHITS_ItemList
+    cfg.merge( OutputStreamCfg(ConfigFlags,"HITS", ItemList=getStreamHITS_ItemList(ConfigFlags), disableEventTag=True) )
+    cfg.getEventAlgo("OutputStreamHITS").AcceptAlgs=[AcceptAlgName]
+
+    if len(ConfigFlags.Output.EVNT_TRFileName)>0:
+        from SimuJobTransforms.SimOutputConfig import getStreamEVNT_TR_ItemList
+        cfg.merge( OutputStreamCfg(ConfigFlags,"EVNT_TR", ItemList=getStreamEVNT_TR_ItemList(ConfigFlags), disableEventTag=True) )
+        cfg.getEventAlgo("OutputStreamEVNT_TR").AcceptAlgs=[AcceptAlgName]
+
+    # FIXME hack because deduplication is broken
+    PoolAttributes = ["TREE_BRANCH_OFFSETTAB_LEN = '100'"]
+    PoolAttributes += ["DatabaseName = '" + ConfigFlags.Output.HITSFileName + "'; ContainerName = 'TTree=CollectionTree'; TREE_AUTO_FLUSH = '1'"]
+    cfg.getService("AthenaPoolCnvSvc").PoolAttributes += PoolAttributes
+
+    return cfg
diff --git a/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py b/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py
index a7bee81d1c4e..12b5b9e551bf 100644
--- a/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py
+++ b/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py
@@ -59,6 +59,9 @@ def fromRunArgs(runArgs):
     #if hasattr(runArgs, 'CavernOn'):
     #    detectors = detectors+['Cavern']
 
+    if hasattr(runArgs, 'simulator'):
+        ConfigFlags.Sim.ISF.Simulator = runArgs.simulator
+
     # Setup common simulation flags
     defaultSimulationFlags(ConfigFlags, detectors)
 
@@ -141,9 +144,6 @@ def fromRunArgs(runArgs):
     if hasattr(runArgs, 'conditionsTag'):
         ConfigFlags.IOVDb.GlobalTag = runArgs.conditionsTag
 
-    if hasattr(runArgs, 'simulator'):
-        ConfigFlags.Sim.ISF.Simulator = runArgs.simulator
-
     if hasattr(runArgs, 'truthStrategy'):
         ConfigFlags.Sim.TruthStrategy = runArgs.truthStrategy
 
@@ -156,57 +156,8 @@ def fromRunArgs(runArgs):
     # Lock flags
     ConfigFlags.lock()
 
-    # Configure main services and input reading (if required)
-    if ConfigFlags.Input.Files == '':
-        # Cases 3a, 3b
-        from AthenaConfiguration.MainServicesConfig import MainEvgenServicesCfg
-        cfg = MainEvgenServicesCfg(ConfigFlags)
-        from AthenaKernel.EventIdOverrideConfig import EvtIdModifierSvcCfg
-        cfg.merge(EvtIdModifierSvcCfg(ConfigFlags))
-        if ConfigFlags.Beam.Type == 'cosmics':
-            # Case 3b: Configure the cosmic Generator
-            from CosmicGenerator.CosmicGeneratorConfig import CosmicGeneratorCfg
-            cfg.merge(CosmicGeneratorCfg(ConfigFlags))
-        else:
-            # Case 3a: Configure ParticleGun
-            log.error("On-the-fly generation other than with CosmicGenerator is not supported yet!")
-            pass
-    else:
-        # Cases 1, 2a, 2b, 2c
-        from AthenaConfiguration.MainServicesConfig import MainServicesCfg
-        cfg = MainServicesCfg(ConfigFlags)
-        from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-        cfg.merge(PoolReadCfg(ConfigFlags))
-        if ConfigFlags.Sim.ReadTR:
-            # Cases 2a, 2b, 2c
-            from TrackRecordGenerator.TrackRecordGeneratorConfigNew import Input_TrackRecordGeneratorCfg
-            cfg.merge(Input_TrackRecordGeneratorCfg(ConfigFlags))
-
-    from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
-    cfg.merge(PoolWriteCfg(ConfigFlags))
-
-    # add BeamEffectsAlg
-    from BeamEffects.BeamEffectsAlgConfig import BeamEffectsAlgCfg
-    cfg.merge(BeamEffectsAlgCfg(ConfigFlags))
-
-    #add the G4AtlasAlg
-    from G4AtlasAlg.G4AtlasAlgConfigNew import G4AtlasAlgCfg
-    cfg.merge(G4AtlasAlgCfg(ConfigFlags))
-
-    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
-    from SimuJobTransforms.SimOutputConfig import getStreamHITS_ItemList
-    cfg.merge( OutputStreamCfg(ConfigFlags,"HITS", ItemList=getStreamHITS_ItemList(ConfigFlags), disableEventTag=True) )
-    cfg.getEventAlgo("OutputStreamHITS").AcceptAlgs=['G4AtlasAlg']
-
-    if len(ConfigFlags.Output.EVNT_TRFileName)>0:
-        from SimuJobTransforms.SimOutputConfig import getStreamEVNT_TR_ItemList
-        cfg.merge( OutputStreamCfg(ConfigFlags,"EVNT_TR", ItemList=getStreamEVNT_TR_ItemList(ConfigFlags), disableEventTag=True) )
-        cfg.getEventAlgo("OutputStreamEVNT_TR").AcceptAlgs=['G4AtlasAlg']
-
-    # FIXME hack because deduplication is broken
-    PoolAttributes = ["TREE_BRANCH_OFFSETTAB_LEN = '100'"]
-    PoolAttributes += ["DatabaseName = '" + ConfigFlags.Output.HITSFileName + "'; ContainerName = 'TTree=CollectionTree'; TREE_AUTO_FLUSH = '1'"]
-    cfg.getService("AthenaPoolCnvSvc").PoolAttributes += PoolAttributes
+    from CommonSimulationSteering import CommonSimulationCfg
+    cfg = CommonSimulationCfg(ConfigFlags, log)
 
     # Post-include
     processPostInclude(runArgs, ConfigFlags, cfg)
diff --git a/Simulation/SimuJobTransforms/python/ISF_Skeleton.py b/Simulation/SimuJobTransforms/python/ISF_Skeleton.py
index 0ca992c17bf0..b9aad23154e8 100644
--- a/Simulation/SimuJobTransforms/python/ISF_Skeleton.py
+++ b/Simulation/SimuJobTransforms/python/ISF_Skeleton.py
@@ -166,55 +166,8 @@ def fromRunArgs(runArgs):
     # Lock flags
     ConfigFlags.lock()
 
-   # Configure main services and input reading (if required)
-    if ConfigFlags.Input.Files == '':
-        # Cases 3a, 3b
-        from AthenaConfiguration.MainServicesConfig import MainEvgenServicesCfg
-        cfg = MainEvgenServicesCfg(ConfigFlags)
-        if ConfigFlags.Beam.Type == 'cosmics':
-            # Case 3b: Configure the cosmic Generator
-            from CosmicGenerator.CosmicGeneratorConfig import CosmicGeneratorCfg
-            cfg.merge(CosmicGeneratorCfg(ConfigFlags))
-        else:
-            # Case 3a: Configure ParticleGun
-            log.error("On-the-fly generation other than with CosmicGenerator is not supported yet!")
-            pass
-    else:
-        # Cases 1, 2a, 2b, 2c
-        from AthenaConfiguration.MainServicesConfig import MainServicesCfg
-        cfg = MainServicesCfg(ConfigFlags)
-        from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-        cfg.merge(PoolReadCfg(ConfigFlags))
-        if ConfigFlags.Sim.ReadTR:
-            # Cases 2a, 2b, 2c
-            from TrackRecordGenerator.TrackRecordGeneratorConfigNew import Input_TrackRecordGeneratorCfg
-            cfg.merge(Input_TrackRecordGeneratorCfg(ConfigFlags))
-
-    from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
-    cfg.merge(PoolWriteCfg(ConfigFlags))
-
-    # add BeamEffectsAlg
-    from BeamEffects.BeamEffectsAlgConfig import BeamEffectsAlgCfg
-    cfg.merge(BeamEffectsAlgCfg(ConfigFlags))
-
-    # add the ISF_MainConfig
-    from ISF_Config.ISF_MainConfigNew import ISF_KernelCfg
-    cfg.merge(ISF_KernelCfg(ConfigFlags))
-
-    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
-    from SimuJobTransforms.SimOutputConfig import getStreamHITS_ItemList
-    cfg.merge( OutputStreamCfg(ConfigFlags,"HITS", ItemList=getStreamHITS_ItemList(ConfigFlags), disableEventTag=True) )
-    #cfg.getEventAlgo("OutputStreamHITS").AcceptAlgs=['SimKernel'] # TODO Figure out how to get the correct SimKernel name
-
-    if len(ConfigFlags.Output.EVNT_TRFileName)>0:
-        from SimuJobTransforms.SimOutputConfig import getStreamEVNT_TR_ItemList
-        cfg.merge( OutputStreamCfg(ConfigFlags,"EVNT_TR", ItemList=getStreamEVNT_TR_ItemList(ConfigFlags), disableEventTag=True) )
-        #cfg.getEventAlgo("OutputStreamEVNT_TR").AcceptAlgs=['SimKernel'] # TODO Figure out how to get the correct SimKernel name
-
-    # FIXME hack because deduplication is broken
-    PoolAttributes = ["TREE_BRANCH_OFFSETTAB_LEN = '100'"]
-    PoolAttributes += ["DatabaseName = '" + ConfigFlags.Output.HITSFileName + "'; ContainerName = 'TTree=CollectionTree'; TREE_AUTO_FLUSH = '1'"]
-    cfg.getService("AthenaPoolCnvSvc").PoolAttributes += PoolAttributes
+    from CommonSimulationSteering import CommonSimulationCfg
+    cfg = CommonSimulationCfg(ConfigFlags, log)
 
     # Post-include
     processPostInclude(runArgs, ConfigFlags, cfg)
-- 
GitLab


From 79707be7df26ef03545b3b9b604cfeedb61d17ae Mon Sep 17 00:00:00 2001
From: Oliver Majersky <oliver.majersky@cern.ch>
Date: Thu, 9 Sep 2021 15:23:58 +0200
Subject: [PATCH 046/347] AnalysisTop: Cleanup obsolete HL-LHC studies code

---
 .../TopAnalysis/Root/EventSaverFlatNtuple.cxx | 490 +-----------------
 .../xAOD/TopAnalysis/Root/EventSelection.cxx  |  60 ---
 .../Root/EventSelectionManager.cxx            |  16 -
 .../TopPhys/xAOD/TopAnalysis/Root/Tools.cxx   |   8 +-
 .../TopAnalysis/EventSaverFlatNtuple.h        |  42 --
 .../TopAnalysis/TopAnalysis/EventSelection.h  |  21 -
 .../TopAnalysis/EventSelectionManager.h       |  13 -
 .../xAOD/TopAnalysis/TopAnalysis/Tools.h      |   7 +-
 .../share/ART/artcut_test_410470afmc16a.txt   |   6 +-
 .../share/ART/artcut_test_410470afmc16d.txt   |   6 +-
 .../share/ART/artcut_test_410470fsmc16a.txt   |   6 +-
 .../ART/artcut_test_410470fsmc16apflow.txt    |   6 +-
 .../ART/artcut_test_410470fsmc16asysts.txt    |   6 +-
 .../share/ART/artcut_test_410470fsmc16d.txt   |   6 +-
 .../artcut_test_410470fsmc16dactualmurw.txt   |   6 +-
 .../ART/artcut_test_410470fsmc16dklfitter.txt |   6 +-
 .../ART/artcut_test_410470fsmc16dpflow.txt    |   6 +-
 .../ART/artcut_test_410470fsmc16dsysts.txt    |   6 +-
 .../xAOD/TopAnalysis/share/example-config.txt |   1 -
 .../TopAnalysis/share/validation-cuts.txt     |   2 +-
 .../xAOD/TopAnalysis/util/top-xaod.cxx        |  35 +-
 .../Root/ConfigurationSettings.cxx            |  10 -
 .../xAOD/TopConfiguration/Root/TopConfig.cxx  |  15 -
 .../TopConfiguration/TopConfig.h              |  20 -
 24 files changed, 23 insertions(+), 777 deletions(-)

diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSaverFlatNtuple.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSaverFlatNtuple.cxx
index 95b3dc455027..ac489c7eb23a 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSaverFlatNtuple.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSaverFlatNtuple.cxx
@@ -152,10 +152,6 @@ namespace top {
     return m_sfRetriever;
   }
 
-  std::shared_ptr<top::TreeManager> EventSaverFlatNtuple::upgradeTreeManager() {
-    return m_upgradeTreeManager;
-  }
-
   std::vector<top::TreeManager::BranchFilter>& EventSaverFlatNtuple::branchFilters() {
     return m_branchFilters;
   }
@@ -200,7 +196,7 @@ namespace top {
 
     //make a tree for each systematic
     std::string nominalTTreeName("SetMe"), nominalLooseTTreeName("SetMe");
-    if (m_config->doTightEvents() && !m_config->HLLHC()) {
+    if (m_config->doTightEvents()) {
       for (auto treeName : *config->systAllTTreeNames()) {
         if (treeName.first == m_config->nominalHashValue() || m_config->doTightSysts()) {
           m_treeManagers.push_back(std::shared_ptr<top::TreeManager>(new top::TreeManager(treeName.second, file,
@@ -1372,7 +1368,6 @@ namespace top {
         systematicTree->makeOutputVariable(trig_name.second, "ph_trigMatch_" + trig_name.first);
     }
 
-    setupUpgradeTreeManager();
     setupParticleLevelTreeManager();
   }
 
@@ -1702,120 +1697,6 @@ namespace top {
     }
   }
 
-  void EventSaverFlatNtuple::setupUpgradeTreeManager(/*const top::ParticleLevelEvent& upgradeEvent*/) {
-    // Quick return if upgrade is disabled or the tree is already initialised.
-    if (not m_config->HLLHC() or m_upgradeTreeManager) {
-      return;
-    }
-
-    m_upgradeTreeManager = std::make_shared<top::TreeManager>("upgrade", m_outputFile, m_config->outputFileNEventAutoFlush(), m_config->outputFileBasketSizePrimitive(), m_config->outputFileBasketSizeVector());
-
-    m_upgradeTreeManager->makeOutputVariable(m_weight_mc, "weight_mc");
-
-    if (m_config->doMCGeneratorWeights()) {
-      m_upgradeTreeManager->makeOutputVariable(m_mc_generator_weights, "mc_generator_weights");
-    }
-
-    //event info
-    m_upgradeTreeManager->makeOutputVariable(m_eventNumber, "eventNumber");
-    m_upgradeTreeManager->makeOutputVariable(m_runNumber, "runNumber");
-    m_upgradeTreeManager->makeOutputVariable(m_mcChannelNumber, "mcChannelNumber");
-    m_upgradeTreeManager->makeOutputVariable(m_mu, "mu");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_actual, "mu_actual");
-
-    // electrons
-    m_upgradeTreeManager->makeOutputVariable(m_el_pt, "el_pt");
-    m_upgradeTreeManager->makeOutputVariable(m_el_eta, "el_eta");
-    m_upgradeTreeManager->makeOutputVariable(m_el_phi, "el_phi");
-    m_upgradeTreeManager->makeOutputVariable(m_el_e, "el_e");
-    m_upgradeTreeManager->makeOutputVariable(m_el_charge, "el_charge");
-    m_upgradeTreeManager->makeOutputVariable(m_el_true_type, "el_true_type");
-    m_upgradeTreeManager->makeOutputVariable(m_el_true_origin, "el_true_origin");
-    m_upgradeTreeManager->makeOutputVariable(m_el_etcone20, "el_etcone20");
-    m_upgradeTreeManager->makeOutputVariable(m_el_ptcone30, "el_ptcone30");
-    //m_upgradeTreeManager->makeOutputVariable(m_el_true_firstEgMotherTruthType,   "el_true_firstEgMotherTruthType");
-    //m_upgradeTreeManager->makeOutputVariable(m_el_true_firstEgMotherTruthOrigin, "el_true_firstEgMotherTruthOrigin");
-    //m_upgradeTreeManager->makeOutputVariable(m_el_true_isPrompt, "el_true_isPrompt");
-    if (m_config->HLLHCFakes()) m_upgradeTreeManager->makeOutputVariable(m_el_faketype, "el_faketype"); // 0 true 2
-                                                                                                        // hfake
-
-    //forward electrons
-    if (m_config->useFwdElectrons()) {
-      m_upgradeTreeManager->makeOutputVariable(m_fwdel_pt, "fwdel_pt");
-      m_upgradeTreeManager->makeOutputVariable(m_fwdel_eta, "fwdel_eta");
-      m_upgradeTreeManager->makeOutputVariable(m_fwdel_phi, "fwdel_phi");
-      m_upgradeTreeManager->makeOutputVariable(m_fwdel_e, "fwdel_e");
-      m_upgradeTreeManager->makeOutputVariable(m_fwdel_etcone20, "fwdel_etcone20");
-      m_upgradeTreeManager->makeOutputVariable(m_fwdel_etcone30, "fwdel_etcone30");
-      m_upgradeTreeManager->makeOutputVariable(m_fwdel_etcone40, "fwdel_etcone40");
-    }
-
-    // muons
-    m_upgradeTreeManager->makeOutputVariable(m_mu_pt, "mu_pt");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_eta, "mu_eta");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_phi, "mu_phi");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_e, "mu_e");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_charge, "mu_charge");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_true_type, "mu_true_type");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_true_origin, "mu_true_origin");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_etcone20, "mu_etcone20");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_ptcone30, "mu_ptcone30");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_true_isPrompt, "mu_true_isPrompt");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_prodVtx_z, "mu_prodVtx_z");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_prodVtx_perp, "mu_prodVtx_perp");
-    m_upgradeTreeManager->makeOutputVariable(m_mu_prodVtx_phi, "mu_prodVtx_phi");
-
-    // jets
-    m_upgradeTreeManager->makeOutputVariable(m_jet_pt, "jet_pt");
-    m_upgradeTreeManager->makeOutputVariable(m_jet_eta, "jet_eta");
-    m_upgradeTreeManager->makeOutputVariable(m_jet_phi, "jet_phi");
-    m_upgradeTreeManager->makeOutputVariable(m_jet_e, "jet_e");
-    m_upgradeTreeManager->makeOutputVariable(m_jet_mv1eff, "jet_mv1eff");
-    m_upgradeTreeManager->makeOutputVariable(m_jet_isPileup, "jet_isPileup");
-
-    m_upgradeTreeManager->makeOutputVariable(m_jet_Ghosts_BHadron_Final_Count, "jet_nGhosts_bHadron");
-    m_upgradeTreeManager->makeOutputVariable(m_jet_Ghosts_CHadron_Final_Count, "jet_nGhosts_cHadron");
-
-    //large R jets
-    if (m_config->useTruthLargeRJets()) {
-      m_upgradeTreeManager->makeOutputVariable(m_ljet_pt, "ljet_pt");
-      m_upgradeTreeManager->makeOutputVariable(m_ljet_eta, "ljet_eta");
-      m_upgradeTreeManager->makeOutputVariable(m_ljet_phi, "ljet_phi");
-      m_upgradeTreeManager->makeOutputVariable(m_ljet_e, "ljet_e");
-
-      m_upgradeTreeManager->makeOutputVariable(m_ljet_Ghosts_BHadron_Final_Count, "ljet_nGhosts_bHadron");
-      m_upgradeTreeManager->makeOutputVariable(m_ljet_Ghosts_CHadron_Final_Count, "ljet_nGhosts_cHadron");
-    }
-
-    if (m_config->useTruthPhotons()) {
-      m_upgradeTreeManager->makeOutputVariable(m_ph_pt, "ph_pt");
-      m_upgradeTreeManager->makeOutputVariable(m_ph_eta, "ph_eta");
-      m_upgradeTreeManager->makeOutputVariable(m_ph_phi, "ph_phi");
-      m_upgradeTreeManager->makeOutputVariable(m_ph_e, "ph_e");
-      m_upgradeTreeManager->makeOutputVariable(m_ph_true_type, "ph_true_type");
-      m_upgradeTreeManager->makeOutputVariable(m_ph_true_origin, "ph_true_origin");
-      if (m_config->HLLHCFakes()) m_upgradeTreeManager->makeOutputVariable(m_ph_faketype, "ph_faketype");                                                                                                                   // 0
-                                                                                                                                                                                                                            // true
-                                                                                                                                                                                                                            // 1
-                                                                                                                                                                                                                            // efake
-                                                                                                                                                                                                                            // 2
-                                                                                                                                                                                                                            // hfake
-    }
-
-    // MET
-    m_upgradeTreeManager->makeOutputVariable(m_met_met, "met_met");
-    m_upgradeTreeManager->makeOutputVariable(m_met_phi, "met_phi");
-
-    m_upgrade_SelectionDecisions.reserve(m_extraBranches.size());
-    for (const auto& selection : m_extraBranches) {
-      m_upgrade_SelectionDecisions.push_back(std::make_pair(selection, int()));
-    }
-
-    for (auto& selectionDecision : m_upgrade_SelectionDecisions) {
-      m_upgradeTreeManager->makeOutputVariable(selectionDecision.second, selectionDecision.first);
-    }
-  }//setupUpgradeTreeManager
-
   void EventSaverFlatNtuple::recordSelectionDecision(const top::Event& event) {
     int index(0);
 
@@ -4851,375 +4732,6 @@ namespace top {
     m_particleLevelTreeManager->fill();
   }
 
-  void EventSaverFlatNtuple::saveUpgradeEvent(const top::ParticleLevelEvent& upgradeEvent) {
-    // Quick return if upgrade is disabled.
-    if (not m_config->HLLHC()) {
-      return;
-    }
-    // No need to attempt to write out anything for non-MC data.
-    if (!m_config->isMC()) {
-      return;
-    }
-    this->cleanUpgradeEvent();
-    this->calculateUpgradeEvent(upgradeEvent);
-    this->fillUpgradeEvent();
-  }
-
-  void EventSaverFlatNtuple::cleanUpgradeEvent() {
-    /* Doing nothing for now, but we should put here the (re-)initialisation to dummy values
-     * of all variables later calculated in calculateParticleLevelEvent(const top::ParticleLevelEvent& plEvent)
-     * For example all weights set to 1, all vectors cleaned, all kinematic or angular variables set to -99999.
-     */
-  }
-
-  void EventSaverFlatNtuple::calculateUpgradeEvent(const top::ParticleLevelEvent& upgradeEvent) {
-    for (auto& selectionDecision : m_upgrade_SelectionDecisions) {
-      selectionDecision.second = upgradeEvent.m_selectionDecisions[ selectionDecision.first ];
-    }
-
-    m_weight_mc = upgradeEvent.m_info->auxdataConst<float>("AnalysisTop_eventWeight");
-
-    m_eventNumber = upgradeEvent.m_info->eventNumber();
-    m_runNumber = upgradeEvent.m_info->runNumber();
-    m_mcChannelNumber = upgradeEvent.m_info->mcChannelNumber();
-
-    m_mu = upgradeEvent.m_info->averageInteractionsPerCrossing();
-    m_mu_actual = upgradeEvent.m_info->actualInteractionsPerCrossing();
-
-    // save electrons
-    unsigned int i = 0;
-    m_el_pt.resize(upgradeEvent.m_electrons->size());
-    m_el_eta.resize(upgradeEvent.m_electrons->size());
-    m_el_phi.resize(upgradeEvent.m_electrons->size());
-    m_el_e.resize(upgradeEvent.m_electrons->size());
-    m_el_etcone20.resize(upgradeEvent.m_electrons->size());
-    m_el_ptcone30.resize(upgradeEvent.m_electrons->size());
-    m_el_charge.resize(upgradeEvent.m_electrons->size());
-    m_el_true_type.resize(upgradeEvent.m_electrons->size());
-    m_el_true_origin.resize(upgradeEvent.m_electrons->size());
-    //m_el_true_firstEgMotherTruthOrigin.resize(upgradeEvent.m_electrons->size());
-    //m_el_true_firstEgMotherTruthType.resize(upgradeEvent.m_electrons->size());
-    //m_el_true_isPrompt.resize(upgradeEvent.m_electrons->size());
-    if (m_config->HLLHCFakes()) m_el_faketype.resize(upgradeEvent.m_electrons->size());
-
-    for (const auto elPtr : *upgradeEvent.m_electrons) {
-      m_el_pt[i] = elPtr->pt();
-      m_el_eta[i] = elPtr->eta();
-      m_el_phi[i] = elPtr->phi();
-      m_el_e[i] = elPtr->e();
-      m_el_charge[i] = elPtr->charge();
-
-      m_el_true_type[i] = 0;
-      m_el_true_origin[i] = 0;
-      //m_el_true_firstEgMotherTruthType[i] = 0;
-      //m_el_true_firstEgMotherTruthOrigin[i] = 0;
-      //m_el_true_isPrompt[i] = 0;
-
-      if (elPtr->isAvailable<float>("etcone20")) {
-        m_el_etcone20[i] = elPtr->auxdata<float>("etcone20");
-      } else {
-        m_el_etcone20[i] = -999;
-      }
-      if (elPtr->isAvailable<float>("ptcone30")) {
-        m_el_ptcone30[i] = elPtr->auxdata<float>("ptcone30");
-      } else {
-        m_el_ptcone30[i] = -999;
-      }
-
-      if (!m_config->HLLHCFakes()) {
-        if (elPtr->isAvailable<unsigned int>("particleType")) {
-          m_el_true_type[i] = elPtr->auxdata<unsigned int>("particleType");
-        } else if (elPtr->isAvailable<unsigned int>("classifierParticleType")) {
-          m_el_true_type[i] = elPtr->auxdata<unsigned int>("classifierParticleType");
-        } else {
-          top::check(false, "Could not obtain truth Type decoration for electron!");
-        }
-        if (elPtr->isAvailable<unsigned int>("particleOrigin")) {
-          m_el_true_origin[i] = elPtr->auxdata<unsigned int>("particleOrigin");
-        } else if (elPtr->isAvailable<unsigned int>("classifierParticleOrigin")) {
-          m_el_true_origin[i] = elPtr->auxdata<unsigned int>("classifierParticleOrigin");
-        } else {
-          top::check(false, "Could not obtain truth Origin decoration for electron!");
-        }
-        //if (elPtr->isAvailable<unsigned int>("firstEgMotherTruthType")) {
-        //    m_el_true_firstEgMotherTruthType[i] = elPtr->auxdata<unsigned int>("firstEgMotherTruthType");
-        //} else {
-        //    top::check(false, "Could not obtain mother's truth Type decoration for electron!");
-        //}
-        //if (elPtr->isAvailable<unsigned int>("firstEgMotherTruthOrigin")) {
-        //    m_el_true_firstEgMotherTruthOrigin[i] = elPtr->auxdata<unsigned int>("firstEgMotherTruthOrigin");
-        //} else {
-        //    top::check(false, "Could not obtain mother's truth Origin decoration for electron!");
-        //}
-        //m_el_true_isPrompt[i] = isPromptElectron(m_el_true_type[i], m_el_true_origin[i],
-        // m_el_true_firstEgMotherTruthType[i], m_el_true_firstEgMotherTruthOrigin[i]);
-      } else {
-        if (elPtr->isAvailable<int>("FakeType")) {
-          m_el_faketype[i] = elPtr->auxdata<int>("FakeType");
-        } else {
-          top::check(false, "Could not obtain FakeType decoration for electron!");
-        }
-        if (m_el_faketype[i] == 0) { // truthType/Origin only available for true electron (also for electron fake, but
-                                     // we are not interested in its truth info)
-          if (elPtr->isAvailable<unsigned int>("particleType")) {
-            m_el_true_type[i] = elPtr->auxdata<unsigned int>("particleType");
-          } else if (elPtr->isAvailable<unsigned int>("classifierParticleType")) {
-            m_el_true_type[i] = elPtr->auxdata<unsigned int>("classifierParticleType");
-          } else {
-            top::check(false, "Could not obtain truth Type decoration for electron!");
-          }
-          if (elPtr->isAvailable<unsigned int>("particleOrigin")) {
-            m_el_true_origin[i] = elPtr->auxdata<unsigned int>("particleOrigin");
-          } else if (elPtr->isAvailable<unsigned int>("classifierParticleOrigin")) {
-            m_el_true_origin[i] = elPtr->auxdata<unsigned int>("classifierParticleOrigin");
-          } else {
-            top::check(false, "Could not obtain truth Origin decoration for electron!");
-          }
-          //if (elPtr->isAvailable<unsigned int>("firstEgMotherTruthType")) {
-          //    m_el_true_firstEgMotherTruthType[i] = elPtr->auxdata<unsigned int>("firstEgMotherTruthType");
-          //} else {
-          //    top::check(false, "Could not obtain mother's truth Type decoration for electron!");
-          //}
-          //if (elPtr->isAvailable<unsigned int>("firstEgMotherTruthOrigin")) {
-          //    m_el_true_firstEgMotherTruthOrigin[i] = elPtr->auxdata<unsigned int>("firstEgMotherTruthOrigin");
-          //} else {
-          //    top::check(false, "Could not obtain mother's truth Origin decoration for electron!");
-          //}
-          //m_el_true_isPrompt[i] = isPromptElectron(m_el_true_type[i], m_el_true_origin[i],
-          // m_el_true_firstEgMotherTruthType[i], m_el_true_firstEgMotherTruthOrigin[i]);
-        }
-      }
-
-      ++i;
-    }
-
-    // save muons
-    i = 0;
-    m_mu_pt.resize(upgradeEvent.m_muons->size());
-    m_mu_eta.resize(upgradeEvent.m_muons->size());
-    m_mu_phi.resize(upgradeEvent.m_muons->size());
-    m_mu_e.resize(upgradeEvent.m_muons->size());
-    m_mu_etcone20.resize(upgradeEvent.m_muons->size());
-    m_mu_ptcone30.resize(upgradeEvent.m_muons->size());
-    m_mu_charge.resize(upgradeEvent.m_muons->size());
-    m_mu_true_type.resize(upgradeEvent.m_muons->size());
-    m_mu_true_origin.resize(upgradeEvent.m_muons->size());
-    m_mu_true_isPrompt.resize(upgradeEvent.m_muons->size());
-    m_mu_prodVtx_z.resize(upgradeEvent.m_muons->size());
-    m_mu_prodVtx_perp.resize(upgradeEvent.m_muons->size());
-    m_mu_prodVtx_phi.resize(upgradeEvent.m_muons->size());
-
-    for (const auto muPtr : *upgradeEvent.m_muons) {
-      m_mu_pt[i] = muPtr->pt();
-      m_mu_eta[i] = muPtr->eta();
-      m_mu_phi[i] = muPtr->phi();
-      m_mu_e[i] = muPtr->e();
-      m_mu_charge[i] = muPtr->charge();
-
-      m_mu_true_type[i] = 0;
-      m_mu_true_origin[i] = 0;
-      m_mu_true_isPrompt[i] = 0;
-      m_mu_prodVtx_z[i] = -999;
-      m_mu_prodVtx_perp[i] = -999;
-      m_mu_prodVtx_phi[i] = -999;
-      if (muPtr->isAvailable<unsigned int>("particleType")) {
-        m_mu_true_type[i] = muPtr->auxdata<unsigned int>("particleType");
-      } else if (muPtr->isAvailable<unsigned int>("classifierParticleType")) {
-        m_mu_true_type[i] = muPtr->auxdata<unsigned int>("classifierParticleType");
-      } else {
-        top::check(false, "Could not obtain truth Type decoration for muon!");
-      }
-      if (muPtr->isAvailable<unsigned int>("particleOrigin")) {
-        m_mu_true_origin[i] = muPtr->auxdata<unsigned int>("particleOrigin");
-      } else if (muPtr->isAvailable<unsigned int>("classifierParticleOrigin")) {
-        m_mu_true_origin[i] = muPtr->auxdata<unsigned int>("classifierParticleOrigin");
-      } else {
-        top::check(false, "Could not obtain truth Origin decoration for muon!");
-      }
-      m_mu_true_isPrompt[i] = isPromptMuon(m_mu_true_type[i], m_mu_true_origin[i]);
-      if (muPtr->isAvailable<float>("prodVtx_z")) {
-        m_mu_prodVtx_z[i] = muPtr->auxdata<float>("prodVtx_z");
-      }
-      if (muPtr->isAvailable<float>("prodVtx_perp")) {
-        m_mu_prodVtx_perp[i] = muPtr->auxdata<float>("prodVtx_perp");
-      }
-      if (muPtr->isAvailable<float>("etcone20")) {
-        m_mu_etcone20[i] = muPtr->auxdata<float>("etcone20");
-      } else {
-        m_mu_etcone20[i] = -999;
-      }
-      if (muPtr->isAvailable<float>("ptcone30")) {
-        m_mu_ptcone30[i] = muPtr->auxdata<float>("ptcone30");
-      } else {
-        m_mu_ptcone30[i] = -999;
-      }
-      if (muPtr->isAvailable<float>("prodVtx_phi")) {
-        m_mu_prodVtx_phi[i] = muPtr->auxdata<float>("prodVtx_phi");
-      }
-
-      ++i;
-    }
-
-    static const SG::AuxElement::ConstAccessor<int> ghostBHadronsFinalCount("GhostBHadronsFinalCount");
-    static const SG::AuxElement::ConstAccessor<int> ghostCHadronsFinalCount("GhostCHadronsFinalCount");
-
-    // save jets
-    i = 0;
-    m_jet_pt.resize(upgradeEvent.m_jets->size());
-    m_jet_eta.resize(upgradeEvent.m_jets->size());
-    m_jet_phi.resize(upgradeEvent.m_jets->size());
-    m_jet_e.resize(upgradeEvent.m_jets->size());
-    m_jet_mv1eff.resize(upgradeEvent.m_jets->size());
-    m_jet_isPileup.resize(upgradeEvent.m_jets->size());
-    m_jet_Ghosts_BHadron_Final_Count.resize(upgradeEvent.m_jets->size());
-    m_jet_Ghosts_CHadron_Final_Count.resize(upgradeEvent.m_jets->size());
-    for (const auto *jetPtr : *upgradeEvent.m_jets) {
-      m_jet_pt[i] = jetPtr->pt();
-      m_jet_eta[i] = jetPtr->eta();
-      m_jet_phi[i] = jetPtr->phi();
-      m_jet_e[i] = jetPtr->e();
-
-      m_jet_mv1eff[i] = jetPtr->auxdata<float>("mv1TagEff");
-
-      if (jetPtr->auxdata<int>("pileUp") == 0) {
-        m_jet_isPileup[i] = 0;
-        
-	if(ghostBHadronsFinalCount.isAvailable(*jetPtr)) {
-	  m_jet_Ghosts_BHadron_Final_Count[i] = ghostBHadronsFinalCount(*jetPtr);
-	}
-	else {
-	  ATH_MSG_DEBUG("Found a jet with no GhostBHadronFinalCount auxdata");
-	  m_jet_Ghosts_BHadron_Final_Count[i] = 0;
-	}
-	
-	if(ghostCHadronsFinalCount.isAvailable(*jetPtr)) {
-	  m_jet_Ghosts_CHadron_Final_Count[i] = ghostCHadronsFinalCount(*jetPtr);
-	}
-	else {
-	  ATH_MSG_DEBUG("Found a jet with no GhostCHadronFinalCount auxdata");
-	  m_jet_Ghosts_CHadron_Final_Count[i] = 0;
-	}
-	
-      } else {
-        m_jet_isPileup[i] = 1;
-        m_jet_Ghosts_BHadron_Final_Count[i] = 0;
-        m_jet_Ghosts_CHadron_Final_Count[i] = 0;
-      }
-
-      ++i;
-    }
-
-    //large R jets
-    if (m_config->useTruthLargeRJets()) {
-      unsigned int i = 0;
-
-      m_ljet_pt.resize(upgradeEvent.m_largeRJets->size());
-      m_ljet_eta.resize(upgradeEvent.m_largeRJets->size());
-      m_ljet_phi.resize(upgradeEvent.m_largeRJets->size());
-      m_ljet_e.resize(upgradeEvent.m_largeRJets->size());
-      m_ljet_Ghosts_BHadron_Final_Count.resize(upgradeEvent.m_largeRJets->size());
-      m_ljet_Ghosts_CHadron_Final_Count.resize(upgradeEvent.m_largeRJets->size());
-      for (const auto *jetPtr : *upgradeEvent.m_largeRJets) {
-        m_ljet_pt[i] = jetPtr->pt();
-        m_ljet_eta[i] = jetPtr->eta();
-        m_ljet_phi[i] = jetPtr->phi();
-        m_ljet_e[i] = jetPtr->e();
-
-        if(ghostBHadronsFinalCount.isAvailable(*jetPtr)) {
-	  m_ljet_Ghosts_BHadron_Final_Count[i] = ghostBHadronsFinalCount(*jetPtr);
-	}
-	else {
-	  ATH_MSG_DEBUG("Found a jet with no GhostBHadronFinalCount auxdata");
-	  m_ljet_Ghosts_BHadron_Final_Count[i] = 0;
-	}
-	
-	if(ghostCHadronsFinalCount.isAvailable(*jetPtr)) {
-	  m_ljet_Ghosts_CHadron_Final_Count[i] = ghostCHadronsFinalCount(*jetPtr);
-	}
-	else {
-	  ATH_MSG_DEBUG("Found a jet with no GhostCHadronFinalCount auxdata");
-	  m_ljet_Ghosts_CHadron_Final_Count[i] = 0;
-	}
-
-        ++i;
-      }
-    }
-
-    //photons
-    if (m_config->useTruthPhotons()) {
-      unsigned int i(0);
-      m_ph_pt.resize(upgradeEvent.m_photons->size());
-      m_ph_eta.resize(upgradeEvent.m_photons->size());
-      m_ph_phi.resize(upgradeEvent.m_photons->size());
-      m_ph_e.resize(upgradeEvent.m_photons->size());
-      m_ph_true_type.resize(upgradeEvent.m_photons->size());
-      m_ph_true_origin.resize(upgradeEvent.m_photons->size());
-      if (m_config->HLLHCFakes()) m_ph_faketype.resize(upgradeEvent.m_photons->size());
-
-      for (const auto* const phPtr : *upgradeEvent.m_photons) {
-        m_ph_pt[i] = phPtr->pt();
-        m_ph_eta[i] = phPtr->eta();
-        m_ph_phi[i] = phPtr->phi();
-        m_ph_e[i] = phPtr->e();
-        if (!m_config->HLLHCFakes()) {
-          if (phPtr->isAvailable<unsigned int>("particleType")) {
-            m_ph_true_type[i] = phPtr->auxdata<unsigned int>("particleType");
-          } else if (phPtr->isAvailable<unsigned int>("classifierParticleType")) {
-            m_ph_true_type[i] = phPtr->auxdata<unsigned int>("classifierParticleType");
-          } else {
-            top::check(false, "Could not obtain truth Type decoration for photon!");
-          }
-          if (phPtr->isAvailable<unsigned int>("particleOrigin")) {
-            m_ph_true_origin[i] = phPtr->auxdata<unsigned int>("particleOrigin");
-          } else if (phPtr->isAvailable<unsigned int>("classifierParticleOrigin")) {
-            m_ph_true_origin[i] = phPtr->auxdata<unsigned int>("classifierParticleOrigin");
-          } else {
-            top::check(false, "Could not obtain truth Origin decoration for photon!");
-          }
-        } else {
-          if (phPtr->isAvailable<int>("FakeType")) {
-            m_ph_faketype[i] = phPtr->auxdata<int>("FakeType");
-          } else {
-            top::check(false, "Could not obtain FakeType decoration for photon!");
-          }
-          if (m_ph_faketype[i] == 0) { // truthType/Origin only available for true photon (also for electron fake, but
-                                       // we are not interested in its truth info)
-            if (phPtr->isAvailable<unsigned int>("particleType")) {
-              m_ph_true_type[i] = phPtr->auxdata<unsigned int>("particleType");
-            } else if (phPtr->isAvailable<unsigned int>("classifierParticleType")) {
-              m_ph_true_type[i] = phPtr->auxdata<unsigned int>("classifierParticleType");
-            } else {
-              top::check(false, "Could not obtain truth Type decoration for photon!");
-            }
-            if (phPtr->isAvailable<unsigned int>("particleOrigin")) {
-              m_ph_true_origin[i] = phPtr->auxdata<unsigned int>("particleOrigin");
-            } else if (phPtr->isAvailable<unsigned int>("classifierParticleOrigin")) {
-              m_ph_true_origin[i] = phPtr->auxdata<unsigned int>("classifierParticleOrigin");
-            } else {
-              top::check(false, "Could not obtain truth Origin decoration for photon!");
-            }
-          }
-        }
-
-        ++i;
-      }
-    }
-
-    // MET
-    m_met_met = upgradeEvent.m_met->met();
-    m_met_phi = upgradeEvent.m_met->phi();
-
-    if (m_config->doMCGeneratorWeights()) {
-      // delegate to helper function.
-      loadMCGeneratorWeights();
-    }
-  }
-
-  void EventSaverFlatNtuple::fillUpgradeEvent() {
-    // fill the tree
-    m_upgradeTreeManager->fill();
-  }//saveUpgradeEvent
-
   void EventSaverFlatNtuple::finalize() {
     m_outputFile->Write();
   }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSelection.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSelection.cxx
index 2206953a410a..c730515252b9 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSelection.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSelection.cxx
@@ -52,7 +52,6 @@ namespace top {
     m_cutflowBScaleFactors_Loose(nullptr),
     m_cutflowParticleLevel(nullptr),
     m_cutflowParticleLevelMCWeights(nullptr),
-    m_cutflowUpgradeLevel(nullptr),
     m_name(name),
     m_isMC(false),
     m_sfRetriever(nullptr),
@@ -135,12 +134,6 @@ namespace top {
                                                  cutNames.size(), -0.5, cutNames.size() - 0.5);
     }
 
-    if (config->HLLHC()) {
-      m_cutflowUpgradeLevel = new TH1D("cutflow_upgrade_level",
-                                       (name + " cutflow_upgrade_level").c_str(), cutNames.size(), -0.5,
-                                       cutNames.size() - 0.5);
-    }
-
     unsigned int i(0);
     for (const auto& currentCutName : cutNames) {
       //look through all the libraries and load any tools
@@ -207,10 +200,6 @@ namespace top {
         m_cutflowParticleLevelMCWeights->GetXaxis()->SetBinLabel(i + 1, m_allCuts[i]->name().c_str());
       }
 
-      if (m_cutflowUpgradeLevel) {
-        m_cutflowUpgradeLevel->GetXaxis()->SetBinLabel(i + 1, m_allCuts[i]->name().c_str());
-      }
-
       if (currentCutName == "SAVE") {
         m_toBeSaved = true;
       }
@@ -244,7 +233,6 @@ namespace top {
     m_cutflowBScaleFactors_Loose(std::move(other.m_cutflowBScaleFactors_Loose)),
     m_cutflowParticleLevel(std::move(other.m_cutflowParticleLevel)),
     m_cutflowParticleLevelMCWeights(std::move(other.m_cutflowParticleLevelMCWeights)),
-    m_cutflowUpgradeLevel(std::move(other.m_cutflowUpgradeLevel)),
     m_name(std::move(other.m_name)),
     m_isMC(std::move(other.m_isMC)),
     m_config(std::move(other.m_config)),
@@ -505,37 +493,6 @@ namespace top {
     return passEvent;
   }
 
-  bool EventSelection::applyUpgradeLevel(const top::ParticleLevelEvent& upgradeEvent) const {
-    // In principle, this function should never be called for non-active
-    // upgrade level. However, for code safetly, include a null pointer
-    // check. Return false here because "do-not-do-particle-level" is equivalent
-    // to "do-no-save-particle-level".
-    if (not m_cutflowUpgradeLevel) {
-      return false;
-    }
-
-    unsigned int i(0);
-    bool passEvent(false);
-
-    for (const auto& currentCut : m_allCuts) {
-      // we use applyParticleLevel, because in the end upgrade events are smeared
-      // truth level, so we can just re-use this function
-      const bool passed = currentCut->applyParticleLevel(upgradeEvent);
-
-      if (!passed) break;
-
-      m_cutflowUpgradeLevel->Fill(i);
-
-      passEvent |= (currentCut->name() == "SAVE");
-      ++i;
-    }
-
-    // If "SAVE" wasn't found but event passes all cuts, event passes the selection
-    passEvent |= (i == m_allCuts.size());
-
-    return passEvent;
-  }
-
   void EventSelection::finalise() const {
     //2dp, neater output for numbers
     std::ostream& msgInfo = msg(MSG::Level::INFO);
@@ -565,10 +522,6 @@ namespace top {
         msgInfo << std::setw(15) << "particle level mc";
       }
 
-      if (m_cutflowUpgradeLevel) {
-        msgInfo << std::setw(15) << "upgrade level";
-      }
-
       msgInfo << "\n";
 
       //cutflow table content
@@ -591,10 +544,6 @@ namespace top {
           msgInfo << std::setw(15) << m_cutflowParticleLevelMCWeights->GetBinContent(i);
         }
 
-        if (m_cutflowUpgradeLevel) {
-          msgInfo << std::setw(15) << m_cutflowUpgradeLevel->GetBinContent(i);
-        }
-
         msgInfo << "\n";
       }
     }
@@ -621,11 +570,6 @@ namespace top {
         msgInfo << std::setw(15) << "particle level mc";
       }
 
-      if (m_cutflowUpgradeLevel) {
-        msgInfo << std::setw(15) << "upgrade level";
-      }
-
-
       msgInfo << "\n";
 
       //cutflow table content
@@ -648,10 +592,6 @@ namespace top {
           msgInfo << std::setw(15) << m_cutflowParticleLevelMCWeights->GetBinContent(i);
         }
 
-        if (m_cutflowUpgradeLevel) {
-          msgInfo << std::setw(15) << m_cutflowUpgradeLevel->GetBinContent(i);
-        }
-
         msgInfo << "\n";
       }
     }
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSelectionManager.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSelectionManager.cxx
index c86529a2033d..a5405695cef8 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSelectionManager.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/EventSelectionManager.cxx
@@ -134,22 +134,6 @@ namespace top {
     return save;
   }
 
-  bool EventSelectionManager::applyUpgradeLevel(const top::ParticleLevelEvent& upgradeEvent) {
-    bool save(false);
-
-    for (const auto& currentSelection : m_selections) {
-      const bool passedThisSelection = currentSelection.applyUpgradeLevel(upgradeEvent);
-
-      //save result as new branch (int)
-      upgradeEvent.m_selectionDecisions[ currentSelection.name() ] = passedThisSelection;
-
-      //Did any of the selections with SAVE specified pass for this event (if so we might want to keep the event)
-      save |= (passedThisSelection && currentSelection.ToBeSaved());
-    }
-
-    return save;
-  }
-
   void EventSelectionManager::finalise() {
     ATH_MSG_INFO("Final yields:");
     for (const auto& currentSelection : m_selections)
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/Tools.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/Tools.cxx
index cc54b072af44..d6d08d3d3155 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/Tools.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/Root/Tools.cxx
@@ -87,7 +87,7 @@ namespace top {
   }
 
   void parseCutBookkeepers(xAOD::TEvent& xaodEvent, const std::size_t size,
-      std::vector<std::string> &names, std::vector<float>& sumW, const bool isHLLHC) {
+      std::vector<std::string> &names, std::vector<float>& sumW) {
 
     // workaround for PMGTruthWeightTool returning ZERO weights, when sample has ONLY ONE weight...
     const std::size_t modifiedSize = (size == 0) ? 1 : size;
@@ -102,7 +102,7 @@ namespace top {
         // skip RDO and ESD numbers, which are nonsense; and
         // skip the derivation number, which is the one after skimming
         // we want the primary xAOD numbers
-        if ((cbk->inputStream() != "StreamAOD") && !(isHLLHC && cbk->inputStream() == "StreamDAOD_TRUTH1"))
+        if ((cbk->inputStream() != "StreamAOD"))
           continue;
         if (cbk->name() != "AllExecutedEvents") continue;
         const std::string name = cbk->name() + "_weight_" + std::to_string(icbk);
@@ -121,12 +121,12 @@ namespace top {
     }
   }
 
-  ULong64_t getRawEventsBookkeeper(const xAOD::CutBookkeeperContainer *cutBookKeepers, const bool isHLLHC) {
+  ULong64_t getRawEventsBookkeeper(const xAOD::CutBookkeeperContainer *cutBookKeepers) {
     int maxCycle = -1;
     ULong64_t rawEntries = 0;
     // search for "AllExecutedEvents" bookkeeper -- this one should always exist
     for (const xAOD::CutBookkeeper *cbk : *cutBookKeepers) {
-      if ((cbk->inputStream() != "StreamAOD") && !(isHLLHC && cbk->inputStream() == "StreamDAOD_TRUTH1"))
+      if ((cbk->inputStream() != "StreamAOD"))
         continue;
       if (cbk->name() != "AllExecutedEvents")
         continue;
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSaverFlatNtuple.h b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSaverFlatNtuple.h
index 291cbac5636f..0305408865e0 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSaverFlatNtuple.h
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSaverFlatNtuple.h
@@ -17,8 +17,6 @@
 
 
 namespace top {
-// fwd declare upgrade class
-  class UpgradeEvent;
 
 /**
  * @brief Some code that writes out a 'standard' flat ntuple.  This can be
@@ -102,22 +100,6 @@ namespace top {
                                                                                       // variables
     virtual void fillParticleLevelEvent(); // calls tree->Fill
 
-    /*!
-     * @brief Store the upgrade event's content in the upgrade
-     * TTree as flat n-tuple.
-     *
-     * This function shall be executed once for each event which is intended for
-     * storage. It writes out the pass/fail results of all EventSelection chains
-     * that have been applied to that specific event object.
-     *
-     * @param upgradeEvent The upgrade event whose data content will be
-     * written to the output.
-     */
-    virtual void saveUpgradeEvent(const top::ParticleLevelEvent& plEvent) override; // calls the three next functions
-    virtual void cleanUpgradeEvent(); // (re-)initialise all relevant variables to default (dummy) values
-    virtual void calculateUpgradeEvent(const top::ParticleLevelEvent& plEvent); // calculate the relevant variables
-    virtual void fillUpgradeEvent(); // calls tree->Fill
-
     /**
      * @brief Not used by the flat ntuple code yet, but needed by the xAOD code.
      */
@@ -152,14 +134,6 @@ namespace top {
      */
     std::shared_ptr<top::TreeManager> particleLevelTreeManager();
 
-    /*!
-     * @brief Return a shared pointer to the top::TreeManager object that is
-     * used for the upgrade level output tree.
-     * @returns A shared pointer to the top::TreeManager object that is used to
-     * write out the upgrade level event data.
-     */
-    std::shared_ptr<top::TreeManager> upgradeTreeManager();
-
     /**
      * @brief Return a shared pointer to the top::ScaleFactorRetriever object
      * which allows us to easily access the SF decorations
@@ -180,11 +154,6 @@ namespace top {
      */
     void setupParticleLevelTreeManager(/*const top::ParticleLevelEvent& plEvent*/);
 
-    /*!
-     * @brief Internal function which configures the upgrade tree manager.
-     * It does branch setup etc.
-     */
-    void setupUpgradeTreeManager(/*const top::UpgradeEvent& upgradeEvent*/);
   private:
     /**
      * @brief For each selection that we run in the top-xaod code, we "decorate"
@@ -247,10 +216,6 @@ namespace top {
     ///    .first  --- The name of the selection
     ///    .second --- The variable used for storing into the TTree
     std::vector< std::pair<std::string, int> > m_particleLevel_SelectionDecisions;
-    std::vector< std::pair<std::string, int> > m_upgrade_SelectionDecisions;
-
-    /// TreeManager for upgrade analysis data output
-    std::shared_ptr<top::TreeManager> m_upgradeTreeManager;
 
     ///names of the passed / failed branches.
     std::vector<std::string> m_extraBranches;
@@ -669,10 +634,6 @@ namespace top {
     std::vector<std::vector<float> > m_failFJvt_jet_ghostTrack_z0;
     std::vector<std::vector<float> > m_failFJvt_jet_ghostTrack_qOverP;
 
-    // for upgrade, we store the tagging efficiency per jet & whether it is from pileup
-    std::vector<float> m_jet_mv1eff;
-    std::vector<float> m_jet_isPileup;
-
     //large-R jets
     std::vector<float> m_ljet_pt;
     std::vector<float> m_ljet_eta;
@@ -1231,9 +1192,6 @@ namespace top {
                                                                                                                    // WP
                                                                                                                    // is
                                                                                                                    // used
-    // for upgrade, we store the tagging efficiency per jet & whether it is from pileup
-    const std::vector<float>& jet_mv1eff() const {return m_jet_mv1eff;}
-    const std::vector<float>& jet_isPileup() const {return m_jet_isPileup;}
 
     // fail-JVT jets
     const std::vector<float>& failJvt_jet_pt() const {return m_failJvt_jet_pt;}
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSelection.h b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSelection.h
index a5d54b3f4dcc..21bc5ded2ddd 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSelection.h
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSelection.h
@@ -126,23 +126,6 @@ namespace top {
      */
     virtual bool applyParticleLevel(const top::ParticleLevelEvent& plEvent) const;
 
-    /*!
-     * @brief Apply the selection for each upgrade level event.
-     *
-     * This loops through all the cuts configured for reco (nominal) level to
-     * see if the top::ParticleLevelEvent passes them or not. It also fills the
-     * upgrade level cutflow histogram corresponding to the stage up to which
-     * the event passes through the event selection.
-     *
-     * @param plEvent This is the upgrade level event which is in question. It
-     * will not be modified by any of the cuts.
-     * @return If the event passes all cuts, or at least all those before SAVE
-     * then true will be returned - which means that this event passes
-     * the selection - and false otherwise. The selection flag will be set accordingly.
-     * In case of true if SAVE is present then the event will be saved.
-     */
-    virtual bool applyUpgradeLevel(const top::ParticleLevelEvent& plEvent) const;
-
     /**
      * @brief Print some yield information.
      *
@@ -217,10 +200,6 @@ namespace top {
     mutable TH1D* m_cutflowParticleLevel;
     mutable TH1D* m_cutflowParticleLevelMCWeights;
 
-    ///The upgrade level cutflow histogram filled by the tool.
-    mutable TH1D* m_cutflowUpgradeLevel;
-
-
     /**
      * @brief Name of this selection (you can have multiple selections run in
      * the same job
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSelectionManager.h b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSelectionManager.h
index 3da71c551e44..05b138db72a3 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSelectionManager.h
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/EventSelectionManager.h
@@ -112,19 +112,6 @@ namespace top {
      */
     virtual bool applyParticleLevel(const top::ParticleLevelEvent& plEvent);
 
-    /*!
-     * @brief Execute the event selection using the Upgrade Level data.
-     *
-     * This uses the same event selection objects as the reco level (nominal)
-     * selection. The function is almost a carbon copy of the apply(top::Event&)
-     * variant.
-     *
-     * @param upgradeEvent The upgrade level event in question.
-     * @return Returns true if the event passes at least one selection for which
-     * SAVE is requested (for saving events to trees).
-     */
-    virtual bool applyUpgradeLevel(const top::ParticleLevelEvent& upgradeEvent);
-
     /**
      * @brief Call finalise on each tool.
      *
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/Tools.h b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/Tools.h
index 950a4b6a61d8..a25b78e07ee3 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/Tools.h
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/TopAnalysis/Tools.h
@@ -53,21 +53,18 @@ namespace top {
  * @param number of the generator weights
  * @param names Vector of names of the selected bookkeepers
  * @param sumW Vector of sum of weights of the selected bookkeepers
- * @param isHLLHC Whether this is a HLLHC ugprade sample, it uses different stream for bookkeepers
  */
   void parseCutBookkeepers(xAOD::TEvent& event, const std::size_t size,
-      std::vector<std::string> &names, std::vector<float>& sumW, const bool isHLLHC=false);
+      std::vector<std::string> &names, std::vector<float>& sumW);
 
 /**
  * @brief Get raw number of events before skimming from "AllExecutedEvents" bookkeeper
  * 
  * @param cutBookKeepers Container with CutBookkeepers
- * @param isHLLHC Whether this is a HLLHC ugprade sample, it uses different stream for bookkeepers
  *
  * @return number of raw events before skimming
  */
-  ULong64_t getRawEventsBookkeeper(const xAOD::CutBookkeeperContainer *cutBookKeepers,
-      const bool isHLLHC=false);
+  ULong64_t getRawEventsBookkeeper(const xAOD::CutBookkeeperContainer *cutBookKeepers);
 
 /**
  * @brief Rename CutBookkeeper names according to MC generator weight names reported by PMGTruthWeightTool
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470afmc16a.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470afmc16a.txt
index 83493f348d56..64683ce9aaec 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470afmc16a.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470afmc16a.txt
@@ -19,12 +19,11 @@ PRWLumiCalcFiles GoodRunsLists/data15_13TeV/20170619/PHYS_StandardGRL_All_Good_2
 
 
 
-BTagCDIPath xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root
 
 ### Object container names
 ElectronCollectionName Electrons
 MuonCollectionName Muons
-JetCollectionName AntiKt4EMTopoJets_BTagging201810
+JetCollectionName AntiKt4EMPFlowJets
 LargeJetCollectionName AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets 
 TauCollectionName TauJets
 PhotonCollectionName Photons
@@ -91,8 +90,6 @@ TauJetIDWP Medium
 TauJetIDWPLoose Medium
 TauEleBDTWP Loose
 TauEleBDTWPLoose Loose
-TauEleOLR False
-TauEleOLRLoose False
 
 # DoTight/DoLoose to activate the loose and tight trees
 # each should be one in: Data, MC, Both, False
@@ -100,7 +97,6 @@ DoTight Both
 DoLoose Data
 
 # Turn on MetaData to pull IsAFII from metadata
-UseAodMetaData True
 #IsAFII False
 
 ### Boosted jet taggers configuration
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470afmc16d.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470afmc16d.txt
index 8d41d932f08b..5e4d259b1b1f 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470afmc16d.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470afmc16d.txt
@@ -12,12 +12,11 @@ PRWConfigFiles_AF dev/AnalysisTop/PileupReweighting/user.iconnell.Top.PRW.MC16d.
 PRWLumiCalcFiles GoodRunsLists/data17_13TeV/20180619/physics_25ns_Triggerno17e33prim.lumicalc.OflLumi-13TeV-010.root
 
 
-BTagCDIPath xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root
 
 ### Object container names
 ElectronCollectionName Electrons
 MuonCollectionName Muons
-JetCollectionName AntiKt4EMTopoJets_BTagging201810
+JetCollectionName AntiKt4EMPFlowJets
 LargeJetCollectionName AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets 
 TauCollectionName TauJets
 PhotonCollectionName Photons
@@ -84,8 +83,6 @@ TauJetIDWP Medium
 TauJetIDWPLoose Medium
 TauEleBDTWP Loose
 TauEleBDTWPLoose Loose
-TauEleOLR False
-TauEleOLRLoose False
 
 # DoTight/DoLoose to activate the loose and tight trees
 # each should be one in: Data, MC, Both, False
@@ -93,7 +90,6 @@ DoTight Both
 DoLoose Data
 
 # Turn on MetaData to pull IsAFII from metadata
-UseAodMetaData True
 #IsAFII False
 
 ### Boosted jet taggers configuration
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16a.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16a.txt
index 83493f348d56..64683ce9aaec 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16a.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16a.txt
@@ -19,12 +19,11 @@ PRWLumiCalcFiles GoodRunsLists/data15_13TeV/20170619/PHYS_StandardGRL_All_Good_2
 
 
 
-BTagCDIPath xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root
 
 ### Object container names
 ElectronCollectionName Electrons
 MuonCollectionName Muons
-JetCollectionName AntiKt4EMTopoJets_BTagging201810
+JetCollectionName AntiKt4EMPFlowJets
 LargeJetCollectionName AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets 
 TauCollectionName TauJets
 PhotonCollectionName Photons
@@ -91,8 +90,6 @@ TauJetIDWP Medium
 TauJetIDWPLoose Medium
 TauEleBDTWP Loose
 TauEleBDTWPLoose Loose
-TauEleOLR False
-TauEleOLRLoose False
 
 # DoTight/DoLoose to activate the loose and tight trees
 # each should be one in: Data, MC, Both, False
@@ -100,7 +97,6 @@ DoTight Both
 DoLoose Data
 
 # Turn on MetaData to pull IsAFII from metadata
-UseAodMetaData True
 #IsAFII False
 
 ### Boosted jet taggers configuration
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16apflow.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16apflow.txt
index 5de6d250728b..64683ce9aaec 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16apflow.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16apflow.txt
@@ -19,12 +19,11 @@ PRWLumiCalcFiles GoodRunsLists/data15_13TeV/20170619/PHYS_StandardGRL_All_Good_2
 
 
 
-BTagCDIPath xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root
 
 ### Object container names
 ElectronCollectionName Electrons
 MuonCollectionName Muons
-JetCollectionName AntiKt4EMPFlowJets_BTagging201810
+JetCollectionName AntiKt4EMPFlowJets
 LargeJetCollectionName AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets 
 TauCollectionName TauJets
 PhotonCollectionName Photons
@@ -91,8 +90,6 @@ TauJetIDWP Medium
 TauJetIDWPLoose Medium
 TauEleBDTWP Loose
 TauEleBDTWPLoose Loose
-TauEleOLR False
-TauEleOLRLoose False
 
 # DoTight/DoLoose to activate the loose and tight trees
 # each should be one in: Data, MC, Both, False
@@ -100,7 +97,6 @@ DoTight Both
 DoLoose Data
 
 # Turn on MetaData to pull IsAFII from metadata
-UseAodMetaData True
 #IsAFII False
 
 ### Boosted jet taggers configuration
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16asysts.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16asysts.txt
index 19e58073fd29..a5e06237df0e 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16asysts.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16asysts.txt
@@ -19,12 +19,11 @@ PRWLumiCalcFiles GoodRunsLists/data15_13TeV/20170619/PHYS_StandardGRL_All_Good_2
 
 
 
-BTagCDIPath xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root
 
 ### Object container names
 ElectronCollectionName Electrons
 MuonCollectionName Muons
-JetCollectionName AntiKt4EMTopoJets_BTagging201810
+JetCollectionName AntiKt4EMPFlowJets
 LargeJetCollectionName AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets 
 TauCollectionName TauJets
 PhotonCollectionName Photons
@@ -91,8 +90,6 @@ TauJetIDWP Medium
 TauJetIDWPLoose Medium
 TauEleBDTWP Loose
 TauEleBDTWPLoose Loose
-TauEleOLR False
-TauEleOLRLoose False
 
 # DoTight/DoLoose to activate the loose and tight trees
 # each should be one in: Data, MC, Both, False
@@ -100,7 +97,6 @@ DoTight Both
 DoLoose Data
 
 # Turn on MetaData to pull IsAFII from metadata
-UseAodMetaData True
 #IsAFII False
 
 ### Boosted jet taggers configuration
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16d.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16d.txt
index 8d41d932f08b..5e4d259b1b1f 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16d.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16d.txt
@@ -12,12 +12,11 @@ PRWConfigFiles_AF dev/AnalysisTop/PileupReweighting/user.iconnell.Top.PRW.MC16d.
 PRWLumiCalcFiles GoodRunsLists/data17_13TeV/20180619/physics_25ns_Triggerno17e33prim.lumicalc.OflLumi-13TeV-010.root
 
 
-BTagCDIPath xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root
 
 ### Object container names
 ElectronCollectionName Electrons
 MuonCollectionName Muons
-JetCollectionName AntiKt4EMTopoJets_BTagging201810
+JetCollectionName AntiKt4EMPFlowJets
 LargeJetCollectionName AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets 
 TauCollectionName TauJets
 PhotonCollectionName Photons
@@ -84,8 +83,6 @@ TauJetIDWP Medium
 TauJetIDWPLoose Medium
 TauEleBDTWP Loose
 TauEleBDTWPLoose Loose
-TauEleOLR False
-TauEleOLRLoose False
 
 # DoTight/DoLoose to activate the loose and tight trees
 # each should be one in: Data, MC, Both, False
@@ -93,7 +90,6 @@ DoTight Both
 DoLoose Data
 
 # Turn on MetaData to pull IsAFII from metadata
-UseAodMetaData True
 #IsAFII False
 
 ### Boosted jet taggers configuration
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dactualmurw.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dactualmurw.txt
index c7544183005b..398ec822fcb0 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dactualmurw.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dactualmurw.txt
@@ -14,12 +14,11 @@ PRWActualMu_AF GoodRunsLists/data17_13TeV/20180619/physics_25ns_Triggerno17e33pr
 PRWLumiCalcFiles GoodRunsLists/data17_13TeV/20180619/physics_25ns_Triggerno17e33prim.lumicalc.OflLumi-13TeV-010.root
 
 
-BTagCDIPath xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root
 
 ### Object container names
 ElectronCollectionName Electrons
 MuonCollectionName Muons
-JetCollectionName AntiKt4EMTopoJets_BTagging201810
+JetCollectionName AntiKt4EMPFlowJets
 LargeJetCollectionName AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets 
 TauCollectionName TauJets
 PhotonCollectionName Photons
@@ -86,8 +85,6 @@ TauJetIDWP Medium
 TauJetIDWPLoose Medium
 TauEleBDTWP Loose
 TauEleBDTWPLoose Loose
-TauEleOLR False
-TauEleOLRLoose False
 
 # DoTight/DoLoose to activate the loose and tight trees
 # each should be one in: Data, MC, Both, False
@@ -95,7 +92,6 @@ DoTight Both
 DoLoose Data
 
 # Turn on MetaData to pull IsAFII from metadata
-UseAodMetaData True
 #IsAFII False
 
 ### Boosted jet taggers configuration
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dklfitter.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dklfitter.txt
index 16f9c9da4b4a..2dce3ec3f768 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dklfitter.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dklfitter.txt
@@ -12,12 +12,11 @@ PRWConfigFiles_AF dev/AnalysisTop/PileupReweighting/user.iconnell.Top.PRW.MC16d.
 PRWLumiCalcFiles GoodRunsLists/data17_13TeV/20180619/physics_25ns_Triggerno17e33prim.lumicalc.OflLumi-13TeV-010.root
 
 
-BTagCDIPath xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root
 
 ### Object container names
 ElectronCollectionName Electrons
 MuonCollectionName Muons
-JetCollectionName AntiKt4EMTopoJets_BTagging201810
+JetCollectionName AntiKt4EMPFlowJets
 LargeJetCollectionName AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets 
 TauCollectionName TauJets
 PhotonCollectionName Photons
@@ -84,8 +83,6 @@ TauJetIDWP Medium
 TauJetIDWPLoose Medium
 TauEleBDTWP Loose
 TauEleBDTWPLoose Loose
-TauEleOLR False
-TauEleOLRLoose False
 
 # DoTight/DoLoose to activate the loose and tight trees
 # each should be one in: Data, MC, Both, False
@@ -93,7 +90,6 @@ DoTight Both
 DoLoose Data
 
 # Turn on MetaData to pull IsAFII from metadata
-UseAodMetaData True
 #IsAFII False
 
 ### Boosted jet taggers configuration
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dpflow.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dpflow.txt
index 05e7b38aeb96..5e4d259b1b1f 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dpflow.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dpflow.txt
@@ -12,12 +12,11 @@ PRWConfigFiles_AF dev/AnalysisTop/PileupReweighting/user.iconnell.Top.PRW.MC16d.
 PRWLumiCalcFiles GoodRunsLists/data17_13TeV/20180619/physics_25ns_Triggerno17e33prim.lumicalc.OflLumi-13TeV-010.root
 
 
-BTagCDIPath xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root
 
 ### Object container names
 ElectronCollectionName Electrons
 MuonCollectionName Muons
-JetCollectionName AntiKt4EMPFlowJets_BTagging201810
+JetCollectionName AntiKt4EMPFlowJets
 LargeJetCollectionName AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets 
 TauCollectionName TauJets
 PhotonCollectionName Photons
@@ -84,8 +83,6 @@ TauJetIDWP Medium
 TauJetIDWPLoose Medium
 TauEleBDTWP Loose
 TauEleBDTWPLoose Loose
-TauEleOLR False
-TauEleOLRLoose False
 
 # DoTight/DoLoose to activate the loose and tight trees
 # each should be one in: Data, MC, Both, False
@@ -93,7 +90,6 @@ DoTight Both
 DoLoose Data
 
 # Turn on MetaData to pull IsAFII from metadata
-UseAodMetaData True
 #IsAFII False
 
 ### Boosted jet taggers configuration
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dsysts.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dsysts.txt
index fad6872b68df..0e80a2d27d81 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dsysts.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/ART/artcut_test_410470fsmc16dsysts.txt
@@ -12,12 +12,11 @@ PRWConfigFiles_AF dev/AnalysisTop/PileupReweighting/user.iconnell.Top.PRW.MC16d.
 PRWLumiCalcFiles GoodRunsLists/data17_13TeV/20180619/physics_25ns_Triggerno17e33prim.lumicalc.OflLumi-13TeV-010.root
 
 
-BTagCDIPath xAODBTaggingEfficiency/13TeV/2019-21-13TeV-MC16-CDI-2019-10-07_v1.root
 
 ### Object container names
 ElectronCollectionName Electrons
 MuonCollectionName Muons
-JetCollectionName AntiKt4EMTopoJets_BTagging201810
+JetCollectionName AntiKt4EMPFlowJets
 LargeJetCollectionName AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets 
 TauCollectionName TauJets
 PhotonCollectionName Photons
@@ -84,8 +83,6 @@ TauJetIDWP Medium
 TauJetIDWPLoose Medium
 TauEleBDTWP Loose
 TauEleBDTWPLoose Loose
-TauEleOLR False
-TauEleOLRLoose False
 
 # DoTight/DoLoose to activate the loose and tight trees
 # each should be one in: Data, MC, Both, False
@@ -93,7 +90,6 @@ DoTight Both
 DoLoose Data
 
 # Turn on MetaData to pull IsAFII from metadata
-UseAodMetaData True
 #IsAFII False
 
 ### Boosted jet taggers configuration
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/example-config.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/example-config.txt
index 9050f2d00d03..bd1e70ef57d6 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/example-config.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/example-config.txt
@@ -27,7 +27,6 @@ DoLoose Data
 Systematics Nominal #Nominal->only nominal. All -> all systematics (will be much slower). You can also use AllMuons, AllJets... see https://twiki.cern.ch/twiki/bin/view/AtlasProtected/TopxAODStartGuideR21#Systematics
 
 #If you use MedaData (as you usually should) IsAFII (needed for fast simulation) is automatically set, see https://twiki.cern.ch/twiki/bin/view/AtlasProtected/TopxAODStartGuideR21#FullSim_vs_AFII
-UseAodMetaData True
 #IsAFII False
 
 ############GRL and PRW#############
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/validation-cuts.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/validation-cuts.txt
index b5c72415469f..2bdac70188d3 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/validation-cuts.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/validation-cuts.txt
@@ -103,7 +103,7 @@ BTaggingTrackJetWP DL1:Continuous DL1r:FixedCutBEff_77
 SaveBootstrapWeights False
 NumberOfBootstrapReplicas 100
 
-#NEvents 500
+NEvents 500
 
 ### Global lepton trigger scale factor example
 UseGlobalLeptonTriggerSF True
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx
index a09cf828d48d..ba6aceae971e 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/util/top-xaod.cxx
@@ -63,8 +63,6 @@
 
 #include "TopDataPreparation/SampleXsection.h"
 
-//#include "TopHLUpgrade/UpgradeObjectLoader.h"
-
 // to disable the sending of file access statistics
 #include "xAODRootAccess/tools/TFileAccessTracer.h"
 
@@ -275,12 +273,9 @@ int main(int argc, char** argv) {
   top::check(systObjMaker->setProperty("config", topConfig), "Failed to setProperty of systObjMaker");
   if (!topConfig->isTruthDxAOD()) top::check(systObjMaker->initialize(), "Failed to initialize systObjMaker");
 
-  //setup object definitions - not used in HLUpgrade tools
   std::unique_ptr<top::TopObjectSelection> objectSelection;
-  if (!topConfig->HLLHC()) {
-    objectSelection.reset(top::loadObjectSelection(topConfig));
-    objectSelection->print(msg(MSG::Level::INFO)); // forward to msg stream using INFO level
-  }
+  objectSelection.reset(top::loadObjectSelection(topConfig));
+  objectSelection->print(msg(MSG::Level::INFO)); // forward to msg stream using INFO level
 
   //setup event-level cuts
   top::EventSelectionManager eventSelectionManager(settings->selections(), outputFile.get(), libraryNames, topConfig);
@@ -288,9 +283,6 @@ int main(int argc, char** argv) {
   //The loader tool for top::ParticleLevelEvent objects
   top::ParticleLevelLoader particleLevelLoader(topConfig);
 
-  // The loader tool for Upgrade objects
-//  top::UpgradeObjectLoader upgradeLoader(topConfig);
-
   // Fix the configuration - it now knows about:
   //     * all objects collections to work with
   //     * all systematic variations
@@ -478,7 +470,6 @@ int main(int argc, char** argv) {
   unsigned int totalYieldSoFar = 0;
   unsigned int skippedEventsSoFar = 0;
   unsigned int eventSavedReco(0), eventSavedRecoLoose(0), eventSavedTruth(0), eventSavedParticle(0);
-//  unsigned int  eventSavedUpgrade(0);
 
   // Close the file that we opened only for metadata
   metadataInitFile->Close();
@@ -530,19 +521,19 @@ int main(int argc, char** argv) {
 
         const std::vector<std::string> &weight_names = m_pmg_weightTool->getWeightNames();
         // try to retrieve CutBookKeepers for LHE3Weights first
-        top::parseCutBookkeepers(xaodEvent, weight_names.size(), LHE3_names_file, LHE3_sumW_file, topConfig->HLLHC());
+        top::parseCutBookkeepers(xaodEvent, weight_names.size(), LHE3_names_file, LHE3_sumW_file);
         // if we have MC generator weights, we rename the bookkeepers in sumWeights TTree to match the weight names from MetaData
         top::renameCutBookkeepers(LHE3_names_file, weight_names);
 
         // raw number of events taken from "AllExecutedEvents" bookkeeper, which corresponds to 0th MC weight
         // but these are raw entries, so doesn't matter if 0th MC weight is nominal or not
-        initialEvents = top::getRawEventsBookkeeper(cutBookKeepers, topConfig->HLLHC());
+        initialEvents = top::getRawEventsBookkeeper(cutBookKeepers);
 
         // determine the nominal sum of weight -- we already found the nominal weight in ScaleFactorCalculator
         const size_t nominalWeightIndex = topConfig->nominalWeightIndex();
         sumW_file = LHE3_sumW_file.at(nominalWeightIndex);
       } else {
-        initialEvents = top::getRawEventsBookkeeper(cutBookKeepers, topConfig->HLLHC());
+        initialEvents = top::getRawEventsBookkeeper(cutBookKeepers);
         sumW_file = initialEvents; // this is data, it's the same number...
       }
     }
@@ -657,19 +648,6 @@ int main(int argc, char** argv) {
         eventSaver->saveTruthEvent();
         if(topConfig->doTopPartonLevel()) ++eventSavedTruth;
 
-        // Upgrade analysis - only for truth DAODs when asking to do upgrade studies
-        if (topConfig->isTruthDxAOD() && topConfig->HLLHC()) {
-          //top::ParticleLevelEvent upgradeEvent = upgradeLoader.load();
-
-          ////event selection
-          //const bool saveEventInOutputFile = eventSelectionManager.applyUpgradeLevel(upgradeEvent);
-
-          //if (saveEventInOutputFile) {
-          //  eventSaver->saveUpgradeEvent(upgradeEvent);
-          //  ++eventSavedUpgrade;
-          //}
-        }
-
         // Particle level analysis, saved only for truth events passing fiducial selection
 
         // --------------------------------------------------
@@ -1072,9 +1050,6 @@ int main(int argc, char** argv) {
     if (particleLevelLoader.active()) {
       ATH_MSG_INFO("Events saved to output file particle level tree : " << eventSavedParticle);
     }
-    //if (upgradeLoader.active()) {
-    //  ATH_MSG_INFO("Events saved to output file upgrade tree : " << eventSavedUpgrade);
-    //}
   }
   ATH_MSG_INFO("Total sum-of-weights (for normalization) : " << totalEventsWeighted);
 
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx
index 20d541371a61..62a1fa18979b 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/ConfigurationSettings.cxx
@@ -630,16 +630,6 @@ namespace top {
     registerParameter("LargeJetOverlapRemoval",
                       "Perform overlap removal including large-R jets. True or False (default: False).", "False");
 
-    registerParameter("HLLHC",
-                      "Set to run HL-LHC studies,"
-                      "True or False (default False)",
-                      "False");
-
-    registerParameter("HLLHCFakes",
-                      "Set to enable Fakes HL-LHC studies,"
-                      "True or False (default False)",
-                      "False");
-
     registerParameter("SaveBootstrapWeights", "Set to true in order to save Poisson bootstrap weights,"
                                               "True or False (default False)", "False");
 
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx
index bacc7168598c..f2f5d4846df6 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/Root/TopConfig.cxx
@@ -321,10 +321,6 @@ namespace top {
     m_truth_jet{25000., 2.5},
     // -----------------------------------------------]]]
 
-    // HL LHC studies
-    m_HLLHC(false),
-    m_HLLHCFakes(false),
-
     // Selections
     m_allSelectionNames(nullptr),
     // Trigger
@@ -1454,17 +1450,6 @@ namespace top {
 
     // -----------------------------------------------]]]
 
-    // Upgrade studies
-    if (settings->value("HLLHC") == "True") {
-      this->HLLHC(true);
-      if (settings->value("TDPPath").compare("dev/AnalysisTop/TopDataPreparation/XSection-MC15-13TeV.data") == 0) {
-        ATH_MSG_WARNING("TopConfig::setConfigSettings  HLLHC is set to True, but the TDPPath is set to default " <<
-          settings->value("TDPPath") << ". Changing to dev/AnalysisTop/TopDataPreparation/XSection-MC15-14TeV.data");
-        this->setTDPPath("dev/AnalysisTop/TopDataPreparation/XSection-MC15-14TeV.data");
-      }
-    }
-    if (settings->value("HLLHCFakes") == "True") this->HLLHCFakes(true);
-
     // LHAPDF Reweighting configuration
     std::istringstream lha_pdf_ss(settings->value("LHAPDFSets"));
     std::copy(std::istream_iterator<std::string>(lha_pdf_ss),
diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h
index ad12e5deb18a..60509cbc2fe4 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopConfiguration/TopConfiguration/TopConfig.h
@@ -1717,22 +1717,6 @@ namespace top {
 
     // -----------------------------------------------]]]
 
-    /// HL LHC studies
-    inline virtual void HLLHC(const bool s) {
-      if (!m_configFixed) {
-        m_HLLHC = s;
-      }
-    }
-
-    inline virtual bool HLLHC() const {return m_HLLHC;}
-    inline virtual void HLLHCFakes(const bool s) {
-      if (!m_configFixed) {
-        m_HLLHCFakes = s;
-      }
-    }
-
-    inline virtual bool HLLHCFakes() const {return m_HLLHCFakes;}
-
     void setBTaggingSFSysts(std::string WP, const std::set<std::string>& btagging_SFs, bool isTrackJet = false);
 
     inline virtual std::set<std::string>  btagging_namedSysts(std::string WP) const {return bTag_named_systs.at(WP);}
@@ -2498,10 +2482,6 @@ namespace top {
 
     // -----------------------------------------------]]]
 
-    // Options for upgrade studies
-    bool m_HLLHC;
-    bool m_HLLHCFakes;
-
     // Boosted jet taggers requested by user
     std::vector<std::pair<std::string, std::string> > m_chosen_boostedJetTaggers;
     std::unordered_map<std::string, std::string> m_boostedTaggerSFnames;
-- 
GitLab


From 6b40ed03f84c08df30071144fe3e49231970c24f Mon Sep 17 00:00:00 2001
From: Ewelina Maria Lobodzinska <ewelina.maria.lobodzinska@cern.ch>
Date: Thu, 9 Sep 2021 10:12:49 +0200
Subject: [PATCH 047/347] Merge branch '21.6_MGC_SDE_Strategy_Patch' into
 '21.6'

Patching MadGraphControl use of sde_strategy

See merge request atlas/athena!46391

(cherry picked from commit 3d581e0146c1da3b79500d2cee26daf1baec7274)

a781a54a Patching MadGraphControl use of sde_strategy
---
 Generators/MadGraphControl/python/MadGraphUtils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Generators/MadGraphControl/python/MadGraphUtils.py b/Generators/MadGraphControl/python/MadGraphUtils.py
index d47343fbbcd7..0fb6d90e6027 100755
--- a/Generators/MadGraphControl/python/MadGraphUtils.py
+++ b/Generators/MadGraphControl/python/MadGraphUtils.py
@@ -312,7 +312,7 @@ def new_process(process='generate p p > t t~\noutput -f', keepJpegs=False, usePM
         do_PMG_updates(process_dir)
 
     # After 2.9.3, enforce the standard default sde_strategy, so that this won't randomly change on the user
-    if is_version_or_newer([2,9,3]):
+    if is_version_or_newer([2,9,3]) and not is_NLO_run(process_dir=process_dir):
         mglog.info('Setting default sde_strategy to old default (1)')
         my_settings = {'sde_strategy':1}
         modify_run_card(process_dir=process_dir,settings=my_settings,skipBaseFragment=True)
-- 
GitLab


From 4eb775eb74acb93a569e1a15b649a15cb113d02b Mon Sep 17 00:00:00 2001
From: Peter Berta <peter.berta@cern.ch>
Date: Wed, 8 Sep 2021 18:02:46 +0200
Subject: [PATCH 048/347] Merge branch 'mhodgkin_fixPFlowMonAlg_Sept2021' into
 '22.0-mc20'

Bug fix for FPE in PFOMonalg

See merge request atlas/athena!46369

(cherry picked from commit d3ca6907c750683129190ca6e07d61ea8515e9e4)

8d686ea0 Bug fix to skip neutral particle flow FlowElement with E set to exactly 0. Usage
---
 .../Jet/JetInputsMonitoring/src/PFOMonitorAlgorithm.cxx  | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Reconstruction/Jet/JetInputsMonitoring/src/PFOMonitorAlgorithm.cxx b/Reconstruction/Jet/JetInputsMonitoring/src/PFOMonitorAlgorithm.cxx
index 578cc6d277d3..ef90b0a70726 100644
--- a/Reconstruction/Jet/JetInputsMonitoring/src/PFOMonitorAlgorithm.cxx
+++ b/Reconstruction/Jet/JetInputsMonitoring/src/PFOMonitorAlgorithm.cxx
@@ -122,7 +122,7 @@ StatusCode PFOMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const
       eta = pfo->eta();
       phi = pfo->phi();
       mass= pfo->m();
-      E   = pfo->e();
+      E   = pfo->e();     
       y   = pfo->rapidity();
       //float score = bdtPi0Score();
 
@@ -152,11 +152,14 @@ StatusCode PFOMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const
     }
 
     for (const auto& pfo : *nupfos) {
+      E   = pfo->e();
+      //some neutral particle flow FlowELement can have their energy set to exactly zero. Will get FPE if
+      //try to calculate rapidity, so skip these.
+      if (0 == E) continue;
       pT  = pfo->pt();
       eta = pfo->eta();
       phi = pfo->phi();
-      mass= pfo->m();
-      E   = pfo->e();
+      mass= pfo->m();      
       y   = pfo->rapidity();
       
       NupT  = pfo->pt();
-- 
GitLab


From e710a868199454242553e2d02c53673aa67c19dd Mon Sep 17 00:00:00 2001
From: Alan Watson <alan.watson@cern.ch>
Date: Thu, 9 Sep 2021 15:46:18 +0200
Subject: [PATCH 049/347] Update eFEX EDM objects to final formats.

---
 .../Root/eFexEMRoIAuxContainer_v1.cxx         |  10 +-
 Event/xAOD/xAODTrigger/Root/eFexEMRoI_v1.cxx  |  94 +++++++++------
 .../Root/eFexTauRoIAuxContainer_v1.cxx        |   4 +-
 Event/xAOD/xAODTrigger/Root/eFexTauRoI_v1.cxx | 109 +++++++++++++-----
 .../versions/eFexEMRoIAuxContainer_v1.h       |   6 +-
 .../xAODTrigger/versions/eFexEMRoI_v1.h       |  28 ++---
 .../versions/eFexTauRoIAuxContainer_v1.h      |   5 +-
 .../xAODTrigger/versions/eFexTauRoI_v1.h      |  49 ++++----
 .../L1CaloFEXSim/src/eFEXFillEDM.cxx          |  10 +-
 .../src/EMTauInputProviderFEX.cxx             |   2 +-
 10 files changed, 193 insertions(+), 124 deletions(-)

diff --git a/Event/xAOD/xAODTrigger/Root/eFexEMRoIAuxContainer_v1.cxx b/Event/xAOD/xAODTrigger/Root/eFexEMRoIAuxContainer_v1.cxx
index 652259372b99..1ef90eaa6b81 100644
--- a/Event/xAOD/xAODTrigger/Root/eFexEMRoIAuxContainer_v1.cxx
+++ b/Event/xAOD/xAODTrigger/Root/eFexEMRoIAuxContainer_v1.cxx
@@ -1,9 +1,9 @@
 /*
-  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: eFexEMRoIAuxContainer_v1.cxx  2019-07-01 13:04:25Z watsona $
-
+// Updated 2021-09-08 for (hopefully) final TOB formats
 // Local include(s):
 #include "xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h"
 
@@ -12,10 +12,8 @@ namespace xAOD {
    eFexEMRoIAuxContainer_v1::eFexEMRoIAuxContainer_v1()
       : AuxContainerBase() {
 
-      AUX_VARIABLE( Word0);
-      AUX_VARIABLE( Word1);
-      AUX_VARIABLE( eFexNumber);
-      AUX_VARIABLE( shelfNumber);
+      AUX_VARIABLE( word0);
+      AUX_VARIABLE( word1);
       AUX_VARIABLE( RetaEnv);
       AUX_VARIABLE( RetaCore);
       AUX_VARIABLE( RhadHad);
diff --git a/Event/xAOD/xAODTrigger/Root/eFexEMRoI_v1.cxx b/Event/xAOD/xAODTrigger/Root/eFexEMRoI_v1.cxx
index 762c9a2c4a51..d029b79bb32c 100755
--- a/Event/xAOD/xAODTrigger/Root/eFexEMRoI_v1.cxx
+++ b/Event/xAOD/xAODTrigger/Root/eFexEMRoI_v1.cxx
@@ -24,12 +24,40 @@ namespace xAOD {
 
    }
 
-   void eFexEMRoI_v1::initialize( uint8_t eFexNumber, uint8_t shelf, uint32_t word0, uint32_t word1 ) {
+   void eFexEMRoI_v1::initialize( unsigned int eFexNumber, unsigned int shelf, uint32_t word0 ) {
 
+      // xTOBs will have eFEX and Shelf numbers in word 1 
+      // To save space, use the second word of this object, which is not part of a TOB, to store these values
+      uint32_t word1 = 0;
+      word1 |= (eFexNumber&s_eFexMask)<<s_eFexBit;
+      word1 |= (shelf&s_shelfMask)<<s_shelfBit;
+      setWord0( word0 );
+      setWord1( word1 );
+
+      /** Quantities derived from TOB data, stored for convenience */
+      setEt( etTOB()*s_tobEtScale );
+      float etaVal = iEta()*s_towerEtaWidth + (seed()+0.5)*s_towerEtaWidth/4;
+      setEta( etaVal );
+      float phiVal = iPhi() * M_PI/32. + M_PI/64.;
+      if (phiVal > M_PI) phiVal = phiVal - 2.*M_PI;
+      setPhi( phiVal );
+
+      /** If the object is a TOB then the isTOB should be true.
+          For xTOB default is false, but should be set by the user if a matching TOB is found */
+      if (type() == TOB) setIsTOB(1);
+      else               setIsTOB(0);
+
+      return;
+   }
+
+
+   /// xTOB initialize method
+   void eFexEMRoI_v1::initialize( uint32_t word0, uint32_t word1 ) {
+
+      // xTOBs will have eFEX and Shelf numbers in word 1 
+      // So all we need to do is set the TOB words
       setWord0( word0 );
       setWord1( word1 );
-      seteFexNumber( eFexNumber );
-      setShelfNumber( shelf );
 
       /** Quantities derived from TOB data, stored for convenience */
       setEt( etTOB()*s_tobEtScale );
@@ -49,14 +77,10 @@ namespace xAOD {
 
 
    /// Raw data words
-   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint32_t, Word0,
+   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint32_t, word0,
                                          setWord0 )
-   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint32_t, Word1,
+   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint32_t, word1,
                                          setWord1 )
-   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint8_t, eFexNumber,
-                                         seteFexNumber )
-   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint8_t, shelfNumber,
-                                         setShelfNumber )
 
    /// Only calculable externally
    AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexEMRoI_v1, uint16_t, RetaCore,
@@ -88,42 +112,52 @@ namespace xAOD {
 
    /// Methods to decode data from the TOB/RoI and return to the user
 
+   /// eFEX number
+   unsigned int eFexEMRoI_v1::eFexNumber() const {
+     return (word1() >> s_eFexBit) & s_eFexMask;
+   }
+
+   /// Shelf number
+   unsigned int eFexEMRoI_v1::shelfNumber() const {
+     return (word1() >> s_shelfBit) & s_shelfMask;
+   }
+
    /// TOB or xTOB?
    eFexEMRoI_v1::ObjectType eFexEMRoI_v1::type() const {
-     if (Word1() == 0) return TOB;
-     else              return xTOB;
+     if (etXTOB() == 0) return TOB;
+     else               return xTOB;
    }
     
    /// Hardware coordinate elements
    unsigned int eFexEMRoI_v1::fpga() const {
-     return (Word0() >> s_fpgaBit) & s_fpgaMask;
+     return (word0() >> s_fpgaBit) & s_fpgaMask;
    }
     
    unsigned int eFexEMRoI_v1::fpgaEta() const {
-     return (Word0() >> s_etaBit) & s_etaMask;
+     return (word0() >> s_etaBit) & s_etaMask;
    }
     
    unsigned int eFexEMRoI_v1::fpgaPhi() const {
-     return (Word0() >> s_phiBit) & s_phiMask;
+     return (word0() >> s_phiBit) & s_phiMask;
    }
     
    unsigned int eFexEMRoI_v1::UpNotDown() const {
-     return (Word0() >> s_updownBit) & s_updownMask;
+     return (word0() >> s_updownBit) & s_updownMask;
    }
     
    unsigned int eFexEMRoI_v1::seed() const {
-     return (Word0() >> s_seedBit) & s_seedMask;
+     return (word0() >> s_seedBit) & s_seedMask;
    }
     
    unsigned int eFexEMRoI_v1::seedMax() const {
-     return (Word0() >> s_maxBit) & s_maxMask;
+     return (word0() >> s_maxBit) & s_maxMask;
    }
 
    /// Raw ET on TOB scale (100 MeV/count)
    unsigned int eFexEMRoI_v1::etTOB() const {
      // Data content = TOB
-     if (Word1() == 0) {
-       return (Word0() >> s_etBit) & s_etMask;
+     if (etXTOB() == 0) {
+       return (word0() >> s_etBit) & s_etMask;
      }
      // Data Content = xTOB. Need to remove lower bits and cap range
      else {
@@ -135,40 +169,34 @@ namespace xAOD {
    
    /// Full precision ET (25 MeV/count, only available if object is an xTOB
    unsigned int eFexEMRoI_v1::etXTOB() const {
-     /// If the object is not an xTOB return 0 as high-precision ET unavailable
-     if (Word1() == 0) { 
-       //return etTOB()*s_tobEtScale/s_xTobEtScale;
-       return 0; 
-     }
-     else {
-       return (Word1() >> s_etBit) & s_etFullMask;
-     }
+     /// If the object is not an xTOB this will return 0
+     return (word1() >> s_etBit) & s_etFullMask;
    }
     
    /// Results of the 3 jet discriminant algorithms
    unsigned int eFexEMRoI_v1::RetaThresholds() const {
-     return (Word0() >> s_veto1Bit) & s_veto1Mask;
+     return (word0() >> s_veto1Bit) & s_veto1Mask;
    }
     
    unsigned int eFexEMRoI_v1::RhadThresholds() const {
-     return (Word0() >> s_veto2Bit) & s_veto2Mask;
+     return (word0() >> s_veto2Bit) & s_veto2Mask;
    }
     
    unsigned int eFexEMRoI_v1::WstotThresholds() const {
-     return (Word0() >> s_veto3Bit) & s_veto3Mask;
+     return (word0() >> s_veto3Bit) & s_veto3Mask;
    }
     
    unsigned int eFexEMRoI_v1::bcn4() const {
-     return (Word1() >> s_bcn4Bit) & s_bcn4Mask;
+     return (word1() >> s_bcn4Bit) & s_bcn4Mask;
    }
 
    /// Return single 32-bit TOB word from an xTOB 
    uint32_t eFexEMRoI_v1::tobWord() const {
      // Do something sensible if called for a TOB
-     if (Word1() == 0) return Word0();
+     if (etXTOB() == 0) return word0();
      // When called for xTOB
      else {
-       uint32_t word = Word0() + etTOB();
+       uint32_t word = word0() + etTOB();
        return word;
      }
    }
diff --git a/Event/xAOD/xAODTrigger/Root/eFexTauRoIAuxContainer_v1.cxx b/Event/xAOD/xAODTrigger/Root/eFexTauRoIAuxContainer_v1.cxx
index 99b58dc8337e..850ad17e47d6 100644
--- a/Event/xAOD/xAODTrigger/Root/eFexTauRoIAuxContainer_v1.cxx
+++ b/Event/xAOD/xAODTrigger/Root/eFexTauRoIAuxContainer_v1.cxx
@@ -12,14 +12,14 @@ namespace xAOD {
 
       AUX_VARIABLE( word0);
       AUX_VARIABLE( word1);
-      AUX_VARIABLE( eFexNumber);
       AUX_VARIABLE( fCoreNumerator);
       AUX_VARIABLE( fCoreDenominator);
+      AUX_VARIABLE( fHadNumerator);
+      AUX_VARIABLE( fHadDenominator);
       AUX_VARIABLE( et);
       AUX_VARIABLE( eta);
       AUX_VARIABLE( phi);
       AUX_VARIABLE( isTOB);
-      AUX_VARIABLE( thrPattern);
    }
 
 } // namespace xAOD
diff --git a/Event/xAOD/xAODTrigger/Root/eFexTauRoI_v1.cxx b/Event/xAOD/xAODTrigger/Root/eFexTauRoI_v1.cxx
index 92d7b3423962..9e799d91fc69 100755
--- a/Event/xAOD/xAODTrigger/Root/eFexTauRoI_v1.cxx
+++ b/Event/xAOD/xAODTrigger/Root/eFexTauRoI_v1.cxx
@@ -18,30 +18,32 @@ namespace xAOD {
   const float eFexTauRoI_v1::s_tobEtScale = 100.;
   const float eFexTauRoI_v1::s_xTobEtScale = 25.;
   const float eFexTauRoI_v1::s_towerEtaWidth = 0.1;
-  const float eFexTauRoI_v1::s_minEta = -2.5;
 
    eFexTauRoI_v1::eFexTauRoI_v1()
       : SG::AuxElement() {
 
    }
 
-   void eFexTauRoI_v1::initialize( uint8_t eFexNumber, uint8_t shelf, uint32_t word0, uint32_t word1 ) {
+   void eFexTauRoI_v1::initialize( unsigned int eFexNumber, unsigned int shelf, uint32_t word0 ) {
 
+      // xTOBs will have eFEX and Shelf numbers in word 1 
+      // To save space, use the second word of this object, which is not part of a TOB, to store these values
+      uint32_t word1 = 0;
+      word1 |= (eFexNumber&s_eFexMask)<<s_eFexBit;
+      word1 |= (shelf&s_shelfMask)<<s_shelfBit;
       setWord0( word0 );
       setWord1( word1 );
-      seteFexNumber( eFexNumber );
-      setShelfNumber( shelf );
 
-      /** Quantities derived from TB data, stored for convenience */
+      /** Quantities derived from TOB data, stored for convenience */
       setEt( etTOB()*s_tobEtScale );
-      float etaVal = s_minEta + iEta()*s_towerEtaWidth + (seed()+0.5)*s_towerEtaWidth/4;
+      float etaVal = iEta()*s_towerEtaWidth + (seed()+0.5)*s_towerEtaWidth/4;
       setEta( etaVal );
       float phiVal = iPhi() * M_PI/32. + M_PI/64.;
       if (phiVal > M_PI) phiVal = phiVal - 2.*M_PI;
       setPhi( phiVal );
 
       /** If the object is a TOB then the isTOB should be true.
-          For xTOB default is false, but should be set if a matching TOB is found */
+          For xTOB default is false, but should be set by the user if a matching TOB is found */
       if (type() == TOB) setIsTOB(1);
       else               setIsTOB(0);
 
@@ -49,24 +51,44 @@ namespace xAOD {
    }
 
 
+   void eFexTauRoI_v1::initialize( uint32_t word0, uint32_t word1 ) {
+
+      // xTOBs will have eFEX and Shelf numbers in word 1 
+      // So all we need to do is set the TOB words
+      setWord0( word0 );
+      setWord1( word1 );
+
+      /** Quantities derived from TOB data, stored for convenience */
+      setEt( etTOB()*s_tobEtScale );
+      float etaVal = iEta()*s_towerEtaWidth + (seed()+0.5)*s_towerEtaWidth/4;
+      setEta( etaVal );
+      float phiVal = iPhi() * M_PI/32. + M_PI/64.;
+      if (phiVal > M_PI) phiVal = phiVal - 2.*M_PI;
+      setPhi( phiVal );
+
+      /** If the object is a TOB then the isTOB should be true.
+          For xTOB default is false, but should be set by the user if a matching TOB is found */
+      if (type() == TOB) setIsTOB(1);
+      else               setIsTOB(0);
+
+      return;
+   }
+
    /// Raw data words
    AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexTauRoI_v1, uint32_t, word0,
                                          setWord0 )
    AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexTauRoI_v1, uint32_t, word1,
                                          setWord1 )
-   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexTauRoI_v1, uint8_t, eFexNumber,
-                                         seteFexNumber )
-   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexTauRoI_v1, uint8_t, shelfNumber,
-                                         setShelfNumber )
-
+ 
    /// Only calculable externally
    AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexTauRoI_v1, uint16_t, fCoreNumerator,
                                          setFCoreNumerator )
    AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexTauRoI_v1, uint16_t, fCoreDenominator,
                                          setFCoreDenominator )
-   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexTauRoI_v1, uint32_t, thrPattern,
-                                         setThrPattern )
-
+   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexTauRoI_v1, uint16_t, fHadNumerator,
+                                         setFHadNumerator )
+   AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexTauRoI_v1, uint16_t, fHadDenominator,
+                                         setFHadDenominator )
 
    /// Should be set for xTOB if there is a matching TOB
    AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( eFexTauRoI_v1, char, isTOB,
@@ -83,6 +105,16 @@ namespace xAOD {
 
    /// Methods to decode data from the TOB/RoI and return to the user
 
+   /// eFEX number
+   unsigned int eFexTauRoI_v1::eFexNumber() const {
+     return (word1() >> s_eFexBit) & s_eFexMask;
+   }
+
+   /// Shelf number
+   unsigned int eFexTauRoI_v1::shelfNumber() const {
+     return (word1() >> s_shelfBit) & s_shelfMask;
+   }
+
    /// TOB or xTOB?
    eFexTauRoI_v1::ObjectType eFexTauRoI_v1::type() const {
      if (word1() == 0) return TOB;
@@ -117,7 +149,7 @@ namespace xAOD {
    /// Raw ET on TOB scale (100 MeV/count)
    unsigned int eFexTauRoI_v1::etTOB() const {
      // Data content = TOB
-     if (word1() == 0) {
+     if (etXTOB() == 0) {
        return (word0() >> s_etBit) & s_etMask;
      }
      // Data Content = xTOB. Need to remove lower bits and cap range
@@ -142,7 +174,7 @@ namespace xAOD {
      return (word0() >> s_veto1Bit) & s_veto1Mask;
    }
     
-   unsigned int eFexTauRoI_v1::tauTwoThresholds() const {
+   unsigned int eFexTauRoI_v1::fHadThresholds() const {
      return (word0() >> s_veto2Bit) & s_veto2Mask;
    }
     
@@ -151,17 +183,13 @@ namespace xAOD {
    }
     
    unsigned int eFexTauRoI_v1::bcn4() const {
-     /// If the object is not an xTOB return 0
-     if (word1() == 0) return 0;
-     else {
-       return (word1() >> s_bcn4Bit) & s_bcn4Mask;
-     }
+     return (word1() >> s_bcn4Bit) & s_bcn4Mask;
    }
 
    /// Return single 32-bit TOB word from a TOB or xTOB 
    uint32_t eFexTauRoI_v1::tobWord() const {
      // Do something sensible if called for a TOB
-     if (word1() == 0) return word0();
+     if (etXTOB() == 0) return word0();
      // When called for xTOB
      else {
        uint32_t word = word0() + etTOB();
@@ -180,7 +208,7 @@ namespace xAOD {
    /// Methods that decode the eFEX number
 
   /// Return phi index in the range 0-63
-  unsigned int eFexTauRoI_v1::iPhi() const {
+  int eFexTauRoI_v1::iPhi() const {
 
     /// Calculate octant (0-7) from eFEX and shelf numbers
     unsigned int octant = int(eFexNumber()/3) + shelfNumber()*s_shelfPhiWidth;
@@ -192,17 +220,36 @@ namespace xAOD {
     return index;
   }
 
-  /// Return an eta index in the range 0-49
-  /// Note that this may not be the final format!
-  /// And you need to combine with the seed() value to get full eta precision
-  unsigned int eFexTauRoI_v1::iEta() const {
+   /// Return an eta index in the range -25 -> +24
+   /// Value corresponds to 10*lower eta edge of tower
+   /// Note that this may not be the final format!
+   /// And you need to combine with the seed() value to get full eta precision
+   int eFexTauRoI_v1::iEta() const {
 
-    /// With appropriate constants this should work in one line...
-    unsigned int index = (eFexNumber()%3)*s_eFexEtaWidth + fpga()*s_fpgaEtaWidth + fpgaEta();
+     /// With appropriate constants this should work in one line...
+     int index = s_minEta + (eFexNumber()%3)*s_eFexEtaWidth + fpga()*s_fpgaEtaWidth + fpgaEta();
+
+     /// Return value
+     return index;
+
+   }
+
+  /// Return phi index in the range used by L1Topo (0->127)
+  int eFexTauRoI_v1::iPhiTopo() const {
+
+     /// Topo use pi/64 steps. Ours are pi/32, so we simply return 2* our integer index
+     return iPhi()*2;
 
-    return index;
    }
 
+   /// Return an eta index in the range used by L1Topo (-100->+99)
+   int eFexTauRoI_v1::iEtaTopo() const {
+
+     /// This returns e/g seed position as an integer index. 
+     /// Value corresponds to 4*lower eta edge of supercell (so 0 means 0.0 -> 0.025) 
+     return iEta()*4 + seed();
+
+   }
 
 
 } // namespace xAOD
diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h
index b6d1a784a4d2..59d204efbfb9 100644
--- a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h
+++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoIAuxContainer_v1.h
@@ -37,10 +37,8 @@ namespace xAOD {
       eFexEMRoIAuxContainer_v1();
 
    private:
-      std::vector< uint32_t > Word0;
-      std::vector< uint32_t > Word1;
-      std::vector< uint8_t >  eFexNumber;
-      std::vector< uint8_t >  shelfNumber;
+      std::vector< uint32_t > word0;
+      std::vector< uint32_t > word1;
       std::vector< uint16_t > RetaEnv;
       std::vector< uint16_t > RetaCore;
       std::vector< uint16_t > RhadHad;
diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoI_v1.h b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoI_v1.h
index e583ad806b3b..92f2f8429412 100755
--- a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoI_v1.h
+++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexEMRoI_v1.h
@@ -37,7 +37,10 @@ namespace xAOD {
       eFexEMRoI_v1();
 
       /// Initialise the object with its most important properties
-      void initialize( uint8_t eFexNumber, uint8_t shelf, uint32_t Word0, uint32_t Word1 = 0 );
+      /// TOB initialiser
+      void initialize( unsigned int eFexNumber, unsigned int shelf, uint32_t word0 );
+      /// xTOB initialiser
+      void initialize( uint32_t word0, uint32_t word1 );
 
       /// Object types
       enum ObjectType {
@@ -46,22 +49,12 @@ namespace xAOD {
       };
 
       /// The "raw" 32-bit words describing the e/gamma candidate
-      uint32_t Word0() const;
-      uint32_t Word1() const;
+      uint32_t word0() const;
+      uint32_t word1() const;
       /// Set the "raw" 32-bit words describing the e/gamma candidate
       void setWord0( uint32_t value );
       void setWord1( uint32_t value );
 
-      /// The eFEX number
-      uint8_t eFexNumber() const;
-      /// Set the eFEX number
-      void seteFexNumber( uint8_t value );
-
-      /// The shelf number
-      uint8_t shelfNumber() const;
-      /// Set the shelf number
-      void setShelfNumber( uint8_t value );
-
       /// TOB ET (decoded from TOB, stored for convenience)
       float    et() const; /// floating point value (MeV, TOB scale)
       void     setEt( float value); /// setter for the above
@@ -114,6 +107,11 @@ namespace xAOD {
       /// Object type (TOB or xTOB)
       ObjectType type() const;
 
+      // Shelf number
+      unsigned int shelfNumber() const;
+
+      // eFEX number
+      unsigned int eFexNumber() const;
 
       /// FPGA number
       unsigned int fpga() const;
@@ -174,6 +172,8 @@ namespace xAOD {
       static const int s_etBit           =  0;
       static const int s_etBitXTOB       =  3;
       static const int s_bcn4Bit         = 28;
+      static const int s_shelfBit        = 24;
+      static const int s_eFexBit         = 20;
 
       //  Data masks
       static const int s_fpgaMask        = 0x3;
@@ -188,6 +188,8 @@ namespace xAOD {
       static const int s_etMask          = 0xfff;
       static const int s_etFullMask      = 0xffff;
       static const int s_bcn4Mask        = 0xf;
+      static const int s_eFexMask        = 0xf;
+      static const int s_shelfMask       = 0xf;
       // For decoding coordinates
       // 
       static const int s_numPhi          = 64;
diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexTauRoIAuxContainer_v1.h b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexTauRoIAuxContainer_v1.h
index c027e2630780..296e7592618e 100644
--- a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexTauRoIAuxContainer_v1.h
+++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexTauRoIAuxContainer_v1.h
@@ -35,16 +35,15 @@ namespace xAOD {
    private:
       std::vector< uint32_t > word0;
       std::vector< uint32_t > word1;
-      std::vector< uint8_t >  eFexNumber;
-      std::vector< uint8_t >  shelfNumber;
       std::vector< uint16_t > fCoreNumerator;
       std::vector< uint16_t > fCoreDenominator;
+      std::vector< uint16_t > fHadNumerator;
+      std::vector< uint16_t > fHadDenominator;
 
       std::vector< float >    et;
       std::vector< float >    eta;
       std::vector< float >    phi;
       std::vector< char >     isTOB;
-      std::vector< uint32_t > thrPattern;
 
    }; // class eFexTauRoIAuxContainer_v1
 
diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexTauRoI_v1.h b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexTauRoI_v1.h
index c63ff7831e08..63efa02ed56f 100755
--- a/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexTauRoI_v1.h
+++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/eFexTauRoI_v1.h
@@ -33,7 +33,8 @@ namespace xAOD {
       eFexTauRoI_v1();
 
       /// Initialise the object with its most important properties
-      void initialize( uint8_t eFexNumber, uint8_t shelf, uint32_t word0, uint32_t word1 = 0 );
+      void initialize( unsigned int eFexNumber, unsigned int shelf, uint32_t word0 );
+      void initialize( uint32_t word0, uint32_t word1 );
 
       /// Object types
       enum ObjectType {
@@ -48,15 +49,11 @@ namespace xAOD {
       void setWord0( uint32_t value );
       void setWord1( uint32_t value );
 
-      /// The eFEX number
-      uint8_t eFexNumber() const;
-      /// Set the eFEX number
-      void seteFexNumber( uint8_t value );
+      // Shelf number (decoded from second xTOB word)
+      unsigned int shelfNumber() const;
 
-      /// The shelf number
-      uint8_t shelfNumber() const;
-      /// Set the shelf number
-      void setShelfNumber( uint8_t value );
+      // eFEX number (decoded from second xTOB word)
+      unsigned int eFexNumber() const;
 
       /// TOB ET (decoded from TOB, stored for convenience)
       float    et() const; /// floating point value (MeV, TOB scale)
@@ -65,14 +62,17 @@ namespace xAOD {
       /// Eta Coordinates (decoded from TOB, stored for convenience)
       float   eta() const; /// Floating point, full precision (0.025)
       void    setEta( float value); /// setter for the above 
-      unsigned int iEta() const;  /// getter for integer eta index (0-49)
+      int     iEta() const;  /// getter for integer eta index (-25->24)
       unsigned int seed() const; /// Seed supercell index within central tower (0 -> 3)
 
       /// Phi coordinates
       float   phi() const; /// Floating point, ATLAS phi convention (-pi -> pi)
       void    setPhi( float value); /// Setter for the above
-      unsigned int iPhi() const; /// Getter for integer phi index (0-63)
+      int     iPhi() const; /// Getter for integer phi index (0-63)
 
+      /// Getters for Topo coordinate indices
+      int iEtaTopo() const;
+      int iPhiTopo() const;
       
       /// Jet Discriminants
       /// Derived floating point values (not used in actual algorithm)
@@ -83,15 +83,15 @@ namespace xAOD {
       uint16_t fCoreDenominator() const;
       void  setFCoreNumerator( uint16_t value);
       void  setFCoreDenominator( uint16_t value);
+      uint16_t fHadNumerator() const;
+      uint16_t fHadDenominator() const;
+      void  setFHadNumerator( uint16_t value);
+      void  setFHadDenominator( uint16_t value);
 
       /// Is this one a TOB (or xTOB partner of a TOB)?
       char isTOB() const;
       void setIsTOB( char value);
 
-      /// Pattern of thresholds passed
-      uint32_t thrPattern() const;
-      void     setThrPattern( uint32_t value);
-   
       /// Return TOB word corresponding to this TOB or xTOB
       uint32_t tobWord() const;
       
@@ -124,7 +124,7 @@ namespace xAOD {
       unsigned int fCoreThresholds() const;
 
       /// Tau Condition 2 (none) results
-      unsigned int tauTwoThresholds() const;
+      unsigned int fHadThresholds() const;
 
       /// Tau Condition 3 (none) results
       unsigned int tauThreeThresholds() const;
@@ -141,7 +141,6 @@ namespace xAOD {
       static const float s_tobEtScale;
       static const float s_xTobEtScale;
       static const float s_towerEtaWidth;
-      static const float s_minEta;
 
 
       /** Constants used in decoding TOB words
@@ -162,6 +161,8 @@ namespace xAOD {
       static const int s_etBit           =  0;
       static const int s_etBitXTOB       =  3;
       static const int s_bcn4Bit         = 28;
+      static const int s_shelfBit        = 24;
+      static const int s_eFexBit         = 20;
 
       //  Data masks
       static const int s_fpgaMask        = 0x3;
@@ -176,6 +177,9 @@ namespace xAOD {
       static const int s_etMask          = 0xfff;
       static const int s_etFullMask      = 0xffff;
       static const int s_bcn4Mask        = 0xf;
+      static const int s_eFexMask        = 0xf;
+      static const int s_shelfMask       = 0xf;
+
       // For decoding coordinates
       // 
       static const int s_numPhi          = 64;
@@ -188,16 +192,7 @@ namespace xAOD {
       static const int s_eFexEtaWidth    =  16;
       static const int s_fpgaEtaWidth    =  4;
       static const int s_shelfPhiWidth   =  4;
-      static const int s_EtaCOffset      =  0;
-      static const int s_EtaBOffset      = 17;
-      static const int s_EtaAOffset      = 33;
-
-      /// eFEX numbering (eta, 3 locations)
-      enum eFEXTypes {eFexC = 0xc, eFexB = 0xb, eFexA = 0xa};
-
-      /// Compute eta & phi indices from TOB word
-      unsigned int etaIndex() const;
-      unsigned int phiIndex() const;
+      static const int s_minEta          = -25;
 
    }; // class eFexTauRoI_v1
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFillEDM.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFillEDM.cxx
index afe82f5d7994..0caa5fb53c9e 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFillEDM.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFillEDM.cxx
@@ -45,7 +45,8 @@ namespace LVL1 {
   void eFEXFillEDM::fillEmEDM(std::unique_ptr<xAOD::eFexEMRoIContainer> &container, uint8_t eFexNum, uint32_t tobWord)
   {
     uint32_t tobWord0 = tobWord;
-    uint32_t tobWord1 = 0;
+    // Only needed for xTOBs, which aren't filled yet
+    // uint32_t tobWord1 = 0;
 
     // Translate eFEX index into Shelf+eFEX:
     // Messy because this eFEX index runs A, B, C while the readout order is C, B, A
@@ -58,7 +59,7 @@ namespace LVL1 {
     
     container->push_back(myEmEDM);
     
-    myEmEDM->initialize(eFEX, shelf, tobWord0, tobWord1);
+    myEmEDM->initialize(eFEX, shelf, tobWord0); 
 
     ATH_MSG_DEBUG(" setting eFEX Number:  " << +myEmEDM->eFexNumber() << " shelf: " << +myEmEDM->shelfNumber() << " et: " << myEmEDM->et() << " eta: " << myEmEDM->eta() <<  " phi: " << myEmEDM->phi() << " input eFexNum: " << MSG::hex << +eFexNum << " TOB word: " << tobWord0 << MSG::dec );
 
@@ -67,7 +68,8 @@ namespace LVL1 {
   void eFEXFillEDM::fillTauEDM(std::unique_ptr<xAOD::eFexTauRoIContainer> &container, uint8_t eFexNum, uint32_t tobWord)
   {
     uint32_t tobWord0 = tobWord;
-    uint32_t tobWord1 = 0;
+    // Only needed for xTOBs, which aren't filled yet
+    //  uint32_t tobWord1 = 0;
 
     // Translate eFEX index into Shelf+eFEX:
     // Messy because this eFEX index runs A, B, C while the readout order is C, B, A
@@ -79,7 +81,7 @@ namespace LVL1 {
 
     container->push_back(myTauEDM);
 
-    myTauEDM->initialize(eFEX, shelf, tobWord0, tobWord1);
+    myTauEDM->initialize(eFEX, shelf, tobWord0);
     ATH_MSG_DEBUG(" setting tau eFEX Number: " << +myTauEDM->eFexNumber() << " et: " << myTauEDM->et() << " eta: " << myTauEDM->eta() << " phi: " << myTauEDM->phi() );
 
   }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/EMTauInputProviderFEX.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/EMTauInputProviderFEX.cxx
index ca94a9e84641..4634fd7e4ebe 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/EMTauInputProviderFEX.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/EMTauInputProviderFEX.cxx
@@ -198,7 +198,7 @@ EMTauInputProviderFEX::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const
     unsigned int wstot = eFexRoI->WstotThresholds();
 
     //Em TOB
-    TCS::eEmTOB eem( EtTopo, 0, etaTopo, static_cast<unsigned int>(phiTopo), TCS::EEM , static_cast<long int>(eFexRoI->Word0()) );
+    TCS::eEmTOB eem( EtTopo, 0, etaTopo, static_cast<unsigned int>(phiTopo), TCS::EEM , static_cast<long int>(eFexRoI->word0()) );
     eem.setEtDouble( static_cast<double>(EtTopo/10.) );
     eem.setEtaDouble( static_cast<double>(etaTopo/40.) );
     eem.setPhiDouble( static_cast<double>(phiTopo/20.) );
-- 
GitLab


From 725de16b81eaf1c9317c07303b1b20549f7a5c1e Mon Sep 17 00:00:00 2001
From: "Ewelina.Maria.Lobodzinska" <ewelina.maria.lobodzinska@cern.ch>
Date: Thu, 9 Sep 2021 17:30:12 +0200
Subject: [PATCH 050/347] GeneratorFilters : correct the units

---
 Generators/GeneratorFilters/src/DiBjetFilter.cxx     | 10 +++++-----
 Generators/GeneratorFilters/src/MultiBjetFilter.cxx  |  6 +++---
 Generators/GeneratorFilters/src/WZtoLeptonFilter.cxx |  6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/Generators/GeneratorFilters/src/DiBjetFilter.cxx b/Generators/GeneratorFilters/src/DiBjetFilter.cxx
index 65929f92ab50..ad55a5d31292 100644
--- a/Generators/GeneratorFilters/src/DiBjetFilter.cxx
+++ b/Generators/GeneratorFilters/src/DiBjetFilter.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
 */
 
 // -------------------------------------------------------------
@@ -33,11 +33,11 @@ DiBjetFilter::DiBjetFilter(const std::string& name, ISvcLocator* pSvcLocator)
 {
   //--------------------------------------------------------------------------    
   // Local Member Data:-
-  declareProperty("LeadJetPtMin",m_leadJet_ptMin=0/Gaudi::Units::GeV);
-  declareProperty("LeadJetPtMax",m_leadJet_ptMax=50000/Gaudi::Units::GeV);
-  declareProperty("BottomPtMin",m_bottomPtMin=5.0/Gaudi::Units::GeV);
+  declareProperty("LeadJetPtMin",m_leadJet_ptMin=0*Gaudi::Units::GeV);
+  declareProperty("LeadJetPtMax",m_leadJet_ptMax=50000*Gaudi::Units::GeV);
+  declareProperty("BottomPtMin",m_bottomPtMin=5.0*Gaudi::Units::GeV);
   declareProperty("BottomEtaMax",m_bottomEtaMax=3.0);
-  declareProperty("JetPtMin",m_jetPtMin=15.0/Gaudi::Units::GeV);
+  declareProperty("JetPtMin",m_jetPtMin=15.0*Gaudi::Units::GeV);
   declareProperty("JetEtaMax",m_jetEtaMax=2.7);
   declareProperty("DeltaRFromTruth",m_deltaRFromTruth=0.3);
   declareProperty("TruthContainerName",m_TruthJetContainerName="AntiKt4TruthJets");
diff --git a/Generators/GeneratorFilters/src/MultiBjetFilter.cxx b/Generators/GeneratorFilters/src/MultiBjetFilter.cxx
index 2c291b7b2a9f..0edb4a44565e 100644
--- a/Generators/GeneratorFilters/src/MultiBjetFilter.cxx
+++ b/Generators/GeneratorFilters/src/MultiBjetFilter.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
 */
 // This is a general-purpose multi-b-jet filter. It can cut on:
 //    - Multiplicity of b-jets (both min and max can be specified)
@@ -32,9 +32,9 @@ MultiBjetFilter::MultiBjetFilter(const std::string& name, ISvcLocator* pSvcLocat
   declareProperty("NBJetsMax", m_nBJetsMax = -1); // Negative number means no cut
   declareProperty("LeadJetPtMin", m_leadJet_ptMin = 0);
   declareProperty("LeadJetPtMax", m_leadJet_ptMax = -1); // Negative number means no cut
-  declareProperty("BottomPtMin", m_bottomPtMin = 5.0/Gaudi::Units::GeV);
+  declareProperty("BottomPtMin", m_bottomPtMin = 5.0*Gaudi::Units::GeV);
   declareProperty("BottomEtaMax", m_bottomEtaMax = 3.0);
-  declareProperty("JetPtMin", m_jetPtMin = 15.0/Gaudi::Units::GeV);
+  declareProperty("JetPtMin", m_jetPtMin = 15.0*Gaudi::Units::GeV);
   declareProperty("JetEtaMax", m_jetEtaMax = 2.7);
   declareProperty("DeltaRFromTruth", m_deltaRFromTruth = 0.3);
   declareProperty("TruthContainerName", m_TruthJetContainerName = "AntiKt4TruthJets");
diff --git a/Generators/GeneratorFilters/src/WZtoLeptonFilter.cxx b/Generators/GeneratorFilters/src/WZtoLeptonFilter.cxx
index 8b5dba559189..f9bb0d9a6f3b 100644
--- a/Generators/GeneratorFilters/src/WZtoLeptonFilter.cxx
+++ b/Generators/GeneratorFilters/src/WZtoLeptonFilter.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 "GaudiKernel/PhysicalConstants.h"
@@ -75,8 +75,8 @@ StatusCode WZtoLeptonFilter::filterFinalize() {
                "0 for more leptons ( difficult to recon ) : " << m_reconeffi << "\n" <<
                "Etacut_electron : " << m_Eta_e << "\n"                               <<
                "Etacut_muon     : " << m_Eta_mu << "\n"                              <<
-               "Ptcut_electron (GeV) : " << m_Pt_e/Gaudi::Units::GeV << "\n"                       <<
-               "Ptcut_muon           : " << m_Pt_mu/Gaudi::Units::GeV);
+               "Ptcut_electron (GeV) : " << m_Pt_e*Gaudi::Units::GeV << "\n"                       <<
+               "Ptcut_muon           : " << m_Pt_mu*Gaudi::Units::GeV);
 
   if (m_AthenaCalls == 0) {
     ATH_MSG_INFO(" ERROR, Your filter is not interfaced/called at all " << "################   WZtoLeptonFilter Finished  ##############");
-- 
GitLab


From 5bfb02d86bee69561c1f0d7f6a791deb7973e794 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Sep 2021 09:54:00 -0400
Subject: [PATCH 051/347] CxxUtils: Fix stacktrace_test.

Fix stacktrace_test for the case where it is compiled using a relative,
not absolute, path to the source.
---
 Control/CxxUtils/test/stacktrace_test.cxx | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Control/CxxUtils/test/stacktrace_test.cxx b/Control/CxxUtils/test/stacktrace_test.cxx
index 6ffbe05fa353..2f27a784528f 100644
--- a/Control/CxxUtils/test/stacktrace_test.cxx
+++ b/Control/CxxUtils/test/stacktrace_test.cxx
@@ -48,6 +48,7 @@ void filter (char* buf)
 {
   char* buf0 = buf;
   char* sl = 0;
+  char* sp = 0;
   while (*buf) {
     if (buf[0] == '0' && buf[1] == 'x') {
       buf += 2;
@@ -76,6 +77,7 @@ void filter (char* buf)
     else if (buf[0] == ' ') {
       ++buf;
       sl = 0;
+      sp = buf;
     }
 
     else if (buf[0] == '?') {
@@ -111,8 +113,14 @@ void filter (char* buf)
         ++buf;
       if (*buf == ' ')
         ++buf;
-      if (sl) {
+      if (sp) {
+        buf = snip (sp, buf);
+        sp = 0;
+        sl = 0;
+      }
+      else if (sl) {
         buf = snip (sl, buf);
+        sp = 0;
         sl = 0;
       }
       else {
@@ -133,6 +141,7 @@ void dumptrace (FILE* fp)
   while (fgets (buf, sizeof (buf), fp)) {
     if (strstr (buf, "libasan") != nullptr)
       continue;
+    fputs (buf, stdout);
     filter (buf);
     fputs (buf, stdout);
   }
-- 
GitLab


From c937e6f06dd127f80613d311364f07dd6e288ba8 Mon Sep 17 00:00:00 2001
From: Peter Berta <peter.berta@cern.ch>
Date: Thu, 9 Sep 2021 17:49:01 +0200
Subject: [PATCH 052/347] Merge branch 'master-DQegamma_07092021_for22.0-mc20'
 into '22.0-mc20'

New DQegamma configuration for 22.0-MC20

See merge request atlas/athena!46398

(cherry picked from commit cf9137309ba9e4fb755e760bdaf3c75b8d80f840)

71737982 New DQegamma configuration for 22.0-MC20
---
 .../config/Egamma/collisions_run.config       | 4098 ++++++----------
 .../config/Egamma/collisions_run.config_run2  | 3294 +++++++++++++
 .../config/Egamma/cosmics_run.config          | 2780 ++++++-----
 .../config/Egamma/heavyions_run.config        | 4100 ++++++-----------
 .../python/SetupEgammaMonitoring.py           |  297 +-
 .../python/egammaMonitoringConfig.py          |    6 +-
 .../src/MonitorElectronAlgorithm.cxx          |  175 +-
 .../src/MonitorFwdElectronAlgorithm.cxx       |   24 +-
 .../src/MonitorPhotonAlgorithm.cxx            |  160 +-
 .../src/MonitorTnPAlgorithm.cxx               |  234 +-
 10 files changed, 8580 insertions(+), 6588 deletions(-)
 create mode 100644 DataQuality/DataQualityConfigurations/config/Egamma/collisions_run.config_run2

diff --git a/DataQuality/DataQualityConfigurations/config/Egamma/collisions_run.config b/DataQuality/DataQualityConfigurations/config/Egamma/collisions_run.config
index 623fecc0b34f..31a1c2b2877c 100644
--- a/DataQuality/DataQualityConfigurations/config/Egamma/collisions_run.config
+++ b/DataQuality/DataQualityConfigurations/config/Egamma/collisions_run.config
@@ -101,7 +101,6 @@ algorithm 2D_Histogram_Not_Empty {
   reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
 }
 
-
 algorithm egamma_FitZmass {
   libname = libdqm_algorithms.so
   name = Simple_gaus_Fit
@@ -113,8 +112,8 @@ algorithm egamma_FitZmass {
 algorithm egamma_FitJPsimass {
   libname = libdqm_algorithms.so
   name = Simple_gaus_Fit
-  xmin = 3000.
-  xmax = 5000. 
+  xmin = 2500.
+  xmax = 3500. 
   thresholds = egamma_FitJPsimass_Thresholds
 }
 
@@ -123,3172 +122,2117 @@ algorithm egamma_FitJPsimass {
 #############
 
 output top_level {
-  algorithm = WorstCaseSummary
+#  algorithm = WorstCaseSummary
   output egamma {
-   algorithm = WorstCaseSummary
+# Photons
    output photons { 
-    algorithm = WorstCaseSummary
-    output EXPERT { 
-    algorithm = WorstCaseSummary
-    }
-    output ID {
-    algorithm = WorstCaseSummary
-    }
-    output LBMon {
-    algorithm = WorstCaseSummary
+    output CBLoose {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
+   }
+   output CBTight {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
     }
    }
    output photonsWithTrigger { 
-    algorithm = WorstCaseSummary
-    output EXPERT { 
-    algorithm = WorstCaseSummary
-    }
-    output ID {
-    algorithm = WorstCaseSummary
+    output CBLoose {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
     }
-    output LBMon {
-    algorithm = WorstCaseSummary
+    output CBTight {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
     }
    }
+  
+# Electrons
    output electrons {
-    algorithm = WorstCaseSummary
-    output EXPERT {
-    algorithm = WorstCaseSummary  
-    }
-    output ID {
-    algorithm = WorstCaseSummary
-    }
-    output Track {
-    algorithm = WorstCaseSummary
+    output LHLoose {
+     output Expert {
+      output ID {
+      }
+      output Track {
+      }
+      output LBMon {
+      }
+     }
     }
-    output LBMon {
-    algorithm = WorstCaseSummary
+    output LHTight {
+     output Expert {
+      output ID {
+      }
+      output Track {
+      }
+      output LBMon {
+      }     
+     }
     }
    }
    output electronsWithTrigger {
-    algorithm = WorstCaseSummary
-    output EXPERT {
-    algorithm = WorstCaseSummary  
+    output LHLoose {
+     output Expert {
+      output ID {
+      }
+      output Track {
+      }
+      output LBMon {
+      }
     }
-    output ID {
-    algorithm = WorstCaseSummary
+   }
+   output LHTight {
+    output Expert {
+     output ID {
+     }
+     output Track {
+     }
+     output LBMon {
+     }    
     }
-    output Track {
-    algorithm = WorstCaseSummary
+   }
+  }
+
+# FwdElectrons
+  output forwardElectrons {
+   output LHTight {
+    output Expert {
     }
-    output LBMon {
-    algorithm = WorstCaseSummary
+   }
+   output LHLoose {
+    output Expert {
     }
    }
-   output forwardElectrons {
-    algorithm = WorstCaseSummary
-    output ID {
-    algorithm = WorstCaseSummary
+   output CBLoose {
+    output Expert {
     }
-    output EXPERT {
-    algorithm = WorstCaseSummary
+   }
+   output CBTight {
+    output Expert {
     }
    }
-   output tagandprobeZ {
-    algorithm = WorstCaseSummary
+  }
+   
+# T&P 
+  output tagandprobeZ {
     output ID {
-    algorithm = WorstCaseSummary  
     }
     output Track {
-    algorithm = WorstCaseSummary
     }
     output LBMon {
-    algorithm = WorstCaseSummary
     }
    }
    output tagandprobeJPsi {
-    algorithm = WorstCaseSummary
     output ID {
-    algorithm = WorstCaseSummary  
     }
     output Track {
-    algorithm = WorstCaseSummary
     }
     output LBMon {
-    algorithm = WorstCaseSummary
     }
    }
- }
+  }
 }
 
 #######################
 # Histogram Assessments
 #######################
 
- dir egamma/electrons {
-      output = egamma/electrons
+##################################
+# Electrons
+#################################@
 
-      # CbLoose
-      hist electronNCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist electronEtCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPtCone20CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
+# LhLoose
 
-      # CbTight
-      hist electronNCbTight {
+dir egamma/LHLooseElectrons {
+      output = egamma/electrons/LHLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
       }
-      hist electronEtCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPtCone20CbTight {
-       algorithm = egKolmogorov
-      } 
-      hist electronTopoEtCone40CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-
-      # LhLoose
-      hist electronNLhLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist Et { 
       }
-      hist electronEtLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVLhLoose {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist Eta { 
       }
-      hist electronEtaPhiPtgt4GeVLhLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist Phi { 
       }
-      hist electronEtaPhiPtgt20GeVLhLoose {
-       output = egamma/electrons/EXPERT
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronPtCone20LhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40LhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronNLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      } 
-      hist electronEtLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaPhiPtgt2.5GeVLhLoose {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist electronEtaPhiPtgt4GeVLhLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist TopoEtCone40 { 
       }
-      hist electronEtaPhiPtgt20GeVLhLoose {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist PtCone20 { 
       }
-      hist electronPtCone20LhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist Time { 
       }
-      hist electronTopoEtCone40LhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+}
+
+dir egamma/LHLooseElectrons/Expert {
+      output = egamma/electrons/LHLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist EtainENDCAP { 
       }
-      hist electronTimeLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist PhiinENDCAP { 
       }
-
-      # LhMedium
-      hist electronNLhMedium {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist TimeinENDCAP { 
       }
-      hist electronEtLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVLhMedium {
-       output = egamma/electrons/EXPERT
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
        algorithm = 2D_Histogram_Not_Empty
-      #  algorithm = egamma_BinsDiffFromStripMedian
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEtaPhiPtgt4GeVLhMedium {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEtaPhiPtgt20GeVLhMedium {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
-      }
-      hist electronPtCone20LhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40LhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronNLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      } 
-      hist electronEtLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-
-      # LhTight
-      hist electronNLhTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist EtainBARREL { 
       }
-      hist electronEtLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist PhiinBARREL { 
       }
-      hist electronPhiLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist TimeinBARREL { 
       }
-      hist electronEtaLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist EtainCRACK { 
       }
-      hist electronEtaPhiPtgt2.5GeVLhTight {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist PhiinCRACK { 
       }
-      hist electronEtaPhiPtgt4GeVLhTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist TimeinCRACK { 
       }
-      hist electronEtaPhiPtgt20GeVLhTight {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
+}
+
+dir egamma/LHLooseElectrons/byLB {
+      output = egamma/electrons/LHLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist LBEvoN { 
       }
-      hist electronPtCone20LhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-}
-
- dir egamma/electrons/ID {
+}
+
+dir egamma/LHLooseElectrons/ID {
+     algorithm = egKolmogorov
+     output = egamma/electrons/LHLoose/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHLooseElectrons/Tracks {
      algorithm = egKolmogorov
-     output = egamma/electrons/ID
+     output = egamma/electrons/LHLoose/Expert/Track
      display = Draw=e1,StatBox
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+}
 
-     # LhLoose
-      hist electronEhad1LhLoose_BARREL {
-      }
-      hist electronEoverPLhLoose_BARREL {
+# LhLooseWithTrigger
+
+dir egamma/LHLooseElectronsWithTrigger {
+      output = egamma/electronsWithTrigger/LHLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronCoreEMLhLoose_BARREL {
+      hist Et { 
       }
-      hist electronF0LhLoose_BARREL {
+      hist Eta { 
       }
-      hist electronF1LhLoose_BARREL {
+      hist Phi { 
       }
-      hist electronF2LhLoose_BARREL {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF3LhLoose_BARREL {
+      hist TopoEtCone40 { 
       }
-      hist electronRe233e237LhLoose_BARREL {
+      hist PtCone20 { 
       }
-      hist electronRe237e277LhLoose_BARREL {
+      hist Time { 
       }
-      hist electronEhad1LhLoose_CRACK {
+}
+
+dir egamma/LHLooseElectronsWithTrigger/Expert {
+      output = egamma/electronsWithTrigger/LHLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
       }
-      hist electronEoverPLhLoose_CRACK {
+      hist Eta_Phi_with_Pt_gt_20GeV { 
       }
-      hist electronCoreEMLhLoose_CRACK {
+}
+
+dir egamma/LHLooseElectronsWithTrigger/byLB {
+      output = egamma/electronsWithTrigger/LHLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist LBEvoN { 
       }
-      hist electronF0LhLoose_CRACK {
+}
+
+dir egamma/LHLooseElectronsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHLoose/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHLooseElectronsWithTrigger/Tracks {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHLoose/Expert/Track
+     display = Draw=e1,StatBox
+
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+
+}
+
+# LhTight
+
+dir egamma/LHTightElectrons {
+      output = egamma/electrons/LHTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronF1LhLoose_CRACK {
+      hist Et { 
       }
-      hist electronF2LhLoose_CRACK {
+      hist Eta { 
       }
-      hist electronF3LhLoose_CRACK {
+      hist Phi { 
       }
-      hist electronRe233e237LhLoose_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronRe237e277LhLoose_CRACK {
+      hist TopoEtCone40 { 
       }
-      hist electronEhad1LhLoose_ENDCAP {
+      hist PtCone20 { 
       }
-      hist electronEoverPLhLoose_ENDCAP {
+      hist Time { 
       }
-      hist electronCoreEMLhLoose_ENDCAP {
+}
+
+dir egamma/LHTightElectrons/Expert {
+      output = egamma/electrons/LHTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist EtainENDCAP { 
       }
-      hist electronF0LhLoose_ENDCAP {
+      hist PhiinENDCAP { 
       }
-      hist electronF1LhLoose_ENDCAP {
+      hist TimeinENDCAP { 
       }
-      hist electronF2LhLoose_ENDCAP {
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronF3LhLoose_ENDCAP {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronRe233e237LhLoose_ENDCAP {
+      hist EtainBARREL { 
       }
-      hist electronRe237e277LhLoose_ENDCAP {
+      hist PhiinBARREL { 
       }
-
-     # LhMedium
-      hist electronEhad1LhMedium_BARREL {
+      hist TimeinBARREL { 
       }
-      hist electronEoverPLhMedium_BARREL {
+      hist EtainCRACK { 
       }
-      hist electronCoreEMLhMedium_BARREL {
+      hist PhiinCRACK { 
       }
-      hist electronF0LhMedium_BARREL {
+      hist TimeinCRACK { 
       }
-      hist electronF1LhMedium_BARREL {
+}
+
+dir egamma/LHTightElectrons/byLB {
+      output = egamma/electrons/LHTight/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist LBEvON { 
       }
-      hist electronF2LhMedium_BARREL {
+}
+
+dir egamma/LHTightElectrons/ID {
+     algorithm = egKolmogorov
+     output = egamma/electrons/LHTight/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHTightElectrons/Tracks {
+     algorithm = egKolmogorov
+     output = egamma/electrons/LHTight/Expert/Track
+     Display = Draw=e1,StatBox
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+}
+
+# LhTightWithTrigger
+
+dir egamma/LHTightElectronsWithTrigger {
+      output = egamma/electronsWithTrigger/LHTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist Et { 
+      } 
+      hist Eta { 
       }
-      hist electronF3LhMedium_BARREL {
+      hist Phi { 
       }
-      hist electronRe233e237LhMedium_BARREL {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronRe237e277LhMedium_BARREL {
+      hist TopoEtCone40 { 
       }
-      hist electronEhad1LhMedium_CRACK {
+      hist PtCone20 { 
       }
-      hist electronEoverPLhMedium_CRACK {
+      hist Time { 
+      }
+}
+
+dir egamma/LHTightElectronsWithTrigger/Expert {
+      output = egamma/electronsWithTrigger/LHTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
       }
-      hist electronCoreEMLhMedium_CRACK {
+      hist Eta_Phi_with_Pt_gt_20GeV { 
       }
-      hist electronF0LhMedium_CRACK {
+}
+
+dir egamma/LHTightElectronsWithTrigger/byLB {
+      output = egamma/electronsWithTrigger/LHTight/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist LBEvON { 
       }
-      hist electronF1LhMedium_CRACK {
+}
+
+dir egamma/LHTightElectronsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHTight/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHTightElectronsWithTrigger/Tracks {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHTight/Expert/Track
+     display = Draw=e1,StatBox
+
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+
+}
+
+
+############################################## 
+### photons
+##############################################
+
+# CBLoose
+
+dir egamma/CBLoosePhotons {
+      output = egamma/photons/CBLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronF2LhMedium_CRACK {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronF3LhMedium_CRACK {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronRe233e237LhMedium_CRACK {
+
+      hist Et { 
       }
-      hist electronRe237e277LhMedium_CRACK {
+      hist Phi { 
       }
-      hist electronEhad1LhMedium_ENDCAP {
+      hist Eta { 
       }
-      hist electronEoverPLhMedium_ENDCAP {
+      hist PtCone20 { 
       }
-      hist electronCoreEMLhMedium_ENDCAP {
+      hist EtCone40 { 
       }
-      hist electronF0LhMedium_ENDCAP {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF1LhMedium_ENDCAP {
+      hist Time { 
       }
-      hist electronF2LhMedium_ENDCAP {
+
+      hist EtConv { 
       }
-      hist electronF3LhMedium_ENDCAP {
+      hist PhiConv { 
       }
-      hist electronRe233e237LhMedium_ENDCAP {
+      hist EtaConv { 
       }
-      hist electronRe237e277LhMedium_ENDCAP {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
 
-     # LhTight
-      hist electronEhad1LhTight_BARREL {
+      hist EtUnconv { 
+      }
+      hist PhiUnconv { 
       }
-      hist electronEoverPLhTight_BARREL {
+      hist EtaUnconv { 
       }
-      hist electronCoreEMLhTight_BARREL {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF0LhTight_BARREL {
+
+
+}
+
+dir egamma/CBLoosePhotons/Expert {
+      output = egamma/photons/CBLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+
+      hist EtainBARREL { 
       }
-      hist electronF1LhTight_BARREL {
+      hist PhiinBARREL { 
       }
-      hist electronF2LhTight_BARREL {
+      hist TimeinBARREL { 
       }
-      hist electronF3LhTight_BARREL {
+      hist RConvinBARREL { 
       }
-      hist electronRe233e237LhTight_BARREL {
+      hist ConvTypeinBARREL { 
       }
-      hist electronRe237e277LhTight_BARREL {
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronEhad1LhTight_CRACK {
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEoverPLhTight_CRACK {
+
+      hist EtainENDCAP { 
       }
-      hist electronCoreEMLhTight_CRACK {
+      hist PhiinENDCAP { 
       }
-      hist electronF0LhTight_CRACK {
+      hist TimeinENDCAP { 
       }
-      hist electronF1LhTight_CRACK {
+      hist RConvinENDCAP { 
       }
-      hist electronF2LhTight_CRACK {
+      hist ConvTypeinENDCAP { 
       }
-      hist electronF3LhTight_CRACK {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronRe233e237LhTight_CRACK {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronRe237e277LhTight_CRACK {
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronEhad1LhTight_ENDCAP {
+
+      hist EtainCRACK { 
       }
-      hist electronEoverPLhTight_ENDCAP {
+      hist PhiinCRACK { 
       }
-      hist electronCoreEMLhTight_ENDCAP {
+      hist TimeinCRACK { 
       }
-      hist electronF0LhTight_ENDCAP {
+      hist RConvinCRACK { 
       }
-      hist electronF1LhTight_ENDCAP {
+      hist ConvTypeinCRACK { 
       }
-      hist electronF2LhTight_ENDCAP {
+
+}
+
+dir egamma/CBLoosePhotons/byLB {
+      output = egamma/photons/CBLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist electronF3LhTight_ENDCAP {
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist electronRe233e237LhTight_ENDCAP {
+      hist    LBEvoN { 
       }
-      hist electronRe237e277LhTight_ENDCAP {
+      hist    Conversion_fraction_vs_LB { 
       }
 }
 
- dir egamma/electrons/Track {
+dir egamma/CBLoosePhotons/ID {
      algorithm = egKolmogorov
-     output = egamma/electrons/Track
+     output = egamma/photons/CBLoose/Expert/ID
      display = Draw=e1,StatBox
-
-     # LhLoose
-      hist electronNOfBLayersHitsLhLoose_BARREL {
+      hist   Ehad1inBARREL { 
       }
-      hist electronNOfTRTHitsLhLoose_BARREL {
+      hist   CoreEMinBARREL { 
       }
-      hist electronNOfSiHitsLhLoose_BARREL {
+      hist   F0inBARREL { 
       }
-      hist electronDeltaEta1LhLoose_BARREL {
+      hist   F1inBARREL { 
       }
-      hist electronDeltaPhi2LhLoose_BARREL {
+      hist   F2inBARREL { 
       }
-      hist electronDeltaEta1LhLoose_CRACK {
+      hist   F3inBARREL { 
       }
-      hist electronDeltaPhi2LhLoose_CRACK {
+      hist   Re233e237inBARREL { 
       }
-      hist electronNOfBLayersHitsLhLoose_CRACK {
+      hist   Re237e277inBARREL { 
       }
-      hist electronNOfTRTHitsLhLoose_CRACK {
+      hist   Ehad1inENDCAP { 
       }
-      hist electronNOfSiHitsLhLoose_CRACK {
+      hist   CoreEMinENDCAP { 
       }
-      hist electronDeltaEta1LhLoose_ENDCAP {
+      hist   F0inENDCAP { 
       }
-      hist electronDeltaPhi2LhLoose_ENDCAP {
+      hist   F1inENDCAP { 
       }
-      hist electronNOfBLayersHitsLhLoose_ENDCAP {
-      }
-      hist electronNOfTRTHitsLhLoose_ENDCAP {
-      }
-      hist electronNOfSiHitsLhLoose_ENDCAP {
-      }
-
-     # LhMedium
-      hist electronNOfBLayersHitsLhMedium_BARREL {
+      hist   F2inENDCAP { 
       }
-      hist electronNOfTRTHitsLhMedium_BARREL {
+      hist   F3inENDCAP { 
       }
-      hist electronNOfSiHitsLhMedium_BARREL {
+      hist   Re233e237inENDCAP { 
       }
-      hist electronDeltaEta1LhMedium_BARREL {
+      hist   Re237e277inENDCAP { 
       }
-      hist electronDeltaPhi2LhMedium_BARREL {
+      hist   Ehad1inCRACK { 
       }
-      hist electronDeltaEta1LhMedium_CRACK {
+      hist   CoreEMinCRACK { 
       }
-      hist electronDeltaPhi2LhMedium_CRACK {
+      hist   F0inCRACK { 
       }
-      hist electronNOfBLayersHitsLhMedium_CRACK {
+      hist   F1inCRACK { 
       }
-      hist electronNOfTRTHitsLhMedium_CRACK {
+      hist   F2inCRACK { 
       }
-      hist electronNOfSiHitsLhMedium_CRACK {
+      hist   F3inCRACK { 
       }
-      hist electronDeltaEta1LhMedium_ENDCAP {
+      hist   Re233e237inCRACK { 
       }
-      hist electronDeltaPhi2LhMedium_ENDCAP {
+      hist   Re237e277inCRACK { 
       }
-      hist electronNOfBLayersHitsLhMedium_ENDCAP {
+}
+
+# CBLooseWithTrigger
+
+dir egamma/CBLoosePhotonsWithTrigger {
+      output = egamma/photonsWithTrigger/CBLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronNOfTRTHitsLhMedium_ENDCAP {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronNOfSiHitsLhMedium_ENDCAP {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
 
-     # LhTight
-      hist electronNOfBLayersHitsLhTight_BARREL {
+      hist Et { 
       }
-      hist electronNOfTRTHitsLhTight_BARREL {
+      hist Phi { 
       }
-      hist electronNOfSiHitsLhTight_BARREL {
+      hist Eta { 
       }
-      hist electronDeltaEta1LhTight_BARREL {
+      hist PtCone20 { 
       }
-      hist electronDeltaPhi2LhTight_BARREL {
+      hist EtCone40 { 
       }
-      hist electronDeltaEta1LhTight_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronDeltaPhi2LhTight_CRACK {
+      hist Time { 
       }
-      hist electronNOfBLayersHitsLhTight_CRACK {
+
+      hist EtConv { 
       }
-      hist electronNOfTRTHitsLhTight_CRACK {
+      hist PhiConv { 
       }
-      hist electronNOfSiHitsLhTight_CRACK {
+      hist EtaConv { 
       }
-      hist electronDeltaEta1LhTight_ENDCAP {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronDeltaPhi2LhTight_ENDCAP {
+
+      hist EtUnconv { 
       }
-      hist electronNOfBLayersHitsLhTight_ENDCAP {
+      hist PhiUnconv { 
       }
-      hist electronNOfTRTHitsLhTight_ENDCAP {
+      hist EtaUnconv { 
       }
-      hist electronNOfSiHitsLhTight_ENDCAP {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
- }
 
- dir egamma/electrons/LBMon {
-     algorithm = egamma_GatherData
-     output = egamma/electrons/LBMon
-     display = Draw=e1,StatBox
-      # LhLoose
-      hist LBEvoNElectronsLhLoose {
-      }
-      # LhMedium
-      hist LBEvoNElectronsLhMedium {
+
+}
+
+dir egamma/CBLoosePhotonsWithTrigger/Expert {
+      output = egamma/photonsWithTrigger/CBLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist EtainBARREL { 
       }
-      # LhTight
-      hist LBEvoNElectronsLhTight {
+      hist PhiinBARREL { 
       }
-      # CbLoose
-      hist LBEvoNElectronsCbLoose {
+      hist TimeinBARREL { 
       }
-      # CbTight
-      hist LBEvoNElectronsCbTight {
+      hist RConvinBARREL { 
       }
-}
-
-### electronsWithTrigger
-
- dir egamma/electronsWithTrigger {
-      output = egamma/electronsWithTrigger
-
-      # CbLoose
-      hist electronNCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist ConvTypeinBARREL { 
       }
-      hist electronEtCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPtCone20CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVCbLoose {
-       output = egamma/electronsWithTrigger/EXPERT
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV {
        algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronEtaPhiPtgt4GeVCbLoose {
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEtaPhiPtgt20GeVCbLoose {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
-      }
 
-      # CbTight
-      hist electronNCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist EtainENDCAP { 
       }
-      hist electronEtCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVCbTight {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist PhiinENDCAP { 
       }
-      hist electronEtaPhiPtgt4GeVCbTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist TimeinENDCAP { 
       }
-      hist electronEtaPhiPtgt20GeVCbTight {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
+      hist RConvinENDCAP { 
       }
-      hist electronPtCone20CbTight {
-       algorithm = egKolmogorov
-      } 
-      hist electronTopoEtCone40CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-
-      # LhLoose
-      hist electronNLhLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox,LogY
+      hist ConvTypeinENDCAP { 
       }
-      hist electronEtLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVLhLoose {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-#       algorithm = egamma_BinsDiffFromStripMedian
-       display = Ref2DSignif, TCanvas(490,900)
+      hist Eta_Phi_with_Pt.gt.20GeV { 
       }
-      hist electronEtaPhiPtgt4GeVLhLoose {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEtaPhiPtgt20GeVLhLoose {
-       output = egamma/electronsWithTrigger/EXPERT
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
 
-      hist electronPtCone20LhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40LhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronNLhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      } 
-      hist electronEtLhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-
-      # LhMedium
-      hist electronNLhMedium {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist EtainCRACK { 
       }
-      hist electronEtLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVLhMedium {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist PhiinCRACK { 
       }
-      hist electronEtaPhiPtgt4GeVLhMedium {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist TimeinCRACK { 
       }
-      hist electronEtaPhiPtgt20GeVLhMedium {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
-      }
-      hist electronPtCone20LhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40LhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronNLhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      } 
-      hist electronEtLhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-
-      # LhTight
-      hist electronNLhTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist electronEtLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist RConvinCRACK { 
       }
-      hist electronPhiLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist ConvTypeinCRACK { 
       }
-      hist electronEtaLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+}
+
+dir egamma/CBLoosePhotonsWithTrigger/byLB {
+      output = egamma/photonsWithTrigger/CBLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist electronEtaPhiPtgt2.5GeVLhTight {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist electronEtaPhiPtgt4GeVLhTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist    LBEvoN { 
       }
-      hist electronEtaPhiPtgt20GeVLhTight {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
+      hist    Conversion_fraction_vs_LB { 
       }
-      hist electronPtCone20LhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtLhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-}
-
- dir egamma/electronsWithTrigger/ID {
+}
+
+dir egamma/CBLoosePhotonsWithTrigger/ID {
      algorithm = egKolmogorov
-     output = egamma/electronsWithTrigger/ID
+     output = egamma/photonsWithTrigger/CBLoose/Expert/ID
      display = Draw=e1,StatBox
-
-     # LhLoose
-      hist electronEhad1LhLoose_BARREL {
-      }
-      hist electronEoverPLhLoose_BARREL {
-      }
-      hist electronCoreEMLhLoose_BARREL {
+      hist   Ehad1inBARREL { 
       }
-      hist electronF0LhLoose_BARREL {
+      hist   CoreEMinBARREL { 
       }
-      hist electronF1LhLoose_BARREL {
+      hist   F0inBARREL { 
       }
-      hist electronF2LhLoose_BARREL {
+      hist   F1inBARREL { 
       }
-      hist electronF3LhLoose_BARREL {
+      hist   F2inBARREL { 
       }
-      hist electronRe233e237LhLoose_BARREL {
+      hist   F3inBARREL { 
       }
-      hist electronRe237e277LhLoose_BARREL {
+      hist   Re233e237inBARREL { 
       }
-      hist electronEhad1LhLoose_CRACK {
+      hist   Re237e277inBARREL { 
       }
-      hist electronEoverPLhLoose_CRACK {
+      hist   Ehad1inENDCAP { 
       }
-      hist electronCoreEMLhLoose_CRACK {
+      hist   CoreEMinENDCAP { 
       }
-      hist electronF0LhLoose_CRACK {
+      hist   F0inENDCAP { 
       }
-      hist electronF1LhLoose_CRACK {
+      hist   F1inENDCAP { 
       }
-      hist electronF2LhLoose_CRACK {
+      hist   F2inENDCAP { 
       }
-      hist electronF3LhLoose_CRACK {
+      hist   F3inENDCAP { 
       }
-      hist electronRe233e237LhLoose_CRACK {
+      hist   Re233e237inENDCAP { 
       }
-      hist electronRe237e277LhLoose_CRACK {
+      hist   Re237e277inENDCAP { 
       }
-      hist electronEhad1LhLoose_ENDCAP {
+      hist   Ehad1inCRACK { 
       }
-      hist electronEoverPLhLoose_ENDCAP {
+      hist   CoreEMinCRACK { 
       }
-      hist electronCoreEMLhLoose_ENDCAP {
+      hist   F0inCRACK { 
       }
-      hist electronF0LhLoose_ENDCAP {
+      hist   F1inCRACK { 
       }
-      hist electronF1LhLoose_ENDCAP {
+      hist   F2inCRACK { 
       }
-      hist electronF2LhLoose_ENDCAP {
+      hist   F3inCRACK { 
       }
-      hist electronF3LhLoose_ENDCAP {
+      hist   Re233e237inCRACK { 
       }
-      hist electronRe233e237LhLoose_ENDCAP {
-      }
-      hist electronRe237e277LhLoose_ENDCAP {
+      hist   Re237e277inCRACK { 
       }
+}
 
-     # LhMedium
-      hist electronEhad1LhMedium_BARREL {
-      }
-      hist electronEoverPLhMedium_BARREL {
-      }
-      hist electronCoreEMLhMedium_BARREL {
-      }
-      hist electronF0LhMedium_BARREL {
-      }
-      hist electronF1LhMedium_BARREL {
-      }
-      hist electronF2LhMedium_BARREL {
-      }
-      hist electronF3LhMedium_BARREL {
-      }
-      hist electronRe233e237LhMedium_BARREL {
-      }
-      hist electronRe237e277LhMedium_BARREL {
-      }
-      hist electronEhad1LhMedium_CRACK {
+# CBTight
+
+dir egamma/CBTightPhotons {
+      output = egamma/photons/CBTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronEoverPLhMedium_CRACK {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronCoreEMLhMedium_CRACK {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronF0LhMedium_CRACK {
+
+      hist Et { 
       }
-      hist electronF1LhMedium_CRACK {
+      hist Phi { 
       }
-      hist electronF2LhMedium_CRACK {
+      hist Eta { 
       }
-      hist electronF3LhMedium_CRACK {
+      hist PtCone20 { 
       }
-      hist electronRe233e237LhMedium_CRACK {
+      hist EtCone40 { 
       }
-      hist electronRe237e277LhMedium_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronEhad1LhMedium_ENDCAP {
+      hist Time { 
       }
-      hist electronEoverPLhMedium_ENDCAP {
+
+      hist EtConv { 
       }
-      hist electronCoreEMLhMedium_ENDCAP {
+      hist PhiConv { 
       }
-      hist electronF0LhMedium_ENDCAP {
+      hist EtaConv { 
       }
-      hist electronF1LhMedium_ENDCAP {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF2LhMedium_ENDCAP {
+
+      hist EtUnconv { 
       }
-      hist electronF3LhMedium_ENDCAP {
+      hist PhiUnconv { 
       }
-      hist electronRe233e237LhMedium_ENDCAP {
+      hist EtaUnconv { 
       }
-      hist electronRe237e277LhMedium_ENDCAP {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
 
-     # LhTight
-      hist electronEhad1LhTight_BARREL {
-      }
-      hist electronEoverPLhTight_BARREL {
-      }
-      hist electronCoreEMLhTight_BARREL {
-      }
-      hist electronF0LhTight_BARREL {
+}
+
+dir egamma/CBTightPhotons/Expert {
+      output = egamma/photons/CBTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist EtainBARREL { 
       }
-      hist electronF1LhTight_BARREL {
+      hist PhiinBARREL { 
       }
-      hist electronF2LhTight_BARREL {
+      hist TimeinBARREL { 
       }
-      hist electronF3LhTight_BARREL {
+      hist RConvinBARREL { 
       }
-      hist electronRe233e237LhTight_BARREL {
+      hist ConvTypeinBARREL { 
       }
-      hist electronRe237e277LhTight_BARREL {
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEhad1LhTight_CRACK {
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEoverPLhTight_CRACK {
+
+      hist EtainENDCAP { 
       }
-      hist electronCoreEMLhTight_CRACK {
+      hist PhiinENDCAP { 
       }
-      hist electronF0LhTight_CRACK {
+      hist TimeinENDCAP { 
       }
-      hist electronF1LhTight_CRACK {
+      hist RConvinENDCAP { 
       }
-      hist electronF2LhTight_CRACK {
+      hist ConvTypeinENDCAP { 
       }
-      hist electronF3LhTight_CRACK {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
       }
-      hist electronRe233e237LhTight_CRACK {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronRe237e277LhTight_CRACK {
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEhad1LhTight_ENDCAP {
+
+      hist EtainCRACK { 
       }
-      hist electronEoverPLhTight_ENDCAP {
+      hist PhiinCRACK { 
       }
-      hist electronCoreEMLhTight_ENDCAP {
+      hist TimeinCRACK { 
       }
-      hist electronF0LhTight_ENDCAP {
+      hist RConvinCRACK { 
       }
-      hist electronF1LhTight_ENDCAP {
+      hist ConvTypeinCRACK { 
       }
-      hist electronF2LhTight_ENDCAP {
+}
+
+dir egamma/CBTightPhotons/byLB {
+      output = egamma/photons/CBTight/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist electronF3LhTight_ENDCAP {
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist electronRe233e237LhTight_ENDCAP {
+      hist    LBEvoN { 
       }
-      hist electronRe237e277LhTight_ENDCAP {
+      hist    Conversion_fraction_vs_LB { 
       }
+
 }
 
- dir egamma/electronsWithTrigger/Track {
+dir egamma/CBTightPhotons/ID {
      algorithm = egKolmogorov
-     output = egamma/electronsWithTrigger/Track
+     output = egamma/photons/CBTight/Expert/ID
      display = Draw=e1,StatBox
-
-     # LhLoose
-      hist electronNOfBLayersHitsLhLoose_BARREL {
-      }
-      hist electronNOfTRTHitsLhLoose_BARREL {
-      }
-      hist electronNOfSiHitsLhLoose_BARREL {
-      }
-      hist electronDeltaEta1LhLoose_BARREL {
-      }
-      hist electronDeltaPhi2LhLoose_BARREL {
-      }
-      hist electronDeltaEta1LhLoose_CRACK {
+      hist   Ehad1inBARREL { 
       }
-      hist electronDeltaPhi2LhLoose_CRACK {
+      hist   CoreEMinBARREL { 
       }
-      hist electronNOfBLayersHitsLhLoose_CRACK {
+      hist   F0inBARREL { 
       }
-      hist electronNOfTRTHitsLhLoose_CRACK {
+      hist   F1inBARREL { 
       }
-      hist electronNOfSiHitsLhLoose_CRACK {
+      hist   F2inBARREL { 
       }
-      hist electronDeltaEta1LhLoose_ENDCAP {
+      hist   F3inBARREL { 
       }
-      hist electronDeltaPhi2LhLoose_ENDCAP {
+      hist   Re233e237inBARREL { 
       }
-      hist electronNOfBLayersHitsLhLoose_ENDCAP {
+      hist   Re237e277inBARREL { 
       }
-      hist electronNOfTRTHitsLhLoose_ENDCAP {
+      hist   Ehad1inENDCAP { 
       }
-      hist electronNOfSiHitsLhLoose_ENDCAP {
+      hist   CoreEMinENDCAP { 
       }
-
-     # LhMedium
-      hist electronNOfBLayersHitsLhMedium_BARREL {
-      }
-      hist electronNOfTRTHitsLhMedium_BARREL {
+      hist   F0inENDCAP { 
       }
-      hist electronNOfSiHitsLhMedium_BARREL {
+      hist   F1inENDCAP { 
       }
-      hist electronDeltaEta1LhMedium_BARREL {
+      hist   F2inENDCAP { 
       }
-      hist electronDeltaPhi2LhMedium_BARREL {
+      hist   F3inENDCAP { 
       }
-      hist electronDeltaEta1LhMedium_CRACK {
+      hist   Re233e237inENDCAP { 
       }
-      hist electronDeltaPhi2LhMedium_CRACK {
+      hist   Re237e277inENDCAP { 
       }
-      hist electronNOfBLayersHitsLhMedium_CRACK {
+      hist   Ehad1inCRACK { 
       }
-      hist electronNOfTRTHitsLhMedium_CRACK {
+      hist   CoreEMinCRACK { 
       }
-      hist electronNOfSiHitsLhMedium_CRACK {
+      hist   F0inCRACK { 
       }
-      hist electronDeltaEta1LhMedium_ENDCAP {
+      hist   F1inCRACK { 
       }
-      hist electronDeltaPhi2LhMedium_ENDCAP {
+      hist   F2inCRACK { 
       }
-      hist electronNOfBLayersHitsLhMedium_ENDCAP {
+      hist   F3inCRACK { 
       }
-      hist electronNOfTRTHitsLhMedium_ENDCAP {
+      hist   Re233e237inCRACK { 
       }
-      hist electronNOfSiHitsLhMedium_ENDCAP {
+      hist   Re237e277inCRACK { 
       }
+}
 
-     # LhTight
-      hist electronNOfBLayersHitsLhTight_BARREL {
-      }
-      hist electronNOfTRTHitsLhTight_BARREL {
+# CBTightWithTrigger
+
+dir egamma/CBTightPhotonsWithTrigger {
+      output = egamma/photonsWithTrigger/CBTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronNOfSiHitsLhTight_BARREL {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronDeltaEta1LhTight_BARREL {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronDeltaPhi2LhTight_BARREL {
+
+      hist Et { 
       }
-      hist electronDeltaEta1LhTight_CRACK {
+      hist Phi { 
       }
-      hist electronDeltaPhi2LhTight_CRACK {
+      hist Eta { 
       }
-      hist electronNOfBLayersHitsLhTight_CRACK {
+      hist PtCone20 { 
       }
-      hist electronNOfTRTHitsLhTight_CRACK {
+      hist EtCone40 { 
       }
-      hist electronNOfSiHitsLhTight_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronDeltaEta1LhTight_ENDCAP {
+      hist Time { 
       }
-      hist electronDeltaPhi2LhTight_ENDCAP {
+
+      hist EtConv { 
       }
-      hist electronNOfBLayersHitsLhTight_ENDCAP {
+      hist PhiConv { 
       }
-      hist electronNOfTRTHitsLhTight_ENDCAP {
+      hist EtaConv { 
       }
-      hist electronNOfSiHitsLhTight_ENDCAP {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
- }
 
- dir egamma/electronsWithTrigger/LBMon {
-     algorithm = egamma_GatherData
-     output = egamma/electronsWithTrigger/LBMon
-     display = Draw=e1,StatBox
-      # LhLoose
-      hist LBEvoNElectronsLhLoose {
+      hist EtUnconv { 
       }
-      # LhMedium
-      hist LBEvoNElectronsLhMedium {
+      hist PhiUnconv { 
       }
-      # LhTight
-      hist LBEvoNElectronsLhTight {
+      hist EtaUnconv { 
       }
-      # CbLoose
-      hist LBEvoNElectronsCbLoose {
-      }
-      # CbTight
-      hist LBEvoNElectronsCbTight {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-}
-
-
-### photons
 
+}
 
- dir egamma/photons {
-     output = egamma/photons
+dir egamma/CBTightPhotonsWithTrigger/Expert {
+      output = egamma/photonsWithTrigger/CBTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
 
-      # CbLoose
-      hist photonNCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist EtainBARREL { 
       }
-      hist photonPhiCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist PhiinBARREL { 
       }
-      hist photonEtaPhiPt2.5GeVCbLoose {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist TimeinBARREL { 
       }
-      hist photonEtaPhiPtgt4GeVCbLoose {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist RConvinBARREL { 
       }
-      hist photonEtaPhiPtgt20GeVCbLoose {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist ConvTypeinBARREL { 
       }
-      hist photonPtCone20CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist photonTopoEtCone40CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonTimeCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+
+      hist EtainENDCAP { 
       }
-      hist photonRconvCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist PhiinENDCAP { 
       }
-
-      # CbTight
-      hist photonNCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist TimeinENDCAP { 
       }
-      hist photonEtCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist RConvinENDCAP { 
       }
-      hist photonPhiCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist ConvTypeinENDCAP { 
       }
-      hist photonEtaPhiPt2.5GeVCbTight {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonEtaPhiPtgt4GeVCbTight {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonEtaPhiPtgt20GeVCbTight {
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonPtCone20CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+
+      hist EtainCRACK { 
+      }
+      hist PhiinCRACK { 
       }
-      hist photonTopoEtCone40CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist TimeinCRACK { 
       }
-      hist photonTimeCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist RConvinCRACK { 
       }
-      hist photonRconvCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist ConvTypeinCRACK { 
       }
 }
 
- dir egamma/photons/Region {
+dir egamma/CBTightPhotonsWithTrigger/byLB {
+      output = egamma/photonsWithTrigger/CBTight/Expert/LBMon
       algorithm = egKolmogorov
-      output = egamma/photons/EXPERT
-      display = Draw=e1,StatBox
-
-      # CbLoose
-      hist photonNCbLoose_BARREL {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose_BARREL {
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist photonEtaCbLoose_BARREL {
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist photonPhiCbLoose_BARREL {
+      hist    LBEvoN { 
       }
-      hist photonPtCone20CbLoose_BARREL {
+      hist    Conversion_fraction_vs_LB { 
       }
-      hist photonTopoEtCone40CbLoose_BARREL {
-      }
-      hist photonNCbLoose_CRACK {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+
+}
+
+dir egamma/CBTightPhotonsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/photonsWithTrigger/CBTight/Expert/ID
+     display = Draw=e1,StatBox
+
+      hist   Ehad1inBARREL { 
       }
-      hist photonEtCbLoose_CRACK {
+      hist   CoreEMinBARREL { 
       }
-      hist photonEtaCbLoose_CRACK {
+      hist   F0inBARREL { 
       }
-      hist photonPhiCbLoose_CRACK {
+      hist   F1inBARREL { 
       }
-      hist photonPtCone20CbLoose_CRACK {
+      hist   F2inBARREL { 
       }
-      hist photonTopoEtCone40CbLoose_CRACK {
+      hist   F3inBARREL { 
       }
-      hist photonNCbLoose_ENDCAP {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   Re233e237inBARREL { 
       }
-      hist photonEtCbLoose_ENDCAP {
+      hist   Re237e277inBARREL { 
       }
-      hist photonEtaCbLoose_ENDCAP {
+      hist   Ehad1inENDCAP { 
       }
-      hist photonPhiCbLoose_ENDCAP {
+      hist   CoreEMinENDCAP { 
       }
-      hist photonPtCone20CbLoose_ENDCAP {
+      hist   F0inENDCAP { 
       }
-      hist photonTopoEtCone40CbLoose_ENDCAP {
+      hist   F1inENDCAP { 
       }
-
-      # CbTight
-      hist photonNCbTight_BARREL {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   F2inENDCAP { 
       }
-      hist photonEtCbTight_BARREL {
+      hist   F3inENDCAP { 
       }
-      hist photonEtaCbTight_BARREL {
+      hist   Re233e237inENDCAP { 
       }
-      hist photonPhiCbTight_BARREL {
+      hist   Re237e277inENDCAP { 
       }
-      hist photonPtCone20CbTight_BARREL {
+      hist   Ehad1inCRACK { 
       }
-      hist photonTopoEtCone40CbTight_BARREL {
+      hist   CoreEMinCRACK { 
       }
-      hist photonNCbTight_CRACK {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   F0inCRACK { 
       }
-      hist photonEtCbTight_CRACK {
+      hist   F1inCRACK { 
       }
-      hist photonEtaCbTight_CRACK {
+      hist   F2inCRACK { 
       }
-      hist photonPhiCbTight_CRACK {
+      hist   F3inCRACK { 
       }
-      hist photonPtCone20CbTight_CRACK {
+      hist   Re233e237inCRACK { 
       }
-      hist photonTopoEtCone40CbTight_CRACK {
+      hist   Re237e277inCRACK { 
       }
-      hist photonNCbTight_ENDCAP {
+}
+
+
+########################################
+### forwardElectrons
+########################################
+
+# CB Loose Forward Electrons
+
+dir egamma/CBLooseFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/CBLoose
+     display = Draw=e1,StatBox
+     hist N {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
+     }
+
+     hist Et { 
+     }
+     hist Phi { 
+     }
+     hist Eta { 
+     }
+     hist Time { 
+     }
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
+     }
+}
+
+dir egamma/CBLooseFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/CBLoose
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
+     }
+     hist FracMax { 
+     }
+     hist Lateral { 
+     }
+     hist Longitudinal { 
+     }
+     hist SecondLambda { 
+     }
+     hist SecondR { 
+     }
+     hist CenterLambda { 
+     }
+}
+
+
+dir egamma/CBLooseFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/CBLoose/Expert
+      display = Draw=e1,StatBox
+
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
+      }
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
+      }
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
+      }
+      hist EtainENDCAP { 
       }
-      hist photonEtCbTight_ENDCAP {
+      hist PhiinENDCAP { 
       }
-      hist photonEtaCbTight_ENDCAP {
+      hist TimeinENDCAP { 
       }
-      hist photonPhiCbTight_ENDCAP {
+      hist EtainFORWARD { 
       }
-      hist photonPtCone20CbTight_ENDCAP {
+      hist PhiinFORWARD { 
       }
-      hist photonTopoEtCone40CbTight_ENDCAP {
+      hist TimeinFORWARD { 
       }
 }
 
- dir egamma/photons/Unconv {
+# CBTight Forward Electrons
+
+dir egamma/CBTightFwdElectrons {
      algorithm = egKolmogorov
-     output = egamma/photons
+     output = egamma/forwardElectrons/CBTight
      display = Draw=e1,StatBox
-
-     #CbLoose
-     hist photonNUnconvCbLoose {
+     hist N {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
      }
-     hist photonEtUnconvCbLoose {
+     hist Et { 
      }
-     hist photonEtaUnconvCbLoose {
+     hist Phi { 
      }
-     hist photonPhiUnconvCbLoose {
+     hist Eta { 
      }
-     hist photonEtaPhiUnconvCbLoose {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist Time { 
      }
-     hist photonTopoEtCone40UnconvCbLoose {
-     }
-     hist photonPtCone20UnconvCbLoose {
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
      }
+}
 
-     #CbTight
-     hist photonNUnconvCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+dir egamma/CBTightFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/CBTight
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
      }
-     hist photonEtUnconvCbTight {
+     hist FracMax { 
      }
-     hist photonEtaUnconvCbTight {
+     hist Lateral { 
      }
-     hist photonPhiUnconvCbTight {
+     hist Longitudinal { 
      }
-     hist photonEtaPhiUnconvCbTight {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist SecondLambda { 
      }
-     hist photonTopoEtCone40UnconvCbTight {
+     hist SecondR { 
      }
-     hist photonPtCone20UnconvCbTight {
+     hist CenterLambda { 
      }
+}
 
+dir egamma/CBTightFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/CBTight/Expert
+      display = Draw=e1,StatBox
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
+      }
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
+      }
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
+      }
+      hist EtainENDCAP { 
+      }
+      hist PhiinENDCAP { 
+      }
+      hist TimeinENDCAP { 
+      }
+      hist EtainFORWARD { 
+      }
+      hist PhiinFORWARD { 
+      }
+      hist TimeinFORWARD { 
+      }
 }
 
+# LH Loose Forward Electrons
 
- dir egamma/photons/Conv {
+dir egamma/LHLooseFwdElectrons {
      algorithm = egKolmogorov
-     output = egamma/photons
+     output = egamma/forwardElectrons/LHLoose
      display = Draw=e1,StatBox
-
-     #CbLoose
-     hist photonNConvCbLoose {
+     hist N {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
      }
-     hist photonEtConvCbLoose {
+     hist Et { 
      }
-     hist photonEtaConvCbLoose {
+     hist Phi { 
      }
-     hist photonPhiConvCbLoose {
+     hist Eta { 
      }
-     hist photonEtaPhiConvCbLoose {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist Time { 
      }
-     hist photonTopoEtCone40ConvCbLoose {
-     }
-     hist photonPtCone20ConvCbLoose {
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
      }
-     #CbTight
-     hist photonNConvCbTight {
+}
+
+dir egamma/LHLooseFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/LHLoose 
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
      }
-     hist photonEtConvCbTight {
+     hist FracMax { 
      }
-     hist photonEtaConvCbTight {
+     hist Lateral { 
      }
-     hist photonPhiConvCbTight {
+     hist Longitudinal { 
      }
-     hist photonEtaPhiConvCbTight {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist SecondLambda { 
      }
-     hist photonTopoEtCone40ConvCbTight {
+     hist SecondR { 
      }
-     hist photonPtCone20ConvCbTight {
+     hist CenterLambda { 
      }
 }
 
- dir egamma/photons/ID {
-     algorithm = egKolmogorov
-     output = egamma/photons/ID
-     display = Draw=e1,StatBox
 
-      #CbLoose
-      hist photonEhad1CbLoose_BARREL {
-      }
-      hist photonCoreEMCbLoose_BARREL {
-      }
-      hist photonF0CbLoose_BARREL {
-      }
-      hist photonF1CbLoose_BARREL {
-      }
-      hist photonF2CbLoose_BARREL {
+dir egamma/LHLooseFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/LHLoose/Expert
+      display = Draw=e1,StatBox
+
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonF3CbLoose_BARREL {
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonRe233e237CbLoose_BARREL {
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
       }
-      hist photonRe237e277CbLoose_BARREL {
+      hist EtainENDCAP { 
       }
-      hist photonEhad1CbLoose_CRACK {
+      hist PhiinENDCAP { 
       }
-      hist photonCoreEMCbLoose_CRACK {
+      hist TimeinENDCAP { 
       }
-      hist photonF0CbLoose_CRACK {
+      hist EtainFORWARD { 
       }
-      hist photonF1CbLoose_CRACK {
+      hist PhiinFORWARD { 
       }
-      hist photonF2CbLoose_CRACK {
+      hist TimeinFORWARD { 
       }
-      hist photonF3CbLoose_CRACK {
+}
+
+# LHTight Forward Electrons
+
+dir egamma/LHTightFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/LHTight
+     display = Draw=e1,StatBox
+     hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+     hist Et { 
+     }
+     hist Phi { 
+     }
+     hist Eta { 
+     }
+     hist Time { 
+     }
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
+     }
+}
+
+dir egamma/LHTightFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/LHTight
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
+     }
+     hist FracMax { 
+     }
+     hist Lateral { 
+     }
+     hist Longitudinal { 
+     }
+     hist SecondLambda { 
+     }
+     hist SecondR { 
+     }
+     hist CenterLambda { 
+     }
+}
+
+dir egamma/LHTightFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/LHTight/Expert
+      display = Draw=e1,StatBox
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonRe233e237CbLoose_CRACK {
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonRe237e277CbLoose_CRACK {
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
       }
-      hist photonEhad1CbLoose_ENDCAP {
+      hist EtainENDCAP { 
       }
-      hist photonCoreEMCbLoose_ENDCAP {
+      hist PhiinENDCAP { 
       }
-      hist photonF0CbLoose_ENDCAP {
+      hist TimeinENDCAP { 
       }
-      hist photonF1CbLoose_ENDCAP {
+      hist EtainFORWARD { 
       }
-      hist photonF2CbLoose_ENDCAP {
+      hist PhiinFORWARD { 
       }
-      hist photonF3CbLoose_ENDCAP {
-      }
-      hist photonRe233e237CbLoose_ENDCAP {
-      }
-      hist photonRe237e277CbLoose_ENDCAP {
-      }
-      #CbTight
-      hist photonEhad1CbTight_BARREL {
-      }
-      hist photonCoreEMCbTight_BARREL {
-      }
-      hist photonF0CbTight_BARREL {
-      }
-      hist photonF1CbTight_BARREL {
-      }
-      hist photonF2CbTight_BARREL {
-      }
-      hist photonF3CbTight_BARREL {
-      }
-      hist photonRe233e237CbTight_BARREL {
-      }
-      hist photonRe237e277CbTight_BARREL {
-      }
-      hist photonEhad1CbTight_CRACK {
-      }
-      hist photonCoreEMCbTight_CRACK {
-      }
-      hist photonF0CbTight_CRACK {
-      }
-      hist photonF1CbTight_CRACK {
-      }
-      hist photonF2CbTight_CRACK {
-      }
-      hist photonF3CbTight_CRACK {
-      }
-      hist photonRe233e237CbTight_CRACK {
-      }
-      hist photonRe237e277CbTight_CRACK {
-      }
-      hist photonEhad1CbTight_ENDCAP {
-      }
-      hist photonCoreEMCbTight_ENDCAP {
-      }
-      hist photonF0CbTight_ENDCAP {
-      }
-      hist photonF1CbTight_ENDCAP {
-      }
-      hist photonF2CbTight_ENDCAP {
-      }
-      hist photonF3CbTight_ENDCAP {
-      }
-      hist photonRe233e237CbTight_ENDCAP {
-      }
-      hist photonRe237e277CbTight_ENDCAP {
+      hist TimeinFORWARD { 
       }
 }
 
- dir egamma/photons/Region {
-     algorithm = egKolmogorov
-     output = egamma/photons/EXPERT
-     display = Draw=e1,StatBox
-
-      # CbLoose
-      hist photonConvTrkMatch1CbLoose_BARREL {
-      }
-      hist photonConvTrkMatch2CbLoose_BARREL {
-      }
-      hist photonConvTypeCbLoose_BARREL {
-      }
-      hist photonConvTrkMatch1CbLoose_CRACK {
-      }
-      hist photonConvTrkMatch2CbLoose_CRACK {
-      }
-      hist photonConvTypeCbLoose_CRACK {
-      }
-      hist photonConvTrkMatch1CbLoose_ENDCAP {
-      }
-      hist photonConvTrkMatch2CbLoose_ENDCAP {
-      }
-      hist photonConvTypeCbLoose_ENDCAP {
-      }
-      # CbTight
-      hist photonConvTrkMatch1CbTight_BARREL {
-      }
-      hist photonConvTrkMatch2CbTight_BARREL {
-      }
-      hist photonConvTypeCbTight_BARREL {
-      }
-      hist photonConvTrkMatch1CbTight_CRACK {
-      }
-      hist photonConvTrkMatch2CbTight_CRACK {
-      }
-      hist photonConvTypeCbTight_CRACK {
-      }
-      hist photonConvTrkMatch1CbTight_ENDCAP {
-      }
-      hist photonConvTrkMatch2CbTight_ENDCAP {
-      }
-      hist photonConvTypeCbTight_ENDCAP {
-      }
- }
-
+### Tag&Probe Z
 
- dir egamma/photons/LBMon {
-     algorithm = egamma_GatherData
-     output = egamma/photons/LBMon
+dir egamma/TnPZ/TnPCandidate {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeZ
      display = Draw=e1,StatBox
-      # CbLoose
-      hist LBEvoNPhotonsCbLoose {
-      }
-      hist LBEvoNPhotonsUnconvCbLoose {
-      }
-      hist LBEvoNPhotonsConvCbLoose {
-      }
-      hist LBEvoConvOverNCbLoose {
-      }
-
-      # CbTight
-      hist LBEvoNPhotonsCbTight {
-      }
-      hist LBEvoNPhotonsUnconvCbTight {
-      }
-      hist LBEvoNPhotonsConvCbTight {
-      }
-      hist LBEvoConvOverNCbTight {
-      }
-}
-
-### photonsWithTrigger
-
- dir egamma/photonsWithTrigger {
-     output = egamma/photonsWithTrigger
-
-      # CbLoose
-      hist photonNCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonPhiCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonEtaPhiPt2.5GeVCbLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist photonEtaPhiPtgt4GeVCbLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist photonEtaPhiPtgt20GeVCbLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist photonPtCone20CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonTopoEtCone40CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonTimeCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonRconvCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-
-      # CbTight
-      hist photonNCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonPhiCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonEtaPhiPt2.5GeVCbTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)      
-      }
-      hist photonEtaPhiPtgt4GeVCbTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist photonEtaPhiPtgt20GeVCbTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist photonPtCone20CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonTopoEtCone40CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonTimeCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonRconvCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-}
-
-
- dir egamma/photonsWithTrigger/Region {
-      algorithm = egKolmogorov
-      output = egamma/photonsWithTrigger/EXPERT
-      display = Draw=e1,StatBox
-
-      # CbLoose
-      hist photonNCbLoose_BARREL {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose_BARREL {
-      }
-      hist photonEtaCbLoose_BARREL {
-      }
-      hist photonPhiCbLoose_BARREL {
-      }
-      hist photonPtCone20CbLoose_BARREL {
-      }
-      hist photonTopoEtCone40CbLoose_BARREL {
-      }
-      hist photonNCbLoose_CRACK {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose_CRACK {
-      }
-      hist photonEtaCbLoose_CRACK {
-      }
-      hist photonPhiCbLoose_CRACK {
-      }
-      hist photonPtCone20CbLoose_CRACK {
-      }
-      hist photonTopoEtCone40CbLoose_CRACK {
-      }
-      hist photonNCbLoose_ENDCAP {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose_ENDCAP {
-      }
-      hist photonEtaCbLoose_ENDCAP {
-      }
-      hist photonPhiCbLoose_ENDCAP {
-      }
-      hist photonPtCone20CbLoose_ENDCAP {
-      }
-      hist photonTopoEtCone40CbLoose_ENDCAP {
-      }
-
-      # CbTight
-      hist photonNCbTight_BARREL {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbTight_BARREL {
-      }
-      hist photonEtaCbTight_BARREL {
-      }
-      hist photonPhiCbTight_BARREL {
-      }
-      hist photonPtCone20CbTight_BARREL {
-      }
-      hist photonTopoEtCone40CbTight_BARREL {
-      }
-      hist photonNCbTight_CRACK {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbTight_CRACK {
-      }
-      hist photonEtaCbTight_CRACK {
-      }
-      hist photonPhiCbTight_CRACK {
-      }
-      hist photonPtCone20CbTight_CRACK {
-      }
-      hist photonTopoEtCone40CbTight_CRACK {
-      }
-      hist photonNCbTight_ENDCAP {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbTight_ENDCAP {
-      }
-      hist photonEtaCbTight_ENDCAP {
-      }
-      hist photonPhiCbTight_ENDCAP {
-      }
-      hist photonPtCone20CbTight_ENDCAP {
-      }
-      hist photonTopoEtCone40CbTight_ENDCAP {
-      }
+     hist Z_candidate_mass {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
+     hist Z_candidate_mass_distribution_Lead_in_Barrel {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
+     hist Number_of_Z_candidates_vs_eta_leading_e {
+     }
+     hist Number_of_Z_candidates_vs_phi_leading_e {
+     }
+     hist Z_candidate_mass_distribution_Lead_in_Crack {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
+     hist Z_candidate_mass_distribution_Lead_in_EndCap {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
 }
 
- dir egamma/photonsWithTrigger/Unconv {
+dir egamma/TnPZ/ID {
      algorithm = egKolmogorov
-     output = egamma/photonsWithTrigger
+     output = egamma/tagandprobeZ/ID
      display = Draw=e1,StatBox
 
-     #CbLoose
-     hist photonNUnconvCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+     hist Ehad1ProbeinBARREL { 
      }
-     hist photonEtUnconvCbLoose {
+     hist EoverPProbeinBARREL { 
      }
-     hist photonEtaUnconvCbLoose {
+     hist CoreEMProbeinBARREL { 
      }
-     hist photonPhiUnconvCbLoose {
+     hist F0ProbeinBARREL { 
      }
-     hist photonEtaPhiUnconvCbLoose {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist F1ProbeinBARREL { 
      }
-     hist photonTopoEtCone40UnconvCbLoose {
+     hist F2ProbeinBARREL { 
      }
-     hist photonPtCone20UnconvCbLoose {
+     hist F3ProbeinBARREL { 
      }
-
-     #CbTight
-     hist photonNUnconvCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+     hist Re233e237ProbeinBARREL { 
      }
-     hist photonEtUnconvCbTight {
+     hist Re237e277ProbeinBARREL { 
      }
-     hist photonEtaUnconvCbTight {
+     hist Ehad1ProbeinENDCAP { 
      }
-     hist photonPhiUnconvCbTight {
+     hist EoverPProbeinENDCAP { 
      }
-     hist photonEtaPhiUnconvCbTight {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist CoreEMProbeinENDCAP { 
      }
-     hist photonTopoEtCone40UnconvCbTight {
+     hist F0ProbeinENDCAP { 
      }
-     hist photonPtCone20UnconvCbTight {
+     hist F1ProbeinENDCAP { 
+     }
+     hist F2ProbeinENDCAP { 
+     }
+     hist F3ProbeinENDCAP { 
+     }
+     hist Re233e237ProbeinENDCAP { 
+     }
+     hist Re237e277ProbeinENDCAP { 
      }
 
 }
 
-
- dir egamma/photonsWithTrigger/Conv {
+dir egamma/TnPZ/Tracks { 
      algorithm = egKolmogorov
-     output = egamma/photonsWithTrigger
+     output = egamma/tagandprobeZ/Track
      display = Draw=e1,StatBox
-
-     #CbLoose
-     hist photonNConvCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+     hist NOfBLayerHitsProbeinBARREL { 
      }
-     hist photonEtConvCbLoose {
+     hist NOfPixelHitsProbeinBARREL { 
      }
-     hist photonEtaConvCbLoose {
+     hist NOfSCTHitsProbeinBARREL { 
      }
-     hist photonPhiConvCbLoose {
+     hist NOfTRTHitsProbeinBARREL { 
      }
-     hist photonEtaPhiConvCbLoose {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist NOfTRTHighThresholdHitsProbeinBARREL { 
      }
-     hist photonTopoEtCone40ConvCbLoose {
+     hist DeltaEta1ProbeinBARREL { 
      }
-     hist photonPtCone20ConvCbLoose {
+     hist DeltaPhi2ProbeinBARREL { 
      }
-     #CbTight
-     hist photonNConvCbTight {
+     hist Trackd0ProbeinBARREL { 
      }
-     hist photonEtConvCbTight {
+     hist NOfBLayerHitsProbeinENDCAP { 
      }
-     hist photonEtaConvCbTight {
+     hist NOfPixelHitsProbeinENDCAP { 
      }
-     hist photonPhiConvCbTight {
+     hist NOfSCTHitsProbeinENDCAP { 
      }
-     hist photonEtaPhiConvCbTight {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist NOfTRTHitsProbeinENDCAP { 
      }
-     hist photonTopoEtCone40ConvCbTight {
+     hist NOfTRTHighThresholdHitsProbeinENDCAP { 
      }
-     hist photonPtCone20ConvCbTight {
+     hist DeltaEta1ProbeinENDCAP { 
+     }
+     hist DeltaPhi2ProbeinENDCAP { 
+     }
+     hist Trackd0ProbeinENDCAP { 
      }
-}
-
- dir egamma/photonsWithTrigger/ID {
-     algorithm = egKolmogorov
-     output = egamma/photonsWithTrigger/ID
-     display = Draw=e1,StatBox
-
-      #CbLoose
-      hist photonEhad1CbLoose_BARREL {
-      }
-      hist photonCoreEMCbLoose_BARREL {
-      }
-      hist photonF0CbLoose_BARREL {
-      }
-      hist photonF1CbLoose_BARREL {
-      }
-      hist photonF2CbLoose_BARREL {
-      }
-      hist photonF3CbLoose_BARREL {
-      }
-      hist photonRe233e237CbLoose_BARREL {
-      }
-      hist photonRe237e277CbLoose_BARREL {
-      }
-      hist photonEhad1CbLoose_CRACK {
-      }
-      hist photonCoreEMCbLoose_CRACK {
-      }
-      hist photonF0CbLoose_CRACK {
-      }
-      hist photonF1CbLoose_CRACK {
-      }
-      hist photonF2CbLoose_CRACK {
-      }
-      hist photonF3CbLoose_CRACK {
-      }
-      hist photonRe233e237CbLoose_CRACK {
-      }
-      hist photonRe237e277CbLoose_CRACK {
-      }
-      hist photonEhad1CbLoose_ENDCAP {
-      }
-      hist photonCoreEMCbLoose_ENDCAP {
-      }
-      hist photonF0CbLoose_ENDCAP {
-      }
-      hist photonF1CbLoose_ENDCAP {
-      }
-      hist photonF2CbLoose_ENDCAP {
-      }
-      hist photonF3CbLoose_ENDCAP {
-      }
-      hist photonRe233e237CbLoose_ENDCAP {
-      }
-      hist photonRe237e277CbLoose_ENDCAP {
-      }
-      #CbTight
-      hist photonEhad1CbTight_BARREL {
-      }
-      hist photonCoreEMCbTight_BARREL {
-      }
-      hist photonF0CbTight_BARREL {
-      }
-      hist photonF1CbTight_BARREL {
-      }
-      hist photonF2CbTight_BARREL {
-      }
-      hist photonF3CbTight_BARREL {
-      }
-      hist photonRe233e237CbTight_BARREL {
-      }
-      hist photonRe237e277CbTight_BARREL {
-      }
-      hist photonEhad1CbTight_CRACK {
-      }
-      hist photonCoreEMCbTight_CRACK {
-      }
-      hist photonF0CbTight_CRACK {
-      }
-      hist photonF1CbTight_CRACK {
-      }
-      hist photonF2CbTight_CRACK {
-      }
-      hist photonF3CbTight_CRACK {
-      }
-      hist photonRe233e237CbTight_CRACK {
-      }
-      hist photonRe237e277CbTight_CRACK {
-      }
-      hist photonEhad1CbTight_ENDCAP {
-      }
-      hist photonCoreEMCbTight_ENDCAP {
-      }
-      hist photonF0CbTight_ENDCAP {
-      }
-      hist photonF1CbTight_ENDCAP {
-      }
-      hist photonF2CbTight_ENDCAP {
-      }
-      hist photonF3CbTight_ENDCAP {
-      }
-      hist photonRe233e237CbTight_ENDCAP {
-      }
-      hist photonRe237e277CbTight_ENDCAP {
-      }
-}
-
- dir egamma/photonsWithTrigger/Region {
-     algorithm = egKolmogorov
-     output = egamma/photonsWithTrigger/EXPERT
-     display = Draw=e1,StatBox
 
-      # CbLoose
-      hist photonConvTrkMatch1CbLoose_BARREL {
-      }
-      hist photonConvTrkMatch2CbLoose_BARREL {
-      }
-      hist photonConvTypeCbLoose_BARREL {
-      }
-      hist photonConvTrkMatch1CbLoose_CRACK {
-      }
-      hist photonConvTrkMatch2CbLoose_CRACK {
-      }
-      hist photonConvTypeCbLoose_CRACK {
-      }
-      hist photonConvTrkMatch1CbLoose_ENDCAP {
-      }
-      hist photonConvTrkMatch2CbLoose_ENDCAP {
-      }
-      hist photonConvTypeCbLoose_ENDCAP {
-      }
-      # CbTight
-      hist photonConvTrkMatch1CbTight_BARREL {
-      }
-      hist photonConvTrkMatch2CbTight_BARREL {
-      }
-      hist photonConvTypeCbTight_BARREL {
-      }
-      hist photonConvTrkMatch1CbTight_CRACK {
-      }
-      hist photonConvTrkMatch2CbTight_CRACK {
-      }
-      hist photonConvTypeCbTight_CRACK {
-      }
-      hist photonConvTrkMatch1CbTight_ENDCAP {
-      }
-      hist photonConvTrkMatch2CbTight_ENDCAP {
-      }
-      hist photonConvTypeCbTight_ENDCAP {
-      }
  }
 
-
- dir egamma/photonsWithTrigger/LBMon {
-     algorithm = egamma_GatherData
-     output = egamma/photonsWithTrigger/LBMon
-     display = Draw=e1,StatBox
-      # CbLoose
-      hist LBEvoNPhotonsCbLoose {
-      }
-      hist LBEvoNPhotonsUnconvCbLoose {
-      }
-      hist LBEvoNPhotonsConvCbLoose {
-      }
-      hist LBEvoConvOverNCbLoose {
-      }
-
-      # CbTight
-      hist LBEvoNPhotonsCbTight {
-      }
-      hist LBEvoNPhotonsUnconvCbTight {
-      }
-      hist LBEvoNPhotonsConvCbTight {
-      }
-      hist LBEvoConvOverNCbTight {
-      }
-}
-
-### forwardElectrons
-
- dir egamma/forwardElectrons {
-     algorithm = egKolmogorov
-     output = egamma/forwardElectrons
-     display = Draw=e1,StatBox
-
-      hist forwardElectronN {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist forwardElectronEt {
-      }
-      hist forwardElectronPhi {
-      }
-      hist forwardElectronEta {
-      }
-      hist forwardElectronEtaPhi {
-       algorithm = egamma_BinsDiffFromStripMedian
-      }
-      # hist forwardElectronTopoEtCone40 {
-      # }
-      hist forwardElectronTime {
-      }
-
-      hist forwardElectronTightN {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist forwardElectronTightEt {
-      }
-      hist forwardElectronTightPhi {
-      }
-      hist forwardElectronTightEta {
-      }
-      hist forwardElectronTightEtaPhi {
-       algorithm = egamma_BinsDiffFromStripMedian
-      }
-      #hist forwardElectronTightTopoEtCone40 {
-      #}
-      hist forwardElectronTightTime {
-      }
-
-}
-
-
- dir egamma/forwardElectrons {
-      Algorithm = Egkolmogorov
-      Output = egamma/forwardElectrons/EXPERT
-      display = Draw=e1,StatBox
-      hist forwardElectronN_ENDCAP {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist forwardElectronEt_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronEta_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronPhi_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTopoEtCone40_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTime_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightN_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightEt_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightEta_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightPhi_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      #hist forwardElectronTightTopoEtCone40_ENDCAP {
-      #output = egamma/forwardElectrons/EXPERT
-      #}
-      hist forwardElectronN_FORWARD {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-       output = egamma/forwardElectrons/EXPERT	
-      }
-      hist forwardElectronEt_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronEta_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronPhi_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      #hist forwardElectronTopoEtCone40_FORWARD {
-      #output = egamma/forwardElectrons/EXPERT
-      #}
-      hist forwardElectronTime_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightN_FORWARD {
-       output = egamma/forwardElectrons/EXPERT
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist forwardElectronTightEt_FORWARD {
-       output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightEta_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightPhi_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      #hist forwardElectronTightTopoEtCone40_FORWARD {
-      #output = egamma/forwardElectrons/EXPERT
-      #}
-}
-
-dir egamma/forwardElectrons/ID {
-      algorithm = egKolmogorov
-      output = egamma/forwardElectrons/ID
-      hist forwardElectronENG_DENS_ENDCAP {
-      }
-      hist forwardElectronFRAC_MAX_ENDCAP {
-      }
-      hist forwardElectronLONGITUDINAL_ENDCAP {
-      }
-      hist forwardElectron2ND_LAMBDA_ENDCAP {
-      }
-      hist forwardElectronLATERAL_ENDCAP {
-      }
-      hist forwardElectron2ND_R_ENDCAP {
-      }
-      hist forwardElectronCENTER_LAMBDA_ENDCAP {
-      }
-      hist forwardElectronENG_DENS_FORWARD {
-      }
-      hist forwardElectronFRAC_MAX_FORWARD {
-      }
-      hist forwardElectronLONGITUDINAL_FORWARD {
-      }
-      hist forwardElectron2ND_LAMBDA_FORWARD {
-      }
-      hist forwardElectronLATERAL_FORWARD {
-      }
-      hist forwardElectron2ND_R_FORWARD {
-      }
-      hist forwardElectronCENTER_LAMBDA_FORWARD {
-      }
-}
-
-
-### Tag&Probe Z
-
-dir egamma/tagandprobeZ {
-    algorithm = egKolmogorov
-    output = egamma/tagandprobeZ
-    display = Draw=e1,StatBox
-
-    hist electronTagAndProbeNcandidates {
-    }
-    hist electronTagAndProbeGlobalMass {
-     algorithm = egamma_FitZmass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_BARREL {
-     algorithm = egamma_FitZmass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_CRACK {
-     algorithm = egamma_FitZmass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_ENDCAP {
-     algorithm = egamma_FitZmass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeN {
-     algorithm = egamma_Histogram_Not_Empty
-     display = Draw=e1,StatBox,LogY
-    }
-    hist electronTagAndProbeEt {
-    }
-    hist electronTagAndProbeEta {
-    }
-    hist electronTagAndProbePhi {
-    }
-    hist electronTagAndProbeEtaPhi {
-     algorithm = egamma_BinsDiffFromStripMedian
-    }
-}
-
-dir egamma/tagandprobeZ {
+dir egamma/TnPZ/Efficiencies {
      algorithm = egKolmogorov
      output = egamma/tagandprobeZ
      display = Draw=e1,StatBox
 
-     hist EfficiencyTagAndProbeElectronIDvsEt {
-     }
-     hist EfficiencyTagAndProbeElectronIDvsEta {
-     }
-     hist EfficiencyTagAndProbeElectronIDvsPhi {
-     }
-     hist EfficiencyTagAndProbeElectronISOvsEt {
+     hist TnP_ID_efficiency_vs_etprobe { 
      }
-     hist EfficiencyTagAndProbeElectronISOvsEta {
+     hist TnP_ID_efficiency_vs_etaprobe { 
      }
-     hist EfficiencyTagAndProbeElectronISOvsPhi {
+     hist TnP_ID_efficiency_vs_phiprobe { 
      }
-}
-
-dir egamma/tagandprobeZ/ID {
-     algorithm = egKolmogorov
-     output = egamma/tagandprobeZ/ID
-     display = Draw=e1,StatBox
-
-      hist electronTagAndProbeEhad1_BARREL {
-      }
-      hist electronTagAndProbeEoverP_BARREL {
-      }
-      hist electronTagAndProbeCoreEM_BARREL {
-      }
-      hist electronTagAndProbeF1_BARREL {
-      }
-      hist electronTagAndProbeF2_BARREL {
-      }
-      hist electronTagAndProbeF3_BARREL {
-      }
-      hist electronTagAndProbeRe233e237_BARREL {
-      }
-      hist electronTagAndProbeRe237e277_BARREL {
-      }
-      hist electronTagAndProbeEhad1_ENDCAP {
-      }
-      hist electronTagAndProbeEoverP_ENDCAP {
-      }
-      hist electronTagAndProbeCoreEM_ENDCAP {
-      }
-      hist electronTagAndProbeF1_ENDCAP {
-      }
-      hist electronTagAndProbeF2_ENDCAP {
-      }
-      hist electronTagAndProbeF3_ENDCAP {
-      }
-      hist electronTagAndProbeRe233e237_ENDCAP {
-      }
-      hist electronTagAndProbeRe237e277_ENDCAP {
-      }
-      hist electronTagAndProbeEhad1_CRACK {
-      }
-      hist electronTagAndProbeEoverP_CRACK {
-      }
-      hist electronTagAndProbeCoreEM_CRACK {
-      }
-      hist electronTagAndProbeF1_CRACK {
-      }
-      hist electronTagAndProbeF2_CRACK {
-      }
-      hist electronTagAndProbeF3_CRACK {
-      }
-      hist electronTagAndProbeRe233e237_CRACK {
-      }
-      hist electronTagAndProbeRe237e277_CRACK {
-      }
-}
-
-dir egamma/tagandprobeZ/Track { 
-     algorithm = egKolmogorov
-     output = egamma/tagandprobeZ/Track
-     display = Draw=e1,StatBox
-
-      hist electronTagAndProbeNOfBLayerHits_BARREL {
-      }
-      hist electronTagAndProbeNOfTRTHits_BARREL {
-      }
-      hist electronTagAndProbeNOfSiHits_BARREL {
-      }
-      hist electronTagAndProbeDeltaEta1_BARREL {
-      }
-      hist electronTagAndProbeDeltaPhi2_BARREL {
-      }
-      hist electronTagAndProbeNOfBLayerHits_ENDCAP {
-      }
-      hist electronTagAndProbeNOfTRTHits_ENDCAP {
-      }
-      hist electronTagAndProbeNOfSiHits_ENDCAP {
-      }
-      hist electronTagAndProbeDeltaEta1_ENDCAP {
-      }
-      hist electronTagAndProbeDeltaPhi2_ENDCAP {
-      }
-      hist electronTagAndProbeNOfBLayerHits_CRACK {
-      }
-      hist electronTagAndProbeNOfTRTHits_CRACK {
-      }
-      hist electronTagAndProbeNOfSiHits_CRACK {
-      }
-      hist electronTagAndProbeDeltaEta1_CRACK {
-      }
-      hist electronTagAndProbeDeltaPhi2_CRACK {
-      }
-
- }
-
-dir egamma/tagandprobeZ/Isolation {
-     algorithm = egKolmogorov
-     output = egamma/tagandprobeZ
-     display = Draw=e1,StatBox
-
-     hist electronTagAndProbeCaloIso_BARREL {
+     hist TnP_Calo_Iso_efficiency_vs_etprobe { 
      }
-     hist electronTagAndProbeTrackIso_BARREL {
+     hist TnP_Calo_Iso_efficiency_vs_etaprobe { 
      }
-     hist electronTagAndProbeCaloIso_ENDCAP {
+     hist TnP_Calo_Iso_efficiency_vs_phiprobe { 
      }
-     hist electronTagAndProbeTrackIso_ENDCAP {
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etprobe { 
      }
-     hist electronTagAndProbeCaloIso_CRACK {
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etaprobe { 
      }
-     hist electronTagAndProbeTrackIso_CRACK {
+     hist TnP_Calo_Iso_and_LHTight_ID_efficiency_vs_phiprobe { 
      }
+      
 }
 
-dir egamma/tagandprobeZ/LBMon {
+dir egamma/TnPZ/TnPCandidate {
     algorithm = egamma_GatherData
     output = egamma/tagandprobeZ/LBMon
     display = Draw=e1,StatBox
 
-    hist LBEvoNZcandidates {
+    hist Number_of_Z_candidates_vs_LB { 
     }
+
 }
 
 ### Tag&Probe JPsi
 
-dir egamma/tagandprobeJPsi {
-    algorithm = egKolmogorov
-    output = egamma/tagandprobeJPsi
-    display = Draw=e1,StatBox
-
-    hist electronTagAndProbeNcandidates {
-    }
-    hist electronTagAndProbeGlobalMass {
-     algorithm = egamma_FitJPsimass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_BARREL {
-     algorithm = egamma_FitJPsimass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_CRACK {
-     algorithm = egamma_FitJPsimass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_ENDCAP {
-     algorithm = egamma_FitJPsimass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeN {
-     algorithm = egamma_Histogram_Not_Empty
-     display = Draw=e1,StatBox,LogY
-    }
-    hist electronTagAndProbeEt {
-    }
-    hist electronTagAndProbeEta {
-    }
-    hist electronTagAndProbePhi {
-    }
-    hist electronTagAndProbeEtaPhi {
-     algorithm = egamma_BinsDiffFromStripMedian
-    }
-}
-
-dir egamma/tagandprobeJPsi {
+dir egamma/TnPJPsi/TnPCandidate {
      algorithm = egKolmogorov
      output = egamma/tagandprobeJPsi
      display = Draw=e1,StatBox
 
-     hist EfficiencyTagAndProbeElectronIDvsEt {
+     hist JPsi_candidate_mass {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
      }
-     hist EfficiencyTagAndProbeElectronIDvsEta {
+     hist JPsi_candidate_mass_distribution_Lead_in_Barrel {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
      }
-     hist EfficiencyTagAndProbeElectronIDvsPhi {
+     hist Number_of_JPsi_candidates_vs_eta_leading_e {
      }
-     hist EfficiencyTagAndProbeElectronISOvsEt {
+     hist Number_of_JPsi_candidates_vs_phi_leading_e {
      }
-     hist EfficiencyTagAndProbeElectronISOvsEta {
+     hist JPsi_candidate_mass_distribution_Lead_in_Crack {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
      }
-     hist EfficiencyTagAndProbeElectronISOvsPhi {
+     hist JPsi_candidate_mass_distribution_Lead_in_EndCap {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
      }
+
 }
 
-dir egamma/tagandprobeJPsi/ID {
+dir egamma/TnPJPsi/ID {
      algorithm = egKolmogorov
      output = egamma/tagandprobeJPsi/ID
      display = Draw=e1,StatBox
 
-      hist electronTagAndProbeEhad1_BARREL {
-      }
-      hist electronTagAndProbeEoverP_BARREL {
-      }
-      hist electronTagAndProbeCoreEM_BARREL {
-      }
-      hist electronTagAndProbeF1_BARREL {
-      }
-      hist electronTagAndProbeF2_BARREL {
-      }
-      hist electronTagAndProbeF3_BARREL {
-      }
-      hist electronTagAndProbeRe233e237_BARREL {
-      }
-      hist electronTagAndProbeRe237e277_BARREL {
-      }
-      hist electronTagAndProbeEhad1_ENDCAP {
-      }
-      hist electronTagAndProbeEoverP_ENDCAP {
-      }
-      hist electronTagAndProbeCoreEM_ENDCAP {
-      }
-      hist electronTagAndProbeF1_ENDCAP {
-      }
-      hist electronTagAndProbeF2_ENDCAP {
-      }
-      hist electronTagAndProbeF3_ENDCAP {
-      }
-      hist electronTagAndProbeRe233e237_ENDCAP {
-      }
-      hist electronTagAndProbeRe237e277_ENDCAP {
-      }
-      hist electronTagAndProbeEhad1_CRACK {
-      }
-      hist electronTagAndProbeEoverP_CRACK {
-      }
-      hist electronTagAndProbeCoreEM_CRACK {
-      }
-      hist electronTagAndProbeF1_CRACK {
-      }
-      hist electronTagAndProbeF2_CRACK {
-      }
-      hist electronTagAndProbeF3_CRACK {
-      }
-      hist electronTagAndProbeRe233e237_CRACK {
-      }
-      hist electronTagAndProbeRe237e277_CRACK {
-      }
+     hist Ehad1ProbeinBARREL { 
+     }
+     hist EoverPProbeinBARREL { 
+     }
+     hist CoreEMProbeinBARREL { 
+     }
+     hist F0ProbeinBARREL { 
+     }
+     hist F1ProbeinBARREL { 
+     }
+     hist F2ProbeinBARREL { 
+     }
+     hist F3ProbeinBARREL { 
+     }
+     hist Re233e237ProbeinBARREL { 
+     }
+     hist Re237e277ProbeinBARREL { 
+     }
+     hist Ehad1ProbeinENDCAP { 
+     }
+     hist EoverPProbeinENDCAP { 
+     }
+     hist CoreEMProbeinENDCAP { 
+     }
+     hist F0ProbeinENDCAP { 
+     }
+     hist F1ProbeinENDCAP { 
+     }
+     hist F2ProbeinENDCAP { 
+     }
+     hist F3ProbeinENDCAP { 
+     }
+     hist Re233e237ProbeinENDCAP { 
+     }
+     hist Re237e277ProbeinENDCAP { 
+     }
+
 }
 
-dir egamma/tagandprobeJPsi/Track { 
+dir egamma/TnPJPsi/Tracks { 
      algorithm = egKolmogorov
      output = egamma/tagandprobeJPsi/Track
      display = Draw=e1,StatBox
 
-      hist electronTagAndProbeNOfBLayerHits_BARREL {
-      }
-      hist electronTagAndProbeNOfTRTHits_BARREL {
-      }
-      hist electronTagAndProbeNOfSiHits_BARREL {
-      }
-      hist electronTagAndProbeDeltaEta1_BARREL {
-      }
-      hist electronTagAndProbeDeltaPhi2_BARREL {
-      }
-      hist electronTagAndProbeNOfBLayerHits_ENDCAP {
-      }
-      hist electronTagAndProbeNOfTRTHits_ENDCAP {
-      }
-      hist electronTagAndProbeNOfSiHits_ENDCAP {
-      }
-      hist electronTagAndProbeDeltaEta1_ENDCAP {
-      }
-      hist electronTagAndProbeDeltaPhi2_ENDCAP {
-      }
-      hist electronTagAndProbeNOfBLayerHits_CRACK {
-      }
-      hist electronTagAndProbeNOfTRTHits_CRACK {
-      }
-      hist electronTagAndProbeNOfSiHits_CRACK {
-      }
-      hist electronTagAndProbeDeltaEta1_CRACK {
-      }
-      hist electronTagAndProbeDeltaPhi2_CRACK {
-      }
+     hist NOfBLayerHitsProbeinBARREL { 
+     }
+     hist NOfPixelHitsProbeinBARREL { 
+     }
+     hist NOfSCTHitsProbeinBARREL { 
+     }
+     hist NOfTRTHitsProbeinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsProbeinBARREL { 
+     }
+     hist DeltaEta1ProbeinBARREL { 
+     }
+     hist DeltaPhi2ProbeinBARREL { 
+     }
+     hist Trackd0ProbeinBARREL { 
+     }
+     hist NOfBLayerHitsProbeinENDCAP { 
+     }
+     hist NOfPixelHitsProbeinENDCAP { 
+     }
+     hist NOfSCTHitsProbeinENDCAP { 
+     }
+     hist NOfTRTHitsProbeinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsProbeinENDCAP { 
+     }
+     hist DeltaEta1ProbeinENDCAP { 
+     }
+     hist DeltaPhi2ProbeinENDCAP { 
+     }
+     hist Trackd0ProbeinENDCAP { 
+     }
 
  }
 
-dir egamma/tagandprobeJPsi/Isolation {
+dir egamma/TnPJPsi/Efficiencies {
      algorithm = egKolmogorov
      output = egamma/tagandprobeJPsi
      display = Draw=e1,StatBox
 
-     hist electronTagAndProbeCaloIso_BARREL {
+     hist TnP_ID_efficiency_vs_etprobe { 
      }
-     hist electronTagAndProbeTrackIso_BARREL {
+     hist TnP_ID_efficiency_vs_etaprobe { 
      }
-     hist electronTagAndProbeCaloIso_ENDCAP {
+     hist TnP_ID_efficiency_vs_phiprobe { 
      }
-     hist electronTagAndProbeTrackIso_ENDCAP {
+     hist TnP_Calo_Iso_efficiency_vs_etprobe { 
      }
-     hist electronTagAndProbeCaloIso_CRACK {
+     hist TnP_Calo_Iso_efficiency_vs_etaprobe { 
      }
-     hist electronTagAndProbeTrackIso_CRACK {
+     hist TnP_Calo_Iso_efficiency_vs_phiprobe { 
      }
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etprobe { 
+     }
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etaprobe { 
+     }
+     hist TnP_Calo_Iso_and_LHTight_ID_efficiency_vs_phiprobe { 
+     } 
 }
 
-dir egamma/tagandprobeJPsi/LBMon {
+dir egamma/TnPJPsi/TnPCandidate {
     algorithm = egamma_GatherData
     output = egamma/tagandprobeJPsi/LBMon
     display = Draw=e1,StatBox
 
-    hist LBEvoNJPsicandidates {
+    hist Number_of_JPsi_candidates_vs_LB { 
     }
-}
+
+}
\ No newline at end of file
diff --git a/DataQuality/DataQualityConfigurations/config/Egamma/collisions_run.config_run2 b/DataQuality/DataQualityConfigurations/config/Egamma/collisions_run.config_run2
new file mode 100644
index 000000000000..623fecc0b34f
--- /dev/null
+++ b/DataQuality/DataQualityConfigurations/config/Egamma/collisions_run.config_run2
@@ -0,0 +1,3294 @@
+# **********************************************************************
+# $Id: collisions_run.config 777627 2016-10-11 10:49:51Z nproklov $
+# **********************************************************************
+
+############################################################
+# e,gamma
+############################################################
+
+# #############
+# Reference
+# #############
+
+reference EgammaReference {
+  location = /eos/atlas/atlascerngroupdisk/data-dqm/references/Other/,root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/Other/
+  file = data15_13TeV.00281411.express_express.merge.HIST.r7510.f810.ref.root
+  path = run_281411
+  name = same_name
+}
+
+####################
+# Thresholds
+####################
+thresholds egKolmogorovThr {
+    limits MaxDist {
+        warning = 0.05
+        error = 0.15
+    }
+}
+
+thresholds egamma_BinsDiffFromStripMedian_threshold {
+  limits MaxDeviation {
+    warning = 25
+    error = 200
+  }
+}
+
+thresholds egamma_FitZmass_Thresholds {
+ limits Sigma {
+  warning = 4000.0
+  error = 10000.0
+ }
+}
+
+thresholds egamma_FitJPsimass_Thresholds {
+ limits Sigma {
+  warning = 4000.0
+  error = 10000.0
+ }
+}
+
+
+####################
+# Common Algorithms
+####################
+
+algorithm egamma_BinsDiffFromStripMedian {
+  libname = libdqm_algorithms.so
+  SuppressFactor = 0
+  name = BinsDiffFromStripMedian
+  thresholds = egamma_BinsDiffFromStripMedian_threshold
+}
+
+algorithm egKolmogorov {
+  libname = libdqm_algorithms.so
+  name = KolmogorovTest_MaxDist
+#  reference = EgammaReference	
+#  reference = CentrallyManagedReferences_Egamma
+  reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
+  thresholds = egKolmogorovThr
+  MinStat = 20
+}
+
+algorithm egKolmogorovProb {
+  libname = libdqm_algorithms.so
+  name = KolmogorovTest_Prob
+#  reference = EgammaReference	
+#  reference = CentrallyManagedReferences_Egamma
+  reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
+  thresholds = egKolmogorovThr
+  MinStat = 20
+}
+
+algorithm egamma_GatherData {
+  libname = libdqm_algorithms.so
+  name = GatherData
+}
+
+algorithm egamma_Histogram_Not_Empty {
+  libname = libdqm_algorithms.so
+  name = Histogram_Not_Empty
+#  reference = EgammaReference	
+  reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
+  MinStat = 20
+}
+
+algorithm 2D_Histogram_Not_Empty {
+  libname = libdqm_algorithms.so
+  name = Histogram_Not_Empty
+  MinStat = 10
+#  reference = EgammaReference	
+  reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
+}
+
+
+algorithm egamma_FitZmass {
+  libname = libdqm_algorithms.so
+  name = Simple_gaus_Fit
+  xmin = 80000.
+  xmax = 100000. 
+  thresholds = egamma_FitZmass_Thresholds
+}
+
+algorithm egamma_FitJPsimass {
+  libname = libdqm_algorithms.so
+  name = Simple_gaus_Fit
+  xmin = 3000.
+  xmax = 5000. 
+  thresholds = egamma_FitJPsimass_Thresholds
+}
+
+#############
+# Output
+#############
+
+output top_level {
+  algorithm = WorstCaseSummary
+  output egamma {
+   algorithm = WorstCaseSummary
+   output photons { 
+    algorithm = WorstCaseSummary
+    output EXPERT { 
+    algorithm = WorstCaseSummary
+    }
+    output ID {
+    algorithm = WorstCaseSummary
+    }
+    output LBMon {
+    algorithm = WorstCaseSummary
+    }
+   }
+   output photonsWithTrigger { 
+    algorithm = WorstCaseSummary
+    output EXPERT { 
+    algorithm = WorstCaseSummary
+    }
+    output ID {
+    algorithm = WorstCaseSummary
+    }
+    output LBMon {
+    algorithm = WorstCaseSummary
+    }
+   }
+   output electrons {
+    algorithm = WorstCaseSummary
+    output EXPERT {
+    algorithm = WorstCaseSummary  
+    }
+    output ID {
+    algorithm = WorstCaseSummary
+    }
+    output Track {
+    algorithm = WorstCaseSummary
+    }
+    output LBMon {
+    algorithm = WorstCaseSummary
+    }
+   }
+   output electronsWithTrigger {
+    algorithm = WorstCaseSummary
+    output EXPERT {
+    algorithm = WorstCaseSummary  
+    }
+    output ID {
+    algorithm = WorstCaseSummary
+    }
+    output Track {
+    algorithm = WorstCaseSummary
+    }
+    output LBMon {
+    algorithm = WorstCaseSummary
+    }
+   }
+   output forwardElectrons {
+    algorithm = WorstCaseSummary
+    output ID {
+    algorithm = WorstCaseSummary
+    }
+    output EXPERT {
+    algorithm = WorstCaseSummary
+    }
+   }
+   output tagandprobeZ {
+    algorithm = WorstCaseSummary
+    output ID {
+    algorithm = WorstCaseSummary  
+    }
+    output Track {
+    algorithm = WorstCaseSummary
+    }
+    output LBMon {
+    algorithm = WorstCaseSummary
+    }
+   }
+   output tagandprobeJPsi {
+    algorithm = WorstCaseSummary
+    output ID {
+    algorithm = WorstCaseSummary  
+    }
+    output Track {
+    algorithm = WorstCaseSummary
+    }
+    output LBMon {
+    algorithm = WorstCaseSummary
+    }
+   }
+ }
+}
+
+#######################
+# Histogram Assessments
+#######################
+
+ dir egamma/electrons {
+      output = egamma/electrons
+
+      # CbLoose
+      hist electronNCbLoose {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist electronEtCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPhiCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPtCone20CbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTopoEtCone40CbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTimeCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+
+      # CbTight
+      hist electronNCbTight {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist electronEtCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPhiCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPtCone20CbTight {
+       algorithm = egKolmogorov
+      } 
+      hist electronTopoEtCone40CbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTimeCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+
+      # LhLoose
+      hist electronNLhLoose {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist electronEtLhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPhiLhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaLhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaPhiPtgt2.5GeVLhLoose {
+       output = egamma/electrons/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt4GeVLhLoose {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt20GeVLhLoose {
+       output = egamma/electrons/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
+      hist electronPtCone20LhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTopoEtCone40LhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTimeLhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronNLhLoose_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      } 
+      hist electronEtLhLoose_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaLhLoose_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhLoose_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhLoose_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhLoose_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhLoose_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhLoose_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhLoose_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhLoose_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhLoose_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }      
+      hist electronPtCone20LhLoose_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhLoose_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhLoose_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhLoose_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhLoose_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhLoose_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhLoose_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaPhiPtgt2.5GeVLhLoose {
+       output = egamma/electrons/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt4GeVLhLoose {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt20GeVLhLoose {
+       output = egamma/electrons/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronPtCone20LhLoose_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhLoose_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhLoose_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+
+      # LhMedium
+      hist electronNLhMedium {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist electronEtLhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPhiLhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaLhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaPhiPtgt2.5GeVLhMedium {
+       output = egamma/electrons/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+      #  algorithm = egamma_BinsDiffFromStripMedian
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt4GeVLhMedium {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt20GeVLhMedium {
+       output = egamma/electrons/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
+      hist electronPtCone20LhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTopoEtCone40LhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTimeLhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronNLhMedium_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      } 
+      hist electronEtLhMedium_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaLhMedium_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhMedium_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhMedium_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhMedium_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhMedium_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhMedium_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhMedium_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhMedium_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhMedium_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }      
+      hist electronPtCone20LhMedium_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhMedium_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhMedium_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhMedium_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhMedium_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhMedium_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhMedium_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhMedium_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhMedium_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhMedium_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+
+      # LhTight
+      hist electronNLhTight {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist electronEtLhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaPhiPtgt2.5GeVLhTight {
+       output = egamma/electrons/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt4GeVLhTight {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt20GeVLhTight {
+       output = egamma/electrons/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
+      hist electronPtCone20LhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhTight_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhTight_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhTight_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhTight_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhTight_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhTight_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhTight_BARREL {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhTight_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhTight_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhTight_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhTight_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }      
+      hist electronPtCone20LhTight_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhTight_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhTight_CRACK {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhTight_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtLhTight_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhTight_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhTight_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhTight_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhTight_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhTight_ENDCAP {
+       output = egamma/electrons/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+}
+
+ dir egamma/electrons/ID {
+     algorithm = egKolmogorov
+     output = egamma/electrons/ID
+     display = Draw=e1,StatBox
+
+     # LhLoose
+      hist electronEhad1LhLoose_BARREL {
+      }
+      hist electronEoverPLhLoose_BARREL {
+      }
+      hist electronCoreEMLhLoose_BARREL {
+      }
+      hist electronF0LhLoose_BARREL {
+      }
+      hist electronF1LhLoose_BARREL {
+      }
+      hist electronF2LhLoose_BARREL {
+      }
+      hist electronF3LhLoose_BARREL {
+      }
+      hist electronRe233e237LhLoose_BARREL {
+      }
+      hist electronRe237e277LhLoose_BARREL {
+      }
+      hist electronEhad1LhLoose_CRACK {
+      }
+      hist electronEoverPLhLoose_CRACK {
+      }
+      hist electronCoreEMLhLoose_CRACK {
+      }
+      hist electronF0LhLoose_CRACK {
+      }
+      hist electronF1LhLoose_CRACK {
+      }
+      hist electronF2LhLoose_CRACK {
+      }
+      hist electronF3LhLoose_CRACK {
+      }
+      hist electronRe233e237LhLoose_CRACK {
+      }
+      hist electronRe237e277LhLoose_CRACK {
+      }
+      hist electronEhad1LhLoose_ENDCAP {
+      }
+      hist electronEoverPLhLoose_ENDCAP {
+      }
+      hist electronCoreEMLhLoose_ENDCAP {
+      }
+      hist electronF0LhLoose_ENDCAP {
+      }
+      hist electronF1LhLoose_ENDCAP {
+      }
+      hist electronF2LhLoose_ENDCAP {
+      }
+      hist electronF3LhLoose_ENDCAP {
+      }
+      hist electronRe233e237LhLoose_ENDCAP {
+      }
+      hist electronRe237e277LhLoose_ENDCAP {
+      }
+
+     # LhMedium
+      hist electronEhad1LhMedium_BARREL {
+      }
+      hist electronEoverPLhMedium_BARREL {
+      }
+      hist electronCoreEMLhMedium_BARREL {
+      }
+      hist electronF0LhMedium_BARREL {
+      }
+      hist electronF1LhMedium_BARREL {
+      }
+      hist electronF2LhMedium_BARREL {
+      }
+      hist electronF3LhMedium_BARREL {
+      }
+      hist electronRe233e237LhMedium_BARREL {
+      }
+      hist electronRe237e277LhMedium_BARREL {
+      }
+      hist electronEhad1LhMedium_CRACK {
+      }
+      hist electronEoverPLhMedium_CRACK {
+      }
+      hist electronCoreEMLhMedium_CRACK {
+      }
+      hist electronF0LhMedium_CRACK {
+      }
+      hist electronF1LhMedium_CRACK {
+      }
+      hist electronF2LhMedium_CRACK {
+      }
+      hist electronF3LhMedium_CRACK {
+      }
+      hist electronRe233e237LhMedium_CRACK {
+      }
+      hist electronRe237e277LhMedium_CRACK {
+      }
+      hist electronEhad1LhMedium_ENDCAP {
+      }
+      hist electronEoverPLhMedium_ENDCAP {
+      }
+      hist electronCoreEMLhMedium_ENDCAP {
+      }
+      hist electronF0LhMedium_ENDCAP {
+      }
+      hist electronF1LhMedium_ENDCAP {
+      }
+      hist electronF2LhMedium_ENDCAP {
+      }
+      hist electronF3LhMedium_ENDCAP {
+      }
+      hist electronRe233e237LhMedium_ENDCAP {
+      }
+      hist electronRe237e277LhMedium_ENDCAP {
+      }
+
+     # LhTight
+      hist electronEhad1LhTight_BARREL {
+      }
+      hist electronEoverPLhTight_BARREL {
+      }
+      hist electronCoreEMLhTight_BARREL {
+      }
+      hist electronF0LhTight_BARREL {
+      }
+      hist electronF1LhTight_BARREL {
+      }
+      hist electronF2LhTight_BARREL {
+      }
+      hist electronF3LhTight_BARREL {
+      }
+      hist electronRe233e237LhTight_BARREL {
+      }
+      hist electronRe237e277LhTight_BARREL {
+      }
+      hist electronEhad1LhTight_CRACK {
+      }
+      hist electronEoverPLhTight_CRACK {
+      }
+      hist electronCoreEMLhTight_CRACK {
+      }
+      hist electronF0LhTight_CRACK {
+      }
+      hist electronF1LhTight_CRACK {
+      }
+      hist electronF2LhTight_CRACK {
+      }
+      hist electronF3LhTight_CRACK {
+      }
+      hist electronRe233e237LhTight_CRACK {
+      }
+      hist electronRe237e277LhTight_CRACK {
+      }
+      hist electronEhad1LhTight_ENDCAP {
+      }
+      hist electronEoverPLhTight_ENDCAP {
+      }
+      hist electronCoreEMLhTight_ENDCAP {
+      }
+      hist electronF0LhTight_ENDCAP {
+      }
+      hist electronF1LhTight_ENDCAP {
+      }
+      hist electronF2LhTight_ENDCAP {
+      }
+      hist electronF3LhTight_ENDCAP {
+      }
+      hist electronRe233e237LhTight_ENDCAP {
+      }
+      hist electronRe237e277LhTight_ENDCAP {
+      }
+}
+
+ dir egamma/electrons/Track {
+     algorithm = egKolmogorov
+     output = egamma/electrons/Track
+     display = Draw=e1,StatBox
+
+     # LhLoose
+      hist electronNOfBLayersHitsLhLoose_BARREL {
+      }
+      hist electronNOfTRTHitsLhLoose_BARREL {
+      }
+      hist electronNOfSiHitsLhLoose_BARREL {
+      }
+      hist electronDeltaEta1LhLoose_BARREL {
+      }
+      hist electronDeltaPhi2LhLoose_BARREL {
+      }
+      hist electronDeltaEta1LhLoose_CRACK {
+      }
+      hist electronDeltaPhi2LhLoose_CRACK {
+      }
+      hist electronNOfBLayersHitsLhLoose_CRACK {
+      }
+      hist electronNOfTRTHitsLhLoose_CRACK {
+      }
+      hist electronNOfSiHitsLhLoose_CRACK {
+      }
+      hist electronDeltaEta1LhLoose_ENDCAP {
+      }
+      hist electronDeltaPhi2LhLoose_ENDCAP {
+      }
+      hist electronNOfBLayersHitsLhLoose_ENDCAP {
+      }
+      hist electronNOfTRTHitsLhLoose_ENDCAP {
+      }
+      hist electronNOfSiHitsLhLoose_ENDCAP {
+      }
+
+     # LhMedium
+      hist electronNOfBLayersHitsLhMedium_BARREL {
+      }
+      hist electronNOfTRTHitsLhMedium_BARREL {
+      }
+      hist electronNOfSiHitsLhMedium_BARREL {
+      }
+      hist electronDeltaEta1LhMedium_BARREL {
+      }
+      hist electronDeltaPhi2LhMedium_BARREL {
+      }
+      hist electronDeltaEta1LhMedium_CRACK {
+      }
+      hist electronDeltaPhi2LhMedium_CRACK {
+      }
+      hist electronNOfBLayersHitsLhMedium_CRACK {
+      }
+      hist electronNOfTRTHitsLhMedium_CRACK {
+      }
+      hist electronNOfSiHitsLhMedium_CRACK {
+      }
+      hist electronDeltaEta1LhMedium_ENDCAP {
+      }
+      hist electronDeltaPhi2LhMedium_ENDCAP {
+      }
+      hist electronNOfBLayersHitsLhMedium_ENDCAP {
+      }
+      hist electronNOfTRTHitsLhMedium_ENDCAP {
+      }
+      hist electronNOfSiHitsLhMedium_ENDCAP {
+      }
+
+     # LhTight
+      hist electronNOfBLayersHitsLhTight_BARREL {
+      }
+      hist electronNOfTRTHitsLhTight_BARREL {
+      }
+      hist electronNOfSiHitsLhTight_BARREL {
+      }
+      hist electronDeltaEta1LhTight_BARREL {
+      }
+      hist electronDeltaPhi2LhTight_BARREL {
+      }
+      hist electronDeltaEta1LhTight_CRACK {
+      }
+      hist electronDeltaPhi2LhTight_CRACK {
+      }
+      hist electronNOfBLayersHitsLhTight_CRACK {
+      }
+      hist electronNOfTRTHitsLhTight_CRACK {
+      }
+      hist electronNOfSiHitsLhTight_CRACK {
+      }
+      hist electronDeltaEta1LhTight_ENDCAP {
+      }
+      hist electronDeltaPhi2LhTight_ENDCAP {
+      }
+      hist electronNOfBLayersHitsLhTight_ENDCAP {
+      }
+      hist electronNOfTRTHitsLhTight_ENDCAP {
+      }
+      hist electronNOfSiHitsLhTight_ENDCAP {
+      }
+ }
+
+ dir egamma/electrons/LBMon {
+     algorithm = egamma_GatherData
+     output = egamma/electrons/LBMon
+     display = Draw=e1,StatBox
+      # LhLoose
+      hist LBEvoNElectronsLhLoose {
+      }
+      # LhMedium
+      hist LBEvoNElectronsLhMedium {
+      }
+      # LhTight
+      hist LBEvoNElectronsLhTight {
+      }
+      # CbLoose
+      hist LBEvoNElectronsCbLoose {
+      }
+      # CbTight
+      hist LBEvoNElectronsCbTight {
+      }
+}
+
+### electronsWithTrigger
+
+ dir egamma/electronsWithTrigger {
+      output = egamma/electronsWithTrigger
+
+      # CbLoose
+      hist electronNCbLoose {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist electronEtCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPhiCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPtCone20CbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTopoEtCone40CbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTimeCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaPhiPtgt2.5GeVCbLoose {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt4GeVCbLoose {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt20GeVCbLoose {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
+
+      # CbTight
+      hist electronNCbTight {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist electronEtCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPhiCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaPhiPtgt2.5GeVCbTight {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt4GeVCbTight {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt20GeVCbTight {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
+      hist electronPtCone20CbTight {
+       algorithm = egKolmogorov
+      } 
+      hist electronTopoEtCone40CbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTimeCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+
+      # LhLoose
+      hist electronNLhLoose {
+       algorithm = egamma_Histogram_Not_Empty
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox,LogY
+      }
+      hist electronEtLhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPhiLhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaLhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaPhiPtgt2.5GeVLhLoose {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+#       algorithm = egamma_BinsDiffFromStripMedian
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt4GeVLhLoose {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt20GeVLhLoose {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+
+      hist electronPtCone20LhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTopoEtCone40LhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTimeLhLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronNLhLoose_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      } 
+      hist electronEtLhLoose_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaLhLoose_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhLoose_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhLoose_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhLoose_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhLoose_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhLoose_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhLoose_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhLoose_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhLoose_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }      
+      hist electronPtCone20LhLoose_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhLoose_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhLoose_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhLoose_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhLoose_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhLoose_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhLoose_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhLoose_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhLoose_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhLoose_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+
+      # LhMedium
+      hist electronNLhMedium {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist electronEtLhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronPhiLhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaLhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaPhiPtgt2.5GeVLhMedium {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt4GeVLhMedium {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt20GeVLhMedium {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
+      hist electronPtCone20LhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTopoEtCone40LhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronTimeLhMedium {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronNLhMedium_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      } 
+      hist electronEtLhMedium_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      } 
+      hist electronEtaLhMedium_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhMedium_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhMedium_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhMedium_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhMedium_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhMedium_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhMedium_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhMedium_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhMedium_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }      
+      hist electronPtCone20LhMedium_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhMedium_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhMedium_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhMedium_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhMedium_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhMedium_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhMedium_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhMedium_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhMedium_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhMedium_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+
+      # LhTight
+      hist electronNLhTight {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist electronEtLhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaPhiPtgt2.5GeVLhTight {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt4GeVLhTight {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist electronEtaPhiPtgt20GeVLhTight {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
+      hist electronPtCone20LhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhTight {
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhTight_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhTight_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhTight_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhTight_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhTight_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhTight_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhTight_BARREL {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhTight_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox, LogY
+      }
+      hist electronEtLhTight_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhTight_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhTight_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }      
+      hist electronPtCone20LhTight_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhTight_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhTight_CRACK {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronNLhTight_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtLhTight_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronEtaLhTight_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPhiLhTight_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronPtCone20LhTight_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTopoEtCone40LhTight_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+      hist electronTimeLhTight_ENDCAP {
+       output = egamma/electronsWithTrigger/EXPERT
+       algorithm = egKolmogorov
+       display = Draw=e1, DrawRef=HIST, StatBox
+      }
+}
+
+ dir egamma/electronsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/ID
+     display = Draw=e1,StatBox
+
+     # LhLoose
+      hist electronEhad1LhLoose_BARREL {
+      }
+      hist electronEoverPLhLoose_BARREL {
+      }
+      hist electronCoreEMLhLoose_BARREL {
+      }
+      hist electronF0LhLoose_BARREL {
+      }
+      hist electronF1LhLoose_BARREL {
+      }
+      hist electronF2LhLoose_BARREL {
+      }
+      hist electronF3LhLoose_BARREL {
+      }
+      hist electronRe233e237LhLoose_BARREL {
+      }
+      hist electronRe237e277LhLoose_BARREL {
+      }
+      hist electronEhad1LhLoose_CRACK {
+      }
+      hist electronEoverPLhLoose_CRACK {
+      }
+      hist electronCoreEMLhLoose_CRACK {
+      }
+      hist electronF0LhLoose_CRACK {
+      }
+      hist electronF1LhLoose_CRACK {
+      }
+      hist electronF2LhLoose_CRACK {
+      }
+      hist electronF3LhLoose_CRACK {
+      }
+      hist electronRe233e237LhLoose_CRACK {
+      }
+      hist electronRe237e277LhLoose_CRACK {
+      }
+      hist electronEhad1LhLoose_ENDCAP {
+      }
+      hist electronEoverPLhLoose_ENDCAP {
+      }
+      hist electronCoreEMLhLoose_ENDCAP {
+      }
+      hist electronF0LhLoose_ENDCAP {
+      }
+      hist electronF1LhLoose_ENDCAP {
+      }
+      hist electronF2LhLoose_ENDCAP {
+      }
+      hist electronF3LhLoose_ENDCAP {
+      }
+      hist electronRe233e237LhLoose_ENDCAP {
+      }
+      hist electronRe237e277LhLoose_ENDCAP {
+      }
+
+     # LhMedium
+      hist electronEhad1LhMedium_BARREL {
+      }
+      hist electronEoverPLhMedium_BARREL {
+      }
+      hist electronCoreEMLhMedium_BARREL {
+      }
+      hist electronF0LhMedium_BARREL {
+      }
+      hist electronF1LhMedium_BARREL {
+      }
+      hist electronF2LhMedium_BARREL {
+      }
+      hist electronF3LhMedium_BARREL {
+      }
+      hist electronRe233e237LhMedium_BARREL {
+      }
+      hist electronRe237e277LhMedium_BARREL {
+      }
+      hist electronEhad1LhMedium_CRACK {
+      }
+      hist electronEoverPLhMedium_CRACK {
+      }
+      hist electronCoreEMLhMedium_CRACK {
+      }
+      hist electronF0LhMedium_CRACK {
+      }
+      hist electronF1LhMedium_CRACK {
+      }
+      hist electronF2LhMedium_CRACK {
+      }
+      hist electronF3LhMedium_CRACK {
+      }
+      hist electronRe233e237LhMedium_CRACK {
+      }
+      hist electronRe237e277LhMedium_CRACK {
+      }
+      hist electronEhad1LhMedium_ENDCAP {
+      }
+      hist electronEoverPLhMedium_ENDCAP {
+      }
+      hist electronCoreEMLhMedium_ENDCAP {
+      }
+      hist electronF0LhMedium_ENDCAP {
+      }
+      hist electronF1LhMedium_ENDCAP {
+      }
+      hist electronF2LhMedium_ENDCAP {
+      }
+      hist electronF3LhMedium_ENDCAP {
+      }
+      hist electronRe233e237LhMedium_ENDCAP {
+      }
+      hist electronRe237e277LhMedium_ENDCAP {
+      }
+
+     # LhTight
+      hist electronEhad1LhTight_BARREL {
+      }
+      hist electronEoverPLhTight_BARREL {
+      }
+      hist electronCoreEMLhTight_BARREL {
+      }
+      hist electronF0LhTight_BARREL {
+      }
+      hist electronF1LhTight_BARREL {
+      }
+      hist electronF2LhTight_BARREL {
+      }
+      hist electronF3LhTight_BARREL {
+      }
+      hist electronRe233e237LhTight_BARREL {
+      }
+      hist electronRe237e277LhTight_BARREL {
+      }
+      hist electronEhad1LhTight_CRACK {
+      }
+      hist electronEoverPLhTight_CRACK {
+      }
+      hist electronCoreEMLhTight_CRACK {
+      }
+      hist electronF0LhTight_CRACK {
+      }
+      hist electronF1LhTight_CRACK {
+      }
+      hist electronF2LhTight_CRACK {
+      }
+      hist electronF3LhTight_CRACK {
+      }
+      hist electronRe233e237LhTight_CRACK {
+      }
+      hist electronRe237e277LhTight_CRACK {
+      }
+      hist electronEhad1LhTight_ENDCAP {
+      }
+      hist electronEoverPLhTight_ENDCAP {
+      }
+      hist electronCoreEMLhTight_ENDCAP {
+      }
+      hist electronF0LhTight_ENDCAP {
+      }
+      hist electronF1LhTight_ENDCAP {
+      }
+      hist electronF2LhTight_ENDCAP {
+      }
+      hist electronF3LhTight_ENDCAP {
+      }
+      hist electronRe233e237LhTight_ENDCAP {
+      }
+      hist electronRe237e277LhTight_ENDCAP {
+      }
+}
+
+ dir egamma/electronsWithTrigger/Track {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/Track
+     display = Draw=e1,StatBox
+
+     # LhLoose
+      hist electronNOfBLayersHitsLhLoose_BARREL {
+      }
+      hist electronNOfTRTHitsLhLoose_BARREL {
+      }
+      hist electronNOfSiHitsLhLoose_BARREL {
+      }
+      hist electronDeltaEta1LhLoose_BARREL {
+      }
+      hist electronDeltaPhi2LhLoose_BARREL {
+      }
+      hist electronDeltaEta1LhLoose_CRACK {
+      }
+      hist electronDeltaPhi2LhLoose_CRACK {
+      }
+      hist electronNOfBLayersHitsLhLoose_CRACK {
+      }
+      hist electronNOfTRTHitsLhLoose_CRACK {
+      }
+      hist electronNOfSiHitsLhLoose_CRACK {
+      }
+      hist electronDeltaEta1LhLoose_ENDCAP {
+      }
+      hist electronDeltaPhi2LhLoose_ENDCAP {
+      }
+      hist electronNOfBLayersHitsLhLoose_ENDCAP {
+      }
+      hist electronNOfTRTHitsLhLoose_ENDCAP {
+      }
+      hist electronNOfSiHitsLhLoose_ENDCAP {
+      }
+
+     # LhMedium
+      hist electronNOfBLayersHitsLhMedium_BARREL {
+      }
+      hist electronNOfTRTHitsLhMedium_BARREL {
+      }
+      hist electronNOfSiHitsLhMedium_BARREL {
+      }
+      hist electronDeltaEta1LhMedium_BARREL {
+      }
+      hist electronDeltaPhi2LhMedium_BARREL {
+      }
+      hist electronDeltaEta1LhMedium_CRACK {
+      }
+      hist electronDeltaPhi2LhMedium_CRACK {
+      }
+      hist electronNOfBLayersHitsLhMedium_CRACK {
+      }
+      hist electronNOfTRTHitsLhMedium_CRACK {
+      }
+      hist electronNOfSiHitsLhMedium_CRACK {
+      }
+      hist electronDeltaEta1LhMedium_ENDCAP {
+      }
+      hist electronDeltaPhi2LhMedium_ENDCAP {
+      }
+      hist electronNOfBLayersHitsLhMedium_ENDCAP {
+      }
+      hist electronNOfTRTHitsLhMedium_ENDCAP {
+      }
+      hist electronNOfSiHitsLhMedium_ENDCAP {
+      }
+
+     # LhTight
+      hist electronNOfBLayersHitsLhTight_BARREL {
+      }
+      hist electronNOfTRTHitsLhTight_BARREL {
+      }
+      hist electronNOfSiHitsLhTight_BARREL {
+      }
+      hist electronDeltaEta1LhTight_BARREL {
+      }
+      hist electronDeltaPhi2LhTight_BARREL {
+      }
+      hist electronDeltaEta1LhTight_CRACK {
+      }
+      hist electronDeltaPhi2LhTight_CRACK {
+      }
+      hist electronNOfBLayersHitsLhTight_CRACK {
+      }
+      hist electronNOfTRTHitsLhTight_CRACK {
+      }
+      hist electronNOfSiHitsLhTight_CRACK {
+      }
+      hist electronDeltaEta1LhTight_ENDCAP {
+      }
+      hist electronDeltaPhi2LhTight_ENDCAP {
+      }
+      hist electronNOfBLayersHitsLhTight_ENDCAP {
+      }
+      hist electronNOfTRTHitsLhTight_ENDCAP {
+      }
+      hist electronNOfSiHitsLhTight_ENDCAP {
+      }
+ }
+
+ dir egamma/electronsWithTrigger/LBMon {
+     algorithm = egamma_GatherData
+     output = egamma/electronsWithTrigger/LBMon
+     display = Draw=e1,StatBox
+      # LhLoose
+      hist LBEvoNElectronsLhLoose {
+      }
+      # LhMedium
+      hist LBEvoNElectronsLhMedium {
+      }
+      # LhTight
+      hist LBEvoNElectronsLhTight {
+      }
+      # CbLoose
+      hist LBEvoNElectronsCbLoose {
+      }
+      # CbTight
+      hist LBEvoNElectronsCbTight {
+      }
+}
+
+
+### photons
+
+
+ dir egamma/photons {
+     output = egamma/photons
+
+      # CbLoose
+      hist photonNCbLoose {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonPhiCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonEtaPhiPt2.5GeVCbLoose {
+       algorithm = egamma_BinsDiffFromStripMedian
+      }
+      hist photonEtaPhiPtgt4GeVCbLoose {
+       algorithm = egamma_BinsDiffFromStripMedian
+      }
+      hist photonEtaPhiPtgt20GeVCbLoose {
+       algorithm = egamma_BinsDiffFromStripMedian
+      }
+      hist photonPtCone20CbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonTopoEtCone40CbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonTimeCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonRconvCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+
+      # CbTight
+      hist photonNCbTight {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonPhiCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonEtaPhiPt2.5GeVCbTight {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist photonEtaPhiPtgt4GeVCbTight {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist photonEtaPhiPtgt20GeVCbTight {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist photonPtCone20CbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonTopoEtCone40CbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonTimeCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonRconvCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+}
+
+ dir egamma/photons/Region {
+      algorithm = egKolmogorov
+      output = egamma/photons/EXPERT
+      display = Draw=e1,StatBox
+
+      # CbLoose
+      hist photonNCbLoose_BARREL {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbLoose_BARREL {
+      }
+      hist photonEtaCbLoose_BARREL {
+      }
+      hist photonPhiCbLoose_BARREL {
+      }
+      hist photonPtCone20CbLoose_BARREL {
+      }
+      hist photonTopoEtCone40CbLoose_BARREL {
+      }
+      hist photonNCbLoose_CRACK {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbLoose_CRACK {
+      }
+      hist photonEtaCbLoose_CRACK {
+      }
+      hist photonPhiCbLoose_CRACK {
+      }
+      hist photonPtCone20CbLoose_CRACK {
+      }
+      hist photonTopoEtCone40CbLoose_CRACK {
+      }
+      hist photonNCbLoose_ENDCAP {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbLoose_ENDCAP {
+      }
+      hist photonEtaCbLoose_ENDCAP {
+      }
+      hist photonPhiCbLoose_ENDCAP {
+      }
+      hist photonPtCone20CbLoose_ENDCAP {
+      }
+      hist photonTopoEtCone40CbLoose_ENDCAP {
+      }
+
+      # CbTight
+      hist photonNCbTight_BARREL {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbTight_BARREL {
+      }
+      hist photonEtaCbTight_BARREL {
+      }
+      hist photonPhiCbTight_BARREL {
+      }
+      hist photonPtCone20CbTight_BARREL {
+      }
+      hist photonTopoEtCone40CbTight_BARREL {
+      }
+      hist photonNCbTight_CRACK {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbTight_CRACK {
+      }
+      hist photonEtaCbTight_CRACK {
+      }
+      hist photonPhiCbTight_CRACK {
+      }
+      hist photonPtCone20CbTight_CRACK {
+      }
+      hist photonTopoEtCone40CbTight_CRACK {
+      }
+      hist photonNCbTight_ENDCAP {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbTight_ENDCAP {
+      }
+      hist photonEtaCbTight_ENDCAP {
+      }
+      hist photonPhiCbTight_ENDCAP {
+      }
+      hist photonPtCone20CbTight_ENDCAP {
+      }
+      hist photonTopoEtCone40CbTight_ENDCAP {
+      }
+}
+
+ dir egamma/photons/Unconv {
+     algorithm = egKolmogorov
+     output = egamma/photons
+     display = Draw=e1,StatBox
+
+     #CbLoose
+     hist photonNUnconvCbLoose {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+     hist photonEtUnconvCbLoose {
+     }
+     hist photonEtaUnconvCbLoose {
+     }
+     hist photonPhiUnconvCbLoose {
+     }
+     hist photonEtaPhiUnconvCbLoose {
+      algorithm = egamma_BinsDiffFromStripMedian
+     }
+     hist photonTopoEtCone40UnconvCbLoose {
+     }
+     hist photonPtCone20UnconvCbLoose {
+     }
+
+     #CbTight
+     hist photonNUnconvCbTight {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+     hist photonEtUnconvCbTight {
+     }
+     hist photonEtaUnconvCbTight {
+     }
+     hist photonPhiUnconvCbTight {
+     }
+     hist photonEtaPhiUnconvCbTight {
+      algorithm = egamma_BinsDiffFromStripMedian
+     }
+     hist photonTopoEtCone40UnconvCbTight {
+     }
+     hist photonPtCone20UnconvCbTight {
+     }
+
+}
+
+
+ dir egamma/photons/Conv {
+     algorithm = egKolmogorov
+     output = egamma/photons
+     display = Draw=e1,StatBox
+
+     #CbLoose
+     hist photonNConvCbLoose {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+     hist photonEtConvCbLoose {
+     }
+     hist photonEtaConvCbLoose {
+     }
+     hist photonPhiConvCbLoose {
+     }
+     hist photonEtaPhiConvCbLoose {
+      algorithm = egamma_BinsDiffFromStripMedian
+     }
+     hist photonTopoEtCone40ConvCbLoose {
+     }
+     hist photonPtCone20ConvCbLoose {
+     }
+     #CbTight
+     hist photonNConvCbTight {
+     }
+     hist photonEtConvCbTight {
+     }
+     hist photonEtaConvCbTight {
+     }
+     hist photonPhiConvCbTight {
+     }
+     hist photonEtaPhiConvCbTight {
+      algorithm = egamma_BinsDiffFromStripMedian
+     }
+     hist photonTopoEtCone40ConvCbTight {
+     }
+     hist photonPtCone20ConvCbTight {
+     }
+}
+
+ dir egamma/photons/ID {
+     algorithm = egKolmogorov
+     output = egamma/photons/ID
+     display = Draw=e1,StatBox
+
+      #CbLoose
+      hist photonEhad1CbLoose_BARREL {
+      }
+      hist photonCoreEMCbLoose_BARREL {
+      }
+      hist photonF0CbLoose_BARREL {
+      }
+      hist photonF1CbLoose_BARREL {
+      }
+      hist photonF2CbLoose_BARREL {
+      }
+      hist photonF3CbLoose_BARREL {
+      }
+      hist photonRe233e237CbLoose_BARREL {
+      }
+      hist photonRe237e277CbLoose_BARREL {
+      }
+      hist photonEhad1CbLoose_CRACK {
+      }
+      hist photonCoreEMCbLoose_CRACK {
+      }
+      hist photonF0CbLoose_CRACK {
+      }
+      hist photonF1CbLoose_CRACK {
+      }
+      hist photonF2CbLoose_CRACK {
+      }
+      hist photonF3CbLoose_CRACK {
+      }
+      hist photonRe233e237CbLoose_CRACK {
+      }
+      hist photonRe237e277CbLoose_CRACK {
+      }
+      hist photonEhad1CbLoose_ENDCAP {
+      }
+      hist photonCoreEMCbLoose_ENDCAP {
+      }
+      hist photonF0CbLoose_ENDCAP {
+      }
+      hist photonF1CbLoose_ENDCAP {
+      }
+      hist photonF2CbLoose_ENDCAP {
+      }
+      hist photonF3CbLoose_ENDCAP {
+      }
+      hist photonRe233e237CbLoose_ENDCAP {
+      }
+      hist photonRe237e277CbLoose_ENDCAP {
+      }
+      #CbTight
+      hist photonEhad1CbTight_BARREL {
+      }
+      hist photonCoreEMCbTight_BARREL {
+      }
+      hist photonF0CbTight_BARREL {
+      }
+      hist photonF1CbTight_BARREL {
+      }
+      hist photonF2CbTight_BARREL {
+      }
+      hist photonF3CbTight_BARREL {
+      }
+      hist photonRe233e237CbTight_BARREL {
+      }
+      hist photonRe237e277CbTight_BARREL {
+      }
+      hist photonEhad1CbTight_CRACK {
+      }
+      hist photonCoreEMCbTight_CRACK {
+      }
+      hist photonF0CbTight_CRACK {
+      }
+      hist photonF1CbTight_CRACK {
+      }
+      hist photonF2CbTight_CRACK {
+      }
+      hist photonF3CbTight_CRACK {
+      }
+      hist photonRe233e237CbTight_CRACK {
+      }
+      hist photonRe237e277CbTight_CRACK {
+      }
+      hist photonEhad1CbTight_ENDCAP {
+      }
+      hist photonCoreEMCbTight_ENDCAP {
+      }
+      hist photonF0CbTight_ENDCAP {
+      }
+      hist photonF1CbTight_ENDCAP {
+      }
+      hist photonF2CbTight_ENDCAP {
+      }
+      hist photonF3CbTight_ENDCAP {
+      }
+      hist photonRe233e237CbTight_ENDCAP {
+      }
+      hist photonRe237e277CbTight_ENDCAP {
+      }
+}
+
+ dir egamma/photons/Region {
+     algorithm = egKolmogorov
+     output = egamma/photons/EXPERT
+     display = Draw=e1,StatBox
+
+      # CbLoose
+      hist photonConvTrkMatch1CbLoose_BARREL {
+      }
+      hist photonConvTrkMatch2CbLoose_BARREL {
+      }
+      hist photonConvTypeCbLoose_BARREL {
+      }
+      hist photonConvTrkMatch1CbLoose_CRACK {
+      }
+      hist photonConvTrkMatch2CbLoose_CRACK {
+      }
+      hist photonConvTypeCbLoose_CRACK {
+      }
+      hist photonConvTrkMatch1CbLoose_ENDCAP {
+      }
+      hist photonConvTrkMatch2CbLoose_ENDCAP {
+      }
+      hist photonConvTypeCbLoose_ENDCAP {
+      }
+      # CbTight
+      hist photonConvTrkMatch1CbTight_BARREL {
+      }
+      hist photonConvTrkMatch2CbTight_BARREL {
+      }
+      hist photonConvTypeCbTight_BARREL {
+      }
+      hist photonConvTrkMatch1CbTight_CRACK {
+      }
+      hist photonConvTrkMatch2CbTight_CRACK {
+      }
+      hist photonConvTypeCbTight_CRACK {
+      }
+      hist photonConvTrkMatch1CbTight_ENDCAP {
+      }
+      hist photonConvTrkMatch2CbTight_ENDCAP {
+      }
+      hist photonConvTypeCbTight_ENDCAP {
+      }
+ }
+
+
+ dir egamma/photons/LBMon {
+     algorithm = egamma_GatherData
+     output = egamma/photons/LBMon
+     display = Draw=e1,StatBox
+      # CbLoose
+      hist LBEvoNPhotonsCbLoose {
+      }
+      hist LBEvoNPhotonsUnconvCbLoose {
+      }
+      hist LBEvoNPhotonsConvCbLoose {
+      }
+      hist LBEvoConvOverNCbLoose {
+      }
+
+      # CbTight
+      hist LBEvoNPhotonsCbTight {
+      }
+      hist LBEvoNPhotonsUnconvCbTight {
+      }
+      hist LBEvoNPhotonsConvCbTight {
+      }
+      hist LBEvoConvOverNCbTight {
+      }
+}
+
+### photonsWithTrigger
+
+ dir egamma/photonsWithTrigger {
+     output = egamma/photonsWithTrigger
+
+      # CbLoose
+      hist photonNCbLoose {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonPhiCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonEtaPhiPt2.5GeVCbLoose {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist photonEtaPhiPtgt4GeVCbLoose {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist photonEtaPhiPtgt20GeVCbLoose {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist photonPtCone20CbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonTopoEtCone40CbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonTimeCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonRconvCbLoose {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+
+      # CbTight
+      hist photonNCbTight {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonPhiCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonEtaPhiPt2.5GeVCbTight {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)      
+      }
+      hist photonEtaPhiPtgt4GeVCbTight {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist photonEtaPhiPtgt20GeVCbTight {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist photonPtCone20CbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonTopoEtCone40CbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonTimeCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+      hist photonRconvCbTight {
+       algorithm = egKolmogorov
+       display = Draw=e1,StatBox
+      }
+}
+
+
+ dir egamma/photonsWithTrigger/Region {
+      algorithm = egKolmogorov
+      output = egamma/photonsWithTrigger/EXPERT
+      display = Draw=e1,StatBox
+
+      # CbLoose
+      hist photonNCbLoose_BARREL {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbLoose_BARREL {
+      }
+      hist photonEtaCbLoose_BARREL {
+      }
+      hist photonPhiCbLoose_BARREL {
+      }
+      hist photonPtCone20CbLoose_BARREL {
+      }
+      hist photonTopoEtCone40CbLoose_BARREL {
+      }
+      hist photonNCbLoose_CRACK {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbLoose_CRACK {
+      }
+      hist photonEtaCbLoose_CRACK {
+      }
+      hist photonPhiCbLoose_CRACK {
+      }
+      hist photonPtCone20CbLoose_CRACK {
+      }
+      hist photonTopoEtCone40CbLoose_CRACK {
+      }
+      hist photonNCbLoose_ENDCAP {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbLoose_ENDCAP {
+      }
+      hist photonEtaCbLoose_ENDCAP {
+      }
+      hist photonPhiCbLoose_ENDCAP {
+      }
+      hist photonPtCone20CbLoose_ENDCAP {
+      }
+      hist photonTopoEtCone40CbLoose_ENDCAP {
+      }
+
+      # CbTight
+      hist photonNCbTight_BARREL {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbTight_BARREL {
+      }
+      hist photonEtaCbTight_BARREL {
+      }
+      hist photonPhiCbTight_BARREL {
+      }
+      hist photonPtCone20CbTight_BARREL {
+      }
+      hist photonTopoEtCone40CbTight_BARREL {
+      }
+      hist photonNCbTight_CRACK {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbTight_CRACK {
+      }
+      hist photonEtaCbTight_CRACK {
+      }
+      hist photonPhiCbTight_CRACK {
+      }
+      hist photonPtCone20CbTight_CRACK {
+      }
+      hist photonTopoEtCone40CbTight_CRACK {
+      }
+      hist photonNCbTight_ENDCAP {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist photonEtCbTight_ENDCAP {
+      }
+      hist photonEtaCbTight_ENDCAP {
+      }
+      hist photonPhiCbTight_ENDCAP {
+      }
+      hist photonPtCone20CbTight_ENDCAP {
+      }
+      hist photonTopoEtCone40CbTight_ENDCAP {
+      }
+}
+
+ dir egamma/photonsWithTrigger/Unconv {
+     algorithm = egKolmogorov
+     output = egamma/photonsWithTrigger
+     display = Draw=e1,StatBox
+
+     #CbLoose
+     hist photonNUnconvCbLoose {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+     hist photonEtUnconvCbLoose {
+     }
+     hist photonEtaUnconvCbLoose {
+     }
+     hist photonPhiUnconvCbLoose {
+     }
+     hist photonEtaPhiUnconvCbLoose {
+      algorithm = egamma_BinsDiffFromStripMedian
+     }
+     hist photonTopoEtCone40UnconvCbLoose {
+     }
+     hist photonPtCone20UnconvCbLoose {
+     }
+
+     #CbTight
+     hist photonNUnconvCbTight {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+     hist photonEtUnconvCbTight {
+     }
+     hist photonEtaUnconvCbTight {
+     }
+     hist photonPhiUnconvCbTight {
+     }
+     hist photonEtaPhiUnconvCbTight {
+      algorithm = egamma_BinsDiffFromStripMedian
+     }
+     hist photonTopoEtCone40UnconvCbTight {
+     }
+     hist photonPtCone20UnconvCbTight {
+     }
+
+}
+
+
+ dir egamma/photonsWithTrigger/Conv {
+     algorithm = egKolmogorov
+     output = egamma/photonsWithTrigger
+     display = Draw=e1,StatBox
+
+     #CbLoose
+     hist photonNConvCbLoose {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+     hist photonEtConvCbLoose {
+     }
+     hist photonEtaConvCbLoose {
+     }
+     hist photonPhiConvCbLoose {
+     }
+     hist photonEtaPhiConvCbLoose {
+      algorithm = egamma_BinsDiffFromStripMedian
+     }
+     hist photonTopoEtCone40ConvCbLoose {
+     }
+     hist photonPtCone20ConvCbLoose {
+     }
+     #CbTight
+     hist photonNConvCbTight {
+     }
+     hist photonEtConvCbTight {
+     }
+     hist photonEtaConvCbTight {
+     }
+     hist photonPhiConvCbTight {
+     }
+     hist photonEtaPhiConvCbTight {
+      algorithm = egamma_BinsDiffFromStripMedian
+     }
+     hist photonTopoEtCone40ConvCbTight {
+     }
+     hist photonPtCone20ConvCbTight {
+     }
+}
+
+ dir egamma/photonsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/photonsWithTrigger/ID
+     display = Draw=e1,StatBox
+
+      #CbLoose
+      hist photonEhad1CbLoose_BARREL {
+      }
+      hist photonCoreEMCbLoose_BARREL {
+      }
+      hist photonF0CbLoose_BARREL {
+      }
+      hist photonF1CbLoose_BARREL {
+      }
+      hist photonF2CbLoose_BARREL {
+      }
+      hist photonF3CbLoose_BARREL {
+      }
+      hist photonRe233e237CbLoose_BARREL {
+      }
+      hist photonRe237e277CbLoose_BARREL {
+      }
+      hist photonEhad1CbLoose_CRACK {
+      }
+      hist photonCoreEMCbLoose_CRACK {
+      }
+      hist photonF0CbLoose_CRACK {
+      }
+      hist photonF1CbLoose_CRACK {
+      }
+      hist photonF2CbLoose_CRACK {
+      }
+      hist photonF3CbLoose_CRACK {
+      }
+      hist photonRe233e237CbLoose_CRACK {
+      }
+      hist photonRe237e277CbLoose_CRACK {
+      }
+      hist photonEhad1CbLoose_ENDCAP {
+      }
+      hist photonCoreEMCbLoose_ENDCAP {
+      }
+      hist photonF0CbLoose_ENDCAP {
+      }
+      hist photonF1CbLoose_ENDCAP {
+      }
+      hist photonF2CbLoose_ENDCAP {
+      }
+      hist photonF3CbLoose_ENDCAP {
+      }
+      hist photonRe233e237CbLoose_ENDCAP {
+      }
+      hist photonRe237e277CbLoose_ENDCAP {
+      }
+      #CbTight
+      hist photonEhad1CbTight_BARREL {
+      }
+      hist photonCoreEMCbTight_BARREL {
+      }
+      hist photonF0CbTight_BARREL {
+      }
+      hist photonF1CbTight_BARREL {
+      }
+      hist photonF2CbTight_BARREL {
+      }
+      hist photonF3CbTight_BARREL {
+      }
+      hist photonRe233e237CbTight_BARREL {
+      }
+      hist photonRe237e277CbTight_BARREL {
+      }
+      hist photonEhad1CbTight_CRACK {
+      }
+      hist photonCoreEMCbTight_CRACK {
+      }
+      hist photonF0CbTight_CRACK {
+      }
+      hist photonF1CbTight_CRACK {
+      }
+      hist photonF2CbTight_CRACK {
+      }
+      hist photonF3CbTight_CRACK {
+      }
+      hist photonRe233e237CbTight_CRACK {
+      }
+      hist photonRe237e277CbTight_CRACK {
+      }
+      hist photonEhad1CbTight_ENDCAP {
+      }
+      hist photonCoreEMCbTight_ENDCAP {
+      }
+      hist photonF0CbTight_ENDCAP {
+      }
+      hist photonF1CbTight_ENDCAP {
+      }
+      hist photonF2CbTight_ENDCAP {
+      }
+      hist photonF3CbTight_ENDCAP {
+      }
+      hist photonRe233e237CbTight_ENDCAP {
+      }
+      hist photonRe237e277CbTight_ENDCAP {
+      }
+}
+
+ dir egamma/photonsWithTrigger/Region {
+     algorithm = egKolmogorov
+     output = egamma/photonsWithTrigger/EXPERT
+     display = Draw=e1,StatBox
+
+      # CbLoose
+      hist photonConvTrkMatch1CbLoose_BARREL {
+      }
+      hist photonConvTrkMatch2CbLoose_BARREL {
+      }
+      hist photonConvTypeCbLoose_BARREL {
+      }
+      hist photonConvTrkMatch1CbLoose_CRACK {
+      }
+      hist photonConvTrkMatch2CbLoose_CRACK {
+      }
+      hist photonConvTypeCbLoose_CRACK {
+      }
+      hist photonConvTrkMatch1CbLoose_ENDCAP {
+      }
+      hist photonConvTrkMatch2CbLoose_ENDCAP {
+      }
+      hist photonConvTypeCbLoose_ENDCAP {
+      }
+      # CbTight
+      hist photonConvTrkMatch1CbTight_BARREL {
+      }
+      hist photonConvTrkMatch2CbTight_BARREL {
+      }
+      hist photonConvTypeCbTight_BARREL {
+      }
+      hist photonConvTrkMatch1CbTight_CRACK {
+      }
+      hist photonConvTrkMatch2CbTight_CRACK {
+      }
+      hist photonConvTypeCbTight_CRACK {
+      }
+      hist photonConvTrkMatch1CbTight_ENDCAP {
+      }
+      hist photonConvTrkMatch2CbTight_ENDCAP {
+      }
+      hist photonConvTypeCbTight_ENDCAP {
+      }
+ }
+
+
+ dir egamma/photonsWithTrigger/LBMon {
+     algorithm = egamma_GatherData
+     output = egamma/photonsWithTrigger/LBMon
+     display = Draw=e1,StatBox
+      # CbLoose
+      hist LBEvoNPhotonsCbLoose {
+      }
+      hist LBEvoNPhotonsUnconvCbLoose {
+      }
+      hist LBEvoNPhotonsConvCbLoose {
+      }
+      hist LBEvoConvOverNCbLoose {
+      }
+
+      # CbTight
+      hist LBEvoNPhotonsCbTight {
+      }
+      hist LBEvoNPhotonsUnconvCbTight {
+      }
+      hist LBEvoNPhotonsConvCbTight {
+      }
+      hist LBEvoConvOverNCbTight {
+      }
+}
+
+### forwardElectrons
+
+ dir egamma/forwardElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons
+     display = Draw=e1,StatBox
+
+      hist forwardElectronN {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist forwardElectronEt {
+      }
+      hist forwardElectronPhi {
+      }
+      hist forwardElectronEta {
+      }
+      hist forwardElectronEtaPhi {
+       algorithm = egamma_BinsDiffFromStripMedian
+      }
+      # hist forwardElectronTopoEtCone40 {
+      # }
+      hist forwardElectronTime {
+      }
+
+      hist forwardElectronTightN {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist forwardElectronTightEt {
+      }
+      hist forwardElectronTightPhi {
+      }
+      hist forwardElectronTightEta {
+      }
+      hist forwardElectronTightEtaPhi {
+       algorithm = egamma_BinsDiffFromStripMedian
+      }
+      #hist forwardElectronTightTopoEtCone40 {
+      #}
+      hist forwardElectronTightTime {
+      }
+
+}
+
+
+ dir egamma/forwardElectrons {
+      Algorithm = Egkolmogorov
+      Output = egamma/forwardElectrons/EXPERT
+      display = Draw=e1,StatBox
+      hist forwardElectronN_ENDCAP {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist forwardElectronEt_ENDCAP {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronEta_ENDCAP {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronPhi_ENDCAP {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronTopoEtCone40_ENDCAP {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronTime_ENDCAP {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronTightN_ENDCAP {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronTightEt_ENDCAP {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronTightEta_ENDCAP {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronTightPhi_ENDCAP {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      #hist forwardElectronTightTopoEtCone40_ENDCAP {
+      #output = egamma/forwardElectrons/EXPERT
+      #}
+      hist forwardElectronN_FORWARD {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+       output = egamma/forwardElectrons/EXPERT	
+      }
+      hist forwardElectronEt_FORWARD {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronEta_FORWARD {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronPhi_FORWARD {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      #hist forwardElectronTopoEtCone40_FORWARD {
+      #output = egamma/forwardElectrons/EXPERT
+      #}
+      hist forwardElectronTime_FORWARD {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronTightN_FORWARD {
+       output = egamma/forwardElectrons/EXPERT
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist forwardElectronTightEt_FORWARD {
+       output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronTightEta_FORWARD {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      hist forwardElectronTightPhi_FORWARD {
+      output = egamma/forwardElectrons/EXPERT
+      }
+      #hist forwardElectronTightTopoEtCone40_FORWARD {
+      #output = egamma/forwardElectrons/EXPERT
+      #}
+}
+
+dir egamma/forwardElectrons/ID {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/ID
+      hist forwardElectronENG_DENS_ENDCAP {
+      }
+      hist forwardElectronFRAC_MAX_ENDCAP {
+      }
+      hist forwardElectronLONGITUDINAL_ENDCAP {
+      }
+      hist forwardElectron2ND_LAMBDA_ENDCAP {
+      }
+      hist forwardElectronLATERAL_ENDCAP {
+      }
+      hist forwardElectron2ND_R_ENDCAP {
+      }
+      hist forwardElectronCENTER_LAMBDA_ENDCAP {
+      }
+      hist forwardElectronENG_DENS_FORWARD {
+      }
+      hist forwardElectronFRAC_MAX_FORWARD {
+      }
+      hist forwardElectronLONGITUDINAL_FORWARD {
+      }
+      hist forwardElectron2ND_LAMBDA_FORWARD {
+      }
+      hist forwardElectronLATERAL_FORWARD {
+      }
+      hist forwardElectron2ND_R_FORWARD {
+      }
+      hist forwardElectronCENTER_LAMBDA_FORWARD {
+      }
+}
+
+
+### Tag&Probe Z
+
+dir egamma/tagandprobeZ {
+    algorithm = egKolmogorov
+    output = egamma/tagandprobeZ
+    display = Draw=e1,StatBox
+
+    hist electronTagAndProbeNcandidates {
+    }
+    hist electronTagAndProbeGlobalMass {
+     algorithm = egamma_FitZmass 
+     display = StatBox,gaus(xmin,xmax)
+    }
+    hist electronTagAndProbeMass_BARREL {
+     algorithm = egamma_FitZmass 
+     display = StatBox,gaus(xmin,xmax)
+    }
+    hist electronTagAndProbeMass_CRACK {
+     algorithm = egamma_FitZmass 
+     display = StatBox,gaus(xmin,xmax)
+    }
+    hist electronTagAndProbeMass_ENDCAP {
+     algorithm = egamma_FitZmass 
+     display = StatBox,gaus(xmin,xmax)
+    }
+    hist electronTagAndProbeN {
+     algorithm = egamma_Histogram_Not_Empty
+     display = Draw=e1,StatBox,LogY
+    }
+    hist electronTagAndProbeEt {
+    }
+    hist electronTagAndProbeEta {
+    }
+    hist electronTagAndProbePhi {
+    }
+    hist electronTagAndProbeEtaPhi {
+     algorithm = egamma_BinsDiffFromStripMedian
+    }
+}
+
+dir egamma/tagandprobeZ {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeZ
+     display = Draw=e1,StatBox
+
+     hist EfficiencyTagAndProbeElectronIDvsEt {
+     }
+     hist EfficiencyTagAndProbeElectronIDvsEta {
+     }
+     hist EfficiencyTagAndProbeElectronIDvsPhi {
+     }
+     hist EfficiencyTagAndProbeElectronISOvsEt {
+     }
+     hist EfficiencyTagAndProbeElectronISOvsEta {
+     }
+     hist EfficiencyTagAndProbeElectronISOvsPhi {
+     }
+}
+
+dir egamma/tagandprobeZ/ID {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeZ/ID
+     display = Draw=e1,StatBox
+
+      hist electronTagAndProbeEhad1_BARREL {
+      }
+      hist electronTagAndProbeEoverP_BARREL {
+      }
+      hist electronTagAndProbeCoreEM_BARREL {
+      }
+      hist electronTagAndProbeF1_BARREL {
+      }
+      hist electronTagAndProbeF2_BARREL {
+      }
+      hist electronTagAndProbeF3_BARREL {
+      }
+      hist electronTagAndProbeRe233e237_BARREL {
+      }
+      hist electronTagAndProbeRe237e277_BARREL {
+      }
+      hist electronTagAndProbeEhad1_ENDCAP {
+      }
+      hist electronTagAndProbeEoverP_ENDCAP {
+      }
+      hist electronTagAndProbeCoreEM_ENDCAP {
+      }
+      hist electronTagAndProbeF1_ENDCAP {
+      }
+      hist electronTagAndProbeF2_ENDCAP {
+      }
+      hist electronTagAndProbeF3_ENDCAP {
+      }
+      hist electronTagAndProbeRe233e237_ENDCAP {
+      }
+      hist electronTagAndProbeRe237e277_ENDCAP {
+      }
+      hist electronTagAndProbeEhad1_CRACK {
+      }
+      hist electronTagAndProbeEoverP_CRACK {
+      }
+      hist electronTagAndProbeCoreEM_CRACK {
+      }
+      hist electronTagAndProbeF1_CRACK {
+      }
+      hist electronTagAndProbeF2_CRACK {
+      }
+      hist electronTagAndProbeF3_CRACK {
+      }
+      hist electronTagAndProbeRe233e237_CRACK {
+      }
+      hist electronTagAndProbeRe237e277_CRACK {
+      }
+}
+
+dir egamma/tagandprobeZ/Track { 
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeZ/Track
+     display = Draw=e1,StatBox
+
+      hist electronTagAndProbeNOfBLayerHits_BARREL {
+      }
+      hist electronTagAndProbeNOfTRTHits_BARREL {
+      }
+      hist electronTagAndProbeNOfSiHits_BARREL {
+      }
+      hist electronTagAndProbeDeltaEta1_BARREL {
+      }
+      hist electronTagAndProbeDeltaPhi2_BARREL {
+      }
+      hist electronTagAndProbeNOfBLayerHits_ENDCAP {
+      }
+      hist electronTagAndProbeNOfTRTHits_ENDCAP {
+      }
+      hist electronTagAndProbeNOfSiHits_ENDCAP {
+      }
+      hist electronTagAndProbeDeltaEta1_ENDCAP {
+      }
+      hist electronTagAndProbeDeltaPhi2_ENDCAP {
+      }
+      hist electronTagAndProbeNOfBLayerHits_CRACK {
+      }
+      hist electronTagAndProbeNOfTRTHits_CRACK {
+      }
+      hist electronTagAndProbeNOfSiHits_CRACK {
+      }
+      hist electronTagAndProbeDeltaEta1_CRACK {
+      }
+      hist electronTagAndProbeDeltaPhi2_CRACK {
+      }
+
+ }
+
+dir egamma/tagandprobeZ/Isolation {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeZ
+     display = Draw=e1,StatBox
+
+     hist electronTagAndProbeCaloIso_BARREL {
+     }
+     hist electronTagAndProbeTrackIso_BARREL {
+     }
+     hist electronTagAndProbeCaloIso_ENDCAP {
+     }
+     hist electronTagAndProbeTrackIso_ENDCAP {
+     }
+     hist electronTagAndProbeCaloIso_CRACK {
+     }
+     hist electronTagAndProbeTrackIso_CRACK {
+     }
+}
+
+dir egamma/tagandprobeZ/LBMon {
+    algorithm = egamma_GatherData
+    output = egamma/tagandprobeZ/LBMon
+    display = Draw=e1,StatBox
+
+    hist LBEvoNZcandidates {
+    }
+}
+
+### Tag&Probe JPsi
+
+dir egamma/tagandprobeJPsi {
+    algorithm = egKolmogorov
+    output = egamma/tagandprobeJPsi
+    display = Draw=e1,StatBox
+
+    hist electronTagAndProbeNcandidates {
+    }
+    hist electronTagAndProbeGlobalMass {
+     algorithm = egamma_FitJPsimass 
+     display = StatBox,gaus(xmin,xmax)
+    }
+    hist electronTagAndProbeMass_BARREL {
+     algorithm = egamma_FitJPsimass 
+     display = StatBox,gaus(xmin,xmax)
+    }
+    hist electronTagAndProbeMass_CRACK {
+     algorithm = egamma_FitJPsimass 
+     display = StatBox,gaus(xmin,xmax)
+    }
+    hist electronTagAndProbeMass_ENDCAP {
+     algorithm = egamma_FitJPsimass 
+     display = StatBox,gaus(xmin,xmax)
+    }
+    hist electronTagAndProbeN {
+     algorithm = egamma_Histogram_Not_Empty
+     display = Draw=e1,StatBox,LogY
+    }
+    hist electronTagAndProbeEt {
+    }
+    hist electronTagAndProbeEta {
+    }
+    hist electronTagAndProbePhi {
+    }
+    hist electronTagAndProbeEtaPhi {
+     algorithm = egamma_BinsDiffFromStripMedian
+    }
+}
+
+dir egamma/tagandprobeJPsi {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeJPsi
+     display = Draw=e1,StatBox
+
+     hist EfficiencyTagAndProbeElectronIDvsEt {
+     }
+     hist EfficiencyTagAndProbeElectronIDvsEta {
+     }
+     hist EfficiencyTagAndProbeElectronIDvsPhi {
+     }
+     hist EfficiencyTagAndProbeElectronISOvsEt {
+     }
+     hist EfficiencyTagAndProbeElectronISOvsEta {
+     }
+     hist EfficiencyTagAndProbeElectronISOvsPhi {
+     }
+}
+
+dir egamma/tagandprobeJPsi/ID {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeJPsi/ID
+     display = Draw=e1,StatBox
+
+      hist electronTagAndProbeEhad1_BARREL {
+      }
+      hist electronTagAndProbeEoverP_BARREL {
+      }
+      hist electronTagAndProbeCoreEM_BARREL {
+      }
+      hist electronTagAndProbeF1_BARREL {
+      }
+      hist electronTagAndProbeF2_BARREL {
+      }
+      hist electronTagAndProbeF3_BARREL {
+      }
+      hist electronTagAndProbeRe233e237_BARREL {
+      }
+      hist electronTagAndProbeRe237e277_BARREL {
+      }
+      hist electronTagAndProbeEhad1_ENDCAP {
+      }
+      hist electronTagAndProbeEoverP_ENDCAP {
+      }
+      hist electronTagAndProbeCoreEM_ENDCAP {
+      }
+      hist electronTagAndProbeF1_ENDCAP {
+      }
+      hist electronTagAndProbeF2_ENDCAP {
+      }
+      hist electronTagAndProbeF3_ENDCAP {
+      }
+      hist electronTagAndProbeRe233e237_ENDCAP {
+      }
+      hist electronTagAndProbeRe237e277_ENDCAP {
+      }
+      hist electronTagAndProbeEhad1_CRACK {
+      }
+      hist electronTagAndProbeEoverP_CRACK {
+      }
+      hist electronTagAndProbeCoreEM_CRACK {
+      }
+      hist electronTagAndProbeF1_CRACK {
+      }
+      hist electronTagAndProbeF2_CRACK {
+      }
+      hist electronTagAndProbeF3_CRACK {
+      }
+      hist electronTagAndProbeRe233e237_CRACK {
+      }
+      hist electronTagAndProbeRe237e277_CRACK {
+      }
+}
+
+dir egamma/tagandprobeJPsi/Track { 
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeJPsi/Track
+     display = Draw=e1,StatBox
+
+      hist electronTagAndProbeNOfBLayerHits_BARREL {
+      }
+      hist electronTagAndProbeNOfTRTHits_BARREL {
+      }
+      hist electronTagAndProbeNOfSiHits_BARREL {
+      }
+      hist electronTagAndProbeDeltaEta1_BARREL {
+      }
+      hist electronTagAndProbeDeltaPhi2_BARREL {
+      }
+      hist electronTagAndProbeNOfBLayerHits_ENDCAP {
+      }
+      hist electronTagAndProbeNOfTRTHits_ENDCAP {
+      }
+      hist electronTagAndProbeNOfSiHits_ENDCAP {
+      }
+      hist electronTagAndProbeDeltaEta1_ENDCAP {
+      }
+      hist electronTagAndProbeDeltaPhi2_ENDCAP {
+      }
+      hist electronTagAndProbeNOfBLayerHits_CRACK {
+      }
+      hist electronTagAndProbeNOfTRTHits_CRACK {
+      }
+      hist electronTagAndProbeNOfSiHits_CRACK {
+      }
+      hist electronTagAndProbeDeltaEta1_CRACK {
+      }
+      hist electronTagAndProbeDeltaPhi2_CRACK {
+      }
+
+ }
+
+dir egamma/tagandprobeJPsi/Isolation {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeJPsi
+     display = Draw=e1,StatBox
+
+     hist electronTagAndProbeCaloIso_BARREL {
+     }
+     hist electronTagAndProbeTrackIso_BARREL {
+     }
+     hist electronTagAndProbeCaloIso_ENDCAP {
+     }
+     hist electronTagAndProbeTrackIso_ENDCAP {
+     }
+     hist electronTagAndProbeCaloIso_CRACK {
+     }
+     hist electronTagAndProbeTrackIso_CRACK {
+     }
+}
+
+dir egamma/tagandprobeJPsi/LBMon {
+    algorithm = egamma_GatherData
+    output = egamma/tagandprobeJPsi/LBMon
+    display = Draw=e1,StatBox
+
+    hist LBEvoNJPsicandidates {
+    }
+}
diff --git a/DataQuality/DataQualityConfigurations/config/Egamma/cosmics_run.config b/DataQuality/DataQualityConfigurations/config/Egamma/cosmics_run.config
index cdbf437543bd..31a1c2b2877c 100644
--- a/DataQuality/DataQualityConfigurations/config/Egamma/cosmics_run.config
+++ b/DataQuality/DataQualityConfigurations/config/Egamma/cosmics_run.config
@@ -1,5 +1,5 @@
 # **********************************************************************
-# $Id: cosmics_run.config 777627 2016-10-11 10:49:51Z nproklov $
+# $Id: collisions_run.config 777627 2016-10-11 10:49:51Z nproklov $
 # **********************************************************************
 
 ############################################################
@@ -88,6 +88,9 @@ algorithm egamma_GatherData {
 algorithm egamma_Histogram_Not_Empty {
   libname = libdqm_algorithms.so
   name = Histogram_Not_Empty
+#  reference = EgammaReference	
+  reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
+  MinStat = 20
 }
 
 algorithm 2D_Histogram_Not_Empty {
@@ -98,7 +101,6 @@ algorithm 2D_Histogram_Not_Empty {
   reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
 }
 
-
 algorithm egamma_FitZmass {
   libname = libdqm_algorithms.so
   name = Simple_gaus_Fit
@@ -110,8 +112,8 @@ algorithm egamma_FitZmass {
 algorithm egamma_FitJPsimass {
   libname = libdqm_algorithms.so
   name = Simple_gaus_Fit
-  xmin = 3000.
-  xmax = 5000. 
+  xmin = 2500.
+  xmax = 3500. 
   thresholds = egamma_FitJPsimass_Thresholds
 }
 
@@ -120,1475 +122,2117 @@ algorithm egamma_FitJPsimass {
 #############
 
 output top_level {
-  algorithm = WorstCaseSummary
+#  algorithm = WorstCaseSummary
   output egamma {
-   algorithm = WorstCaseSummary
+# Photons
    output photons { 
-    algorithm = WorstCaseSummary
-    output EXPERT { 
-    algorithm = WorstCaseSummary
+    output CBLoose {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
+   }
+   output CBTight {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
     }
-    output ID {
-    algorithm = WorstCaseSummary
+   }
+   output photonsWithTrigger { 
+    output CBLoose {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
     }
-    output LBMon {
-    algorithm = WorstCaseSummary
+    output CBTight {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
     }
    }
+  
+# Electrons
    output electrons {
-    algorithm = WorstCaseSummary
-    output EXPERT {
-    algorithm = WorstCaseSummary  
+    output LHLoose {
+     output Expert {
+      output ID {
+      }
+      output Track {
+      }
+      output LBMon {
+      }
+     }
+    }
+    output LHTight {
+     output Expert {
+      output ID {
+      }
+      output Track {
+      }
+      output LBMon {
+      }     
+     }
+    }
+   }
+   output electronsWithTrigger {
+    output LHLoose {
+     output Expert {
+      output ID {
+      }
+      output Track {
+      }
+      output LBMon {
+      }
+    }
+   }
+   output LHTight {
+    output Expert {
+     output ID {
+     }
+     output Track {
+     }
+     output LBMon {
+     }    
+    }
+   }
+  }
+
+# FwdElectrons
+  output forwardElectrons {
+   output LHTight {
+    output Expert {
+    }
+   }
+   output LHLoose {
+    output Expert {
+    }
+   }
+   output CBLoose {
+    output Expert {
+    }
+   }
+   output CBTight {
+    output Expert {
     }
+   }
+  }
+   
+# T&P 
+  output tagandprobeZ {
     output ID {
-    algorithm = WorstCaseSummary
     }
     output Track {
-    algorithm = WorstCaseSummary
     }
     output LBMon {
-    algorithm = WorstCaseSummary
     }
    }
-   output forwardElectrons {
-    algorithm = WorstCaseSummary
+   output tagandprobeJPsi {
     output ID {
-    algorithm = WorstCaseSummary
     }
-    output EXPERT {
-    algorithm = WorstCaseSummary
+    output Track {
+    }
+    output LBMon {
     }
    }
- }
+  }
 }
 
 #######################
 # Histogram Assessments
 #######################
 
- dir egamma/electrons {
-      output = egamma/electrons
+##################################
+# Electrons
+#################################@
 
-      # CbLoose
-      hist electronNCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist electronEtCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPtCone20CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
+# LhLoose
 
-      # CbTight
-      hist electronNCbTight {
+dir egamma/LHLooseElectrons {
+      output = egamma/electrons/LHLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
       }
-      hist electronEtCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPtCone20CbTight {
-       algorithm = egKolmogorov
-      } 
-      hist electronTopoEtCone40CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-
-      # LhLoose
-      hist electronNLhLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist Et { 
       }
-      hist electronEtLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVLhLoose {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist Eta { 
       }
-      hist electronEtaPhiPtgt4GeVLhLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist Phi { 
       }
-      hist electronEtaPhiPtgt20GeVLhLoose {
-       output = egamma/electrons/EXPERT
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronPtCone20LhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40LhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronNLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      } 
-      hist electronEtLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaPhiPtgt2.5GeVLhLoose {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist electronEtaPhiPtgt4GeVLhLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist TopoEtCone40 { 
       }
-      hist electronEtaPhiPtgt20GeVLhLoose {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist PtCone20 { 
       }
-      hist electronPtCone20LhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist Time { 
       }
-      hist electronTopoEtCone40LhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+}
+
+dir egamma/LHLooseElectrons/Expert {
+      output = egamma/electrons/LHLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist EtainENDCAP { 
       }
-      hist electronTimeLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist PhiinENDCAP { 
       }
-
-      # LhMedium
-      hist electronNLhMedium {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist TimeinENDCAP { 
       }
-      hist electronEtLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVLhMedium {
-       output = egamma/electrons/EXPERT
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
        algorithm = 2D_Histogram_Not_Empty
-      #  algorithm = egamma_BinsDiffFromStripMedian
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEtaPhiPtgt4GeVLhMedium {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEtaPhiPtgt20GeVLhMedium {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
-      }
-      hist electronPtCone20LhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40LhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronNLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      } 
-      hist electronEtLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-
-      # LhTight
-      hist electronNLhTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist EtainBARREL { 
       }
-      hist electronEtLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist PhiinBARREL { 
       }
-      hist electronPhiLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist TimeinBARREL { 
       }
-      hist electronEtaLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist EtainCRACK { 
       }
-      hist electronEtaPhiPtgt2.5GeVLhTight {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist PhiinCRACK { 
       }
-      hist electronEtaPhiPtgt4GeVLhTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist TimeinCRACK { 
       }
-      hist electronEtaPhiPtgt20GeVLhTight {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
+}
+
+dir egamma/LHLooseElectrons/byLB {
+      output = egamma/electrons/LHLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist LBEvoN { 
       }
-      hist electronPtCone20LhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-}
-
- dir egamma/electrons/ID {
+}
+
+dir egamma/LHLooseElectrons/ID {
+     algorithm = egKolmogorov
+     output = egamma/electrons/LHLoose/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHLooseElectrons/Tracks {
      algorithm = egKolmogorov
-     output = egamma/electrons/ID
+     output = egamma/electrons/LHLoose/Expert/Track
      display = Draw=e1,StatBox
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+}
 
-     # LhLoose
-      hist electronEhad1LhLoose_BARREL {
-      }
-      hist electronEoverPLhLoose_BARREL {
+# LhLooseWithTrigger
+
+dir egamma/LHLooseElectronsWithTrigger {
+      output = egamma/electronsWithTrigger/LHLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronCoreEMLhLoose_BARREL {
+      hist Et { 
       }
-      hist electronF0LhLoose_BARREL {
+      hist Eta { 
       }
-      hist electronF1LhLoose_BARREL {
+      hist Phi { 
       }
-      hist electronF2LhLoose_BARREL {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF3LhLoose_BARREL {
+      hist TopoEtCone40 { 
       }
-      hist electronRe233e237LhLoose_BARREL {
+      hist PtCone20 { 
       }
-      hist electronRe237e277LhLoose_BARREL {
+      hist Time { 
       }
-      hist electronEhad1LhLoose_CRACK {
+}
+
+dir egamma/LHLooseElectronsWithTrigger/Expert {
+      output = egamma/electronsWithTrigger/LHLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
       }
-      hist electronEoverPLhLoose_CRACK {
+      hist Eta_Phi_with_Pt_gt_20GeV { 
       }
-      hist electronCoreEMLhLoose_CRACK {
+}
+
+dir egamma/LHLooseElectronsWithTrigger/byLB {
+      output = egamma/electronsWithTrigger/LHLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist LBEvoN { 
       }
-      hist electronF0LhLoose_CRACK {
+}
+
+dir egamma/LHLooseElectronsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHLoose/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHLooseElectronsWithTrigger/Tracks {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHLoose/Expert/Track
+     display = Draw=e1,StatBox
+
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+
+}
+
+# LhTight
+
+dir egamma/LHTightElectrons {
+      output = egamma/electrons/LHTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronF1LhLoose_CRACK {
+      hist Et { 
       }
-      hist electronF2LhLoose_CRACK {
+      hist Eta { 
       }
-      hist electronF3LhLoose_CRACK {
+      hist Phi { 
       }
-      hist electronRe233e237LhLoose_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronRe237e277LhLoose_CRACK {
+      hist TopoEtCone40 { 
       }
-      hist electronEhad1LhLoose_ENDCAP {
+      hist PtCone20 { 
       }
-      hist electronEoverPLhLoose_ENDCAP {
+      hist Time { 
       }
-      hist electronCoreEMLhLoose_ENDCAP {
+}
+
+dir egamma/LHTightElectrons/Expert {
+      output = egamma/electrons/LHTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist EtainENDCAP { 
       }
-      hist electronF0LhLoose_ENDCAP {
+      hist PhiinENDCAP { 
       }
-      hist electronF1LhLoose_ENDCAP {
+      hist TimeinENDCAP { 
       }
-      hist electronF2LhLoose_ENDCAP {
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronF3LhLoose_ENDCAP {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronRe233e237LhLoose_ENDCAP {
+      hist EtainBARREL { 
       }
-      hist electronRe237e277LhLoose_ENDCAP {
+      hist PhiinBARREL { 
       }
-
-     # LhMedium
-      hist electronEhad1LhMedium_BARREL {
+      hist TimeinBARREL { 
       }
-      hist electronEoverPLhMedium_BARREL {
+      hist EtainCRACK { 
       }
-      hist electronCoreEMLhMedium_BARREL {
+      hist PhiinCRACK { 
       }
-      hist electronF0LhMedium_BARREL {
+      hist TimeinCRACK { 
       }
-      hist electronF1LhMedium_BARREL {
-      }
-      hist electronF2LhMedium_BARREL {
-      }
-      hist electronF3LhMedium_BARREL {
+}
+
+dir egamma/LHTightElectrons/byLB {
+      output = egamma/electrons/LHTight/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist LBEvON { 
       }
-      hist electronRe233e237LhMedium_BARREL {
+}
+
+dir egamma/LHTightElectrons/ID {
+     algorithm = egKolmogorov
+     output = egamma/electrons/LHTight/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHTightElectrons/Tracks {
+     algorithm = egKolmogorov
+     output = egamma/electrons/LHTight/Expert/Track
+     Display = Draw=e1,StatBox
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+}
+
+# LhTightWithTrigger
+
+dir egamma/LHTightElectronsWithTrigger {
+      output = egamma/electronsWithTrigger/LHTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronRe237e277LhMedium_BARREL {
+      hist Et { 
+      } 
+      hist Eta { 
       }
-      hist electronEhad1LhMedium_CRACK {
+      hist Phi { 
       }
-      hist electronEoverPLhMedium_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronCoreEMLhMedium_CRACK {
+      hist TopoEtCone40 { 
       }
-      hist electronF0LhMedium_CRACK {
+      hist PtCone20 { 
       }
-      hist electronF1LhMedium_CRACK {
+      hist Time { 
       }
-      hist electronF2LhMedium_CRACK {
+}
+
+dir egamma/LHTightElectronsWithTrigger/Expert {
+      output = egamma/electronsWithTrigger/LHTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
       }
-      hist electronF3LhMedium_CRACK {
+      hist Eta_Phi_with_Pt_gt_20GeV { 
       }
-      hist electronRe233e237LhMedium_CRACK {
+}
+
+dir egamma/LHTightElectronsWithTrigger/byLB {
+      output = egamma/electronsWithTrigger/LHTight/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist LBEvON { 
       }
-      hist electronRe237e277LhMedium_CRACK {
+}
+
+dir egamma/LHTightElectronsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHTight/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHTightElectronsWithTrigger/Tracks {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHTight/Expert/Track
+     display = Draw=e1,StatBox
+
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+
+}
+
+
+############################################## 
+### photons
+##############################################
+
+# CBLoose
+
+dir egamma/CBLoosePhotons {
+      output = egamma/photons/CBLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronEhad1LhMedium_ENDCAP {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronEoverPLhMedium_ENDCAP {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronCoreEMLhMedium_ENDCAP {
+
+      hist Et { 
       }
-      hist electronF0LhMedium_ENDCAP {
+      hist Phi { 
       }
-      hist electronF1LhMedium_ENDCAP {
+      hist Eta { 
       }
-      hist electronF2LhMedium_ENDCAP {
+      hist PtCone20 { 
       }
-      hist electronF3LhMedium_ENDCAP {
+      hist EtCone40 { 
       }
-      hist electronRe233e237LhMedium_ENDCAP {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronRe237e277LhMedium_ENDCAP {
+      hist Time { 
       }
 
-     # LhTight
-      hist electronEhad1LhTight_BARREL {
+      hist EtConv { 
+      }
+      hist PhiConv { 
       }
-      hist electronEoverPLhTight_BARREL {
+      hist EtaConv { 
       }
-      hist electronCoreEMLhTight_BARREL {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF0LhTight_BARREL {
+
+      hist EtUnconv { 
       }
-      hist electronF1LhTight_BARREL {
+      hist PhiUnconv { 
       }
-      hist electronF2LhTight_BARREL {
+      hist EtaUnconv { 
       }
-      hist electronF3LhTight_BARREL {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronRe233e237LhTight_BARREL {
+
+
+}
+
+dir egamma/CBLoosePhotons/Expert {
+      output = egamma/photons/CBLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+
+      hist EtainBARREL { 
       }
-      hist electronRe237e277LhTight_BARREL {
+      hist PhiinBARREL { 
       }
-      hist electronEhad1LhTight_CRACK {
+      hist TimeinBARREL { 
       }
-      hist electronEoverPLhTight_CRACK {
+      hist RConvinBARREL { 
       }
-      hist electronCoreEMLhTight_CRACK {
+      hist ConvTypeinBARREL { 
       }
-      hist electronF0LhTight_CRACK {
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF1LhTight_CRACK {
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronF2LhTight_CRACK {
+
+      hist EtainENDCAP { 
       }
-      hist electronF3LhTight_CRACK {
+      hist PhiinENDCAP { 
       }
-      hist electronRe233e237LhTight_CRACK {
+      hist TimeinENDCAP { 
       }
-      hist electronRe237e277LhTight_CRACK {
+      hist RConvinENDCAP { 
       }
-      hist electronEhad1LhTight_ENDCAP {
+      hist ConvTypeinENDCAP { 
       }
-      hist electronEoverPLhTight_ENDCAP {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronCoreEMLhTight_ENDCAP {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF0LhTight_ENDCAP {
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF1LhTight_ENDCAP {
+
+      hist EtainCRACK { 
       }
-      hist electronF2LhTight_ENDCAP {
+      hist PhiinCRACK { 
       }
-      hist electronF3LhTight_ENDCAP {
+      hist TimeinCRACK { 
       }
-      hist electronRe233e237LhTight_ENDCAP {
+      hist RConvinCRACK { 
       }
-      hist electronRe237e277LhTight_ENDCAP {
+      hist ConvTypeinCRACK { 
       }
-}
 
- dir egamma/electrons/Track {
-     algorithm = egKolmogorov
-     output = egamma/electrons/Track
-     display = Draw=e1,StatBox
+}
 
-     # LhLoose
-      hist electronNOfBLayersHitsLhLoose_BARREL {
-      }
-      hist electronNOfTRTHitsLhLoose_BARREL {
-      }
-      hist electronNOfSiHitsLhLoose_BARREL {
+dir egamma/CBLoosePhotons/byLB {
+      output = egamma/photons/CBLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist electronDeltaEta1LhLoose_BARREL {
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist electronDeltaPhi2LhLoose_BARREL {
+      hist    LBEvoN { 
       }
-      hist electronDeltaEta1LhLoose_CRACK {
+      hist    Conversion_fraction_vs_LB { 
       }
-      hist electronDeltaPhi2LhLoose_CRACK {
+}
+
+dir egamma/CBLoosePhotons/ID {
+     algorithm = egKolmogorov
+     output = egamma/photons/CBLoose/Expert/ID
+     display = Draw=e1,StatBox
+      hist   Ehad1inBARREL { 
       }
-      hist electronNOfBLayersHitsLhLoose_CRACK {
+      hist   CoreEMinBARREL { 
       }
-      hist electronNOfTRTHitsLhLoose_CRACK {
+      hist   F0inBARREL { 
       }
-      hist electronNOfSiHitsLhLoose_CRACK {
+      hist   F1inBARREL { 
       }
-      hist electronDeltaEta1LhLoose_ENDCAP {
+      hist   F2inBARREL { 
       }
-      hist electronDeltaPhi2LhLoose_ENDCAP {
+      hist   F3inBARREL { 
       }
-      hist electronNOfBLayersHitsLhLoose_ENDCAP {
+      hist   Re233e237inBARREL { 
       }
-      hist electronNOfTRTHitsLhLoose_ENDCAP {
+      hist   Re237e277inBARREL { 
       }
-      hist electronNOfSiHitsLhLoose_ENDCAP {
+      hist   Ehad1inENDCAP { 
       }
-
-     # LhMedium
-      hist electronNOfBLayersHitsLhMedium_BARREL {
+      hist   CoreEMinENDCAP { 
       }
-      hist electronNOfTRTHitsLhMedium_BARREL {
+      hist   F0inENDCAP { 
       }
-      hist electronNOfSiHitsLhMedium_BARREL {
+      hist   F1inENDCAP { 
       }
-      hist electronDeltaEta1LhMedium_BARREL {
+      hist   F2inENDCAP { 
       }
-      hist electronDeltaPhi2LhMedium_BARREL {
+      hist   F3inENDCAP { 
       }
-      hist electronDeltaEta1LhMedium_CRACK {
+      hist   Re233e237inENDCAP { 
       }
-      hist electronDeltaPhi2LhMedium_CRACK {
+      hist   Re237e277inENDCAP { 
       }
-      hist electronNOfBLayersHitsLhMedium_CRACK {
+      hist   Ehad1inCRACK { 
       }
-      hist electronNOfTRTHitsLhMedium_CRACK {
+      hist   CoreEMinCRACK { 
       }
-      hist electronNOfSiHitsLhMedium_CRACK {
+      hist   F0inCRACK { 
       }
-      hist electronDeltaEta1LhMedium_ENDCAP {
+      hist   F1inCRACK { 
       }
-      hist electronDeltaPhi2LhMedium_ENDCAP {
+      hist   F2inCRACK { 
       }
-      hist electronNOfBLayersHitsLhMedium_ENDCAP {
+      hist   F3inCRACK { 
       }
-      hist electronNOfTRTHitsLhMedium_ENDCAP {
+      hist   Re233e237inCRACK { 
       }
-      hist electronNOfSiHitsLhMedium_ENDCAP {
+      hist   Re237e277inCRACK { 
       }
+}
 
-     # LhTight
-      hist electronNOfBLayersHitsLhTight_BARREL {
-      }
-      hist electronNOfTRTHitsLhTight_BARREL {
+# CBLooseWithTrigger
+
+dir egamma/CBLoosePhotonsWithTrigger {
+      output = egamma/photonsWithTrigger/CBLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronNOfSiHitsLhTight_BARREL {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronDeltaEta1LhTight_BARREL {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronDeltaPhi2LhTight_BARREL {
+
+      hist Et { 
       }
-      hist electronDeltaEta1LhTight_CRACK {
+      hist Phi { 
       }
-      hist electronDeltaPhi2LhTight_CRACK {
+      hist Eta { 
       }
-      hist electronNOfBLayersHitsLhTight_CRACK {
+      hist PtCone20 { 
       }
-      hist electronNOfTRTHitsLhTight_CRACK {
+      hist EtCone40 { 
       }
-      hist electronNOfSiHitsLhTight_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronDeltaEta1LhTight_ENDCAP {
+      hist Time { 
       }
-      hist electronDeltaPhi2LhTight_ENDCAP {
+
+      hist EtConv { 
       }
-      hist electronNOfBLayersHitsLhTight_ENDCAP {
+      hist PhiConv { 
       }
-      hist electronNOfTRTHitsLhTight_ENDCAP {
+      hist EtaConv { 
       }
-      hist electronNOfSiHitsLhTight_ENDCAP {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
- }
 
- dir egamma/electrons/LBMon {
-     algorithm = egamma_GatherData
-     output = egamma/electrons/LBMon
-     display = Draw=e1,StatBox
-      # LhLoose
-      hist LBEvoNElectronsLhLoose {
+      hist EtUnconv { 
       }
-      # LhMedium
-      hist LBEvoNElectronsLhMedium {
+      hist PhiUnconv { 
       }
-      # LhTight
-      hist LBEvoNElectronsLhTight {
+      hist EtaUnconv { 
       }
-      # CbLoose
-      hist LBEvoNElectronsCbLoose {
-      }
-      # CbTight
-      hist LBEvoNElectronsCbTight {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-}
 
-### photons
 
+}
 
- dir egamma/photons {
-     output = egamma/photons
+dir egamma/CBLoosePhotonsWithTrigger/Expert {
+      output = egamma/photonsWithTrigger/CBLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
 
-      # CbLoose
-      hist photonNCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist EtainBARREL { 
       }
-      hist photonEtCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist PhiinBARREL { 
       }
-      hist photonPhiCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist TimeinBARREL { 
       }
-      hist photonEtaPhiPt2.5GeVCbLoose {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist RConvinBARREL { 
       }
-      hist photonEtaPhiPtgt4GeVCbLoose {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist ConvTypeinBARREL { 
       }
-      hist photonEtaPhiPtgt20GeVCbLoose {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist photonPtCone20CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonTopoEtCone40CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+
+      hist EtainENDCAP { 
       }
-      hist photonTimeCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist PhiinENDCAP { 
       }
-      hist photonRconvCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist TimeinENDCAP { 
       }
-
-      # CbTight
-      hist photonNCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist RConvinENDCAP { 
       }
-      hist photonEtCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist ConvTypeinENDCAP { 
       }
-      hist photonPhiCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist Eta_Phi_with_Pt.gt.20GeV { 
       }
-      hist photonEtaPhiPt2.5GeVCbTight {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonEtaPhiPtgt4GeVCbTight {
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonEtaPhiPtgt20GeVCbTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+
+      hist EtainCRACK { 
       }
-      hist photonPtCone20CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist PhiinCRACK { 
       }
-      hist photonTopoEtCone40CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist TimeinCRACK { 
       }
-      hist photonTimeCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist RConvinCRACK { 
       }
-      hist photonRconvCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist ConvTypeinCRACK { 
       }
 }
 
- dir egamma/photons/Region {
+dir egamma/CBLoosePhotonsWithTrigger/byLB {
+      output = egamma/photonsWithTrigger/CBLoose/Expert/LBMon
       algorithm = egKolmogorov
-      output = egamma/photons/EXPERT
-      display = Draw=e1,StatBox
-
-      # CbLoose
-      hist photonNCbLoose_BARREL {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist photonEtCbLoose_BARREL {
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist photonEtaCbLoose_BARREL {
+      hist    LBEvoN { 
       }
-      hist photonPhiCbLoose_BARREL {
+      hist    Conversion_fraction_vs_LB { 
       }
-      hist photonPtCone20CbLoose_BARREL {
+}
+
+dir egamma/CBLoosePhotonsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/photonsWithTrigger/CBLoose/Expert/ID
+     display = Draw=e1,StatBox
+      hist   Ehad1inBARREL { 
       }
-      hist photonTopoEtCone40CbLoose_BARREL {
+      hist   CoreEMinBARREL { 
       }
-      hist photonNCbLoose_CRACK {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   F0inBARREL { 
       }
-      hist photonEtCbLoose_CRACK {
+      hist   F1inBARREL { 
       }
-      hist photonEtaCbLoose_CRACK {
+      hist   F2inBARREL { 
       }
-      hist photonPhiCbLoose_CRACK {
+      hist   F3inBARREL { 
       }
-      hist photonPtCone20CbLoose_CRACK {
+      hist   Re233e237inBARREL { 
       }
-      hist photonTopoEtCone40CbLoose_CRACK {
+      hist   Re237e277inBARREL { 
       }
-      hist photonNCbLoose_ENDCAP {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   Ehad1inENDCAP { 
       }
-      hist photonEtCbLoose_ENDCAP {
+      hist   CoreEMinENDCAP { 
       }
-      hist photonEtaCbLoose_ENDCAP {
+      hist   F0inENDCAP { 
       }
-      hist photonPhiCbLoose_ENDCAP {
+      hist   F1inENDCAP { 
       }
-      hist photonPtCone20CbLoose_ENDCAP {
+      hist   F2inENDCAP { 
       }
-      hist photonTopoEtCone40CbLoose_ENDCAP {
+      hist   F3inENDCAP { 
       }
-
-      # CbTight
-      hist photonNCbTight_BARREL {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   Re233e237inENDCAP { 
       }
-      hist photonEtCbTight_BARREL {
+      hist   Re237e277inENDCAP { 
       }
-      hist photonEtaCbTight_BARREL {
+      hist   Ehad1inCRACK { 
       }
-      hist photonPhiCbTight_BARREL {
+      hist   CoreEMinCRACK { 
       }
-      hist photonPtCone20CbTight_BARREL {
+      hist   F0inCRACK { 
       }
-      hist photonTopoEtCone40CbTight_BARREL {
+      hist   F1inCRACK { 
       }
-      hist photonNCbTight_CRACK {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   F2inCRACK { 
       }
-      hist photonEtCbTight_CRACK {
+      hist   F3inCRACK { 
       }
-      hist photonEtaCbTight_CRACK {
+      hist   Re233e237inCRACK { 
       }
-      hist photonPhiCbTight_CRACK {
+      hist   Re237e277inCRACK { 
       }
-      hist photonPtCone20CbTight_CRACK {
+}
+
+# CBTight
+
+dir egamma/CBTightPhotons {
+      output = egamma/photons/CBTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonTopoEtCone40CbTight_CRACK {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonNCbTight_ENDCAP {
+      hist NUnconv {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
       }
-      hist photonEtCbTight_ENDCAP {
+
+      hist Et { 
       }
-      hist photonEtaCbTight_ENDCAP {
+      hist Phi { 
       }
-      hist photonPhiCbTight_ENDCAP {
+      hist Eta { 
       }
-      hist photonPtCone20CbTight_ENDCAP {
+      hist PtCone20 { 
       }
-      hist photonTopoEtCone40CbTight_ENDCAP {
+      hist EtCone40 { 
+      }
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
+      hist Time { 
       }
-}
-
- dir egamma/photons/Unconv {
-     algorithm = egKolmogorov
-     output = egamma/photons
-     display = Draw=e1,StatBox
-
-     #CbLoose
-     hist photonNUnconvCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-     }
-     hist photonEtUnconvCbLoose {
-     }
-     hist photonEtaUnconvCbLoose {
-     }
-     hist photonPhiUnconvCbLoose {
-     }
-     hist photonEtaPhiUnconvCbLoose {
-      algorithm = egamma_BinsDiffFromStripMedian
-     }
-     hist photonTopoEtCone40UnconvCbLoose {
-     }
-     hist photonPtCone20UnconvCbLoose {
-     }
-
-     #CbTight
-     hist photonNUnconvCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-     }
-     hist photonEtUnconvCbTight {
-     }
-     hist photonEtaUnconvCbTight {
-     }
-     hist photonPhiUnconvCbTight {
-     }
-     hist photonEtaPhiUnconvCbTight {
-      algorithm = egamma_BinsDiffFromStripMedian
-     }
-     hist photonTopoEtCone40UnconvCbTight {
-     }
-     hist photonPtCone20UnconvCbTight {
-     }
-
-}
 
+      hist EtConv { 
+      }
+      hist PhiConv { 
+      }
+      hist EtaConv { 
+      }
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
 
- dir egamma/photons/Conv {
-     algorithm = egKolmogorov
-     output = egamma/photons
-     display = Draw=e1,StatBox
+      hist EtUnconv { 
+      }
+      hist PhiUnconv { 
+      }
+      hist EtaUnconv { 
+      }
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
 
-     #CbLoose
-     hist photonNConvCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-     }
-     hist photonEtConvCbLoose {
-     }
-     hist photonEtaConvCbLoose {
-     }
-     hist photonPhiConvCbLoose {
-     }
-     hist photonEtaPhiConvCbLoose {
-      algorithm = egamma_BinsDiffFromStripMedian
-     }
-     hist photonTopoEtCone40ConvCbLoose {
-     }
-     hist photonPtCone20ConvCbLoose {
-     }
-     #CbTight
-     hist photonNConvCbTight {
-     }
-     hist photonEtConvCbTight {
-     }
-     hist photonEtaConvCbTight {
-     }
-     hist photonPhiConvCbTight {
-     }
-     hist photonEtaPhiConvCbTight {
-      algorithm = egamma_BinsDiffFromStripMedian
-     }
-     hist photonTopoEtCone40ConvCbTight {
-     }
-     hist photonPtCone20ConvCbTight {
-     }
 }
 
- dir egamma/photons/ID {
-     algorithm = egKolmogorov
-     output = egamma/photons/ID
-     display = Draw=e1,StatBox
+dir egamma/CBTightPhotons/Expert {
+      output = egamma/photons/CBTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
 
-      #CbLoose
-      hist photonEhad1CbLoose_BARREL {
+      hist EtainBARREL { 
       }
-      hist photonCoreEMCbLoose_BARREL {
+      hist PhiinBARREL { 
       }
-      hist photonF0CbLoose_BARREL {
+      hist TimeinBARREL { 
       }
-      hist photonF1CbLoose_BARREL {
+      hist RConvinBARREL { 
       }
-      hist photonF2CbLoose_BARREL {
+      hist ConvTypeinBARREL { 
       }
-      hist photonF3CbLoose_BARREL {
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonRe233e237CbLoose_BARREL {
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonRe237e277CbLoose_BARREL {
+
+      hist EtainENDCAP { 
       }
-      hist photonEhad1CbLoose_CRACK {
+      hist PhiinENDCAP { 
       }
-      hist photonCoreEMCbLoose_CRACK {
+      hist TimeinENDCAP { 
       }
-      hist photonF0CbLoose_CRACK {
+      hist RConvinENDCAP { 
       }
-      hist photonF1CbLoose_CRACK {
+      hist ConvTypeinENDCAP { 
       }
-      hist photonF2CbLoose_CRACK {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
       }
-      hist photonF3CbLoose_CRACK {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonRe233e237CbLoose_CRACK {
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonRe237e277CbLoose_CRACK {
+
+      hist EtainCRACK { 
       }
-      hist photonEhad1CbLoose_ENDCAP {
+      hist PhiinCRACK { 
       }
-      hist photonCoreEMCbLoose_ENDCAP {
+      hist TimeinCRACK { 
       }
-      hist photonF0CbLoose_ENDCAP {
+      hist RConvinCRACK { 
       }
-      hist photonF1CbLoose_ENDCAP {
+      hist ConvTypeinCRACK { 
       }
-      hist photonF2CbLoose_ENDCAP {
+}
+
+dir egamma/CBTightPhotons/byLB {
+      output = egamma/photons/CBTight/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist photonF3CbLoose_ENDCAP {
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist photonRe233e237CbLoose_ENDCAP {
+      hist    LBEvoN { 
       }
-      hist photonRe237e277CbLoose_ENDCAP {
+      hist    Conversion_fraction_vs_LB { 
       }
-      #CbTight
-      hist photonEhad1CbTight_BARREL {
+
+}
+
+dir egamma/CBTightPhotons/ID {
+     algorithm = egKolmogorov
+     output = egamma/photons/CBTight/Expert/ID
+     display = Draw=e1,StatBox
+      hist   Ehad1inBARREL { 
       }
-      hist photonCoreEMCbTight_BARREL {
+      hist   CoreEMinBARREL { 
       }
-      hist photonF0CbTight_BARREL {
+      hist   F0inBARREL { 
       }
-      hist photonF1CbTight_BARREL {
+      hist   F1inBARREL { 
       }
-      hist photonF2CbTight_BARREL {
+      hist   F2inBARREL { 
       }
-      hist photonF3CbTight_BARREL {
+      hist   F3inBARREL { 
       }
-      hist photonRe233e237CbTight_BARREL {
+      hist   Re233e237inBARREL { 
       }
-      hist photonRe237e277CbTight_BARREL {
+      hist   Re237e277inBARREL { 
       }
-      hist photonEhad1CbTight_CRACK {
+      hist   Ehad1inENDCAP { 
       }
-      hist photonCoreEMCbTight_CRACK {
+      hist   CoreEMinENDCAP { 
       }
-      hist photonF0CbTight_CRACK {
+      hist   F0inENDCAP { 
       }
-      hist photonF1CbTight_CRACK {
+      hist   F1inENDCAP { 
       }
-      hist photonF2CbTight_CRACK {
+      hist   F2inENDCAP { 
       }
-      hist photonF3CbTight_CRACK {
+      hist   F3inENDCAP { 
       }
-      hist photonRe233e237CbTight_CRACK {
+      hist   Re233e237inENDCAP { 
       }
-      hist photonRe237e277CbTight_CRACK {
+      hist   Re237e277inENDCAP { 
       }
-      hist photonEhad1CbTight_ENDCAP {
+      hist   Ehad1inCRACK { 
       }
-      hist photonCoreEMCbTight_ENDCAP {
+      hist   CoreEMinCRACK { 
       }
-      hist photonF0CbTight_ENDCAP {
+      hist   F0inCRACK { 
       }
-      hist photonF1CbTight_ENDCAP {
+      hist   F1inCRACK { 
       }
-      hist photonF2CbTight_ENDCAP {
+      hist   F2inCRACK { 
       }
-      hist photonF3CbTight_ENDCAP {
+      hist   F3inCRACK { 
       }
-      hist photonRe233e237CbTight_ENDCAP {
+      hist   Re233e237inCRACK { 
       }
-      hist photonRe237e277CbTight_ENDCAP {
+      hist   Re237e277inCRACK { 
       }
 }
 
- dir egamma/photons/Region {
-     algorithm = egKolmogorov
-     output = egamma/photons/EXPERT
-     display = Draw=e1,StatBox
+# CBTightWithTrigger
 
-      # CbLoose
-      hist photonConvTrkMatch1CbLoose_BARREL {
+dir egamma/CBTightPhotonsWithTrigger {
+      output = egamma/photonsWithTrigger/CBTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonConvTrkMatch2CbLoose_BARREL {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonConvTypeCbLoose_BARREL {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonConvTrkMatch1CbLoose_CRACK {
+
+      hist Et { 
       }
-      hist photonConvTrkMatch2CbLoose_CRACK {
+      hist Phi { 
       }
-      hist photonConvTypeCbLoose_CRACK {
+      hist Eta { 
       }
-      hist photonConvTrkMatch1CbLoose_ENDCAP {
+      hist PtCone20 { 
       }
-      hist photonConvTrkMatch2CbLoose_ENDCAP {
+      hist EtCone40 { 
       }
-      hist photonConvTypeCbLoose_ENDCAP {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      # CbTight
-      hist photonConvTrkMatch1CbTight_BARREL {
+      hist Time { 
       }
-      hist photonConvTrkMatch2CbTight_BARREL {
+
+      hist EtConv { 
       }
-      hist photonConvTypeCbTight_BARREL {
+      hist PhiConv { 
       }
-      hist photonConvTrkMatch1CbTight_CRACK {
+      hist EtaConv { 
       }
-      hist photonConvTrkMatch2CbTight_CRACK {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist photonConvTypeCbTight_CRACK {
+
+      hist EtUnconv { 
       }
-      hist photonConvTrkMatch1CbTight_ENDCAP {
+      hist PhiUnconv { 
       }
-      hist photonConvTrkMatch2CbTight_ENDCAP {
+      hist EtaUnconv { 
       }
-      hist photonConvTypeCbTight_ENDCAP {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
- }
 
+}
 
- dir egamma/photons/LBMon {
-     algorithm = egamma_GatherData
-     output = egamma/photons/LBMon
-     display = Draw=e1,StatBox
-      # CbLoose
-      hist LBEvoNPhotonsCbLoose {
+dir egamma/CBTightPhotonsWithTrigger/Expert {
+      output = egamma/photonsWithTrigger/CBTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist EtainBARREL { 
+      }
+      hist PhiinBARREL { 
+      }
+      hist TimeinBARREL { 
+      }
+      hist RConvinBARREL { 
+      }
+      hist ConvTypeinBARREL { 
+      }
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
+      }
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+
+      hist EtainENDCAP { 
+      }
+      hist PhiinENDCAP { 
+      }
+      hist TimeinENDCAP { 
+      }
+      hist RConvinENDCAP { 
       }
-      hist LBEvoNPhotonsUnconvCbLoose {
+      hist ConvTypeinENDCAP { 
       }
-      hist LBEvoNPhotonsConvCbLoose {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist LBEvoConvOverNCbLoose {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
+      }
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
 
-      # CbTight
-      hist LBEvoNPhotonsCbTight {
+      hist EtainCRACK { 
       }
-      hist LBEvoNPhotonsUnconvCbTight {
+      hist PhiinCRACK { 
       }
-      hist LBEvoNPhotonsConvCbTight {
+      hist TimeinCRACK { 
       }
-      hist LBEvoConvOverNCbTight {
+      hist RConvinCRACK { 
+      }
+      hist ConvTypeinCRACK { 
       }
 }
 
+dir egamma/CBTightPhotonsWithTrigger/byLB {
+      output = egamma/photonsWithTrigger/CBTight/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist    Number_of_Unconv._photons_vs_LB { 
+      }
+      hist    Number_of_Conv._photons_vs_LB { 
+      }
+      hist    LBEvoN { 
+      }
+      hist    Conversion_fraction_vs_LB { 
+      }
 
-### forwardElectrons
+}
 
- dir egamma/forwardElectrons {
+dir egamma/CBTightPhotonsWithTrigger/ID {
      algorithm = egKolmogorov
-     output = egamma/forwardElectrons
+     output = egamma/photonsWithTrigger/CBTight/Expert/ID
      display = Draw=e1,StatBox
 
-      hist forwardElectronN {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   Ehad1inBARREL { 
       }
-      hist forwardElectronEt {
+      hist   CoreEMinBARREL { 
       }
-      hist forwardElectronPhi {
+      hist   F0inBARREL { 
       }
-      hist forwardElectronEta {
+      hist   F1inBARREL { 
       }
-      hist forwardElectronEtaPhi {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist   F2inBARREL { 
       }
-      # hist forwardElectronTopoEtCone40 {
-      # }
-      hist forwardElectronTime {
+      hist   F3inBARREL { 
       }
-
-      hist forwardElectronTightN {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   Re233e237inBARREL { 
       }
-      hist forwardElectronTightEt {
+      hist   Re237e277inBARREL { 
       }
-      hist forwardElectronTightPhi {
+      hist   Ehad1inENDCAP { 
       }
-      hist forwardElectronTightEta {
+      hist   CoreEMinENDCAP { 
       }
-      hist forwardElectronTightEtaPhi {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist   F0inENDCAP { 
+      }
+      hist   F1inENDCAP { 
+      }
+      hist   F2inENDCAP { 
+      }
+      hist   F3inENDCAP { 
+      }
+      hist   Re233e237inENDCAP { 
+      }
+      hist   Re237e277inENDCAP { 
+      }
+      hist   Ehad1inCRACK { 
+      }
+      hist   CoreEMinCRACK { 
+      }
+      hist   F0inCRACK { 
+      }
+      hist   F1inCRACK { 
+      }
+      hist   F2inCRACK { 
+      }
+      hist   F3inCRACK { 
       }
-      # hist forwardElectronTightTopoEtCone40 {
-      # }
-      hist forwardElectronTightTime {
+      hist   Re233e237inCRACK { 
       }
+      hist   Re237e277inCRACK { 
+      }
+}
+
+
+########################################
+### forwardElectrons
+########################################
+
+# CB Loose Forward Electrons
+
+dir egamma/CBLooseFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/CBLoose
+     display = Draw=e1,StatBox
+     hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+
+     hist Et { 
+     }
+     hist Phi { 
+     }
+     hist Eta { 
+     }
+     hist Time { 
+     }
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
+     }
+}
 
+dir egamma/CBLooseFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/CBLoose
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
+     }
+     hist FracMax { 
+     }
+     hist Lateral { 
+     }
+     hist Longitudinal { 
+     }
+     hist SecondLambda { 
+     }
+     hist SecondR { 
+     }
+     hist CenterLambda { 
+     }
 }
 
 
- dir egamma/forwardElectrons {
-      Algorithm = Egkolmogorov
-      Output = egamma/forwardElectrons/EXPERT
+dir egamma/CBLooseFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/CBLoose/Expert
       display = Draw=e1,StatBox
-      hist forwardElectronN_ENDCAP {
-       algorithm = egamma_Histogram_Not_Empty
+
+      hist NinENDCAP { 
        display = Draw=e1,StatBox,LogY
       }
-      hist forwardElectronEt_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist forwardElectronEta_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
       }
-      hist forwardElectronPhi_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
+      hist EtainENDCAP { 
       }
-      # hist forwardElectronTopoEtCone40_ENDCAP {
-      # output = egamma/forwardElectrons/EXPERT
-      # }
-      hist forwardElectronTime_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
+      hist PhiinENDCAP { 
       }
-      hist forwardElectronTightN_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
+      hist TimeinENDCAP { 
       }
-      hist forwardElectronTightEt_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
+      hist EtainFORWARD { 
       }
-      hist forwardElectronTightEta_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
+      hist PhiinFORWARD { 
       }
-      hist forwardElectronTightPhi_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
+      hist TimeinFORWARD { 
       }
-      #hist forwardElectronTightTopoEtCone40_ENDCAP {
-      # output = egamma/forwardElectrons/EXPERT
-      # }
-      hist forwardElectronN_FORWARD {
+}
+
+# CBTight Forward Electrons
+
+dir egamma/CBTightFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/CBTight
+     display = Draw=e1,StatBox
+     hist N {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
-       output = egamma/forwardElectrons/EXPERT	
+     }
+     hist Et { 
+     }
+     hist Phi { 
+     }
+     hist Eta { 
+     }
+     hist Time { 
+     }
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
+     }
+}
+
+dir egamma/CBTightFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/CBTight
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
+     }
+     hist FracMax { 
+     }
+     hist Lateral { 
+     }
+     hist Longitudinal { 
+     }
+     hist SecondLambda { 
+     }
+     hist SecondR { 
+     }
+     hist CenterLambda { 
+     }
+}
+
+dir egamma/CBTightFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/CBTight/Expert
+      display = Draw=e1,StatBox
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist forwardElectronEt_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist forwardElectronEta_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
       }
-      hist forwardElectronPhi_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
+      hist EtainENDCAP { 
       }
-      # hist forwardElectronTopoEtCone40_FORWARD {
-      # output = egamma/forwardElectrons/EXPERT
-      # }
-      hist forwardElectronTime_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
+      hist PhiinENDCAP { 
       }
-      hist forwardElectronTightN_FORWARD {
-       output = egamma/forwardElectrons/EXPERT
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist TimeinENDCAP { 
       }
-      hist forwardElectronTightEt_FORWARD {
-       output = egamma/forwardElectrons/EXPERT
+      hist EtainFORWARD { 
       }
-      hist forwardElectronTightEta_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
+      hist PhiinFORWARD { 
       }
-      hist forwardElectronTightPhi_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
+      hist TimeinFORWARD { 
       }
-      # hist forwardElectronTightTopoEtCone40_FORWARD {
-      # output = egamma/forwardElectrons/EXPERT
-      # }
 }
 
-dir egamma/forwardElectrons/ID {
+# LH Loose Forward Electrons
+
+dir egamma/LHLooseFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/LHLoose
+     display = Draw=e1,StatBox
+     hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+     hist Et { 
+     }
+     hist Phi { 
+     }
+     hist Eta { 
+     }
+     hist Time { 
+     }
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
+     }
+}
+
+dir egamma/LHLooseFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/LHLoose 
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
+     }
+     hist FracMax { 
+     }
+     hist Lateral { 
+     }
+     hist Longitudinal { 
+     }
+     hist SecondLambda { 
+     }
+     hist SecondR { 
+     }
+     hist CenterLambda { 
+     }
+}
+
+
+dir egamma/LHLooseFwdElectrons/Expert {
       algorithm = egKolmogorov
-      output = egamma/forwardElectrons/ID
-      hist forwardElectronENG_DENS_ENDCAP {
+      output = egamma/forwardElectrons/LHLoose/Expert
+      display = Draw=e1,StatBox
+
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist forwardElectronFRAC_MAX_ENDCAP {
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
+      }
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
+      }
+      hist EtainENDCAP { 
+      }
+      hist PhiinENDCAP { 
       }
-      hist forwardElectronLONGITUDINAL_ENDCAP {
+      hist TimeinENDCAP { 
       }
-      hist forwardElectron2ND_LAMBDA_ENDCAP {
+      hist EtainFORWARD { 
       }
-      hist forwardElectronLATERAL_ENDCAP {
+      hist PhiinFORWARD { 
       }
-      hist forwardElectron2ND_R_ENDCAP {
+      hist TimeinFORWARD { 
+      }
+}
+
+# LHTight Forward Electrons
+
+dir egamma/LHTightFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/LHTight
+     display = Draw=e1,StatBox
+     hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+     hist Et { 
+     }
+     hist Phi { 
+     }
+     hist Eta { 
+     }
+     hist Time { 
+     }
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
+     }
+}
+
+dir egamma/LHTightFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/LHTight
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
+     }
+     hist FracMax { 
+     }
+     hist Lateral { 
+     }
+     hist Longitudinal { 
+     }
+     hist SecondLambda { 
+     }
+     hist SecondR { 
+     }
+     hist CenterLambda { 
+     }
+}
+
+dir egamma/LHTightFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/LHTight/Expert
+      display = Draw=e1,StatBox
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist forwardElectronCENTER_LAMBDA_ENDCAP {
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist forwardElectronENG_DENS_FORWARD {
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
       }
-      hist forwardElectronFRAC_MAX_FORWARD {
+      hist EtainENDCAP { 
       }
-      hist forwardElectronLONGITUDINAL_FORWARD {
+      hist PhiinENDCAP { 
       }
-      hist forwardElectron2ND_LAMBDA_FORWARD {
+      hist TimeinENDCAP { 
       }
-      hist forwardElectronLATERAL_FORWARD {
+      hist EtainFORWARD { 
       }
-      hist forwardElectron2ND_R_FORWARD {
+      hist PhiinFORWARD { 
       }
-      hist forwardElectronCENTER_LAMBDA_FORWARD {
+      hist TimeinFORWARD { 
       }
 }
 
+### Tag&Probe Z
 
+dir egamma/TnPZ/TnPCandidate {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeZ
+     display = Draw=e1,StatBox
+     hist Z_candidate_mass {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
+     hist Z_candidate_mass_distribution_Lead_in_Barrel {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
+     hist Number_of_Z_candidates_vs_eta_leading_e {
+     }
+     hist Number_of_Z_candidates_vs_phi_leading_e {
+     }
+     hist Z_candidate_mass_distribution_Lead_in_Crack {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
+     hist Z_candidate_mass_distribution_Lead_in_EndCap {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
+}
+
+dir egamma/TnPZ/ID {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeZ/ID
+     display = Draw=e1,StatBox
+
+     hist Ehad1ProbeinBARREL { 
+     }
+     hist EoverPProbeinBARREL { 
+     }
+     hist CoreEMProbeinBARREL { 
+     }
+     hist F0ProbeinBARREL { 
+     }
+     hist F1ProbeinBARREL { 
+     }
+     hist F2ProbeinBARREL { 
+     }
+     hist F3ProbeinBARREL { 
+     }
+     hist Re233e237ProbeinBARREL { 
+     }
+     hist Re237e277ProbeinBARREL { 
+     }
+     hist Ehad1ProbeinENDCAP { 
+     }
+     hist EoverPProbeinENDCAP { 
+     }
+     hist CoreEMProbeinENDCAP { 
+     }
+     hist F0ProbeinENDCAP { 
+     }
+     hist F1ProbeinENDCAP { 
+     }
+     hist F2ProbeinENDCAP { 
+     }
+     hist F3ProbeinENDCAP { 
+     }
+     hist Re233e237ProbeinENDCAP { 
+     }
+     hist Re237e277ProbeinENDCAP { 
+     }
+
+}
+
+dir egamma/TnPZ/Tracks { 
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeZ/Track
+     display = Draw=e1,StatBox
+     hist NOfBLayerHitsProbeinBARREL { 
+     }
+     hist NOfPixelHitsProbeinBARREL { 
+     }
+     hist NOfSCTHitsProbeinBARREL { 
+     }
+     hist NOfTRTHitsProbeinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsProbeinBARREL { 
+     }
+     hist DeltaEta1ProbeinBARREL { 
+     }
+     hist DeltaPhi2ProbeinBARREL { 
+     }
+     hist Trackd0ProbeinBARREL { 
+     }
+     hist NOfBLayerHitsProbeinENDCAP { 
+     }
+     hist NOfPixelHitsProbeinENDCAP { 
+     }
+     hist NOfSCTHitsProbeinENDCAP { 
+     }
+     hist NOfTRTHitsProbeinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsProbeinENDCAP { 
+     }
+     hist DeltaEta1ProbeinENDCAP { 
+     }
+     hist DeltaPhi2ProbeinENDCAP { 
+     }
+     hist Trackd0ProbeinENDCAP { 
+     }
+
+ }
+
+dir egamma/TnPZ/Efficiencies {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeZ
+     display = Draw=e1,StatBox
+
+     hist TnP_ID_efficiency_vs_etprobe { 
+     }
+     hist TnP_ID_efficiency_vs_etaprobe { 
+     }
+     hist TnP_ID_efficiency_vs_phiprobe { 
+     }
+     hist TnP_Calo_Iso_efficiency_vs_etprobe { 
+     }
+     hist TnP_Calo_Iso_efficiency_vs_etaprobe { 
+     }
+     hist TnP_Calo_Iso_efficiency_vs_phiprobe { 
+     }
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etprobe { 
+     }
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etaprobe { 
+     }
+     hist TnP_Calo_Iso_and_LHTight_ID_efficiency_vs_phiprobe { 
+     }
+      
+}
+
+dir egamma/TnPZ/TnPCandidate {
+    algorithm = egamma_GatherData
+    output = egamma/tagandprobeZ/LBMon
+    display = Draw=e1,StatBox
+
+    hist Number_of_Z_candidates_vs_LB { 
+    }
+
+}
+
+### Tag&Probe JPsi
+
+dir egamma/TnPJPsi/TnPCandidate {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeJPsi
+     display = Draw=e1,StatBox
+
+     hist JPsi_candidate_mass {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
+     }
+     hist JPsi_candidate_mass_distribution_Lead_in_Barrel {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
+     }
+     hist Number_of_JPsi_candidates_vs_eta_leading_e {
+     }
+     hist Number_of_JPsi_candidates_vs_phi_leading_e {
+     }
+     hist JPsi_candidate_mass_distribution_Lead_in_Crack {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
+     }
+     hist JPsi_candidate_mass_distribution_Lead_in_EndCap {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
+     }
+
+}
+
+dir egamma/TnPJPsi/ID {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeJPsi/ID
+     display = Draw=e1,StatBox
+
+     hist Ehad1ProbeinBARREL { 
+     }
+     hist EoverPProbeinBARREL { 
+     }
+     hist CoreEMProbeinBARREL { 
+     }
+     hist F0ProbeinBARREL { 
+     }
+     hist F1ProbeinBARREL { 
+     }
+     hist F2ProbeinBARREL { 
+     }
+     hist F3ProbeinBARREL { 
+     }
+     hist Re233e237ProbeinBARREL { 
+     }
+     hist Re237e277ProbeinBARREL { 
+     }
+     hist Ehad1ProbeinENDCAP { 
+     }
+     hist EoverPProbeinENDCAP { 
+     }
+     hist CoreEMProbeinENDCAP { 
+     }
+     hist F0ProbeinENDCAP { 
+     }
+     hist F1ProbeinENDCAP { 
+     }
+     hist F2ProbeinENDCAP { 
+     }
+     hist F3ProbeinENDCAP { 
+     }
+     hist Re233e237ProbeinENDCAP { 
+     }
+     hist Re237e277ProbeinENDCAP { 
+     }
+
+}
+
+dir egamma/TnPJPsi/Tracks { 
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeJPsi/Track
+     display = Draw=e1,StatBox
+
+     hist NOfBLayerHitsProbeinBARREL { 
+     }
+     hist NOfPixelHitsProbeinBARREL { 
+     }
+     hist NOfSCTHitsProbeinBARREL { 
+     }
+     hist NOfTRTHitsProbeinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsProbeinBARREL { 
+     }
+     hist DeltaEta1ProbeinBARREL { 
+     }
+     hist DeltaPhi2ProbeinBARREL { 
+     }
+     hist Trackd0ProbeinBARREL { 
+     }
+     hist NOfBLayerHitsProbeinENDCAP { 
+     }
+     hist NOfPixelHitsProbeinENDCAP { 
+     }
+     hist NOfSCTHitsProbeinENDCAP { 
+     }
+     hist NOfTRTHitsProbeinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsProbeinENDCAP { 
+     }
+     hist DeltaEta1ProbeinENDCAP { 
+     }
+     hist DeltaPhi2ProbeinENDCAP { 
+     }
+     hist Trackd0ProbeinENDCAP { 
+     }
+
+ }
+
+dir egamma/TnPJPsi/Efficiencies {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeJPsi
+     display = Draw=e1,StatBox
+
+     hist TnP_ID_efficiency_vs_etprobe { 
+     }
+     hist TnP_ID_efficiency_vs_etaprobe { 
+     }
+     hist TnP_ID_efficiency_vs_phiprobe { 
+     }
+     hist TnP_Calo_Iso_efficiency_vs_etprobe { 
+     }
+     hist TnP_Calo_Iso_efficiency_vs_etaprobe { 
+     }
+     hist TnP_Calo_Iso_efficiency_vs_phiprobe { 
+     }
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etprobe { 
+     }
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etaprobe { 
+     }
+     hist TnP_Calo_Iso_and_LHTight_ID_efficiency_vs_phiprobe { 
+     } 
+}
+
+dir egamma/TnPJPsi/TnPCandidate {
+    algorithm = egamma_GatherData
+    output = egamma/tagandprobeJPsi/LBMon
+    display = Draw=e1,StatBox
+
+    hist Number_of_JPsi_candidates_vs_LB { 
+    }
 
+}
\ No newline at end of file
diff --git a/DataQuality/DataQualityConfigurations/config/Egamma/heavyions_run.config b/DataQuality/DataQualityConfigurations/config/Egamma/heavyions_run.config
index 02e36f8d5a72..31a1c2b2877c 100644
--- a/DataQuality/DataQualityConfigurations/config/Egamma/heavyions_run.config
+++ b/DataQuality/DataQualityConfigurations/config/Egamma/heavyions_run.config
@@ -1,5 +1,5 @@
 # **********************************************************************
-# $Id: heavyions_run.config 781943 2016-11-02 16:47:25Z xhoad $
+# $Id: collisions_run.config 777627 2016-10-11 10:49:51Z nproklov $
 # **********************************************************************
 
 ############################################################
@@ -101,7 +101,6 @@ algorithm 2D_Histogram_Not_Empty {
   reference = stream=physics_Main:CentrallyManagedReferences_Main;CentrallyManagedReferences
 }
 
-
 algorithm egamma_FitZmass {
   libname = libdqm_algorithms.so
   name = Simple_gaus_Fit
@@ -113,8 +112,8 @@ algorithm egamma_FitZmass {
 algorithm egamma_FitJPsimass {
   libname = libdqm_algorithms.so
   name = Simple_gaus_Fit
-  xmin = 3000.
-  xmax = 5000. 
+  xmin = 2500.
+  xmax = 3500. 
   thresholds = egamma_FitJPsimass_Thresholds
 }
 
@@ -123,3172 +122,2117 @@ algorithm egamma_FitJPsimass {
 #############
 
 output top_level {
-  algorithm = WorstCaseSummary
+#  algorithm = WorstCaseSummary
   output egamma {
-   algorithm = WorstCaseSummary
+# Photons
    output photons { 
-    algorithm = WorstCaseSummary
-    output EXPERT { 
-    algorithm = WorstCaseSummary
-    }
-    output ID {
-    algorithm = WorstCaseSummary
-    }
-    output LBMon {
-    algorithm = WorstCaseSummary
+    output CBLoose {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
+   }
+   output CBTight {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
     }
    }
    output photonsWithTrigger { 
-    algorithm = WorstCaseSummary
-    output EXPERT { 
-    algorithm = WorstCaseSummary
-    }
-    output ID {
-    algorithm = WorstCaseSummary
+    output CBLoose {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
     }
-    output LBMon {
-    algorithm = WorstCaseSummary
+    output CBTight {
+     output Expert { 
+      output ID {
+      }
+      output LBMon {
+      }
+     }
     }
    }
+  
+# Electrons
    output electrons {
-    algorithm = WorstCaseSummary
-    output EXPERT {
-    algorithm = WorstCaseSummary  
-    }
-    output ID {
-    algorithm = WorstCaseSummary
-    }
-    output Track {
-    algorithm = WorstCaseSummary
+    output LHLoose {
+     output Expert {
+      output ID {
+      }
+      output Track {
+      }
+      output LBMon {
+      }
+     }
     }
-    output LBMon {
-    algorithm = WorstCaseSummary
+    output LHTight {
+     output Expert {
+      output ID {
+      }
+      output Track {
+      }
+      output LBMon {
+      }     
+     }
     }
    }
    output electronsWithTrigger {
-    algorithm = WorstCaseSummary
-    output EXPERT {
-    algorithm = WorstCaseSummary  
+    output LHLoose {
+     output Expert {
+      output ID {
+      }
+      output Track {
+      }
+      output LBMon {
+      }
     }
-    output ID {
-    algorithm = WorstCaseSummary
+   }
+   output LHTight {
+    output Expert {
+     output ID {
+     }
+     output Track {
+     }
+     output LBMon {
+     }    
     }
-    output Track {
-    algorithm = WorstCaseSummary
+   }
+  }
+
+# FwdElectrons
+  output forwardElectrons {
+   output LHTight {
+    output Expert {
     }
-    output LBMon {
-    algorithm = WorstCaseSummary
+   }
+   output LHLoose {
+    output Expert {
     }
    }
-   output forwardElectrons {
-    algorithm = WorstCaseSummary
-    output ID {
-    algorithm = WorstCaseSummary
+   output CBLoose {
+    output Expert {
     }
-    output EXPERT {
-    algorithm = WorstCaseSummary
+   }
+   output CBTight {
+    output Expert {
     }
    }
-   output tagandprobeZ {
-    algorithm = WorstCaseSummary
+  }
+   
+# T&P 
+  output tagandprobeZ {
     output ID {
-    algorithm = WorstCaseSummary  
     }
     output Track {
-    algorithm = WorstCaseSummary
     }
     output LBMon {
-    algorithm = WorstCaseSummary
     }
    }
    output tagandprobeJPsi {
-    algorithm = WorstCaseSummary
     output ID {
-    algorithm = WorstCaseSummary  
     }
     output Track {
-    algorithm = WorstCaseSummary
     }
     output LBMon {
-    algorithm = WorstCaseSummary
     }
    }
- }
+  }
 }
 
 #######################
 # Histogram Assessments
 #######################
 
- dir egamma/electrons {
-      output = egamma/electrons
+##################################
+# Electrons
+#################################@
 
-      # CbLoose
-      hist electronNCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist electronEtCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPtCone20CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
+# LhLoose
 
-      # CbTight
-      hist electronNCbTight {
+dir egamma/LHLooseElectrons {
+      output = egamma/electrons/LHLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
       }
-      hist electronEtCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPtCone20CbTight {
-       algorithm = egKolmogorov
-      } 
-      hist electronTopoEtCone40CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-
-      # LhLoose
-      hist electronNLhLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist Et { 
       }
-      hist electronEtLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVLhLoose {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist Eta { 
       }
-      hist electronEtaPhiPtgt4GeVLhLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist Phi { 
       }
-      hist electronEtaPhiPtgt20GeVLhLoose {
-       output = egamma/electrons/EXPERT
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronPtCone20LhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40LhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronNLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      } 
-      hist electronEtLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaPhiPtgt2.5GeVLhLoose {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist electronEtaPhiPtgt4GeVLhLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist TopoEtCone40 { 
       }
-      hist electronEtaPhiPtgt20GeVLhLoose {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist PtCone20 { 
       }
-      hist electronPtCone20LhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist Time { 
       }
-      hist electronTopoEtCone40LhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+}
+
+dir egamma/LHLooseElectrons/Expert {
+      output = egamma/electrons/LHLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist EtainENDCAP { 
       }
-      hist electronTimeLhLoose_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist PhiinENDCAP { 
       }
-
-      # LhMedium
-      hist electronNLhMedium {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist TimeinENDCAP { 
       }
-      hist electronEtLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVLhMedium {
-       output = egamma/electrons/EXPERT
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
        algorithm = 2D_Histogram_Not_Empty
-      #  algorithm = egamma_BinsDiffFromStripMedian
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEtaPhiPtgt4GeVLhMedium {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEtaPhiPtgt20GeVLhMedium {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
-      }
-      hist electronPtCone20LhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40LhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronNLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      } 
-      hist electronEtLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-
-      # LhTight
-      hist electronNLhTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist EtainBARREL { 
       }
-      hist electronEtLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist PhiinBARREL { 
       }
-      hist electronPhiLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist TimeinBARREL { 
       }
-      hist electronEtaLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist EtainCRACK { 
       }
-      hist electronEtaPhiPtgt2.5GeVLhTight {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist PhiinCRACK { 
       }
-      hist electronEtaPhiPtgt4GeVLhTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist TimeinCRACK { 
       }
-      hist electronEtaPhiPtgt20GeVLhTight {
-       output = egamma/electrons/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
+}
+
+dir egamma/LHLooseElectrons/byLB {
+      output = egamma/electrons/LHLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist LBEvoN { 
       }
-      hist electronPtCone20LhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_BARREL {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_CRACK {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_ENDCAP {
-       output = egamma/electrons/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-}
-
- dir egamma/electrons/ID {
+}
+
+dir egamma/LHLooseElectrons/ID {
+     algorithm = egKolmogorov
+     output = egamma/electrons/LHLoose/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHLooseElectrons/Tracks {
      algorithm = egKolmogorov
-     output = egamma/electrons/ID
+     output = egamma/electrons/LHLoose/Expert/Track
      display = Draw=e1,StatBox
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+}
 
-     # LhLoose
-      hist electronEhad1LhLoose_BARREL {
-      }
-      hist electronEoverPLhLoose_BARREL {
+# LhLooseWithTrigger
+
+dir egamma/LHLooseElectronsWithTrigger {
+      output = egamma/electronsWithTrigger/LHLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronCoreEMLhLoose_BARREL {
+      hist Et { 
       }
-      hist electronF0LhLoose_BARREL {
+      hist Eta { 
       }
-      hist electronF1LhLoose_BARREL {
+      hist Phi { 
       }
-      hist electronF2LhLoose_BARREL {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF3LhLoose_BARREL {
+      hist TopoEtCone40 { 
       }
-      hist electronRe233e237LhLoose_BARREL {
+      hist PtCone20 { 
       }
-      hist electronRe237e277LhLoose_BARREL {
+      hist Time { 
       }
-      hist electronEhad1LhLoose_CRACK {
+}
+
+dir egamma/LHLooseElectronsWithTrigger/Expert {
+      output = egamma/electronsWithTrigger/LHLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
       }
-      hist electronEoverPLhLoose_CRACK {
+      hist Eta_Phi_with_Pt_gt_20GeV { 
       }
-      hist electronCoreEMLhLoose_CRACK {
+}
+
+dir egamma/LHLooseElectronsWithTrigger/byLB {
+      output = egamma/electronsWithTrigger/LHLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist LBEvoN { 
       }
-      hist electronF0LhLoose_CRACK {
+}
+
+dir egamma/LHLooseElectronsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHLoose/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHLooseElectronsWithTrigger/Tracks {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHLoose/Expert/Track
+     display = Draw=e1,StatBox
+
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+
+}
+
+# LhTight
+
+dir egamma/LHTightElectrons {
+      output = egamma/electrons/LHTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronF1LhLoose_CRACK {
+      hist Et { 
       }
-      hist electronF2LhLoose_CRACK {
+      hist Eta { 
       }
-      hist electronF3LhLoose_CRACK {
+      hist Phi { 
       }
-      hist electronRe233e237LhLoose_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronRe237e277LhLoose_CRACK {
+      hist TopoEtCone40 { 
       }
-      hist electronEhad1LhLoose_ENDCAP {
+      hist PtCone20 { 
       }
-      hist electronEoverPLhLoose_ENDCAP {
+      hist Time { 
       }
-      hist electronCoreEMLhLoose_ENDCAP {
+}
+
+dir egamma/LHTightElectrons/Expert {
+      output = egamma/electrons/LHTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist EtainENDCAP { 
       }
-      hist electronF0LhLoose_ENDCAP {
+      hist PhiinENDCAP { 
       }
-      hist electronF1LhLoose_ENDCAP {
+      hist TimeinENDCAP { 
       }
-      hist electronF2LhLoose_ENDCAP {
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronF3LhLoose_ENDCAP {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronRe233e237LhLoose_ENDCAP {
+      hist EtainBARREL { 
       }
-      hist electronRe237e277LhLoose_ENDCAP {
+      hist PhiinBARREL { 
       }
-
-     # LhMedium
-      hist electronEhad1LhMedium_BARREL {
+      hist TimeinBARREL { 
       }
-      hist electronEoverPLhMedium_BARREL {
+      hist EtainCRACK { 
       }
-      hist electronCoreEMLhMedium_BARREL {
+      hist PhiinCRACK { 
       }
-      hist electronF0LhMedium_BARREL {
+      hist TimeinCRACK { 
       }
-      hist electronF1LhMedium_BARREL {
+}
+
+dir egamma/LHTightElectrons/byLB {
+      output = egamma/electrons/LHTight/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist LBEvON { 
       }
-      hist electronF2LhMedium_BARREL {
+}
+
+dir egamma/LHTightElectrons/ID {
+     algorithm = egKolmogorov
+     output = egamma/electrons/LHTight/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHTightElectrons/Tracks {
+     algorithm = egKolmogorov
+     output = egamma/electrons/LHTight/Expert/Track
+     Display = Draw=e1,StatBox
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+}
+
+# LhTightWithTrigger
+
+dir egamma/LHTightElectronsWithTrigger {
+      output = egamma/electronsWithTrigger/LHTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+      }
+      hist Et { 
+      } 
+      hist Eta { 
       }
-      hist electronF3LhMedium_BARREL {
+      hist Phi { 
       }
-      hist electronRe233e237LhMedium_BARREL {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronRe237e277LhMedium_BARREL {
+      hist TopoEtCone40 { 
       }
-      hist electronEhad1LhMedium_CRACK {
+      hist PtCone20 { 
       }
-      hist electronEoverPLhMedium_CRACK {
+      hist Time { 
+      }
+}
+
+dir egamma/LHTightElectronsWithTrigger/Expert {
+      output = egamma/electronsWithTrigger/LHTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist Eta_Phi_with_Pt_gt_2.5GeV { 
       }
-      hist electronCoreEMLhMedium_CRACK {
+      hist Eta_Phi_with_Pt_gt_20GeV { 
       }
-      hist electronF0LhMedium_CRACK {
+}
+
+dir egamma/LHTightElectronsWithTrigger/byLB {
+      output = egamma/electronsWithTrigger/LHTight/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist LBEvON { 
       }
-      hist electronF1LhMedium_CRACK {
+}
+
+dir egamma/LHTightElectronsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHTight/Expert/ID
+     display = Draw=e1,StatBox
+     hist Ehad1inBARREL { 
+     }
+     hist CoreEMinBARREL { 
+     }
+     hist F0inBARREL { 
+     }
+     hist F1inBARREL { 
+     }
+     hist F2inBARREL { 
+     }
+     hist F3inBARREL { 
+     }
+     hist Re237e277inBARREL { 
+     }
+     hist Ehad1inENDCAP { 
+     }
+     hist EoverPinENDCAP { 
+     }
+     hist CoreEMinENDCAP { 
+     }
+     hist Re233e237inENDCAP { 
+     }
+     hist Re237e277inENDCAP { 
+     }
+     hist Ehad1inCRACK { 
+     }
+     hist EoverPinCRACK { 
+     }
+     hist CoreEMinCRACK { 
+     }
+     hist F0inCRACK { 
+     }
+     hist F1inCRACK { 
+     }
+     hist F2inCRACK { 
+     }
+     hist F3inCRACK { 
+     }
+     hist Re233e237inCRACK { 
+     }
+     hist Re237e277inCRACK { 
+     }
+}
+
+dir egamma/LHTightElectronsWithTrigger/Tracks {
+     algorithm = egKolmogorov
+     output = egamma/electronsWithTrigger/LHTight/Expert/Track
+     display = Draw=e1,StatBox
+
+     hist NOfBLayerHitsinBARREL { 
+     }
+     hist NOfPixelHitsinBARREL { 
+     }
+     hist NOfSCTHitsinBARREL  { 
+     }
+     hist NOfTRTHitsinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsinBARREL { 
+     }
+     hist DeltaEta1inBARREL { 
+     }
+     hist DeltaPhi2inBARREL { 
+     }
+     hist Trackd0inBARREL { 
+     }
+     hist NOfBLayerHitsinENDCAP { 
+     }
+     hist NOfPixelHitsinENDCAP { 
+     }
+     hist NOfSCTHitsinENDCAP { 
+     }
+     hist NOfTRTHitsinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsinENDCAP { 
+     }
+     hist DeltaEta1inENDCAP { 
+     }
+     hist DeltaPhi2inENDCAP { 
+     }
+     hist Trackd0inENDCAP { 
+     }
+     hist NOfBLayerHitsinCRACK { 
+     }
+     hist NOfPixelHitsinCRACK { 
+     }
+     hist NOfSCTHitsinCRACK { 
+     }
+     hist NOfTRTHitsinCRACK { 
+     }
+     hist NOfTRTHighThresholdHitsinCRACK { 
+     }
+     hist DeltaEta1inCRACK { 
+     }
+     hist DeltaPhi2inCRACK { 
+     }
+     hist Trackd0inCRACK { 
+     }
+
+}
+
+
+############################################## 
+### photons
+##############################################
+
+# CBLoose
+
+dir egamma/CBLoosePhotons {
+      output = egamma/photons/CBLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronF2LhMedium_CRACK {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronF3LhMedium_CRACK {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronRe233e237LhMedium_CRACK {
+
+      hist Et { 
       }
-      hist electronRe237e277LhMedium_CRACK {
+      hist Phi { 
       }
-      hist electronEhad1LhMedium_ENDCAP {
+      hist Eta { 
       }
-      hist electronEoverPLhMedium_ENDCAP {
+      hist PtCone20 { 
       }
-      hist electronCoreEMLhMedium_ENDCAP {
+      hist EtCone40 { 
       }
-      hist electronF0LhMedium_ENDCAP {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF1LhMedium_ENDCAP {
+      hist Time { 
       }
-      hist electronF2LhMedium_ENDCAP {
+
+      hist EtConv { 
       }
-      hist electronF3LhMedium_ENDCAP {
+      hist PhiConv { 
       }
-      hist electronRe233e237LhMedium_ENDCAP {
+      hist EtaConv { 
       }
-      hist electronRe237e277LhMedium_ENDCAP {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
 
-     # LhTight
-      hist electronEhad1LhTight_BARREL {
+      hist EtUnconv { 
+      }
+      hist PhiUnconv { 
       }
-      hist electronEoverPLhTight_BARREL {
+      hist EtaUnconv { 
       }
-      hist electronCoreEMLhTight_BARREL {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF0LhTight_BARREL {
+
+
+}
+
+dir egamma/CBLoosePhotons/Expert {
+      output = egamma/photons/CBLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+
+      hist EtainBARREL { 
       }
-      hist electronF1LhTight_BARREL {
+      hist PhiinBARREL { 
       }
-      hist electronF2LhTight_BARREL {
+      hist TimeinBARREL { 
       }
-      hist electronF3LhTight_BARREL {
+      hist RConvinBARREL { 
       }
-      hist electronRe233e237LhTight_BARREL {
+      hist ConvTypeinBARREL { 
       }
-      hist electronRe237e277LhTight_BARREL {
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronEhad1LhTight_CRACK {
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEoverPLhTight_CRACK {
+
+      hist EtainENDCAP { 
       }
-      hist electronCoreEMLhTight_CRACK {
+      hist PhiinENDCAP { 
       }
-      hist electronF0LhTight_CRACK {
+      hist TimeinENDCAP { 
       }
-      hist electronF1LhTight_CRACK {
+      hist RConvinENDCAP { 
       }
-      hist electronF2LhTight_CRACK {
+      hist ConvTypeinENDCAP { 
       }
-      hist electronF3LhTight_CRACK {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronRe233e237LhTight_CRACK {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronRe237e277LhTight_CRACK {
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronEhad1LhTight_ENDCAP {
+
+      hist EtainCRACK { 
       }
-      hist electronEoverPLhTight_ENDCAP {
+      hist PhiinCRACK { 
       }
-      hist electronCoreEMLhTight_ENDCAP {
+      hist TimeinCRACK { 
       }
-      hist electronF0LhTight_ENDCAP {
+      hist RConvinCRACK { 
       }
-      hist electronF1LhTight_ENDCAP {
+      hist ConvTypeinCRACK { 
       }
-      hist electronF2LhTight_ENDCAP {
+
+}
+
+dir egamma/CBLoosePhotons/byLB {
+      output = egamma/photons/CBLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist electronF3LhTight_ENDCAP {
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist electronRe233e237LhTight_ENDCAP {
+      hist    LBEvoN { 
       }
-      hist electronRe237e277LhTight_ENDCAP {
+      hist    Conversion_fraction_vs_LB { 
       }
 }
 
- dir egamma/electrons/Track {
+dir egamma/CBLoosePhotons/ID {
      algorithm = egKolmogorov
-     output = egamma/electrons/Track
+     output = egamma/photons/CBLoose/Expert/ID
      display = Draw=e1,StatBox
-
-     # LhLoose
-      hist electronNOfBLayersHitsLhLoose_BARREL {
+      hist   Ehad1inBARREL { 
       }
-      hist electronNOfTRTHitsLhLoose_BARREL {
+      hist   CoreEMinBARREL { 
       }
-      hist electronNOfSiHitsLhLoose_BARREL {
+      hist   F0inBARREL { 
       }
-      hist electronDeltaEta1LhLoose_BARREL {
+      hist   F1inBARREL { 
       }
-      hist electronDeltaPhi2LhLoose_BARREL {
+      hist   F2inBARREL { 
       }
-      hist electronDeltaEta1LhLoose_CRACK {
+      hist   F3inBARREL { 
       }
-      hist electronDeltaPhi2LhLoose_CRACK {
+      hist   Re233e237inBARREL { 
       }
-      hist electronNOfBLayersHitsLhLoose_CRACK {
+      hist   Re237e277inBARREL { 
       }
-      hist electronNOfTRTHitsLhLoose_CRACK {
+      hist   Ehad1inENDCAP { 
       }
-      hist electronNOfSiHitsLhLoose_CRACK {
+      hist   CoreEMinENDCAP { 
       }
-      hist electronDeltaEta1LhLoose_ENDCAP {
+      hist   F0inENDCAP { 
       }
-      hist electronDeltaPhi2LhLoose_ENDCAP {
+      hist   F1inENDCAP { 
       }
-      hist electronNOfBLayersHitsLhLoose_ENDCAP {
-      }
-      hist electronNOfTRTHitsLhLoose_ENDCAP {
-      }
-      hist electronNOfSiHitsLhLoose_ENDCAP {
-      }
-
-     # LhMedium
-      hist electronNOfBLayersHitsLhMedium_BARREL {
+      hist   F2inENDCAP { 
       }
-      hist electronNOfTRTHitsLhMedium_BARREL {
+      hist   F3inENDCAP { 
       }
-      hist electronNOfSiHitsLhMedium_BARREL {
+      hist   Re233e237inENDCAP { 
       }
-      hist electronDeltaEta1LhMedium_BARREL {
+      hist   Re237e277inENDCAP { 
       }
-      hist electronDeltaPhi2LhMedium_BARREL {
+      hist   Ehad1inCRACK { 
       }
-      hist electronDeltaEta1LhMedium_CRACK {
+      hist   CoreEMinCRACK { 
       }
-      hist electronDeltaPhi2LhMedium_CRACK {
+      hist   F0inCRACK { 
       }
-      hist electronNOfBLayersHitsLhMedium_CRACK {
+      hist   F1inCRACK { 
       }
-      hist electronNOfTRTHitsLhMedium_CRACK {
+      hist   F2inCRACK { 
       }
-      hist electronNOfSiHitsLhMedium_CRACK {
+      hist   F3inCRACK { 
       }
-      hist electronDeltaEta1LhMedium_ENDCAP {
+      hist   Re233e237inCRACK { 
       }
-      hist electronDeltaPhi2LhMedium_ENDCAP {
+      hist   Re237e277inCRACK { 
       }
-      hist electronNOfBLayersHitsLhMedium_ENDCAP {
+}
+
+# CBLooseWithTrigger
+
+dir egamma/CBLoosePhotonsWithTrigger {
+      output = egamma/photonsWithTrigger/CBLoose
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronNOfTRTHitsLhMedium_ENDCAP {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronNOfSiHitsLhMedium_ENDCAP {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
 
-     # LhTight
-      hist electronNOfBLayersHitsLhTight_BARREL {
+      hist Et { 
       }
-      hist electronNOfTRTHitsLhTight_BARREL {
+      hist Phi { 
       }
-      hist electronNOfSiHitsLhTight_BARREL {
+      hist Eta { 
       }
-      hist electronDeltaEta1LhTight_BARREL {
+      hist PtCone20 { 
       }
-      hist electronDeltaPhi2LhTight_BARREL {
+      hist EtCone40 { 
       }
-      hist electronDeltaEta1LhTight_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronDeltaPhi2LhTight_CRACK {
+      hist Time { 
       }
-      hist electronNOfBLayersHitsLhTight_CRACK {
+
+      hist EtConv { 
       }
-      hist electronNOfTRTHitsLhTight_CRACK {
+      hist PhiConv { 
       }
-      hist electronNOfSiHitsLhTight_CRACK {
+      hist EtaConv { 
       }
-      hist electronDeltaEta1LhTight_ENDCAP {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronDeltaPhi2LhTight_ENDCAP {
+
+      hist EtUnconv { 
       }
-      hist electronNOfBLayersHitsLhTight_ENDCAP {
+      hist PhiUnconv { 
       }
-      hist electronNOfTRTHitsLhTight_ENDCAP {
+      hist EtaUnconv { 
       }
-      hist electronNOfSiHitsLhTight_ENDCAP {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
- }
 
- dir egamma/electrons/LBMon {
-     algorithm = egamma_GatherData
-     output = egamma/electrons/LBMon
-     display = Draw=e1,StatBox
-      # LhLoose
-      hist LBEvoNElectronsLhLoose {
-      }
-      # LhMedium
-      hist LBEvoNElectronsLhMedium {
+
+}
+
+dir egamma/CBLoosePhotonsWithTrigger/Expert {
+      output = egamma/photonsWithTrigger/CBLoose/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist EtainBARREL { 
       }
-      # LhTight
-      hist LBEvoNElectronsLhTight {
+      hist PhiinBARREL { 
       }
-      # CbLoose
-      hist LBEvoNElectronsCbLoose {
+      hist TimeinBARREL { 
       }
-      # CbTight
-      hist LBEvoNElectronsCbTight {
+      hist RConvinBARREL { 
       }
-}
-
-### electronsWithTrigger
-
- dir egamma/electronsWithTrigger {
-      output = egamma/electronsWithTrigger
-
-      # CbLoose
-      hist electronNCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist ConvTypeinBARREL { 
       }
-      hist electronEtCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPtCone20CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVCbLoose {
-       output = egamma/electronsWithTrigger/EXPERT
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV {
        algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronEtaPhiPtgt4GeVCbLoose {
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEtaPhiPtgt20GeVCbLoose {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
-      }
 
-      # CbTight
-      hist electronNCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist EtainENDCAP { 
       }
-      hist electronEtCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVCbTight {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist PhiinENDCAP { 
       }
-      hist electronEtaPhiPtgt4GeVCbTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist TimeinENDCAP { 
       }
-      hist electronEtaPhiPtgt20GeVCbTight {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
+      hist RConvinENDCAP { 
       }
-      hist electronPtCone20CbTight {
-       algorithm = egKolmogorov
-      } 
-      hist electronTopoEtCone40CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-
-      # LhLoose
-      hist electronNLhLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox,LogY
+      hist ConvTypeinENDCAP { 
       }
-      hist electronEtLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVLhLoose {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-#       algorithm = egamma_BinsDiffFromStripMedian
-       display = Ref2DSignif, TCanvas(490,900)
+      hist Eta_Phi_with_Pt.gt.20GeV { 
       }
-      hist electronEtaPhiPtgt4GeVLhLoose {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEtaPhiPtgt20GeVLhLoose {
-       output = egamma/electronsWithTrigger/EXPERT
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
 
-      hist electronPtCone20LhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40LhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeLhLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronNLhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      } 
-      hist electronEtLhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhLoose_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-
-      # LhMedium
-      hist electronNLhMedium {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist EtainCRACK { 
       }
-      hist electronEtLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronPhiLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaPhiPtgt2.5GeVLhMedium {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist PhiinCRACK { 
       }
-      hist electronEtaPhiPtgt4GeVLhMedium {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist TimeinCRACK { 
       }
-      hist electronEtaPhiPtgt20GeVLhMedium {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
-      }
-      hist electronPtCone20LhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTopoEtCone40LhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronTimeLhMedium {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronNLhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      } 
-      hist electronEtLhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      } 
-      hist electronEtaLhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhMedium_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-
-      # LhTight
-      hist electronNLhTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist electronEtLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist RConvinCRACK { 
       }
-      hist electronPhiLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+      hist ConvTypeinCRACK { 
       }
-      hist electronEtaLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
+}
+
+dir egamma/CBLoosePhotonsWithTrigger/byLB {
+      output = egamma/photonsWithTrigger/CBLoose/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist electronEtaPhiPtgt2.5GeVLhTight {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist electronEtaPhiPtgt4GeVLhTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
+      hist    LBEvoN { 
       }
-      hist electronEtaPhiPtgt20GeVLhTight {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900) 
+      hist    Conversion_fraction_vs_LB { 
       }
-      hist electronPtCone20LhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight {
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_BARREL {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox, LogY
-      }
-      hist electronEtLhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }      
-      hist electronPtCone20LhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_CRACK {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronNLhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtLhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronEtaLhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPhiLhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronPtCone20LhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTopoEtCone40LhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-      hist electronTimeLhTight_ENDCAP {
-       output = egamma/electronsWithTrigger/EXPERT
-       algorithm = egKolmogorov
-       display = Draw=e1, DrawRef=HIST, StatBox
-      }
-}
-
- dir egamma/electronsWithTrigger/ID {
+}
+
+dir egamma/CBLoosePhotonsWithTrigger/ID {
      algorithm = egKolmogorov
-     output = egamma/electronsWithTrigger/ID
+     output = egamma/photonsWithTrigger/CBLoose/Expert/ID
      display = Draw=e1,StatBox
-
-     # LhLoose
-      hist electronEhad1LhLoose_BARREL {
-      }
-      hist electronEoverPLhLoose_BARREL {
-      }
-      hist electronCoreEMLhLoose_BARREL {
+      hist   Ehad1inBARREL { 
       }
-      hist electronF0LhLoose_BARREL {
+      hist   CoreEMinBARREL { 
       }
-      hist electronF1LhLoose_BARREL {
+      hist   F0inBARREL { 
       }
-      hist electronF2LhLoose_BARREL {
+      hist   F1inBARREL { 
       }
-      hist electronF3LhLoose_BARREL {
+      hist   F2inBARREL { 
       }
-      hist electronRe233e237LhLoose_BARREL {
+      hist   F3inBARREL { 
       }
-      hist electronRe237e277LhLoose_BARREL {
+      hist   Re233e237inBARREL { 
       }
-      hist electronEhad1LhLoose_CRACK {
+      hist   Re237e277inBARREL { 
       }
-      hist electronEoverPLhLoose_CRACK {
+      hist   Ehad1inENDCAP { 
       }
-      hist electronCoreEMLhLoose_CRACK {
+      hist   CoreEMinENDCAP { 
       }
-      hist electronF0LhLoose_CRACK {
+      hist   F0inENDCAP { 
       }
-      hist electronF1LhLoose_CRACK {
+      hist   F1inENDCAP { 
       }
-      hist electronF2LhLoose_CRACK {
+      hist   F2inENDCAP { 
       }
-      hist electronF3LhLoose_CRACK {
+      hist   F3inENDCAP { 
       }
-      hist electronRe233e237LhLoose_CRACK {
+      hist   Re233e237inENDCAP { 
       }
-      hist electronRe237e277LhLoose_CRACK {
+      hist   Re237e277inENDCAP { 
       }
-      hist electronEhad1LhLoose_ENDCAP {
+      hist   Ehad1inCRACK { 
       }
-      hist electronEoverPLhLoose_ENDCAP {
+      hist   CoreEMinCRACK { 
       }
-      hist electronCoreEMLhLoose_ENDCAP {
+      hist   F0inCRACK { 
       }
-      hist electronF0LhLoose_ENDCAP {
+      hist   F1inCRACK { 
       }
-      hist electronF1LhLoose_ENDCAP {
+      hist   F2inCRACK { 
       }
-      hist electronF2LhLoose_ENDCAP {
+      hist   F3inCRACK { 
       }
-      hist electronF3LhLoose_ENDCAP {
+      hist   Re233e237inCRACK { 
       }
-      hist electronRe233e237LhLoose_ENDCAP {
-      }
-      hist electronRe237e277LhLoose_ENDCAP {
+      hist   Re237e277inCRACK { 
       }
+}
 
-     # LhMedium
-      hist electronEhad1LhMedium_BARREL {
-      }
-      hist electronEoverPLhMedium_BARREL {
-      }
-      hist electronCoreEMLhMedium_BARREL {
-      }
-      hist electronF0LhMedium_BARREL {
-      }
-      hist electronF1LhMedium_BARREL {
-      }
-      hist electronF2LhMedium_BARREL {
-      }
-      hist electronF3LhMedium_BARREL {
-      }
-      hist electronRe233e237LhMedium_BARREL {
-      }
-      hist electronRe237e277LhMedium_BARREL {
-      }
-      hist electronEhad1LhMedium_CRACK {
+# CBTight
+
+dir egamma/CBTightPhotons {
+      output = egamma/photons/CBTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronEoverPLhMedium_CRACK {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronCoreEMLhMedium_CRACK {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronF0LhMedium_CRACK {
+
+      hist Et { 
       }
-      hist electronF1LhMedium_CRACK {
+      hist Phi { 
       }
-      hist electronF2LhMedium_CRACK {
+      hist Eta { 
       }
-      hist electronF3LhMedium_CRACK {
+      hist PtCone20 { 
       }
-      hist electronRe233e237LhMedium_CRACK {
+      hist EtCone40 { 
       }
-      hist electronRe237e277LhMedium_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronEhad1LhMedium_ENDCAP {
+      hist Time { 
       }
-      hist electronEoverPLhMedium_ENDCAP {
+
+      hist EtConv { 
       }
-      hist electronCoreEMLhMedium_ENDCAP {
+      hist PhiConv { 
       }
-      hist electronF0LhMedium_ENDCAP {
+      hist EtaConv { 
       }
-      hist electronF1LhMedium_ENDCAP {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronF2LhMedium_ENDCAP {
+
+      hist EtUnconv { 
       }
-      hist electronF3LhMedium_ENDCAP {
+      hist PhiUnconv { 
       }
-      hist electronRe233e237LhMedium_ENDCAP {
+      hist EtaUnconv { 
       }
-      hist electronRe237e277LhMedium_ENDCAP {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
 
-     # LhTight
-      hist electronEhad1LhTight_BARREL {
-      }
-      hist electronEoverPLhTight_BARREL {
-      }
-      hist electronCoreEMLhTight_BARREL {
-      }
-      hist electronF0LhTight_BARREL {
+}
+
+dir egamma/CBTightPhotons/Expert {
+      output = egamma/photons/CBTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist EtainBARREL { 
       }
-      hist electronF1LhTight_BARREL {
+      hist PhiinBARREL { 
       }
-      hist electronF2LhTight_BARREL {
+      hist TimeinBARREL { 
       }
-      hist electronF3LhTight_BARREL {
+      hist RConvinBARREL { 
       }
-      hist electronRe233e237LhTight_BARREL {
+      hist ConvTypeinBARREL { 
       }
-      hist electronRe237e277LhTight_BARREL {
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEhad1LhTight_CRACK {
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEoverPLhTight_CRACK {
+
+      hist EtainENDCAP { 
       }
-      hist electronCoreEMLhTight_CRACK {
+      hist PhiinENDCAP { 
       }
-      hist electronF0LhTight_CRACK {
+      hist TimeinENDCAP { 
       }
-      hist electronF1LhTight_CRACK {
+      hist RConvinENDCAP { 
       }
-      hist electronF2LhTight_CRACK {
+      hist ConvTypeinENDCAP { 
       }
-      hist electronF3LhTight_CRACK {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
       }
-      hist electronRe233e237LhTight_CRACK {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronRe237e277LhTight_CRACK {
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist electronEhad1LhTight_ENDCAP {
+
+      hist EtainCRACK { 
       }
-      hist electronEoverPLhTight_ENDCAP {
+      hist PhiinCRACK { 
       }
-      hist electronCoreEMLhTight_ENDCAP {
+      hist TimeinCRACK { 
       }
-      hist electronF0LhTight_ENDCAP {
+      hist RConvinCRACK { 
       }
-      hist electronF1LhTight_ENDCAP {
+      hist ConvTypeinCRACK { 
       }
-      hist electronF2LhTight_ENDCAP {
+}
+
+dir egamma/CBTightPhotons/byLB {
+      output = egamma/photons/CBTight/Expert/LBMon
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist electronF3LhTight_ENDCAP {
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist electronRe233e237LhTight_ENDCAP {
+      hist    LBEvoN { 
       }
-      hist electronRe237e277LhTight_ENDCAP {
+      hist    Conversion_fraction_vs_LB { 
       }
+
 }
 
- dir egamma/electronsWithTrigger/Track {
+dir egamma/CBTightPhotons/ID {
      algorithm = egKolmogorov
-     output = egamma/electronsWithTrigger/Track
+     output = egamma/photons/CBTight/Expert/ID
      display = Draw=e1,StatBox
-
-     # LhLoose
-      hist electronNOfBLayersHitsLhLoose_BARREL {
-      }
-      hist electronNOfTRTHitsLhLoose_BARREL {
-      }
-      hist electronNOfSiHitsLhLoose_BARREL {
-      }
-      hist electronDeltaEta1LhLoose_BARREL {
-      }
-      hist electronDeltaPhi2LhLoose_BARREL {
-      }
-      hist electronDeltaEta1LhLoose_CRACK {
+      hist   Ehad1inBARREL { 
       }
-      hist electronDeltaPhi2LhLoose_CRACK {
+      hist   CoreEMinBARREL { 
       }
-      hist electronNOfBLayersHitsLhLoose_CRACK {
+      hist   F0inBARREL { 
       }
-      hist electronNOfTRTHitsLhLoose_CRACK {
+      hist   F1inBARREL { 
       }
-      hist electronNOfSiHitsLhLoose_CRACK {
+      hist   F2inBARREL { 
       }
-      hist electronDeltaEta1LhLoose_ENDCAP {
+      hist   F3inBARREL { 
       }
-      hist electronDeltaPhi2LhLoose_ENDCAP {
+      hist   Re233e237inBARREL { 
       }
-      hist electronNOfBLayersHitsLhLoose_ENDCAP {
+      hist   Re237e277inBARREL { 
       }
-      hist electronNOfTRTHitsLhLoose_ENDCAP {
+      hist   Ehad1inENDCAP { 
       }
-      hist electronNOfSiHitsLhLoose_ENDCAP {
+      hist   CoreEMinENDCAP { 
       }
-
-     # LhMedium
-      hist electronNOfBLayersHitsLhMedium_BARREL {
-      }
-      hist electronNOfTRTHitsLhMedium_BARREL {
+      hist   F0inENDCAP { 
       }
-      hist electronNOfSiHitsLhMedium_BARREL {
+      hist   F1inENDCAP { 
       }
-      hist electronDeltaEta1LhMedium_BARREL {
+      hist   F2inENDCAP { 
       }
-      hist electronDeltaPhi2LhMedium_BARREL {
+      hist   F3inENDCAP { 
       }
-      hist electronDeltaEta1LhMedium_CRACK {
+      hist   Re233e237inENDCAP { 
       }
-      hist electronDeltaPhi2LhMedium_CRACK {
+      hist   Re237e277inENDCAP { 
       }
-      hist electronNOfBLayersHitsLhMedium_CRACK {
+      hist   Ehad1inCRACK { 
       }
-      hist electronNOfTRTHitsLhMedium_CRACK {
+      hist   CoreEMinCRACK { 
       }
-      hist electronNOfSiHitsLhMedium_CRACK {
+      hist   F0inCRACK { 
       }
-      hist electronDeltaEta1LhMedium_ENDCAP {
+      hist   F1inCRACK { 
       }
-      hist electronDeltaPhi2LhMedium_ENDCAP {
+      hist   F2inCRACK { 
       }
-      hist electronNOfBLayersHitsLhMedium_ENDCAP {
+      hist   F3inCRACK { 
       }
-      hist electronNOfTRTHitsLhMedium_ENDCAP {
+      hist   Re233e237inCRACK { 
       }
-      hist electronNOfSiHitsLhMedium_ENDCAP {
+      hist   Re237e277inCRACK { 
       }
+}
 
-     # LhTight
-      hist electronNOfBLayersHitsLhTight_BARREL {
-      }
-      hist electronNOfTRTHitsLhTight_BARREL {
+# CBTightWithTrigger
+
+dir egamma/CBTightPhotonsWithTrigger {
+      output = egamma/photonsWithTrigger/CBTight
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronNOfSiHitsLhTight_BARREL {
+      hist NConv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronDeltaEta1LhTight_BARREL {
+      hist NUnconv {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
       }
-      hist electronDeltaPhi2LhTight_BARREL {
+
+      hist Et { 
       }
-      hist electronDeltaEta1LhTight_CRACK {
+      hist Phi { 
       }
-      hist electronDeltaPhi2LhTight_CRACK {
+      hist Eta { 
       }
-      hist electronNOfBLayersHitsLhTight_CRACK {
+      hist PtCone20 { 
       }
-      hist electronNOfTRTHitsLhTight_CRACK {
+      hist EtCone40 { 
       }
-      hist electronNOfSiHitsLhTight_CRACK {
+      hist Eta_Phi_distribution_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist electronDeltaEta1LhTight_ENDCAP {
+      hist Time { 
       }
-      hist electronDeltaPhi2LhTight_ENDCAP {
+
+      hist EtConv { 
       }
-      hist electronNOfBLayersHitsLhTight_ENDCAP {
+      hist PhiConv { 
       }
-      hist electronNOfTRTHitsLhTight_ENDCAP {
+      hist EtaConv { 
       }
-      hist electronNOfSiHitsLhTight_ENDCAP {
+      hist Eta_Phi_Conv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
- }
 
- dir egamma/electronsWithTrigger/LBMon {
-     algorithm = egamma_GatherData
-     output = egamma/electronsWithTrigger/LBMon
-     display = Draw=e1,StatBox
-      # LhLoose
-      hist LBEvoNElectronsLhLoose {
+      hist EtUnconv { 
       }
-      # LhMedium
-      hist LBEvoNElectronsLhMedium {
+      hist PhiUnconv { 
       }
-      # LhTight
-      hist LBEvoNElectronsLhTight {
+      hist EtaUnconv { 
       }
-      # CbLoose
-      hist LBEvoNElectronsCbLoose {
-      }
-      # CbTight
-      hist LBEvoNElectronsCbTight {
+      hist Eta_Phi_Unconv_with_Pt.gt.4GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-}
-
-
-### photons
 
+}
 
- dir egamma/photons {
-     output = egamma/photons
+dir egamma/CBTightPhotonsWithTrigger/Expert {
+      output = egamma/photonsWithTrigger/CBTight/Expert
+      algorithm = egKolmogorov
+      display = Draw=e1, DrawRef=HIST, StatBox
 
-      # CbLoose
-      hist photonNCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist EtainBARREL { 
       }
-      hist photonPhiCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist PhiinBARREL { 
       }
-      hist photonEtaPhiPt2.5GeVCbLoose {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist TimeinBARREL { 
       }
-      hist photonEtaPhiPtgt4GeVCbLoose {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist RConvinBARREL { 
       }
-      hist photonEtaPhiPtgt20GeVCbLoose {
-       algorithm = egamma_BinsDiffFromStripMedian
+      hist ConvTypeinBARREL { 
       }
-      hist photonPtCone20CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist Eta_Phi_Unconv_with_Pt.gt.2.5GeV {
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900) 
       }
-      hist photonTopoEtCone40CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist Eta_Phi_Conv_with_Pt_gt_2.5GeV { 
+       algorithm = 2D_Histogram_Not_Empty
+       display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonTimeCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+
+      hist EtainENDCAP { 
       }
-      hist photonRconvCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist PhiinENDCAP { 
       }
-
-      # CbTight
-      hist photonNCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist TimeinENDCAP { 
       }
-      hist photonEtCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist RConvinENDCAP { 
       }
-      hist photonPhiCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist ConvTypeinENDCAP { 
       }
-      hist photonEtaPhiPt2.5GeVCbTight {
+      hist Eta_Phi_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonEtaPhiPtgt4GeVCbTight {
+      hist Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonEtaPhiPtgt20GeVCbTight {
+      hist Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV { 
        algorithm = 2D_Histogram_Not_Empty
        display = Ref2DSignif, TCanvas(490,900)
       }
-      hist photonPtCone20CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+
+      hist EtainCRACK { 
+      }
+      hist PhiinCRACK { 
       }
-      hist photonTopoEtCone40CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist TimeinCRACK { 
       }
-      hist photonTimeCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist RConvinCRACK { 
       }
-      hist photonRconvCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
+      hist ConvTypeinCRACK { 
       }
 }
 
- dir egamma/photons/Region {
+dir egamma/CBTightPhotonsWithTrigger/byLB {
+      output = egamma/photonsWithTrigger/CBTight/Expert/LBMon
       algorithm = egKolmogorov
-      output = egamma/photons/EXPERT
-      display = Draw=e1,StatBox
-
-      # CbLoose
-      hist photonNCbLoose_BARREL {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose_BARREL {
+      display = Draw=e1, DrawRef=HIST, StatBox
+      hist    Number_of_Unconv._photons_vs_LB { 
       }
-      hist photonEtaCbLoose_BARREL {
+      hist    Number_of_Conv._photons_vs_LB { 
       }
-      hist photonPhiCbLoose_BARREL {
+      hist    LBEvoN { 
       }
-      hist photonPtCone20CbLoose_BARREL {
+      hist    Conversion_fraction_vs_LB { 
       }
-      hist photonTopoEtCone40CbLoose_BARREL {
-      }
-      hist photonNCbLoose_CRACK {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+
+}
+
+dir egamma/CBTightPhotonsWithTrigger/ID {
+     algorithm = egKolmogorov
+     output = egamma/photonsWithTrigger/CBTight/Expert/ID
+     display = Draw=e1,StatBox
+
+      hist   Ehad1inBARREL { 
       }
-      hist photonEtCbLoose_CRACK {
+      hist   CoreEMinBARREL { 
       }
-      hist photonEtaCbLoose_CRACK {
+      hist   F0inBARREL { 
       }
-      hist photonPhiCbLoose_CRACK {
+      hist   F1inBARREL { 
       }
-      hist photonPtCone20CbLoose_CRACK {
+      hist   F2inBARREL { 
       }
-      hist photonTopoEtCone40CbLoose_CRACK {
+      hist   F3inBARREL { 
       }
-      hist photonNCbLoose_ENDCAP {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   Re233e237inBARREL { 
       }
-      hist photonEtCbLoose_ENDCAP {
+      hist   Re237e277inBARREL { 
       }
-      hist photonEtaCbLoose_ENDCAP {
+      hist   Ehad1inENDCAP { 
       }
-      hist photonPhiCbLoose_ENDCAP {
+      hist   CoreEMinENDCAP { 
       }
-      hist photonPtCone20CbLoose_ENDCAP {
+      hist   F0inENDCAP { 
       }
-      hist photonTopoEtCone40CbLoose_ENDCAP {
+      hist   F1inENDCAP { 
       }
-
-      # CbTight
-      hist photonNCbTight_BARREL {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   F2inENDCAP { 
       }
-      hist photonEtCbTight_BARREL {
+      hist   F3inENDCAP { 
       }
-      hist photonEtaCbTight_BARREL {
+      hist   Re233e237inENDCAP { 
       }
-      hist photonPhiCbTight_BARREL {
+      hist   Re237e277inENDCAP { 
       }
-      hist photonPtCone20CbTight_BARREL {
+      hist   Ehad1inCRACK { 
       }
-      hist photonTopoEtCone40CbTight_BARREL {
+      hist   CoreEMinCRACK { 
       }
-      hist photonNCbTight_CRACK {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+      hist   F0inCRACK { 
       }
-      hist photonEtCbTight_CRACK {
+      hist   F1inCRACK { 
       }
-      hist photonEtaCbTight_CRACK {
+      hist   F2inCRACK { 
       }
-      hist photonPhiCbTight_CRACK {
+      hist   F3inCRACK { 
       }
-      hist photonPtCone20CbTight_CRACK {
+      hist   Re233e237inCRACK { 
       }
-      hist photonTopoEtCone40CbTight_CRACK {
+      hist   Re237e277inCRACK { 
       }
-      hist photonNCbTight_ENDCAP {
+}
+
+
+########################################
+### forwardElectrons
+########################################
+
+# CB Loose Forward Electrons
+
+dir egamma/CBLooseFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/CBLoose
+     display = Draw=e1,StatBox
+     hist N {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
+     }
+
+     hist Et { 
+     }
+     hist Phi { 
+     }
+     hist Eta { 
+     }
+     hist Time { 
+     }
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
+     }
+}
+
+dir egamma/CBLooseFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/CBLoose
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
+     }
+     hist FracMax { 
+     }
+     hist Lateral { 
+     }
+     hist Longitudinal { 
+     }
+     hist SecondLambda { 
+     }
+     hist SecondR { 
+     }
+     hist CenterLambda { 
+     }
+}
+
+
+dir egamma/CBLooseFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/CBLoose/Expert
+      display = Draw=e1,StatBox
+
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
+      }
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
+      }
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
+      }
+      hist EtainENDCAP { 
       }
-      hist photonEtCbTight_ENDCAP {
+      hist PhiinENDCAP { 
       }
-      hist photonEtaCbTight_ENDCAP {
+      hist TimeinENDCAP { 
       }
-      hist photonPhiCbTight_ENDCAP {
+      hist EtainFORWARD { 
       }
-      hist photonPtCone20CbTight_ENDCAP {
+      hist PhiinFORWARD { 
       }
-      hist photonTopoEtCone40CbTight_ENDCAP {
+      hist TimeinFORWARD { 
       }
 }
 
- dir egamma/photons/Unconv {
+# CBTight Forward Electrons
+
+dir egamma/CBTightFwdElectrons {
      algorithm = egKolmogorov
-     output = egamma/photons
+     output = egamma/forwardElectrons/CBTight
      display = Draw=e1,StatBox
-
-     #CbLoose
-     hist photonNUnconvCbLoose {
+     hist N {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
      }
-     hist photonEtUnconvCbLoose {
+     hist Et { 
      }
-     hist photonEtaUnconvCbLoose {
+     hist Phi { 
      }
-     hist photonPhiUnconvCbLoose {
+     hist Eta { 
      }
-     hist photonEtaPhiUnconvCbLoose {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist Time { 
      }
-     hist photonTopoEtCone40UnconvCbLoose {
-     }
-     hist photonPtCone20UnconvCbLoose {
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
      }
+}
 
-     #CbTight
-     hist photonNUnconvCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+dir egamma/CBTightFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/CBTight
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
      }
-     hist photonEtUnconvCbTight {
+     hist FracMax { 
      }
-     hist photonEtaUnconvCbTight {
+     hist Lateral { 
      }
-     hist photonPhiUnconvCbTight {
+     hist Longitudinal { 
      }
-     hist photonEtaPhiUnconvCbTight {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist SecondLambda { 
      }
-     hist photonTopoEtCone40UnconvCbTight {
+     hist SecondR { 
      }
-     hist photonPtCone20UnconvCbTight {
+     hist CenterLambda { 
      }
+}
 
+dir egamma/CBTightFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/CBTight/Expert
+      display = Draw=e1,StatBox
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
+      }
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
+      }
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
+      }
+      hist EtainENDCAP { 
+      }
+      hist PhiinENDCAP { 
+      }
+      hist TimeinENDCAP { 
+      }
+      hist EtainFORWARD { 
+      }
+      hist PhiinFORWARD { 
+      }
+      hist TimeinFORWARD { 
+      }
 }
 
+# LH Loose Forward Electrons
 
- dir egamma/photons/Conv {
+dir egamma/LHLooseFwdElectrons {
      algorithm = egKolmogorov
-     output = egamma/photons
+     output = egamma/forwardElectrons/LHLoose
      display = Draw=e1,StatBox
-
-     #CbLoose
-     hist photonNConvCbLoose {
+     hist N {
        algorithm = egamma_Histogram_Not_Empty
        display = Draw=e1,StatBox,LogY
      }
-     hist photonEtConvCbLoose {
+     hist Et { 
      }
-     hist photonEtaConvCbLoose {
+     hist Phi { 
      }
-     hist photonPhiConvCbLoose {
+     hist Eta { 
      }
-     hist photonEtaPhiConvCbLoose {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist Time { 
      }
-     hist photonTopoEtCone40ConvCbLoose {
-     }
-     hist photonPtCone20ConvCbLoose {
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
      }
-     #CbTight
-     hist photonNConvCbTight {
+}
+
+dir egamma/LHLooseFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/LHLoose 
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
      }
-     hist photonEtConvCbTight {
+     hist FracMax { 
      }
-     hist photonEtaConvCbTight {
+     hist Lateral { 
      }
-     hist photonPhiConvCbTight {
+     hist Longitudinal { 
      }
-     hist photonEtaPhiConvCbTight {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist SecondLambda { 
      }
-     hist photonTopoEtCone40ConvCbTight {
+     hist SecondR { 
      }
-     hist photonPtCone20ConvCbTight {
+     hist CenterLambda { 
      }
 }
 
- dir egamma/photons/ID {
-     algorithm = egKolmogorov
-     output = egamma/photons/ID
-     display = Draw=e1,StatBox
 
-      #CbLoose
-      hist photonEhad1CbLoose_BARREL {
-      }
-      hist photonCoreEMCbLoose_BARREL {
-      }
-      hist photonF0CbLoose_BARREL {
-      }
-      hist photonF1CbLoose_BARREL {
-      }
-      hist photonF2CbLoose_BARREL {
+dir egamma/LHLooseFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/LHLoose/Expert
+      display = Draw=e1,StatBox
+
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonF3CbLoose_BARREL {
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonRe233e237CbLoose_BARREL {
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
       }
-      hist photonRe237e277CbLoose_BARREL {
+      hist EtainENDCAP { 
       }
-      hist photonEhad1CbLoose_CRACK {
+      hist PhiinENDCAP { 
       }
-      hist photonCoreEMCbLoose_CRACK {
+      hist TimeinENDCAP { 
       }
-      hist photonF0CbLoose_CRACK {
+      hist EtainFORWARD { 
       }
-      hist photonF1CbLoose_CRACK {
+      hist PhiinFORWARD { 
       }
-      hist photonF2CbLoose_CRACK {
+      hist TimeinFORWARD { 
       }
-      hist photonF3CbLoose_CRACK {
+}
+
+# LHTight Forward Electrons
+
+dir egamma/LHTightFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/LHTight
+     display = Draw=e1,StatBox
+     hist N {
+       algorithm = egamma_Histogram_Not_Empty
+       display = Draw=e1,StatBox,LogY
+     }
+     hist Et { 
+     }
+     hist Phi { 
+     }
+     hist Eta { 
+     }
+     hist Time { 
+     }
+     hist Eta_Phi_distributionf_Pt_gt_10GeV { 
+       algorithm = egamma_BinsDiffFromStripMedian
+     }
+}
+
+dir egamma/LHTightFwdElectrons {
+     algorithm = egKolmogorov
+     output = egamma/forwardElectrons/LHTight
+     display = Draw=e1,StatBox
+     hist EnergyDensity { 
+     }
+     hist FracMax { 
+     }
+     hist Lateral { 
+     }
+     hist Longitudinal { 
+     }
+     hist SecondLambda { 
+     }
+     hist SecondR { 
+     }
+     hist CenterLambda { 
+     }
+}
+
+dir egamma/LHTightFwdElectrons/Expert {
+      algorithm = egKolmogorov
+      output = egamma/forwardElectrons/LHTight/Expert
+      display = Draw=e1,StatBox
+      hist NinENDCAP { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonRe233e237CbLoose_CRACK {
+      hist NinFORWARD { 
+       display = Draw=e1,StatBox,LogY
       }
-      hist photonRe237e277CbLoose_CRACK {
+      hist Eta_Phi_distribution_Pt_gt_2.5GeV { 
       }
-      hist photonEhad1CbLoose_ENDCAP {
+      hist EtainENDCAP { 
       }
-      hist photonCoreEMCbLoose_ENDCAP {
+      hist PhiinENDCAP { 
       }
-      hist photonF0CbLoose_ENDCAP {
+      hist TimeinENDCAP { 
       }
-      hist photonF1CbLoose_ENDCAP {
+      hist EtainFORWARD { 
       }
-      hist photonF2CbLoose_ENDCAP {
+      hist PhiinFORWARD { 
       }
-      hist photonF3CbLoose_ENDCAP {
-      }
-      hist photonRe233e237CbLoose_ENDCAP {
-      }
-      hist photonRe237e277CbLoose_ENDCAP {
-      }
-      #CbTight
-      hist photonEhad1CbTight_BARREL {
-      }
-      hist photonCoreEMCbTight_BARREL {
-      }
-      hist photonF0CbTight_BARREL {
-      }
-      hist photonF1CbTight_BARREL {
-      }
-      hist photonF2CbTight_BARREL {
-      }
-      hist photonF3CbTight_BARREL {
-      }
-      hist photonRe233e237CbTight_BARREL {
-      }
-      hist photonRe237e277CbTight_BARREL {
-      }
-      hist photonEhad1CbTight_CRACK {
-      }
-      hist photonCoreEMCbTight_CRACK {
-      }
-      hist photonF0CbTight_CRACK {
-      }
-      hist photonF1CbTight_CRACK {
-      }
-      hist photonF2CbTight_CRACK {
-      }
-      hist photonF3CbTight_CRACK {
-      }
-      hist photonRe233e237CbTight_CRACK {
-      }
-      hist photonRe237e277CbTight_CRACK {
-      }
-      hist photonEhad1CbTight_ENDCAP {
-      }
-      hist photonCoreEMCbTight_ENDCAP {
-      }
-      hist photonF0CbTight_ENDCAP {
-      }
-      hist photonF1CbTight_ENDCAP {
-      }
-      hist photonF2CbTight_ENDCAP {
-      }
-      hist photonF3CbTight_ENDCAP {
-      }
-      hist photonRe233e237CbTight_ENDCAP {
-      }
-      hist photonRe237e277CbTight_ENDCAP {
+      hist TimeinFORWARD { 
       }
 }
 
- dir egamma/photons/Region {
-     algorithm = egKolmogorov
-     output = egamma/photons/EXPERT
-     display = Draw=e1,StatBox
-
-      # CbLoose
-      hist photonConvTrkMatch1CbLoose_BARREL {
-      }
-      hist photonConvTrkMatch2CbLoose_BARREL {
-      }
-      hist photonConvTypeCbLoose_BARREL {
-      }
-      hist photonConvTrkMatch1CbLoose_CRACK {
-      }
-      hist photonConvTrkMatch2CbLoose_CRACK {
-      }
-      hist photonConvTypeCbLoose_CRACK {
-      }
-      hist photonConvTrkMatch1CbLoose_ENDCAP {
-      }
-      hist photonConvTrkMatch2CbLoose_ENDCAP {
-      }
-      hist photonConvTypeCbLoose_ENDCAP {
-      }
-      # CbTight
-      hist photonConvTrkMatch1CbTight_BARREL {
-      }
-      hist photonConvTrkMatch2CbTight_BARREL {
-      }
-      hist photonConvTypeCbTight_BARREL {
-      }
-      hist photonConvTrkMatch1CbTight_CRACK {
-      }
-      hist photonConvTrkMatch2CbTight_CRACK {
-      }
-      hist photonConvTypeCbTight_CRACK {
-      }
-      hist photonConvTrkMatch1CbTight_ENDCAP {
-      }
-      hist photonConvTrkMatch2CbTight_ENDCAP {
-      }
-      hist photonConvTypeCbTight_ENDCAP {
-      }
- }
-
+### Tag&Probe Z
 
- dir egamma/photons/LBMon {
-     algorithm = egamma_GatherData
-     output = egamma/photons/LBMon
+dir egamma/TnPZ/TnPCandidate {
+     algorithm = egKolmogorov
+     output = egamma/tagandprobeZ
      display = Draw=e1,StatBox
-      # CbLoose
-      hist LBEvoNPhotonsCbLoose {
-      }
-      hist LBEvoNPhotonsUnconvCbLoose {
-      }
-      hist LBEvoNPhotonsConvCbLoose {
-      }
-      hist LBEvoConvOverNCbLoose {
-      }
-
-      # CbTight
-      hist LBEvoNPhotonsCbTight {
-      }
-      hist LBEvoNPhotonsUnconvCbTight {
-      }
-      hist LBEvoNPhotonsConvCbTight {
-      }
-      hist LBEvoConvOverNCbTight {
-      }
-}
-
-### photonsWithTrigger
-
- dir egamma/photonsWithTrigger {
-     output = egamma/photonsWithTrigger
-
-      # CbLoose
-      hist photonNCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonPhiCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonEtaPhiPt2.5GeVCbLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist photonEtaPhiPtgt4GeVCbLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist photonEtaPhiPtgt20GeVCbLoose {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist photonPtCone20CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonTopoEtCone40CbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonTimeCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonRconvCbLoose {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-
-      # CbTight
-      hist photonNCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonPhiCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonEtaPhiPt2.5GeVCbTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)      
-      }
-      hist photonEtaPhiPtgt4GeVCbTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist photonEtaPhiPtgt20GeVCbTight {
-       algorithm = 2D_Histogram_Not_Empty
-       display = Ref2DSignif, TCanvas(490,900)
-      }
-      hist photonPtCone20CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonTopoEtCone40CbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonTimeCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-      hist photonRconvCbTight {
-       algorithm = egKolmogorov
-       display = Draw=e1,StatBox
-      }
-}
-
-
- dir egamma/photonsWithTrigger/Region {
-      algorithm = egKolmogorov
-      output = egamma/photonsWithTrigger/EXPERT
-      display = Draw=e1,StatBox
-
-      # CbLoose
-      hist photonNCbLoose_BARREL {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose_BARREL {
-      }
-      hist photonEtaCbLoose_BARREL {
-      }
-      hist photonPhiCbLoose_BARREL {
-      }
-      hist photonPtCone20CbLoose_BARREL {
-      }
-      hist photonTopoEtCone40CbLoose_BARREL {
-      }
-      hist photonNCbLoose_CRACK {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose_CRACK {
-      }
-      hist photonEtaCbLoose_CRACK {
-      }
-      hist photonPhiCbLoose_CRACK {
-      }
-      hist photonPtCone20CbLoose_CRACK {
-      }
-      hist photonTopoEtCone40CbLoose_CRACK {
-      }
-      hist photonNCbLoose_ENDCAP {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbLoose_ENDCAP {
-      }
-      hist photonEtaCbLoose_ENDCAP {
-      }
-      hist photonPhiCbLoose_ENDCAP {
-      }
-      hist photonPtCone20CbLoose_ENDCAP {
-      }
-      hist photonTopoEtCone40CbLoose_ENDCAP {
-      }
-
-      # CbTight
-      hist photonNCbTight_BARREL {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbTight_BARREL {
-      }
-      hist photonEtaCbTight_BARREL {
-      }
-      hist photonPhiCbTight_BARREL {
-      }
-      hist photonPtCone20CbTight_BARREL {
-      }
-      hist photonTopoEtCone40CbTight_BARREL {
-      }
-      hist photonNCbTight_CRACK {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbTight_CRACK {
-      }
-      hist photonEtaCbTight_CRACK {
-      }
-      hist photonPhiCbTight_CRACK {
-      }
-      hist photonPtCone20CbTight_CRACK {
-      }
-      hist photonTopoEtCone40CbTight_CRACK {
-      }
-      hist photonNCbTight_ENDCAP {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist photonEtCbTight_ENDCAP {
-      }
-      hist photonEtaCbTight_ENDCAP {
-      }
-      hist photonPhiCbTight_ENDCAP {
-      }
-      hist photonPtCone20CbTight_ENDCAP {
-      }
-      hist photonTopoEtCone40CbTight_ENDCAP {
-      }
+     hist Z_candidate_mass {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
+     hist Z_candidate_mass_distribution_Lead_in_Barrel {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
+     hist Number_of_Z_candidates_vs_eta_leading_e {
+     }
+     hist Number_of_Z_candidates_vs_phi_leading_e {
+     }
+     hist Z_candidate_mass_distribution_Lead_in_Crack {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
+     hist Z_candidate_mass_distribution_Lead_in_EndCap {
+      algorithm = egamma_FitZmass 
+      display = StatBox,gaus(80000.,100000.)
+     }
 }
 
- dir egamma/photonsWithTrigger/Unconv {
+dir egamma/TnPZ/ID {
      algorithm = egKolmogorov
-     output = egamma/photonsWithTrigger
+     output = egamma/tagandprobeZ/ID
      display = Draw=e1,StatBox
 
-     #CbLoose
-     hist photonNUnconvCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+     hist Ehad1ProbeinBARREL { 
      }
-     hist photonEtUnconvCbLoose {
+     hist EoverPProbeinBARREL { 
      }
-     hist photonEtaUnconvCbLoose {
+     hist CoreEMProbeinBARREL { 
      }
-     hist photonPhiUnconvCbLoose {
+     hist F0ProbeinBARREL { 
      }
-     hist photonEtaPhiUnconvCbLoose {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist F1ProbeinBARREL { 
      }
-     hist photonTopoEtCone40UnconvCbLoose {
+     hist F2ProbeinBARREL { 
      }
-     hist photonPtCone20UnconvCbLoose {
+     hist F3ProbeinBARREL { 
      }
-
-     #CbTight
-     hist photonNUnconvCbTight {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+     hist Re233e237ProbeinBARREL { 
      }
-     hist photonEtUnconvCbTight {
+     hist Re237e277ProbeinBARREL { 
      }
-     hist photonEtaUnconvCbTight {
+     hist Ehad1ProbeinENDCAP { 
      }
-     hist photonPhiUnconvCbTight {
+     hist EoverPProbeinENDCAP { 
      }
-     hist photonEtaPhiUnconvCbTight {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist CoreEMProbeinENDCAP { 
      }
-     hist photonTopoEtCone40UnconvCbTight {
+     hist F0ProbeinENDCAP { 
      }
-     hist photonPtCone20UnconvCbTight {
+     hist F1ProbeinENDCAP { 
+     }
+     hist F2ProbeinENDCAP { 
+     }
+     hist F3ProbeinENDCAP { 
+     }
+     hist Re233e237ProbeinENDCAP { 
+     }
+     hist Re237e277ProbeinENDCAP { 
      }
 
 }
 
-
- dir egamma/photonsWithTrigger/Conv {
+dir egamma/TnPZ/Tracks { 
      algorithm = egKolmogorov
-     output = egamma/photonsWithTrigger
+     output = egamma/tagandprobeZ/Track
      display = Draw=e1,StatBox
-
-     #CbLoose
-     hist photonNConvCbLoose {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
+     hist NOfBLayerHitsProbeinBARREL { 
      }
-     hist photonEtConvCbLoose {
+     hist NOfPixelHitsProbeinBARREL { 
      }
-     hist photonEtaConvCbLoose {
+     hist NOfSCTHitsProbeinBARREL { 
      }
-     hist photonPhiConvCbLoose {
+     hist NOfTRTHitsProbeinBARREL { 
      }
-     hist photonEtaPhiConvCbLoose {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist NOfTRTHighThresholdHitsProbeinBARREL { 
      }
-     hist photonTopoEtCone40ConvCbLoose {
+     hist DeltaEta1ProbeinBARREL { 
      }
-     hist photonPtCone20ConvCbLoose {
+     hist DeltaPhi2ProbeinBARREL { 
      }
-     #CbTight
-     hist photonNConvCbTight {
+     hist Trackd0ProbeinBARREL { 
      }
-     hist photonEtConvCbTight {
+     hist NOfBLayerHitsProbeinENDCAP { 
      }
-     hist photonEtaConvCbTight {
+     hist NOfPixelHitsProbeinENDCAP { 
      }
-     hist photonPhiConvCbTight {
+     hist NOfSCTHitsProbeinENDCAP { 
      }
-     hist photonEtaPhiConvCbTight {
-      algorithm = egamma_BinsDiffFromStripMedian
+     hist NOfTRTHitsProbeinENDCAP { 
      }
-     hist photonTopoEtCone40ConvCbTight {
+     hist NOfTRTHighThresholdHitsProbeinENDCAP { 
      }
-     hist photonPtCone20ConvCbTight {
+     hist DeltaEta1ProbeinENDCAP { 
+     }
+     hist DeltaPhi2ProbeinENDCAP { 
+     }
+     hist Trackd0ProbeinENDCAP { 
      }
-}
-
- dir egamma/photonsWithTrigger/ID {
-     algorithm = egKolmogorov
-     output = egamma/photonsWithTrigger/ID
-     display = Draw=e1,StatBox
-
-      #CbLoose
-      hist photonEhad1CbLoose_BARREL {
-      }
-      hist photonCoreEMCbLoose_BARREL {
-      }
-      hist photonF0CbLoose_BARREL {
-      }
-      hist photonF1CbLoose_BARREL {
-      }
-      hist photonF2CbLoose_BARREL {
-      }
-      hist photonF3CbLoose_BARREL {
-      }
-      hist photonRe233e237CbLoose_BARREL {
-      }
-      hist photonRe237e277CbLoose_BARREL {
-      }
-      hist photonEhad1CbLoose_CRACK {
-      }
-      hist photonCoreEMCbLoose_CRACK {
-      }
-      hist photonF0CbLoose_CRACK {
-      }
-      hist photonF1CbLoose_CRACK {
-      }
-      hist photonF2CbLoose_CRACK {
-      }
-      hist photonF3CbLoose_CRACK {
-      }
-      hist photonRe233e237CbLoose_CRACK {
-      }
-      hist photonRe237e277CbLoose_CRACK {
-      }
-      hist photonEhad1CbLoose_ENDCAP {
-      }
-      hist photonCoreEMCbLoose_ENDCAP {
-      }
-      hist photonF0CbLoose_ENDCAP {
-      }
-      hist photonF1CbLoose_ENDCAP {
-      }
-      hist photonF2CbLoose_ENDCAP {
-      }
-      hist photonF3CbLoose_ENDCAP {
-      }
-      hist photonRe233e237CbLoose_ENDCAP {
-      }
-      hist photonRe237e277CbLoose_ENDCAP {
-      }
-      #CbTight
-      hist photonEhad1CbTight_BARREL {
-      }
-      hist photonCoreEMCbTight_BARREL {
-      }
-      hist photonF0CbTight_BARREL {
-      }
-      hist photonF1CbTight_BARREL {
-      }
-      hist photonF2CbTight_BARREL {
-      }
-      hist photonF3CbTight_BARREL {
-      }
-      hist photonRe233e237CbTight_BARREL {
-      }
-      hist photonRe237e277CbTight_BARREL {
-      }
-      hist photonEhad1CbTight_CRACK {
-      }
-      hist photonCoreEMCbTight_CRACK {
-      }
-      hist photonF0CbTight_CRACK {
-      }
-      hist photonF1CbTight_CRACK {
-      }
-      hist photonF2CbTight_CRACK {
-      }
-      hist photonF3CbTight_CRACK {
-      }
-      hist photonRe233e237CbTight_CRACK {
-      }
-      hist photonRe237e277CbTight_CRACK {
-      }
-      hist photonEhad1CbTight_ENDCAP {
-      }
-      hist photonCoreEMCbTight_ENDCAP {
-      }
-      hist photonF0CbTight_ENDCAP {
-      }
-      hist photonF1CbTight_ENDCAP {
-      }
-      hist photonF2CbTight_ENDCAP {
-      }
-      hist photonF3CbTight_ENDCAP {
-      }
-      hist photonRe233e237CbTight_ENDCAP {
-      }
-      hist photonRe237e277CbTight_ENDCAP {
-      }
-}
-
- dir egamma/photonsWithTrigger/Region {
-     algorithm = egKolmogorov
-     output = egamma/photonsWithTrigger/EXPERT
-     display = Draw=e1,StatBox
 
-      # CbLoose
-      hist photonConvTrkMatch1CbLoose_BARREL {
-      }
-      hist photonConvTrkMatch2CbLoose_BARREL {
-      }
-      hist photonConvTypeCbLoose_BARREL {
-      }
-      hist photonConvTrkMatch1CbLoose_CRACK {
-      }
-      hist photonConvTrkMatch2CbLoose_CRACK {
-      }
-      hist photonConvTypeCbLoose_CRACK {
-      }
-      hist photonConvTrkMatch1CbLoose_ENDCAP {
-      }
-      hist photonConvTrkMatch2CbLoose_ENDCAP {
-      }
-      hist photonConvTypeCbLoose_ENDCAP {
-      }
-      # CbTight
-      hist photonConvTrkMatch1CbTight_BARREL {
-      }
-      hist photonConvTrkMatch2CbTight_BARREL {
-      }
-      hist photonConvTypeCbTight_BARREL {
-      }
-      hist photonConvTrkMatch1CbTight_CRACK {
-      }
-      hist photonConvTrkMatch2CbTight_CRACK {
-      }
-      hist photonConvTypeCbTight_CRACK {
-      }
-      hist photonConvTrkMatch1CbTight_ENDCAP {
-      }
-      hist photonConvTrkMatch2CbTight_ENDCAP {
-      }
-      hist photonConvTypeCbTight_ENDCAP {
-      }
  }
 
-
- dir egamma/photonsWithTrigger/LBMon {
-     algorithm = egamma_GatherData
-     output = egamma/photonsWithTrigger/LBMon
-     display = Draw=e1,StatBox
-      # CbLoose
-      hist LBEvoNPhotonsCbLoose {
-      }
-      hist LBEvoNPhotonsUnconvCbLoose {
-      }
-      hist LBEvoNPhotonsConvCbLoose {
-      }
-      hist LBEvoConvOverNCbLoose {
-      }
-
-      # CbTight
-      hist LBEvoNPhotonsCbTight {
-      }
-      hist LBEvoNPhotonsUnconvCbTight {
-      }
-      hist LBEvoNPhotonsConvCbTight {
-      }
-      hist LBEvoConvOverNCbTight {
-      }
-}
-
-### forwardElectrons
-
- dir egamma/forwardElectrons {
-     algorithm = egKolmogorov
-     output = egamma/forwardElectrons
-     display = Draw=e1,StatBox
-
-      hist forwardElectronN {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist forwardElectronEt {
-      }
-      hist forwardElectronPhi {
-      }
-      hist forwardElectronEta {
-      }
-      hist forwardElectronEtaPhi {
-       algorithm = egamma_BinsDiffFromStripMedian
-      }
-      # hist forwardElectronTopoEtCone40 {
-      # }
-      hist forwardElectronTime {
-      }
-
-      hist forwardElectronTightN {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist forwardElectronTightEt {
-      }
-      hist forwardElectronTightPhi {
-      }
-      hist forwardElectronTightEta {
-      }
-      hist forwardElectronTightEtaPhi {
-       algorithm = egamma_BinsDiffFromStripMedian
-      }
-      # hist forwardElectronTightTopoEtCone40 {
-      # }
-      hist forwardElectronTightTime {
-      }
-
-}
-
-
- dir egamma/forwardElectrons {
-      Algorithm = Egkolmogorov
-      Output = egamma/forwardElectrons/EXPERT
-      display = Draw=e1,StatBox
-      hist forwardElectronN_ENDCAP {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist forwardElectronEt_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronEta_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronPhi_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      # hist forwardElectronTopoEtCone40_ENDCAP {
-      # output = egamma/forwardElectrons/EXPERT
-      # }
-      hist forwardElectronTime_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightN_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightEt_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightEta_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightPhi_ENDCAP {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      # hist forwardElectronTightTopoEtCone40_ENDCAP {
-      # output = egamma/forwardElectrons/EXPERT
-      # }
-      hist forwardElectronN_FORWARD {
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-       output = egamma/forwardElectrons/EXPERT	
-      }
-      hist forwardElectronEt_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronEta_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronPhi_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      # hist forwardElectronTopoEtCone40_FORWARD {
-      # output = egamma/forwardElectrons/EXPERT
-      # }
-      hist forwardElectronTime_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightN_FORWARD {
-       output = egamma/forwardElectrons/EXPERT
-       algorithm = egamma_Histogram_Not_Empty
-       display = Draw=e1,StatBox,LogY
-      }
-      hist forwardElectronTightEt_FORWARD {
-       output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightEta_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      hist forwardElectronTightPhi_FORWARD {
-      output = egamma/forwardElectrons/EXPERT
-      }
-      # hist forwardElectronTightTopoEtCone40_FORWARD {
-      # output = egamma/forwardElectrons/EXPERT
-      # }
-}
-
-dir egamma/forwardElectrons/ID {
-      algorithm = egKolmogorov
-      output = egamma/forwardElectrons/ID
-      hist forwardElectronENG_DENS_ENDCAP {
-      }
-      hist forwardElectronFRAC_MAX_ENDCAP {
-      }
-      hist forwardElectronLONGITUDINAL_ENDCAP {
-      }
-      hist forwardElectron2ND_LAMBDA_ENDCAP {
-      }
-      hist forwardElectronLATERAL_ENDCAP {
-      }
-      hist forwardElectron2ND_R_ENDCAP {
-      }
-      hist forwardElectronCENTER_LAMBDA_ENDCAP {
-      }
-      hist forwardElectronENG_DENS_FORWARD {
-      }
-      hist forwardElectronFRAC_MAX_FORWARD {
-      }
-      hist forwardElectronLONGITUDINAL_FORWARD {
-      }
-      hist forwardElectron2ND_LAMBDA_FORWARD {
-      }
-      hist forwardElectronLATERAL_FORWARD {
-      }
-      hist forwardElectron2ND_R_FORWARD {
-      }
-      hist forwardElectronCENTER_LAMBDA_FORWARD {
-      }
-}
-
-
-### Tag&Probe Z
-
-dir egamma/tagandprobeZ {
-    algorithm = egKolmogorov
-    output = egamma/tagandprobeZ
-    display = Draw=e1,StatBox
-
-    hist electronTagAndProbeNcandidates {
-    }
-    hist electronTagAndProbeGlobalMass {
-     algorithm = egamma_FitZmass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_BARREL {
-     algorithm = egamma_FitZmass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_CRACK {
-     algorithm = egamma_FitZmass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_ENDCAP {
-     algorithm = egamma_FitZmass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeN {
-     algorithm = egamma_Histogram_Not_Empty
-     display = Draw=e1,StatBox,LogY
-    }
-    hist electronTagAndProbeEt {
-    }
-    hist electronTagAndProbeEta {
-    }
-    hist electronTagAndProbePhi {
-    }
-    hist electronTagAndProbeEtaPhi {
-     algorithm = egamma_BinsDiffFromStripMedian
-    }
-}
-
-dir egamma/tagandprobeZ {
+dir egamma/TnPZ/Efficiencies {
      algorithm = egKolmogorov
      output = egamma/tagandprobeZ
      display = Draw=e1,StatBox
 
-     hist EfficiencyTagAndProbeElectronIDvsEt {
+     hist TnP_ID_efficiency_vs_etprobe { 
      }
-     hist EfficiencyTagAndProbeElectronIDvsEta {
+     hist TnP_ID_efficiency_vs_etaprobe { 
      }
-     hist EfficiencyTagAndProbeElectronIDvsPhi {
+     hist TnP_ID_efficiency_vs_phiprobe { 
      }
-     hist EfficiencyTagAndProbeElectronISOvsEt {
+     hist TnP_Calo_Iso_efficiency_vs_etprobe { 
      }
-     hist EfficiencyTagAndProbeElectronISOvsEta {
+     hist TnP_Calo_Iso_efficiency_vs_etaprobe { 
      }
-     hist EfficiencyTagAndProbeElectronISOvsPhi {
+     hist TnP_Calo_Iso_efficiency_vs_phiprobe { 
      }
-}
-
-dir egamma/tagandprobeZ/ID {
-     algorithm = egKolmogorov
-     output = egamma/tagandprobeZ/ID
-     display = Draw=e1,StatBox
-
-      hist electronTagAndProbeEhad1_BARREL {
-      }
-      hist electronTagAndProbeEoverP_BARREL {
-      }
-      hist electronTagAndProbeCoreEM_BARREL {
-      }
-      hist electronTagAndProbeF1_BARREL {
-      }
-      hist electronTagAndProbeF2_BARREL {
-      }
-      hist electronTagAndProbeF3_BARREL {
-      }
-      hist electronTagAndProbeRe233e237_BARREL {
-      }
-      hist electronTagAndProbeRe237e277_BARREL {
-      }
-      hist electronTagAndProbeEhad1_ENDCAP {
-      }
-      hist electronTagAndProbeEoverP_ENDCAP {
-      }
-      hist electronTagAndProbeCoreEM_ENDCAP {
-      }
-      hist electronTagAndProbeF1_ENDCAP {
-      }
-      hist electronTagAndProbeF2_ENDCAP {
-      }
-      hist electronTagAndProbeF3_ENDCAP {
-      }
-      hist electronTagAndProbeRe233e237_ENDCAP {
-      }
-      hist electronTagAndProbeRe237e277_ENDCAP {
-      }
-      hist electronTagAndProbeEhad1_CRACK {
-      }
-      hist electronTagAndProbeEoverP_CRACK {
-      }
-      hist electronTagAndProbeCoreEM_CRACK {
-      }
-      hist electronTagAndProbeF1_CRACK {
-      }
-      hist electronTagAndProbeF2_CRACK {
-      }
-      hist electronTagAndProbeF3_CRACK {
-      }
-      hist electronTagAndProbeRe233e237_CRACK {
-      }
-      hist electronTagAndProbeRe237e277_CRACK {
-      }
-}
-
-dir egamma/tagandprobeZ/Track { 
-     algorithm = egKolmogorov
-     output = egamma/tagandprobeZ/Track
-     display = Draw=e1,StatBox
-
-      hist electronTagAndProbeNOfBLayerHits_BARREL {
-      }
-      hist electronTagAndProbeNOfTRTHits_BARREL {
-      }
-      hist electronTagAndProbeNOfSiHits_BARREL {
-      }
-      hist electronTagAndProbeDeltaEta1_BARREL {
-      }
-      hist electronTagAndProbeDeltaPhi2_BARREL {
-      }
-      hist electronTagAndProbeNOfBLayerHits_ENDCAP {
-      }
-      hist electronTagAndProbeNOfTRTHits_ENDCAP {
-      }
-      hist electronTagAndProbeNOfSiHits_ENDCAP {
-      }
-      hist electronTagAndProbeDeltaEta1_ENDCAP {
-      }
-      hist electronTagAndProbeDeltaPhi2_ENDCAP {
-      }
-      hist electronTagAndProbeNOfBLayerHits_CRACK {
-      }
-      hist electronTagAndProbeNOfTRTHits_CRACK {
-      }
-      hist electronTagAndProbeNOfSiHits_CRACK {
-      }
-      hist electronTagAndProbeDeltaEta1_CRACK {
-      }
-      hist electronTagAndProbeDeltaPhi2_CRACK {
-      }
-
- }
-
-dir egamma/tagandprobeZ/Isolation {
-     algorithm = egKolmogorov
-     output = egamma/tagandprobeZ
-     display = Draw=e1,StatBox
-
-     hist electronTagAndProbeCaloIso_BARREL {
-     }
-     hist electronTagAndProbeTrackIso_BARREL {
-     }
-     hist electronTagAndProbeCaloIso_ENDCAP {
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etprobe { 
      }
-     hist electronTagAndProbeTrackIso_ENDCAP {
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etaprobe { 
      }
-     hist electronTagAndProbeCaloIso_CRACK {
-     }
-     hist electronTagAndProbeTrackIso_CRACK {
+     hist TnP_Calo_Iso_and_LHTight_ID_efficiency_vs_phiprobe { 
      }
+      
 }
 
-dir egamma/tagandprobeZ/LBMon {
+dir egamma/TnPZ/TnPCandidate {
     algorithm = egamma_GatherData
     output = egamma/tagandprobeZ/LBMon
     display = Draw=e1,StatBox
 
-    hist LBEvoNZcandidates {
+    hist Number_of_Z_candidates_vs_LB { 
     }
+
 }
 
 ### Tag&Probe JPsi
 
-dir egamma/tagandprobeJPsi {
-    algorithm = egKolmogorov
-    output = egamma/tagandprobeJPsi
-    display = Draw=e1,StatBox
-
-    hist electronTagAndProbeNcandidates {
-    }
-    hist electronTagAndProbeGlobalMass {
-     algorithm = egamma_FitJPsimass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_BARREL {
-     algorithm = egamma_FitJPsimass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_CRACK {
-     algorithm = egamma_FitJPsimass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeMass_ENDCAP {
-     algorithm = egamma_FitJPsimass 
-     display = StatBox,gaus(xmin,xmax)
-    }
-    hist electronTagAndProbeN {
-     algorithm = egamma_Histogram_Not_Empty
-     display = Draw=e1,StatBox,LogY
-    }
-    hist electronTagAndProbeEt {
-    }
-    hist electronTagAndProbeEta {
-    }
-    hist electronTagAndProbePhi {
-    }
-    hist electronTagAndProbeEtaPhi {
-     algorithm = egamma_BinsDiffFromStripMedian
-    }
-}
-
-dir egamma/tagandprobeJPsi {
+dir egamma/TnPJPsi/TnPCandidate {
      algorithm = egKolmogorov
      output = egamma/tagandprobeJPsi
      display = Draw=e1,StatBox
 
-     hist EfficiencyTagAndProbeElectronIDvsEt {
+     hist JPsi_candidate_mass {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
      }
-     hist EfficiencyTagAndProbeElectronIDvsEta {
+     hist JPsi_candidate_mass_distribution_Lead_in_Barrel {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
      }
-     hist EfficiencyTagAndProbeElectronIDvsPhi {
+     hist Number_of_JPsi_candidates_vs_eta_leading_e {
      }
-     hist EfficiencyTagAndProbeElectronISOvsEt {
+     hist Number_of_JPsi_candidates_vs_phi_leading_e {
      }
-     hist EfficiencyTagAndProbeElectronISOvsEta {
+     hist JPsi_candidate_mass_distribution_Lead_in_Crack {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
      }
-     hist EfficiencyTagAndProbeElectronISOvsPhi {
+     hist JPsi_candidate_mass_distribution_Lead_in_EndCap {
+      algorithm = egamma_FitJPsimass 
+      display = StatBox,gaus(2500.,4000.)
      }
+
 }
 
-dir egamma/tagandprobeJPsi/ID {
+dir egamma/TnPJPsi/ID {
      algorithm = egKolmogorov
      output = egamma/tagandprobeJPsi/ID
      display = Draw=e1,StatBox
 
-      hist electronTagAndProbeEhad1_BARREL {
-      }
-      hist electronTagAndProbeEoverP_BARREL {
-      }
-      hist electronTagAndProbeCoreEM_BARREL {
-      }
-      hist electronTagAndProbeF1_BARREL {
-      }
-      hist electronTagAndProbeF2_BARREL {
-      }
-      hist electronTagAndProbeF3_BARREL {
-      }
-      hist electronTagAndProbeRe233e237_BARREL {
-      }
-      hist electronTagAndProbeRe237e277_BARREL {
-      }
-      hist electronTagAndProbeEhad1_ENDCAP {
-      }
-      hist electronTagAndProbeEoverP_ENDCAP {
-      }
-      hist electronTagAndProbeCoreEM_ENDCAP {
-      }
-      hist electronTagAndProbeF1_ENDCAP {
-      }
-      hist electronTagAndProbeF2_ENDCAP {
-      }
-      hist electronTagAndProbeF3_ENDCAP {
-      }
-      hist electronTagAndProbeRe233e237_ENDCAP {
-      }
-      hist electronTagAndProbeRe237e277_ENDCAP {
-      }
-      hist electronTagAndProbeEhad1_CRACK {
-      }
-      hist electronTagAndProbeEoverP_CRACK {
-      }
-      hist electronTagAndProbeCoreEM_CRACK {
-      }
-      hist electronTagAndProbeF1_CRACK {
-      }
-      hist electronTagAndProbeF2_CRACK {
-      }
-      hist electronTagAndProbeF3_CRACK {
-      }
-      hist electronTagAndProbeRe233e237_CRACK {
-      }
-      hist electronTagAndProbeRe237e277_CRACK {
-      }
+     hist Ehad1ProbeinBARREL { 
+     }
+     hist EoverPProbeinBARREL { 
+     }
+     hist CoreEMProbeinBARREL { 
+     }
+     hist F0ProbeinBARREL { 
+     }
+     hist F1ProbeinBARREL { 
+     }
+     hist F2ProbeinBARREL { 
+     }
+     hist F3ProbeinBARREL { 
+     }
+     hist Re233e237ProbeinBARREL { 
+     }
+     hist Re237e277ProbeinBARREL { 
+     }
+     hist Ehad1ProbeinENDCAP { 
+     }
+     hist EoverPProbeinENDCAP { 
+     }
+     hist CoreEMProbeinENDCAP { 
+     }
+     hist F0ProbeinENDCAP { 
+     }
+     hist F1ProbeinENDCAP { 
+     }
+     hist F2ProbeinENDCAP { 
+     }
+     hist F3ProbeinENDCAP { 
+     }
+     hist Re233e237ProbeinENDCAP { 
+     }
+     hist Re237e277ProbeinENDCAP { 
+     }
+
 }
 
-dir egamma/tagandprobeJPsi/Track { 
+dir egamma/TnPJPsi/Tracks { 
      algorithm = egKolmogorov
      output = egamma/tagandprobeJPsi/Track
      display = Draw=e1,StatBox
 
-      hist electronTagAndProbeNOfBLayerHits_BARREL {
-      }
-      hist electronTagAndProbeNOfTRTHits_BARREL {
-      }
-      hist electronTagAndProbeNOfSiHits_BARREL {
-      }
-      hist electronTagAndProbeDeltaEta1_BARREL {
-      }
-      hist electronTagAndProbeDeltaPhi2_BARREL {
-      }
-      hist electronTagAndProbeNOfBLayerHits_ENDCAP {
-      }
-      hist electronTagAndProbeNOfTRTHits_ENDCAP {
-      }
-      hist electronTagAndProbeNOfSiHits_ENDCAP {
-      }
-      hist electronTagAndProbeDeltaEta1_ENDCAP {
-      }
-      hist electronTagAndProbeDeltaPhi2_ENDCAP {
-      }
-      hist electronTagAndProbeNOfBLayerHits_CRACK {
-      }
-      hist electronTagAndProbeNOfTRTHits_CRACK {
-      }
-      hist electronTagAndProbeNOfSiHits_CRACK {
-      }
-      hist electronTagAndProbeDeltaEta1_CRACK {
-      }
-      hist electronTagAndProbeDeltaPhi2_CRACK {
-      }
+     hist NOfBLayerHitsProbeinBARREL { 
+     }
+     hist NOfPixelHitsProbeinBARREL { 
+     }
+     hist NOfSCTHitsProbeinBARREL { 
+     }
+     hist NOfTRTHitsProbeinBARREL { 
+     }
+     hist NOfTRTHighThresholdHitsProbeinBARREL { 
+     }
+     hist DeltaEta1ProbeinBARREL { 
+     }
+     hist DeltaPhi2ProbeinBARREL { 
+     }
+     hist Trackd0ProbeinBARREL { 
+     }
+     hist NOfBLayerHitsProbeinENDCAP { 
+     }
+     hist NOfPixelHitsProbeinENDCAP { 
+     }
+     hist NOfSCTHitsProbeinENDCAP { 
+     }
+     hist NOfTRTHitsProbeinENDCAP { 
+     }
+     hist NOfTRTHighThresholdHitsProbeinENDCAP { 
+     }
+     hist DeltaEta1ProbeinENDCAP { 
+     }
+     hist DeltaPhi2ProbeinENDCAP { 
+     }
+     hist Trackd0ProbeinENDCAP { 
+     }
 
  }
 
-dir egamma/tagandprobeJPsi/Isolation {
+dir egamma/TnPJPsi/Efficiencies {
      algorithm = egKolmogorov
      output = egamma/tagandprobeJPsi
      display = Draw=e1,StatBox
 
-     hist electronTagAndProbeCaloIso_BARREL {
+     hist TnP_ID_efficiency_vs_etprobe { 
+     }
+     hist TnP_ID_efficiency_vs_etaprobe { 
      }
-     hist electronTagAndProbeTrackIso_BARREL {
+     hist TnP_ID_efficiency_vs_phiprobe { 
      }
-     hist electronTagAndProbeCaloIso_ENDCAP {
+     hist TnP_Calo_Iso_efficiency_vs_etprobe { 
      }
-     hist electronTagAndProbeTrackIso_ENDCAP {
+     hist TnP_Calo_Iso_efficiency_vs_etaprobe { 
      }
-     hist electronTagAndProbeCaloIso_CRACK {
+     hist TnP_Calo_Iso_efficiency_vs_phiprobe { 
      }
-     hist electronTagAndProbeTrackIso_CRACK {
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etprobe { 
      }
+     hist TnP_Calo_Iso_and_LHTight_efficiency_vs_etaprobe { 
+     }
+     hist TnP_Calo_Iso_and_LHTight_ID_efficiency_vs_phiprobe { 
+     } 
 }
 
-dir egamma/tagandprobeJPsi/LBMon {
+dir egamma/TnPJPsi/TnPCandidate {
     algorithm = egamma_GatherData
     output = egamma/tagandprobeJPsi/LBMon
     display = Draw=e1,StatBox
 
-    hist LBEvoNJPsicandidates {
+    hist Number_of_JPsi_candidates_vs_LB { 
     }
-}
+
+}
\ No newline at end of file
diff --git a/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py b/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py
index 06bf0a1f68eb..a3c7e65039d3 100755
--- a/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py
+++ b/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py
@@ -9,7 +9,6 @@
 '''
 from AthenaConfiguration.ComponentFactory import CompFactory
 
-#def BookHistogramsPerRegions(thegroupe,theparttype,thereconame,thewithTrigger,thename,title,path,xbins,xmin,xmax,thetype="TH1F",thecut="is_pt_gt_4gev"):
 def BookHistogramsPerRegions(thegroupe,theparttype,thename,title,path,xbins,xmin,xmax,thetype="TH1F",thecut="is_pt_gt_4gev"):
     '''
     Function to configure the egamma histograms per region (BARREL, CRACK, ENDCAP, FORWARD)
@@ -17,9 +16,11 @@ def BookHistogramsPerRegions(thegroupe,theparttype,thename,title,path,xbins,xmin
     '''
     Regions = ['BARREL', 'CRACK', 'ENDCAP']
     for n in range(len(Regions)):
-        hname = thename + "in" + Regions[n] + ";" + thename + "in" + Regions[n] #+ " " + thepartype + thereconame + thewithTrigger
+        hname = thename + "in" + Regions[n] #+ ";" + thename + "in" + Regions[n] #+ " " + thepartype + thereconame + thewithTrigger
         htitle = title + " " + theparttype + " " + Regions[n]
-        thegroupe.defineHistogram(hname,title=htitle, path=path, xbins=xbins,xmin=xmin,xmax=xmax,type = thetype, cutmask = thecut)
+        thefinalcut = thecut+Regions[n] 
+        thegroupe.defineHistogram(hname,title=htitle, path=path, xbins=xbins,xmin=xmin,xmax=xmax,type = thetype, cutmask = thefinalcut)
+
 
 def BookHistogramsPerForwardRegions(thegroupe,theparttype,thename,title,path,xbins,xmin,xmax,thetype="TH1F",thecut="is_pt_gt_10gev"):
     '''
@@ -28,10 +29,10 @@ def BookHistogramsPerForwardRegions(thegroupe,theparttype,thename,title,path,xbi
     '''
     Regions = ['ENDCAP','FORWARD']
     for n in range(len(Regions)):
-        hname = thename + "in" + Regions[n] + ";" + thename + "in" + Regions[n] #+ " " + thepartype + thereconame + thewithTrigger
+        hname = thename + "in" + Regions[n] # + ";" + thename + "in" + Regions[n] #+ " " + thepartype + thereconame + thewithTrigger
         htitle = title + " " + theparttype + " " + Regions[n]
-        thegroupe.defineHistogram(hname,title=htitle, path=path, xbins=xbins,xmin=xmin,xmax=xmax,type = thetype, cutmask = thecut)
-
+        thefinalcut = thecut+Regions[n] 
+        thegroupe.defineHistogram(hname,title=htitle, path=path, xbins=xbins,xmin=xmin,xmax=xmax,type = thetype, cutmask = thefinalcut)
 
 def BookHistograms(groupe,reconame,particletype,withTrigger=""):
     '''
@@ -47,6 +48,7 @@ def BookHistograms(groupe,reconame,particletype,withTrigger=""):
         if particletype in ["Photon"] :
             prefix = "photon"
             tlabel = "_{#gamma}"
+
         hname = "N"
         htitle = "Number of " + prefix + "s (" + reconame + " " + withTrigger+ ") ; N" + tlabel + " ; N_{event}"
         groupe.defineHistogram(hname,title=htitle, path='',xbins=20,xmin=-0.5,xmax=19.5)
@@ -54,23 +56,23 @@ def BookHistograms(groupe,reconame,particletype,withTrigger=""):
         if particletype in ["Photon"] :
             hname = "NConv"
             htitle = "Number of converted photons (" + reconame + " " + withTrigger+ ") ; N_{Conv. #gamma} ; N_{event}"
-            groupe.defineHistogram(hname,title=htitle, path='',xbins=20,xmin=-0.5,xmax=19.5,cutmask = 'is_pt_gt_4gevandconv')
+            groupe.defineHistogram(hname,title=htitle, path='',xbins=20,xmin=-0.5,xmax=19.5)
 
             hname = "NUnconv"
             htitle = "Number of unconverted photons (" + reconame + " " + withTrigger+ ") ; N_{Unconv. #gamma} ; N_{event}"
-            groupe.defineHistogram(hname,title=htitle, path='',xbins=20,xmin=-0.5,xmax=19.5,cutmask = 'is_pt_gt_4gevandunconv')
+            groupe.defineHistogram(hname,title=htitle, path='',xbins=20,xmin=-0.5,xmax=19.5)
 
-        hname= "Et ;" + prefix + " Et distribution"
+        hname= "Et"
         htitle= particletype + " transverse energy [MeV]" + " (" + reconame + " " + withTrigger + ")" + " ; Et"+ tlabel +" ; N" + tlabel
         groupe.defineHistogram(hname,title=htitle, path='',xbins=100,xmin=2.,xmax=102000.0)
 
         if particletype in ["Photon"] :
 
-            hname= "Et ; Converted photon Et distribution"
+            hname= "EtConv"
             htitle= "Converted #gamma transverse energy [MeV]" + " (" + reconame + " " + withTrigger + ")" + " ; Et" + tlabel + " ; N" + tlabel
             groupe.defineHistogram(hname,title=htitle, path='',xbins=100,xmin=2.,xmax=102000.0, cutmask = 'is_pt_gt_4gevandconv')
 
-            hname= "Et ; Unconverted photon Et distribution"
+            hname= "EtUnconv"
             htitle= "Unconverted #gamma transverse energy [MeV]" + " (" + reconame + " " + withTrigger + ")" + " ; Et" + tlabel + " ; N" + tlabel
             groupe.defineHistogram(hname,title=htitle, path='',xbins=100,xmin=2.,xmax=102000.0, cutmask = 'is_pt_gt_4gevandunconv')
 
@@ -92,50 +94,50 @@ def BookHistograms(groupe,reconame,particletype,withTrigger=""):
         groupe.defineHistogram(hname,title=htitle, path='',xbins=64,xmin=-3.2,xmax=3.2)
 
         if particletype in ["Photon"] :
-            hname= "Phi ; Phi of conv. photons"
+            hname= "PhiConv"
             htitle= "Converted photon #phi" + " (" + reconame + " " + withTrigger + ")" + " ; #phi" + tlabel + " ; N" + tlabel
             groupe.defineHistogram(hname,title=htitle, path='',xbins=64,xmin=-3.2,xmax=3.2,cutmask = 'is_pt_gt_4gevandconv')
 
-            hname= "Phi ; Phi of unconv. photons"
+            hname= "PhiUnconv"
             htitle= "Unconverted photon #phi" + " (" + reconame + " " + withTrigger + ")" + " ; #phi" + tlabel + " ; N" + tlabel
             groupe.defineHistogram(hname,title=htitle, path='',xbins=64,xmin=-3.2,xmax=3.2, cutmask = 'is_pt_gt_4gevandunconv')
 
-        hname= "Eta,Phi;(Eta,Phi) distribution of Pt>2.5GeV"
+        hname= "Eta,Phi;Eta_Phi_with_Pt_gt_2.5GeV"
         htitle= particletype + " #eta,#phi map (candidates with Pt>2.5GeV)" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi"
         groupe.defineHistogram(hname,title=htitle,path='Expert',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2,cutmask = 'is_pt_gt_2_5gev')
 
         if particletype in ["Photon"] :
-            hname= "Eta,Phi;(Eta,Phi) distribution of Conv. photons with Pt>2.5GeV"
+            hname= "Eta,Phi;Eta_Phi_Conv_with_Pt_gt_2.5GeV"
             htitle= "(#eta,#phi) map of Conv. #gamma with Pt>2.5GeV" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi"
             groupe.defineHistogram(hname,title=htitle,path='Expert',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2, cutmask = 'is_pt_gt_2_5gevandconv')
 
-            hname= "Eta,Phi;(Eta,Phi) distribution of Unconv. photons with Pt>2.5GeV"
+            hname= "Eta,Phi;Eta_Phi_Unconv_with_Pt.gt.2.5GeV"
             htitle= "(#eta,#phi) map of Unconv. #gamma with Pt>2.5GeV" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi"
             groupe.defineHistogram(hname,title=htitle,path='Expert',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2, cutmask = 'is_pt_gt_2_5gevandunconv')
 
-        hname= "Eta,Phi;(Eta,Phi) distribution for "+ prefix +"s with Pt>4GeV"
-        htitle= particletype + " #eta,#phi map (candidates with Pt>4GeV)" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi"
+        hname= "Eta,Phi;Eta_Phi_distribution_with_Pt.gt.4GeV"
+        htitle= particletype + " #eta,#phi map (candidates with Pt>4GeV)" + " (" + reconame + " " + prefix + " " + withTrigger + ") ; #eta ; #phi"
         groupe.defineHistogram(hname,title=htitle,path='',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2,cutmask='is_pt_gt_4gev')
 
         if particletype in ["Photon"] :
-            hname= "Eta,Phi;(Eta,Phi) distribution for Conv. photons with Pt>4GeV"
+            hname= "Eta,Phi;Eta_Phi_Conv_with_Pt.gt.4GeV"
             htitle= particletype + " #eta,#phi map (candidates with Pt>4GeV)" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi"
             groupe.defineHistogram(hname,title=htitle,path='',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2,cutmask='is_pt_gt_4gevandconv')
 
-            hname= "Eta,Phi;(Eta,Phi) distribution of Unconv. photons with Pt>4GeV"
+            hname= "Eta,Phi;Eta_Phi_Unconv_with_Pt.gt.4GeV"
             htitle= particletype + " #eta,#phi map (candidates with Pt>4GeV)" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi"
             groupe.defineHistogram(hname,title=htitle,path='',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2,cutmask='is_pt_gt_4gevandunconv')
 
-        hname= "Eta,Phi;(Eta,Phi) distribution for "+ prefix +"s with Pt>20GeV"
+        hname= "Eta,Phi;Eta_Phi_with_Pt.gt.20GeV"
         htitle= particletype + " #eta,#phi map (candidates with Pt>20GeV)" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi "
         groupe.defineHistogram(hname,title=htitle,path='Expert',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2,cutmask='is_pt_gt_20gev')
 
         if particletype in ["Photon"] :
-            hname= "Eta,Phi;(Eta,Phi) distribution of Conv. photons with Pt>20GeV"
+            hname= "Eta,Phi;Eta_Phi_distribution_of_Conv._photons_with_Pt.gt.20GeV"
             htitle= particletype + " #eta,#phi map (candidates with Pt>20GeV)" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi"
             groupe.defineHistogram(hname,title=htitle,path='Expert',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2,cutmask='is_pt_gt_20gevandconv')
 
-            hname= "Eta,Phi;(Eta,Phi) distribution of Unconv. photons with Pt>20GeV"
+            hname= "Eta,Phi;Eta_Phi_distribution_of_Unconv._photons_with_Pt.gt.20GeV"
             htitle= particletype + " #eta,#phi map (candidates with Pt>20GeV)" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi"
             groupe.defineHistogram(hname,title=htitle,path='Expert',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2,cutmask='is_pt_gt_20gevandunconv')
 
@@ -157,10 +159,6 @@ def BookHistograms(groupe,reconame,particletype,withTrigger=""):
             groupe.defineHistogram(hname,title=htitle, path='',xbins=100,xmin=0.,xmax=800.)
 
         # histograms per region
-        hname = "N"
-        htitle = "Number of " + prefix + "s (" + reconame + " " + withTrigger+ ") ; N" + tlabel +" ; N_{events} "
-        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname,  title=htitle, path='Expert',xbins=20,xmin=0.0,xmax=20.0)
-
         hname= "Et"
         htitle= particletype + " transverse energy [MeV]" + " (" + reconame + " " + withTrigger + ") ; Et" + tlabel + " ; N" + tlabel
         BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert',xbins=100,xmin=2.,xmax=102000.0,thecut='is_pt_gt_2_5gev')
@@ -198,75 +196,75 @@ def BookHistograms(groupe,reconame,particletype,withTrigger=""):
 
         hname= "Ehad1"
         htitle = particletype + " energy leakage in 1st hadronic sampling " + " (" + reconame + " " + withTrigger + ")" + "; Ehad1 (MeV) ; N" + tlabel
-        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-1000.,xmax=10000.)
+        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-1000.,xmax=10000.)
 
         if particletype in ["Electron"] :
             hname= "EoverP"
             htitle = particletype + " matched track E over P " + " (" + reconame + " " + withTrigger + ")" + "; EoverP ; N" + tlabel
-            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=0.,xmax=5.)
+            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=0.,xmax=5.)
 
         hname= "CoreEM"
         htitle = particletype + " core energy in EM calorimeter " + " (" + reconame + " " + withTrigger + ")" + "; E (MeV) ; N" + tlabel
-        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-5000.,xmax=250000.)
+        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-5000.,xmax=250000.)
 
         hname= "F0"
         htitle = particletype + " fractional energy in Presampler " + " (" + reconame + " " + withTrigger + ")" + "; F0 ; N" + tlabel
-        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-0.2,xmax=1.)
+        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-0.2,xmax=1.)
 
         hname= "F1"
         htitle = particletype + " fractional energy in 1st sampling " + " (" + reconame + " " + withTrigger + ")" + "; F1 ; N" + tlabel
-        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-0.2,xmax=1.)
+        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-0.2,xmax=1.)
 
         hname= "F2"
         htitle = particletype + " fractional energy in 2nd sampling " + " (" + reconame + " " + withTrigger + ")" + "; F2 ; N" + tlabel
-        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-0.2,xmax=1.)
+        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-0.2,xmax=1.)
 
         hname= "F3"
         htitle = particletype + " fractional energy in 3rd sampling " + " (" + reconame + " " + withTrigger + ")" + "; F3 ; N" + tlabel
-        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-0.2,xmax=1.)
+        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-0.2,xmax=1.)
 
         hname= "Re233e237"
         htitle = particletype + "  uncor. energy fraction in 3x3/3x7 cells in em sampling 2 " + " (" + reconame + " " + withTrigger + ")" + "; R 3x3/3x7 ; N" + tlabel
-        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=0.,xmax=2.)
+        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=0.,xmax=2.)
 
         hname= "Re237e277"
         htitle = particletype + "  uncor. energy fraction in 3x7/7x7 cells in em sampling 2 " + " (" + reconame + " " + withTrigger + ")" + "; R 3x7/7x7 ; N" + tlabel
-        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=0.,xmax=2.)
+        BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=0.,xmax=2.)
 
         # Specific plots for electrons (related to electron track) in Expert/Tracks Panel
 
         if particletype in ["Electron"] :
             hname= "NOfBLayerHits"
             htitle = particletype + " NOfBLayerHits (" + reconame + " " + withTrigger + ") ; N_{BlayerHits} ; N_{e}"
-            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=6,xmin=-0.5,xmax=5.5)
+            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=6,xmin=-0.5,xmax=5.5)
 
             hname= "NOfPixelHits"
             htitle = particletype + " NOfPixelHits (" + reconame + " " + withTrigger + ") ; N_{PixelHits} ; N_{e}"
-            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=6,xmin=-0.5,xmax=5.5)
+            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=6,xmin=-0.5,xmax=5.5)
 
             hname= "NOfSCTHits"
             htitle = particletype + " NOfSCTHits (" + reconame + " " + withTrigger + ") ; N_{SCTHits} ; N_{e}"
-            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=26,xmin=-0.5,xmax=25.5)
+            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=26,xmin=-0.5,xmax=25.5)
 
             hname= "NOfTRTHits"
             htitle = particletype + " NOfTRTHits (" + reconame + " " + withTrigger + ") ; N_{TRTHits} ; N_{e}"
-            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=26,xmin=-0.5,xmax=50.5)
+            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=26,xmin=-0.5,xmax=50.5)
 
             hname= "NOfTRTHighThresholdHits"
             htitle = particletype + " NOfTRTHighThresholdHits (" + reconame + " " + withTrigger + ") ; N_{TRT HighThres. Hits} ; N_{e}"
-            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=26,xmin=-0.5,xmax=50.5)
+            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=26,xmin=-0.5,xmax=50.5)
 
             hname= "DeltaEta1"
             htitle = particletype + " track match #Delta #eta (1st sampling) " + " (" + reconame + " " + withTrigger + ")  ; #Delta #eta ; N_{e} "
-            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=50,xmin=-0.05,xmax=0.05)
+            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=50,xmin=-0.05,xmax=0.05)
 
             hname= "DeltaPhi2"
             htitle = particletype + " track match #Delta #Phi (2st sampling) " + " (" + reconame + " " + withTrigger + ")  ; #Delta #phi ; N_{e} "
-            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=50,xmin=-0.15,xmax=0.15)
+            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=50,xmin=-0.15,xmax=0.15)
 
             hname= "Trackd0"
             htitle = particletype + " track d0 " + " (" + reconame + " " + withTrigger + ")  ; d0 ; N_{e}"
-            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=100,xmin=-5.,xmax=5.)
+            BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=100,xmin=-5.,xmax=5.)
 
         # LumiBlock dependant histogram
 
@@ -275,15 +273,15 @@ def BookHistograms(groupe,reconame,particletype,withTrigger=""):
         groupe.defineHistogram(hname,title=htitle,path='byLB',type='TH1F',xbins=2000,xmin=-0.5,xmax=1999.5)
 
         if particletype in ["Photon"] :
-            hname= "LBEvoNPhotonsUnconv ; Number of Unconv. photons vs LB"
+            hname= "LBEvoNPhotonsUnconv;Number_of_Unconv._photons_vs_LB"
             htitle = "Unconverted photon number versus LB " + " (" + reconame + " " + withTrigger + ") ; LB ; N_{Unconv. #gamma}"
             groupe.defineHistogram(hname,title=htitle, path='byLB',xbins=2000,xmin=-0.5,xmax=1999.)
 
-            hname= "LBEvoNPhotonsConv ; Number of Conv. photons vs LB"
+            hname= "LBEvoNPhotonsConv;Number_of_Conv._photons_vs_LB"
             htitle = "Converted photon number versus LB " + " (" + reconame + " " + withTrigger + ") ; LB ; N_{Conv. #gamma}"
             groupe.defineHistogram(hname,title=htitle, path='byLB',xbins=2000,xmin=-0.5,xmax=1999.)
 
-            hname= "is_pt_gt_4gevandconv,LB;Conversion fraction vs LB"
+            hname= "is_pt_gt_4gevandconv,LB;Conversion_fraction_vs_LB"
             htitle = "Converted photon fraction versus LB " + " (" + reconame + " " + withTrigger + ") ; LB ; Conv. #gamma fraction"
             groupe.defineHistogram(hname,title=htitle, path='byLB',type = 'TEfficiency', xbins=2000,xmin=-0.5,xmax=1999.)
 
@@ -298,178 +296,178 @@ def BookTnPHistograms(groupe,reconame,TnPType,MassLowerCut,MassUpperCut):
     tlabel = "_{" + TnPType + "}"
     particletype = 'Electron'
 
-    hname = "LB; Number of " + TnPType + "candidates vs LB"
+    hname = "LB;Number_of_" + TnPType + "_candidates_vs_LB"
     htitle = "Number of " + TnPType +" candidates vs LB ; LB ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='TnPCandidate',xbins=2000,xmin=-0.5,xmax=1999.5)
 
-    hname = "MassZ ;" + TnPType + " candidate mass"
+    hname = "MassZ;" + TnPType + "_candidate_mass"
     htitle = TnPType + " candidate mass ; M_{ee} [MeV/ c^{2}]; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='TnPCandidate',xbins=100,xmin=MassLowerCut,xmax=MassUpperCut)
 
-    hname = "MassZ_BARREL ;" + TnPType + " candidate mass distribution (Lead in Barrel)"
+    hname = "MassZ_BARREL;" + TnPType + "_candidate_mass_distribution_Lead_in_Barrel"
     htitle = TnPType + " candidate mass in Barrel ; M_{ee} [MeV/ c^{2}]; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='TnPCandidate',xbins=100,xmin=MassLowerCut,xmax=MassUpperCut)
 
-    hname = "MassZ_ENDCAP ;" + TnPType + " candidate mass distribution (Lead in EndCap)"
+    hname = "MassZ_ENDCAP;" + TnPType + "_candidate_mass_distribution_Lead_in_EndCap"
     htitle = TnPType + " candidate mass in Barrel ; M_{ee} [MeV/ c^{2}]; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='TnPCandidate',xbins=100,xmin=MassLowerCut,xmax=MassUpperCut)
 
-    hname = "MassZ_CRACK ;" + TnPType + " candidate mass distribution (Lead in Crack)"
+    hname = "MassZ_CRACK;" + TnPType + "_candidate_mass_distribution_Lead_in_Crack"
     htitle = TnPType + " candidate mass in Barrel ; M_{ee} [MeV/ c^{2}]; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='TnPCandidate',xbins=100,xmin=MassLowerCut,xmax=MassUpperCut)
 
     # The next two histos receive 1 entry per leading electron probe candidate
 
-    hname = "EtaZ ; Number of "+ TnPType + " candidates vs eta_leading_e "
+    hname = "EtaZ;Number_of_"+ TnPType + "_candidates_vs_eta_leading_e"
     htitle = "Number of "+ TnPType +" candidates vs #eta of leading e" + " ; #eta_{e_{lead}} ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='TnPCandidate',xbins=64,xmin=-3.2,xmax=3.2)
 
-    hname = "PhiZ ; Number of "+ TnPType + " candidates vs phi_leading_e "
+    hname = "PhiZ;Number_of_"+ TnPType + "_candidates_vs_phi_leading_e"
     htitle = "Number of "+ TnPType +" candidates vs #phi of e" + " ; #phi_{e_{lead}} ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='TnPCandidate',xbins=64,xmin=-3.2,xmax=3.2)
 
     # EFFICIENCIES IN EFFICIENCIES PANEL
 
-    hname= "is_Tight,Etprobe; Tag & Probe ID efficiency vs etprobe"
+    hname = "is_Tight,Etprobe;TnP_ID_efficiency_vs_etprobe"
     htitle = "Tag & Probe  ID efficiency vs Et_{e} [MeV] ; Et_{e} [MeV] ; LHTight ID Eff. "
     groupe.defineHistogram(hname,title=htitle, path='Efficiencies',type = 'TEfficiency', xbins=100,xmin=0.,xmax=250000.)
 
-    hname= "is_Tight,Etaprobe; Tag & Probe ID efficiency vs etaprobe"
+    hname = "is_Tight,Etaprobe;TnP_ID_efficiency_vs_etaprobe"
     htitle = "Tag & Probe  ID efficiency vs #eta ; #eta _{e} ; LHTight ID Eff. "
     groupe.defineHistogram(hname,title=htitle, path='Efficiencies',type = 'TEfficiency', xbins=64,xmin=-3.2,xmax=3.2)
 
-    hname= "is_Tight,Phiprobe; Tag & Probe ID efficiency vs phiprobe"
+    hname = "is_Tight,Phiprobe;TnP_ID_efficiency_vs_phiprobe"
     htitle = "Tag & Probe  ID efficiency vs #eta ; #phi _{e} ; LHTight ID Eff. "
     groupe.defineHistogram(hname,title=htitle, path='Efficiencies',type = 'TEfficiency', xbins=64,xmin=-3.2,xmax=3.2)
 
-    hname= "is_Iso,Etprobe; Tag & Probe  Calo Iso efficiency vs etprobe"
+    hname = "is_Iso,Etprobe;TnP_Calo_Iso_efficiency_vs_etprobe"
     htitle = "Tag & Probe  Calo. Isolation efficiency vs Et _{e} [MeV] ; Et_{e} [MeV] ; Calo Iso Eff. "
     groupe.defineHistogram(hname,title=htitle, path='Efficiencies',type = 'TEfficiency', xbins=100,xmin=0.,xmax=250000.)
 
-    hname= "is_Iso,Etaprobe; Tag & Probe Calo Iso efficiency vs etaprobe"
+    hname = "is_Iso,Etaprobe;TnP_Calo_Iso_efficiency_vs_etaprobe"
     htitle = "Tag & Probe  Calo. Isolation efficiency vs #eta_{e} ; #eta_{e} ; Calo. Iso Eff. "
     groupe.defineHistogram(hname,title=htitle, path='Efficiencies',type = 'TEfficiency', xbins=64,xmin=-3.2,xmax=3.2)
 
-    hname= "is_Iso,Phiprobe; Tag & Probe Calo Iso efficiency vs phiprobe"
+    hname = "is_Iso,Phiprobe;TnP_Calo_Iso_efficiency_vs_phiprobe"
     htitle = "Tag & Probe Calo. Isolation efficiency vs #phi_{e} ; #phi_{e}; Calo Iso. Eff. "
     groupe.defineHistogram(hname,title=htitle, path='Efficiencies',type = 'TEfficiency', xbins=64,xmin=-3.2,xmax=3.2)
 
-    hname= "is_IsoandTight,Etprobe; Tag & Probe Calo Iso + LHTight efficiency vs etprobe"
+    hname = "is_IsoandTight,Etprobe;TnP_Calo_Iso_and_LHTight_efficiency_vs_etprobe"
     htitle = "Tag & Probe (Isolation & LHTight ID) efficiency vs Et_{e} [MeV] ; Et_{e} [MeV] ; Calo Iso & LHTight ID Eff. "
     groupe.defineHistogram(hname,title=htitle, path='Efficiencies',type = 'TEfficiency', xbins=100,xmin=0.,xmax=250000.)
 
-    hname= "is_IsoandTight,Etaprobe; Tag & Probe Calo Iso + LHTight efficiency vs etaprobe"
+    hname = "is_IsoandTight,Etaprobe;TnP_Calo_Iso_and_LHTight_efficiency_vs_etaprobe"
     htitle = "Tag & Probe (Isolation & LHTight ID) efficiency vs #eta ; #eta _{e} ; Calo. Iso & LHTight ID Eff. "
     groupe.defineHistogram(hname,title=htitle, path='Efficiencies',type = 'TEfficiency', xbins=64,xmin=-3.2,xmax=3.2)
 
-    hname= "is_IsoandTight,Phiprobe; Tag & Probe Calo Iso + LHTight ID efficiency vs phiprobe"
+    hname = "is_IsoandTight,Phiprobe;TnP_Calo_Iso_and_LHTight_ID_efficiency_vs_phiprobe"
     htitle = "Tag & Probe (Isolation & LHTight ID) efficiency vs #phi_{e} ; #phi_{e} ; Calo Iso & LHTight ID Eff. "
     groupe.defineHistogram(hname,title=htitle, path='Efficiencies',type = 'TEfficiency', xbins=64,xmin=-3.2,xmax=3.2)
 
 
     # Probe electron candidate distributions
 
-    hname = "Etprobe ;Etprobe distribution"
+    hname = "Etprobe;Etprobe_distribution"
     htitle = "Number of "+ TnPType +" candidates vs of leading e ; Et_{probe} ; N_{e_ {probe}}"
     groupe.defineHistogram(hname,title=htitle, path='ElectronProbes',xbins=100,xmin=-1000.0,xmax=200000.0)
 
-    hname= "Etaprobe ;Etaprobe distribution"
+    hname = "Etaprobe;Etaprobe_distribution"
     htitle = "#eta distribution of probe candidates ; #eta_{e_{probe}} ; N_{e_ {probe}}"
     groupe.defineHistogram(hname,title=htitle,path='ElectronProbes', xbins=64,xmin=-3.2,xmax=3.2)
 
-    hname = "Phiprobe ;Phiprobe distribution"
+    hname = "Phiprobe;Phiprobe_distribution"
     htitle = "#phi distribution of probe candidates ; #phi_{e_{probe}} ; N_{e_ {probe}}"
     groupe.defineHistogram(hname,title=htitle,path='ElectronProbes', xbins=64,xmin=-3.2,xmax=3.2)
 
-    hname= "Etaprobe,Phiprobe;(Eta,Phi) map of electron probes for T&P "+ TnPType
+    hname = "Etaprobe,Phiprobe;Eta_Phi_map_of_electron_probes_for_T_and_P_"+ TnPType
     htitle= "Concerted photons #eta,#phi map (candidates with Pt>4GeV)" + " ; #eta_{e} ; #phi_{e}"
     groupe.defineHistogram(hname,title=htitle,path='ElectronProbes',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2)
 
-    hname= "Timeprobe ;Time of electron probe"
+    hname = "Timeprobe;Time_of_electron_probe"
     htitle = "Time distribution of probe candidates ; Time_{e_{probe}} [ns] ; N_{e_{probe}}"
     groupe.defineHistogram(hname,title=htitle,path='ElectronProbes',xbins=90,xmin=-30.,xmax=60.)
 
-    hname= "TopoEtCone40probe; TopoEtCone40 of electron probe"
+    hname = "TopoEtCone40probe;TopoEtCone40_of_electron_probe"
     htitle = "Electron probe Topocluster Isolation Energy ; TopoEtCone40 [MeV] ; N_{e_{probe}} "
     groupe.defineHistogram(hname,title=htitle, path='ElectronProbes',xbins=100,xmin=-10000.,xmax=40000.)
 
-    hname= "PtCone20probe; PtCone20 of electron probe"
+    hname = "PtCone20probe;PtCone20_of_electron_probe"
     htitle = "Electron probe Track Isolation Pt [MeV]; PtCone20 [MeV] ; N_{e_{probe}} "
     groupe.defineHistogram(hname,title=htitle, path='ElectronProbes',xbins=64,xmin=-10000.,xmax=40000.)
 
     # Track distributions
 
-    hname= "NOfBLayerHits"
+    hname = "NOfBLayerHitsProbe"
     htitle = "Electron probe NOfBLayerHits ; N_{BlayerHits} ; N_{e_{probe}}"
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=6,xmin=-0.5,xmax=5.5)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=6,xmin=-0.5,xmax=5.5)
 
-    hname= "NOfPixelHits"
+    hname = "NOfPixelHitsProbe"
     htitle = "Electron probe NOfPixelHits ; N_{PixelHits} ; N_{e_{probe}}"
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=6,xmin=-0.5,xmax=5.5)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=6,xmin=-0.5,xmax=5.5)
 
-    hname= "NOfSCTHits"
+    hname = "NOfSCTHitsProbe"
     htitle = "Electron probe NOfSCTHits ; N_{SCTHits} ; N_{e_{probe}}"
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=26,xmin=-0.5,xmax=25.5)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=26,xmin=-0.5,xmax=25.5)
 
-    hname= "NOfTRTHits"
+    hname = "NOfTRTHitsProbe"
     htitle = "Electron probe NOfTRTHits ; N_{TRTHits} ; N_{e_{probe}}"
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=26,xmin=-0.5,xmax=50.5)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=26,xmin=-0.5,xmax=50.5)
 
-    hname= "NOfTRTHighThresholdHits"
+    hname = "NOfTRTHighThresholdHitsProbe"
     htitle = "Electron probe NOfTRTHighThresholdHits ; N_{TRT HighThres. Hits} ; N_{e_{probe}}"
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=26,xmin=-0.5,xmax=50.5)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=26,xmin=-0.5,xmax=50.5)
 
-    hname= "DeltaEta1"
+    hname = "DeltaEta1Probe"
     htitle = "Electron probe track match #Delta #eta (1st sampling) ; #Delta #eta ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=50,xmin=-0.05,xmax=0.05)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=50,xmin=-0.05,xmax=0.05)
 
-    hname= "DeltaPhi2"
+    hname = "DeltaPhi2Probe"
     htitle = "Electron probe track match #Delta #Phi (2st sampling) ; #Delta #phi ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=50,xmin=-0.15,xmax=0.15)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=50,xmin=-0.15,xmax=0.15)
 
-    hname= "Trackd0"
+    hname = "Trackd0Probe"
     htitle = "Electron probe track d0 ; d0 ; N_{e_{probe}}"
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/Tracks',xbins=100,xmin=-5.,xmax=5.)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Tracks',xbins=100,xmin=-5.,xmax=5.)
 
     # ID distributions
 
-    hname= "Ehad1"
+    hname = "Ehad1Probe"
     htitle = "Electron probe energy leakage in 1st hadronic sampling ; Ehad1 (MeV) ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-1000.,xmax=10000.)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-1000.,xmax=10000.)
 
-    hname= "EoverP"
+    hname = "EoverPProbe"
     htitle = "Electron probe matched track E over P ; EoverP ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=0.,xmax=5.)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=0.,xmax=5.)
 
-    hname= "CoreEM"
+    hname = "CoreEMProbe"
     htitle = "Electron probe core energy in EM calorimeter ; E (MeV) ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-5000.,xmax=250000.)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-5000.,xmax=250000.)
 
-    hname= "F0"
+    hname = "F0Probe"
     htitle = "Electron probe fractional energy in Presampler ; F0 ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-0.2,xmax=1.)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-0.2,xmax=1.)
 
-    hname= "F1"
+    hname = "F1Probe"
     htitle = "Electron probe fractional energy in 1st sampling ; F1 ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-0.2,xmax=1.)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-0.2,xmax=1.)
 
-    hname= "F2"
+    hname = "F2Probe"
     htitle = "Electron probe fractional energy in 2nd sampling ; F2 ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-0.2,xmax=1.)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-0.2,xmax=1.)
 
-    hname= "F3"
+    hname = "F3Probe"
     htitle = "Electron probe fractional energy in 3rd sampling ; F3 ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=-0.2,xmax=1.)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=-0.2,xmax=1.)
 
-    hname= "Re233e237"
+    hname = "Re233e237Probe"
     htitle = "Electron probe  uncor. energy fraction in 3x3/3x7 cells in em sampling ; R 3x3/3x7 ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=0.,xmax=2.)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=0.,xmax=2.)
 
-    hname= "Re237e277"
+    hname = "Re237e277Probe"
     htitle = "Electron probe  uncor. energy fraction in 3x7/7x7 cells in em sampling 2 ; R 3x7/7x7 ; N_{e_{probe}} "
-    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert/ID',xbins=50,xmin=0.,xmax=2.)
+    BookHistogramsPerRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='ID',xbins=50,xmin=0.,xmax=2.)
 
-    hname= "LBEvoN"
+    hname = "LBEvoNProbe"
     htitle= "Number of " + TnPType + " electron probe per LB ; LB ; N_{e_{probe}} "
     groupe.defineHistogram(hname,title=htitle,path='byLB',type='TH1F',xbins=2000,xmin=-0.5,xmax=1999.5)
 
@@ -489,7 +487,15 @@ def BookFwdElectronHistograms(groupe,reconame,particletype,withTrigger=""):
     htitle = "Number of " + prefix + "s (" + reconame + " " + withTrigger+ ") ; N" + tlabel + " ; N_{event}"
     groupe.defineHistogram(hname,title=htitle, path='',xbins=20,xmin=-0.5,xmax=19.5)
 
-    hname= "Et ;" + prefix + " Et distribution"
+    hname = "NinENDCAP"
+    htitle = "Number of " + prefix + "s in ENDCAP (" + reconame + " " + withTrigger+ ") ; N" + tlabel + " ; N_{event}"
+    groupe.defineHistogram(hname,title=htitle, path='',xbins=20,xmin=-0.5,xmax=19.5)
+
+    hname = "NinFORWARD"
+    htitle = "Number of " + prefix + "s in FORWARD (" + reconame + " " + withTrigger+ ") ; N" + tlabel + " ; N_{event}"
+    groupe.defineHistogram(hname,title=htitle, path='',xbins=20,xmin=-0.5,xmax=19.5)
+
+    hname= "Et" 
     htitle= particletype + " transverse energy [MeV]" + " (" + reconame + " " + withTrigger + ")" + " ; Et"+ tlabel +" ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='',xbins=100,xmin=2.,xmax=102000.0)
 
@@ -501,41 +507,41 @@ def BookFwdElectronHistograms(groupe,reconame,particletype,withTrigger=""):
     htitle= particletype + " #phi" + " (" + reconame + " " + withTrigger + ")" + " ; #phi" + tlabel + " ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='',xbins=64,xmin=-3.2,xmax=3.2)
 
-    hname= "Eta,Phi;(Eta,Phi) distribution of Pt>2.5GeV"
+    hname= "Eta,Phi;Eta_Phi_distribution_Pt_gt_2.5GeV"
     htitle= particletype + " #eta,#phi map (candidates with Pt>2.5GeV)" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi"
     groupe.defineHistogram(hname,title=htitle,path='Expert',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2,cutmask = 'is_pt_gt_2_5gev')
 
-    hname= "Eta,Phi;(Eta,Phi) distribution for "+ prefix +"s with Pt>10GeV"
+    hname= "Eta,Phi;Eta_Phi_distributionf_Pt_gt_10GeV"
     htitle= particletype + " #eta,#phi map (candidates with Pt>10GeV)" + " (" + reconame + " " + withTrigger + ") ; #eta ; #phi "
     groupe.defineHistogram(hname,title=htitle,path='',type='TH2F',xbins=64,xmin=-3.2,xmax=3.2,ybins=64,ymin=-3.2,ymax=3.2,cutmask='is_pt_gt_10gev')
 
     # shower variables
 
-    hname= "EnergyDensity ; Fwd Electron first moment energy density distribution"
+    hname= "EnergyDensity"
     htitle= "Fwd electron 1st Moment Energy Density" + " (" + reconame + " " + withTrigger + ")" + " ; firstENGdensity ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='',xbins=200,xmin=0.,xmax=2.0)
 
-    hname= "FracMax ; Fwd Electron fraction of most energetic cell distribution"
+    hname= "FracMax"
     htitle= "Fwd electron fraction of most energetic cell distribution" + " (" + reconame + " " + withTrigger + ")" + " ; lateral moment ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='',xbins=50,xmin=0.,xmax=1.0)
 
-    hname= "Lateral ; Fwd Electron normalized lateral moment distribution"
+    hname= "Lateral"
     htitle= "Fwd electron lateral moment distribution" + " (" + reconame + " " + withTrigger + ")" + " ; lateral moment ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='',xbins=100,xmin=0.,xmax=1.0)
 
-    hname= "Longitudinal ; Fwd Electron normalized longitudinal moment distribution"
+    hname= "Longitudinal"
     htitle= "Fwd electron longitudinal moment distribution" + " (" + reconame + " " + withTrigger + ")" + " ; longitudinal moment ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='',xbins=100,xmin=0.,xmax=1.0)
 
-    hname= "SecondLambda ; Fwd Electron second R moment distribution"
+    hname= "SecondLambda"
     htitle= "Fwd electron lambda second moment distribution" + " (" + reconame + " " + withTrigger + ")" + " ; Second#Lambda ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='',xbins=500,xmin=0.,xmax=10000.0)
 
-    hname= "SecondR ; Fwd Electron second R moment distribution"
-    htitle= "Fwd electron lateral moment distribution" + " (" + reconame + " " + withTrigger + ")" + " ; SecondR ; N" + tlabel
+    hname= "SecondR"
+    htitle= "Fwd electron SecondR lateral moment distribution" + " (" + reconame + " " + withTrigger + ")" + " ; SecondR ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='',xbins=500,xmin=0.,xmax=20000.0)
 
-    hname= "CenterLambda ; Fwd Electron shower center from calo front face distribution"
+    hname= "CenterLambda"
     htitle= "Fwd Electron shower center from calo front face distribution" + " (" + reconame + " " + withTrigger + ")" + " ; Center lambda ; N" + tlabel
     groupe.defineHistogram(hname,title=htitle, path='',xbins=500,xmin=0.,xmax=2000.0)
 
@@ -546,10 +552,6 @@ def BookFwdElectronHistograms(groupe,reconame,particletype,withTrigger=""):
     # info per forward region
 
     # histograms per region
-    hname = "N"
-    htitle = "Number of " + prefix + "s (" + reconame + " " + withTrigger+ ") ; N" + tlabel +" ; N_{events} "
-    BookHistogramsPerForwardRegions(thegroupe = groupe, theparttype = particletype, thename = hname,  title=htitle, path='Expert',xbins=20,xmin=0.0,xmax=20.0)
-
     hname= "Et"
     htitle= particletype + " transverse energy [MeV]" + " (" + reconame + " " + withTrigger + ") ; Et" + tlabel + " ; N" + tlabel
     BookHistogramsPerForwardRegions(thegroupe = groupe, theparttype = particletype, thename = hname, title=htitle, path='Expert',xbins=100,xmin=2.,xmax=102000.0,thecut='is_pt_gt_2_5gev')
@@ -578,7 +580,7 @@ def MonitorElectronConfig(inputFlags):
 
     ### STEP 2 ###
 
-    SpareElectronMonitoringGroups = [ "CBTightTrig" ]
+    SpareElectronMonitoringGroups = [ ]
 
     MonitorElectronAlgorithm=CompFactory.MonitorElectronAlgorithm
     elLHTightMonAlg = helper.addAlgorithm(MonitorElectronAlgorithm,'elLHTightMonAlg')
@@ -667,17 +669,17 @@ def MonitorElectronConfig(inputFlags):
     BookHistograms(GroupElectronLHTightTriggered,"LHTightTrig","Electron","WithTrigger")
     # LHLoose Electrons
     BookHistograms(GroupElectronLHLoose,"LHLoose","Electron")
-    BookHistograms(GroupElectronLHLooseTriggered,"LHLooseTrig","Electron","withTrigger")
+    BookHistograms(GroupElectronLHLooseTriggered,"LHLooseTrig","Electron","WithTrigger")
     # Cut Based Tight Electrons
     if ("CBTight" in SpareElectronMonitoringGroups) :
         BookHistograms(GroupElectronCBTight,"CBTight","Electron")
     if ("CBTightTrig" in SpareElectronMonitoringGroups) :
-        BookHistograms(GroupElectronCBTightTriggered,"CBTightTrig","Electron","withTrigger")
+        BookHistograms(GroupElectronCBTightTriggered,"CBTightTrig","Electron","WithTrigger")
     # Cut Based Loose Electrons
     if ("CBLoose" in SpareElectronMonitoringGroups) :
         BookHistograms(GroupElectronCBLoose,"CBLoose","Electron")
     if ("CBLooseTrig" in SpareElectronMonitoringGroups) :
-        BookHistograms(GroupElectronCBLooseTriggered,"CBLooseTrig","Electron","withTrigger")
+        BookHistograms(GroupElectronCBLooseTriggered,"CBLooseTrig","Electron","WithTrigger")
 
     ### STEP 6 ###
     return helper.result()
@@ -760,10 +762,11 @@ def MonitorTnPConfig(inputFlags):
 
     ### STEP 2 ###
 
-    MonitorTnPAlgorithm=CompFactory.MonitorTnPAlgorithm
+    MonitorTnPAlgorithm = CompFactory.MonitorTnPAlgorithm
     ZeeMonAlg = helper.addAlgorithm(MonitorTnPAlgorithm,'TnPZeeMonAlg')
     JPsiMonAlg = helper.addAlgorithm(MonitorTnPAlgorithm,'TnPJpsiMonAlg')
 
+
     ### STEP 3 ###
     # Edit properties of algorithms
 
@@ -782,10 +785,10 @@ def MonitorTnPConfig(inputFlags):
     JPsiMonAlg.ParticleContainerName = "Electrons"
     JPsiMonAlg.RecoName = "LHLoose"
     JPsiMonAlg.ParticlePrefix = "electron"
-    JPsiMonAlg.MassPeak = 3097
-    JPsiMonAlg.ElectronEtCut = 3000
-    JPsiMonAlg.MassLowerCut = 2500
-    JPsiMonAlg.MassUpperCut = 3500
+    JPsiMonAlg.MassPeak = 3097.
+    JPsiMonAlg.ElectronEtCut = 3000.
+    JPsiMonAlg.MassLowerCut = 2500.
+    JPsiMonAlg.MassUpperCut = 3500.
     JPsiMonAlg.TnPType = "JPsi"
     JPsiMonAlg.TriggerChain =egammaConf.monitoring_Jpsiee[0]
 
@@ -880,7 +883,6 @@ def MonitorForwardElectronConfig(inputFlags):
         # to enable a trigger filter, for example:
         fwdelCBLooseTrigMonAlg.TriggerChain = egammaConf.primary_single_ele[0]
 
-
     ### STEP 4 ###
 
     #GroupFwdElectronLHTight = helper.addGroup(fwdelLHTightMonAlg, 'MonitorFwdElectron', 'egamma/LHTightFwdElectrons/')
@@ -900,21 +902,21 @@ def MonitorForwardElectronConfig(inputFlags):
     # Configure histograms
 
     # LHTight FwdElectrons
-    #BookHistograms(GroupFwdElectronLHTight,"LHTight","FwdElectron")
-    #BookHistograms(GroupFwdElectronLHTightTriggered,"LHTightTrig","FwdElectron","WithTrigger")
+    #BookFwdHistograms(GroupFwdElectronLHTight,"LHTight","FwdElectron")
+    #BookFwdHistograms(GroupFwdElectronLHTightTriggered,"LHTightTrig","FwdElectron","WithTrigger")
     # LHLoose FwdElectrons
-    #BookHistograms(GroupFwdElectronLHLoose,"LHLoose","FwdElectron")
-    #BookHistograms(GroupFwdElectronLHLooseTriggered,"LHLooseTrig","FwdElectron","withTrigger")
+    #BookFwdHistograms(GroupFwdElectronLHLoose,"LHLoose","FwdElectron")
+    #BookFwdHistograms(GroupFwdElectronLHLooseTriggered,"LHLooseTrig","FwdElectron","WithTrigger")
     # Cut Based Tight FwdElectrons
     if ("CBFwdTight" in SpareFwdElectronMonitoringGroups) :
         BookFwdElectronHistograms(GroupFwdElectronCBTight,"CBTight","FwdElectron")
     if ("CBFwdTightTrig" in SpareFwdElectronMonitoringGroups) :
-        BookFwdElectronHistograms(GroupFwdElectronCBTightTriggered,"CBTightTrig","FwdElectron","withTrigger")
+        BookFwdElectronHistograms(GroupFwdElectronCBTightTriggered,"CBTightTrig","FwdElectron","WithTrigger")
     # Cut Based Loose FwdElectrons
     if ("CBFwdLoose" in SpareFwdElectronMonitoringGroups) :
         BookFwdElectronHistograms(GroupFwdElectronCBLoose,"CBLoose","FwdElectron")
     if ("CBFwdLooseTrig" in SpareFwdElectronMonitoringGroups) :
-        BookFwdElectronHistograms(GroupFwdElectronCBLooseTriggered,"CBLooseTrig","FwdElectron","withTrigger")
+        BookFwdElectronHistograms(GroupFwdElectronCBLooseTriggered,"CBLooseTrig","FwdElectron","WithTrigger")
 
     ### STEP 6 ###
     return helper.result()
@@ -934,9 +936,14 @@ if __name__=='__main__':
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
     file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
+
     ConfigFlags.Input.Files = [nightly+file]
+#    ConfigFlags.Input.Files = 'AOD.11038520._000001.pool.root.1'
     ConfigFlags.Input.isMC = False
-    ConfigFlags.Output.HISTFileName = 'MonitorEgammaOutput.root'
+#    ConfigFlags.Output.HISTFileName = 'MonitorEgammaOutput.root'
+
+# To produce WebDisplay, filename must follow a certain format
+    ConfigFlags.Output.HISTFileName = 'data16_13TeV.00311321.physics_Main.merge.HIST.f1156_h347._0002.1.root'
 
     ConfigFlags.lock()
 
@@ -959,12 +966,18 @@ if __name__=='__main__':
     cfg.merge(MonitorFwdElectronAcc)
 
     # If you want to turn on more detailed messages ...
-    #MonitorTnPAcc.getEventAlgo('TnPZeeMonAlg').OutputLevel = 2 # DEBUG
-    #MonitorFwdElectronAcc.getEventAlgo('fwdelCBTightMonAlg').OutputLevel = 2 # DEBUG
+
+    #MonitorElectronAcc.getEventAlgo('elLHLooseMonAlg').OutputLevel = 2 # 2 = DEBUG
+    #MonitorPhotonAcc.getEventAlgo('phCBLooseMonAlg').OutputLevel = 2 # 2 = DEBUG
+    #MonitorTnPAcc.getEventAlgo('TnPZeeMonAlg').OutputLevel = 2 # 2 = DEBUG
+    #MonitorFwdElectronAcc.getEventAlgo('fwdelCBTightMonAlg').OutputLevel = 2 # 2 = DEBUG
+
+    MonitorFwdElectronAcc = MonitorForwardElectronConfig(ConfigFlags)
+    cfg.merge(MonitorFwdElectronAcc)
 
     cfg.printConfig(withDetails=False) # set True for exhaustive info
     #cfg.printConfig(withDetails=True) # set True for exhaustive info
 
-    #cfg.run(2)
-    cfg.run(-1)
-    #cfg.run(600) #use cfg.run(20) to only run on first 20 events
+    #cfg.run(10)
+    cfg.run(-1)  # the one to process all events  
+    #cfg.run(600) # use cfg.run(20) to only run on first 20 events
diff --git a/Reconstruction/egamma/egammaPerformance/python/egammaMonitoringConfig.py b/Reconstruction/egamma/egammaPerformance/python/egammaMonitoringConfig.py
index bdbd7bfa7f74..f620e45d53f4 100644
--- a/Reconstruction/egamma/egammaPerformance/python/egammaMonitoringConfig.py
+++ b/Reconstruction/egamma/egammaPerformance/python/egammaMonitoringConfig.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
 #
 
 def egammaMonitoringConfig(flags):
@@ -8,9 +8,11 @@ def egammaMonitoringConfig(flags):
 
     # don't run in RAW -> ESD
     if flags.DQ.Environment in ('tier0', 'tier0ESD',' online', 'AOD'):
-        from egammaPerformance.SetupEgammaMonitoring import MonitorElectronConfig, MonitorPhotonConfig
+        from egammaPerformance.SetupEgammaMonitoring import MonitorElectronConfig, MonitorPhotonConfig, MonitorTnPConfig, MonitorForwardElectronConfig
 
         result.merge(MonitorElectronConfig(flags))
         result.merge(MonitorPhotonConfig(flags))
+        result.merge(MonitorTnPConfig(flags))
+        result.merge(MonitorForwardElectronConfig(flags))
 
     return result
diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx
index d8d3fedad498..274f45b3c454 100755
--- a/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx
+++ b/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx
@@ -20,6 +20,7 @@ StatusCode MonitorElectronAlgorithm::initialize() {
     ATH_CHECK( AthMonitorAlgorithm::initialize() );
     ATH_CHECK( m_ParticleContainerKey.initialize() );
     ATH_CHECK( m_ElectronIsolationKey.initialize() );
+
     return StatusCode::SUCCESS;
 }
 
@@ -75,7 +76,7 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c
     auto f1_barrel = Monitored::Scalar<Float_t>("F1inBARREL",0.0);
     auto f2_barrel = Monitored::Scalar<Float_t>("F2inBARREL",0.0);
     auto f3_barrel = Monitored::Scalar<Float_t>("F3inBARREL",0.0);
-    auto re233e237_barrel = Monitored::Scalar<Float_t>("Re233e337inBARREL",0.0);
+    auto re233e237_barrel = Monitored::Scalar<Float_t>("Re233e237inBARREL",0.0);
     auto re237e277_barrel = Monitored::Scalar<Float_t>("Re237e277inBARREL",0.0);
     auto nofblayerhits_barrel = Monitored::Scalar<u_int8_t>("NOfBLayerHitsinBARREL",0);
     auto nofpixelhits_barrel = Monitored::Scalar<u_int8_t>("NOfPixelHitsinBARREL",0);
@@ -95,12 +96,12 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c
     auto ehad1_endcap = Monitored::Scalar<Float_t>("Ehad1inENDCAP",0.0);
     auto eoverp_endcap = Monitored::Scalar<Float_t>("EoverPinENDCAP",0.0);
     auto coreem_endcap = Monitored::Scalar<Float_t>("CoreEMinENDCAP",0.0);
-    auto f0_endcap = Monitored::Scalar<Float_t>("F0_endcapinENDCAP",0.0);
-    auto f1_endcap = Monitored::Scalar<Float_t>("F1_endcapinENDCAP",0.0);
-    auto f2_endcap = Monitored::Scalar<Float_t>("F2_endcapinENDCAP",0.0);
-    auto f3_endcap = Monitored::Scalar<Float_t>("F3_endcapinENDCAP",0.0);
-    auto re233e237_endcap = Monitored::Scalar<Float_t>("Re233e337_endcapinENDCAP",0.0);
-    auto re237e277_endcap = Monitored::Scalar<Float_t>("Re237e277_endcapinENDCAP",0.0);
+    auto f0_endcap = Monitored::Scalar<Float_t>("F0inENDCAP",0.0);
+    auto f1_endcap = Monitored::Scalar<Float_t>("F1inENDCAP",0.0);
+    auto f2_endcap = Monitored::Scalar<Float_t>("F2inENDCAP",0.0);
+    auto f3_endcap = Monitored::Scalar<Float_t>("F3inENDCAP",0.0);
+    auto re233e237_endcap = Monitored::Scalar<Float_t>("Re233e237inENDCAP",0.0);
+    auto re237e277_endcap = Monitored::Scalar<Float_t>("Re237e277inENDCAP",0.0);
     auto nofblayerhits_endcap = Monitored::Scalar<u_int8_t>("NOfBLayerHitsinENDCAP",0);
     auto nofpixelhits_endcap = Monitored::Scalar<u_int8_t>("NOfPixelHitsinENDCAP",0);
     auto nofscthits_endcap = Monitored::Scalar<u_int8_t>("NOfSCTHitsinENDCAP",0);
@@ -123,7 +124,7 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c
     auto f1_crack = Monitored::Scalar<Float_t>("F1inCRACK",0.0);
     auto f2_crack = Monitored::Scalar<Float_t>("F2inCRACK",0.0);
     auto f3_crack = Monitored::Scalar<Float_t>("F3inCRACK",0.0);
-    auto re233e237_crack = Monitored::Scalar<Float_t>("Re233e337inCRACK",0.0);
+    auto re233e237_crack = Monitored::Scalar<Float_t>("Re233e237inCRACK",0.0);
     auto re237e277_crack = Monitored::Scalar<Float_t>("Re237e277inCRACK",0.0);
     auto nofblayerhits_crack = Monitored::Scalar<u_int8_t>("NOfBLayerHitsinCRACK",0);
     auto nofpixelhits_crack = Monitored::Scalar<u_int8_t>("NOfPixelHitsinCRACK",0);
@@ -134,20 +135,57 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c
     auto deltaphi2_crack = Monitored::Scalar<Float_t>("DeltaPhi2inCRACK",0.0);
     auto trackd0_crack = Monitored::Scalar<Float_t>("Trackd0inCRACK",0.0);
 
+
+    auto is_pt_gt_4gev_barrel = Monitored::Scalar<bool>("is_pt_gt_4gevBARREL",false);    
+    auto is_pt_gt_4gev_endcap = Monitored::Scalar<bool>("is_pt_gt_4gevENDCAP",false);
+    auto is_pt_gt_4gev_crack = Monitored::Scalar<bool>("is_pt_gt_4gevCRACK",false);
+
+    auto is_pt_gt_2_5gev_barrel = Monitored::Scalar<bool>("is_pt_gt_2_5gevBARREL",false);    
+    auto is_pt_gt_2_5gev_endcap = Monitored::Scalar<bool>("is_pt_gt_2_5gevENDCAP",false);
+    auto is_pt_gt_2_5gev_crack = Monitored::Scalar<bool>("is_pt_gt_2_5gevCRACK",false);
+
+    auto is_pt_gt_20gev_barrel = Monitored::Scalar<bool>("is_pt_gt_20gevBARREL",false);    
+    auto is_pt_gt_20gev_endcap = Monitored::Scalar<bool>("is_pt_gt_20gevENDCAP",false);
+    auto is_pt_gt_20gev_crack = Monitored::Scalar<bool>("is_pt_gt_20gevCRACK",false);
+
     // Set the values of the monitored variables for the event
 
     u_int16_t mylb = GetEventInfo(ctx)->lumiBlock();
     lbNCandidates = mylb;
 
     u_int16_t mynp = 0;
+    u_int16_t mynp_barrel = 0;
+    u_int16_t mynp_crack = 0;
+    u_int16_t mynp_endcap = 0;
+
     for (const auto *const e_iter : *electrons) {
-      // Check that the electron meets our requirements
+ 
+    // Check that the electron meets our requirements
       bool isGood;
       if (! e_iter->passSelection(isGood,m_RecoName)) {
         ATH_MSG_WARNING("Misconfiguration: " << m_RecoName << " is not a valid working point for electrons");
         break; // no point in continuing
       }
-      if(isGood) {mynp++;}
+      if(isGood) {
+	mynp++;
+	Float_t myetaloc = e_iter->eta();
+	auto regionloc = GetRegion(myetaloc);
+        ATH_MSG_DEBUG("Test electron in region : " << regionloc);
+	switch(regionloc){
+        case BARREL :
+	  mynp_barrel++;
+	  break;
+        case CRACK :
+	  mynp_crack++;
+	  break;
+	case ENDCAP : 
+	  mynp_endcap++;
+	  break;
+	default :
+	  ATH_MSG_DEBUG("Found an electron out the acceptance region : " << regionloc);
+	  break;
+	}
+      }
       else continue;
 
       // do specific stuff with electrons
@@ -156,9 +194,25 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c
       Float_t myeta = e_iter->eta();
       Float_t myphi = e_iter->phi();
 
-      is_pt_gt_2_5gev = myet > 2500. ;
-      is_pt_gt_4gev = myet > 4000. ;
-      is_pt_gt_20gev = myet > 20000. ;
+      bool myis_pt_gt_2_5gev = myet > 2500. ;
+      bool myis_pt_gt_4gev = myet > 4000. ;
+      bool myis_pt_gt_20gev = myet > 20000. ;
+
+      is_pt_gt_2_5gev = myis_pt_gt_2_5gev ;
+      is_pt_gt_4gev = myis_pt_gt_4gev ;
+      is_pt_gt_20gev = myis_pt_gt_20gev ;
+
+      is_pt_gt_4gev_barrel = myis_pt_gt_4gev ;
+      is_pt_gt_4gev_endcap = myis_pt_gt_4gev ;
+      is_pt_gt_4gev_crack = myis_pt_gt_4gev ;
+
+      is_pt_gt_2_5gev_barrel = myis_pt_gt_2_5gev ;
+      is_pt_gt_2_5gev_endcap = myis_pt_gt_2_5gev ;
+      is_pt_gt_2_5gev_crack = myis_pt_gt_2_5gev ;
+
+      is_pt_gt_20gev_barrel = myis_pt_gt_20gev ;
+      is_pt_gt_20gev_endcap = myis_pt_gt_20gev ;
+      is_pt_gt_20gev_crack = myis_pt_gt_20gev ;
 
       // Isolation Energy
       Float_t mytopoetcone40 = -999.;
@@ -247,51 +301,54 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c
 
       // Fill per region histograms
       auto region = GetRegion(myeta);
+
+      //ATH_MSG_INFO("Test electron in region : " << region);
+
       switch(region){
-        case BARREL :
-          nofblayerhits_barrel = mynofblayerhits; nofpixelhits_barrel = mynofpixelhits ; nofscthits_barrel = mynofscthits ;
-          noftrthits_barrel = mynoftrthits ; noftrthighthresholdhits_barrel = mynoftrthighthresholdhits;
-          fill("MonitorElectron",nofblayerhits_barrel, nofpixelhits_barrel,noftrthits_barrel,noftrthighthresholdhits_barrel,is_pt_gt_4gev);
-          deltaeta1_barrel = mydeltaeta1; deltaphi2_barrel = mydeltaphi2; trackd0_barrel = mytrackd0;
-          eoverp_barrel = myeoverp;
-          fill("MonitorElectron",deltaeta1_barrel, deltaphi2_barrel,trackd0_barrel,eoverp_barrel,is_pt_gt_4gev);
-          np_barrel = mynp; et_barrel = myet ; eta_barrel = myeta ; phi_barrel = myphi ;
-          fill("MonitorElectron",np_barrel,et_barrel,eta_barrel,phi_barrel,is_pt_gt_4gev);
-          time_barrel = mytime; ehad1_barrel = myehad1; coreem_barrel = myecore;
-          fill("MonitorElectron",time_barrel, ehad1_barrel,coreem_barrel,is_pt_gt_4gev);
-          f0_barrel = myf0; f1_barrel = myf1; f2_barrel = myf2; f3_barrel = myf3; re233e237_barrel = myre233e237; re237e277_barrel = myre237e277;
-          fill("MonitorElectron",f0_barrel,f1_barrel,f2_barrel, f3_barrel,re233e237_barrel,re237e277_barrel,is_pt_gt_4gev);
-          break;
-        case ENDCAP :
-          nofblayerhits_endcap = mynofblayerhits; nofpixelhits_endcap = mynofpixelhits ; nofscthits_endcap = mynofscthits ;
-          noftrthits_endcap = mynoftrthits ; noftrthighthresholdhits_endcap = mynoftrthighthresholdhits;
-          fill("MonitorElectron",nofblayerhits_endcap, nofpixelhits_endcap,noftrthits_endcap,noftrthighthresholdhits_endcap,is_pt_gt_4gev);
-          deltaeta1_endcap = mydeltaeta1; deltaphi2_endcap = mydeltaphi2; trackd0_endcap = mytrackd0;
-          eoverp_endcap = myeoverp;
-          fill("MonitorElectron",deltaeta1_endcap, deltaphi2_endcap,trackd0_endcap,eoverp_endcap,is_pt_gt_4gev);
-          np_endcap = mynp ; et_endcap = myet ; eta_endcap = myeta ; phi_endcap = myphi ;
-          fill("MonitorElectron",np_endcap,et_endcap,eta_endcap,phi_endcap,is_pt_gt_4gev);
-          time_endcap = mytime; ehad1_endcap = myehad1; coreem_endcap = myecore;
-          fill("MonitorElectron",time_endcap, ehad1_endcap,coreem_endcap,is_pt_gt_4gev);
-          f0_endcap = myf0; f1_endcap = myf1; f2_endcap = myf2; f3_endcap = myf3; re233e237_endcap = myre233e237; re237e277_endcap = myre237e277;
-          fill("MonitorElectron",f0_endcap,f1_endcap,f2_endcap,f3_endcap,re233e237_endcap,re237e277_endcap,is_pt_gt_4gev);
-          break;
-        case CRACK :
-          nofblayerhits_crack = mynofblayerhits; nofpixelhits_crack = mynofpixelhits ; nofscthits_crack = mynofscthits ;
-          noftrthits_crack = mynoftrthits ; noftrthighthresholdhits_crack = mynoftrthighthresholdhits;
-          fill("MonitorElectron",nofblayerhits_crack, nofpixelhits_crack,noftrthits_crack,noftrthighthresholdhits_crack,is_pt_gt_4gev);
-          deltaeta1_crack = mydeltaeta1; deltaphi2_crack = mydeltaphi2; trackd0_crack = mytrackd0;
-          eoverp_barrel = myeoverp;
-          fill("MonitorElectron",deltaeta1_crack, deltaphi2_crack,trackd0_crack,eoverp_crack,is_pt_gt_4gev);
-          np_crack = mynp ; et_crack = myet ; eta_crack = myeta ; phi_crack = myphi ;
-          fill("MonitorElectron",np_crack,et_crack,eta_crack,phi_crack,is_pt_gt_4gev);
-          time_crack = mytime; ehad1_crack = myehad1; coreem_crack = myecore;
-          fill("MonitorElectron",time_crack, ehad1_crack,coreem_crack,is_pt_gt_4gev);
-          f0_crack = myf0; f1_crack = myf1; f2_crack = myf2; f3_crack = myf3; re233e237_crack = myre233e237; re237e277_crack = myre237e277;
-          fill("MonitorElectron",f0_crack,f1_crack,f2_crack,f3_crack,re233e237_crack,re237e277_crack,is_pt_gt_4gev);
-          break;
+
+      case BARREL :
+	nofblayerhits_barrel = mynofblayerhits ; nofpixelhits_barrel = mynofpixelhits ; nofscthits_barrel = mynofscthits ;
+	noftrthits_barrel = mynoftrthits ; noftrthighthresholdhits_barrel = mynoftrthighthresholdhits;
+	deltaeta1_barrel = mydeltaeta1; deltaphi2_barrel = mydeltaphi2; trackd0_barrel = mytrackd0;
+	eoverp_barrel = myeoverp;
+	et_barrel = myet ; eta_barrel = myeta ; phi_barrel = myphi ;
+	time_barrel = mytime; ehad1_barrel = myehad1; coreem_barrel = myecore;
+	f0_barrel = myf0; f1_barrel = myf1; f2_barrel = myf2; f3_barrel = myf3; re233e237_barrel = myre233e237; re237e277_barrel = myre237e277;
+	fill("MonitorElectron",np_barrel, nofblayerhits_barrel, nofpixelhits_barrel, nofscthits_barrel, noftrthits_barrel, noftrthighthresholdhits_barrel, 
+	     deltaeta1_barrel, deltaphi2_barrel,trackd0_barrel,eoverp_barrel,
+	     et_barrel,eta_barrel,phi_barrel, time_barrel, ehad1_barrel,coreem_barrel, f0_barrel,f1_barrel,f2_barrel, f3_barrel,
+	     re233e237_barrel,re237e277_barrel,is_pt_gt_4gev_barrel,is_pt_gt_2_5gev_barrel,is_pt_gt_20gev_barrel);
+	break;
+
+      case ENDCAP :
+	nofblayerhits_endcap = mynofblayerhits; nofpixelhits_endcap = mynofpixelhits ; nofscthits_endcap = mynofscthits ;
+	noftrthits_endcap = mynoftrthits ; noftrthighthresholdhits_endcap = mynoftrthighthresholdhits;
+	deltaeta1_endcap = mydeltaeta1; deltaphi2_endcap = mydeltaphi2; trackd0_endcap = mytrackd0;
+	eoverp_endcap = myeoverp;
+	et_endcap = myet ; eta_endcap = myeta ; phi_endcap = myphi ;
+	time_endcap = mytime; ehad1_endcap = myehad1; coreem_endcap = myecore;
+	f0_endcap = myf0; f1_endcap = myf1; f2_endcap = myf2; f3_endcap = myf3; re233e237_endcap = myre233e237; re237e277_endcap = myre237e277;
+	fill("MonitorElectron",np_endcap,nofblayerhits_endcap,nofpixelhits_endcap,nofscthits_endcap,noftrthits_endcap,noftrthighthresholdhits_endcap,
+	     deltaeta1_endcap, deltaphi2_endcap,trackd0_endcap,eoverp_endcap,et_endcap,eta_endcap,phi_endcap,
+	     time_endcap, ehad1_endcap,coreem_endcap,
+	     f0_endcap,f1_endcap,f2_endcap,f3_endcap,re233e237_endcap,re237e277_endcap,is_pt_gt_4gev_endcap,is_pt_gt_2_5gev_endcap,is_pt_gt_20gev_endcap);
+	break;
+
+      case CRACK :
+	nofblayerhits_crack = mynofblayerhits; nofpixelhits_crack = mynofpixelhits ; nofscthits_crack = mynofscthits ;
+	noftrthits_crack = mynoftrthits ; noftrthighthresholdhits_crack = mynoftrthighthresholdhits;
+	deltaeta1_crack = mydeltaeta1; deltaphi2_crack = mydeltaphi2; trackd0_crack = mytrackd0;
+	eoverp_crack = myeoverp;
+	et_crack = myet ; eta_crack = myeta ; phi_crack = myphi ;
+	time_crack = mytime; ehad1_crack = myehad1; coreem_crack = myecore;
+	f0_crack = myf0; f1_crack = myf1; f2_crack = myf2; f3_crack = myf3; re233e237_crack = myre233e237; re237e277_crack = myre237e277;
+	fill("MonitorElectron",np_crack,nofblayerhits_crack, nofpixelhits_crack,nofscthits_crack,noftrthits_crack,noftrthighthresholdhits_crack,
+	     deltaeta1_crack, deltaphi2_crack,trackd0_crack,eoverp_crack,et_crack,eta_crack,phi_crack,
+	     time_crack, ehad1_crack,coreem_crack,f0_crack,f1_crack,f2_crack,f3_crack,re233e237_crack,re237e277_crack,is_pt_gt_4gev_crack,is_pt_gt_2_5gev_crack,is_pt_gt_20gev_crack);
+	break;
+
         default :
-          //ATH_MSG_WARNING("found an electron outside the |eta| > 2.47 acceptance");
+          ATH_MSG_DEBUG("found an electron outside the |eta| > 2.47 acceptance");
           break;
       }
 
@@ -303,7 +360,11 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c
     }
 
     np = mynp;
-    fill("MonitorElectron",np);
+    np_barrel = mynp_barrel;
+    np_endcap = mynp_endcap;
+    np_crack = mynp_crack;
+
+    fill("MonitorElectron",np,np_barrel,np_endcap,np_crack);
 
     return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorFwdElectronAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorFwdElectronAlgorithm.cxx
index d7ec5de5b52d..5e472a6a50cc 100644
--- a/Reconstruction/egamma/egammaPerformance/src/MonitorFwdElectronAlgorithm.cxx
+++ b/Reconstruction/egamma/egammaPerformance/src/MonitorFwdElectronAlgorithm.cxx
@@ -49,11 +49,14 @@ StatusCode MonitorFwdElectronAlgorithm::fillHistograms( const EventContext& ctx
 
     // Particle variables to be monitored
     auto np = Monitored::Scalar<int>("N",0.0);
+    auto np_endcap = Monitored::Scalar<int>("NinENDCAP",0.0);
+    auto np_forward = Monitored::Scalar<int>("NinFORWARD",0.0);
     auto et = Monitored::Scalar<Float_t>("Et",0.0);
     auto eta = Monitored::Scalar<Float_t>("Eta",0.0);
     auto phi = Monitored::Scalar<Float_t>("Phi",0.0);
     auto is_pt_gt_2_5gev = Monitored::Scalar<bool>("is_pt_gt_2_5gev",false);
     auto is_pt_gt_10gev = Monitored::Scalar<bool>("is_pt_gt_10gev",false);
+
     auto time = Monitored::Scalar<Float_t>("Time",0.0);
 
     auto firstENGdens = Monitored::Scalar<Float_t>("EnergyDensity",0.0);
@@ -70,18 +73,20 @@ StatusCode MonitorFwdElectronAlgorithm::fillHistograms( const EventContext& ctx
     // variables per Region
 
     // ENDCAP
-    auto np_endcap = Monitored::Scalar<int>("NinENDCAP",0.0);
     auto et_endcap = Monitored::Scalar<Float_t>("EtinENDCAP",0.0);
     auto eta_endcap = Monitored::Scalar<Float_t>("EtainENDCAP",0.0);
     auto phi_endcap = Monitored::Scalar<Float_t>("PhiinENDCAP",0.0);
     auto time_endcap = Monitored::Scalar<Float_t>("TimeinENDCAP",0.0);
+    auto is_pt_gt_2_5gev_endcap = Monitored::Scalar<bool>("is_pt_gt_2_5gevENDCAP",false);
+    auto is_pt_gt_10gev_endcap = Monitored::Scalar<bool>("is_pt_gt_10gevENDCAP",false);
 
     // FORWARD
-    auto np_forward = Monitored::Scalar<int>("NinFORWARD",0.0);
     auto et_forward = Monitored::Scalar<Float_t>("EtinFORWARD",0.0);
     auto eta_forward = Monitored::Scalar<Float_t>("EtainFORWARD",0.0);
     auto phi_forward = Monitored::Scalar<Float_t>("PhiinFORWARD",0.0);
     auto time_forward = Monitored::Scalar<Float_t>("TimeinFORWARD",0.0);
+    auto is_pt_gt_2_5gev_forward = Monitored::Scalar<bool>("is_pt_gt_2_5gevFORWARD",false);
+    auto is_pt_gt_10gev_forward = Monitored::Scalar<bool>("is_pt_gt_10gevFORWARD",false);
 
     // Set the values of the monitored variables for the event
 
@@ -109,8 +114,12 @@ StatusCode MonitorFwdElectronAlgorithm::fillHistograms( const EventContext& ctx
       Float_t myeta = e_iter->eta();
       Float_t myphi = e_iter->phi();
 
-      is_pt_gt_2_5gev = myet > 2500. ;
-      is_pt_gt_10gev = myet > 10000. ;
+      bool myis_pt_gt_2_5gev = myet > 2500. ;
+      bool myis_pt_gt_10gev = myet > 10000. ;
+
+      is_pt_gt_2_5gev = myis_pt_gt_2_5gev ;
+      is_pt_gt_10gev = myis_pt_gt_10gev ;
+
 
       // Associated cluster details
       // Shower shape variable details
@@ -153,14 +162,13 @@ StatusCode MonitorFwdElectronAlgorithm::fillHistograms( const EventContext& ctx
           mynp_endcap++;
           et_endcap = myet ; eta_endcap = myeta ;
           phi_endcap = myphi ; time_endcap = mytime;
-          fill("MonitorFwdElectron",et_endcap,eta_endcap,phi_endcap,time_endcap,is_pt_gt_10gev);
+          fill("MonitorFwdElectron",et_endcap,eta_endcap,phi_endcap,time_endcap,is_pt_gt_2_5gev_endcap,is_pt_gt_10gev_endcap);
           break;
         case FORWARD :
-          mynp_forward++;
           mynp_forward++;
           et_forward = myet ; eta_forward = myeta ;
           phi_forward = myphi ; time_forward = mytime;
-          fill("MonitorFwdElectron",et_forward,eta_forward,phi_forward,time_forward,is_pt_gt_10gev);
+          fill("MonitorFwdElectron",et_forward,eta_forward,phi_forward,time_forward,is_pt_gt_2_5gev_forward,is_pt_gt_10gev_forward);
           break;
         default :
           //ATH_MSG_WARNING("found an electron outside the |eta| > 2.47 acceptance");
@@ -179,7 +187,7 @@ StatusCode MonitorFwdElectronAlgorithm::fillHistograms( const EventContext& ctx
     }
 
     np = mynp; np_endcap = mynp_endcap ; np_forward = mynp_forward ;
-    fill("MonitorFwdElectron",np,np_endcap,np_forward,is_pt_gt_10gev);
+    fill("MonitorFwdElectron",np,np_endcap);
 
     return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx
index 75719765524e..0fe4378f41a1 100755
--- a/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx
+++ b/Reconstruction/egamma/egammaPerformance/src/MonitorPhotonAlgorithm.cxx
@@ -56,8 +56,20 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
     auto eta = Monitored::Scalar<Float_t>("Eta",0.0);
     auto phi = Monitored::Scalar<Float_t>("Phi",0.0);
     auto is_pt_gt_2_5gev = Monitored::Scalar<bool>("is_pt_gt_2_5gev",false);
+    auto is_pt_gt_2_5gev_barrel = Monitored::Scalar<bool>("is_pt_gt_2_5gevBARREL",false);
+    auto is_pt_gt_2_5gev_endcap = Monitored::Scalar<bool>("is_pt_gt_2_5gevENDCAP",false);
+    auto is_pt_gt_2_5gev_crack = Monitored::Scalar<bool>("is_pt_gt_2_5gevCRACK",false);
+
     auto is_pt_gt_4gev = Monitored::Scalar<bool>("is_pt_gt_4gev",false);
+    auto is_pt_gt_4gev_barrel = Monitored::Scalar<bool>("is_pt_gt_4gevBARREL",false);
+    auto is_pt_gt_4gev_endcap = Monitored::Scalar<bool>("is_pt_gt_4gevENDCAP",false);
+    auto is_pt_gt_4gev_crack = Monitored::Scalar<bool>("is_pt_gt_4gevCRACK",false);
+
     auto is_pt_gt_20gev = Monitored::Scalar<bool>("is_pt_gt_20gev",false);
+    auto is_pt_gt_20gev_crack = Monitored::Scalar<bool>("is_pt_gt_20gevCRACK",false);
+    auto is_pt_gt_20gev_barrel = Monitored::Scalar<bool>("is_pt_gt_20gevBARREL",false);
+    auto is_pt_gt_20gev_endcap = Monitored::Scalar<bool>("is_pt_gt_20gevENDCAP",false);
+
     auto time = Monitored::Scalar<Float_t>("Time",0.0);
     auto topoetcone40 = Monitored::Scalar<Float_t>("TopoEtCone40",0.0);
     auto ptcone20 = Monitored::Scalar<Float_t>("PtCone20",0.0);
@@ -65,7 +77,6 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
     // Particle variables per Region
 
     // BARREL
-    auto np_barrel = Monitored::Scalar<int>("NinBARREL",0.0);
     auto et_barrel = Monitored::Scalar<Float_t>("EtinBARREL",0.0);
     auto eta_barrel = Monitored::Scalar<Float_t>("EtainBARREL",0.0);
     auto phi_barrel = Monitored::Scalar<Float_t>("PhiinBARREL",0.0);
@@ -77,11 +88,10 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
     auto f1_barrel = Monitored::Scalar<Float_t>("F1inBARREL",0.0);
     auto f2_barrel = Monitored::Scalar<Float_t>("F2inBARREL",0.0);
     auto f3_barrel = Monitored::Scalar<Float_t>("F3inBARREL",0.0);
-    auto re233e237_barrel = Monitored::Scalar<Float_t>("Re233e337inBARREL",0.0);
+    auto re233e237_barrel = Monitored::Scalar<Float_t>("Re233e237inBARREL",0.0);
     auto re237e277_barrel = Monitored::Scalar<Float_t>("Re237e277inBARREL",0.0);
 
     // ENDCAP
-    auto np_endcap = Monitored::Scalar<int>("NinENDCAP",0.0);
     auto et_endcap = Monitored::Scalar<Float_t>("EtinENDCAP",0.0);
     auto eta_endcap = Monitored::Scalar<Float_t>("EtainENDCAP",0.0);
     auto phi_endcap = Monitored::Scalar<Float_t>("PhiinENDCAP",0.0);
@@ -93,7 +103,7 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
     auto f1_endcap = Monitored::Scalar<Float_t>("F1inENDCAP",0.0);
     auto f2_endcap = Monitored::Scalar<Float_t>("F2inENDCAP",0.0);
     auto f3_endcap = Monitored::Scalar<Float_t>("F3inENDCAP",0.0);
-    auto re233e237_endcap = Monitored::Scalar<Float_t>("Re233e337inENDCAP",0.0);
+    auto re233e237_endcap = Monitored::Scalar<Float_t>("Re233e237inENDCAP",0.0);
     auto re237e277_endcap = Monitored::Scalar<Float_t>("Re237e277inENDCAP",0.0);
 
     // CRACK
@@ -109,11 +119,21 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
     auto f1_crack = Monitored::Scalar<Float_t>("F1inCRACK",0.0);
     auto f2_crack = Monitored::Scalar<Float_t>("F2inCRACK",0.0);
     auto f3_crack = Monitored::Scalar<Float_t>("F3inCRACK",0.0);
-    auto re233e237_crack = Monitored::Scalar<Float_t>("Re233e337inCRACK",0.0);
+    auto re233e237_crack = Monitored::Scalar<Float_t>("Re233e237inCRACK",0.0);
     auto re237e277_crack = Monitored::Scalar<Float_t>("Re237e277inCRACK",0.0);
 
     // Specific Photon variables
 
+    auto npconv = Monitored::Scalar<int>("NConv",0.0);
+    auto etconv = Monitored::Scalar<Float_t>("EtConv",0.0);
+    auto etaconv = Monitored::Scalar<Float_t>("EtaConv",0.0);
+    auto phiconv = Monitored::Scalar<Float_t>("PhiConv",0.0);
+
+    auto npunconv = Monitored::Scalar<int>("NUnconv",0.0);
+    auto etunconv = Monitored::Scalar<Float_t>("EtUnconv",0.0);
+    auto etaunconv = Monitored::Scalar<Float_t>("EtaUnconv",0.0);
+    auto phiunconv = Monitored::Scalar<Float_t>("PhiUnconv",0.0);
+
     auto lb = Monitored::Scalar<u_int16_t>("LB",0);
 
     auto is_pt_gt_2_5gevandconv = Monitored::Scalar<bool>("is_pt_gt_2_5gevandconv",false);
@@ -134,24 +154,31 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
 
     auto rconv_barrel = Monitored::Scalar<Float_t>("RConvinBARREL",0.0);
     auto convtype_barrel = Monitored::Scalar<xAOD::EgammaParameters::ConversionType>("ConvTypeinBARREL",nullptr);
-    auto contrkmatch1_barrel = Monitored::Scalar<u_int8_t>("ConvTrkmatch1inBARREL",0);
-    auto contrkmatch2_barrel = Monitored::Scalar<u_int8_t>("ConvTrkmatch2inBARREL",0);
+    auto contrkmatch1_barrel = Monitored::Scalar<u_int8_t>("ConvTrkMatch1inBARREL",0);
+    auto contrkmatch2_barrel = Monitored::Scalar<u_int8_t>("ConvTrkMatch2inBARREL",0);
 
     // ENDCAP
     auto rconv_endcap = Monitored::Scalar<Float_t>("RConvinENDCAP",0.0);
     auto convtype_endcap = Monitored::Scalar<xAOD::EgammaParameters::ConversionType>("ConvTypeinENDCAP",nullptr);
-    auto contrkmatch1_endcap = Monitored::Scalar<u_int8_t>("ConvTrkmatch1inENDCAP",0);
-    auto contrkmatch2_endcap = Monitored::Scalar<u_int8_t>("ConvTrkmatch2inENDCAP",0);
+    auto contrkmatch1_endcap = Monitored::Scalar<u_int8_t>("ConvTrkMatch1inENDCAP",0);
+    auto contrkmatch2_endcap = Monitored::Scalar<u_int8_t>("ConvTrkMatch2inENDCAP",0);
 
     // CRACK
     auto rconv_crack = Monitored::Scalar<Float_t>("RConvinCRACK",0.0);
     auto convtype_crack = Monitored::Scalar<xAOD::EgammaParameters::ConversionType>("ConvTypeinCRACK",nullptr);
-    auto contrkmatch1_crack = Monitored::Scalar<u_int8_t>("ConvTrkmatch1inCRACK",0);
-    auto contrkmatch2_crack = Monitored::Scalar<u_int8_t>("ConvTrkmatch2inCRACK",0);
+    auto contrkmatch1_crack = Monitored::Scalar<u_int8_t>("ConvTrkMatch1inCRACK",0);
+    auto contrkmatch2_crack = Monitored::Scalar<u_int8_t>("ConvTrkMatch2inCRACK",0);
 
     // Set the values of the monitored variables for the event
 
     u_int16_t mynp=0;
+    u_int16_t mynpconv = 0;
+    u_int16_t mynpunconv = 0;
+
+    Float_t myet = 0.;
+    Float_t myeta = 0.;
+    Float_t myphi = 0.;
+
     for (const auto *const p_iter : *photons) {
       // Check that the electron meets our requirements
       bool isGood;
@@ -159,12 +186,30 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
         ATH_MSG_WARNING("Misconfiguration: " << m_RecoName << " is not a valid working point for photons");
         break; // no point in continuing
       }
-      if(isGood) {mynp++;}
+
+      if(isGood) {
+	mynp++;
+	Float_t myetaloc = p_iter->eta();
+	auto regionloc = GetRegion(myetaloc);
+        ATH_MSG_DEBUG("Test photon in region : " << regionloc);
+	
+	switch(regionloc){
+        case BARREL :
+	  break;
+        case CRACK :
+	  break;
+	case ENDCAP : 
+	  break;
+	default :
+	  ATH_MSG_DEBUG("Found a photon out the acceptance region : " << regionloc);
+	  break;
+	}
+      }
       else continue;
 
-      Float_t myet = p_iter->pt(); // in MeV (/Gaudi::Units::GeV; // in GeV)
-      Float_t myeta = p_iter->eta();
-      Float_t myphi = p_iter->phi();
+      myet = p_iter->pt(); // in MeV (/Gaudi::Units::GeV; // in GeV)
+      myeta = p_iter->eta();
+      myphi = p_iter->phi();
       et = myet ; eta = myeta ; phi = myphi ;
 
       bool myis_pt_gt_2_5gev = myet > 2500. ;
@@ -175,6 +220,18 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
       is_pt_gt_4gev = myis_pt_gt_4gev ;
       is_pt_gt_20gev = myis_pt_gt_20gev ;
 
+      is_pt_gt_4gev_barrel = myis_pt_gt_4gev ;
+      is_pt_gt_4gev_endcap = myis_pt_gt_4gev ;
+      is_pt_gt_4gev_crack = myis_pt_gt_4gev ;
+
+      is_pt_gt_2_5gev_barrel = myis_pt_gt_2_5gev ;
+      is_pt_gt_2_5gev_endcap = myis_pt_gt_2_5gev ;
+      is_pt_gt_2_5gev_crack = myis_pt_gt_2_5gev ;
+
+      is_pt_gt_20gev_barrel = myis_pt_gt_20gev ;
+      is_pt_gt_20gev_endcap = myis_pt_gt_20gev ;
+      is_pt_gt_20gev_crack = myis_pt_gt_20gev ;
+
       // Isolation Energy
       Float_t mytopoetcone40 = -999.;
       p_iter->isolationValue(mytopoetcone40,xAOD::Iso::topoetcone40);
@@ -229,6 +286,25 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
       xAOD::EgammaParameters::ConversionType myconvtype = xAOD::EgammaHelpers::conversionType(p_iter);
       bool isUnconverted = (myconvtype==xAOD::EgammaParameters::ConversionType::unconverted) ;
 
+      if (isUnconverted) {
+	npunconv++;
+	etconv = -1.;
+	etaconv = -6.;
+	phiconv = -6.;
+	etunconv = myet;
+        etaunconv = myeta;
+	phiunconv = myphi;
+      }
+      else {
+	npconv++;
+	etunconv = -1.;
+	etaunconv = -6.;
+	phiunconv = -6.;
+        etconv = myet;
+	etaconv = myeta;
+	phiconv = myphi;
+      } 
+
       is_pt_gt_2_5gevandconv = myis_pt_gt_2_5gev && !isUnconverted ;
       is_pt_gt_2_5gevandunconv = myis_pt_gt_2_5gev && isUnconverted ;
 
@@ -242,11 +318,6 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
       lbevonphotonsconv = mylb;
       lbevonphotonsunconv = mylb;
 
-      fill("MonitorPhoton",lbevonphotonsconv,lbevonphotonsunconv,
-          is_pt_gt_4gevandconv,is_pt_gt_4gevandunconv,
-          is_pt_gt_2_5gevandconv,is_pt_gt_2_5gevandunconv,
-          is_pt_gt_20gevandconv, is_pt_gt_20gevandunconv);
-
       Float_t myrconv = 0.0;
       myrconv = xAOD::EgammaHelpers::conversionRadius(p_iter);
 
@@ -260,59 +331,58 @@ StatusCode MonitorPhotonAlgorithm::fillHistograms( const EventContext& ctx ) con
       switch(region){
         case BARREL :
           et_barrel = myet ; eta_barrel = myeta ; phi_barrel = myphi ;
-          fill("MonitorPhoton",np_barrel,et_barrel,eta_barrel,phi_barrel,is_pt_gt_4gev);
           time_barrel = mytime; ehad1_barrel = myehad1; coreem_barrel = myecore;
-          fill("MonitorPhoton",time_barrel, ehad1_barrel,coreem_barrel,is_pt_gt_4gev);
           f0_barrel = myf0; f1_barrel = myf1; f2_barrel = myf2; f3_barrel = myf3; re233e237_barrel = myre233e237; re237e277_barrel = myre237e277;
-          fill("MonitorPhoton",f0_barrel,f1_barrel,f2_barrel, f3_barrel,re233e237_barrel,re237e277_barrel,is_pt_gt_4gev);
           rconv_barrel = myrconv ; convtype_barrel = myconvtype ; contrkmatch1_barrel = mycontrkmatch1 ; contrkmatch2_barrel = mycontrkmatch2 ;
-          fill("MonitorPhoton",rconv_barrel,convtype_barrel,contrkmatch1_barrel,contrkmatch2_barrel,is_pt_gt_4gev);
+          fill("MonitorPhoton", et_barrel,eta_barrel,phi_barrel, time_barrel, ehad1_barrel,coreem_barrel,
+	       f0_barrel,f1_barrel,f2_barrel, f3_barrel,re233e237_barrel,re237e277_barrel,
+	       rconv_barrel,convtype_barrel,contrkmatch1_barrel,contrkmatch2_barrel,is_pt_gt_4gev_barrel,is_pt_gt_2_5gev_barrel,is_pt_gt_20gev_barrel);
           break;
 
         case ENDCAP :
           et_endcap = myet ; eta_endcap = myeta ; phi_endcap = myphi ;
-          fill("MonitorPhoton",np_endcap,et_endcap,eta_endcap,phi_endcap,is_pt_gt_4gev);
           time_endcap = mytime; ehad1_endcap = myehad1; coreem_endcap = myecore;
-          fill("MonitorPhoton",time_endcap, ehad1_endcap,coreem_endcap,is_pt_gt_4gev);
           f0_endcap = myf0; f1_endcap = myf1; f2_endcap = myf2; f3_endcap = myf3; re233e237_endcap = myre233e237; re237e277_endcap = myre237e277;
-          fill("MonitorPhoton",f0_endcap,f1_endcap,f2_endcap,f3_endcap,re233e237_endcap,re237e277_endcap,is_pt_gt_4gev);
           rconv_endcap = myrconv ; convtype_endcap = myconvtype ; contrkmatch1_endcap = mycontrkmatch1 ; contrkmatch2_endcap = mycontrkmatch2 ;
-          fill("MonitorPhoton",rconv_endcap,convtype_endcap,contrkmatch1_endcap,contrkmatch2_endcap,is_pt_gt_4gev);
+          fill("MonitorPhoton",et_endcap,eta_endcap,phi_endcap,
+	       time_endcap, ehad1_endcap,coreem_endcap,
+	       f0_endcap,f1_endcap,f2_endcap,f3_endcap,re233e237_endcap,re237e277_endcap,
+	       rconv_endcap,convtype_endcap,contrkmatch1_endcap,contrkmatch2_endcap,is_pt_gt_4gev_endcap,is_pt_gt_2_5gev_endcap,is_pt_gt_20gev_endcap);
           break;
 
         case CRACK :
           et_crack = myet ; eta_crack = myeta ; phi_crack = myphi ;
-          fill("MonitorPhoton",np_crack,et_crack,eta_crack,phi_crack,is_pt_gt_4gev);
           time_crack = mytime; ehad1_crack = myehad1; coreem_crack = myecore;
-          fill("MonitorPhoton",time_crack, ehad1_crack,coreem_crack,is_pt_gt_4gev);
           f0_crack = myf0; f1_crack = myf1; f2_crack = myf2; f3_crack = myf3; re233e237_crack = myre233e237; re237e277_crack = myre237e277;
-          fill("MonitorPhoton",f0_crack,f1_crack,f2_crack,f3_crack,re233e237_crack,re237e277_crack,is_pt_gt_4gev);
           rconv_crack = myrconv ; convtype_crack = myconvtype ; contrkmatch1_crack = mycontrkmatch1 ; contrkmatch2_crack = mycontrkmatch2 ;
-          fill("MonitorPhoton",rconv_crack,convtype_crack,contrkmatch1_crack,contrkmatch2_crack,is_pt_gt_4gev);
+          fill("MonitorPhoton",et_crack,eta_crack,phi_crack,time_crack, ehad1_crack,coreem_crack,
+          f0_crack,f1_crack,f2_crack,f3_crack,re233e237_crack,re237e277_crack,
+	  rconv_crack,convtype_crack,contrkmatch1_crack,contrkmatch2_crack,is_pt_gt_4gev_crack,is_pt_gt_2_5gev_crack,is_pt_gt_20gev_crack);
           break;
 
         default :
-          ATH_MSG_DEBUG("found an electron outside the |eta| > 2.47 acceptance");
+          ATH_MSG_DEBUG("found an photon outside the |eta| > 2.47 acceptance");
           break;
       }
       // Fill. First argument is the tool name, all others are the variables to be histogramed
 
-
-      fill("MonitorPhoton",et,eta,phi,time,ptcone20,topoetcone40,is_pt_gt_4gev,is_pt_gt_20gev,
-        is_pt_gt_2_5gevandconv,is_pt_gt_2_5gevandunconv,
-        is_pt_gt_4gevandconv,is_pt_gt_4gevandunconv,
-        is_pt_gt_20gevandconv,is_pt_gt_20gevandunconv);
-
       lb = mylb; lbevonphotonsunconv = mylb ; lbevonphotonsconv = mylb; lbNCandidates = mylb;
-      fill("MonitorPhoton",lb, lbNCandidates,
-          is_pt_gt_2_5gev,is_pt_gt_2_5gevandconv,is_pt_gt_2_5gevandunconv,
-          is_pt_gt_4gev,is_pt_gt_4gevandconv,is_pt_gt_4gevandunconv,
-          is_pt_gt_20gev,is_pt_gt_20gevandconv,is_pt_gt_20gevandunconv);
-
+      fill("MonitorPhoton",
+	   lbevonphotonsconv,lbevonphotonsunconv,lb,lbNCandidates,
+	   et,eta,phi,time,ptcone20,topoetcone40,
+	   etconv,etaconv,phiconv,
+	   etunconv,etaunconv,phiunconv,
+	   is_pt_gt_4gev,is_pt_gt_20gev,is_pt_gt_2_5gev,
+	   is_pt_gt_2_5gevandconv,is_pt_gt_2_5gevandunconv,
+	   is_pt_gt_4gevandconv,is_pt_gt_4gevandunconv,
+	   is_pt_gt_20gevandconv,is_pt_gt_20gevandunconv);
     }
 
     np = mynp;
-    fill("MonitorPhoton",np);
+    npconv = mynpconv;
+    npunconv = mynpunconv;
+
+    fill("MonitorPhoton",np,npconv,npunconv);
 
     return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx
index b3c1c030be21..66d1222f6c08 100644
--- a/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx
+++ b/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx
@@ -128,8 +128,7 @@ StatusCode MonitorTnPAlgorithm::fillHistograms( const EventContext& ctx ) const
     break;
   }
 
-
-  ATH_MSG_DEBUG("Zee mass & cuts: (" << mass << ", " << m_MassLowerCut << ", " << m_MassUpperCut << ")");
+  ATH_MSG_DEBUG("ee mass & cuts: (" << mass << ", " << m_MassLowerCut << ", " << m_MassUpperCut << ")");
   if(mass<m_MassLowerCut || mass>m_MassUpperCut) return StatusCode::SUCCESS;
 
   // Register this good Tag & Probe candidate
@@ -210,73 +209,77 @@ StatusCode MonitorTnPAlgorithm::fillElectronProbe(const xAOD::Electron *el, cons
   // Particle variables per Region
 
   // BARREL
-  auto et_barrel = Monitored::Scalar<Float_t>("EtinBARREL",0.0);
-  auto eta_barrel = Monitored::Scalar<Float_t>("EtainBARREL",0.0);
-  auto phi_barrel = Monitored::Scalar<Float_t>("PhiinBARREL",0.0);
-  auto time_barrel = Monitored::Scalar<Float_t>("TimeinBARREL",0.0);
-  auto ehad1_barrel = Monitored::Scalar<Float_t>("Ehad1inBARREL",0.0);
-  auto eoverp_barrel = Monitored::Scalar<Float_t>("EoverPinBARREL",0.0);
-  auto coreem_barrel = Monitored::Scalar<Float_t>("CoreEMinBARREL",0.0);
-  auto f0_barrel = Monitored::Scalar<Float_t>("F0inBARREL",0.0);
-  auto f1_barrel = Monitored::Scalar<Float_t>("F1inBARREL",0.0);
-  auto f2_barrel = Monitored::Scalar<Float_t>("F2inBARREL",0.0);
-  auto f3_barrel = Monitored::Scalar<Float_t>("F3inBARREL",0.0);
-  auto re233e237_barrel = Monitored::Scalar<Float_t>("Re233e337inBARREL",0.0);
-  auto re237e277_barrel = Monitored::Scalar<Float_t>("Re237e277inBARREL",0.0);
-  auto nofblayerhits_barrel = Monitored::Scalar<u_int8_t>("NOfBLayerHitsinBARREL",0);
-  auto nofpixelhits_barrel = Monitored::Scalar<u_int8_t>("NOfPixelHitsinBARREL",0);
-  auto nofscthits_barrel = Monitored::Scalar<u_int8_t>("NOfSCTHitsinBARREL",0);
-  auto noftrthits_barrel = Monitored::Scalar<u_int8_t>("NOfTRTHitsinBARREL",0);
-  auto noftrthighthresholdhits_barrel = Monitored::Scalar<u_int8_t>("NOfTRTHighThresholdHitsinBARREL",0);
-  auto deltaeta1_barrel = Monitored::Scalar<Float_t>("DeltaEta1inBARREL",0.0);
-  auto deltaphi2_barrel = Monitored::Scalar<Float_t>("DeltaPhi2inBARREL",0.0);
-  auto trackd0_barrel = Monitored::Scalar<Float_t>("Trackd0inBARREL",0.0);
+
+  auto et_barrel = Monitored::Scalar<Float_t>("EtProbeinBARREL",0.0);
+  auto eta_barrel = Monitored::Scalar<Float_t>("EtaProbeinBARREL",0.0);
+  auto phi_barrel = Monitored::Scalar<Float_t>("PhiProbeinBARREL",0.0);
+  auto time_barrel = Monitored::Scalar<Float_t>("TimeProbeinBARREL",0.0);
+  auto ehad1_barrel = Monitored::Scalar<Float_t>("Ehad1ProbeinBARREL",0.0);
+  auto eoverp_barrel = Monitored::Scalar<Float_t>("EoverPProbeinBARREL",0.0);
+  auto coreem_barrel = Monitored::Scalar<Float_t>("CoreEMProbeinBARREL",0.0);
+  auto f0_barrel = Monitored::Scalar<Float_t>("F0ProbeinBARREL",0.0);
+  auto f1_barrel = Monitored::Scalar<Float_t>("F1ProbeinBARREL",0.0);
+  auto f2_barrel = Monitored::Scalar<Float_t>("F2ProbeinBARREL",0.0);
+  auto f3_barrel = Monitored::Scalar<Float_t>("F3ProbeinBARREL",0.0);
+  auto re233e237_barrel = Monitored::Scalar<Float_t>("Re233e237ProbeinBARREL",0.0);
+  auto re237e277_barrel = Monitored::Scalar<Float_t>("Re237e277ProbeinBARREL",0.0);
+  auto nofblayerhits_barrel = Monitored::Scalar<u_int8_t>("NOfBLayerHitsProbeinBARREL",0);
+  auto nofpixelhits_barrel = Monitored::Scalar<u_int8_t>("NOfPixelHitsProbeinBARREL",0);
+  auto nofscthits_barrel = Monitored::Scalar<u_int8_t>("NOfSCTHitsProbeinBARREL",0);
+  auto noftrthits_barrel = Monitored::Scalar<u_int8_t>("NOfTRTHitsProbeinBARREL",0);
+  auto noftrthighthresholdhits_barrel = Monitored::Scalar<u_int8_t>("NOfTRTHighThresholdHitsProbeinBARREL",0);
+  auto deltaeta1_barrel = Monitored::Scalar<Float_t>("DeltaEta1ProbeinBARREL",0.0);
+  auto deltaphi2_barrel = Monitored::Scalar<Float_t>("DeltaPhi2ProbeinBARREL",0.0);
+  auto trackd0_barrel = Monitored::Scalar<Float_t>("Trackd0ProbeinBARREL",0.0);
 
   // ENDCAP
-  auto et_endcap = Monitored::Scalar<Float_t>("EtinENDCAP",0.0);
-  auto eta_endcap = Monitored::Scalar<Float_t>("EtainENDCAP",0.0);
-  auto phi_endcap = Monitored::Scalar<Float_t>("PhiinENDCAP",0.0);
-  auto time_endcap = Monitored::Scalar<Float_t>("TimeinENDCAP",0.0);
-  auto ehad1_endcap = Monitored::Scalar<Float_t>("Ehad1inENDCAP",0.0);
-  auto eoverp_endcap = Monitored::Scalar<Float_t>("EoverPinENDCAP",0.0);
-  auto coreem_endcap = Monitored::Scalar<Float_t>("CoreEMinENDCAP",0.0);
-  auto f0_endcap = Monitored::Scalar<Float_t>("F0inENDCAP",0.0);
-  auto f1_endcap = Monitored::Scalar<Float_t>("F1inENDCAP",0.0);
-  auto f2_endcap = Monitored::Scalar<Float_t>("F2inENDCAP",0.0);
-  auto f3_endcap = Monitored::Scalar<Float_t>("F3inENDCAP",0.0);
-  auto re233e237_endcap = Monitored::Scalar<Float_t>("Re233e337inENDCAP",0.0);
-  auto re237e277_endcap = Monitored::Scalar<Float_t>("Re237e277inENDCAP",0.0);
-  auto nofblayerhits_endcap = Monitored::Scalar<u_int8_t>("NOfBLayerHitsinENDCAP",0);
-  auto nofpixelhits_endcap = Monitored::Scalar<u_int8_t>("NOfPixelHitsinENDCAP",0);
-  auto nofscthits_endcap = Monitored::Scalar<u_int8_t>("NOfSCTHitsinENDCAP",0);
-  auto noftrthits_endcap = Monitored::Scalar<u_int8_t>("NOfTRTHitsinENDCAP",0);
-  auto noftrthighthresholdhits_endcap = Monitored::Scalar<u_int8_t>("NOfTRTHighThresholdHitsinENDCAP",0);
-  auto deltaeta1_endcap = Monitored::Scalar<Float_t>("DeltaEta1_endcapinENDCAP",0.0);
-  auto deltaphi2_endcap = Monitored::Scalar<Float_t>("DeltaPhi2_endcapinENDCAP",0.0);
-  auto trackd0_endcap = Monitored::Scalar<Float_t>("Trackd0_endcapinENDCAP",0.0);
+
+  auto et_endcap = Monitored::Scalar<Float_t>("EtProbeinENDCAP",0.0);
+  auto eta_endcap = Monitored::Scalar<Float_t>("EtaProbeinENDCAP",0.0);
+  auto phi_endcap = Monitored::Scalar<Float_t>("PhiProbeinENDCAP",0.0);
+  auto time_endcap = Monitored::Scalar<Float_t>("TimeProbeinENDCAP",0.0);
+  auto ehad1_endcap = Monitored::Scalar<Float_t>("Ehad1ProbeinENDCAP",0.0);
+  auto eoverp_endcap = Monitored::Scalar<Float_t>("EoverPProbeinENDCAP",0.0);
+  auto coreem_endcap = Monitored::Scalar<Float_t>("CoreEMProbeinENDCAP",0.0);
+  auto f0_endcap = Monitored::Scalar<Float_t>("F0ProbeinENDCAP",0.0);
+  auto f1_endcap = Monitored::Scalar<Float_t>("F1ProbeinENDCAP",0.0);
+  auto f2_endcap = Monitored::Scalar<Float_t>("F2ProbeinENDCAP",0.0);
+  auto f3_endcap = Monitored::Scalar<Float_t>("F3ProbeinENDCAP",0.0);
+  auto re233e237_endcap = Monitored::Scalar<Float_t>("Re233e237ProbeinENDCAP",0.0);
+  auto re237e277_endcap = Monitored::Scalar<Float_t>("Re237e277ProbeinENDCAP",0.0);
+  auto nofblayerhits_endcap = Monitored::Scalar<u_int8_t>("NOfBLayerHitsProbeinENDCAP",0);
+  auto nofpixelhits_endcap = Monitored::Scalar<u_int8_t>("NOfPixelHitsProbeinENDCAP",0);
+  auto nofscthits_endcap = Monitored::Scalar<u_int8_t>("NOfSCTHitsProbeinENDCAP",0);
+  auto noftrthits_endcap = Monitored::Scalar<u_int8_t>("NOfTRTHitsProbeinENDCAP",0);
+  auto noftrthighthresholdhits_endcap = Monitored::Scalar<u_int8_t>("NOfTRTHighThresholdHitsProbeinENDCAP",0);
+  auto deltaeta1_endcap = Monitored::Scalar<Float_t>("DeltaEta1ProbeinENDCAP",0.0);
+  auto deltaphi2_endcap = Monitored::Scalar<Float_t>("DeltaPhi2ProbeinENDCAP",0.0);
+  auto trackd0_endcap = Monitored::Scalar<Float_t>("Trackd0ProbeinENDCAP",0.0);
 
   // CRACK
-  auto et_crack = Monitored::Scalar<Float_t>("EtinCRACK",0.0);
-  auto eta_crack = Monitored::Scalar<Float_t>("EtainCRACK",0.0);
-  auto phi_crack = Monitored::Scalar<Float_t>("PhiinCRACK",0.0);
-  auto time_crack = Monitored::Scalar<Float_t>("TimeinCRACK",0.0);
-  auto ehad1_crack = Monitored::Scalar<Float_t>("Ehad1inCRACK",0.0);
-  auto eoverp_crack = Monitored::Scalar<Float_t>("EoverPinCRACK",0.0);
-  auto coreem_crack = Monitored::Scalar<Float_t>("CoreEMinCRACK",0.0);
-  auto f0_crack = Monitored::Scalar<Float_t>("F0inCRACK",0.0);
-  auto f1_crack = Monitored::Scalar<Float_t>("F1inCRACK",0.0);
-  auto f2_crack = Monitored::Scalar<Float_t>("F2inCRACK",0.0);
-  auto f3_crack = Monitored::Scalar<Float_t>("F3inCRACK",0.0);
-  auto re233e237_crack = Monitored::Scalar<Float_t>("Re233e337inCRACK",0.0);
-  auto re237e277_crack = Monitored::Scalar<Float_t>("Re237e277inCRACK",0.0);
-  auto nofblayerhits_crack = Monitored::Scalar<u_int8_t>("NOfBLayerHitsinCRACK",0);
-  auto nofpixelhits_crack = Monitored::Scalar<u_int8_t>("NOfPixelHitsinCRACK",0);
-  auto nofscthits_crack = Monitored::Scalar<u_int8_t>("NOfSCTHitsinCRACK",0);
-  auto noftrthits_crack = Monitored::Scalar<u_int8_t>("NOfTRTHitsinCRACK",0);
-  auto noftrthighthresholdhits_crack = Monitored::Scalar<u_int8_t>("NOfTRTHighThresholdHitsinCRACK",0);
-  auto deltaeta1_crack = Monitored::Scalar<Float_t>("DeltaEta1inCRACK",0.0);
-  auto deltaphi2_crack = Monitored::Scalar<Float_t>("DeltaPhi2inCRACK",0.0);
-  auto trackd0_crack = Monitored::Scalar<Float_t>("Trackd0inCRACK",0.0);
+
+  auto et_crack = Monitored::Scalar<Float_t>("EtProbeinCRACK",0.0);
+  auto eta_crack = Monitored::Scalar<Float_t>("EtaProbeinCRACK",0.0);
+  auto phi_crack = Monitored::Scalar<Float_t>("PhiProbeinCRACK",0.0);
+  auto time_crack = Monitored::Scalar<Float_t>("TimeProbeinCRACK",0.0);
+  auto ehad1_crack = Monitored::Scalar<Float_t>("Ehad1ProbeinCRACK",0.0);
+  auto eoverp_crack = Monitored::Scalar<Float_t>("EoverPProbeinCRACK",0.0);
+  auto coreem_crack = Monitored::Scalar<Float_t>("CoreEMProbeinCRACK",0.0);
+  auto f0_crack = Monitored::Scalar<Float_t>("F0ProbeinCRACK",0.0);
+  auto f1_crack = Monitored::Scalar<Float_t>("F1ProbeinCRACK",0.0);
+  auto f2_crack = Monitored::Scalar<Float_t>("F2ProbeinCRACK",0.0);
+  auto f3_crack = Monitored::Scalar<Float_t>("F3ProbeinCRACK",0.0);
+  auto re233e237_crack = Monitored::Scalar<Float_t>("Re233e237ProbeinCRACK",0.0);
+  auto re237e277_crack = Monitored::Scalar<Float_t>("Re237e277ProbeinCRACK",0.0);
+  auto nofblayerhits_crack = Monitored::Scalar<u_int8_t>("NOfBLayerHitsProbeinCRACK",0);
+  auto nofpixelhits_crack = Monitored::Scalar<u_int8_t>("NOfPixelHitsProbeinCRACK",0);
+  auto nofscthits_crack = Monitored::Scalar<u_int8_t>("NOfSCTHitsProbeinCRACK",0);
+  auto noftrthits_crack = Monitored::Scalar<u_int8_t>("NOfTRTHitsProbeinCRACK",0);
+  auto noftrthighthresholdhits_crack = Monitored::Scalar<u_int8_t>("NOfTRTHighThresholdHitsProbeinCRACK",0);
+  auto deltaeta1_crack = Monitored::Scalar<Float_t>("DeltaEta1ProbeinCRACK",0.0);
+  auto deltaphi2_crack = Monitored::Scalar<Float_t>("DeltaPhi2ProbeinCRACK",0.0);
+  auto trackd0_crack = Monitored::Scalar<Float_t>("Trackd0ProbeinCRACK",0.0);
+
 
   Float_t myeta = el->eta();
   Float_t myphi = el->phi();
@@ -284,6 +287,15 @@ StatusCode MonitorTnPAlgorithm::fillElectronProbe(const xAOD::Electron *el, cons
   auto is_pt_gt_4gev = Monitored::Scalar<bool>("is_pt_gt_4gev",false);
   is_pt_gt_4gev = myet > 4000. ;
 
+  auto is_pt_gt_4gev_barrel = Monitored::Scalar<bool>("is_pt_gt_4gevBARREL",false);
+  is_pt_gt_4gev_barrel = myet > 4000. ;
+
+  auto is_pt_gt_4gev_endcap = Monitored::Scalar<bool>("is_pt_gt_4gevENDCAP",false);
+  is_pt_gt_4gev_endcap = myet > 4000. ;
+
+  auto is_pt_gt_4gev_crack = Monitored::Scalar<bool>("is_pt_gt_4gevCRACK",false);
+  is_pt_gt_4gev_crack = myet > 4000. ;
+
   // Isolation Energy
 
   el->isolationValue(myptcone20,xAOD::Iso::ptcone20);
@@ -296,9 +308,9 @@ StatusCode MonitorTnPAlgorithm::fillElectronProbe(const xAOD::Electron *el, cons
   Float_t myf1    = 0.0;
   Float_t myf2    = 0.0;
   Float_t myf3    = 0.0;
-  Float_t e233  = 0.0;
-  Float_t e237  = 0.0;
-  Float_t e277  = 0.0;
+  Float_t e233    = 0.0;
+  Float_t e237    = 0.0;
+  Float_t e277    = 0.0;
   Float_t myre233e237 = 0.0;
   Float_t myre237e277 = 0.0;
 
@@ -330,7 +342,7 @@ StatusCode MonitorTnPAlgorithm::fillElectronProbe(const xAOD::Electron *el, cons
   u_int8_t mynoftrthits=-1;
   u_int8_t mynoftrthighthresholdhits=-1;
 
-  if(t) {
+  if (t) {
     trackp = t->pt()*cosh(t->eta());
     // retrieve track summary information
     t->summaryValue(mynofblayerhits,xAOD::numberOfInnermostPixelLayerHits);
@@ -366,56 +378,56 @@ StatusCode MonitorTnPAlgorithm::fillElectronProbe(const xAOD::Electron *el, cons
   auto region = GetRegion(myeta);
   switch(region){
     case BARREL :
-    nofblayerhits_barrel = mynofblayerhits ; nofpixelhits_barrel = mynofpixelhits ; nofscthits_barrel = mynofscthits ;
-    noftrthits_barrel = mynoftrthits ; noftrthighthresholdhits_barrel = mynoftrthighthresholdhits;
-    fill("MonitorTnP",nofblayerhits_barrel, nofpixelhits_barrel,noftrthits_barrel,noftrthighthresholdhits_barrel,is_pt_gt_4gev);
-    deltaeta1_barrel = mydeltaeta1; deltaphi2_barrel = mydeltaphi2; trackd0_barrel = mytrackd0;
-    eoverp_barrel = myeoverp;
-    fill("MonitorTnP",deltaeta1_barrel, deltaphi2_barrel,trackd0_barrel,eoverp_barrel,is_pt_gt_4gev);
-    et_barrel = myet ; eta_barrel = myeta ; phi_barrel = myphi ;
-    fill("MonitorTnP",et_barrel,eta_barrel,phi_barrel,is_pt_gt_4gev);
-    time_barrel = mytime; ehad1_barrel = myehad1; coreem_barrel = myecore;
-    fill("MonitorTnP",time_barrel, ehad1_barrel,coreem_barrel,is_pt_gt_4gev);
-    f0_barrel = myf0; f1_barrel = myf1; f2_barrel = myf2; f3_barrel = myf3; re233e237_barrel = myre233e237; re237e277_barrel = myre237e277;
-    fill("MonitorTnP",f0_barrel,f1_barrel,f2_barrel, f3_barrel,re233e237_barrel,re237e277_barrel,is_pt_gt_4gev);
-    break;
+
+      nofblayerhits_barrel = mynofblayerhits ; nofpixelhits_barrel = mynofpixelhits ; nofscthits_barrel = mynofscthits ;
+      noftrthits_barrel = mynoftrthits ; noftrthighthresholdhits_barrel = mynoftrthighthresholdhits;
+      deltaeta1_barrel = mydeltaeta1; deltaphi2_barrel = mydeltaphi2; trackd0_barrel = mytrackd0;
+      eoverp_barrel = myeoverp;
+      et_barrel = myet ; eta_barrel = myeta ; phi_barrel = myphi ;
+      time_barrel = mytime; ehad1_barrel = myehad1; coreem_barrel = myecore;
+      f0_barrel = myf0; f1_barrel = myf1; f2_barrel = myf2; f3_barrel = myf3; re233e237_barrel = myre233e237; re237e277_barrel = myre237e277;
+      fill("MonitorTnP",nofblayerhits_barrel, nofpixelhits_barrel, nofscthits_barrel, noftrthits_barrel, noftrthighthresholdhits_barrel, 
+	   deltaeta1_barrel, deltaphi2_barrel,trackd0_barrel,eoverp_barrel,
+	   et_barrel,eta_barrel,phi_barrel, time_barrel, ehad1_barrel,coreem_barrel, f0_barrel,f1_barrel,f2_barrel, f3_barrel,
+	   re233e237_barrel,re237e277_barrel,is_pt_gt_4gev_barrel);
+      break;
+
     case ENDCAP :
-    nofblayerhits_endcap = mynofblayerhits; nofpixelhits_endcap = mynofpixelhits ; nofscthits_endcap = mynofscthits ;
-    noftrthits_endcap = mynoftrthits ; noftrthighthresholdhits_endcap = mynoftrthighthresholdhits;
-    fill("MonitorTnP",nofblayerhits_endcap, nofpixelhits_endcap,noftrthits_endcap,noftrthighthresholdhits_endcap,is_pt_gt_4gev);
-    deltaeta1_endcap = mydeltaeta1; deltaphi2_endcap = mydeltaphi2; trackd0_endcap = mytrackd0;
-    eoverp_endcap = myeoverp;
-    fill("MonitorTnP",deltaeta1_endcap, deltaphi2_endcap,trackd0_endcap,eoverp_endcap,is_pt_gt_4gev);
-    et_endcap = myet ; eta_endcap = myeta ; phi_endcap = myphi ;
-    fill("MonitorTnP",et_endcap,eta_endcap,phi_endcap,is_pt_gt_4gev);
-    time_endcap = mytime; ehad1_endcap = myehad1; coreem_endcap = myecore;
-    fill("MonitorTnP",time_endcap, ehad1_endcap,coreem_endcap,is_pt_gt_4gev);
-    f0_endcap = myf0; f1_endcap = myf1; f2_endcap = myf2; f3_endcap = myf3; re233e237_endcap = myre233e237; re237e277_endcap = myre237e277;
-    fill("MonitorTnP",f0_endcap,f1_endcap,f2_endcap,f3_endcap,re233e237_endcap,re237e277_endcap,is_pt_gt_4gev);
-    break;
+
+      nofblayerhits_endcap = mynofblayerhits; nofpixelhits_endcap = mynofpixelhits ; nofscthits_endcap = mynofscthits ;
+      noftrthits_endcap = mynoftrthits ; noftrthighthresholdhits_endcap = mynoftrthighthresholdhits;
+      deltaeta1_endcap = mydeltaeta1; deltaphi2_endcap = mydeltaphi2; trackd0_endcap = mytrackd0;
+      eoverp_endcap = myeoverp;
+      et_endcap = myet ; eta_endcap = myeta ; phi_endcap = myphi ;
+      time_endcap = mytime; ehad1_endcap = myehad1; coreem_endcap = myecore;
+      f0_endcap = myf0; f1_endcap = myf1; f2_endcap = myf2; f3_endcap = myf3; re233e237_endcap = myre233e237; re237e277_endcap = myre237e277;
+      fill("MonitorTnP",nofblayerhits_endcap,nofpixelhits_endcap,nofscthits_endcap,noftrthits_endcap,noftrthighthresholdhits_endcap,
+	   deltaeta1_endcap, deltaphi2_endcap,trackd0_endcap,eoverp_endcap,et_endcap,eta_endcap,phi_endcap,
+	   time_endcap, ehad1_endcap,coreem_endcap,
+	   f0_endcap,f1_endcap,f2_endcap,f3_endcap,re233e237_endcap,re237e277_endcap,is_pt_gt_4gev_endcap);
+      break;
+
     case CRACK :
-    nofblayerhits_crack = mynofblayerhits; nofpixelhits_crack = mynofpixelhits ; nofscthits_crack = mynofscthits ;
-    noftrthits_crack = mynoftrthits ; noftrthighthresholdhits_crack = mynoftrthighthresholdhits;
-    fill("MonitorTnP",nofblayerhits_crack, nofpixelhits_crack,noftrthits_crack,noftrthighthresholdhits_crack,is_pt_gt_4gev);
-    deltaeta1_crack = mydeltaeta1; deltaphi2_crack = mydeltaphi2; trackd0_crack = mytrackd0;
-    eoverp_barrel = myeoverp;
-    fill("MonitorTnP",deltaeta1_crack, deltaphi2_crack,trackd0_crack,eoverp_crack,is_pt_gt_4gev);
-    et_crack = myet ; eta_crack = myeta ; phi_crack = myphi ;
-    fill("MonitorTnP",et_crack,eta_crack,phi_crack,is_pt_gt_4gev);
-    time_crack = mytime; ehad1_crack = myehad1; coreem_crack = myecore;
-    fill("MonitorTnP",time_crack, ehad1_crack,coreem_crack,is_pt_gt_4gev);
-    f0_crack = myf0; f1_crack = myf1; f2_crack = myf2; f3_crack = myf3; re233e237_crack = myre233e237; re237e277_crack = myre237e277;
-    fill("MonitorTnP",f0_crack,f1_crack,f2_crack,f3_crack,re233e237_crack,re237e277_crack,is_pt_gt_4gev);
-    break;
+      nofblayerhits_crack = mynofblayerhits; nofpixelhits_crack = mynofpixelhits ; nofscthits_crack = mynofscthits ;
+      noftrthits_crack = mynoftrthits ; noftrthighthresholdhits_crack = mynoftrthighthresholdhits;
+      deltaeta1_crack = mydeltaeta1; deltaphi2_crack = mydeltaphi2; trackd0_crack = mytrackd0;
+      eoverp_crack = myeoverp;
+      et_crack = myet ; eta_crack = myeta ; phi_crack = myphi ;
+      time_crack = mytime; ehad1_crack = myehad1; coreem_crack = myecore;
+      f0_crack = myf0; f1_crack = myf1; f2_crack = myf2; f3_crack = myf3; re233e237_crack = myre233e237; re237e277_crack = myre237e277;
+      fill("MonitorTnP",nofblayerhits_crack, nofpixelhits_crack,nofscthits_crack,noftrthits_crack,noftrthighthresholdhits_crack,
+	   deltaeta1_crack, deltaphi2_crack,trackd0_crack,eoverp_crack,et_crack,eta_crack,phi_crack,
+	   time_crack, ehad1_crack,coreem_crack,f0_crack,f1_crack,f2_crack,f3_crack,re233e237_crack,re237e277_crack,is_pt_gt_4gev_crack);
+      break;
     default :
-    //ATH_MSG_WARNING("found an electron outside the |eta| > 2.47 acceptance");
-    break;
+      //ATH_MSG_WARNING("found an electron outside the |eta| > 2.47 acceptance");
+      break;
   }
 
   et = myet ; eta = myeta ; phi = myphi ; time = mytime ;
   ptcone20 = myptcone20; topoetcone40 = mytopoetcone40 ;
   fill("MonitorTnP",et,eta,phi,time,is_pt_gt_4gev,
-      ptcone20,topoetcone40,lbNProbeCandidates,is_TightID,is_Iso,is_IsoandTight);
+       ptcone20,topoetcone40,lbNProbeCandidates,is_TightID,is_Iso,is_IsoandTight);
 
   return StatusCode::SUCCESS;
 }
-- 
GitLab


From ba82c2e43a7e58da5537f66ab485bcaec65b211c Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Fri, 10 Sep 2021 10:03:09 +0200
Subject: [PATCH 053/347] Update version.txt

---
 Projects/Athena/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt
index de6a79655ec9..e2b274ee15be 100644
--- a/Projects/Athena/version.txt
+++ b/Projects/Athena/version.txt
@@ -1 +1 @@
-22.0.43
+22.0.44
-- 
GitLab


From 2e984a4ffd7c518b58ec31f0f7dfa9347b32e2ce Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Fri, 10 Sep 2021 10:04:31 +0200
Subject: [PATCH 054/347] Update version.txt

---
 Projects/AthSimulation/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/AthSimulation/version.txt b/Projects/AthSimulation/version.txt
index de6a79655ec9..e2b274ee15be 100644
--- a/Projects/AthSimulation/version.txt
+++ b/Projects/AthSimulation/version.txt
@@ -1 +1 @@
-22.0.43
+22.0.44
-- 
GitLab


From 066c2d451095a68c334d93fe10f09e6cfa02f1ce Mon Sep 17 00:00:00 2001
From: Luzhan Yue <luzhan.yue@cern.ch>
Date: Fri, 10 Sep 2021 10:05:18 +0200
Subject: [PATCH 055/347] corrected a typo

---
 Generators/Herwig7_i/test/test_02_Wjet.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Generators/Herwig7_i/test/test_02_Wjet.sh b/Generators/Herwig7_i/test/test_02_Wjet.sh
index c0485fae98cb..3673f9358e5b 100755
--- a/Generators/Herwig7_i/test/test_02_Wjet.sh
+++ b/Generators/Herwig7_i/test/test_02_Wjet.sh
@@ -22,8 +22,8 @@ python /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Pythia8i/rootconvert.py
 echo "art-result: $? Plot"
 
 dcubeName="Herwig7"
-dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/master_branch/Herwig7_i/config_file/test_02_config.xml"
-dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Herwig7_i/reference/test_02_output.root"
+dcubeXml="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Herwig7_i/config_file/test_02_config.xml"
+dcubeRef="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Herwig7_i/master_branch/reference/test_02_output.root"
 
 bash /cvmfs/atlas.cern.ch/repo/sw/art/dcube/bin/art-dcube $dcubeName MyOutput.root $dcubeXml $dcubeRef
 
-- 
GitLab


From 1cb19a9743e023e89e0c06e9df1eebefb6321d1e Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Fri, 10 Sep 2021 10:05:37 +0200
Subject: [PATCH 056/347] Update version.txt

---
 Projects/AthDataQuality/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/AthDataQuality/version.txt b/Projects/AthDataQuality/version.txt
index de6a79655ec9..e2b274ee15be 100644
--- a/Projects/AthDataQuality/version.txt
+++ b/Projects/AthDataQuality/version.txt
@@ -1 +1 @@
-22.0.43
+22.0.44
-- 
GitLab


From fb93c533d09e562dcb618cecb2a0a0eaddc24e8e Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Fri, 10 Sep 2021 10:07:37 +0200
Subject: [PATCH 057/347] Update version.txt

---
 Projects/DetCommon/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/DetCommon/version.txt b/Projects/DetCommon/version.txt
index de6a79655ec9..e2b274ee15be 100644
--- a/Projects/DetCommon/version.txt
+++ b/Projects/DetCommon/version.txt
@@ -1 +1 @@
-22.0.43
+22.0.44
-- 
GitLab


From b8654c8f9cf971d523d8543708de6813163c6a52 Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Fri, 10 Sep 2021 10:08:51 +0200
Subject: [PATCH 058/347] Update version.txt

---
 Projects/VP1Light/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/VP1Light/version.txt b/Projects/VP1Light/version.txt
index de6a79655ec9..e2b274ee15be 100644
--- a/Projects/VP1Light/version.txt
+++ b/Projects/VP1Light/version.txt
@@ -1 +1 @@
-22.0.43
+22.0.44
-- 
GitLab


From 45be05e5609c73b26164427a512e2048448fe90c Mon Sep 17 00:00:00 2001
From: Sergi Rodriguez Bosca <sergi.rodriguez@cern.ch>
Date: Fri, 10 Sep 2021 10:31:31 +0200
Subject: [PATCH 059/347] Shifting the phi coordinate for each TT

---
 .../L1CaloFEXSim/L1CaloFEXSim/jTower.h        |  4 +++
 .../L1CaloFEXSim/L1CaloFEXSim/jTowerBuilder.h |  4 +++
 .../L1CaloFEX/L1CaloFEXSim/src/jTower.cxx     |  8 +++---
 .../L1CaloFEXSim/src/jTowerBuilder.cxx        | 27 ++++++++-----------
 4 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jTower.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jTower.h
index 9bb6165fb30b..48837d8e9c33 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jTower.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jTower.h
@@ -66,10 +66,12 @@ namespace LVL1 {
     int iPhi() const;
     float eta() {return m_eta;};
     float phi() {return m_phi;};
+    
     float eta() const {return m_eta;};
     float phi() const {return m_phi;};
     float centreEta() const {return m_centre_eta;}
     float centrePhi() const {return m_centre_phi;}
+    float centrephi_toPI() const {return m_centre_phi_toPI;}
     int fcalLayer() const {return m_fcal_layer;}
     
     void setEta(const float thiseta){ m_eta = thiseta; }
@@ -140,10 +142,12 @@ namespace LVL1 {
   private:
     float m_eta;
     float m_phi;
+    
     int m_tower_id;
     int m_posneg = 0;
     float m_centre_eta =0;
     float m_centre_phi =0;
+    float m_centre_phi_toPI=0;
     std::vector<Identifier> m_EM_scID;
     std::vector<Identifier> m_HAD_scID;
     std::vector<int> m_et;    
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jTowerBuilder.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jTowerBuilder.h
index 74573bb1dc7b..3288dfb38431 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jTowerBuilder.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jTowerBuilder.h
@@ -40,6 +40,10 @@ class jTowerBuilder: public AthAlgTool, virtual public IjTowerBuilder {
   virtual void BuildHECjTowers(std::unique_ptr<jTowerContainer> & jTowerContainerRaw) const override ;
   virtual void BuildAllTowers(std::unique_ptr<jTowerContainer> & jTowerContainerRaw) const override ;
   virtual void BuildSingleTower(std::unique_ptr<jTowerContainer> & jTowerContainerRawRaw,float eta, float phi, int key_eta, float keybase, int posneg, float centre_eta = 0.0, float centre_phi = 0.0, int fcal_layer = -1) const override ;
+  
+  
+  static constexpr float m_TT_Size_phi = M_PI/32;
+  static constexpr float m_TT_Size_phi_FCAL = M_PI/16;
 
 };
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jTower.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jTower.cxx
index bc13ef599bfa..29dedfda1527 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jTower.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jTower.cxx
@@ -44,9 +44,11 @@ namespace LVL1 {
     m_centre_eta(centre_eta),
     m_centre_phi(centre_phi),
     m_fcal_layer(fcal_layer)
-  {
-    this->clearET();
-  }
+    {   
+        m_centre_phi_toPI = centre_phi;
+        if(centre_phi>M_PI) m_centre_phi_toPI = centre_phi-2*M_PI;
+        this->clearET();
+    }
   
   
   /** Clear and resize ET value vector */
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jTowerBuilder.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jTowerBuilder.cxx
index d3c694061c47..c62faed1d702 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jTowerBuilder.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jTowerBuilder.cxx
@@ -64,7 +64,7 @@ void jTowerBuilder::BuildEMBjTowers(std::unique_ptr<jTowerContainer> & jTowerCon
         float centre_eta = (0.1*ieta) + (0.05) ;
         for (int iphi = 0; iphi < 64; ++iphi) { // loop over 64 phi steps
             int key_eta = ieta;
-            float centre_phi = (0.1*iphi) + (0.05) ;
+            float centre_phi = (m_TT_Size_phi*iphi) + (m_TT_Size_phi/2);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 100000, -1, -1*centre_eta, centre_phi);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 200000,  1,    centre_eta, centre_phi);
         }
@@ -80,8 +80,7 @@ void jTowerBuilder::BuildTRANSjTowers(std::unique_ptr<jTowerContainer> & jTowerC
         float centre_eta = (0.1*ieta) + (0.05);
         for (int iphi = 0; iphi < 64; ++iphi) { // loop over 64 phi steps
             int key_eta = ieta;
-            //float centre_phi = (TT_Size*iphi) + (0.5*TT_Size);
-            float centre_phi = (0.1*iphi) + (0.05) ;
+            float centre_phi = (m_TT_Size_phi*iphi) + (m_TT_Size_phi/2);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 300000, -1,-1*centre_eta, centre_phi);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 400000,  1,   centre_eta, centre_phi);
         }
@@ -98,7 +97,7 @@ void jTowerBuilder::BuildEMEjTowers(std::unique_ptr<jTowerContainer> & jTowerCon
         float centre_eta =(0.1*ieta) + (0.05) ;
         for (int iphi = 0; iphi < 64; ++iphi) { // loop over 64 phi steps
             int key_eta = ieta;
-            float centre_phi = (0.1*iphi) + (0.05) ;
+            float centre_phi = (m_TT_Size_phi*iphi) + (m_TT_Size_phi/2);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 500000, -1, -1*centre_eta, centre_phi);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 600000,  1,    centre_eta, centre_phi);
         }
@@ -111,8 +110,7 @@ void jTowerBuilder::BuildEMEjTowers(std::unique_ptr<jTowerContainer> & jTowerCon
         float centre_eta = (0.1*ieta) + (0.05);
         for (int iphi = 0; iphi < 64; ++iphi) { // loop over 64 phi steps
             int key_eta = ieta;
-            //float centre_phi =(TT_Size*iphi) + (0.5*TT_Size) ;
-            float centre_phi = (0.1*iphi) + (0.05) ;
+            float centre_phi = (m_TT_Size_phi*iphi) + (m_TT_Size_phi/2);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 500000, -1,-1*centre_eta, centre_phi);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 600000,  1,   centre_eta, centre_phi);
         }
@@ -125,8 +123,7 @@ void jTowerBuilder::BuildEMEjTowers(std::unique_ptr<jTowerContainer> & jTowerCon
         float centre_eta= (0.1*ieta) + (0.05) ;
         for (int iphi = 0; iphi < 64; ++iphi) { // loop over 64 phi steps
             int key_eta = ieta;
-            //float centre_phi =(TT_Size*iphi) + (0.5*TT_Size) ;
-            float centre_phi = (0.1*iphi) + (0.05) ;
+            float centre_phi = (m_TT_Size_phi*iphi) + (m_TT_Size_phi/2);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 500000, -1,-1*centre_eta, centre_phi);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 600000,  1,   centre_eta, centre_phi);
         }
@@ -140,7 +137,7 @@ void jTowerBuilder::BuildEMEjTowers(std::unique_ptr<jTowerContainer> & jTowerCon
         for (int iphi = 0; iphi < 64; ++iphi) { // loop over 64 phi steps
             int key_eta = ieta;
             //float centre_phi =(TT_Size*iphi) + (0.5*TT_Size) ;
-            float centre_phi = (0.1*iphi) + (0.05) ;
+            float centre_phi = (m_TT_Size_phi*iphi) + (m_TT_Size_phi/2);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 500000, -1, -1*centre_eta, centre_phi);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 600000,  1,    centre_eta, centre_phi);
         }
@@ -154,7 +151,6 @@ void jTowerBuilder::BuildEMEjTowers(std::unique_ptr<jTowerContainer> & jTowerCon
 void jTowerBuilder::BuildEMIEjTowers(std::unique_ptr<jTowerContainer> & jTowerContainerRaw) const {
     int EMIE_MODIFIER = 25;
     int tmpVal = EMIE_MODIFIER;
-    float phi_width = 2.0;
     int cellCountEta = 0;
 
     for (int ieta = tmpVal; ieta < tmpVal + 3; ++ieta) { // loop over eta steps (there are 3 here, 2.5-2.7, 2.7-2.9, 2.9-3.1)
@@ -162,7 +158,7 @@ void jTowerBuilder::BuildEMIEjTowers(std::unique_ptr<jTowerContainer> & jTowerCo
         float centre_eta =(0.1*ieta) + (0.1*cellCountEta) ;
         for (int iphi = 0; iphi < 32; ++iphi) { // loop over 32 phi steps
             int key_eta = ieta;
-            float centre_phi = (2*iphi+phi_width/2.0)/10.0;
+            float centre_phi = (2*m_TT_Size_phi*iphi) + m_TT_Size_phi;
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, /*7*/500000, -1, -1*centre_eta, centre_phi);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, /*8*/600000,  1,    centre_eta, centre_phi);
         }
@@ -174,7 +170,7 @@ void jTowerBuilder::BuildEMIEjTowers(std::unique_ptr<jTowerContainer> & jTowerCo
         float centre_eta = (0.1*ieta + 0.3) + (0.05);
         for (int iphi = 0; iphi < 32; ++iphi) { // loop over 32 phi steps
             int key_eta = ieta;
-            float centre_phi = (2*iphi+phi_width/2.0)/10.0;
+            float centre_phi = (2*m_TT_Size_phi*iphi) + m_TT_Size_phi;
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, /*7*/500000, -1, -1*centre_eta, centre_phi);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, /*8*/600000,  1,    centre_eta, centre_phi);
         }
@@ -201,7 +197,6 @@ void jTowerBuilder::BuildFCALjTowers(std::unique_ptr<jTowerContainer> & jTowerCo
 
     //FCAL0
     float eta_width = 1.4;
-    float phi_width = 4.0;
     int cellCountEta = 0;
     int FCAL0_INITIAL = FCAL_MODIFIER;
     std::vector<int> TT_etapos{31,33,34,36,37,39,40,42,43,45,46,48}; // Eta position of each supercell, need to be change for the real coords. Future MR
@@ -211,7 +206,7 @@ void jTowerBuilder::BuildFCALjTowers(std::unique_ptr<jTowerContainer> & jTowerCo
         cellCountEta++;
 
         for (int iphi = 0; iphi < 16; ++iphi) { // loop over 16 phi steps
-            float centre_phi = (4*iphi+phi_width/2.0)/10.0;
+            float centre_phi = (2*m_TT_Size_phi_FCAL*iphi) + m_TT_Size_phi_FCAL;
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 700000, -1, -1*centre_eta, centre_phi, 0);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 800000,  1,    centre_eta, centre_phi, 0);
         }
@@ -229,7 +224,7 @@ void jTowerBuilder::BuildFCALjTowers(std::unique_ptr<jTowerContainer> & jTowerCo
         float centre_eta = (TT_etapos[cellCountEta]+eta_width/2)/10.0;
         cellCountEta++;
         for (int iphi = 0; iphi < 16; ++iphi) { // loop over 16 phi steps
-            float centre_phi = (4*iphi+phi_width/2.0)/10.0;
+            float centre_phi = (2*m_TT_Size_phi_FCAL*iphi) + m_TT_Size_phi_FCAL;
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta,  900000, -1, -1*centre_eta, centre_phi, 1);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 1000000,  1,    centre_eta, centre_phi, 1);
         }
@@ -248,7 +243,7 @@ void jTowerBuilder::BuildFCALjTowers(std::unique_ptr<jTowerContainer> & jTowerCo
         float centre_eta = (TT_etapos[cellCountEta]+eta_width/2)/10.0;
         cellCountEta++;
         for (int iphi = 0; iphi < 16; ++iphi) { // loop over 16 phi steps
-            float centre_phi = (4*iphi+phi_width/2.0)/10.0;
+            float centre_phi = (2*m_TT_Size_phi_FCAL*iphi) + m_TT_Size_phi_FCAL;
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 1100000, -1, -1*centre_eta, centre_phi, 2);
             BuildSingleTower(jTowerContainerRaw, ieta, iphi, key_eta, 1200000,  1,    centre_eta, centre_phi, 2);
         }
-- 
GitLab


From 0d96b75adae9b342973fa5cdf1dac7919a1069b1 Mon Sep 17 00:00:00 2001
From: Thomas Strebler <thomas.strebler@cern.ch>
Date: Fri, 10 Sep 2021 10:36:27 +0200
Subject: [PATCH 060/347] IDPVM ITk config

---
 .../InDetConfig/python/ITkConfigFlags.py      |   1 +
 .../InDetConfig/python/InDetConfigFlags.py    |   2 +
 .../InDetPhysValMonitoring/CMakeLists.txt     |   1 +
 .../InDetPhysValMonitoringTool.h              |   2 +
 .../python/InDetPhysValDecorationConfig.py    | 256 +++++++++++++
 .../python/InDetPhysValFlags.py               |  32 ++
 .../python/InDetPhysValMonitoringConfig.py    | 284 +++++++++++++++
 .../python/addTruthJetsConfig.py              |  21 ++
 .../scripts/runIDPVM.py                       |  79 ++++
 .../share/InDetPVMPlotDefCommon.xml           | 106 +-----
 .../share/InDetPVMPlotDefITK.xml              | 338 +++++++++++++++++-
 .../share/InDetPVMPlotDefRun2.xml             | 105 ++++++
 .../InDetPhysValMonitoring_topOptions.py      |   8 +-
 .../src/InDetPhysValMonitoringTool.cxx        |  87 +++--
 .../src/InDetRttPlots.cxx                     |  10 +-
 15 files changed, 1189 insertions(+), 143 deletions(-)
 create mode 100644 InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecorationConfig.py
 create mode 100644 InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValFlags.py
 create mode 100644 InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py
 create mode 100644 InnerDetector/InDetValidation/InDetPhysValMonitoring/python/addTruthJetsConfig.py
 create mode 100755 InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py

diff --git a/InnerDetector/InDetConfig/python/ITkConfigFlags.py b/InnerDetector/InDetConfig/python/ITkConfigFlags.py
index 3eb9e05f4b3a..64df9b1cfbc0 100644
--- a/InnerDetector/InDetConfig/python/ITkConfigFlags.py
+++ b/InnerDetector/InDetConfig/python/ITkConfigFlags.py
@@ -38,6 +38,7 @@ def createITkConfigFlags():
   itkcf.addFlag("ITk.doFastTracking", False) # Turn running of ITk FastTracking on and off
   itkcf.addFlag("ITk.doITkConversionFinding",True) # Turn running of doITkConversionFinding second pass on and off
   itkcf.addFlag("ITk.doITkLargeD0", False)
+  itkcf.addFlag("ITk.storeSeparateLargeD0Container", False)
   itkcf.addFlag("ITk.doBremRecovery", True) # Turn on running of Brem Recover in tracking
   itkcf.addFlag("ITk.doCaloSeededBrem", True) # Brem Recover in tracking restricted to Calo ROIs
   itkcf.addFlag("ITk.doHadCaloSeededSSS", False) # Use Recover SSS to Calo ROIs
diff --git a/InnerDetector/InDetConfig/python/InDetConfigFlags.py b/InnerDetector/InDetConfig/python/InDetConfigFlags.py
index ae3d4ab11e58..df7fb3ed7290 100644
--- a/InnerDetector/InDetConfig/python/InDetConfigFlags.py
+++ b/InnerDetector/InDetConfig/python/InDetConfigFlags.py
@@ -36,6 +36,8 @@ def createInDetConfigFlags():
   icf.addFlag("InDet.doForwardTracks", False) # Turn running of doForwardTracks pass on and off
   icf.addFlag("InDet.doLowPtLargeD0", False) # Turn running of doLargeD0 second pass down to 100 MeV on and off Turn running of doLargeD0 second pass on and off
   icf.addFlag("InDet.doLargeD0", False)
+  icf.addFlag("InDet.doR3LargeD0", True)
+  icf.addFlag("InDet.storeSeparateLargeD0Container", True)
   icf.addFlag("InDet.useExistingTracksAsInput", False) # Use already processed Track from a (D)ESD input file. This flag is related with ProcessedESDTracks InDetKey 
   icf.addFlag("InDet.cutLevel", 19) # Control cuts and settings for different lumi to limit CPU and disk space 
   icf.addFlag("InDet.priVtxCutLevel", 3 ) # Control vertexing cuts and settings for different lumi to limit CPU and disk space 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt b/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt
index 0e41e8058566..011b83d33ae4 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt
@@ -25,6 +25,7 @@ atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/*.py share/*.txt )
 atlas_install_runtime( share/*.xml share/*.xsd)
 atlas_install_runtime( test/InDetPhysValMonitoring_TestConfiguration.xml )
+atlas_install_runtime( scripts/*.py )
 
 # build postprocessing program 
 atlas_add_executable( postProcessIDPVMHistos util/postProcessIDPVMHistos.cxx 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/InDetPhysValMonitoringTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/InDetPhysValMonitoringTool.h
index 18929353d7d6..3a8d67059d6c 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/InDetPhysValMonitoringTool.h
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/InDetPhysValMonitoringTool.h
@@ -169,6 +169,8 @@ private:
     BooleanProperty m_fillTruthToRecoNtuple {this, "FillTruthToRecoNtuple", false, "Fill an ntuple with truth and matching reco info for more detailed stuidies"}; 
     BooleanProperty m_useVertexTruthMatchTool {this, "useVertexTruthMatchTool", false, "Use the vertex truth matching tool"}; 
     BooleanProperty m_onlyFillMatched {this, "onlyFillTruthMatched", false, "Only fill truth-to-reco (eff, reso, matched hit) plots"}; 
+    BooleanProperty m_doTRTExtensionPlots {this, "doTRTExtensionPlots", true, "do TRT extension plots"};
+
     FloatProperty m_maxTrkJetDR{this,"maxTrkJetDR",0.4,"the maximum dR to jets to allow for track-in-jet plots"}; 
     StringProperty m_dirName {this, "DirName", "SquirrelPlots/", "Top level directory to write histograms into"}; 
     StringProperty m_folder {this, "SubFolder", "", "Subfolder to add for plots if desired. Used when working with multiple IDPVM tool instances."}; 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecorationConfig.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecorationConfig.py
new file mode 100644
index 000000000000..6b958e757c05
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecorationConfig.py
@@ -0,0 +1,256 @@
+#
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+#
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+def metaDataKey():
+    '''
+    Meta data key to store the file source on which the InDet decoration alg has been running.
+    '''
+    return 'InDetPhysValDecoration'
+
+def monManName():
+    '''
+    Name of the monitoring manager
+    '''
+    return 'PhysValMonManager'
+
+def getMetaData(flags):
+    '''
+    Try to determine from the meta data whether the decoration has been performed already.
+    '''
+
+    from PyUtils.MetaReader import read_metadata
+    infile = flags.Input.Files[0]
+    thisFileMD = read_metadata(infile, None, 'full')
+    metadata = thisFileMD[infile]
+
+    try:
+        return metadata['/TagInfo'][metaDataKey()]
+    except Exception:
+        pass
+    return ''
+
+
+def canAddDecorator(flags):
+    '''
+    check whether the decorator can be added.
+
+    A decorator can be added if a track particle converter alg is in the sequence or
+    if ESDs or AODs are read.
+    '''
+    if not (flags.Detector.GeometryID or flags.Detector.GeometryITk):
+        return False
+
+    inputTags = flags.Input.ProcessingTags
+
+    for tag in inputTags:
+        if "StreamAOD" in tag:
+            return True
+
+        if "StreamESD" in tag:
+            return True
+
+    '''
+    if rec.readTAG:
+        return False
+
+    if rec.readRDO:
+        try:
+            from AthenaCommon.AlgSequence import AlgSequence
+            topSequence = AlgSequence()
+            import re
+            pat = re.compile('.*(TrackParticleCnvAlg).*')
+            for alg in topSequence.getChildren():
+                if pat.match(alg.getFullName()) is not None:
+                    return True
+
+        except Exception:
+            pass
+    '''
+
+    return False
+
+
+def createExtendNameIfNotDefaultCfg(alg,
+                                    check_prop,
+                                    def_val,
+                                    kwargs):
+    acc = ComponentAccumulator()
+
+    def_name = alg.getType() if hasattr(alg, 'getType') else alg.__class__.__name__
+    the_name = kwargs.pop('name', def_name)
+    if check_prop in kwargs and kwargs[check_prop] != def_val:
+        if the_name == def_name:
+            the_name += '_'
+            the_name += kwargs[check_prop]
+    elif check_prop not in kwargs:
+        kwargs.setdefault(check_prop, def_val)
+
+    cfg_alg = alg(**kwargs)
+    acc.addEventAlgo(cfg_alg)
+
+    return acc
+
+
+def PhysValMonInDetHoleSearchToolCfg(flags, name="PhysValMonInDetHoleSearchTool", **kwargs):    
+    if flags.Detector.GeometryID:
+        from InDetConfig.InDetRecToolConfig import InDetTrackHoleSearchToolCfg
+        return InDetTrackHoleSearchToolCfg(flags, name=name, **kwargs)
+    elif flags.Detector.GeometryITk:
+        from InDetConfig.ITkRecToolConfig import ITkTrackHoleSearchToolCfg
+        return ITkTrackHoleSearchToolCfg(flags, name=name, **kwargs)
+
+def InDetPhysHitDecoratorAlgCfg(flags, **kwargs):
+    '''
+    create decoration algorithm which decorates track particles with the unbiased hit residuals and pulls.
+    If the collection name TrackParticleContainerName is specified and differs from the default, the name
+    of the algorithm will be extended by the collection name
+    '''
+    acc = ComponentAccumulator()
+
+    kwargs.setdefault( "InDetTrackHoleSearchTool", acc.popToolsAndMerge(PhysValMonInDetHoleSearchToolCfg(flags)) )
+
+    Updator = None
+    if flags.Detector.GeometryID:
+        from InDetConfig.TrackingCommonConfig import InDetUpdatorCfg
+        Updator = acc.getPrimaryAndMerge(InDetUpdatorCfg(flags))
+    elif flags.Detector.GeometryITk:
+        from InDetConfig.ITkRecToolConfig import ITkUpdatorCfg
+        Updator = acc.popToolsAndMerge(ITkUpdatorCfg(flags))
+    kwargs.setdefault( "Updator", Updator )
+
+    acc.merge(createExtendNameIfNotDefaultCfg(CompFactory.InDetPhysHitDecoratorAlg,
+                                              'TrackParticleContainerName', 'InDetTrackParticles',
+                                              kwargs))
+    return acc
+
+
+
+def ParameterErrDecoratorAlgCfg(flags, **kwargs):
+    '''
+    create decoration algorithm which decorates track particles with the uncertainties of the track parameters.
+    If the collection name TrackParticleContainerName is specified and differs from the default, the name
+    of the algorithm will be extended by the collection name
+    '''
+    return createExtendNameIfNotDefaultCfg(CompFactory.ParameterErrDecoratorAlg,
+                                           'TrackParticleContainerName', 'InDetTrackParticles',
+                                           kwargs)
+        
+
+def InDetPhysValTruthDecoratorAlgCfg(flags, **kwargs):
+    '''
+    create decoration algorithm which decorates truth particles with track parameters at the perigee.
+    If the collection name TruthParticleContainerName is specified and differs from the default, the name
+    of the algorithm will be extended by the collection name
+    '''
+    acc = ComponentAccumulator()
+
+    Extrapolator = None
+    if flags.Detector.GeometryITk:
+        from  InDetConfig.ITkRecToolConfig import ITkExtrapolatorCfg
+        Extrapolator = acc.getPrimaryAndMerge(ITkExtrapolatorCfg(flags))
+    else:
+        from  InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg
+        Extrapolator = acc.getPrimaryAndMerge(InDetExtrapolatorCfg(flags))
+    kwargs.setdefault("Extrapolator", Extrapolator)
+
+    acc.merge(createExtendNameIfNotDefaultCfg(CompFactory.InDetPhysValTruthDecoratorAlg,
+                                              'TruthParticleContainerName', 'TruthParticles',
+                                              kwargs))
+    return acc
+
+def TruthClassDecoratorAlgCfg(flags, **kwargs):
+    '''
+    create decoration algorithm which decorates truth particles with origin and type from truth classifier.
+    if the collection name TruthParticleContainerName is specified and differs from the default, the name
+    of the algorithm will be extended by the collection name
+    '''
+    return createExtendNameIfNotDefaultCfg(CompFactory.TruthClassDecoratorAlg,
+                                           'TruthParticleContainerName', 'TruthParticles',
+                                           kwargs)
+
+def TrackDecoratorsCfg(flags, **kwargs):
+    '''
+    Get track particle decorators needed for the InDetPhysValMonitoring tool
+    If the collection name TrackParticleContainerName is specified and differs from the default, the name
+    of the algorithms will be extended by the collection name.
+    '''
+    acc = ComponentAccumulator()
+
+    if "CombinedInDetTracks" in flags.Input.Collections:
+        acc.merge(InDetPhysHitDecoratorAlgCfg(flags,**kwargs))
+
+    acc.merge(ParameterErrDecoratorAlgCfg(flags,**kwargs))
+
+    return acc
+
+def DBMTrackDecoratorsCfg(flags, **kwargs):
+    kwargs.setdefault("TrackParticleContainerName","ResolvedDBMTracks")
+    return TrackDecoratorsCfg(flags,**kwargs)
+
+def GSFTrackDecoratorsCfg(flags, **kwargs):
+    kwargs.setdefault("TrackParticleContainerName","GSFTrackParticles")
+    return TrackDecoratorsCfg(flags,**kwargs)
+
+def AddDecoratorCfg(flags,**kwargs):
+    '''
+    Add the track particle decoration algorithm to the top sequence.
+    The algorithm is to be run on RAW/RDO since it depends on full hit information
+    which is generally not available at later stages. The decorations added by this
+    algorithm are used by InDetPhysValMonitoring tool.
+    '''
+    acc = ComponentAccumulator()
+
+    acc.merge(TrackDecoratorsCfg(flags))
+  
+    if flags.Input.isMC and not flags.Detector.GeometryITk: #Temporarily disabled for ITk
+        acc.merge(InDetPhysValTruthDecoratorAlgCfg(flags))
+
+    if flags.IDPVM.doValidateGSFTracks:
+        acc.merge(AddGSFTrackDecoratorAlgCfg(flags))
+
+    if flags.IDPVM.doValidateDBMTracks and ("DBMTrackParticles" in flags.Input.Collections):
+        acc.merge(DBMTrackDecoratorsCfg(flags))
+
+    return acc
+
+
+def AddGSFTrackDecoratorAlgCfg(flags,**kwargs):
+    
+    #Search egamma algorithm and add the GSF TrackParticle decorator after the it.
+    acc = ComponentAccumulator()
+
+    if flags.IDPVM.doValidateGSFTracks:
+        # print ('DEBUG add addGSFTrackDecoratorAlg')
+
+        acc.merge(GSFTrackDecoratorsCfg(flags))
+
+        from  InDetPhysValMonitoring.ConfigUtils import extractCollectionPrefix
+        for col in flags.IDPVM.validateExtraTrackCollections :
+            prefix=extractCollectionPrefix(col)
+            decorator = acc.popToolsAndMerge(TrackDecoratorsCfg(flags))
+            decorator.TrackParticleContainerName=prefix+"TrackParticles"
+
+
+def AddDecoratorIfNeededCfg(flags):
+    '''
+     Add the InDet decoration algorithm if it has not been ran yet.
+    '''
+
+    acc = ComponentAccumulator()
+
+    if not canAddDecorator(flags):
+        print('DEBUG addDecoratorIfNeeded ? Stage is too early or too late for running the decoration. Needs reconstructed tracks. Try again during next stage ?')
+        return acc
+
+    meta_data = getMetaData(flags)
+    if len(meta_data) == 0:
+        # decoration has not been ran
+        acc.merge(AddDecoratorCfg(flags))
+
+    return acc
+
+
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValFlags.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValFlags.py
new file mode 100644
index 000000000000..f28ffea20ee9
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValFlags.py
@@ -0,0 +1,32 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+from AthenaConfiguration.AllConfigFlags import _addFlagsCategory
+
+def createIDPVMConfigFlags():
+    from AthenaConfiguration.AthConfigFlags import AthConfigFlags
+    icf = AthConfigFlags()
+
+    icf.addFlag("IDPVM.doValidateDBMTracks", False )
+    icf.addFlag("IDPVM.doValidateGSFTracks", False )
+    icf.addFlag("IDPVM.doValidateLooseTracks", False )
+    icf.addFlag("IDPVM.doValidateTightPrimaryTracks", False )
+    icf.addFlag("IDPVM.doValidateTracksInJets", False )
+    icf.addFlag("IDPVM.doValidateTracksInBJets", False )
+    icf.addFlag("IDPVM.doValidateTruthToRecoNtuple", False )
+    icf.addFlag("IDPVM.doValidateMuonMatchedTracks", False )
+    icf.addFlag("IDPVM.doValidateElectronMatchedTracks", False )
+    icf.addFlag("IDPVM.doValidateLargeD0Tracks", False )
+    icf.addFlag("IDPVM.doPhysValOutput", False )
+    icf.addFlag("IDPVM.doExpertOutput", False )
+    icf.addFlag("IDPVM.doTruthOriginPlots", False )
+    icf.addFlag("IDPVM.doPerAuthorPlots", False )
+    icf.addFlag("IDPVM.doHitLevelPlots", False )
+    icf.addFlag("IDPVM.setTruthStrategy", "HardScatter" )
+    icf.addFlag("IDPVM.validateExtraTrackCollections", [] ) # List of extra track collection names to be validated in addition to Tracks.
+    icf.addFlag("IDPVM.ancestorIDs", [] )
+    icf.addFlag("IDPVM.hardScatterStrategy", 0 ) # The hard-scatter vertex selection strategy to use when running hard-scatter efficiency / performance plots in IDPVM. 0 corresponds to sumPt^2, 1 corresponds to sumPt
+    
+    return icf
+
+_addFlagsCategory(ConfigFlags, "IDPVM", createIDPVMConfigFlags , "AthenaMonitoring")
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py
new file mode 100644
index 000000000000..b1afdf4eb977
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py
@@ -0,0 +1,284 @@
+#
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+#
+
+'''@file InDetPhysValMonitoringConfig.py
+@author T. Strebler
+@date 2021-08-30
+@brief Main CA-based python configuration for InDetPhysValMonitoring
+'''
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+def HistogramDefinitionSvcCfg(flags, **kwargs):
+    acc = ComponentAccumulator()
+    if flags.Detector.GeometryID:
+        kwargs.setdefault("DefinitionSource", "InDetPVMPlotDefRun2.xml")
+    elif flags.Detector.GeometryITk:
+        kwargs.setdefault("DefinitionSource", "InDetPVMPlotDefITK.xml")
+    kwargs.setdefault("DefinitionFormat", "text/xml")
+    histoSvc = CompFactory.HistogramDefinitionSvc(**kwargs)
+    acc.addService(histoSvc)
+    return acc
+
+def InDetRttTruthSelectionToolCfg(flags, name="InDetRttTruthSelectionTool", **kwargs):
+    acc = ComponentAccumulator()
+
+    kwargs.setdefault("requireStatus1", True)
+    kwargs.setdefault("requireCharged", True)
+    kwargs.setdefault("maxBarcode", (200*1000 if kwargs.pop("OnlyDressPrimaryTracks", True) else 2**31-1))
+    kwargs.setdefault("maxProdVertRadius", 300.)
+    kwargs.setdefault("maxEta", 2.5)
+    kwargs.setdefault("minPt", 500.)
+
+    Extrapolator = None
+    if flags.Detector.GeometryITk:
+        from  InDetConfig.ITkRecToolConfig import ITkExtrapolatorCfg
+        Extrapolator = acc.getPrimaryAndMerge(ITkExtrapolatorCfg(flags))
+    else:
+        from  InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg
+        Extrapolator = acc.getPrimaryAndMerge(InDetExtrapolatorCfg(flags))
+    kwargs.setdefault("Extrapolator", Extrapolator)
+
+    tool = CompFactory.AthTruthSelectionTool(name = name, **kwargs)
+    acc.setPrivateTools(tool)
+    return acc
+
+def HardScatterSelectionToolCfg(flags, **kwargs):
+    acc = ComponentAccumulator()
+    tool = CompFactory.InDet.InDetHardScatterSelectionTool(name = "InDetHardScatterSelectionTool", **kwargs)
+    acc.setPrivateTools(tool)
+    return acc
+
+def InDetVertexTruthMatchToolCfg(flags, **kwargs):
+    acc  = ComponentAccumulator()
+    tool = CompFactory.InDetVertexTruthMatchTool(**kwargs)
+    acc.setPrivateTools(tool)
+    return acc
+
+def InDetPhysValMonitoringToolCfg(flags, **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("useTrackSelection", False)
+    kwargs.setdefault("EnableLumi", False)
+
+    acc.merge(HistogramDefinitionSvcCfg(flags))
+
+    if flags.Input.isMC:
+        kwargs.setdefault("TruthParticleContainerName", "TruthParticles")
+        if 'TruthSelectionTool' not in kwargs:
+            TruthSelectionTool = acc.popToolsAndMerge(InDetRttTruthSelectionToolCfg(flags))
+            kwargs.setdefault("TruthSelectionTool", TruthSelectionTool)
+
+        if 'hardScatterSelectionTool' not in kwargs:
+            hardScatterSelectionTool = acc.popToolsAndMerge(HardScatterSelectionToolCfg(flags))
+            hardScatterSelectionTool.RedoHardScatter=True
+            hardScatterSelectionTool.SelectionMode = flags.IDPVM.hardScatterStrategy
+            kwargs.setdefault("hardScatterSelectionTool", hardScatterSelectionTool)
+
+        if flags.IDPVM.doValidateTracksInJets:
+            jets_name = 'AntiKt4TruthJets'
+            kwargs.setdefault("JetContainerName", jets_name)
+            kwargs.setdefault("FillTrackInJetPlots", True)            
+
+            from InDetPhysValMonitoring.addTruthJetsConfig import AddTruthJetsIfNotExistingCfg
+            acc.merge(AddTruthJetsIfNotExistingCfg(flags))
+
+            if flags.IDPVM.doValidateTracksInBJets:
+                kwargs.setdefault("FillTrackInBJetPlots", True)
+
+        else:
+            kwargs.setdefault("JetContainerName",'')
+            kwargs.setdefault("FillTrackInJetPlots", False)
+
+        kwargs.setdefault("FillTruthToRecoNtuple", flags.IDPVM.doValidateTruthToRecoNtuple)
+        kwargs.setdefault("doTruthOriginPlots",    flags.IDPVM.doTruthOriginPlots)
+        kwargs.setdefault("doPerAuthorPlots",      flags.IDPVM.doPerAuthorPlots)
+        kwargs.setdefault("doHitLevelPlots",       flags.IDPVM.doHitLevelPlots)
+
+        # adding the VeretxTruthMatchingTool
+        VertexTruthMatchTool = acc.popToolsAndMerge(InDetVertexTruthMatchToolCfg(flags))
+        kwargs.setdefault("useVertexTruthMatchTool", True)
+        kwargs.setdefault("VertexTruthMatchTool", VertexTruthMatchTool)
+
+        # Options for Truth Strategy : Requires full pile-up truth containers for some
+        if flags.IDPVM.setTruthStrategy == 'All' or flags.IDPVM.setTruthStrategy == 'PileUp':
+            if "xAOD::TruthPileupEventContainer#TruthPileupEvents" in flags.Input.TypedCollections:
+                kwargs.setdefault("PileupSwitch", flags.IDPVM.setTruthStrategy)
+            else:
+                print('WARNING Truth Strategy for InDetPhysValMonitoring set to %s but TruthPileupEvents are missing in the input; resetting to HardScatter only' % (
+                    flags.IDPVM.setTruthStrategy))
+        elif flags.IDPVM.setTruthStrategy != 'HardScatter':
+            print('WARNING Truth Strategy for for InDetPhysValMonitoring set to invalid option %s; valid flags are ["HardScatter", "All", "PileUp"]' % (
+                flags.IDPVM.setTruthStrategy))
+
+    else:
+        # disable truth monitoring for data
+        kwargs.setdefault("TruthParticleContainerName", '')
+        kwargs.setdefault("TruthVertexContainerName", '')
+        kwargs.setdefault("TruthEvents", '')
+        kwargs.setdefault("TruthPileupEvents" '')
+        kwargs.setdefault("TruthSelectionTool", None)        
+        # the jet container is actually meant to be a truth jet container
+        kwargs.setdefault("JetContainerName", '')
+        kwargs.setdefault("FillTrackInJetPlots", False)
+        kwargs.setdefault("FillTrackInBJetPlots", False)
+        kwargs.setdefault("FillTruthToRecoNtuple ", False)
+
+    if flags.Detector.GeometryITk:
+        #Disable vertex container for now
+        kwargs.setdefault("VertexContainerName", '')
+        kwargs.setdefault("doTRTExtensionPlots", False)
+
+    # Control the number of output histograms
+    if flags.IDPVM.doPhysValOutput:
+        kwargs.setdefault("DetailLevel", 100)
+
+    elif flags.IDPVM.doExpertOutput:
+        kwargs.setdefault("DetailLevel", 200)
+
+    tool = CompFactory.InDetPhysValMonitoringTool(**kwargs)
+    acc.setPrivateTools(tool)
+    return acc
+
+def InDetTrackSelectionToolLooseCfg(flags, name="InDetTrackSelectionToolLoose",
+                                    **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("CutLevel", "Loose")
+    tool = CompFactory.InDet.InDetTrackSelectionTool(name, **kwargs)
+    acc.setPrivateTools(tool)
+    return acc
+
+def InDetTrackSelectionToolTightPrimaryCfg(flags, name="InDetTrackSelectionToolTightPrimary",
+                                           **kwargs):
+    acc = ComponentAccumulator()
+    kwargs.setdefault("CutLevel", "TightPrimary")
+    tool = CompFactory.InDet.InDetTrackSelectionTool(name, **kwargs)
+    acc.setPrivateTools(tool)
+    return acc
+
+def InDetPhysValMonitoringToolLooseCfg(flags, **kwargs):
+    acc = ComponentAccumulator()
+
+    if 'TrackSelectionTool' not in kwargs:
+        TrackSelectionTool = acc.popToolsAndMerge(InDetTrackSelectionToolLooseCfg(flags))
+        kwargs.setdefault("TrackSelectionTool", TrackSelectionTool)
+
+    kwargs.setdefault("SubFolder", 'Loose/')
+    kwargs.setdefault("useTrackSelection", True)
+
+    return InDetPhysValMonitoringToolCfg(flags, name="InDetPhysValMonitoringToolLoose", **kwargs)
+
+def InDetPhysValMonitoringToolTightPrimaryCfg(flags, **kwargs):
+    acc = ComponentAccumulator()
+
+    if 'TrackSelectionTool' not in kwargs:
+        TrackSelectionTool = acc.popToolsAndMerge(InDetTrackSelectionToolTightPrimaryCfg(flags))
+        kwargs.setdefault("TrackSelectionTool", TrackSelectionTool)
+
+    kwargs.setdefault("SubFolder", 'TightPrimary/')
+    kwargs.setdefault("useTrackSelection", True)
+
+    return InDetPhysValMonitoringToolCfg(flags, name="InDetPhysValMonitoringToolTightPrimary", **kwargs)
+
+def InDetPhysValMonitoringToolGSFCfg(flags, **kwargs):
+    kwargs.setdefault("SubFolder", 'GSF/')
+    kwargs.setdefault("TrackParticleContainerName", 'GSFTrackParticles')
+    kwargs.setdefault("useTrackSelection", True)
+
+    return InDetPhysValMonitoringToolCfg(flags, name="InDetPhysValMonitoringToolGSF", **kwargs)
+
+def InDetPhysValMonitoringToolElectronsCfg(flags, **kwargs):
+    acc = ComponentAccumulator()
+
+    TruthSelectionTool = acc.popToolsAndMerge(InDetRttTruthSelectionToolCfg(flags, name="AthTruthSelectionToolForIDPVM_Electrons", **kwargs))
+    TruthSelectionTool.pdgId = 11
+    TruthSelectionTool.minPt = 5000.
+
+    kwargs.setdefault("TruthSelectionTool", TruthSelectionTool)
+    kwargs.setdefault("onlyFillTruthMatched", True)
+    kwargs.setdefault("SubFolder", 'Electrons/')
+
+    return InDetPhysValMonitoringToolCfg(flags, name='InDetPhysValMonitoringToolElectrons', **kwargs)
+
+def InDetPhysValMonitoringToolMuonsCfg(flags, **kwargs):
+    acc = ComponentAccumulator()
+
+    TruthSelectionTool = acc.popToolsAndMerge(InDetRttTruthSelectionToolCfg(flags, name = "AthTruthSelectionToolForIDPVM_Muons", **kwargs))
+    TruthSelectionTool.pdgId = 13
+    TruthSelectionTool.minPt = 5000.
+
+    kwargs.setdefault("TruthSelectionTool", TruthSelectionTool)
+    kwargs.setdefault("onlyFillTruthMatched", True)
+    kwargs.setdefault("SubFolder", 'Muons/')
+
+    return InDetPhysValMonitoringToolCfg(flags, name='InDetPhysValMonitoringToolMuons', **kwargs)
+
+def InDetPhysValMonitoringToolDBMCfg(flags, **kwargs):
+    
+    kwargs.setdefault("SubFolder", 'DBM/')
+    kwargs.setdefault("TrackParticleContainerName", 'ResolvedDBMTracks')
+    kwargs.setdefault("useTrackSelection", True)
+
+    return InDetPhysValMonitoringToolCfg(flags, name='InDetPhysValMonitoringToolDBM', **kwargs)
+
+def InDetLargeD0PhysValMonitoringToolCfg(flags, **kwargs):
+    acc = ComponentAccumulator()
+
+    TruthSelectionTool = acc.popToolsAndMerge(InDetRttTruthSelectionToolCfg(flags, name = "AthTruthSelectionToolForIDPVM_LargeD0", **kwargs))
+    TruthSelectionTool.maxProdVertRadius = 400.
+    TruthSelectionTool.minPt = 1200.
+    TruthSelectionTool.ancestorList = flags.IDPVM.ancestorIDs
+
+    kwargs.setdefault("SubFolder", 'LRT/')
+    kwargs.setdefault("TruthSelectionTool", TruthSelectionTool)
+    if flags.Detector.GeometryID:
+        kwargs.setdefault("TrackParticleContainerName", 'InDetLargeD0TrackParticles' if flags.InDet.storeSeparateLargeD0Container else 'InDetTrackParticles')
+    elif flags.Detector.GeometryITk:
+        kwargs.setdefault("TrackParticleContainerName", 'InDetLargeD0TrackParticles' if flags.ITk.storeSeparateLargeD0Container else 'InDetTrackParticles')
+    kwargs.setdefault("useTrackSelection", True)
+
+    return InDetPhysValMonitoringToolCfg(flags, name='InDetPhysValMonitoringToolLargeD0', **kwargs)
+
+def InDetPhysValMonitoringCfg(flags):
+    acc = ComponentAccumulator()
+
+    from InDetPhysValMonitoring.InDetPhysValDecorationConfig import AddDecoratorIfNeededCfg
+    acc.merge(AddDecoratorIfNeededCfg(flags))
+
+    monMan = CompFactory.AthenaMonManager( "PhysValMonManager" )
+    monMan.FileKey = "M_output"
+    monMan.Environment = "altprod"
+    monMan.ManualDataTypeSetup = True
+    monMan.DataType = "monteCarlo"
+    monMan.ManualRunLBSetup = True
+    monMan.Run = 1
+    monMan.LumiBlock = 1
+
+    mons = [ (True                                       ,  InDetPhysValMonitoringToolCfg ),
+             (flags.IDPVM.doValidateMuonMatchedTracks    ,  InDetPhysValMonitoringToolMuonsCfg ),
+             (flags.IDPVM.doValidateElectronMatchedTracks,  InDetPhysValMonitoringToolElectronsCfg ),
+             (flags.IDPVM.doValidateLargeD0Tracks        ,  InDetLargeD0PhysValMonitoringToolCfg ),
+             (flags.IDPVM.doValidateLooseTracks          ,  InDetPhysValMonitoringToolLooseCfg ),
+             (flags.IDPVM.doValidateTightPrimaryTracks   ,  InDetPhysValMonitoringToolTightPrimaryCfg ),
+             (flags.IDPVM.doValidateDBMTracks            ,  InDetPhysValMonitoringToolDBMCfg ),
+             (flags.IDPVM.doValidateGSFTracks            ,  InDetPhysValMonitoringToolGSFCfg )
+    ]
+
+    for enabled, creator in mons :
+        if enabled :
+            monMan.AthenaMonTools += [ acc.popToolsAndMerge(creator(flags)) ]
+
+    from  InDetPhysValMonitoring.ConfigUtils import extractCollectionPrefix
+    for col in flags.IDPVM.validateExtraTrackCollections :
+        prefix=extractCollectionPrefix(col)
+        tool = acc.popToolsAndMerge(InDetPhysValMonitoringToolCfg(flags, name = 'InDetPhysValMonitoringTool'+prefix))
+        tool.SubFolder = prefix+'Tracks/'
+        tool.TrackParticleContainerName = prefix+'TrackParticles'
+
+        monMan.AthenaMonTools += [ tool ]
+        
+    acc.addEventAlgo(monMan, primary = True)
+    return acc
+             
+    
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/addTruthJetsConfig.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/addTruthJetsConfig.py
new file mode 100644
index 000000000000..9ec4648aa7e9
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/addTruthJetsConfig.py
@@ -0,0 +1,21 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+def AddTruthJetsIfNotExistingCfg(flags):
+    '''
+    Add algorithm to create the truth jets collection unless the
+    collection exists already, or a truth jet finder is already running
+    '''
+    
+    # the jet collection name does not exist in the input file
+    # add a jet finder algorithm in front of the monitoring if the algorithm
+    # does not yet exist.
+    if "xAOD::JetContainer#AntiKt4TruthJets" not in flags.Input.TypedCollections:
+        from AthenaCommon.Logging import logging
+        log = logging.getLogger('InDetPhysValMonitoring/addTruthJets.py')
+
+        log.info('DEBUG addTruthJetsIfNotExising {} not in {} [file_type={}]'.format("AntiKt4TruthJets", flags.Input.TypedCollections, flags.Input.Format))
+
+        from JetRecConfig.StandardSmallRJets import AntiKt4Truth
+        from JetRecConfig.JetRecConfig import JetRecCfg
+
+        return JetRecCfg(flags, AntiKt4Truth)
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py
new file mode 100755
index 000000000000..386681d103bb
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+
+from AthenaCommon.Configurable import Configurable
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+# Set up logging and new style config
+Configurable.configurableRun3Behavior = True
+
+def GetCustomAthArgs():
+    from argparse import ArgumentParser
+    IDPVMparser = ArgumentParser(description='Parser for IDPVM configuration')
+    IDPVMparser.add_argument("--filesInput")
+    IDPVMparser.add_argument("--doTightPrimary", help='also run tight-primary plots', action='store_true', default=False)
+    IDPVMparser.add_argument("--doTracksInJets", help='also run tracks in jets', action='store_true', default=False)
+    IDPVMparser.add_argument("--doTracksInBJets", help='also run tracks in jets', action='store_true', default=False)
+    IDPVMparser.add_argument("--doTruthOrigin", help='make plots by track origin', action='store_true', default=False)
+    IDPVMparser.add_argument("--doHitLevelPlots", help='make hit residual / eff plots', action='store_true', default=False)
+    IDPVMparser.add_argument("--doPerAuthor", help='make plots by track author', action='store_true', default=False)
+    IDPVMparser.add_argument("--doExpertPlots", help='run additional expert-level plots', action='store_true', default=False)
+    IDPVMparser.add_argument("--doMuonMatchedTracks", help='run plots for tracks matched to true muons', action='store_true', default=False)
+    IDPVMparser.add_argument("--doElectronMatchedTracks", help='run plots for tracks matched to true electrons', action='store_true', default=False)
+    IDPVMparser.add_argument("--doTruthToRecoNtuple", help='output track-to-truth ntuple', action='store_true', default=False)
+    IDPVMparser.add_argument("--hardScatterStrategy", help='Strategy to select the hard scatter. 0 = SumPt² 1 = SumPt', choices=["0","1"], default="0")
+    IDPVMparser.add_argument("--outputFile", help='Name of output file',default="M_output.root")
+    IDPVMparser.add_argument("--HSFlag", help='Hard-scatter flag - decides what is used for truth matching', choices=['HardScatter', 'All', 'PileUp'],default="HardScatter")
+    IDPVMparser.add_argument("--ancestorIDList", help='List of ancestor truth IDs to match.', default = [], nargs='+', type=int)
+    return IDPVMparser.parse_args()
+
+# Parse the arguments 
+MyArgs = GetCustomAthArgs()
+
+from InDetPhysValMonitoring.InDetPhysValFlags import ConfigFlags 
+ConfigFlags.IDPVM.setTruthStrategy = MyArgs.HSFlag
+ConfigFlags.IDPVM.doExpertOutput   = MyArgs.doExpertPlots
+ConfigFlags.IDPVM.doPhysValOutput  = not MyArgs.doExpertPlots
+ConfigFlags.IDPVM.doValidateTruthToRecoNtuple = MyArgs.doTruthToRecoNtuple
+ConfigFlags.IDPVM.doValidateTracksInBJets = MyArgs.doTracksInBJets
+ConfigFlags.IDPVM.doValidateTracksInJets = MyArgs.doTracksInJets
+ConfigFlags.IDPVM.doValidateTightPrimaryTracks = MyArgs.doTightPrimary
+ConfigFlags.IDPVM.doTruthOriginPlots = MyArgs.doTruthOrigin
+ConfigFlags.IDPVM.doValidateMuonMatchedTracks = MyArgs.doMuonMatchedTracks
+ConfigFlags.IDPVM.doValidateElectronMatchedTracks = MyArgs.doElectronMatchedTracks
+ConfigFlags.IDPVM.doPerAuthorPlots = MyArgs.doPerAuthor
+ConfigFlags.IDPVM.doHitLevelPlots = MyArgs.doHitLevelPlots
+ConfigFlags.IDPVM.ancestorIDs = MyArgs.ancestorIDList
+ConfigFlags.IDPVM.hardScatterStrategy = int(MyArgs.hardScatterStrategy)
+
+ConfigFlags.Input.Files = [MyArgs.filesInput]
+
+from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+acc = MainServicesCfg(ConfigFlags)
+from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+acc.merge(PoolReadCfg(ConfigFlags))
+
+if ConfigFlags.Detector.GeometryITk:
+    #Temporary
+    ConfigFlags.TrackingGeometry.MaterialSource = 'Input'
+
+ConfigFlags.lock()
+
+from InDetPhysValMonitoring.InDetPhysValMonitoringConfig import InDetPhysValMonitoringCfg
+acc.merge(InDetPhysValMonitoringCfg(ConfigFlags))
+
+# finally, set up the infrastructure for writing our output
+from GaudiSvc.GaudiSvcConf import THistSvc
+histSvc = CompFactory.THistSvc()
+histSvc.Output += ["M_output DATAFILE='"+MyArgs.outputFile+"' OPT='RECREATE'"]
+acc.addService(histSvc)
+
+acc.printConfig(withDetails=True)
+
+# Execute and finish
+sc = acc.run(maxEvents=-1)
+ 
+# Success should be 0
+import sys
+sys.exit(not sc.isSuccess())
+
+
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml
index 2c3ae6d6c560..6d713d8f0273 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml
@@ -93,23 +93,6 @@
   <y title="# SCT Hits" n="&SCTHIT;" lo="0." hi="&SCTHIT;"/>
 </h>
 
-<h id="nTRTHits" type="TH1F" title="TRT Hits">
-  <x title="# TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-  <y title="Entries"/>
-</h>
-<h id="nTRTHits_vs_eta" type="TProfile" title="TRT Hits vs Eta">
-  <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
-  <y title="# TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-<h id="nTRTHits_vs_phi" type="TProfile" title="TRT Hits vs Phi">
-  <x title="#phi" n="80" lo="-3.2" hi="3.2"/>
-  <y title="# TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-<h id="nTRTHits_vs_mu" type="TProfile" title="TRT Hits vs Mu">
-  <x title="#mu" n="100" lo="-0.5" hi="99.5"/>
-  <y title="# TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-
 <h id="nPixelHoles" type="TH1F" title="Pixel Holes">
   <x title="# Pixel Holes" n="&PIXHIT;" lo="0." hi="&PIXHIT;"/>
   <y title="Entries"/>
@@ -154,23 +137,6 @@
   <y title="# SCT Holes" n="&SCTHIT;" lo="0." hi="&SCTHIT;"/>
 </h>
 
-<h id="nTRTHighThresholdHits" type="TH1F" title="High Threshold TRT Hits">
-  <x title="# High Tr TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-  <y title="Entries"/>
-</h>
-<h id="nTRTHighThresholdHits_vs_eta" type="TProfile" title="High Threshold TRT Hits vs Eta">
-  <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
-  <y title="# High Tr TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-<h id="nTRTHighThresholdHits_vs_phi" type="TProfile" title="High Threshold TRT Hits vs Phi">
-  <x title="#phi" n="80" lo="-3.2" hi="3.2"/>
-  <y title="# High Tr TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-<h id="nTRTHighThresholdHits_vs_mu" type="TProfile" title="High Threshold TRT Hits vs Mu">
-  <x title="#mu" n="100" lo="-0.5" hi="99.5"/>
-  <y title="# High Tr TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-
 <!--Detailed Hit Plots -->
 <h id="nInnerMostPixelOutliers" type="TH1F" title="InnerMost Pixel Outliers">
   <x title="# InnerMost Pixel Outliers" n="&PIXHIT;" lo="0." hi="&PIXHIT;"/>
@@ -425,40 +391,6 @@
   <y title="# SCT SharedHits" n="&SCTHIT;" lo="0." hi="&SCTHIT;"/>
 </h>
 
-<h id="nTRTOutliers" type="TH1F" title="TRT Outliers">
-  <x title="# TRT Outliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-  <y title="Entries"/>
-</h>
-<h id="nTRTOutliers_vs_eta" type="TProfile" title="TRT Outliers vs Eta">
-  <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
-  <y title="# TRT Outliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-<h id="nTRTOutliers_vs_phi" type="TProfile" title="TRT Outliers vs Phi">
-  <x title="#phi" n="80" lo="-3.2" hi="3.2"/>
-  <y title="# TRT Outliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-<h id="nTRTOutliers_vs_mu" type="TProfile" title="TRT Outliers vs Mu">
-  <x title="#mu" n="100" lo="-0.5" hi="99.5"/>
-  <y title="# TRT Outliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-
-<h id="nTRTHighThresholdOutliers" type="TH1F" title="TRT HighThresholdOutliers">
-  <x title="# TRT HighThresholdOutliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-  <y title="Entries"/>
-</h>
-<h id="nTRTHighThresholdOutliers_vs_eta" type="TProfile" title="TRT HighThresholdOutliers vs Eta">
-  <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
-  <y title="# TRT HighThresholdOutliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-<h id="nTRTHighThresholdOutliers_vs_phi" type="TProfile" title="TRT HighThresholdOutliers vs Phi">
-  <x title="#phi" n="80" lo="-3.2" hi="3.2"/>
-  <y title="# TRT HighThresholdOutliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-<h id="nTRTHighThresholdOutliers_vs_mu" type="TProfile" title="TRT HighThresholdOutliers vs Mu">
-  <x title="#mu" n="100" lo="-0.5" hi="99.5"/>
-  <y title="# TRT HighThresholdOutliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-
 <h id="nPixelDeadSensors" type="TH1F" title="Pixel DeadSensors">
   <x title="# Pixel DeadSensors" n="&PIXHIT;" lo="0." hi="&PIXHIT;"/>
   <y title="Entries"/>
@@ -1842,7 +1774,7 @@
   <y title="Number of Entries"/>
 </h>
 <h id="reco_z0" type="TH1F" title="reco_{z_{0}}">
-  <x title="reco_{z_{0}}" n="100" lo="-&Z0PARA;" hi="&Z0PARA;"/>
+  <x title="reco_{z_{0}} [mm]" n="100" lo="-&Z0PARA;" hi="&Z0PARA;"/>
   <y title="Number of Entries"/>
 </h>
 <h id="reco_qoverp" type="TH1F" title="reco_{q/p}">
@@ -1858,7 +1790,7 @@
   <y title="Number of Entries"/>
 </h>
 <h id="reco_eta" type="TH1F" title="reco_{#eta}">
-  <x title="reco_{#eta} [rads]" n="100" lo="-&ETA;" hi="&ETA;"/>
+  <x title="reco_{#eta}" n="100" lo="-&ETA;" hi="&ETA;"/>
   <y title="Number of Entries"/>
 </h>
 
@@ -1872,7 +1804,7 @@
 </h>
 
 <h id="reco_z0sin" type="TH1F" title="reco_{z_{0} #times sin}">
-  <x title="reco_{z_{0} #times sin}" n="100" lo="-&Z0SINPARA;" hi="&Z0SINPARA;"/>
+  <x title="reco_{z_{0} #times sin #theta} [mm]" n="100" lo="-&Z0SINPARA;" hi="&Z0SINPARA;"/>
   <y title="Number of Entries"/>
 </h>
 
@@ -1906,13 +1838,13 @@
 </h>
 
 <h id="reco_d0_vs_z0" type="TH2F" title="reco d_{T} vs z_{0}">
-  <x title="reco_{d_0}" n="100" lo="-20" hi="20"/>
-  <y title="reco_{z_{0}}" n="100" lo="-250" hi="250"/>
+  <x title="reco_{d_0} [mm]" n="100" lo="-20" hi="20"/>
+  <y title="reco_{z_{0}} [mm]" n="100" lo="-250" hi="250"/>
 </h>
 
 <h id="reco_d0_vs_z0sin" type="TH2F" title="reco d_{T} vs z_{0} sin #theta">
-  <x title="reco_{d_0}" n="100" lo="-20" hi="20"/>
-  <y title="reco_{z_{0} sin #theta}" n="100" lo="-10" hi="10"/>
+  <x title="reco_{d_0} [mm]" n="100" lo="-20" hi="20"/>
+  <y title="reco_{z_{0} sin #theta} [mm]" n="100" lo="-10" hi="10"/>
 </h>
 
 <h id="truth_d0" type="TH1F" title="truth_{d_{0}}">
@@ -1920,7 +1852,7 @@
   <y title="Number of Entries"/>
 </h>
 <h id="truth_z0" type="TH1F" title="truth_{z_{0}}">
-  <x title="truth_{z_{0}}" n="100" lo="-&Z0PARA;" hi="&Z0PARA;"/>
+  <x title="truth_{z_{0}} [mm]" n="100" lo="-&Z0PARA;" hi="&Z0PARA;"/>
   <y title="Number of Entries"/>
 </h>
 <h id="truth_qoverp" type="TH1F" title="truth_{q/p}">
@@ -1936,7 +1868,7 @@
   <y title="Number of Entries"/>
 </h>
 <h id="truth_eta" type="TH1F" title="truth_{#eta}">
-  <x title="truth_{#eta} [rads]" n="100" lo="-&ETA;" hi="&ETA;"/>
+  <x title="truth_{#eta}" n="100" lo="-&ETA;" hi="&ETA;"/>
   <y title="Number of Entries"/>
 </h>
 
@@ -1998,11 +1930,6 @@
   <y title="# SCT Hits" n="&SCTHIT;" lo="0." hi="&SCTHIT;"/>
 </h>
 
-<h id="nTRTHits_vs_dR" type="TProfile" title="TRT Hits vs #DeltaR">
-  <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
-  <y title="# TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-
 <h id="nPixelHoles_vs_dR" type="TProfile" title="Pixel Holes vs #DeltaR">
   <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
   <y title="# Pixel Holes" n="&PIXHIT;" lo="0." hi="&PIXHIT;"/>
@@ -2013,11 +1940,6 @@
   <y title="# SCT Holes" n="&SCTHIT;" lo="0." hi="&SCTHIT;"/>
 </h>
 
-<h id="nTRTHighThresholdHits_vs_dR" type="TProfile" title="High Threshold TRT Hits vs #DeltaR">
-  <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
-  <y title="# High Tr TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-
 <!--Detailed Hit Plots -->
 <h id="nInnerMostPixelOutliers_vs_dR" type="TProfile" title="InnerMost Pixel Outliers vs #DeltaR">
   <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
@@ -2089,16 +2011,6 @@
   <y title="# SCT SharedHits" n="&SCTHIT;" lo="0." hi="&SCTHIT;"/>
 </h>
 
-<h id="nTRTOutliers_vs_dR" type="TProfile" title="TRT Outliers vs #DeltaR">
-  <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
-  <y title="# TRT Outliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-
-<h id="nTRTHighThresholdOutliers_vs_dR" type="TProfile" title="TRT HighThresholdOutliers vs #DeltaR">
-  <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
-  <y title="# TRT HighThresholdOutliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
-</h>
-
 <h id="nPixelDeadSensors_vs_dR" type="TProfile" title="Pixel DeadSensors vs #DeltaR">
   <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
   <y title="# Pixel DeadSensors" n="&PIXHIT;" lo="0." hi="&PIXHIT;"/>
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefITK.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefITK.xml
index 1473e97c6d1f..146e83d52651 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefITK.xml
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefITK.xml
@@ -5,6 +5,7 @@
 <!ENTITY PI "3.1415926">
 <!-- eta coverage of the tracker -->
 <!ENTITY ETA "4.0">
+<!ENTITY NETA "100">
 <!-- min eta covered by pix. endcaps -->
 <!ENTITY ETAPixECMin "1.5">
 <!-- eta coverage of sct -->
@@ -13,6 +14,30 @@
 <!ENTITY ETASctECMin "1.0">
 <!-- term used for innermost pixel barrel layer in histogram text -->
 <!ENTITY L0PixBarr "Pix. Barr. layer0">
+<!-- bins for hits -->
+<!ENTITY PIXHIT "20">
+<!ENTITY SCTHIT "20">
+<!-- bins for resolutions -->
+<!ENTITY D0RES "2.00">
+<!ENTITY Z0RES "10.0">
+<!ENTITY PTQOPTRES "2.00">
+<!ENTITY THETARES "0.10">
+<!ENTITY PHIRES "0.010">
+<!ENTITY Z0SINRES "1.00">
+<!-- bins for parameters -->
+<!ENTITY D0PARA "20.0">
+<!ENTITY Z0PARA "250.0">
+<!ENTITY QOPPARA "5.0e-3">
+<!ENTITY Z0SINPARA "40.0">
+<!-- dR plots for tracks in jets -->
+<!ENTITY DRMAX "0.4">
+<!ENTITY SMALLDRMAX "0.1">
+<!-- Number of tracks vs MU -->
+<!ENTITY NmuBINS "26">
+<!ENTITY EXPMU "260">
+<!ENTITY EXPTRK "2000">
+<!ENTITY ETABINS2D "256">
+<!ENTITY PHIBINS2D "160">
 <!-- histogram definitions common to Run2 and ITk -->
 <!ENTITY Common SYSTEM "InDetPVMPlotDefCommon.xml">
 ]>
@@ -21,5 +46,316 @@
   <!-- Plots common to Run2 and ITK -->
   &Common;
   <!-- ITK-specific plots -->
-</hdef>
+  <!--
+      =======================================================
+      efficiency vs mu plots [InDetPerfPlot_Eff]:
+      =======================================================
+  -->
+  <h id="eff_vs_mu" type="TEfficiency" title="efficiency vs #mu (|#eta| &lt; 2.7)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Efficiency" lo="0.0" hi="1.2"/>
+  </h>
+  <h id="eff_vs_mu2" type="TEfficiency" title="efficiency vs #mu (2.7 &gt; |#eta| &lt; 3.5)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Efficiency" lo="0.0" hi="1.2"/>
+  </h>
+  <h id="eff_vs_mu3" type="TEfficiency" title="efficiency vs #mu (|#eta| &gt; 3.5)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Efficiency" lo="0.0" hi="1.2"/>
+  </h>
+  <h id="eff_vs_muTotal" type="TEfficiency" title="efficiency vs #mu">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Efficiency" lo="0.0" hi="1.2"/>
+  </h>
+  <!--
+      =======================================================
+      end of efficiency vs mu plots [InDetPerfPlot_Eff]
+      =======================================================
+  -->
+  <h id="mu" type="TH1F" title="#mu">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Entries"/>
+  </h>
+  <!--
+      =======================================================
+      differential inclusive track rates
+      (n_selected_reco_tracks/n_selected_truth_tracks):
+      =======================================================
+  -->
+  <!-- vs pt -->
+  <h id="nRecTrk_vs_eta_pt1" type="TH1F" title="# reco tracks vs #eta (p_{T} &gt; 1 GeV)">
+    <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nRecTrk_vs_eta_pt2" type="TH1F" title="# reco tracks vs #eta (p_{T} &gt; 2 GeV)">
+    <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+  <y title="Entries"/>
+  </h>
+  <h id="nRecTrk_vs_eta_pt5" type="TH1F" title="# reco tracks vs #eta (p_{T} &gt; 5 GeV)">
+    <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nTruthTrk_vs_eta_pt1" type="TH1F" title="# truth tracks vs #eta (p_{T} &gt; 1 GeV)">
+    <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nTruthTrk_vs_eta_pt2" type="TH1F" title="# truth tracks vs #eta (p_{T} &gt; 2 GeV)">
+    <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nTruthTrk_vs_eta_pt5" type="TH1F" title="# truth tracks vs #eta (p_{T} &gt; 5 GeV)">
+    <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="incTrkRate_vs_eta_pt1" type="TH1F" title="Inclusive track rate vs #eta (p_{T} &gt; 1 GeV)">
+    <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+    <y title="reco/truth"/>
+  </h>
+  <h id="incTrkRate_vs_eta_pt2" type="TH1F" title="Inclusive track rate vs #eta (p_{T} &gt; 2 GeV)">
+    <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+    <y title="reco/truth"/>
+  </h>
+  <h id="incTrkRate_vs_eta_pt5" type="TH1F" title="Inclusive track rate vs #eta (p_{T} &gt; 5 GeV)">
+    <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+    <y title="reco/truth"/>
+  </h>
+  <!-- vs mu -->
+  <h id="nRecTrk_vs_mu_etalt2p7" type="TH1F" title="# reco tracks vs #mu (|#eta| &lt; 2.7)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nRecTrk_vs_mu_etagt2p7_lt3p5" type="TH1F" title="# reco tracks vs #mu (2.7 &gt; |#eta| &lt; 3.5)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nRecTrk_vs_mu_etagt3p5" type="TH1F" title="# reco tracks vs #mu (|#eta| &gt; 3.5)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nRecTrk_vs_mu_etaTotal" type="TH1F" title="# reco tracks vs #mu">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nTruthTrk_vs_mu_etalt2p7" type="TH1F" title="# truth tracks vs #mu (|#eta| &lt; 2.7)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nTruthTrk_vs_mu_etagt2p7_lt3p5" type="TH1F" title="# truth tracks vs #mu (2.7 &gt; |#eta| &lt; 3.5)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nTruthTrk_vs_mu_etagt3p5" type="TH1F" title="# truth tracks vs #mu (|#eta| &gt; 3.5)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="nTruthTrk_vs_mu_etaTotal" type="TH1F" title="# truth tracks vs #mu">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="Entries"/>
+  </h>
+  <h id="incTrkRate_vs_mu_etalt2p7" type="TH1F" title="inclusive track rate vs #mu (|#eta| &lt; 2.7)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="reco/truth"/>
+  </h>
+  <h id="incTrkRate_vs_mu_etagt2p7_lt3p5" type="TH1F" title="inclusive track rate vs #mu (2.7 &gt; |#eta| &lt; 3.5)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="reco/truth"/>
+  </h>
+  <h id="incTrkRate_vs_mu_etagt3p5" type="TH1F" title="inclusive track rate vs #mu (|#eta| &gt; 3.5)">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="reco/truth"/>
+  </h>
+  <h id="incTrkRate_vs_mu_etaTotal" type="TH1F" title="inclusive track rate vs #mu">
+    <x title="#mu" n="&NmuBINS;" lo="0.0" hi="&EXPMU;"/>
+    <y title="reco/truth"/>
+  </h>
+  <!--
+      =======================================================
+      end differential inclusive track rates
+      =======================================================
+  -->
+
+  <!--
+   =======================================================
+   hit efficiency plots:
+   * filled by InDetPerfPlot_hitEff
+   * currently these plots will only get filled for ESD.
+   Reason:contents are created by InDetPhysHitDecoratorTool
+   and require unlsimmed Trk::Track collection.
+   ========================================================
+  -->
+
+  <!--Splitting all layers-->
+
+<h id="eff_hit_vs_eta_pix_barrel_layer0" type="TEfficiency" title="Cluster Efficiency: Pixel Barrel - Layer 0">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_pix_endcap_layer0" type="TEfficiency" title="Cluster Efficiency: Pixel Endcaps - Layer 0">
+  <x title="#eta" n="20" lo="&ETAPixECMin;" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+
+<h id="eff_hit_vs_eta_pix_innermost" type="TEfficiency" title="Cluster Efficiency: Pixel Innermost Layer">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_pix_nextToInnermost" type="TEfficiency" title="Cluster Efficiency: Pixel Next-To-Innermost Layer">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_pix_others" type="TEfficiency" title="Cluster Efficiency: Pixel All Other Layers">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+
+<h id="eff_hit_vs_eta_pix_barrel_layer1" type="TEfficiency" title="Cluster Efficiency: Pixel Barrel - Layer 1">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_pix_endcap_layer1" type="TEfficiency" title="Cluster Efficiency: Pixel Endcaps - Layer 1">
+  <x title="#eta" n="20" lo="&ETAPixECMin;" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+
+<h id="eff_hit_vs_eta_pix_barrel_layer2" type="TEfficiency" title="Cluster Efficiency: Pixel Barrel - Layer 2">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_pix_endcap_layer2" type="TEfficiency" title="Cluster Efficiency: Pixel Endcaps - Layer 2">
+  <x title="#eta" n="20" lo="&ETAPixECMin;" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+
+<h id="eff_hit_vs_eta_pix_barrel_layer3" type="TEfficiency" title="Cluster Efficiency: Pixel Barrel - Layer 3">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_pix_endcap_layer3" type="TEfficiency" title="Cluster Efficiency: Pixel Endcaps - Layer 3">
+  <x title="#eta" n="20" lo="&ETAPixECMin;" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+
+<h id="eff_hit_vs_eta_pix_barrel_layer4" type="TEfficiency" title="Cluster Efficiency: Pixel Barrel - Layer 4">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_pix_endcap_layer4" type="TEfficiency" title="Cluster Efficiency: Pixel Endcaps - Layer 4">
+  <x title="#eta" n="20" lo="&ETAPixECMin;" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
 
+<h id="eff_hit_vs_eta_sct_barrel_layer0" type="TEfficiency" title="Cluster Efficiency: SCT Barrel - Layer 0">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_sct_endcap_layer0" type="TEfficiency" title="Cluster Efficiency: SCT Endcaps - Layer 0">
+  <x title="#eta" n="20" lo="&ETASctECMin;" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+
+<h id="eff_hit_vs_eta_sct_barrel_layer1" type="TEfficiency" title="Cluster Efficiency: SCT Barrel - Layer 1">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_sct_endcap_layer1" type="TEfficiency" title="Cluster Efficiency: SCT Endcaps - Layer 1">
+  <x title="#eta" n="20" lo="&ETASctECMin;" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+
+<h id="eff_hit_vs_eta_sct_barrel_layer2" type="TEfficiency" title="Cluster Efficiency: SCT Barrel - Layer 2">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_sct_endcap_layer2" type="TEfficiency" title="Cluster Efficiency: SCT Endcaps - Layer 2">
+  <x title="#eta" n="20" lo="&ETASctECMin;" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+
+<h id="eff_hit_vs_eta_sct_barrel_layer3" type="TEfficiency" title="Cluster Efficiency: SCT Barrel - Layer 3">
+  <x title="#eta" n="20" lo="0" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+<h id="eff_hit_vs_eta_sct_endcap_layer3" type="TEfficiency" title="Cluster Efficiency: SCT Endcaps - Layer 3">
+  <x title="#eta" n="20" lo="&ETASctECMin;" hi="&ETA;"/>
+  <y title="Cluster Efficiency" lo="0" hi="2.0"/>
+</h>
+
+<!--
+   =======================================================
+   end of hit efficiency plots
+   ======================================================
+-->
+
+<!--
+   =======================================================
+   hit residuals & cluster width plots:
+   * filled by InDetPerfPlot_hitResidual
+   * currently these plots will only get filled for ESD.
+   Not filled in xAOD/DxAOD.
+   Reason:contents are created by InDetPhysHitDecoratorTool
+   and require unlsimmed Trk::Track collection.
+   ========================================================
+  -->
+<!-- hitResidual plots -->
+<!-- innermost, next-to-innetmost, others -->
+<!-- x residuals -->
+<h id="residualx_pixel" type="TH1F" title="Residual: Pixel X">
+  <x title="x residual(#mum)" n="1000" lo="-500" hi="500"/>
+  <y title="Entries"/>
+</h>
+<h id="residualx_pixel_1hit" type="TH1F" title="Residual: Pixel X 1 hit">
+  <x title="x residual(#mum)" n="1000" lo="-500" hi="500"/>
+  <y title="Entries"/>
+</h>
+<h id="residualx_pixel_2ormorehits" type="TH1F" title="Residual: Pixel X &gt;=2 hits">
+  <x title="x residual(#mum)" n="1000" lo="-500" hi="500"/>
+  <y title="Entries"/>
+</h>
+<!-- y residuals -->
+<h id="residualy_pixel" type="TH1F" title="Residual: Pixel Y">
+  <x title="y residual(#mum)" n="1000" lo="-500" hi="500"/>
+  <y title="Entries"/>
+</h>
+<h id="residualy_pixel_1hit" type="TH1F" title="Residual: Pixel Y 1 hit">
+  <x title="y residual(#mum)" n="1000" lo="-500" hi="500"/>
+  <y title="Entries"/>
+</h>
+<h id="residualy_pixel_2ormorehits" type="TH1F" title="Residual: Pixel Y &gt;=2 hits">
+  <x title="x residual(#mum)" n="1000" lo="-500" hi="500"/>
+  <y title="Entries"/>
+</h>
+<!-- pulls -->
+<h id="residualpullx_pixel" type="TH1F" title="Residualpull: Pixel X">
+  <x title="x residual(#mum)" n="100" lo="-5" hi="5"/>
+  <y title="Entries"/>
+</h>
+<h id="residualpully_pixel" type="TH1F" title="Residualpull: Pixel Y">
+  <x title="y residual(#mum)" n="100" lo="-5" hi="5"/>
+  <y title="Entries"/>
+</h>
+<!-- cluster width plots -->
+<h id="clusterPhiWidth_pixel" type="TH1F" title="Cluster width in phi: Pixel">
+  <x title="Pixels" n="10" lo="0" hi="10"/>
+  <y title="Entries"/>
+</h>
+<h id="clusterEtaWidth_pixel" type="TH1F" title="Cluster width in eta: Pixel">
+  <x title="Pixels" n="20" lo="0" hi="20"/>
+  <y title="Entries"/>
+</h>
+<!-- cluster width vs eta plots -->
+<h id="clusterPhiWidth_eta_pixel" type="TProfile" title="Cluster width in phi vs eta: Pixel">
+  <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+  <y title="Cluster width in phi"/>
+</h>
+<h id="clusterEtaWidth_eta_pixel" type="TProfile" title="Cluster width in eta vs eta: Pixel">
+  <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+  <y title="Cluster width in eta"/>
+</h>
+
+<!--
+=======================================================
+end of hit residuals & cluster width plots
+=======================================================
+  -->
+
+</hdef>
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefRun2.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefRun2.xml
index 022ca477d946..7f6c5f5294db 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefRun2.xml
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefRun2.xml
@@ -180,6 +180,86 @@
    ========================================================
   -->
 
+<!--
+   ========================================================
+   Hits plots in InDetPerf_Hits
+   ========================================================
+ -->
+
+<h id="nTRTHits" type="TH1F" title="TRT Hits">
+  <x title="# TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+  <y title="Entries"/>
+</h>
+<h id="nTRTHits_vs_eta" type="TProfile" title="TRT Hits vs Eta">
+  <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+  <y title="# TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+<h id="nTRTHits_vs_phi" type="TProfile" title="TRT Hits vs Phi">
+  <x title="#phi" n="80" lo="-3.2" hi="3.2"/>
+  <y title="# TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+<h id="nTRTHits_vs_mu" type="TProfile" title="TRT Hits vs Mu">
+  <x title="#mu" n="100" lo="-0.5" hi="99.5"/>
+  <y title="# TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+
+<h id="nTRTHighThresholdHits" type="TH1F" title="High Threshold TRT Hits">
+  <x title="# High Tr TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+  <y title="Entries"/>
+</h>
+<h id="nTRTHighThresholdHits_vs_eta" type="TProfile" title="High Threshold TRT Hits vs Eta">
+  <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+  <y title="# High Tr TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+<h id="nTRTHighThresholdHits_vs_phi" type="TProfile" title="High Threshold TRT Hits vs Phi">
+  <x title="#phi" n="80" lo="-3.2" hi="3.2"/>
+  <y title="# High Tr TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+<h id="nTRTHighThresholdHits_vs_mu" type="TProfile" title="High Threshold TRT Hits vs Mu">
+  <x title="#mu" n="100" lo="-0.5" hi="99.5"/>
+  <y title="# High Tr TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+
+<h id="nTRTOutliers" type="TH1F" title="TRT Outliers">
+  <x title="# TRT Outliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+  <y title="Entries"/>
+</h>
+<h id="nTRTOutliers_vs_eta" type="TProfile" title="TRT Outliers vs Eta">
+  <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+  <y title="# TRT Outliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+<h id="nTRTOutliers_vs_phi" type="TProfile" title="TRT Outliers vs Phi">
+  <x title="#phi" n="80" lo="-3.2" hi="3.2"/>
+  <y title="# TRT Outliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+<h id="nTRTOutliers_vs_mu" type="TProfile" title="TRT Outliers vs Mu">
+  <x title="#mu" n="100" lo="-0.5" hi="99.5"/>
+  <y title="# TRT Outliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+
+<h id="nTRTHighThresholdOutliers" type="TH1F" title="TRT HighThresholdOutliers">
+  <x title="# TRT HighThresholdOutliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+  <y title="Entries"/>
+</h>
+<h id="nTRTHighThresholdOutliers_vs_eta" type="TProfile" title="TRT HighThresholdOutliers vs Eta">
+  <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/>
+  <y title="# TRT HighThresholdOutliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+<h id="nTRTHighThresholdOutliers_vs_phi" type="TProfile" title="TRT HighThresholdOutliers vs Phi">
+  <x title="#phi" n="80" lo="-3.2" hi="3.2"/>
+  <y title="# TRT HighThresholdOutliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+<h id="nTRTHighThresholdOutliers_vs_mu" type="TProfile" title="TRT HighThresholdOutliers vs Mu">
+  <x title="#mu" n="100" lo="-0.5" hi="99.5"/>
+  <y title="# TRT HighThresholdOutliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+
+<!--
+   =======================================================
+   end of hit plots
+   ======================================================
+ -->
+
 <!--
    =======================================================
    TRT Extension plots
@@ -481,7 +561,32 @@
    ========================================================
   -->
 
+<!--
+   =======================================================
+   hit plots for tracks in jets
+   ======================================================
+
+     -->
+
+<h id="nTRTHits_vs_dR" type="TProfile" title="TRT Hits vs #DeltaR">
+  <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
+  <y title="# TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
 
+<h id="nTRTHighThresholdHits_vs_dR" type="TProfile" title="High Threshold TRT Hits vs #DeltaR">
+  <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
+  <y title="# High Tr TRT Hits" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+
+<h id="nTRTOutliers_vs_dR" type="TProfile" title="TRT Outliers vs #DeltaR">
+  <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
+  <y title="# TRT Outliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
+
+<h id="nTRTHighThresholdOutliers_vs_dR" type="TProfile" title="TRT HighThresholdOutliers vs #DeltaR">
+  <x title="#DeltaR(jet,track)" n="80" lo="0.0" hi="&DRMAX;"/>
+  <y title="# TRT HighThresholdOutliers" n="&TRTHIT;" lo="0." hi="&TRTHIT;"/>
+</h>
 
 
 </hdef>
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoring_topOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoring_topOptions.py
index 89dac6922acc..dbb6a0d0d370 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoring_topOptions.py
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoring_topOptions.py
@@ -1,4 +1,10 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+print("*********************************************************************************************************************************")
+print("WARNING - You're running a recently deprecated IDPVM jobOptions: you're kindly invited to switch to the new runIDPVM.py executable")
+print("WARNING - The IDPVM jobOptions you're currently running will soon be removed from the release")
+print("*********************************************************************************************************************************")
+
 
 # Define a few configuration arguments that can be passed by the user via the command line.
 # Avoid the need of hacking the job option file 
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx
index fe57241a2c9b..5ccba269f47d 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx
@@ -145,7 +145,7 @@ InDetPhysValMonitoringTool::initialize() {
 
   ATH_CHECK( m_trkParticleName.initialize() );
   ATH_CHECK( m_truthParticleName.initialize( (m_pileupSwitch == "HardScatter" or m_pileupSwitch == "All") and not m_truthParticleName.key().empty() ) );
-  ATH_CHECK( m_vertexContainerName.initialize() );
+  ATH_CHECK( m_vertexContainerName.initialize( not m_vertexContainerName.empty() ) );
   ATH_CHECK( m_truthVertexContainerName.initialize( not m_truthVertexContainerName.key().empty() ) );
   ATH_CHECK( m_eventInfoContainerName.initialize() );
 
@@ -202,6 +202,8 @@ InDetRttPlotConfig InDetPhysValMonitoringTool::getFilledPlotConfig() const{
   rttConfig.doEfficienciesPerAuthor = m_doPerAuthorPlots;
   rttConfig.doResolutionsPerAuthor = m_doPerAuthorPlots;
 
+  rttConfig.doTrtExtensionPlots = m_doTRTExtensionPlots;
+
   /// turn off truth if none is present
   if (m_truthParticleName.key().empty()){
     rttConfig.doFakePlots = false; 
@@ -306,46 +308,52 @@ InDetPhysValMonitoringTool::fillHistograms() {
     ATH_MSG_WARNING("Shouldn't happen - EventInfo is buggy, setting mu to 0");
   }
 
-  ATH_MSG_DEBUG("Getting number of pu interactings per event");
-
-  ATH_MSG_DEBUG("Filling vertex plots");
-  SG::ReadHandle<xAOD::VertexContainer>  vertices(m_vertexContainerName);
   const xAOD::Vertex* primaryvertex = nullptr;
-  const float puEvents = !m_truthPileUpEventName.key().empty() and truthPileupEventContainer.isValid() ?  static_cast<int>( truthPileupEventContainer->size() ) : pie.isValid() ? pie->actualInteractionsPerCrossing() : 0;
-  const float nVertices = not vertices->empty() ? vertices->size() : 0;
-  const float beamSpotWeight = pie->beamSpotWeight();
-  ATH_MSG_DEBUG("beamSpotWeight is equal to " <<  beamSpotWeight);
-
-  if (vertices.isValid() and not vertices->empty()) {
-    ATH_MSG_DEBUG("Number of vertices retrieved for this event " << vertices->size());
-    //Find the HS vertex following the user-configured strategy
-    primaryvertex = m_hardScatterSelectionTool->getHardScatter(vertices.get()); 
-    if (!primaryvertex){
-      /// In case of no HS, print a debug message - no warning since this is expected
-      /// in single particle MC. The downstream code is able to handle the absence of a HS vertex. 
-      ATH_MSG_DEBUG("Failed to find a hard scatter vertex in this event.");
-    }
-    //Filling plots for all reconstructed vertices and the hard-scatter
-    ATH_MSG_DEBUG("Filling vertices info monitoring plots");
-
-    // Fill vectors of truth HS and PU vertices
-    std::pair<std::vector<const xAOD::TruthVertex*>, std::vector<const xAOD::TruthVertex*>> truthVertices = getTruthVertices();
-    std::vector<const xAOD::TruthVertex*> truthHSVertices = truthVertices.first;
-    std::vector<const xAOD::TruthVertex*> truthPUVertices = truthVertices.second;
-
-    // Decorate vertices
-    if (m_useVertexTruthMatchTool && m_vtxValidTool) {
-       ATH_CHECK(m_vtxValidTool->matchVertices(*vertices));
-       ATH_MSG_DEBUG("Hard scatter classification type: " << InDetVertexTruthMatchUtils::classifyHardScatter(*vertices) << ", vertex container size = " << vertices->size());
-    }
-    m_monPlots->fill(*vertices, primaryvertex, truthHSVertices, truthPUVertices, beamSpotWeight);
+  float puEvents = 0;
+  float nVertices = 0;
+  float beamSpotWeight = 1;
+
+  if(not m_vertexContainerName.key().empty()){
+    ATH_MSG_DEBUG("Getting number of pu interactings per event");
+
+    ATH_MSG_DEBUG("Filling vertex plots");
+    SG::ReadHandle<xAOD::VertexContainer>  vertices(m_vertexContainerName);
+    puEvents = !m_truthPileUpEventName.key().empty() and truthPileupEventContainer.isValid() ?  static_cast<int>( truthPileupEventContainer->size() ) : pie.isValid() ? pie->actualInteractionsPerCrossing() : 0;
+    nVertices = not vertices->empty() ? vertices->size() : 0;
+    beamSpotWeight = pie->beamSpotWeight();
+    ATH_MSG_DEBUG("beamSpotWeight is equal to " <<  beamSpotWeight);
+
+    if (vertices.isValid() and not vertices->empty()) {
+      ATH_MSG_DEBUG("Number of vertices retrieved for this event " << vertices->size());
+      //Find the HS vertex following the user-configured strategy
+      primaryvertex = m_hardScatterSelectionTool->getHardScatter(vertices.get());
+      if (!primaryvertex){
+	/// In case of no HS, print a debug message - no warning since this is expected
+	/// in single particle MC. The downstream code is able to handle the absence of a HS vertex.
+	ATH_MSG_DEBUG("Failed to find a hard scatter vertex in this event.");
+      }
+      //Filling plots for all reconstructed vertices and the hard-scatter
+      ATH_MSG_DEBUG("Filling vertices info monitoring plots");
+
+      // Fill vectors of truth HS and PU vertices
+      std::pair<std::vector<const xAOD::TruthVertex*>, std::vector<const xAOD::TruthVertex*>> truthVertices = getTruthVertices();
+      std::vector<const xAOD::TruthVertex*> truthHSVertices = truthVertices.first;
+      std::vector<const xAOD::TruthVertex*> truthPUVertices = truthVertices.second;
+
+      // Decorate vertices
+      if (m_useVertexTruthMatchTool && m_vtxValidTool) {
+	ATH_CHECK(m_vtxValidTool->matchVertices(*vertices));
+	ATH_MSG_DEBUG("Hard scatter classification type: " << InDetVertexTruthMatchUtils::classifyHardScatter(*vertices) << ", vertex container size = " << vertices->size());
+      }
+      m_monPlots->fill(*vertices, primaryvertex, truthHSVertices, truthPUVertices, beamSpotWeight);
 
-    ATH_MSG_DEBUG("Filling vertex/event info monitoring plots");
-    //Filling vertexing plots for the reconstructed hard-scatter as a function of mu
-    m_monPlots->fill(*vertices, puEvents, beamSpotWeight);
-  } else {
-    //FIXME: Does this happen for single particles?
-    ATH_MSG_WARNING("Skipping vertexing plots.");
+      ATH_MSG_DEBUG("Filling vertex/event info monitoring plots");
+      //Filling vertexing plots for the reconstructed hard-scatter as a function of mu
+      m_monPlots->fill(*vertices, puEvents, beamSpotWeight);
+    } else {
+      //FIXME: Does this happen for single particles?
+      ATH_MSG_WARNING("Skipping vertexing plots.");
+    }
   }
 
 
@@ -394,6 +402,7 @@ InDetPhysValMonitoringTool::fillHistograms() {
     selectedTracks.push_back(thisTrack);
     //Number of selected reco tracks
     nSelectedRecoTracks++;
+
     //Fill plots for selected reco tracks, hits / perigee / ???
     std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo>  patternInfo = thisTrack->patternRecoInfo();
     bool isBAT = patternInfo.test(xAOD::TrackPatternRecoInfo::TRTSeededTrackFinder);
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx
index c386f97a96be..52fd96e3a2a4 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx
@@ -112,11 +112,11 @@ InDetRttPlots::fill(const xAOD::TrackParticle& particle, const xAOD::TruthPartic
     if(m_config.doResolutionsPerAuthor &&  m_iDetailLevel >= 200 and (barcode < 200000 and barcode != 0 and prob > 0.5)){
       std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo>  patternInfo = particle.patternRecoInfo();
       
-      bool isSiSpSeededFinder = patternInfo.test(0);
-      bool isInDetExtensionProcessor = patternInfo.test(3);
-      bool isTRTSeededTrackFinder = patternInfo.test(4);
-      bool isTRTStandalone = patternInfo.test(20);
-      bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(49);
+      bool isSiSpSeededFinder = patternInfo.test(xAOD::TrackPatternRecoInfo::SiSPSeededFinder);
+      bool isInDetExtensionProcessor = patternInfo.test(xAOD::TrackPatternRecoInfo::InDetExtensionProcessor);
+      bool isTRTSeededTrackFinder = patternInfo.test(xAOD::TrackPatternRecoInfo::TRTSeededTrackFinder);
+      bool isTRTStandalone = patternInfo.test(xAOD::TrackPatternRecoInfo::TRTStandalone);
+      bool isSiSpacePointsSeedMaker_LargeD0 = patternInfo.test(xAOD::TrackPatternRecoInfo::SiSpacePointsSeedMaker_LargeD0);
 
       if(isSiSpSeededFinder and not isInDetExtensionProcessor) m_resSiSPSeededFinderPlots->fill(particle, truthParticle, weight);
       if(isInDetExtensionProcessor and not (isTRTSeededTrackFinder or isSiSpacePointsSeedMaker_LargeD0)) m_resInDetExtensionProcessorPlots->fill(particle, truthParticle, weight);
-- 
GitLab


From a32ca0bb0fce37aa95cc5b1aec613c3b93556e7b Mon Sep 17 00:00:00 2001
From: Noemi Calace <noemi.calace@cern.ch>
Date: Fri, 10 Sep 2021 10:44:55 +0200
Subject: [PATCH 061/347] Implementing tracking geometry for ITk

---
 .../SCT_OverlapDescriptor.h                   |   4 +-
 .../InDetTrackingGeometry/SiLayerBuilder.h    |  10 +-
 .../StagedTrackingGeometryBuilder.h           |  29 ++
 .../src/PixelOverlapDescriptor.cxx            |   8 +-
 .../src/SCT_OverlapDescriptor.cxx             |  66 +++-
 .../src/SiLayerBuilder.cxx                    | 371 +++++++++++++++++-
 .../src/StagedTrackingGeometryBuilder.cxx     | 317 ++++++++++++---
 .../python/AtlasTrackingGeometrySvcConfig.py  | 179 ++++++++-
 .../TrkDetDescrInterfaces/IGeometryBuilder.h  |  21 +-
 .../share/TrkExUnitTestITkConfig.py           | 147 +++++++
 10 files changed, 1049 insertions(+), 103 deletions(-)
 create mode 100644 Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestITkConfig.py

diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SCT_OverlapDescriptor.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SCT_OverlapDescriptor.h
index af32b8ccf2bc..c9cd74465d08 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SCT_OverlapDescriptor.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SCT_OverlapDescriptor.h
@@ -74,7 +74,7 @@ namespace InDet {
        public:
 
          /** Constructor */
-         SCT_OverlapDescriptor();
+         SCT_OverlapDescriptor(bool addMoreSurfaces = false, int eta_slices = 3);
          
          /** Destructor */
          virtual ~SCT_OverlapDescriptor() = default;
@@ -91,6 +91,8 @@ namespace InDet {
         private:
           bool dumpSurfaces(std::vector<Trk::SurfaceIntersection>& surfaces) const;
           bool                                 m_robustMode;
+          bool                                 m_addMoreSurfaces;
+          int                                  m_etaSlices;         
           mutable std::atomic<const SCT_ID*>   m_sctIdHelper{nullptr};
     };
 
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h
index 346544a8ce6d..7d15b770b9ae 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilder.h
@@ -95,7 +95,8 @@ namespace InDet {
       std::vector< const Trk::CylinderLayer* >* dressCylinderLayers(const std::vector< const Trk::CylinderLayer* >& dLayers) const;
       
       /** create the disc layers, if no vector is given, then it's the first pass, else it's the DBM for the Pixels */
-      std::vector< const Trk::DiscLayer* >* createDiscLayers(std::vector<const Trk::DiscLayer* >* dLayers = NULL) const;
+      std::vector< const Trk::DiscLayer* >* createDiscLayers(std::vector<const Trk::DiscLayer* >* dLayers = NULL) const;      
+      std::vector< const Trk::DiscLayer* >* createRingLayers() const;
         
       const Trk::LayerMaterialProperties* barrelLayerMaterial(double r, double hz) const;  //!< helper method to construct barrel material
       const Trk::LayerMaterialProperties* endcapLayerMaterial(double rMin, double rMax) const; //!< helper method to construct endcap material
@@ -137,7 +138,12 @@ namespace InDet {
       static std::vector<const Trk::DiscLayer*>      s_splitDiscLayers;                 //!< cached SLHC/split disc layers for projective layout
                                                      
       bool                                           m_runGeometryValidation;           //!< run the validation of the geometry ( no empty bins)
-            
+      
+      std::vector<int>                               m_layerIndicesBarrel;
+      std::vector<int>                               m_layerIndicesEndcap;
+      bool                                           m_useRingLayout;   
+      
+      bool                                           m_addMoreSurfaces   ;              //!< to add additional surfaces to the SCT_OverlapDescriptor (used for ITk specific case)
                       
   };
 
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
index 11ba120faf49..56ec490d3e38 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilder.h
@@ -210,6 +210,12 @@ namespace InDet {
 
       /** helper method needed for the Ring layout */
       void checkForInsert(std::vector<double>& radii, double radius) const;
+      
+      void checkForInsert(double rmin, double rmax, std::vector<std::pair<double, double>>& radii) const;
+
+      /** Private helper method for merging of rings with z-overlap */
+      std::vector<const Trk::Layer*> checkZoverlap(std::vector<const Trk::Layer*>& lays) const; 
+      const Trk::Layer* mergeDiscLayers(std::vector<const Trk::Layer*>& dlays) const;
 
       // helper tools for the geometry building
       ToolHandleArray<Trk::ILayerProvider>           m_layerProviders;          //!< Helper Tools for the Layer creation, includes beam pipe builder   
@@ -260,7 +266,30 @@ namespace InDet {
       std::sort(radii.begin(),radii.end());   
   }
 
+  inline void StagedTrackingGeometryBuilder::checkForInsert(double rmin, double rmax, std::vector<std::pair<double, double>>& radii) const {
 
+    // range into non-overlapping layers
+
+    if (!radii.size()) radii.push_back(std::pair<double,double>(rmin,rmax));
+    
+    unsigned int ir=0;
+    while ( ir != radii.size() && rmin > radii[ir].second ) ir++;
+
+    if (ir==radii.size()) radii.push_back(std::pair<double,double>(rmin,rmax));
+    // insert ?
+    else if (rmax<radii[ir].first) radii.insert(radii.begin()+ir,std::pair<double,double>(rmin,rmax));
+    // overlaps
+    else {
+      // resolve low edge
+      if (rmin<radii[ir].first) radii[ir].first=rmin;
+      // resolve upper edge
+      unsigned int imerge = ir;
+      while (imerge<radii.size()-1 && rmax>radii[imerge+1].first) imerge++;
+      radii[ir].second = rmax > radii[imerge].second ? rmax : radii[imerge].second;
+      if (imerge>ir) radii.erase(radii.begin()+ir+1,radii.begin()+imerge);       
+    }
+  }
+  
 } // end of namespace
 
 #endif //INDETTRACKINGGEOMETRY_STAGEDTRACKINGGEOMETRYBUILDER_H
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/PixelOverlapDescriptor.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/PixelOverlapDescriptor.cxx
index e614a33efff9..f90a666114e6 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/PixelOverlapDescriptor.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/PixelOverlapDescriptor.cxx
@@ -42,14 +42,13 @@ InDet::PixelOverlapDescriptor::reachableSurfaces(
     tmp->detectorType() == Trk::DetectorElemType::Silicon
       ? static_cast<const InDetDD::SiDetectorElement*>(tmp)
       : nullptr;
-  // now get the overlap options
   if (sElement) {
     size_t newCapacity = cSurfaces.size();
-    if (m_robustMode) {
-      newCapacity += 8;
-    } else if (m_addMoreSurfaces and sElement->isBarrel()) {
+    if (m_robustMode and m_addMoreSurfaces and sElement->isBarrel()) {
       // sum up the defined slices to evaluate the new capacity
       newCapacity += (2*m_phiSlices+ 2*(m_etaSlices*(2*m_phiSlices+1)));
+    } else if (m_robustMode) {
+      newCapacity += 8;
     } else {
       newCapacity += 1;
       if (sElement->isBarrel()) {
@@ -58,6 +57,7 @@ InDet::PixelOverlapDescriptor::reachableSurfaces(
     }
     cSurfaces.reserve(newCapacity);
 
+    // now get the overlap options
     //!< position phi and surface phi - rescale to 0 -> 2PI
     double surfacePhi = tsf.center().phi() + M_PI;
     double positionPhi = pos.phi() + M_PI;
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SCT_OverlapDescriptor.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SCT_OverlapDescriptor.cxx
index 2155f4808f3b..f708e6b20f2b 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SCT_OverlapDescriptor.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SCT_OverlapDescriptor.cxx
@@ -18,8 +18,10 @@
 #include "StoreGate/StoreGateSvc.h"
 #include "InDetIdentifier/SCT_ID.h"
 
-InDet::SCT_OverlapDescriptor::SCT_OverlapDescriptor()
-  : m_robustMode(true)
+InDet::SCT_OverlapDescriptor::SCT_OverlapDescriptor(bool addMoreSurfaces, int eta_slices)
+  : m_robustMode(true),
+  m_addMoreSurfaces(addMoreSurfaces), 
+  m_etaSlices(eta_slices)
 {}
 
 /** get the compatible surfaces */
@@ -31,14 +33,6 @@ InDet::SCT_OverlapDescriptor::reachableSurfaces(
   const Amg::Vector3D&) const
 
 {
-  size_t newCapacity = cSurfaces.size() + 2;
-  if (m_robustMode) {
-    newCapacity += 16;
-  } else {
-    newCapacity += 6;
-  }
-  cSurfaces.reserve(newCapacity);
-
   // first add the target surface and the backside surface (in the if statement)
   cSurfaces.emplace_back(Trk::Intersection(pos, 0., true), &tsf);
 
@@ -48,13 +42,26 @@ InDet::SCT_OverlapDescriptor::reachableSurfaces(
     tmp->detectorType() == Trk::DetectorElemType::Silicon
       ? static_cast<const InDetDD::SiDetectorElement*>(tmp)
       : nullptr;
- 
-  //!< position phi and surface phi - rescale to 0 -> 2PI
-  double surfacePhi = tsf.center().phi() + M_PI;
-  double positionPhi = pos.phi() + M_PI;
-
-  // now get the overlap options
+      
   if (sElement) {
+    
+    size_t newCapacity = cSurfaces.size() + 2;
+    if (m_robustMode and m_addMoreSurfaces and sElement->isBarrel()) {
+      // sum up the defined slices to evaluate the new capacity
+      // only uses one additional slice in phi
+      newCapacity += (2 + 6*m_etaSlices)*2;
+    } else if (m_robustMode) {
+      newCapacity += 16;
+    } else {
+      newCapacity += 6;
+    }
+    cSurfaces.reserve(newCapacity);
+    
+    //!< position phi and surface phi - rescale to 0 -> 2PI
+    double surfacePhi = tsf.center().phi() + M_PI;
+    double positionPhi = pos.phi() + M_PI;
+
+    // now get the overlap options
     addOtherSide(sElement, cSurfaces);
 
     // 8-cell-connectivity depending on track/surface geometry
@@ -76,6 +83,33 @@ InDet::SCT_OverlapDescriptor::reachableSurfaces(
       nElement = sElement->prevInPhi();
       addNextInEtaOS(nElement, cSurfaces);
       addPrevInEtaOS(nElement, cSurfaces);
+      
+      if (m_addMoreSurfaces and sElement->isBarrel()) {  
+        unsigned int next = 1;
+        const InDetDD::SiDetectorElement* currentElement = sElement->nextInEta();
+        while (currentElement and next<(unsigned int)m_etaSlices) {
+          addNextInEtaOS(currentElement,cSurfaces);
+          currentElement = currentElement->nextInEta();
+          if (currentElement) {
+            addNextInPhiOS(currentElement,cSurfaces);
+            addPrevInPhiOS(currentElement,cSurfaces);
+          }
+          next++;
+        }
+        
+        unsigned int prev = 1;
+        currentElement = sElement->prevInEta();
+        while (currentElement and prev<(unsigned int)m_etaSlices) {
+          addPrevInEtaOS(currentElement,cSurfaces);
+          currentElement = currentElement->prevInEta();
+          if (currentElement) {
+            addNextInPhiOS(currentElement,cSurfaces);
+            addPrevInPhiOS(currentElement,cSurfaces);
+          }
+          prev++;
+        }
+      }      
+      
     } else {
       // get the phi information
       if (surfacePhi < positionPhi) {
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx
index d5398de1c95e..03a646e38161 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilder.cxx
@@ -69,7 +69,9 @@ InDet::SiLayerBuilder::SiLayerBuilder(const std::string& t, const std::string& n
   m_identification("Pixel"),
   m_splitMode(0),
   m_splitTolerance(10.),   
-  m_runGeometryValidation(true)
+  m_runGeometryValidation(true),
+  m_useRingLayout(false),
+  m_addMoreSurfaces(false)
 {
   declareInterface<Trk::ILayerBuilder>(this);
   // general steering
@@ -98,6 +100,12 @@ InDet::SiLayerBuilder::SiLayerBuilder(const std::string& t, const std::string& n
   declareProperty("SplitTolerance"                   , m_splitTolerance);      
   // Validation
   declareProperty("GeometryValidation"               , m_runGeometryValidation);
+  // for splitting the geometry
+  declareProperty("LayerIndicesBarrel"               , m_layerIndicesBarrel);
+  declareProperty("LayerIndicesEndcap"               , m_layerIndicesEndcap);
+  declareProperty("UseRingLayout"                    , m_useRingLayout);
+  // For OverlapDescriptor settings
+  declareProperty("AddMoreSurfaces"                  , m_addMoreSurfaces);
 }
 
 // destructor
@@ -176,7 +184,9 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric
   for (int i = 0; i < siNumerology.numLayers(); i++)
        if (siNumerology.useLayer(i)) barrelLayers++;
   
-
+  if (not m_layerIndicesBarrel.empty())
+    barrelLayers = m_layerIndicesBarrel.size();
+         
   // screen output
   ATH_MSG_DEBUG( "Configured to build " << barrelLayers << " (active) barrel layers (out of " << siNumerology.numLayers() << " )" );
   if (!m_barrelAdditionalLayerR.empty())
@@ -213,21 +223,29 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric
   for (; sidetIter != m_siMgr->getDetectorElementEnd(); ++sidetIter){
      // Barrel check
      if ((*sidetIter) && (*sidetIter)->isBarrel()){
+       Identifier    currentId((*sidetIter)->identify());
+       int currentlayerIndex = m_pixIdHelper ? m_pixIdHelper->layer_disk(currentId) : m_sctIdHelper->layer_disk(currentId);
+       if (not m_layerIndicesBarrel.empty()) {
+         if (std::find(m_layerIndicesBarrel.begin(), m_layerIndicesBarrel.end(), currentlayerIndex) == m_layerIndicesBarrel.end())
+           continue;
+       }
        // unit test
        ++barrelModules;
        // get the identifier
-       Identifier    currentId((*sidetIter)->identify());
-       int currentlayer = m_pixIdHelper ? m_pixIdHelper->layer_disk(currentId) : m_sctIdHelper->layer_disk(currentId);
        //skip the layer if it is chosen to be switched off
-       if ( !m_siMgr->numerology().useLayer(currentlayer) ) continue;
+       if ( !m_siMgr->numerology().useLayer(currentlayerIndex) ) continue;
+       
+       int currentlayer = m_layerIndicesBarrel.empty() ? 
+                          currentlayerIndex : (currentlayerIndex-m_layerIndicesBarrel.at(0));
+       
        // (A) Determination of phi / eta sectors  ---------------------------------------------------
        // only do the exercise if it hasn't been done already 
        if (layerPhiSectors[currentlayer] == 0){                        
           ATH_MSG_VERBOSE("Pre-processing Elements from Layer (id from idHelper): " << currentlayer );      
           // set number of phiSectors
-          layerPhiSectors[currentlayer] = m_siMgr->numerology().numPhiModulesForLayer(currentlayer);
+          layerPhiSectors[currentlayer] = m_siMgr->numerology().numPhiModulesForLayer(currentlayerIndex);
           // set number of etaSectors
-          layerZsectors[currentlayer] = m_siMgr->numerology().numEtaModulesForLayer(currentlayer);
+          layerZsectors[currentlayer] = m_siMgr->numerology().numEtaModulesForLayer(currentlayerIndex);
           // get the HalfLength of the Layer
           const InDetDD::SiDetectorElement* countPtr = (*sidetIter);
           // needed for the complex z binning if activated
@@ -237,7 +255,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric
           // walk all along to negative eta
           while ((countPtr->prevInEta()))
                  countPtr = countPtr->prevInEta();
-           layerMinZ[currentlayer] = countPtr->center().z() - 0.5*fabs(countPtr->length());
+           layerMinZ[currentlayer] = countPtr->center().z() - 0.5*std::abs(countPtr->length());
            zboundaries.push_back(layerMinZ[currentlayer]);
            lastModuleZ   = countPtr->center().z();
            // register the layer minZ into the zboundaries         
@@ -250,14 +268,14 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric
                   zboundaries.push_back(currentZboundary);
                   lastModuleZ   = currentModuleZ;
            }
-           layerMaxZ[currentlayer] = fabs(countPtr->center().z()) + 0.5*fabs(countPtr->length());
+           layerMaxZ[currentlayer] = std::abs(countPtr->center().z()) + 0.5*std::abs(countPtr->length());
            zboundaries.push_back(layerMaxZ[currentlayer]);
            
            // complex z binning mode
            layerZboundaries[currentlayer] = zboundaries;
            // chose which one to register for the split mode (SLHC)
            layerHalfLength[currentlayer] =  layerMinZ[currentlayer]*layerMinZ[currentlayer] > layerMaxZ[currentlayer]*layerMaxZ[currentlayer] ?
-               fabs(layerMinZ[currentlayer]) : layerMaxZ[currentlayer];
+               std::abs(layerMinZ[currentlayer]) : layerMaxZ[currentlayer];
            // get the haflength of the layer
            takeSmaller( minHalflengthZ, layerHalfLength[currentlayer]);
            takeBigger( maxHalflengthZ, layerHalfLength[currentlayer]);
@@ -300,7 +318,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric
        Trk::SurfaceOrderPosition surfaceOrder(sharedSurface, orderPosition);
        if (takeIt) (layerSurfaces[currentlayer]).push_back(surfaceOrder);
      
-     } else if (!(*sidetIter)) // barrel chek and screen output
+    } else if (!(*sidetIter))
         ATH_MSG_WARNING("nullptr to Barrel module given by SiDetectorManager! Please check db & dict.xml");
   
   } // SiDet Loop
@@ -344,7 +362,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric
       // create the BinKeyUtility - the phi binning is identical
       double halfPhiStep = M_PI/layerPhiSectors[layerCounter];
       // protection in case phi value was fluctuating around 0 or M_PI in parsing
-      if (fabs(layerMinPhi[layerCounter]+layerMaxPhi[layerCounter])< halfPhiStep && fabs(M_PI+layerMinPhi[layerCounter]) < 0.5*halfPhiStep ){
+      if (std::abs(layerMinPhi[layerCounter]+layerMaxPhi[layerCounter])< halfPhiStep && std::abs(M_PI+layerMinPhi[layerCounter]) < 0.5*halfPhiStep ){
           ATH_MSG_VERBOSE("Detected module fluctuation around +/- M_PI, correcting for it.");
           ATH_MSG_VERBOSE("    min phi / max phi detected  : "  << layerMinPhi[layerCounter] << " / " << layerMaxPhi[layerCounter] );
           layerMinPhi[layerCounter] += 2*halfPhiStep;
@@ -415,7 +433,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric
       // split mode > 0 : compare to minHalflength
       double compareHalfLengthZ = m_splitMode < 0 ? maxHalflengthZ : minHalflengthZ;
       
-      splitDone = m_splitMode && fabs(layerHalfLength[layerCounter]-compareHalfLengthZ) > m_splitTolerance;
+      splitDone = m_splitMode && std::abs(layerHalfLength[layerCounter]-compareHalfLengthZ) > m_splitTolerance;
       if (m_splitMode){
            ATH_MSG_DEBUG( "[ Split mode / part 1 ] Layer Halflength determined as: " << layerHalfLength[layerCounter]);
            ATH_MSG_DEBUG( "                               while minHalflengthZ is: " << minHalflengthZ );
@@ -455,7 +473,7 @@ const std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::cylindric
       Trk::OverlapDescriptor* olDescriptor = nullptr;
       if (m_pixelCase)
           olDescriptor = new InDet::PixelOverlapDescriptor;
-      else olDescriptor = new  InDet::SCT_OverlapDescriptor;
+      else olDescriptor = new  InDet::SCT_OverlapDescriptor(m_addMoreSurfaces);
       // for eventual use with the passive layer
       currentLayerRadius = layerRadius[layerCounter];
 
@@ -524,7 +542,7 @@ const std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::discLayers()
 
   // check for DBMS
   int nDBMLayers = m_siMgr->numerology().numEndcapsDBM();
-  if (!nDBMLayers) return createDiscLayers();
+  if (!nDBMLayers) return ((m_pixelCase and m_useRingLayout) ? createRingLayers() : createDiscLayers());
   
   ATH_MSG_DEBUG( "Found " << m_siMgr->numerology().numEndcapsDBM() << " DBM layers active, building first ECs, then DBMS");
   std::vector<const Trk::DiscLayer*>* ecLayers = createDiscLayers();
@@ -662,7 +680,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st
            }
         }
         // we take the phi / r binning only from the closer to IP module 
-        if ( !(*sidetIter)->otherSide() || fabs(currentZ) < fabs((*sidetIter)->otherSide()->center().z())){
+        if ( !(*sidetIter)->otherSide() || std::abs(currentZ) < std::abs((*sidetIter)->otherSide()->center().z())){
             // take phi-min and phimax
             takeSmaller(discPhiMin[currentlayer][currentring],currentPhi);
             takeBigger(discPhiMax[currentlayer][currentring],currentPhi);
@@ -683,7 +701,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st
        takeSmaller(minRmin,discRmin[iec]); takeBigger(maxRmax,discRmax[iec]);
        // average it out
        discZpos[iec]        = 0.5 * (discZmin[iec] + discZmax[iec]);
-       discThickness[iec]   = isDBM ? 1. : fabs(discZmax[iec]-discZmin[iec]);
+       discThickness[iec]   = isDBM ? 1. : std::abs(discZmax[iec]-discZmin[iec]);
        // make the map z / index
        discZposLayerIndex.insert(std::make_pair(discZpos[iec],iec));
   }
@@ -701,7 +719,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st
         currentlayer += (*sidetIter)->center().z() > 0. ? endcapLayers : 0;
         // decision which module to take
         const InDetDD::SiDetectorElement* otherSide = (*sidetIter)->otherSide();    
-        bool takeIt =  (!otherSide || fabs((*sidetIter)->center().z()) < fabs(otherSide->center().z()) );
+        bool takeIt =  (!otherSide || std::abs((*sidetIter)->center().z()) < std::abs(otherSide->center().z()) );
         const InDetDD::SiDetectorElement* chosenSide = takeIt ?  (*sidetIter) : otherSide;
         // get the center position
         const Amg::Vector3D& orderPosition = chosenSide->center();
@@ -760,7 +778,7 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st
        if (discRsectors==1){
             double halfPhiStep = M_PI/discPhiSectors[discCounter][0];
             // protection in case phi value was fluctuating around 0 or M_PI in parsing
-            if (fabs(discPhiMin[discCounter][0]+discPhiMax[discCounter][0])< halfPhiStep && fabs(discPhiMin[discCounter][0]) < 0.5*halfPhiStep ){
+            if (std::abs(discPhiMin[discCounter][0]+discPhiMax[discCounter][0])< halfPhiStep && std::abs(discPhiMin[discCounter][0]) < 0.5*halfPhiStep ){
                 ATH_MSG_VERBOSE("Detected module fluctuation around +/- M_PI, correcting for it.");
                 ATH_MSG_VERBOSE("    min phi / max phi detected  : "  << discPhiMin[discCounter][0] << " / " <<discPhiMax[discCounter][0] );
                 discPhiMin[discCounter][0] += 2*halfPhiStep;
@@ -1022,7 +1040,322 @@ std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createDiscLayers(st
   return discLayers;
 }
 
+/** LayerBuilder interface method - returning ring-like layers */
+/** this is ITk pixel specific and doesn't include DBM modules */
+std::vector< const Trk::DiscLayer* >* InDet::SiLayerBuilder::createRingLayers() const {
+ 
+  // get general layout
+  InDetDD::SiDetectorElementCollection::const_iterator sidetIter = m_siMgr->getDetectorElementBegin();
+    
+  // save way to estimate the number of barrels
+  unsigned int endcapLayers = 0;
+  for (int i = 0; i < m_siMgr->numerology().numDiskLayers(); i++) {
+    if (not m_layerIndicesEndcap.empty() and 
+      std::find(m_layerIndicesEndcap.begin(), m_layerIndicesEndcap.end(), i)==m_layerIndicesEndcap.end() ) continue;
+    if (m_siMgr->numerology().useDiskLayer(i)) {
+      endcapLayers+=m_siMgr->numerology().numDisksForLayer(i);
+    }
+  }
+  
+  ATH_MSG_DEBUG( "Configured to build " << endcapLayers << " *2 disc-like layers  (+ additional support layers)." );
+ 
+  if (m_splitMode) 
+      ATH_MSG_DEBUG( "[ Split mode ] Some layers may bee cached." );
 
+  // prepare the vectors
+  std::vector<double>                                     discZmin(2*endcapLayers,10e10);
+  std::vector<double>                                     discZmax(2*endcapLayers,-10e10);
+  std::vector<double>                                     discZpos(2*endcapLayers,0.);
+  std::vector<double>                                     discRmin(2*endcapLayers,10e10);
+  std::vector<double>                                     discRmax(2*endcapLayers,0);
+  std::vector<double>                                     discThickness(2*endcapLayers,0.);  
+  std::vector<int>                                        discPhiSectors(2*endcapLayers,-1);
+  std::vector<double>                                     discPhiMin(2*endcapLayers,10e10);
+  std::vector<double>                                     discPhiMax(2*endcapLayers,-10e10);
+  std::vector< std::vector<Trk::SurfaceOrderPosition> >   discSurfaces(2*endcapLayers, std::vector<Trk::SurfaceOrderPosition>());  
+    
+  // let's make sure the discs are ordered in z: that's the z / map index
+  std::map< double, int>                                  discZposLayerIndex;  
+   
+  int endcapModules = 0;
+  int sumCheckEndcapModules = 0;
+  unsigned int currentdisk  = 0;
+  unsigned int currentring  = 0;
+  unsigned int currentlayer = 0;
+  
+  // [-A-] ------------------------ first LOOP over Detector Elements of sensitive layers -------------------------------                 
+  // -- get the missing dimensions by loop over DetElements
+  sidetIter = m_siMgr->getDetectorElementBegin();  
+  for (; sidetIter != m_siMgr->getDetectorElementEnd(); ++sidetIter){
+     // take it - if 
+     // a) you have a detector element ... protection
+     // b) the detector element is EC
+     if ( (*sidetIter) && (*sidetIter)->isEndcap() ){     
+        // get the identifier & calculate current layer and current disk from it     
+        Identifier    currentId((*sidetIter)->identify());
+        currentring  = m_pixIdHelper->layer_disk(currentId);
+        if (not m_layerIndicesEndcap.empty() and std::find(m_layerIndicesEndcap.begin(), m_layerIndicesEndcap.end(), currentring) == m_layerIndicesEndcap.end())
+          continue;
+        
+        double currentZ = (*sidetIter)->center().z();
+        currentdisk = (unsigned int)m_pixIdHelper->eta_module(currentId);
+        currentlayer = currentdisk;
+        for (unsigned int i = 0; i < currentring; i++) {
+          if (not m_layerIndicesEndcap.empty() and 
+            std::find(m_layerIndicesEndcap.begin(), m_layerIndicesEndcap.end(), i)==m_layerIndicesEndcap.end() ) continue;
+          if (m_siMgr->numerology().useDiskLayer(i)) {
+            currentlayer+=m_siMgr->numerology().numDisksForLayer(i);
+          }
+        }
+        // parse all z positions for the mean value of the discs
+        currentlayer += currentZ > 0. ? endcapLayers : 0;
+        
+        // increase the counter of endcap modules
+        endcapModules++;
+        
+        takeSmallerBigger(discZmin[currentlayer],discZmax[currentlayer],currentZ);
+
+        // set the disc Rmin / Rmax  
+        double currentRmin = (*sidetIter)->rMin();
+        double currentRmax = (*sidetIter)->rMax();
+        
+        // the current phi 
+        double currentPhi = (*sidetIter)->center().phi();
+        takeSmaller(discRmin[currentlayer],currentRmin);
+        takeBigger( discRmax[currentlayer],currentRmax);       
+        
+        //fill the number of phi sectors for the different rings
+        if (discPhiSectors[currentlayer]<0){
+          ATH_MSG_VERBOSE("Pre-processing Elements from Disk/Layer (id from idHelper): " << currentring << "/" << currentdisk );
+          // get the number of phi sectors
+          unsigned int phiSectorsRing = m_siMgr->numerology().numPhiModulesForLayerDisk(currentring, currentdisk);
+          ATH_MSG_VERBOSE("--> has " << phiSectorsRing << " phi sectors");
+          discPhiSectors[currentlayer]=phiSectorsRing;
+        }
+//         we take the phi / r binning only from the closer to IP module 
+        // take phi-min and phimax
+        takeSmaller(discPhiMin[currentlayer],currentPhi);
+        takeBigger(discPhiMax[currentlayer],currentPhi);
+        
+        const InDetDD::SiDetectorElement* detElement = (*sidetIter);
+        // get the center position
+        const Amg::Vector3D& orderPosition = detElement->center();
+        // register the chosen side in the object array
+        Trk::SharedObject<const Trk::Surface> sharedSurface(&(detElement->surface()), Trk::do_not_delete<const Trk::Surface>);
+        Trk::SurfaceOrderPosition surfaceOrder(sharedSurface, orderPosition);
+        discSurfaces[currentlayer].push_back(surfaceOrder);
+        
+     } else if (!(*sidetIter))
+        ATH_MSG_WARNING("nullptr to Endcap module given by SCT_DetectorManager! Please check db & dict.xml");
+  } // DetElement loop 
+
+  ATH_MSG_VERBOSE("Estimating the average z position and the radius for each disk.");
+  // get the average z-position per layer & estimate thes thickness
+  for (unsigned int iec=0; iec<2*endcapLayers; ++iec){
+    // average it out
+    discZpos[iec]        = 0.5 * (discZmin[iec] + discZmax[iec]);
+    discThickness[iec]   = std::abs(discZmax[iec]-discZmin[iec]);
+    // make the map z / index
+    discZposLayerIndex.insert(std::make_pair(discZpos[iec],iec));
+  }
+      
+  // [-B-] ------------------------ Construction of the layers -----------------------------------
+  // construct the layers
+  std::vector< const Trk::DiscLayer* >* discLayers = new std::vector< const Trk::DiscLayer* >;
+  std::vector<double>::iterator discZposIter = discZpos.begin();
+  int discCounter = 0;
+                                              
+  for ( ; discZposIter != discZpos.end(); ++discZposIter){
+    // dynamic estimation 1: estimate the layer thickness dynamically
+    double thickness = discThickness[discCounter]+m_endcapEnvelope;       
+    
+    // screen output           
+    ATH_MSG_DEBUG( "Building a DiscLayer with single R sectors. " );
+    ATH_MSG_DEBUG( "  -> At Z - Position      :  " << discZpos[discCounter] );
+    ATH_MSG_DEBUG( "  -> With Thickness       :  " << thickness   << " i- ncludes envelope tolerance : " << m_endcapEnvelope );
+    ATH_MSG_DEBUG( "  -> With Rmin/Rmax (est) :  " << discRmin[discCounter] << " / " << discRmax[discCounter] );
+    
+    // prepare the binned array, it can be with one to several rings            
+    Trk::BinnedArray<Trk::Surface>* currentBinnedArray = nullptr;
+    
+    double halfPhiStep = M_PI/discPhiSectors[discCounter];
+    // protection in case phi value was fluctuating around 0 or M_PI in parsing
+    if (std::abs(discPhiMin[discCounter]+discPhiMax[discCounter])< halfPhiStep && std::abs(discPhiMin[discCounter]) < 0.5*halfPhiStep ){
+      ATH_MSG_VERBOSE("Detected module fluctuation around +/- M_PI, correcting for it.");
+      ATH_MSG_VERBOSE("    [0 - ] min phi / max phi detected  : "  << discPhiMin[discCounter] << " / " <<discPhiMax[discCounter]);
+      discPhiMin[discCounter] += 2*halfPhiStep;
+    }
+    
+    // prepare min phi and max phi & eventually a sub stepvalue
+    ATH_MSG_VERBOSE("    [1 - ] min phi / max phi detected  : " << discPhiMin[discCounter] << " / " << discPhiMax[discCounter] );
+    double minPhiCorrected = discPhiMin[discCounter]-halfPhiStep;
+    double maxPhiCorrected = discPhiMax[discCounter]+halfPhiStep;
+    // catch if the minPhi falls below M_PI
+    if (minPhiCorrected < -M_PI){
+      minPhiCorrected += 2*halfPhiStep;
+      maxPhiCorrected += 2*halfPhiStep;
+    }
+    
+    ATH_MSG_VERBOSE("    min phi / max phi corrected : " << minPhiCorrected << " / " << maxPhiCorrected );
+    ATH_MSG_VERBOSE("Constructing a one-dimensional BinnedArray with phiMin / phiMax (bins) = " 
+                     << minPhiCorrected << " / " << maxPhiCorrected
+                     << " (" << discPhiSectors[discCounter] << ")");
+    
+    Trk::BinUtility* currentBinUtility = new Trk::BinUtility(discPhiSectors[discCounter],
+                                                             minPhiCorrected,
+                                                             maxPhiCorrected,
+                                                             Trk::closed,
+                                                             Trk::binPhi);
+    
+    // a one-dimensional BinnedArray is sufficient
+    currentBinnedArray = new Trk::BinnedArray1D<Trk::Surface>(discSurfaces[discCounter],currentBinUtility);
+    
+    int discSurfacesNum = (discSurfaces[discCounter]).size();
+    ATH_MSG_DEBUG( "Constructed BinnedArray for DiscLayer with "<< discSurfacesNum << " SubSurfaces." );
+
+    // always run the geometry validation to catch flaws
+        
+    // checking for :
+    //   - empty surface bins
+    //   - doubly filled bins
+    std::map< const Trk::Surface*,Amg::Vector3D > uniqueSurfaceMap;
+    std::map< const Trk::Surface*,Amg::Vector3D >::iterator usmIter = uniqueSurfaceMap.end();
+    // check the registered surfaces in the binned array
+    const std::vector<const Trk::Surface*>& arraySurfaces = currentBinnedArray->arrayObjects();
+    size_t dsumCheckSurfaces = 0;
+    double lastPhi = 0.;
+    for (const auto & asurfIter : arraySurfaces){
+      if ( asurfIter ) {
+        ++dsumCheckSurfaces;
+        usmIter = uniqueSurfaceMap.find(asurfIter);
+        lastPhi = asurfIter->center().phi();
+        if ( usmIter != uniqueSurfaceMap.end() )
+          ATH_MSG_WARNING("Non-unique surface found with eta/phi = " << asurfIter->center().eta() << " / " << asurfIter->center().phi());
+        else uniqueSurfaceMap[asurfIter] = asurfIter->center();
+      } else 
+        ATH_MSG_WARNING("Zero-pointer in array detected in this ring, last valid phi value was = " << lastPhi);
+    }
+    sumCheckEndcapModules +=  dsumCheckSurfaces;   
+    
+    ATH_MSG_DEBUG( "  -> With Rmin/Rmax :  " << discRmin[discCounter] << " / " << discRmax[discCounter] );
+    
+    // get the layer material from the helper method
+    const Trk::LayerMaterialProperties* layerMaterial = endcapLayerMaterial(discRmin[discCounter],discRmax[discCounter]);
+
+    // position & bounds of the active Layer
+    Amg::Transform3D  activeLayerTransform;
+    activeLayerTransform = Amg::Translation3D(0.,0.,discZpos[discCounter]);
+    
+    Trk::DiscBounds* activeLayerBounds    = new Trk::DiscBounds(discRmin[discCounter],discRmax[discCounter]);
+    std::vector<Trk::BinUtility*>* binUtils = new std::vector<Trk::BinUtility*>;
+    // prepare the right overlap descriptor       
+    Trk::OverlapDescriptor* olDescriptor = new  InDet::DiscOverlapDescriptor(currentBinnedArray, binUtils, true);
+        
+    // layer creation; deletes currentBinnedArray in baseclass 'Layer' upon destruction
+    // activeLayerTransform deleted in 'Surface' baseclass
+    Trk::DiscLayer* activeLayer = new Trk::DiscLayer(activeLayerTransform,
+                                                     activeLayerBounds,
+                                                     currentBinnedArray,
+                                                     *layerMaterial,
+                                                     thickness,
+                                                     olDescriptor);
+    // cleanup
+    delete layerMaterial;
+    // register the layer to the surfaces --- if necessary to the other sie as well
+    const std::vector<const Trk::Surface*>& layerSurfaces     = currentBinnedArray->arrayObjects();
+    registerSurfacesToLayer(layerSurfaces,*activeLayer);
+    discLayers->push_back(activeLayer);
+    // increase the disc counter by one
+    ++discCounter;
+  }  
+
+  ATH_MSG_DEBUG( endcapModules << " Endcap Modules parsed for Disc Layer dimensions." );
+  ATH_MSG_DEBUG( sumCheckEndcapModules << " Endcap Modules filled in Disc Layer Arrays." );
+  if ( endcapModules-sumCheckEndcapModules )
+    ATH_MSG_WARNING( endcapModules-sumCheckEndcapModules << " Modules not registered properly in binned array." );       
+
+ 
+  // sort the vector
+  Trk::DiscLayerSorterZ zSorter;
+  std::vector<const Trk::DiscLayer*>::iterator sortIter = discLayers->begin();
+  std::vector<const Trk::DiscLayer*>::iterator sortEnd   = discLayers->end(); 
+  std::sort(sortIter, sortEnd, zSorter);
+ 
+  // if there are additional layers to be built - never build for the DBM loop
+  if (!m_endcapAdditionalLayerPosZ.empty()){
+    // sort also the additional layer z positions
+    auto addLayerIter     = m_endcapAdditionalLayerPosZ.begin();
+    auto addLayerIterEnd  = m_endcapAdditionalLayerPosZ.end();
+    auto addLayerTypeIter = m_endcapAdditionalLayerType.begin();
+    // reassign the iterators
+    sortIter = discLayers->begin();
+    sortEnd   = discLayers->end();
+    // get the last rmin / rmax
+    double lastRmin = 0.;
+    double lastRmax = 0.;
+    // build the additional layers -------------------------------------------
+    for ( ; sortIter != sortEnd || addLayerIter != addLayerIterEnd; ){
+      // cache befor last parameters are overwritten 
+      double layerRmin       = lastRmin;
+      double layerRmax       = lastRmax;
+      double layerZposition   = 0.; 
+      // check if the z-position is smaller than the 
+      if ( sortIter != sortEnd){
+        // get the current z position to guarantee a symmetrical setup
+        layerZposition = (*sortIter)->surfaceRepresentation().center().z();
+        // get the bounds for the rMin / rMax setting
+        const Trk::DiscBounds* currentBounds = dynamic_cast<const Trk::DiscBounds*>(&((*sortIter)->surfaceRepresentation().bounds()));
+        lastRmin = currentBounds ? currentBounds->rMin() : 0.;
+        lastRmax = currentBounds ? currentBounds->rMax() : 0.;
+        ++sortIter;           
+      }
+      if ( addLayerIter != addLayerIterEnd){
+        // symmetric setup around 0.
+        double rMin = layerZposition > 0. ? layerRmin : lastRmin;
+        double rMax = layerZposition > 0. ? layerRmax : lastRmax;
+        // the passive layer
+        Trk::DiscLayer* passiveLayer = nullptr;
+        // passive layer creation
+        Amg::Transform3D passiveDiscTransf = Amg::Transform3D(Amg::Translation3D(0., 0., *addLayerIter));
+        if (*addLayerTypeIter) {
+          ATH_MSG_DEBUG("Building an additional DiscLayer w/o sensitive modules at");
+          // create the material and the passive layer
+          const Trk::LayerMaterialProperties* passiveLayerMaterial = endcapLayerMaterial(rMin, rMax);
+          passiveLayer = new Trk::DiscLayer(passiveDiscTransf,
+                                            new Trk::DiscBounds(rMin, rMax),
+                                            *passiveLayerMaterial,
+                                            1. * Gaudi::Units::mm);
+          // cleanup of the layer material
+          // --------------------------------------------------------------
+          delete passiveLayerMaterial;
+        } else {
+          passiveLayer = new Trk::DiscLayer(passiveDiscTransf, 
+                                            new Trk::DiscBounds(rMin, rMax), 
+                                            nullptr);
+        }
+        ATH_MSG_DEBUG( "  -> At Z - Position       :  " << *addLayerIter );
+        ATH_MSG_DEBUG( "  -> With Rmin/Rmax (corr) :  " << rMin << " / " << rMax );
+         
+        // increase the iterator and push back the new layer
+        ++addLayerIter; 
+        discLayers->push_back(passiveLayer);
+      }
+    } // the additional layers are build ------------------------------------
+    
+    // another round of sorting needed after adding the passive layers
+    sortIter = discLayers->begin();
+    sortEnd   = discLayers->end(); 
+    std::sort(sortIter, sortEnd, zSorter);
+  }
+
+  ATH_MSG_DEBUG("Returning: " << discLayers->size() << " disk-like layers to the volume builder");
+  for (const auto& dl : (*discLayers)){
+    ATH_MSG_VERBOSE(" ----> Pointer location : " << dl);
+    ATH_MSG_VERBOSE(" ----> Disk layer located at : " << dl->surfaceRepresentation().center().z());
+  }
+ 
+  return discLayers;
+}
 
 std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilder::dressCylinderLayers(const std::vector< const Trk::CylinderLayer* >& detectionLayers ) const {
 
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
index fc54f8798b15..3d474b5ad6da 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
@@ -8,14 +8,18 @@
 
 // InDet
 #include "InDetTrackingGeometry/StagedTrackingGeometryBuilder.h"
+#include "InDetTrackingGeometry/DiscOverlapDescriptor.h"
+#include "InDetReadoutGeometry/SiDetectorElement.h"
 // EnvelopeDefinitionService
 #include "SubDetectorEnvelopes/IEnvelopeDefSvc.h"
 // Trk interfaces
+#include "TrkDetDescrInterfaces/ILayerBuilder.h"
 #include "TrkDetDescrInterfaces/ILayerProvider.h"
 #include "TrkDetDescrInterfaces/ITrackingVolumeCreator.h"
 #include "TrkDetDescrInterfaces/ILayerArrayCreator.h"
 // Trk Geometry stuff
 #include "TrkDetDescrUtils/BinnedArray.h"
+#include "TrkDetDescrUtils/BinnedArray1D1D.h"
 #include "TrkVolumes/VolumeBounds.h"
 #include "TrkVolumes/CylinderVolumeBounds.h"
 #include "TrkGeometry/TrackingVolume.h"
@@ -67,6 +71,8 @@ InDet::StagedTrackingGeometryBuilder::StagedTrackingGeometryBuilder(const std::s
   // force robust layer indexing  
   declareProperty("IndexStaticLayers",                m_indexStaticLayers);
   declareProperty("CheckForRingLayout",               m_checkForRingLayout);
+  // minimal radial distance between rings to allow a split
+  declareProperty("MinimalRadialGapForVolumeSplit",   m_ringTolerance);
   // volume namespace & contaienr name
   declareProperty("VolumeNamespace",                  m_namespace); 
   declareProperty("ExitVolumeName",                   m_exitVolume);
@@ -201,6 +207,9 @@ const Trk::TrackingGeometry* InDet::StagedTrackingGeometryBuilder::trackingGeome
             // [b] cache is not empty - let's see what is going on:
             ATH_MSG_VERBOSE("       -> new sector does not fit the current cache specs -> flushing the cache." );
             // create the outer boundary
+            //TODO CHECK THIS (NOEMI)
+//             double flushRadius = layerSetupCache[layerSetupCache.size()-1].rMax > lSetup.rMin ? 
+// 	      0.5*(layerSetupCache[layerSetupCache.size()-1].rMax + lSetup.rMax) :  0.5*(layerSetupCache[layerSetupCache.size()-1].rMax + lSetup.rMin)  ;
             double flushRadius = 0.5*(layerSetupCache[layerSetupCache.size()-1].rMax + lSetup.rMin);
             // create a flush volume - clears the cache
             const Trk::TrackingVolume* fVolume = createFlushVolume(layerSetupCache,lastFlushRadius,flushRadius,maximumLayerExtendZ);
@@ -300,7 +309,7 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::packVolumeTripl
                                                                    -zMax,-zPosCentral,
                                                                    volumeBase+"::NegativeEndcap",
                                                                    (Trk::BinningType)layerSetup.binningEndcap,
-								   false);
+                                                                   false);
 
   const Trk::TrackingVolume* centralVolume = 
          m_trackingVolumeCreator->createTrackingVolume(layerSetup.centralLayers,
@@ -315,7 +324,7 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::packVolumeTripl
                                                                     zPosCentral,zMax,
                                                                     volumeBase+"::PositiveEndcap",
                                                                     (Trk::BinningType)layerSetup.binningEndcap,
-								    false);
+                                                                    false);
    
    // the base volumes have been created
    ATH_MSG_VERBOSE('\t' << '\t'<< "Volumes have been created, now pack them into a triple.");
@@ -473,24 +482,50 @@ bool InDet::StagedTrackingGeometryBuilder::setupFitsCache(LayerSetup& layerSetup
 }
  
 bool InDet::StagedTrackingGeometryBuilder::ringLayout(const std::vector<const Trk::Layer*>& layers, std::vector<double>& rmins, std::vector<double>& rmaxs) const {
-    // get the maximum extent in z
-    ATH_MSG_INFO("Checking for Ring layout ... ");
-    for (const auto & ring : layers){
-        // Surface
-        const Trk::Surface&     ringSurface = ring->surfaceRepresentation(); 
-        const Trk::DiscBounds*  ringBounds  = dynamic_cast<const Trk::DiscBounds*>(&(ringSurface.bounds()));
-        if (ringBounds){
-            // get the main parameters
-            double zpos         = ringSurface.center().z();
-            double rMin         = ringBounds->rMin();
-            double rMax         = ringBounds->rMax();
-            // take and check
-            checkForInsert(rmins,rMin);
-            checkForInsert(rmaxs,rMax);
-            ATH_MSG_INFO(" -> Ring at z-position " << zpos << " - with rMin/rMax = " << rMin << "/" << rMax );
-        }
+  // get the maximum extent in z
+  std::vector<std::pair<double,double>> radii;
+  ATH_MSG_DEBUG("Checking for Ring layout ... ");
+  for (auto& ring : layers) {
+    // Surface
+    const Trk::Surface&     ringSurface = ring->surfaceRepresentation(); 
+    const Trk::DiscBounds*  ringBounds  = dynamic_cast<const Trk::DiscBounds*>(&(ringSurface.bounds()));
+    if (ringBounds){
+      // get the main parameters
+      double zpos         = ringSurface.center().z();
+      double rMin         = ringBounds->rMin();
+      double rMax         = ringBounds->rMax();
+      // take and check the couple rmin/rmax
+      checkForInsert(rMin, rMax, radii);
+      ATH_MSG_DEBUG(" -> Ring at z-position " << zpos << " - with rMin/rMax = " << rMin << "/" << rMax );
     }
-    return (rmins.size() > 1 );
+  }
+  
+  // you need a post processing of the (rmin,rmax) in order to fit z-overlapping disks in the same ring
+  std::vector<std::pair<double,double>> tmpradii;
+  
+  for (auto& rs: radii) {
+    bool found = false;
+    for (auto& tmprs: tmpradii) {
+      if ((rs.first<tmprs.second and rs.second>tmprs.first) ) {
+	tmprs.first  = std::min(tmprs.first ,rs.first );
+	tmprs.second = std::max(tmprs.second,rs.second);
+	found = true;
+	break;
+      }
+    }
+    if (found) continue;
+    tmpradii.push_back(rs);
+  }
+   
+  // now you fill rmin and rmax
+  rmins.clear(); rmaxs.clear();
+  for (auto& r: tmpradii) {
+    rmins.push_back(r.first);
+    rmaxs.push_back(r.second);
+  }
+   
+  //add rmin and rmax
+  return (rmins.size() > 1 );
 }                                              
  
  
@@ -532,36 +567,67 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::createTrackingV
                 if (dring) groupedDiscs[rPos].push_back(dring);
             }
         }
-        // we are now grouped in cylinder rings per volume
-        for (int idset = 0; idset < int(groupedDiscs.size()); idset++){
-            // always keep the boundaries in mind for the radial extend
-            double crmin = idset ? ringRmaxa[idset-1]+m_layerEnvelopeCover : innerRadius;
-            double crmax = ringRmaxa[idset]+m_layerEnvelopeCover;
-	    if(idset==int(groupedDiscs.size())-1 && !doAdjustOuterRadius) crmax = outerRadius; 
-            // now create the sub volume
-            std::string ringVolumeName = volumeName+"Ring"+std::to_string(idset);
-            const Trk::TrackingVolume* ringVolume = m_trackingVolumeCreator->createTrackingVolume(groupedDiscs[idset],
-                                                                                                  *m_materialProperties,
-                                                                                                  crmin,crmax,
-                                                                                                  zMin,zMax,
-                                                                                                  ringVolumeName,
-                                                                                                  binningType);
-             // push back into the 
-             ringVolumes.push_back(ringVolume);
+      // layer merging may be needed 
+      std::vector< std::vector< const Trk::Layer*> > mergedLayers;
+      std::vector< float > mergedRmax;
+      std::vector< std::vector< int > > merge;
+      std::vector<int> laySet(1,0); merge.push_back(laySet);
+      double rCurr = ringRmaxa[0];
+      mergedRmax.push_back(rCurr);
+      for (int idset = 1; idset < int(groupedDiscs.size()); idset++){
+        if (ringRmins[idset]<=rCurr + m_ringTolerance) {
+          merge.back().push_back(idset);
+          if (ringRmaxa[idset]>mergedRmax.back()) mergedRmax.back()=ringRmaxa[idset]; 
+        } else {
+          merge.push_back(std::vector<int>(1,idset));
+          mergedRmax.push_back(ringRmaxa[idset]);
         }
-        // set the outer radius
-        if(doAdjustOuterRadius) outerRadius = ringRmaxa[ringRmaxa.size()-1]+m_layerEnvelopeCover;
-        //
-        ATH_MSG_INFO("      -> adjusting the outer radius to the last ring at " << outerRadius );
-        ATH_MSG_INFO("      -> created " << ringVolumes.size() << " ring volumes for Volume '" << volumeName << "'.");
-        // create the tiple container
-        return m_trackingVolumeCreator->createContainerTrackingVolume(ringVolumes,
-                                                                      *m_materialProperties,
-                                                                      volumeName,
-                                                                      m_buildBoundaryLayers,
-                                                                      m_replaceJointBoundaries);
-        
-        
+        rCurr = ringRmaxa[idset];
+      } 
+      for ( auto layset : merge ) {
+        std::vector<const Trk::Layer*> ringSet;
+        for ( auto lay : layset ) {
+          for ( auto ring : groupedDiscs[lay]) {
+            float zPos = ring->surfaceRepresentation().center().z();
+            if (!ringSet.size() || zPos>ringSet.back()->surfaceRepresentation().center().z()) ringSet.push_back(ring);
+            else {
+              std::vector<const Trk::Layer*>::iterator lit = ringSet.begin();
+              while (lit!=ringSet.end() && zPos>(*lit)->surfaceRepresentation().center().z()) lit++;
+              ringSet.insert(lit,ring);  
+            }   
+          }
+        } 
+        // rings ordered in z : resolve overlap
+        mergedLayers.push_back(checkZoverlap(ringSet));
+      }
+      // we are now grouped in cylinder rings per volume
+      for (int idset = 0; idset < int(mergedLayers.size()); idset++){
+        // always keep the boundaries in mind for the radial extend
+        double crmin = idset ? mergedRmax[idset-1]+m_layerEnvelopeCover : innerRadius;
+        double crmax = mergedRmax[idset]+m_layerEnvelopeCover;
+        if(idset==int(mergedLayers.size())-1 && !doAdjustOuterRadius) crmax = outerRadius; 
+        // now create the sub volume
+        std::string ringVolumeName = volumeName+"Ring"+std::to_string(idset);
+        const Trk::TrackingVolume* ringVolume = m_trackingVolumeCreator->createTrackingVolume(mergedLayers[idset],
+                                                                                              *m_materialProperties,
+                                                                                              crmin,crmax,
+                                                                                              zMin,zMax,
+                                                                                              ringVolumeName,
+                                                                                              binningType);
+        // push back into the 
+        ringVolumes.push_back(ringVolume);
+      }
+      // set the outer radius
+      if(doAdjustOuterRadius) outerRadius = ringRmaxa[ringRmaxa.size()-1]+m_layerEnvelopeCover;
+      //
+      ATH_MSG_INFO("      -> adjusting the outer radius to the last ring at " << outerRadius );
+      ATH_MSG_INFO("      -> created " << ringVolumes.size() << " ring volumes for Volume '" << volumeName << "'.");
+      // create the tiple container
+      return m_trackingVolumeCreator->createContainerTrackingVolume(ringVolumes,
+                                                                    *m_materialProperties,
+                                                                    volumeName,
+                                                                    m_buildBoundaryLayers,
+                                                                    m_replaceJointBoundaries);
     } else 
         return m_trackingVolumeCreator->createTrackingVolume(layers,
                                                              *m_materialProperties,
@@ -608,12 +674,12 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::createFlushVolu
            // take the given outer radius for the last one - median otherwise
            double orE = ((ilS+1)==layerSetupCache.size()) ? outerRadius : 0.5*(layerSetupCache[ilS+1].minRadiusEndcap+layerSetupCache[ilS].maxRadiusEndcap);
            double orC = ((ilS+1)==layerSetupCache.size()) ? outerRadius : 0.5*(layerSetupCache[ilS+1].minRadiusCenter+layerSetupCache[ilS].maxRadiusCenter);
-	   // Adjust last volumes in R to the same maximal radial extends!
-	   if(ilS==layerSetupCache.size()-1) {
-	     ATH_MSG_VERBOSE("Processing last volume");
-	     ATH_MSG_VERBOSE("  --> adjust volumes to same extends: orE=" << orE << " orC=" << orC);
-	     if(orE>orC) orC=orE; else orE=orC;
-	   }
+           // Adjust last volumes in R to the same maximal radial extends!
+           if(ilS==layerSetupCache.size()-1) {
+             ATH_MSG_VERBOSE("Processing last volume");
+             ATH_MSG_VERBOSE("  --> adjust volumes to same extends: orE=" << orE << " orC=" << orC);
+             if(orE>orC) orC=orE; else orE=orC;
+           }
            // create the three volumes
            const Trk::TrackingVolume* nVolume = createTrackingVolume(layerSetupCache[ilS].negativeLayers,
                                                                      irE,orE,
@@ -710,3 +776,146 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::packVolumeTripl
                                                                 m_replaceJointBoundaries);
    return tripleContainer;
 }
+
+
+std::vector<const Trk::Layer*> InDet::StagedTrackingGeometryBuilder::checkZoverlap(std::vector<const Trk::Layer*>& lays) const 
+{
+    // check disc layer overlaps in z, merge if appropriate
+    std::vector<const Trk::Layer*> mergedDiscLayers;
+    std::vector<const Trk::Layer*> toMerge;
+    double zlast = 0.; bool overlaps = false;
+    for (auto lay : lays) {
+        float zpos= lay->surfaceRepresentation().center().z();
+        float thick = 0.5*lay->thickness();
+        if (lay==lays.front()) toMerge.push_back(lay);
+        else { 
+          if ( zpos - thick<zlast) {
+            toMerge.push_back(lay);
+            overlaps = true;   
+          } else {
+            if ( toMerge.size()==1 ) mergedDiscLayers.push_back(toMerge[0]);
+            else if (toMerge.size()>1) {
+              const Trk::Layer* nd = mergeDiscLayers(toMerge);
+              if (nd) mergedDiscLayers.push_back(nd); 
+              else {
+                ATH_MSG_DEBUG("radial merge of rings failed, return the input layer set");
+                return lays;
+              }
+            }
+            toMerge.clear(); toMerge.push_back(lay);
+          }
+        }
+        zlast = zpos+thick;
+    }
+    if (toMerge.size()==1) mergedDiscLayers.push_back(toMerge[0]);
+    else if (toMerge.size()>1) {
+      const Trk::Layer* nd = mergeDiscLayers(toMerge);
+      if (nd) mergedDiscLayers.push_back(nd); 
+      else {
+        ATH_MSG_DEBUG("radial merge of rings failed, return the input layer set");
+        return lays;
+      }
+    }
+
+    if (overlaps) return mergedDiscLayers;
+
+    return lays;
+}
+
+const Trk::Layer* InDet::StagedTrackingGeometryBuilder::mergeDiscLayers (std::vector<const Trk::Layer*>& inputDiscs) const {
+ 
+  // on the input, disc layers overlapping in thickness : merge to a new DiscLayer
+  std::pair<float,float> zb(1.e5,-1.e5);
+  // order discs in radius
+  std::vector< std::pair<float,float> > rbounds; std::vector<size_t> discOrder;
+  size_t id=0;
+  for ( auto  lay : inputDiscs ) {
+    zb.first = fmin( zb.first, lay->surfaceRepresentation().center().z()-0.5*lay->thickness());
+    zb.second = fmax( zb.second, lay->surfaceRepresentation().center().z()+0.5*lay->thickness());
+    const Trk::DiscBounds* db = dynamic_cast<const Trk::DiscBounds*>(&(lay->surfaceRepresentation().bounds()));
+    if (!db) {
+      ATH_MSG_WARNING("attempt to merge non-disc layers, bailing out");
+      return 0;    
+    }
+    float r = db->rMin();
+    if (!rbounds.size() ||  r>rbounds.back().first) {
+      rbounds.push_back(std::pair<float,float> (r,db->rMax()));  
+      discOrder.push_back(id);
+    } else {
+      int ir=rbounds.size()-1;
+      while (ir>=0) {
+        if ( r>rbounds[ir].first ) break; 
+        ir--;
+      }
+      rbounds.insert(rbounds.begin()+ir+1,std::pair<float,float> (r,db->rMax()));  
+      discOrder.insert(discOrder.begin()+ir+1,id);           
+    }
+    id++;
+  }
+  
+  std::vector<float> rsteps; std::vector<const Trk::Surface*> surfs; 
+  std::vector<Trk::BinUtility*>* binUtils=new std::vector<Trk::BinUtility*>(); 
+  rsteps.push_back(rbounds[0].first);
+  for (unsigned int id=0; id<discOrder.size(); id++) {
+    unsigned int index=discOrder[id];
+    const Trk::SurfaceArray* surfArray = inputDiscs[index]->surfaceArray();    
+    if (surfArray) {
+      if (surfArray->binUtility()->binningValue()!=Trk::binPhi) {
+        ATH_MSG_WARNING("attempt to merge 2D disc arrays, bailing out");
+        return 0;
+      }
+      binUtils->push_back(surfArray->binUtility()->clone());
+      if (id+1<discOrder.size()) rsteps.push_back( 0.5*(rbounds[id].second+rbounds[id+1].first));
+      const std::vector<const Trk::Surface*> ringSurf =surfArray->arrayObjects();
+      surfs.insert(surfs.end(),ringSurf.begin(),ringSurf.end());
+    }  
+  }
+  rsteps.push_back(rbounds.back().second);
+
+  std::vector< std::pair< Trk::SharedObject<const Trk::Surface>, Amg::Vector3D >  > surfaces;
+  for ( auto  sf : surfs ) {
+    Trk::SharedObject<const Trk::Surface> sharedSurface(sf,Trk::do_not_delete<const Trk::Surface>);
+    std::pair< Trk::SharedObject<const Trk::Surface>, Amg::Vector3D >  surfaceOrder(sharedSurface, sf->center());
+    surfaces.push_back(surfaceOrder);
+  }
+
+  // create merged binned array
+  Trk::BinnedArray<Trk::Surface>* mergeBA = new Trk::BinnedArray1D1D<Trk::Surface>(surfaces,new Trk::BinUtility(rsteps,Trk::open,Trk::binR),binUtils);
+
+  // prepare the overlap descriptor       
+  std::vector<Trk::BinUtility*> clonedBinUtils = std::vector<Trk::BinUtility*>();
+  for (auto bu : *binUtils) clonedBinUtils.push_back(bu->clone());
+  Trk::OverlapDescriptor* olDescriptor = new InDet::DiscOverlapDescriptor(mergeBA,&clonedBinUtils,true);
+    
+  // position & bounds of the disc layer
+  double disc_thickness = std::fabs(zb.second-zb.first);
+  double disc_pos = (zb.first+zb.second)*0.5;
+
+  Amg::Transform3D transf;
+  transf = Amg::Translation3D(0.,0.,disc_pos);
+
+  // get the layer material from the first merged layer
+  const Trk::LayerMaterialProperties* disc_material = inputDiscs[0]->layerMaterialProperties()->clone();
+
+  // create disc layer
+  const Trk::DiscLayer* layer = new Trk::DiscLayer(transf,
+                                                   new Trk::DiscBounds(rsteps.front(),rsteps.back()),
+                                                   mergeBA,
+                                                   *disc_material,
+                                                   disc_thickness,
+                                                   olDescriptor); 
+  
+   // register the layer to the surfaces 
+   const std::vector<const Trk::Surface*>& layerSurfaces     = mergeBA->arrayObjects();
+   for (auto sf : layerSurfaces) {
+     const InDetDD::SiDetectorElement* detElement = dynamic_cast<const InDetDD::SiDetectorElement*>(sf->associatedDetectorElement());
+     const std::vector<const Trk::Surface*>& allSurfacesVector = detElement->surfaces();
+     for (auto subsf : allSurfacesVector)  
+       Trk::IGeometryBuilder::associateLayer(*layer, const_cast<Trk::Surface&>(*subsf));
+   }
+   
+   for (auto disc : inputDiscs)   delete disc;      // cleanup
+
+   return layer; 
+
+}
diff --git a/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py b/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py
index 3df2543aa479..95a939792c79 100644
--- a/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py
+++ b/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py
@@ -6,6 +6,7 @@ Trk__TrackingGeometrySvc=CompFactory.Trk.TrackingGeometrySvc
 Trk__GeometryBuilder=CompFactory.Trk.GeometryBuilder
 from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
 from SubDetectorEnvelopes.SubDetectorEnvelopesConfigNew import EnvelopeDefSvcCfg 
+from AthenaCommon.Constants import VERBOSE
 
 from GaudiKernel.GaudiHandles import PrivateToolHandleArray
 
@@ -178,6 +179,177 @@ def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc,
                                                 # Probably they should just be dropped, but I leave this comment for the moment so reviewers can have a think as well.
                                                 
                                                 # Barrel Entry layers (in old config) etc were removed in 323990adfce581a635ae1809fd2ecc6a093a704c (!)
+
+
+def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, namePrefix='', setLayerAssociation = True, buildTrtStrawLayers = False):
+  # Based on https://gitlab.cern.ch/atlas/athena/blob/master/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilder.py
+  # A lot of comments below are to help people understand differences from the above, in case we need to revert some simplifications I made
+  # i.e. this is far from complete, but is better than what was there before.
+  
+  # beampipe        
+  InDet__BeamPipeBuilder=CompFactory.InDet.BeamPipeBuilder
+  beamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix+'BeamPipeBuilder')
+  beamPipeBuilder.OutputLevel=VERBOSE
+  result.addPublicTool(beamPipeBuilder)
+  BeamPipeBinning = 2  
+  
+  Trk__LayerProvider=CompFactory.Trk.LayerProvider
+  beamPipeProvider = Trk__LayerProvider(name=namePrefix+'BeamPipeProvider')
+  beamPipeProvider.LayerBuilder = beamPipeBuilder
+  beamPipeProvider.OutputLevel=VERBOSE
+  result.addPublicTool(beamPipeProvider)  
+  
+  layerProviders = [beamPipeProvider]
+  binnings_barrel = [BeamPipeBinning]
+  binnings_endcap = [BeamPipeBinning]   
+  colors          = [2]
+  
+  # Pixel
+  if flags.Detector.GeometryITkPixel:
+    InDet__SiLayerBuilder=CompFactory.InDet.SiLayerBuilder
+    PixelLayerBuilderInner = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilderInner')
+    PixelLayerBuilderInner.PixelCase            = True
+    PixelLayerBuilderInner.Identification       = 'ITkPixelInner'
+    PixelLayerBuilderInner.SiDetManagerLocation = 'ITkPixel'
+    PixelLayerBuilderInner.LayerIndicesBarrel   = [0,1]
+    PixelLayerBuilderInner.LayerIndicesEndcap   = [0,1,2]
+    PixelLayerBuilderInner.UseRingLayout=True
+    # Pixel barrel specifications
+    PixelLayerBuilderInner.BarrelLayerBinsZ     = 1 #TODO Update with meaningful bins
+    PixelLayerBuilderInner.BarrelLayerBinsPhi   = 1 #TODO Update with meaningful bins
+    PixelLayerBuilderInner.EndcapLayerBinsR     = 1 #TODO Update with meaningful bins
+    PixelLayerBuilderInner.EndcapLayerBinsPhi   = 1 #TODO Update with meaningful bins
+    #PixelLayerBuilderInner.OutputLevel=VERBOSE
+    
+    # set the layer association
+    PixelLayerBuilderInner.SetLayerAssociation  = setLayerAssociation
+
+    # the binning type of the layers   a
+    PixelLayerBinning = 2
+    # add it to tool service
+    result.addPublicTool(PixelLayerBuilderInner)
+    
+    pixelProviderInner = Trk__LayerProvider(name=namePrefix+'PixelProviderInner')
+    pixelProviderInner.LayerBuilder = PixelLayerBuilderInner
+    #pixelProviderInner.OutputLevel=VERBOSE
+    result.addPublicTool(pixelProviderInner)
+    # put them to the caches
+    layerProviders  += [pixelProviderInner]
+    binnings_barrel += [ PixelLayerBinning ]
+    binnings_endcap += [ PixelLayerBinning ]
+    colors          += [ 3 ]
+    
+    PixelLayerBuilderOuter = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilderOuter')
+    PixelLayerBuilderOuter.PixelCase            = True
+    PixelLayerBuilderOuter.Identification       = 'ITkPixelOuter'
+    PixelLayerBuilderOuter.SiDetManagerLocation = 'ITkPixel'
+    PixelLayerBuilderOuter.LayerIndicesBarrel   = [2,3,4]
+    PixelLayerBuilderOuter.LayerIndicesEndcap   = [3,4,5,6,7,8]
+    PixelLayerBuilderOuter.UseRingLayout=True
+    # Pixel barrel specifications
+    PixelLayerBuilderOuter.BarrelLayerBinsZ     = 1 #TODO Update with meaningful bins
+    PixelLayerBuilderOuter.BarrelLayerBinsPhi   = 1 #TODO Update with meaningful bins
+    PixelLayerBuilderOuter.EndcapLayerBinsR     = 1 #TODO Update with meaningful bins
+    PixelLayerBuilderOuter.EndcapLayerBinsPhi   = 1 #TODO Update with meaningful bins
+    PixelLayerBuilderOuter.OutputLevel=VERBOSE
+    
+    # set the layer association
+    PixelLayerBuilderOuter.SetLayerAssociation  = setLayerAssociation
+
+    # the binning type of the layers   a
+    PixelLayerBinning = 2
+    # add it to tool service
+    result.addPublicTool(PixelLayerBuilderOuter)
+    
+    pixelProviderOuter = Trk__LayerProvider(name=namePrefix+'PixelProviderOuter')
+    pixelProviderOuter.LayerBuilder = PixelLayerBuilderOuter
+    pixelProviderOuter.OutputLevel=VERBOSE
+    result.addPublicTool(pixelProviderOuter)
+    # put them to the caches
+    layerProviders  += [pixelProviderOuter]
+    binnings_barrel += [ PixelLayerBinning ]
+    binnings_endcap += [ PixelLayerBinning ]
+    colors          += [ 3 ]
+
+  if flags.Detector.GeometryITkStrip:
+    # SCT building
+    InDet__SiLayerBuilder=CompFactory.InDet.SiLayerBuilder
+    SCT_LayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder')
+    SCT_LayerBuilder.PixelCase                       = False
+    SCT_LayerBuilder.Identification                  = 'ITkStrip'
+    SCT_LayerBuilder.SiDetManagerLocation            = 'ITkStrip'
+    SCT_LayerBuilder.AddMoreSurfaces                 = True
+    # additionall layers - handle with care !
+    SCT_LayerBuilder.BarrelLayerBinsZ                = 1 #TODO Update with meaningful bins
+    SCT_LayerBuilder.BarrelLayerBinsPhi              = 1 #TODO Update with meaningful bins
+    # SCT endcap specifications                          
+    SCT_LayerBuilder.EndcapLayerBinsR                = 1 #TODO Update with meaningful bins
+    SCT_LayerBuilder.EndcapLayerBinsPhi              = 1 #TODO Update with meaningful bins
+    # set the layer association                   
+    SCT_LayerBuilder.SetLayerAssociation             = setLayerAssociation        
+    # the binning type of the layer     
+    SCT_LayerBinning = 2
+    # SCT -> ToolSvc                             
+    result.addPublicTool(SCT_LayerBuilder)
+    
+    stripProvider = Trk__LayerProvider(name=namePrefix+'StripProvider')
+    stripProvider.LayerBuilder = SCT_LayerBuilder
+    result.addPublicTool(stripProvider)
+    
+    # put them to the caches
+    layerProviders  += [stripProvider]
+    binnings_barrel += [ SCT_LayerBinning ]
+    binnings_endcap += [ SCT_LayerBinning ]
+    colors          += [ 4 ]
+  
+  # helpers for the InDetTrackingGeometry Builder : layer array creator
+  Trk__LayerArrayCreator=CompFactory.Trk.LayerArrayCreator
+  InDetLayerArrayCreator = Trk__LayerArrayCreator(name = 'InDetLayerArrayCreator')
+  InDetLayerArrayCreator.EmptyLayerMode           = 2 # deletes empty material layers from arrays
+  # add to ToolSvc
+  result.addPublicTool(InDetLayerArrayCreator)  
+
+  # helpers for the InDetTrackingGeometry Builder : volume array creator
+  Trk__TrackingVolumeArrayCreator= CompFactory.Trk.TrackingVolumeArrayCreator
+  InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(name = 'InDetTrackingVolumeArrayCreator')
+  # add to ToolSvc
+  result.addPublicTool(InDetTrackingVolumeArrayCreator)  
+
+  # helpers for the InDetTrackingGeometry Builder : tracking volume helper for gluing
+  Trk__TrackingVolumeHelper=CompFactory.Trk.TrackingVolumeHelper
+  InDetTrackingVolumeHelper                             = Trk__TrackingVolumeHelper(name ='InDetTrackingVolumeHelper')
+  # the material bins - assume defaults
+  # add to ToolSvc
+  result.addPublicTool(InDetTrackingVolumeHelper)  
+  
+  # helpers for the InDetTrackingGeometry Builder : cylinder volume creator
+  Trk__CylinderVolumeCreator=CompFactory.Trk.CylinderVolumeCreator
+  InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = 'InDetCylinderVolumeCreator')
+  # give it the layer array creator
+  InDetCylinderVolumeCreator.LayerArrayCreator = InDetLayerArrayCreator
+  InDetCylinderVolumeCreator.TrackingVolumeArrayCreator = InDetTrackingVolumeArrayCreator
+  InDetCylinderVolumeCreator.TrackingVolumeHelper       = InDetTrackingVolumeHelper
+        
+  # specifiy the binning, passive layers, entry layers - assume defaults
+  # add to ToolSvc
+  result.addPublicTool(InDetCylinderVolumeCreator)  
+
+  # the tracking geometry builder
+  InDet__StagedTrackingGeometryBuilder=CompFactory.InDet.StagedTrackingGeometryBuilder
+  return InDet__StagedTrackingGeometryBuilder(namePrefix+name,
+                                              LayerBuilders     = layerProviders,
+                                              LayerBinningTypeCenter    = binnings_barrel,
+                                              LayerBinningTypeEndcap    = binnings_endcap,
+                                              ColorCodes                = colors,
+                                              EnvelopeDefinitionSvc     = envelopeDefinitionSvc,
+                                              TrackingVolumeCreator     = InDetCylinderVolumeCreator,
+                                              LayerArrayCreator         = InDetLayerArrayCreator,
+                                              CheckForRingLayout        = True,
+                                              MinimalRadialGapForVolumeSplit = 2.,
+                                              ReplaceAllJointBoundaries = True,
+                                              BuildBoundaryLayers=True,
+                                              ExitVolumeName='InDet::Containers::InnerDetector',
+                                              OutputLevel=VERBOSE)
   
 # Replaces https://gitlab.cern.ch/atlas/athena/blob/master/Calorimeter/CaloTrackingGeometry/python/ConfiguredCaloTrackingGeometryBuilder.py
 def _getCaloTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, trackingVolumeHelper, namePrefix=''):
@@ -226,6 +398,11 @@ def TrackingGeometrySvcCfg( flags , name = 'AtlasTrackingGeometrySvc', doMateria
       
       atlas_geometry_builder.InDetTrackingGeometryBuilder = inDetTrackingGeometryBuilder
       
+    elif flags.Detector.GeometryITk:
+      inDetTrackingGeometryBuilder = _getITkTrackingGeometryBuilder(name ='InDetTrackingGeometryBuilder', flags=flags, result=result,
+                                                                    envelopeDefinitionSvc=atlas_env_def_service)
+      atlas_geometry_builder.InDetTrackingGeometryBuilder = inDetTrackingGeometryBuilder
+      
     if flags.Detector.GeometryCalo:
       Trk__CylinderVolumeCreator=CompFactory.Trk.CylinderVolumeCreator
       caloVolumeCreator = Trk__CylinderVolumeCreator("CaloVolumeCreator")
@@ -281,7 +458,7 @@ def TrackingGeometrySvcCfg( flags , name = 'AtlasTrackingGeometrySvc', doMateria
        result.merge(_setupCondDB(flags, CoolDataBaseFolder))
     elif  flags.TrackingGeometry.MaterialSource == 'Input':
       Trk__InputLayerMaterialProvider=CompFactory.Trk.InputLayerMaterialProvider
-      atlasMaterialProvider = Trk__InputLayerMaterialProvider('AtlasMaterialProvider', LayerMaterialMapKey='')
+      atlasMaterialProvider = Trk__InputLayerMaterialProvider('AtlasMaterialProvider')
       atlas_geometry_processors += [ atlasMaterialProvider ]
       
     if doMaterialValidation:
diff --git a/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/IGeometryBuilder.h b/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/IGeometryBuilder.h
index 96fd035c35ae..26edfcf24e33 100755
--- a/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/IGeometryBuilder.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/IGeometryBuilder.h
@@ -1,7 +1,7 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
 ///////////////////////////////////////////////////////////////////
 // IGeometryBuilder.hm (c) ATLAS Detector software
 ///////////////////////////////////////////////////////////////////
@@ -13,15 +13,17 @@
 #include "GaudiKernel/IAlgTool.h"
 // Trk - enum
 #include "TrkDetDescrUtils/GeometrySignature.h"
+#include "TrkSurfaces/Surface.h"
 // STL
 #include <vector>
 
-#include "CxxUtils/checker_macros.h"
-
+#include "CxxUtils/checker_macros.h"
+
 namespace Trk {
 
   class TrackingGeometry;
   class TrackingVolume;
+  class Layer;
 
   /** Interface ID for IGeometryBuilders*/  
   static const InterfaceID IID_IGeometryBuilder("IGeometryBuilder", 1, 0);
@@ -56,6 +58,13 @@ namespace Trk {
       /** The unique signature */
       virtual GeometrySignature geometrySignature() const = 0;
       
+      protected:
+      /** Protected method to register the Layer to the Surface */
+      void associateLayer(const Layer& lay, Surface& sf) const
+      {
+        sf.associateLayer(lay);
+      }
+      
   };
 
 } // end of namespace
diff --git a/Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestITkConfig.py b/Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestITkConfig.py
new file mode 100644
index 000000000000..4a7aebbfb484
--- /dev/null
+++ b/Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestITkConfig.py
@@ -0,0 +1,147 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator 
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+
+def PositionMomentumWriterCfg(configFlags, name="PositionMomentumWriter", **kwargs) :
+  result = ComponentAccumulator()
+
+  Trk__PositionMomentumWriter = CompFactory.Trk.PositionMomentumWriter
+  posMomWriter = Trk__PositionMomentumWriter(name, **kwargs)
+  result.addPublicTool(posMomWriter)
+  #result.setPrivateTools(posMomWriter)
+  return result, posMomWriter
+
+def ExtrapolationEngineTestCfg(configFlags, name = "ExtrapolationEngineTest", **kwargs ) :
+  result=ComponentAccumulator()  
+  
+  from AtlasGeoModel.GeoModelConfig import GeoModelCfg
+  gmsAcc = GeoModelCfg(configFlags)
+  result.merge(gmsAcc)
+
+  #from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
+  #kwargs["ExtrapolationEngine"] = result.popToolsAndMerge(AtlasExtrapolationEngineCfg(configFlags, nameprefix=''))
+  
+  from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
+  extrapAcc = AtlasExtrapolationEngineCfg(configFlags)
+  extrapolationEngine = extrapAcc.getPrimary()
+  result.merge(extrapAcc)
+  kwargs["ExtrapolationEngine"] = extrapolationEngine
+
+  posMomAcc, posMomWriter = PositionMomentumWriterCfg(configFlags)
+  result.merge(posMomAcc)
+  kwargs.setdefault('PositionMomentumWriter', posMomWriter)
+     
+  Trk__ExtrapolationEngineTest = CompFactory.Trk.ExtrapolationEngineTest
+  extrapolationTest = Trk__ExtrapolationEngineTest(name, **kwargs)
+  result.addEventAlgo(extrapolationTest)
+  
+  return result
+
+if __name__=="__main__":
+    from AthenaCommon.Configurable import Configurable
+    from AthenaCommon.Logging import log
+    from AthenaCommon.Constants import VERBOSE
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    
+    Configurable.configurableRun3Behavior = True
+    
+    ## Just enable ID for the moment.
+    ConfigFlags.Input.isMC             = True
+    
+    ConfigFlags.GeoModel.useLocalGeometry = True
+    detectors = [
+      "ITkPixel",
+      "ITkStrip"
+    ]
+    
+    from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
+    setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
+
+    ConfigFlags.GeoModel.AtlasVersion = "ATLAS-P2-ITK-24-00-00"
+    ConfigFlags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
+    ConfigFlags.GeoModel.Align.Dynamic = False
+    ConfigFlags.TrackingGeometry.MaterialSource = "Input"
+    ConfigFlags.Beam.Type =''
+    
+    ConfigFlags.Detector.GeometryCalo  = False
+    ConfigFlags.Detector.GeometryMuon  = False
+    
+    # This should run serially for the moment.
+    ConfigFlags.Concurrency.NumThreads = 1
+    ConfigFlags.Concurrency.NumConcurrentEvents = 1
+    
+    log.debug('Lock config flags now.')
+    ConfigFlags.lock()
+    
+    log.debug('dumping config flags now.')
+    ConfigFlags.dump()
+
+    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    cfg=MainServicesCfg(ConfigFlags)
+    
+    from AthenaConfiguration.ComponentFactory import CompFactory
+    
+    from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelGeometryCfg
+    itkPixel = ITkPixelGeometryCfg(ConfigFlags)
+    cfg.merge(itkPixel)
+    
+    from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripGeometryCfg
+    itkStrip = ITkStripGeometryCfg(ConfigFlags)
+    cfg.merge(itkStrip)
+    
+    from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
+    cfg.merge(BeamPipeGeometryCfg(ConfigFlags))
+    
+    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
+    cfg.merge(TrackingGeometrySvcCfg(ConfigFlags))
+    
+    histSvc = CompFactory.THistSvc(Output = ["val DATAFILE='ExtrapolationEngineTest.root' TYPE='ROOT' OPT='RECREATE'"])
+    histSvc.OutputLevel=VERBOSE
+    cfg.addService( histSvc )
+    
+    topoAcc=ExtrapolationEngineTestCfg(ConfigFlags,
+                                       NumberOfTestsPerEvent   = 100,
+                                       # parameters mode: 0 - neutral tracks, 1 - charged particles 
+                                       ParametersMode          = 1,
+                                       # do the full test backwards as well            
+                                       BackExtrapolation       = False,
+                                       # Smear the production vertex - standard primary vertex paramters
+                                       SmearOrigin             = False,
+                                       SimgaOriginD0           = 2./3.,
+                                       SimgaOriginZ0           = 50.,
+                                       SmearFlatOriginZ0       = False,
+                                       Z0Min                   = -150.,
+                                       Z0Max                   =  150.,
+                                       Z0Values                = [-150., 0., 150.],
+                                       SmearFlatOriginD0       = False,
+                                       D0Min                   = -2.0,
+                                       D0Max                   =  2.0,
+                                       # pT range for testing
+                                       PtMin                   = 1000,
+                                       PtMax                   = 1000,
+                                       # The test range in Eta                      
+                                       EtaMin                  =  -5.,
+                                       EtaMax                  =   5.,
+                                       #EtaMin                  =  -2.0
+                                       #EtaMax                  =   2.0
+                                       #PhiMin                  =  -0.5
+                                       #PhiMax                  =   0.5
+                                       # Configure how you wanna run                  
+                                       CollectSensitive        = True,
+                                       CollectPassive          = True,
+                                       CollectBoundary         = True,
+                                       CollectMaterial         = True,
+                                       UseHGTD                 = False,
+                                       # the path limit to test                        
+                                       PathLimit               = -1.,
+                                       )
+    cfg.merge(topoAcc)
+    
+    #vp1 = CompFactory.VP1Alg() 
+    #cfg.addEventAlgo(vp1)
+
+    cfg.run(1000)
+    f=open("ExtrapolationEngineTestConfig.pkl","wb")
+    cfg.store(f)
+    f.close()
-- 
GitLab


From 2dd4606758d3ec38754e1baaf223b3f3acab41c3 Mon Sep 17 00:00:00 2001
From: Johannes Elmsheuser <johannes.elmsheuser@cern.ch>
Date: Fri, 10 Sep 2021 11:47:37 +0200
Subject: [PATCH 062/347] Fix a dev3LCG nightly compilation problem of
 GetEntry(..), which requires a default argument in the latest ROOT version

---
 LArCalorimeter/LArG4/LArG4ShowerLib/src/IShowerLib.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/LArCalorimeter/LArG4/LArG4ShowerLib/src/IShowerLib.cxx b/LArCalorimeter/LArG4/LArG4ShowerLib/src/IShowerLib.cxx
index 70db67bc4086..b41f0c5adc1d 100755
--- a/LArCalorimeter/LArG4/LArG4ShowerLib/src/IShowerLib.cxx
+++ b/LArCalorimeter/LArG4/LArG4ShowerLib/src/IShowerLib.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
 */
 
 
@@ -27,7 +27,7 @@ namespace ShowerLib {
 	  source->SetBranchAddress("geantVersion",&geant);
 	  source->SetBranchAddress("physicsList",&physics);
 	  source->SetBranchAddress("comment",&comment);
-	  source->GetEntry();
+	  source->GetEntry(0);
 	  m_detector = detector;
 	  m_release = release;
 	  m_geometry = geometry;
-- 
GitLab


From 0727fdba6f4161e11a39afbb5c016c16e912937b Mon Sep 17 00:00:00 2001
From: Alison Elliot <alison.elliot@cern.ch>
Date: Fri, 10 Sep 2021 12:00:19 +0200
Subject: [PATCH 063/347] commenting out gfex bitwise simulation while blocker
 FPE error is solved

---
 .../TriggerJobOpts/python/Lvl1SimulationConfig.py         | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py
index 749107c862d7..f76e5664d6f5 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py
@@ -111,10 +111,10 @@ def Lvl1SimulationSequence( ConfigFlags ):
         l1CaloSimSeq.jFEXDriver.jSuperCellTowerMapperTool.SCell=SCellType
         l1CaloSimSeq.jFEXDriver.jFEXSysSimTool.SCell=SCellType
 
-        l1CaloSimSeq += CfgMgr.LVL1__gFEXDriver('gFEXDriver',
-            SCell=SCellType )
-        l1CaloSimSeq.gFEXDriver.gSuperCellTowerMapperTool.SCell=SCellType
-        l1CaloSimSeq.gFEXDriver.gFEXSysSimTool.SCell=SCellType
+        #l1CaloSimSeq += CfgMgr.LVL1__gFEXDriver('gFEXDriver',
+        #    SCell=SCellType )
+        #l1CaloSimSeq.gFEXDriver.gSuperCellTowerMapperTool.SCell=SCellType
+        #l1CaloSimSeq.gFEXDriver.gFEXSysSimTool.SCell=SCellType
 
     ##################################################
     # Muons
-- 
GitLab


From 403644949cca5285a1dfb9a4c3d8c79a8ea9a4e4 Mon Sep 17 00:00:00 2001
From: Savanna Marie Shaw <savanna.marie.shaw@cern.ch>
Date: Fri, 10 Sep 2021 15:47:56 +0200
Subject: [PATCH 064/347] Updates for L2MuonSA new JO configuration

A couple of minor updates for the L2 SA new JO configuration:
- Properly configure the RPC RoI tool for running with enableL1MuonPhase1
- Remove instance 'addPublicTool' where it is no longer needed
---
 .../TrigL2MuonSA/python/TrigL2MuonSAConfig_newJO.py       | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAConfig_newJO.py b/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAConfig_newJO.py
index 72a8e964ec40..67ef990abdc7 100644
--- a/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAConfig_newJO.py
+++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/python/TrigL2MuonSAConfig_newJO.py
@@ -20,11 +20,12 @@ def RpcDataPreparatorCfg( flags, roisKey ):
 
     # Set Rpc data preparator for MuFast data preparator
     TrigL2MuonSA__RpcDataPreparator=CompFactory.getComp("TrigL2MuonSA::RpcDataPreparator")
+    from TrigT1MuonRecRoiTool.TrigT1MuonRecRoiToolConfig import getRun3RPCRecRoiTool
     RpcDataPreparator = TrigL2MuonSA__RpcDataPreparator()
-    acc.addPublicTool( RpcDataPreparator, primary=True ) # Now this is needed, but should be removed
+    RpcDataPreparator.TrigT1RPCRecRoiTool = getRun3RPCRecRoiTool(name="RPCRecRoiTool",useRun3Config=flags.Trigger.enableL1MuonPhase1)
     from RegionSelector.RegSelToolConfig import regSelTool_RPC_Cfg
     RpcDataPreparator.RegSel_RPC = acc.popToolsAndMerge( regSelTool_RPC_Cfg( flags ) )
- 
+
     return acc, RpcDataPreparator
 
 # Get Tgc data decoder for MuFast data preparator 
@@ -60,7 +61,6 @@ def CscDataPreparatorCfg( flags, roisKey ):
     TrigL2MuonSA__CscDataPreparator=CompFactory.getComp("TrigL2MuonSA::CscDataPreparator")
     CscDataPreparator = TrigL2MuonSA__CscDataPreparator()
 
-    acc.addPublicTool( CscDataPreparator, primary=True ) # This should be removed
 
     return acc, CscDataPreparator
 
@@ -71,7 +71,6 @@ def StgcDataPreparatorCfg( flags, roisKey ):
     # Set Stgc data preparator for MuFast data preparator
     TrigL2MuonSA__StgcDataPreparator=CompFactory.getComp("TrigL2MuonSA::StgcDataPreparator")
     StgcDataPreparator = TrigL2MuonSA__StgcDataPreparator()
-    acc.addPublicTool( StgcDataPreparator, primary=True ) # Now this is needed, but should be removed
     from RegionSelector.RegSelToolConfig import regSelTool_STGC_Cfg
     StgcDataPreparator.RegSel_STGC = acc.popToolsAndMerge( regSelTool_STGC_Cfg( flags ) )
 
@@ -86,7 +85,6 @@ def MmDataPreparatorCfg( flags, roisKey ):
     MmDataPreparator = TrigL2MuonSA__MmDataPreparator()
     from RegionSelector.RegSelToolConfig import regSelTool_MM_Cfg
     MmDataPreparator.RegSel_MM = acc.popToolsAndMerge( regSelTool_MM_Cfg( flags ) )
-    acc.addPublicTool( MmDataPreparator, primary=True ) # Now this is needed, but should be removed
 
     return acc, MmDataPreparator
 
-- 
GitLab


From 9a8ba379c57c501d2b04179336694ecade831a51 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Fri, 10 Sep 2021 17:30:50 +0200
Subject: [PATCH 065/347] Fix ATLASSIM-5394

Missed updating `FastChainSkeleton.EVGENtoRDO.py` as part of !46319.
---
 Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py b/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py
index 032dd781fc75..457c9d01f3a5 100644
--- a/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py
+++ b/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py
@@ -835,6 +835,7 @@ topSequence += CfgGetter.getAlgorithm("BeamEffectsAlg")
 collection_merger_alg = CfgGetter.getAlgorithm('ISF_CollectionMerger')
 
 SimKernel = CfgGetter.getAlgorithm(ISF_Flags.Simulator.KernelName())
+topSequence += SimKernel
 
 if ISF_Flags.HITSMergingRequired.anyOn():
     topSequence += collection_merger_alg
-- 
GitLab


From 4a2c74d05685162f81e015ac0631df3cbf23cd3a Mon Sep 17 00:00:00 2001
From: tstreble <thomas.strebler@cern.ch>
Date: Fri, 10 Sep 2021 18:37:35 +0200
Subject: [PATCH 066/347] Dynamically set ITk.Tracking flags depending on reco
 mode

---
 InnerDetector/InDetConfig/python/ITkConfigFlags.py     | 8 --------
 InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py | 8 ++++++++
 InnerDetector/InDetConfig/python/TrackingCutsFlags.py  | 1 +
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/InnerDetector/InDetConfig/python/ITkConfigFlags.py b/InnerDetector/InDetConfig/python/ITkConfigFlags.py
index 64df9b1cfbc0..dcb7be158f9b 100644
--- a/InnerDetector/InDetConfig/python/ITkConfigFlags.py
+++ b/InnerDetector/InDetConfig/python/ITkConfigFlags.py
@@ -66,12 +66,4 @@ def createITkConfigFlags():
   itkcf.addFlag("ITk.doRobustReco", False) # Switch for running Robust settings
   itkcf.addFlag("ITk.useNewSiSPSeededTF", False ) # Switch for using new SiSPSeededTrackFinder strategy
 
-  from InDetConfig.TrackingCutsFlags import createITkTrackingFlags, createITkLargeD0TrackingFlags, createITkConversionFindingTrackingFlags, createITkFastTrackingFlags, createITkLargeD0FastTrackingFlags
-
-  itkcf.addFlagsCategory ("ITk.Tracking", createITkTrackingFlags, prefix=True)
-  itkcf.addFlagsCategory ("ITk.LargeD0Tracking", createITkLargeD0TrackingFlags, prefix=True)
-  itkcf.addFlagsCategory ("ITk.ConversionFindingTracking", createITkConversionFindingTrackingFlags, prefix=True)
-  itkcf.addFlagsCategory ("ITk.FastTracking", createITkFastTrackingFlags, prefix=True)
-  itkcf.addFlagsCategory ("ITk.LargeD0FastTracking", createITkLargeD0FastTrackingFlags, prefix=True)
-
   return itkcf
diff --git a/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py b/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py
index e16076bd6427..47de8244cc9d 100644
--- a/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py
+++ b/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py
@@ -262,6 +262,14 @@ def ITkTrackRecoCfg(flags):
 
     from InDetConfig.ITkSiliconPreProcessing import ITkRecPreProcessingSiliconCfg
     result.merge(ITkRecPreProcessingSiliconCfg(flags))
+
+    from InDetConfig.TrackingCutsFlags import createITkTrackingFlags
+    createTrackingFlags = createITkTrackingFlags
+    if flags.ITk.doFastTracking:
+        from InDetConfig.TrackingCutsFlags import createITkFastTrackingFlags
+        createTrackingFlags = createITkFastTrackingFlags
+    flags.addFlagsCategory ("ITk.Tracking", createTrackingFlags, prefix=True)
+
     from InDetConfig.ITkTrackingSiPatternConfig import ITkTrackingSiPatternCfg
     result.merge(ITkTrackingSiPatternCfg(flags, [], "ResolvedTracks", "SiSPSeededTracks"))
     result.merge(ITkTrackParticleCnvAlgCfg(flags, TrackContainerName="ResolvedTracks"))
diff --git a/InnerDetector/InDetConfig/python/TrackingCutsFlags.py b/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
index 11a116d0dca1..9bc05fe90207 100644
--- a/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
+++ b/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
@@ -426,6 +426,7 @@ def createITkFastTrackingFlags():
     icf.nHolesGapMax          = [1]
     icf.minPTSeed             = 1.0 * Units.GeV
     icf.maxZImpactSeed        = 150.0 * Units.mm
+    icf.useITkStripSeeding    = False
 
     return icf
 
-- 
GitLab


From 690fcbc7e1a8295cd6d67788351348a7545b6d61 Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Sat, 11 Sep 2021 17:52:00 +0200
Subject: [PATCH 067/347] Update BeamPipe Section volume names

---
 .../python/G4PhysicsRegionConfig.py           | 41 ++++++++++++++++---
 .../python/G4PhysicsRegionConfigNew.py        | 27 +++++++++---
 .../G4AtlasTools/src/RegionCreator.cxx        | 14 +++++--
 Tools/PROCTools/python/RunTier0TestsTools.py  |  2 +-
 4 files changed, 69 insertions(+), 15 deletions(-)

diff --git a/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfig.py b/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfig.py
index 5073dbede5b1..e860a4769a1b 100644
--- a/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfig.py
+++ b/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfig.py
@@ -1,12 +1,30 @@
-# 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
 
+def getLHCRun():
+    from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags
+    from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags
+    if commonGeoFlags.Run()=="UNDEFINED":
+        if not geoFlags.isIBL():
+            return "RUN1"
+        else:
+            return "RUN2"
+    return commonGeoFlags.Run
+
+
 # Beampipe Regions
 def getBeampipeFwdCutPhysicsRegionTool(name='BeampipeFwdCutPhysicsRegionTool', **kwargs):
     kwargs.setdefault("RegionName", 'BeampipeFwdCut')
-    volumeList = ['BeamPipe::SectionF47', 'BeamPipe::SectionF48', 'BeamPipe::SectionF61']
+    currentRun = getLHCRun()
+    volumeList = []
+    if currentRun in ["RUN1"]:
+        volumeList = ['BeamPipe::SectionF47', 'BeamPipe::SectionF48', 'BeamPipe::SectionF61']
+    else:
+        volumeList = ['BeamPipe::SectionF198', 'BeamPipe::SectionF199', 'BeamPipe::SectionF200']
+        if currentRun not in ["RUN2", "RUN3", "RUN4"]:
+            print('BeampipeFwdCutPhysicsRegionToolCfg: WARNING check that RUN2 beampipe volume names are correct for this geometry tag')
     kwargs.setdefault("VolumeList",  volumeList)
     from G4AtlasApps.SimFlags import simFlags
     if simFlags.BeamPipeSimMode() == "FastSim":
@@ -33,7 +51,13 @@ def getBeampipeFwdCutPhysicsRegionTool(name='BeampipeFwdCutPhysicsRegionTool', *
 
 def getFWDBeamLinePhysicsRegionTool(name='FWDBeamLinePhysicsRegionTool', **kwargs):
     kwargs.setdefault("RegionName", 'FWDBeamLine')
-    volumeList = ['BeamPipe::SectionF46']
+    currentRun = getLHCRun()
+    if currentRun in ["RUN1"]:
+        volumeList = ['BeamPipe::SectionF46']
+    else:
+        volumeList = ['BeamPipe::SectionF197']
+        if currentRun not in ["RUN2", "RUN3", "RUN4"]:
+            print('getFWDBeamLinePhysicsRegionTool: WARNING check that RUN2 beampipe volume names are correct for this geometry tag')
     kwargs.setdefault("VolumeList",  volumeList)
     return CfgMgr.RegionCreator(name, **kwargs)
 
@@ -191,8 +215,15 @@ def getPreSampLArPhysicsRegionTool(name='PreSampLArPhysicsRegionTool', **kwargs)
 def getDeadMaterialPhysicsRegionTool(name='DeadMaterialPhysicsRegionTool', **kwargs):
     kwargs.setdefault("RegionName", 'DeadMaterial')
     volumeList = []
-    sectionList = list(range(16,49)) # does not include 49
-    sectionList += [ 51, 52, 53, 54 ]
+    currentRun = getLHCRun()
+    sectionList = []
+    if currentRun in ["RUN1"]:
+        sectionList = list(range(16,49)) # does not include 49
+        sectionList += [ 51, 52, 53, 54 ]
+    else:
+        sectionList = list(range(191,200)) # does not include 200
+        if currentRun not in ["RUN2", "RUN3", "RUN4"]:
+            print('getDeadMaterialPhysicsRegionTool: WARNING check that RUN2 beampipe volume names are correct for this geometry tag')
     for section in sectionList:
         volumeList += ['BeamPipe::SectionF'+str(section)]
     volumeList += ['LArMgr::LAr::Endcap::Cryostat::Cylinder',
diff --git a/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfigNew.py b/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfigNew.py
index 70b097cb3370..900cd79a9e27 100644
--- a/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfigNew.py
+++ b/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfigNew.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 AthenaConfiguration.ComponentFactory import CompFactory
 
@@ -7,7 +7,13 @@ RegionCreator=CompFactory.RegionCreator
 # Beampipe Regions
 def BeampipeFwdCutPhysicsRegionToolCfg(ConfigFlags, name='BeampipeFwdCutPhysicsRegionTool', **kwargs):
     kwargs.setdefault("RegionName", 'BeampipeFwdCut')
-    volumeList = ['BeamPipe::SectionF47', 'BeamPipe::SectionF48', 'BeamPipe::SectionF61']
+    volumeList = []
+    if ConfigFlags.GeoModel.Run in ["RUN1"]:
+        volumeList = ['BeamPipe::SectionF47', 'BeamPipe::SectionF48', 'BeamPipe::SectionF61']
+    else:
+        volumeList = ['BeamPipe::SectionF198', 'BeamPipe::SectionF199', 'BeamPipe::SectionF200']
+        if ConfigFlags.GeoModel.Run not in ["RUN2", "RUN3", "RUN4"]:
+            print('BeampipeFwdCutPhysicsRegionToolCfg: WARNING check that RUN2 beampipe volume names are correct for this geometry tag')
     kwargs.setdefault("VolumeList",  volumeList)
 
     if ConfigFlags.Sim.BeamPipeSimMode == "FastSim":
@@ -34,7 +40,12 @@ def BeampipeFwdCutPhysicsRegionToolCfg(ConfigFlags, name='BeampipeFwdCutPhysicsR
 
 def FWDBeamLinePhysicsRegionToolCfg(ConfigFlags, name='FWDBeamLinePhysicsRegionTool', **kwargs):
     kwargs.setdefault("RegionName", 'FWDBeamLine')
-    volumeList = ['BeamPipe::SectionF46']
+    if ConfigFlags.GeoModel.Run in ["RUN1"]:
+        volumeList = ['BeamPipe::SectionF46']
+    else:
+        volumeList = ['BeamPipe::SectionF197']
+        if ConfigFlags.GeoModel.Run not in ["RUN2", "RUN3", "RUN4"]:
+            print('FWDBeamLinePhysicsRegionToolCfg: WARNING check that RUN2 beampipe volume names are correct for this geometry tag')
     kwargs.setdefault("VolumeList",  volumeList)
     return RegionCreator(name, **kwargs)
 
@@ -208,8 +219,14 @@ def PreSampLArPhysicsRegionToolCfg(ConfigFlags, name='PreSampLArPhysicsRegionToo
 def DeadMaterialPhysicsRegionToolCfg(ConfigFlags, name='DeadMaterialPhysicsRegionTool', **kwargs):
     kwargs.setdefault("RegionName", 'DeadMaterial')
     volumeList = []
-    sectionList = list(range(16,49)) # does not include 49
-    sectionList += [ 51, 52, 53, 54 ]
+    sectionList = []
+    if ConfigFlags.GeoModel.Run in ["RUN1"]:
+        sectionList = list(range(16,49)) # does not include 49
+        sectionList += [ 51, 52, 53, 54 ]
+    else:
+        sectionList = list(range(191,200)) # does not include 200
+        if ConfigFlags.GeoModel.Run not in ["RUN2", "RUN3", "RUN4"]:
+            print('DeadMaterialPhysicsRegionToolCfg: WARNING check that RUN2 beampipe volume names are correct for this geometry tag')
     for section in sectionList:
         volumeList += ['BeamPipe::SectionF'+str(section)]
     volumeList += ['LArMgr::LAr::Endcap::Cryostat::Cylinder',
diff --git a/Simulation/G4Atlas/G4AtlasTools/src/RegionCreator.cxx b/Simulation/G4Atlas/G4AtlasTools/src/RegionCreator.cxx
index 0b4df2983041..50dd5a39ca83 100644
--- a/Simulation/G4Atlas/G4AtlasTools/src/RegionCreator.cxx
+++ b/Simulation/G4Atlas/G4AtlasTools/src/RegionCreator.cxx
@@ -41,21 +41,27 @@ void RegionCreator::Construct()
   G4Region* theRegion=new G4Region(m_regionName.value());
 
   // loop over volumes and fish for those in the list
-  int nVolumes = 0;
+  size_t nVolumes{0};
   G4LogicalVolumeStore* logStore=G4LogicalVolumeStore::GetInstance();
-  for (const auto& vol: m_logicalVolumes)
+  for (const auto& vol: m_logicalVolumes) {
+    size_t nVolumesCurrent{0};
     for (auto* it: *logStore)
       {
 
         if (vol == static_cast<const std::string&>(it->GetName()))
           {
-            nVolumes++;
+            nVolumesCurrent++;
             it->SetRegion(theRegion);
             theRegion->AddRootLogicalVolume(it);
           }
       }
+    if (nVolumesCurrent==0) {
+      ATH_MSG_WARNING("No volumes matching \"" << vol << "\" found in G4 LogicalVolumeStore. " << m_regionName.value() << " G4PhysicsRegion may not behave as intended.");
+    }
+    nVolumes += nVolumesCurrent;
+  }
 
-  ATH_MSG_INFO(" a total of "<<nVolumes<<" volumes was assigned to region "<<m_regionName.value() );
+  ATH_MSG_INFO("A total of "<<nVolumes<<" volumes was assigned to region "<<m_regionName.value() );
 
   // create a G4ProductionCuts object and set appropriate values
   G4ProductionCuts* cuts=new G4ProductionCuts();
diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py
index bba36c350af5..ccabca200d7b 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'           : 'v11',
+                's3505-22.0'           : 'v12',
                 # OverlayTier0Test_required-test
                 'overlay-d1498-21.0'   : 'v2',
                 'overlay-d1498-22.0'   : 'v38',
-- 
GitLab


From 3d06cca0b43fa784ad34c767ef8604a89e560efa Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Sat, 11 Sep 2021 20:17:45 +0200
Subject: [PATCH 068/347] Disable old-style MDT DQ postprocessing

---
 DataQuality/DataQualityUtils/CMakeLists.txt   |    1 -
 .../DataQualityUtils/MonitoringFile.h         |   52 +-
 .../python/DQPostProcessMod.py                |    2 -
 .../src/MonitoringFile_MDTPostProcess.cxx     | 1984 -----------------
 4 files changed, 2 insertions(+), 2037 deletions(-)
 delete mode 100644 DataQuality/DataQualityUtils/src/MonitoringFile_MDTPostProcess.cxx

diff --git a/DataQuality/DataQualityUtils/CMakeLists.txt b/DataQuality/DataQualityUtils/CMakeLists.txt
index ef01bc9e43e5..f164228e7126 100644
--- a/DataQuality/DataQualityUtils/CMakeLists.txt
+++ b/DataQuality/DataQualityUtils/CMakeLists.txt
@@ -22,7 +22,6 @@ atlas_add_library( DataQualityUtils
                    src/MonitoringFile.cxx
                    src/MonitoringFile_CSCPostProcess.cxx
                    src/MonitoringFile_RPCPostProcess.cxx
-                   src/MonitoringFile_MDTPostProcess.cxx
                    src/MonitoringFile_TGCPostProcess.cxx
                    src/MonitoringFile_MDTvsTGCPostProcess.cxx
                    src/MonitoringFile_PPFileWrapper.cxx
diff --git a/DataQuality/DataQualityUtils/DataQualityUtils/MonitoringFile.h b/DataQuality/DataQualityUtils/DataQualityUtils/MonitoringFile.h
index d3952e454b5d..2e7d5b51a0c1 100644
--- a/DataQuality/DataQualityUtils/DataQualityUtils/MonitoringFile.h
+++ b/DataQuality/DataQualityUtils/DataQualityUtils/MonitoringFile.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 dqutilsMonitoringFile_h
@@ -183,55 +183,7 @@ namespace dqutils {
     static void MuonTrackPostProcess(std::string inFileName, bool isIncremental = false);
     static void MuonTrack_Main(std::string inFileName, TString dirname);
 
-    //For Muon MDT
-    static void  MDTPostProcess(std::string inFilename, int txtFileOutputType = 0);
-    static void  MDTChamReAlign(std::string inFilename, std::string title="MDT");
-    static void  MDTChamEff(std::string inFilename,  std::string title="MDT", int txtFileOutputType = 0 );
-    static void  MDTChamOcc(std::string inFilename, std::string title="MDT");
-    static void  MDTTDCSum(std::string inFilename, std::string title="MDT");
-    static void  MDTLowStat(std::string inFilename, std::string title="MDT");
-    static bool  MDTCheckAlign(std::string inFilename, std::string title="MDT");
-    static bool  MDTCheck(std::string inFilename);
-    static void MDTTubeEff(const TString & dirName, const TH1F*, const TH1F*, TH1F*, float &countsML1, float &countsML2, float &entriesML1, float &entriesML2);
-    static void MDT2DHWName(TString, TString &, TString &, TString &, TString &, TString &);
-    static void MDTFitTDC(TH1F* h, double &t0, double &t0Err, double &tmax, double &tmaxErr);
-    static void MDTSetMetaData(TDirectory* targetDir, TH1* h1, TH1* h2=0, TH1* h3=0);
-    static void MDTSet2DRangeZ(TH2F* h);
-    static void MDTResetContents(TH2F* h);
-    static void MDTFinalizeWriteTH1FChar(TH1F* h);
-    static double     fittzero(double *, double *);
-    static double     fittmax(double *, double *);
-    static void GetTubeLength(double & tubeLength, TString dirName);
-    static TString returnString(int a);
-    static TString returnString(double a);
-    static TString ConvertTubeVectorToString(std::vector<int> & v, TH1F* h, TString chamber);
-    static TString ConvertLayerVectorToString(std::vector<int> & v, TString chamber);
-    static TString ConvertMezzVectorToString(std::vector<int> & v, TH1F* h, TString chamber);
-    static TString ConvertVectorToString(std::vector<int> & v);
-    static TString TubeID_to_ID_L_ML(int & tubeID, const TString & hardware_name, int totalTubes);
-    static TString Layer_to_L_ML(int & tubeID, const TString & hardware_name);
-    static TString Mezz_to_ML_mezz(int tubeID, const TString & hardware_name, int totalTubes);
-    static bool tdcSort(const TH1* h1, const TH1* h2);
-    class MDTPostProcessor : public TFile { //class to keep keep track of histograms we collect
-    public:
-      MDTPostProcessor(std::string inFilename, std::string name);
-      ~MDTPostProcessor(); //delete all objects accessed from the TFile whose SetDirectory(0)
-
-      //function to automatically getObject, obj->SetDirectory(target), if target==0 save target for future deletion
-      //option to supply baseDir to get object from subdir of TFile rather than from TFile itself
-      //target if nothing is supplied thatn the object will be set to 0 (protects against f->Write() writing unintended copies of your histogram
-      template <class T>
-      void get(const char* namecycle, T* &ptr, TDirectory* baseDir=0, TDirectory* target=0); //use TDirectory->GetObject(const char* namecycle, void* &ptr);
-      void setDirectory(TH1* h, TDirectory* dir = 0);
-      void setDirectory(TH2* h, TDirectory* dir = 0);
-      void setMetaData(TDirectory* targetDir, TH1* h1, TH1* h2=0, TH1* h3=0);
-      void error();//call this function if you want the underlying TFile not to write i.e. recover error in program
-    private:
-      std::set<TObject*> m_garbage;
-      std::string m_name;
-      bool m_error;
-    };
-
+    //For RPC
     static void  RPCPostProcess(std::string inFilename, bool isIncremental = false);
     static bool  RPCCheckHistogram(TFile* f, const char* HistoName);
 
diff --git a/DataQuality/DataQualityUtils/python/DQPostProcessMod.py b/DataQuality/DataQualityUtils/python/DQPostProcessMod.py
index 8ca7ff85f13e..78f1e1b0b057 100644
--- a/DataQuality/DataQualityUtils/python/DQPostProcessMod.py
+++ b/DataQuality/DataQualityUtils/python/DQPostProcessMod.py
@@ -186,8 +186,6 @@ def DQPostProcess( outFileName, isIncremental=False ):
                   ['michele.bianco@le.infn.it', 'monica.verducci@cern.ch']),
                  (mdt_create,
                   ['john.stakely.keller@cern.ch', 'monica.verducci@cern.ch']),
-                 (mf.MDTPostProcess,
-                  ['john.stakely.keller@cern.ch']),
                  (mf.TGCPostProcess,
                   ['lyuan@ihep.ac.cn', 'kingmgl@stu.kobe-u.ac.jp']),
                  (mf.MDTvsTGCPostProcess,
diff --git a/DataQuality/DataQualityUtils/src/MonitoringFile_MDTPostProcess.cxx b/DataQuality/DataQualityUtils/src/MonitoringFile_MDTPostProcess.cxx
deleted file mode 100644
index b4c9697cad31..000000000000
--- a/DataQuality/DataQualityUtils/src/MonitoringFile_MDTPostProcess.cxx
+++ /dev/null
@@ -1,1984 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/////////////////////////////////////////////////////////////////////////////////////////////////
-//Method Process MDT Offline Histos After Merging
-//Author Justin Griffiths griffith@cern.ch
-//       Orin Harris omh@cern.ch
-//Created Apr 2009
-//Aug 2009 Major Update To Communicate w/ Database
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-#include "DataQualityUtils/MonitoringFile.h"
-
-#include <iostream>
-#include <algorithm>
-#include <fstream>
-#include <cmath>
-#include <cstdlib>
-#include <sstream>
-#include <stdio.h>
-#include <map>
-#include <iomanip>
-#include <set>
-
-#include "TH1F.h"
-#include "TH2F.h"
-#include "TFile.h"
-#include "TClass.h"
-#include "TKey.h"
-#include "TMath.h"
-#include "TF1.h"
-#include "TTree.h"
-#include "TBranch.h"
-#include "TList.h"
-
-#include "DataQualityUtils/MdtDeadNoisyUtils.h"
-
-namespace dqutils {
-
-void MonitoringFile::MDTPostProcess( std::string inFilename, int txtFileOutputType ) 
-{    
-	//    std::cout << "Running MDT post processing \n" ;
-
-	bool goodMDTFile = MonitoringFile::MDTCheck( inFilename );
-
-	if(goodMDTFile){
-		MonitoringFile::MDTChamReAlign( inFilename );
-		MonitoringFile::MDTChamEff( inFilename, "MDT", txtFileOutputType );
-		MonitoringFile::MDTChamOcc( inFilename );
-		MonitoringFile::MDTTDCSum( inFilename );
-		MonitoringFile::MDTLowStat( inFilename );
-	}    
-	else std::cout << "No MDT Directory!" << std::endl;
-
-	//     std::cout << "\n";
-	//     std::cout << "Finish MDT analysis"<<std::endl;
-	return;
-}
-
-void MonitoringFile::MDTChamReAlign(std::string inFilename, std::string title){
-	//    std::cout << "Begin ReAlign MDT Chamber by Chamber Plots" << std::endl;
-
-	if(MDTCheckAlign(inFilename, title)) {/*std::cout << "File Already Aligned. Exiting..." << std::endl;*/ return;}
-
-	TFile* f = TFile::Open(inFilename.c_str(),"UPDATE");
-
-	if (f == 0) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Input file not opened \n";
-		return;
-	}
-	if(f->GetSize()<1000.) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Input file empty \n";
-		return; 
-	}
-
-	TIter nextcd0(f->GetListOfKeys());
-	while(TKey *key0 = dynamic_cast<TKey*> (nextcd0())){
-		// Following can never test true, since while would fail.
-		// In fact loop breaks at this point, may not be desired behavior.
-		// Coverity 16305
-		//if (key0 == 0) continue;
-		TDirectory *dir0= dynamic_cast<TDirectory*> (key0->ReadObj());
-		if (dir0 == 0) return;
-
-		TString runNumber = dir0->GetName();
-		TString mDir = runNumber+"/Muon/MuonRawDataMonitoring/" + title;
-		TDirectory* mdt_base_dir = f->GetDirectory(mDir);
-		if (! mdt_base_dir) continue;
-		TIter nextcd1(mdt_base_dir->GetListOfKeys());
-		//  std::cout << mDir << std::endl;                                                                                                                          
-		while(TKey* key1 = dynamic_cast<TKey*>(nextcd1())) {//While in BA/EA/BC/EC                                                                   
-			TString ecap_fullStr = mDir+"/"+key1->GetName();
-			TDirectory* dir1 = f->GetDirectory(ecap_fullStr);
-			if(!dir1) continue;
-			dir1->cd();
-			//Determine which directory to put new folders into
-			if(strncmp(key1->GetName(),"Sum",2)==0)continue;
-			if(strncmp(key1->GetName(),"Ove",2)==0)continue;
-			if(gDirectory->GetDirectory("Chambers")) gDirectory->cd("Chambers");
-			else if(gDirectory->GetDirectory("Chamber")) gDirectory->cd("Chamber");
-
-			dir1 = gDirectory;
-			TIter nextcd2(gDirectory->GetListOfKeys());
-
-			TString metadataName;
-			//The following if is a relic the else is what is likely to occur
-			if(!(strncmp(key1->GetName(),dir1->GetName(),2)==0)) metadataName = mDir+"/"+key1->GetName()+"/"+gDirectory->GetName()+"/metadata";
-			else metadataName = mDir +"/"+key1->GetName()+"/metadata";
-			TTree* metadata = 0; (f->GetObject(metadataName,metadata));
-			char nameData[99];
-			char intervalData[99];
-			char chainData[99];
-			char mergeData[99];
-			TBranch* b_nameData;
-			TBranch* b_intervalData;
-			TBranch* b_chainData;
-			TBranch* b_mergeData;
-
-			if(metadata){
-				metadata->SetBranchAddress("Interval",intervalData,&b_intervalData);
-				metadata->SetBranchAddress("Name",nameData,&b_nameData);
-				metadata->SetBranchAddress("TriggerChain",chainData,&b_chainData);
-				metadata->SetBranchAddress("MergeMethod",mergeData,&b_mergeData);
-			}
-
-			int treeCounter = 0;
-			TTree* metadata_new = 0;
-			OutputMetadata* outputmd = 0;
-			TKey* key2 = 0;
-			TDirectory* chambDir = 0;
-			TDirectory* lastChamb = 0;
-
-			while( (key2 = dynamic_cast<TKey*> (nextcd2()) ) != 0){
-				if(strncmp(key2->GetName(),"metadata",5)==0){
-					continue;
-				}
-				if(metadata) {metadata->GetEntry(treeCounter); ++treeCounter;}
-				TString name = key2->GetName();
-				if(TClass::GetClass(key2->GetClassName())->InheritsFrom("TDirectory")) { continue; }
-				TString chamberName = name(0,7);
-
-				if(!(chambDir = dir1->GetDirectory(chamberName))) {
-					//First Save the new TTree to the last directory
-					if(metadata_new){ 
-						if(lastChamb) lastChamb->cd();
-						metadata_new->Write();
-						delete metadata_new;
-					}
-					chambDir = dir1->mkdir(chamberName);
-					if(!chambDir) chambDir = dir1->GetDirectory(chamberName);
-					//Create New MetaData to be stored later;
-					metadata_new = new TTree( "metadata", "Monitoring Metadata" );
-					metadata_new->SetDirectory(0);
-					delete outputmd;
-					outputmd = new OutputMetadata( metadata_new );
-				}
-				lastChamb = chambDir;
-				chambDir->cd();
-				TH1* obj = dynamic_cast<TH1*> (dir1->Get(key2->GetName()));
-				TH1* obj2 = dynamic_cast<TH1*> (chambDir->Get(key2->GetName()));
-				if(obj2 && obj) { obj->Add(obj2); }
-				if(obj) { obj->SetFillColor(42); obj->Write("",TObject::kOverwrite); }
-				dir1->cd();
-				delete obj;
-				if(obj2) delete obj2;
-				key2->Delete();
-				if(outputmd) outputmd->fill(nameData,intervalData,chainData,mergeData);
-			}
-			//Fill the metadata for the last directories
-			if(metadata_new && chambDir) {chambDir->cd(); metadata_new->Write(); }
-
-			TIter nextcd3(dir1->GetListOfKeys());
-			TKey* key3 = 0;
-			//Delete Straglers (1 Folder for each of BA/BC/EA/EC)
-			while( (key3 = dynamic_cast<TKey*> (nextcd3()) ) != 0){
-				TString histName = key3->GetName();
-				if(!TClass::GetClass(key3->GetClassName())->InheritsFrom("TDirectory")) { key3->Delete();}
-			}
-			delete outputmd;
-		}
-	}
-
-	f->Close();
-	//    std::cout << "End ReAlign MDT Chamber by Chamber Plots" << std::endl;
-	delete f;
-	return;
-}
-
-void MonitoringFile::MDTChamEff( std::string inFilename, std::string title, int txtFileOutputType) {
-	//const float m_noiseCut = 100000;
-	//if(isIncremental || useOfflineTubeID || makePDF || doAllPDF){ std::cout << "dead code " << std::endl;}	
-	
-	MDTPostProcessor mf( inFilename, "ChamberEff Calculations");
-
-	if ( !mf.IsOpen() ) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Input file not opened \n";
-		return;
-	}
-	if(mf.GetSize()<1000.) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Input file empty \n";
-		return; 
-	}
-
-	int numAllTubes = 0;
-	int numDeadTubes = 0;
-	int numDeadTubes_All = 0;
-	int numNoisyTubes = 0;
-	int numAllMezz = 0;
-	int numDeadMezz = 0;
-	int numAllLayers = 0;
-	int numDeadLayers = 0;
-	int numAllML = 0;
-	int numDeadML = 0;
-	int numDeadChambers = 0;
-	int totBA = 331; int totBC = 329;
-    int totEA = 257; int totEC = 257; //assuming 7 EEA chambers, 31 EEC chambers
-	int numAllChambers = totBA + totBC + totEA + totEC;
-
-	////////////////////////////////////////////////////////////////////////////////////////////////////
-
-	TIter next_run ( mf.GetListOfKeys() );
-	TKey* key_run(0);
-	while ((key_run = dynamic_cast<TKey*> ( next_run() )) !=0 ) {
-		TString run_dir = key_run->GetName();
-		////Needed for Database
-		int runNumber_int = TString(run_dir(4,run_dir.Length()-4)).Atoi();
-		if(runNumber_int<0) std::cerr << "Bad Run Number " << runNumber_int << std::endl;
-		int ChannelIdCounter = 0;
-		////
-
-		if (!run_dir.Contains("run") )   continue;
-		//Compute Tube Effs
-		TString chamber_Area = run_dir + "/Muon/MuonRawDataMonitoring/"+title+"/";
-
-		if(mf.GetDirectory(chamber_Area)) mf.cd(chamber_Area);
-		//else {std::cerr << "No MDT Directory! " << std::endl; f->Close() ; delete f; return; }
-		else {std::cout << "No MDT Directory! " << std::endl; mf.error(); return; }
-		TIter next_ecap(gDirectory->GetListOfKeys());
-		TDirectory* dir_Overview = mf.GetDirectory(chamber_Area+"Overview/");
-
-		//Get Global Chamber Effs
-		if(!dir_Overview) continue;
-		bool EffG = true;
-		TH2F* EffBCap = 0; 
-		TH2F* EffECap = 0; 
-		mf.get("EffsInBarrelPerChamber_ADCCut", EffBCap, dir_Overview);
-		mf.get("EffsInEndCapPerChamber_ADCCut", EffECap, dir_Overview);
-		if( !EffBCap ) mf.get("effsInBarrelPerChamber_ADCCut", EffBCap, dir_Overview); 
-		if( !EffECap ) mf.get("effsInEndCapPerChamber_ADCCut", EffECap, dir_Overview); 
-
-		//We get the noise and bkgrd hist from the MDT folder, thus nTriggers must come from there as well
-		TH1F* hNTriggers = 0; mf.get(run_dir + "/Muon/MuonRawDataMonitoring/MDT/Overview/TotalNumber_of_MDT_hits_per_event_ADCCut",hNTriggers);
-		int nTriggers = 1;
-		if(hNTriggers) {
-			nTriggers = (int) hNTriggers->GetEntries();
-		}
-
-		std::map<TString, int> nTubes_map;
-
-		//Get number_of_Chambers_with_hits_per_event, number_of_Chambers_with_hits_per_event_ADCCut, TotalNumber_of_MDT_hits_per_event_big, TotalNumber_of_MDT_hits_per_event_big_ADCCut
-		//...for the purpose of changing their directory/metadata
-		TH1F* hNumChambHitsPerEvt = 0; 
-		TH1F* hNumChambHitsPerEvtADCCut = 0;
-		TH1F* hTotNumMDTHitsPerEvtBig = 0;  
-		TH1F* hTotNumMDTHitsPerEvtBigADCCut = 0;  
-		mf.get("number_of_Chambers_with_hits_per_event", hNumChambHitsPerEvt, dir_Overview);
-		mf.get("number_of_Chambers_with_hits_per_event_ADCCut", hNumChambHitsPerEvtADCCut, dir_Overview);
-		mf.get("TotalNumber_of_MDT_hits_per_event_big", hTotNumMDTHitsPerEvtBig, dir_Overview);
-		mf.get("TotalNumber_of_MDT_hits_per_event_big_ADCCut", hTotNumMDTHitsPerEvtBigADCCut, dir_Overview);
-
-		////////////////////////////////////////////////////////////////////////////////////////////////////
-		///////Create Noisy/Dead element histos and noise rate//////////////////////////////////////////////
-		////////////////////////////////////////////////////////////////////////////////////////////////////
-		TH1F* hDeadElements = new TH1F("MDTDeadElements","MDTDeadElements",1,0,1);
-		//TH1F* hNoisyElements = new TH1F("MDTNoisyElements","MDTNoisyElements",1,0,1);
-		//TH1F* hNoiseRate = new TH1F("TubeRate","TubeRate; Rate [kHz]; counts",1000,0,100);
-		TDirectory* dir_Overview_expert = dir_Overview->GetDirectory("Expert");
-		if(!dir_Overview_expert) dir_Overview_expert = dir_Overview->mkdir("Expert");
-		mf.setMetaData(dir_Overview_expert,hDeadElements);
-		//mf.setMetaData(dir_Overview_expert,hNoisyElements);
-		// Create new directory for all the noise/bkd rate info
-		//TDirectory* dir_Overview_expert_noisebkd = dir_Overview_expert->GetDirectory("Noise_Bkgrd_Rate");
-		//if(!dir_Overview_expert_noisebkd) dir_Overview_expert_noisebkd = dir_Overview_expert->mkdir("Noise_Bkgrd_Rate");
-		//mf.setMetaData(dir_Overview_expert_noisebkd,hNoiseRate);
-		////////////////////////////////////////////////////////////////////////////////////////////////////
-		///////Finish Creating histos Noisy/Dead elements///////////////////////////////////////////////////
-		////////////////////////////////////////////////////////////////////////////////////////////////////      
-
-		TH2F* EffECap_N = 0; 
-		TH2F* EffBCap_N = 0; 
-
-		// Create chamber volume map, for weighting occupancy plots
-		TH2F * VolumeMapBCap = 0;
-		TH2F * VolumeMapECap = 0;
-		//TH2F * VolumeMapBCap_noisecut = 0;
-		//TH2F * VolumeMapECap_noisecut = 0;
-
-		// new occ plots, hits/evt/chamber-volume
-		TH2F* EvtTubeNormOccBCap = 0;
-		TH2F* EvtTubeNormOccECap = 0;
-		//TH2F* EvtTubeNormOccNoiseCutBCap = 0;
-		//TH2F* EvtTubeNormOccNoiseCutECap = 0;
-		// raw hits/evt occ plots
-		TDirectory* dir_Overview_expert_RawHits = dir_Overview_expert->GetDirectory("RawHitsPerChamber");
-		if(!dir_Overview_expert_RawHits) dir_Overview_expert_RawHits = dir_Overview_expert->mkdir("RawHitsPerChamber");
-		TH2F* EvtOccBCap = 0;
-		TH2F* EvtOccECap = 0;
-		//TH2F* EvtOccNoiseCutBCap = 0;
-		//TH2F* EvtOccNoiseCutECap = 0;
-
-		// noise vs eff hists
-		/*TH1F* EffVSNoise_num = new TH1F("EffVSNoise_num","Tube eff_num vs tube noise rate",50,0,1000);
-      mf.setDirectory(EffVSNoise_num);
-      TH1F* EffVSNoise_den = new TH1F("EffVSNoise_den","Tube eff_den vs tube noise rate",50,0,1000);
-      mf.setDirectory(EffVSNoise_den);
-      TH1F* EffVSNoise_ADCCut_num = new TH1F("EffVSNoise_ADCCut_num","Tube eff_num vs tube (ADC>80) noise rate",50,0,1);
-      mf.setDirectory(EffVSNoise_ADCCut_num);
-      TH1F* EffVSNoise_ADCCut_den = new TH1F("EffVSNoise_ADCCut_den","Tube eff_den vs tube (ADC>80) noise rate",50,0,1);
-      mf.setDirectory(EffVSNoise_ADCCut_den);
-      TH1F* EffVSBkd_num = new TH1F("EffVSBkd_num","Tube eff_num vs tube (ADC>80) bkd rate",50,0,1);
-      mf.setDirectory(EffVSBkd_num);
-      TH1F* EffVSBkd_den = new TH1F("EffVSBkd_den","Tube eff_den vs tube (ADC>80) bkd rate",50,0,1);
-      mf.setDirectory(EffVSBkd_den);
-
-      //Plots to Fill Noise/Bkgrd Occupancy
-      TH2F* NoiseBCap = 0;
-      TH2F* NoiseECap = 0;
-      TH2F* BkgrdBCap = 0;
-      TH2F* BkgrdECap = 0;*/
-
-		if(!EffBCap || !EffECap) { std::cerr << "MDT: No Global Eff Plots" << std::endl; EffG=false; }
-		if(EffG) {
-			MDTResetContents(EffBCap);
-			MDTResetContents(EffECap);	
-			// Create chamber volume map, for weighting occupancy plots
-			VolumeMapBCap = (TH2F*) EffBCap->Clone();
-			VolumeMapECap = (TH2F*) EffECap->Clone();
-			VolumeMapBCap->SetName("VolumeMapBarrel");
-			VolumeMapBCap->SetTitle("Volume Map (#tubes*tubeVol in m^3) Barrel");
-			VolumeMapECap->SetName("VolumeMapEndcap");
-			VolumeMapECap->SetTitle("Volume Map (#tubes*tubeVol in m^3) Endcap");
-			mf.setMetaData(dir_Overview_expert, VolumeMapBCap, VolumeMapECap);
-			/*VolumeMapBCap_noisecut = (TH2F*) EffBCap->Clone();
-	VolumeMapECap_noisecut = (TH2F*) EffECap->Clone();
-	VolumeMapBCap_noisecut->SetName("VolumeMapBarrel_noisecut");
-	VolumeMapBCap_noisecut->SetTitle("Volume Map (m^3) Barrel, 100KHz noise cut");
-	VolumeMapECap_noisecut->SetName("VolumeMapEndcap_noisecut");
-	VolumeMapECap_noisecut->SetTitle("Volume Map (m^3) Endcap, 100KHz noise cut");
-	mf.setMetaData(dir_Overview_expert, VolumeMapBCap_noisecut, VolumeMapECap_noisecut);*/
-			EffBCap_N = (TH2F*) EffBCap->Clone();
-			EffECap_N = (TH2F*) EffECap->Clone();
-			mf.setDirectory(EffBCap_N);
-			mf.setDirectory(EffECap_N);
-			/*NoiseBCap = (TH2F*) EffBCap->Clone();
-	NoiseECap = (TH2F*) EffECap->Clone();
-	NoiseBCap->SetName("AverageNoisePerTubeBarrel");
-	NoiseBCap->SetTitle("Avg # noise-hits/evt/m^3 Barrel");
-	NoiseECap->SetName("AverageNoisePerTubeEndcap");
-	NoiseECap->SetTitle("Avg # noise-hits/evt/m^3 Endcap");
-	mf.setMetaData(dir_Overview_expert_noisebkd, NoiseBCap, NoiseECap);
-	BkgrdBCap = (TH2F*) EffBCap->Clone();
-	BkgrdECap = (TH2F*) EffECap->Clone();
-	BkgrdBCap->SetName("AverageBkgrdPerTubeBarrel");
-	BkgrdBCap->SetTitle("Avg # bkgrd-hits/evt/m^3 Barrel");
-	BkgrdECap->SetName("AverageBkgrdPerTubeEndcap");
-	BkgrdECap->SetTitle("Avg # bkgrd-hits/evt/m^3 Endcap");
-	mf.setMetaData(dir_Overview_expert_noisebkd, BkgrdECap, BkgrdBCap);*/
-			// Raw hits per event
-			EvtOccBCap = (TH2F*) EffBCap->Clone();
-			EvtOccECap = (TH2F*) EffECap->Clone();
-			EvtOccBCap->SetName("HitsPerEvtInBarrelPerChamber_ADCCut");
-			EvtOccBCap->SetTitle("Avg # hits/evt Barrel, ADCCut");
-			EvtOccECap->SetName("HitsPerEvtInEndCapPerChamber_ADCCut");
-			EvtOccECap->SetTitle("Avg # hits/evt Endcap, ADCCut");
-			mf.setMetaData(dir_Overview_expert_RawHits, EvtOccBCap, EvtOccECap);
-			/*EvtOccNoiseCutBCap = (TH2F*) EffBCap->Clone();
-	EvtOccNoiseCutECap = (TH2F*) EffECap->Clone();
-	EvtOccNoiseCutBCap->SetName("HitsPerEvtInBarrelPerChamber_ADCCut_NoiseCut");
-	EvtOccNoiseCutBCap->SetTitle("Avg # hits/evt Barrel, ADCCut, 100KHz noise cut");
-	EvtOccNoiseCutECap->SetName("HitsPerEvtInEndCapPerChamber_ADCCut_NoiseCut");
-	EvtOccNoiseCutECap->SetTitle("Avg # hits/evt Endcap, ADCCut, 100KHz noise cut");
-	mf.setMetaData(dir_Overview_expert_RawHits, EvtOccNoiseCutBCap, EvtOccNoiseCutECap);*/
-		}
-		while( TKey* key_ecap = dynamic_cast<TKey*> (next_ecap()) ) {//BA,BC,EA,EC
-			if(strncmp(key_ecap->GetName(),"Overvi",6)==0) continue;	    
-			if(strncmp(key_ecap->GetName(),"Summar",6)==0) continue;	    
-			TString ecap_str = key_ecap->GetName();
-			TString ecap_fullStr = ecap_str;
-			ecap_str = ecap_str(3,2);
-			TString ecapPath_str = chamber_Area+ecap_fullStr+"/Chambers";
-
-			//	TDirectory* dir1 = f->GetDirectory(ecapPath_str);
-			TDirectory* dir1 = mf.GetDirectory(ecapPath_str);
-			if(!dir1) continue;
-			TIter next_cham(dir1->GetListOfKeys());
-			TString overview_str = chamber_Area+ecap_fullStr+"/Overview/";
-			//	TDirectory* dir_Overview_local = f->GetDirectory(overview_str);
-			TDirectory* dir_Overview_local = mf.GetDirectory(overview_str);
-			//Get Local Chamber Effs
-			bool EffL = true;
-			bool EffInner_old = true; // protect agains pre-BIR/BIM separation
-			TH2F* EffExtra = 0;
-			TH2F* EffInner = 0;
-			TH2F* EffMiddle = 0;
-			TH2F* EffOuter = 0;
-			TH2F* EffExtra_N = 0;
-			TH2F* EffInner_N = 0;
-			TH2F* EffMiddle_N = 0;
-			TH2F* EffOuter_N = 0;
-
-			TString ecap_fullStr_lower = "mdt"+ecap_str;
-			TH1F* heff = new TH1F(ecap_fullStr_lower+"_TUBE_eff",ecap_fullStr_lower+"_TUBE_eff",100,0,1);
-			TH1F* heffML = new TH1F(ecap_fullStr_lower+"_ML_eff",ecap_fullStr_lower+"_ML_eff",50,0,1);
-			//Histogram To Trivially measure coverage per tube
-
-			if(dir_Overview_local){
-				mf.get("EffsIn"+ecap_str+"InnerPerMultiLayer_ADCCut",EffInner,dir_Overview_local); 
-				mf.get("EffsIn"+ecap_str+"MiddlePerMultiLayer_ADCCut",EffMiddle,dir_Overview_local); 
-				mf.get("EffsIn"+ecap_str+"OuterPerMultiLayer_ADCCut",EffOuter,dir_Overview_local); 
-				mf.get("EffsIn"+ecap_str+"ExtraPerMultiLayer_ADCCut",EffExtra,dir_Overview_local); 
-				if(!EffInner)  mf.get("effsIn"+ecap_str+"InnerPerMultiLayer_ADCCut",EffInner,dir_Overview_local); 
-				if(!EffMiddle) mf.get("effsIn"+ecap_str+"MiddlePerMultiLayer_ADCCut",EffMiddle,dir_Overview_local); 
-				if(!EffOuter)  mf.get("effsIn"+ecap_str+"OuterPerMultiLayer_ADCCut",EffOuter,dir_Overview_local); 
-				if(!EffExtra)  mf.get("effsIn"+ecap_str+"ExtraPerMultiLayer_ADCCut",EffExtra,dir_Overview_local); 
-			}
-			if(!EffExtra || !EffInner || ! EffMiddle || !EffOuter) { std::cerr << "No Local Chamber Eff Plots" << std::endl; EffL = false;}
-
-			if(EffL) {
-				MDTResetContents((TH2F*)EffExtra); MDTResetContents((TH2F*)EffOuter); MDTResetContents((TH2F*)EffMiddle); MDTResetContents((TH2F*)EffInner);
-				EffExtra_N = (TH2F*) EffExtra->Clone();
-				EffInner_N = (TH2F*) EffInner->Clone();
-				EffMiddle_N = (TH2F*) EffMiddle->Clone();
-				EffOuter_N = (TH2F*) EffOuter->Clone();
-				mf.setDirectory(EffExtra_N);
-				mf.setDirectory(EffInner_N);
-				mf.setDirectory(EffMiddle_N);
-				mf.setDirectory(EffOuter_N);
-				if(EffInner->GetNbinsY() == 36) EffInner_old = false;
-			}
-
-			std::vector<TString> chamberNames_vec;
-			std::vector<float> chamberHits_vec;//get median value of hits per chamber in order to count HV off chambers
-			while( TKey* key_cham = (TKey*) (next_cham()) ){//Chamber Folders
-				if(strncmp(key_cham->GetName(),"meta",4)==0) continue;
-				TString chamberStr = chamber_Area+ecap_fullStr+"/Chambers/"+key_cham->GetName();
-				TDirectory* dirChamb = mf.GetDirectory(chamberStr);
-				if(!dirChamb) continue;
-				if(!(dirChamb)->InheritsFrom("TDirectory")) continue;
-				TString dirName = dirChamb->GetName();
-				chamberNames_vec.push_back(dirName);
-				TH1F* tube = 0; mf.get(dirName+"_MDT_Station_TUBE_ADCCut",tube,dirChamb);
-				if(tube) {
-					chamberHits_vec.push_back((float) tube->GetEntries());	  
-				}
-			}	
-			std::sort( chamberHits_vec.begin(), chamberHits_vec.end() );
-			double medianChamberHits = 0; 
-			unsigned nChambers_ = chamberHits_vec.size();
-			if(nChambers_%2==0 && nChambers_ > 2) medianChamberHits = (chamberHits_vec.at(nChambers_/2) + chamberHits_vec.at(nChambers_/2 + 1))/nChambers_;
-			else if(nChambers_>0) medianChamberHits = chamberHits_vec.at(nChambers_/2);
-			int chamberCounter = 0;
-			for(std::vector<TString>::const_iterator chamberStrItr = chamberNames_vec.begin(); chamberStrItr != chamberNames_vec.end(); ++chamberStrItr, ++chamberCounter){
-				TString dirName = *chamberStrItr;
-				TDirectory* dirChamb = mf.GetDirectory(chamber_Area+ecap_fullStr+"/Chambers/"+dirName);
-				if(!dirChamb) continue;
-				if(dirName=="BML6A13"||dirName=="BML6C13") continue;//These chambers do not exist
-
-
-				////////////////////////////////////////////////////////////////////////////////////////////////////
-				//////Dead Noisy Tube Calculations
-				////////////////////////////////////////////////////////////////////////////////////////////////////
-				////Arbitrary counter for database file
-				bool hvOff = false;
-				bool noDeadLayer = true; //flag to determine if chamber has dead ml,l, or mezz
-				ChannelIdCounter++;
-				TH1F* den = 0; mf.get(dirName+"_MDT_Station_EFFENTRIES",den,dirChamb);
-				TH1F* num = 0; mf.get(dirName+"_MDT_Station_EFFCOUNTS",num,dirChamb);
-				TH1F* tube = 0; mf.get(dirName+"_MDT_Station_TUBE_ADCCut",tube,dirChamb);
-				unsigned numTubesInChamber = tube->GetNbinsX();
-
-				////////////////////////////////////////////////////////////////////////////////////////////////////
-				//////FillBackground Plots Calculations
-				////////////////////////////////////////////////////////////////////////////////////////////////////
-
-				if(tube){
-					if( (dirName.BeginsWith("BIS8") || dirName.BeginsWith("BE"))) {
-						if(tube->GetEntries() < 0.01 * medianChamberHits + 0.1) hvOff = true;
-					} else if ( tube->GetEntries() < 0.07 * medianChamberHits + 0.1  ) hvOff = true;
-					
-					//TH1F* noise_clone = (TH1F*) noise->Clone();
-					//noise_clone->Scale(1./nTriggers/300.*1e9);
-					//TH1F* bkgrd_clone = (TH1F*) bkgrd->Clone();
-					//bkgrd_clone->Scale(1./nTriggers/300.*1e9);
-					//int nTubes_noiseCut = 0;
-					//int nHits_noiseCut = 0;
-					int nHits = (int)tube->GetEntries();
-
-					/*for( int ibin = 1; ibin != bkgrd_clone->GetNbinsX()+1; ++ibin){
-                       if(noise_clone->At(ibin) <= m_noiseCut) {
-                        nTubes_noiseCut++;
-                        nHits_noiseCut += (int)tube->At(ibin);
-                       }
-                     }*/
-
-					// For filling Bkgrd/Noise Occupancy plots
-					TString xAxis = dirName(0,1)+dirName(4,1)+dirName(3,1);
-					TString yAxis = dirName(1,1)+","+dirName(5,2);
-					//Seperate BIR/MXA11/15
-					if( EffG && (dirName(0,3) == "BIR" || dirName(0,3) == "BIM") && (dirName(5,2) == "11" || dirName(5,2) == "15" ) && VolumeMapBCap->GetNbinsY() >= 58){
-						yAxis += ",";
-						yAxis += dirName(2,1);
-					}
-					//BML[45][AC]13-->BML[56][AC]13
-					if( EffG && dirName(0,3) == "BML" && TString(dirName(3,1)).Atoi() >= 4 && dirName(5,2) == "13" && VolumeMapBCap->GetNbinsY() >= 58 ){
-						xAxis = dirName(0,1) + dirName(4,1) + returnString( TString(dirName(3,1)).Atoi() + 1 );
-					}
-					//BME1[AC]14 (mistake - is actually 13 - so account for both cases!) -->BML4[AC]13
-					if( EffG && dirName(0,3) == "BME" && VolumeMapBCap->GetNbinsY() >= 58 ){
-						xAxis = dirName(0,1) + dirName(4,1) + "4";
-						yAxis = "M,13";
-					}
-                                        if(EffG && dirName(0,3) == "BMF"){
-                                                xAxis = dirName(0,1) + dirName(4,1) + returnString(TString(dirName(3,1)).Atoi()*2-1);
-                                        
-                                        } 
-					double tubeLength = 4.9615;
-					double tubeRadiusScale = 1;
-					// 	    double maxTubeLengthBarrel = 4961.5;  // just FYI
-					// 	    double maxTubeLengthEndcap = 5941.5;  // just FYI 
-					GetTubeLength(tubeLength,dirName);    // should always fill tubeLength
-					if(dirName(0,3) == "BME" || dirName(0,3) == "BMG") tubeRadiusScale = 0.25;
-					double chamb_vol = (double)numTubesInChamber*tubeLength*0.0006881*tubeRadiusScale;   // 0.0006881 m2 = pi*tube_r^2
-					// BME tubes are half the radius = 1/4 the volume/
-					//double noiseCut_vol = (double)nTubes_noiseCut*tubeLength*0.0006881*tubeRadiusScale; // these represent the total volume in (m3) covered by the tubes in the chamber
-
-					// Fill volume maps regardless of whether the chamber is called dead
-					if (EffG) {
-						if(xAxis.BeginsWith("B")) {
-							VolumeMapBCap->Fill(xAxis,yAxis,chamb_vol);
-							//VolumeMapBCap_noisecut->Fill(xAxis,yAxis,noiseCut_vol);
-						}
-						else {
-							VolumeMapECap->Fill(xAxis,yAxis,chamb_vol);
-							//VolumeMapECap_noisecut->Fill(xAxis,yAxis,noiseCut_vol);
-						}
-					}
-
-					// Only do the rest if chamber is not called dead
-					if( !hvOff ) {
-						TString eta_ring = dirName(0,2) + dirName(4,1);
-						TString eta_stat = dirName(3,1);
-                                                if(dirName(0,3)=="BMF") eta_stat = returnString(TString(dirName(3,1)).Atoi()*2-1);
-						if(eta_stat=="5"||eta_stat=="6"||eta_stat=="7"||eta_stat=="8") eta_ring+="5,6";
-						if(eta_stat=="3"||eta_stat=="4") eta_ring+="3,4";
-						if(eta_stat=="1"||eta_stat=="2"||eta_stat=="0") eta_ring+="1,2";
-						//float noise_rate = 0;
-						//float noise_hits = 0;
-						//float bkgrd_rate = 0;
-						//float bkgrd_hits = 0;
-
-						/*for( int ibin = 1; ibin != bkgrd_clone->GetNbinsX()+1; ++ibin){
-                            hNoiseRate->Fill(noise_clone->At(ibin)/1000.);
-                            if(noise_clone->At(ibin) <= m_noiseCut) {
-                                noise_rate += noise_clone->At(ibin);
-                                bkgrd_rate += bkgrd_clone->At(ibin);
-                                noise_hits += noise->At(ibin);
-                                bkgrd_hits += bkgrd->At(ibin);
-                            }
-                        }*/
-
-						if (EffG) {
-							if(xAxis.BeginsWith("B")) {
-								//NoiseBCap->Fill(xAxis, yAxis, noise_hits / ((double)nTriggers) );
-								//BkgrdBCap->Fill(xAxis, yAxis, bkgrd_hits / ((double)nTriggers) );     
-								EvtOccBCap->Fill(        xAxis, yAxis, nHits          / ((double)nTriggers) );
-								//EvtOccNoiseCutBCap->Fill(xAxis, yAxis, nHits_noiseCut / ((double)nTriggers) );
-							}
-							else {
-								//NoiseECap->Fill(xAxis, yAxis, noise_hits / ((double)nTriggers) );
-								//BkgrdECap->Fill(xAxis, yAxis, bkgrd_hits / ((double)nTriggers) );     
-								EvtOccECap->Fill(        xAxis, yAxis, nHits          / ((double)nTriggers) );
-								//EvtOccNoiseCutECap->Fill(xAxis, yAxis, nHits_noiseCut / ((double)nTriggers) );
-							}
-						}
-
-						//std::map<TString,float>::iterator noise_itr = noise_map.find(eta_ring);
-						//std::map<TString,float>::iterator bkgrd_itr = bkgrd_map.find(eta_ring);
-						//std::map<TString,int>::iterator nTubes_itr = nTubes_map.find(eta_ring);
-						/*if( noise_itr == noise_map.end() ) noise_map.insert(std::make_pair(eta_ring,noise_rate));
-                         else (*noise_itr).second += noise_rate;
-                         if( bkgrd_itr == bkgrd_map.end() ) bkgrd_map.insert(std::make_pair(eta_ring,bkgrd_rate));
-                         else (*bkgrd_itr).second += bkgrd_rate;
-                         if( nTubes_itr == nTubes_map.end() ) nTubes_map.insert(std::make_pair(eta_ring,nTubes_noiseCut));
-                         else (*nTubes_itr).second += nTubes_noiseCut;
-						 */
-						////////////////////////////////////////////////////////////////////////////////////////////////////
-						//////End FillBackground Plots Calculations
-						//////Next do Efficiencies
-						////////////////////////////////////////////////////////////////////////////////////////////////////
-
-						TH1F* eff = new TH1F(dirName+"_MDT_Station_EFFPERTUBE",dirName+"_MDT_Station_EFFPERTUBE; tubeID; Number of Entries",numTubesInChamber,1,numTubesInChamber+1);
-						mf.setMetaData(dirChamb,eff);
-						if(!eff || !num || !den) continue;
-
-						float countsML1, countsML2, entriesML1, entriesML2;
-						MDTTubeEff(dirName,num,den,eff,countsML1,countsML2,entriesML1,entriesML2);
-						//Fill heff if no dead layer,ML, or Mezz
-						if(noDeadLayer) {
-							for(int ibin = 1; ibin != eff->GetNbinsX(); ++ibin) {
-								if( den->At(ibin) > 10 ) heff->Fill( (num->At(ibin))/(den->At(ibin)) ); 
-							}
-						}
-
-						///Set the char labels for the efficiency plots
-						TString stateta_IMO_c; TString statphi_IMO_c; TString stateta_c; TString statphi_c; TString statphi_c2;
-						MDT2DHWName(dirName,  stateta_IMO_c,  statphi_IMO_c,  stateta_c,  statphi_c,  statphi_c2);
-						//correct for BI[R/M][A/C][11/15]
-						//Move BML[4,5][A/C]13-->BML[5,6][A/C]13
-						stateta_IMO_c = xAxis;
-						statphi_IMO_c = yAxis;
-
-						if(EffG){
-							if( entriesML1 + entriesML2 > 10 ) {
-								if(ecap_str(0,1)=="B") {
-									EffBCap->Fill(stateta_IMO_c,statphi_IMO_c,countsML1+countsML2);
-									EffBCap_N->Fill(stateta_IMO_c,statphi_IMO_c,entriesML1+entriesML2);
-								}
-								else {
-									EffECap->Fill(stateta_IMO_c,statphi_IMO_c,countsML1+countsML2);
-									EffECap_N->Fill(stateta_IMO_c,statphi_IMO_c,entriesML1+entriesML2);
-								}
-							}
-						}
-						if(EffL){
-							if(dirName(1,1)=="E") {
-								if( entriesML1 > 10 ) {
-									EffExtra->Fill(stateta_c, statphi_c, countsML1);
-									EffExtra_N->Fill(stateta_c, statphi_c, entriesML1);	  
-								}
-								if( entriesML2 > 10 ) {
-									if(dirName(1,0)=="E"){
-										EffExtra->Fill(stateta_c, statphi_c2, countsML2);
-										EffExtra_N->Fill(stateta_c,statphi_c2, entriesML2);
-									}
-								}
-							}
-							if(dirName(1,1)=="I" && (!EffInner_old || dirName(0,1)=="E")) {
-								if( entriesML1 > 10 ) {
-									EffInner->Fill(stateta_c, statphi_c, countsML1);
-									EffInner_N->Fill(stateta_c, statphi_c, entriesML1);	  
-								}
-								if( entriesML2 > 10 ) {
-									EffInner->Fill(stateta_c, statphi_c2, countsML2);
-									EffInner_N->Fill(stateta_c,statphi_c2, entriesML2);
-								}
-							}
-							if(dirName(1,1)=="M") {
-								if( entriesML1 > 10 ) {
-									EffMiddle->Fill(stateta_c, statphi_c, countsML1);
-									EffMiddle_N->Fill(stateta_c, statphi_c, entriesML1);	  
-								}
-								if( entriesML2 > 10 ) {
-									EffMiddle->Fill(stateta_c, statphi_c2, countsML2);
-									EffMiddle_N->Fill(stateta_c,statphi_c2, entriesML2);
-								}
-							}
-							if(dirName(1,1)=="O") {
-								if( entriesML1 > 10 ) {
-									EffOuter->Fill(stateta_c, statphi_c, countsML1);
-									EffOuter_N->Fill(stateta_c, statphi_c, entriesML1);	  
-								}
-								if( entriesML2 > 10 ) {
-									EffOuter->Fill(stateta_c, statphi_c2, countsML2);
-									EffOuter_N->Fill(stateta_c,statphi_c2, entriesML2);
-								}
-							}
-						}
-						dirChamb->cd();
-						eff->Write("",TObject::kOverwrite); 
-						//Write to the file periodically
-						//Wish we didn't have to do this
-						//	      if(ChannelIdCounter%20==0) mf.Write();
-						if(noDeadLayer) { if( entriesML2 > 10 ) heffML->Fill(countsML2/entriesML2); if( entriesML1 > 10 ) heffML->Fill(countsML1/entriesML1); }
-					}
-					//delete bkgrd_clone;
-					//delete noise_clone;
-				}
-			}//Chamber Folders
-			if(EffL && dir_Overview_local){
-				dir_Overview_local->cd();
-				heff->Write("",TObject::kOverwrite);
-				heffML->Write("",TObject::kOverwrite);
-				EffExtra->Divide(EffExtra_N);
-				EffInner->Divide(EffInner_N);
-				EffMiddle->Divide(EffMiddle_N);
-				EffOuter->Divide(EffOuter_N);
-				//Only Write Histogram if it originally had 36 y-axis bins
-				if(ecap_str(0,1)=="E") {EffInner->Write("",TObject::kOverwrite); }
-				else if(!EffInner_old) {EffInner->Write("",TObject::kOverwrite); }
-				else delete EffInner_N;
-				EffMiddle->Write("",TObject::kOverwrite);
-				EffOuter->Write("",TObject::kOverwrite);
-				EffExtra->Write("",TObject::kOverwrite);
-			}
-		}//End BA,BC,EA,EC
-		if(EffG){
-			if(dir_Overview_expert){ 
-				dir_Overview_expert->cd();
-				// Few histos moving to expert dir
-				mf.setMetaData(dir_Overview_expert, hNumChambHitsPerEvt, hNumChambHitsPerEvtADCCut);
-				if(hTotNumMDTHitsPerEvtBigADCCut && hTotNumMDTHitsPerEvtBig) mf.setMetaData(dir_Overview_expert, hTotNumMDTHitsPerEvtBig, hTotNumMDTHitsPerEvtBigADCCut);
-				hNumChambHitsPerEvt->Write("",TObject::kOverwrite);
-				hNumChambHitsPerEvtADCCut->Write("",TObject::kOverwrite);
-				if(hTotNumMDTHitsPerEvtBig) hTotNumMDTHitsPerEvtBig->Write("",TObject::kOverwrite);
-				if(hTotNumMDTHitsPerEvtBigADCCut) hTotNumMDTHitsPerEvtBigADCCut->Write("",TObject::kOverwrite);
-				// Chamber volume maps // these are used below -- make sure they are left before the writes below
-				// 	  VolumeMapBCap->Scale(1./VolumeMapBCap->GetMaximum());
-				MDTSet2DRangeZ(VolumeMapBCap);
-				VolumeMapBCap->Write("",TObject::kOverwrite);
-				// 	  VolumeMapECap->Scale(1./VolumeMapECap->GetMaximum());
-				MDTSet2DRangeZ(VolumeMapECap);
-				VolumeMapECap->Write("",TObject::kOverwrite);
-				// 	  VolumeMapBCap_noisecut->Scale(1./VolumeMapBCap_noisecut->GetMaximum());
-				//MDTSet2DRangeZ(VolumeMapBCap_noisecut);
-				//VolumeMapBCap_noisecut->Write("",TObject::kOverwrite);
-				// 	  VolumeMapECap_noisecut->Scale(1./VolumeMapECap_noisecut->GetMaximum());
-				//MDTSet2DRangeZ(VolumeMapECap_noisecut);
-				//VolumeMapECap_noisecut->Write("",TObject::kOverwrite);
-				// Hits per vol per event
-				EvtTubeNormOccBCap = (TH2F*) EvtOccBCap->Clone();
-				EvtTubeNormOccECap = (TH2F*) EvtOccECap->Clone();
-				EvtTubeNormOccBCap->SetName("NormedHitsInBarrelPerChamber_ADCCut");
-				EvtTubeNormOccBCap->SetTitle("Avg # hits/evt/m^3 Barrel, ADCCut");
-				EvtTubeNormOccECap->SetName("NormedHitsInEndCapPerChamber_ADCCut");
-				EvtTubeNormOccECap->SetTitle("Avg # hits/evt/m^3 Endcap, ADCCut");
-				mf.setMetaData(dir_Overview, EvtTubeNormOccBCap, EvtTubeNormOccECap);
-				EvtTubeNormOccBCap->Divide(VolumeMapBCap);
-				MDTSet2DRangeZ(EvtTubeNormOccBCap);
-				EvtTubeNormOccBCap->Write("",TObject::kOverwrite);
-				EvtTubeNormOccECap->Divide(VolumeMapECap);
-				MDTSet2DRangeZ(EvtTubeNormOccECap);
-				EvtTubeNormOccECap->Write("",TObject::kOverwrite);
-			}
-			/*if(dir_Overview) {
-                dir_Overview->cd();
-                // Hits per vol per event, noise cut
-                EvtTubeNormOccNoiseCutBCap = (TH2F*) EvtOccNoiseCutBCap->Clone();
-                EvtTubeNormOccNoiseCutECap = (TH2F*) EvtOccNoiseCutECap->Clone();
-                EvtTubeNormOccNoiseCutBCap->SetName("NormedHitsInBarrelPerChamber_ADCCut_NoiseCut");
-                EvtTubeNormOccNoiseCutBCap->SetTitle("Avg # hits/evt/m^3 Barrel, ADCCut, 100KHz noise cut");
-                EvtTubeNormOccNoiseCutECap->SetName("NormedHitsInEndCapPerChamber_ADCCut_NoiseCut");
-                EvtTubeNormOccNoiseCutECap->SetTitle("Avg # hits/evt/m^3 Endcap, ADCCut, 100KHz noise cut");
-                mf.setMetaData(dir_Overview, EvtTubeNormOccNoiseCutBCap, EvtTubeNormOccNoiseCutECap);
-                EvtTubeNormOccNoiseCutBCap->Divide(VolumeMapBCap_noisecut);
-                MDTSet2DRangeZ(EvtTubeNormOccNoiseCutBCap);
-	  EvtTubeNormOccNoiseCutBCap->Write("",TObject::kOverwrite);
-	  EvtTubeNormOccNoiseCutECap->Divide(VolumeMapECap_noisecut);
-	  MDTSet2DRangeZ(EvtTubeNormOccNoiseCutECap);
-	  EvtTubeNormOccNoiseCutECap->Write("",TObject::kOverwrite);
-	}
-	if(dir_Overview_expert_noisebkd){
-	  dir_Overview_expert_noisebkd->cd();
-	  NoiseBCap->Divide(VolumeMapBCap_noisecut);
-	  MDTSet2DRangeZ(NoiseBCap);
-	  NoiseBCap->Write("",TObject::kOverwrite);
-	  NoiseECap->Divide(VolumeMapECap_noisecut);
-	  MDTSet2DRangeZ(NoiseECap);
-	  NoiseECap->Write("",TObject::kOverwrite);
-	  BkgrdBCap->Divide(VolumeMapBCap_noisecut);
-	  MDTSet2DRangeZ(BkgrdBCap);
-	  BkgrdBCap->Write("",TObject::kOverwrite);
-	  BkgrdECap->Divide(VolumeMapECap_noisecut);
-	  MDTSet2DRangeZ(BkgrdECap);
-	  BkgrdECap->Write("",TObject::kOverwrite);
-	}*/
-			if(dir_Overview_expert_RawHits) {
-				dir_Overview_expert_RawHits->cd();
-				// Raw hits per event (don't divide by volume map)
-				MDTSet2DRangeZ(EvtOccBCap);
-				EvtOccBCap->Write("",TObject::kOverwrite);
-				MDTSet2DRangeZ(EvtOccECap);
-				EvtOccECap->Write("",TObject::kOverwrite);
-				//MDTSet2DRangeZ(EvtOccNoiseCutBCap);
-				//EvtOccNoiseCutBCap->Write("",TObject::kOverwrite);
-				//MDTSet2DRangeZ(EvtOccNoiseCutECap);
-				//EvtOccNoiseCutECap->Write("",TObject::kOverwrite);
-			}
-		}
-
-		// make corresponding summary text file
-		if(txtFileOutputType > 0) {
-			std::ofstream txtfile;
-			std::string textfilename = inFilename + ".Summary.txt";
-			txtfile.open(textfilename.c_str(), std::ios::app);	
-			if( txtfile.is_open() ) {
-				txtfile.precision(3);
-				txtfile << "************************************************************************************************" << std::endl;
-				txtfile << "**** Global summary of dead/noisy analysis: " << std::endl;
-				txtfile << "******** Tubes:       " << std::setw(8) << numAllTubes << ",  Dead: " << std::setw(8) << std::fixed << 100.0 * (double)numDeadTubes / (double)numAllTubes << "%,  Noisy: " << std::setw(8) << 100.0 * (numAllTubes > 0 ? (double)numNoisyTubes / (double)numAllTubes : 0) << "%" << std::endl;
-				txtfile << "******** Mezzanines:  " << std::setw(8) << numAllMezz << ",  Dead: " << std::setw(8) << std::fixed << 100.0 * (numAllMezz > 0 ? (double)numDeadMezz / (double)numAllMezz : 0) << "%,  Noisy: " << std::setw(9) << "n/a" << std::endl;
-				txtfile << "******** Layers:      " << std::setw(8) << numAllLayers << ",  Dead: " << std::setw(8) << std::fixed << 100.0 * (numAllLayers > 0 ? (double)numDeadLayers / (double)numAllLayers : 0) << "%,  Noisy: " << std::setw(9) << "n/a" << std::endl;
-				txtfile << "******** Multilayers: " << std::setw(8) << numAllML << ",  Dead: " << std::setw(8) << std::fixed << 100.0 * (numAllML > 0 ? (double)numDeadML / (double)numAllML : 0) << "%,  Noisy: " << std::setw(9) << "n/a" << std::endl;	  
-				txtfile << "******** Chambers:    " << std::setw(8) << numAllChambers << ",  Dead: " << std::setw(8) << std::fixed << 100.0 * (numAllChambers > 0 ? (double)numDeadChambers / (double)numAllChambers : 0) << "%,  Noisy: " << std::setw(9) << "n/a" << std::endl;	    
-				txtfile.close();
-			}
-		}
-		//Fill Dead element info
-		hDeadElements->Fill("Chambers",numDeadChambers);
-		hDeadElements->Fill("MultiLayers",numDeadML);
-		hDeadElements->Fill("Layers",numDeadLayers);
-		hDeadElements->Fill("Mezzanines",numDeadMezz);
-		hDeadElements->Fill("Tubes",numDeadTubes);
-		hDeadElements->Fill("AllTubes",numDeadTubes_All);
-		/*hNoisyElements->Fill("Chambers",0);
-		hNoisyElements->Fill("MultiLayers",0);
-		hNoisyElements->Fill("Layers",0);
-		hNoisyElements->Fill("Mezzanines",0);
-		hNoisyElements->Fill("Tubes",numNoisyTubes);
-		//Fill Bkgrd/Noise Info
-		TH1F* bkgrd_summary = new TH1F("bkgrd_summary","Background Rate; Region; average rate per tube [Hz]",1,0,1);
-		TH1F* noise_summary = new TH1F("noise_summary","Noise Rate; Region; average rate per tube [Hz]",1,0,1);
-		mf.setMetaData(dir_Overview_expert_noisebkd, bkgrd_summary, noise_summary);
-		TH1F* BA_bkgrd = new TH1F("BA_bkgrd","Background Rate in Eta Rings BA; Eta Ring; average rate per tube [Hz]",1,0,1);
-		TH1F* BA_noise = new TH1F("BA_noise","Noise Rate in Eta Rings BA; Eta Ring; average rate per tube [Hz]",1,0,1);
-		mf.setMetaData(dir_Overview_expert_noisebkd, BA_bkgrd, BA_noise);
-		TH1F* BC_bkgrd = new TH1F("BC_bkgrd","Background Rate in Eta Rings BC; Eta Ring; average rate per tube [Hz]",1,0,1);
-		TH1F* BC_noise = new TH1F("BC_noise","Noise Rate in Eta Rings BC; Eta Ring; average rate per tube [Hz]",1,0,1);
-		mf.setMetaData(dir_Overview_expert_noisebkd, BC_bkgrd, BC_noise);
-		TH1F* EA_bkgrd = new TH1F("EA_bkgrd","Background Rate in Eta Rings EA; Eta Ring; average rate per tube [Hz]",1,0,1);
-		TH1F* EA_noise = new TH1F("EA_noise","Noise Rate in Eta Rings EA; Eta Ring; average rate per tube [Hz]",1,0,1);
-		mf.setMetaData(dir_Overview_expert_noisebkd, EA_bkgrd, EA_noise);
-		TH1F* EC_bkgrd = new TH1F("EC_bkgrd","Background Rate in Eta Rings EC; Eta Ring; average rate per tube [Hz]",1,0,1);
-		TH1F* EC_noise = new TH1F("EC_noise","Noise Rate in Eta Rings EC; Eta Ring; average rate per tube [Hz]",1,0,1);
-		mf.setMetaData(dir_Overview_expert_noisebkd, EC_bkgrd, EC_noise);
-		float bkgrd_overall = 0; float bkgrd_BA = 0; float bkgrd_BC = 0; float bkgrd_EA = 0; float bkgrd_EC = 0;
-		float noise_overall = 0; float noise_BA = 0; float noise_BC = 0; float noise_EA = 0; float noise_EC = 0;
-		int nTubes_overall = 0; int nTubes_BA = 0; int nTubes_BC = 0; int nTubes_EA = 0; int nTubes_EC = 0;*/
-		/*for(std::map<TString,float>::const_iterator m_itr = bkgrd_map.begin(); m_itr != bkgrd_map.end(); ++m_itr){
-	TString eta_ring = (*m_itr).first;
-	float bkgrd = (*m_itr).second;
-	float noise = 0;
-	int nTubes = 0;
-	std::map<TString,float>::const_iterator n_itr = noise_map.find(eta_ring.Data());
-	std::map<TString,int>::const_iterator t_itr = nTubes_map.find(eta_ring.Data());
-	if( n_itr != noise_map.end()) noise = (*n_itr).second;
-	if( t_itr != nTubes_map.end()) nTubes = (*t_itr).second;
-	bkgrd_overall+=bkgrd;
-	noise_overall+=noise;
-	nTubes_overall+=nTubes;
-	if(eta_ring(0,1)=="B" && eta_ring(2,1)=="A") {
-	  bkgrd_BA+=bkgrd; noise_BA+=noise; nTubes_BA+=nTubes;
-	  if( eta_ring.Sizeof() >= 5 && eta_ring(1,1)!="E" && nTubes>0) {
-	    BA_bkgrd->Fill(eta_ring, bkgrd/nTubes);
-	    BA_noise->Fill(eta_ring, noise/nTubes);
-	  }
-	}
-	if(eta_ring(0,1)=="B" && eta_ring(2,1)=="C") {
-	  bkgrd_BC+=bkgrd; noise_BC+=noise; nTubes_BC+=nTubes;
-	  if( eta_ring.Sizeof() >= 5 && eta_ring(1,1)!="E" && nTubes>0) {
-	    BC_bkgrd->Fill(eta_ring, bkgrd/nTubes);
-	    BC_noise->Fill(eta_ring, noise/nTubes);
-	  }
-	}
-	if(eta_ring(0,1)=="E" && eta_ring(2,1)=="A") {
-	  bkgrd_EA+=bkgrd; noise_EA+=noise; nTubes_EA+=nTubes;
-	  if( eta_ring.Sizeof() >= 5 && eta_ring(1,1)!="E" && nTubes>0) {
-	    EA_bkgrd->Fill(eta_ring, bkgrd/nTubes);
-	    EA_noise->Fill(eta_ring, noise/nTubes);
-	  }
-	}
-	if(eta_ring(0,1)=="E" && eta_ring(2,1)=="C") {
-	  bkgrd_EC+=bkgrd; noise_EC+=noise; nTubes_EC+=nTubes;
-	  if( eta_ring.Sizeof() >= 5 && eta_ring(1,1)!="E" && nTubes>0) {
-	    EC_bkgrd->Fill(eta_ring, bkgrd/nTubes);
-	    EC_noise->Fill(eta_ring, noise/nTubes);
-	  }
-	}
-      }
-      if (nTubes_overall>0) {
-        bkgrd_summary->Fill("Overall",bkgrd_overall/nTubes_overall); 
-        noise_summary->Fill("Overall",noise_overall/nTubes_overall); 
-      }
-      if (nTubes_BA>0) {
-        bkgrd_summary->Fill("BA",bkgrd_BA/nTubes_BA); 
-        noise_summary->Fill("BA",noise_BA/nTubes_BA); 
-      }
-      if (nTubes_BC>0) {
-        bkgrd_summary->Fill("BC",bkgrd_BC/nTubes_BC); 
-        noise_summary->Fill("BC",noise_BC/nTubes_BC); 
-      }
-      if (nTubes_EA>0) {
-        bkgrd_summary->Fill("EA",bkgrd_EA/nTubes_EA); 
-        noise_summary->Fill("EA",noise_EA/nTubes_EA); 
-      }
-      if (nTubes_EC>0) {
-        bkgrd_summary->Fill("EC",bkgrd_EC/nTubes_EC); 
-        noise_summary->Fill("EC",noise_EC/nTubes_EC); 
-      }
-		 
-		EffVSNoise_num->Sumw2();
-		EffVSNoise_den->Sumw2();
-		TH1F* EffVSNoise = (TH1F*)EffVSNoise_num->Clone();
-		EffVSNoise->SetName("EffVSNoise");
-		EffVSNoise->SetTitle("Tube eff vs tube noise rate");
-		EffVSNoise->GetXaxis()->SetTitle("noise rate [KHz]");
-		EffVSNoise->GetYaxis()->SetTitle("eff");
-		EffVSNoise->Divide(EffVSNoise_num,EffVSNoise_den,1,1,"B");
-		mf.setMetaData(dir_Overview_expert_noisebkd,EffVSNoise);
-
-		EffVSNoise_ADCCut_num->Sumw2();
-		EffVSNoise_ADCCut_den->Sumw2();
-		TH1F* EffVSNoise_ADCCut = (TH1F*)EffVSNoise_ADCCut_num->Clone();
-		EffVSNoise_ADCCut->SetName("EffVSNoise_ADCCut");
-		EffVSNoise_ADCCut->SetTitle("Tube eff vs tube (ADC>80) noise rate");
-		EffVSNoise_ADCCut->GetXaxis()->SetTitle("noise rate [KHz]");
-		EffVSNoise_ADCCut->GetYaxis()->SetTitle("eff");
-		EffVSNoise_ADCCut->Divide(EffVSNoise_ADCCut_num,EffVSNoise_ADCCut_den,1,1,"B");
-		mf.setMetaData(dir_Overview_expert_noisebkd,EffVSNoise_ADCCut);
-
-		EffVSBkd_num->Sumw2();
-		EffVSBkd_den->Sumw2();
-		TH1F* EffVSBkd = (TH1F*)EffVSBkd_num->Clone();
-		EffVSBkd->SetName("EffVSBkd");
-		EffVSBkd->SetTitle("Tube eff vs tube (ADC>80) bkd rate");
-		EffVSBkd->GetXaxis()->SetTitle("background rate [KHz]");
-		EffVSBkd->GetYaxis()->SetTitle("eff");
-		EffVSBkd->Divide(EffVSBkd_num,EffVSBkd_den,1,1,"B");
-		mf.setMetaData(dir_Overview_expert_noisebkd,EffVSBkd);
-*/
-		if(dir_Overview_expert){
-			dir_Overview_expert->cd();
-			//MDTFinalizeWriteTH1FChar(hNoisyElements);
-			MDTFinalizeWriteTH1FChar(hDeadElements);
-		}
-/*
-		if(dir_Overview_expert_noisebkd && dir_Overview_expert){
-			dir_Overview_expert_noisebkd->cd();
-			hNoiseRate->Write("",TObject::kOverwrite);	
-			EffVSNoise->Write("",TObject::kOverwrite);
-			EffVSNoise_ADCCut->Write("",TObject::kOverwrite);
-			EffVSBkd->Write("",TObject::kOverwrite);
-			MDTFinalizeWriteTH1FChar(bkgrd_summary);
-			MDTFinalizeWriteTH1FChar(noise_summary);	
-			MDTFinalizeWriteTH1FChar(BA_bkgrd);
-			MDTFinalizeWriteTH1FChar(BA_noise);	
-			MDTFinalizeWriteTH1FChar(BC_bkgrd);
-			MDTFinalizeWriteTH1FChar(BC_noise);	
-			MDTFinalizeWriteTH1FChar(EA_bkgrd);
-			MDTFinalizeWriteTH1FChar(EA_noise);	
-			MDTFinalizeWriteTH1FChar(EC_bkgrd);
-			MDTFinalizeWriteTH1FChar(EC_noise);		
-		}
-*/
-		TDirectory* dir_Overview_expert_reco = dir_Overview_expert->GetDirectory("RecoMonitoring");
-		if(dir_Overview_expert_reco && dir_Overview_expert) {
-			dir_Overview_expert_reco->cd();	
-			// 2D eff histos -- divide and change metadata before writing to new reco dir
-			if (EffECap && EffBCap) {
-				EffECap->Divide(EffECap_N);
-				EffBCap->Divide(EffBCap_N);
-				mf.setMetaData(dir_Overview_expert_reco, EffECap, EffBCap);
-				EffECap->Write("",TObject::kOverwrite); 
-				EffBCap->Write("",TObject::kOverwrite); 	  
-			}
-		}
-		////////////////////////////////////////////////////////////////////////////////////////////////////
-	}//While loop over run_XXX directory
-
-	return;
-}
-
-// This function is for grabbing overview hists from raw and doing something to them, rather than going through a chamber-by-chamber loop
-void MonitoringFile::MDTChamOcc( std::string inFilename, std::string title ) {
-	MDTPostProcessor mf( inFilename , "ChamberOcc Calculations");
-	if (!mf.IsOpen()) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Input file not opened \n";
-		return;
-	}
-	if(mf.GetSize()<1000.) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Input file empty \n";
-		return; 
-	}
-
-	TIter next_run ( mf.GetListOfKeys() );
-	TKey* key_run(0);
-	while ((key_run = dynamic_cast<TKey*> ( next_run() )) !=0 ) {
-		TString run_dir = key_run->GetName();      
-		if (!run_dir.Contains("run") )   continue;
-
-		TDirectory* dir_Overview = mf.GetDirectory(run_dir + "/Muon/MuonRawDataMonitoring/"+title+"/Overview");
-		if(!dir_Overview) continue;
-		TH1F* hNTriggers = 0; mf.get("TotalNumber_of_MDT_hits_per_event_ADCCut",hNTriggers,dir_Overview);
-		int nTriggers = 1;
-		if(hNTriggers) {
-			nTriggers = (int) hNTriggers->GetEntries();
-		}
-
-		TString expert_Area = run_dir + "/Muon/MuonRawDataMonitoring/MDT/Overview/Expert";
-		TDirectory* dir_Overview_expert = mf.GetDirectory(expert_Area);
-
-		TString RecoMonArea = expert_Area+"/RecoMonitoring";
-		TDirectory* dir_Overview_expert_reco = mf.GetDirectory(RecoMonArea);
-		if(dir_Overview_expert_reco && dir_Overview_expert) {
-			dir_Overview_expert_reco->cd();
-			TH2F* OccBCap = 0; mf.get("NumberOfHitsInBarrelPerChamber_onSegm_ADCCut",OccBCap,dir_Overview_expert_reco); 
-			TH2F* OccECap = 0; mf.get("NumberOfHitsInEndCapPerChamber_onSegm_ADCCut",OccECap,dir_Overview_expert_reco); 
-			TH2F* VolumeMapBCap = 0; mf.get("VolumeMapBarrel",VolumeMapBCap,dir_Overview_expert); 
-			TH2F* VolumeMapECap = 0; mf.get("VolumeMapEndcap",VolumeMapECap,dir_Overview_expert); 
-			if( OccBCap && OccECap && VolumeMapBCap && VolumeMapECap ){
-				TH2F* OccBCap_norm = dynamic_cast<TH2F*> (OccBCap->Clone());
-				TH2F* OccECap_norm = dynamic_cast<TH2F*> (OccECap->Clone());
-				if (OccBCap_norm && OccECap_norm) {
-					OccBCap_norm->Scale(1./nTriggers);
-					OccBCap_norm->Divide(VolumeMapBCap);
-					OccBCap_norm->SetName("HitsPerEventInBarrelPerChamber_onSegm_ADCCut");
-					OccBCap_norm->SetTitle("Avg # hits-on-segm/evt/m^3 Barrel");
-					OccECap_norm->Scale(1./nTriggers);	  
-					OccECap_norm->Divide(VolumeMapECap);
-					OccECap_norm->SetName("HitsPerEventInEndCapPerChamber_onSegm_ADCCut");
-					OccECap_norm->SetTitle("Avg # hits-on-segm/evt/m^3 Endcap");
-					MDTSet2DRangeZ(OccBCap_norm);
-					MDTSet2DRangeZ(OccECap_norm);
-					mf.setMetaData(dir_Overview_expert_reco, OccBCap_norm, OccECap_norm);
-					OccBCap_norm->Write("",TObject::kOverwrite);
-					OccECap_norm->Write("",TObject::kOverwrite);	
-				}
-			}
-		}
-
-
-	}//While loop over run_XXX directory
-
-	return;
-}
-
-void MonitoringFile::MDTTDCSum( std::string inFilename, std::string title ){ 
-
-	MDTPostProcessor mf( inFilename, "Sector t0,tmax, & tdrift Calculations");
-
-	if (!mf.IsOpen()) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Input file not opened \n";
-		return;
-	}
-
-	if(mf.GetSize()<1000.) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Input file empty \n";
-		return; 
-	}
-
-
-	TString run_dir = "";
-	TIter next_run ( mf.GetListOfKeys() );
-	TKey* key_run(0);
-
-	while ((key_run = dynamic_cast<TKey*> ( next_run() )) !=0 ) {
-		TObject* obj_run = key_run->ReadObj();
-		TDirectory* tdir_run = dynamic_cast<TDirectory*>( obj_run );
-		if (tdir_run ==0 ) {delete obj_run; continue; }
-		TString tdir_run_name( tdir_run->GetName() );
-		if (!tdir_run_name.Contains("run") ) continue;
-		run_dir=tdir_run_name;
-
-		//Compute Summary Hists
-		TString Overview_Area = run_dir + "/Muon/MuonRawDataMonitoring/"+title;
-		TDirectory* dir_Main = 0;
-
-		if(mf.cd(Overview_Area)) dir_Main = mf.GetDirectory(Overview_Area);
-		if(!dir_Main) { std::cerr << "No MDT Direcotry! "<< std::endl; mf.error(); return; }
-
-		TIter next_ecap(dir_Main->GetListOfKeys());
-		while( TKey* key_ecap = dynamic_cast<TKey*> (next_ecap()) ){//BA,BC,EA,EC
-			if(strncmp(key_ecap->GetName(),"Overvi",6)==0) continue;	
-			if(strncmp(key_ecap->GetName(),"Summar",6)==0) continue;
-			TString dir_ecap_str = Overview_Area+"/"+key_ecap->GetName();
-			//	TDirectory* dir_ecap = dynamic_cast<TDirectory*> (key_ecap->ReadObj());
-			TDirectory* dir_ecap = mf.GetDirectory(dir_ecap_str);
-			if(!dir_ecap) continue;
-			TString ecap_str = key_ecap->GetName();
-			TString ecap_strFull = ecap_str;
-			if(ecap_str.Length()>4) ecap_str = ecap_str(3,2);
-			else ecap_str = ecap_str(0,2);
-			TIter next_Overview(dir_ecap->GetListOfKeys());
-			while( TKey* key_Overview = dynamic_cast<TKey*> (next_Overview()) ){ //Overview Chambers
-				if(strncmp(key_Overview->GetName(),"Chambe",6)==0) continue;		  
-				TString sumt0_name = "MDT_t0_"+ecap_str;
-				TString sumtmax_name = "MDT_tmax_"+ecap_str;
-				TString sumtdrift_name = "MDT_tdrift_"+ecap_str;
-				TString dir_Overview_str = dir_ecap_str+"/"+key_Overview->GetName();
-				//	  TDirectory* dir_Overview = dynamic_cast<TDirectory*> (key_Overview->ReadObj());
-				TDirectory* dir_Overview = mf.GetDirectory(dir_Overview_str);
-				if(!dir_Overview) continue;
-				TH1F* sumt0 = new TH1F(sumt0_name,sumt0_name,1,0,1);
-				TH1F* sumtmax = new TH1F(sumtmax_name,sumtmax_name,1,0,1);
-				TH1F* sumtdrift = new TH1F(sumtdrift_name,sumtdrift_name,1,0,1);
-				mf.setDirectory(sumt0);
-				sumt0->SetFillColor(42);
-				sumt0->SetMarkerStyle(20);
-				sumt0->SetMarkerColor(42);
-				sumt0->SetAxisRange(400,800,"y");
-				mf.setDirectory(sumtmax);
-				sumtmax->SetFillColor(42);
-				sumtmax->SetMarkerStyle(20);
-				sumtmax->SetMarkerColor(42);
-				sumtmax->SetAxisRange(800,1700,"y");
-				mf.setDirectory(sumtdrift);
-				sumtdrift->SetFillColor(42);
-				sumtdrift->SetMarkerStyle(20);
-				sumtdrift->SetMarkerColor(42);
-				sumtdrift->SetAxisRange(0,1500,"y");
-				// Ultraparanoia ...
-				if(!(sumtdrift && sumt0 && sumtmax)) {
-					std::cerr << "No Summary Histograms" << std::endl;
-					mf.error();
-					return;
-				}	
-				sumtmax->Reset(); sumt0->Reset(); sumtdrift->Reset();
-				if(dir_Overview){
-					if(!dir_Overview->GetDirectory("TDC")) continue;
-				}
-				TDirectory* dir_TDC = dir_Overview->GetDirectory("TDC"); //Directory of TDC spectra
-				TIter next_tdc(dir_TDC->GetListOfKeys());
-				int currentbin = 1;
-				std::vector<TH1F*> hists;
-				while(TKey* key_TDC = dynamic_cast<TKey*> (next_tdc())){//TDC spectra
-					if(strncmp(key_TDC->GetName(),"metadata",6)==0) continue;	    
-					TH1F* h = 0; mf.get(key_TDC->GetName(),h,dir_TDC);
-					hists.push_back(h);
-				}	  
-				//TKeys now in alphabetical order after merge, revert to order they were initialized in ESDtoAOD step
-				std::sort(hists.begin(), hists.end(), tdcSort);
-
-				for(std::vector<TH1F*>::const_iterator hitr = hists.begin(); hitr!=hists.end(); ++hitr){
-					TH1F* h = *hitr;
-					if(!h) continue;
-
-					double t0 = 0;
-					double t0err = 0;
-					double tmax = 0;
-					double tmaxerr = 0;
-					MDTFitTDC(h, t0, t0err, tmax, tmaxerr);
-
-					TString layer;
-					if(currentbin<17) layer = "In";
-					else if (currentbin<33) layer = "Mid";
-					else if (currentbin<49) layer = "Out";
-					else layer = "Ext";
-					int stPhi = currentbin%16;
-					if(layer=="Ext" && (ecap_str=="BA"||ecap_str=="BC")) {
-						stPhi = 2*currentbin%16;		
-					}
-					if(stPhi==0) stPhi=16;
-
-					TString phi = returnString(stPhi);
-
-					TString sector = ecap_str+"_"+layer+"_"+phi;
-					if(h->GetEntries()<100) sector+="_OFF";
-					else if(t0err>t0) sector+="_ERR";
-					sumt0->Fill(sector,t0);
-					sumt0->SetBinError(currentbin,t0err);
-
-					sector = ecap_str+"_"+layer+"_"+phi;
-					if(h->GetEntries()<100) sector+="_OFF";
-					else if(tmaxerr>tmax) sector+="_ERR";
-					sumtmax->Fill(sector,tmax);
-					sumtmax->SetBinError(currentbin,tmaxerr);
-
-					sector = ecap_str+"_"+layer+"_"+phi;
-					if(h->GetEntries()<100) sector+="_OFF";
-					else if(tmaxerr>tmax || t0err>t0 || tmax-t0 < 0 || tmax-t0 > 2000) sector+="_ERR";
-					if(tmax-t0 < 0 || tmax-t0 > 2000) {
-						sumtdrift->Fill(sector,0); 
-						sumtdrift->SetBinError(currentbin,2000);
-					}
-					else {
-						sumtdrift->Fill(sector,tmax-t0); 
-						sumtdrift->SetBinError(currentbin,sqrt(tmaxerr*tmaxerr + t0err*t0err));
-					}
-					currentbin++;//initialized at 1 for first bin
-					if(dir_TDC){
-						dir_TDC->cd();
-						h->SetAxisRange(0,h->GetBinContent(h->GetMaximumBin())*1.05,"y");
-						h->Write("",TObject::kOverwrite);		
-						//Seems to help to write to the tfile early and often
-						//	      if (currentbin % 10 == 0) mf.Write();
-					}
-				}//TDC Spectra
-
-				if(dir_Overview){
-					dir_Overview->cd();
-					sumt0->SetAxisRange(0,300,"y");
-					sumtdrift->SetAxisRange(0,1200,"y");
-					sumtmax->SetAxisRange(0,1500,"y");
-					MDTFinalizeWriteTH1FChar(sumt0);
-					MDTFinalizeWriteTH1FChar(sumtdrift);
-					MDTFinalizeWriteTH1FChar(sumtmax);
-					TH1F* hTDCSummary = 0; mf.get("MDTTDC_Summary_ADCCut_"+ecap_str,hTDCSummary, dir_Overview);
-					TH1F* hTDCSummary_onsegm = 0; mf.get("MDTTDC_segm_Summary_ADCCut_"+ecap_str,hTDCSummary_onsegm, dir_Overview);
-					if(hTDCSummary){
-						// 	      double t0 = 0;
-						// 	      double t0err = 0;
-						// 	      double tmax = 0;
-						// 	      double tmaxerr = 0;
-						// 	      MDTFitTDC(hTDCSummary, t0, t0err, tmax, tmaxerr);
-						hTDCSummary->Write("",TObject::kOverwrite);
-					}
-					if(hTDCSummary_onsegm){
-						double t0 = 0;
-						double t0err = 0;
-						double tmax = 0;
-						double tmaxerr = 0;
-						MDTFitTDC(hTDCSummary_onsegm, t0, t0err, tmax, tmaxerr);
-						hTDCSummary_onsegm->Write("",TObject::kOverwrite);
-					}
-				}
-			}//Overview
-		}
-
-		TH1F* hTDCSummary = 0;
-		TH1F* hTDCSummary_onsegm = 0;
-		mf.get(Overview_Area+"/Overview/Overall_TDC_ADCCut_spectrum",hTDCSummary);
-		mf.get(Overview_Area+"/Overview/Overall_TDC_onSegm_ADCCut_spectrum",hTDCSummary_onsegm);
-		if(hTDCSummary){
-			// 	double t0 = 0;
-			// 	double t0err = 0;
-			// 	double tmax = 0;
-			// 	double tmaxerr = 0;
-			// 	MDTFitTDC(hTDCSummary, t0, t0err, tmax, tmaxerr);
-			mf.cd(Overview_Area+"/Overview/");
-			hTDCSummary->Write("",TObject::kOverwrite);
-		}
-		if(hTDCSummary_onsegm){
-			double t0 = 0;
-			double t0err = 0;
-			double tmax = 0;
-			double tmaxerr = 0;
-			MDTFitTDC(hTDCSummary_onsegm, t0, t0err, tmax, tmaxerr);
-			mf.cd(Overview_Area+"/Overview/");
-			hTDCSummary_onsegm->Write("",TObject::kOverwrite);
-		}
-
-	}//computing  All      
-
-	return;
-}
-
-void  MonitoringFile::MDTLowStat( std::string inFilename, std::string title){
-
-	MDTPostProcessor mf( inFilename, "MDT LowStat Analysis" );
-
-	if (!mf.IsOpen()) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Input file not opened \n";
-		return;
-	}
-
-	if(mf.GetSize()<1000.) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Input file empty \n";
-		return; 
-	}
-
-	// get run directory name
-	//Seemingly unnecessary lines are necessary
-	TIter nextcd0(mf.GetListOfKeys());
-	TKey *key0 = (TKey*)nextcd0();
-	TDirectory *dir0= dynamic_cast<TDirectory*>(key0->ReadObj());
-	if (!dir0) {
-		std::cerr << "MDTPostProcess(): "
-				<< "Unable to find run directory in input file\n";
-		return;
-	}
-	///
-
-	TIter next_run ( dir0->GetListOfKeys() );
-	TKey* key_run = 0;
-	while ((key_run = dynamic_cast<TKey*> ( next_run() )) !=0 ) {
-		TKey* key_lowStat = 0;
-
-		while ((key_lowStat = dynamic_cast<TKey*> ( next_run() )) !=0 ) {
-			TString lowStat_str = key_lowStat->GetName();
-			if(!lowStat_str.Contains("lowStat")) continue;
-
-			TDirectory* lowStat_dir = dir0->GetDirectory(lowStat_str);
-			if(!lowStat_dir) continue;
-			TDirectory* dirOverview = lowStat_dir->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/Overview"));
-			TDirectory* dirOverviewBA = lowStat_dir->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTBA/Overview"));
-			TDirectory* dirOverviewBC = lowStat_dir->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTBC/Overview"));
-			TDirectory* dirOverviewEA = lowStat_dir->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTEA/Overview"));
-			TDirectory* dirOverviewEC = lowStat_dir->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTEC/Overview"));
-
-			if( !(dirOverview && dirOverviewBA && dirOverviewBC && dirOverviewEA && dirOverviewEC) ) {//Catch New Directory Name Fix
-				dirOverview = lowStat_dir->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/Overview_lowStat"));
-				dirOverviewBA = lowStat_dir->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTBA/Overview_lowStat"));
-				dirOverviewBC = lowStat_dir->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTBC/Overview_lowStat"));
-				dirOverviewEA = lowStat_dir->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTEA/Overview_lowStat"));
-				dirOverviewEC = lowStat_dir->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTEC/Overview_lowStat"));
-			}
-
-			if( !(dirOverview && dirOverviewBA && dirOverviewBC && dirOverviewEA && dirOverviewEC) ) continue;//Make sure mdt has lowStat entires before continuing
-
-			TH1F* tdc = 0; mf.get("Overall_TDC_ADCCut_spectrum",tdc,dirOverview);
-			TH1F* tdcBA = 0; mf.get("MDTTDC_Summary_ADCCut_BA",tdcBA,dirOverviewBA);
-			TH1F* tdcBC = 0; mf.get("MDTTDC_Summary_ADCCut_BC",tdcBC,dirOverviewBC);
-			TH1F* tdcEA = 0; mf.get("MDTTDC_Summary_ADCCut_EA",tdcEA,dirOverviewEA);
-			TH1F* tdcEC = 0; mf.get("MDTTDC_Summary_ADCCut_EC",tdcEC,dirOverviewEC);
-			TH1F* tdc_onSegm = 0; mf.get("Overall_TDC_onSegm_ADCCut_spectrum",tdc_onSegm,dirOverview);
-			TH1F* tdcBA_onSegm = 0; mf.get("MDTTDC_segm_Summary_ADCCut_BA",tdcBA_onSegm,dirOverviewBA);
-			TH1F* tdcBC_onSegm = 0; mf.get("MDTTDC_segm_Summary_ADCCut_BC",tdcBC_onSegm,dirOverviewBC);
-			TH1F* tdcEA_onSegm = 0; mf.get("MDTTDC_segm_Summary_ADCCut_EA",tdcEA_onSegm,dirOverviewEA);
-			TH1F* tdcEC_onSegm = 0; mf.get("MDTTDC_segm_Summary_ADCCut_EC",tdcEC_onSegm,dirOverviewEC);
-
-			double t0 = 0;
-			double t0err = 0;
-			double tmax = 0;
-			double tmaxerr = 0;
-
-			if(tdc && dirOverview) { 
-				// 	  MDTFitTDC(tdc,t0,t0err,tmax,tmaxerr);
-				dirOverview->cd();
-				tdc->Write("",TObject::kOverwrite);
-			}
-			if(tdcBA && dirOverviewBA) { 
-				// 	  MDTFitTDC(tdcBA,t0,t0err,tmax,tmaxerr);
-				dirOverviewBA->cd();
-				tdcBA->Write("",TObject::kOverwrite);
-			}
-			if(tdcBC && dirOverviewBC) { 
-				// 	  MDTFitTDC(tdcBC,t0,t0err,tmax,tmaxerr);
-				dirOverviewBC->cd();
-				tdcBC->Write("",TObject::kOverwrite);
-			}
-			if(tdcEA && dirOverviewEA) { 
-				// 	  MDTFitTDC(tdcEA,t0,t0err,tmax,tmaxerr);
-				dirOverviewEA->cd();
-				tdcEA->Write("",TObject::kOverwrite);
-			}
-			if(tdcEC && dirOverviewEC) { 
-				// 	  MDTFitTDC(tdcEC,t0,t0err,tmax,tmaxerr);
-				dirOverviewEC->cd();
-				tdcEC->Write("",TObject::kOverwrite);
-			}
-			if(tdc_onSegm && dirOverview) { 
-				MDTFitTDC(tdc_onSegm,t0,t0err,tmax,tmaxerr);
-				dirOverview->cd();
-				tdc_onSegm->Write("",TObject::kOverwrite);
-			}
-			if(tdcBA_onSegm && dirOverviewBA) { 
-				MDTFitTDC(tdcBA_onSegm,t0,t0err,tmax,tmaxerr);
-				dirOverviewBA->cd();
-				tdcBA_onSegm->Write("",TObject::kOverwrite);
-			}
-			if(tdcBC_onSegm && dirOverviewBC) { 
-				MDTFitTDC(tdcBC_onSegm,t0,t0err,tmax,tmaxerr);
-				dirOverviewBC->cd();
-				tdcBC_onSegm->Write("",TObject::kOverwrite);
-			}
-			if(tdcEA_onSegm && dirOverviewEA) { 
-				MDTFitTDC(tdcEA_onSegm,t0,t0err,tmax,tmaxerr);
-				dirOverviewEA->cd();
-				tdcEA_onSegm->Write("",TObject::kOverwrite);
-			}
-			if(tdcEC_onSegm && dirOverviewEC) { 
-				MDTFitTDC(tdcEC_onSegm,t0,t0err,tmax,tmaxerr);
-				dirOverviewEC->cd();
-				tdcEC_onSegm->Write("",TObject::kOverwrite);
-			}
-		}// All LowStat Dirs
-	}// All Runs  
-
-	return;
-
-}
-
-bool MonitoringFile::MDTCheckAlign(std::string inFilename, std::string title){
-
-	TFile* f = TFile::Open(inFilename.c_str(),"READ");
-
-	if (f == 0) {
-		std::cerr << "MonitoringFile::MDTPostProcess(): "
-				<< "Input file not opened \n";
-		return true;
-	}
-	if(f->GetSize()<1000.) {
-		std::cerr << "MonitoringFile::MDTPostProcess(): "
-				<< "Input file empty \n";
-		return true; 
-	}
-
-	TIter nextcd0(gDirectory->GetListOfKeys());
-	TKey *key0 = (TKey*)nextcd0();
-	TDirectory *dir0= dynamic_cast<TDirectory*> (key0->ReadObj());
-	dir0->cd();
-
-	int keysBA = 0;
-	int keysBC = 0;
-	int keysEA = 0;
-	int keysEC = 0;
-	TDirectory* dirBA = dir0->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTBA/Chambers"));
-	if(dirBA) keysBA = dirBA->GetNkeys();
-	TDirectory* dirBC = dir0->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTBC/Chambers"));
-	if(dirBC) keysBC = dirBC->GetNkeys();
-	TDirectory* dirEA = dir0->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTEA/Chambers"));
-	if(dirEA) keysEA = dirEA->GetNkeys();
-	TDirectory* dirEC = dir0->GetDirectory(TString("Muon/MuonRawDataMonitoring/"+title+"/MDTEC/Chambers"));
-	if(dirEC) keysEC = dirEC->GetNkeys();
-
-	bool aligned = (keysBA < 600 && keysBC < 600 && keysEA < 600 && keysEC < 600);
-
-	f->Close();
-	delete f;
-
-	return aligned;
-}
-
-bool MonitoringFile::MDTCheck(std::string inFilename){
-
-	TFile* f = TFile::Open(inFilename.c_str(),"READ");
-
-	if (f == 0 || ! f->IsOpen()) {
-		std::cerr << "MonitoringFile::MDTPostProcess(): "
-				<< "Input file not opened \n";
-		delete f;
-		return false;
-	}
-	if(f->GetSize()<1000.) {
-		std::cerr << "MonitoringFile::MDTPostProcess(): "
-				<< "Input file empty \n";
-		delete f;
-		return false; 
-	}
-
-	TIter nextcd0(gDirectory->GetListOfKeys());
-	TKey *key0 = (TKey*)nextcd0();
-	TDirectory *dir0 = 0;
-	while (key0 != 0 && dir0 == 0) {
-		dir0= dynamic_cast<TDirectory*> (key0->ReadObj());
-		key0 = (TKey*)nextcd0();
-	}
-	if (dir0 == 0) {
-		std::cerr << "MonitoringFile::MDTPostProcess(): "
-				<< "Can't find top level directory \n";
-		delete f;
-		return false;
-	}
-	dir0->cd();
-
-	TDirectory* dir = dir0->GetDirectory("Muon/MuonRawDataMonitoring/MDT");
-	bool goodMDTFile = dir!=0;
-	f->Close();
-	delete f;
-	return goodMDTFile;
-}
-
-void MonitoringFile::MDTTubeEff(const TString & dirName, const TH1F* num, const TH1F* den, TH1F* eff, float &countsML1, float &countsML2, float &entriesML1, float &entriesML2){
-	int nBinsNum = num->GetNbinsX();
-	int BinsML1 = nBinsNum/2;
-	if(dirName(0,4)=="BIS8" || dirName(0,2)=="BE") BinsML1=nBinsNum; // only one ML
-	countsML1 = 0;
-	countsML2 = 0;
-	entriesML1 = 0;
-	entriesML2 = 0;
-	if(nBinsNum!=den->GetNbinsX()) return;
-	if(nBinsNum!=eff->GetNbinsX()) return;
-	eff->Reset();
-	for(int ibin = 1; ibin !=nBinsNum+1; ++ibin){
-		float entries    = den->GetBinContent(ibin);
-		float counts     = num->GetBinContent(ibin);
-		float efficiency = (counts+1.)/(entries+2.);
-		float error      = sqrt(efficiency*(1-efficiency))/sqrt(entries+3.);  
-		if(ibin<BinsML1 || BinsML1==nBinsNum) {countsML1+=counts; entriesML1+=entries;}
-		else {countsML2+=counts; entriesML2+=entries;}
-		eff->SetBinContent(ibin, efficiency);
-		eff->SetBinError(ibin,error);
-	}
-}
-
-void MonitoringFile::MDT2DHWName(TString hardware_name, TString &stateta_IMO_c, TString &statphi_IMO_c, TString &stateta_c, TString &statphi_c,
-		TString &statphi_c2){
-
-	TString statphi_s = hardware_name(5,2);
-	TString Barrel = hardware_name(0,1);
-	TString Side = hardware_name(4,1);
-	TString hwname = hardware_name(1,1);
-
-	TString eta_s = hardware_name(3,1);
-
-	//BME1[AC]14 (mistake - is actually 13 - so account for both cases!) -->BME4[AC]13 in histogram position
-	if( hardware_name(0,3) == "BME" ){
-		eta_s = "4";
-		statphi_s = "13";
-	}    
-
-	statphi_c = statphi_s+",1";
-	statphi_c2 = statphi_s+",2";
-
-	if(hardware_name(0,3)=="BIR" || hardware_name(0,3)=="BIM") {
-		statphi_c = statphi_c +","+hardware_name(2,1);
-		statphi_c2 = statphi_c2 +","+hardware_name(2,1);
-	}
-
-	//BML[45][AC]13-->BML[56][AC]13
-	if( hardware_name(0,3) == "BML" && TString(hardware_name(3,1)).Atoi() >= 4 && hardware_name(5,2) == "13" ){
-		eta_s = returnString( TString(hardware_name(3,1)).Atoi() + 1 );
-	}
-
-        //BMF1,2,3 corresponds to eta stations 1,3,5
-        if( hardware_name(0,3) == "BMF"){
-            eta_s = returnString(TString(hardware_name(3,1)).Atoi()*2 - 1);
-        }
-
-	stateta_c = hardware_name(0,2);
-	stateta_c += hardware_name(4,1);
-	stateta_c+=eta_s;
-
-	stateta_IMO_c = hardware_name(0,1);
-	stateta_IMO_c += hardware_name(4,1);
-	stateta_IMO_c += eta_s;
-
-	statphi_IMO_c = hwname+","+statphi_s;
-
-}
-
-Double_t MonitoringFile::fittzero(Double_t *x,Double_t *par)
-{
-	Double_t fitvaltzero = par[0] + ( par[3] / ( 1 + ( TMath::Exp((-x[0]+par[1])/par[2]) ) ) );
-	return fitvaltzero; 
-} 
-
-Double_t MonitoringFile::fittmax(Double_t *x,Double_t *par)
-{  
-	Double_t fitvaltmax = par[0] + ( par[3] / ( 1 + ( TMath::Exp((x[0]-par[1])/par[2]) ) ) );
-	return fitvaltmax; 
-} 
-
-void  MonitoringFile::MDTFitTDC(TH1F* h, double &t0, double &t0err, double &tmax, double &tmaxerr){
-	t0 = tmax = 0;
-	t0err = tmaxerr = 0;
-	double up = h->GetBinCenter(h->GetMaximumBin()+1);
-	if( up > 200 ) up = 200;
-	double down = up + 650;
-	if( up < 50 ) up = 50;
-	double parESD0 = h->GetBinContent(h->GetMinimumBin()); 
-	double parESD1 = up;
-	double parESD2 = 20;
-	double parESD3 = h->GetBinContent(h->GetMaximumBin()) - h->GetBinContent(h->GetMinimumBin());  
-	TF1 func1("func1", &fittzero,(Double_t)(0.),(Double_t)(up), 4);
-	func1.SetParameters(parESD0, parESD1, parESD2, parESD3);
-	func1.SetLineColor(kBlue+2);
-	if(h->GetEntries()>100){
-		h->Fit("func1","RQ");
-		t0 = func1.GetParameter(1) ;
-		t0err = func1.GetParError(1);
-		double binAtT0 = (double)h->GetBinContent(h->FindBin(t0));
-		if(binAtT0<1) binAtT0 = 1;
-		t0err += 10.0 * func1.GetChisquare() / (0.01*binAtT0*binAtT0*(double)func1.GetNumberFitPoints()); // to additionally account for bad fits
-	}
-
-	parESD0 = h->GetBinContent(h->GetMinimumBin());
-	parESD1 = down;
-	parESD2 = 50;
-	parESD3 = (h->GetBinContent(h->GetMaximumBin())-h->GetBinContent(h->GetMinimumBin()))/10.;
-	TF1 func2("func2", &fittmax, (Double_t)(down-135), (Double_t)(down+135), 4);
-	func2.SetParameters(parESD0,parESD1,parESD2,parESD3);
-	func2.SetLineColor(kRed+1);
-	if(h->GetEntries()>100){
-		func2.SetParLimits(0, parESD0, 2.0*parESD0+1);
-		func2.SetParLimits(2, 5, 90);
-		func2.SetParLimits(3, 0.2*parESD3, 7*parESD3);
-		h->Fit("func2","WWRQ+");
-		//       std::cout << h->GetName() << std::endl;
-		//       std::cout << " " << func2.GetParameter(0) << " " << func2.GetParameter(1) << " " << func2.GetParameter(2) << " " << func2.GetParameter(3) << std::endl;
-		tmax = func2.GetParameter(1);
-		tmaxerr = func2.GetParError(1);
-		double binAtTmax = (double)h->GetBinContent(h->FindBin(tmax));
-		if(binAtTmax<1) binAtTmax = 1;
-		tmaxerr += 10.0 * func2.GetChisquare() / (0.01*binAtTmax*binAtTmax*(double)func2.GetNumberFitPoints()); // to additionally account for bad fits
-	}
-
-	h->GetXaxis()->SetTitle("[nsec] t0 = "+returnString(t0)+" +/- "+returnString(t0err)+" tmax = "+returnString(tmax)+" +/- "+returnString(tmaxerr));
-
-	return;
-}
-
-void MonitoringFile::MDTSetMetaData(TDirectory* /*targetDir*/, TH1* /*h1*/, TH1* /*h2*/, TH1* /*h3*/){
-	return;
-	// TTree* metadata_overview_tr = 0;
-	// if(!targetDir || !h1) return;
-	// targetDir->GetObject("metadata",metadata_overview_tr);
-	// //Fill Metadata for new objs.
-	// std::string name_;
-	// std::string intervalData_="run";
-	// std::string chainData_="<none>";
-	// std::string mergeData_="<default>";
-	// if(metadata_overview_tr){
-	//   OutputMetadata metadata_overview(metadata_overview_tr);
-	//   char name[99];
-	//   char intervalData[99];
-	//   char chainData[99];
-	//   char mergeData[99];
-	//   TBranch* b_name;
-	//   TBranch* b_intervalData;
-	//   TBranch* b_chainData;
-	//   TBranch* b_mergeData;
-	//   TTree* tClone = (TTree*) metadata_overview_tr->Clone();
-	//   metadata_overview_tr->SetDirectory(0);
-	//   tClone->SetBranchAddress("Name",name,&b_name);
-	//   tClone->SetBranchAddress("Interval",intervalData,&b_intervalData);
-	//   tClone->SetBranchAddress("TriggerChain",chainData,&b_chainData);
-	//   tClone->SetBranchAddress("MergeMethod",mergeData,&b_mergeData);
-	//   //Check if Metadata Already Exists
-	//   bool isMeta = false;
-	//   for(int i = 0; i != tClone->GetEntries(); ++i){
-	// 	tClone->GetEntry(i);
-	// 	intervalData_ = intervalData;
-	// 	chainData_ = chainData;
-	// 	mergeData_ = mergeData;
-	// 	name_ = name;
-	// 	if(name_ == (std::string) h1->GetName()) isMeta = true;
-	//   }
-	//   delete tClone;
-	//   if(isMeta) {
-	// 	metadata_overview_tr->SetDirectory(0);
-	// 	delete metadata_overview_tr;
-	// 	return;
-	//   }
-	//   metadata_overview.fill(h1->GetName(), intervalData_.c_str(), chainData_.c_str(), mergeData_.c_str());
-	//   if(h2) metadata_overview.fill(h2->GetName(), intervalData_.c_str(), chainData_.c_str(), mergeData_.c_str());
-	//   if(h3) metadata_overview.fill(h3->GetName(), intervalData_.c_str(), chainData_.c_str(), mergeData_.c_str());
-	//   //set new hists to 0 dir
-	//   TDirectory* tempDir = gDirectory;
-	//   targetDir->cd();
-	//   metadata_overview_tr->Write("",TObject::kOverwrite);
-	//   tempDir->cd();
-	// }
-	// else {
-	//   TTree*  metadata_overview_tr = new TTree( "metadata", "Monitoring Metadata" );
-	//   OutputMetadata metadata_overview(metadata_overview_tr);      
-	//   if(h1) metadata_overview.fill( h1->GetName(), intervalData_.c_str(), chainData_.c_str(), mergeData_.c_str());
-	//   TDirectory* tempDir = gDirectory;
-	//   targetDir->cd();
-	//   h1->SetDirectory(0);
-	//   metadata_overview_tr->Write("",TObject::kOverwrite);
-	//   metadata_overview_tr->SetDirectory(0);//make this safe to delete
-	//   delete metadata_overview_tr;
-	//   tempDir->cd();      
-	// }
-}
-
-void MonitoringFile::MDTFinalizeWriteTH1FChar(TH1F* h){
-	h->LabelsDeflate("x");
-	if(h->GetNbinsX()>1) h->LabelsOption("v","x");
-	h->Write("",TObject::kOverwrite);
-}
-
-void MonitoringFile::GetTubeLength( double & tubeLength, TString dirName ) {
-	if( dirName(0,3) == "BEE" ) tubeLength = .9115;
-	else if( dirName(0,3) == "BIS" && dirName(3,1) != "8" ) tubeLength = 1.6715;
-	else if( dirName(0,4) == "BIS8" ) tubeLength = .8515;
-	else if( dirName(0,3) == "BIL" ) tubeLength = 2.6715;
-	else if( dirName(0,3) == "BIM" ) tubeLength = 1.5365;
-	else if( dirName(0,3) == "BIR" ) tubeLength = 1.1055;
-	else if( dirName(0,4) == "BIR1" ) tubeLength = 2.6715;
-	else if( dirName(0,4) == "BIR2" || dirName(0,4) == "BIR4" || dirName(0,4) == "BIR5" ) tubeLength = 1.5365;
-	else if( dirName(0,4) == "BIR3" || dirName(0,4) == "BIR6" ) tubeLength = 1.1055;
-	else if( dirName(0,3) == "BME" ) tubeLength = 2.15; //approximate!
-	else if( dirName(0,3) == "BMG" ) tubeLength = 1.12; //approximate!
-	else if( dirName(0,3) == "BML" ) tubeLength = 3.5515;
-	else if( dirName(0,3) == "BMS" || dirName(0,3) == "BMF" ) tubeLength = 3.0715;
-	else if( dirName(0,3) == "BOL" ) tubeLength = 4.9615;
-	else if( dirName(0,3) == "BOG" ) tubeLength = 3.7715;
-	else if( dirName(0,3) == "BOS" || dirName(0,3) == "BOF" ) tubeLength = 3.7733;
-	else if( dirName(0,4) == "EES1" ) tubeLength = 2.1945;
-	else if( dirName(0,4) == "EES2" ) tubeLength = 2.5905;
-	else if( dirName(0,4) == "EEL1" && dirName(5,2) == "05" ) tubeLength = 2.6265;
-	else if( dirName(0,4) == "EEL1" ) tubeLength = 4.2015;
-	else if( dirName(0,4) == "EEL2" ) tubeLength = 3.6015;	   
-	else if( dirName(0,4) == "EIS1" ) tubeLength = 1.0605;
-	else if( dirName(0,4) == "EIS2" ) tubeLength = 1.4115;
-	else if( dirName(0,4) == "EIL1" ) tubeLength = 1.5465;
-	else if( dirName(0,4) == "EIL2" ) tubeLength = 2.0865;
-	else if( dirName(0,4) == "EIL3" && (dirName(5,2) == "11" || dirName(5,2) == "15") ) tubeLength = 1.7415;
-	else if( dirName(0,4) == "EIL3" ) tubeLength = 2.0715;
-	else if( dirName(0,4) == "EIL4" && (dirName(5,2) == "11" || dirName(5,2) == "15") ) tubeLength = 1.5515;
-	else if( dirName(0,4) == "EIL4" && (dirName(5,2) == "01" || dirName(5,2) == "09") ) tubeLength = 1.5365;
-	else if( dirName(0,4) == "EIL4" && (dirName(5,2) == "03" || dirName(5,2) == "05" || dirName(5,2) == "13") ) tubeLength = 2.8015;
-	else if( dirName(0,4) == "EIL4" && (dirName(5,2) == "07") ) tubeLength = 2.0115;
-	else if( dirName(0,4) == "EIL5" && (dirName(5,2) == "01" || dirName(5,2) == "09") ) tubeLength = 2.8015;
-	else if( dirName(0,4) == "EML1" ) tubeLength = 1.5465;
-	else if( dirName(0,4) == "EML2" ) tubeLength = 2.4465;
-	else if( dirName(0,4) == "EML3" ) tubeLength = 3.4065;
-	else if( dirName(0,4) == "EML4" ) tubeLength = 4.3665;
-	else if( dirName(0,4) == "EML5" ) tubeLength = 5.3265;
-	else if( dirName(0,4) == "EMS1" ) tubeLength = 1.0875;
-	else if( dirName(0,4) == "EMS2" ) tubeLength = 1.6635;
-	else if( dirName(0,4) == "EMS3" ) tubeLength = 2.2395;
-	else if( dirName(0,4) == "EMS4" ) tubeLength = 2.8155;
-	else if( dirName(0,4) == "EMS5" ) tubeLength = 3.3915;
-	else if( dirName(0,4) == "EOL1" ) tubeLength = 2.0415;
-	else if( dirName(0,4) == "EOL2" ) tubeLength = 3.0015;
-	else if( dirName(0,4) == "EOL3" ) tubeLength = 3.7815;
-	else if( dirName(0,4) == "EOL4" ) tubeLength = 4.5015;
-	else if( dirName(0,4) == "EOL5" ) tubeLength = 5.2215;
-	else if( dirName(0,4) == "EOL6" ) tubeLength = 5.9415;
-	else if( dirName(0,4) == "EOS1" ) tubeLength = 1.4655;
-	else if( dirName(0,4) == "EOS2" ) tubeLength = 1.9695;
-	else if( dirName(0,4) == "EOS3" ) tubeLength = 2.4735;
-	else if( dirName(0,4) == "EOS4" ) tubeLength = 2.9415;
-	else if( dirName(0,4) == "EOS5" ) tubeLength = 3.3735;
-	else if( dirName(0,4) == "EOS6" ) tubeLength = 3.8055;
-	// 	    else std::cout << "Missing chamb: " << dirName << " " << nTubes << std::endl;
-}
-
-TString MonitoringFile::returnString(int a){
-	std::stringstream ss; ss << a;
-	TString b; ss >> b;
-	return b;
-}
-
-TString MonitoringFile::returnString(double a){
-	std::stringstream ss; ss << a;
-	TString b; ss >> b;
-	return b;
-}
-
-/////////dead/noisy/ineff functions
-
-TString MonitoringFile::ConvertTubeVectorToString( std::vector<int> & v, TH1F* h, TString chamber ) {
-	TString theList;
-	if( v.size() > 0 ) theList = TubeID_to_ID_L_ML(v.at(0), chamber, h->GetNbinsX());
-	for(unsigned int i=1; i<v.size(); i++) theList += "," + TubeID_to_ID_L_ML(v.at(i), chamber, h->GetNbinsX());
-	return theList;
-}
-
-TString MonitoringFile::ConvertLayerVectorToString( std::vector<int> & v, TString chamber ) {
-	TString theList;
-	if( v.size() > 0 ) theList = Layer_to_L_ML(v.at(0), chamber);
-	for(unsigned int i=1; i<v.size(); i++) theList += "," + Layer_to_L_ML(v.at(i), chamber);
-	return theList;
-}
-
-TString MonitoringFile::ConvertMezzVectorToString( std::vector<int> & v, TH1F* h, TString chamber ) {
-	TString theList;
-	if( v.size() > 0 ) theList = Mezz_to_ML_mezz(v.at(0), chamber, h->GetNbinsX());
-	for(unsigned int i=1; i<v.size(); i++) theList += "," + Mezz_to_ML_mezz(v.at(i), chamber, h->GetNbinsX());
-	return theList;
-}
-
-TString MonitoringFile::ConvertVectorToString( std::vector<int> & v ) {
-	TString theList;
-	if( v.size() > 0 ) theList = returnString(v.at(0));
-	for(unsigned int i=1; i<v.size(); i++) theList += "," + returnString(v.at(i));
-	return theList;
-}
-
-TString MonitoringFile::Mezz_to_ML_mezz(int mezz, const TString & hardware_name, int totalTubes) {
-	int mezzML = dqutils_mdtdeadnoisy::Get_ML_of_Mezz_degenerate(mezz, hardware_name, totalTubes);
-
-	// Convert to string format
-	TString mezz_str;
-	if(mezz<10) mezz_str = "0" + returnString(mezz);
-	else mezz_str = returnString(mezz);
-
-	return (returnString(mezzML)+mezz_str);
-}
-
-TString MonitoringFile::TubeID_to_ID_L_ML(int & tubeID, const TString & hardware_name, int totalTubes) {
-	int derived_tube = 1;
-	int derived_layer = 1;
-	int derived_ML = 1;
-
-	// Get Number of X
-	int derived_NumTubePerLayer = 1;
-	int derived_NumTubePerML = 1;
-	int derived_NumLayer = 1;
-	int derived_NumLayerPerML = 1;
-	int derived_NumML = 1;
-	if( hardware_name(0,4) == "BIS8" /*&& hardware_name(5,2) == "12"*/ ) {
-		derived_NumLayerPerML = 3;
-		derived_NumML = 1;
-	}
-	else if( /*hardware_name(0,4) == "BIS8" ||*/ hardware_name(0,3) == "BEE" ) {
-		derived_NumLayerPerML = 4;
-		derived_NumML = 1;    
-	}
-	else if( hardware_name(0,2) == "BI" || hardware_name(0,2) == "EI" ) {
-		derived_NumLayerPerML = 4;
-		derived_NumML = 2;
-	}
-	else {
-		derived_NumLayerPerML = 3;
-		derived_NumML = 2;
-	}
-
-	derived_NumLayer = derived_NumLayerPerML * derived_NumML;
-	derived_NumTubePerML = totalTubes / derived_NumML;
-	derived_NumTubePerLayer = totalTubes / derived_NumLayer;
-
-	// Corrections for derived_NumTubePerLayer
-	if( hardware_name(0,4) == "BMS4" || hardware_name(0,4) == "BMS6" )
-		derived_NumTubePerLayer = 48;
-	if((hardware_name(5,2) == "11" || hardware_name(5,2) == "15")) {
-		if( hardware_name(0,4) == "BIR1" )
-			derived_NumTubePerLayer = 30;
-		if( hardware_name(0,4) == "BIR2" )
-			derived_NumTubePerLayer = 30;
-		if( hardware_name(0,4) == "BIR3" )
-			derived_NumTubePerLayer = 36;
-		if( hardware_name(0,4) == "BIR4" )
-			derived_NumTubePerLayer = 30;
-		if( hardware_name(0,4) == "BIR5" )
-			derived_NumTubePerLayer = 24;
-	}
-	//     if( hardware_name(0,4)=="EIL4" && ( hardware_name(5,2)=="09" || hardware_name(5,2)=="01" ) ) // possible MdtIdHelper problem
-	//       derived_NumTubePerLayer = 54;
-
-	// Now get X
-	derived_ML = (tubeID-1)/derived_NumTubePerML + 1;
-	derived_layer = (tubeID-1)/derived_NumTubePerLayer + 1;
-	derived_tube = tubeID - (derived_layer - 1) * derived_NumTubePerLayer;
-	if(derived_ML==2) derived_layer -= derived_NumLayerPerML;
-
-	// Convert to string format
-	TString tube_str;
-	if(derived_tube<10) tube_str = "0" + returnString(derived_tube);
-	else tube_str = returnString(derived_tube);
-
-	return (returnString(derived_ML)+returnString(derived_layer)+tube_str);
-}
-
-TString MonitoringFile::Layer_to_L_ML(int & layer, const TString & hardware_name) {
-	int derived_layer = 1;
-	int derived_ML = 1;
-
-	// Get Number of X
-	// int derived_NumLayer = 1;
-	int derived_NumLayerPerML = 1;
-	// int derived_NumML = 1;
-	if( hardware_name(0,4) == "BIS8" /*&& hardware_name(5,2) == "12"*/ ) {
-		derived_NumLayerPerML = 3;
-		// derived_NumML = 1;
-	}
-	else if( /*hardware_name(0,4) == "BIS8" ||*/ hardware_name(0,3) == "BEE" ) {
-		derived_NumLayerPerML = 4;
-		// derived_NumML = 1;    
-	}
-	else if( hardware_name(0,2) == "BI" || hardware_name(0,2) == "EI" ) {
-		derived_NumLayerPerML = 4;
-		// derived_NumML = 2;
-	}
-	else {
-		derived_NumLayerPerML = 3;
-		// derived_NumML = 2;
-	}
-	// derived_NumLayer = derived_NumLayerPerML * derived_NumML;
-
-	// Now get X
-	derived_ML = (layer-1)/derived_NumLayerPerML + 1;
-	derived_layer = layer;
-	if(derived_ML==2) derived_layer -= derived_NumLayerPerML;
-
-	// Convert to string format and return
-	return (returnString(derived_ML)+returnString(derived_layer));
-}
-
-void MonitoringFile::MDTSet2DRangeZ(TH2F* h) {   
-	double minz = 0.00000001; 
-	double maxz = h->GetMaximum(); 
-	if(h->GetMinimum(minz) > minz) minz = h->GetMinimum(minz);
-	if( maxz <= minz ) return;
-	if( maxz/minz < 10.0 ) maxz = 10.0*minz; // always give range >= factor of 10 so that the labels will show in logz (root is stupid)
-
-	h->SetAxisRange(minz,maxz,"z");
-}
-
-void MonitoringFile::MDTResetContents(TH2F* h) {    
-	// copy all functions of histogram before resetting
-	TList* h_funcs; 
-	h_funcs = dynamic_cast<TList*> (h->GetListOfFunctions()->Clone());
-	h->Reset(); 
-	//now insert these functions back into the hist
-	TIter iterE(h_funcs);
-	while ( (iterE()) ){h->GetListOfFunctions()->Add(*iterE);}
-	delete h_funcs; 
-	// are the functions still valid after list deletion?
-	//http://root.cern.ch/root/html/TList#TList:_TList  should be!
-	// 	TIter iterTest(EffBCap->GetListOfFunctions());
-	// 	while( iterTest() ) std::cout << (*iterTest)->GetName() << std::endl;    
-}
-
-MonitoringFile::MDTPostProcessor::MDTPostProcessor(std::string inFilename, std::string name) :
-    		TFile( inFilename.c_str(), "UPDATE" ),
-    		m_name(name),
-    		m_error(0)
-{    
-	//     if(this->IsOpen()) std::cout << "Begin " << m_name << " MonitoringFile: " << this->GetName() << " Size: " << this->GetSize() << std::endl;
-	//     else std::cerr << "ERROR " << m_name << " Could not open MonitoringFile: " << inFilename << std::endl;
-	if(!this->IsOpen()) std::cerr << "ERROR " << m_name << " Could not open MonitoringFile: " << inFilename << std::endl;
-}
-
-MonitoringFile::MDTPostProcessor::~MDTPostProcessor(){
-	//     std::cout << "Destructing " << m_name << " Collected " << m_garbage.size() << " Objects to be deleted" << std::endl;
-	if(!m_error) this->Write(); 
-	else std::cout << "WARNING " << m_name << " Chose Not To Write " << this->GetName() << std::endl;
-	this->Close();
-	for(std::set<TObject*>::const_iterator git = m_garbage.begin(); git != m_garbage.end(); ++git){delete *git;}
-	//    std::cout << "\n";
-}
-
-void MonitoringFile::MDTPostProcessor::error(){ m_error = true; }
-
-template <class T>
-void MonitoringFile::MDTPostProcessor::get(const char* namecycle, T* &ptr, TDirectory* baseDir, TDirectory* target){
-
-	if (baseDir) baseDir->GetObject( namecycle, ptr ); // suggested root function
-	else this->GetObject( namecycle, ptr ); //suggested root function
-	if(!ptr) return;
-	TH1* obj = reinterpret_cast<TH1*> (ptr);
-
-	obj->SetDirectory(target);
-	if( target == 0 ) m_garbage.insert(obj);
-}
-
-void MonitoringFile::MDTPostProcessor::setDirectory( TH1* h, TDirectory* dir ){
-	h->SetDirectory(dir);
-	if ( dir == 0 ) m_garbage.insert(h);
-}
-
-void MonitoringFile::MDTPostProcessor::setDirectory( TH2* h, TDirectory* dir ){
-	h->SetDirectory(dir);
-	if ( dir == 0 ) m_garbage.insert(h);
-}
-
-void MonitoringFile::MDTPostProcessor::setMetaData(TDirectory* targetDir, TH1* h1, TH1* h2, TH1* h3) { 
-	//we will collect the garbage and set the directory to zero    
-	h1->SetDirectory(0);
-	m_garbage.insert(h1);
-	if(h2) { h2->SetDirectory(0); m_garbage.insert(h2); }
-	if(h3) { h3->SetDirectory(0); m_garbage.insert(h3); }
-	//now call old function being sure not to fill a garbage set
-	return MonitoringFile::MDTSetMetaData( targetDir, h1, h2, h3);
-}
-
-bool MonitoringFile::tdcSort(const TH1* h1, const TH1* h2){
-	TString name1 = h1->GetName();
-	TString name2 = h2->GetName();
-
-	name1.ReplaceAll("MDTTDC_ADCCut_","");
-	name2.ReplaceAll("MDTTDC_ADCCut_","");
-	name1.ReplaceAll("BA_","") ;     name1.ReplaceAll("BC_","") ;     name1.ReplaceAll("EA_","") ;     name1.ReplaceAll("EC_","") ;
-	name2.ReplaceAll("BA_","") ;     name2.ReplaceAll("BC_","") ;     name2.ReplaceAll("EA_","") ;     name2.ReplaceAll("EC_","") ;
-	TString layer1 = name1(0,name1.Index("_"));
-	TString layer2 = name2(0,name2.Index("_"));
-	if( layer1 == "Extra" && layer2 != "Extra") return false;
-	else if (layer2 == "Extra" && layer1 != "Extra") return true;
-	if(layer1 < layer2) return true;
-	if(layer1 > layer2) return false;
-
-	name1.ReplaceAll(((TString)layer1+"_StPhi"),"") ;
-	name2.ReplaceAll(((TString)layer1+"_StPhi"),"") ;
-	std::stringstream ss1;
-	std::stringstream ss2;
-	int phi1; int phi2;
-
-	ss1 << name1;
-	ss1 >> phi1;
-	ss2 << name2;
-	ss2 >> phi2;
-
-	if( phi1 < phi2) return true;
-	else return false;
-}
-
-}//namespace
-
-
-- 
GitLab


From b2e0fcf3640dd714618a448e0a4a25240f2b76ee Mon Sep 17 00:00:00 2001
From: joaoVictorPinto <jodafons@cern.ch>
Date: Sat, 11 Sep 2021 22:04:33 +0200
Subject: [PATCH 069/347] Fix ringer et/eta bin ranges

---
 .../Root/tools/onnx/RingerSelector.cxx             | 12 ++++++------
 .../src/tools/RingerSelectorTool.cxx               | 14 ++++++--------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/PhysicsAnalysis/RingerSelectorTools/Root/tools/onnx/RingerSelector.cxx b/PhysicsAnalysis/RingerSelectorTools/Root/tools/onnx/RingerSelector.cxx
index 194f3fc1617c..575fac600790 100644
--- a/PhysicsAnalysis/RingerSelectorTools/Root/tools/onnx/RingerSelector.cxx
+++ b/PhysicsAnalysis/RingerSelectorTools/Root/tools/onnx/RingerSelector.cxx
@@ -117,12 +117,12 @@ namespace Ringer{
     bool RingerSelector::accept( const xAOD::TrigRingerRings *ringsCluster, float discr, float avgmu ) const 
     {
       float et = ringsCluster->emCluster()->et()/Gaudi::Units::GeV;
-      float eta = std::min( std::abs(ringsCluster->emCluster()->eta()), float(2.5));
+      float eta = std::abs(ringsCluster->emCluster()->eta());
     
       ATH_MSG_DEBUG( "Event et = "<< et << ", eta = " << eta );
       for( auto& cutDef : m_thresholds ){
-        if ( et <= cutDef.etMin() || et > cutDef.etMax() ) continue;
-        if ( eta <= cutDef.etaMin() || eta > cutDef.etaMax() ) continue;
+        if ( et < cutDef.etMin() || et >= cutDef.etMax() ) continue;
+        if ( eta < cutDef.etaMin() || eta >= cutDef.etaMax() ) continue;
         return cutDef.accept( discr, avgmu );
       }// loop over all thresholds
     
@@ -204,13 +204,13 @@ namespace Ringer{
     float RingerSelector::predict(const xAOD::TrigRingerRings *ringsCluster , const xAOD::TrigElectron *el ) const
     {
       float et = ringsCluster->emCluster()->et()/Gaudi::Units::GeV;
-      float eta = std::min( std::abs(ringsCluster->emCluster()->eta()), float(2.5));
+      float eta = std::abs(ringsCluster->emCluster()->eta());
 
       // Find the correct model and predict
       for( auto& model : m_models ){
         
-        if(et<=model.etMin() || et > model.etMax()) continue;
-        if(eta<=model.etaMin() || eta > model.etaMax()) continue;
+        if(et<model.etMin() || et >= model.etMax()) continue;
+        if(eta<model.etaMin() || eta >= model.etaMax()) continue;
 
         auto inputs = prepare_inputs( model.barcode(), ringsCluster, el );
         auto output = model.predict( inputs ); // propagate the input throut the model
diff --git a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/tools/RingerSelectorTool.cxx b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/tools/RingerSelectorTool.cxx
index c282a1c39404..a8f333715457 100644
--- a/Trigger/TrigHypothesis/TrigMultiVarHypo/src/tools/RingerSelectorTool.cxx
+++ b/Trigger/TrigHypothesis/TrigMultiVarHypo/src/tools/RingerSelectorTool.cxx
@@ -144,15 +144,14 @@ bool  RingerSelectorTool::accept( double discriminant, double et, double eta, do
 const {
 
   eta = std::fabs(eta);
-  if(eta>2.50) eta=2.50;///fix for events out of the ranger
   et  = et/Gaudi::Units::GeV; ///in GeV
   double threshold = 0.0;
   double avgmu = mu;
   //Apply cut
   for(unsigned i=0; i < m_cutDefs.size(); ++i){
-    if((avgmu  > m_cutDefs[i]->mumin()) && (avgmu  <= m_cutDefs[i]->mumax())){
-      if((et  > m_cutDefs[i]->etmin()) && (et  <= m_cutDefs[i]->etmax())){
-        if((eta > m_cutDefs[i]->etamin()) && (eta <= m_cutDefs[i]->etamax())){
+    if((avgmu  >= m_cutDefs[i]->mumin()) && (avgmu  < m_cutDefs[i]->mumax())){
+      if((et  >= m_cutDefs[i]->etmin()) && (et  < m_cutDefs[i]->etmax())){
+        if((eta >= m_cutDefs[i]->etamin()) && (eta < m_cutDefs[i]->etamax())){
           
           if(m_doPileupCorrection){
             // Limited Pileup
@@ -183,14 +182,13 @@ bool RingerSelectorTool::retrieve(double et, double eta, double mu, std::shared_
 const {
 
   eta = std::fabs(eta);
-  if(eta>2.50) eta=2.50;///fix for events out of the ranger
   et  = et/Gaudi::Units::GeV; ///in GeV
   
   if(!m_discriminators.empty()){
     for(unsigned i=0; i<m_discriminators.size(); ++i){
-      if(mu > m_discriminators[i]->mumin() && mu <= m_discriminators[i]->mumax()){
-        if(et > m_discriminators[i]->etmin() && et <= m_discriminators[i]->etmax()){
-          if(eta > m_discriminators[i]->etamin() && eta <= m_discriminators[i]->etamax()){
+      if(mu >= m_discriminators[i]->mumin() && mu < m_discriminators[i]->mumax()){
+        if(et >= m_discriminators[i]->etmin() && et < m_discriminators[i]->etmax()){
+          if(eta >= m_discriminators[i]->etamin() && eta < m_discriminators[i]->etamax()){
             discr   = m_discriminators[i];
             preproc = m_preprocs[i];
             return true;
-- 
GitLab


From b2f725a7434d60cc6b8006be9af75122f5536ccf Mon Sep 17 00:00:00 2001
From: Moe Wakida <wakida@hepl.phys.nagoya-u.ac.jp>
Date: Sun, 12 Sep 2021 19:36:07 +0200
Subject: [PATCH 070/347] Support L1Muon Rename

---
 .../TrigMuonMonitoringMT/python/EFMuonMonConfig.py |  2 +-
 .../python/L2MuonSAIOMonConfig.py                  |  2 +-
 .../python/L2MuonSAMonConfig.py                    |  2 +-
 .../python/L2OverlapRemoverMonConfig.py            |  2 +-
 .../python/L2muCombMonConfig.py                    |  2 +-
 .../python/MuonTriggerCountMTConfig.py             |  2 +-
 .../python/TrigMuonEfficiencyMonConfig.py          | 14 ++++++--------
 7 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py
index 1533991b8e8f..d0b14d23790c 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/EFMuonMonConfig.py
@@ -10,7 +10,7 @@ def EFMuonMonConfig(helper):
 
     monAlg = helper.addAlgorithm(CompFactory.EFMuonMonMT,'EFMuonMonMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_2mu14_L12MU10']
+    monAlg.MonitoredChains = ['HLT_mu6_L1MU5VF', 'HLT_mu26_ivarmedium_L1MU14FCH', 'HLT_mu50_L1MU14FCH', 'HLT_mu60_0eta105_msonly_L1MU14FCH', 'HLT_2mu14_L12MU8F', 'HLT_mu22_mu8noL1_L1MU14FCH']
     monAlg.Group = GroupName
 
     # configuration of etaphi2D and Ratio plots for non-specific chain
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAIOMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAIOMonConfig.py
index b7acd0286e18..5261cbb6183f 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAIOMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAIOMonConfig.py
@@ -9,7 +9,7 @@ def L2MuonSAIOMonConfig(helper):
     GroupName = 'L2MuonSAIO'
 
     monAlg = helper.addAlgorithm(CompFactory.L2MuonSAIOMonMT,'L2MuonSAIOMonMT')
-    monAlg.MonitoredChains = ['HLT_2mu6_l2io_L12MU6', 'HLT_2mu14_l2io_L12MU10']
+    monAlg.MonitoredChains = ['HLT_2mu6_l2io_L12MU5VF', 'HLT_2mu14_l2io_L12MU8F']
     monAlg.Group = GroupName
 
     for chain in monAlg.MonitoredChains:
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py
index bf6f3fff3c88..4e9426a7e745 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2MuonSAMonConfig.py
@@ -10,7 +10,7 @@ def L2MuonSAMonConfig(helper):
 
     monAlg = helper.addAlgorithm(CompFactory.L2MuonSAMonMT,'L2MuonSAMonMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    monAlg.MonitoredChains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_2mu14_L12MU10']
+    monAlg.MonitoredChains = ['HLT_mu6_L1MU5VF', 'HLT_mu26_ivarmedium_L1MU14FCH', 'HLT_2mu14_L12MU8F']
     monAlg.Group = GroupName
 
     # configuration of etaphi2D and Ratio plots for non-specific chain
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2OverlapRemoverMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2OverlapRemoverMonConfig.py
index 6fd0399fe01c..51dfc670d7a1 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2OverlapRemoverMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2OverlapRemoverMonConfig.py
@@ -10,7 +10,7 @@ def L2OverlapRemoverMonConfig(helper):
 
     monAlg = helper.addAlgorithm(CompFactory.L2OverlapRemoverMonMT,'L2OverlapRemoverMonMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    monAlg.MonitoredChains = ['HLT_2mu14_L12MU10']
+    monAlg.MonitoredChains = ['HLT_2mu14_L12MU8F']
     monAlg.Group = GroupName
 
 
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py
index 27742b57f752..fc1a93f0c21b 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/L2muCombMonConfig.py
@@ -10,7 +10,7 @@ def L2muCombMonConfig(helper):
 
     monAlg = helper.addAlgorithm(CompFactory.L2muCombMonMT,'L2muCombMonMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    monAlg.MonitoredChains =  ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_2mu14_L12MU10']
+    monAlg.MonitoredChains =  ['HLT_mu6_L1MU5VF', 'HLT_mu26_ivarmedium_L1MU14FCH', 'HLT_2mu14_L12MU8F']
     monAlg.Group = GroupName
 
     # configuration of etaphi2D and Ratio plots for non-specific chain
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/MuonTriggerCountMTConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/MuonTriggerCountMTConfig.py
index 6d472f7cce9c..d11aa35deb5e 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/MuonTriggerCountMTConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/MuonTriggerCountMTConfig.py
@@ -7,7 +7,7 @@ def MuonTriggerCountMTConfig(helper):
     from AthenaConfiguration.ComponentFactory import CompFactory
 
     GroupName = 'TriggerCount'
-    Chains =  ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_2mu14_L12MU10', 'HLT_mu22_mu8noL1_L1MU20']
+    Chains =  ['HLT_mu6_L1MU5VF', 'HLT_mu26_ivarmedium_L1MU14FCH', 'HLT_mu50_L1MU14FCH', 'HLT_mu60_0eta105_msonly_L1MU14FCH', 'HLT_2mu14_L12MU8F', 'HLT_mu22_mu8noL1_L1MU14FCH']
 
     monAlg = helper.addAlgorithm(CompFactory.MuonTriggerCountMT,'MuonTriggerCountMT')
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py
index eeae591308ee..17034a13b9d7 100644
--- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py
+++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/python/TrigMuonEfficiencyMonConfig.py
@@ -22,14 +22,13 @@ def TrigMuonEfficiencyMonTTbarConfig(helper):
     from AthenaConfiguration.ComponentFactory import CompFactory
 
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    # To do: add noL1 chain
-    Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_mu14_L1MU10']
+    Chains = ['HLT_mu6_L1MU5VF', 'HLT_mu26_ivarmedium_L1MU14FCH', 'HLT_mu50_L1MU14FCH', 'HLT_mu60_0eta105_msonly_L1MU14FCH', 'HLT_mu14_L1MU8F', 'HLT_mu22_mu8noL1_L1MU14FCH']
 
     for chain in Chains:
         monAlg = helper.addAlgorithm(CompFactory.TrigMuonEfficiencyMonMT,'TrigMuEff_ttbar_'+chain)
 
-        monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU20'
-        monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU20'
+        monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU14FCH'
+        monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU14FCH'
         monAlg.Method = 'TTbarTagAndProbe'
         monAlg.MonitoredChains = [chain]
         threshold, level1 = regex('HLT_mu([0-9]+).*_(L1MU[0-9]+)').match(chain).groups()
@@ -51,14 +50,13 @@ def TrigMuonEfficiencyMonZTPConfig(helper):
     from AthenaConfiguration.ComponentFactory import CompFactory
 
     # HLT_mu6_L1MU6 is test chain for small statistics, so it will be removed.
-    # To do: add noL1 chain
-    Chains = ['HLT_mu6_L1MU6', 'HLT_mu26_ivarmedium_L1MU20', 'HLT_mu50_L1MU20', 'HLT_mu60_0eta105_msonly_L1MU20', 'HLT_mu14_L1MU10']
+    Chains = ['HLT_mu6_L1MU5VF', 'HLT_mu26_ivarmedium_L1MU14FCH', 'HLT_mu50_L1MU14FCH', 'HLT_mu60_0eta105_msonly_L1MU14FCH', 'HLT_mu14_L1MU8F', 'HLT_mu22_mu8noL1_L1MU14FCH']
 
     for chain in Chains:
         monAlg = helper.addAlgorithm(CompFactory.TrigMuonEfficiencyMonMT,'TrigMuEff_ZTP_'+chain)
 
-        monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU20'
-        monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU20'
+        monAlg.EventTrigger = 'HLT_mu26_ivarmedium_L1MU14FCH'
+        monAlg.TagTrigger = 'HLT_mu26_ivarmedium_L1MU14FCH'
         monAlg.Method = 'ZTagAndProbe'
         monAlg.MonitoredChains = [chain]
         threshold, level1 = regex('HLT_mu([0-9]+).*_(L1MU[0-9]+)').match(chain).groups()
-- 
GitLab


From 399530e2a0f7fd53e7db89070a169db4bd3aaef3 Mon Sep 17 00:00:00 2001
From: Malik Aliev <malik.aliev@cern.ch>
Date: Sun, 12 Sep 2021 21:28:10 +0200
Subject: [PATCH 071/347] Menu changes to accommodate NCB requests, JIRA:
 ATR-24107

---
 .../TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py         | 3 ++-
 .../TriggerMenuMT/python/L1/Menu/Menu_MC_HI_v1.py              | 1 +
 .../TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py              | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py
index 1669043dae89..bd0020705532 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py
@@ -65,7 +65,8 @@ def getL1BackgroundSeed(menul1items):
         'L1_BCM_Wide_ABORTGAPNOTCALIB',
         'L1_BCM_AC_CALIB', 'L1_BCM_CA_CALIB',
         'L1_BCM_Wide_CALIB',
-        'L1_J50_UNPAIRED_ISO', 'L1_J50_UNPAIRED_NONISO', 'L1_J50_ABORTGAPNOTCALIB'
+        'L1_J50_UNPAIRED_ISO', 'L1_J50_UNPAIRED_NONISO', 'L1_J50_ABORTGAPNOTCALIB',
+        'L1_J12_EMPTY', 'L1_J12_BGRP12',
         ]
     
     if TriggerFlags.triggerMenuSetup() == 'LS1_v1':
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_HI_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_HI_v1.py
index 9007363d1a9d..da96e8f871ff 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_HI_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_HI_v1.py
@@ -87,6 +87,7 @@ def defineMenu():
         'L1_J30_EMPTY', 'L1_J30_FIRSTEMPTY', 'L1_J30p31ETA49_EMPTY', 'L1_J30p31ETA49_UNPAIRED_ISO', 'L1_J30p31ETA49_UNPAIRED_NONISO',
         'L1_J50_UNPAIRED_ISO', 'L1_J50_UNPAIRED_NONISO', 'L1_J50_ABORTGAPNOTCALIB',         
         'L1_J100_FIRSTEMPTY',
+        'L1_J12_BGRP12',
 
        
         # multi jet
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
index 4088e72a0448..92cac5933a42 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
@@ -127,6 +127,7 @@ def defineMenu():
         'L1_J30_EMPTY', 'L1_J30_FIRSTEMPTY', 'L1_J30p31ETA49_EMPTY', 'L1_J30p31ETA49_UNPAIRED_ISO', 'L1_J30p31ETA49_UNPAIRED_NONISO',
         'L1_J50_UNPAIRED_ISO', 'L1_J50_UNPAIRED_NONISO', 'L1_J50_ABORTGAPNOTCALIB',         
         'L1_J100_FIRSTEMPTY',
+        'L1_J12_BGRP12',
 
         # jJ 
         'L1_jJ12', 'L1_jJ12p0ETA25', 'L1_jJ15', 'L1_jJ15p0ETA25', 'L1_jJ15p31ETA49', 'L1_jJ20', 'L1_jJ20p31ETA49', 'L1_jJ25',  'L1_jJ25p0ETA23',
-- 
GitLab


From 8d769898717d04f646698aa03937dba1069d1d33 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Mon, 13 Sep 2021 11:50:36 +0200
Subject: [PATCH 072/347] AtlasSemantics.py: Invert the merging direction

---
 Control/AthenaConfiguration/python/AtlasSemantics.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Control/AthenaConfiguration/python/AtlasSemantics.py b/Control/AthenaConfiguration/python/AtlasSemantics.py
index 82e5a7346d40..31ebbd22ecb7 100644
--- a/Control/AthenaConfiguration/python/AtlasSemantics.py
+++ b/Control/AthenaConfiguration/python/AtlasSemantics.py
@@ -27,7 +27,7 @@ class AppendListSemantics(GaudiConfig2.semantics.SequenceSemantics):
     def __init__(self, cpp_type, name=None):
         super(AppendListSemantics, self).__init__(cpp_type, name)
 
-    def merge(self,a,b):
+    def merge(self,b,a):
         a.extend(b)
         return a
 
@@ -67,7 +67,7 @@ class VarHandleArraySematics(GaudiConfig2.semantics.PropertySemantics):
         super(VarHandleArraySematics,self).__init__(cpp_type, name)
         pass
 
-    def merge(self,aa,bb):
+    def merge(self,bb,aa):
         for b in bb:
             if b not in aa:
                 aa.append(b)
@@ -84,7 +84,7 @@ class ToolHandleSemantics(GaudiConfig2.semantics.PropertySemantics):
         super(ToolHandleSemantics, self).__init__(cpp_type,name)
         
 
-    def merge(self,a,b):
+    def merge(self,b,a):
         #Deal with 'None'
         if a is None or a=='': return b
         if b is None or b=='': return a
@@ -159,7 +159,7 @@ class PublicHandleArraySemantics(GaudiConfig2.semantics.PropertySemantics):
         return copy.copy(value)
         
 
-    def merge(self,aa,bb):
+    def merge(self,bb,aa):
         for b in bb:
             if b not in aa:
                 aa.append(b)
@@ -185,7 +185,7 @@ class ToolHandleArraySemantics(GaudiConfig2.semantics.PropertySemantics):
             value=PrivateToolHandleArray(value)
         return value
 
-    def merge(self,a,b):
+    def merge(self,b,a):
         for bTool in b:
             try:
                 #If a tool with that name exists in a, we'll merge it
-- 
GitLab


From 20cfa5ea0f17579f0f8472e68fb6baab8feb693b Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Mon, 13 Sep 2021 13:09:00 +0200
Subject: [PATCH 073/347] cleanup, solve cppcheck performance warning

---
 .../src/TRT_ActiveFractionSvc.cxx             | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/InnerDetector/InDetConditions/TRT_RecoConditionsServices/src/TRT_ActiveFractionSvc.cxx b/InnerDetector/InDetConditions/TRT_RecoConditionsServices/src/TRT_ActiveFractionSvc.cxx
index 6ef0c955d155..85e5c0972dee 100644
--- a/InnerDetector/InDetConditions/TRT_RecoConditionsServices/src/TRT_ActiveFractionSvc.cxx
+++ b/InnerDetector/InDetConditions/TRT_RecoConditionsServices/src/TRT_ActiveFractionSvc.cxx
@@ -19,6 +19,7 @@
 #include "TRT_ReadoutGeometry/TRT_BaseElement.h"
 
 #include "StoreGate/ReadCondHandle.h"
+#include <cmath>
 
 //////
 /// Constructor
@@ -144,7 +145,7 @@ void TRT_ActiveFractionSvc::handle( const Incident& inc ) {
     double rMinEndcap = 617.; 
     double rMaxEndcap = 1106.;
     int countAll(0), countDead(0), countSaved(0), countPhiSkipped(0), countEtaSkipped(0), countInvalidEtaValues(0); 
-    for (std::vector<Identifier>::const_iterator it = TRTHelper->straw_layer_begin(); it != TRTHelper->straw_layer_end(); it++  ) {
+    for (std::vector<Identifier>::const_iterator it = TRTHelper->straw_layer_begin(); it != TRTHelper->straw_layer_end(); ++it  ) {
       int nStrawsInLayer = TRTHelper->straw_max(*it);
       for (int i=0; i<=nStrawsInLayer; i++) { 
 
@@ -156,23 +157,23 @@ void TRT_ActiveFractionSvc::handle( const Incident& inc ) {
         countAll++; if (status) countDead++;
 
         const Amg::Vector3D &strawPosition = elements->getDetectorElement(hashId)->center(id);
-        double phi = atan2( strawPosition.y(), strawPosition.x() );
+        double phi = std::atan2( strawPosition.y(), strawPosition.x() );
         int phiBin = findPhiBin( phi );
 	if (phiBin<0) { if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TRT_ActiveFractionSvc::handle phiBin<0: " << phi << " " << phiBin << endmsg; countPhiSkipped++; continue; }
 
 	// calculate etaMin, etaMax
 	int side = TRTHelper->barrel_ec(id);
-        double z = fabs( strawPosition.z() );
+        double z = std::abs( strawPosition.z() );
 	double thetaMin(0.), thetaMax(0.);
 	if (abs(side)==1) { // barrel
           double zRange = 360.; // straw length / 2  
 	  if ( TRTHelper->layer_or_wheel(id) == 0 && TRTHelper->straw_layer(id) < 9 ) zRange = 160.;  // short straws
-	  double r = sqrt( pow(strawPosition.x(), 2) + pow(strawPosition.y(), 2) );
-	  thetaMin = atan( r / (z+zRange) );
-	  thetaMax = ((z-zRange)>0.) ? atan( r / (z-zRange) ) : 1.57; // M_PI_2 - epsilon
+	  double r = std::sqrt( std::pow(strawPosition.x(), 2) + std::pow(strawPosition.y(), 2) );
+	  thetaMin = std::atan( r / (z+zRange) );
+	  thetaMax = ((z-zRange)>0.) ? std::atan( r / (z-zRange) ) : 1.57; // M_PI_2 - epsilon
 	} else { // endcap
-	  thetaMin = atan( rMinEndcap / z );		
-	  thetaMax = atan( rMaxEndcap / z );	
+	  thetaMin = std::atan( rMinEndcap / z );		
+	  thetaMax = std::atan( rMaxEndcap / z );	
 	}
         if (side<0) { // theta -> M_PI - theta
           double thetaDummy = thetaMin;
@@ -184,14 +185,13 @@ void TRT_ActiveFractionSvc::handle( const Incident& inc ) {
         double etaCheck[] = {0., 0.};
         for (int ti=0; ti<2; ti++) {
           if (thetaCheck[ti]<=0.||thetaCheck[ti]>=M_PI) if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TRT_ActiveFractionSvc: theta " << ti << " " << thetaCheck[ti] << endmsg;
-          double tanTheta = tan(thetaCheck[ti]/2.);
+          double tanTheta = std::tan(thetaCheck[ti]/2.);
           if (tanTheta<=0.) { if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "TRT_ActiveFractionSvc: theta tan " << ti << " " << tanTheta << endmsg; countInvalidEtaValues++; continue; }
-          etaCheck[ti] = -log( tanTheta );
+          etaCheck[ti] = -std::log( tanTheta );
         }
        double etaMin = etaCheck[0];
        double etaMax = etaCheck[1];
-//	double etaMin =  -log( tan( thetaMax / 2.) ); // eta goes in the other ways as theta!! etaMIN = f(thetaMAX) 
-//        double etaMax =  -log( tan( thetaMin / 2.) );
+
 	int etaMinBin = findEtaBin( etaMin );
 	int etaMaxBin = findEtaBin( etaMax ); 
         if (etaMin>=etaMax) if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "TRT_ActiveFractionSvc::handle etaMaxBin<etaMinBin " << etaMin << " " << etaMax << " " << thetaMin << " " << thetaMax << endmsg;
-- 
GitLab


From b9ee7cabb38e1076617d85ee1f6b91d48ac69216 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Mon, 13 Sep 2021 14:43:21 +0200
Subject: [PATCH 074/347] pass argument string by reference, not value

---
 .../InDetDetDescr/SCT_Cabling/src/SCT_CablingXmlTags.h          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingXmlTags.h b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingXmlTags.h
index 6a02fd2d9e8e..7537a50d57aa 100644
--- a/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingXmlTags.h
+++ b/InnerDetector/InDetDetDescr/SCT_Cabling/src/SCT_CablingXmlTags.h
@@ -44,7 +44,7 @@ namespace SCT_Cabling{
   
   std::string formatModuleOutput(const unsigned int rod, const unsigned int fibre, 
                                  const int bec,const int layerDisk, const int eta, const int phi, const int side, const int robId,
-                                 const std::string fullsn){
+                                 const std::string & fullsn){
     const std::string sep(" ");
     using std::to_string;
     std::string result= to_string(rod)+sep+to_string(fibre)+sep+to_string(bec)+sep+to_string(layerDisk)+sep;
-- 
GitLab


From 9593dd50c1de4effb1e9f67c391068558dd8cc75 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Mon, 13 Sep 2021 14:57:47 +0200
Subject: [PATCH 075/347] change postfix to prefix increment

---
 .../src/InDetEventCnvTool.cxx                 | 24 ++++++-------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/InnerDetector/InDetEventCnv/InDetEventCnvTools/src/InDetEventCnvTool.cxx b/InnerDetector/InDetEventCnv/InDetEventCnvTools/src/InDetEventCnvTool.cxx
index 8def17fe48dd..e5d052de008e 100755
--- a/InnerDetector/InDetEventCnv/InDetEventCnvTools/src/InDetEventCnvTool.cxx
+++ b/InnerDetector/InDetEventCnv/InDetEventCnvTools/src/InDetEventCnvTool.cxx
@@ -51,30 +51,20 @@ StatusCode InDet::InDetEventCnvTool::initialize() {
   
   // check if SLHC geo is used (TRT not implemented) 
   // if not SLHC, get the TRT Det Descr manager
-  sc = detStore()->retrieve(m_idDictMgr, "IdDict");
-  if (sc.isFailure()) {
-    std::cout << "Could not get IdDictManager !" << std::endl;
-    return StatusCode::FAILURE;
-  } 
+  ATH_CHECK(detStore()->retrieve(m_idDictMgr, "IdDict")) ;
+ 
   const IdDictDictionary* dict = m_idDictMgr->manager()->find_dictionary("InnerDetector");
   if (!dict) {
-    std::cout << " Cannot access InnerDetector dictionary "<< std::endl;
+   ATH_MSG_ERROR( " Cannot access InnerDetector dictionary ");
     return StatusCode::FAILURE;
   }
 
   bool isSLHC = false;
-  // Find value for the field TRT - if not found is SLHC geo
-  //int trtField   = -1;
-  //if (dict->get_label_value("part", "TRT", trtField)) isSLHC=true;
   // Find string SLHC in dictionary file name - if found is SLHC geo
   if (dict->file_name().find("SLHC")!=std::string::npos) isSLHC=true;
 
   //retrieving the various ID helpers
-  
-  if (detStore()->retrieve(m_IDHelper, "AtlasID").isFailure()) {
-    ATH_MSG_FATAL( "Could not get ATLAS ID helper");
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK (detStore()->retrieve(m_IDHelper, "AtlasID"));
 
   ATH_CHECK( detStore()->retrieve(m_pixelHelper, "PixelID") );
   ATH_CHECK( detStore()->retrieve(m_SCTHelper, "SCT_ID") );
@@ -268,7 +258,7 @@ InDet::InDetEventCnvTool::pixelClusterLink( const Identifier& id,  const Identif
     PixelClusterCollection::const_iterator collIt    = ptr->begin();
     PixelClusterCollection::const_iterator collItEnd = ptr->end();
     // there MUST be a faster way to do this!!
-    for ( ; collIt!=collItEnd; collIt++){
+    for ( ; collIt!=collItEnd; ++collIt){
       if ( (*collIt)->identify()==id ) return *collIt;
     }
   }
@@ -297,7 +287,7 @@ InDet::InDetEventCnvTool::sctClusterLink( const Identifier& id,  const Identifie
     SCT_ClusterCollection::const_iterator collIt    = ptr->begin();
     SCT_ClusterCollection::const_iterator collItEnd = ptr->end();
     // there MUST be a faster way to do this!!
-    for ( ; collIt!=collItEnd; collIt++) {
+    for ( ; collIt!=collItEnd; ++collIt) {
       if ( (*collIt)->identify()==id ) return *collIt;
     }
   }
@@ -326,7 +316,7 @@ InDet::InDetEventCnvTool::trtDriftCircleLink( const Identifier& id,  const Ident
     TRT_DriftCircleCollection::const_iterator collIt    = ptr->begin();
     TRT_DriftCircleCollection::const_iterator collItEnd = ptr->end();
     // there MUST be a faster way to do this!!
-    for ( ; collIt!=collItEnd; collIt++) {
+    for ( ; collIt!=collItEnd; ++collIt) {
       if ( (*collIt)->identify()==id ) return *collIt;
     }
   }
-- 
GitLab


From 3c0423c26a5290d7e03129c0d7334a99684b73d1 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Mon, 13 Sep 2021 15:12:04 +0200
Subject: [PATCH 076/347] change postfix to prefix increment

---
 .../InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx | 10 +++-------
 .../InDetPrepRawDataToxAOD/src/SCT_PrepDataToxAOD.cxx  |  2 +-
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx
index e186b68f22e4..1b1183b857be 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx
@@ -366,7 +366,7 @@ StatusCode PixelPrepDataToxAOD::execute()
     }
   }
 
-  for ( auto clusItr = xaod->begin(); clusItr != xaod->end(); clusItr++ ) {
+  for ( auto clusItr = xaod->begin(); clusItr != xaod->end(); ++clusItr ) {
       AUXDATA(*clusItr,char,broken) = false;
   }
 
@@ -374,7 +374,7 @@ StatusCode PixelPrepDataToxAOD::execute()
   static const SG::AuxElement::Accessor<int> acc_phi_module ("phi_module");
   static const SG::AuxElement::Accessor<int> acc_eta_module ("eta_module");
   static const SG::AuxElement::Accessor<std::vector<int> > acc_sihit_barcode ("sihit_barcode");
-  for ( auto clusItr = xaod->begin(); clusItr != xaod->end(); clusItr++ )
+  for ( auto clusItr = xaod->begin(); clusItr != xaod->end(); ++clusItr)
   {
       auto pixelCluster = *clusItr;
       int layer = acc_layer(*pixelCluster);
@@ -586,7 +586,7 @@ std::vector<SiHit> PixelPrepDataToxAOD::findAllHitsCompatibleWithCluster( const
   std::vector<const SiHit* >::iterator siHitIter  = multiMatchingHits.begin();
   std::vector<const SiHit* >::iterator siHitIter2 = multiMatchingHits.begin();
   ATH_MSG_DEBUG( "Found " << multiMatchingHits.size() << " SiHit " );
-  for ( ; siHitIter != multiMatchingHits.end(); siHitIter++) {
+  for ( ; siHitIter != multiMatchingHits.end(); ++siHitIter) {
     const SiHit* lowestXPos  = *siHitIter;
     const SiHit* highestXPos = *siHitIter;
 
@@ -705,8 +705,6 @@ void PixelPrepDataToxAOD::addRdoInformation(xAOD::TrackMeasurementValidation* xp
   for (; rdosBegin!= rdosEnd; ++rdosBegin)
   {
     Identifier rId =  *rdosBegin;
-    // rowList.push_back( m_PixelHelper->phi_index(rId) );
-    // colList.push_back( m_PixelHelper->eta_index(rId) );  
     phiIndexList.push_back( m_PixelHelper->phi_index(rId) );
     etaIndexList.push_back( m_PixelHelper->eta_index(rId) );  
 
@@ -723,8 +721,6 @@ void PixelPrepDataToxAOD::addRdoInformation(xAOD::TrackMeasurementValidation* xp
   }//end iteration on rdos
 
 
-  // AUXDATA(xprd, std::vector<int>, rdo_row)  = rowList;
-  // AUXDATA(xprd, std::vector<int>, rdo_col)  = colList;
   AUXDATA(xprd, std::vector<int>,rdo_phi_pixel_index)  = phiIndexList;
   AUXDATA(xprd, std::vector<int>,rdo_eta_pixel_index)  = etaIndexList;
   AUXDATA(xprd, std::vector<float>,rdo_charge)  = chList;
diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/SCT_PrepDataToxAOD.cxx b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/SCT_PrepDataToxAOD.cxx
index 0004cec08898..eeb8e5a334f7 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/SCT_PrepDataToxAOD.cxx
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/SCT_PrepDataToxAOD.cxx
@@ -390,7 +390,7 @@ void SCT_PrepDataToxAOD::findAllHitsCompatibleWithCluster(const InDet::SCT_Clust
   std::vector<const SiHit*>::iterator siHitIter{multiMatchingHits.begin()};
   std::vector<const SiHit*>::iterator siHitIter2{multiMatchingHits.begin()};
   ATH_MSG_DEBUG("Found " << multiMatchingHits.size() << " SiHit ");
-  for (; siHitIter != multiMatchingHits.end(); siHitIter++) {
+  for (; siHitIter != multiMatchingHits.end(); ++siHitIter) {
     const SiHit* lowestXPos{*siHitIter};
     const SiHit* highestXPos{*siHitIter};
 
-- 
GitLab


From 84a1dde94dae7c67cf9c2d2509beab136fb5853b Mon Sep 17 00:00:00 2001
From: Kenji Hamano <kenji.hamano@cern.ch>
Date: Mon, 13 Sep 2021 06:19:14 -0700
Subject: [PATCH 077/347] monitoring group added to a MET chain

---
 .../TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 0f20464dc93b..ae35f6e1542e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -343,7 +343,7 @@ def setupMenu():
         ChainProp(name='HLT_xe110_pfsum_cssk_L1XE50', l1SeedThresholds=['FSNOSEED'], groups=SingleMETGroup),
         ChainProp(name='HLT_xe110_pfsum_vssk_L1XE50', l1SeedThresholds=['FSNOSEED'], groups=SingleMETGroup),
         # MultiMET Chain
-        ChainProp(name='HLT_xe30_cell_xe30_tcpufit_L1XE30', l1SeedThresholds=['FSNOSEED']*2, groups=MultiMETGroup), #must be FS seeded
+        ChainProp(name='HLT_xe30_cell_xe30_tcpufit_L1XE30', l1SeedThresholds=['FSNOSEED']*2, groups=MultiMETGroup, monGroups=['metMon:shifter']), #must be FS seeded
 
         # Test chains to determine rate after calo-only preselection for tracking
         ChainProp(name='HLT_xe60_cell_L1XE50', l1SeedThresholds=['FSNOSEED'], groups=SingleMETGroup),
-- 
GitLab


From 6772a8ef0efec619bf1bc1da6c76306c7ce19375 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Mon, 13 Sep 2021 15:35:04 +0200
Subject: [PATCH 078/347] change floats to ints for numbers of entries

---
 .../InDetAlignExample/macros/NewSiL1AlignRTT.cc             | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetExample/InDetAlignExample/macros/NewSiL1AlignRTT.cc b/InnerDetector/InDetExample/InDetAlignExample/macros/NewSiL1AlignRTT.cc
index 20d3cfdb7338..547c95f93c53 100644
--- a/InnerDetector/InDetExample/InDetAlignExample/macros/NewSiL1AlignRTT.cc
+++ b/InnerDetector/InDetExample/InDetAlignExample/macros/NewSiL1AlignRTT.cc
@@ -71,17 +71,17 @@ void makePlot(Char_t filename[300], TString psname){
   t->SetTextSize(0.035);
   histname = "IDAlignMon/"+FirstTrackCollection+"/GenericTracks/Nhits_per_event";
   h_events = (TH1F*)file->Get(histname);
-  float iEvents = h_events->GetEntries();	
+  int iEvents = h_events->GetEntries();	
   sprintf(nameh,"Events: %d",iEvents);
   t->DrawLatex(0.08,0.78,nameh);
   histname = "IDAlignMon/"+FirstTrackCollection+"/GenericTracks/Nhits_per_track";
   h_tracks = (TH1F*)file->Get(histname);
-  float TotalTracks = h_tracks->GetEntries();
+  int TotalTracks = h_tracks->GetEntries();
   sprintf(nameh,"ResolvedTrks_all: %d",TotalTracks);
   t->DrawLatex(0.08,0.74,nameh);
   histname = "IDAlignMon/"+SecondTrackCollection+"/GenericTracks/Nhits_per_track";
   h_Aligntracks = (TH1F*)file->Get(histname);
-  float AlignTracks = h_Aligntracks->GetEntries();
+  int AlignTracks = h_Aligntracks->GetEntries();
   sprintf(nameh,"AlignTrks_all: %d",AlignTracks);
   t->DrawLatex(0.08,0.70,nameh);
 
-- 
GitLab


From d9267d0b8638c05ad86b709ceaa80a1ea4c06a95 Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <m.hodgkinson@sheffield.ac.uk>
Date: Mon, 13 Sep 2021 16:10:18 +0200
Subject: [PATCH 079/347] Bug fix to file path used for input file in
 PFlowCalibHitDecorator_jobOptions.py

---
 .../PFlow/PFlowUtils/share/PFlowCalibHitDecorator_jobOptions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Reconstruction/PFlow/PFlowUtils/share/PFlowCalibHitDecorator_jobOptions.py b/Reconstruction/PFlow/PFlowUtils/share/PFlowCalibHitDecorator_jobOptions.py
index 56520ffcdc09..89050881436c 100644
--- a/Reconstruction/PFlow/PFlowUtils/share/PFlowCalibHitDecorator_jobOptions.py
+++ b/Reconstruction/PFlow/PFlowUtils/share/PFlowCalibHitDecorator_jobOptions.py
@@ -1,5 +1,5 @@
 from AthenaCommon.AthenaCommonFlags import athenaCommonFlags 
-athenaCommonFlags.FilesInput=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PFlowTests/mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.recon.ESD.e6337_e5984_s3170_r12674/ESD.25732025._000034.pool.root.1"]
+athenaCommonFlags.FilesInput=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PFlowTests/mc16_13TeV/mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.recon.ESD.e6337_e5984_s3170_r12674/ESD.25732025._000034.pool.root.1"]
 
 #Disable reco of trigger, egamma, muons and taus
 from RecExConfig.RecFlags import rec
-- 
GitLab


From edd2a6fdd29cd3ed56782465e885e128bc4639ee Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Mon, 13 Sep 2021 16:35:18 +0200
Subject: [PATCH 080/347] Add sanity checks for initial/final bunch crossing
 arguments

---
 Simulation/Digitization/python/DigitizationConfigFlags.py | 4 ++++
 Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py   | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/Simulation/Digitization/python/DigitizationConfigFlags.py b/Simulation/Digitization/python/DigitizationConfigFlags.py
index 1a1c6fd1c329..c4ae8e92872b 100644
--- a/Simulation/Digitization/python/DigitizationConfigFlags.py
+++ b/Simulation/Digitization/python/DigitizationConfigFlags.py
@@ -224,6 +224,10 @@ def pileupRunArgsToFlags(runArgs, flags):
     if hasattr(runArgs, "pileupFinalBunch"):
         flags.Digitization.PU.FinalBunchCrossing = runArgs.pileupFinalBunch
 
+    # sanity check
+    if flags.Digitization.PU.InitialBunchCrossing > flags.Digitization.PU.FinalBunchCrossing:
+        raise ValueError("Initial bunch crossing should not be larger than the final one")
+
     if hasattr(runArgs, "inputLowPtMinbiasHitsFile"):
         from Digitization.PileUpUtils import generateBackgroundInputCollections
         flags.Digitization.PU.LowPtMinBiasInputCols = \
diff --git a/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py b/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py
index cabbb553f0b1..e1fa1d1312b9 100644
--- a/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py
+++ b/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py
@@ -121,6 +121,8 @@ if hasattr(runArgs,"digiSteeringConf"):
         digilog.info( "Changing digitizationFlags.digiSteeringConf from %s to %s", digitizationFlags.digiSteeringConf.get_Value(),runArgs.digiSteeringConf)
         digitizationFlags.digiSteeringConf=runArgs.digiSteeringConf+"PileUpToolsAlg"
         PileUpConfigOverride=True
+if digitizationFlags.initialBunchCrossing > digitizationFlags.finalBunchCrossing:
+    raise ValueError( "Initial bunch crossing should not be larger than the final one" )
 if PileUpConfigOverride:
     digilog.info( "NB Some pile-up (re-)configuration was done on the command-line.")
 del PileUpConfigOverride
-- 
GitLab


From 2d2a87c92b8141e8363b1c6270c9cb788f0c7103 Mon Sep 17 00:00:00 2001
From: Mark Sutton <mark.sutton@cern.ch>
Date: Mon, 13 Sep 2021 17:47:03 +0200
Subject: [PATCH 081/347] Fix the muon chain names and the TDT configuration

---
 .../share/TIDAdata-chains-run3.dat            | 36 +++++++-------
 .../python/TrigInDetArtSteps.py               | 18 +++----
 .../TrigInDetValidation_AODtoTrkNtuple.py     | 34 +++++++++----
 .../TrigInDetValidation/share/comparitor.json | 16 +++----
 .../test/test_trigID_bjet_lowpt_pu55.py       | 48 +++++++++++++++++++
 .../test/test_trigID_bjet_pu55.py             | 46 ++++++++++++++++++
 6 files changed, 155 insertions(+), 43 deletions(-)
 create mode 100755 Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_lowpt_pu55.py
 create mode 100755 Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu55.py

diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
index bf77821f9613..83543fecf5be 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
@@ -7,24 +7,24 @@ testChains = {
 
 #ifndef VTXANALYSIS
 
-    "HLT_mu6_idperf_L1MU6:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon",
-    "HLT_mu6_idperf_L1MU6:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon",
-    "HLT_mu6_ivarmedium_L1MU6:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso",
-    "HLT_mu6_ivarmedium_L1MU6:HLT_IDTrack_MuonIso_IDTrig:HLT_Roi_MuonIso",
+    "HLT_mu6_idperf_L1MU5VF:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon",
+    "HLT_mu6_idperf_L1MU5VF:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon",
+    "HLT_mu6_ivarmedium_L1MU5VF:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso",
+    "HLT_mu6_ivarmedium_L1MU5VF:HLT_IDTrack_MuonIso_IDTrig:HLT_Roi_MuonIso",
 
-    "HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon",
-    "HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon",
-    "HLT_mu26_ivarmedium_L1MU20:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso",
-    "HLT_mu26_ivarmedium_L1MU20:HLT_IDTrack_MuonIso_IDTrig:HLT_Roi_MuonIso",
-    "HLT_mu28_ivarmedium_L1MU20:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso",
-    "HLT_mu28_ivarmedium_L1MU20:HLT_IDTrack_MuonIso_IDTrig:HLT_Roi_MuonIso",
-    "HLT_mu26_ivarperf_L1MU20:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso",
-    "HLT_mu26_ivarperf_L1MU20:HLT_IDTrack_MuonIso_IDTrig:HLT_Roi_MuonIso",
+    "HLT_mu24_idperf_L1MU14FCH:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon",
+    "HLT_mu24_idperf_L1MU14FCH:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon",
+    "HLT_mu26_ivarmedium_L1MU14FCH:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso",
+    "HLT_mu26_ivarmedium_L1MU14FCH:HLT_IDTrack_MuonIso_IDTrig:HLT_Roi_MuonIso",
+    "HLT_mu28_ivarmedium_L1MU14FCH:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso",
+    "HLT_mu28_ivarmedium_L1MU14FCH:HLT_IDTrack_MuonIso_IDTrig:HLT_Roi_MuonIso",
+    "HLT_mu26_ivarperf_L1MU14FCH:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso",
+    "HLT_mu26_ivarperf_L1MU14FCH:HLT_IDTrack_MuonIso_IDTrig:HLT_Roi_MuonIso",
 
-    "HLT_mu24_LRT_idperf_L1MU20:HLT_IDTrack_MuonLRT_FTF:HLT_Roi_L2SAMuon_LRT",
-    "HLT_mu6_LRT_idperf_L1MU6:HLT_IDTrack_MuonLRT_IDTrig:HLT_Roi_L2SAMuon_LRT",
-    "HLT_mu6_LRT_idperf_L1MU6:HLT_IDTrack_MuonLRT_FTF:HLT_Roi_L2SAMuon_LRT",
-    "HLT_mu6_idperf_L1MU6:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon",
+    "HLT_mu24_LRT_idperf_L1MU14FCH:HLT_IDTrack_MuonLRT_FTF:HLT_Roi_L2SAMuon_LRT",
+    "HLT_mu6_LRT_idperf_L1MU5VF:HLT_IDTrack_MuonLRT_IDTrig:HLT_Roi_L2SAMuon_LRT",
+    "HLT_mu6_LRT_idperf_L1MU5VF:HLT_IDTrack_MuonLRT_FTF:HLT_Roi_L2SAMuon_LRT",
+    "HLT_mu6_idperf_L1MU5VF:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon",
 
 
 
@@ -61,8 +61,8 @@ testChains = {
     "HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FS_FTF;DTE",
     "HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FSLRT_IDTrig;DTE",
 
-    "HLT_2mu4_bBmumux_BsmumuPhi_L12MU4:HLT_IDTrack_Bmumux_FTF",
-    "HLT_2mu4_bBmumux_BsmumuPhi_L12MU4:HLT_IDTrack_Bmumux_IDTrig",
+    "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_FTF",
+    "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_IDTrig",
 
 
 #endif
diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index f9c3bba04f9c..2d66016e46f3 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -77,17 +77,17 @@ class TrigInDetReco(ExecStep):
         flags = ''
         for i in self.slices:
             if (i=='L2muonLRT') :
-                chains += "'HLT_mu24_LRT_idperf_L1MU20',"
-                chains += "'HLT_mu6_LRT_idperf_L1MU6',"
-                chains += "'HLT_mu6_idperf_L1MU6',"
+                chains += "'HLT_mu24_LRT_idperf_L1MU14FCH',"
+                chains += "'HLT_mu6_LRT_idperf_L1MU5VF',"
+                chains += "'HLT_mu6_idperf_L1MU5VF',"
                 flags += 'doMuonSlice=True;'
             if (i=='FSLRT') :
                 chains += "'HLT_unconvtrk0_fslrt_L1All',"
                 flags  += 'doUnconventionalTrackingSlice=True;'
             if (i=='muon') :
-                chains += "'HLT_mu6_idperf_L1MU6',"
-                chains += "'HLT_mu24_idperf_L1MU20',"
-                chains += "'HLT_mu26_ivarperf_L1MU20',"
+                chains += "'HLT_mu6_idperf_L1MU5VF',"
+                chains += "'HLT_mu24_idperf_L1MU14FCH',"
+                chains += "'HLT_mu26_ivarperf_L1MU14FCH',"
                 flags += 'doMuonSlice=True;'
             if (i=='L2electronLRT') :
                 chains += "'HLT_e5_idperf_loose_lrtloose_L1EM3',"
@@ -122,11 +122,11 @@ class TrigInDetReco(ExecStep):
                 chains += "'HLT_mb_sptrk_L1RD0_FILLED',"
                 flags  += "doMinBiasSlice=True;setMenu='LS2_v1';"
             if (i=='cosmic') :
-                chains += "'HLT_mu4_cosmic_L1MU4'"
+                chains += "'HLT_mu4_cosmic_L1MU3V'"
                 flags  += "doMuonSlice=True;doCosmics=True;setMenu='Cosmic_run3_v1';"
             if (i=='bphys') :
-                chains += "'HLT_mu6_idperf_L1MU6',"
-                chains += "'HLT_2mu4_bBmumux_BsmumuPhi_L12MU4',"
+                chains += "'HLT_mu6_idperf_L1MU5VF',"
+                chains += "'HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V',"
                 flags += 'doMuonSlice=True;doBphysicsSlice=True;'
         if ( flags=='' ) : 
             print( "ERROR: no chains configured" )
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
index beb40ea60a21..7b6bdd72eb51 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
@@ -18,11 +18,29 @@ algseq = CfgMgr.AthSequencer("AthAlgSeq")                #gets the main AthSeque
 
 #only specifying here so that has the standard 'TrigDecisionTool' name
 
-from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
-ToolSvc += CfgMgr.Trig__TrigDecisionTool("TrigDecisionTool")
+### old TDT configuration - LEAVE THIS HERE FOR TH TIME BEING
+### this will be removed once we kow that the nightly tests are 
+### all working again...
+### from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
+### ToolSvc += CfgMgr.Trig__TrigDecisionTool("TrigDecisionTool")
+
+### from TrigEDMConfig.TriggerEDM import EDMLibraries
+### ToolSvc.TrigDecisionTool.Navigation.Dlls = EDMLibraries
+
+### from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
+### myAlg.TrigDecisionTool = conf2toConfigurable(tdtAcc.getPrimary())
+
+from AthenaCommon.Configurable import Configurable
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+from AthenaConfiguration.ComponentAccumulator import appendCAtoAthena
+from TrigDecisionTool.TrigDecisionToolConfig import getTrigDecisionTool
+Configurable.configurableRun3Behavior+=1
+tdtAcc = getTrigDecisionTool(ConfigFlags)
+Configurable.configurableRun3Behavior-=1
+appendCAtoAthena( tdtAcc )
+
+
 
-from TrigEDMConfig.TriggerEDM import EDMLibraries
-ToolSvc.TrigDecisionTool.Navigation.Dlls = EDMLibraries
 
 from AthenaCommon.AppMgr import topSequence
 
@@ -32,11 +50,11 @@ from TrigConfxAOD.TrigConfxAODConf import TrigConf__xAODConfigTool
 cfgtool = TrigConf__xAODConfigTool('xAODConfigTool')
 ToolSvc += cfgtool
 
-tdt = Trig__TrigDecisionTool('TrigDecisionTool')
-tdt.ConfigTool = cfgtool
-tdt.NavigationFormat = "TrigComposite"
+## tdt = Trig__TrigDecisionTool('TrigDecisionTool')
+## tdt.ConfigTool = cfgtool
+## tdt.NavigationFormat = "TrigComposite"
 
-tdt.Navigation.Dlls = [e for e in  EDMLibraries if 'TPCnv' not in e]
+## tdt.Navigation.Dlls = [e for e in  EDMLibraries if 'TPCnv' not in e]
 
 
 jps.AthenaCommonFlags.FilesInput = FilesInput
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
index 932670d8ca21..33c1ab48b303 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
@@ -1,21 +1,21 @@
 {
     "EFmuonLRT":{
-	"chains" : "HLT_mu6_LRT_idperf_L1MU6:HLT_IDTrack_MuonLRT_IDTrig:HLT_Roi_L2SAMuon_LRT HLT_mu6_LRT_idperf_L1MU6:HLT_IDTrack_MuonLRT_FTF:HLT_Roi_L2SAMuon_LRT HLT_mu6_idperf_L1MU6:HLT_IDTrack_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon"
+	"chains" : "HLT_mu6_LRT_idperf_L1MU5VF:HLT_IDTrack_MuonLRT_IDTrig:HLT_Roi_L2SAMuon_LRT HLT_mu6_LRT_idperf_L1MU5VF:HLT_IDTrack_MuonLRT_FTF:HLT_Roi_L2SAMuon_LRT HLT_mu6_idperf_L1MU5VF:HLT_IDTrack_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon"
     },
     "L2muonLRT":{
-	"chains" : "HLT_mu24_LRT_idperf_L1MU20:HLT_IDTrack_MuonLRT_FTF:HLT_Roi_L2SAMuon_LRT HLT_mu6_idperf_L1MU6:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon"
+	"chains" : "HLT_mu24_LRT_idperf_L1MU14FCH:HLT_IDTrack_MuonLRT_FTF:HLT_Roi_L2SAMuon_LRT HLT_mu6_idperf_L1MU5VF:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon"
     },
     "L2muon":{
-        "chains" : "HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon HLT_mu26_ivarperf_L1MU20:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso"
+        "chains" : "HLT_mu24_idperf_L1MU14FCH:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon HLT_mu26_ivarperf_L1MU14FCH:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso"
     },
     "EFmuon":{
-        "chains" : "HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon  HLT_mu24_idperf_L1MU20:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon   HLT_mu26_ivarperf_L1MU20:HLT_IDTrack_MuonIso_IDTrig:HLT_Roi_MuonIso"
+        "chains" : "HLT_mu24_idperf_L1MU14FCH:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon  HLT_mu24_idperf_L1MU14FCH:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon   HLT_mu26_ivarperf_L1MU14FCH:HLT_IDTrack_MuonIso_IDTrig:HLT_Roi_MuonIso"
     },
     "L2muonLowpt":{
-        "chains" : "HLT_mu6_idperf_L1MU6:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon  HLT_mu6_ivarmedium_L1MU6:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso"
+        "chains" : "HLT_mu6_idperf_L1MU5VF:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon  HLT_mu6_ivarmedium_L1MU5VF:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso"
     },
     "EFmuonLowpt":{
-        "chains" : "HLT_mu6_idperf_L1MU6:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon  HLT_mu6_idperf_L1MU6:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon  HLT_mu6_ivarmedium_L1MU6:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso"
+        "chains" : "HLT_mu6_idperf_L1MU5VF:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon  HLT_mu6_idperf_L1MU5VF:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon  HLT_mu6_ivarmedium_L1MU5VF:HLT_IDTrack_MuonIso_FTF:HLT_Roi_MuonIso"
     },
     "L2electronLRT":{
 	"chains" : "HLT_e5_idperf_loose_lrtloose_L1EM3:HLT_IDTrack_ElecLRT_FTF:HLT_Roi_FastElectron_LRT HLT_e26_idperf_loose_lrtloose_L1EM22VHI:HLT_IDTrack_ElecLRT_FTF:HLT_Roi_FastElectron_LRT"
@@ -72,10 +72,10 @@
         "chains" : "HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FSLRT_FTF_DTE  HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FSLRT_IDTrig_DTE"
     },
     "L2bphys":{ 
-	"chains" : "HLT_2mu4_bBmumux_BsmumuPhi_L12MU4:HLT_IDTrack_Bmumux_FTF"
+	"chains" : "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_FTF"
     },
     "EFbphys":{ 
-	"chains" : "HLT_2mu4_bBmumux_BsmumuPhi_L12MU4:HLT_IDTrack_Bmumux_FTF  HLT_2mu4_bBmumux_BsmumuPhi_L12MU4:HLT_IDTrack_Bmumux_IDTrig"
+	"chains" : "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_FTF  HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_IDTrig"
     },
     "L2electronTnP":{
 	"chains" : "HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1"
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_lowpt_pu55.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_lowpt_pu55.py
new file mode 100755
index 000000000000..f133b4357669
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_lowpt_pu55.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+
+# art-description: art job for bjet_lowpt_pu55
+# art-type: grid
+# art-include: master/Athena
+# art-input-nfiles: 3
+# art-athena-mt: 4
+# art-memory: 4096
+# art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir=
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+Slices  = ['bjet']
+Events  = 4000
+Threads = 8 
+Slots   = 8
+Input   = 'ttbar'    # defined in TrigValTools/share/TrigValInputs.json  
+Release = "current"
+
+preinclude_file = "RDOtoRDOTrigger:TrigInDetValidation/TIDAbjetpt_preinclude.py"
+
+Jobs = [ ( "Truth",       " TIDAdata-run3.dat                    -o data-hists.root" ),
+         ( "Offline",     " TIDAdata-run3-offline.dat -r Offline -o data-hists-offline.root" ) ]
+
+Comp = [ ( "L2bjet",              "L2bjet",      "data-hists.root",         " -c TIDAhisto-panel.dat  -d HLTL2-plots " ),
+         ( "L2bjetoffline",       "L2bjet",      "data-hists-offline.root", " -c TIDAhisto-panel.dat  -d HLTL2-plots-offline " ),
+         ( "EFbjet",              "EFbjet",      "data-hists.root",         " -c TIDAhisto-panel.dat  -d HLTEF-plots " ),
+         ( "EFbjetoffline",       "EFbjet",      "data-hists-offline.root", " -c TIDAhisto-panel.dat  -d HLTEF-plots-offline " ) ]
+
+
+from AthenaCommon.Include import include 
+include("TrigInDetValidation/TrigInDetValidation_Base.py")
+
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu55.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu55.py
new file mode 100755
index 000000000000..0159288edb35
--- /dev/null
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu55.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+
+# art-description: art job for bjet_pu55
+# art-type: grid
+# art-include: master/Athena
+# art-input-nfiles: 3
+# art-athena-mt: 4
+# art-memory: 4096
+# art-html: https://idtrigger-val.web.cern.ch/idtrigger-val/TIDAWeb/TIDAart/?jobdir=
+# art-output: *.txt
+# art-output: *.log
+# art-output: log.*
+# art-output: *.out
+# art-output: *.err
+# art-output: *.log.tar.gz
+# art-output: *.new
+# art-output: *.json
+# art-output: *.root
+# art-output: *.check*
+# art-output: HLT*
+# art-output: times*
+# art-output: cost-perCall
+# art-output: cost-perEvent
+# art-output: cost-perCall-chain
+# art-output: cost-perEvent-chain
+# art-output: *.dat 
+
+Slices = ['bjet']
+Events  = 4000
+Threads = 8 
+Slots   = 8
+Input   = 'ttbar'    # defined in TrigValTools/share/TrigValInputs.json  
+Release = "current"
+
+Jobs = [ ( "Truth",       " TIDAdata-run3.dat                    -o data-hists.root" ),
+         ( "Offline",     " TIDAdata-run3-offline.dat -r Offline -o data-hists-offline.root" ) ]
+
+Comp = [ ( "L2bjet",              "L2bjet",      "data-hists.root",         " -c TIDAhisto-panel.dat  -d HLTL2-plots " ),
+         ( "L2bjetoffline",       "L2bjet",      "data-hists-offline.root", " -c TIDAhisto-panel.dat  -d HLTL2-plots-offline " ),
+         ( "EFbjet",              "EFbjet",      "data-hists.root",         " -c TIDAhisto-panel.dat  -d HLTEF-plots " ),
+         ( "EFbjetoffline",       "EFbjet",      "data-hists-offline.root", " -c TIDAhisto-panel.dat  -d HLTEF-plots-offline " ) ]
+
+
+from AthenaCommon.Include import include 
+include("TrigInDetValidation/TrigInDetValidation_Base.py")
+
-- 
GitLab


From 9a0f4b7af1246ec1568cbb3aa15473016b9e0d5a Mon Sep 17 00:00:00 2001
From: Antonio Manuel Mendes Jacques Da Costa
 <antonio.manuel.mendes.jacques.da.costa@cern.ch>
Date: Mon, 13 Sep 2021 18:43:52 +0200
Subject: [PATCH 082/347] Changes on energy encoding scheme

---
 .../L1CaloFEXSim/eFEXCompression.h            | 22 +++++-
 .../L1CaloFEXSim/L1CaloFEXSim/eTower.h        | 24 ++----
 .../L1CaloFEXSim/src/eFEXCompression.cxx      | 65 ++++++++++++++--
 .../L1CaloFEX/L1CaloFEXSim/src/eFEXDriver.cxx |  2 +-
 .../L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx   |  8 +-
 .../L1CaloFEX/L1CaloFEXSim/src/eFakeTower.cxx |  2 +-
 .../L1CaloFEX/L1CaloFEXSim/src/eTower.cxx     | 77 ++++---------------
 7 files changed, 107 insertions(+), 93 deletions(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXCompression.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXCompression.h
index 1ae954501f84..4995ddac0936 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXCompression.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXCompression.h
@@ -22,22 +22,30 @@ This simple utility class contains 3 functions:
   - Compress:  encodes a signed integer MeV value
   - Expand:    decodes a 10 bit unsigned int into a signed integer MeV value
   - Threshold: applies a threshold (in MeV) to the compressed code, zeroing if below
+  - NoiseCut:  applies a noise cut per layer
   - Linearize: decodes a 10 bit unsigned int into the unsigned 16 bit eFEX ET with
                least count of 25 MeV. A user-defined threshold (in MeV) can be 
                applied, but as the eFEX ET is positive a negative threshold is
                equivalent to a threshold of 0.
+  - Decode:  encodes a signed integer MeV value, checks is noise cut is passed,
+               and then decodes a 10 bit unsigned int into the unsigned 16 bit eFEX ET 
+	       with least count of 25 MeV.
   */
 class eFEXCompression {
 
 public: 
   /** Compress data */
-  static unsigned int Compress(int Et);
+  static unsigned int compress(int Et);
   /** Uncompress data */
-  static int Expand(unsigned int code);
+  static int expand(unsigned int code);
   /** Apply threshold to compressed data */
-  static unsigned int Threshold(unsigned int code, int threshold = -800);
+  static unsigned int threshold(unsigned int code, int threshold = -800);
+  /** Apply supercell noise cut **/
+  static bool noiseCut(unsigned int code, int layer);
   /** Linearize LAr code to eFEX internal format */
-  static unsigned int Linearize(unsigned int code, int threshold = 0);
+  static unsigned int linearize(unsigned int code, int threshold = 0);
+  /** Full sequence **/
+  static unsigned int decode(int EtVal, int layer);
  
 private: 
   /** Maximum ET value that can be encoded */
@@ -70,6 +78,12 @@ private:
   static const unsigned int s_eFEXOverflow = 0xffff;
   /** Error return value */
   static const int s_error = -999;
+  /** Noise Cuts per layer **/
+  static const unsigned int m_noisecutPS = 36; // corresponds to 100 MeV
+  static const unsigned int m_noisecutL1 = 36;
+  static const unsigned int m_noisecutL2 = 36;
+  static const unsigned int m_noisecutL3 = 36;
+  static const unsigned int m_noisecutHad = 36;
 };
 
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eTower.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eTower.h
index 4b543858e0db..fba374c144d0 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eTower.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eTower.h
@@ -77,22 +77,22 @@ namespace LVL1 {
     float constid() const {return m_tower_id;};
 
     /** Get ET of a specified cell in MeV */
-    int getET(unsigned int layer, int cell = 0) const;
+    unsigned int getET(unsigned int layer, int cell = 0) const;
     
     /** Get ET sum of all cells in the eTower in MeV */
-    int getTotalET() const;
+    unsigned int getTotalET() const;
 
     /** Get total ET sum of all cells in a given layer in MeV */
-    int getLayerTotalET(unsigned int layer) const;
+    unsigned int getLayerTotalET(unsigned int layer) const;
 
     /** Get vector of ET values for a given layer in MeV */
-    std::vector<int> getLayerETvec(unsigned int layer) const;
+    std::vector<unsigned int> getLayerETvec(unsigned int layer) const;
     
     /** Get vector of all ET values in MeV */
-    std::vector<int> getETs() const {return m_et;};
+    std::vector<unsigned int> getETs() const {return m_et;};
 
     /** Get vector of INT which describe whether a slot shared split ET from two different supercells - required information for production of CSV input files */
-    std::vector<int> getETSplits() const {return m_etSplits;};
+    std::vector<unsigned int> getETSplits() const {return m_etSplits;};
 
     /** Get ET of a specified cell in MeV FLOAT VERSION */
     float getET_float(unsigned int layer, int cell = 0) const;
@@ -120,9 +120,6 @@ namespace LVL1 {
 
     std::vector<Identifier> getLayerSCIDs(unsigned int layer) const;
 
-    /** Apply supercell noise cut **/
-    bool noiseCut(int et, int layer) const;
-
     void setPosNeg(int posneg);
 
     inline int getPosNeg() const {return m_posneg;}
@@ -132,16 +129,11 @@ namespace LVL1 {
     float m_eta;
     float m_phi;
     std::vector<Identifier> m_scID;
-    std::vector<int> m_et;    
+    std::vector<unsigned int> m_et;    
     std::vector<float> m_et_float;
-    std::vector<int> m_etSplits;
+    std::vector<unsigned int> m_etSplits;
     int m_tower_id;
     int m_posneg = 0;
-    int m_noisecutPS = 100;
-    int m_noisecutL1 = 100;
-    int m_noisecutL2 = 100;
-    int m_noisecutL3 = 100;
-    int m_noisecutHad = 100;
 
   };
   
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXCompression.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXCompression.cxx
index f844c0887a5a..20d580de9a4d 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXCompression.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXCompression.cxx
@@ -16,7 +16,7 @@ const int eFEXCompression::s_steps[] = {25, 50, 100, 200, 400, 102400};
 const int eFEXCompression::s_minET[] = {-750, 1600, 6400, 25600, 102400, 200000};
 const int eFEXCompression::s_minCode[] = {2, 96, 192, 384, 768, 1012};
 
-unsigned int eFEXCompression::Compress(int Et) {
+unsigned int eFEXCompression::compress(int Et) {
 
   // Check for overflow
   if (Et >= s_maxET) return s_LArOverflow;
@@ -44,7 +44,7 @@ unsigned int eFEXCompression::Compress(int Et) {
   return code;
 }
 
-int eFEXCompression::Expand(unsigned int code) {
+int eFEXCompression::expand(unsigned int code) {
 
   // Deal with special codes first:
   if (code == s_NoData)  return 0;
@@ -64,11 +64,39 @@ int eFEXCompression::Expand(unsigned int code) {
   return Et;
 }
 
+bool eFEXCompression::noiseCut(unsigned int code, int layer) {
+    // Check if noise cut is passed - one cut per layer  
+    bool pass=true;
+
+    switch(layer){
+    case 0: 
+      if(code<m_noisecutPS){ pass = false; }
+      break;
+    case 1:
+      if(code<m_noisecutL1){ pass = false; }
+      break;
+    case 2:
+      if(code<m_noisecutL2){ pass = false; }
+      break;
+    case 3: 
+      if(code<m_noisecutL3){ pass = false; }
+      break;
+    case 4:
+      if(code<m_noisecutHad){ pass = false; }
+      break;
+    default: 
+      pass = false;
+      break;
+    }
+    
+    return pass;
+}
+
 
-unsigned int eFEXCompression::Threshold(unsigned int code, int threshold) {
+unsigned int eFEXCompression::threshold(unsigned int code, int threshold) {
 
   /// Convert threshold into a compressed code
-  unsigned int cut = eFEXCompression::Compress(threshold);
+  unsigned int cut = eFEXCompression::compress(threshold);
 
   /// Zero code if < threshold
   if (code < cut) code = 0;
@@ -77,14 +105,14 @@ unsigned int eFEXCompression::Threshold(unsigned int code, int threshold) {
 }
 
 
-unsigned int eFEXCompression::Linearize(unsigned int code, int threshold) {
+unsigned int eFEXCompression::linearize(unsigned int code, int threshold) {
 
   /// Apply the threshold. Since eFEX ET is positive, minimum threshold is 0.
   if (threshold < 0) threshold = 0;
-  code = eFEXCompression::Threshold(code, threshold);
+  code = eFEXCompression::threshold(code, threshold);
 
   /// Expand the ET value
-  int Et = eFEXCompression::Expand(code);
+  int Et = eFEXCompression::expand(code);
 
   // Check for overflow
   if (Et >= s_maxET) return s_eFEXOverflow;
@@ -94,4 +122,27 @@ unsigned int eFEXCompression::Linearize(unsigned int code, int threshold) {
   return eFexET;
 }
 
+unsigned int eFEXCompression::decode(int EtVal, int layer) {
+
+  // Calculate code
+  unsigned int tcode = eFEXCompression::compress(EtVal);
+
+  /// Check if noise cut is passed
+  unsigned int code = 0; // corresponds to 0 GeV
+  if (eFEXCompression::noiseCut(tcode,layer)) {
+    code = tcode;
+  }
+
+  /// Expand the ET value
+  int Et = eFEXCompression::expand(code);
+  
+  // Check for overflow
+  if (Et >= s_maxET) return s_eFEXOverflow;
+
+  /// Convert to eFEX digit scale: 25 MeV
+  unsigned int eFexET = Et/s_eFEXstep;
+
+  return eFexET;
+}
+
 } // end of namespace bracket
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXDriver.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXDriver.cxx
index a5040d810ffb..a7b290b21754 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXDriver.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXDriver.cxx
@@ -142,7 +142,7 @@ StatusCode eFEXDriver::finalize()
         int slotcount = 0;
         for (int layer = 0; layer<=4; layer++){
           std::vector<Identifier> scIDs = (*thistower)->getLayerSCIDs(layer);
-          std::vector<int> splits = (*thistower)->getETSplits();
+          std::vector<unsigned int> splits = (*thistower)->getETSplits();
           for (long unsigned int ncell = 0; ncell < scIDs.size(); ncell++){
             sc_tower_map << (*thistower)->id() << "," << scIDs[ncell] << "," << slotcount << "," << splits[slotcount] << "\n";
             slotcount++;
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
index 2845743f16de..b41100a1c519 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
@@ -95,6 +95,7 @@ StatusCode eFEXFPGA::execute(eFEXOutputCollection* inputOutputCollection){
 
   auto & thr_eEM = l1Menu->thrExtraInfo().eEM();
 
+  const unsigned int eFexstep = 25;
   const unsigned int eFexTobstep = 100;
 
   for(int ieta = 1; ieta < 5; ieta++) {
@@ -119,12 +120,13 @@ StatusCode eFEXFPGA::execute(eFEXOutputCollection* inputOutputCollection){
       unsigned int ptMinToTopoCounts = 0;
       ptMinToTopoCounts = thr_eEM.ptMinToTopoCounts(); 
 
-      //returns a unsigned integer et value corresponding to the... eFEX EM cluster? in MeV?
+      //returns a unsigned integer et value corresponding to the... eFEX EM cluster? in 1 MeV scale
       unsigned int eEMTobEt = 0;
       eEMTobEt = m_eFEXegAlgoTool->getET();
+      
       unsigned int eEMTobEtCounts = 0;
-      eEMTobEtCounts = eEMTobEt/eFexTobstep;//steps of 100 MeV for the TOB
-
+      eEMTobEtCounts = eEMTobEt*eFexstep/eFexTobstep; //rescale from 25 MeV eFEX steps to 100 MeV for the TOB
+      
       // thresholds from Trigger menu
       auto iso_loose  = thr_eEM.isolation(TrigConf::Selection::WP::LOOSE, ieta);
       auto iso_medium = thr_eEM.isolation(TrigConf::Selection::WP::MEDIUM, ieta);
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFakeTower.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFakeTower.cxx
index 127fe7cae690..b78aa1102d11 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFakeTower.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFakeTower.cxx
@@ -232,7 +232,7 @@ std::vector<int>* LVL1::eFakeTower::loadBlock(std::string inputfile, int eventnu
         if (eventnumber == 0) {
           output->push_back(std::stoi(temvalue));
         } else {
-          int et = eFEXCompression::Expand(int(strtoull(temvalue.c_str(), nullptr, 16)));
+          int et = eFEXCompression::expand(int(strtoull(temvalue.c_str(), nullptr, 16)));
           output->push_back(et);
         }
       }
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eTower.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eTower.cxx
index f563af8a1cb6..ae96c4ace66e 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eTower.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eTower.cxx
@@ -101,13 +101,8 @@ namespace LVL1 {
     addET(et, cell);
     
     //multi linear digitisation encoding
-    unsigned int ecode = eFEXCompression::Compress(m_et_float[cell]);
-    int outET = eFEXCompression::Expand(ecode);
-    
-    //noise cut
-    const bool SCpass = noiseCut(outET,layer);
-    if (SCpass){ m_et[cell] = outET;}
-    else{ m_et[cell] = 0; }
+    unsigned int outET = eFEXCompression::decode((unsigned int)m_et_float[cell],layer);
+    m_et[cell] = outET;
   }
 
   /** Set supercell position ID and ET**/
@@ -122,16 +117,10 @@ namespace LVL1 {
       addET(et, cell);
       
       m_scID[cell] = ID;
-      
+    
       //multi linear digitisation encoding
-      unsigned int ecode = eFEXCompression::Compress(m_et_float[cell]);
-      int outET = eFEXCompression::Expand(ecode);
-      
-      //noise cut
-      const bool SCpass = noiseCut(outET,layer);
-      if (SCpass){ m_et[cell] = outET;}
-      else{ m_et[cell] = 0; }
-      
+      unsigned int outET = eFEXCompression::decode((unsigned int)m_et_float[cell],layer);
+      m_et[cell] = outET;
     }
     else{
 
@@ -142,51 +131,17 @@ namespace LVL1 {
       m_etSplits[cell] = 1;
       m_etSplits[cell+1] = 1;
 
-      unsigned int ecode1 = eFEXCompression::Compress(m_et_float[cell]);
-      int outET1 = eFEXCompression::Expand(ecode1);
-      unsigned int ecode2 = eFEXCompression::Compress(m_et_float[cell+1]);
-      int outET2 = eFEXCompression::Expand(ecode2);
-
-      //noise cuts
-      const bool SCpass1 = noiseCut(outET1,layer);
-      if (SCpass1){ m_et[cell] = outET1;}
-      else{ m_et[cell] = 0; }
-      const bool SCpass2 = noiseCut(outET2,layer);
-      if (SCpass2){ m_et[cell+1] = outET2;}
-      else{ m_et[cell+1] = 0; }
-
+      unsigned int outET1 = eFEXCompression::decode((unsigned int)m_et_float[cell],layer);
+      unsigned int outET2 = eFEXCompression::decode((unsigned int)m_et_float[cell+1],layer);
+      
+      m_et[cell] = outET1;
+      m_et[cell+1] = outET2;
     }
 
     return;
 
   }
 
-  /** Apply noise cut per layer **/
-  bool eTower::noiseCut(int et, int layer) const
-  {
-
-    bool pass=true;                                                                                                         
-    if(layer==0) {
-      if(et<m_noisecutPS){ pass = false; }
-    } 
-    else if (layer==1) {
-      if(et<m_noisecutL1){ pass = false; }
-    } 
-    else if (layer==2) {
-      if(et<m_noisecutL2){ pass = false; }
-    } 
-    else if (layer==3) {
-      if(et<m_noisecutL3){ pass = false; }
-    } 
-    else if (layer==4) {
-      if(et<m_noisecutHad){ pass = false; }
-    } 
-    else { pass = false; }
-    
-    return pass;
-
-  }
-
   /** Return global eta index.
       Should be derived from tower ID, should be corrected in the future.
       Need to also think what index range should be (thinking ahead to Run2) */
@@ -203,7 +158,7 @@ namespace LVL1 {
   }
   
   /** Return ET of specified supercell */
-  int eTower::getET(unsigned int layer,  int cell) const {
+  unsigned int eTower::getET(unsigned int layer,  int cell) const {
     
     /// Check cell index in range for layer
     if (layer > 5 || cell < 0 || cell >= s_cells[layer]) return 0;
@@ -225,9 +180,9 @@ namespace LVL1 {
   }
 
   /** Return ET of all supercells together*/
-  int eTower::getTotalET() const{
+  unsigned int eTower::getTotalET() const{
     
-    int tmp = 0;
+    unsigned int tmp = 0;
     for (unsigned int i=0; i<m_et.size(); i++){
       tmp += m_et[i];
     }
@@ -250,10 +205,10 @@ namespace LVL1 {
 
   
   /** Return supercell ET values for specified layer */
-  std::vector<int> eTower::getLayerETvec(unsigned int layer) const {
+  std::vector<unsigned int> eTower::getLayerETvec(unsigned int layer) const {
     
     /// Create empty vector of data
-    std::vector<int> cells;
+    std::vector<unsigned int> cells;
     
     /// Check cell index in range for layer
     if (layer > 5) return cells;
@@ -282,7 +237,7 @@ namespace LVL1 {
 
 
   /** Return supercell ET values for specified layer */
-  int eTower::getLayerTotalET(unsigned int layer) const {
+  unsigned int eTower::getLayerTotalET(unsigned int layer) const {
         
     if (layer == 0){
       return m_et[0];
-- 
GitLab


From b3b336f182745f7c0727654acc64a4b7c30d94aa Mon Sep 17 00:00:00 2001
From: Will Buttinger <will.buttinger@cern.ch>
Date: Mon, 13 Sep 2021 18:47:45 +0200
Subject: [PATCH 083/347] Fixes to analysis mode of running athena

---
 .../AthAnalysisAlgorithm.h                    |  61 +++++-
 .../AthAnalysisBaseComps/AthAnalysisHelper.h  |   6 +
 .../src/AthAnalysisAlgorithm.cxx              | 179 +++++++++++++++++-
 .../src/AthAnalysisHelper.cxx                 |  38 ++++
 .../AthenaRootComps/src/xAODEventSelector.cxx |  56 +++++-
 5 files changed, 318 insertions(+), 22 deletions(-)

diff --git a/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisAlgorithm.h b/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisAlgorithm.h
index e0ddb4bc8ba7..0b596ca6a000 100644
--- a/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisAlgorithm.h
+++ b/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisAlgorithm.h
@@ -15,6 +15,8 @@
 
 /** @class AthAnalysisAlgorithm AthAnalysisAlgorithm.h AthAnalysisBaseComps/AthAnalysisAlgorithm.h
  *
+ *  Same as AthAlgorithm but adds a beginInputFile method and handle method for incident listening
+ *  Also adds a retrieveMetadata method for easy metadata retrieval from InputMetaDataStore (method not IOV Safe though!)
  *  Update Feb 2016: Made inherit from AthHistogramAlgorithm, since that has nice histogram booking features
 
  *  @author Will Buttinger
@@ -23,14 +25,14 @@
 
 #include "AthenaBaseComps/AthHistogramAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h" //included under assumption you'll want to use some tools!
+#include "GaudiKernel/IIncidentSvc.h"
+
 
 #include "AthAnalysisBaseComps/AthAnalysisHelper.h"
 #include "TFile.h"
 
-class AthAnalysisAlgorithm
-  : public ::AthHistogramAlgorithm
-{
-public:
+class AthAnalysisAlgorithm : public ::AthHistogramAlgorithm, virtual public IIncidentListener {
+ public:
 
   /// Constructor taking just a name
   AthAnalysisAlgorithm(const std::string& name);
@@ -55,12 +57,55 @@ public:
   /// override to do firstEvent method
   virtual StatusCode sysExecute(const EventContext&) override;
 
+    /// Helper function to access IOVMetaDataContainer information helped in the MetaDataStore
+    template<typename T> StatusCode retrieveMetadata(const std::string& folder, const std::string& key, T& out) {
+        try {
+            return AthAnalysisHelper::retrieveMetadata(folder,key,out,inputMetaStore());
+        } catch(std::exception& e) {
+            ATH_MSG_WARNING(e.what());
+            return StatusCode::FAILURE;
+        }
+    }
+
+    /// Helper function to access IOVMetaDataContainer information held in InputMetaDataStore, but will check IOVTime. Also can give a channel (leave as -1 to take first available)
+    /// IOVTime(runNumber, eventNumber) is a valid constructor for example
+    template<typename T> StatusCode retrieveMetadata(const std::string& folder, const std::string& key, T& out, IOVTime time, int channel=-1) {
+        try {
+            return AthAnalysisHelper::retrieveMetadata(folder,key,out,inputMetaStore(),time,channel);
+        } catch(std::exception& e) {
+            ATH_MSG_WARNING(e.what());
+            return StatusCode::FAILURE;
+        }
+    }
+
 protected:
   void updateEvtStore(Gaudi::Details::PropertyBase& prop);
 
-  /// Function called when first execute is encountered
-  /// user can read event information with evtStore()
-  virtual StatusCode firstExecute();
+
+    /// Function receiving incidents from IncidentSvc/TEvent
+    /// Experts can override but they should ensure they add
+    ///   AthAnalysisAlgorithm::handle();
+    /// to the end of their own implementation
+    virtual void handle( const Incident& inc ) override;
+
+    /// Function called when a new input file is opened
+    /// user can read input metadata from inputMetaStore()
+    virtual StatusCode beginInputFile();
+
+    /// Function called as an input file is being closed
+    virtual StatusCode endInputFile();
+
+    /// Function called before finalize
+    /// user can read output metadata from outputMetaStore()
+    virtual StatusCode metaDataStop();
+
+    /// Function called when first execute is encountered
+    /// user can read event information with evtStore()
+    virtual StatusCode firstExecute();
+
+    /// Function returning the TFile pointer of the currently open file of the
+    /// given EventSelector (in athena jobs this defaults to "EventSelector")
+    virtual TFile* currentFile(const char* evtSelName="EventSelector") final;
 
 private:
   /// Object accessing the input metadata store
@@ -68,6 +113,8 @@ private:
   /// Object accessing the output metadata store
   mutable ServiceHandle< StoreGateSvc > m_outputMetaStore;
 
+    TFile* m_currentFile = 0; //used to cache the current file
+
   bool m_doneFirstEvent{false};
 };
 
diff --git a/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h b/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
index 24f4c8cfe5c9..5925908a88af 100644
--- a/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
+++ b/Control/AthAnalysisBaseComps/AthAnalysisBaseComps/AthAnalysisHelper.h
@@ -32,6 +32,7 @@
 #include "GaudiKernel/ToolHandle.h"
 
 #include <type_traits>
+#include "TFile.h"
 
 class AthAnalysisHelper { //thought about being a namespace but went for static methods instead, in case I want private data members in future
 
@@ -377,6 +378,11 @@ public:
 
 
 
+  //Obtain TFile pointer to THistSvc's output file with the given streamName
+  static TFile* getOutputFile(const std::string& streamName);
+
+
+
 
    ///we keep a static handle to the joboptionsvc, since it's very useful
    ///can e.g. do: AAH::joSvc->readOptions("myJob.opts","$JOBOPTSEARCHPATH")
diff --git a/Control/AthAnalysisBaseComps/src/AthAnalysisAlgorithm.cxx b/Control/AthAnalysisBaseComps/src/AthAnalysisAlgorithm.cxx
index 91b7d56db50e..741b96d7c47b 100644
--- a/Control/AthAnalysisBaseComps/src/AthAnalysisAlgorithm.cxx
+++ b/Control/AthAnalysisBaseComps/src/AthAnalysisAlgorithm.cxx
@@ -6,13 +6,15 @@
 
 // AthAnalysisAlgorithm.cxx 
 // Implementation file for class AthAnalysisAlgorithm
-// Exactly like an AthAlgorithm
+// Exactly like an AthAlgorithm except also has Metadata accessors
+// and beginInputFile method
 // Author: W.Buttinger<will@cern.ch>
 /////////////////////////////////////////////////////////////////// 
 
 #include "AthAnalysisBaseComps/AthAnalysisAlgorithm.h"
 
 #include "TROOT.h"
+#include "TObjString.h"
 
 AthAnalysisAlgorithm::AthAnalysisAlgorithm( const std::string& name )
   : AthAnalysisAlgorithm( name, Gaudi::svcLocator() )
@@ -57,11 +59,24 @@ ServiceHandle<StoreGateSvc>& AthAnalysisAlgorithm::outputMetaStore() const {
 
 StatusCode AthAnalysisAlgorithm::sysInitialize() {
 
-  // Let the base class do its thing:
-  ATH_CHECK( AthHistogramAlgorithm::sysInitialize() );
+      // Connect to the IncidentSvc:
+      ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
+      ATH_CHECK( incSvc.retrieve() );
 
-  // Return gracefully:
-  return StatusCode::SUCCESS;
+      // Set up the right callbacks: //but ensure we don't double-register if sysInitialize called twice (appears to be the case)
+      incSvc->removeListener( this, IncidentType::BeginInputFile );
+      incSvc->addListener( this, IncidentType::BeginInputFile, 0, true );
+      incSvc->removeListener( this, IncidentType::EndInputFile );
+      incSvc->addListener( this, IncidentType::EndInputFile, 0, true );
+      incSvc->removeListener( this, "MetaDataStop" );
+      incSvc->addListener( this, "MetaDataStop", 0, true );
+
+
+      // Let the base class do its thing:
+      ATH_CHECK( AthHistogramAlgorithm::sysInitialize() );
+
+      // Return gracefully:
+      return StatusCode::SUCCESS;
 }
 
 StatusCode AthAnalysisAlgorithm::sysExecute(const EventContext& ctx) {
@@ -75,6 +90,60 @@ StatusCode AthAnalysisAlgorithm::sysExecute(const EventContext& ctx) {
   return AthHistogramAlgorithm::sysExecute(ctx);
 }
 
+void AthAnalysisAlgorithm::handle( const Incident& inc ) {
+
+   // Tell the user what's happening:
+   ATH_MSG_VERBOSE( "Callback received with incident: " << inc.type() );
+
+   // Call the appropriate member function:
+   if( inc.type() == IncidentType::BeginInputFile ) {
+      m_currentFile=0;
+      if( beginInputFile().isFailure() ) {
+         ATH_MSG_FATAL( "Failed to call beginInputFile()" );
+         throw std::runtime_error( "Couldn't call beginInputFile()" );
+      }
+   } else if(inc.type() == IncidentType::EndInputFile ) {
+     if( endInputFile().isFailure() ) {
+         ATH_MSG_FATAL( "Failed to call endInputFile()" );
+         throw std::runtime_error( "Couldn't call endInputFile()" );
+      }
+   } else if(inc.type() == "MetaDataStop" ) {
+     if( metaDataStop().isFailure() ) {
+         ATH_MSG_FATAL( "Failed to call metaDataStop()" );
+         throw std::runtime_error( "Couldn't call metaDataStop()" );
+      }
+   } else {
+      ATH_MSG_WARNING( "Unknown incident type received: " << inc.type() );
+   }
+
+   return;
+}
+
+/// Dummy implementation that can be overridden by the derived tool.
+///
+StatusCode AthAnalysisAlgorithm::beginInputFile() {
+
+   // Return gracefully:
+   return StatusCode::SUCCESS;
+}
+
+/// Dummy implementation that can be overridden by the derived tool.
+///
+StatusCode AthAnalysisAlgorithm::endInputFile() {
+
+   // Return gracefully:
+   return StatusCode::SUCCESS;
+}
+
+/// Dummy implementation that can be overridden by the derived tool.
+///
+StatusCode AthAnalysisAlgorithm::metaDataStop() {
+
+   // Return gracefully:
+   return StatusCode::SUCCESS;
+}
+
+
 /// Dummy implementation that can be overridden by the derived tool.
 ///
 StatusCode AthAnalysisAlgorithm::firstExecute() {
@@ -82,3 +151,103 @@ StatusCode AthAnalysisAlgorithm::firstExecute() {
    // Return gracefully:
    return StatusCode::SUCCESS;
 }
+
+
+
+TFile* AthAnalysisAlgorithm::currentFile(const char* evtSelName) {
+   if(m_currentFile) return m_currentFile;
+
+   //get the EventSelector so we can get it's list of input files
+   //dont get it with a ServiceHandle, because that invokes initialize, can get into init loop
+
+   IProperty* evtSelector = 0;
+   if(service(evtSelName,evtSelector,false).isFailure()) {
+     ATH_MSG_ERROR("currentFile(): Couldn't find the service: " << evtSelName);return 0;
+   }
+   //SmartIF<IProperty> evtSelector(mysel);
+   /*
+   ServiceHandle<IProperty> evtSelector(evtSelName,name());
+
+   if(evtSelector.retrieve().isFailure()) {
+      ATH_MSG_ERROR("currentFile(): Couldn't find the service: " << evtSelName);return 0;
+      }*/
+
+   try {
+      //get the list of input files - use this to determine which open file is the current input file
+      const StringArrayProperty& inputCollectionsName = dynamic_cast<const StringArrayProperty&>(evtSelector->getProperty("InputCollections"));
+
+      ATH_MSG_VERBOSE("nOpenFile=" << gROOT->GetListOfFiles()->GetSize() << ". nFilesInInputCollection=" << inputCollectionsName.value().size());
+      if(msgLvl(MSG::VERBOSE)) {
+          for(int i=0;i<gROOT->GetListOfFiles()->GetSize();i++) {
+            ATH_MSG_VERBOSE("Open file: " << gROOT->GetListOfFiles()->At(i)->GetName());
+          }
+      }
+
+      //look through list of files and find the one from the input collection that is currently open
+
+      for(int i=0;i<gROOT->GetListOfFiles()->GetSize();i++) {
+            TFile *g = (TFile*)gROOT->GetListOfFiles()->At(i);
+            //see if this file is in the input file list
+            //strip everything except stuff either side of last /
+            TString s(g->GetName());
+            TObjArray* tokens = s.Tokenize("/");
+            TObjString* lastToken = dynamic_cast<TObjString*>(tokens->Last());
+            TString sToCompare("");
+            bool shortComparison(false);
+            if(tokens->GetEntries()>1) {
+                TString beforeSlash((dynamic_cast<TObjString*>(tokens->At(tokens->GetEntries()-2)))->GetString());
+                if(beforeSlash.Length()>0) sToCompare += beforeSlash;
+                sToCompare += "/";
+            } else {
+                shortComparison=true;
+            }
+            sToCompare += lastToken->GetString();
+            TString sToCompare_short(lastToken->GetString()); //short versions search
+            delete tokens;
+
+            for(unsigned int j=0;j<inputCollectionsName.value().size();j++) {
+                TString t(inputCollectionsName.value()[j].c_str());
+                //try perfect match first
+                if(s.EqualTo(t)) {
+                  ATH_MSG_VERBOSE("Current File is: " << inputCollectionsName.value()[j]);
+                  m_currentFile = g;
+                  return g;
+                }
+                TObjArray* tokens = t.Tokenize("/");
+                TObjString* lastToken = dynamic_cast<TObjString*>(tokens->Last());
+                TString tToCompare = "";
+                bool shortComparison2(false);
+                if(tokens->GetEntries()>1) {
+                  TString beforeSlash((dynamic_cast<TObjString*>(tokens->At(tokens->GetEntries()-2)))->GetString());
+                  if(beforeSlash.Length()>0) tToCompare += beforeSlash;
+                  tToCompare += "/";
+                } else {
+                  shortComparison2=true;
+                }
+                tToCompare += lastToken->GetString();
+                TString tToCompare_short(lastToken->GetString());
+                delete tokens;
+
+                if(shortComparison || shortComparison2) { //doing short version search, no directories to distinguish files!
+                  if(sToCompare_short.EqualTo(tToCompare_short)) {
+                      ATH_MSG_VERBOSE("Current File is: " << inputCollectionsName.value()[j]);
+                      m_currentFile = g;
+                      return g;
+                  }
+                } else
+                if(sToCompare.EqualTo(tToCompare)) {
+                  ATH_MSG_VERBOSE("Current File is: " << inputCollectionsName.value()[j]);
+                  m_currentFile=g;
+                  return g;
+                }
+            }
+      }
+
+   } catch(...) {
+     ATH_MSG_ERROR("currentFile(): Couldn't load InputCollections property of " << evtSelName); return 0;
+   }
+
+   ATH_MSG_ERROR("currentFile(): Could not find the current file!");
+   return 0; //something went wrong :-(
+
+}
diff --git a/Control/AthAnalysisBaseComps/src/AthAnalysisHelper.cxx b/Control/AthAnalysisBaseComps/src/AthAnalysisHelper.cxx
index 4d27d5f130b5..3fa044058f15 100644
--- a/Control/AthAnalysisBaseComps/src/AthAnalysisHelper.cxx
+++ b/Control/AthAnalysisBaseComps/src/AthAnalysisHelper.cxx
@@ -6,6 +6,10 @@
 
 #include "AthContainers/AuxTypeRegistry.h"
 
+#include "GaudiKernel/AttribStringParser.h"
+#include "boost/algorithm/string/case_conv.hpp"
+#include "TROOT.h"
+
 const std::string AthAnalysisHelper::UNDEFINED = "__UNDEFINED__";
 
 ServiceHandle<Gaudi::Interfaces::IOptionsSvc> AthAnalysisHelper::joSvc = ServiceHandle<Gaudi::Interfaces::IOptionsSvc>("JobOptionsSvc","AthAnalysisHelper");
@@ -94,3 +98,37 @@ void AthAnalysisHelper::dumpProperties(const IProperty& component) {
     std::cout << p->name() << " = " << p->toString() << std::endl;
   }
 }
+
+
+TFile* AthAnalysisHelper::getOutputFile(const std::string& streamName) {
+  ServiceHandle<IProperty> histSvc("THistSvc","");
+  auto& prop = histSvc->getProperty("Output");
+
+  std::vector<std::string> outputs;
+  if( Gaudi::Parsers::parse(outputs,prop.toString()).isFailure() ) {
+    return nullptr;
+  }
+
+  //extract the DATAFILE part of the string
+  std::string fileName="";
+  for(std::string& output : outputs) {
+    if( output.substr(0,output.find(" "))!=streamName ) continue;
+
+    //got here .. means we found the stream ...
+    for(auto attrib : Gaudi::Utils::AttribStringParser(output.substr(output.find(" ")+1))) {
+      auto TAG = boost::algorithm::to_upper_copy(attrib.tag);
+
+      if(TAG=="FILE" || TAG=="DATAFILE") {
+	fileName = attrib.value;
+	break;
+      }
+
+    }
+    if(fileName.length()) {
+      return static_cast<TFile*>(gROOT->GetListOfFiles()->FindObject(fileName.c_str()));
+    }
+
+  }
+  return 0;
+
+}
diff --git a/Database/AthenaRoot/AthenaRootComps/src/xAODEventSelector.cxx b/Database/AthenaRoot/AthenaRootComps/src/xAODEventSelector.cxx
index 8b286daf179c..8c6b85fc9d5e 100644
--- a/Database/AthenaRoot/AthenaRootComps/src/xAODEventSelector.cxx
+++ b/Database/AthenaRoot/AthenaRootComps/src/xAODEventSelector.cxx
@@ -194,6 +194,20 @@ StatusCode xAODEventSelector::initialize()
    m_tevent = new xAOD::xAODTEvent(); //our special class inheriting from xAOD::TEvent
   }
 
+  //use the first file to decide if reading metadata with POOL is ok
+  if(m_readMetadataWithPool) {
+    std::unique_ptr<TFile> f( TFile::Open( m_inputCollectionsName.value()[0].c_str() ) );
+    if(!f) {
+      ATH_MSG_ERROR("Failed to open first input file: " << m_inputCollectionsName.value()[0]);
+      return StatusCode::FAILURE;
+    }
+    if(!f->Get("##Shapes")) {
+      ATH_MSG_INFO("First file is not POOL file (e.g. is CxAOD), so reading metadata with xAOD::TEvent instead");
+      m_readMetadataWithPool = false;
+    }
+    f->Close();
+  }
+
 
   {
     // register this service for 'I/O' events
@@ -315,6 +329,9 @@ StatusCode xAODEventSelector::initialize()
   //checked above that there's at least one file
   CHECK( setFile(m_inputCollectionsName.value()[0]) );
 
+  //first FirstInputFile incident so that input metadata store is populated by MetaDataSvc
+  m_incsvc->fireIncident(FileIncident(name(), "FirstInputFile", m_inputCollectionsName.value()[0]));
+
   if(m_printPerfStats) xAOD::PerfStats::instance().start();
 
 
@@ -380,6 +397,11 @@ xAODEventSelector::next( IEvtSelector::Context& ctx ) const
   
 
   TFile *file = rctx->file();
+  if(file && m_nbrEvts==0) {
+    //fire the BeginInputFile incident for the first file
+    m_incsvc->fireIncident(FileIncident(name(), "BeginInputFile", file->GetName()));
+  }
+
   if (!file) { //must be starting another file ...
     auto& fnames = rctx->files();
     //std::size_t fidx = rctx->fileIndex();
@@ -394,6 +416,8 @@ xAODEventSelector::next( IEvtSelector::Context& ctx ) const
 	   throw GaudiException("xAODEventSelector::next() - Fatal error when trying to setFile('" + fname + "')","xAODEventSelector",StatusCode::FAILURE);
 	 }
          ATH_MSG_DEBUG("TEvent entries = " << m_tevent_entries);
+	 //fire incident for this file ..
+	 m_incsvc->fireIncident(FileIncident(name(), "BeginInputFile", rctx->file()->GetName()));
       } else {
          // end of collections
 	return StatusCode::FAILURE; //this is a valid failure ... athena will interpret as 'finished looping'
@@ -472,6 +496,18 @@ xAODEventSelector::next( IEvtSelector::Context& ctx ) const
     // ::setAddress(NULL).
     // this way, the next time we hit ::createRootBranchAddress or ::updateAddress
     // all internal states are kosher.
+
+    /*
+     * Problem for rel22 --
+     * The proxyProviderSvc 'moves' the transient addresses created in this class
+     * and thus invalidates them.
+     * The sequence is proxyProviderSvc will call "loadAddresses" method below but
+     * when it puts them into a DataProxy it will move the addresses so they are now invalid
+     *
+     * Shortest route to fixing this is just to clear the addresses and not touch them again
+     */
+    self()->m_rootAddresses.clear();
+
     for (auto& iaddr : self()->m_rootAddresses) {
       iaddr.second = false; // mark as invalid
       SG::TransientAddress* taddr = iaddr.first;
@@ -888,6 +924,12 @@ xAODEventSelector::createMetaDataRootBranchAddresses() const
       const void* value_ptr = m_tevent;
       const std::string type_name = leaf->GetTypeName();
       const std::string br_name = branch->GetName();
+      // Skip if type_name does contain xAOD, ie. is not an xAOD container
+      const std::string toCheck = "xAOD::";
+      if (type_name.find(toCheck) == std::string::npos) {
+	ATH_MSG_DEBUG("** Skip type-name = " << type_name << ", br_name = " << br_name );
+	continue;
+      }
       const std::string sg_key = br_name;//m_tupleName.value()+"/"+br_name;
       TClass *cls = TClass::GetClass(type_name.c_str());
       const std::type_info *ti = 0;
@@ -917,12 +959,7 @@ xAODEventSelector::createMetaDataRootBranchAddresses() const
 	  continue;
 	}
 
-	// Skip if type_name does contain xAOD, ie. is not an xAOD container
-	const std::string toCheck = "xAOD::";
-	if (type_name.find(toCheck) == std::string::npos) {
-	  ATH_MSG_DEBUG("** Skip type-name = " << type_name << ", br_name = " << br_name );
-	  continue;
-	}
+
 
 	ATH_MSG_DEBUG("id = " << id << ", m_metadataName.value() = " << m_metadataName.value() << ", br_name = " << br_name << ", value_ptr = " << value_ptr);
 	Athena::xAODBranchAddress* addr = new Athena::xAODBranchAddress
@@ -987,8 +1024,8 @@ StatusCode xAODEventSelector::setFile(const std::string& fname) {
 
   if(m_tfile && m_tfile != newFile) {
     const std::string currFile = m_tfile->GetName();
-    //disconnect pool if necessary
-    if(m_readMetadataWithPool) m_poolSvc->disconnectDb("PFN:"+currFile).ignore();
+    //disconnect pool if necessary ... always fire this, hopefully it is safe even if not needed
+    m_poolSvc->disconnectDb("PFN:"+currFile).ignore();
     //close existing file
     m_tfile->Close();
     //we should also cleanup after pool, in case it has left open files dangling
@@ -1024,8 +1061,7 @@ StatusCode xAODEventSelector::setFile(const std::string& fname) {
       }
    }
 
-  //must trigger a beginInputFile event here
-  m_incsvc->fireIncident(FileIncident(name(), "BeginInputFile", m_tfile->GetName())); 
+
 
   return StatusCode::SUCCESS;
 
-- 
GitLab


From cbf6561c188da6bfc7b83995a2969223c963753b Mon Sep 17 00:00:00 2001
From: Daniele Zanzi <daniele.zanzi@cern.ch>
Date: Mon, 13 Sep 2021 18:51:43 +0200
Subject: [PATCH 084/347] New muon topo algos

---
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    |  52 +++-
 .../share/ref_v1Dev_decodeBS_build.ref        |  48 +--
 .../python/HLTMenuConfig/Menu/LS2_v1.py       |  30 +-
 .../HLTMenuConfig/Menu/Physics_pp_run3_v1.py  |   4 +-
 .../HLTMenuConfig/Menu/SignatureDicts.py      |   5 +-
 .../TriggerMenuMT/python/L1/Config/ItemDef.py |  70 ++---
 .../python/L1/Config/ThresholdDef.py          |   5 -
 .../python/L1/Config/TopoAlgoDef.py           |  67 ++++-
 .../python/L1/Menu/Menu_MC_HI_v1.py           | 219 +-------------
 .../python/L1/Menu/Menu_MC_pp_v8.py           | 280 ++----------------
 .../python/L1/Menu/Menu_MC_pp_v8_inputs.py    |  43 ++-
 11 files changed, 228 insertions(+), 595 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 94d030e48011..a17147e56e33 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -675,24 +675,24 @@ HLT_2mu4_noL2Comb_bJpsimumu_L12MU3V:
     2: 10
     3: 8
     4: 8
-HLT_2mu50_msonly_L1MU14FCH:
-  eventCount: 0
-  stepCounts:
-    0: 1
-  stepFeatures:
-    0: 2
-HLT_2mu6_10invm70_L1MU5VF:
-  eventCount: 2
+HLT_2mu4_os_dRAA12_L1BPH-0DR12C-2MU3V:
+  eventCount: 1
   stepCounts:
     0: 3
     1: 3
     2: 3
-    3: 2
+    3: 1
   stepFeatures:
     0: 6
     1: 6
-    2: 8
-    3: 7
+    2: 10
+    3: 8
+HLT_2mu50_msonly_L1MU14FCH:
+  eventCount: 0
+  stepCounts:
+    0: 1
+  stepFeatures:
+    0: 2
 HLT_2mu6_10invmAA70_L1MU5VF:
   eventCount: 2
   stepCounts:
@@ -949,6 +949,10 @@ HLT_3j65_0eta290_020jvt_pf_ftf_bdl1r85_L1J45p0ETA21_3J15p0ETA25:
     0: 12
     1: 20
     2: 7
+HLT_3mu4_L1BPH-0M10-3MU3V:
+  eventCount: 0
+HLT_3mu4_L1BPH-0M10C-3MU3V:
+  eventCount: 0
 HLT_3mu4_bDimu2700_L13MU3V:
   eventCount: 0
   stepCounts:
@@ -1628,6 +1632,8 @@ HLT_e120_lhvloose_L1EM22VHI:
     4: 1
 HLT_e12_lhloose_2mu10_L12MU8F:
   eventCount: 0
+HLT_e12_lhtight_mu11_dRAB15_invmAB10_L1LFV-eEM8L-MU8VF:
+  eventCount: 0
 HLT_e140_dnnloose_L1EM22VHI:
   eventCount: 0
 HLT_e140_gsf_dnnloose_L1EM22VHI:
@@ -1654,6 +1660,8 @@ HLT_e14_lhtight_e4_etcut_Jpsiee_L1JPSI-1M5-EM12:
   eventCount: 0
 HLT_e14_lhtight_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
+HLT_e14_lhtight_mu6_dRAB15_invmAB10_L1LFV-eEM12L-MU5VF:
+  eventCount: 0
 HLT_e14_lhtight_noringer_e4_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
 HLT_e14_lhtight_noringer_e4_etcut_Jpsiee_L1JPSI-1M5-EM12:
@@ -7031,7 +7039,7 @@ HLT_mu10_ivarmedium_j70_0eta320_j50_0eta490_j0_DJMASS900j50_L1MJJ-500-NFF:
     3: 2
     4: 1
     5: 11
-HLT_mu10_ivarmedium_mu10_10invm70_L12MU8F:
+HLT_mu10_ivarmedium_mu10_10invmAB70_L12MU8F:
   eventCount: 1
   stepCounts:
     0: 2
@@ -7049,7 +7057,9 @@ HLT_mu10_l2mt_mu4_l2mt_bJpsimumu_L1MU10BOM:
   eventCount: 0
   stepFeatures:
     0: 2
-HLT_mu10_lateMu_L1LATE-MU8F_XE50:
+HLT_mu10_lateMu_L1LATE-MU8F_J50:
+  eventCount: 0
+HLT_mu10_lateMu_L1LATE-MU8F_XE30:
   eventCount: 0
 HLT_mu11_mu6_bBmumu_L1LFV-MU8VF:
   eventCount: 0
@@ -7625,7 +7635,7 @@ HLT_mu20_ivarloose_tau20_mediumRNN_tracktwoMVA_03dRAB_L1MU14FCH:
     7: 15
     8: 15
     9: 6
-HLT_mu20_ivarmedium_mu4noL1_10invm70_L1MU14FCH:
+HLT_mu20_ivarmedium_mu4noL1_10invmAB70_L1MU14FCH:
   eventCount: 2
   stepCounts:
     0: 6
@@ -8827,14 +8837,24 @@ HLT_mu6_mu4_L12MU3V:
     1: 18
     2: 24
     3: 17
+HLT_mu6_mu4_bBmumu_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bBmumu_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
+HLT_mu6_mu4_bBmumu_Lxy0_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bBmumu_Lxy0_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
+HLT_mu6_mu4_bBmumux_BpmumuKp_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bBmumux_BpmumuKp_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
+HLT_mu6_mu4_bBmumux_BsmumuPhi_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bBmumux_BsmumuPhi_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
+HLT_mu6_mu4_bDimu_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bDimu_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
 HLT_mu6_mu4_bDimu_L1MU5VF_2MU3V:
@@ -8850,8 +8870,12 @@ HLT_mu6_mu4_bDimu_L1MU5VF_2MU3V:
     2: 18
     3: 15
     4: 15
+HLT_mu6_mu4_bJpsimumu_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bJpsimumu_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
+HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
 HLT_mu6_mu4_bUpsimumu_L1BPH-8M15-0DR22-MU5VFMU3V-BO:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index d72ef10d7fb1..a5b647448f10 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -93,18 +93,6 @@ HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100:
   eventCount: 0
 HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100:
   eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j135XXj60_L1J100:
-  eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100:
-  eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100:
-  eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j135XXj60_L1J100:
-  eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100:
-  eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100:
-  eventCount: 0
 HLT_2j330_a10sd_cssk_pf_jes_ftf_35smcINF_L1J100:
   eventCount: 0
 HLT_2j330_a10sd_cssk_pf_jes_ftf_35smcINF_L1SC111-CJ15:
@@ -273,14 +261,14 @@ HLT_2mu4_noL2Comb_bJpsimumu_L12MU3V:
   stepFeatures:
     0: 2
     1: 2
-HLT_2mu50_msonly_L1MU14FCH:
-  eventCount: 0
-HLT_2mu6_10invm70_L1MU5VF:
+HLT_2mu4_os_dRAA12_L1BPH-0DR12C-2MU3V:
   eventCount: 0
   stepCounts:
     0: 1
   stepFeatures:
     0: 2
+HLT_2mu50_msonly_L1MU14FCH:
+  eventCount: 0
 HLT_2mu6_10invmAA70_L1MU5VF:
   eventCount: 0
   stepCounts:
@@ -388,6 +376,10 @@ HLT_3j65_0eta290_020jvt_pf_ftf_bdl1r77_L1J45p0ETA21_3J15p0ETA25:
   eventCount: 0
 HLT_3j65_0eta290_020jvt_pf_ftf_bdl1r85_L1J45p0ETA21_3J15p0ETA25:
   eventCount: 0
+HLT_3mu4_L1BPH-0M10-3MU3V:
+  eventCount: 0
+HLT_3mu4_L1BPH-0M10C-3MU3V:
+  eventCount: 0
 HLT_3mu4_bDimu2700_L13MU3V:
   eventCount: 0
 HLT_3mu4_bJpsi_L13MU3V:
@@ -608,6 +600,8 @@ HLT_e120_lhvloose_L1EM22VHI:
   eventCount: 0
 HLT_e12_lhloose_2mu10_L12MU8F:
   eventCount: 0
+HLT_e12_lhtight_mu11_dRAB15_invmAB10_L1LFV-eEM8L-MU8VF:
+  eventCount: 0
 HLT_e140_dnnloose_L1EM22VHI:
   eventCount: 0
 HLT_e140_gsf_dnnloose_L1EM22VHI:
@@ -628,6 +622,8 @@ HLT_e14_lhtight_e4_etcut_Jpsiee_L1JPSI-1M5-EM12:
     0: 6
 HLT_e14_lhtight_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
+HLT_e14_lhtight_mu6_dRAB15_invmAB10_L1LFV-eEM12L-MU5VF:
+  eventCount: 0
 HLT_e14_lhtight_noringer_e4_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
   stepFeatures:
@@ -2726,11 +2722,13 @@ HLT_mu10_L1MU8F:
     0: 5
 HLT_mu10_ivarmedium_j70_0eta320_j50_0eta490_j0_DJMASS900j50_L1MJJ-500-NFF:
   eventCount: 0
-HLT_mu10_ivarmedium_mu10_10invm70_L12MU8F:
+HLT_mu10_ivarmedium_mu10_10invmAB70_L12MU8F:
   eventCount: 0
 HLT_mu10_l2mt_mu4_l2mt_bJpsimumu_L1MU10BOM:
   eventCount: 0
-HLT_mu10_lateMu_L1LATE-MU8F_XE50:
+HLT_mu10_lateMu_L1LATE-MU8F_J50:
+  eventCount: 0
+HLT_mu10_lateMu_L1LATE-MU8F_XE30:
   eventCount: 0
 HLT_mu11_mu6_bBmumu_L1LFV-MU8VF:
   eventCount: 0
@@ -2920,7 +2918,7 @@ HLT_mu20_ivarloose_tau20_mediumRNN_tracktwoMVA_03dRAB_L1MU14FCH:
   eventCount: 0
   stepFeatures:
     0: 1
-HLT_mu20_ivarmedium_mu4noL1_10invm70_L1MU14FCH:
+HLT_mu20_ivarmedium_mu4noL1_10invmAB70_L1MU14FCH:
   eventCount: 0
   stepCounts:
     0: 1
@@ -3346,14 +3344,24 @@ HLT_mu6_mu4_L12MU3V:
     0: 1
   stepFeatures:
     0: 4
+HLT_mu6_mu4_bBmumu_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bBmumu_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
+HLT_mu6_mu4_bBmumu_Lxy0_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bBmumu_Lxy0_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
+HLT_mu6_mu4_bBmumux_BpmumuKp_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bBmumux_BpmumuKp_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
+HLT_mu6_mu4_bBmumux_BsmumuPhi_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bBmumux_BsmumuPhi_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
+HLT_mu6_mu4_bDimu_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bDimu_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
 HLT_mu6_mu4_bDimu_L1MU5VF_2MU3V:
@@ -3362,8 +3370,12 @@ HLT_mu6_mu4_bDimu_L1MU5VF_2MU3V:
     0: 1
   stepFeatures:
     0: 4
+HLT_mu6_mu4_bJpsimumu_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bJpsimumu_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
+HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-0DR15-C-MU5VFMU3V:
+  eventCount: 0
 HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-0DR15-MU5VFMU3V:
   eventCount: 0
 HLT_mu6_mu4_bUpsimumu_L1BPH-8M15-0DR22-MU5VFMU3V-BO:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index f31e39cd77d9..cf010bd96767 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -86,10 +86,11 @@ def setupMenu():
 
         ChainProp(name='HLT_mu6_msonly_L1MU5VF',     groups=SingleMuonGroup, monGroups=['muonMon:shifter','muonMon:val','idMon:t0']),
 
-        ChainProp(name='HLT_2mu6_10invm70_L1MU5VF', groups=SingleMuonGroup),
-        # Using generic hypo
         ChainProp(name='HLT_2mu6_10invmAA70_L1MU5VF', groups=SingleMuonGroup),
-        ChainProp(name='HLT_mu10_lateMu_L1LATE-MU8F_XE50', l1SeedThresholds=['FSNOSEED'], groups=SingleMuonGroup),
+
+        # LATE
+        ChainProp(name='HLT_mu10_lateMu_L1LATE-MU8F_J50', l1SeedThresholds=['FSNOSEED'], groups=SingleMuonGroup+PrimaryL1MuGroup),
+        ChainProp(name='HLT_mu10_lateMu_L1LATE-MU8F_XE30', l1SeedThresholds=['FSNOSEED'], groups=SingleMuonGroup),
 
         # ATR-20049
         ChainProp(name='HLT_mu6_mu4_L12MU3V',  l1SeedThresholds=['MU3V']*2, groups=MultiMuonGroup),
@@ -154,6 +155,13 @@ def setupMenu():
         ChainProp(name='HLT_mu24_ivarmedium_mu6_ivarmedium_probe_L1MU14FCH', l1SeedThresholds=['MU14FCH','PROBEMU3V'], groups=MultiMuonGroup),
         ChainProp(name='HLT_mu24_ivarmedium_mu6_ivarperf_probe_L1MU14FCH', l1SeedThresholds=['MU14FCH','PROBEMU3V'], groups=MultiMuonGroup),
 
+        # 3mu inv mass (ATR-19355, ATR-19638), TODO: HLT invm to be added and moved to BLS signature
+        ChainProp(name='HLT_3mu4_L1BPH-0M10-3MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_3mu4_L1BPH-0M10C-3MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+
+        #ATR-21566, di-muon TLA, TODO: TLA implementation and change stream
+        ChainProp(name='HLT_2mu4_os_dRAA12_L1BPH-0DR12C-2MU3V', l1SeedThresholds=['MU3V'], groups=MultiMuonGroup),
+ 
    ]
 
     TriggerFlags.EgammaSlice.signatures = TriggerFlags.EgammaSlice.signatures() + [
@@ -931,6 +939,16 @@ def setupMenu():
 
         # RCP multiple candidate
         ChainProp(name='HLT_mu10_l2mt_mu4_l2mt_bJpsimumu_L1MU10BOM', l1SeedThresholds=['MU10BOM']*2, stream=["BphysDelayed"], groups=BphysicsGroup),
+
+        # mu6+mu4 chains with L1 charge cut (ATR-19639)
+        ChainProp(name='HLT_mu6_mu4_bBmumux_BsmumuPhi_L1BPH-2M9-0DR15-C-MU5VFMU3V', l1SeedThresholds=['MU5VF','MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_mu6_mu4_bBmumu_L1BPH-2M9-0DR15-C-MU5VFMU3V', l1SeedThresholds=['MU5VF','MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_mu6_mu4_bBmumux_BpmumuKp_L1BPH-2M9-0DR15-C-MU5VFMU3V', l1SeedThresholds=['MU5VF','MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_mu6_mu4_bDimu_L1BPH-2M9-0DR15-C-MU5VFMU3V', l1SeedThresholds=['MU5VF','MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_mu6_mu4_bJpsimumu_L1BPH-2M9-0DR15-C-MU5VFMU3V', l1SeedThresholds=['MU5VF','MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-0DR15-C-MU5VFMU3V', l1SeedThresholds=['MU5VF','MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_mu6_mu4_bBmumu_Lxy0_L1BPH-2M9-0DR15-C-MU5VFMU3V', l1SeedThresholds=['MU5VF','MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+
     ]
 
     TriggerFlags.CombinedSlice.signatures = TriggerFlags.CombinedSlice.signatures() + [
@@ -1104,7 +1122,11 @@ def setupMenu():
         #ATR-23156
         ChainProp(name='HLT_mu4_j20_0eta290_pf_ftf_boffperf_dRAB03_L1MU3V_J15', l1SeedThresholds=['MU3V','FSNOSEED'], groups=SingleBjetGroup),
         ChainProp(name='HLT_mu4_j20_0eta290_pf_ftf_boffperf_dRAB03_L1MU3V', l1SeedThresholds=['MU3V','FSNOSEED'], groups=SingleBjetGroup),
-        
+    
+        #ATR-23394
+        ChainProp(name='HLT_e14_lhtight_mu6_dRAB15_invmAB10_L1LFV-eEM12L-MU5VF', l1SeedThresholds=['eEM10L','MU5VF'], stream=[PhysicsStream], groups=BphysicsGroup), #TODO: eEM12L->eEM10L in HLT seeding to fix
+        ChainProp(name='HLT_e12_lhtight_mu11_dRAB15_invmAB10_L1LFV-eEM8L-MU8VF', l1SeedThresholds=['eEM8L','MU8VF'], stream=[PhysicsStream], groups=BphysicsGroup),    
+
         ]
 
     TriggerFlags.HeavyIonSlice.signatures  = TriggerFlags.HeavyIonSlice.signatures() + []
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
index 5e997b183d80..6a02ae1e840f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
@@ -107,10 +107,10 @@ def setupMenu():
         ChainProp(name='HLT_2mu15_L12MU8F', groups=PrimaryL1MuGroup+MultiMuonGroup),
         ChainProp(name='HLT_mu20_ivarmedium_mu8noL1_L1MU14FCH', l1SeedThresholds=['MU14FCH','FSNOSEED'], groups=PrimaryL1MuGroup+MultiMuonGroup),
         #ATR-22107
-        ChainProp(name='HLT_mu20_ivarmedium_mu4noL1_10invm70_L1MU14FCH', l1SeedThresholds=['MU14FCH','FSNOSEED'], groups=PrimaryL1MuGroup+MultiMuonGroup),
+        ChainProp(name='HLT_mu20_ivarmedium_mu4noL1_10invmAB70_L1MU14FCH', l1SeedThresholds=['MU14FCH','FSNOSEED'], groups=PrimaryL1MuGroup+MultiMuonGroup),
 
         #-- 2 mu iso invm
-        ChainProp(name='HLT_mu10_ivarmedium_mu10_10invm70_L12MU8F', groups=PrimaryL1MuGroup+MultiMuonGroup), 
+        ChainProp(name='HLT_mu10_ivarmedium_mu10_10invmAB70_L12MU8F', groups=PrimaryL1MuGroup+MultiMuonGroup), 
         #-- 3 mu
         ChainProp(name='HLT_mu20_2mu4noL1_L1MU14FCH', l1SeedThresholds=['MU14FCH','FSNOSEED'], groups=PrimaryL1MuGroup+MultiMuonGroup),
         ChainProp(name='HLT_mu22_2mu4noL1_L1MU14FCH', l1SeedThresholds=['MU14FCH','FSNOSEED'], groups=PrimaryL1MuGroup+MultiMuonGroup),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 72f12b0b2ed7..af05a50e4499 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -318,7 +318,7 @@ MuonChainParts = {
     'IDinfo'         : [],
     'isoInfo'        : ['ivarloose', 'ivarmedium', 'ivarperf','iloosems'],
     'lrtInfo'        : ['d0loose','d0medium','d0tight'],
-    'invMassInfo'    : ['10invm70', 'invmJPsi'],
+    'invMassInfo'    : ['invmJPsi'],
     'msonlyInfo'     : ['msonly'],
     'addInfo'        : ['1step','idperf','LRT','3layersEC','cosmic',"muonqual","nscan","os"],
     'topo'           : AllowedTopos_mu,
@@ -1034,10 +1034,11 @@ UnconventionalTrackingChainParts_Default = {
 # Combined Chains
 #==========================================================
 AllowedTopos_comb = [
-    '03dRAB','03dRAB30','dRAB03','02dRAB','02dRAC','50invmAB','60invmAB','afpdijet','18dphiAB','18dphiAC','80mTAC',
+    'dRAA12', 'dRAB15', '03dRAB','03dRAB30','dRAB03','02dRAB','02dRAC','50invmAB','60invmAB','afpdijet','18dphiAB','18dphiAC','80mTAC',
     '1invmAB5','50invmAB130', # Jpsiee, Zee/Zeg
     '25dphiAA','invmAA80', # Low-mass diphoton
     '10invmAA70', # Low-mass dimuon
+    'invmAB10', '10invmAB70',
     ]
 
 # ---- Combined Dictionary of all allowed Values ----
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
index b4de74268274..bb695dae28c8 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
@@ -238,7 +238,6 @@ class ItemDef:
 
         # MUON ctpid=[0x20;0x2f]
         # RUn3 thresholds
-        MenuItem('L1_MU0'        ).setLogic( d.MU0        & physcond).setTriggerType(TT.muon)
         MenuItem('L1_MU3V'       ).setLogic( d.MU3V       & physcond).setTriggerType(TT.muon) # ~ Run2 MU4 eff
         MenuItem('L1_MU5VF'      ).setLogic( d.MU5VF      & physcond).setTriggerType(TT.muon) # ~ Run2 MU6
         MenuItem('L1_MU8F'       ).setLogic( d.MU8F       & physcond).setTriggerType(TT.muon) # ~ Run2 MU10
@@ -253,9 +252,6 @@ class ItemDef:
         MenuItem('L1_MU10BOM'    ).setLogic( d.MU10BOM    & physcond).setTriggerType(TT.muon) # Barrel-only close-by muons
         MenuItem('L1_MU20FC'     ).setLogic( d.MU20FC     & physcond).setTriggerType(TT.muon) # alignment with toroid off
   
-        MenuItem('L1_2MU0'         ).setLogic( d.MU0.x(2)              & physcond).setTriggerType(TT.muon)
-        MenuItem('L1_MU5VF_2MU0'   ).setLogic( d.MU5VF & d.MU0.x(2)    & physcond).setTriggerType(TT.muon)
-
         MenuItem('L1_2MU3V'        ).setLogic( d.MU3V.x(2)             & physcond).setTriggerType(TT.muon)
         MenuItem('L1_2MU5VF'       ).setLogic( d.MU5VF.x(2)            & physcond).setTriggerType(TT.muon)
         MenuItem('L1_2MU8F'        ).setLogic( d.MU8F.x(2)             & physcond).setTriggerType(TT.muon)
@@ -293,15 +289,9 @@ class ItemDef:
         MenuItem('L1_MU3V_TE30p24ETA49' ).setLogic( d.MU3V  & d.TE3024ETA49 & physcond).setTriggerType(TT.muon)
         MenuItem('L1_MU3V_TE35p24ETA49' ).setLogic( d.MU3V  & d.TE3524ETA49 & physcond).setTriggerType(TT.muon)
         MenuItem('L1_MU3V_TE40p24ETA49' ).setLogic( d.MU3V  & d.TE4024ETA49 & physcond).setTriggerType(TT.muon)
-        MenuItem('L1_MU0_VTE50'  ).setLogic( d.MU0      & Not(d.TE50) & physcond).setTriggerType(TT.muon)
         MenuItem('L1_MU3V_VTE50' ).setLogic( d.MU3V     & Not(d.TE50) & physcond).setTriggerType(TT.muon)
         MenuItem('L1_MU5VF_VTE50').setLogic( d.MU5VF    & Not(d.TE50) & physcond).setTriggerType(TT.muon)
 
-        MenuItem('L1_MU0_UNPAIRED_ISO'   ).setLogic(d.MU0 & unpaired_isocond   ).setTriggerType( TT.muon )
-        MenuItem('L1_MU0_UNPAIRED_NONISO').setLogic(d.MU0 & unpaired_nonisocond).setTriggerType( TT.muon )
-        MenuItem('L1_MU0_EMPTY'          ).setLogic(d.MU0 & cosmiccond).setTriggerType( TT.muon )
-        MenuItem('L1_MU0_FIRSTEMPTY'     ).setLogic(d.MU0 & firstempty).setTriggerType( TT.muon )
-
         MenuItem('L1_MU3V_UNPAIRED_ISO'   ).setLogic(d.MU3V  & unpaired_isocond   ).setTriggerType( TT.muon )
         MenuItem('L1_MU3V_UNPAIRED_NONISO').setLogic(d.MU3V  & unpaired_nonisocond).setTriggerType( TT.muon )
         MenuItem('L1_MU3V_EMPTY'          ).setLogic(d.MU3V  & cosmiccond).setTriggerType( TT.muon )
@@ -312,7 +302,6 @@ class ItemDef:
         MenuItem('L1_MU8VF_EMPTY'         ).setLogic(d.MU8VF & cosmiccond).setTriggerType( TT.muon )
         MenuItem('L1_MU14FCH_FIRSTEMPTY'  ).setLogic(d.MU14FCH  & firstempty).setTriggerType(TT.muon)
         MenuItem('L1_MU14FCHR_FIRSTEMPTY' ).setLogic(d.MU14FCHR & firstempty).setTriggerType(TT.muon)
-        MenuItem('L1_2MU0_EMPTY'            ).setLogic(d.MU0.x(2)   & cosmiccond).setTriggerType( TT.muon )
         MenuItem('L1_2MU3V_EMPTY'           ).setLogic(d.MU3V.x(2)  & cosmiccond).setTriggerType( TT.muon )
         MenuItem('L1_2MU5VF_UNPAIRED_ISO'   ).setLogic(d.MU5VF.x(2) & unpaired_isocond).setTriggerType( TT.muon )
         MenuItem('L1_2MU5VF_UNPAIRED_NONISO').setLogic(d.MU5VF.x(2) & unpaired_nonisocond).setTriggerType( TT.muon )
@@ -1466,30 +1455,38 @@ class ItemDef:
 
             # Phase-1:
             MenuItem('L1_LAR-ZEE-eEM').setLogic( d.TOPO_ZEE_eEM20sm2 & physcond).setTriggerType( TT.lardemo ) # LAr demo (ATR-23403)
-            MenuItem('L1_LATE-MU8F_XE50').setLogic( d.TOPO_LATE_MU10s1 & d.XE50 & physcond)
-            MenuItem('L1_LATE-MU8F_XE40').setLogic( d.TOPO_LATE_MU10s1 & d.XE40 & physcond)
+            MenuItem('L1_LATE-MU8F_XE30').setLogic( d.TOPO_LATE_MU10s1 & d.XE30 & physcond)
             MenuItem('L1_LATE-MU8F_J50' ).setLogic( d.TOPO_LATE_MU10s1 & d.J50 & physcond)
             MenuItem('L1_LFV-MU8VF').setLogic( d.TOPO_0DR15_2MU6ab & d.MU8VF & d.MU5VF.x(2) & physcond)
             MenuItem('L1_LFV-MU5VF' ).setLogic( d.TOPO_0DR15_2MU6ab & d.MU5VF.x(2) & physcond)
             MenuItem('L1_LFV-eEM8L-MU8VF' ).setLogic( d.TOPO_0INVM10_0DR15_eEM8abl_MU10ab & d.MU8VF & physcond)
             MenuItem('L1_LFV-eEM12L-MU5VF' ).setLogic( d.TOPO_0INVM10_0DR15_eEM12abl_MU6ab & physcond)
-            MenuItem('L1_LFV-eEM8L').setLogic( d.TOPO_0DETA04_eEM8abl_MU10ab & d.TOPO_0DPHI03_eEM8abl_MU10ab & d.MU8F & physcond) #ATR-14282
-            MenuItem('L1_LFV-eEM15L').setLogic( d.TOPO_0DETA04_eEM15abl_MUab & d.TOPO_0DPHI03_eEM15abl_MUab & physcond) #ATR-14282
+
+            #BLS
             #ATR-19720
-            MenuItem('L1_BPH-8M15-0DR22-2MU5VF'     ).setLogic( d.TOPO_8INVM15_0DR22_2MU6ab & d.MU5VF.x(2) & physcond)
-            MenuItem('L1_BPH-8M15-0DR22-MU5VFMU3V-BO').setLogic( d.TOPO_8INVM15_0DR22_MU6ab_MU4ab & d.TOPO_MULT_CMU4ab.x(2) & d.TOPO_MULT_CMU6ab & d.MU5VF & physcond)
-            MenuItem('L1_BPH-2M9-2DR15-2MU5VF'      ).setLogic( d.TOPO_2INVM9_2DR15_2MU6ab & d.MU5VF.x(2) & physcond)
-            MenuItem('L1_BPH-2M9-0DR15-MU5VFMU3V'    ).setLogic( d.TOPO_2INVM9_0DR15_MU6ab_MU4ab & d.MU5VF & physcond)
-            MenuItem('L1_BPH-2M9-0DR15-2MU3V'       ).setLogic( d.TOPO_2INVM9_0DR15_2MU4ab & physcond)
+            MenuItem('L1_BPH-2M9-0DR15-2MU3V'         ).setLogic( d.TOPO_2INVM9_0DR15_2MU4ab & physcond)
+            MenuItem('L1_BPH-2M9-0DR15-MU5VFMU3V'     ).setLogic( d.TOPO_2INVM9_0DR15_MU6ab_MU4ab & d.MU5VF & physcond)
+            MenuItem('L1_BPH-2M9-2DR15-2MU5VF'        ).setLogic( d.TOPO_2INVM9_2DR15_2MU6ab & d.MU5VF.x(2) & physcond)
+            MenuItem('L1_BPH-8M15-0DR22-MU5VFMU3V-BO' ).setLogic( d.TOPO_8INVM15_0DR22_MU6ab_MU4ab & d.TOPO_MULT_CMU4ab.x(2) & d.TOPO_MULT_CMU6ab & d.MU5VF & physcond)
+            MenuItem('L1_BPH-8M15-0DR22-2MU5VF'       ).setLogic( d.TOPO_8INVM15_0DR22_2MU6ab & d.MU5VF.x(2) & physcond)
+            #ATR-19355
+            MenuItem('L1_BPH-0M10-3MU3V'              ).setLogic( d.TOPO_0INVM10_3MU4ab & physcond)
+            #ATR-19638
+            MenuItem('L1_BPH-0M10C-3MU3V'             ).setLogic( d.TOPO_0INVM10C_3MU4ab & physcond)
+            #ATR-19639
+            MenuItem('L1_BPH-2M9-0DR15-C-MU5VFMU3V'   ).setLogic( d.TOPO_2INVM9_0DR15_C_MU6ab_MU4ab & d.MU5VF & physcond)        
+            # ATR-21566
+            MenuItem('L1_BPH-0DR12C-2MU3V').setLogic( d.TOPO_0DR12C_2MU4ab & physcond)
+            # Barrel only, maybe needed?
             MenuItem("L1_2MU3V-BO"  ).setLogic( d.TOPO_MULT_CMU4ab.x(2) & physcond)
             MenuItem("L1_2MU5VF-BO"  ).setLogic( d.TOPO_MULT_CMU6ab.x(2) & d.MU5VF.x(2) & physcond)
             MenuItem("L1_MU5VFMU3V-BO").setLogic( d.TOPO_MULT_CMU4ab.x(2) & d.TOPO_MULT_CMU6ab & d.MU5VF & physcond)
-            #ATR-19355
-            MenuItem('L1_BPH-0M10-3MU3V' ).setLogic( d.TOPO_0INVM10_3MU4ab & physcond)
-            # ATR-19510
+
+            # ATR-19510, SM Low-mass DY
             MenuItem('L1_DY-BOX-2MU3V' ).setLogic( d.TOPO_5DETA99_5DPHI99_2MU4ab & d.MU3V.x(2) & physcond)
             MenuItem('L1_DY-BOX-MU5VFMU3V').setLogic( d.TOPO_5DETA99_5DPHI99_MU6ab_MU4ab & d.MU5VF & physcond)
             MenuItem('L1_DY-BOX-2MU5VF').setLogic( d.TOPO_5DETA99_5DPHI99_2MU6ab & d.MU5VF.x(2) & physcond)
+
             #ATR-17320
             MenuItem('L1_CEP-CjJ60').setLogic( d.TOPO_CEP_CjJ60s6 & physcond )
             MenuItem('L1_CEP-CjJ50').setLogic( d.TOPO_CEP_CjJ50s6 & physcond )
@@ -1508,7 +1505,6 @@ class ItemDef:
 
             # subset of legacy chains migrated phase1 boards
             MenuItem('L1_BPH-0M9-eEM7-eEM5').setLogic( d.TOPO_0INVM9_eEM7ab_eEMab & physcond)
-
             MenuItem('L1_BPH-0M9-eEM7-eEM5_MU5VF').setLogic( d.MU5VF & d.TOPO_0INVM9_eEM7ab_eEMab & physcond)
             MenuItem('L1_BPH-0M9-eEM7-eEM5_2MU3V').setLogic( d.MU3V.x(2) & d.TOPO_0INVM9_eEM7ab_eEMab & physcond)
             MenuItem('L1_BPH-0DR3-eEM7jJ15').setLogic( d.TOPO_0DR03_eEM7ab_CjJ15ab & physcond)
@@ -1547,35 +1543,9 @@ class ItemDef:
             MenuItem('L1_DPHI-2eEM3_VTE5p24ETA49_ALFA_EINE').setLogic( d.TOPO_27DPHI32_eEMs1_eEMs6 & Not(d.TE524ETA49) & ALFA_EINE & physcond).setTriggerType(TT.alfa)
             MenuItem('L1_DPHI-2eEM3_VTE10').setLogic( d.TOPO_27DPHI32_eEMs1_eEMs6 & Not(d.TE10) & physcond).setTriggerType(TT.calo)
             MenuItem('L1_DPHI-2eEM8_VTE50').setLogic( d.eEM8.x(2) & d.TOPO_27DPHI32_eEMs1_eEMs6 & Not(d.TE50) & physcond).setTriggerType(TT.calo)
-            
-            #needed?
             MenuItem('L1_BTAG-MU3VjJ15').setLogic( d.TOPO_0DR04_MU4ab_CjJ15ab & physcond)
             MenuItem('L1_BTAG-MU5VFjJ20').setLogic( d.TOPO_0DR04_MU6ab_CjJ20ab & d.MU5VF & physcond)
-            #needed?
-            MenuItem('L1_BPH-2M8-2MU3V_BPH-0DR15-2MU3V'     ).setLogic( d.TOPO_2INVM8_2MU4ab & d.TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi
-            MenuItem('L1_BPH-2M9-2MU3V_BPH-0DR15-2MU3V'     ).setLogic( d.TOPO_2INVM9_2MU4ab & d.TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi
-            MenuItem('L1_BPH-7M15-2MU3V_BPH-0DR24-2MU3V'    ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_2MU4ab & physcond)           # 78% for Upsi
-            MenuItem('L1_BPH-2M8-MU5VFMU3V_BPH-0DR15-MU5VFMU3V' ).setLogic( d.TOPO_2INVM8_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & d.MU5VF & physcond)  # 86% for Bs,J/psi
-            MenuItem('L1_BPH-2M9-MU5VFMU3V_BPH-0DR15-MU5VFMU3V' ).setLogic( d.TOPO_2INVM9_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & d.MU5VF & physcond)
-            MenuItem('L1_BPH-8M15-MU5VFMU3V_BPH-0DR22-MU5VFMU3V').setLogic( d.TOPO_8INVM15_MU6ab_MU4ab & d.TOPO_0DR22_MU6ab_MU4ab & d.MU5VF & physcond) # 86% for Upsi
-            MenuItem('L1_BPH-2M9-2MU5VF_BPH-2DR15-2MU5VF'     ).setLogic( d.TOPO_2INVM9_2MU6ab & d.TOPO_2DR15_2MU6ab & d.MU5VF.x(2) & physcond)            # 96% for Bs,J/psi
-            MenuItem('L1_BPH-2M9-2MU5VF'                      ).setLogic( d.TOPO_2INVM9_2MU6ab & d.MU5VF.x(2) & physcond)
-            MenuItem('L1_BPH-8M15-2MU5VF_BPH-0DR22-2MU5VF'    ).setLogic( d.TOPO_8INVM15_2MU6ab & d.TOPO_0DR22_2MU6ab & d.MU5VF.x(2) & physcond)           # 96% for Upsi
             MenuItem('L1_BPH-8M15-2MU3V-BO'    ).setLogic( d.TOPO_8INVM15_2CMU4ab & physcond)           # 96% for Upsi
-            # Barrel and BarrelOnly items w/o topo selection
-            MenuItem('L1_2MU3V-B'      ).setLogic( d.MU3V.x(2) & d.TOPO_MULT_CMU4ab & physcond)              # 2MU4_Barrel
-            MenuItem('L1_2MU5VF-B'    ).setLogic( d.MU5VF.x(2) & d.TOPO_MULT_CMU6ab & physcond)              # 2MU6_Barrel
-            MenuItem('L1_MU5VF_2MU3V-B').setLogic( d.MU5VF & d.MU3V.x(2) & d.TOPO_MULT_CMU4ab & physcond)        # MU6_2MU4_Barrel,
-            # Barrel and BarrelOnly variants of L1Topo items
-            MenuItem('L1_BPH-2M8-2MU3V-B_BPH-0DR15-2MU3V'     ).setLogic( d.TOPO_2INVM8_CMU4ab_MU4ab & d.TOPO_0DR15_2MU4ab & physcond)                # 78% for Bs,J/psi + OneBarrel
-            MenuItem('L1_BPH-7M15-2MU3V_BPH-0DR24-2MU3V-B'    ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_2MU4ab & d.TOPO_MULT_CMU4ab & physcond) # 78% for Upsi + OneBarrel
-            MenuItem('L1_BPH-7M15-2MU3V_BPH-0DR24-2MU3V-BO'   ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_2CMU4ab & physcond)                    # 78% for Upsi + BarrelOnly
-            MenuItem('L1_BPH-2M8-MU5VFMU3V-B_BPH-0DR15-MU5VFMU3V' ).setLogic( d.TOPO_2INVM8_ONEBARREL_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & d.MU5VF & physcond)  # 86% for Bs,J/psi + OneBarrel
-            MenuItem('L1_BPH-8M15-MU5VFMU3V_BPH-0DR22-MU5VFMU3V-B').setLogic( d.TOPO_8INVM15_MU6ab_MU4ab & d.TOPO_0DR22_MU6ab_MU4ab & d.TOPO_MULT_CMU4ab & d.MU5VF & physcond)
-            MenuItem('L1_BPH-8M15-MU5VFMU3V_BPH-0DR22-MU5VFMU3V-BO').setLogic( d.TOPO_8INVM15_MU6ab_MU4ab & d.TOPO_0DR22_MU6ab_MU4ab & d.TOPO_MULT_CMU4ab.x(2) & d.TOPO_MULT_CMU6ab & d.MU5VF & physcond)
-            MenuItem('L1_BPH-2M8-2MU3V').setLogic( d.TOPO_2INVM8_2MU4ab & physcond)                  # backup 71% for Bs,J/psi
-            MenuItem('L1_BPH-8M15-MU5VFMU3V').setLogic( d.TOPO_8INVM15_MU6ab_MU4ab & d.MU5VF & physcond) # backup 71% for Upsi
-            MenuItem('L1_BPH-8M15-2MU5VF').setLogic( d.TOPO_8INVM15_2MU6ab & d.MU5VF.x(2) & physcond)   # backup 95% for Upsi 
 
         except NameError as ex:
             exc_type, exc_value, exc_traceback = sys.exc_info()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py
index a12a6ff9238c..2c65c12ff7db 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py
@@ -67,11 +67,6 @@ class ThresholdDef:
         MuonThreshold( "MU8EOF"   ).setThrValue( thr=8  ).setTGCFlags("F").setRegion("EC,FW")  # forward muon, commissioning
         MuonThreshold( "MU3EOF"   ).setThrValue( thr=3, ba=4 ).setTGCFlags("F").setRegion("EC,FW")  # forward muon, commissioning
 
-        # special threshold for magnet-off menu
-        MuonThreshold( "MU0").setThrValue( thr=0 )
-
-
-
         # EM 
         for thrV in [3, 5, 8, 15, 20, 22]:
             #EMThreshold('eEM%i' % thrV, 'eEM').addThrValue(thrV)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
index 07ef9637c9f5..c96281b8b6b8 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
@@ -326,6 +326,38 @@ class TopoAlgoDef:
             alg.addvariable('DeltaRMax', d.maxDr*d.maxDr*_dr_conversion*_dr_conversion)
             tm.registerTopoAlgo(alg)
 
+        # dimu DR with opposite charge, ATR-23073, ATR-21566
+        # TODO: udpate with phase1 muons
+        listofalgos=[
+            {"minDr": 0, "maxDr": 12, "mult": 2, "otype1" : "MU", "ocut1": 4,  "olist" : "ab", "otype2" : "",   "ocut2": 4, "onebarrel": 0}, #0DR12C-2MU4ab 
+        ]
+        for x in listofalgos:
+            class d:
+                pass
+            for k in x:
+                setattr (d, k, x[k])
+            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)
+            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)
+            toponame = "%iDR%iC-%s%s%s"  % (d.minDr, d.maxDr, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)
+            log.debug("Define %s", toponame)
+            inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]
+            algoname = AlgConf.DeltaRSqrIncl1Charge if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaRSqrIncl2
+            alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ])
+            if (d.mult>1 or d.otype1==d.otype2):
+                alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+                alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+                alg.addgeneric('RequireOneBarrel', d.onebarrel)
+            else:
+                alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
+                alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU)
+                alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
+                alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
+            alg.addgeneric('NumResultBits', 1)
+            alg.addvariable('MinET1',    d.ocut1*_et_conversion)
+            alg.addvariable('MinET2',    d.ocut2*_et_conversion)
+            alg.addvariable('DeltaRMin', d.minDr*d.minDr*_dr_conversion*_dr_conversion)
+            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr*_dr_conversion*_dr_conversion)
+            tm.registerTopoAlgo(alg)
             
         # deta-dphi with ab+ab
         # TODO: udpate with phase1 muons
@@ -1142,6 +1174,19 @@ class TopoAlgoDef:
         alg.addvariable('MinET1',      4*_et_conversion)
         tm.registerTopoAlgo(alg)
 
+        #ATR-19638, 3muon, not all with the same charge
+        # TODO: to be updated with phase1 muons
+        toponame = "0INVM10C-3MU4ab"
+        log.debug("Define %s", toponame)
+        inputList = 'MUab'
+        alg = AlgConf.InvariantMassThreeTOBsIncl1Charge( name = toponame, inputs = inputList, outputs = toponame )
+        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+        alg.addgeneric('NumResultBits', 1)
+        alg.addvariable('MinMSqr',     0*_et_conversion*_et_conversion)
+        alg.addvariable('MaxMSqr', 10*10*_et_conversion*_et_conversion)
+        alg.addvariable('MinET1',      4*_et_conversion)
+        tm.registerTopoAlgo(alg)
 
         #ATR-18815
         # TODO: to be updated with phase1 muons
@@ -1352,6 +1397,23 @@ class TopoAlgoDef:
         alg.addvariable('DeltaRMax', 15*15*_dr_conversion*_dr_conversion)
         tm.registerTopoAlgo(alg)
 
+        #ATR-19639, L1_BPH-2M9-0DR15-C-MU6MU4, with opposite charge
+        # TODO: update with phase1 muons
+        toponame = "2INVM9-0DR15-C-MU6ab-MU4ab"
+        log.debug("Define %s", toponame)
+        inputList = ['MUab']
+        alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1Charge( name = toponame, inputs = inputList, outputs = toponame )
+        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+        alg.addgeneric('NumResultBits', 1)
+        alg.addvariable('MinMSqr',     2*2*_et_conversion*_et_conversion)
+        alg.addvariable('MaxMSqr',     9*9*_et_conversion*_et_conversion)
+        alg.addvariable('MinET1',        6*_et_conversion)
+        alg.addvariable('MinET2',        4*_et_conversion)
+        alg.addvariable('DeltaRMin',     0*_dr_conversion*_dr_conversion)
+        alg.addvariable('DeltaRMax', 15*15*_dr_conversion*_dr_conversion)
+        tm.registerTopoAlgo(alg)
+
         #ATR-19720, L1_BPH-8M15-0DR22-MU6MU4-BO
         # TODO: update with phase1 muons
         toponame = "8INVM15-0DR22-MU6ab-MU4ab"
@@ -1385,7 +1447,10 @@ class TopoAlgoDef:
         alg.addvariable('DeltaRMin',     0*_dr_conversion*_dr_conversion)
         alg.addvariable('DeltaRMax', 15*15*_dr_conversion*_dr_conversion)
         tm.registerTopoAlgo(alg)
-        
+       
+
+
+ 
         # CEP_CjJ
         # TODO: update with phase1 jets, what conversion for Xi?
         CEPmap = [
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_HI_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_HI_v1.py
index 9007363d1a9d..400a4b4aa5db 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_HI_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_HI_v1.py
@@ -182,227 +182,12 @@ def defineMenu():
         ]
 
 
-#CTP IDs are taken from this mapping. Every L1 item needs a unique ctpid.
+
 # Run this file as python python/l1menu/Menu_MC_pp_v7.py to print out available IDs
-# 463-464 are reserved for L1_RD2_BGRP14 and L1_RD3_BGRP15 (in MC_Physics_pp_v7)
-# 509-511 are reserved for CALREQ
+# CTP IDs 509-511 are reserved for CALREQ
     
     L1MenuFlags.CtpIdMap = {
  
-        'L1_EM3' : 0,
-        'L1_EM7' : 1,
-        'L1_EM12' : 2,
-        'L1_EM8VH' : 3,
-        'L1_EM10VH' : 4,
-        'L1_EM15' : 6,
-        'L1_EM15VH' : 7,
-        'L1_EM18VHI' : 8,
-        'L1_EM20VH' : 9,
-        'L1_EM20VHI' : 10,
-        'L1_EM22VHI' : 11,
-        'L1_EM3_EMPTY' : 12,
-        'L1_EM7_EMPTY' : 13,
-        'L1_2EM3' : 23,
-        'L1_2EM7' : 24,
-        #'L1_EM30VHI' : 25,
-        'L1_2EM15' : 27,
-        'L1_2EM15VH' : 28,
-        'L1_EM15VHI' : 29,
-        #'L1_EM24VHIM' : 30,
-        'L1_2EM15VHI' : 31,
-        'L1_2EM20VH':400,
-        'L1_EM20VH_3EM10VH':431, 
-        'L1_4J15p0ETA25' : 41,
-
-        'L1_J15' : 92,
-        'L1_J20' : 93,
-        'L1_J25' : 94,
-        'L1_J30' : 95,
-        'L1_J40' : 96,
-        'L1_J50' : 97,
-        'L1_J75' : 98,
-        'L1_J85' : 99,
-        'L1_J100' : 100,
-        'L1_J120' : 101,
-        'L1_J400' : 102,
-        'L1_J20p31ETA49' : 103,
-        'L1_J30p31ETA49' : 104,
-        'L1_J50p31ETA49' : 105,
-        'L1_J75p31ETA49' : 106,       
-        'L1_J15p31ETA49' : 109,
-
-        'L1_J12_EMPTY' : 111,
-        'L1_J12_FIRSTEMPTY' : 112,
-        'L1_J12_UNPAIRED_ISO' : 113,
-        'L1_J12_UNPAIRED_NONISO' : 114,
-        'L1_J12_ABORTGAPNOTCALIB' : 115,
-        'L1_J15p31ETA49_UNPAIRED_ISO' : 75,
-        'L1_J30_EMPTY' : 116,
-        'L1_J30_FIRSTEMPTY' : 117,
-        'L1_J30p31ETA49_EMPTY' : 118,
-        'L1_J30p31ETA49_UNPAIRED_ISO' : 119,
-        'L1_J30p31ETA49_UNPAIRED_NONISO' : 120,
-        'L1_J50_UNPAIRED_ISO' : 121,
-        'L1_J50_UNPAIRED_NONISO' : 122,
-        'L1_J50_ABORTGAPNOTCALIB' : 123,
-
-        'L1_3J40' : 128,
-        'L1_3J50' : 130,
-        'L1_4J15' : 131,
-        'L1_4J20' : 132,
-        'L1_3J15p0ETA25_XE40' : 184,
-        'L1_J45p0ETA21_3J15p0ETA25' : 86,
-        'L1_J50_2J40p0ETA25_3J15p0ETA25' : 87,
-
-        'L1_6J15' : 135,
-        'L1_J85_3J30' : 480,
-        #'L1_J30p0ETA49_2J20p0ETA49' : 137,
-
-        'L1_5J15p0ETA25' : 140,
-        'L1_2J15_XE55' : 141,
-        'L1_J40_XE50' : 142,
-
-        #'L1_XE10': 68,
-        'L1_XE30': 85,
-        'L1_XE300': 187,
-        
-        'L1_XE35' : 144,
-        'L1_XE40' : 145,
-        'L1_XE45' : 146,
-        'L1_XE50' : 147,
-        'L1_XE55' : 148,
-        'L1_XE60' : 149,
-        #'L1_XE70' : 150,
-        #'L1_XE80' : 151,
-        #'L1_EM12_XS20' : 154,
-        #'L1_EM15_XS30' : 155,
-        'L1_TE10' : 158,
-        'L1_TE30' : 138,
-
-        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
-        'L1_CEP-CJ60' : 162,
-        'L1_BCM_AC_UNPAIRED_ISO' : 163,
-        'L1_CEP-CJ50' : 80,
-        'L1_MBTS_1_EMPTY' : 164,
-        'L1_MBTS_1_1_EMPTY' : 168,
-        'L1_MBTS_2_EMPTY' : 166,
-        'L1_EM20VH_3J20' : 26,
-        'L1_EM18VHI_3J20' : 172,
-        'L1_2J50_XE40' : 175,
-        'L1_J40_XE60' : 176,
-        'L1_J25p0ETA23_2J15p31ETA49': 335 , 
-        'L1_J40p0ETA25_2J15p31ETA49' : 181,
-        'L1_J40p0ETA25_2J25_J20p31ETA49' : 182,
-
-        ## noid
-        'L1_RD0_FILLED' : 200,
-        'L1_RD0_UNPAIRED_ISO' : 201,
-        'L1_RD0_EMPTY' : 202,
-        'L1_RD0_FIRSTEMPTY' : 209,
-        'L1_RD1_EMPTY' : 204,
-        'L1_RD2_FILLED' : 205,
-        'L1_RD2_EMPTY' : 206,
-        'L1_RD3_FILLED' : 207,
-        'L1_RD3_EMPTY' : 208,
-        'L1_TGC_BURST' : 220,
-        'L1_BCM_AC_CA_BGRP0' : 223,
-        'L1_BCM_Wide_EMPTY' : 224,
-        'L1_BCM_Wide_UNPAIRED_ISO' : 225,
-
-        'L1_BCM_CA_UNPAIRED_ISO' : 229,
-        'L1_BCM_AC_UNPAIRED_NONISO' : 230,
-        'L1_BCM_CA_UNPAIRED_NONISO' : 231,
-        'L1_BCM_AC_ABORTGAPNOTCALIB' : 232,
-        'L1_BCM_CA_ABORTGAPNOTCALIB' : 233,
-        'L1_BCM_Wide_ABORTGAPNOTCALIB' : 234,
-        'L1_BCM_AC_CALIB' : 235,
-        'L1_BCM_CA_CALIB' : 236,
-        'L1_BCM_Wide_CALIB' : 237,
-
-        'L1_ZB' : 240,
-
-        'L1_HT190-J15pETA21' : 258,
-        'L1_HT190-J15s5pETA21' : 259,
-        'L1_HT150-J20pETA31' : 260,
-        'L1_JPSI-1M5-EM7' : 263,
-        'L1_JPSI-1M5-EM12' : 264,
-        'L1_MJJ-400-0DPHI20' : 270,
-        'L1_MJJ-400-0DPHI22' : 272,
-        'L1_MJJ-400-0DPHI24' : 274,
-        'L1_MJJ-400-0DPHI26' : 276,
-        'L1_EM22VH' : 295,
-
-        ### ATR-14350 - these should be replaced in 2017 with items 296 and 298
-        'L1_LFV-EM8I' : 320,
-        'L1_LFV-EM15I' : 321,
-        'L1_MJJ-800' : 327,
-        'L1_MJJ-400' : 329,
-        'L1_MJJ-100' : 333,
-        'L1_J50_DETA20-J50J' : 275,
-        'L1_DPHI-2EM3' : 288, 
-        'L1_HT150-JJ15pETA49' : 334,
-        'L1_J4-MATCH' : 336,
-        'L1_LLP-RO' : 338,
-        'L1_LLP-NOMATCH' : 339,
-
-        'L1_LAR-EM' : 351,
-        'L1_LAR-J' : 352,
-        'L1_LAR-ZEE' : 71,
-        'L1_LAR-ZEE_LAR-EM' : 285,
-        'L1_SC111-CJ15' : 356,
-        'L1_SC85-CJ15' : 357,
-
-        'L1_EM7_FIRSTEMPTY': 371, 
-        'L1_RD0_ABORTGAPNOTCALIB':372,
-        'L1_3J25p0ETA23' : 373,
-        'L1_3J35p0ETA23' : 425,
-        #'L1_4J20p0ETA49' : 383,
-        'L1_HT150-JJ15pETA49_MJJ-400' : 416,
-
-        ### ATR-15062
-        
-        'L1_EM7_UNPAIRED_ISO': 389,
-        'L1_EM24VHI'           : 392,
-        #
-        'L1_EM20VH_FIRSTEMPTY': 411, 
-        'L1_J100_FIRSTEMPTY': 414, 
-        
-        # LUCID
-        'L1_LUCID' : 212,
-        'L1_LUCID_EMPTY' : 213,
-        'L1_LUCID_UNPAIRED_ISO' : 214,
-        'L1_LUCID_BGRP9' : 471,
-        'L1_LUCID_BGRP11' : 472,
-
-        # TRT
-        'L1_TRT_FILLED' : 218,
-        'L1_TRT_EMPTY' : 219,
-
-        # ALFA
-        'L1_ALFA_A7L1L': 492,
-        'L1_ALFA_A7L1U': 491,
-        'L1_ALFA_A7R1L': 494,
-        'L1_ALFA_A7R1U': 493,
-        'L1_ALFA_ANY'  : 490,
-        'L1_ALFA_B7L1L': 497,
-        'L1_ALFA_B7L1U': 489,
-        'L1_ALFA_B7R1L': 496,
-        'L1_ALFA_B7R1U': 495,
-
-
-        # RNDM
-        'L1_RD0_UNPAIRED_NONISO' : 178,
-        'L1_RD0_BGRP9' : 210,
-        'L1_RD0_BGRP10' : 473,
-        'L1_RD0_BGRP11' : 211,
-        'L1_RD1_FILLED' : 203,
-        'L1_RD1_BGRP10' : 188,
-        'L1_RD2_EMPTY' : 206,
-        'L1_RD2_BGRP12' : 390,
-        'L1_RD3_FILLED' : 207,
-        'L1_RD3_EMPTY' : 208,
-        'L1_RD2_BGRP14' : 463,
-        'L1_RD3_BGRP15' : 464,
 
         # NB: 508 is reserved for the zero bias trigger, and 509-511 for the CALREQ triggers (at the moment, ATR-22654)
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
index 4088e72a0448..cfaff282ebe2 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
@@ -285,11 +285,16 @@ def defineMenu():
         'L1_LLP-RO-eEM', 'L1_LLP-NOMATCH-eEM',
         'L1_DPHI-2eEM3', 
         'L1_jHT150-jJ20s5pETA31_jMJJ-400-CF',
-        'L1_DY-BOX-2MU5VF',
+
+        #ATR-19510
+        'L1_DY-BOX-2MU5VF', 'L1_DY-BOX-MU5VFMU3V', 'L1_DY-BOX-2MU3V',
+
+        #ATR-23394
         'L1_LFV-eEM8L-MU8VF', 'L1_LFV-eEM12L-MU5VF',
+
         'L1_LFV-MU5VF',
-        'L1_LFV-MU8VF',
-        'L1_LFV-eEM8L', 'L1_LFV-eEM15L', 
+        'L1_LFV-MU8VF', 
+
         'L1_jMJJ-700-NFF',
         'L1_jMJJ-300-NFF',
         'L1_jMJJ-500-NFF',
@@ -298,23 +303,26 @@ def defineMenu():
 
         'L1_10DR-MU14FCH-MU5VF', #ATR-19376
     
-        #ATR-19720
+        #ATR-19720, ATR-19639
         'L1_BPH-2M9-0DR15-2MU3V',
-        'L1_BPH-8M15-2MU3V-BO',
         'L1_BPH-2M9-0DR15-MU5VFMU3V',
-        'L1_BPH-8M15-0DR22-MU5VFMU3V-BO',
+        'L1_BPH-2M9-0DR15-C-MU5VFMU3V',
         'L1_BPH-2M9-2DR15-2MU5VF',
+        'L1_BPH-8M15-0DR22-MU5VFMU3V-BO',
         'L1_BPH-8M15-0DR22-2MU5VF',
-        
+        #ATR-19355
+        'L1_BPH-0M10-3MU3V',
+        #ATR-19638
+        'L1_BPH-0M10C-3MU3V',
+        #ATR-21566 
+        'L1_BPH-0DR12C-2MU3V',
+         
         # INVM + DPHI 
         'L1_jMJJ-400-NFF-0DPHI22',
         'L1_jMJJ-400-NFF-0DPHI24',
         'L1_jMJJ-400-NFF-0DPHI26',
 
-        'L1_LATE-MU8F_XE50','L1_LATE-MU8F_XE40', 'L1_LATE-MU8F_J50',
-
-        #ATR-19355
-        'L1_BPH-0M10-3MU3V',
+        'L1_LATE-MU8F_XE30', 'L1_LATE-MU8F_J50',
 
         #ATR-18824
         'L1_ZAFB-04DPHI-eEM15M',
@@ -324,9 +332,6 @@ def defineMenu():
 
         'L1_DPHI-M70-2eEM10M', 'L1_DPHI-M70-2eEM12M', #ATR-19302
         'L1_DPHI-M70-2eEM12', # ATR-21637 (no shower shape cuts)
-
-        #ATR-19510
-        'L1_DY-BOX-2MU3V',
                 
         #ATR-17320
         'L1_CEP-CjJ60',
@@ -336,256 +341,11 @@ def defineMenu():
         ]
 
 
-#CTP IDs are taken from this mapping. Every L1 item needs a unique ctpid.
 # Run this file as python python/l1menu/Menu_MC_pp_v7.py to print out available IDs
-# 463-464 are reserved for L1_RD2_BGRP14 and L1_RD3_BGRP15 (in MC_Physics_pp_v7)
-# 509-511 are reserved for CALREQ
+# CTP ID 509-511 are reserved for CALREQ
     
     L1MenuFlags.CtpIdMap = {
 
-        'L1_RD0_FILLED' : 200,
-        'L1_RD0_UNPAIRED_ISO' : 201,
-        'L1_RD0_EMPTY' : 202,
-        'L1_RD0_FIRSTEMPTY' : 209,
-        'L1_RD0_ABORTGAPNOTCALIB':372,
-        'L1_RD0_UNPAIRED_NONISO' : 178,
-        'L1_RD0_BGRP9' : 210,
-        'L1_RD0_BGRP10' : 473,
-        'L1_RD0_BGRP11' : 211,
-        'L1_RD1_EMPTY' : 204,
-        'L1_RD1_FILLED' : 203,
-        'L1_RD1_BGRP10' : 188,
-        'L1_RD2_FILLED' : 205,
-        'L1_RD2_EMPTY' : 206,
-        'L1_RD2_BGRP12' : 390,
-        'L1_RD2_BGRP14' : 463,
-        'L1_RD3_FILLED' : 207,
-        'L1_RD3_EMPTY' : 208,
-        'L1_RD3_BGRP15' : 464,
-
-        'L1_TGC_BURST' : 220,
-        'L1_ZB' : 240,
-
-        'L1_LUCID' : 212,
-        'L1_LUCID_EMPTY' : 213,
-        'L1_LUCID_UNPAIRED_ISO' : 214,
-        'L1_LUCID_BGRP9' : 471,
-        'L1_LUCID_BGRP11' : 472,
-
-        'L1_TRT_FILLED' : 218,
-        'L1_TRT_EMPTY' : 219,
-
-        'L1_BCM_AC_CA_BGRP0' : 223,
-        'L1_BCM_AC_UNPAIRED_ISO' : 163,
-        'L1_BCM_CA_UNPAIRED_ISO' : 229,
-        'L1_BCM_AC_UNPAIRED_NONISO' : 230,
-        'L1_BCM_CA_UNPAIRED_NONISO' : 231,
-        'L1_BCM_AC_ABORTGAPNOTCALIB' : 232,
-        'L1_BCM_CA_ABORTGAPNOTCALIB' : 233,
-        'L1_BCM_AC_CALIB' : 235,
-        'L1_BCM_CA_CALIB' : 236,
-        'L1_BCM_Wide_ABORTGAPNOTCALIB' : 234,  
-        'L1_BCM_Wide_CALIB' : 237,
-        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
-        'L1_BCM_Wide_EMPTY' : 224,
-        'L1_BCM_Wide_UNPAIRED_ISO' : 225,
-
-        'L1_MBTS_1_EMPTY' : 164,
-        'L1_MBTS_1_1_EMPTY' : 168,
-        'L1_MBTS_2_EMPTY' : 166,
-        'L1_MBTS_1_UNPAIRED_ISO' : 169,
-        'L1_MBTS_2_UNPAIRED_ISO' : 170,
-        'L1_MBTS_1_1_UNPAIRED_ISO' : 171,        
-
-        'L1_MBTSA0' : 401,
-        'L1_MBTSA1' : 402,
-        'L1_MBTSA2' : 403,
-        'L1_MBTSA3' : 404,
-        'L1_MBTSA4' : 405,
-        'L1_MBTSA5' : 406,
-        'L1_MBTSA6' : 407,
-        'L1_MBTSA7' : 408,
-        'L1_MBTSA8' : 409,
-        'L1_MBTSA9' : 410,
-        'L1_MBTSA10' : 443,
-        'L1_MBTSA11' : 412,
-        'L1_MBTSA12' : 413,
-        'L1_MBTSA13' : 415,
-        'L1_MBTSA14' : 416,
-        'L1_MBTSA15' : 444,
-        'L1_MBTSC0' : 418,
-        'L1_MBTSC1' : 419,
-        'L1_MBTSC2' : 420,
-        'L1_MBTSC3' : 421,
-        'L1_MBTSC4' : 422,
-        'L1_MBTSC5' : 423,
-        'L1_MBTSC6' : 424,
-        'L1_MBTSC7' : 434,
-        'L1_MBTSC8' : 435,
-        'L1_MBTSC9' : 436,
-        'L1_MBTSC10' : 437,
-        'L1_MBTSC11' : 438,
-        'L1_MBTSC12' : 439,
-        'L1_MBTSC13' : 440,
-        'L1_MBTSC14' : 441,
-        'L1_MBTSC15' : 442,
-
-        'L1_ALFA_A7L1L': 492,
-        'L1_ALFA_A7L1U': 491,
-        'L1_ALFA_A7R1L': 494,
-        'L1_ALFA_A7R1U': 493,
-        'L1_ALFA_ANY'  : 490,
-        'L1_ALFA_B7L1L': 497,
-        'L1_ALFA_B7L1U': 489,
-        'L1_ALFA_B7R1L': 496,
-        'L1_ALFA_B7R1U': 495,
-
-        # legacy non-physics items
-        'L1_EM3_EMPTY' : 12,
-        'L1_EM7_EMPTY' : 13,
-        'L1_EM7_FIRSTEMPTY': 371,
-        'L1_EM7_UNPAIRED_ISO': 389,
-        'L1_EM20VH_FIRSTEMPTY': 411,
-        'L1_TAU8_EMPTY' : 57,
-        'L1_TAU8_FIRSTEMPTY' : 391,
-        'L1_TAU8_UNPAIRED_ISO' : 388,
-        #'L1_TAU30_EMPTY':341,
-        #'L1_TAU30_UNPAIRED_ISO' : 343,
-        'L1_J12_EMPTY' : 111,
-        'L1_J12_FIRSTEMPTY' : 112,
-        'L1_J12_UNPAIRED_ISO' : 113,
-        'L1_J12_UNPAIRED_NONISO' : 114,
-        'L1_J12_ABORTGAPNOTCALIB' : 115,
-        'L1_J15p31ETA49_UNPAIRED_ISO' : 75,
-        'L1_J30_EMPTY' : 116,
-        'L1_J30_FIRSTEMPTY' : 117,
-        'L1_J30p31ETA49_EMPTY' : 118,
-        'L1_J30p31ETA49_UNPAIRED_ISO' : 119,
-        'L1_J30p31ETA49_UNPAIRED_NONISO' : 120,
-        'L1_J50_UNPAIRED_ISO' : 121,
-        'L1_J50_UNPAIRED_NONISO' : 122,
-        'L1_J50_ABORTGAPNOTCALIB' : 123,
-        'L1_J100_FIRSTEMPTY': 414,
-
-        # Legacy L1Calo threholds
-        # EM
-        'L1_EM3' : 0,
-        'L1_EM7' : 1,
-        'L1_EM12' : 2,
-        'L1_EM8VH' : 3,
-        'L1_EM10VH' : 4,
-        'L1_EM15VHI_2TAU12IM_4J12' : 5,
-        'L1_EM15' : 6,
-        'L1_EM15VH' : 7,
-        'L1_EM18VHI' : 8,
-        'L1_EM20VH' : 9,
-        'L1_EM20VHI' : 10,
-        'L1_EM22VHI' : 11,
-        'L1_EM22VH' : 295,
-        'L1_EM24VHI' : 392,
-        'L1_2EM3' : 23,
-        'L1_2EM7' : 24,
-        #'L1_EM30VHI' : 25,
-        'L1_2EM15' : 27,
-        'L1_2EM15VH' : 28,
-        'L1_EM15VHI' : 29,
-        #'L1_EM24VHIM' : 30,
-        'L1_2EM15VHI' : 31,
-        'L1_2EM20VH':400,
-        'L1_EM20VH_3EM10VH':431, 
-        'L1_4J15p0ETA25' : 41,
-
-        # TAU
-        #'L1_TAU5' : 50,
-        #'L1_2TAU5' : 59,
-        'L1_2TAU8': 459,
-        #'L1_TAU12' : 45,
-        'L1_TAU12IM' : 47,
-        'L1_TAU20IM' : 51,
-        'L1_TAU100' : 52,
-        #'L1_TAU30' : 53,
-        'L1_TAU40' : 54,
-        'L1_TAU60' : 55,
-        #'L1_TAU90' : 56,
-        'L1_TAU20IM_2TAU12IM' : 58,
-        'L1_TAU60_2TAU40': 458, 
-
-        'L1_EM15VHI_2TAU12IM' : 60,
-        'L1_EM15VHI_2TAU12IM_XE35' : 78,
-        'L1_EM15VHI_2TAU12IM_J25_3J12' : 61,
-        #'L1_EM15VHI_TAU40_2TAU15' : 62,
-        #'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
-
-        'L1_TAU20IM_2TAU12IM_J25_2J20_3J12' : 70,
-        'L1_TAU20IM_2TAU12IM_4J12p0ETA25' : 316,
-        'L1_TAU20IM_2J20_XE45' : 74,
-        #'L1_TAU20IM_2TAU12IM_4J12p0ETA28' : 77,
-        'L1_TAU20IM_2J20_XE50' : 79,
-        'L1_TAU25IM_2TAU20IM_2J25_3J20' : 398,
-        'L1_TAU20IM_2TAU12IM_XE35' : 83,
-        'L1_TAU40_2TAU12IM_XE40' : 429,
-
-        'L1_J15' : 92,
-        'L1_J20' : 93,
-        'L1_J25' : 94,
-        'L1_J30' : 95,
-        'L1_J40' : 96,
-        'L1_J50' : 97,
-        'L1_J75' : 98,
-        'L1_J85' : 99,
-        'L1_J100' : 100,
-        #'L1_J120' : 101,
-        'L1_J400' : 102,
-        'L1_J20p31ETA49' : 103,
-        'L1_J30p31ETA49' : 104,
-        'L1_J50p31ETA49' : 105,
-        'L1_J75p31ETA49' : 106,
-        'L1_J15p31ETA49' : 109,
-        'L1_3J40' : 128,
-        'L1_3J50' : 130,
-        'L1_4J15' : 131,
-        'L1_4J20' : 132,
-        'L1_J45p0ETA21_3J15p0ETA25' : 86,
-        'L1_J50_2J40p0ETA25_3J15p0ETA25' : 87,
-        'L1_6J15' : 135,
-        'L1_J85_3J30' : 480,
-        #'L1_J30p0ETA49_2J20p0ETA49' : 137,
-
-        'L1_5J15p0ETA25' : 140,
-        'L1_2J15_XE55' : 141,
-        'L1_J25p0ETA23_2J15p31ETA49': 335 ,
-        'L1_J40p0ETA25_2J15p31ETA49' : 181,
-        'L1_J40p0ETA25_2J25_J20p31ETA49' : 182,
-        'L1_3J25p0ETA23' : 373,
-        'L1_3J35p0ETA23' : 425,
-        #'L1_4J20p0ETA49' : 383,
-
-        #'L1_XE10': 68,
-        'L1_XE30': 85,
-        'L1_XE300': 187,
-        'L1_XE35' : 144,
-        'L1_XE40' : 145,
-        'L1_XE45' : 146,
-        'L1_XE50' : 147,
-        'L1_XE55' : 148,
-        'L1_XE60' : 149,
-        #'L1_XE70' : 150,
-        #'L1_XE80' : 151,
-        #'L1_EM12_XS20' : 154,
-        #'L1_EM15_XS30' : 155,
-        'L1_TE10' : 158,
-        #'L1_TE30' : 138,
-
-        'L1_EM20VH_3J20' : 26,
-        'L1_EM18VHI_3J20' : 172,
-
-        'L1_3J15p0ETA25_XE40' : 184,
-
-        'L1_J40_XE50' : 142,
-        'L1_2J50_XE40' : 175,
-        'L1_J40_XE60' : 176,
-
-
         # NB: 508 is reserved for the zero bias trigger, and 509-511 for the CALREQ triggers (at the moment, ATR-22654)
 
     }
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
index 79de79944593..1c3df87f8fd1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
@@ -153,12 +153,14 @@ def defineInputsMenu():
                                                                                                                   '400INVM-0DPHI24-jJ30s6-AjJ20s6',
                                                                                                                   '400INVM-0DPHI22-jJ30s6-AjJ20s6',
                                                                                                                   '400INVM-0DPHI20-jJ30s6-AjJ20s6'] ),
-                    TopoMenuDef( '0INVM10-3MU4ab',                             outputbits = 6 ),
+                    TopoMenuDef( '0INVM10-3MU4ab',                             outputbits = 6 ), #BLS
                     TopoMenuDef( 'LATE-MU10s1',                                outputbits = 7 ),
-                    TopoMenuDef( 'MULT-CMU4ab',                                outputbits = (8,9), outputlines = ['MULT-CMU4ab[0]', 'MULT-CMU4ab[1]'] ), # 2bits  # TODO: needed?
-                    TopoMenuDef( 'MULT-CMU6ab',                                outputbits = (10,11), outputlines = ['MULT-CMU6ab[0]', 'MULT-CMU6ab[1]'] ), # 2bits # TODO: needed?
-                    TopoMenuDef( '0DR04-MU4ab-CjJ15ab',                        outputbits = 12 ),  # not a primary
-                    TopoMenuDef( '0DR04-MU6ab-CjJ20ab',                        outputbits = 13 ),  # not a primary
+                    TopoMenuDef( 'MULT-CMU4ab',                                outputbits = (8,9), outputlines = ['MULT-CMU4ab[0]', 'MULT-CMU4ab[1]'] ), # BLS, 2bits  # TODO: needed?
+                    TopoMenuDef( 'MULT-CMU6ab',                                outputbits = (10,11), outputlines = ['MULT-CMU6ab[0]', 'MULT-CMU6ab[1]'] ), # BLS, 2bits # TODO: needed?
+                    TopoMenuDef( '0DR04-MU4ab-CjJ15ab',                        outputbits = 12 ), #Bjet, TODO: not a primary
+                    TopoMenuDef( '0DR04-MU6ab-CjJ20ab',                        outputbits = 13 ), #Bjet, TODO: not a primary
+                    TopoMenuDef( '0INVM10C-3MU4ab',                            outputbits = 14 ), #BLS
+                    TopoMenuDef( '2INVM9-0DR15-C-MU6ab-MU4ab',                 outputbits = 15 ), #BLS 
                 ]
             },            
 
@@ -253,7 +255,8 @@ def defineInputsMenu():
                     TopoMenuDef( '0INVM70-27DPHI32-eEM10sm1-eEM10sm6',   outputbits = 2 ),
                     TopoMenuDef( '0INVM70-27DPHI32-eEM12sm1-eEM12sm6',   outputbits = 3 ),
                     TopoMenuDef( 'ZEE-eEM20sm2',                         outputbits = 4 ), 
-                    TopoMenuDef( '10DR99-2MU6ab',                        outputbits = 5 ),
+                    TopoMenuDef( '10DR99-2MU6ab',                        outputbits = 5 ), #Msonly Narrow scan triggers
+                    TopoMenuDef( '0DR12C-2MU4ab',                        outputbits = 6 ), #BLS
                 ]
             },
 
@@ -261,22 +264,18 @@ def defineInputsMenu():
                 "fpga" : 1,
                 "clock" : 1,
                 "algorithms" : [
-                    TopoMenuDef( '8INVM15-0DR22-MU6ab-MU4ab',            outputbits = 0 ),
-                    TopoMenuDef( '2INVM9-0DR15-MU6ab-MU4ab',             outputbits = 1 ),  
-                    TopoMenuDef( '2INVM9-0DR15-2MU4ab',                  outputbits = 2 ), 
-                    TopoMenuDef( '2INVM9-2DR15-2MU6ab',                  outputbits = 3 ),
-                    TopoMenuDef( '5DETA99-5DPHI99-2MU4ab',               outputbits = 4 ),
-                    TopoMenuDef( '5DETA99-5DPHI99-MU6ab-MU4ab',          outputbits = 5 ), 
-                    TopoMenuDef( '5DETA99-5DPHI99-2MU6ab',               outputbits = 6 ),
-                    TopoMenuDef( '0DETA04-eEM8abl-MU10ab',               outputbits = 7 ),
-                    TopoMenuDef( '0DPHI03-eEM8abl-MU10ab',               outputbits = 8 ),
-                    TopoMenuDef( '0DETA04-eEM15abl-MUab',                outputbits = 9 ),
-                    TopoMenuDef( '0DPHI03-eEM15abl-MUab',                outputbits = 10 ),
-                    TopoMenuDef( '0INVM10-0DR15-eEM8abl-MU10ab',         outputbits = 11 ),
-                    TopoMenuDef( '0INVM10-0DR15-eEM12abl-MU6ab',         outputbits = 12 ),
-                    TopoMenuDef( '8INVM15-2CMU4ab',                      outputbits = 13 ), #TODO: needed?
-                    TopoMenuDef( '0DR15-2MU6ab',                         outputbits = 14 ),
-                    TopoMenuDef( '8INVM15-0DR22-2MU6ab',                 outputbits = 15 ),
+                    TopoMenuDef( '8INVM15-0DR22-MU6ab-MU4ab',            outputbits = 0 ),  #BLS
+                    TopoMenuDef( '2INVM9-0DR15-MU6ab-MU4ab',             outputbits = 1 ),  #BLS 
+                    TopoMenuDef( '2INVM9-0DR15-2MU4ab',                  outputbits = 2 ),  #BLS 
+                    TopoMenuDef( '2INVM9-2DR15-2MU6ab',                  outputbits = 3 ),  #BLS
+                    TopoMenuDef( '5DETA99-5DPHI99-2MU4ab',               outputbits = 4 ),  #Low-mass DY
+                    TopoMenuDef( '5DETA99-5DPHI99-MU6ab-MU4ab',          outputbits = 5 ),  #Low-mass DY
+                    TopoMenuDef( '5DETA99-5DPHI99-2MU6ab',               outputbits = 6 ),  #Low-mass DY
+                    TopoMenuDef( '0INVM10-0DR15-eEM8abl-MU10ab',         outputbits = 7 ), #LFV
+                    TopoMenuDef( '0INVM10-0DR15-eEM12abl-MU6ab',         outputbits = 8 ), #LFV
+                    TopoMenuDef( '8INVM15-2CMU4ab',                      outputbits = 9 ), #BLS, TODO: needed?
+                    TopoMenuDef( '0DR15-2MU6ab',                         outputbits = 10 ), #LFV
+                    TopoMenuDef( '8INVM15-0DR22-2MU6ab',                 outputbits = 11 ), #BLS
                 ]
             }
         ]
-- 
GitLab


From adf7fd45614f93d19a74f0a3c38cde4312e48e9c Mon Sep 17 00:00:00 2001
From: Stewart Martin-Haugh <stewart.martin-haugh@cern.ch>
Date: Mon, 13 Sep 2021 18:57:11 +0200
Subject: [PATCH 085/347] Only retrieve tools in initialize() methods ATR-24078

---
 .../TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h  | 2 ++
 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXDriver.cxx  | 3 ---
 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx    | 8 ++++----
 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXSim.cxx     | 2 +-
 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXSysSim.cxx  | 3 ++-
 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx  | 3 ---
 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx     | 8 ++++++--
 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx  | 2 +-
 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXDriver.cxx  | 3 ---
 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx    | 3 +--
 Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSim.cxx     | 6 +-----
 11 files changed, 18 insertions(+), 25 deletions(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h
index 8822ebb4698a..d778ba6b9826 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h
@@ -45,6 +45,8 @@ namespace LVL1 {
 
     virtual void execute() override ;
 
+    virtual StatusCode initialize() override ;
+
     virtual StatusCode executegFEXSim(gTowersIDs tmp) override;
 
     virtual std::vector<uint32_t> getgRhoTOBs() const override;
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXDriver.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXDriver.cxx
index a5040d810ffb..3e785e116383 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXDriver.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXDriver.cxx
@@ -120,13 +120,11 @@ StatusCode eFEXDriver::finalize()
   std::unique_ptr<eTowerContainer> local_eTowerContainerRaw = std::make_unique<eTowerContainer>();
 
   // STEP 1 - Make some eTowers and fill the local container
-  ATH_CHECK( m_eTowerBuilderTool.retrieve() );
   m_eTowerBuilderTool->init(local_eTowerContainerRaw);
   local_eTowerContainerRaw->clearContainerMap();
   local_eTowerContainerRaw->fillContainerMap();
 
   // STEP 2 - Do the supercell-tower mapping - put this information into the eTowerContainer
-  ATH_CHECK( m_eSuperCellTowerMapperTool.retrieve() );
   ATH_CHECK(m_eSuperCellTowerMapperTool->AssignSuperCellsToTowers(local_eTowerContainerRaw));
   ATH_CHECK(m_eSuperCellTowerMapperTool->AssignTriggerTowerMapper(local_eTowerContainerRaw));
 
@@ -168,7 +166,6 @@ StatusCode eFEXDriver::finalize()
   ATH_CHECK(eTowerContainerSG.record(std::move(/*my_eTowerContainerRaw*/local_eTowerContainerRaw)));
 
   // STEP 4 - Set up the eFEXSysSim
-  ATH_CHECK( m_eFEXSysSimTool.retrieve() );
   m_eFEXSysSimTool->init();
 
   // STEP 5 - Do some monitoring
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
index 2845743f16de..261ad3251c55 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
@@ -56,6 +56,10 @@ StatusCode eFEXFPGA::initialize()
 {
 
   ATH_CHECK(m_eFEXFPGA_eTowerContainerKey.initialize());
+  ATH_CHECK( m_eFEXegAlgoTool.retrieve() );
+  ATH_CHECK( m_eFEXtauAlgoTool.retrieve() );
+  
+  
   ATH_CHECK(m_l1MenuKey.initialize());
 
   return StatusCode::SUCCESS;
@@ -105,8 +109,6 @@ StatusCode eFEXFPGA::execute(eFEXOutputCollection* inputOutputCollection){
         {m_eTowersIDs[iphi+1][ieta-1], m_eTowersIDs[iphi+1][ieta], m_eTowersIDs[iphi+1][ieta+1]},
       };
 
-      ATH_CHECK( m_eFEXegAlgoTool.retrieve() );
-  
       ATH_CHECK( m_eFEXegAlgoTool->safetyTest() );
       m_eFEXegAlgoTool->setup(tobtable);
 
@@ -222,8 +224,6 @@ StatusCode eFEXFPGA::execute(eFEXOutputCollection* inputOutputCollection){
         {m_eTowersIDs[iphi+1][ieta-1], m_eTowersIDs[iphi+1][ieta], m_eTowersIDs[iphi+1][ieta+1]},
       };
       
-      ATH_CHECK( m_eFEXtauAlgoTool.retrieve() );
-  
       ATH_CHECK( m_eFEXtauAlgoTool->safetyTest() );
       m_eFEXtauAlgoTool->setup(tobtable);
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXSim.cxx
index 898f3cc3e2ad..9f91a4ddb59e 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXSim.cxx
@@ -33,6 +33,7 @@ namespace LVL1 {
 
   StatusCode eFEXSim::initialize()
   {
+    ATH_CHECK( m_eFEXFPGATool.retrieve() );
     return StatusCode::SUCCESS;
   }
 
@@ -82,7 +83,6 @@ StatusCode eFEXSim::NewExecute(int tmp_eTowersIDs_subset[10][18], eFEXOutputColl
 
   int tmp_eTowersIDs_subset_FPGA[10][6];
 
-  ATH_CHECK( m_eFEXFPGATool.retrieve() );
   
   //FPGA 0----------------------------------------------------------------------------------------------------------------------------------------------
   memset(tmp_eTowersIDs_subset_FPGA, 0, sizeof tmp_eTowersIDs_subset_FPGA);
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXSysSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXSysSim.cxx
index bee3cfd059bd..b7e38bc130a1 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXSysSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXSysSim.cxx
@@ -64,6 +64,8 @@ namespace LVL1 {
 
     ATH_CHECK( m_eFEXFPGATowerIdProviderTool.retrieve() );
 
+    ATH_CHECK( m_eFEXFPGATool.retrieve() );
+
     return StatusCode::SUCCESS;
   }
 
@@ -107,7 +109,6 @@ namespace LVL1 {
 
     // do mapping with preloaded csv file if it is available
     if (m_eFEXFPGATowerIdProviderTool->ifhaveinputfile()) {
-      ATH_CHECK( m_eFEXFPGATool.retrieve() );
       int tmp_eTowersIDs_subset_eFEX[10][18];
       for (int i_efex{ 0 }; i_efex < 24; i_efex++) {
           ATH_CHECK(m_eFEXFPGATowerIdProviderTool->getRankedTowerIDineFEX(i_efex, tmp_eTowersIDs_subset_eFEX));
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx
index 6a6d1cdb1f63..bee5625655ad 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx
@@ -89,13 +89,11 @@ StatusCode gFEXDriver::initialize()
   // ATH_CHECK(gFEXOutputCollectionSG.record(std::move(my_gFEXOutputCollection)));
 
   // STEP 2 - Make some gTowers and fill the local container
-  ATH_CHECK( m_gTowerBuilderTool.retrieve() );
   m_gTowerBuilderTool->init(local_gTowerContainerRaw);
   local_gTowerContainerRaw->clearContainerMap();
   local_gTowerContainerRaw->fillContainerMap();
 
   // STEP 3 - Do the supercell-tower mapping - put this information into the gTowerContainer
-  ATH_CHECK( m_gSuperCellTowerMapperTool.retrieve() );
   ATH_CHECK(m_gSuperCellTowerMapperTool->AssignSuperCellsToTowers(local_gTowerContainerRaw));
   ATH_CHECK(m_gSuperCellTowerMapperTool->AssignTriggerTowerMapper(local_gTowerContainerRaw));
 
@@ -104,7 +102,6 @@ StatusCode gFEXDriver::initialize()
   ATH_CHECK(gTowerContainerSG.record(std::move(local_gTowerContainerRaw)));
 
   // STEP 5 - Set up the gFEXSysSim
-  ATH_CHECK( m_gFEXSysSimTool.retrieve() );
 
   // STEP 6 - Run the gFEXSysSim
   ATH_CHECK(m_gFEXSysSimTool->execute());
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
index ee6e2ed98123..604c5eee9822 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
@@ -45,6 +45,12 @@ namespace LVL1 {
    gFEXSim::~gFEXSim(){
    }
 
+   StatusCode gFEXSim::initialize(){
+      ATH_CHECK( m_gFEXFPGA_Tool.retrieve() );
+      ATH_CHECK( m_gFEXJetAlgoTool.retrieve() );
+      return StatusCode::SUCCESS;
+   }
+
  void gFEXSim::execute(){
 
  }
@@ -65,7 +71,6 @@ StatusCode gFEXSim::executegFEXSim(gTowersIDs tmp_gTowersIDs_subset){
    gTowersForward CNtwr = {{{0}}};
 
 
-   ATH_CHECK( m_gFEXFPGA_Tool.retrieve() );
 
    //FPGA A----------------------------------------------------------------------------------------------------------------------------------------------
    gTowersCentral tmp_gTowersIDs_subset_centralFPGA;
@@ -155,7 +160,6 @@ StatusCode gFEXSim::executegFEXSim(gTowersIDs tmp_gTowersIDs_subset){
    std::array<uint32_t, 7> BTOB2_dat = {0};
 
    // Retrieve the gFEXJetAlgoTool
-   ATH_CHECK( m_gFEXJetAlgoTool.retrieve() );
 
    // Pass the energy matrices to the algo tool, and run the algorithms
    auto tobs_v = m_gFEXJetAlgoTool->largeRfinder(Atwr, Btwr, CNtwr, CPtwr,
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
index 31dcc398e367..609368c9ea2b 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
@@ -312,4 +312,4 @@ namespace LVL1 {
    }
 
 
-} // end of namespace bracket
\ No newline at end of file
+} // end of namespace bracket
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXDriver.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXDriver.cxx
index 88b3388661fe..8432975147bf 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXDriver.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXDriver.cxx
@@ -135,13 +135,11 @@ StatusCode jFEXDriver::finalize()
   
 
   // STEP 2 - Make some jTowers and fill the local container
-  ATH_CHECK( m_jTowerBuilderTool.retrieve() );
   m_jTowerBuilderTool->init(local_jTowerContainerRaw);
   local_jTowerContainerRaw->clearContainerMap();
   local_jTowerContainerRaw->fillContainerMap();
 
   // STEP 3 - Do the supercell-tower mapping - put this information into the jTowerContainer
-  ATH_CHECK( m_jSuperCellTowerMapperTool.retrieve() );
   ATH_CHECK(m_jSuperCellTowerMapperTool->AssignSuperCellsToTowers(local_jTowerContainerRaw));
 
   ATH_CHECK(m_jSuperCellTowerMapperTool->AssignTriggerTowerMapper(local_jTowerContainerRaw));
@@ -153,7 +151,6 @@ StatusCode jFEXDriver::finalize()
   ATH_CHECK(jTowerContainerSG.record(std::move(/*my_jTowerContainerRaw*/local_jTowerContainerRaw)));
 
   // STEP 5 - Set up the jFEXSysSim
-  ATH_CHECK( m_jFEXSysSimTool.retrieve() );
   m_jFEXSysSimTool->init();
 
   // STEP 6 - Run THE jFEXSysSim
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx
index 77c101030bbb..9b9ee4411b4a 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx
@@ -66,6 +66,7 @@ StatusCode jFEXFPGA::initialize()
   ATH_CHECK(m_jFEXFPGA_jTowerContainerKey.initialize());
   ATH_CHECK(m_jFEXFPGA_jFEXOutputCollectionKey.initialize());
   ATH_CHECK(m_l1MenuKey.initialize());
+  ATH_CHECK( m_jFEXtauAlgoTool.retrieve());
   return StatusCode::SUCCESS;
 }
 
@@ -298,7 +299,6 @@ StatusCode jFEXFPGA::execute() {
 
     //FCAL region algorithm
     if(m_jfexid ==0 || m_jfexid ==5) {
-        ATH_CHECK(m_jFEXForwardJetsAlgoTool->initialize());
         ATH_CHECK(m_jFEXForwardJetsAlgoTool->safetyTest());
         m_jFEXForwardJetsAlgoTool->setFPGAEnergy(m_map_Etvalues_FPGA);
         m_jFEXForwardJetsAlgoTool->setup(m_jTowersIDs_Wide,m_jfexid,m_id);
@@ -442,7 +442,6 @@ StatusCode jFEXFPGA::execute() {
                 }
             }
 
-            ATH_CHECK( m_jFEXtauAlgoTool.retrieve());
             ATH_CHECK( m_jFEXtauAlgoTool->safetyTest());
             m_jFEXtauAlgoTool->setFPGAEnergy(m_map_Etvalues_FPGA);
             m_jFEXtauAlgoTool->setup(TT_searchWindow_ID,TT_seed_ID);
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSim.cxx
index cc75a2e00ee0..cc93c2e203f3 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSim.cxx
@@ -34,6 +34,7 @@ namespace LVL1 {
 
   StatusCode jFEXSim::initialize()
   {
+    ATH_CHECK( m_jFEXFPGATool.retrieve() );
     return StatusCode::SUCCESS;
   }
 
@@ -116,8 +117,6 @@ namespace LVL1 {
   // 2.4 -> 5.6 [core is 3.2 to 4.8] // FPGA 2
   // 4.0 -> 0.8 [core is 4.8 to 6.4] // FPGA 3
 
-  ATH_CHECK( m_jFEXFPGATool.retrieve() );
-
   //FPGA 0----------------------------------------------------------------------------------------------------------------------------------------------
   memset(tmp_jTowersIDs_subset_FPGA, 0, sizeof tmp_jTowersIDs_subset_FPGA);
   // 5.6 -> 2.4 [core is 0.0 to 1.6]
@@ -361,8 +360,6 @@ namespace LVL1 {
     // 2.4 -> 5.6 [core is 3.2 to 4.8] // FPGA 2
     // 4.0 -> 0.8 [core is 4.8 to 6.4] // FPGA 3
 
-    ATH_CHECK( m_jFEXFPGATool.retrieve() );
-
     //FPGA 0----------------------------------------------------------------------------------------------------------------------------------------------
     memset(tmp_jTowersIDs_subset_FPGA, 0, sizeof tmp_jTowersIDs_subset_FPGA);
     // 5.6 -> 2.4 [core is 0.0 to 1.6]
@@ -595,7 +592,6 @@ StatusCode jFEXSim::ExecuteBarrel(int tmp_jTowersIDs_subset[FEXAlgoSpaceDefs::jF
 
   int tmp_jTowersIDs_subset_FPGA[nrows][ncols];
 
-  ATH_CHECK( m_jFEXFPGATool.retrieve() );
   
   //FPGA 0----------------------------------------------------------------------------------------------------------------------------------------------
   memset(tmp_jTowersIDs_subset_FPGA, 0, sizeof tmp_jTowersIDs_subset_FPGA);
-- 
GitLab


From a7efdf533129c55794d27d26534d00bf68c9a34e Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Mon, 13 Sep 2021 19:54:15 +0200
Subject: [PATCH 086/347] 22.0-cppcheck-InDetDetDescrExample

---
 .../src/ReadSiDetectorElements.cxx                  | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx b/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx
index ef3e7ae800b5..9bcf27e15990 100755
--- a/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx
+++ b/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx
@@ -23,13 +23,7 @@
 #include <string>
 
 using namespace InDetDD;
-// or just the ones we need.
-// using InDetDD::SiDetectorManager;
-// using InDetDD::SiDetectorElement;
-// using InDetDD::SiDetectorElementCollection;
-// using InDetDD::SiLocalPosition;
-// using InDetDD::SiCellId;
-// using InDetDD::SiIntersect;
+
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -563,7 +557,7 @@ ReadSiDetectorElements::printDifference() const {
   SiDetectorElementCollection::const_iterator elementC = elementsC->begin();
   SiDetectorElementCollection::const_iterator elementM = elementsM->begin();
   SiDetectorElementCollection::const_iterator elementMe = elementsM->end();
-  for (; elementM!=elementMe; elementC++, elementM++) {
+  for (; elementM!=elementMe; ++elementC, ++elementM) {
     auto diff = (*elementC)->center()-(*elementM)->center();
     if (diff[0]!=0. or diff[1]!=0. or diff[2]!=0.) {
       ATH_MSG_ALWAYS("----------------------------------------------");
@@ -693,8 +687,7 @@ ReadSiDetectorElements::testElement(const Identifier & id,
       ATH_MSG_ALWAYS(" Near bond gap: (tolerance = " << tolerance/CLHEP::mm << " mm) : " 
                      <<  element->nearBondGap(globalPos, tolerance));
       SiCellId returnedCellId = element->cellIdOfPosition(localPosNew);
-      //     ATH_MSG_ALWAYS(" Returned cell Id (phiIndex,etaIndex) = " 
-      //     << returnedCellId.phiIndex() << ", " << returnedCellId.etaIndex()); 
+
       ATH_MSG_ALWAYS(" Returned cell Id [phiIndex.etaIndex] = " 
                      << returnedCellId); 
       ATH_MSG_ALWAYS(" using global position sin(tilt), tilt (deg), sin(stereo), stereo (deg) = "
-- 
GitLab


From 5042ab5f22dcef50f5487f3f7cfd2fa1d394be36 Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Mon, 13 Sep 2021 19:56:38 +0200
Subject: [PATCH 087/347] DQ ART updates

---
 .../test/test_run3dq_r21_esd_serial.sh        |  2 +-
 .../test/test_run3dq_r22_aod.sh               |  2 +-
 .../test/test_run3dq_r22_aod_trigger.sh       | 10 +++-----
 .../test_run3dq_r22_aod_trigger_aodslim.sh    | 23 +++++++++++++++++++
 .../test_run3dq_r22_aod_trigger_serial.sh     | 22 ------------------
 .../test/test_run3dq_r22_esd.sh               |  2 +-
 .../test/test_run3dq_r22_esd_cosmics.sh       |  2 +-
 .../test/test_run3dq_r22_recotf.sh            |  2 +-
 .../test/test_run3dq_r22_recotf_rawtoall.sh   |  2 +-
 .../test_run3dq_r22_recotf_rawtoall_mt_t2.sh  |  2 +-
 10 files changed, 33 insertions(+), 36 deletions(-)
 create mode 100755 Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_aodslim.sh
 delete mode 100755 Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_serial.sh

diff --git a/Control/AthenaMonitoring/test/test_run3dq_r21_esd_serial.sh b/Control/AthenaMonitoring/test/test_run3dq_r21_esd_serial.sh
index 14d2758a5ab5..89d6fafa6722 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r21_esd_serial.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r21_esd_serial.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# art-description: ESD->HIST, R21 data ESD
+# art-description: ESD->HIST, R21 data ESD, Serial
 # art-type: grid
 # art-memory: 4096
 # art-include: master/Athena
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_aod.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_aod.sh
index 7e283d9eb02d..65bddb45019e 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r22_aod.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r22_aod.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# art-description: AOD->HIST, R22 data AOD
+# art-description: AOD->HIST, R22 Run 2 data AOD
 # art-type: grid
 # art-include: master/Athena
 # art-include: 22.0-mc20/Athena
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger.sh
index 754e8d30b662..7f82b16a11d6 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger.sh
@@ -7,8 +7,8 @@
 # art-output: ExampleMonitorOutput.root
 # art-output: log*
 
-art.py download TrigAnalysisTest test_trigAna_RDOtoAOD_v1Dev_grid.py
-AODFILE=(./ref-*/AOD.pool.root)
+art.py download Tier0ChainTests test_q221_mt1.sh 
+AODFILE=(./ref-*/myAOD.pool.root)
 Run3DQTestingDriver.py --inputFiles=${AODFILE} DQ.Steering.doHLTMon=True DQ.Environment=AOD --threads=1 --dqOffByDefault > log.HIST_Creation 2>&1
 
 echo "art-result: $? HIST_Creation"
@@ -19,8 +19,4 @@ ArtJobName=$2
 art.py download ${ArtPackage} ${ArtJobName}
 REFFILE=(./ref-*/ExampleMonitorOutput.root)
 hist_diff.sh ExampleMonitorOutput.root $REFFILE -i > log.HIST_Diff 2>&1
-echo "art-result: $? HIST_Diff"
-
-art.py download AthenaMonitoring test_run3dq_r22_aod_trigger.sh
-hist_diff.sh ExampleMonitorOutput.root $REFFILE -i > log.HIST_Diff_Serial 2>&1
-echo "art-result: $? HIST_Diff_Serial"
+echo "art-result: $? HIST_Diff"
\ No newline at end of file
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_aodslim.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_aodslim.sh
new file mode 100755
index 000000000000..b127adbcf213
--- /dev/null
+++ b/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_aodslim.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# art-description: AOD->HIST, R22 MC, Trigger Only, AODSLIM content
+# art-type: grid
+# art-memory: 3072
+# art-include: master/Athena
+# art-include: 22.0-mc20/Athena
+# art-output: ExampleMonitorOutput.root
+# art-output: log*
+
+Reco_tf.py --AMI=q221 --athenaopts='--threads=1' --preExec 'from TriggerJobOpts.TriggerFlags import TriggerFlags; TriggerFlags.AODEDMSet="AODSLIM"' --outputAODFile=myAOD.pool.root --imf False
+echo "art-result: $? AOD_Creation"
+
+Run3DQTestingDriver.py --inputFiles=myAOD.pool.root DQ.Steering.doHLTMon=True DQ.Environment=AOD --threads=1 --dqOffByDefault > log.HIST_Creation 2>&1
+echo "art-result: $? HIST_Creation"
+
+rm -rf ref-*
+
+ArtPackage=$1
+ArtJobName=$2
+art.py download ${ArtPackage} ${ArtJobName}
+REFFILE=(./ref-*/ExampleMonitorOutput.root)
+hist_diff.sh ExampleMonitorOutput.root $REFFILE -i > log.HIST_Diff 2>&1
+echo "art-result: $? HIST_Diff"
\ No newline at end of file
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_serial.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_serial.sh
deleted file mode 100755
index 9ec8123d5b52..000000000000
--- a/Control/AthenaMonitoring/test/test_run3dq_r22_aod_trigger_serial.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-# art-description: AOD->HIST, R22 MC, Trigger Only
-# art-type: grid
-# art-memory: 3072
-# art-include: master/Athena
-# art-include: 22.0-mc20/Athena
-# art-output: ExampleMonitorOutput.root
-# art-output: log*
-
-art.py download TrigAnalysisTest test_trigAna_RDOtoAOD_v1Dev_grid.py
-AODFILE=(./ref-*/AOD.pool.root)
-Run3DQTestingDriver.py --inputFiles=${AODFILE} DQ.Steering.doHLTMon=True DQ.Environment=AOD --dqOffByDefault > log.HIST_Creation 2>&1
-
-echo "art-result: $? HIST_Creation"
-rm -rf ref-*
-
-ArtPackage=$1
-ArtJobName=$2
-art.py download ${ArtPackage} ${ArtJobName}
-REFFILE=(./ref-*/ExampleMonitorOutput.root)
-hist_diff.sh ExampleMonitorOutput.root $REFFILE -i > log.HIST_Diff 2>&1
-echo "art-result: $? HIST_Diff"
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh
index cff1471d445b..77b096aa8378 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# art-description: ESD->HIST, R22 data ESD
+# art-description: ESD->HIST, R22 Run 2 data ESD
 # art-type: grid
 # art-memory: 4096
 # art-include: master/Athena
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_esd_cosmics.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_esd_cosmics.sh
index bd5c2f0ae1ae..b1a6bc7db462 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r22_esd_cosmics.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r22_esd_cosmics.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# art-description: ESD->HIST, R22 cosmics data ESD
+# art-description: ESD->HIST, R22 Run 2 cosmics data ESD
 # art-type: grid
 # art-memory: 3072
 # art-include: master/Athena
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_recotf.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_recotf.sh
index 1e368a8e7ded..85bceab563c1 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r22_recotf.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r22_recotf.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# art-description: new DQ in Reco_tf, two-step, data q431
+# art-description: new DQ in Reco_tf, two-step, Run 2 data q431
 # art-type: grid
 # art-memory: 6144
 # art-include: master/Athena
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_recotf_rawtoall.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_recotf_rawtoall.sh
index 8d2718fd099e..b82f56b3aa2b 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r22_recotf_rawtoall.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r22_recotf_rawtoall.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# art-description: new DQ in Reco_tf, RAWtoALL, data q431
+# art-description: new DQ in Reco_tf, RAWtoALL, Run 2 data q431
 # art-type: grid
 # art-memory: 6144
 # art-include: master/Athena
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_recotf_rawtoall_mt_t2.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_recotf_rawtoall_mt_t2.sh
index fb39bd4e10c7..f6fd17d1a96e 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r22_recotf_rawtoall_mt_t2.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r22_recotf_rawtoall_mt_t2.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# art-description: new DQ in Reco_tf, RAWtoALL, data q431
+# art-description: new DQ in Reco_tf, RAWtoALL, Run 2 data q431
 # art-type: grid
 # art-memory: 6144
 # art-include: master/Athena
-- 
GitLab


From d3201907f5b98d9d566211ef97c510c3bfbb11f7 Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Mon, 13 Sep 2021 20:19:47 +0200
Subject: [PATCH 088/347] LArStripsCrossTalkCorrector: Allow to process Barrel
 and Endcap in one go

---
 .../LArStripsCrossTalkCorrector.h             |  57 +-
 .../src/LArStripsCrossTalkCorrector.cxx       | 609 ++++++++----------
 .../python/LArCalib_Delay_OFCCali.py          |   3 +-
 3 files changed, 300 insertions(+), 369 deletions(-)

diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArStripsCrossTalkCorrector.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArStripsCrossTalkCorrector.h
index 1c4eb1438c32..62e2f9b75feb 100755
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArStripsCrossTalkCorrector.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArStripsCrossTalkCorrector.h
@@ -54,20 +54,16 @@ private:
 class LArStripsCrossTalkCorrector : public AthAlgorithm
 {
  public:
-  LArStripsCrossTalkCorrector(const std::string & name, ISvcLocator * pSvcLocator);
-  ~LArStripsCrossTalkCorrector();
+  using AthAlgorithm::AthAlgorithm;
 
   //standard algorithm methods
-  StatusCode initialize();
-  StatusCode execute();
-  StatusCode finalize();
+  virtual StatusCode initialize() override final;
+  virtual StatusCode execute() override final;
+  virtual StatusCode finalize() override final;
 
 
  private:
-  StatusCode executeWithAccumulatedDigits();
-  StatusCode executeWithStandardDigits();
-
-
+  
   SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"};
   SG::ReadCondHandleKey<LArBadFebCont> m_BFKey {this, "MissingFEBKey", "LArBadFeb", "SG key for miffing FEB object"};
   SG::ReadCondHandleKey<LArOnOffIdMapping>  m_cablingKey{this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"};
@@ -82,29 +78,34 @@ class LArStripsCrossTalkCorrector : public AthAlgorithm
 
 
 
-  const LArOnlineID*  m_onlineHelper;
-  const LArEM_ID*     m_emId;
-
-  const DataHandle<ILArPedestal> m_larPedestal;
-  unsigned int        m_event_counter;
-  unsigned int        m_MAXeta, m_MINeta;
-  const unsigned int  m_MAXphi;
-  int                 m_nStrips;
+  const LArOnlineID*  m_onlineHelper{nullptr};
+  const LArEM_ID*     m_emId{nullptr};
+  unsigned int        m_event_counter=0;
+  //Ranges for eta and phi indices for barrel(0) and endcap(1)
+  const std::array<unsigned,2> m_MAXeta{448,208};
+  const std::array<unsigned,2> m_MINeta{1,0};
+  const unsigned int  m_MAXphi=64;
+  int                 m_nStrips=-1;
   //Algorithm-Properties:
-  std::vector<std::string> m_keylist;
-  unsigned int m_ADCsatur;
-  bool m_useAccumulatedDigits;
-  float m_acceptableDifference;
+  Gaudi::Property<std::vector<std::string> > m_keylist{this,"KeyList",{},"List of input keys ('HIGH','MEDIUM','LOW')"};
+  Gaudi::Property<unsigned int> m_ADCsatur {this,"ADCsaturation",0,"Cutoff value to ignore saturated digits"};
+  Gaudi::Property<float> m_acceptableDifference{this,"AcceptableDifference",20, "For sanity check: By how much the corrected value may differ from the original one (in %)"};
+
+
+  SG::ReadCondHandleKey<ILArPedestal> m_pedKey{this,"PedestalKey","Pedestal","Key of Pedestal object"};
 
-  std::string m_pedKey;
+  uint16_t m_fatalFebErrorPattern{0xffff};
 
-  uint16_t m_fatalFebErrorPattern;
+  const size_t m_noIdx{9999999};
 
-  const size_t m_noIdx;
+  //2D Eta-phi array of strip cells. A/C side is accomodated by duplicating the number of phi-bins
+  //One such array for barrel, one for endcap
+  //Idexing: Barrel/EC, eta-index, phi-index
+  std::array<std::vector < std::vector < const LArAccumulatedCalibDigit* > >,2> m_stripsLookUp;
 
-  std::vector < std::vector < const LArAccumulatedCalibDigit* > > m_stripsLookUp;
+  std::array<std::vector < std::bitset< 128 > >,2> m_knownMissingFebs;
 
-  std::vector < std::bitset< 128 > > m_knownMissingFebs;
+  bool m_missingFEBsDone=false;
 
   std::set<HWIdentifier> m_uncorrectedIds;
 
@@ -116,10 +117,10 @@ class LArStripsCrossTalkCorrector : public AthAlgorithm
  };
 
 
-  XtalkCorrHisto m_differences;
+  XtalkCorrHisto m_differences{6,0.3};
 
   std::string printMaxSample(const LArAccumulatedCalibDigit* thisDig);
-  StatusCode initKnownMissingFebs(const int bec);
+  StatusCode initKnownMissingFebs();
 
   size_t getEtaIndex(const Identifier) const;
   size_t getPhiIndex(const Identifier) const;
diff --git a/LArCalorimeter/LArCalibUtils/src/LArStripsCrossTalkCorrector.cxx b/LArCalorimeter/LArCalibUtils/src/LArStripsCrossTalkCorrector.cxx
index 257c1575cade..a91d37dbc78c 100755
--- a/LArCalorimeter/LArCalibUtils/src/LArStripsCrossTalkCorrector.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArStripsCrossTalkCorrector.cxx
@@ -12,31 +12,6 @@
 #include <math.h>
 
 
-LArStripsCrossTalkCorrector::LArStripsCrossTalkCorrector(const std::string& name, ISvcLocator* pSvcLocator) : 
-  AthAlgorithm(name, pSvcLocator),
-  m_onlineHelper(nullptr),
-  m_emId(nullptr),
-  m_event_counter(0),
-  m_MAXeta(208), 
-  m_MINeta(1),
-  m_MAXphi(64),
-  m_nStrips(-1),
-  m_fatalFebErrorPattern(0xffff),
-  m_noIdx(9999999),
-  m_differences(6,0.3) { 
-  declareProperty("KeyList",             m_keylist,
-		  "List of input keys (normally the 'HIGH','MEDIUM','LOW')"); 
-  declareProperty("ADCsaturation",       m_ADCsatur=0);
-  declareProperty("UseAccumulatedDigits",m_useAccumulatedDigits=true); 
-  declareProperty("AcceptableDifference",m_acceptableDifference=20,
-		  "For sanity check: By how much the corrected value may differ from the original one (in %)");
-  declareProperty("PedestalKey",m_pedKey="Pedestal",
-		  "Key of the pedestal object (to be subtracted)");
-   
-}
-
-LArStripsCrossTalkCorrector::~LArStripsCrossTalkCorrector()  {}
-
 StatusCode LArStripsCrossTalkCorrector::initialize() {
 
   StatusCode sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID");
@@ -58,17 +33,19 @@ StatusCode LArStripsCrossTalkCorrector::initialize() {
   ATH_CHECK(m_BCKey.initialize());
   ATH_CHECK(m_BFKey.initialize());
   ATH_CHECK(m_cablingKey.initialize());
+  ATH_CHECK(m_pedKey.initialize());
+  
+  m_acceptableDifference.value()/=100; //Convert from % to fraction
 
-  sc = detStore()->regHandle(m_larPedestal,m_pedKey);
-  if (sc!=StatusCode::SUCCESS) {
-    ATH_MSG_ERROR( "Could not register DataHandle for pedestal with key " << m_pedKey  );
-    return sc;
+  //Initialize strips lookup table:
+  for (unsigned bec : {0,1}) {
+    m_stripsLookUp[bec].resize(2*m_MAXphi); //change index to coded index
+    for (unsigned iside=0;iside<2;++iside) {
+      for (unsigned iphi=0; iphi!=m_MAXphi; ++iphi) {
+	      m_stripsLookUp[bec][iphi+iside*m_MAXphi].resize(m_MAXeta[bec],nullptr); 
+      }   
+    }
   }
-
-  m_event_counter=0;
-  m_nStrips=-1;
-  m_acceptableDifference/=100; //Convert from % to fraction
-
   return StatusCode::SUCCESS;
 }
 
@@ -84,14 +61,6 @@ StatusCode LArStripsCrossTalkCorrector::execute()
     return StatusCode::FAILURE;
   }
   
-  if (m_useAccumulatedDigits)
-    return executeWithAccumulatedDigits();
-  else
-    return executeWithStandardDigits();  
-}
-
-
-StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits()  {
 
   StatusCode sc;
   unsigned nSaturation=0;
@@ -115,10 +84,13 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits()  {
      return StatusCode::FAILURE;
   }
 
-
   SG::ReadCondHandle<LArBadChannelCont> bcHdl{m_BCKey};
   const LArBadChannelCont* bcCont{*bcHdl};
 
+  SG::ReadCondHandle<ILArPedestal> pedHdl{m_pedKey};
+  const ILArPedestal* larPedestal=*pedHdl; 
+
+
   const LArAccumulatedCalibDigitContainer* larAccumulatedCalibDigitContainer;
   
   // now start to deal with digits   
@@ -133,7 +105,7 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits()  {
     
 
     LArAccumulatedCalibDigit febErrorDummy; //Use the address of this object to mark cells belonging to a errornous FEB
-    LArAccumulatedCalibDigit inexistingDummy; //Use the address of this object for "cells" that woudl be outside of cryostat
+    LArAccumulatedCalibDigit inexistingDummy; //Use the address of this object for "cells" that would be outside of cryostat
     
     
     HWIdentifier  lastFailedFEB(0);
@@ -147,44 +119,27 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits()  {
 			 << ". Size: " << larAccumulatedCalibDigitContainer->size() );
     }
     
-    //Get barrel/ec for online Identifier of the first cell in the container
-    HWIdentifier chid=larAccumulatedCalibDigitContainer->front()->hardwareID();
-    const int have_barrel_ec=m_onlineHelper->barrel_ec(chid);
-
-    if (have_barrel_ec==1) {
-      m_MINeta = 0;
-      m_MAXeta = 208;  //Endcap
-    }
-    else {
-      m_MINeta = 1;
-      m_MAXeta = 448;  //Barrel
+    //Fill missing febs (if not done yet)
+    if (!m_missingFEBsDone) {
+      ATH_CHECK(initKnownMissingFebs());
     }
     
-    if (m_knownMissingFebs.size()!=(unsigned)m_MAXeta) {
-      sc=initKnownMissingFebs(have_barrel_ec);
-      if (sc.isFailure()) return sc;
-    }
-
-    m_stripsLookUp.resize(2*m_MAXphi); //change index to coded index
-    for (unsigned iside=0;iside<2;++iside) {
-      for (unsigned iphi=0; iphi!=m_MAXphi; ++iphi) {
-	m_stripsLookUp[iphi+iside*m_MAXphi].resize(m_MAXeta); 
-      }
-    }
-    
-    for (unsigned ieta=0;ieta!=m_MAXeta;++ieta) {  //Loop over Strips cells
-      for (unsigned iphi=0;iphi!=m_MAXphi;++iphi) {  //Loop over Strips cells	   
-        for (unsigned iside=0;iside<2;++iside) {
-	  m_stripsLookUp[iphi+iside*m_MAXphi][ieta]=0;
+      
+    //Reset strips lookup table to nullptr:
+    for (int bec : {0,1}) {
+      for (unsigned ieta=0;ieta!=m_MAXeta[bec];++ieta) {  //Loop over Strips cells
+        for (unsigned iphi=0;iphi!=m_MAXphi;++iphi) {  //Loop over Strips cells	   
+          for (unsigned iside=0;iside<2;++iside) {
+	          m_stripsLookUp[bec][iphi+iside*m_MAXphi][ieta]=nullptr;
+          }
         }
-      }
-    }    
-    
-    ATH_MSG_DEBUG( "Filling Strips lookup table..." ) ;
+      }    
+    } //end loop over barrel & EC
+    ATH_MSG_DEBUG( "Filling strips lookup table..." ) ;
     int nStrips=0;
     
     for (const LArAccumulatedCalibDigit* dig : *larAccumulatedCalibDigitContainer) {  //Loop over all cells to fill Strips lookup table
-      chid=dig->hardwareID();     
+      const HWIdentifier chid=dig->hardwareID();     
       if (!(m_onlineHelper->isEMBchannel(chid) || m_onlineHelper->isEMECchannel(chid))) continue; //Deal only with EM calos case
       if (!cabling->isOnlineConnected(chid)) continue; //ignore disconnected channels
 	  
@@ -194,30 +149,26 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits()  {
 	
       const HWIdentifier febid=m_onlineHelper->feb_Id(chid);
       if (febErrSum) {
-	const uint16_t febErrs=febErrSum->feb_error(febid);
-	if (febErrs & m_fatalFebErrorPattern) {
-	  if (febid!=lastFailedFEB) {
-	    lastFailedFEB=febid;
-	    ATH_MSG_ERROR( "Event " << m_event_counter << " Feb " <<  m_onlineHelper->channel_name(febid) 
-			    << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." );
-	  }
-	  dig=&febErrorDummy;
-	} //end if fatal feb error
+	      const uint16_t febErrs=febErrSum->feb_error(febid);
+	       if (febErrs & m_fatalFebErrorPattern) {
+	         if (febid!=lastFailedFEB) {
+	          lastFailedFEB=febid;
+	           ATH_MSG_ERROR( "Event " << m_event_counter << " Feb " <<  m_onlineHelper->channel_name(febid) 
+		          << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." );
+	        }   
+	        dig=&febErrorDummy;
+	      } //end if fatal feb error
       }//end if check feb error summary
 
 
-      if (m_onlineHelper->barrel_ec(chid) != have_barrel_ec) {
-	ATH_MSG_FATAL( "Found barrel and endcap cells in same event. This is not supported by the LArStripsCrossTalkCorrector!" );
-	return StatusCode::FAILURE;
-      }
-    
+      const int bec=m_onlineHelper->barrel_ec(chid);  
       const size_t ieta=getEtaIndex(id);
       if (ieta==m_noIdx) continue; //Not a cell we care about
       const size_t iphi=getPhiIndex(id);
-      if (iphi>=2*m_MAXphi || ieta>=m_MAXeta) {
-	ATH_MSG_FATAL( "Array index out of range: iphi=" << iphi << " (max " << m_MAXphi << "), ieta=" 
-			 << ieta << "(max " << m_MAXphi << ")" );
-	return StatusCode::FAILURE;
+      if (iphi>=2*m_MAXphi || ieta>=m_MAXeta[bec]) {
+	      ATH_MSG_FATAL( "Array index out of range: iphi=" <<  iphi << " (max " << m_MAXphi << "), ieta=" 
+			                << ieta << "(max " << m_MAXeta[bec] << ")" );
+	      return StatusCode::FAILURE;
       }
       ++nStrips;
 
@@ -225,28 +176,26 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits()  {
       //check for saturation:
       bool saturated=false;
       if (m_ADCsatur>0) {
-	const std::vector<uint32_t>& samples=dig->sampleSum();
-	const size_t& nS=samples.size();
-	const uint32_t maxValue=(uint32_t)(m_ADCsatur*dig->nTriggers());
-	for (size_t i=0;i<nS;++i) {
-	  if (samples[i] >= maxValue) {
-	    saturated=true;
-	    ATH_MSG_DEBUG("Found saturating digit (index = " << i           
-			  << ", <ADC> = " << samples[i]/dig->nTriggers()
-			  << ", DAC = " << dig->DAC()
-			  << ") for channel 0x"  << MSG::hex << chid.get_compact() << MSG::dec
-			  << ". Skipping.");
-	    break;
-	  }//end if>maxvalue
-	}//end loop over digits
-      }
-      if (saturated) {
-	++nSaturation;
-	continue; //Skip this channel
-      }
+	      const std::vector<uint32_t>& samples=dig->sampleSum();
+	      const size_t& nS=samples.size();
+	      const uint32_t maxValue=(uint32_t)(m_ADCsatur*dig->nTriggers());
+	      for (size_t i=0;i<nS;++i) {
+	        if (samples[i] >= maxValue) {
+	        saturated=true;
+	        ATH_MSG_DEBUG("Found saturating digit (index = " << i << ", <ADC> = " << samples[i]/dig->nTriggers()
+			      << ", DAC = " << dig->DAC() << ") for channel " << m_onlineHelper->channel_name(chid)
+			      << ". Skipping.");
+	        break;
+	        }//end if>maxvalue
+	      }//end loop over digits
+      }//end if m_ADCsatur>0
+    if (saturated) {
+	    ++nSaturation;
+	    continue; //Skip this channel
+    }
 
      
-      m_stripsLookUp[iphi][ieta]=dig;
+    m_stripsLookUp[bec][iphi][ieta]=dig;
 
     }//End loop over all cells
     
@@ -254,13 +203,12 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits()  {
       m_nStrips=nStrips;
     
     if (m_nStrips != nStrips) {
-      ATH_MSG_WARNING( "Number of strips changed! Have " <<  nStrips << ", had " << m_nStrips 
-			<< " before. Size of map: " << 2*m_MAXphi*(m_MAXeta-m_MINeta) );
+      ATH_MSG_WARNING( "Number of strips changed! Have " <<  nStrips << ", had " << m_nStrips << " before.");
       m_nStrips=nStrips;
     }
     else
-      ATH_MSG_DEBUG("Strips lookup table filled. Have " <<  nStrips << " out of " << 2*m_MAXphi*(1+m_MAXeta-m_MINeta) 
-		      << " channels.");
+      ATH_MSG_DEBUG("strips lookup table filled. Have " <<  nStrips << " out of " << 2*m_MAXphi*(1+m_MAXeta[0]-m_MINeta[0]) 
+		      << " barrel channels plus " << 2*m_MAXphi*(1+m_MAXeta[1]-m_MINeta[1]) << "endcap channels.");
 
 
     //Weight for the four neighbors: 
@@ -273,209 +221,200 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits()  {
     neighbours[2].dist=1;
     neighbours[3].dist=2;
 
-    for (unsigned iside=0; iside<2; iside++) {          //Loop over both sides of the detector
-      for (int ieta=0; ieta<(int)m_MAXeta; ieta++) {    // Loop over eta range
-	for (unsigned iphi=0; iphi<m_MAXphi; iphi++) {  // Loop over phi range
-	 
-	  const unsigned iphi2=iphi+m_MAXphi*iside;    //Phi index inside lookup table 
-	  const LArAccumulatedCalibDigit* currDig=m_stripsLookUp[iphi2][ieta];
-
-	  if (currDig==0 || currDig==&febErrorDummy) continue; //Digit not found or FEB in error: ignore
-
-	  if ( currDig->isPulsed() ) {
-	    chid = currDig->hardwareID();
-	    CaloGain::CaloGain t_gain = currDig->gain();
-	    if (m_dontCorrMask.cellShouldBeMasked(bcCont,chid)) {
-	      ATH_MSG_DEBUG("Strips 0x"  << MSG::hex << chid.get_compact() << MSG::dec << " (Eta = " << ieta << ", Phi = " 
-			    << iphi2 << ") should not be touched accoring to jobConfig");
-	      continue;
-	    }
-
-	    const unsigned NtotSamples = currDig->nsamples();	
-	    const unsigned NbTriggers = currDig->nTriggers();	    
-            ATH_MSG_VERBOSE("Now processing Strips 0x"  << MSG::hex << chid.get_compact() << MSG::dec
-			    << " (Eta = " << ieta << ", Phi = " << iphi2 << ")");
-
-	    //Fill the pointers and pedestal in the 'neighbours' array
-	    for (unsigned i=0;i<4;i++) {
-	      //Set all zero to start with...
-	      neighbours[i].dig=NULL;
-	      neighbours[i].ped=0.;
-	      const int neigbEtaItx=neighbours[i].dist+(int)ieta;
-	      //Check if we are supposed to have this neighbour
-	      if (neigbEtaItx<(int)m_MINeta || neigbEtaItx>=(int)m_MAXeta) {
-		ATH_MSG_DEBUG("Neighbour " << neighbours[i].dist <<" , ieta=" << neigbEtaItx 
-			      << " doesn't exist. (min="<< m_MINeta << " ,max=" << m_MAXeta <<  ")");
-		neighbours[i].dig=&inexistingDummy;
-		continue;
-	      }
-	      const LArAccumulatedCalibDigit* neighDig=m_stripsLookUp[iphi2][neigbEtaItx];
-	      //Check if neighbour is present
-	      if (!neighDig) {
-		//neighbor missing. Could be known missing FEB or new problem
-		//Reported only if at least WARNING
-		if (msgLvl(MSG::WARNING)) {
-		  if (m_knownMissingFebs[neigbEtaItx].test(iphi2)) {
-		    ATH_MSG_DEBUG("FEB missing for neighbour " << neighbours[i].dist << " to be added to Strip 0x" 
-				  << MSG::hex << chid.get_compact() << MSG::dec
-				  << " (Eta = " << ieta << ", Phi = " << iphi << ")");
-		  }
-		  else {
-		    ATH_MSG_WARNING( "Cannot find neighbour " << neighbours[i].dist << " to be added to Strip 0x" 
-				      << MSG::hex << chid.get_compact() << MSG::dec
-				      << " (Eta = " << ieta << ", Phi = " << iphi << ")" );
-		  }
-		}//end if msgLvl(INFO)
- 		continue;
- 	      }
-	      if (neighDig==&febErrorDummy) { //Pointer comparison!!
-		ATH_MSG_WARNING("Neighbour " << neighbours[i].dist << " of strip 0x" << MSG::hex << chid.get_compact() << MSG::dec
-				<< " (Eta = " << ieta << ", Phi = " << iphi <<"), has a FEB error. Ignored.");
+    for (unsigned bec : {0,1}) { //Loop over barrel and endcap
+      for (unsigned iside=0; iside<2; iside++) {          //Loop over both sides of the detector
+        for (int ieta=0; ieta<(int)m_MAXeta[bec]; ieta++) {    // Loop over eta range
+	  for (unsigned iphi=0; iphi<m_MAXphi; iphi++) {  // Loop over phi range
+	    const unsigned iphi2=iphi+m_MAXphi*iside;    //Phi index inside lookup table 
+	    const LArAccumulatedCalibDigit* currDig=m_stripsLookUp[bec][iphi2][ieta];
+	    if (currDig==0 || currDig==&febErrorDummy) continue; //Digit not found or FEB in error: ignore
+	    
+	    if ( currDig->isPulsed() ) {
+	      HWIdentifier chid = currDig->hardwareID();
+	      CaloGain::CaloGain t_gain = currDig->gain();
+	      if (m_dontCorrMask.cellShouldBeMasked(bcCont,chid)) {
+		ATH_MSG_DEBUG("Strip " << m_onlineHelper->channel_name(chid) <<" (Eta = " << ieta << ", Phi = " 
+			      << iphi2 << ") should not be touched accoring to jobConfig");
 		continue;
 	      }
 
-	      //Check if neighbour is pulsed
-	      if (neighDig->isPulsed()) {
-		ATH_MSG_WARNING( "Neighbour " << neighbours[i].dist << " of strip 0x" << MSG::hex << chid.get_compact() << MSG::dec
-				  << " (Eta = " << ieta << ", Phi = " << iphi <<", " << printMaxSample(neighDig) 
-				  << ") is pulsed. Not used for correction." );
-		continue;
-	      }
-	      //Check if neighbour is on the bad-channel list
-	      if (m_dontUseForCorrMask.cellShouldBeMasked(bcCont,neighDig->hardwareID())) {
-		ATH_MSG_DEBUG("Neighbour " << neighbours[i].dist << " of strip 0x" << MSG::hex << chid.get_compact() << MSG::dec
-			      << " (Eta = " << ieta << ", Phi = " << iphi 
-			      << ") is flagged by the LArBadChannelMaskingTool. Not used for correction.");
+	      const unsigned NtotSamples = currDig->nsamples();	
+	      const unsigned NbTriggers = currDig->nTriggers();	    
+	      ATH_MSG_VERBOSE("Now processing strip "<< m_onlineHelper->channel_name(chid) << " (Eta = " << ieta << ", Phi = " << iphi2 << ")");
+
+	      //Fill the pointers and pedestal in the 'neighbours' array
+	      for (unsigned i=0;i<4;i++) {
+		//Set all zero to start with...
+		neighbours[i].dig=NULL;
+		neighbours[i].ped=0.;
+		const int neigbEtaItx=neighbours[i].dist+(int)ieta;
+		//Check if we are supposed to have this neighbour
+		if (neigbEtaItx<(int)m_MINeta[bec] || neigbEtaItx>=(int)m_MAXeta[bec]) {
+		  ATH_MSG_DEBUG("Neighbour " << neighbours[i].dist <<" , ieta=" << neigbEtaItx 
+				<< " doesn't exist. (min="<< m_MINeta[bec] << " ,max=" << m_MAXeta[bec] <<  ")");
+		  neighbours[i].dig=&inexistingDummy;
 		  continue;
+		}
+		const LArAccumulatedCalibDigit* neighDig=m_stripsLookUp[bec][iphi2][neigbEtaItx];
+		//Check if neighbour is present
+		if (!neighDig) {
+		  //neighbor missing. Could be known missing FEB or new problem
+		  //Reported only if at least WARNING
+		  if (msgLvl(MSG::WARNING)) {
+		    if (m_knownMissingFebs[bec][neigbEtaItx].test(iphi2)) {
+		      ATH_MSG_DEBUG("FEB missing for neighbour " << neighbours[i].dist << " to be added to strip 0x" 
+				    << m_onlineHelper->channel_name(chid) << " (Eta = " << ieta << ", Phi = " << iphi << ")");
+		    }
+		    else {
+		      ATH_MSG_WARNING( "Cannot find neighbour " << neighbours[i].dist << " to be added to strip 0x" 
+				       << m_onlineHelper->channel_name(chid) << " (Eta = " << ieta << ", Phi = " << iphi << ")" );
+		    } 
+		  }//end if msgLvl(WARNING)
+		  continue;
+		}//end if !neighDIg
+		if (neighDig==&febErrorDummy) { //Pointer comparison!!
+		  ATH_MSG_WARNING("Neighbour " << neighbours[i].dist << " of strip " << m_onlineHelper->channel_name(chid)
+				  << " (Eta = " << ieta << ", Phi = " << iphi <<"), has a FEB error. Ignored.");
+		  continue;
+		}
+		
+		//Check if neighbour is pulsed
+		if (neighDig->isPulsed()) {
+		  ATH_MSG_WARNING( "Neighbour " << neighbours[i].dist << " of strip " << m_onlineHelper->channel_name(chid)
+				   << " (Eta = " << ieta << ", Phi = " << iphi <<", " << printMaxSample(neighDig) 
+				   << ") is pulsed. Not used for correction." );
+		  continue;
+		}
+		
+		//Check if neighbour is on the bad-channel list
+		if (m_dontUseForCorrMask.cellShouldBeMasked(bcCont,neighDig->hardwareID())) {
+		  ATH_MSG_DEBUG("Neighbour " << neighbours[i].dist << " of strip " << m_onlineHelper->channel_name(chid) 
+				<< " (Eta = " << ieta << ", Phi = " << iphi 
+				<< ") is flagged by the LArBadChannelMaskingTool. Not used for correction.");
+		  continue;
+		}
+
+		//Get Pedestal
+		const float pedestal = larPedestal->pedestal(neighDig->hardwareID(),t_gain);
+		if (pedestal <= (1.0+LArElecCalib::ERRORCODE)) {
+		  ATH_MSG_ERROR( "No pedestal are available for neighbour " << neighbours[i].dist << " of strip " 
+				 << m_onlineHelper->channel_name(chid) << " (Eta = " << ieta << ", Phi = " << iphi << "). Not used for correction!" );
+		  continue;
+		}
+		//All went ok, fill struct
+		neighbours[i].dig=neighDig;
+		neighbours[i].ped=pedestal;
+
+		//The weight is one, unless the neighbor-of-the-neighbor is pulsed too
+		neighbours[i].weight=1.0;	
+		//Now check if the neighbor-of-the-neighbor is pulsed to set a different weight.
+		const int nnEta=ieta+2*neighbours[i].dist;
+		if (nnEta>=(int)m_MINeta[bec] && nnEta<(int)m_MAXeta[bec]) {
+		  const LArAccumulatedCalibDigit* nnDig=m_stripsLookUp[bec][iphi2][nnEta];
+		  if (nnDig!=nullptr) {
+		    //Could be also FebErrorDummy (which will always pretentd to be not pulsed)
+		    if (nnDig->isPulsed()) {
+		      ATH_MSG_VERBOSE("Neighbour " << neighbours[i].dist << " of strip " << m_onlineHelper->channel_name(chid) 
+				      << " has another pulsed cell in the neighborhood. Setting weight to 0.5");
+		      neighbours[i].weight=0.5;
+		    }//end if isPulsed
+		  }//end if neighbor-of-neighbor not NULL
+		}//end if neighbor-of-neighbor in eta range
+	      }//End loop over four neighbours
+
+
+	      //Now loop over samples to apply xtalk correction
+	      std::vector<double> SampleSums(NtotSamples);
+	      for (std::size_t SampleIndex=0;SampleIndex<NtotSamples; ++SampleIndex ) {
+		SampleSums[SampleIndex]=(double)currDig->sampleSum()[SampleIndex];
+		ATH_MSG_VERBOSE("SampleSum " << SampleIndex << " (" << SampleSums[SampleIndex] << " ADC counts / " << NbTriggers << " Ntriggers)");
 	      }
-	      //Get Pedestal
-	      const float pedestal = m_larPedestal->pedestal(neighDig->hardwareID(),t_gain);
-	      if (pedestal <= (1.0+LArElecCalib::ERRORCODE)) {
-		ATH_MSG_ERROR( "No pedestal are available for neighbour " << neighbours[i].dist << " of Strip 0x" 
-				<< MSG::hex << chid.get_compact() << MSG::dec
-				<< " (Eta = " << ieta << ", Phi = " << iphi << "). Not used for correction!" );
-		continue;
-	      }
-	      //All went ok, fill struct
-	      neighbours[i].dig=neighDig;
-	      neighbours[i].ped=pedestal;
-
-	      //The weight is one, unless the neighbor-of-the-neighbor is pulsed too
-	      neighbours[i].weight=1.0;	
-	      //Now check if the neighbor-of-the-neighbor is pulsed to set a different weight.
-	      const int nnEta=ieta+2*neighbours[i].dist;
-	      if (nnEta>=(int)m_MINeta && nnEta<(int)m_MAXeta) {
-		const LArAccumulatedCalibDigit* nnDig=m_stripsLookUp[iphi2][nnEta];
-		if (nnDig!=0) {
-		  //Could bea also FebErrorDummy (which will always pretentd to be not pulsed)
-		  if (nnDig->isPulsed()) {
-		     ATH_MSG_VERBOSE("Neighbour " << neighbours[i].dist << " of Strip 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-				     << " has another pulsed cell in the neighborhood. Setting weight to 0.5");
-		    neighbours[i].weight=0.5;
-		  }
-		}//end if neighbor-of-neighbor not NULL
-	      }//end if neighbor-of-neighbor in eta range
-	    
-	    }//End loop over four neighbours
-
-
-	    //Now loop over samples to apply xtalk correction
-	    std::vector<double> SampleSums(NtotSamples);
-	    for (std::size_t SampleIndex=0;SampleIndex<NtotSamples; ++SampleIndex ) {
-	      SampleSums[SampleIndex]=(double)currDig->sampleSum()[SampleIndex];
-	      ATH_MSG_VERBOSE("SampleSum " << SampleIndex << " (" << SampleSums[SampleIndex] << " ADC counts / " << NbTriggers << " Ntriggers)");
-	    }
-	    //Loop over the neighbours and apply corrections
-	    for (unsigned i=0;i<4;i++) {   
-	      if (neighbours[i].dig==&inexistingDummy) { //Pointer comparision!
-		ATH_MSG_VERBOSE("Neighbour " << neighbours[i].dist << " of strip 0x" << MSG::hex << chid.get_compact() << MSG::dec
-				<< " (Eta = " << ieta << ", Phi = " << iphi << ") does not exist.");
-		//no neighbor (end of calorimeter). Do nothing
-		continue;
-	      }
+	      //Loop over the neighbours and apply corrections
+	      for (unsigned i=0;i<4;i++) {   
+		if (neighbours[i].dig==&inexistingDummy) { //Pointer comparision!
+		  ATH_MSG_VERBOSE("Neighbour " << neighbours[i].dist << " of strip " << m_onlineHelper->channel_name(chid) 
+				  << " (Eta = " << ieta << ", Phi = " << iphi << ") does not exist.");
+		  //no neighbor (end of calorimeter). Do nothing
+		  continue;
+		}
 	      
-	      if (neighbours[i].dig) { //"Normal" case
-		correctSamples(SampleSums,neighbours[i]);
-		ATH_MSG_VERBOSE("Neighbour " << neighbours[i].dist << " of strip 0x" << MSG::hex << chid.get_compact() << MSG::dec
-			       << " (Eta = " << ieta << ", Phi = " << iphi << ") is used for correction");
-	      } //end if have pointer to neighbor cell
-	      else { //Neighbor not usable for some reason, try mirrored neighbor
-		const int j = 3-i; //get mirrored neighbor
-		ATH_MSG_INFO( "Neighbour " << neighbours[i].dist << " of channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-			       << " cannot be used. Taking mirrored neighbour " << neighbours[j].dist << " instead." );
-		if (neighbours[j].dig!=0 && neighbours[j].dig!=&inexistingDummy){
-		  correctSamples(SampleSums,neighbours[j]);
-		  ATH_MSG_VERBOSE("Mirrored neighbour " << neighbours[j].dist << " of strip 0x" << MSG::hex << chid.get_compact() << MSG::dec
+		if (neighbours[i].dig) { //"Normal" case
+		  correctSamples(SampleSums,neighbours[i]);
+		  ATH_MSG_VERBOSE("Neighbour " << neighbours[i].dist << " of strip " << m_onlineHelper->channel_name(chid) 
 				  << " (Eta = " << ieta << ", Phi = " << iphi << ") is used for correction");
-		}//end if neighbours[j].dig
-		else {
-		  ATH_MSG_WARNING( "Mirrored Neighbour " << neighbours[j].dist << " of channel 0x" << MSG::hex << chid.get_compact() << MSG::dec 
-				    << " cannot be used too. No correction applied" );
-		}
-	      }//end if no neighboring cell
-	    }//end loop over the four neighbors
+		} //end if have pointer to neighbor cell
+		else { //Neighbor not usable for some reason, try mirrored neighbor
+		  const int j = 3-i; //get mirrored neighbor
+		  ATH_MSG_INFO( "Neighbour " << neighbours[i].dist << " of strip " << m_onlineHelper->channel_name(chid) 
+				<< " cannot be used. Taking mirrored neighbour " << neighbours[j].dist << " instead." );
+		  if (neighbours[j].dig!=0 && neighbours[j].dig!=&inexistingDummy){
+		    correctSamples(SampleSums,neighbours[j]);
+		    ATH_MSG_VERBOSE("Mirrored neighbour " << neighbours[j].dist << " of strip " << m_onlineHelper->channel_name(chid) 
+				    << " (Eta = " << ieta << ", Phi = " << iphi << ") is used for correction");
+		  }//end if neighbours[j].dig
+		  else {
+		    ATH_MSG_WARNING( "Mirrored Neighbour " << neighbours[j].dist << " of strip " << m_onlineHelper->channel_name(chid) 
+				     << " cannot be used too. No correction applied" );
+		  } 
+		}//end if no neighboring cell
+	      }//end loop over the four neighbors
 	    
 	    
-	    std::vector<uint32_t> SampleSumInt(NtotSamples);
-	    bool unresonable=false;
-	    std::size_t iPeak=std::max_element(currDig->sampleSum().begin(),currDig->sampleSum().end())-currDig->sampleSum().begin();
-	    for (std::size_t SampleIndex=0;SampleIndex<NtotSamples; ++SampleIndex ) {
-	      const double& thisSampleSum=SampleSums[SampleIndex];
-	      const uint32_t& oldVal=currDig->sampleSum()[SampleIndex];
-	      if (thisSampleSum<0) {
-		unresonable=true;
-		ATH_MSG_WARNING( "Channel 0x"  << MSG::hex << chid.get_compact() << MSG::dec
+	      std::vector<uint32_t> SampleSumInt(NtotSamples);
+	      bool unresonable=false;
+	      std::size_t iPeak=std::max_element(currDig->sampleSum().begin(),currDig->sampleSum().end())-currDig->sampleSum().begin();
+	      for (std::size_t SampleIndex=0;SampleIndex<NtotSamples; ++SampleIndex ) {
+		const double& thisSampleSum=SampleSums[SampleIndex];
+		const uint32_t& oldVal=currDig->sampleSum()[SampleIndex];
+		if (thisSampleSum<0) {
+		  unresonable=true;
+		  ATH_MSG_WARNING("Strip " << m_onlineHelper->channel_name(chid) 
 				  << " (Eta = " << ieta << ", Phi = " << iphi << ") Resulting ADC sample " << SampleIndex <<" negative! " 
 				  << thisSampleSum << " instead of " << oldVal << " Not corrected." );
-                break;
-	      }
-
-	      if (SampleIndex==iPeak) { //check value of correction at peak
-		const float dev=(thisSampleSum-oldVal)/oldVal;
-		m_differences.add(currDig,dev);
-		if (fabs(dev)>m_acceptableDifference) {
-		  unresonable=true;
-		  ATH_MSG_WARNING("Channel 0x"  << MSG::hex << chid.get_compact() << MSG::dec
-				  << " (Eta = " << ieta << ", Phi = " << iphi
-				  << ") DAC=" << currDig->DAC() << ":  Resulting ADC sample " << SampleIndex <<" looks unreasonable: " 
-				  << thisSampleSum << " instead of " << oldVal << " (off by " << dev*100 << "%)" 
-				  << " (=" << thisSampleSum/NbTriggers << " -> " << oldVal/NbTriggers <<", ped=" 
-				  << m_larPedestal->pedestal(chid,t_gain)
-				  << " Not Corrected.");
 		  break;
-		}//end if dev>m_acceptableDifference
-	      } // end if at peak sample
-	      SampleSumInt[SampleIndex] = (uint32_t)(thisSampleSum);
-	    }//End loop over samples
+		}
+
+		if (SampleIndex==iPeak) { //check value of correction at peak
+		  const float dev=(thisSampleSum-oldVal)/oldVal;
+		  m_differences.add(currDig,dev);
+		  if (fabs(dev)>m_acceptableDifference) {
+		    unresonable=true;
+		    ATH_MSG_WARNING("Strip " << m_onlineHelper->channel_name(chid) << " (Eta = " << ieta << ", Phi = " << iphi
+				    << ") DAC=" << currDig->DAC() << ":  Resulting ADC sample " << SampleIndex <<" looks unreasonable: " 
+				    << thisSampleSum << " instead of " << oldVal << " (off by " << dev*100 << "%)" 
+				    << " (=" << thisSampleSum/NbTriggers << " -> " << oldVal/NbTriggers <<", ped=" 
+				    << larPedestal->pedestal(chid,t_gain)
+				    << " Not Corrected.");
+		    break;
+		  }//end if dev>m_acceptableDifference
+		} // end if at peak sample
+		SampleSumInt[SampleIndex] = (uint32_t)(thisSampleSum);
+	      }//End loop over samples
 	 
-	    if (unresonable) {
-	      m_uncorrectedIds.insert(chid);
-	      ATH_MSG_DEBUG("Correction for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec << " failed");
-	    }
-	    else {
-	      ATH_MSG_VERBOSE("Correction for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec << " DAC="<<currDig->DAC() << " succeeded " 
-			      << currDig->sampleSum()[2] << "->" << SampleSumInt[2]);
-              // FIXME: const_cast, modifying object in SG.
-	      const_cast<LArAccumulatedCalibDigit*>(currDig)->setSampleSum(SampleSumInt);
-	    }
-
-	  }// end if-pulsed 
-	}//end loop over phi
-      }//end loop over eta
-    }//End loop over sides   
+	      if (unresonable) {
+		m_uncorrectedIds.insert(chid);
+		ATH_MSG_DEBUG("Correction for channel " << m_onlineHelper->channel_name(chid) << " failed");
+	      }
+	      else {
+		ATH_MSG_VERBOSE("Correction for channel " << m_onlineHelper->channel_name(chid) << " DAC="<<currDig->DAC() << " succeeded " 
+				<< currDig->sampleSum()[2] << "->" << SampleSumInt[2]);
+		// FIXME: const_cast, modifying object in SG.
+		const_cast<LArAccumulatedCalibDigit*>(currDig)->setSampleSum(SampleSumInt);
+	      }      
+	    }// end if-pulsed 
+	  }//end loop over phi
+	}//end loop over eta
+      }//End loop over sides
+    }//End loop over barrel-EC   
   } //End loop over all containers    
 
-  if (nSaturation) 
+  if (nSaturation) {
     ATH_MSG_INFO( "Found " << nSaturation << " saturating digits in this event." );
-  
+  }
   return StatusCode::SUCCESS;
 }
 
-
-StatusCode LArStripsCrossTalkCorrector::executeWithStandardDigits() {
-  ATH_MSG_FATAL( "Xtalk correction wiht non-accumulated digits not supported any more." );
-  return StatusCode::FAILURE;
-}
+  
 
 StatusCode LArStripsCrossTalkCorrector::finalize() { 
   if (msgLvl(MSG::WARNING) && m_uncorrectedIds.size()>0 ) {
@@ -509,10 +448,13 @@ std::string  LArStripsCrossTalkCorrector::printMaxSample(const LArAccumulatedCal
 }
 
 
-StatusCode LArStripsCrossTalkCorrector::initKnownMissingFebs(const int bec) {
-  unsigned nMissing=0;
-  m_knownMissingFebs.clear();
-  m_knownMissingFebs.resize(m_MAXeta);
+StatusCode LArStripsCrossTalkCorrector::initKnownMissingFebs() {
+unsigned nMissing=0;  
+
+  for (unsigned bec : {0,1}) {    
+    m_knownMissingFebs[bec].clear();
+    m_knownMissingFebs[bec].resize(m_MAXeta[bec]);
+  }
   
   //const std::vector<HWIdentifier> mf=m_badChannelTool->missingFEBs();
   SG::ReadCondHandle<LArBadFebCont> bfHdl{m_BFKey};
@@ -533,6 +475,7 @@ StatusCode LArStripsCrossTalkCorrector::initKnownMissingFebs(const int bec) {
       const HWIdentifier hid=HWIdentifier(entry.first);
       mf.emplace_back(LArBadChannelDBTools::BadFebEntry(hid,entry.second));
   } 
+
   //ATH_MSG_DEBUG( "Got " << mf.size() << " missing FEBs" );
   LArBadChannelDBTools::BadFebVec::const_iterator it=mf.begin();
   LArBadChannelDBTools::BadFebVec::const_iterator it_e=mf.end();
@@ -540,47 +483,33 @@ StatusCode LArStripsCrossTalkCorrector::initKnownMissingFebs(const int bec) {
     const HWIdentifier& fid=it->first;
     const LArBadFeb& bf=it->second;
     if (bf.deadAll() || bf.deadReadout() || bf.deactivatedInOKS()) {
-      if ((bec==0 && m_onlineHelper->isEMBchannel(fid)) ||
-	  (bec==1 && m_onlineHelper->isEMECchannel(fid))) {
-	ATH_MSG_DEBUG( "Feb  " << MSG::hex << fid.get_compact() << MSG::dec << " reported as missing" );
-	const int nChan=m_onlineHelper->channelInSlotMax(fid);
-	for (int c=0;c<nChan;++c) {
-	  const HWIdentifier chid=m_onlineHelper->channel_Id(fid,c);
-	  const Identifier id=cabling->cnvToIdentifier(chid);
-	  const size_t ieta=getEtaIndex(id);
-	  if (ieta==m_noIdx) continue; //Not a cell we care about
-	  const size_t iphi=getPhiIndex(id);
-	  if (iphi>=2*m_MAXphi || ieta>=m_MAXeta) {
-	    ATH_MSG_FATAL( "Array index out of range: iphi=" << iphi << " (max " << m_MAXphi << "), ieta=" 
-			    << ieta << "(max " << m_MAXphi << ")" );
-	    return StatusCode::FAILURE;
-	  }
-	  m_knownMissingFebs[ieta].set(iphi);
-	  ++nMissing;
-	}//end loop over channels of one feb
+      if (m_onlineHelper->isEMBchannel(fid) || m_onlineHelper->isEMECchannel(fid)) {
+	      ATH_MSG_DEBUG( "Feb  " << MSG::hex << fid.get_compact() << MSG::dec << " reported as missing" );
+	      const int nChan=m_onlineHelper->channelInSlotMax(fid);
+        const unsigned bec=m_onlineHelper->barrel_ec(fid);
+	      for (int c=0;c<nChan;++c) {
+	        const HWIdentifier chid=m_onlineHelper->channel_Id(fid,c);
+	        const Identifier id=cabling->cnvToIdentifier(chid);
+	        const size_t ieta=getEtaIndex(id);
+	        if (ieta==m_noIdx) continue; //Not a cell we care about
+	        const size_t iphi=getPhiIndex(id);
+	        if (iphi>=2*m_MAXphi || ieta>=m_MAXeta[bec]) {
+	          ATH_MSG_FATAL( "Array index out of range: iphi=" << iphi << " (max " << m_MAXphi << "), ieta=" 
+			        << ieta << "(max " << m_MAXeta[bec] << ")" );
+	          return StatusCode::FAILURE;
+	        }
+	        m_knownMissingFebs[bec][ieta].set(iphi);
+	        ++nMissing;
+	      }//end loop over channels of one feb
       }//end if is barrel/endcap & EM
     }//end if is dead
   }//end loop over problematic febs
-  ATH_MSG_INFO( "Number of known missing Strip cells: "<< nMissing );
+  ATH_MSG_INFO( "Number of known missing strip cells: "<< nMissing );
+  m_missingFEBsDone=true;
   return StatusCode::SUCCESS;
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 XtalkCorrHisto::XtalkCorrHisto(const unsigned nBins, const float upperLimit) :
   m_nBins(nBins),
   m_binwidth(upperLimit/nBins),
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
index 89a7238fa0a0..279a3ac992d3 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
@@ -28,7 +28,7 @@ def LArDelay_OFCCaliCfg(flags):
 
 
     from IOVDbSvc.IOVDbSvcConfig import addFolders
-    result.merge(addFolders(flags,flags.LArCalib.Pedestal.Folder,detDb=flags.LArCalib.Input.Database, tag=pedestalTag))
+    result.merge(addFolders(flags,flags.LArCalib.Pedestal.Folder,detDb=flags.LArCalib.Input.Database, tag=pedestalTag, className="LArPedestalComplete"))
     result.merge(addFolders(flags,flags.LArCalib.AutoCorr.Folder,detDb=flags.LArCalib.Input.Database, tag=acTag))
     
 
@@ -161,3 +161,4 @@ if __name__ == "__main__":
     cfg.merge(LArDelay_OFCCaliCfg(ConfigFlags))
     print("Start running...")
     cfg.run()
+
-- 
GitLab


From 3b08a9634a3c438ad993a9fc6c455c6daed75dcd Mon Sep 17 00:00:00 2001
From: Douglas Michael Schaefer <schaed@uchicago.edu>
Date: Mon, 13 Sep 2021 20:28:09 +0200
Subject: [PATCH 089/347] Write clusters for the FCS_NTUP

---
 .../CMakeLists.txt                            |  5 +-
 .../ISF_HitAnalysis.h                         |  8 ++
 .../Root/LinkDef.h                            |  1 +
 .../python/fcsTrfArgs.py                      |  3 +
 .../share/ISF_ntuple_core.py                  |  1 +
 .../share/skeleton.ESDtoNTUP_FCS.py           |  6 ++
 .../src/ISF_HitAnalysis.cxx                   | 81 ++++++++++++++++++-
 7 files changed, 98 insertions(+), 7 deletions(-)

diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/CMakeLists.txt b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/CMakeLists.txt
index 75734daf6996..f46547960606 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/CMakeLists.txt
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/CMakeLists.txt
@@ -30,13 +30,13 @@ atlas_add_library( ISF_FastCaloSimParametrizationLib
                    INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
                    PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS}
                    LINK_LIBRARIES ${CLHEP_LIBRARIES} ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel AtlasHepMCLib BarcodeEventLib CaloDetDescrLib CaloInterfaceLib GaudiKernel ISF_FastCaloSimEvent ISF_InterfacesLib LArElecCalib LArReadoutGeometry StoreGateLib TrkEventPrimitives TrkExInterfaces TrkParameters
-                   PRIVATE_LINK_LIBRARIES CaloGeoHelpers )
+                   PRIVATE_LINK_LIBRARIES CaloGeoHelpers xAODCaloEvent )
 
 atlas_add_component( ISF_FastCaloSimParametrization
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} ${GEANT4_LIBRARIES} ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaPoolUtilities AtlasHepMCLib CaloDetDescrLib CaloEvent CaloGeoHelpers CaloIdentifier EventInfo GaudiKernel GeneratorObjects GeoAdaptors GeoModelInterfaces GeoPrimitives ISF_Event ISF_FastCaloSimEvent ISF_FastCaloSimInterfaces ISF_FastCaloSimParametrizationLib ISF_InterfacesLib LArSimEvent NavFourMom StoreGateLib TileConditionsLib TileDetDescr TileSimEvent TrackRecordLib TrkExInterfaces TrkGeometry TrkMaterialOnTrack TrkParameters TrkSurfaces )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} ${GEANT4_LIBRARIES} ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaPoolUtilities AtlasHepMCLib CaloDetDescrLib CaloEvent CaloGeoHelpers CaloIdentifier EventInfo GaudiKernel GeneratorObjects GeoAdaptors GeoModelInterfaces GeoPrimitives ISF_Event ISF_FastCaloSimEvent ISF_FastCaloSimInterfaces ISF_FastCaloSimParametrizationLib ISF_InterfacesLib LArSimEvent NavFourMom StoreGateLib TileConditionsLib TileDetDescr TileSimEvent TrackRecordLib TrkExInterfaces TrkGeometry TrkMaterialOnTrack TrkParameters TrkSurfaces xAODCaloEvent )
 
 # Code in this file makes heavy use of eigen and runs orders of magnitude
 # more slowly without optimization.  So force this to be optimized even
@@ -51,7 +51,6 @@ if ( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" )
      COMPILE_DEFINITIONS "FLATTEN" )
 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/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/ISF_FastCaloSimParametrization/ISF_HitAnalysis.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/ISF_FastCaloSimParametrization/ISF_HitAnalysis.h
index 8b3a212ba61c..30a998e34491 100755
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/ISF_FastCaloSimParametrization/ISF_HitAnalysis.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/ISF_FastCaloSimParametrization/ISF_HitAnalysis.h
@@ -118,6 +118,13 @@ class ISF_HitAnalysis : public AthAlgorithm {
    std::vector<int>*   m_truth_barcode;
    std::vector<int>*   m_truth_vtxbarcode; //production vertex barcode
 
+   std::vector<float>* m_cluster_energy;
+   std::vector<float>* m_cluster_eta;
+   std::vector<float>* m_cluster_phi;
+   std::vector<unsigned>* m_cluster_size;
+   std::vector<std::vector<Long64_t >>* m_cluster_cellID;
+      
+
    std::vector<Long64_t>* m_cell_identifier;
    std::vector<float>*       m_cell_energy;
    std::vector<int>*         m_cell_sampling;
@@ -264,6 +271,7 @@ class ISF_HitAnalysis : public AthAlgorithm {
    double m_calomargin;
    bool m_saveAllBranches;
    bool m_doAllCells;
+   bool m_doClusterInfo;
    bool m_doLayers;
    bool m_doLayerSums;
    bool m_doG4Hits;
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/Root/LinkDef.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/Root/LinkDef.h
index ecefea902167..5edfb24e7bd1 100755
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/Root/LinkDef.h
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/Root/LinkDef.h
@@ -17,6 +17,7 @@
 #pragma link C++ struct FCS_matchedcellvector+;
 #pragma link C++ class std::vector<Float_t>+;
 #pragma link C++ class std::vector<std::vector<float> >+;
+#pragma link C++ class std::vector<std::vector<Long64_t> >+;
 #ifndef CaloGeometryFromFile_h
 #pragma link C++ class CaloGeometryLookup;
 #pragma link C++ class CaloGeometry;
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/python/fcsTrfArgs.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/python/fcsTrfArgs.py
index 88d243aabfb6..4c7f8a1a50a8 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/python/fcsTrfArgs.py
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/python/fcsTrfArgs.py
@@ -26,3 +26,6 @@ def addFCS_NtupArgs(parser):
     parser.add_argument('--NTruthParticles',
                         type=argFactory(argInt),
                         help='Option to select number of truth particles copied to ntuples', group='FCS_Ntup_tf')
+    parser.add_argument('--doClusterInfo',
+                        type=argFactory(argBool),
+                        help='Flag to turn on extra branches for clusters', group='FCS_Ntup_tf')
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_ntuple_core.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_ntuple_core.py
index 7c21248a6021..d0a846616ef3 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_ntuple_core.py
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_ntuple_core.py
@@ -47,6 +47,7 @@ ISF_HitAnalysis.DoAllCells = False
 ISF_HitAnalysis.DoLayers = True
 ISF_HitAnalysis.DoLayerSums = True
 ISF_HitAnalysis.DoG4Hits = doG4Hits
+ISF_HitAnalysis.DoClusterInfo = doClusterInfo
 ISF_HitAnalysis.TimingCut = 999999
 ISF_HitAnalysis.OutputLevel = ERROR
 
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/skeleton.ESDtoNTUP_FCS.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/skeleton.ESDtoNTUP_FCS.py
index 1bd9e55073d8..0f38dd84a893 100644
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/skeleton.ESDtoNTUP_FCS.py
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/skeleton.ESDtoNTUP_FCS.py
@@ -53,6 +53,12 @@ if hasattr(runArgs,"doG4Hits"):
 else:
     doG4Hits = False
 
+## Flag for doClusterInfo
+if hasattr(runArgs,"doClusterInfo"):
+    doClusterInfo = runArgs.doClusterInfo
+else:
+    doClusterInfo = False
+
 ## Flag for saveAllBranches
 if hasattr(runArgs, "saveAllBranches"):
     saveAllBranches = runArgs.saveAllBranches
diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx
index 42882f7170e6..de2fd53fc82e 100755
--- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx
+++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/ISF_HitAnalysis.cxx
@@ -31,6 +31,9 @@
 
 //CaloCell
 #include "CaloEvent/CaloCellContainer.h"
+#include "CaloEvent/CaloClusterCellLinkContainer.h"
+#include "xAODCaloEvent/CaloClusterContainer.h"
+#include "xAODCaloEvent/CaloCluster.h"
 
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/IToolSvc.h"
@@ -102,6 +105,11 @@ ISF_HitAnalysis::ISF_HitAnalysis(const std::string& name, ISvcLocator* pSvcLocat
    , m_truth_pdg(0)
    , m_truth_barcode(0)
    , m_truth_vtxbarcode(0)
+   , m_cluster_energy(0)
+   , m_cluster_eta(0)
+   , m_cluster_phi(0)
+   , m_cluster_size(0)
+   , m_cluster_cellID(0)
    , m_cell_identifier(0)
    , m_cell_energy(0)
    , m_cell_sampling(0)
@@ -213,6 +221,7 @@ ISF_HitAnalysis::ISF_HitAnalysis(const std::string& name, ISvcLocator* pSvcLocat
 
   declareProperty("SaveAllBranches", m_saveAllBranches = false);
   declareProperty("DoAllCells", m_doAllCells = false);
+  declareProperty("DoClusterInfo", m_doClusterInfo = false);
   declareProperty("DoLayers", m_doLayers = true);
   declareProperty("DoLayerSums", m_doLayerSums = true);
   declareProperty("DoG4Hits", m_doG4Hits = false);
@@ -479,6 +488,18 @@ StatusCode ISF_HitAnalysis::initialize()
       return StatusCode::FAILURE;
     }
 
+  if(m_doClusterInfo){
+    m_tree->Branch("ClusterE",               &m_cluster_energy);
+    m_tree->Branch("ClusterEta",             &m_cluster_eta);
+    m_tree->Branch("ClusterPhi",             &m_cluster_phi);
+    m_tree->Branch("ClusterSize",            &m_cluster_size);
+    m_tree->Branch("ClusterCellID",          &m_cluster_cellID);
+  }
+  m_oneeventcells = new FCS_matchedcellvector;
+  if(m_doAllCells){
+    m_tree->Branch("AllCells", &m_oneeventcells);
+  }
+
   //#########################
   IPartPropSvc* p_PartPropSvc=0;
   if (service("PartPropSvc",p_PartPropSvc).isFailure() || p_PartPropSvc == 0)
@@ -532,6 +553,12 @@ StatusCode ISF_HitAnalysis::initialize()
       m_truth_barcode = new std::vector<int>;
       m_truth_vtxbarcode = new std::vector<int>;
 
+      m_cluster_energy = new std::vector<float>;
+      m_cluster_eta    = new std::vector<float>;
+      m_cluster_phi    = new std::vector<float>;
+      m_cluster_size   = new std::vector<unsigned>;
+      m_cluster_cellID = new std::vector<std::vector<Long64_t > >;
+
       m_cell_identifier = new std::vector<Long64_t>;
       m_cell_energy = new std::vector<float>;
       m_cell_sampling = new std::vector<int>;
@@ -820,6 +847,11 @@ StatusCode ISF_HitAnalysis::execute()
  m_truth_pdg->clear();
  m_truth_barcode->clear();
  m_truth_vtxbarcode->clear();
+ m_cluster_energy->clear();
+ m_cluster_eta->clear();
+ m_cluster_phi->clear();
+ m_cluster_size->clear();
+ m_cluster_cellID->clear();
  m_cell_identifier->clear();
  m_cell_energy->clear();
  m_cell_sampling->clear();
@@ -917,7 +949,7 @@ StatusCode ISF_HitAnalysis::execute()
        sampling = layer; //use CaloCell layer immediately
      } else {
        ATH_MSG_WARNING( "Warning no sampling info for "<<id.getString());
-     } 
+     }
 
      if(m_larEmID->is_lar_em(id) || m_larHecID->is_lar_hec(id) || m_larFcalID->is_lar_fcal(id)) sampfrac=fSampl->FSAMPL(id);
 
@@ -949,7 +981,7 @@ StatusCode ISF_HitAnalysis::execute()
        if(tile_sampling!= -1) sampling = tile_sampling; //m_calo_dd_man needs to be called with cell_id not pmt_id!!
      } else {
        ATH_MSG_WARNING( "This hit is somewhere. Please check!");
-     }  
+     }
 
      m_hit_identifier->push_back(id.get_compact());
      m_hit_cellidentifier->push_back(cell_id.get_compact());
@@ -1137,8 +1169,6 @@ StatusCode ISF_HitAnalysis::execute()
    } //mcEvent
  }//truth event
 
-
-
  //Retrieve and save MuonEntryLayer information 
  const TrackRecordCollection *MuonEntry = nullptr;
  sc = evtStore()->retrieve(MuonEntry, "MuonEntryLayer");
@@ -1160,6 +1190,49 @@ StatusCode ISF_HitAnalysis::execute()
   }
  }
 
+ // Get the reco clusters if available
+// retreiving cluster container
+  const DataHandle<xAOD::CaloClusterContainer > theClusters;
+  std::string clusterContainerName = "CaloCalTopoClusters";
+  sc = evtStore()->retrieve(theClusters, clusterContainerName);
+  if (sc.isFailure()) {
+    ATH_MSG_WARNING(" Couldn't get cluster container '" << clusterContainerName << "'");
+    return StatusCode::SUCCESS; 
+  }
+  xAOD::CaloClusterContainer::const_iterator itrClus = theClusters->begin();
+  xAOD::CaloClusterContainer::const_iterator itrLastClus = theClusters->end();
+  for ( ; itrClus!=itrLastClus; ++itrClus){
+    const xAOD::CaloCluster *cluster =(*itrClus);
+    m_cluster_energy->push_back(cluster->e());
+    m_cluster_eta->push_back(cluster->eta());
+    m_cluster_phi->push_back(cluster->phi());
+    ATH_MSG_VERBOSE("Cluster energy: " << cluster->e() << " cells: " << " links: " << cluster->getCellLinks());
+    //cluster->getCellLinks();
+    const CaloClusterCellLink* cellLinks = cluster->getCellLinks();
+    if (!cellLinks) {
+      ATH_MSG_DEBUG( "No cell links for this cluster"  );
+      continue;
+    }
+
+    const CaloCellContainer* cellCont=cellLinks->getCellContainer();
+    if (!cellCont) {
+      ATH_MSG_DEBUG( "DataLink to cell container is broken"  );
+      continue;
+    }
+    unsigned cellcount = 0;
+    std::vector<Long64_t> cellIDs_in_cluster;
+    xAOD::CaloCluster::const_cell_iterator cellIter =cluster->cell_begin();
+    xAOD::CaloCluster::const_cell_iterator cellIterEnd =cluster->cell_end();
+    for ( ;cellIter !=cellIterEnd;cellIter++) {
+      ++cellcount;
+      const CaloCell* cell= (*cellIter);
+      cellIDs_in_cluster.push_back(cell->ID().get_compact());
+      float EnergyCell=cell->energy(); //ID, time, phi, eta
+      ATH_MSG_DEBUG("   Cell energy: " << EnergyCell);
+    }// end of cells inside cluster loop
+    m_cluster_size->push_back(cellcount);
+    m_cluster_cellID->push_back(cellIDs_in_cluster);
+  }
 
  //Get reco cells if available
  const CaloCellContainer *cellColl = 0;
-- 
GitLab


From ac778c3dfc59bed8c9490d9356fbb359ea1c3fc4 Mon Sep 17 00:00:00 2001
From: Francesca Pastore <francesca.pastore@cern.ch>
Date: Mon, 13 Sep 2021 20:31:12 +0200
Subject: [PATCH 090/347] Cleanup of HLT-CF emulation tests (ATR-24087)

---
 .../TrigSteer/DecisionHandling/CMakeLists.txt |   9 +-
 .../share/EmuStepProcessingTest.py            |  90 ---------
 .../share/emu_step_menu_processing.ref        | 171 ------------------
 .../test/test_emu_step_menu_processing.sh     |   6 -
 .../test/test_emu_step_processing.sh          |   6 -
 .../TriggerMenuMT/CMakeLists.txt              |  25 ++-
 .../python/CFtest}/EmuStepProcessingConfig.py |  61 +++----
 .../CFtest/generateCFChains.py}               |  58 ++----
 .../test_emu_step_menu_processing_cf.sh       |   6 +
 .../scripts/test_emu_step_processing_cf.sh    |   7 +
 ...full_menu_cf.sh => test_manual_menu_cf.sh} |   3 +-
 .../share/emu_step_menu_processing_cf.ref     |  98 ++++++++++
 .../share/emu_step_processing_cf.ref}         |   0
 .../TriggerMenuMT/share/test_menu_cf.py       | 109 +++++++++++
 14 files changed, 273 insertions(+), 376 deletions(-)
 delete mode 100644 Trigger/TrigSteer/DecisionHandling/share/EmuStepProcessingTest.py
 delete mode 100644 Trigger/TrigSteer/DecisionHandling/share/emu_step_menu_processing.ref
 delete mode 100755 Trigger/TrigSteer/DecisionHandling/test/test_emu_step_menu_processing.sh
 delete mode 100755 Trigger/TrigSteer/DecisionHandling/test/test_emu_step_processing.sh
 rename Trigger/{TrigSteer/DecisionHandling/python => TriggerCommon/TriggerMenuMT/python/CFtest}/EmuStepProcessingConfig.py (92%)
 rename Trigger/TriggerCommon/TriggerMenuMT/{share/full_menu_cf.py => python/CFtest/generateCFChains.py} (90%)
 create mode 100755 Trigger/TriggerCommon/TriggerMenuMT/scripts/test_emu_step_menu_processing_cf.sh
 create mode 100755 Trigger/TriggerCommon/TriggerMenuMT/scripts/test_emu_step_processing_cf.sh
 rename Trigger/TriggerCommon/TriggerMenuMT/scripts/{test_full_menu_cf.sh => test_manual_menu_cf.sh} (74%)
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/share/emu_step_menu_processing_cf.ref
 rename Trigger/{TrigSteer/DecisionHandling/share/emu_step_processing.ref => TriggerCommon/TriggerMenuMT/share/emu_step_processing_cf.ref} (100%)
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/share/test_menu_cf.py

diff --git a/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt b/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt
index 7c7509139fe4..01d72d4b4777 100644
--- a/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt
+++ b/Trigger/TrigSteer/DecisionHandling/CMakeLists.txt
@@ -31,17 +31,10 @@ atlas_add_component( DecisionHandling
                      LINK_LIBRARIES DecisionHandlingLib AthenaKernel xAODTrigCalo AthViews xAODTracking xAODJet )
 
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
-atlas_install_joboptions( share/*.py )
+#atlas_install_joboptions( share/*.py )
 atlas_install_data( share/*.ref)
-atlas_install_scripts( test/test_emu_step_menu_processing.sh )
 
 # Tests
-foreach(test emu_step_processing emu_step_menu_processing)
-    atlas_add_test( ${test}
-        SCRIPT test/test_${test}.sh
-        LOG_SELECT_PATTERN "TrigSignatureMoni.*INFO HLT_.*|TrigSignatureMoni.*-- #[0-9]+ (Events|Features).*|TriggerSummaryStep.* chains passed:|TriggerSummaryStep.*+++ HLT_.*|TriggerSummaryStep.*+++ leg.*"
-        PRIVATE_WORKING_DIRECTORY )
-endforeach()
 
 atlas_add_test( test_ComboHypoTool
     SOURCES test/test_ComboHypoTool.cxx
diff --git a/Trigger/TrigSteer/DecisionHandling/share/EmuStepProcessingTest.py b/Trigger/TrigSteer/DecisionHandling/share/EmuStepProcessingTest.py
deleted file mode 100644
index 0f1af8b73da3..000000000000
--- a/Trigger/TrigSteer/DecisionHandling/share/EmuStepProcessingTest.py
+++ /dev/null
@@ -1,90 +0,0 @@
-###############################################################
-#
-# Job options file
-#
-# Based on AthExStoreGateExamples
-#
-#==============================================================
-
-#--------------------------------------------------------------
-# ATLAS default Application Configuration options
-#--------------------------------------------------------------
-from __future__ import print_function
-
-# input parameters:
-class opt:
-    doMenu          = False # use either menu or manual chain building
-
-
-
-from AthenaCommon.Logging import logging
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-from DecisionHandling.EmuStepProcessingConfig import generateHLTSeedingAndChainsManually, generateHLTSeedingAndChainsByMenu
-from AthenaCommon.AlgSequence import AlgSequence
-from TriggerMenuMT.HLTMenuConfig.Menu.HLTMenuJSON import generateJSON
-
-# signatures
-# steps: sequential AND of 1=Filter 2=Processing
-# chainstep=single chain step
-# global step=joint for all chains
-# filters: one SeqFilter per step, per chain
-# inputMakers: one per each first RecoAlg in a step (so one per step), one input per chain that needs that step
-
-log = logging.getLogger('EmuStepProcessingTest.py')
-log.info('Setup options:')
-defaultOptions = [a for a in dir(opt) if not a.startswith('__')]
-for option in defaultOptions:
-    if option in globals():
-        setattr(opt, option, globals()[option])
-        log.info(' %20s = %s' % (option, getattr(opt, option)))
-    else:        
-        log.info(' %20s = (Default) %s' % (option, getattr(opt, option)))
-
-from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg,HLTConfigSvcCfg
-from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-from AthenaConfiguration.ComponentAccumulator import CAtoGlobalWrapper
-from AthenaConfiguration.AllConfigFlags import ConfigFlags
-
-ConfigFlags.Trigger.triggerMenuSetup = TriggerFlags.triggerMenuSetup= 'LS2_v1'
-ConfigFlags.Trigger.generateMenuDiagnostics = True
-
-CAtoGlobalWrapper(L1ConfigSvcCfg,ConfigFlags)
-CAtoGlobalWrapper(HLTConfigSvcCfg,ConfigFlags)
-
-
-topSequence = AlgSequence()
-
-if opt.doMenu is True:
-    generateHLTSeedingAndChainsByMenu(topSequence)
-else:
-    generateHLTSeedingAndChainsManually(topSequence)
-
-generateJSON()
-
-
-
-
-from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
-from GaudiSvc.GaudiSvcConf import THistSvc
-svcMgr += THistSvc()
-if hasattr(svcMgr.THistSvc, "Output"):
-    from TriggerJobOpts.TriggerHistSvcConfig import setTHistSvcOutput
-    setTHistSvcOutput(svcMgr.THistSvc.Output)
-
-print ("EmuStepProcessing: dump top Sequence after CF/DF Tree build")
-from AthenaCommon.AlgSequence import dumpSequence
-dumpSequence( topSequence )
-
-from TriggerJobOpts.TriggerConfig import collectHypos, collectFilters, collectDecisionObjects, collectHypoDecisionObjects, triggerOutputCfg
-from AthenaCommon.CFElements import findAlgorithm,findSubSequence
-hypos = collectHypos(findSubSequence(topSequence, "HLTAllSteps"))
-filters = collectFilters(findSubSequence(topSequence, "HLTAllSteps"))
-
-nfilters = sum(len(v) for v in filters.values())
-nhypos = sum(len(v) for v in hypos.values())
-log.info( "Algorithms counting: Number of Filter algorithms: %d  -  Number of Hypo algorithms: %d", nfilters , nhypos) 
-
-#dumpMasterSequence()
-
-theApp.EvtMax = 4
-
diff --git a/Trigger/TrigSteer/DecisionHandling/share/emu_step_menu_processing.ref b/Trigger/TrigSteer/DecisionHandling/share/emu_step_menu_processing.ref
deleted file mode 100644
index 1a47a2a26ddb..000000000000
--- a/Trigger/TrigSteer/DecisionHandling/share/emu_step_menu_processing.ref
+++ /dev/null
@@ -1,171 +0,0 @@
-TriggerSummaryStep1                                    0     0   DEBUG In summary 0 chains passed:
-TriggerSummaryStep2                                    0     0   DEBUG In summary 0 chains passed:
-TriggerSummaryStep1                                    1     0   DEBUG In summary 8 chains passed:
-TriggerSummaryStep1                                    1     0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep1                                    1     0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep1                                    1     0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#1790520567
-TriggerSummaryStep1                                    1     0   DEBUG  +++ HLT_TestChain5_ev3_L1EM7 ID#2336588294
-TriggerSummaryStep1                                    1     0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
-TriggerSummaryStep1                                    1     0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#3196402061
-TriggerSummaryStep1                                    1     0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#3844733695
-TriggerSummaryStep1                                    1     0   DEBUG  +++ HLT_TestChain5_gv1_L1EM7 ID#3893303900
-TriggerSummaryStep2                                    1     0   DEBUG In summary 3 chains passed:
-TriggerSummaryStep2                                    1     0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep2                                    1     0   DEBUG  +++ HLT_TestChain5_ev3_L1EM7 ID#2336588294
-TriggerSummaryStep2                                    1     0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
-TriggerSummaryStep3                                    1     0   DEBUG In summary 2 chains passed:
-TriggerSummaryStep3                                    1     0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep3                                    1     0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
-TriggerSummaryStep1                                    2     0   DEBUG In summary 23 chains passed:
-TriggerSummaryStep1                                    2     0   DEBUG  +++ leg000_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1092141028
-TriggerSummaryStep1                                    2     0   DEBUG  +++ leg001_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1132652453
-TriggerSummaryStep1                                    2     0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#1241022881
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep1                                    2     0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#1790520567
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#1883945626
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_2TestChain6_muEmpty1_L12MU6 ID#2176116418
-TriggerSummaryStep1                                    2     0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#2261571957
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep1                                    2     0   DEBUG  +++ leg001_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#2599553377
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#2709794009
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#2748291265
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#2764921170
-TriggerSummaryStep1                                    2     0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#3060005588
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#3196402061
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain10_muv2_L1MU10 ID#3482819675
-TriggerSummaryStep1                                    2     0   DEBUG  +++ HLT_TestChain8_muv1step_L1MU6 ID#3588359947
-TriggerSummaryStep1                                    2     0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 ID#3844733695
-TriggerSummaryStep1                                    2     0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#3957881558
-TriggerSummaryStep1                                    2     0   DEBUG  +++ leg000_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#4097287954
-TriggerSummaryStep2                                    2     0   DEBUG In summary 20 chains passed:
-TriggerSummaryStep2                                    2     0   DEBUG  +++ leg000_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1092141028
-TriggerSummaryStep2                                    2     0   DEBUG  +++ leg001_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1132652453
-TriggerSummaryStep2                                    2     0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#1241022881
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#1883945626
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_2TestChain6_muEmpty1_L12MU6 ID#2176116418
-TriggerSummaryStep2                                    2     0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#2261571957
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep2                                    2     0   DEBUG  +++ leg001_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#2599553377
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#2709794009
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#2748291265
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#2764921170
-TriggerSummaryStep2                                    2     0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#3060005588
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_TestChain10_muv2_L1MU10 ID#3482819675
-TriggerSummaryStep2                                    2     0   DEBUG  +++ HLT_TestChain8_muv1step_L1MU6 ID#3588359947
-TriggerSummaryStep2                                    2     0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#3957881558
-TriggerSummaryStep2                                    2     0   DEBUG  +++ leg000_HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 ID#4097287954
-TriggerSummaryStep3                                    2     0   DEBUG In summary 13 chains passed:
-TriggerSummaryStep3                                    2     0   DEBUG  +++ leg000_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1092141028
-TriggerSummaryStep3                                    2     0   DEBUG  +++ leg001_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1132652453
-TriggerSummaryStep3                                    2     0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#1241022881
-TriggerSummaryStep3                                    2     0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep3                                    2     0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
-TriggerSummaryStep3                                    2     0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#1883945626
-TriggerSummaryStep3                                    2     0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#2261571957
-TriggerSummaryStep3                                    2     0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
-TriggerSummaryStep3                                    2     0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep3                                    2     0   DEBUG  +++ HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#2709794009
-TriggerSummaryStep3                                    2     0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#2748291265
-TriggerSummaryStep3                                    2     0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#3060005588
-TriggerSummaryStep3                                    2     0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#3957881558
-TriggerSummaryStep4                                    2     0   DEBUG In summary 5 chains passed:
-TriggerSummaryStep4                                    2     0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#1241022881
-TriggerSummaryStep4                                    2     0   DEBUG  +++ HLT_2TestChain6_muv1_L12MU6 ID#1408409992
-TriggerSummaryStep4                                    2     0   DEBUG  +++ HLT_TestChain6_muEmpty2_L1MU6 ID#2511524900
-TriggerSummaryStep4                                    2     0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#2748291265
-TriggerSummaryStep4                                    2     0   DEBUG  +++ leg001_HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#3060005588
-TriggerSummaryStep1                                    3     0   DEBUG In summary 9 chains passed:
-TriggerSummaryStep1                                    3     0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep1                                    3     0   DEBUG  +++ leg000_HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#1241022881
-TriggerSummaryStep1                                    3     0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#1883945626
-TriggerSummaryStep1                                    3     0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#2261571957
-TriggerSummaryStep1                                    3     0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep1                                    3     0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
-TriggerSummaryStep1                                    3     0   DEBUG  +++ HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 ID#2748291265
-TriggerSummaryStep1                                    3     0   DEBUG  +++ HLT_TestChain8_muv1step_L1MU6 ID#3588359947
-TriggerSummaryStep1                                    3     0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#3957881558
-TriggerSummaryStep2                                    3     0   DEBUG In summary 7 chains passed:
-TriggerSummaryStep2                                    3     0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep2                                    3     0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#1883945626
-TriggerSummaryStep2                                    3     0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#2261571957
-TriggerSummaryStep2                                    3     0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep2                                    3     0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
-TriggerSummaryStep2                                    3     0   DEBUG  +++ HLT_TestChain8_muv1step_L1MU6 ID#3588359947
-TriggerSummaryStep2                                    3     0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#3957881558
-TriggerSummaryStep3                                    3     0   DEBUG In summary 6 chains passed:
-TriggerSummaryStep3                                    3     0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep3                                    3     0   DEBUG  +++ HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#1883945626
-TriggerSummaryStep3                                    3     0   DEBUG  +++ leg001_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#2261571957
-TriggerSummaryStep3                                    3     0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TriggerSummaryStep3                                    3     0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
-TriggerSummaryStep3                                    3     0   DEBUG  +++ leg000_HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 ID#3957881558
-TriggerSummaryStep4                                    3     0   DEBUG In summary 2 chains passed:
-TriggerSummaryStep4                                    3     0   DEBUG  +++ HLT_TestChain20_muv1_L1MU10 ID#356594709
-TriggerSummaryStep4                                    3     0   DEBUG  +++ HLT_TestChain8_muv1_L1MU10 ID#2288364952
-TrigSignatureMoni                                                 INFO HLT_2TestChain4_muv1dr_L12MU6 #3176095517
-TrigSignatureMoni                                                 INFO -- #3176095517 Events         0          0          0          0          0          0          0          
-TrigSignatureMoni                                                 INFO -- #3176095517 Features                             0          0          0          0          
-TrigSignatureMoni                                                 INFO HLT_2TestChain6_muEmpty1_L12MU6 #2176116418
-TrigSignatureMoni                                                 INFO -- #2176116418 Events         1          1          -          1          -          -          1          
-TrigSignatureMoni                                                 INFO -- #2176116418 Features                             -          3          -          -          
-TrigSignatureMoni                                                 INFO HLT_2TestChain6_muv1_L12MU6 #1408409992
-TrigSignatureMoni                                                 INFO -- #1408409992 Events         2          2          1          1          1          1          1          
-TrigSignatureMoni                                                 INFO -- #1408409992 Features                             3          3          3          3          
-TrigSignatureMoni                                                 INFO HLT_3TestChain6_muv1_L12MU6 #2217088100
-TrigSignatureMoni                                                 INFO -- #2217088100 Events         0          0          0          0          0          0          0          
-TrigSignatureMoni                                                 INFO -- #2217088100 Features                             0          0          0          0          
-TrigSignatureMoni                                                 INFO HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU6 #2764921170
-TrigSignatureMoni                                                 INFO -- #2764921170 Events         1          1          -          1          -          -          1          
-TrigSignatureMoni                                                 INFO -- #2764921170 Features                             -          4          -          -          
-TrigSignatureMoni                                                 INFO HLT_TestChain10_muv2_L1MU10 #3482819675
-TrigSignatureMoni                                                 INFO -- #3482819675 Events         2          2          1          0          0          -          0          
-TrigSignatureMoni                                                 INFO -- #3482819675 Features                             1          0          0          -          
-TrigSignatureMoni                                                 INFO HLT_TestChain20_muv1_L1MU10 #356594709
-TrigSignatureMoni                                                 INFO -- #356594709 Events          1          1          1          1          1          1          1          
-TrigSignatureMoni                                                 INFO -- #356594709 Features                              1          1          1          1          
-TrigSignatureMoni                                                 INFO HLT_TestChain5_ev1_L1EM3 #1756953305
-TrigSignatureMoni                                                 INFO -- #1756953305 Events         3          3          2          2          2          -          2          
-TrigSignatureMoni                                                 INFO -- #1756953305 Features                             4          4          4          -          
-TrigSignatureMoni                                                 INFO HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 #2709794009
-TrigSignatureMoni                                                 INFO -- #2709794009 Events         1          1          1          1          1          -          1          
-TrigSignatureMoni                                                 INFO -- #2709794009 Features                             4          4          4          -          
-TrigSignatureMoni                                                 INFO HLT_TestChain5_ev2_L1EM7 #1760405581
-TrigSignatureMoni                                                 INFO -- #1760405581 Events         0          0          0          0          -          -          0          
-TrigSignatureMoni                                                 INFO -- #1760405581 Features                             0          0          -          -          
-TrigSignatureMoni                                                 INFO HLT_TestChain5_ev3_L1EM7 #2336588294
-TrigSignatureMoni                                                 INFO -- #2336588294 Events         1          1          1          1          -          -          1          
-TrigSignatureMoni                                                 INFO -- #2336588294 Features                             2          2          -          -          
-TrigSignatureMoni                                                 INFO HLT_TestChain5_gv1_L1EM7 #3893303900
-TrigSignatureMoni                                                 INFO -- #3893303900 Events         1          1          1          -          -          -          1          
-TrigSignatureMoni                                                 INFO -- #3893303900 Features                             2          -          -          -          
-TrigSignatureMoni                                                 INFO HLT_TestChain6_muEmpty2_L1MU6 #2511524900
-TrigSignatureMoni                                                 INFO -- #2511524900 Events         1          1          1          -          1          1          1          
-TrigSignatureMoni                                                 INFO -- #2511524900 Features                             3          -          3          3          
-TrigSignatureMoni                                                 INFO HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU10 #2748291265
-TrigSignatureMoni                                                 INFO -- #2748291265 Events         2          2          1          1          1          1          1          
-TrigSignatureMoni                                                 INFO -- #2748291265 Features                             4          3          3          1          
-TrigSignatureMoni                                                 INFO HLT_TestChain6_muv1_TestChain10_muv1_L12MU6 #3196402061
-TrigSignatureMoni                                                 INFO -- #3196402061 Events         2          2          1          0          0          0          0          
-TrigSignatureMoni                                                 INFO -- #3196402061 Features                             4          3          0          0          
-TrigSignatureMoni                                                 INFO HLT_TestChain6_muv1_TestChain5_ev1dr_L1EM7_MU10 #437234536
-TrigSignatureMoni                                                 INFO -- #437234536 Events          0          0          0          0          0          0          0          
-TrigSignatureMoni                                                 INFO -- #437234536 Features                              0          0          0          0          
-TrigSignatureMoni                                                 INFO HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU10 #1883945626
-TrigSignatureMoni                                                 INFO -- #1883945626 Events         2          2          2          2          2          -          2          
-TrigSignatureMoni                                                 INFO -- #1883945626 Features                             5          5          2          -          
-TrigSignatureMoni                                                 INFO HLT_TestChain8_ev1_L1EM3 #2478217953
-TrigSignatureMoni                                                 INFO -- #2478217953 Events         4          4          3          3          3          -          3          
-TrigSignatureMoni                                                 INFO -- #2478217953 Features                             4          4          4          -          
-TrigSignatureMoni                                                 INFO HLT_TestChain8_muv1_L1MU10 #2288364952
-TrigSignatureMoni                                                 INFO -- #2288364952 Events         2          2          2          1          1          1          1          
-TrigSignatureMoni                                                 INFO -- #2288364952 Features                             2          1          1          1          
-TrigSignatureMoni                                                 INFO HLT_TestChain8_muv1step_L1MU6 #3588359947
-TrigSignatureMoni                                                 INFO -- #3588359947 Events         2          2          2          -          -          -          2          
-TrigSignatureMoni                                                 INFO -- #3588359947 Features                             3          -          -          -          
diff --git a/Trigger/TrigSteer/DecisionHandling/test/test_emu_step_menu_processing.sh b/Trigger/TrigSteer/DecisionHandling/test/test_emu_step_menu_processing.sh
deleted file mode 100755
index 5a216e49330e..000000000000
--- a/Trigger/TrigSteer/DecisionHandling/test/test_emu_step_menu_processing.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-# This is a unit test of HLT Control Flow 
-athena.py -l DEBUG --imf --threads=1 -c "doMenu=True" DecisionHandling/EmuStepProcessingTest.py
-
-
diff --git a/Trigger/TrigSteer/DecisionHandling/test/test_emu_step_processing.sh b/Trigger/TrigSteer/DecisionHandling/test/test_emu_step_processing.sh
deleted file mode 100755
index c2f32beba9f8..000000000000
--- a/Trigger/TrigSteer/DecisionHandling/test/test_emu_step_processing.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-# This is a unit test of HLT Control Flow 
-athena.py -l DEBUG --imf --threads=1 -c "doMenu=False" DecisionHandling/EmuStepProcessingTest.py
-
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
index 9d6f149f18e8..9f23d537044d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
+++ b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
@@ -100,25 +100,28 @@ atlas_install_python_modules( python/*.py
                               python/L1
                               python/HLTMenuConfig
                               python/TriggerAPI
+                              python/CFtest
                               POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
 
 atlas_install_scripts( scripts/generateLVL1MenuMT.py
                        scripts/generateL1MenuRun3.py
                        scripts/trigCompareOldandNewL1Menus.py
-                       scripts/verify_menu_config.py
-                       scripts/test_full_menu_cf.py
+                       scripts/verify_menu_config.py                       
                        scripts/generateBunchGroupSetFromOldKey.py
                        scripts/trigmenu_modify_prescale_json.py
                        scripts/extract_chain_from_json.py
                        scripts/runTriggerAPIExample.py
-                       scripts/generateUnprescaledLists.py
+                       scripts/generateUnprescaledLists.py                       
                        POST_BUILD_CMD ${ATLAS_FLAKE8} )
 
 # Shell scripts without flake8 checking:
 atlas_install_scripts( scripts/generateL1MenuMT.sh
                        scripts/trigL1MenuMigrationCheck.sh
                        scripts/test_HLTmenu.sh
-		       scripts/test_slice_independence.sh )
+                       scripts/test_slice_independence.sh
+                       scripts/test_manual_menu_cf.sh
+                       scripts/test_emu_step_menu_processing_cf.sh
+                       scripts/test_emu_step_processing_cf.sh )
 
 atlas_install_joboptions( share/*.py
                           POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-ignore=F821 )
@@ -136,11 +139,14 @@ atlas_add_test( generateMenuMT
                 PROPERTIES TIMEOUT 500
                 POST_EXEC_SCRIPT nopost.sh )
 
-atlas_add_test( full_menu_cf
-                SCRIPT scripts/test_full_menu_cf.sh
-                PRIVATE_WORKING_DIRECTORY
-                PROPERTIES TIMEOUT 500
-                POST_EXEC_SCRIPT nopost.sh )
+# control flow tests
+foreach(test manual_menu_cf emu_step_processing_cf emu_step_menu_processing_cf)
+                atlas_add_test( ${test}                
+                SCRIPT scripts/test_${test}.sh
+                LOG_SELECT_PATTERN "TrigSignatureMoni.*INFO HLT_.*|TrigSignatureMoni.*-- #[0-9]+ (Events|Features).*|TriggerSummaryStep.* chains passed:|TriggerSummaryStep.*+++ HLT_.*|TriggerSummaryStep.*+++ leg.*"
+                PRIVATE_WORKING_DIRECTORY )
+endforeach()
+
 
 # Unit tests:
 atlas_add_test( ViewCFTest
@@ -163,6 +169,7 @@ atlas_add_test( RecoFragmentsPool
 #
 # Temporary copy of LVL1 XML DTD (remove this and the file once XML menu is deprecated)
 atlas_install_xmls( share/*.dtd )
+atlas_install_data( share/*.ref)
 
 # List of XML menus to be created:
 atlas_build_lvl1_trigger_menu( Physics_pp_run3_v1 )
diff --git a/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/CFtest/EmuStepProcessingConfig.py
similarity index 92%
rename from Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py
rename to Trigger/TriggerCommon/TriggerMenuMT/python/CFtest/EmuStepProcessingConfig.py
index 7397279d0050..b0efc09472c8 100644
--- a/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/CFtest/EmuStepProcessingConfig.py
@@ -1,9 +1,8 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.AlgScheduler import AlgScheduler
-from AthenaCommon.CFElements import parOR
 from AthenaCommon.Logging import logging
-from HLTSeeding.HLTSeedingConf import CTPUnpackingEmulationTool, RoIsUnpackingEmulationTool, HLTSeeding
+from HLTSeeding.HLTSeedingConf import CTPUnpackingEmulationTool, RoIsUnpackingEmulationTool
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import EmptyMenuSequence
 log = logging.getLogger('EmuStepProcessingConfig')
 
@@ -20,44 +19,31 @@ def thresholdToChains( chains ):
 
 ###########################################################################    
 def generateHLTSeedingAndChainsManually(topSequence):
+    log.info( "generateHLTSeedingAndChainsManually")
     generateEmuEvents()
-    from AthenaCommon.CFElements import seqOR,parOR
-    hltTop = seqOR("HLTTop")
-    hltBeginSeq = parOR("HLTBeginSeq")
-    hltTop += hltBeginSeq
-    topSequence += hltTop
-    hltSeeding = generateHLTSeeding()
-    hltBeginSeq += hltSeeding
+    emulateHLTSeeding(topSequence)
     generateChainsManually()
-    from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree
-    from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
-    makeHLTTree( triggerConfigHLT=TriggerConfigHLT )
     
 
 ###########################################################################    
 def generateHLTSeedingAndChainsByMenu(topSequence):
+    log.info("generateHLTSeedingAndChainsByMenu")
     generateEmuEvents()
-    from AthenaCommon.CFElements import seqOR,parOR
-    hltTop = seqOR("HLTTop")
-    hltBeginSeq = parOR("HLTBeginSeq")
-    hltTop += hltBeginSeq
-    topSequence += hltTop
-    hltSeeding = generateHLTSeeding()
-    hltBeginSeq += hltSeeding
-    hltSeeding = generateHLTSeeding()
+    emulateHLTSeeding(topSequence)
     generateEmuMenu()
 
 
 
 ###########################################################################    
-def generateEmuMenu():    
+def generateEmuMenu(): 
+    """ 
+     set Emu menu and reproduce generateMT
+    """
+    log.info("generateEmuMenu")  
     from TriggerMenuMT.HLTMenuConfig.Menu import LS2_v1
     from TriggerMenuMT.HLTMenuConfig.Menu import LS2_emu_v1 
     from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT import GenerateMenuMT
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    from AthenaCommon.Logging import logging
-    log = logging.getLogger('EmuMenuTest')
-    log.debug("generateEmuMenu")
+    from TriggerJobOpts.TriggerFlags import TriggerFlags  
 
     # overwrite LS2_v1 
     LS2_v1.setupMenu = LS2_emu_v1.setupMenu
@@ -70,13 +56,15 @@ def generateEmuMenu():
 
     # Generate the menu    
     menu = GenerateMenuMT()
-    menu.overwriteSignaturesWith(signaturesToGenerate)    
-    menu.generateMT()
+    menu.overwriteSignaturesWith(signaturesToGenerate)
+    menu.generateAllChainConfigs()    
+    #menu.generateMT()
 
 
 
 ###########################################################################    
 def generateEmuEvents():
+    log.info("generateEmuEvents")
     AlgScheduler.ShowControlFlow( True )
     AlgScheduler.ShowDataFlow( True )
 
@@ -179,6 +167,7 @@ def generateEmuEvents():
 
 ###########################################################################    
 def generateChainsManually():
+    log.info("generateChainsManually")
     from DecisionHandling.TestUtils import makeChain, makeChainStep    
     doMuon     = True
     doElectron = True
@@ -338,12 +327,12 @@ def generateChainsManually():
 
 
 ########################## L1 #################################################        
-def generateHLTSeeding():
-
-    L1UnpackingSeq = parOR("L1UnpackingSeq")
-
-    hltSeeding = HLTSeeding( RoIBResult="", L1TriggerResult="" )
-    hltSeeding.HLTSeedingSummaryKey = "HLTSeedingSummary"
+def emulateHLTSeeding(topSequence):
+    log.info("emulateHLTSeeding")
+    
+    # modify hltSeeding already in the Tree
+    hltSeeding=topSequence.HLTTop.HLTBeginSeq.HLTSeeding    
+    
     ctpUnpacker = CTPUnpackingEmulationTool( ForceEnableAllChains=False , InputFilename="ctp.dat" )
     hltSeeding.ctpUnpacker = ctpUnpacker
 
@@ -353,16 +342,10 @@ def generateHLTSeeding():
     hltSeeding.prescaler = psEmulation
 
     from HLTSeeding.HLTSeedingConfig import mapThresholdToL1RoICollection, mapThresholdToL1DecisionCollection
-
     emUnpacker = RoIsUnpackingEmulationTool("EMRoIsUnpackingTool", InputFilename="l1emroi.dat", OutputTrigRoIs=mapThresholdToL1RoICollection("EM"), Decisions=mapThresholdToL1DecisionCollection("EM"), ThresholdPrefix="EM" )
-
     muUnpacker = RoIsUnpackingEmulationTool("MURoIsUnpackingTool", InputFilename="l1muroi.dat",  OutputTrigRoIs=mapThresholdToL1RoICollection("MU"), Decisions=mapThresholdToL1DecisionCollection("MU"), ThresholdPrefix="MU" )
 
     hltSeeding.RoIBRoIUnpackers = [emUnpacker, muUnpacker]
 
-    L1UnpackingSeq += hltSeeding
-    log.debug(L1UnpackingSeq)
-
-    return hltSeeding
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/share/full_menu_cf.py b/Trigger/TriggerCommon/TriggerMenuMT/python/CFtest/generateCFChains.py
similarity index 90%
rename from Trigger/TriggerCommon/TriggerMenuMT/share/full_menu_cf.py
rename to Trigger/TriggerCommon/TriggerMenuMT/python/CFtest/generateCFChains.py
index b355c1f2fec3..034adf8145e7 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/share/full_menu_cf.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/CFtest/generateCFChains.py
@@ -2,11 +2,15 @@
 #  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 #
 
+
 ##########################################
-# This is the menu:
+# generateCFChains generates some menu-like chains, outside the menu generation framework,  
+# using the Control-flow framework alone
 ###########################################
 
-def generateChains():
+
+
+def generateCFChains(opt):
     from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import RecoFragmentsPool
     from DecisionHandling.TestUtils import makeChain, makeChainStep
     
@@ -20,8 +24,8 @@ def generateChains():
         electronSeq = RecoFragmentsPool.retrieve( fastElectronSequenceCfg, None )
         precisionCaloSeq = RecoFragmentsPool.retrieve( precisionCaloSequenceCfg, None )
         
-        FastCaloStep = makeChainStep("ElectronFastCaloStep", [fastCaloSeq])
-        FastElectronStep = makeChainStep("ElectronFastTrackStep", [electronSeq])
+        FastCaloStep      = makeChainStep("ElectronFastCaloStep", [fastCaloSeq])
+        FastElectronStep  = makeChainStep("ElectronFastTrackStep", [electronSeq])
         PrecisionCaloStep = makeChainStep("ElectronPrecisionCaloStep", [precisionCaloSeq])
         
         electronChains  = [
@@ -33,12 +37,12 @@ def generateChains():
         testChains += electronChains
 
         from TriggerMenuMT.HLTMenuConfig.Egamma.PhotonChainConfiguration import fastPhotonCaloSequenceCfg, fastPhotonSequenceCfg, precisionPhotonCaloSequenceCfg
-        fastCaloSeq = RecoFragmentsPool.retrieve( fastPhotonCaloSequenceCfg, None )
-        fastPhotonSeq = RecoFragmentsPool.retrieve( fastPhotonSequenceCfg, None )
+        fastCaloSeq            = RecoFragmentsPool.retrieve( fastPhotonCaloSequenceCfg, None )
+        fastPhotonSeq          = RecoFragmentsPool.retrieve( fastPhotonSequenceCfg, None )
         precisionCaloPhotonSeq = RecoFragmentsPool.retrieve( precisionPhotonCaloSequenceCfg, None)
         
-        FastCaloStep = makeChainStep("PhotonFastCaloStep", [fastCaloSeq])
-        fastPhotonStep = makeChainStep("PhotonStep2", [fastPhotonSeq])
+        FastCaloStep            = makeChainStep("PhotonFastCaloStep", [fastCaloSeq])
+        fastPhotonStep          = makeChainStep("PhotonStep2", [fastPhotonSeq])
         precisionCaloPhotonStep = makeChainStep("precisionCaloPhotonStep", [precisionCaloPhotonSeq])
         
         photonChains = [
@@ -270,40 +274,4 @@ def generateChains():
         comboChains =  [ makeChain(name='HLT_e3_etcut_mu6_L1EM7_MU8F', L1Thresholds=["EM7", "MU8F"],  ChainSteps=[comboStep_et_mufast ])]
     #   comboChains += [Chain(name='HLT_mu8fast_e8_etcut1step',   ChainSteps=[ comboStep_mufast_etcut1_step1 ])]
         testChains += comboChains
-        
-
-### commands here:
-
-from AthenaCommon.Logging import logging
-__log = logging.getLogger('full_menu')
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-createHLTMenuExternally=True # menu will be build up explicitly here 
-doWriteRDOTrigger = False
-doWriteBS = False
-forceEnableAllChains=True
-TriggerFlags.triggerMenuSetup = "LS2_v1"
-
-include("TriggerJobOpts/runHLT_standalone.py")
-
-# make menu manually here:
-from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree
-from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
-
-generateChains()
-makeHLTTree( triggerConfigHLT=TriggerConfigHLT )
-
-from TriggerMenuMT.HLTMenuConfig.Menu.CheckL1HLTConsistency import checkL1HLTConsistency
-checkL1HLTConsistency()
-       
-from TriggerMenuMT.HLTMenuConfig.Menu.HLTMenuJSON import generateJSON
-generateJSON()
-
-from TriggerMenuMT.HLTMenuConfig.Menu.HLTPrescaleJSON import generateJSON as generatePrescaleJSON
-generatePrescaleJSON()
-   
-from TriggerMenuMT.HLTMenuConfig.Menu.HLTMonitoringJSON import generateDefaultMonitoringJSON
-generateDefaultMonitoringJSON()
-
-from AthenaCommon.AlgSequence import dumpSequence
-dumpSequence(topSequence)
+   
\ No newline at end of file
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_emu_step_menu_processing_cf.sh b/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_emu_step_menu_processing_cf.sh
new file mode 100755
index 000000000000..c00ff5e1230c
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_emu_step_menu_processing_cf.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# This is a unit test of HLT Control Flow 
+athena.py --imf --threads=1  --evtMax 4 --filesInput /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 -c "menuType='emuMenuTest';" TriggerMenuMT/test_menu_cf.py
+
+
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_emu_step_processing_cf.sh b/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_emu_step_processing_cf.sh
new file mode 100755
index 000000000000..1855296a735f
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_emu_step_processing_cf.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# This is a unit test of HLT Control Flow 
+
+athena.py --imf --threads=1  --evtMax 4 --filesInput /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 -c "menuType='emuManual';" TriggerMenuMT/test_menu_cf.py
+
+
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_full_menu_cf.sh b/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_manual_menu_cf.sh
similarity index 74%
rename from Trigger/TriggerCommon/TriggerMenuMT/scripts/test_full_menu_cf.sh
rename to Trigger/TriggerCommon/TriggerMenuMT/scripts/test_manual_menu_cf.sh
index 9b360d1fc1bf..0dc529c1c609 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_full_menu_cf.sh
+++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/test_manual_menu_cf.sh
@@ -4,5 +4,4 @@
 
 # This is a unit test of HLT Control Flow 
 
-
-athena.py --imf --threads=1 --evtMax 5  --filesInput /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 --config-only=config.pkl -c "doWriteBS=False;doWriteRDOTrigger=True;" TriggerMenuMT/full_menu_cf.py
+athena.py --imf --threads=1 --evtMax 5  --filesInput /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1 --config-only=config.pkl -c "menuType='menuManual';" TriggerMenuMT/test_menu_cf.py
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/share/emu_step_menu_processing_cf.ref b/Trigger/TriggerCommon/TriggerMenuMT/share/emu_step_menu_processing_cf.ref
new file mode 100644
index 000000000000..31cbb58e5c60
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/share/emu_step_menu_processing_cf.ref
@@ -0,0 +1,98 @@
+TriggerSummaryStep1                        0   0   DEBUG In summary 0 chains passed:
+TriggerSummaryStep2                        0   0   DEBUG In summary 0 chains passed:
+TriggerSummaryStep1                        1   0   DEBUG In summary 4 chains passed:
+TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
+TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain5_ev3_L1EM7 ID#2336588294
+TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
+TriggerSummaryStep1                        1   0   DEBUG  +++ HLT_TestChain5_gv1_L1EM7 ID#3893303900
+TriggerSummaryStep2                        1   0   DEBUG In summary 3 chains passed:
+TriggerSummaryStep2                        1   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
+TriggerSummaryStep2                        1   0   DEBUG  +++ HLT_TestChain5_ev3_L1EM7 ID#2336588294
+TriggerSummaryStep2                        1   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
+TriggerSummaryStep3                        1   0   DEBUG In summary 2 chains passed:
+TriggerSummaryStep3                        1   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
+TriggerSummaryStep3                        1   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
+TriggerSummaryStep1                        2   0   DEBUG In summary 5 chains passed:
+TriggerSummaryStep1                        2   0   DEBUG  +++ leg000_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1092141028
+TriggerSummaryStep1                        2   0   DEBUG  +++ leg001_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1132652453
+TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
+TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
+TriggerSummaryStep1                        2   0   DEBUG  +++ HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#2709794009
+TriggerSummaryStep2                        2   0   DEBUG In summary 5 chains passed:
+TriggerSummaryStep2                        2   0   DEBUG  +++ leg000_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1092141028
+TriggerSummaryStep2                        2   0   DEBUG  +++ leg001_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1132652453
+TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
+TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
+TriggerSummaryStep2                        2   0   DEBUG  +++ HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#2709794009
+TriggerSummaryStep3                        2   0   DEBUG In summary 5 chains passed:
+TriggerSummaryStep3                        2   0   DEBUG  +++ leg000_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1092141028
+TriggerSummaryStep3                        2   0   DEBUG  +++ leg001_HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#1132652453
+TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain5_ev1_L1EM3 ID#1756953305
+TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
+TriggerSummaryStep3                        2   0   DEBUG  +++ HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 ID#2709794009
+TriggerSummaryStep1                        3   0   DEBUG In summary 1 chains passed:
+TriggerSummaryStep1                        3   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
+TriggerSummaryStep2                        3   0   DEBUG In summary 1 chains passed:
+TriggerSummaryStep2                        3   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
+TriggerSummaryStep3                        3   0   DEBUG In summary 1 chains passed:
+TriggerSummaryStep3                        3   0   DEBUG  +++ HLT_TestChain8_ev1_L1EM3 ID#2478217953
+TrigSignatureMoni                                   INFO HLT_2TestChain4_muv1dr_L12MU5VF #2974919246
+TrigSignatureMoni                                   INFO -- #2974919246 Events         0          0          0          0          0          0          0          
+TrigSignatureMoni                                   INFO -- #2974919246 Features                             0          0          0          0          
+TrigSignatureMoni                                   INFO HLT_2TestChain6_muEmpty1_L12MU5VF #2063478629
+TrigSignatureMoni                                   INFO -- #2063478629 Events         0          0          -          0          -          -          0          
+TrigSignatureMoni                                   INFO -- #2063478629 Features                             -          0          -          -          
+TrigSignatureMoni                                   INFO HLT_2TestChain6_muv1_L12MU5VF #1545433316
+TrigSignatureMoni                                   INFO -- #1545433316 Events         0          0          0          0          0          0          0          
+TrigSignatureMoni                                   INFO -- #1545433316 Features                             0          0          0          0          
+TrigSignatureMoni                                   INFO HLT_3TestChain6_muv1_L12MU5VF #2841958077
+TrigSignatureMoni                                   INFO -- #2841958077 Events         0          0          0          0          0          0          0          
+TrigSignatureMoni                                   INFO -- #2841958077 Features                             0          0          0          0          
+TrigSignatureMoni                                   INFO HLT_TestChain10_muEmpty1_TestChain6_muEmpty1_L12MU5VF #597611606
+TrigSignatureMoni                                   INFO -- #597611606 Events          0          0          -          0          -          -          0          
+TrigSignatureMoni                                   INFO -- #597611606 Features                              -          0          -          -          
+TrigSignatureMoni                                   INFO HLT_TestChain10_muv2_L1MU8F #3249372037
+TrigSignatureMoni                                   INFO -- #3249372037 Events         0          0          0          0          0          -          0          
+TrigSignatureMoni                                   INFO -- #3249372037 Features                             0          0          0          -          
+TrigSignatureMoni                                   INFO HLT_TestChain20_muv1_L1MU8F #279377365
+TrigSignatureMoni                                   INFO -- #279377365 Events          0          0          0          0          0          0          0          
+TrigSignatureMoni                                   INFO -- #279377365 Features                              0          0          0          0          
+TrigSignatureMoni                                   INFO HLT_TestChain5_ev1_L1EM3 #1756953305
+TrigSignatureMoni                                   INFO -- #1756953305 Events         3          3          2          2          2          -          2          
+TrigSignatureMoni                                   INFO -- #1756953305 Features                             4          4          4          -          
+TrigSignatureMoni                                   INFO HLT_TestChain5_ev1_TestChain8_ev1_L12EM3 #2709794009
+TrigSignatureMoni                                   INFO -- #2709794009 Events         1          1          1          1          1          -          1          
+TrigSignatureMoni                                   INFO -- #2709794009 Features                             4          4          4          -          
+TrigSignatureMoni                                   INFO HLT_TestChain5_ev2_L1EM7 #1760405581
+TrigSignatureMoni                                   INFO -- #1760405581 Events         0          0          0          0          -          -          0          
+TrigSignatureMoni                                   INFO -- #1760405581 Features                             0          0          -          -          
+TrigSignatureMoni                                   INFO HLT_TestChain5_ev3_L1EM7 #2336588294
+TrigSignatureMoni                                   INFO -- #2336588294 Events         1          1          1          1          -          -          1          
+TrigSignatureMoni                                   INFO -- #2336588294 Features                             2          2          -          -          
+TrigSignatureMoni                                   INFO HLT_TestChain5_gv1_L1EM7 #3893303900
+TrigSignatureMoni                                   INFO -- #3893303900 Events         1          1          1          -          -          -          1          
+TrigSignatureMoni                                   INFO -- #3893303900 Features                             2          -          -          -          
+TrigSignatureMoni                                   INFO HLT_TestChain6_muEmpty2_L1MU5VF #3556826768
+TrigSignatureMoni                                   INFO -- #3556826768 Events         0          0          0          -          0          0          0          
+TrigSignatureMoni                                   INFO -- #3556826768 Features                             0          -          0          0          
+TrigSignatureMoni                                   INFO HLT_TestChain6_muv1_TestChain10_ev1_L1EM7_MU8F #3189882830
+TrigSignatureMoni                                   INFO -- #3189882830 Events         0          0          0          0          0          0          0          
+TrigSignatureMoni                                   INFO -- #3189882830 Features                             0          0          0          0          
+TrigSignatureMoni                                   INFO HLT_TestChain6_muv1_TestChain10_muv1_L12MU5VF #2652330631
+TrigSignatureMoni                                   INFO -- #2652330631 Events         0          0          0          0          0          0          0          
+TrigSignatureMoni                                   INFO -- #2652330631 Features                             0          0          0          0          
+TrigSignatureMoni                                   INFO HLT_TestChain6_muv1_TestChain5_ev1dr_L1EM7_MU8F #1574217442
+TrigSignatureMoni                                   INFO -- #1574217442 Events         0          0          0          0          0          0          0          
+TrigSignatureMoni                                   INFO -- #1574217442 Features                             0          0          0          0          
+TrigSignatureMoni                                   INFO HLT_TestChain6_muv2_TestChain8_ev2_L1EM7_MU8F #682812371
+TrigSignatureMoni                                   INFO -- #682812371 Events          0          0          0          0          0          -          0          
+TrigSignatureMoni                                   INFO -- #682812371 Features                              0          0          0          -          
+TrigSignatureMoni                                   INFO HLT_TestChain8_ev1_L1EM3 #2478217953
+TrigSignatureMoni                                   INFO -- #2478217953 Events         4          4          3          3          3          -          3          
+TrigSignatureMoni                                   INFO -- #2478217953 Features                             4          4          4          -          
+TrigSignatureMoni                                   INFO HLT_TestChain8_muv1_L1MU8F #2440697751
+TrigSignatureMoni                                   INFO -- #2440697751 Events         0          0          0          0          0          0          0          
+TrigSignatureMoni                                   INFO -- #2440697751 Features                             0          0          0          0          
+TrigSignatureMoni                                   INFO HLT_TestChain8_muv1step_L1MU5VF #2287259817
+TrigSignatureMoni                                   INFO -- #2287259817 Events         0          0          0          -          -          -          0          
+TrigSignatureMoni                                   INFO -- #2287259817 Features                             0          -          -          -          
diff --git a/Trigger/TrigSteer/DecisionHandling/share/emu_step_processing.ref b/Trigger/TriggerCommon/TriggerMenuMT/share/emu_step_processing_cf.ref
similarity index 100%
rename from Trigger/TrigSteer/DecisionHandling/share/emu_step_processing.ref
rename to Trigger/TriggerCommon/TriggerMenuMT/share/emu_step_processing_cf.ref
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/share/test_menu_cf.py b/Trigger/TriggerCommon/TriggerMenuMT/share/test_menu_cf.py
new file mode 100644
index 000000000000..040490461ed8
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/share/test_menu_cf.py
@@ -0,0 +1,109 @@
+#
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+#
+
+## This file runs runHLT_standalone with external menus
+# 3 tests of the CF to cover different menu generation frameworks and data inputs:
+
+#   - menuManual: chains are generated manually in generateCFChains, and run on input data file
+#   - emuMenuTest: chains are generated in the menu framework as HLT_TestChain**, and run on emulated data 
+#   - emuManual: chains are genrated manually and run on emulated data
+
+class testopt:
+    menuType  = 'menuManual' # use either menu or manual chain building
+
+from AthenaCommon.Logging import logging
+log = logging.getLogger('test_menu_cf')
+
+
+log.info('Setup options:')
+defaultOptions = [a for a in dir(testopt) if not a.startswith('__')]
+for option in defaultOptions:
+    if option in globals():
+        setattr(testopt, option, globals()[option])
+        log.info(' %20s = %s' , option, getattr(testopt, option))
+    else:        
+        log.info(' %20s = (Default) %s' , option, getattr(testopt, option))
+
+
+
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+ConfigFlags.Trigger.generateMenuDiagnostics = True
+
+
+from TriggerJobOpts.TriggerFlags import TriggerFlags
+createHLTMenuExternally=True # menu will be build up explicitly here 
+doWriteRDOTrigger = False
+doWriteBS = False
+forceEnableAllChains=True
+TriggerFlags.triggerMenuSetup = "LS2_v1"
+
+# load all configuration as the real HLT
+include("TriggerJobOpts/runHLT_standalone.py")
+
+
+# make menu manually here:
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree
+from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
+from TriggerMenuMT.CFtest.generateCFChains import generateCFChains
+from TriggerMenuMT.CFtest.EmuStepProcessingConfig import generateHLTSeedingAndChainsManually, generateHLTSeedingAndChainsByMenu
+
+topSequence = AlgSequence()
+
+if testopt.menuType == 'menuManual':
+    generateCFChains(opt)
+    from TriggerMenuMT.HLTMenuConfig.Menu.CheckL1HLTConsistency import checkL1HLTConsistency
+    checkL1HLTConsistency()
+elif testopt.menuType == 'emuMenuTest':
+    # HLT_TestChain
+    generateHLTSeedingAndChainsByMenu(topSequence)
+elif testopt.menuType == 'emuManual':
+    generateHLTSeedingAndChainsManually(topSequence)
+else:
+    log.error("Input parameter %s not accepted",testopt.menuType)
+
+
+# set DEBUG flag on the control-flow builder (before building)
+import TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig
+TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig.log.setLevel(DEBUG)
+
+# from here generate the ControlFlow and the Dataflow
+# doing the same as menu.generateMT()
+makeHLTTree( triggerConfigHLT=TriggerConfigHLT )
+
+       
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTMenuJSON import generateJSON
+generateJSON()
+
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTPrescaleJSON import generateJSON as generatePrescaleJSON
+generatePrescaleJSON()
+   
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTMonitoringJSON import generateDefaultMonitoringJSON
+generateDefaultMonitoringJSON()
+
+# now some debug
+print ("EmuStepProcessing: dump top Sequence after CF/DF Tree build")
+from AthenaCommon.AlgSequence import dumpSequence
+dumpSequence( topSequence )
+
+from TriggerJobOpts.TriggerConfig import collectHypos, collectFilters
+from AthenaCommon.CFElements import findSubSequence
+hypos   = collectHypos(findSubSequence(topSequence, "HLTAllSteps"))
+filters = collectFilters(findSubSequence(topSequence, "HLTAllSteps"))
+
+nfilters = sum(len(v) for v in filters.values())
+nhypos = sum(len(v) for v in hypos.values())
+log.info( "Algorithms counting: Number of Filter algorithms: %d  -  Number of Hypo algorithms: %d", nfilters , nhypos) 
+
+
+# switch on DEBUG on the trigger monitoring
+topSequence.HLTTop.HLTEndSeq.TrigSignatureMoni.OutputLevel = DEBUG
+
+from AthenaCommon.CFElements import getSequenceChildren, isSequence
+for alg in getSequenceChildren( topSequence.HLTTop.HLTAllSteps ):
+         if isSequence( alg ):
+             continue
+ 
+         if "TriggerSummary" in alg.getName():
+             alg.OutputLevel = DEBUG
+
-- 
GitLab


From c4fbc985c989e97e1417b5e956d37e82f9a3ee52 Mon Sep 17 00:00:00 2001
From: David Richard Shope <david.richard.shope@cern.ch>
Date: Mon, 13 Sep 2021 20:32:54 +0200
Subject: [PATCH 091/347] Adapt SiHitAnalysis and associated configuration to
 handle HGTD hits

---
 .../Tools/HitAnalysis/python/PostIncludes.py  | 11 ++++
 .../Tools/HitAnalysis/python/SiHitAnalysis.py | 18 +++++++
 .../Tools/HitAnalysis/python/__init__.py      |  4 +-
 .../Tools/HitAnalysis/src/SiHitAnalysis.cxx   | 52 +++++++++++++++++++
 .../Tools/HitAnalysis/src/SiHitAnalysis.h     |  8 +++
 5 files changed, 91 insertions(+), 2 deletions(-)

diff --git a/Simulation/Tools/HitAnalysis/python/PostIncludes.py b/Simulation/Tools/HitAnalysis/python/PostIncludes.py
index 6ca5bcc4dbc9..50b776b3d2bf 100644
--- a/Simulation/Tools/HitAnalysis/python/PostIncludes.py
+++ b/Simulation/Tools/HitAnalysis/python/PostIncludes.py
@@ -14,3 +14,14 @@ def ITkHitAnalysis(flags):
         result.merge(ITkStripHitAnalysisCfg(flags))
 
     return result
+
+def HGTDHitAnalysis(flags):
+    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+    from HitAnalysis.SiHitAnalysis import HGTD_HitAnalysisCfg
+
+    result = ComponentAccumulator()
+
+    if flags.Detector.EnableHGTD:
+        result.merge(HGTD_HitAnalysisCfg(flags))
+
+    return result
diff --git a/Simulation/Tools/HitAnalysis/python/SiHitAnalysis.py b/Simulation/Tools/HitAnalysis/python/SiHitAnalysis.py
index 305800623580..9f0212f928b1 100644
--- a/Simulation/Tools/HitAnalysis/python/SiHitAnalysis.py
+++ b/Simulation/Tools/HitAnalysis/python/SiHitAnalysis.py
@@ -44,6 +44,21 @@ def ITkStripHitAnalysisCfg(flags):
     return acc
 
 
+def HGTD_HitAnalysisCfg(flags):
+    from HGTD_GeoModel.HGTD_GeoModelConfig import HGTD_GeometryCfg
+    acc = HGTD_GeometryCfg(flags)
+
+    alg = CompFactory.SiHitAnalysis('HGTD_HitAnalysis')
+    alg.CollectionName = 'HGTD_Hits'
+    alg.HistPath='/SiHitAnalysis/Histos/'
+    alg.NtupleFileName='/SiHitAnalysis/Ntuples/'
+    acc.addEventAlgo(alg)
+
+    acc.merge(SiHitAnalysisOutputCfg(flags))
+
+    return acc
+
+
 def SiHitAnalysisCfg(flags):
     acc = ComponentAccumulator()
 
@@ -53,4 +68,7 @@ def SiHitAnalysisCfg(flags):
     if flags.Detector.EnableITkStrip:
         acc.merge(ITkStripHitAnalysisCfg(flags))
 
+    if flags.Detector.EnableHGTD:
+        acc.merge(HGTD_HitAnalysisCfg(flags))
+
     return acc
diff --git a/Simulation/Tools/HitAnalysis/python/__init__.py b/Simulation/Tools/HitAnalysis/python/__init__.py
index 4f61759ba5c3..8d8a6e80b452 100644
--- a/Simulation/Tools/HitAnalysis/python/__init__.py
+++ b/Simulation/Tools/HitAnalysis/python/__init__.py
@@ -1,5 +1,5 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
-from .PostIncludes import ITkHitAnalysis
+from .PostIncludes import ITkHitAnalysis, HGTDHitAnalysis
  
-__all__ = ['ITkHitAnalysis']
+__all__ = ['ITkHitAnalysis', 'HGTDHitAnalysis']
diff --git a/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx
index aef5d6cb16aa..40cd60c5b78e 100644
--- a/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx
+++ b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx
@@ -5,6 +5,9 @@
 #include "SiHitAnalysis.h"
 
 #include "GeoAdaptors/GeoSiHit.h"
+#include "GeneratorObjects/HepMcParticleLink.h"
+#include "AtlasHepMC/GenVertex.h"
+#include "AtlasHepMC/GenParticle.h"
 
 #include "TH1.h"
 #include "TH2.h"
@@ -47,6 +50,10 @@ StatusCode SiHitAnalysis::initialize()
     detName = "BLM";
     ntupName = "SiBLM";
   }
+  else if (m_hitsContainerKey.key()=="HGTD_Hits") {
+    detName = "HGTD";
+    ntupName = "SiHGTD";
+  }
   else {
     ATH_MSG_ERROR("SiHitsAnalysis for " << m_hitsContainerKey.key() << " not supported!!!");
     return StatusCode::FAILURE;
@@ -78,6 +85,12 @@ StatusCode SiHitAnalysis::initialize()
     radius_up = 1000;
     radius_down = 0;
     z_max = 3000;
+  } else if (detName == "HGTD") {
+    bin_down = -1000;
+    bin_up = 1000;
+    radius_up = 1000;
+    radius_down = 350;
+    z_max = 3600;
   }
 
   m_h_hits_x = new TH1D(("h_"+detName+"_x").c_str(),("h_"+detName+"_x").c_str(), 100,bin_down, bin_up);
@@ -170,6 +183,15 @@ StatusCode SiHitAnalysis::initialize()
     m_tree->Branch((detName+"_eloss").c_str(), &m_hits_eloss);
     m_tree->Branch((detName+"_step").c_str(), &m_hits_step);
     m_tree->Branch((detName+"_barcode").c_str(), &m_hits_barcode);
+    if (m_extraTruthBranches) {
+      m_tree->Branch((detName+"_pdgId").c_str(), &m_hits_pdgId);
+      m_tree->Branch((detName+"_pT").c_str(), &m_hits_pT);
+      m_tree->Branch((detName+"_eta").c_str(), &m_hits_eta);
+      m_tree->Branch((detName+"_phi").c_str(), &m_hits_phi);
+      m_tree->Branch((detName+"_prodVtx_x").c_str(), &m_hits_prodVtx_x);
+      m_tree->Branch((detName+"_prodVtx_y").c_str(), &m_hits_prodVtx_y);
+      m_tree->Branch((detName+"_prodVtx_z").c_str(), &m_hits_prodVtx_z);
+    }
 
     m_tree->Branch((detName+"_barrel_endcap").c_str(), &m_barrel_endcap);
     m_tree->Branch((detName+"_layer_disk").c_str(), &m_layer_disk);
@@ -199,6 +221,15 @@ StatusCode SiHitAnalysis::execute()
   m_hits_eloss->clear();
   m_hits_step->clear();
   m_hits_barcode->clear();
+  if (m_extraTruthBranches) {
+    m_hits_pdgId->clear();
+    m_hits_pT->clear();
+    m_hits_eta->clear();
+    m_hits_phi->clear();
+    m_hits_prodVtx_x->clear();
+    m_hits_prodVtx_y->clear();
+    m_hits_prodVtx_z->clear();
+  }
 
   m_barrel_endcap->clear();
   m_layer_disk->clear();
@@ -245,6 +276,27 @@ StatusCode SiHitAnalysis::execute()
       m_hits_time->push_back(hit.meanTime());
       m_hits_step->push_back(step_length);
       m_hits_barcode->push_back(hit.particleLink().barcode());
+      if (m_extraTruthBranches) {
+        auto tpl = hit.particleLink();
+        if (tpl.isValid()) {
+          m_hits_pdgId->push_back(tpl->pdg_id());
+          m_hits_pT->push_back(tpl->momentum().perp());
+          m_hits_eta->push_back(tpl->momentum().eta());
+          m_hits_phi->push_back(tpl->momentum().phi());
+          m_hits_prodVtx_x->push_back(tpl->production_vertex()->position().x());
+          m_hits_prodVtx_y->push_back(tpl->production_vertex()->position().y());
+          m_hits_prodVtx_z->push_back(tpl->production_vertex()->position().z());
+        }
+        else {
+          m_hits_pdgId->push_back(-9999);
+          m_hits_pT->push_back(-9999);
+          m_hits_eta->push_back(-9999);
+          m_hits_phi->push_back(-9999);
+          m_hits_prodVtx_x->push_back(-9999);
+          m_hits_prodVtx_y->push_back(-9999);
+          m_hits_prodVtx_z->push_back(-9999);
+        }
+      }
 
       m_barrel_endcap->push_back(hit.getBarrelEndcap());
       m_layer_disk->push_back(hit.getLayerDisk());
diff --git a/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h
index 69cb4be29752..8b62ef4b1bbc 100755
--- a/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h
+++ b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h
@@ -60,6 +60,13 @@ private:
   std::vector<float>* m_hits_eloss{};
   std::vector<float>* m_hits_step{};
   std::vector<float>* m_hits_barcode{};
+  std::vector<float>* m_hits_pdgId{};
+  std::vector<float>* m_hits_pT{};
+  std::vector<float>* m_hits_eta{};
+  std::vector<float>* m_hits_phi{};
+  std::vector<float>* m_hits_prodVtx_x{};
+  std::vector<float>* m_hits_prodVtx_y{};
+  std::vector<float>* m_hits_prodVtx_z{};
   std::vector<int>* m_barrel_endcap{};
   std::vector<int>* m_layer_disk{};
   std::vector<int>* m_module_phi{};
@@ -70,6 +77,7 @@ private:
   Gaudi::Property<std::string> m_histPath {this, "HistPath", "/SiHitAnalysis/", ""};
   Gaudi::Property<std::string> m_ntuplePath {this, "NtupleFileName", "/SiHitAnalysis/", ""};
   Gaudi::Property<bool> m_expert {this, "ExpertMode", false, ""};
+  Gaudi::Property<bool> m_extraTruthBranches {this, "ExtraTruthBranches", false, ""};
 
   ServiceHandle<ITHistSvc> m_thistSvc {this, "HistSvc", "THistSvc", ""};
 
-- 
GitLab


From 764a7e4ffbbd98c7fd5ac997395d235c10cb0111 Mon Sep 17 00:00:00 2001
From: Frank Berghaus <frank.berghaus@cern.ch>
Date: Mon, 13 Sep 2021 20:34:56 +0200
Subject: [PATCH 092/347] xAODMetaDataCnv: FileMetaDataTool copies all
 xAOD::FileMetaData objects

---
 .../AsgTools/AsgTools/SgTEvent.h              |   8 ++
 .../AsgTools/AsgTools/SgTEvent.icc            |   9 ++
 .../AsgTools/AsgTools/SgTEventMeta.h          |   6 +
 .../AsgTools/AsgTools/SgTEventMeta.icc        |   6 +
 Control/xAODRootAccess/Root/TEvent.cxx        | 117 ++++++++++++++++++
 Control/xAODRootAccess/Root/TStore.cxx        |  23 ++++
 .../test/ut_xaodrootaccess_tevent_test.cxx    |  46 +++++++
 .../test/ut_xaodrootaccess_tstore_test.cxx    |  21 ++++
 .../xAODRootAccess/xAODRootAccess/TEvent.h    |   5 +
 .../xAODRootAccess/xAODRootAccess/TStore.h    |   8 ++
 .../xAODRootAccess/xAODRootAccess/TStore.icc  |   8 ++
 .../xAODRootAccessInterfaces/TVirtualEvent.h  |  13 ++
 .../TVirtualEvent.icc                         |   8 ++
 .../xAODMetaDataCnv/Root/FileMetaDataTool.cxx |  69 +++++------
 .../FileMetaDataCreatorTool_jobOptions.py     |   2 -
 .../xAODMetaDataCnv/FileMetaDataTool.h        |  18 +--
 16 files changed, 316 insertions(+), 51 deletions(-)

diff --git a/Control/AthToolSupport/AsgTools/AsgTools/SgTEvent.h b/Control/AthToolSupport/AsgTools/AsgTools/SgTEvent.h
index 0ed0bfa50a7a..6f3631c83401 100644
--- a/Control/AthToolSupport/AsgTools/AsgTools/SgTEvent.h
+++ b/Control/AthToolSupport/AsgTools/AsgTools/SgTEvent.h
@@ -8,6 +8,7 @@
 // System include(s):
 #include <memory>
 #include <string>
+#include <vector>
 
 // Local include(s):
 #include "AsgMessaging/StatusCode.h"
@@ -87,6 +88,13 @@ namespace asg {
                             bool allowMods, bool resetOnly = true,
                             bool noHist = false );
 
+      /** provide list of all keys associated with an object.
+       * usage: store->keys(key_vector)
+       * @param a vector of strings that will be filled with the list of keys
+       */
+      template< typename T >
+      void keys( std::vector< std::string >& vkeys ) const;
+
       /// @}
 
    private:
diff --git a/Control/AthToolSupport/AsgTools/AsgTools/SgTEvent.icc b/Control/AthToolSupport/AsgTools/AsgTools/SgTEvent.icc
index 770f91200c84..003f9ca45873 100644
--- a/Control/AthToolSupport/AsgTools/AsgTools/SgTEvent.icc
+++ b/Control/AthToolSupport/AsgTools/AsgTools/SgTEvent.icc
@@ -163,6 +163,15 @@ namespace asg {
       return StatusCode::FAILURE;
    }
 
+   template< typename T >
+   void SgTEvent::keys( std::vector< std::string >& vkeys ) const {
+      if ( m_ptds ) {
+         m_ptds->keys< T >(vkeys);
+      } else if ( m_pevm ) {
+         m_pevm->keys< T >(vkeys);
+      }
+   }
+
 } // namespace asg
 
 #endif // ASGTOOLS_SGTEVENT_ICC
diff --git a/Control/AthToolSupport/AsgTools/AsgTools/SgTEventMeta.h b/Control/AthToolSupport/AsgTools/AsgTools/SgTEventMeta.h
index 2fbc0a931d05..c08bc33095ac 100644
--- a/Control/AthToolSupport/AsgTools/AsgTools/SgTEventMeta.h
+++ b/Control/AthToolSupport/AsgTools/AsgTools/SgTEventMeta.h
@@ -75,6 +75,12 @@ namespace asg {
       template< typename T >
       StatusCode record( T* obj, const std::string& name );
 
+      /// provide list of all keys associated with a type.
+      /// usage: store->keys< type >(vector_to_fill)
+      /// @param vkeys will be filled with list of keys (may be empty)
+      template< typename T >
+      void keys( std::vector<std::string>& vkeys ) const;
+
       /// @}
 
    private:
diff --git a/Control/AthToolSupport/AsgTools/AsgTools/SgTEventMeta.icc b/Control/AthToolSupport/AsgTools/AsgTools/SgTEventMeta.icc
index 93af9b586627..daab3f7ddf67 100644
--- a/Control/AthToolSupport/AsgTools/AsgTools/SgTEventMeta.icc
+++ b/Control/AthToolSupport/AsgTools/AsgTools/SgTEventMeta.icc
@@ -152,6 +152,12 @@ namespace asg {
      return record( std::unique_ptr<T>(obj), name );
    }
 
+   template< typename T >
+   void SgTEventMeta::keys( std::vector< std::string >& vkeys ) const {
+      if (m_event)
+         m_event->keys<T>(vkeys, true); // true tells TEvent to scan metadata
+   }
+
 } // namespace asg
 
 #endif // ASGTOOLS_SGTEVENTMETA_ICC
diff --git a/Control/xAODRootAccess/Root/TEvent.cxx b/Control/xAODRootAccess/Root/TEvent.cxx
index 0985063c9a11..4b5af274fe90 100644
--- a/Control/xAODRootAccess/Root/TEvent.cxx
+++ b/Control/xAODRootAccess/Root/TEvent.cxx
@@ -1619,6 +1619,123 @@ namespace xAOD {
       return dummy;
    }
 
+   void TEvent::getNames(const std::string& targetClassName,
+                         std::vector<std::string>& vkeys,
+                         bool metadata) const {
+      // The results go in here
+      std::set<std::string> keys;
+
+      // Check input objects
+      TTree * tree = ( metadata ? m_inMetaTree : m_inTree );
+      if (tree) {
+         const TObjArray * in = tree->GetListOfBranches();
+         ::Info("xAOD::TEvent::getNames", "scanning input objects");
+
+         for ( Int_t index = 0; index < in->GetEntriesFast(); ++index ) {
+            const TObject * obj = in->At(index);
+            if ( ! obj ) continue;
+            const TBranch * element = dynamic_cast<const TBranch*>(obj);
+            if (!obj) {
+               ::Error("xAOD::TEvent::getNames", "Failure inspecting input objects");
+               break;
+            }
+            std::string objClassName = element->GetClassName();
+            std::string key = obj->GetName();
+            ::Info("xAOD::TEvent::getNames",
+                   "Inspecting %s / %s",
+                   objClassName.c_str(), key.c_str());
+            if (objClassName == targetClassName) {
+               ::Info("xAOD::TEvent::getNames",
+                     "Matched %s to key %s",
+                     targetClassName.c_str(), key.c_str());
+               keys.insert(key);
+            }
+         }
+      }
+
+      const Object_t& inAux = ( metadata ?
+                                m_inputMetaObjects : m_inputObjects );
+
+      ::Info("xAOD::TEvent::getNames",
+             "scanning input Aux objects for %s", targetClassName.c_str());
+      for( const auto& object : inAux ) {
+         // All metadata objects should be held by TObjectManager objects.
+         // Anything else is an error.
+         TObjectManager* mgr = dynamic_cast< TObjectManager* >( object.second );
+         if ( ! mgr ) continue;
+         const std::string& objClassName = mgr->holder()->getClass()->GetName();
+         const std::string& key = object.first;
+         ::Info("xAOD::TEvent::getNames",
+                "Inspecting %s / %s",
+                objClassName.c_str(), key.c_str());
+         if (objClassName == targetClassName) {
+            ::Info("xAOD::TEvent::getNames",
+                   "Matched %s to key %s",
+                   targetClassName.c_str(), key.c_str());
+            keys.insert(key);
+         }
+      }
+
+
+      // check output objects
+      tree = ( metadata ? nullptr : m_outTree );
+      if (tree) {
+         const TObjArray * out = tree->GetListOfBranches();
+         ::Info("xAOD::TEvent::getNames", "scanning output objects");
+
+         for ( Int_t index = 0; index < out->GetEntriesFast(); ++index ) {
+            const TObject * obj = out->At(index);
+            if ( ! obj ) continue;
+            const TBranch * element = dynamic_cast<const TBranch*>(obj);
+            if (!obj) {
+               ::Error("xAOD::TEvent::getNames", "Failure inspecting input objects");
+               break;
+            }
+            std::string objClassName = element->GetClassName();
+            std::string key = obj->GetName();
+            ::Info("xAOD::TEvent::getNames",
+                   "Inspecting %s / %s",
+                   objClassName.c_str(), key.c_str());
+            if (objClassName == targetClassName) {
+               ::Info("xAOD::TEvent::getNames",
+                     "Matched %s to key %s",
+                     targetClassName.c_str(), key.c_str());
+               keys.insert(key);
+            }
+         }
+      } else {
+         ::Info("xAOD::TEvent::getNames", "no output tree connected");
+      }
+
+
+      const Object_t& outAux = ( metadata ?
+                                 m_outputMetaObjects : m_outputObjects );
+
+      // Search though EventFormat for entries where class matches the provided
+      // typeName
+      ::Info("xAOD::TEvent::getNames",
+             "scanning output Aux objects for %s", targetClassName.c_str());
+      for( const auto& object : outAux ) {
+         // All metadata objects should be held by TObjectManager objects.
+         // Anything else is an error.
+         TObjectManager* mgr = dynamic_cast< TObjectManager* >( object.second );
+         if ( ! mgr ) continue;
+         const std::string& objClassName = mgr->holder()->getClass()->GetName();
+         const std::string& key = object.first;
+         ::Info("xAOD::TEvent::getNames",
+                "Inspecting %s / %s",
+                objClassName.c_str(), key.c_str());
+         if (objClassName == targetClassName) {
+            ::Info("xAOD::TEvent::getNames",
+                   "Matched %s to key %s",
+                   targetClassName.c_str(), key.c_str());
+            keys.insert(key);
+         }
+      }
+
+      vkeys.insert(vkeys.end(), keys.begin(), keys.end());
+   }
+
    /// This function is used primarily when getting the string key of
    /// a smart pointer that we read in from a file, or access it in memory.
    ///
diff --git a/Control/xAODRootAccess/Root/TStore.cxx b/Control/xAODRootAccess/Root/TStore.cxx
index 3dd983d0a203..a41f21c585a9 100644
--- a/Control/xAODRootAccess/Root/TStore.cxx
+++ b/Control/xAODRootAccess/Root/TStore.cxx
@@ -1,5 +1,7 @@
 // Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
+#include <set>
+
 // ROOT include(s):
 #include <TError.h>
 #include <TClass.h>
@@ -372,4 +374,25 @@ namespace xAOD {
       return dummy;
    }
 
+   void TStore::getNames( const std::string& targetTypeName,
+                          std::vector< std::string >& vkeys ) const {
+      std::set< std::string > keys;
+
+      for ( const auto& pair : m_objects ) {
+         const std::string& key = pair.first;
+         ::TClass* cl = pair.second->getClass();
+         const std::type_info* ti = pair.second->getTypeInfo();
+         std::string typeName;
+         if (cl)
+            typeName = cl->GetName();
+         else if (ti)
+            typeName = SG::normalizedTypeinfoName( *ti );
+
+         if (!typeName.empty() && typeName == targetTypeName)
+            keys.insert( key );
+      }
+
+      vkeys.insert( vkeys.end(), keys.begin(), keys.end() );
+   }
+
 } // namespace xAOD
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_test.cxx
index 420fa5745046..cd04fc0d54f4 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tevent_test.cxx
@@ -3,6 +3,7 @@
 */
 
 // System include(s):
+#include <algorithm>
 #include <memory>
 #include <vector>
 #include <string>
@@ -66,6 +67,17 @@ public:
    
 }; // class ClassB
 
+// some dummz definitions to test TEvent::keys
+namespace xAOD {
+   // a test for metadata
+   class FileMetaData_v1 { int m_a, m_e; };
+   typedef FileMetaData_v1 FileMetaData;
+
+   // a test for event payload
+   class TrackParticle_v1 { int m_a, m_e; };
+   typedef TrackParticle_v1 TrackParticle;
+}
+
 int main() {
 
    // Get the name of the application:
@@ -194,6 +206,40 @@ int main() {
       return 1;
    }
 
+   // test listing object keys
+   {
+      std::vector<std::string> keys;
+      event.keys<xAOD::FileMetaData>(keys, true);
+      if (keys.size() != 1) {
+         ::Error( APP_NAME,
+               XAOD_MESSAGE( "keys<xAOD::FileMetaData>(true).size = %u (!=1)" ),
+               static_cast<unsigned>(keys.size()) );
+         return 1;
+      }
+
+      keys.clear();
+      keys.reserve(6);
+      event.keys<DataVector< xAOD::TrackParticle > >(keys);
+      if (keys.size() != 6) {
+         ::Error( APP_NAME,
+               XAOD_MESSAGE( "keys<xAOD::TrackParticle >().size = %u (!=6)" ),
+               static_cast<unsigned>(keys.size()) );
+         return 1;
+      }
+
+      auto begin = keys.begin();
+      auto end = keys.end();
+      if (std::find(begin, end, "InDetTrackParticles") == end) {
+         ::Error( APP_NAME,
+               XAOD_MESSAGE( "keys<xAOD::TrackParticle >() did not find "
+                             "\"InDetTrackParticles\"" ) );
+         return 1;
+      }
+
+      // $TODO: test scanning through output
+
+   }
+
    // Create another TEvent instance to test the file writing capabilities of
    // the code:
    xAOD::TEvent wevent;
diff --git a/Control/xAODRootAccess/test/ut_xaodrootaccess_tstore_test.cxx b/Control/xAODRootAccess/test/ut_xaodrootaccess_tstore_test.cxx
index 946393a10615..774a6b2a5b2b 100644
--- a/Control/xAODRootAccess/test/ut_xaodrootaccess_tstore_test.cxx
+++ b/Control/xAODRootAccess/test/ut_xaodrootaccess_tstore_test.cxx
@@ -205,6 +205,27 @@ int main() {
    SIMPLE_ASSERT( APP_NAME,
                   store.isConst< DV_t >( "ConstDataVector" ) == kTRUE );
 
+   { // test getting a list of keys
+      store.clear();
+      std::string key = "MyObjA";
+      std::string postfix = "12345";
+      for ( const char &c : postfix ) {
+         key.push_back(c);
+         std::unique_ptr< ClassA > objA = std::make_unique< ClassA >();
+         RETURN_CHECK( APP_NAME, store.record( std::move( objA ), key ) );
+         key.pop_back();
+      }
+
+      std::vector< std::string > keys;
+      store.keys< ClassA >(keys);
+      if (keys.size() != postfix.size()) {
+         ::Error( APP_NAME, XAOD_MESSAGE( "store.keys< ClassA > size = %u (!=%u)" ),
+                                          static_cast< uint32_t >(keys.size()),
+                                          static_cast< uint32_t >(postfix.size()) );
+         return 1;
+      }
+   }
+
    // Return gracefully:
    return 0;
 }
diff --git a/Control/xAODRootAccess/xAODRootAccess/TEvent.h b/Control/xAODRootAccess/xAODRootAccess/TEvent.h
index 0a7ff0c7c637..07290c936e21 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TEvent.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TEvent.h
@@ -284,6 +284,11 @@ namespace xAOD {
                                   const std::type_info& ti,
                                   bool silent = false ) override;
 
+      /// Function determining the list keys associated with a type name
+      void getNames(const std::string& targetClassName,
+                    std::vector<std::string>& vkeys,
+                    bool metadata = false) const override;
+
       /// @}
 
       /// @name Functions implementing the IProxyDict interface
diff --git a/Control/xAODRootAccess/xAODRootAccess/TStore.h b/Control/xAODRootAccess/xAODRootAccess/TStore.h
index f1496279606b..435aca08ad69 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TStore.h
+++ b/Control/xAODRootAccess/xAODRootAccess/TStore.h
@@ -9,6 +9,7 @@
 #include <string>
 #include <map>
 #include <memory>
+#include <vector>
 
 // ROOT include(s):
 #include <Rtypes.h>
@@ -83,6 +84,10 @@ namespace xAOD {
       template< typename T >
       StatusCode record( std::unique_ptr< T > obj, const std::string& key );
 
+      /// prodive a list of keys associated with a type
+      template< typename T >
+      void keys( std::vector< std::string >& vkeys ) const;
+
       /// Remove an object from the store by name
       StatusCode remove( const std::string& key );
       /// Remove an object from the store by pointer
@@ -133,6 +138,9 @@ namespace xAOD {
       const std::string& getName( uint32_t hash ) const;
       /// Get the name of a managed object
       const std::string& getName( const void* ptr ) const;
+      /// Function determining the list keys associated with a type name
+      void getNames(const std::string& targetClassName,
+                    std::vector<std::string>& vkeys ) const;
 
       /// @}
 
diff --git a/Control/xAODRootAccess/xAODRootAccess/TStore.icc b/Control/xAODRootAccess/xAODRootAccess/TStore.icc
index bcfaffff8fb7..c404d207b564 100644
--- a/Control/xAODRootAccess/xAODRootAccess/TStore.icc
+++ b/Control/xAODRootAccess/xAODRootAccess/TStore.icc
@@ -5,6 +5,8 @@
 #ifndef XAODROOTACCESS_TSTORE_ICC
 #define XAODROOTACCESS_TSTORE_ICC
 
+#include "AthContainers/normalizedTypeinfoName.h"
+
 // ROOT include(s):
 #include <TError.h>
 
@@ -134,6 +136,12 @@ namespace xAOD {
       return record( hldr, key );
    }
 
+   template< typename T >
+   void TStore::keys( std::vector< std::string >& vkeys ) const {
+      getNames( SG::normalizedTypeinfoName( typeid( T ) ), vkeys );
+   }
+
+
 } // namespace xAOD
 
 #endif // XAODROOTACCESS_TSTORE_ICC
diff --git a/Control/xAODRootAccessInterfaces/xAODRootAccessInterfaces/TVirtualEvent.h b/Control/xAODRootAccessInterfaces/xAODRootAccessInterfaces/TVirtualEvent.h
index 30d9b36a1b56..67e329fee188 100644
--- a/Control/xAODRootAccessInterfaces/xAODRootAccessInterfaces/TVirtualEvent.h
+++ b/Control/xAODRootAccessInterfaces/xAODRootAccessInterfaces/TVirtualEvent.h
@@ -10,6 +10,7 @@ extern "C" {
 #   include <stdint.h>
 }
 #include <string>
+#include <vector>
 
 // Forward declaration(s):
 namespace std {
@@ -46,6 +47,14 @@ namespace xAOD {
       bool retrieve( const T*& obj, const std::string& key,
                      bool silent = false );
 
+      /// provide list of all keys associated with provided type.
+      /// usage: event->keys( vec_to_fill, metadata )
+      /// @param vkeys will be filled with the list of keys (may be empty)
+      /// @param metadata (default false) look in metadata content if true
+      template< typename T >
+      void keys( std::vector< std::string >& vkeys,
+                 bool metadata = false ) const;
+
       /// Function returning the hash describing an object's name/key
       virtual uint32_t getHash( const std::string& key ) const = 0;
       /// Function returning the hash describing a known object
@@ -63,6 +72,10 @@ namespace xAOD {
       virtual const void* getInputObject( uint32_t key,
                                           const std::type_info& ti,
                                           bool silent = false ) = 0;
+      /// Function to retrieve list of keys describing a type name
+      virtual void getNames( const std::string& targetClassName,
+                             std::vector<std::string>& vkeys,
+                             bool metadata) const = 0;
 
    }; // class TVirtualEvent
 
diff --git a/Control/xAODRootAccessInterfaces/xAODRootAccessInterfaces/TVirtualEvent.icc b/Control/xAODRootAccessInterfaces/xAODRootAccessInterfaces/TVirtualEvent.icc
index 324428a66bcf..5e76d56ac5b4 100644
--- a/Control/xAODRootAccessInterfaces/xAODRootAccessInterfaces/TVirtualEvent.icc
+++ b/Control/xAODRootAccessInterfaces/xAODRootAccessInterfaces/TVirtualEvent.icc
@@ -5,6 +5,8 @@
 #ifndef XAODROOTACCESSINTERFACES_TVIRTUALEVENT_ICC
 #define XAODROOTACCESSINTERFACES_TVIRTUALEVENT_ICC
 
+#include "AthContainers/normalizedTypeinfoName.h"
+
 // ROOT include(s):
 #include <TError.h>
 
@@ -61,6 +63,12 @@ namespace xAOD {
       return retrieve( obj, getHash( key ), silent );
    }
 
+   template< typename T >
+   void TVirtualEvent::keys( std::vector< std::string >& vkeys,
+                             bool metadata ) const {
+      getNames( SG::normalizedTypeinfoName( typeid( T ) ), vkeys, metadata);
+   }
+
 } // namespace xAOD
 
 #endif // XAODROOTACCESSINTERFACES_TVIRTUALEVENT_ICC
diff --git a/Event/xAOD/xAODMetaDataCnv/Root/FileMetaDataTool.cxx b/Event/xAOD/xAODMetaDataCnv/Root/FileMetaDataTool.cxx
index 69ff1214d598..3cc1a00076ce 100644
--- a/Event/xAOD/xAODMetaDataCnv/Root/FileMetaDataTool.cxx
+++ b/Event/xAOD/xAODMetaDataCnv/Root/FileMetaDataTool.cxx
@@ -18,11 +18,9 @@ namespace xAODMaker {
 
 FileMetaDataTool::FileMetaDataTool(const std::string& name)
     : asg::AsgMetadataTool(name) {
-  declareProperty("InputKey", m_inputKey = "FileMetaData",
-                  "Key of xAOD::FileMetaData object in input");
-
-  declareProperty("OutputKey", m_outputKey = "FileMetaData",
-                  "Key of xAOD::FileMetaData in MetaDataStore");
+       declareProperty( "Keys", m_keys = {},
+             "List of keys to propogate from input to output - all if empty "
+             "(default: empty)");
 #ifndef XAOD_STANDALONE
       declareInterface< ::IMetaDataTool >(this);
 #endif  // XAOD_STANDALONE
@@ -38,50 +36,46 @@ StatusCode
       return StatusCode::SUCCESS;
     }
 
-#ifndef XAOD_STANDALONE
 StatusCode
-    FileMetaDataTool::endInputFile(const SG::SourceID&) {
-      // Return gracefully:
-      return StatusCode::SUCCESS;
-    }
+    FileMetaDataTool::beginInputFile() {
+      // Previous input file has been processed
+      std::lock_guard lock(m_toolMutex);
 
-StatusCode
-    FileMetaDataTool::beginInputFile(const SG::SourceID&) {
-      return beginInputFile();
-    }
-#endif  // XAOD_STANDALONE
+      // get the keys for all metadata in input
+      if (m_keys.empty()) {
+         inputMetaStore()->keys<xAOD::FileMetaData>(m_keys);
+      }
+
+      // Now copy all object to MetaDataStore
+      for(const std::string& key : m_keys) {
+         ASG_CHECK(copy(key));
+      }
 
-StatusCode
-    FileMetaDataTool::endInputFile() {
-      // Return gracefully:
       return StatusCode::SUCCESS;
     }
 
 StatusCode
-    FileMetaDataTool::beginInputFile() {
-      // Previous input file has been processed
-      std::lock_guard lock(m_toolMutex);
-
+    FileMetaDataTool::copy(const std::string& key) {
+      ATH_MSG_DEBUG("Copying \"" << key << "\" from InputMetaDataStore");
       // Quit gracefully if there is nothing to do
-      if (!inputMetaStore()->contains< xAOD::FileMetaData >(m_inputKey)) {
-        ATH_MSG_INFO("No xAOD::FileMetaData in the input file");
+      if (!inputMetaStore()->contains< xAOD::FileMetaData >(key)) {
+        ATH_MSG_INFO("No \"" << key << "\" in the input file");
         return StatusCode::SUCCESS;
       }
 
       // Get the FileMetaData object from the input file
       const xAOD::FileMetaData * input = nullptr;
-      ASG_CHECK(inputMetaStore()->retrieve(input, m_inputKey));
+      ASG_CHECK(inputMetaStore()->retrieve(input, key));
 
       // Emit a warning if the FileMetaData from previous files does not
       // match that of the new input file
 #ifdef XAOD_STANDALONE
-      if (outputMetaStore()->contains< xAOD::FileMetaData >(m_outputKey)) {
+      if (outputMetaStore()->contains< xAOD::FileMetaData >(key)) {
         xAOD::FileMetaData * output = nullptr;
-        ASG_CHECK(
-            outputMetaStore()->retrieve(output, m_outputKey));
+        ASG_CHECK(outputMetaStore()->retrieve(output, key));
 #else
-      if (m_metaDataSvc->contains< xAOD::FileMetaData >(m_outputKey)) {
-        const auto *output = m_metaDataSvc->tryConstRetrieve< xAOD::FileMetaData >(m_outputKey);
+      if (m_metaDataSvc->contains< xAOD::FileMetaData >(key)) {
+        const auto *output = m_metaDataSvc->tryConstRetrieve< xAOD::FileMetaData >(key);
         if (!output) return StatusCode::FAILURE;
 #endif  // XAOD_STANDALONE
 
@@ -104,30 +98,25 @@ StatusCode
 #ifdef XAOD_STANDALONE
       ASG_CHECK(
           outputMetaStore()->record< xAOD::FileMetaData >(
-              std::move(output), m_outputKey));
+              std::move(output), key));
 
       ASG_CHECK(
           outputMetaStore()->record< xAOD::FileMetaDataAuxInfo >(
-              std::move(outputAux), m_outputKey + "Aux."));
+              std::move(outputAux), key + "Aux."));
 #else
       ASG_CHECK(
           m_metaDataSvc->record< xAOD::FileMetaData >(
-              std::move(output), m_outputKey));
+              std::move(output), key));
 
       ASG_CHECK(
           m_metaDataSvc->record< xAOD::FileMetaDataAuxInfo >(
-              std::move(outputAux), m_outputKey + "Aux."));
+              std::move(outputAux), key + "Aux."));
 #endif  // XAOD_STANDALONE
 
-      ATH_MSG_INFO("Copied xAOD::FileMetaData to MetaDataStore");
+      ATH_MSG_INFO("Copied \"" << key << "\" to MetaDataStore");
 
       // Return gracefully:
       return StatusCode::SUCCESS;
     }
 
-StatusCode
-    FileMetaDataTool::metaDataStop() {
-      // Return gracefully:
-      return StatusCode::SUCCESS;
-    }
 }  // namespace xAODMaker
diff --git a/Event/xAOD/xAODMetaDataCnv/share/FileMetaDataCreatorTool_jobOptions.py b/Event/xAOD/xAODMetaDataCnv/share/FileMetaDataCreatorTool_jobOptions.py
index 402c6f76a82e..71fc01a54ad1 100644
--- a/Event/xAOD/xAODMetaDataCnv/share/FileMetaDataCreatorTool_jobOptions.py
+++ b/Event/xAOD/xAODMetaDataCnv/share/FileMetaDataCreatorTool_jobOptions.py
@@ -39,8 +39,6 @@ svcMgr.EventSelector.InputCollections = ["/cvmfs/atlas-nightlies.cern.ch/repo/da
 # propogate xAOD::EventFormat from InputMetaDataStore to MetaDataStore
 ToolSvc += CfgMgr.xAODMaker__FileMetaDataTool(
     "FileMetaDataTool",
-    InputKey="FileMetaData",
-    OutputKey="FileMetaData",
     OutputLevel=DEBUG,
 )
 svcMgr.MetaDataSvc.MetaDataTools += [ToolSvc.FileMetaDataTool]
diff --git a/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h b/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h
index c45092a35af3..68dff5d25d98 100644
--- a/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h
+++ b/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h
@@ -51,27 +51,24 @@ class FileMetaDataTool
   StatusCode beginInputFile() override;
 
   /// Does nothing
-  StatusCode endInputFile() override;
+  StatusCode endInputFile() override {return StatusCode::SUCCESS;};
 
 #ifndef XAOD_STANDALONE
   /// Collecting file metadata from input and write to output
-  StatusCode beginInputFile(const SG::SourceID&) override;
+  StatusCode beginInputFile(const SG::SourceID&) override {return beginInputFile();};
 
   /// Does nothing
-  StatusCode endInputFile(const SG::SourceID&) override;
+  StatusCode endInputFile(const SG::SourceID&) override {return StatusCode::SUCCESS;};
 #endif
 
   /// Does nothing
-  StatusCode metaDataStop() override;
+  StatusCode metaDataStop() override {return StatusCode::SUCCESS;};
 
   /// @}
 
  private:
-  /// Key of the metadata object in the input file
-  std::string m_inputKey;
-
-  /// Key of the metadata object for the output file
-  std::string m_outputKey;
+  /// list of keys to propogate from input to output
+  std::vector< std::string > m_keys;
 
 #ifndef XAOD_STANDALONE
   /// Get a handle on the metadata store for the job
@@ -80,6 +77,9 @@ class FileMetaDataTool
 
   // To lock/unlock the tool
   std::mutex m_toolMutex;
+
+  // implementation of individual object copy
+  StatusCode copy(const std::string&);
 };  // class FileMetaDataTool
 
 }  // namespace xAODMaker
-- 
GitLab


From 721103c03bdd875630c58d6f2657ffba39c9d686 Mon Sep 17 00:00:00 2001
From: Petr Balek <petr.balek@cern.ch>
Date: Mon, 13 Sep 2021 20:45:15 +0200
Subject: [PATCH 093/347] fix FPE

---
 ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
index 9234e1c3a024..504c4198efc2 100644
--- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
+++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPFastReco.cxx
@@ -115,6 +115,7 @@ std::pair<double, double> AFPFastReco::linReg(std::vector<std::pair<double, doub
 		denumerator += dx * dx;
 	}
 
+	if(denumerator==0.0) denumerator=1e-6;
 	const double slope    = numerator / denumerator;
 	const double position = meany - slope * meanx;
 
-- 
GitLab


From c1560adc616440a81feb0fb04a4f80ef7e7c902f Mon Sep 17 00:00:00 2001
From: Adam Edward Barton <adam.edward.barton@cern.ch>
Date: Mon, 13 Sep 2021 19:29:56 +0100
Subject: [PATCH 094/347] clang-tidy performance adjustments on MuonGeoModel
 and  MuonReadoutGeometry

---
 .../MuonReadoutGeometry/CscReadoutElement.h   | 12 ++--
 .../MuonReadoutGeometry/GlobalUtilities.h     |  4 +-
 .../MuonReadoutGeometry/MMReadoutElement.h    |  2 +-
 .../MuonReadoutGeometry/MdtReadoutElement.h   | 24 ++++----
 .../MuonClusterReadoutElement.h               |  2 +-
 .../MuonReadoutGeometry/MuonDetectorManager.h |  8 +--
 .../MuonReadoutGeometry/MuonReadoutElement.h  |  2 +-
 .../MuonReadoutGeometry/RpcReadoutElement.h   |  4 +-
 .../MuonReadoutGeometry/TgcReadoutElement.h   | 10 ++--
 .../MuonReadoutGeometry/sTgcReadoutElement.h  |  2 +-
 .../src/CscReadoutElement.cxx                 | 12 ++--
 .../src/GlobalUtilities.cxx                   |  4 +-
 .../src/MMReadoutElement.cxx                  |  6 +-
 .../src/MdtReadoutElement.cxx                 | 25 +++++----
 .../src/MuonClusterReadoutElement.cxx         |  2 +-
 .../src/MuonDetectorManager.cxx               |  8 ++-
 .../src/MuonReadoutElement.cxx                |  2 +-
 .../MuonReadoutGeometry/src/MuonStation.cxx   |  3 +-
 .../src/RpcReadoutElement.cxx                 |  4 +-
 .../src/TgcReadoutElement.cxx                 | 10 ++--
 .../src/TgcReadoutParams.cxx                  |  6 +-
 .../src/sTgcReadoutElement.cxx                |  7 ++-
 .../MuonGeoModel/MuonGeoModel/CscMultiLayer.h |  2 +-
 .../MuonGeoModel/MuonGeoModel/FPVMAP.h        |  4 +-
 .../MuonGeoModel/MuonGeoModel/MMSpacer.h      |  2 +-
 .../MuonGeoModel/MuonGeoModel/MYSQL.h         | 56 +++++++++----------
 .../MuonGeoModel/MuonGeoModel/Mdt.h           |  2 +-
 .../MuonGeoModel/MuonGeoModel/Micromegas.h    |  2 +-
 .../MuonGeoModel/MuonGeoModel/MuonChamber.h   |  8 +--
 .../MuonGeoModel/RDBReaderAtlas.h             |  2 +-
 .../MuonGeoModel/StationSelector.h            |  2 +-
 .../MuonGeoModel/MuonGeoModel/sTGC.h          |  2 +-
 MuonSpectrometer/MuonGeoModel/src/Csc.cxx     |  3 +-
 .../MuonGeoModel/src/CscMultilayer.cxx        |  5 +-
 .../MuonGeoModel/src/DBReader.cxx             |  4 +-
 .../MuonGeoModel/src/DED_Technology.cxx       |  4 +-
 .../MuonGeoModel/src/DriftTube.cxx            |  3 +-
 MuonSpectrometer/MuonGeoModel/src/FPVMAP.cxx  |  4 +-
 .../MuonGeoModel/src/MMSpacer.cxx             |  2 +-
 MuonSpectrometer/MuonGeoModel/src/MYSQL.cxx   | 21 +++----
 MuonSpectrometer/MuonGeoModel/src/Mdt.cxx     |  2 +-
 .../MuonGeoModel/src/Micromegas.cxx           |  2 +-
 .../MuonGeoModel/src/MultiLayer.cxx           |  3 +-
 .../MuonGeoModel/src/MuonChamber.cxx          |  8 +--
 .../src/MuonSystemDescription.cxx             |  3 +-
 .../MuonGeoModel/src/RDBReaderAtlas.cxx       |  2 +-
 .../MuonGeoModel/src/RpcLayer.cxx             |  3 +-
 .../MuonGeoModel/src/SUP_Technology.cxx       |  4 +-
 .../MuonGeoModel/src/SimpleVolAction.cxx      |  2 +-
 MuonSpectrometer/MuonGeoModel/src/Station.cxx |  3 +-
 .../MuonGeoModel/src/StationSelector.cxx      |  5 +-
 .../MuonGeoModel/src/Technology.cxx           |  4 +-
 MuonSpectrometer/MuonGeoModel/src/sTGC.cxx    |  2 +-
 53 files changed, 177 insertions(+), 153 deletions(-)

diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/CscReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/CscReadoutElement.h
index 99f18eb26b41..382c31d20817 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/CscReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/CscReadoutElement.h
@@ -65,7 +65,7 @@ namespace MuonGM {
 
   public:
 
-    CscReadoutElement(GeoVFullPhysVol* pv, std::string stName,
+    CscReadoutElement(GeoVFullPhysVol* pv, const std::string& stName,
 		      int zi, int fi, bool is_mirrored, MuonDetectorManager* mgr);
 
     virtual ~CscReadoutElement();
@@ -171,9 +171,9 @@ namespace MuonGM {
     const Amg::Vector3D stripPos(Identifier id) const;       /**< takes into account internal alignment parameters, hence gives accurate answer */
     const Amg::Vector3D stripPos(int eta, int chamberLayer, int wireLayer,
 					    int measPhi, int channel) const;  /**< takes into account internal alignment parameters, hence gives accurate answer */
-    const Amg::Vector3D nominalGlobalPos(Amg::Vector3D localP) const; /**<  ignores internal alignment parameters, hence gives generally incorrect answer */
-    const Amg::Vector3D globalPos(Amg::Vector3D localP) const;        /**<  station-level method: does not depend on the strip view/layer, hence it cannot account for internal alignment parameters */
-    const Amg::Vector3D localPos(Amg::Vector3D globalP) const;        /**<  station-level method: does not depend on the strip view/layer, hence it cannot account for internal alignment parameters  */
+    const Amg::Vector3D nominalGlobalPos(const Amg::Vector3D& localP) const; /**<  ignores internal alignment parameters, hence gives generally incorrect answer */
+    const Amg::Vector3D globalPos(const Amg::Vector3D &localP) const;        /**<  station-level method: does not depend on the strip view/layer, hence it cannot account for internal alignment parameters */
+    const Amg::Vector3D localPos(const Amg::Vector3D& globalP) const;        /**<  station-level method: does not depend on the strip view/layer, hence it cannot account for internal alignment parameters  */
     const Amg::Vector3D nominalLocalStripPos(Identifier id) const; /**< ignores internal alignment parameters, hence gives generally incorrect answer (local here is the station frame, coherent with the gas gas frames) */
     //const Amg::Vector3D nominalLocalStripPos(IdentifierHash id) const;/**< ignores internal alignment parameters, hence gives generally incorrect answer (local here is the station frame, coherent with the gas gas frames) */
     const Amg::Vector3D nominalLocalStripPos(int eta, int chamberLayer, int wireLayer,
@@ -212,11 +212,11 @@ namespace MuonGM {
       @param[in]  x  local coordinates of the point in the gas gap = sensitive volume
     */
     //local to global and viceversa
-    const Amg::Vector3D localToGlobalCoords(Amg::Vector3D x, Identifier id) const; //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame  */
+    const Amg::Vector3D localToGlobalCoords(const Amg::Vector3D& x, Identifier id) const; //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame  */
     const Amg::Transform3D localToGlobalTransf(Identifier id) const; //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame  */
     const Amg::Transform3D localToGlobalTransf(int gasGap) const;    //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame  */
     // global to local
-    const Amg::Vector3D globalToLocalCoords(Amg::Vector3D x, Identifier id) const; //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame  */
+    const Amg::Vector3D globalToLocalCoords(const Amg::Vector3D& x, Identifier id) const; //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame  */
     const Amg::Transform3D globalToLocalTransf(Identifier id) const;           //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame  */
 
     // modifiers
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/GlobalUtilities.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/GlobalUtilities.h
index 360650a3c28d..10844c9e1bd7 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/GlobalUtilities.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/GlobalUtilities.h
@@ -15,8 +15,8 @@
 namespace MuonGM 
 {
     std::string buildString(int i, int ncha);
-    int strtoint(std::string str, unsigned int istart, unsigned int length);
-    int stationPhiTGC(std::string stName, int fi, int zi_input, std::string geometry_version);
+    int strtoint(const std::string& str, unsigned int istart, unsigned int length);
+    int stationPhiTGC(const std::string& stName, int fi, int zi_input, const std::string& geometry_version);
 }
 
 #endif // MUONREADOUTGEOMETRY_GLOBALUTILITIES_H
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h
index 0c0d85e1ec41..f44ec36b3b53 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MMReadoutElement.h
@@ -93,7 +93,7 @@ namespace MuonGM {
 
     /** simHit local (SD) To Global position - to be used by MuonGeoAdaprors only
      */
-    Amg::Vector3D localToGlobalCoords(Amg::Vector3D locPos, Identifier id) const;
+    Amg::Vector3D localToGlobalCoords(const Amg::Vector3D& locPos, Identifier id) const;
 
     /** TrkDetElementInterface */
     virtual Trk::DetectorElemType detectorType() const override final
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h
index 5a731960261a..d2384136e086 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h
@@ -60,7 +60,7 @@ friend class MuonChamber;
 
 public:
 
-   MdtReadoutElement(GeoVFullPhysVol* pv, std::string stName,
+   MdtReadoutElement(GeoVFullPhysVol* pv, const std::string& stName,
                      int zi, int fi, bool is_mirrored, MuonDetectorManager* mgr);
 
    virtual ~MdtReadoutElement()=default;
@@ -90,15 +90,15 @@ public:
     inline double tubePitch() const;
 
     // local(tube frame) to global coord.
-    const Amg::Vector3D                    localToGlobalCoords(Amg::Vector3D x, Identifier id) const;
+    const Amg::Vector3D                    localToGlobalCoords(const Amg::Vector3D& x, Identifier id) const;
     const Amg::Transform3D                localToGlobalTransf(Identifier id) const;
     const Amg::Transform3D                localToGlobalTransf(const int tubeLayer, const int tube) const;
     const Amg::Vector3D           nodeform_localToGlobalCoords(Amg::Vector3D x, Identifier id) const;
     const Amg::Transform3D       nodeform_localToGlobalTransf(Identifier id) const;
     // global to local(tube frame) coord.
-    const Amg::Vector3D                    globalToLocalCoords(Amg::Vector3D x, Identifier id) const;
+    const Amg::Vector3D                    globalToLocalCoords(const Amg::Vector3D& x, Identifier id) const;
     const Amg::Transform3D                globalToLocalTransf(Identifier id) const;
-    const Amg::Vector3D           nodeform_globalToLocalCoords(Amg::Vector3D x, Identifier id) const;
+    const Amg::Vector3D           nodeform_globalToLocalCoords(const Amg::Vector3D& x, Identifier id) const;
     const Amg::Transform3D       nodeform_globalToLocalTransf(Identifier id) const;
     // local(tube frame) to multilayer coord.
     const Amg::Vector3D           tubeToMultilayerCoords(Amg::Vector3D x, Identifier id) const;
@@ -106,9 +106,9 @@ public:
     const Amg::Vector3D     nodeform_tubeToMultilayerCoords(Amg::Vector3D x, Identifier id) const;
     const Amg::Transform3D nodeform_tubeToMultilayerTransf(Identifier id) const;
     // multilayer to local (tube frame) coords
-    const Amg::Vector3D           multilayerToTubeCoords(Amg::Vector3D x, Identifier id) const;
+    const Amg::Vector3D           multilayerToTubeCoords(const Amg::Vector3D& x, Identifier id) const;
     const Amg::Transform3D       multilayerToTubeTransf(Identifier id) const;
-    const Amg::Vector3D     nodeform_multilayerToTubeCoords(Amg::Vector3D x, Identifier id) const;
+    const Amg::Vector3D     nodeform_multilayerToTubeCoords(const Amg::Vector3D& x, Identifier id) const;
     const Amg::Transform3D nodeform_multilayerToTubeTransf(Identifier id) const;
 
     // in the native MDT reference system
@@ -134,10 +134,10 @@ public:
     double signedRODistanceFromTubeCentre(const int ml, const int tl, const int tube) const;
     double RODistanceFromTubeCentre(const Identifier& id) const;
     double RODistanceFromTubeCentre(const int ml, const int tl, const int tube) const;
-    double distanceFromRO(Amg::Vector3D GlobalHitPosition, Identifier id) const;
-    double distanceFromRO(Amg::Vector3D GlobalHitPosition, const int multilayer, const int tubelayer, const int tube) const;
-    int isAtReadoutSide(Amg::Vector3D GlobalHitPosition, Identifier id) const;
-    int isAtReadoutSide(Amg::Vector3D GlobalHitPosition, const int multilayer, const int tubelayer, const int tube) const;
+    double distanceFromRO(const Amg::Vector3D &GlobalHitPosition, Identifier id) const;
+    double distanceFromRO(const Amg::Vector3D &GlobalHitPosition, const int multilayer, const int tubelayer, const int tube) const;
+    int isAtReadoutSide(const Amg::Vector3D &GlobalHitPosition, Identifier id) const;
+    int isAtReadoutSide(const Amg::Vector3D &GlobalHitPosition, const int multilayer, const int tubelayer, const int tube) const;
     const Amg::Vector3D localROPos(const int multilayer, const int tubelayer, const int tube) const;
     const Amg::Vector3D ROPos(const int multilayer, const int tubelayer, const int tube) const;
     const Amg::Vector3D tubeFrame_localROPos(const int multilayer, const int tubelayer, const int tube) const;
@@ -204,8 +204,8 @@ private:
 
     Amg::Vector3D posOnDefChamWire(const Amg::Vector3D& locAMDBPos, double, double, double, double,
 	double, double, double, double, double, double, double, double,
-	double, double, double, const Amg::Vector3D fixedPoint) const;
-    Amg::Vector3D posOnDefChamWire(const Amg::Vector3D& locAMDBPos, const BLinePar* bLine, const Amg::Vector3D fixedPoint) const;
+	double, double, double, const Amg::Vector3D& fixedPoint) const;
+    Amg::Vector3D posOnDefChamWire(const Amg::Vector3D& locAMDBPos, const BLinePar* bLine, const Amg::Vector3D& fixedPoint) const;
     void wireEndpointsAsBuilt(Amg::Vector3D& locAMDBWireEndP, Amg::Vector3D& locAMDBWireEndN, const int multilayer, const int tubelayer, const int tube) const;
 
     // methods used only by friend class MdtAlignModule to shift chambers
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonClusterReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonClusterReadoutElement.h
index 212428b0d37d..4493106be1ec 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonClusterReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonClusterReadoutElement.h
@@ -57,7 +57,7 @@ namespace MuonGM {
     };
 
     
-    MuonClusterReadoutElement(GeoVFullPhysVol* pv, std::string stName,
+    MuonClusterReadoutElement(GeoVFullPhysVol* pv, const std::string& stName,
 			      int zi, int fi, bool is_mirrored,
 			      MuonDetectorManager* mgr);
     
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h
index 589def9a2505..b1f881988e6c 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h
@@ -288,10 +288,10 @@ namespace MuonGM {
 
     // Add a MuonStation to the list
     void addMuonStation(MuonStation* mst);
-    const MuonStation* getMuonStation (std::string stName, int eta, int phi) const;
-    MuonStation* getMuonStation (std::string stName, int eta, int phi);
+    const MuonStation* getMuonStation (const std::string &stName, int eta, int phi) const;
+    MuonStation* getMuonStation (const std::string &stName, int eta, int phi);
     //<! access to the MuonStation by StationName, Jzz, Jff (amdb indices!!!! not stationPhi and Eta)
-    std::string muonStationKey(std::string stName, int statEtaIndex, int statPhiIndex) const;
+    std::string muonStationKey(const std::string& stName, int statEtaIndex, int statPhiIndex) const;
 
     void clearCache();
     void refreshCache();
@@ -517,7 +517,7 @@ namespace MuonGM {
 
   void
     MuonDetectorManager::setGeometryVersion(std::string version)
-  {m_geometryVersion = version;}
+  {m_geometryVersion = std::move(version);}
 
   std::string MuonDetectorManager::get_DBMuonVersion() const
     {return m_DBMuonVersion;}
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h
index 70a238fde674..20a7784cfb2f 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h
@@ -120,7 +120,7 @@ public:
     inline bool sideA() const;
     inline bool sideC() const;
 
-    void setParentStationPV(PVConstLink);
+    void setParentStationPV(const PVConstLink&);
     void setParentStationPV();
     PVConstLink  parentStationPV()     const;
     const MuonStation* parentMuonStation() const;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h
index ffa152b75247..041fede8af77 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h
@@ -75,7 +75,7 @@ namespace MuonGM {
 
   public:
     /** constructor */
-    RpcReadoutElement(GeoVFullPhysVol* pv, std::string stName,
+    RpcReadoutElement(GeoVFullPhysVol* pv, const std::string& stName,
 		      int zi, int fi, bool is_mirrored,
 		      MuonDetectorManager* mgr);
 
@@ -213,7 +213,7 @@ namespace MuonGM {
     const Amg::Transform3D localToGlobalTransf(Identifier id) const;
     const Amg::Transform3D localToGlobalTransf(int dbZ, int dbPhi, int gasGap) const;
     // global to local
-    const Amg::Vector3D globalToLocalCoords(Amg::Vector3D x, Identifier id) const;
+    const Amg::Vector3D globalToLocalCoords(const Amg::Vector3D& x, Identifier id) const;
     const Amg::Transform3D globalToLocalTransf(Identifier id) const;
 
     const Amg::Vector3D stripPos(Identifier id) const;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h
index ff356c8a8fa8..f248d4c7e6ad 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h
@@ -61,7 +61,7 @@ namespace MuonGM {
 
   public:
 
-    TgcReadoutElement(GeoVFullPhysVol* pv, std::string stName,
+    TgcReadoutElement(GeoVFullPhysVol* pv, const std::string& stName,
 		      int zi, int fi, bool is_mirrored, MuonDetectorManager* mgr);
 
     virtual ~TgcReadoutElement();
@@ -135,11 +135,11 @@ namespace MuonGM {
     double StripPitch(int plane, int strip, float zlocal) const;
 
     // local to global
-    const Amg::Vector3D localToGlobalCoords(Amg::Vector3D x, Identifier id) const;
+    const Amg::Vector3D localToGlobalCoords(const Amg::Vector3D& x, Identifier id) const;
     const Amg::Transform3D localToGlobalTransf(Identifier id) const;
     const Amg::Transform3D localToGlobalTransf(int gasGap) const;
     // global to local
-    const Amg::Vector3D globalToLocalCoords(Amg::Vector3D x, Identifier id) const;
+    const Amg::Vector3D globalToLocalCoords(const Amg::Vector3D& x, Identifier id) const;
     const Amg::Transform3D globalToLocalTransf(Identifier id) const;
     //
     const Amg::Vector3D channelPos(int gasGap, int isStrip, int channel) const;
@@ -221,9 +221,9 @@ namespace MuonGM {
     float stripSkew(int, int) const;
     int   findChannel(int, int, Amg::Vector3D) const;
     int   findGang(int, Amg::Vector3D) const;
-    int   findStrip(int, Amg::Vector3D, Amg::Vector3D) const;
+    int   findStrip(int, Amg::Vector3D, const Amg::Vector3D&) const;
     int   gapVolume(int) const;
-    bool  isAgap(std::string) const;
+    bool  isAgap(const std::string&) const;
     bool  validGap(int) const;
     bool  validGang(int, int) const;
     bool  validStrip(int, int) const;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h
index 83ad62d2b227..dd092e06e0b2 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h
@@ -118,7 +118,7 @@ namespace MuonGM {
     void spacePointPosition( const Amg::Vector2D& phiPos, const Amg::Vector2D& etaPos, Amg::Vector2D& pos ) const;
 
     /** simHit local (SD) To Global position - to be used by MuonGeoAdaprors only      */
-    Amg::Vector3D localToGlobalCoords(Amg::Vector3D locPos, Identifier id) const;
+    Amg::Vector3D localToGlobalCoords(const Amg::Vector3D& locPos, Identifier id) const;
 
     /** @brief function to fill tracking cache */
     virtual void         fillCache() override final;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/CscReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/CscReadoutElement.cxx
index 1621ccae1c1d..79ba55b16ead 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/CscReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/CscReadoutElement.cxx
@@ -37,7 +37,7 @@ namespace Trk {
 
 namespace MuonGM {
 
-CscReadoutElement::CscReadoutElement(GeoVFullPhysVol* pv, std::string stName,
+CscReadoutElement::CscReadoutElement(GeoVFullPhysVol* pv, const std::string& stName,
                                      int zi, int fi, bool is_mirrored,
                                      MuonDetectorManager* mgr)
   : MuonClusterReadoutElement(pv, stName, zi, fi, is_mirrored, mgr),
@@ -113,7 +113,7 @@ CscReadoutElement::~CscReadoutElement()
 }
 
 
-const Amg::Vector3D CscReadoutElement::localToGlobalCoords(Amg::Vector3D x, Identifier id) const
+const Amg::Vector3D CscReadoutElement::localToGlobalCoords(const Amg::Vector3D& x, Identifier id) const
 {
     const Amg::Vector3D gasgapP = localWireLayerPos(id);
     const Amg::Translation3D xfp(gasgapP.x(),gasgapP.y(), gasgapP.z());
@@ -133,7 +133,7 @@ const Amg::Transform3D CscReadoutElement::localToGlobalTransf(Identifier id) con
     return absTransform()*xfp;    
 }
 
-const Amg::Vector3D CscReadoutElement::globalToLocalCoords(Amg::Vector3D x, Identifier id) const
+const Amg::Vector3D CscReadoutElement::globalToLocalCoords(const Amg::Vector3D& x, Identifier id) const
 {
     return localToGlobalTransf(id).inverse()*x;    
 }
@@ -527,7 +527,7 @@ const Amg::Vector3D CscReadoutElement::localClusterPos(int eta, int wireLayer,
 }
 
 //****************************************************************************
-const Amg::Vector3D CscReadoutElement::localPos(Amg::Vector3D globalP) const
+const Amg::Vector3D CscReadoutElement::localPos(const Amg::Vector3D& globalP) const
 {
   // localP is a local position
   const Amg::Transform3D cscTrans = absTransform();
@@ -535,7 +535,7 @@ const Amg::Vector3D CscReadoutElement::localPos(Amg::Vector3D globalP) const
 }
 
 //****************************************************************************
-const Amg::Vector3D CscReadoutElement::nominalGlobalPos(Amg::Vector3D localP) const
+const Amg::Vector3D CscReadoutElement::nominalGlobalPos(const Amg::Vector3D& localP) const
 {
   // globalP is a global position
   const Amg::Transform3D cscTrans = absTransform();
@@ -543,7 +543,7 @@ const Amg::Vector3D CscReadoutElement::nominalGlobalPos(Amg::Vector3D localP) co
 }
 
 //****************************************************************************
-const Amg::Vector3D CscReadoutElement::globalPos(Amg::Vector3D localP) const
+const Amg::Vector3D CscReadoutElement::globalPos(const Amg::Vector3D &localP) const
 {
   return nominalGlobalPos(localP);
 }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/GlobalUtilities.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/GlobalUtilities.cxx
index 0b75c43e73e3..e121ecce535e 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/GlobalUtilities.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/GlobalUtilities.cxx
@@ -36,7 +36,7 @@ std::string buildString(int i, int ncha)
     
 
 
-int strtoint(std::string str, unsigned int istart, unsigned int length)
+int strtoint(const std::string& str, unsigned int istart, unsigned int length)
 {
   std::string s(str.substr(istart,length));
   int result = std::stoi(s);
@@ -45,7 +45,7 @@ int strtoint(std::string str, unsigned int istart, unsigned int length)
 
 
 
-int stationPhiTGC(std::string stName, int fi, int zi_input, std::string geometry_version) 
+int stationPhiTGC(const std::string& stName, int fi, int zi_input, const std::string& geometry_version) 
 {
     // fi and zi_imput are the amdb indices (1, ... 8) and (-8, 8) are their ranges
     std::string stName3 = stName.substr(0,3);
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx
index d16f3b99524d..95c86d863591 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MMReadoutElement.cxx
@@ -45,7 +45,7 @@ namespace MuonGM {
   MMReadoutElement::MMReadoutElement(GeoVFullPhysVol* pv, std::string stName,
 				     int zi, int fi, int mL, bool is_mirrored,
 				     MuonDetectorManager* mgr)
-    : MuonClusterReadoutElement(pv, stName, zi, fi, is_mirrored, mgr),
+    : MuonClusterReadoutElement(pv, std::move(stName), zi, fi, is_mirrored, mgr),
       m_BLinePar(nullptr)
   {
     m_rots = 0.;
@@ -62,7 +62,7 @@ namespace MuonGM {
     setCachingFlag(mgr->cachingFlag());
 
     std::string vName = pv->getLogVol()->getName();
-    std::string sName = vName.substr(vName.find("-")+1);
+    std::string sName = vName.substr(vName.find('-')+1);
     std::string fixName = (sName[2]=='L') ? "MML" : "MMS";
 
     setStationName(fixName);
@@ -316,7 +316,7 @@ namespace MuonGM {
     return true;
   }
 
-  Amg::Vector3D MMReadoutElement::localToGlobalCoords(Amg::Vector3D locPos, Identifier id) const
+  Amg::Vector3D MMReadoutElement::localToGlobalCoords(const Amg::Vector3D& locPos, Identifier id) const
   {
     int gg = manager()->mmIdHelper()->gasGap(id);
     
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx
index fdeff8f914b3..441a136da2f5 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx
@@ -27,6 +27,7 @@
 #include "MuonAlignmentData/BLinePar.h"
 
 #include <limits>
+#include <utility>
 
 // From Dan Levin: MDT 
 // linear density of wire: lambda=wireLinearDensity=19.3 [gm/cm^3] * PI*
@@ -56,7 +57,7 @@ namespace {
 
 namespace MuonGM {
 
-MdtReadoutElement::MdtReadoutElement(GeoVFullPhysVol* pv, std::string stName,
+MdtReadoutElement::MdtReadoutElement(GeoVFullPhysVol* pv, const std::string& stName,
                                      int zi, int fi, bool is_mirrored,
                                      MuonDetectorManager* mgr)
   : MuonReadoutElement(pv, zi, fi, is_mirrored, mgr),
@@ -224,7 +225,7 @@ double MdtReadoutElement::tubeLength(Identifier id) const
   return getTubeLength(layer, tube);
 }
 
-double MdtReadoutElement::distanceFromRO(Amg::Vector3D x, Identifier id) const
+double MdtReadoutElement::distanceFromRO(const Amg::Vector3D &x, Identifier id) const
 {
   // x is given in the global reference frame
   const MdtIdHelper* idh = manager()->mdtIdHelper();
@@ -256,7 +257,7 @@ double MdtReadoutElement::distanceFromRO(Amg::Vector3D x, Identifier id) const
 
 
 double 
-MdtReadoutElement::distanceFromRO(Amg::Vector3D x, int multilayer, int tubelayer, int tube) const
+MdtReadoutElement::distanceFromRO(const Amg::Vector3D &x, int multilayer, int tubelayer, int tube) const
 {
   // x is given in the global reference frame
   const MdtIdHelper* idh = manager()->mdtIdHelper();
@@ -265,7 +266,7 @@ MdtReadoutElement::distanceFromRO(Amg::Vector3D x, int multilayer, int tubelayer
 }
 
 
-int MdtReadoutElement::isAtReadoutSide(Amg::Vector3D GlobalHitPosition, Identifier id) const
+int MdtReadoutElement::isAtReadoutSide(const Amg::Vector3D &GlobalHitPosition, Identifier id) const
 {
     const MdtIdHelper* idh = manager()->mdtIdHelper();
     int tubel = idh->tubeLayer(id);
@@ -288,7 +289,7 @@ int MdtReadoutElement::isAtReadoutSide(Amg::Vector3D GlobalHitPosition, Identifi
         return -1;
     }
 }
-int MdtReadoutElement::isAtReadoutSide(Amg::Vector3D GlobalHitPosition, int ml, int tubel, int tube) const
+int MdtReadoutElement::isAtReadoutSide(const Amg::Vector3D &GlobalHitPosition, int ml, int tubel, int tube) const
 {
     double distance = distanceFromRO(GlobalHitPosition, ml, tubel, tube);
     if (distance < 0) {
@@ -661,7 +662,7 @@ const Amg::Transform3D  MdtReadoutElement::nodeform_tubeToMultilayerTransf(Ident
 }
 
 const Amg::Vector3D 
-MdtReadoutElement::multilayerToTubeCoords(Amg::Vector3D x, Identifier id) const
+MdtReadoutElement::multilayerToTubeCoords(const Amg::Vector3D& x, Identifier id) const
 {
   const Amg::Vector3D tp = nodeform_localTubePos(id);
   const Amg::Translation3D xfp(-tp.x(), -tp.y(), -tp.z());
@@ -670,7 +671,7 @@ MdtReadoutElement::multilayerToTubeCoords(Amg::Vector3D x, Identifier id) const
 }
 
 const Amg::Vector3D 
-MdtReadoutElement::nodeform_multilayerToTubeCoords(Amg::Vector3D x, Identifier id) const
+MdtReadoutElement::nodeform_multilayerToTubeCoords(const Amg::Vector3D& x, Identifier id) const
 {
   const Amg::Vector3D tp = nodeform_localTubePos(id);
   const Amg::Translation3D xfp(-tp.x(), -tp.y(), -tp.z());
@@ -692,7 +693,7 @@ const Amg::Transform3D  MdtReadoutElement::nodeform_multilayerToTubeTransf(Ident
 }
 
 const Amg::Vector3D 
-MdtReadoutElement::localToGlobalCoords(Amg::Vector3D x, Identifier id) const
+MdtReadoutElement::localToGlobalCoords(const Amg::Vector3D& x, Identifier id) const
 {
   return transform(id)*x;
 }
@@ -756,13 +757,13 @@ MdtReadoutElement::nodeform_globalToLocalTransf(Identifier id) const
   return mytransf;
 }
 
-const Amg::Vector3D MdtReadoutElement::globalToLocalCoords(Amg::Vector3D x, Identifier id) const
+const Amg::Vector3D MdtReadoutElement::globalToLocalCoords(const Amg::Vector3D& x, Identifier id) const
 {
     const Amg::Transform3D mytransf = globalToLocalTransf(id);
     Amg::Vector3D xx = mytransf * x;
     return xx;
 }
-const Amg::Vector3D MdtReadoutElement::nodeform_globalToLocalCoords(Amg::Vector3D x, Identifier id) const
+const Amg::Vector3D MdtReadoutElement::nodeform_globalToLocalCoords(const Amg::Vector3D& x, Identifier id) const
 {
     const Amg::Transform3D mytransf = nodeform_globalToLocalTransf(id);
     Amg::Vector3D xx = mytransf * x;
@@ -1006,7 +1007,7 @@ MdtReadoutElement::deformedTransform (int multilayer, int tubelayer, int tube) c
 
 
 Amg::Vector3D
-MdtReadoutElement::posOnDefChamWire( const Amg::Vector3D& locAMDBPos, const BLinePar* bLine, const Amg::Vector3D fixedPoint) const
+MdtReadoutElement::posOnDefChamWire( const Amg::Vector3D& locAMDBPos, const BLinePar* bLine, const Amg::Vector3D& fixedPoint) const
 {
 
   double height = m_inBarrel ? m_Zsize : m_Rsize;
@@ -1050,7 +1051,7 @@ MdtReadoutElement::posOnDefChamWire( const Amg::Vector3D& locAMDBPos,
     double width_narrow, double width_wide, double height, double thickness,
     double /*bz*/, double /*bp*/, double /*bn*/, double sp, double sn, double tw,
     double /*pg*/, double /*tr*/, double eg, double ep, double en, 
-    const Amg::Vector3D fixedPoint) const
+    const Amg::Vector3D& fixedPoint) const
 {
   // S.Spagnolo Feb.6, 2011, modified by P.F Giraud, 2015-01-17
   // This version does not implement deformations modifying only the second
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonClusterReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonClusterReadoutElement.cxx
index a688fc887c24..59ff18ec9b5a 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonClusterReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonClusterReadoutElement.cxx
@@ -9,7 +9,7 @@ class GeoVFullPhysVol;
 namespace MuonGM {
 
 
-  MuonClusterReadoutElement::MuonClusterReadoutElement(GeoVFullPhysVol* pv, std::string,
+  MuonClusterReadoutElement::MuonClusterReadoutElement(GeoVFullPhysVol* pv, const std::string&,
 						       int zi, int fi, bool is_mirrored,
 						       MuonDetectorManager* mgr)
     : MuonReadoutElement(pv, zi, fi, is_mirrored, mgr), m_surfaceData(nullptr)
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx
index b60cc3e9c471..168be6ce9d9b 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx
@@ -24,6 +24,8 @@
 
 #include <TString.h> // for Form
 
+#include <utility>
+
 #ifndef SIMULATIONBASE
 #include "MuonCondSvc/NSWCondUtils.h"
 #endif
@@ -259,7 +261,7 @@ void MuonDetectorManager::addMuonStation (MuonStation* mst)
 }
 
 std::string
-MuonDetectorManager::muonStationKey(std::string stName, int statEtaIndex, int statPhiIndex) const
+MuonDetectorManager::muonStationKey(const std::string& stName, int statEtaIndex, int statPhiIndex) const
 {
     std::string key;
     if (statEtaIndex<0)
@@ -274,7 +276,7 @@ MuonDetectorManager::muonStationKey(std::string stName, int statEtaIndex, int st
 }
 
 const MuonStation*
-MuonDetectorManager::getMuonStation(std::string stName, int stEtaIndex, int stPhiIndex) const
+MuonDetectorManager::getMuonStation(const std::string &stName, int stEtaIndex, int stPhiIndex) const
 {
 
     std::string key = muonStationKey(stName, stEtaIndex, stPhiIndex);
@@ -285,7 +287,7 @@ MuonDetectorManager::getMuonStation(std::string stName, int stEtaIndex, int stPh
 }
 
 MuonStation*
-MuonDetectorManager::getMuonStation(std::string stName, int stEtaIndex, int stPhiIndex)
+MuonDetectorManager::getMuonStation(const std::string &stName, int stEtaIndex, int stPhiIndex)
 {
 
     std::string key = muonStationKey(stName, stEtaIndex, stPhiIndex);
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx
index 3fc12149c13c..356bfcaaea51 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx
@@ -91,7 +91,7 @@ namespace MuonGM {
     return (!largeSector());
   }
 
-  void MuonReadoutElement::setParentStationPV(PVConstLink x)
+  void MuonReadoutElement::setParentStationPV(const PVConstLink& x)
   {
     m_parentStationPV = x;
     setIndexOfREinMuonStation();
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx
index c35a4cfe3a77..cf89b0a461e5 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx
@@ -14,6 +14,7 @@
 #include "GaudiKernel/MsgStream.h"
 
 #include <iomanip>
+#include <utility>
 
 namespace MuonGM {
 
@@ -22,7 +23,7 @@ MuonStation::MuonStation(std::string stName,
                          double LongSsize, double LongRsize, double LongZsize, int zi, int fi, 
                          bool descratzneg)
 {
-  m_statname    = stName;
+  m_statname    = std::move(stName);
   m_Ssize       = Ssize      ;
   m_Rsize       = Rsize      ;
   m_Zsize       = Zsize      ;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx
index f0bea6420af8..500d50c1cb24 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx
@@ -37,7 +37,7 @@ namespace {
 namespace MuonGM {
 
 
-  RpcReadoutElement::RpcReadoutElement(GeoVFullPhysVol* pv, std::string stName,
+  RpcReadoutElement::RpcReadoutElement(GeoVFullPhysVol* pv, const std::string& stName,
 				       int zi, int fi, bool is_mirrored,
 				       MuonDetectorManager* mgr)
     : MuonClusterReadoutElement(pv, stName, zi, fi, is_mirrored, mgr),
@@ -676,7 +676,7 @@ namespace MuonGM {
   {
     return localToGlobalTransf(id).inverse();
   }
-  const Amg::Vector3D RpcReadoutElement::globalToLocalCoords(Amg::Vector3D x, Identifier id) const
+  const Amg::Vector3D RpcReadoutElement::globalToLocalCoords(const Amg::Vector3D& x, Identifier id) const
   {
     return globalToLocalTransf(id)*x;
   }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx
index fa6bba6fd8bf..60f7d9063550 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx
@@ -30,7 +30,7 @@ namespace Trk {
 
 namespace MuonGM {
 
-TgcReadoutElement::TgcReadoutElement(GeoVFullPhysVol* pv, std::string stName,
+TgcReadoutElement::TgcReadoutElement(GeoVFullPhysVol* pv, const std::string& stName,
                                      int zi, int fi, bool is_mirrored,
                                      MuonDetectorManager* mgr)
   : MuonClusterReadoutElement(pv, stName, zi, fi, is_mirrored, mgr),
@@ -66,7 +66,7 @@ const Amg::Transform3D TgcReadoutElement::localToGlobalTransf(Identifier id) con
   return absTransform()*xfp;
 }
 
-const Amg::Vector3D TgcReadoutElement::localToGlobalCoords(Amg::Vector3D x, Identifier id) const
+const Amg::Vector3D TgcReadoutElement::localToGlobalCoords(const Amg::Vector3D& x, Identifier id) const
 {
   const Amg::Vector3D gasgapP = localGasGapPos(id);
   const Amg::Translation3D xfp(gasgapP.x(),gasgapP.y(), gasgapP.z());
@@ -78,7 +78,7 @@ const Amg::Transform3D TgcReadoutElement::globalToLocalTransf(Identifier id) con
   return localToGlobalTransf(id).inverse();
 }
 
-const Amg::Vector3D TgcReadoutElement::globalToLocalCoords(Amg::Vector3D x, Identifier id) const
+const Amg::Vector3D TgcReadoutElement::globalToLocalCoords(const Amg::Vector3D& x, Identifier id) const
 {
   return globalToLocalTransf(id)*x;
 }
@@ -766,7 +766,7 @@ int TgcReadoutElement::findGang(int gasGap, Amg::Vector3D localPos) const
 }
 
 int TgcReadoutElement::findStrip(int gasGap,
-                                 Amg::Vector3D localPos, Amg::Vector3D /*globalPos*/) const
+                                 Amg::Vector3D localPos, const Amg::Vector3D& /*globalPos*/) const
 {
     if(! validGap(gasGap) ) throw;
 
@@ -798,7 +798,7 @@ int TgcReadoutElement::gapVolume(int gasGap) const
     throw;
 }
 
-bool TgcReadoutElement::isAgap(std::string volumeMaterial) const
+bool TgcReadoutElement::isAgap(const std::string& volumeMaterial) const
 {
     return ("TGCGas" == volumeMaterial);
 }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutParams.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutParams.cxx
index 57ca20acb984..f4d03b6f5dd0 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutParams.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutParams.cxx
@@ -12,13 +12,15 @@
 #include "AthenaKernel/getMessageSvc.h"
 #include <GaudiKernel/IMessageSvc.h>
 
+#include <utility>
+
 namespace MuonGM {
 
 TgcReadoutParams::TgcReadoutParams(std::string name, int iCh, int Version, float WireSp, const float NCHRNG,
                                      const float* NWGS, const float* IWGS1, const float* IWGS2,
                                      const float* IWGS3, const float* ROFFST, const float* NSPS,
 				   const float* POFFST)
-  :m_chamberName(name), m_chamberType(iCh), m_readoutVersion(Version),
+  :m_chamberName(std::move(name)), m_chamberType(iCh), m_readoutVersion(Version),
    m_wirePitch(WireSp), m_nPhiChambers((int)NCHRNG), m_physicalDistanceFromBase(-9999.)
 {
 
@@ -55,7 +57,7 @@ TgcReadoutParams::TgcReadoutParams(std::string name, int iCh, int Version, float
                                    const float* NWGS, const float* IWGS1, const float* IWGS2, const float* IWGS3,
                                    float PDIST, const float* SLARGE, const float* SSHORT, 
                                    const float* ROFFST, const float* NSPS, const float* POFFST)
-  : m_chamberName(name), m_chamberType(iCh), m_readoutVersion(Version),
+  : m_chamberName(std::move(name)), m_chamberType(iCh), m_readoutVersion(Version),
     m_wirePitch(WireSp), m_nPhiChambers(NCHRNG)
 {
   for (int iGap = 0; iGap < MaxNGaps; ++iGap) {
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx
index acbce6bd1e14..58e611b0c0af 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/sTgcReadoutElement.cxx
@@ -37,13 +37,14 @@
 #include <memory>
 #include <cmath>
 #include <stdexcept>
+#include <utility>
 
 namespace MuonGM {
 
   sTgcReadoutElement::sTgcReadoutElement(GeoVFullPhysVol* pv, std::string stName,
 					 int zi, int fi, int mL, bool is_mirrored,
 					 MuonDetectorManager* mgr)
-    : MuonClusterReadoutElement(pv, stName, zi, fi, is_mirrored, mgr),
+    : MuonClusterReadoutElement(pv, std::move(stName), zi, fi, is_mirrored, mgr),
       m_BLinePar(nullptr)
   {
     m_rots = 0.;
@@ -60,7 +61,7 @@ namespace MuonGM {
     setCachingFlag(mgr->cachingFlag());
 
     std::string vName = pv->getLogVol()->getName();
-    std::string sName = vName.substr(vName.find("-")+1);
+    std::string sName = vName.substr(vName.find('-')+1);
     std::string fixName = (sName[1]=='L') ? "STL" : "STS";
 	
     setStationName(fixName);
@@ -507,7 +508,7 @@ namespace MuonGM {
   }
 
 
-  Amg::Vector3D sTgcReadoutElement::localToGlobalCoords(Amg::Vector3D locPos, Identifier id) const
+  Amg::Vector3D sTgcReadoutElement::localToGlobalCoords(const Amg::Vector3D& locPos, Identifier id) const
   {
     int gg = manager()->stgcIdHelper()->gasGap(id);
     int channelType = manager()->stgcIdHelper()->channelType(id);
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/CscMultiLayer.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/CscMultiLayer.h
index 91128993aa1c..34a240963c60 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/CscMultiLayer.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/CscMultiLayer.h
@@ -34,7 +34,7 @@ namespace MuonGM {
       public: // methods
         CscMultiLayer(std::string n);
         GeoVPhysVol *build();
-        GeoVPhysVol *build(int cutoutson, std::vector<Cutout *> vcutdef);
+        GeoVPhysVol *build(int cutoutson, const std::vector<Cutout *>& vcutdef);
         void print();
     };
 
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/FPVMAP.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/FPVMAP.h
index 2e37b78cfc4b..005c83e48338 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/FPVMAP.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/FPVMAP.h
@@ -23,8 +23,8 @@ namespace MuonGM {
         inline int NDetectors();
         inline int NDetectorsReused();
 
-        GeoVPhysVol *GetDetector(std::string name);
-        void StoreDetector(GeoVPhysVol *s, std::string name);
+        GeoVPhysVol *GetDetector(const std::string& name);
+        void StoreDetector(GeoVPhysVol *s, const std::string& name);
         void PrintAllDetectors();
 
       private:
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MMSpacer.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MMSpacer.h
index f18eb08f512f..536307656599 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MMSpacer.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MMSpacer.h
@@ -28,7 +28,7 @@ namespace MuonGM {
 
         MMSpacer(Component *s);
         GeoPhysVol *build(int minimalgeo);
-        GeoPhysVol *build(int minimalgeo, int cutoutson, std::vector<Cutout *>);
+        GeoPhysVol *build(int minimalgeo, int cutoutson, const std::vector<Cutout *>&);
         void print();
 
       private:
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MYSQL.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MYSQL.h
index 5b32c68a8bb5..8fa89af89d62 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MYSQL.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MYSQL.h
@@ -44,13 +44,13 @@ namespace MuonGM {
         ~MYSQL();
         inline bool amdb_from_RDB() const;
         inline void set_amdb_from_RDB(bool);
-        inline void set_DBMuonVersion(std::string);
+        inline void set_DBMuonVersion(const std::string&);
         inline std::string get_DBMuonVersion();
-        inline void setGeometryVersion(std::string s);
+        inline void setGeometryVersion(const std::string& s);
         inline std::string getGeometryVersion() const;
         inline void setCtbBisFlag(int i);
         inline int getCtbBisFlag() const;
-        inline void setLayoutName(std::string s);
+        inline void setLayoutName(const std::string& s);
         inline std::string getLayoutName() const;
         inline void setCutoutsBogFlag(int i);
         inline int getCutoutsBogFlag() const;
@@ -69,38 +69,38 @@ namespace MuonGM {
         inline AllocposIterator AllocposEnd();
         inline AllocposIterator AllocposFind(int);
         inline std::string AllocposFindName(int);
-        inline void addAllocpos(int i, std::string str);
+        inline void addAllocpos(int i, const std::string& str);
         // the new ones
-        std::string allocPosBuildKey(std::string statType, int fi, int zi);
+        std::string allocPosBuildKey(const std::string& statType, int fi, int zi);
         inline int allocPosBuildValue(int subtype, int cutout);
         inline allocPosIterator allocPosBegin();
         inline allocPosIterator allocPosEnd();
-        inline allocPosIterator allocPosFind(std::string key);
-        allocPosIterator allocPosFind(std::string statType, int fi, int zi);
-        int allocPosFindSubtype(std::string statType, int fi, int zi);
-        inline int allocPosFindSubtype(std::string key);
+        inline allocPosIterator allocPosFind(const std::string& key);
+        allocPosIterator allocPosFind(const std::string& statType, int fi, int zi);
+        int allocPosFindSubtype(const std::string& statType, int fi, int zi);
+        inline int allocPosFindSubtype(const std::string& key);
         inline int allocPosFindSubtype(allocPosIterator it);
-        int allocPosFindCutout(std::string statType, int fi, int zi);
-        inline int allocPosFindCutout(std::string key);
+        int allocPosFindCutout(const std::string& statType, int fi, int zi);
+        inline int allocPosFindCutout(const std::string& key);
         inline int allocPosFindCutout(allocPosIterator it);
-        inline void addallocPos(std::string key, int value);
-        void addallocPos(std::string statType, int fi, int zi, int subtyp, int cutout);
-        inline void addallocPos(std::string key, int subtype, int cutout);
+        inline void addallocPos(const std::string& key, int value);
+        void addallocPos(const std::string& statType, int fi, int zi, int subtyp, int cutout);
+        inline void addallocPos(const std::string& key, int subtype, int cutout);
 
         inline int NStations();
         inline int NTgcReadTypes();
 
         static MYSQL *GetPointer();
-        Station *GetStation(std::string name);
-        Position GetStationPosition(std::string nameType, int fi, int zi);
-        TgcReadoutParams *GetTgcRPars(std::string name);
+        Station *GetStation(const std::string& name);
+        Position GetStationPosition(const std::string& nameType, int fi, int zi);
+        TgcReadoutParams *GetTgcRPars(const std::string& name);
         TgcReadoutParams *GetTgcRPars(int i);
         void StoreStation(Station *s);
         void PrintAllStations();
         void StoreTechnology(Technology *t);
         void StoreTgcRPars(TgcReadoutParams *t);
-        Technology *GetTechnology(std::string name);
-        Technology *GetATechnology(std::string name);
+        Technology *GetTechnology(const std::string& name);
+        Technology *GetATechnology(const std::string& name);
         void PrintTechnologies();
 
         // singleton
@@ -126,7 +126,7 @@ namespace MuonGM {
         int m_controlAlines;
     };
 
-    void MYSQL::addAllocpos(int i, std::string str) { m_allocatedpos[i] = str; }
+    void MYSQL::addAllocpos(int i, const std::string& str) { m_allocatedpos[i] = str; }
 
     AllocposIterator MYSQL::AllocposEnd() { return m_allocatedpos.end(); }
 
@@ -162,7 +162,7 @@ namespace MuonGM {
 
     allocPosIterator MYSQL::allocPosEnd() { return m_allocPos.end(); }
 
-    allocPosIterator MYSQL::allocPosFind(std::string key) { return m_allocPos.find(key); }
+    allocPosIterator MYSQL::allocPosFind(const std::string& key) { return m_allocPos.find(key); }
 
     int MYSQL::allocPosFindSubtype(allocPosIterator it) {
         int value = it->second;
@@ -176,9 +176,9 @@ namespace MuonGM {
         return cutout;
     }
 
-    void MYSQL::addallocPos(std::string key, int value) { m_allocPos[key] = value; }
+    void MYSQL::addallocPos(const std::string& key, int value) { m_allocPos[key] = value; }
 
-    void MYSQL::addallocPos(std::string key, int subtype, int cutout) { m_allocPos[key] = allocPosBuildValue(subtype, cutout); }
+    void MYSQL::addallocPos(const std::string& key, int subtype, int cutout) { m_allocPos[key] = allocPosBuildValue(subtype, cutout); }
 
     std::string MYSQL::getGeometryVersion() const { return m_geometry_version; }
 
@@ -200,7 +200,7 @@ namespace MuonGM {
 
     void MYSQL::set_amdb_from_RDB(bool val) { m_amdb_from_rdb = val; }
 
-    void MYSQL::set_DBMuonVersion(std::string a) { m_DBMuonVersion = a; }
+    void MYSQL::set_DBMuonVersion(const std::string& a) { m_DBMuonVersion = a; }
 
     std::string MYSQL::get_DBMuonVersion() { return m_DBMuonVersion; }
 
@@ -208,7 +208,7 @@ namespace MuonGM {
 
     int MYSQL::controlAlines() const { return m_controlAlines; }
 
-    void MYSQL::setGeometryVersion(std::string s) {
+    void MYSQL::setGeometryVersion(const std::string &s) {
         MsgStream log(Athena::getMessageSvc(), "MuonGeoModel.MYSQL");
 
         if (m_geometry_version != "unknown") {
@@ -228,7 +228,7 @@ namespace MuonGM {
             log << MSG::VERBOSE << "setNovaReadVersion to " << m_amdb_version << endmsg;
     }
 
-    void MYSQL::setLayoutName(std::string s) {
+    void MYSQL::setLayoutName(const std::string& s) {
         MsgStream log(Athena::getMessageSvc(), "MuonGeoModel.MYSQL");
         if (m_layout_name != "unknown") {
             if (s == m_layout_name)
@@ -247,7 +247,7 @@ namespace MuonGM {
             log << MSG::VERBOSE << "setNovaVersion to " << m_nova_version << endmsg;
     }
 
-    int MYSQL::allocPosFindCutout(std::string key) {
+    int MYSQL::allocPosFindCutout(const std::string& key) {
         int cutout = 0;
         allocPosIterator it = m_allocPos.find(key);
         if (it != allocPosEnd()) {
@@ -259,7 +259,7 @@ namespace MuonGM {
         return cutout;
     }
 
-    int MYSQL::allocPosFindSubtype(std::string key) {
+    int MYSQL::allocPosFindSubtype(const std::string& key) {
         int subtype = 0;
         allocPosIterator it = m_allocPos.find(key);
         if (it != allocPosEnd()) {
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/Mdt.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/Mdt.h
index 5d1202b29690..37da132f8dc1 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/Mdt.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/Mdt.h
@@ -30,7 +30,7 @@ namespace MuonGM {
         double tubelenStepSize;
         double tubePitch;
 
-        Mdt(Component *s1, std::string s2);
+        Mdt(Component *s1, const std::string& s2);
         ~Mdt();
         MultiLayer *layer;
         GeoFullPhysVol *build();
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/Micromegas.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/Micromegas.h
index 825f791ab20d..f49ddf7c50bc 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/Micromegas.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/Micromegas.h
@@ -28,7 +28,7 @@ namespace MuonGM {
 
         Micromegas(Component *s);
         GeoFullPhysVol *build(int minimalgeo);
-        GeoFullPhysVol *build(int minimalgeo, int cutoutson, std::vector<Cutout *>);
+        GeoFullPhysVol *build(int minimalgeo, int cutoutson, const std::vector<Cutout *>&);
         void print();
 
       private:
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonChamber.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonChamber.h
index 2ff4e7bd31b6..4ed2fda6ad8b 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonChamber.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonChamber.h
@@ -34,7 +34,7 @@ namespace MuonGM {
 
         double rotangle[10];
 
-        int stationPhiTGC(std::string stName, int fi, int zi, std::string geometry_version) const;
+        int stationPhiTGC(const std::string& stName, int fi, int zi, const std::string& geometry_version) const;
         inline void setFineClashFixingFlag(int value);
 
         MuonChamber(Station *s);
@@ -43,10 +43,10 @@ namespace MuonGM {
         inline void setFPVMAP(FPVMAP *fpvmap);
 
       private:
-        void setCscReadoutGeom(CscReadoutElement *re, const CscComponent *cc, const Position &p, std::string geomVers, std::string statname);
+        void setCscReadoutGeom(CscReadoutElement *re, const CscComponent *cc, const Position &p, const std::string& geomVers, const std::string& statname);
         void setMdtReadoutGeom(MdtReadoutElement *re, const MdtComponent *cc, const Position &p);
-        void setRpcReadoutGeom(RpcReadoutElement *re, const RpcComponent *cc, const Position &p, std::string geomVers, MuonDetectorManager *manager);
-        void setTgcReadoutGeom(TgcReadoutElement *re, const TgcComponent *cc, const Position &p, std::string geomVers, std::string statname);
+        void setRpcReadoutGeom(RpcReadoutElement *re, const RpcComponent *cc, const Position &p, const std::string& geomVers, MuonDetectorManager *manager);
+        void setTgcReadoutGeom(TgcReadoutElement *re, const TgcComponent *cc, const Position &p, const std::string& geomVers, const std::string& statname);
 
         Station *m_station;
         IMessageSvc *m_msgSvc;
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/RDBReaderAtlas.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/RDBReaderAtlas.h
index 953e5c304293..25854e1e4f7c 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/RDBReaderAtlas.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/RDBReaderAtlas.h
@@ -19,7 +19,7 @@ namespace MuonGM {
 
     class RDBReaderAtlas : public DBReader {
       public:
-        RDBReaderAtlas(StoreGateSvc *pDetStore, IRDBAccessSvc *m_pRDBAccess, std::string geoTag, std::string geoNode, bool dumpAlines, bool dumpICSCAlines, bool useICSCAlines,
+        RDBReaderAtlas(StoreGateSvc *pDetStore, IRDBAccessSvc *m_pRDBAccess, const std::string& geoTag, const std::string& geoNode, bool dumpAlines, bool dumpICSCAlines, bool useICSCAlines,
                        const std::map<std::string, std::string> *asciiFileDBMap = 0);
         ~RDBReaderAtlas();
         StatusCode ProcessDB();
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/StationSelector.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/StationSelector.h
index b2a6be102187..3c728320529e 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/StationSelector.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/StationSelector.h
@@ -17,7 +17,7 @@ namespace MuonGM {
     class StationSelector {
       public:
         typedef std::map<std::string, Station *, std::less<std::string>>::const_iterator StationIterator;
-        StationSelector(std::string filename);
+        StationSelector(const std::string& filename);
         StationSelector(std::vector<std::string> s);
         StationIterator begin();
         StationIterator end();
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/sTGC.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/sTGC.h
index 1ec653b2a3ff..e7cbd682279d 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/sTGC.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/sTGC.h
@@ -30,7 +30,7 @@ namespace MuonGM {
 
         sTGC(Component *s);
         GeoFullPhysVol *build(int minimalgeo);
-        GeoFullPhysVol *build(int minimalgeo, int cutoutson, std::vector<Cutout *>);
+        GeoFullPhysVol *build(int minimalgeo, int cutoutson, const std::vector<Cutout *>&);
         void print();
 
       private:
diff --git a/MuonSpectrometer/MuonGeoModel/src/Csc.cxx b/MuonSpectrometer/MuonGeoModel/src/Csc.cxx
index e2a83b4da384..c1afcb4f1a7e 100644
--- a/MuonSpectrometer/MuonGeoModel/src/Csc.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/Csc.cxx
@@ -22,6 +22,7 @@
 #include <GeoModelKernel/GeoShape.h>
 #include <GeoModelKernel/GeoVPhysVol.h>
 #include <string>
+#include <utility>
 
 class GeoMaterial;
 
@@ -91,7 +92,7 @@ namespace MuonGM {
         if (minimalgeo == 1)
             return pcsc;
 
-        GeoVPhysVol *lay = layer->build(cutoutson, vcutdef);
+        GeoVPhysVol *lay = layer->build(cutoutson, std::move(vcutdef));
         if (!skip_csc)
             pcsc->add(lay);
 
diff --git a/MuonSpectrometer/MuonGeoModel/src/CscMultilayer.cxx b/MuonSpectrometer/MuonGeoModel/src/CscMultilayer.cxx
index 62396d9ed869..3de62c1c45ed 100644
--- a/MuonSpectrometer/MuonGeoModel/src/CscMultilayer.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/CscMultilayer.cxx
@@ -25,6 +25,7 @@
 #include <math.h>
 #include <stddef.h>
 #include <string>
+#include <utility>
 #include <vector>
 
 class GeoMaterial;
@@ -35,7 +36,7 @@ namespace MuonGM {
 
 namespace MuonGM {
 
-    CscMultiLayer::CscMultiLayer(std::string n) : DetectorElement(n), width(0.), longWidth(0.), upWidth(0.), excent(0.), length(0.), physicalLength(0.), maxwLength(0.) {
+    CscMultiLayer::CscMultiLayer(std::string n) : DetectorElement(std::move(n)), width(0.), longWidth(0.), upWidth(0.), excent(0.), length(0.), physicalLength(0.), maxwLength(0.) {
         MYSQL *amdb = MYSQL::GetPointer();
         CSC *md = (CSC *)amdb->GetTechnology(name);
         nrOfLayers = md->numOfLayers;
@@ -49,7 +50,7 @@ namespace MuonGM {
         return build(cutoutson, vcutdef);
     }
 
-    GeoVPhysVol *CscMultiLayer::build(int /*cutoutson*/, std::vector<Cutout *> /*vcutdef*/) {
+    GeoVPhysVol *CscMultiLayer::build(int /*cutoutson*/, const std::vector<Cutout *>& /*vcutdef*/) {
         MYSQL *amdb = MYSQL::GetPointer();
         CSC *md = (CSC *)amdb->GetTechnology(name);
 
diff --git a/MuonSpectrometer/MuonGeoModel/src/DBReader.cxx b/MuonSpectrometer/MuonGeoModel/src/DBReader.cxx
index c3c137c193a3..0cd538ff1d57 100644
--- a/MuonSpectrometer/MuonGeoModel/src/DBReader.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/DBReader.cxx
@@ -2,6 +2,8 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
+#include <utility>
+
 #include "MuonGeoModel/DBReader.h"
 
 #include "StoreGate/StoreGateSvc.h"
@@ -13,7 +15,7 @@ namespace MuonGM {
         m_msgSvc = Athena::getMessageSvc();
     }
 
-    void DBReader::setGeometryVersion(std::string geoVersion) { m_version = geoVersion; }
+    void DBReader::setGeometryVersion(std::string geoVersion) { m_version = std::move(geoVersion); }
 
     std::string DBReader::getGeometryVersion() const { return m_version; }
 
diff --git a/MuonSpectrometer/MuonGeoModel/src/DED_Technology.cxx b/MuonSpectrometer/MuonGeoModel/src/DED_Technology.cxx
index eaa526c60fb6..e065a02adb12 100644
--- a/MuonSpectrometer/MuonGeoModel/src/DED_Technology.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/DED_Technology.cxx
@@ -10,10 +10,12 @@
 //<doc><file>	$Id: DED_Technology.cxx,v 1.1 2008-07-31 10:57:55 dquarrie Exp $
 //<version>	$Name: not supported by cvs2svn $
 
+#include <utility>
+
 #include "MuonGeoModel/DED_Technology.h"
 
 namespace MuonGM {
 
-    DED::DED(std::string s) : Technology(s), AlThickness(0.), HoneyCombThickness(0.) {}
+    DED::DED(std::string s) : Technology(std::move(s)), AlThickness(0.), HoneyCombThickness(0.) {}
 
 } // namespace MuonGM
diff --git a/MuonSpectrometer/MuonGeoModel/src/DriftTube.cxx b/MuonSpectrometer/MuonGeoModel/src/DriftTube.cxx
index b26dba8095d7..e4790a7916a2 100644
--- a/MuonSpectrometer/MuonGeoModel/src/DriftTube.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/DriftTube.cxx
@@ -20,11 +20,12 @@
 #include <GaudiKernel/MsgStream.h>
 #include <iostream>
 #include <string>
+#include <utility>
 
 namespace MuonGM {
 
     DriftTube::DriftTube(std::string n)
-        : DetectorElement(n), length(0.) // length is set in MultiLayer.cxx
+        : DetectorElement(std::move(n)), length(0.) // length is set in MultiLayer.cxx
     {
         gasMaterial = "muo::ArCO2";
         tubeMaterial = "std::Aluminium";
diff --git a/MuonSpectrometer/MuonGeoModel/src/FPVMAP.cxx b/MuonSpectrometer/MuonGeoModel/src/FPVMAP.cxx
index f4485f3b5da2..315e19cef08c 100644
--- a/MuonSpectrometer/MuonGeoModel/src/FPVMAP.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/FPVMAP.cxx
@@ -16,7 +16,7 @@ namespace MuonGM {
 
     FPVMAP::FPVMAP() { m_nreused = 0; }
 
-    GeoVPhysVol *FPVMAP::GetDetector(std::string name) {
+    GeoVPhysVol *FPVMAP::GetDetector(const std::string& name) {
         if (m_Detectors.find(name) != m_Detectors.end()) {
             m_nreused++;
             // std::cout<<"FPVMAP:: the pointer to "<<name
@@ -26,7 +26,7 @@ namespace MuonGM {
             return 0;
     }
 
-    void FPVMAP::StoreDetector(GeoVPhysVol *s, std::string name) {
+    void FPVMAP::StoreDetector(GeoVPhysVol *s, const std::string& name) {
         // std::cout<<"FPVMAP:: store the pointer to "<<name<<std::endl;
         m_Detectors[name] = s;
     }
diff --git a/MuonSpectrometer/MuonGeoModel/src/MMSpacer.cxx b/MuonSpectrometer/MuonGeoModel/src/MMSpacer.cxx
index a84e3a8ea467..939d93cbfdde 100644
--- a/MuonSpectrometer/MuonGeoModel/src/MMSpacer.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/MMSpacer.cxx
@@ -43,7 +43,7 @@ namespace MuonGM {
         return build(minimalgeo, cutoutson, vcutdef);
     }
 
-    GeoPhysVol *MMSpacer::build(int minimalgeo, int, std::vector<Cutout *>) {
+    GeoPhysVol *MMSpacer::build(int minimalgeo, int, const std::vector<Cutout *>&) {
         MYSQL *mysql = MYSQL::GetPointer();
 
         MMSpacer_Technology *t = (MMSpacer_Technology *)mysql->GetTechnology(name);
diff --git a/MuonSpectrometer/MuonGeoModel/src/MYSQL.cxx b/MuonSpectrometer/MuonGeoModel/src/MYSQL.cxx
index ee55791f3899..3cbdce0c5046 100644
--- a/MuonSpectrometer/MuonGeoModel/src/MYSQL.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/MYSQL.cxx
@@ -11,6 +11,7 @@
 #include <cassert>
 #include <iostream>
 #include <sstream>
+#include <utility>
 
 namespace MuonGM {
 
@@ -51,7 +52,7 @@ namespace MuonGM {
         return s_thePointer;
     }
 
-    Station *MYSQL::GetStation(std::string name) {
+    Station *MYSQL::GetStation(const std::string& name) {
         MsgStream log(Athena::getMessageSvc(), "MuonGeoModel.MYSQL");
         if (log.level() <= MSG::VERBOSE) {
             log << MSG::VERBOSE << " looking for station " << name << endmsg;
@@ -67,7 +68,7 @@ namespace MuonGM {
         }
     }
 
-    Position MYSQL::GetStationPosition(std::string nameType, int fi, int zi) {
+    Position MYSQL::GetStationPosition(const std::string& nameType, int fi, int zi) {
         Position p;
         MsgStream log(Athena::getMessageSvc(), "MuonGeoModel.MYSQL");
         if (log.level() <= MSG::VERBOSE) {
@@ -90,7 +91,7 @@ namespace MuonGM {
         return p;
     }
 
-    TgcReadoutParams *MYSQL::GetTgcRPars(std::string name) {
+    TgcReadoutParams *MYSQL::GetTgcRPars(const std::string& name) {
         MsgStream log(Athena::getMessageSvc(), "MuonGeoModel.MYSQL");
         if (log.level() <= MSG::VERBOSE) {
             log << MSG::VERBOSE << "MYSQL::GetTgcRPars looking for a TgcRPars named <" << name << ">" << endmsg;
@@ -112,7 +113,7 @@ namespace MuonGM {
         return m_tgcReadout[jsta - 1];
     }
 
-    Technology *MYSQL::GetTechnology(std::string name) {
+    Technology *MYSQL::GetTechnology(const std::string& name) {
         std::map<std::string, Technology *>::const_iterator it = m_technologies.find(name);
 #ifndef NDEBUG
         MsgStream log(Athena::getMessageSvc(), "MuonGeoModel.MYSQL");
@@ -189,7 +190,7 @@ namespace MuonGM {
         }
     }
 
-    Technology *MYSQL::GetATechnology(std::string name) {
+    Technology *MYSQL::GetATechnology(const std::string& name) {
         std::map<std::string, Technology *>::const_iterator it = m_technologies.find(name);
         MsgStream log(Athena::getMessageSvc(), "MuonGeoModel.MYSQL");
 
@@ -219,7 +220,7 @@ namespace MuonGM {
         }
     }
 
-    std::string MYSQL::allocPosBuildKey(std::string statType, int fi, int zi) {
+    std::string MYSQL::allocPosBuildKey(const std::string& statType, int fi, int zi) {
         std::ostringstream mystream;
         mystream << statType << "fi" << MuonGM::buildString(fi, 1) << "zi" << MuonGM::buildString(zi, -1);
         MsgStream log(Athena::getMessageSvc(), "MuonGeoModel.MYSQL");
@@ -229,22 +230,22 @@ namespace MuonGM {
         return mystream.str();
     }
 
-    allocPosIterator MYSQL::allocPosFind(std::string statType, int fi, int zi) {
+    allocPosIterator MYSQL::allocPosFind(const std::string& statType, int fi, int zi) {
         std::string key = allocPosBuildKey(statType, fi, zi);
         return allocPosFind(key);
     }
 
-    int MYSQL::allocPosFindSubtype(std::string statType, int fi, int zi) {
+    int MYSQL::allocPosFindSubtype(const std::string& statType, int fi, int zi) {
         std::string key = allocPosBuildKey(statType, fi, zi);
         return allocPosFindSubtype(key);
     }
 
-    int MYSQL::allocPosFindCutout(std::string statType, int fi, int zi) {
+    int MYSQL::allocPosFindCutout(const std::string& statType, int fi, int zi) {
         std::string key = allocPosBuildKey(statType, fi, zi);
         return allocPosFindCutout(key);
     }
 
-    void MYSQL::addallocPos(std::string statType, int fi, int zi, int subtyp, int cutout) {
+    void MYSQL::addallocPos(const std::string& statType, int fi, int zi, int subtyp, int cutout) {
         std::string key = allocPosBuildKey(statType, fi, zi);
         addallocPos(key, subtyp, cutout);
     }
diff --git a/MuonSpectrometer/MuonGeoModel/src/Mdt.cxx b/MuonSpectrometer/MuonGeoModel/src/Mdt.cxx
index e93fb82a9657..b1f0fbdf9c62 100644
--- a/MuonSpectrometer/MuonGeoModel/src/Mdt.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/Mdt.cxx
@@ -29,7 +29,7 @@ namespace MuonGM {
         return std::round(toRound * factor) / factor;
     }
 
-    Mdt::Mdt(Component *ss, std::string lVName) : DetectorElement(ss->name) {
+    Mdt::Mdt(Component *ss, const std::string& lVName) : DetectorElement(ss->name) {
         logVolName = lVName;
         MdtComponent *s = (MdtComponent *)ss;
         MDT *thism = (MDT *)(MYSQL::GetPointer()->GetTechnology(s->name));
diff --git a/MuonSpectrometer/MuonGeoModel/src/Micromegas.cxx b/MuonSpectrometer/MuonGeoModel/src/Micromegas.cxx
index d5978953082a..ed7d36106153 100644
--- a/MuonSpectrometer/MuonGeoModel/src/Micromegas.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/Micromegas.cxx
@@ -49,7 +49,7 @@ namespace MuonGM {
         return build(minimalgeo, cutoutson, vcutdef);
     }
 
-    GeoFullPhysVol *Micromegas::build(int minimalgeo, int, std::vector<Cutout *>) {
+    GeoFullPhysVol *Micromegas::build(int minimalgeo, int, const std::vector<Cutout *>&) {
         AGDDDetectorStore *ds = AGDDDetectorStore::GetDetectorStore();
         MMDetectorHelper mmHelper;
         MMDetectorDescription *mm_descr = mmHelper.Get_MMDetectorSubType(m_component->subType);
diff --git a/MuonSpectrometer/MuonGeoModel/src/MultiLayer.cxx b/MuonSpectrometer/MuonGeoModel/src/MultiLayer.cxx
index 498649573402..60586c345941 100644
--- a/MuonSpectrometer/MuonGeoModel/src/MultiLayer.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/MultiLayer.cxx
@@ -38,6 +38,7 @@
 #include <memory>
 #include <stdexcept>
 #include <stdlib.h>
+#include <utility>
 #include <vector>
 
 class GeoMaterial;
@@ -55,7 +56,7 @@ namespace {
 namespace MuonGM {
 
     MultiLayer::MultiLayer(std::string n)
-        : DetectorElement(n), nrOfLayers(0), nrOfTubes(0), tubePitch(0.), width(0.), length(0.), thickness(0.), mdtthickness(0.), longWidth(0.), nrOfSteps(0), cutoutNsteps(0),
+        : DetectorElement(std::move(n)), nrOfLayers(0), nrOfTubes(0), tubePitch(0.), width(0.), length(0.), thickness(0.), mdtthickness(0.), longWidth(0.), nrOfSteps(0), cutoutNsteps(0),
           cutoutAtAngle(false), m_nonCutoutXSteps(), m_nonCutoutYSteps() {
         MsgStream log(Athena::getMessageSvc(), "MultiLayer::MultiLayer");
 
diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx
index 118c594987e2..aaea21962cbf 100644
--- a/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx
@@ -1454,7 +1454,7 @@ namespace MuonGM {
         return ptrd;
     }
 
-    void MuonChamber::setCscReadoutGeom(CscReadoutElement *re, const CscComponent *cc, const Position &ip, std::string /*gVersion*/, std::string /*stName*/) {
+    void MuonChamber::setCscReadoutGeom(CscReadoutElement *re, const CscComponent *cc, const Position &ip, const std::string& /*gVersion*/, const std::string& /*stName*/) {
         MsgStream log(m_msgSvc, "MuGM:MuonChamber:setCscReadoutGeom");
 
         re->m_Ssize = cc->dx1;
@@ -1555,7 +1555,7 @@ namespace MuonGM {
         }
     }
 
-    void MuonChamber::setRpcReadoutGeom(RpcReadoutElement *re, const RpcComponent *cc, const Position &ip, std::string /*gVersion*/, MuonDetectorManager *manager) {
+    void MuonChamber::setRpcReadoutGeom(RpcReadoutElement *re, const RpcComponent *cc, const Position &ip, const std::string& /*gVersion*/, MuonDetectorManager *manager) {
         MsgStream log(m_msgSvc, "MuGM:MuonChamber:setRpcReadoutGeom");
         re->m_Ssize = cc->dx1;
         re->m_LongSsize = cc->dx2;
@@ -1642,7 +1642,7 @@ namespace MuonGM {
         }
     }
 
-    void MuonChamber::setTgcReadoutGeom(TgcReadoutElement *re, const TgcComponent *cc, const Position &ip, std::string /*gVersion*/, std::string stName) {
+    void MuonChamber::setTgcReadoutGeom(TgcReadoutElement *re, const TgcComponent *cc, const Position &ip, const std::string& /*gVersion*/, const std::string& stName) {
         MsgStream log(m_msgSvc, "MuGM:MuonChamber:setTgcReadoutGeom");
 
         re->m_Ssize = cc->dx1;
@@ -1714,7 +1714,7 @@ namespace MuonGM {
         log << MSG::INFO << "MuonChamber " << name << " :" << endmsg;
     }
 
-    int MuonChamber::stationPhiTGC(std::string stName, int fi, int zi_input, std::string geometry_version) const {
+    int MuonChamber::stationPhiTGC(const std::string& stName, int fi, int zi_input, const std::string& geometry_version) const {
         std::string stName3 = stName.substr(0, 3);
         int stphi = 0;
 
diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonSystemDescription.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonSystemDescription.cxx
index 32916c8531b6..b0f07b159f5f 100644
--- a/MuonSpectrometer/MuonGeoModel/src/MuonSystemDescription.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/MuonSystemDescription.cxx
@@ -5,6 +5,7 @@
 #include "MuonGeoModel/MuonSystemDescription.h"
 
 #include <string>
+#include <utility>
 #include <vector>
 
 namespace MuonGM {
@@ -12,6 +13,6 @@ namespace MuonGM {
     extern std::vector<std::string> tokenize(std::string);
 
     MuonSystemDescription::MuonSystemDescription(std::string n)
-        : barrelInnerRadius(0.), innerRadius(0.), outerRadius(0.), endcapFrontFace(0.), length(0.), barreLength(0.), barrelInterRadius(0.), extraZ(0.), extraR(0.), m_name(n) {}
+        : barrelInnerRadius(0.), innerRadius(0.), outerRadius(0.), endcapFrontFace(0.), length(0.), barreLength(0.), barrelInterRadius(0.), extraZ(0.), extraR(0.), m_name(std::move(n)) {}
 
 } // namespace MuonGM
diff --git a/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx b/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
index 6a63d010c5b9..92619a9d652d 100644
--- a/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
@@ -19,7 +19,7 @@
 
 namespace MuonGM {
 
-    RDBReaderAtlas::RDBReaderAtlas(StoreGateSvc *pDetStore, IRDBAccessSvc *pRDBAccess, std::string geoTag, std::string geoNode, bool dumpAlinesFromOracle,
+    RDBReaderAtlas::RDBReaderAtlas(StoreGateSvc *pDetStore, IRDBAccessSvc *pRDBAccess, const std::string& geoTag, const std::string& geoNode, bool dumpAlinesFromOracle,
                                    bool useCscInternalAlinesFromOracle, bool dumpCscInternalAlinesFromOracle, const std::map<std::string, std::string> *asciiFileDBMap)
         : DBReader(pDetStore), m_controlCscIntAlines(0), m_dhdbam(nullptr), m_dbam(nullptr), m_dhatyp(nullptr), m_atyp(nullptr), m_dhasmp(nullptr), m_asmp(nullptr),
           m_dhalmn(nullptr), m_almn(nullptr), m_dhaptp(nullptr), m_aptp(nullptr), m_dhwrpc(nullptr), m_wrpc(nullptr), m_dhwtgc(nullptr), m_wtgc(nullptr), m_dhacut(nullptr),
diff --git a/MuonSpectrometer/MuonGeoModel/src/RpcLayer.cxx b/MuonSpectrometer/MuonGeoModel/src/RpcLayer.cxx
index 91a5d4b58cd9..da739eda24eb 100644
--- a/MuonSpectrometer/MuonGeoModel/src/RpcLayer.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/RpcLayer.cxx
@@ -22,6 +22,7 @@
 
 #include <TString.h> // for Form
 #include <iomanip>
+#include <utility>
 
 namespace {
     static constexpr double const &rpc3GapLayerThickness = 11.8; // gas vol. + ( bakelite + graphite + PET )x2
@@ -34,7 +35,7 @@ namespace {
 
 namespace MuonGM {
 
-    RpcLayer::RpcLayer(std::string s, Rpc *t) : DetectorElement(s), lwidth(0.), llength(0.), thickness(0.), llongWidth(0.) { m = t; }
+    RpcLayer::RpcLayer(std::string s, Rpc *t) : DetectorElement(std::move(s)), lwidth(0.), llength(0.), thickness(0.), llongWidth(0.) { m = t; }
 
     GeoVPhysVol *RpcLayer::build() {
         std::vector<Cutout *> vcutdef;
diff --git a/MuonSpectrometer/MuonGeoModel/src/SUP_Technology.cxx b/MuonSpectrometer/MuonGeoModel/src/SUP_Technology.cxx
index c0f35191b789..755163e4e4e1 100644
--- a/MuonSpectrometer/MuonGeoModel/src/SUP_Technology.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/SUP_Technology.cxx
@@ -10,12 +10,14 @@
 //<doc><file>	$Id: SUP_Technology.cxx,v 1.1 2008-07-31 10:57:55 dquarrie Exp $
 //<version>	$Name: not supported by cvs2svn $
 
+#include <utility>
+
 #include "MuonGeoModel/SUP_Technology.h"
 
 namespace MuonGM {
 
     SUP::SUP(std::string s)
-        : Technology(s), alFlangeThickness(0.), alHorFlangeLength(0.), alVerFlangeLength(0.), alVerProfileThickness(0.), alHorProfileThickness(0.), largeVerClearance(0.),
+        : Technology(std::move(s)), alFlangeThickness(0.), alHorFlangeLength(0.), alVerFlangeLength(0.), alVerProfileThickness(0.), alHorProfileThickness(0.), largeVerClearance(0.),
           smallVerClearance(0.), HorClearance(0.), xAMDB0(0.), yAMDB0(0.), zAMDB0(0.), bottomsizewrtAMDB0(0.), topsizewrtAMDB0(0.), alThickness(0.), length(0.), sup3Square(0.),
           sup3VerticalThickness(0.), sup3CentralLength(0.), sup3OuterLength(0.) {
         totalThickness = 0.;
diff --git a/MuonSpectrometer/MuonGeoModel/src/SimpleVolAction.cxx b/MuonSpectrometer/MuonGeoModel/src/SimpleVolAction.cxx
index 5d58de2de634..e2c67604c114 100644
--- a/MuonSpectrometer/MuonGeoModel/src/SimpleVolAction.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/SimpleVolAction.cxx
@@ -30,7 +30,7 @@ namespace MuonGM {
 
         //   std::cout<<" MY VOL Action is handlying a GeoVPhysVol "<<std::endl;
         const GeoLogVol *lv = pv->getLogVol();
-        std::string name = lv->getName();
+        const std::string& name = lv->getName();
         const GeoMaterial *mat = lv->getMaterial();
         unsigned int nchild = pv->getNChildVols();
 
diff --git a/MuonSpectrometer/MuonGeoModel/src/Station.cxx b/MuonSpectrometer/MuonGeoModel/src/Station.cxx
index cdd75c0fe144..bda7b6f53fff 100644
--- a/MuonSpectrometer/MuonGeoModel/src/Station.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/Station.cxx
@@ -17,10 +17,11 @@
 #include <cassert>
 #include <iostream>
 #include <limits>
+#include <utility>
 
 namespace MuonGM {
 
-    Station::Station(std::string s) : m_name(s) {
+    Station::Station(std::string s) : m_name(std::move(s)) {
         m_amdbOrigine_along_length = 0;
         m_amdbOrigine_along_thickness = 0;
 
diff --git a/MuonSpectrometer/MuonGeoModel/src/StationSelector.cxx b/MuonSpectrometer/MuonGeoModel/src/StationSelector.cxx
index fde9d57a97e9..bc4aee17f4a6 100644
--- a/MuonSpectrometer/MuonGeoModel/src/StationSelector.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/StationSelector.cxx
@@ -11,12 +11,13 @@
 
 #include <fstream>
 #include <sstream>
+#include <utility>
 
 namespace MuonGM {
 
     std::atomic<int> StationSelector::m_selectType = 0;
 
-    StationSelector::StationSelector(std::string filename) {
+    StationSelector::StationSelector(const std::string& filename) {
         std::ifstream from;
         from.open(filename.c_str());
         char buffer[200];
@@ -36,7 +37,7 @@ namespace MuonGM {
         }
     }
 
-    StationSelector::StationSelector(std::vector<std::string> s) : m_selector(s) {
+    StationSelector::StationSelector(std::vector<std::string> s) : m_selector(std::move(s)) {
         MYSQL *mysql = MYSQL::GetPointer();
         StationIterator it;
         for (it = mysql->StationBegin(); it != mysql->StationEnd(); it++) {
diff --git a/MuonSpectrometer/MuonGeoModel/src/Technology.cxx b/MuonSpectrometer/MuonGeoModel/src/Technology.cxx
index 21fff4c06955..0b755938e737 100644
--- a/MuonSpectrometer/MuonGeoModel/src/Technology.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/Technology.cxx
@@ -2,6 +2,8 @@
   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
+#include <utility>
+
 #include "MuonGeoModel/Technology.h"
 
 #include "MuonGeoModel/MYSQL.h"
@@ -10,7 +12,7 @@ namespace MuonGM {
 
     std::string Technology::GetName() { return m_name; }
 
-    Technology::Technology(std::string s) : m_name(s), thickness(0.) {
+    Technology::Technology(std::string s) : m_name(std::move(s)), thickness(0.) {
         MYSQL *mysql = MYSQL::GetPointer();
         mysql->StoreTechnology(this);
     }
diff --git a/MuonSpectrometer/MuonGeoModel/src/sTGC.cxx b/MuonSpectrometer/MuonGeoModel/src/sTGC.cxx
index a1d00004ae05..006ca771b0f8 100644
--- a/MuonSpectrometer/MuonGeoModel/src/sTGC.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/sTGC.cxx
@@ -55,7 +55,7 @@ namespace MuonGM {
     }
 
     // Start building the physical volume of the quadruplet
-    GeoFullPhysVol *sTGC::build(int minimalgeo, int, std::vector<Cutout *>) {
+    GeoFullPhysVol *sTGC::build(int minimalgeo, int, const std::vector<Cutout *>&) {
         AGDDDetectorStore *ds = AGDDDetectorStore::GetDetectorStore();
         sTGCDetectorHelper stgcHelper;
         sTGCDetectorDescription *stgc_descr = stgcHelper.Get_sTGCDetectorSubType(m_component->subType);
-- 
GitLab


From 6404f5861a72e7a0f16da900920719aa70ddb6b8 Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Mon, 13 Sep 2021 23:58:50 +0200
Subject: [PATCH 095/347] Disable old-style DQ SCT postprocessing

---
 DataQuality/DataQualityUtils/CMakeLists.txt   |   1 -
 .../DataQualityUtils/MonitoringFile.h         |   3 +-
 .../python/DQPostProcessMod.py                |   2 -
 .../src/MonitoringFile_SCTPostProcess.cxx     | 577 ------------------
 4 files changed, 1 insertion(+), 582 deletions(-)
 delete mode 100644 DataQuality/DataQualityUtils/src/MonitoringFile_SCTPostProcess.cxx

diff --git a/DataQuality/DataQualityUtils/CMakeLists.txt b/DataQuality/DataQualityUtils/CMakeLists.txt
index ef01bc9e43e5..3ec9a2ac0597 100644
--- a/DataQuality/DataQualityUtils/CMakeLists.txt
+++ b/DataQuality/DataQualityUtils/CMakeLists.txt
@@ -39,7 +39,6 @@ atlas_add_library( DataQualityUtils
                    src/MonitoringFile_HLTJetPostProcess.cxx
                    src/MonitoringFile_HLTMinBiasMonPostProcess.cxx
                    src/MonitoringFile_PixelPostProcess.cxx
-                   src/MonitoringFile_SCTPostProcess.cxx
                    src/MonitoringFile_MuonTrackPostProcess.cxx
                    src/MonitoringFile_MergeAlgs.cxx
                    src/StatusFlagCOOL.cxx
diff --git a/DataQuality/DataQualityUtils/DataQualityUtils/MonitoringFile.h b/DataQuality/DataQualityUtils/DataQualityUtils/MonitoringFile.h
index d3952e454b5d..61743d47c7e6 100644
--- a/DataQuality/DataQualityUtils/DataQualityUtils/MonitoringFile.h
+++ b/DataQuality/DataQualityUtils/DataQualityUtils/MonitoringFile.h
@@ -345,9 +345,8 @@ namespace dqutils {
                                         const TString& nameDen, const TString& nameEff,
 				        int items, double threshold, int binSkip);
 
-    // SCT
+    // Pixel
     static void PixelPostProcess(std::string inFilename, bool isIncremental = false);
-    static void SCTPostProcess(std::string inFilename, bool isIncremental = false);
  
     // Other helper methods
     // Compute Bin Errors a la Ullrich, Paterno, Xu (see source file for more details)
diff --git a/DataQuality/DataQualityUtils/python/DQPostProcessMod.py b/DataQuality/DataQualityUtils/python/DQPostProcessMod.py
index 8ca7ff85f13e..f6eb226e2e7a 100644
--- a/DataQuality/DataQualityUtils/python/DQPostProcessMod.py
+++ b/DataQuality/DataQualityUtils/python/DQPostProcessMod.py
@@ -210,8 +210,6 @@ def DQPostProcess( outFileName, isIncremental=False ):
                   ['m.neumann@cern.ch']),
                  (mf.L1CaloPostProcess,
                   ['ivana.hristova@cern.ch', 'pjwf@hep.ph.bham.ac.uk']),
-                 (mf.SCTPostProcess,
-                  ['masaki.endo@cern.ch']),
                  (mf.PixelPostProcess,
                   ['daiki.yamaguchi@cern.ch']),
                  (mf.MuonTrackPostProcess,
diff --git a/DataQuality/DataQualityUtils/src/MonitoringFile_SCTPostProcess.cxx b/DataQuality/DataQualityUtils/src/MonitoringFile_SCTPostProcess.cxx
deleted file mode 100644
index 283dabc91a8f..000000000000
--- a/DataQuality/DataQualityUtils/src/MonitoringFile_SCTPostProcess.cxx
+++ /dev/null
@@ -1,577 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/////////////////////////////////////////////////////////////////////
-//Methods to process SCT histograms after merging.
-//Author: Masaki ENDO (masaki.endo@cern.ch)
-//Date: Aug 2012
-/////////////////////////////////////////////////////////////////////
-
-#include "DataQualityUtils/MonitoringFile.h"
-
-#include <iostream>
-#include <iomanip>
-#include <algorithm>
-#include <fstream>
-#include <cmath>
-#include <cstdlib>
-#include <sstream>
-#include <vector>
-#include <utility>
-#include <map>
-#include <string>
-
-#include "TH1F.h"
-#include "TH2F.h"
-#include "TFile.h"
-#include "TClass.h"
-#include "TKey.h"
-#include "TMath.h"
-#include "TF1.h"
-#include "TTree.h"
-#include "TBranch.h"
-#include "TProfile.h"
-#include "TProfile2D.h"
-
-
-namespace dqutils {
-
-  static const bool rno_debug = false;
-
-  void
-  MonitoringFile::SCTPostProcess( std::string inFilename, bool /* isIncremental */ )
-  {
-    if (rno_debug) std::cout << "Start SCT post-processing" <<std::endl;
-
-    TH1::SetDefaultSumw2();
-    TFile *infile = TFile::Open(inFilename.c_str(),"UPDATE");
-    if(infile==0 || ! infile->IsOpen()){
-      std::cerr << "--> SCTPostProcess: Input file not opened" <<std::endl;
-      return;
-    }
-    if(infile->IsZombie()){
-      std::cerr << "--> SCTPostProcess: Input file " << inFilename << " cannot be opened" <<std::endl;
-      return;
-    }
-    if(infile->GetSize()<1000){
-      std::cerr << "--> SCTPostProcess: Input file empty " <<std::endl;
-      return;
-    }
-
-    // start postprocessing
-
-    TIter next_run(infile->GetListOfKeys());
-    TKey *key_run(0);
-    key_run = (TKey*)next_run();
-    TDirectory *dir0 = dynamic_cast<TDirectory*> (key_run->ReadObj());
-    if(!dir0) return; // should never fail
-    dir0->cd();
-
-    TString run_dir;
-    const int N_dir=4;
-    const int N_BARREL=4, N_DISKS=9;
-    TString subDetName[N_dir] = {"/GENERAL", "/SCTEC", "/SCTB", "/SCTEA"};
-
-    int times = 1;
-    while (times--) {  // just once
-      run_dir = dir0->GetName();
-      bool do_rno = true;
-      bool do_no = true;
-      bool do_conf = true;
-      bool do_eff = true;
-
-      // setup directories
-
-      TString rno_dir[N_dir];
-      TDirectory *rnodir[N_dir];
-      for(int i=0;i<N_dir;i++){
-	rno_dir[i] = run_dir + "/SCT" + subDetName[i] + "/RatioNoise/";
-	rnodir[i] = (TDirectory*)infile->GetDirectory(rno_dir[i]);
-	if(!rnodir[i]){
-	  std::cerr << "--> SCTPostProcess: directory " << rno_dir[i] << " not found " <<std::endl;
-	  do_rno = false;
-	  //return;
-	}
-      }
-
-      TString no_dir[N_dir];
-      TDirectory *nodir[N_dir];
-      for(int i=0;i<N_dir;i++){
-	if(i==0)no_dir[i] = run_dir + "/SCT" + subDetName[i] + "/noise/";
-	else no_dir[i] = run_dir + "/SCT" + subDetName[i] + "/Noise/";
-	nodir[i] = (TDirectory*)infile->GetDirectory(no_dir[i]);
-	if(!nodir[i]){
-	  std::cerr << "--> SCTPostProcess: directory " << no_dir[i] << " not found " <<std::endl;
-	  do_no = false;
-	  //return;
-	}
-      }
-
-      TString conf_dir[N_dir];
-      TDirectory *confdir[N_dir];
-      for(int i=0;i<N_dir;i++){
-	conf_dir[i] = run_dir + "/SCT" + subDetName[i] + "/Conf/";
-	confdir[i] = (TDirectory*)infile->GetDirectory(conf_dir[i]);
-	if(!confdir[i]){
-	  std::cerr << "--> SCTPostProcess: directory " << conf_dir[i] << " not found " <<std::endl;
-	  do_conf = false;
-	  //return;
-	}
-      }
-
-      TString eff_dir[N_dir];
-      TDirectory *effdir[N_dir];
-      for(int i=0;i<N_dir;i++){
-	eff_dir[i] = run_dir + "/SCT" + subDetName[i] + "/eff/";
-	effdir[i] = (TDirectory*)infile->GetDirectory(eff_dir[i]);
-	if(!effdir[i]){
-	  std::cerr << "--> SCTPostProcess: directory " << eff_dir[i] << " not found " <<std::endl;
-	  do_eff = false;
-	  //return;
-	}
-      }
-
-      int layers[3] = {N_DISKS, N_BARREL, N_DISKS};
-      if (rno_debug) std::cout << "SCT post-processing: efficiency" <<std::endl;
-      // efficiency
-      if(do_eff){
-	TString posi_eff[3] = {"m_eff_", "eff_", "p_eff_"};
-
-	effdir[0]->cd();
-	TH1F *h_EffDist = new TH1F("SctEffDistribution", "SCT Efficiency Distribution", 500, 0, 1);
-	h_EffDist->GetXaxis()->SetTitle("Efficiency");
-	h_EffDist->GetYaxis()->SetTitle("Links");
-
-	TString mapName = "";
-	TProfile2D *tp2dMap = 0;
-
-	for(Long_t i=0;i<3;i++){
-	  effdir[i+1]->cd();
-	  for(Long_t j=0;j<layers[i];j++){
-	    for(Long_t k=0;k<2;k++){
-	      mapName = eff_dir[i+1] + posi_eff[i]+j+"_"+k;
-	      tp2dMap = (TProfile2D*) infile->Get(mapName);
-	      if(!tp2dMap){
-		std::cerr << "--> SCTPostProcess: no such histogram: "<<mapName<<std::endl;
-		continue;
-	      }
-	      for(int xbin=1;xbin<tp2dMap->GetNbinsX()+1;xbin++){
-		for(int ybin=1;ybin<tp2dMap->GetNbinsY()+1;ybin++){
-		  if(tp2dMap->GetBinEntries(tp2dMap->GetBin(xbin,ybin))==0) continue;
-		  h_EffDist->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		}
-	      }
-	    }
-	  }
-	}
-	effdir[0]->cd();
-	h_EffDist->Write("", TObject::kOverwrite);
-      }
-
-      if (rno_debug) std::cout << "SCT post-processing: ratio noise" <<std::endl;
-      // ratio noise
-      if(do_rno){
-	int nModuleEndCap1[9] = {0, 92, 224, 356, 488, 620, 752, 844, 936};
-	int nModuleEndCap2[9] = {92, 224, 356, 488, 620, 752, 844, 936, 988};
-	int nModuleBarrel1[4] = {0, 384, 864, 1440};
-	int nModuleBarrel2[4] = {384, 864, 1440, 2112};
-
-	rnodir[0]->cd();
-	TH1F *hist_all = new TH1F("h_NO","Noise Occupancy for Barrel and Endcaps",500,0.,100.);
-	TH1F *hist_bar = new TH1F("h_NOb","Noise Occupancy for Barrel",500,0.,100.);
-	TH1F *hist_end = new TH1F("h_NOEC","Noise Occupancy for Endcaps",500,0.,100.);
-	TH1F *hist_endc = new TH1F("hist_endcapC","endcap C",500,0.,100.);
-	TH1F *hist_enda = new TH1F("hist_endcapA","endcap A",500,0.,100.);
-
-	TH1F *hist_inner = new TH1F("h_NOEC_Inner","Noise Occupancy Inner Endcap Modules",500,0.,100.);
-	TH1F *hist_middle = new TH1F("h_NOEC_Middle","Noise Occupancy Middle Endcap Modules",500,0.,100.);
-	TH1F *hist_outer = new TH1F("h_NOEC_Outer","Noise Occupancy Outer Endcap Modules",500,0.,100.);
-	TH1F *hist_smiddle = new TH1F("h_NOEC_ShortMiddle","Noise Occupancy Short Middle Endcap Modules",500,0.,100.);
-
-	TH1F *hist_bar_layer[4];
-	for(int i=0;i<4;i++){
-	  rnodir[2]->cd();
-	  hist_bar_layer[i] = new TH1F(Form("h_NOb_layer%d",i),Form("Noise Occupancy Barrel Layer %d",i),500,0.,100.);
-	}
-	TH1F *hist_endC_disk[9];
-	for(int i=0;i<9;i++){
-	  rnodir[1]->cd();
-	  hist_endC_disk[i] = new TH1F(Form("h_NOECC_disk%d",i),Form("Noise Occupancy Endcap C disk %d",i),500,0.,100.);
-	}
-	TH1F *hist_endA_disk[9];
-	for(int i=0;i<9;i++){
-	  rnodir[3]->cd();
-	  hist_endA_disk[i] = new TH1F(Form("h_NOECA_disk%d",i),Form("Noise Occupancy Endcap A disk %d",i),500,0.,100.);
-	}
-
-	rnodir[0]->cd();
-	TString noSideHitHist = rno_dir[0] + "h_NZ1_vs_modnum";
-	TString oneSideHitHist = rno_dir[0] + "h_N11_vs_modnum";
-	TH1F *h_nosidehit = (TH1F*)infile->Get(noSideHitHist);
-	TH1F *h_onesidehit = (TH1F*)infile->Get(oneSideHitHist);
-	if(!h_nosidehit || !h_onesidehit){
-	  std::cerr << "--> SCTPostProcess: no such histograms " << noSideHitHist << "and/or" << oneSideHitHist <<std::endl;
-	}
-
-	for(int i=0;i<4088;i++){
-	  int nosidehit = h_nosidehit ? h_nosidehit->GetBinContent(i+1): -999;
-	  int onesidehit = h_onesidehit ? h_onesidehit->GetBinContent(i+1): -999;
-	  if(nosidehit>0 && onesidehit>-999){
-	    double Rval = (double)onesidehit/(double)nosidehit;
-	    double NOval = 1./768.*Rval/(2.+Rval);
-	    if(NOval!=0){
-	      hist_all->Fill(100000.*NOval);
-	      if(i>=0 && i<988){
-		hist_end->Fill(100000.*NOval);
-		hist_endc->Fill(100000.*NOval);
-		for(int j=0;j<9;j++){
-		  if(i>=nModuleEndCap1[j] && i<nModuleEndCap2[j]){
-		    hist_endC_disk[j]->Fill(100000.*NOval);
-		    if(i-nModuleEndCap1[j]<52){
-		      hist_outer->Fill(100000.*NOval);
-		    }else if(i-nModuleEndCap1[j]>=52 && i-nModuleEndCap1[j]<92){
-		      if(i<844){
-			hist_middle->Fill(100000.*NOval);
-		      }else if(i>=844){
-			hist_smiddle->Fill(100000.*NOval);
-		      }
-		    }else if(i-nModuleEndCap1[j]>=92 && i-nModuleEndCap1[j]<132){
-		      hist_inner->Fill(100000.*NOval);
-		    }
-		  }
-		}
-	      }else if(i>=988 && i<3100){
-		hist_bar->Fill(100000.*NOval);
-		for(int j=0;j<4;j++){
-		  if(i>=nModuleBarrel1[j]+988 && i<nModuleBarrel2[j]+988){
-		    hist_bar_layer[j]->Fill(100000*NOval);
-		  }
-		}
-	      }else if(i>=3100 && i<4088){
-		hist_end->Fill(100000.*NOval);
-		hist_enda->Fill(100000.*NOval);
-		for(int j=0;j<9;j++){
-		  if(i>=nModuleEndCap1[j]+3100 && i<nModuleEndCap2[j]+3100){
-		    hist_endA_disk[j]->Fill(100000*NOval);
-		    if(i-nModuleEndCap1[j]-3100<52){
-		      hist_outer->Fill(100000.*NOval);
-		    }else if(i-nModuleEndCap1[j]-3100>=52 && i-nModuleEndCap1[j]-3100<92){
-		      if(i-3100<844){
-			hist_middle->Fill(100000.*NOval);
-		      }else if(i-3100>=844){
-			hist_smiddle->Fill(100000.*NOval);
-		      }
-		    }else if(i-nModuleEndCap1[j]-3100>=92 && i-nModuleEndCap1[j]-3100<132){
-		      hist_inner->Fill(100000.*NOval);
-		    }
-		  }
-		}
-	      }
-	    }
-	  }
-	}
-	hist_all->SetBinContent(hist_all->GetNbinsX(),hist_all->GetBinContent(hist_all->GetNbinsX() ) + hist_all->GetBinContent(hist_all->GetNbinsX() +1));
-	hist_bar->SetBinContent(hist_bar->GetNbinsX(),hist_bar->GetBinContent(hist_bar->GetNbinsX() ) + hist_bar->GetBinContent(hist_bar->GetNbinsX() +1));
-	hist_end->SetBinContent(hist_end->GetNbinsX(),hist_end->GetBinContent(hist_end->GetNbinsX() ) + hist_end->GetBinContent(hist_end->GetNbinsX() +1));
-
-	rnodir[0]->cd();
-	hist_all->Write("", TObject::kOverwrite);
-	hist_bar->Write("", TObject::kOverwrite);
-	hist_end->Write("", TObject::kOverwrite);
-	hist_inner->Write("", TObject::kOverwrite);
-	hist_middle->Write("", TObject::kOverwrite);
-	hist_outer->Write("", TObject::kOverwrite);
-	hist_smiddle->Write("", TObject::kOverwrite);
-	for(int i=0;i<9;i++){
-	  rnodir[1]->cd();
-	  hist_endC_disk[i]->Write("", TObject::kOverwrite);
-	}
-	for(int i=0;i<4;i++){
-	  rnodir[2]->cd();
-	  hist_bar_layer[i]->Write("", TObject::kOverwrite);
-	}
-	for(int i=0;i<9;i++){
-	  rnodir[3]->cd();
-	  hist_endA_disk[i]->Write("", TObject::kOverwrite);
-	}
-      }
-
-      if (rno_debug) std::cout << "SCT post-processing: noise occupancy" <<std::endl;
-      // noise occupancy
-      if(do_no){
-	TString posi_notrg[3] = {"/noiseoccupancymaptriggerECm_", "/noiseoccupancymaptrigger_", "/noiseoccupancymaptriggerECp_"};
-	TString posi_no[3] = {"/noiseoccupancymapECm_", "/noiseoccupancymap_", "/noiseoccupancymapECp_"};
-	TString posi_hotrg[3] = {"/hitoccupancymaptriggerECm_", "/hitoccupancymaptrigger_", "/hitoccupancymaptriggerECp_"};
-	TString posi_ho[3] = {"/hitoccupancymapECm_", "/hitoccupancymap_", "/hitoccupancymapECp_"};
-
-	TString tmpName = no_dir[0]+"SCTNOdistributionTrigger";
-	TString NO_title = "";
-	nodir[0]->cd();
-	TH1F* h_SCTNOTrigger = 0;
-	if(!infile->Get(tmpName)){
-	  NO_title = "NO Distribution for the SCT for EMPTY trigger";
-	}
-	else{
-	  NO_title = ((TH1F*)infile->Get(tmpName))->GetTitle();
-	}
-	h_SCTNOTrigger = new TH1F("SCTNOdistributionTrigger", NO_title, 8000,1e-1 ,20000);
-	h_SCTNOTrigger->GetXaxis()->SetTitle("Noise Occupancy [10^{-5}]");
-	h_SCTNOTrigger->GetYaxis()->SetTitle("Modules");
-
-	TH1F* h_SCTNO = new TH1F("SCTNOdistribution", "NO Distribution for the SCT", 8000,1e-1 ,20000);
-	h_SCTNO->GetXaxis()->SetTitle("Noise Occupancy [10^{-5}]");
-	h_SCTNO->GetYaxis()->SetTitle("Modules");
-
-	NO_title.ReplaceAll("SCT", "Barrel");
-	TH1F* h_barrelNOTrigger = new TH1F("barrelNOdistributionTrigger", NO_title, 8000,1e-1 ,20000);
-	h_barrelNOTrigger->GetXaxis()->SetTitle("Noise Occupancy [10^{-5}]");
-	h_barrelNOTrigger->GetYaxis()->SetTitle("Modules");
-	TH1F* h_barrelNO = new TH1F("barrelNOdistribution", "NO Distribution for the Barrel", 8000,1e-1 ,20000);
-	h_barrelNO->GetXaxis()->SetTitle("Noise Occupancy [10^{-5}]");
-	h_barrelNO->GetYaxis()->SetTitle("Modules");
-
-	NO_title.ReplaceAll("Barrel", "EndCap A");
-	TH1F* h_ECANOTrigger = new TH1F("ECANOdistributionTrigger", NO_title, 8000,1e-1 ,20000);
-	h_ECANOTrigger->GetXaxis()->SetTitle("Noise Occupancy [10^{-5}]");
-	h_ECANOTrigger->GetYaxis()->SetTitle("Modules");
-	TH1F* h_ECANO = new TH1F("ECANOdistribution", "NO Distribution for the EndCap A", 8000,1e-1 ,20000);
-	h_ECANO->GetXaxis()->SetTitle("Noise Occupancy [10^{-5}]");
-	h_ECANO->GetYaxis()->SetTitle("Modules");
-
-	NO_title.ReplaceAll("EndCap A", "EndCap C");
-	TH1F* h_ECCNOTrigger = new TH1F("ECCNOdistributionTrigger", NO_title, 8000,1e-1 ,20000);
-	h_ECCNOTrigger->GetXaxis()->SetTitle("Noise Occupancy [10^{-5}]");
-	h_ECCNOTrigger->GetYaxis()->SetTitle("Modules");
-	TH1F* h_ECCNO = new TH1F("ECCNOdistribution", "NO Distribution for the EndCap C", 8000,1e-1 ,20000);
-	h_ECCNO->GetXaxis()->SetTitle("Noise Occupancy [10^{-5}]");
-	h_ECCNO->GetYaxis()->SetTitle("Modules");
-
-	tmpName = no_dir[0]+"SCTHOdistributionTrigger";
-	TString HO_title = "";
-	nodir[0]->cd();
-	TH1F* h_SCTHOTrigger = 0;
-	if(!infile->Get(tmpName)){
-	  HO_title = "HO Distribution for the SCT for EMPTY trigger";
-	}
-	else{
-	  HO_title = ((TH1F*)infile->Get(tmpName))->GetTitle();
-	}
-	h_SCTHOTrigger = new TH1F("SCTHOdistributionTrigger", HO_title, 8000,1e-1 ,20000);
-	h_SCTHOTrigger->GetXaxis()->SetTitle("Noise Occupancy [10^{-5}]");
-	h_SCTHOTrigger->GetYaxis()->SetTitle("Modules");
-
-	TH1F* h_SCTHO = new TH1F("SCTHOdistribution", "HO Distribution for the SCT", 8000,1e-1 ,20000);
-	h_SCTHO->GetXaxis()->SetTitle("Noise Occupancy [10^{-5}]");
-	h_SCTHO->GetYaxis()->SetTitle("Modules");
-
-	HO_title.ReplaceAll("SCT", "Barrel");
-	TH1F* h_barrelHOTrigger = new TH1F("barrelHOdistributionTrigger", HO_title, 8000,1e-1 ,20000);
-	h_barrelHOTrigger->GetXaxis()->SetTitle("Hit Occupancy [10^{-5}]");
-	h_barrelHOTrigger->GetYaxis()->SetTitle("Modules");
-	TH1F* h_barrelHO = new TH1F("barrelHOdistribution", "HO Distribution for the Barrel", 8000,1e-1 ,20000);
-	h_barrelHO->GetXaxis()->SetTitle("Hit Occupancy [10^{-5}]");
-	h_barrelHO->GetYaxis()->SetTitle("Modules");
-
-	HO_title.ReplaceAll("Barrel", "EndCap A");
-	TH1F* h_ECAHOTrigger = new TH1F("ECAHOdistributionTrigger", HO_title, 8000,1e-1 ,20000);
-	h_ECAHOTrigger->GetXaxis()->SetTitle("Hit Occupancy [10^{-5}]");
-	h_ECAHOTrigger->GetYaxis()->SetTitle("Modules");
-	TH1F* h_ECAHO = new TH1F("ECAHOdistribution", "HO Distribution for the EndCap A", 8000,1e-1 ,20000);
-	h_ECAHO->GetXaxis()->SetTitle("Hit Occupancy [10^{-5}]");
-	h_ECAHO->GetYaxis()->SetTitle("Modules");
-
-	HO_title.ReplaceAll("EndCap A", "EndCap C");
-	TH1F* h_ECCHOTrigger = new TH1F("ECCHOdistributionTrigger", HO_title, 8000,1e-1 ,20000);
-	h_ECCHOTrigger->GetXaxis()->SetTitle("Hit Occupancy [10^{-5}]");
-	h_ECCHOTrigger->GetYaxis()->SetTitle("Modules");
-	TH1F* h_ECCHO = new TH1F("ECCHOdistribution", "HO Distribution for the EndCap C", 8000,1e-1 ,20000);
-	h_ECCHO->GetXaxis()->SetTitle("Hit Occupancy [10^{-5}]");
-	h_ECCHO->GetYaxis()->SetTitle("Modules");
-
-	TString mapName = "";
-	TProfile2D *tp2dMap = 0;
-
-	for(Long_t i=0;i<3;i++){
-	  nodir[i+1]->cd();
-	  for(Long_t j=0;j<layers[i];j++){
-	    for(Long_t k=0;k<2;k++){
-	      mapName = no_dir[i+1] + posi_no[i]+j+"_"+k;
-	      tp2dMap = (TProfile2D*) infile->Get(mapName);
-	      if(!tp2dMap){
-		std::cerr << "--> SCTPostProcess: no such histogram: "<<mapName<<std::endl;
-		continue;
-	      }
-	      for(int xbin=1;xbin<tp2dMap->GetNbinsX()+1;xbin++){
-		for(int ybin=1;ybin<tp2dMap->GetNbinsY()+1;ybin++){
-		  if(tp2dMap->GetBinEntries(tp2dMap->GetBin(xbin,ybin))==0) continue;
-		  h_SCTNO->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==0) h_ECCNO->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==1) h_barrelNO->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==2) h_ECANO->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		}
-	      }
-	    }
-	    for(Long_t k=0;k<2;k++){
-	      mapName = no_dir[i+1] + posi_notrg[i]+j+"_"+k;
-	      tp2dMap = (TProfile2D*) infile->Get(mapName);
-	      if(!tp2dMap){
-		std::cerr << "--> SCTPostProcess: no such histogram: "<<mapName<<std::endl;
-		continue;
-	      }
-	      for(int xbin=1;xbin<tp2dMap->GetNbinsX()+1;xbin++){
-		for(int ybin=1;ybin<tp2dMap->GetNbinsY()+1;ybin++){
-		  if(tp2dMap->GetBinEntries(tp2dMap->GetBin(xbin,ybin))==0) continue;
-		  h_SCTNOTrigger->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==0) h_ECCNOTrigger->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==1) h_barrelNOTrigger->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==2) h_ECANOTrigger->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		}
-	      }
-	    }
-	    for(Long_t k=0;k<2;k++){
-	      mapName = no_dir[i+1] + posi_ho[i]+j+"_"+k;
-	      tp2dMap = (TProfile2D*) infile->Get(mapName);
-	      if(!tp2dMap){
-		std::cerr << "--> SCTPostProcess: no such histogram: "<<mapName<<std::endl;
-		continue;
-	      }
-	      for(int xbin=1;xbin<tp2dMap->GetNbinsX()+1;xbin++){
-		for(int ybin=1;ybin<tp2dMap->GetNbinsY()+1;ybin++){
-		  if(tp2dMap->GetBinEntries(tp2dMap->GetBin(xbin,ybin))==0) continue;
-		  h_SCTHO->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==0) h_ECCHO->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==1) h_barrelHO->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==2) h_ECAHO->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		}
-	      }
-	    }
-	    for(Long_t k=0;k<2;k++){
-	      mapName = no_dir[i+1] + posi_hotrg[i]+j+"_"+k;
-	      tp2dMap = (TProfile2D*) infile->Get(mapName);
-	      if(!tp2dMap){
-		std::cerr << "--> SCTPostProcess: no such histogram: "<<mapName<<std::endl;
-		continue;
-	      }
-	      for(int xbin=1;xbin<tp2dMap->GetNbinsX()+1;xbin++){
-		for(int ybin=1;ybin<tp2dMap->GetNbinsY()+1;ybin++){
-		  if(tp2dMap->GetBinEntries(tp2dMap->GetBin(xbin,ybin))==0) continue;
-		  h_SCTHOTrigger->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==0) h_ECCHOTrigger->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==1) h_barrelHOTrigger->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		  if(i==2) h_ECAHOTrigger->Fill(tp2dMap->GetBinContent(xbin,ybin));
-		}
-	      }
-	    }
-	  }
-	}
-
-	nodir[0]->cd();
-
-	h_SCTNOTrigger->Write("", TObject::kOverwrite);
-	h_SCTNO->Write("", TObject::kOverwrite);
-	h_barrelNOTrigger->Write("", TObject::kOverwrite);
-	h_barrelNO->Write("", TObject::kOverwrite);
-	h_ECCNOTrigger->Write("", TObject::kOverwrite);
-	h_ECCNO->Write("", TObject::kOverwrite);
-	h_ECANOTrigger->Write("", TObject::kOverwrite);
-	h_ECANO->Write("", TObject::kOverwrite);
-
-	h_SCTHOTrigger->Write("", TObject::kOverwrite);
-	h_SCTHO->Write("", TObject::kOverwrite);
-	h_barrelHOTrigger->Write("", TObject::kOverwrite);
-	h_barrelHO->Write("", TObject::kOverwrite);
-	h_ECCHOTrigger->Write("", TObject::kOverwrite);
-	h_ECCHO->Write("", TObject::kOverwrite);
-	h_ECAHOTrigger->Write("", TObject::kOverwrite);
-	h_ECAHO->Write("", TObject::kOverwrite);
-      }
-
-      if (rno_debug) std::cout << "SCT post-processing: Configuration" <<std::endl;
-      // Configuration
-      if(do_conf){
-	const int N_hist = 3;
-	double Threshold[N_hist] = {0.7,0.1,150};
-	TString name_hist[N_hist][N_dir] = {
-	  {"","/errors/Errors/SCT_NumberOfErrorsEC_", "/errors/Errors/SCT_NumberOfErrorsB_", "/errors/Errors/SCT_NumberOfErrorsEA_"},
-	  {"","/eff/ineffm_", "/eff/ineff_", "/eff/ineffp_"},
-	  {"","/Noise/noiseoccupancymaptriggerECm_", "/Noise/noiseoccupancymaptrigger_", "/Noise/noiseoccupancymaptriggerECp_"}
-	};
-	int countM[N_hist][N_dir];
-	for (int ibc = 0; ibc != N_dir; ++ibc) { // region
-	  for(int ih = 0; ih != N_hist; ++ih) { // hist
-	    countM[ih][ibc]=0;
-	  }
-	}
-
-	TH2F* hist0 = 0;
-	TH2F* hist1 = 0;
-	TString mapName = "";
-
-	confdir[0]->cd();
-	for (int ibc = 1; ibc != N_dir; ++ibc) { // region(B=1,ECA=2,ECC=3)
-	  for (int lyr = 0; lyr != layers[ibc-1]; ++lyr) { // layer
-	    for (int ih = 0; ih!= N_hist; ++ih) { // hist
-	      hist0 = 0; hist1 = 0;
-	      mapName =  run_dir + "/SCT" + subDetName[ibc] + name_hist[ih][ibc] + TString::Itoa(lyr,10) + "_0";
-	      hist0 = (TH2F*)infile->Get(mapName);
-	      mapName =  run_dir + "/SCT" + subDetName[ibc] + name_hist[ih][ibc] + TString::Itoa(lyr,10) + "_1";
-	      hist1 = (TH2F*)infile->Get(mapName);
-	      if(!hist0 || !hist1){
-		std::cerr << "--> SCTPostProcess: no such histogram: " << mapName + " or _0" <<std::endl;
-		continue;
-	      }
-	      int xbins = hist0->GetNbinsX() + 1;
-	      int ybins = hist0->GetNbinsY() + 1;
-	      for (int xb = 1; xb != xbins; ++xb) {
-		for (int yb = 1; yb != ybins; ++yb) {
-		  if (hist0->GetBinContent(xb,yb) > Threshold[ih] || hist1->GetBinContent(xb,yb) > Threshold[ih]){
-		    countM[ih][0]++;
-		    countM[ih][ibc]++;
-		  }
-		}
-	      }
-	    }
-	  }
-	}
-
-	dir0->cd();
-	TString conftitleNew[N_dir] = {
-	  "SCTConf", "SCTConfEndcapC", "SCTConfBarrel", "SCTConfEndcapA"
-	};
-	TString conflabel[N_dir] = {
-	  "Num of Problematic Module in All Region", "Num of Problematic Module in EndcapC",
-	  "Num of Problematic Module in Barrel", "Num of Problematic Module in EndcapA"
-	};
-	TH1F *ConfNew[N_dir];
-	for(int i=0;i<N_dir;i++){
-	  TH1F* h_tmp = (TH1F*)infile->Get(conf_dir[i] + conftitleNew[i]);
-	  confdir[i]->cd();
-	  ConfNew[i] = new TH1F(conftitleNew[i]+"New", conflabel[i], 5, -0.5, 4.5);
-	  ConfNew[i]->GetXaxis()->SetBinLabel(1,"Flagged Links");
-	  if(h_tmp) ConfNew[i]->SetBinContent(1,h_tmp->GetBinContent(2));
-	  if(h_tmp) ConfNew[i]->SetBinError(1,TMath::Sqrt(h_tmp->GetBinContent(2)));
-	  ConfNew[i]->GetXaxis()->SetBinLabel(2,"Masked Links");
-	  if(h_tmp) ConfNew[i]->SetBinContent(2,h_tmp->GetBinContent(3));
-	  if(h_tmp) ConfNew[i]->SetBinError(2,TMath::Sqrt(h_tmp->GetBinContent(3)));
-	  ConfNew[i]->GetXaxis()->SetBinLabel(3,"Errors");
-	  ConfNew[i]->SetBinContent(3,countM[0][i]);
-	  ConfNew[i]->SetBinError(3,TMath::Sqrt(countM[0][i]));
-	  ConfNew[i]->GetXaxis()->SetBinLabel(4,"Inefficient");
-	  ConfNew[i]->SetBinContent(4,countM[1][i]);
-	  ConfNew[i]->SetBinError(4,TMath::Sqrt(countM[1][i]));
-	  ConfNew[i]->GetXaxis()->SetBinLabel(5,"Noisy");
-	  ConfNew[i]->SetBinContent(5,countM[2][i]);
-	  ConfNew[i]->SetBinError(5,TMath::Sqrt(countM[2][i]));
-	  ConfNew[i]->Write("", TObject::kOverwrite);
-	}
-      }
-
-      if (rno_debug) std::cout<<"Writing Histograms for SCT..."<<std::endl;
-      infile->Write();
-
-    }//while
-    //infile->Close();
-  }
-
-}//namespace
-- 
GitLab


From 9feec4ca978a390e5a7282afbda58ad711c3edab Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 5 Aug 2021 16:01:52 -0400
Subject: [PATCH 096/347] TileConditions: Don't fail if Digitization doesn't
 exist.

Don't fail configuration if the Digitization package doesn't exist.
Helps with testing in partial builds.
(This is a conditions package and that is simulation, so we really
shouldn't be depending on that in the first place.)
---
 .../TileConditions/python/TileInfoConfigurator.py         | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py
index 0e0e73c0cf8b..f182a652d08c 100644
--- a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py
+++ b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py
@@ -99,8 +99,12 @@ class _TileInfoConfigurator( TileInfoLoader ):
         #from .TileCondToolConf import getTileCondToolNoiseRawChn
         #ToolSvc += getTileCondToolNoiseRawChn('COOL')
 
-        from Digitization.DigitizationFlags import digitizationFlags
-        if not digitizationFlags.doXingByXingPileUp():
+        from PyUtils.moduleExists import moduleExists
+        doXingByXingPileUp = False
+        if moduleExists ('Digitization'):
+            from Digitization.DigitizationFlags import digitizationFlags
+            doXingByXingPileUp = digitizationFlags.doXingByXingPileUp()
+        if not doXingByXingPileUp:
             self.msg.info("Changing default TileCondToolTiming configuration to COOL source")
             from .TileCondToolConf import getTileCondToolTiming
             getTileCondToolTiming('COOL',type)
-- 
GitLab


From 9e88b0a5bea5666758a02880065f198e4d368494 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 5 Aug 2021 17:59:53 -0400
Subject: [PATCH 097/347] AthAllocators: Page-align blocks.

Align the memory allocated by ArenaBlock to page boundaries, and round
up the block size to the nearest page boundary.
---
 .../AthAllocators/AthAllocators/ArenaBlock.h  |  10 +-
 Control/AthAllocators/src/ArenaBlock.cxx      |  23 ++-
 .../src/ArenaBlockAllocatorBase.cxx           |   8 +-
 .../test/ArenaBlockAllocatorBase_test.cxx     |  40 ++--
 .../AthAllocators/test/ArenaBlock_test.cxx    |  20 +-
 .../test/ArenaCachingHandle_test.cxx          |  75 ++++---
 .../test/ArenaHandleBase_test.cxx             |  27 +--
 .../AthAllocators/test/ArenaHandle_test.cxx   |  53 ++---
 .../test/ArenaHeapAllocator_test.cxx          | 160 ++++++++-------
 .../test/ArenaHeapSTLAllocator_test.cxx       |  58 +++---
 .../test/ArenaPoolAllocator_test.cxx          | 185 ++++++++++--------
 .../test/ArenaPoolSTLAllocator_test.cxx       |  50 ++---
 .../test/ArenaSharedHeapSTLAllocator_test.cxx |  84 ++++----
 Control/AthAllocators/test/DataPool_test.cxx  |  17 +-
 14 files changed, 438 insertions(+), 372 deletions(-)

diff --git a/Control/AthAllocators/AthAllocators/ArenaBlock.h b/Control/AthAllocators/AthAllocators/ArenaBlock.h
index 3fd8677c22c6..24e2797d004c 100644
--- a/Control/AthAllocators/AthAllocators/ArenaBlock.h
+++ b/Control/AthAllocators/AthAllocators/ArenaBlock.h
@@ -1,11 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
-
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id: ArenaBlock.h 470529 2011-11-24 23:54:22Z ssnyder $
-
 /**
  * @file  AthAllocators/ArenaBlock.h
  * @author scott snyder
@@ -59,6 +55,10 @@ public:
    * @param elt_size The size in bytes of each element.
    * @param ctor If non-null, call this function on each element
    *             in the new block.
+   *
+   * The block will be allocated so that it entirely occupies
+   * a set of contiguous pages.  The requested size may be rounded
+   * up for this.
    */
   static ArenaBlock* newBlock (size_t n, size_t elt_size, func_t* ctor);
 
diff --git a/Control/AthAllocators/src/ArenaBlock.cxx b/Control/AthAllocators/src/ArenaBlock.cxx
index c09df379a99f..dbab9ddb5962 100644
--- a/Control/AthAllocators/src/ArenaBlock.cxx
+++ b/Control/AthAllocators/src/ArenaBlock.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: ArenaBlock.cxx 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file  AthAllocators/src/ArenaBlock.cxx
  * @author scott snyder
@@ -15,6 +13,8 @@
 
 #include "AthAllocators/ArenaBlock.h"
 #include <cstdlib>
+#include <unistd.h>
+#include <cassert>
 
 
 namespace SG {
@@ -30,18 +30,29 @@ std::atomic<size_t> ArenaBlock::s_nactive;
  * @param elt_size The size in bytes of each element.
  * @param ctor If non-null, call this function on each element
  *             in the new block.
+ *
+ * The block will be allocated so that it entirely occupies
+ * a set of contiguous pages.  The requested size may be rounded
+ * up for this.
  */
 ArenaBlock*
 ArenaBlock::newBlock (size_t n, size_t elt_size, func_t* ctor)
 {
+  static const size_t pageSize = sysconf (_SC_PAGESIZE);
   size_t tot_size = n*elt_size + ArenaBlockBodyOffset;
-  ArenaBlock* p = reinterpret_cast<ArenaBlock*> (std::malloc (tot_size));
+  // Round up to a multiple of pageSize.
+  size_t tot_size_rounded = (tot_size + (pageSize-1)) & ~(pageSize-1);
+  // Number of elements after rounding up.
+  size_t n_rounded = (tot_size_rounded - ArenaBlockBodyOffset) / elt_size;
+  assert (n_rounded >= n);
+  ArenaBlock* p = reinterpret_cast<ArenaBlock*>
+    (std::aligned_alloc (pageSize, tot_size_rounded));
   ++s_nactive;
   p->m_link = nullptr;
   p->m_elt_size = elt_size;
-  p->m_size = n;
+  p->m_size = n_rounded;
   if (ctor) {
-    for (size_t i = 0; i < n; i++)
+    for (size_t i = 0; i < n_rounded; i++)
       ctor (p->index (i, elt_size));
   }
   return p;
diff --git a/Control/AthAllocators/src/ArenaBlockAllocatorBase.cxx b/Control/AthAllocators/src/ArenaBlockAllocatorBase.cxx
index 608a1eac8173..d96ac519df50 100644
--- a/Control/AthAllocators/src/ArenaBlockAllocatorBase.cxx
+++ b/Control/AthAllocators/src/ArenaBlockAllocatorBase.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: ArenaBlockAllocatorBase.cxx 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file  AthAllocators/src/ArenaBlockAllocatorBase.cxx
  * @author scott snyder
@@ -127,7 +125,7 @@ void ArenaBlockAllocatorBase::reserve (size_t size)
     // Update statistics (others are derived in stats()).
     ++m_stats.blocks.free;
     ++m_stats.blocks.total;
-    m_stats.elts.total += sz;
+    m_stats.elts.total += newblock->size();
 
     // Add to the free list.
     newblock->link() = m_freeblocks;
@@ -235,7 +233,7 @@ ArenaBlock* ArenaBlockAllocatorBase::getBlock()
     // Otherwise, we need to make a new block.
     newblock = ArenaBlock::newBlock (m_params.nblock, m_params.eltSize,
                                      m_params.constructor);
-    m_stats.elts.total += m_params.nblock;
+    m_stats.elts.total += newblock->size();
     ++m_stats.blocks.total;
   }
   // Finish updating statistics.
diff --git a/Control/AthAllocators/test/ArenaBlockAllocatorBase_test.cxx b/Control/AthAllocators/test/ArenaBlockAllocatorBase_test.cxx
index 487aa686e624..39954cd4aa24 100644
--- a/Control/AthAllocators/test/ArenaBlockAllocatorBase_test.cxx
+++ b/Control/AthAllocators/test/ArenaBlockAllocatorBase_test.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: ArenaBlockAllocatorBase_test.cxx 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file AthAllocators/test/ArenaBlockAllocatorBase_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -16,6 +14,8 @@
 #include "CxxUtils/checker_macros.h"
 #include <cassert>
 #include <atomic>
+#include <vector>
+#include <iostream>
 
 
 struct Payload
@@ -27,20 +27,21 @@ struct Payload
 
   int x;
   int y;
+  char pad[40-2*sizeof(int)];
   static std::atomic<int> n;
-  //static std::vector<int> v;
+  static std::vector<int> v ATLAS_THREAD_SAFE;
 };
 
 Payload::Payload()
 {
   x = n++;
   y = 0;
-  //v.push_back (x);
+  v.push_back (x);
 }
 
 Payload::~Payload()
 {
-  //v.push_back (-x);
+  v.push_back (-x);
 }
 
 void Payload::clear ()
@@ -49,7 +50,7 @@ void Payload::clear ()
 }
 
 std::atomic<int> Payload::n;
-//std::vector<int> Payload::v;
+std::vector<int> Payload::v;
 
 
 class TestAlloc
@@ -92,25 +93,32 @@ void test1()
   test_stats (bab, 0, 0);
 
   bab.reserve (1000);
-  test_stats (bab, 1, 1000);
+  const size_t nelt1 = Payload::v.size();
+  assert (nelt1 >= 1000);
+  test_stats (bab, 1, nelt1);
 
   bab.reserve (500);
-  test_stats (bab, 1, 1000);
+  test_stats (bab, 1, nelt1);
 
   bab.reserve (0);
   test_stats (bab, 0, 0);
 
+  Payload::v.clear();
   bab.reserve (500);
-  test_stats (bab, 1, 500);
+  const size_t nelt2 = Payload::v.size();
+  assert (nelt2 >= 500);
+  test_stats (bab, 1, nelt2);
   bab.reserve (1000);
-  test_stats (bab, 2, 1000);
+  const size_t nelt3 = Payload::v.size();
+  assert (nelt3 >= 1000);
+  test_stats (bab, 2, nelt3);
   bab.reserve (500);
-  test_stats (bab, 1, 500);
+  test_stats (bab, 1, nelt2);
   bab.erase();
   test_stats (bab, 0, 0);
 
   bab.reserve (500);
-  test_stats (bab, 1, 500);
+  test_stats (bab, 1, nelt2);
   SG::ArenaBlock* blocks = bab.m_blocks;
   SG::ArenaBlock* freeblocks = bab.m_freeblocks;
   TestAlloc bab2 (std::move (bab));
@@ -119,7 +127,7 @@ void test1()
   assert (bab2.name() == "foo");
   assert (bab2.params().name == "foo");
   test_stats (bab, 0, 0);
-  test_stats (bab2, 1, 500);
+  test_stats (bab2, 1, nelt2);
   assert (bab.m_blocks == nullptr);
   assert (bab.m_freeblocks == nullptr);
   assert (bab2.m_blocks == blocks);
@@ -131,7 +139,7 @@ void test1()
   assert (bab2.name() == "foo");
   assert (bab2.params().name == "foo");
   test_stats (bab2, 0, 0);
-  test_stats (bab, 1, 500);
+  test_stats (bab, 1, nelt2);
   assert (bab2.m_blocks == nullptr);
   assert (bab2.m_freeblocks == nullptr);
   assert (bab.m_blocks == blocks);
@@ -143,7 +151,7 @@ void test1()
   assert (bab2.name() == "foo");
   assert (bab2.params().name == "foo");
   test_stats (bab, 0, 0);
-  test_stats (bab2, 1, 500);
+  test_stats (bab2, 1, nelt2);
   assert (bab.m_blocks == nullptr);
   assert (bab.m_freeblocks == nullptr);
   assert (bab2.m_blocks == blocks);
diff --git a/Control/AthAllocators/test/ArenaBlock_test.cxx b/Control/AthAllocators/test/ArenaBlock_test.cxx
index 7bce79c3b1c6..d151bb34f023 100644
--- a/Control/AthAllocators/test/ArenaBlock_test.cxx
+++ b/Control/AthAllocators/test/ArenaBlock_test.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: ArenaBlock_test.cxx 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file AthAllocators/test/ArenaBlock_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -86,7 +84,7 @@ void test1()
   SG::ArenaBlock* bl = SG::ArenaBlock::newBlock (20, elt_size, nullptr);
   assert (SG::ArenaBlock::nactive() == 1);
   assert (bl->overhead() > 0 && bl->overhead() < 100);
-  assert (bl->size() == 20);
+  assert (bl->size() >= 20);
   assert (bl->eltSize() == elt_size);
   word(bl, 0) = 0;
   word(bl, 1) = 0;
@@ -108,6 +106,10 @@ void test2()
                                                  Payload::constructor);
   SG::ArenaBlock* b3 = SG::ArenaBlock::newBlock (20, elt_size,
                                                  Payload::constructor);
+  assert (b1->size() >= 20);
+  assert (b2->size() >= 20);
+  assert (b3->size() >= 20);
+
   int i = 0;
   for (size_t j = 0; j < b1->size(); j++) {
     assert (payload(b1, j).x == i);
@@ -117,8 +119,8 @@ void test2()
   b1->link() = b2;
   SG::ArenaBlock::appendList (&b1, b3);
   assert (payload(b1).x == 0);
-  assert (payload(b1->link()).x == 20);
-  assert (payload(b1->link()->link()).x == 40);
+  assert (payload(b1->link()).x == static_cast<int>(b1->size()));
+  assert (payload(b1->link()->link()).x == static_cast<int>(b1->size() + b2->size()));
   assert(b1->link()->link()->link() == nullptr);
   SG::ArenaBlock* bb = nullptr;
   SG::ArenaBlock::appendList (&bb, b1);
@@ -126,17 +128,17 @@ void test2()
 
   Payload::v.clear();
   SG::ArenaBlock::applyList (b1, Payload::scan, 10);
-  assert (Payload::v.size() == 50);
+  assert (Payload::v.size() == 10 + b2->size() + b3->size());
   for (size_t j = 0; j < 10; ++j) {
     assert (Payload::v[j] == (int)j);
   }
   for (size_t j = 10; j < Payload::v.size(); ++j) {
-    assert (Payload::v[j] == (int)j+10);
+    assert (Payload::v[j] == static_cast<int>(j+(b1->size()-10)));
   }
 
   Payload::v.clear();
   SG::ArenaBlock::destroyList (b1, Payload::destructor);
-  assert (Payload::v.size() == 60);
+  assert (Payload::v.size() == b1->size() + b2->size() + b3->size());
   for (size_t j = 0; j < Payload::v.size(); ++j) {
     assert (Payload::v[j] == -(int)j);
   }
diff --git a/Control/AthAllocators/test/ArenaCachingHandle_test.cxx b/Control/AthAllocators/test/ArenaCachingHandle_test.cxx
index 95bd8f745e6e..dd55344878d1 100644
--- a/Control/AthAllocators/test/ArenaCachingHandle_test.cxx
+++ b/Control/AthAllocators/test/ArenaCachingHandle_test.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: ArenaCachingHandle_test.cxx 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file AthAllocators/test/ArenaCachingHandle_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -60,13 +58,12 @@ void test1()
       p->y = i+1;
       ptrs.push_back (p);
     }
-    assert (nctor == 100);
+    assert (nctor >= 100);
     assert (ndtor == 0);
     assert (nclear == 0);
+    assert (hand.stats().elts.total >= 100);
     assert (hand.stats().elts.inuse == 100);
-    assert (hand.stats().elts.free == 0);
-    assert (hand.stats().elts.total == 100);
-
+    assert (hand.stats().elts.free == hand.stats().elts.total - 100);
     std::vector<int> v;
     for (Handtype::iterator ii = hand.begin();
          ii != hand.end();
@@ -108,12 +105,12 @@ void test1()
     }
 
     hand.reset();
-    assert (nctor == 100);
+    assert (nctor >= 100);
     assert (ndtor == 0);
     assert (nclear == 100);
+    assert (hand.stats().elts.total >= 100);
     assert (hand.stats().elts.inuse == 0);
-    assert (hand.stats().elts.free == 100);
-    assert (hand.stats().elts.total == 100);
+    assert (hand.stats().elts.free == hand.stats().elts.total);
 
     ptrs.clear();
     for (int i=0; i < 100; i++) {
@@ -122,12 +119,12 @@ void test1()
       p->y = i + 1;
       ptrs.push_back (p);
     }
-    assert (nctor == 100);
+    assert (nctor >= 100);
     assert (ndtor == 0);
     assert (nclear == 100);
+    assert (hand.stats().elts.total >= 100);
     assert (hand.stats().elts.inuse == 100);
-    assert (hand.stats().elts.free == 0);
-    assert (hand.stats().elts.total == 100);
+    assert (hand.stats().elts.free == hand.stats().elts.total - 100);
   }
 
   {
@@ -135,22 +132,24 @@ void test1()
     size_t elt_size = hand2.params().eltSize;
 
     hand2.resetTo (ptrs[50]);
-    assert (nctor == 100);
+    assert (nctor >= 100);
     assert (ndtor == 0);
     assert (nclear == 150);
+    assert (hand2.stats().elts.total >= 100);
     assert (hand2.stats().elts.inuse == 50);
-    assert (hand2.stats().elts.free == 50);
-    assert (hand2.stats().elts.total == 100);
+    assert (hand2.stats().elts.free == hand2.stats().elts.total - 50);
+    assert (hand2.stats().blocks.total >= 1);
     assert (hand2.stats().blocks.inuse == 1);
-    assert (hand2.stats().blocks.free == 1);
-    assert (hand2.stats().blocks.total == 2);
+    assert (hand2.stats().blocks.free == hand2.stats().blocks.total - 1);
+    const size_t nelt = hand2.stats().elts.total;
+    const size_t nblock = hand2.stats().blocks.total;
     assert (hand2.stats().bytes.inuse == 50 * elt_size + block_ov);
-    assert (hand2.stats().bytes.free == 50 * elt_size + block_ov);
-    assert (hand2.stats().bytes.total == 100 * elt_size + 2*block_ov);
+    assert (hand2.stats().bytes.free == (nelt-50) * elt_size + (nblock-1)*block_ov);
+    assert (hand2.stats().bytes.total == nelt * elt_size + nblock*block_ov);
 
     hand2.erase();
-    assert (nctor == 100);
-    assert (ndtor == 100);
+    assert (nctor >= 100);
+    assert (ndtor == nctor);
     assert (nclear == 150);
     assert (hand2.stats().elts.inuse == 0);
     assert (hand2.stats().elts.free == 0);
@@ -184,31 +183,31 @@ void test2()
   }
   //printf ("%d %d %d\n", nctor, ndtor, nclear);
   //printf ("%d %d %d\n", hand.stats().elts.inuse, hand.stats().elts.free, hand.stats().elts.total());
-  assert (nctor == 100);
+  assert (nctor >= 100);
   assert (ndtor == 0);
   assert (nclear == 0);
+  assert (hand.stats().elts.total >= 100);
   assert (hand.stats().elts.inuse == 100);
-  assert (hand.stats().elts.free == 0);
-  assert (hand.stats().elts.total == 100);
+  assert (hand.stats().elts.free == hand.stats().elts.total - 100);
 
   for (size_t i = 0; i < ptrs.size(); i+=2) {
     hand.free (ptrs[i]);
   }
 
-  assert (nctor == 100);
+  assert (nctor >= 100);
   assert (ndtor == 0);
   assert (nclear == 50);
+  assert (hand.stats().elts.total >= 100);
   assert (hand.stats().elts.inuse == 50);
-  assert (hand.stats().elts.free == 50);
-  assert (hand.stats().elts.total == 100);
+  assert (hand.stats().elts.free == hand.stats().elts.total - 50);
 
   hand.reset();
-  assert (nctor == 100);
+  assert (nctor >= 100);
   assert (ndtor == 0);
-  assert (nclear == 150);
+  assert (nclear == nctor + 50);
+  assert (hand.stats().elts.total >= 100);
   assert (hand.stats().elts.inuse == 0);
-  assert (hand.stats().elts.free == 100);
-  assert (hand.stats().elts.total == 100);
+  assert (hand.stats().elts.free == hand.stats().elts.total);
 
   ptrs.clear();
   for (int i=0; i < 100; i++) {
@@ -217,12 +216,12 @@ void test2()
     p->y = i+1;
     ptrs.push_back (p);
   }
-  assert (nctor == 100);
+  assert (nctor >= 100);
   assert (ndtor == 0);
-  assert (nclear == 150);
+  assert (nclear == nctor + 50);
+  assert (hand.stats().elts.total >= 100);
   assert (hand.stats().elts.inuse == 100);
-  assert (hand.stats().elts.free == 0);
-  assert (hand.stats().elts.total == 100);
+  assert (hand.stats().elts.free == hand.stats().elts.total - 100);
 }
 
 
@@ -236,9 +235,9 @@ void test3()
   Handtype hand (&head, &params);
 
   hand.reserve (100);
+  assert (hand.stats().elts.total >= 100);
   assert (hand.stats().elts.inuse == 0);
-  assert (hand.stats().elts.free == 100);
-  assert (hand.stats().elts.total == 100);
+  assert (hand.stats().elts.free == hand.stats().elts.total);
 }
 
 
diff --git a/Control/AthAllocators/test/ArenaHandleBase_test.cxx b/Control/AthAllocators/test/ArenaHandleBase_test.cxx
index aa147d934fed..63eed33c61bd 100644
--- a/Control/AthAllocators/test/ArenaHandleBase_test.cxx
+++ b/Control/AthAllocators/test/ArenaHandleBase_test.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: ArenaHandleBase_test.cxx 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file AthAllocators/test/ArenaHandleBase_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -59,19 +57,20 @@ void test1()
     assert (test.stats().elts.free == 0);
     assert (test.stats().elts.total == 0);
     test.reserve (10);
+    assert (test.stats().elts.total >= 1000);
     assert (test.stats().elts.inuse == 0);
-    assert (test.stats().elts.free == 1000);
-    assert (test.stats().elts.total == 1000);
+    assert (test.stats().elts.free == test.stats().elts.total);
     assert (test.stats().blocks.inuse == 0);
     assert (test.stats().blocks.free == 1);
     assert (test.stats().blocks.total == 1);
+    const size_t nelt = test.stats().elts.total;
     assert (test.stats().bytes.inuse == 0);
-    assert (test.stats().bytes.free == 1000 * elt_size + block_ov);
-    assert (test.stats().bytes.total == 1000 * elt_size + block_ov);
+    assert (test.stats().bytes.free == nelt * elt_size + block_ov);
+    assert (test.stats().bytes.total == nelt * elt_size + block_ov);
     test.reset ();
+    assert (test.stats().elts.total >= 1000);
     assert (test.stats().elts.inuse == 0);
-    assert (test.stats().elts.free == 1000);
-    assert (test.stats().elts.total == 1000);
+    assert (test.stats().elts.free == test.stats().elts.total);
     test.erase ();
     assert (test.stats().elts.inuse == 0);
     assert (test.stats().elts.free == 0);
@@ -82,9 +81,9 @@ void test1()
   {
     SG::ArenaHandleBase test2 (static_cast<SG::ArenaHeader*>(nullptr), 0);
     test2.reserve (10);
+    assert (test2.stats().elts.total >= 1000);
     assert (test2.stats().elts.inuse == 0);
-    assert (test2.stats().elts.free == 1000);
-    assert (test2.stats().elts.total == 1000);
+    assert (test2.stats().elts.free == test2.stats().elts.total);
   }
 }
 
@@ -112,18 +111,21 @@ void test2()
     SG::ArenaHandleBase h1 (&header, EventContext(0, 1), i);
     h1.reserve (10);
   }
+#if 0
   assert (header.reportStr() == "\
 === 1 ===\n\
 Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
        0/   1000/   1000       0/   4032/   4032       0/      1/      1  \n\
 === 2 ===\n\
 === default ===\n");
+#endif
 
   {
     SG::ArenaHandleBase h2 (&a2, i);
     h2.reserve (10);
   }
 
+#if 0
   assert (header.reportStr() == "\
 === 1 ===\n\
 Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
@@ -132,12 +134,14 @@ Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
 Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
        0/   1000/   1000       0/   4032/   4032       0/      1/      1  \n\
 === default ===\n");
+#endif
 
   {
     SG::ArenaHandleBase h2 (&header, EventContext(0, 2), i);
     h2.reserve (2000);
   }
 
+#if 0
   assert (header.reportStr() == "\
 === 1 ===\n\
 Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
@@ -146,6 +150,7 @@ Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
 Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
        0/   2000/   2000       0/   8064/   8064       0/      2/      2  \n\
 === default ===\n");
+#endif
 }
 
 
diff --git a/Control/AthAllocators/test/ArenaHandle_test.cxx b/Control/AthAllocators/test/ArenaHandle_test.cxx
index a0c78bc2b47e..cc7af4cddd09 100644
--- a/Control/AthAllocators/test/ArenaHandle_test.cxx
+++ b/Control/AthAllocators/test/ArenaHandle_test.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: ArenaHandle_test.cxx 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file AthAllocators/test/ArenaHandle_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -61,9 +59,9 @@ void test1()
     assert (nctor == 100);
     assert (ndtor == 0);
     assert (nclear == 0);
+    assert (hand.stats().elts.total >= 100);
     assert (hand.stats().elts.inuse == 100);
-    assert (hand.stats().elts.free == 0);
-    assert (hand.stats().elts.total == 100);
+    assert (hand.stats().elts.free == hand.stats().elts.total - 100);
 
     std::vector<int> v;
     for (Handtype::iterator ii = hand.begin();
@@ -109,9 +107,9 @@ void test1()
     assert (nctor == 100);
     assert (ndtor == 100);
     assert (nclear == 0);
+    assert (hand.stats().elts.total >= 100);
     assert (hand.stats().elts.inuse == 0);
-    assert (hand.stats().elts.free == 100);
-    assert (hand.stats().elts.total == 100);
+    assert (hand.stats().elts.free == hand.stats().elts.total);
 
     ptrs.clear();
     for (int i=0; i < 100; i++) {
@@ -122,9 +120,9 @@ void test1()
     assert (nctor == 200);
     assert (ndtor == 100);
     assert (nclear == 0);
+    assert (hand.stats().elts.total >= 100);
     assert (hand.stats().elts.inuse == 100);
-    assert (hand.stats().elts.free == 0);
-    assert (hand.stats().elts.total == 100);
+    assert (hand.stats().elts.free == hand.stats().elts.total - 100);
   }
 
   {
@@ -134,9 +132,9 @@ void test1()
     assert (nctor == 200);
     assert (ndtor == 150);
     assert (nclear == 00);
+    assert (hand2.stats().elts.total >= 100);
     assert (hand2.stats().elts.inuse == 50);
-    assert (hand2.stats().elts.free == 50);
-    assert (hand2.stats().elts.total == 100);
+    assert (hand2.stats().elts.free == hand2.stats().elts.total - 50);
 
     hand2.erase();
     assert (nctor == 200);
@@ -175,9 +173,9 @@ void test2()
   assert (nctor == 100);
   assert (ndtor == 0);
   assert (nclear == 0);
+  assert (hand.stats().elts.total >= 100);
   assert (hand.stats().elts.inuse == 100);
-  assert (hand.stats().elts.free == 0);
-  assert (hand.stats().elts.total == 100);
+  assert (hand.stats().elts.free == hand.stats().elts.total - 100);
 
   for (size_t i = 0; i < ptrs.size(); i+=2) {
     hand.free (ptrs[i]);
@@ -185,23 +183,26 @@ void test2()
   assert (nctor == 100);
   assert (ndtor == 50);
   assert (nclear == 0);
+  assert (hand.stats().elts.total >= 100);
   assert (hand.stats().elts.inuse == 50);
-  assert (hand.stats().elts.free == 50);
-  assert (hand.stats().elts.total == 100);
-  assert (hand.stats().blocks.inuse == 2);
+  assert (hand.stats().elts.free == hand.stats().elts.total - 50);
+  const size_t nblock = hand.stats().blocks.total;
+  assert (nblock >= 1);
+  const size_t nelt = hand.stats().elts.total;
+  assert (hand.stats().blocks.inuse == nblock);
   assert (hand.stats().blocks.free == 0);
-  assert (hand.stats().blocks.total == 2);
-  assert (hand.stats().bytes.inuse ==  50 * elt_size + 2 * block_ov);
-  assert (hand.stats().bytes.free  ==  50 * elt_size);
-  assert (hand.stats().bytes.total == 100 * elt_size + 2 * block_ov);
+  assert (hand.stats().blocks.total == nblock);
+  assert (hand.stats().bytes.inuse ==  50 * elt_size + nblock * block_ov);
+  assert (hand.stats().bytes.free  ==  (nelt - 50) * elt_size);
+  assert (hand.stats().bytes.total == nelt * elt_size + nblock * block_ov);
 
   hand.reset();
   assert (nctor == 100);
   assert (ndtor == 100);
   assert (nclear == 0);
+  assert (hand.stats().elts.total >= 100);
   assert (hand.stats().elts.inuse == 0);
-  assert (hand.stats().elts.free == 100);
-  assert (hand.stats().elts.total == 100);
+  assert (hand.stats().elts.free == hand.stats().elts.total);
 
   ptrs.clear();
   for (int i=0; i < 100; i++) {
@@ -213,9 +214,9 @@ void test2()
   assert (nctor == 200);
   assert (ndtor == 100);
   assert (nclear == 0);
+  assert (hand.stats().elts.total >= 100);
   assert (hand.stats().elts.inuse == 100);
-  assert (hand.stats().elts.free == 0);
-  assert (hand.stats().elts.total == 100);
+  assert (hand.stats().elts.free == hand.stats().elts.total - 100);
 }
 
 
@@ -229,9 +230,9 @@ void test3()
   Handtype hand (&head, &params);
 
   hand.reserve (100);
+  assert (hand.stats().elts.total >= 100);
   assert (hand.stats().elts.inuse == 0);
-  assert (hand.stats().elts.free == 100);
-  assert (hand.stats().elts.total == 100);
+  assert (hand.stats().elts.free == hand.stats().elts.total);
 }
 
 
diff --git a/Control/AthAllocators/test/ArenaHeapAllocator_test.cxx b/Control/AthAllocators/test/ArenaHeapAllocator_test.cxx
index a61423a71522..96b758bb368d 100644
--- a/Control/AthAllocators/test/ArenaHeapAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaHeapAllocator_test.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: ArenaHeapAllocator_test.cxx 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file AthAllocators/test/ArenaHeapAllocator_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -18,6 +16,10 @@
 #include <cassert>
 #include <algorithm>
 #include <iostream>
+#include <unistd.h>
+
+
+static const size_t pageSize = sysconf (_SC_PAGESIZE);
 
 
 //==========================================================================
@@ -32,6 +34,7 @@ struct Payload
 
   int x;
   int y;
+  char pad[40-2*sizeof(int)-sizeof(void*)];
   static std::atomic<int> n;
   static std::vector<int> v ATLAS_THREAD_SAFE;
 };
@@ -71,8 +74,8 @@ void test1()
   assert (aha.stats().blocks.inuse == 0);
   assert (aha.stats().blocks.free  == 0);
   assert (aha.stats().blocks.total == 0);
-  size_t elt_size = aha.params().eltSize;
-  size_t block_ov = SG::ArenaBlock::overhead();
+  const size_t elt_size = aha.params().eltSize;
+  const size_t block_ov = SG::ArenaBlock::overhead();
 
   int nptr = 987;
   std::vector<Payload*> ptrs;
@@ -81,75 +84,81 @@ void test1()
     ptrs.push_back (p);
     p->y = 2*p->x;
   }
-  assert  (Payload::v.size() == 1000);
-  for (int i=0; i < 1000; ++i) {
-    assert (Payload::v[i] == i);
+  const size_t nelt = Payload::v.size();
+  assert  (nelt >= 1000);
+  for (size_t i=0; i < nelt; ++i) {
+    assert (Payload::v[i] == static_cast<int>(i));
   }
+
+  const size_t elts_per_block = (pageSize - SG::ArenaBlockBodyOffset) / elt_size;
+  const size_t nblocks = (1000 + elts_per_block-1) / elts_per_block;
+
   assert (aha.stats().elts.inuse == 987);
-  assert (aha.stats().elts.free == 13);
-  assert (aha.stats().elts.total == 1000);
-  assert (aha.stats().blocks.inuse == 10);
+  assert (aha.stats().elts.total == nelt);
+  assert (aha.stats().elts.free == nelt - 987);
+  assert (aha.stats().blocks.inuse == nblocks);
   assert (aha.stats().blocks.free  ==  0);
-  assert (aha.stats().blocks.total == 10);
+  assert (aha.stats().blocks.total == nblocks);
 
   for (size_t i = 0; i < ptrs.size(); i += 2)
     aha.free ((char*)ptrs[i]);
   assert (aha.stats().elts.inuse == 493);
-  assert (aha.stats().elts.free == 507);
-  assert (aha.stats().elts.total == 1000);
-  assert (aha.stats().blocks.inuse == 10);
+  assert (aha.stats().elts.total == nelt);
+  assert (aha.stats().elts.free == nelt - 493);
+  assert (aha.stats().blocks.inuse == nblocks);
   assert (aha.stats().blocks.free  ==  0);
-  assert (aha.stats().blocks.total == 10);
+  assert (aha.stats().blocks.total == nblocks);
   for (size_t i = 0; i < ptrs.size(); i += 2)
     assert (ptrs[i]->y == 0);
   for (size_t i = 0; i < 300; i++)
     ptrs.push_back (reinterpret_cast<Payload*>(aha.allocate()));
   //printf ("%d %d %d\n", aha.stats().elts.inuse, aha.stats().elts.free, aha.stats().elts.total);
   assert (aha.stats().elts.inuse == 793);
-  assert (aha.stats().elts.free == 207);
-  assert (aha.stats().elts.total == 1000);
-  assert (aha.stats().blocks.inuse == 10);
+  assert (aha.stats().elts.total == nelt);
+  assert (aha.stats().elts.free == nelt - 793);
+  assert (aha.stats().blocks.inuse == nblocks);
   assert (aha.stats().blocks.free  ==  0);
-  assert (aha.stats().blocks.total == 10);
+  assert (aha.stats().blocks.total == nblocks);
 
-  assert (aha.stats().bytes.inuse ==  (793 * elt_size + 10 * block_ov));
-  assert (aha.stats().bytes.free  ==  207 * elt_size);
-  assert (aha.stats().bytes.total == (1000 * elt_size + 10 * block_ov));
+  assert (aha.stats().bytes.inuse ==  (793 * elt_size + nblocks * block_ov));
+  assert (aha.stats().bytes.free  ==  (nelt - 793) * elt_size);
+  assert (aha.stats().bytes.total == (nelt * elt_size + nblocks * block_ov));
 
   aha.reset();
   assert (aha.stats().elts.inuse == 0);
-  assert (aha.stats().elts.free == 1000);
-  assert (aha.stats().elts.total == 1000);
+  assert (aha.stats().elts.free == nelt);
+  assert (aha.stats().elts.total == nelt);
   assert (aha.stats().blocks.inuse ==  0);
-  assert (aha.stats().blocks.free  == 10);
-  assert (aha.stats().blocks.total == 10);
+  assert (aha.stats().blocks.free  == nblocks);
+  assert (aha.stats().blocks.total == nblocks);
 
   ptrs.clear();
   for (size_t i = 0; i < 300; i++)
     ptrs.push_back (reinterpret_cast<Payload*>(aha.allocate()));
   assert (aha.stats().elts.inuse == 300);
-  assert (aha.stats().elts.free == 700);
-  assert (aha.stats().elts.total == 1000);
-  assert (aha.stats().blocks.inuse ==  3);
-  assert (aha.stats().blocks.free  ==  7);
-  assert (aha.stats().blocks.total == 10);
+  assert (aha.stats().elts.free == nelt - 300);
+  assert (aha.stats().elts.total == nelt);
+  assert (aha.stats().blocks.inuse == (300 + elts_per_block-1) / elts_per_block);
+  assert (aha.stats().blocks.free  ==  nblocks - aha.stats().blocks.inuse);
+  assert (aha.stats().blocks.total == nblocks);
 
   aha.reserve (550);
   assert (aha.stats().elts.inuse == 300);
-  assert (aha.stats().elts.free == 300);
-  assert (aha.stats().elts.total == 600);
-  assert (aha.stats().blocks.inuse ==  3);
-  assert (aha.stats().blocks.free  ==  3);
-  assert (aha.stats().blocks.total ==  6);
+  assert (aha.stats().elts.total == ((550 + elts_per_block-1) / elts_per_block) * elts_per_block);
+  assert (aha.stats().elts.free == aha.stats().elts.total - 300);
+  assert (aha.stats().blocks.inuse ==  (300 + elts_per_block-1) / elts_per_block);
+  assert (aha.stats().blocks.total ==  (550 + elts_per_block-1) / elts_per_block);
+  assert (aha.stats().blocks.free  ==  aha.stats().blocks.total - aha.stats().blocks.inuse);
 
   aha.reserve (1000);
   //printf ("%d %d %d\n", aha.stats().elts.inuse, aha.stats().elts.free, aha.stats().elts.total);
   assert (aha.stats().elts.inuse == 300);
-  assert (aha.stats().elts.free == 700);
-  assert (aha.stats().elts.total == 1000);
-  assert (aha.stats().blocks.inuse ==  3);
-  assert (aha.stats().blocks.free  ==  4);
-  assert (aha.stats().blocks.total ==  7);
+  assert (aha.stats().elts.total >= 1000);
+  assert (aha.stats().elts.free == aha.stats().elts.total - 300);
+  assert (aha.stats().blocks.inuse ==  (300 + elts_per_block-1) / elts_per_block);
+  assert (aha.stats().blocks.total == (550 + elts_per_block-1) / elts_per_block + 1); 
+  assert (aha.stats().blocks.free  ==  aha.stats().blocks.total - aha.stats().blocks.inuse);
+  const size_t nelt2 = aha.stats().elts.total;
 
   Payload::v.clear();
   aha.erase();
@@ -159,14 +168,10 @@ void test1()
   assert (aha.stats().blocks.inuse ==  0);
   assert (aha.stats().blocks.free  ==  0);
   assert (aha.stats().blocks.total ==  0);
-  assert (Payload::v.size() == 1000);
+  assert (Payload::v.size() == nelt2);
   std::sort (Payload::v.begin(), Payload::v.end());
-  for (size_t i = 0; i < 700; i++) {
-    assert (Payload::v[i] == (int)i-1399);
-    //printf ("%d %d\n", Payload::v[i], i);
-  }
-  for (size_t i = 700; i < Payload::v.size(); i++) {
-    assert (Payload::v[i] == (int)i-999);
+  for (size_t i = 0; i < Payload::v.size(); i++) {
+    assert (Payload::v[i] <= 0);
   }
 }
 
@@ -174,6 +179,8 @@ void test1()
 void test2()
 {
   std::cout << "test2\n";
+  Payload::v.clear();
+  
   SG::ArenaHeapAllocator::Params params = 
     SG::ArenaHeapAllocator::initParams<Payload, true>(100);
   params.mustClear = true;
@@ -200,12 +207,20 @@ void test2()
   }
   aha.reset();
   assert (nclear == 987);
+
+  size_t nelt = Payload::v.size();
+  assert  (nelt >= 1000);
+
+  const size_t elt_size = aha.params().eltSize;
+  const size_t elts_per_block = (pageSize - SG::ArenaBlockBodyOffset) / elt_size;
+  const size_t nblocks = (1000 + elts_per_block-1) / elts_per_block;
+
   assert (aha.stats().elts.inuse == 0);
-  assert (aha.stats().elts.free == 1000);
-  assert (aha.stats().elts.total == 1000);
+  assert (aha.stats().elts.free == nelt);
+  assert (aha.stats().elts.total == nelt);
   assert (aha.stats().blocks.inuse ==  0);
-  assert (aha.stats().blocks.free  == 10);
-  assert (aha.stats().blocks.total == 10);
+  assert (aha.stats().blocks.free  == nblocks);
+  assert (aha.stats().blocks.total == nblocks);
 
   for (size_t i = 0; i < ptrs.size(); i++) {
     if ((i&1) != 0)
@@ -227,14 +242,21 @@ void test3()
     aha.allocate();
   }
 
+  const size_t nelt = Payload::v.size();
+  assert  (nelt >= 150);
+
+  const size_t elt_size = aha.params().eltSize;
+  const size_t elts_per_block = (pageSize - SG::ArenaBlockBodyOffset) / elt_size;
+  const size_t nblocks = (150 + elts_per_block-1) / elts_per_block;
+
   assert (aha.name() == "bar");
   assert (aha.params().name == "bar");
   assert (aha.stats().elts.inuse == 150);
-  assert (aha.stats().elts.free == 50);
-  assert (aha.stats().elts.total == 200);
-  assert (aha.stats().blocks.inuse == 2);
+  assert (aha.stats().elts.free == nelt - 150);
+  assert (aha.stats().elts.total == nelt);
+  assert (aha.stats().blocks.inuse == nblocks);
   assert (aha.stats().blocks.free  == 0);
-  assert (aha.stats().blocks.total == 2);
+  assert (aha.stats().blocks.total == nblocks);
 
   SG::ArenaHeapAllocator aha2 (std::move (aha));
   assert (aha.name() == "bar");
@@ -242,11 +264,11 @@ void test3()
   assert (aha2.name() == "bar");
   assert (aha2.params().name == "bar");
   assert (aha2.stats().elts.inuse == 150);
-  assert (aha2.stats().elts.free == 50);
-  assert (aha2.stats().elts.total == 200);
-  assert (aha2.stats().blocks.inuse == 2);
+  assert (aha2.stats().elts.free == nelt - 150);
+  assert (aha2.stats().elts.total == nelt);
+  assert (aha2.stats().blocks.inuse == nblocks);
   assert (aha2.stats().blocks.free  == 0);
-  assert (aha2.stats().blocks.total == 2);
+  assert (aha2.stats().blocks.total == nblocks);
   assert (aha.stats().elts.inuse == 0);
   assert (aha.stats().elts.free == 0);
   assert (aha.stats().elts.total == 0);
@@ -260,11 +282,11 @@ void test3()
   assert (aha2.name() == "bar");
   assert (aha2.params().name == "bar");
   assert (aha.stats().elts.inuse == 150);
-  assert (aha.stats().elts.free == 50);
-  assert (aha.stats().elts.total == 200);
-  assert (aha.stats().blocks.inuse == 2);
+  assert (aha.stats().elts.free == nelt - 150);
+  assert (aha.stats().elts.total == nelt);
+  assert (aha.stats().blocks.inuse == nblocks);
   assert (aha.stats().blocks.free  == 0);
-  assert (aha.stats().blocks.total == 2);
+  assert (aha.stats().blocks.total == nblocks);
   assert (aha2.stats().elts.inuse == 0);
   assert (aha2.stats().elts.free == 0);
   assert (aha2.stats().elts.total == 0);
@@ -278,11 +300,11 @@ void test3()
   assert (aha2.name() == "bar");
   assert (aha2.params().name == "bar");
   assert (aha2.stats().elts.inuse == 150);
-  assert (aha2.stats().elts.free == 50);
-  assert (aha2.stats().elts.total == 200);
-  assert (aha2.stats().blocks.inuse == 2);
+  assert (aha2.stats().elts.free == nelt - 150);
+  assert (aha2.stats().elts.total == nelt);
+  assert (aha2.stats().blocks.inuse == nblocks);
   assert (aha2.stats().blocks.free  == 0);
-  assert (aha2.stats().blocks.total == 2);
+  assert (aha2.stats().blocks.total == nblocks);
   assert (aha.stats().elts.inuse == 0);
   assert (aha.stats().elts.free == 0);
   assert (aha.stats().elts.total == 0);
diff --git a/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx b/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx
index 14ffe4e63a5b..0ce661c65393 100644
--- a/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.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: ArenaHeapSTLAllocator_test.cxx,v 1.2 2008-08-26 02:12:26 ssnyder Exp $
 /**
  * @file AthAllocators/test/ArenaHeapSTLAllocator_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -139,11 +137,11 @@ void test1()
   }
 
   assert (a4.stats().elts.inuse == 1);
-  assert (a4.stats().elts.total == 100);
+  assert (a4.stats().elts.total >= 100);
 
   a4.reset();
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 100);
+  assert (a4.stats().elts.total >= 100);
 
   a4.erase();
   assert (a4.stats().elts.inuse == 0);
@@ -151,7 +149,7 @@ void test1()
 
   a4.reserve(5000);
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 5000);
+  assert (a4.stats().elts.total >= 5000);
 
   assert (Payload::n == 2);
   assert (Payload::v.size() == 0);
@@ -192,16 +190,16 @@ void test2()
 
   (void)a3.allocate (1);
   assert (a3.stats().elts.inuse == 1);
-  assert (a3.stats().elts.total == 1000);
+  assert (a3.stats().elts.total >= 1000);
 
   assert (a4.stats().elts.inuse == 1);
-  assert (a4.stats().elts.total == 1000);
+  assert (a4.stats().elts.total >= 1000);
 
   CTest c4 (a4);
   auto a4_nc = SG::ArenaHeapSTLAllocator<int>::get_allocator (c4);
   a4_nc.reset();
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 1000);
+  assert (a4.stats().elts.total >= 1000);
 
   a4_nc.erase();
   assert (a4.stats().elts.inuse == 0);
@@ -209,15 +207,15 @@ void test2()
 
   a4_nc.reserve(1000);
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 1000);
+  assert (a4.stats().elts.total >= 1000);
 
   int* p = a4.allocate (2);
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 1000);
+  assert (a4.stats().elts.total >= 1000);
 
   a4.deallocate (p, 2);
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 1000);
+  assert (a4.stats().elts.total >= 1000);
 
   assert (Payload::n == 0);
   assert (Payload::v.size() == 0);
@@ -238,7 +236,7 @@ void test3()
   Payload* pp[10];
   pp[0] = b1.allocate(1);
   assert (b1.stats().elts.inuse == 1);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
 
   SG::ArenaHeapSTLAllocator<Payload, int> b2 (std::move (b1));
   assert (b1.nblock() == 100);
@@ -248,12 +246,12 @@ void test3()
   assert (b1.stats().elts.inuse == 0);
   assert (b1.stats().elts.total == 0);
   assert (b2.stats().elts.inuse == 1);
-  assert (b2.stats().elts.total == 100);
+  assert (b2.stats().elts.total >= 100);
   b2.deallocate (pp[0], 1);
   pp[1] = b2.allocate(1);
   pp[0] = b2.allocate(1);
   assert (b2.stats().elts.inuse == 2);
-  assert (b2.stats().elts.total == 100);
+  assert (b2.stats().elts.total >= 100);
 
   b1 = std::move(b2);
   assert (b1.nblock() == 100);
@@ -263,12 +261,12 @@ void test3()
   assert (b2.stats().elts.inuse == 0);
   assert (b2.stats().elts.total == 0);
   assert (b1.stats().elts.inuse == 2);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
   b1.deallocate (pp[0], 1);
   pp[2] = b1.allocate(1);
   pp[0] = b1.allocate(1);
   assert (b1.stats().elts.inuse == 3);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
 
   b1.swap(b2);
   assert (b1.nblock() == 100);
@@ -278,7 +276,7 @@ void test3()
   assert (b1.stats().elts.inuse == 0);
   assert (b1.stats().elts.total == 0);
   assert (b2.stats().elts.inuse == 3);
-  assert (b2.stats().elts.total == 100);
+  assert (b2.stats().elts.total >= 100);
 
   assert (b1 == b1);
   assert (!(b1 != b1));
@@ -305,7 +303,7 @@ void test4()
     list.push_back (i);
 
   assert (list.size() == 10);
-  assert (list.get_allocator().stats().elts.total == 500);
+  assert (list.get_allocator().stats().elts.total >= 500);
   assert (list.get_allocator().stats().elts.inuse == 10);
 
   for (list_t::iterator i = list.begin();
@@ -317,16 +315,16 @@ void test4()
   }
 
   assert (list.size() == 5);
-  assert (list.get_allocator().stats().elts.total == 500);
+  assert (list.get_allocator().stats().elts.total >= 500);
   assert (list.get_allocator().stats().elts.inuse == 5);
 
   list.clear();
   assert (list.size() == 0);
-  assert (list.get_allocator().stats().elts.total == 500);
+  assert (list.get_allocator().stats().elts.total >= 500);
   assert (list.get_allocator().stats().elts.inuse == 0);
 
   allocator_t::get_allocator(list).reset();
-  assert (list.get_allocator().stats().elts.total == 500);
+  assert (list.get_allocator().stats().elts.total >= 500);
   assert (list.get_allocator().stats().elts.inuse == 0);
 
   assert (Payload::n == 0);
@@ -350,16 +348,16 @@ void test5()
     list.push_back (i);
 
   assert (list.size() == 10);
-  assert (list.get_allocator().stats().elts.total == 500);
+  assert (list.get_allocator().stats().elts.total >= 500);
   assert (list.get_allocator().stats().elts.inuse == 10);
 
   list_t list2 = list;
   assert (list.size() == 10);
-  assert (list.get_allocator().stats().elts.total == 500);
+  assert (list.get_allocator().stats().elts.total >= 500);
   assert (list.get_allocator().stats().elts.inuse == 10);
 
   assert (list2.size() == 10);
-  assert (list2.get_allocator().stats().elts.total == 500);
+  assert (list2.get_allocator().stats().elts.total >= 500);
   assert (list2.get_allocator().stats().elts.inuse == 10);
 
   // This fails in gcc 6.2.
@@ -385,17 +383,17 @@ void test5()
   list_t list3;
   list3 = list;
   assert (list.size() == 10);
-  assert (list.get_allocator().stats().elts.total == 500);
+  assert (list.get_allocator().stats().elts.total >= 500);
   assert (list.get_allocator().stats().elts.inuse == 10);
 
   assert (list3.size() == 10);
-  assert (list3.get_allocator().stats().elts.total == 1000);
+  assert (list3.get_allocator().stats().elts.total >= 1000);
   assert (list3.get_allocator().stats().elts.inuse == 10);
 #endif
 
   list_t list4 (std::move (list2));
   assert (list4.size() == 10);
-  assert (list4.get_allocator().stats().elts.total == 500);
+  assert (list4.get_allocator().stats().elts.total >= 500);
   assert (list4.get_allocator().stats().elts.inuse == 10);
   assert (list2.size() == 0);
   assert (list2.get_allocator().stats().elts.total == 0);
@@ -403,7 +401,7 @@ void test5()
 
   list2 = std::move(list4);
   assert (list2.size() == 10);
-  assert (list2.get_allocator().stats().elts.total == 500);
+  assert (list2.get_allocator().stats().elts.total >= 500);
   assert (list2.get_allocator().stats().elts.inuse == 10);
   assert (list4.size() == 0);
   assert (list4.get_allocator().stats().elts.total == 0);
@@ -411,7 +409,7 @@ void test5()
 
   list2.swap (list4);
   assert (list4.size() == 10);
-  assert (list4.get_allocator().stats().elts.total == 500);
+  assert (list4.get_allocator().stats().elts.total >= 500);
   assert (list4.get_allocator().stats().elts.inuse == 10);
   assert (list2.size() == 0);
   assert (list2.get_allocator().stats().elts.total == 0);
diff --git a/Control/AthAllocators/test/ArenaPoolAllocator_test.cxx b/Control/AthAllocators/test/ArenaPoolAllocator_test.cxx
index 0a9797113cd2..59a37ae7fd92 100644
--- a/Control/AthAllocators/test/ArenaPoolAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaPoolAllocator_test.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: ArenaPoolAllocator_test.cxx 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file AthAllocators/test/ArenaPoolAllocator_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -19,6 +17,10 @@
 #include <algorithm>
 #include <iostream>
 #include <atomic>
+#include <unistd.h>
+
+
+static const size_t pageSize = sysconf (_SC_PAGESIZE);
 
 
 //==========================================================================
@@ -33,6 +35,7 @@ struct Payload
 
   int x;
   int y;
+  char pad[40-2*sizeof(int)];
   static std::atomic<int> n;
   static std::vector<int> v ATLAS_THREAD_SAFE;
 };
@@ -74,6 +77,7 @@ void test1()
   assert (apa.stats().blocks.free == 0);
   assert (apa.stats().blocks.total == 0);
   assert (apa.params().eltSize == sizeof (Payload));
+  const size_t elt_size = apa.params().eltSize;
 
   int nptr = 987;
   std::vector<Payload*> ptrs;
@@ -83,25 +87,30 @@ void test1()
     ptrs.push_back (p);
     p->y = 2*p->x;
   }
-  assert  (Payload::v.size() == 1000);
-  for (int i=0; i < 1000; ++i) {
-    assert (Payload::v[i] == i);
+  const size_t nelt = Payload::v.size();
+  assert  (nelt >= 1000);
+  for (size_t i=0; i < nelt; ++i) {
+    assert (Payload::v[i] == static_cast<int>(i));
   }
+
+  const size_t elts_per_block = (pageSize - SG::ArenaBlockBodyOffset) / elt_size;
+  const size_t nblocks = (1000 + elts_per_block-1) / elts_per_block;
+
   assert (apa.stats().elts.inuse == 987);
-  assert (apa.stats().elts.free == 13);
-  assert (apa.stats().elts.total == 1000);
-  assert (apa.stats().blocks.inuse == 10);
+  assert (apa.stats().elts.free == nelt - 987);
+  assert (apa.stats().elts.total == nelt);
+  assert (apa.stats().blocks.inuse == nblocks);
   assert (apa.stats().blocks.free == 0);
-  assert (apa.stats().blocks.total == 10);
+  assert (apa.stats().blocks.total == nblocks);
 
   Payload::v.clear();
   apa.reset();
   assert (apa.stats().elts.inuse == 0);
-  assert (apa.stats().elts.free == 1000);
-  assert (apa.stats().elts.total == 1000);
+  assert (apa.stats().elts.free == nelt);
+  assert (apa.stats().elts.total == nelt);
   assert (apa.stats().blocks.inuse == 0);
-  assert (apa.stats().blocks.free == 10);
-  assert (apa.stats().blocks.total == 10);
+  assert (apa.stats().blocks.free == nblocks);
+  assert (apa.stats().blocks.total == nblocks);
 
   for (int i=0; i < 300; i++) {
     Payload* p = reinterpret_cast<Payload*> (apa.allocate());
@@ -111,11 +120,11 @@ void test1()
   }
   assert (Payload::v.size() == 0);
   assert (apa.stats().elts.inuse == 300);
-  assert (apa.stats().elts.free == 700);
-  assert (apa.stats().elts.total == 1000);
-  assert (apa.stats().blocks.inuse == 3);
-  assert (apa.stats().blocks.free == 7);
-  assert (apa.stats().blocks.total == 10);
+  assert (apa.stats().elts.free == nelt - 300);
+  assert (apa.stats().elts.total == nelt);
+  assert (apa.stats().blocks.inuse == (300 + elts_per_block-1) / elts_per_block);
+  assert (apa.stats().blocks.free  ==  nblocks - apa.stats().blocks.inuse);
+  assert (apa.stats().blocks.total == nblocks);
 
   apa.allocate();
   std::vector<int> vv;
@@ -168,52 +177,50 @@ void test1()
   }
   assert (Payload::v.size() == 0);
   assert (apa.stats().elts.inuse == 400);
-  assert (apa.stats().elts.free == 600);
-  assert (apa.stats().elts.total == 1000);
-  assert (apa.stats().blocks.inuse == 4);
-  assert (apa.stats().blocks.free == 6);
-  assert (apa.stats().blocks.total == 10);
+  assert (apa.stats().elts.free == nelt - 400);
+  assert (apa.stats().elts.total == nelt);
+  assert (apa.stats().blocks.inuse == (400 + elts_per_block-1) / elts_per_block);
+  assert (apa.stats().blocks.free  ==  nblocks - apa.stats().blocks.inuse);
+  assert (apa.stats().blocks.total == nblocks);
 
   Payload::v.clear();
   apa.reserve (550);
   assert (apa.stats().elts.inuse == 400);
-  assert (apa.stats().elts.free == 200);
-  assert (apa.stats().elts.total == 600);
-  assert (apa.stats().blocks.inuse == 4);
-  assert (apa.stats().blocks.free == 2);
-  assert (apa.stats().blocks.total == 6);
-  assert (Payload::v.size() == 400);
+  assert (apa.stats().elts.total == ((550 + elts_per_block-1) / elts_per_block) * elts_per_block);
+  assert (apa.stats().elts.free == apa.stats().elts.total - 400);
+  assert (apa.stats().blocks.inuse == (400 + elts_per_block-1) / elts_per_block);
+  assert (apa.stats().blocks.total == (550 + elts_per_block-1) / elts_per_block);
+  assert (apa.stats().blocks.free  ==  apa.stats().blocks.total - apa.stats().blocks.inuse);
+  const size_t freed_blocks = (nelt - 550)/elts_per_block;
+  assert (Payload::v.size() == freed_blocks * elts_per_block);
   std::sort (Payload::v.begin(), Payload::v.end());
-  for (size_t i=0; i < 100; i++) {
-    assert (Payload::v[i] == (int)i-799);
-  }
-  for (size_t i=100; i < Payload::v.size(); i++) {
-    assert (Payload::v[i] == (int)i-799);
+  const size_t max_del = (apa.stats().blocks.inuse + freed_blocks)*elts_per_block-1;
+  for (size_t i=0; i < Payload::v.size(); i++) {
+    assert (Payload::v[i] == static_cast<int>(i-max_del));
   }
 
   Payload::v.clear();
-  apa.reserve (950);
+  const size_t nelt2 = apa.stats().elts.total;
+  apa.reserve (nelt2 + elts_per_block / 2);
   assert (apa.stats().elts.inuse == 400);
-  assert (apa.stats().elts.free == 550);
-  assert (apa.stats().elts.total == 950);
-  assert (apa.stats().blocks.inuse == 4);
-  assert (apa.stats().blocks.free == 3);
-  assert (apa.stats().blocks.total == 7);
-  assert (Payload::v.size() == 350);
+  assert (apa.stats().elts.total == nelt2 + elts_per_block);
+  assert (apa.stats().elts.free == apa.stats().elts.total - apa.stats().elts.inuse);
+  assert (apa.stats().blocks.inuse == (400 + elts_per_block-1) / elts_per_block);
+  assert (apa.stats().blocks.total == (550 + elts_per_block-1) / elts_per_block + 1);
+  assert (apa.stats().blocks.free  ==  apa.stats().blocks.total - apa.stats().blocks.inuse);
+  assert (Payload::v.size() == elts_per_block);
   std::sort (Payload::v.begin(), Payload::v.end());
   for (size_t i=0; i < Payload::v.size(); i++) {
-    assert (Payload::v[i] == (int)i+1000);
+    assert (Payload::v[i] == static_cast<int>(i+nelt));
   }
 
+  
   Payload::v.clear();
   apa.erase();
-  assert (Payload::v.size() == 950);
+  assert (Payload::v.size() == nelt2 + elts_per_block);
   std::sort (Payload::v.begin(), Payload::v.end());
-  for (size_t i=0; i < 550; i++) {
-    assert (Payload::v[i] == (int)i-1349);
-  }
-  for (size_t i=550; i < Payload::v.size(); i++) {
-    assert (Payload::v[i] == (int)i-949);
+  for (size_t i=0; i < Payload::v.size() ; i++) {
+    assert (Payload::v[i] <= 0);
   }
   assert (apa.stats().elts.inuse == 0);
   assert (apa.stats().elts.free == 0);
@@ -233,35 +240,42 @@ void test2()
   for (int i=0; i < 150; i++) {
     apa.allocate();
   }
-  assert (Payload::v.size() == 200);
+
+  assert (Payload::v.size() >= 150);
+
   SG::ArenaPoolAllocator::pointer p = apa.allocate();
-  assert (Payload::v.size() == 200);
+  assert (Payload::v.size() >= 151);
   for (int i=0; i < 150; i++) {
     apa.allocate();
   }
-  assert (Payload::v.size() == 400);
+  const size_t nelt = Payload::v.size();
+  assert (nelt >= 301);
+  const size_t elt_size = apa.params().eltSize;
+  const size_t elts_per_block = (pageSize - SG::ArenaBlockBodyOffset) / elt_size;
+  const size_t nblocks1 = (150 + elts_per_block-1) / elts_per_block;
+  const size_t nblocks2 = (301 + elts_per_block-1) / elts_per_block;
+
   assert (apa.stats().elts.inuse == 301);
-  assert (apa.stats().elts.free == 99);
-  assert (apa.stats().elts.total == 400);
-  assert (apa.stats().blocks.inuse == 4);
+  assert (apa.stats().elts.free == nelt - 301);
+  assert (apa.stats().elts.total == nelt);
+  assert (apa.stats().blocks.inuse == nblocks2);
   assert (apa.stats().blocks.free  == 0);
-  assert (apa.stats().blocks.total == 4);
+  assert (apa.stats().blocks.total == nblocks2);
 
-  size_t elt_size = apa.params().eltSize;
-  size_t block_ov = SG::ArenaBlock::overhead();
+  const size_t block_ov = SG::ArenaBlock::overhead();
 
   apa.resetTo (p);
 
   assert (apa.stats().elts.inuse == 150);
-  assert (apa.stats().elts.free == 250);
-  assert (apa.stats().elts.total == 400);
-  assert (apa.stats().blocks.inuse == 2);
-  assert (apa.stats().blocks.free  == 2);
-  assert (apa.stats().blocks.total == 4);
-
-  assert (apa.stats().bytes.inuse == (150 * elt_size + 2 * block_ov));
-  assert (apa.stats().bytes.free == (250 * elt_size + 2 * block_ov));
-  assert (apa.stats().bytes.total == (400 * elt_size + 4 * block_ov));
+  assert (apa.stats().elts.free == nelt - 150);
+  assert (apa.stats().elts.total == nelt);
+  assert (apa.stats().blocks.inuse == nblocks1);
+  assert (apa.stats().blocks.free  == nblocks2 - nblocks1);
+  assert (apa.stats().blocks.total == nblocks2);
+
+  assert (apa.stats().bytes.inuse == (150 * elt_size + nblocks1 * block_ov));
+  assert (apa.stats().bytes.free == ((nelt - 150) * elt_size + (nblocks2-nblocks1) * block_ov));
+  assert (apa.stats().bytes.total == (nelt * elt_size + nblocks2 * block_ov));
 }
 
 
@@ -276,14 +290,19 @@ void test3()
     apa.allocate();
   }
 
+  const size_t nelt = Payload::v.size();
+  const size_t elt_size = apa.params().eltSize;
+  const size_t elts_per_block = (pageSize - SG::ArenaBlockBodyOffset) / elt_size;
+  const size_t nblocks = (150 + elts_per_block-1) / elts_per_block;
+
   assert (apa.name() == "bar");
   assert (apa.params().name == "bar");
   assert (apa.stats().elts.inuse == 150);
-  assert (apa.stats().elts.free == 50);
-  assert (apa.stats().elts.total == 200);
-  assert (apa.stats().blocks.inuse == 2);
+  assert (apa.stats().elts.free == nelt - 150);
+  assert (apa.stats().elts.total == nelt);
+  assert (apa.stats().blocks.inuse == nblocks);
   assert (apa.stats().blocks.free  == 0);
-  assert (apa.stats().blocks.total == 2);
+  assert (apa.stats().blocks.total == nblocks);
 
   SG::ArenaPoolAllocator apa2 (std::move (apa));
   assert (apa.name() == "bar");
@@ -291,11 +310,11 @@ void test3()
   assert (apa2.name() == "bar");
   assert (apa2.params().name == "bar");
   assert (apa2.stats().elts.inuse == 150);
-  assert (apa2.stats().elts.free == 50);
-  assert (apa2.stats().elts.total == 200);
-  assert (apa2.stats().blocks.inuse == 2);
+  assert (apa2.stats().elts.free == nelt - 150);
+  assert (apa2.stats().elts.total == nelt);
+  assert (apa2.stats().blocks.inuse == nblocks);
   assert (apa2.stats().blocks.free  == 0);
-  assert (apa2.stats().blocks.total == 2);
+  assert (apa2.stats().blocks.total == nblocks);
   assert (apa.stats().elts.inuse == 0);
   assert (apa.stats().elts.free == 0);
   assert (apa.stats().elts.total == 0);
@@ -309,11 +328,11 @@ void test3()
   assert (apa2.name() == "bar");
   assert (apa2.params().name == "bar");
   assert (apa.stats().elts.inuse == 150);
-  assert (apa.stats().elts.free == 50);
-  assert (apa.stats().elts.total == 200);
-  assert (apa.stats().blocks.inuse == 2);
+  assert (apa.stats().elts.free == nelt - 150);
+  assert (apa.stats().elts.total == nelt);
+  assert (apa.stats().blocks.inuse == nblocks);
   assert (apa.stats().blocks.free  == 0);
-  assert (apa.stats().blocks.total == 2);
+  assert (apa.stats().blocks.total == nblocks);
   assert (apa2.stats().elts.inuse == 0);
   assert (apa2.stats().elts.free == 0);
   assert (apa2.stats().elts.total == 0);
@@ -327,11 +346,11 @@ void test3()
   assert (apa2.name() == "bar");
   assert (apa2.params().name == "bar");
   assert (apa2.stats().elts.inuse == 150);
-  assert (apa2.stats().elts.free == 50);
-  assert (apa2.stats().elts.total == 200);
-  assert (apa2.stats().blocks.inuse == 2);
+  assert (apa2.stats().elts.free == nelt - 150);
+  assert (apa2.stats().elts.total == nelt);
+  assert (apa2.stats().blocks.inuse == nblocks);
   assert (apa2.stats().blocks.free  == 0);
-  assert (apa2.stats().blocks.total == 2);
+  assert (apa2.stats().blocks.total == nblocks);
   assert (apa.stats().elts.inuse == 0);
   assert (apa.stats().elts.free == 0);
   assert (apa.stats().elts.total == 0);
diff --git a/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx b/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx
index 3fd724a50e72..9ca0f7616ee9 100644
--- a/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx
@@ -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 AthAllocators/test/ArenaPoolAllocator_test.cxx
@@ -138,11 +138,11 @@ void test1()
   }
 
   assert (a4.stats().elts.inuse == 10);
-  assert (a4.stats().elts.total == 100);
+  assert (a4.stats().elts.total >= 100);
 
   a4.reset();
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 100);
+  assert (a4.stats().elts.total >= 100);
 
   a4.erase();
   assert (a4.stats().elts.inuse == 0);
@@ -150,7 +150,7 @@ void test1()
 
   a4.reserve(5000);
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 5000);
+  assert (a4.stats().elts.total >= 5000);
 
   assert (Payload::n == 2);
   assert (Payload::v.size() == 0);
@@ -175,7 +175,7 @@ void test2()
 
   (void)a3.allocate (1);
   assert (a3.stats().elts.inuse == 1);
-  assert (a3.stats().elts.total == 1000);
+  assert (a3.stats().elts.total >= 1000);
 
   Payload** p = a4.allocate (2);
   a4.deallocate (p, 2);
@@ -214,16 +214,16 @@ void test3()
 
   (void)a3.allocate (1);
   assert (a3.stats().elts.inuse == 1);
-  assert (a3.stats().elts.total == 1000);
+  assert (a3.stats().elts.total >= 1000);
 
   assert (a4.stats().elts.inuse == 1);
-  assert (a4.stats().elts.total == 1000);
+  assert (a4.stats().elts.total >= 1000);
 
   CTest c4 (a4);
   auto a4_nc = SG::ArenaPoolSTLAllocator<int>::get_allocator (c4);
   a4_nc.reset();
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 1000);
+  assert (a4.stats().elts.total >= 1000);
 
   a4_nc.erase();
   assert (a4.stats().elts.inuse == 0);
@@ -231,15 +231,15 @@ void test3()
 
   a4_nc.reserve(1000);
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 1000);
+  assert (a4.stats().elts.total >= 1000);
 
   int* p = a4.allocate (2);
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 1000);
+  assert (a4.stats().elts.total >= 1000);
 
   a4.deallocate (p, 2);
   assert (a4.stats().elts.inuse == 0);
-  assert (a4.stats().elts.total == 1000);
+  assert (a4.stats().elts.total >= 1000);
 
   assert (Payload::n == 0);
   assert (Payload::v.size() == 0);
@@ -259,7 +259,7 @@ void test4()
 
   (void)b1.allocate(1);
   assert (b1.stats().elts.inuse == 1);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
 
   SG::ArenaPoolSTLAllocator<Payload, int> b2 (std::move (b1));
   assert (b1.nblock() == 100);
@@ -269,10 +269,10 @@ void test4()
   assert (b1.stats().elts.inuse == 0);
   assert (b1.stats().elts.total == 0);
   assert (b2.stats().elts.inuse == 1);
-  assert (b2.stats().elts.total == 100);
+  assert (b2.stats().elts.total >= 100);
   (void)b2.allocate(1);
   assert (b2.stats().elts.inuse == 2);
-  assert (b2.stats().elts.total == 100);
+  assert (b2.stats().elts.total >= 100);
 
   b1 = std::move(b2);
   assert (b1.nblock() == 100);
@@ -282,10 +282,10 @@ void test4()
   assert (b2.stats().elts.inuse == 0);
   assert (b2.stats().elts.total == 0);
   assert (b1.stats().elts.inuse == 2);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
   (void)b1.allocate(1);
   assert (b1.stats().elts.inuse == 3);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
 
   b1.swap(b2);
   assert (b1.nblock() == 100);
@@ -295,7 +295,7 @@ void test4()
   assert (b1.stats().elts.inuse == 0);
   assert (b1.stats().elts.total == 0);
   assert (b2.stats().elts.inuse == 3);
-  assert (b2.stats().elts.total == 100);
+  assert (b2.stats().elts.total >= 100);
 
   assert (b1 == b1);
   assert (!(b1 != b1));
@@ -366,31 +366,31 @@ void test6()
     map[i] = i;
 
   assert (map.size() == 10);
-  assert (map.get_allocator().stats().elts.total == 500);
+  assert (map.get_allocator().stats().elts.total >= 500);
   assert (map.get_allocator().stats().elts.inuse == 10);
 
   map_t map2 = map;
   assert (map.size() == 10);
-  assert (map.get_allocator().stats().elts.total == 500);
+  assert (map.get_allocator().stats().elts.total >= 500);
   assert (map.get_allocator().stats().elts.inuse == 10);
 
   assert (map2.size() == 10);
-  assert (map2.get_allocator().stats().elts.total == 500);
+  assert (map2.get_allocator().stats().elts.total >= 500);
   assert (map2.get_allocator().stats().elts.inuse == 10);
 
   map_t map3;
   map3 = map;
   assert (map.size() == 10);
-  assert (map.get_allocator().stats().elts.total == 500);
+  assert (map.get_allocator().stats().elts.total >= 500);
   assert (map.get_allocator().stats().elts.inuse == 10);
 
   assert (map3.size() == 10);
-  assert (map3.get_allocator().stats().elts.total == 1000);
+  assert (map3.get_allocator().stats().elts.total >= 1000);
   assert (map3.get_allocator().stats().elts.inuse == 10);
 
   map_t map4 (std::move (map2));
   assert (map4.size() == 10);
-  assert (map4.get_allocator().stats().elts.total == 500);
+  assert (map4.get_allocator().stats().elts.total >= 500);
   assert (map4.get_allocator().stats().elts.inuse == 10);
   assert (map2.size() == 0);
   assert (map2.get_allocator().stats().elts.total == 0);
@@ -398,7 +398,7 @@ void test6()
 
   map2 = std::move(map4);
   assert (map2.size() == 10);
-  assert (map2.get_allocator().stats().elts.total == 500);
+  assert (map2.get_allocator().stats().elts.total >= 500);
   assert (map2.get_allocator().stats().elts.inuse == 10);
   assert (map4.size() == 0);
   assert (map4.get_allocator().stats().elts.total == 0);
@@ -406,7 +406,7 @@ void test6()
 
   map2.swap (map4);
   assert (map4.size() == 10);
-  assert (map4.get_allocator().stats().elts.total == 500);
+  assert (map4.get_allocator().stats().elts.total >= 500);
   assert (map4.get_allocator().stats().elts.inuse == 10);
   assert (map2.size() == 0);
   assert (map2.get_allocator().stats().elts.total == 0);
diff --git a/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx b/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx
index b381cd036197..94b0c4b0d616 100644
--- a/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.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: ArenaSharedHeapSTLAllocator_test.cxx 470825 2011-11-25 23:20:57Z ssnyder $
 /**
  * @file AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -130,11 +128,11 @@ void test1()
   }
 
   assert (a2.stats().elts.inuse == 1);
-  assert (a2.stats().elts.total == 100);
+  assert (a2.stats().elts.total >= 100);
 
   a2.reset();
   assert (a2.stats().elts.inuse == 0);
-  assert (a2.stats().elts.total == 100);
+  assert (a2.stats().elts.total >= 100);
 
   a2.erase();
   assert (a2.stats().elts.inuse == 0);
@@ -142,7 +140,7 @@ void test1()
 
   a2.reserve(5000);
   assert (a2.stats().elts.inuse == 0);
-  assert (a2.stats().elts.total == 5000);
+  assert (a2.stats().elts.total >= 5000);
 
   assert (Payload::n == 2);
   assert (Payload::v.size() == 0);
@@ -153,11 +151,11 @@ void test1()
 
   Payload* p1 = a2.allocate (1);
   assert (a2.stats().elts.inuse == 1);
-  assert (a2.stats().elts.total == 5000);
+  assert (a2.stats().elts.total >= 5000);
 
   Payload* p2 = a3.allocate (1);
   assert (a3.stats().elts.inuse == 2);
-  assert (a3.stats().elts.total == 5000);
+  assert (a3.stats().elts.total >= 5000);
 
   SG::ArenaSharedHeapSTLAllocator<int> a4 (a2);
   assert (a4.nblock() == 100);
@@ -165,9 +163,9 @@ void test1()
 
   int* p3 = a4.allocate(1);
   assert (a3.stats().elts.inuse == 2);
-  assert (a3.stats().elts.total == 5000);
+  assert (a3.stats().elts.total >= 5000);
   assert (a4.stats().elts.inuse == 1);
-  assert (a4.stats().elts.total == 100);
+  assert (a4.stats().elts.total >= 100);
 
   a2.deallocate (p1, 1);
   a3.deallocate (p2, 1);
@@ -210,24 +208,24 @@ void test3()
   Payload* pp[10];
   pp[0] = b1.allocate(1);
   assert (b1.stats().elts.inuse == 1);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
 
   SG::ArenaSharedHeapSTLAllocator<Payload> b2 (b1);
   assert (b2.nblock() == 100);
   assert (b2.name() == "ArenaSharedHeapSTLAllocator<Payload>");
   pp[1] = b2.allocate(1);
   assert (b1.stats().elts.inuse == 2);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
   assert (b2.stats().elts.inuse == 2);
-  assert (b2.stats().elts.total == 100);
+  assert (b2.stats().elts.total >= 100);
 
   b1 = b2;
   assert (b1.nblock() == 100);
   assert (b1.name() == "ArenaSharedHeapSTLAllocator<Payload>");
   assert (b1.stats().elts.inuse == 2);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
   assert (b2.stats().elts.inuse == 2);
-  assert (b2.stats().elts.total == 100);
+  assert (b2.stats().elts.total >= 100);
 
   SG::ArenaSharedHeapSTLAllocator<Payload> b3 (100);
   EXPECT_EXCEPTION (SG::ExcDifferentArenas, b3 = b2);
@@ -238,16 +236,16 @@ void test3()
   assert (b4.nblock() == 100);
   assert (b4.name() == "ArenaSharedHeapSTLAllocator<Payload>");
   assert (b1.stats().elts.inuse == 2);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
   assert (b4.stats().elts.inuse == 2);
-  assert (b4.stats().elts.total == 100);
+  assert (b4.stats().elts.total >= 100);
   b4.deallocate (pp[0], 1);
   pp[1] = b4.allocate(1);
   pp[2] = b4.allocate(1);
   assert (b4.stats().elts.inuse == 3);
-  assert (b4.stats().elts.total == 100);
+  assert (b4.stats().elts.total >= 100);
   assert (b1.stats().elts.inuse == 3);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
 
   b1 = std::move(b4);
   assert (b1.nblock() == 100);
@@ -255,16 +253,16 @@ void test3()
   assert (b4.nblock() == 100);
   assert (b4.name() == "ArenaSharedHeapSTLAllocator<Payload>");
   assert (b4.stats().elts.inuse == 3);
-  assert (b4.stats().elts.total == 100);
+  assert (b4.stats().elts.total >= 100);
   assert (b1.stats().elts.inuse == 3);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
   b1.deallocate (pp[0], 1);
   pp[3] = b1.allocate(1);
   pp[0] = b1.allocate(1);
   assert (b4.stats().elts.inuse == 4);
-  assert (b4.stats().elts.total == 100);
+  assert (b4.stats().elts.total >= 100);
   assert (b1.stats().elts.inuse == 4);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
 
   b1.swap(b4);
   assert (b1.nblock() == 100);
@@ -272,9 +270,9 @@ void test3()
   assert (b4.nblock() == 100);
   assert (b4.name() == "ArenaSharedHeapSTLAllocator<Payload>");
   assert (b1.stats().elts.inuse == 4);
-  assert (b1.stats().elts.total == 100);
+  assert (b1.stats().elts.total >= 100);
   assert (b4.stats().elts.inuse == 4);
-  assert (b4.stats().elts.total == 100);
+  assert (b4.stats().elts.total >= 100);
 
   b4.swap (b3);
   assert (b4.nblock() == 100);
@@ -282,7 +280,7 @@ void test3()
   assert (b3.nblock() == 100);
   assert (b3.name() == "ArenaSharedHeapSTLAllocator<Payload>");
   assert (b3.stats().elts.inuse == 4);
-  assert (b3.stats().elts.total == 100);
+  assert (b3.stats().elts.total >= 100);
 
   assert (b1 == b1);
   assert (b1 == b2);
@@ -310,7 +308,7 @@ void test4()
   assert (list.size() == 10);
   SG::ArenaAllocatorBase::Stats stats;
   stats = list.get_allocator().totstats();
-  assert (stats.elts.total == 500);
+  assert (stats.elts.total >= 500);
   assert (stats.elts.inuse == 10);
 
   for (list_t::iterator i = list.begin();
@@ -323,7 +321,7 @@ void test4()
 
   assert (list.size() == 5);
   stats = list.get_allocator().totstats();
-  assert (stats.elts.total == 500);
+  assert (stats.elts.total >= 500);
   assert (stats.elts.inuse == 5);
 
   list_t list2 (allo);
@@ -338,7 +336,7 @@ void test4()
   list.clear();
   assert (list.size() == 0);
   stats = list.get_allocator().totstats();
-  assert (stats.elts.total == 500);
+  assert (stats.elts.total >= 500);
   assert (stats.elts.inuse == 2);
 
   list2.clear();
@@ -351,7 +349,7 @@ void test4()
 
   list.get_allocator().reset();
   stats = list.get_allocator().totstats();
-  assert (stats.elts.total == 500);
+  assert (stats.elts.total >= 500);
   assert (stats.elts.inuse == 0);
 
   list.push_back(1);
@@ -387,58 +385,58 @@ void test5()
     list.push_back (i);
 
   assert (list.size() == 10);
-  assert (list.get_allocator().totstats().elts.total == 500);
+  assert (list.get_allocator().totstats().elts.total >= 500);
   assert (list.get_allocator().totstats().elts.inuse == 10);
 
   list_t list2 = list;
   assert (list.size() == 10);
-  assert (list.get_allocator().totstats().elts.total == 500);
+  assert (list.get_allocator().totstats().elts.total >= 500);
   assert (list.get_allocator().totstats().elts.inuse == 20);
 
   assert (list2.size() == 10);
-  assert (list2.get_allocator().totstats().elts.total == 500);
+  assert (list2.get_allocator().totstats().elts.total >= 500);
   assert (list2.get_allocator().totstats().elts.inuse == 20);
 
   list_t list3;
   list3 = list;
   assert (list.size() == 10);
-  assert (list.get_allocator().totstats().elts.total == 500);
+  assert (list.get_allocator().totstats().elts.total >= 500);
   assert (list.get_allocator().totstats().elts.inuse == 20);
 
   assert (list3.size() == 10);
-  assert (list3.get_allocator().totstats().elts.total == 1000);
+  assert (list3.get_allocator().totstats().elts.total >= 1000);
   assert (list3.get_allocator().totstats().elts.inuse == 10);
 
   list_t list4 (std::move (list2));
   assert (list4.size() == 10);
-  assert (list4.get_allocator().totstats().elts.total == 500);
+  assert (list4.get_allocator().totstats().elts.total >= 500);
   assert (list4.get_allocator().totstats().elts.inuse == 20);
   assert (list2.size() == 0);
-  assert (list2.get_allocator().totstats().elts.total == 500);
+  assert (list2.get_allocator().totstats().elts.total >= 500);
   assert (list2.get_allocator().totstats().elts.inuse == 20);
 
   list2 = std::move(list4);
   assert (list2.size() == 10);
-  assert (list2.get_allocator().totstats().elts.total == 500);
+  assert (list2.get_allocator().totstats().elts.total >= 500);
   assert (list2.get_allocator().totstats().elts.inuse == 20);
   assert (list4.size() == 0);
-  assert (list4.get_allocator().totstats().elts.total == 500);
+  assert (list4.get_allocator().totstats().elts.total >= 500);
   assert (list4.get_allocator().totstats().elts.inuse == 20);
 
   list2.swap (list4);
   assert (list4.size() == 10);
-  assert (list4.get_allocator().totstats().elts.total == 500);
+  assert (list4.get_allocator().totstats().elts.total >= 500);
   assert (list4.get_allocator().totstats().elts.inuse == 20);
   assert (list2.size() == 0);
-  assert (list2.get_allocator().totstats().elts.total == 500);
+  assert (list2.get_allocator().totstats().elts.total >= 500);
   assert (list2.get_allocator().totstats().elts.inuse == 20);
 
   list3.swap (list4);
   assert (list3.size() == 10);
-  assert (list3.get_allocator().totstats().elts.total == 500);
+  assert (list3.get_allocator().totstats().elts.total >= 500);
   assert (list3.get_allocator().totstats().elts.inuse == 20);
   assert (list4.size() == 10);
-  assert (list4.get_allocator().totstats().elts.total == 1000);
+  assert (list4.get_allocator().totstats().elts.total >= 1000);
   assert (list4.get_allocator().totstats().elts.inuse == 10);
 }
 
diff --git a/Control/AthAllocators/test/DataPool_test.cxx b/Control/AthAllocators/test/DataPool_test.cxx
index 19385fee4610..164c60f7a159 100644
--- a/Control/AthAllocators/test/DataPool_test.cxx
+++ b/Control/AthAllocators/test/DataPool_test.cxx
@@ -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
 */
 
 #undef NDEBUG
@@ -54,6 +54,7 @@ void test_slots()
     f->setPar(0);
   }
 
+#if 0
   assert (head.reportStr() == "\
 === 1 ===\n\
 Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
@@ -62,6 +63,7 @@ Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
 === default ===\n\
 Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
     1500/    548/   2048   72064/  26304/  98368       2/      0/      2  SG::ArenaCachingHandle<Fluff,SG::ArenaPoolAllocator>\n");
+#endif
 
   {
     DataPool<Fluff> pool (EventContext (0, 2));
@@ -69,6 +71,7 @@ Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
     f->setPar(0);
   }
 
+#if 0
   assert (head.reportStr() == "\
 === 1 ===\n\
 Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
@@ -79,6 +82,7 @@ Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
 === default ===\n\
 Elts InUse/Free/Total   Bytes InUse/Free/Total  Blocks InUse/Free/Total\n\
     1500/    548/   2048   72064/  26304/  98368       2/      0/      2  SG::ArenaCachingHandle<Fluff,SG::ArenaPoolAllocator>\n");
+#endif
 }
 
 
@@ -107,7 +111,8 @@ int main ATLAS_NOT_THREAD_SAFE ()
 	assert(iter == iend);		 // because pool ain't accessed yet.
 	assert (0 == df->allocated());
 	//  check pool capacity: default is 1024 even though we asked for 10
-	assert (1024 == df->capacity());
+        //   ... and may be more because we round up to a full page.
+	assert (1024 <= df->capacity());
 
 	// Now use the first 5 of these Fluff's
 	for (int j = 10; j < 15; j++)
@@ -135,7 +140,7 @@ int main ATLAS_NOT_THREAD_SAFE ()
 	DataPool<Fluff>::const_iterator iend3 = df->end();
 	assert (iter3 == iend3);	 // after reset
 	assert (0 == df->allocated());
-	assert (1024 == df->capacity());			// should be same
+	assert (1024 <= df->capacity());			// should be same
 
 	// Now use 1500 of these Fluff's.. should automatically resize
 	//cout << "You should see a message on automatic increase of pool size" << endl;
@@ -148,18 +153,18 @@ int main ATLAS_NOT_THREAD_SAFE ()
 
 	assert(1500 == df->allocated());			// up by 2 automatically
 								 
-	assert(2048 == df->capacity());
+	assert(2048 <= df->capacity());
 
 	// check that resizing to less than m_refCount doesn't work
 	df->reserve(1000);
-	assert(2048==df->capacity());
+	assert(2048<=df->capacity());
 	assert(1500==df->allocated());
 
 	// check that resizing to less than m_maxRefCount works
 	// changes related to m_maxRefCount are not visible in capacity() or allocated().
 	df->reserve(1600);			
 
-	assert(2048==df->capacity());
+	assert(2048<=df->capacity());
 	assert(1500==df->allocated());
 
 	// this is test by cheating. We reset the data pool (objects are not deleted
-- 
GitLab


From 2129ed2a0482c07211cdbb30dfa8098f9a03eeda Mon Sep 17 00:00:00 2001
From: scott snyder <scott.snyder@cern.ch>
Date: Wed, 8 Feb 2017 11:37:06 -0500
Subject: [PATCH 098/347] EventAthenaPool: Use templated Athena pool
 converters.

Use templated Athena pool converters.
---
 .../src/EventStreamInfoCnv.cxx                | 44 ------------
 .../EventAthenaPool/src/EventStreamInfoCnv.h  | 32 ++++-----
 .../src/MergedEventInfoCnv.cxx                | 36 ----------
 .../EventAthenaPool/src/MergedEventInfoCnv.h  | 20 ++----
 .../src/PileUpEventInfoCnv.cxx                | 67 -------------------
 .../EventAthenaPool/src/PileUpEventInfoCnv.h  | 24 +++----
 6 files changed, 27 insertions(+), 196 deletions(-)

diff --git a/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx b/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx
index d2db891d1d90..b5301ed08b75 100755
--- a/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx
+++ b/Event/EventAthenaPool/src/EventStreamInfoCnv.cxx
@@ -8,47 +8,3 @@
  *  $Id: EventStreamInfoCnv.cxx,v 1.3 2009-03-18 17:48:03 gemmeren Exp $
  **/
 
-#include "EventStreamInfoCnv.h"
-#include "EventTPCnv/EventStreamInfo_p1.h"
-#include "EventTPCnv/EventStreamInfo_p2.h"
-#include "EventTPCnv/EventStreamInfo_p3.h"
-#include "EventTPCnv/EventStreamInfoCnv_p1.h"
-#include "EventTPCnv/EventStreamInfoCnv_p2.h"
-#include "EventTPCnv/EventStreamInfoCnv_p3.h"
-#include "EventTPCnv/EventInfoCnv_p1.h"
-
-//______________________________________________________________________________
-EventStreamInfo_PERS* EventStreamInfoCnv::createPersistent(EventStreamInfo* transObj) {
-   MsgStream log(msgSvc(), "EventStreamInfoConverter");
-   EventStreamInfoCnv_p3 tPconverter_p3;
-   EventStreamInfo_PERS *persObj = tPconverter_p3.createPersistent(transObj, log);
-   log << MSG::DEBUG << "Success" << endmsg;
-   return(persObj);
-}
-//______________________________________________________________________________
-EventStreamInfo* EventStreamInfoCnv::createTransient() {
-   static const pool::Guid p3_guid("11DF1B8C-0DEE-4687-80D7-E74B520ACBB4");
-   static const pool::Guid p2_guid("9AD4889D-C8EB-4F3B-9920-D37FF092CAB6");
-   static const pool::Guid p1_guid("9998C282-403B-4EA5-A795-C8C9BA9909C3");
-   if (compareClassGuid(p3_guid)) {
-      // using unique_ptr ensures deletion of the persistent object
-      std::unique_ptr<EventStreamInfo_p3> esi_p3(poolReadObject<EventStreamInfo_p3>());
-      MsgStream log(msgSvc(), "EventStreamInfoConverter");
-      EventStreamInfoCnv_p3 tPconverter_p3;
-      return(tPconverter_p3.createTransient(esi_p3.get(), log));
-   } else if (compareClassGuid(p2_guid)) {
-      // using unique_ptr ensures deletion of the persistent object
-      std::unique_ptr<EventStreamInfo_p2> esi_p2(poolReadObject<EventStreamInfo_p2>());
-      MsgStream log(msgSvc(), "EventStreamInfoConverter");
-      EventStreamInfoCnv_p2 tPconverter_p2;
-      return(tPconverter_p2.createTransient(esi_p2.get(), log));
-   } else if (compareClassGuid(p1_guid)) {
-      // using unique_ptr ensures deletion of the persistent object
-      std::unique_ptr<EventStreamInfo_p1> esi_p1(poolReadObject<EventStreamInfo_p1>());
-      MsgStream log(msgSvc(), "EventStreamInfoConverter");
-      EventStreamInfoCnv_p1 tPconverter_p1;
-      return(tPconverter_p1.createTransient(esi_p1.get(), log));
-   }
-   EventStreamInfo* esi = poolReadObject<EventStreamInfo>();
-   return(esi);
-}
diff --git a/Event/EventAthenaPool/src/EventStreamInfoCnv.h b/Event/EventAthenaPool/src/EventStreamInfoCnv.h
index 4bbdf192c5c8..e8eb422005b4 100644
--- a/Event/EventAthenaPool/src/EventStreamInfoCnv.h
+++ b/Event/EventAthenaPool/src/EventStreamInfoCnv.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 EVENTSTREAMINFOCNV_H
@@ -11,28 +11,20 @@
  *  $Id: EventStreamInfoCnv.h,v 1.3 2009-03-18 17:48:04 gemmeren Exp $
  **/
 
-#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
-#include "EventInfo/EventStreamInfo.h"
-#include "EventTPCnv/EventStreamInfo_p3.h"
-
-/// the latest persistent representation type of EventStreamInfo
-typedef EventStreamInfo_p3 EventStreamInfo_PERS;
-typedef T_AthenaPoolCustomCnv<EventStreamInfo, EventStreamInfo_PERS> EventStreamInfoCnvBase;
 
-/** @class EventStreamInfoCnv
- *  @brief This class provides a converter for the EventStreamInfo class.
- **/
-class EventStreamInfoCnv : public EventStreamInfoCnvBase {
+#include "AthenaPoolCnvSvc/T_AthenaPoolTPCnvCnv.h"
+#include "EventInfo/EventStreamInfo.h"
+#include "EventTPCnv/EventStreamInfoCnv_p1.h"
+#include "EventTPCnv/EventStreamInfoCnv_p2.h"
+#include "EventTPCnv/EventStreamInfoCnv_p3.h"
 
-friend class CnvFactory<EventStreamInfoCnv>;
 
-protected:
-public:
-   EventStreamInfoCnv(ISvcLocator* svcloc) : EventStreamInfoCnvBase(svcloc) {}
-protected:
+typedef T_AthenaPoolTPCnvCnv<EventStreamInfo,
+                             EventStreamInfoCnv_p3,
+                             EventStreamInfoCnv_p2,
+                             EventStreamInfoCnv_p1,
+                             T_TPCnvNull<EventStreamInfo> >
+  EventStreamInfoCnv;
 
-   virtual EventStreamInfo_PERS* createPersistent(EventStreamInfo* transObj);
-   virtual EventStreamInfo* createTransient();
-};
 
 #endif
diff --git a/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx b/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx
index 3bfdc89587f8..0b7f6a82b168 100755
--- a/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx
+++ b/Event/EventAthenaPool/src/MergedEventInfoCnv.cxx
@@ -8,39 +8,3 @@
  * @author Marcin.Nowak@cern.ch
  */
 
-#include "MergedEventInfoCnv.h"
-
-MergedEventInfo_PERS* MergedEventInfoCnv::createPersistent(MergedEventInfo* transObj) {
-    MsgStream log(msgSvc(), "MergedEventInfoConverter" ); 
-    static const MergedEventInfoCnv_p2  TPconv;
-    MergedEventInfo_PERS *persObj = TPconv.createPersistentConst( transObj, log );
-    //log << MSG::DEBUG << "Success" << endmsg;
-    return persObj; 
-}
-    
-MergedEventInfo* MergedEventInfoCnv::createTransient() {
-   static const pool::Guid   p2_guid("5B0C1A92-6836-4B3C-9EE6-5E69792A28B5");
-   static const pool::Guid   p1_guid("9540DED6-51E8-48A3-8F86-05CB1D9CC812");
-   static const pool::Guid   p0_guid("FA93B80D-82C7-4096-8A04-62885A679A6F");
-   if( compareClassGuid(p2_guid) ) {
-      std::unique_ptr< MergedEventInfo_p2 > col_vect( poolReadObject< MergedEventInfo_p2 >() );
-      MsgStream log(msgSvc(), "MergedEventInfoConverter" );
-      //log << MSG::DEBUG << "Reading MergedEventInfo_p2" << endmsg; 
-      static const MergedEventInfoCnv_p2   TPconverter;
-      return TPconverter.createTransientConst( col_vect.get(), log );
-   } else 
-   if( compareClassGuid(p1_guid) ) {
-      std::unique_ptr< MergedEventInfo_p1 > col_vect( poolReadObject< MergedEventInfo_p1 >() );
-      MsgStream log(msgSvc(), "MergedEventInfoConverter" );
-      //log << MSG::DEBUG << "Reading MergedEventInfo_p1" << endmsg; 
-      static const MergedEventInfoCnv_p1   TPconverter;
-      return TPconverter.createTransientConst( col_vect.get(), log );
-   }
-   else if( compareClassGuid(p0_guid) ) {
-      // regular object from before TP separation, just return it
-      //MsgStream log(msgSvc(), "MergedEventInfoConverter" );
-      //log << MSG::DEBUG << "Reading MergedEventInfo (original)" << endmsg; 
-      return poolReadObject< MergedEventInfo >();
-   } 
-   throw std::runtime_error("Unsupported persistent version of MergedEventInfo");
-}
diff --git a/Event/EventAthenaPool/src/MergedEventInfoCnv.h b/Event/EventAthenaPool/src/MergedEventInfoCnv.h
index b3c7dfe89fe9..dbb67e50b063 100644
--- a/Event/EventAthenaPool/src/MergedEventInfoCnv.h
+++ b/Event/EventAthenaPool/src/MergedEventInfoCnv.h
@@ -19,20 +19,12 @@
 #include "EventTPCnv/MergedEventInfo_p2.h"
 #include "EventTPCnv/MergedEventInfoCnv_p2.h"
 
-// the latest persistent representation type of MergedEventInfo
-typedef  MergedEventInfo_p2  MergedEventInfo_PERS;
-
-typedef  T_AthenaPoolCustomCnv<MergedEventInfo, MergedEventInfo_PERS >   MergedEventInfoCnvBase;
-
-class MergedEventInfoCnv : public MergedEventInfoCnvBase {
-friend class CnvFactory<MergedEventInfoCnv >;
-protected:
-public:
-  MergedEventInfoCnv (ISvcLocator* svcloc) : MergedEventInfoCnvBase(svcloc) {}
-protected:
-  virtual MergedEventInfo_PERS*   createPersistent (MergedEventInfo* transObj);
-  virtual MergedEventInfo*        createTransient ();
-};
+typedef T_AthenaPoolTPCnvCnv<MergedEventInfo,
+                             MergedEventInfoCnv_p2,
+                             MergedEventInfoCnv_p1,
+                             T_TPCnvNull<MergedEventInfo> >
+  MergedEventInfoCnv;
+
 
 #endif
 
diff --git a/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx b/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx
index 07a678a7be63..805e5aa48782 100755
--- a/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx
+++ b/Event/EventAthenaPool/src/PileUpEventInfoCnv.cxx
@@ -8,70 +8,3 @@
  * @author Marcin.Nowak@cern.ch
  */
 
-#include "PileUpEventInfoCnv.h"
-
-
-PileUpEventInfo_PERS* PileUpEventInfoCnv::createPersistent(PileUpEventInfo* transObj) {
-    MsgStream log(msgSvc(), "PileUpEventInfoConverter" ); 
-    static const PileUpEventInfoCnv_p5   TPconverter;
-    PileUpEventInfo_PERS *persObj = TPconverter.createPersistentConst( transObj, log );
-    //log << MSG::DEBUG << "Success" << endmsg;
-    return persObj; 
-}
-    
-PileUpEventInfo* PileUpEventInfoCnv::createTransient() {
-   static const pool::Guid   p5_guid("F53A1735-F61A-4CA4-B25F-DB0E277E2DDC");
-   static const pool::Guid   p4_guid("7D72CE05-E814-4A70-B3B2-B54B05069103");
-   static const pool::Guid   p3_guid("32A54198-BCDF-0AB5-DC0B-542CAE9866C2");
-   static const pool::Guid   p2_guid("C2A54FC3-759C-4F01-AF7E-668D9198E10F");
-   static const pool::Guid   p1_guid("1A399605-8E31-4150-B766-2049FD689485");
-   static const pool::Guid   p0_guid("6A58157B-6B6E-430F-A72A-EAAA4BDC4AE2");
-   if( compareClassGuid(p5_guid) ) {
-      // using unique_ptr ensures deletion of the persistent object
-      std::unique_ptr< PileUpEventInfo_p5 > col_vect( poolReadObject< PileUpEventInfo_p5 >() );
-      MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
-      //log << MSG::DEBUG << "Reading PileUpEventInfo_p5" << endmsg; 
-      static const PileUpEventInfoCnv_p5   TPconverter;
-      return TPconverter.createTransientConst( col_vect.get(), log );
-   }	
-   else if( compareClassGuid(p4_guid) ) {
-      // using unique_ptr ensures deletion of the persistent object
-      std::unique_ptr< PileUpEventInfo_p4 > col_vect( poolReadObject< PileUpEventInfo_p4 >() );
-      MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
-      //log << MSG::DEBUG << "Reading PileUpEventInfo_p4" << endmsg; 
-      static const PileUpEventInfoCnv_p4   TPconverter;
-      return TPconverter.createTransientConst( col_vect.get(), log );
-   }	
-  if( compareClassGuid(p3_guid) ) {
-      // using unique_ptr ensures deletion of the persistent object
-      std::unique_ptr< PileUpEventInfo_p3 > col_vect( poolReadObject< PileUpEventInfo_p3 >() );
-      MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
-      //log << MSG::DEBUG << "Reading PileUpEventInfo_p3" << endmsg; 
-      static const PileUpEventInfoCnv_p3   TPconverter;
-      return TPconverter.createTransientConst( col_vect.get(), log );
-   }
-   else if( compareClassGuid(p2_guid) ) {
-      // using unique_ptr ensures deletion of the persistent object
-      std::unique_ptr< PileUpEventInfo_p2 > col_vect( poolReadObject< PileUpEventInfo_p2 >() );
-      MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
-      //log << MSG::DEBUG << "Reading PileUpEventInfo_p2" << endmsg; 
-      static const PileUpEventInfoCnv_p2   TPconverter;
-      return TPconverter.createTransientConst( col_vect.get(), log );
-   }
-   else if( compareClassGuid(p1_guid) ) {
-      // using unique_ptr ensures deletion of the persistent object
-      std::unique_ptr< PileUpEventInfo_p1 > col_vect( poolReadObject< PileUpEventInfo_p1 >() );
-      MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
-      //log << MSG::DEBUG << "Reading PileUpEventInfo_p1" << endmsg; 
-      static const PileUpEventInfoCnv_p1   TPconverter;
-      return TPconverter.createTransientConst( col_vect.get(), log );
-   }
-   else if( compareClassGuid(p0_guid) ) {
-      // regular object from before TP separation, just return it
-
-      //MsgStream log(msgSvc(), "PileUpEventInfoConverter" );
-      //log << MSG::DEBUG << "Reading PileUpEventInfo (original)" << endmsg; 
-      return poolReadObject< PileUpEventInfo >();
-   } 
-   throw std::runtime_error("Unsupported persistent version of PileUpEventInfo");
-}
diff --git a/Event/EventAthenaPool/src/PileUpEventInfoCnv.h b/Event/EventAthenaPool/src/PileUpEventInfoCnv.h
index dd2266d69b66..f9fd00c8d612 100644
--- a/Event/EventAthenaPool/src/PileUpEventInfoCnv.h
+++ b/Event/EventAthenaPool/src/PileUpEventInfoCnv.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,20 +27,14 @@
 #include "EventTPCnv/PileUpEventInfo_p5.h"
 #include "EventTPCnv/PileUpEventInfoCnv_p5.h"
 
-// the latest persistent representation type of PileUpEventInfo
-typedef  PileUpEventInfo_p5  PileUpEventInfo_PERS;
+typedef T_AthenaPoolTPCnvCnv<PileUpEventInfo,
+                             PileUpEventInfoCnv_p5,
+                             PileUpEventInfoCnv_p4,
+                             PileUpEventInfoCnv_p3,
+                             PileUpEventInfoCnv_p2,
+                             PileUpEventInfoCnv_p1,
+                             T_TPCnvNull<PileUpEventInfo> >
+  PileUpEventInfoCnv;
 
-typedef  T_AthenaPoolCustomCnv<PileUpEventInfo, PileUpEventInfo_PERS >   PileUpEventInfoCnvBase;
-
-class PileUpEventInfoCnv : public PileUpEventInfoCnvBase {
-friend class CnvFactory<PileUpEventInfoCnv >;
-protected:
-public:
-  PileUpEventInfoCnv (ISvcLocator* svcloc) : PileUpEventInfoCnvBase(svcloc) {}
-protected:
-  virtual PileUpEventInfo_PERS*   createPersistent (PileUpEventInfo* transObj);
-  virtual PileUpEventInfo*        createTransient ();
-};
 
 #endif
-
-- 
GitLab


From b69fc9a985638f16955d96a252768877188db421 Mon Sep 17 00:00:00 2001
From: Sergi Rodriguez Bosca <sergi.rodriguez@cern.ch>
Date: Tue, 14 Sep 2021 10:19:36 +0200
Subject: [PATCH 099/347] From std::map to std::unordered_map

---
 .../L1CaloFEXSim/L1CaloFEXSim/jFEXDriver.h    |  2 +-
 .../L1CaloFEXSim/L1CaloFEXSim/jFEXFPGA.h      | 10 ++++----
 .../L1CaloFEXSim/jFEXForwardJetsAlgo.h        | 10 ++++----
 .../L1CaloFEXSim/jFEXLargeRJetAlgo.h          |  4 ++--
 .../L1CaloFEXSim/jFEXOutputCollection.h       | 24 +++++++++----------
 .../L1CaloFEXSim/jFEXPileupAndNoise.h         |  8 +++----
 .../L1CaloFEXSim/L1CaloFEXSim/jFEXSim.h       |  2 +-
 .../L1CaloFEXSim/jFEXSmallRJetAlgo.h          |  4 ++--
 .../L1CaloFEXSim/L1CaloFEXSim/jFEXmetAlgo.h   |  4 ++--
 .../L1CaloFEXSim/L1CaloFEXSim/jFEXsumETAlgo.h |  4 ++--
 .../L1CaloFEXSim/L1CaloFEXSim/jFEXtauAlgo.h   |  4 ++--
 .../L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx   |  2 +-
 .../L1CaloFEXSim/src/jFEXForwardJetsAlgo.cxx  | 16 ++++++-------
 .../L1CaloFEXSim/src/jFEXLargeRJetAlgo.cxx    |  2 +-
 .../L1CaloFEXSim/src/jFEXOutputCollection.cxx | 16 ++++++-------
 .../L1CaloFEXSim/src/jFEXPileupAndNoise.cxx   | 18 +++++++-------
 .../L1CaloFEXSim/src/jFEXSmallRJetAlgo.cxx    |  2 +-
 .../L1CaloFEXSim/src/jFEXmetAlgo.cxx          |  2 +-
 .../L1CaloFEXSim/src/jFEXsumETAlgo.cxx        |  2 +-
 .../L1CaloFEXSim/src/jFEXtauAlgo.cxx          |  2 +-
 .../IjFEXForwardJetsAlgo.h                    |  8 +++----
 .../IjFEXLargeRJetAlgo.h                      |  2 +-
 .../IjFEXPileupAndNoise.h                     |  6 ++---
 .../IjFEXSmallRJetAlgo.h                      |  2 +-
 .../L1CaloFEXToolInterfaces/IjFEXmetAlgo.h    |  2 +-
 .../L1CaloFEXToolInterfaces/IjFEXsumETAlgo.h  |  2 +-
 .../L1CaloFEXToolInterfaces/IjFEXtauAlgo.h    |  2 +-
 27 files changed, 81 insertions(+), 81 deletions(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXDriver.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXDriver.h
index 6806c59c913d..68db6752c580 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXDriver.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXDriver.h
@@ -61,7 +61,7 @@ class jFEXDriver : public AthAlgorithm
   ToolHandle<IjSuperCellTowerMapper> m_jSuperCellTowerMapperTool {this, "jSuperCellTowerMapperTool", "LVL1::jSuperCellTowerMapper", "Tool that maps supercells to jTowers"};
   ToolHandle<IjFEXSysSim> m_jFEXSysSimTool {this, "jFEXSysSimTool", "LVL1::jFEXSysSim", "Tool that creates the jFEX System Simulation"};
 
-  std::map<Identifier, std::pair<int,int> > m_cell_to_tower_map;
+  std::unordered_map<Identifier, std::pair<int,int> > m_cell_to_tower_map;
 
 };
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXFPGA.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXFPGA.h
index e6ec4e430a79..a0de2971f076 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXFPGA.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXFPGA.h
@@ -114,13 +114,13 @@ namespace LVL1 {
     int m_jTowersIDs_Wide [FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width] = {{0}};
     int m_jTowersIDs_Thin [FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width] = {{0}};
     int m_jTowersIDs      [FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width] = {{0}};
-    std::map<int,jTower> m_jTowersColl;
-    std::map<int,std::vector<int> > m_map_Etvalues_FPGA;
-    std::map<int,std::vector<int> > m_map_HAD_Etvalues_FPGA;
-    std::map<int,std::vector<int> > m_map_EM_Etvalues_FPGA;
+    std::unordered_map<int,jTower> m_jTowersColl;
+    std::unordered_map<int,std::vector<int> > m_map_Etvalues_FPGA;
+    std::unordered_map<int,std::vector<int> > m_map_HAD_Etvalues_FPGA;
+    std::unordered_map<int,std::vector<int> > m_map_EM_Etvalues_FPGA;
     
 
-    std::map<int, jFEXForwardJetsInfo> m_FCALJets; 
+    std::unordered_map<int, jFEXForwardJetsInfo> m_FCALJets; 
 
     int m_SRJetET;
     int m_LRJetET;
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXForwardJetsAlgo.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXForwardJetsAlgo.h
index 8bad30e5569d..b142f8de647a 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXForwardJetsAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXForwardJetsAlgo.h
@@ -48,17 +48,17 @@ namespace LVL1 {
     virtual unsigned int localPhi(int nphi, int neta) override;
     virtual unsigned int localEta(int nphi, int neta) override;
     virtual unsigned int getTTowerET(int nphi, int neta) override; 
-    virtual std::map<int, jFEXForwardJetsInfo> FcalJetsTowerIDLists() override;
-    virtual std::map<int, jFEXForwardJetsInfo> isSeedLocalMaxima() override;
-    virtual std::map<int, jFEXForwardJetsInfo> calculateJetETs() override;
-    virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)  override;
+    virtual std::unordered_map<int, jFEXForwardJetsInfo> FcalJetsTowerIDLists() override;
+    virtual std::unordered_map<int, jFEXForwardJetsInfo> isSeedLocalMaxima() override;
+    virtual std::unordered_map<int, jFEXForwardJetsInfo> calculateJetETs() override;
+    virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)  override;
 
   protected:
 
   private:
         SG::ReadHandleKey<LVL1::jTowerContainer> m_jFEXForwardJetsAlgo_jTowerContainerKey {this, "MyjTowers", "jTowerContainer", "Input container for jTowers"};
         int m_jFEXalgoTowerID[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width];
-        std::map<int,std::vector<int> > m_map_Etvalues;
+        std::unordered_map<int,std::vector<int> > m_map_Etvalues;
         int m_lowerEM_eta;
         int m_upperEM_eta;
         int m_jfex;
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXLargeRJetAlgo.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXLargeRJetAlgo.h
index d1f30ab63750..793f9daf52d0 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXLargeRJetAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXLargeRJetAlgo.h
@@ -44,7 +44,7 @@ namespace LVL1 {
     virtual unsigned int getRingET() override;
     virtual unsigned int getLargeClusterET(unsigned int smallClusterET, unsigned int largeRingET) override;
     virtual std::unique_ptr<jFEXLargeRJetTOB> getLargeRJetTOBs(int smallClusterET,int TTID) override;
-    virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)  override;
+    virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)  override;
 
   protected:
 
@@ -57,7 +57,7 @@ namespace LVL1 {
     //int inputTable[15][15];
     int m_largeRJetEtRing_IDs[15][15];
     int getTTowerET(unsigned int TTID ) ;
-    std::map<int,std::vector<int> > m_map_Etvalues;
+    std::unordered_map<int,std::vector<int> > m_map_Etvalues;
   };
 
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXOutputCollection.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXOutputCollection.h
index 5b763ff346ea..b638eab77e7c 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXOutputCollection.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXOutputCollection.h
@@ -38,19 +38,19 @@ namespace LVL1 {
     int LRsize();
     int tausize();
     int pileupsize();
-    std::map<std::string, int>* get_smallRJet(int);
-    std::map<std::string, int>* get_largeRJet(int);
-    std::map<std::string, int>* get_tau(int);
-    std::map<std::string, int>* get_pileup(int);
+    std::unordered_map<std::string, int>* get_smallRJet(int);
+    std::unordered_map<std::string, int>* get_largeRJet(int);
+    std::unordered_map<std::string, int>* get_tau(int);
+    std::unordered_map<std::string, int>* get_pileup(int);
   private:
-    std::map<std::string, int> m_values_tem_smallRJet;
-    std::vector<std::map<std::string, int>*> m_allvalues_smallRJet;
-    std::map<std::string, int> m_values_tem_largeRJet;
-    std::vector<std::map<std::string, int>*> m_allvalues_largeRJet;
-    std::map<std::string, int> m_values_tem_tau;
-    std::vector<std::map<std::string, int>*> m_allvalues_tau;
-    std::map<std::string, int> m_values_tem_pileup;
-    std::vector<std::map<std::string, int>*> m_allvalues_pileup;
+    std::unordered_map<std::string, int> m_values_tem_smallRJet;
+    std::vector<std::unordered_map<std::string, int>*> m_allvalues_smallRJet;
+    std::unordered_map<std::string, int> m_values_tem_largeRJet;
+    std::vector<std::unordered_map<std::string, int>*> m_allvalues_largeRJet;
+    std::unordered_map<std::string, int> m_values_tem_tau;
+    std::vector<std::unordered_map<std::string, int>*> m_allvalues_tau;
+    std::unordered_map<std::string, int> m_values_tem_pileup;
+    std::vector<std::unordered_map<std::string, int>*> m_allvalues_pileup;
   };
 }
 CLASS_DEF(LVL1::jFEXOutputCollection, 1317184196 , 1 )
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXPileupAndNoise.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXPileupAndNoise.h
index d57c313d7a37..69fee1380972 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXPileupAndNoise.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXPileupAndNoise.h
@@ -40,9 +40,9 @@ namespace LVL1 {
     virtual void setup(int FPGA[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width]) override;
     virtual void setup(int FPGA[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]) override;    
     
-    virtual std::map<int,std::vector<int> > GetEt_values() override;
-    virtual std::map<int,std::vector<int> > Get_EM_Et_values() override;
-    virtual std::map<int,std::vector<int> > Get_HAD_Et_values() override;
+    virtual std::unordered_map<int,std::vector<int> > GetEt_values() override;
+    virtual std::unordered_map<int,std::vector<int> > Get_EM_Et_values() override;
+    virtual std::unordered_map<int,std::vector<int> > Get_HAD_Et_values() override;
     
     /** Destructor **/
     virtual ~jFEXPileupAndNoise();
@@ -90,7 +90,7 @@ protected:
         
         void reset_conters();
         void SubtractPileup();
-        void ApplyNoiseCuts(std::map<int,std::vector<int> > & map_Etvalues, int Jet_NoiseCut, int Met_NoiseCut);
+        void ApplyNoiseCuts(std::unordered_map<int,std::vector<int> > & map_Etvalues, int Jet_NoiseCut, int Met_NoiseCut);
 
         // SG information
         int getTTowerEta(unsigned int TTID ); 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSim.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSim.h
index fb3a65639d3f..88349f857b3b 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSim.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSim.h
@@ -73,7 +73,7 @@ namespace LVL1 {
     int m_jTowersIDs_Wide [FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width];
     int m_jTowersIDs_Thin [FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width];
 
-    std::map<int,jTower> m_jTowersColl;
+    std::unordered_map<int,jTower> m_jTowersColl;
     CaloCellContainer m_sCellsCollection;
     std::vector<jFEXFPGA*> m_jFEXFPGACollection;
    
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSmallRJetAlgo.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSmallRJetAlgo.h
index 2c1ec06090a8..20c3bd90efef 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSmallRJetAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXSmallRJetAlgo.h
@@ -51,7 +51,7 @@ namespace LVL1 {
     virtual bool checkDisplacedLM() override;
     virtual std::unique_ptr<jFEXSmallRJetTOB> getSmallRJetTOBs() override;
     virtual unsigned int getTTIDcentre() override;
-    virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)  override;
+    virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)  override;
   //  virtual jFEXSmallRJetTOB* getSmallRJetTOBs() override;
 //LVL1::jFEXSmallRJetAlgoTOB * LVL1::jFEXSmallRJetAlgo::getSmallRJetTOB()
     
@@ -63,7 +63,7 @@ protected:
         int m_jFEXalgoSearchWindowSeedET[5][5];
 	bool m_seedSet;
         bool m_LMDisplaced;
-        std::map<int,std::vector<int> > m_map_Etvalues;
+        std::unordered_map<int,std::vector<int> > m_map_Etvalues;
   };
 
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXmetAlgo.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXmetAlgo.h
index 2e85efaf6a64..1ab9d9c89b91 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXmetAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXmetAlgo.h
@@ -50,7 +50,7 @@ namespace LVL1 {
     virtual int GetMetXComponent()  override;
     virtual int GetMetYComponent()  override;
     virtual int getTTowerET(unsigned int TTID ) override; 
-    virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)  override;
+    virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)  override;
     
     virtual std::unique_ptr<jFEXmetTOB> getmetTOBs() override;
     
@@ -71,7 +71,7 @@ protected:
         virtual void buildMetXComponent();
         virtual void buildMetYComponent();        
         
-        std::map<int,std::vector<int> > m_map_Etvalues;
+        std::unordered_map<int,std::vector<int> > m_map_Etvalues;
   };
 
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXsumETAlgo.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXsumETAlgo.h
index 27e72a55d840..371920e90b6c 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXsumETAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXsumETAlgo.h
@@ -50,7 +50,7 @@ namespace LVL1 {
     virtual void buildFWDSumET()  override;
     virtual int getETlowerEta(uint bin)  override;
     virtual int getETupperEta(uint bin)  override;   
-    virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)  override;
+    virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)  override;
     
     virtual std::unique_ptr<jFEXsumETTOB> getsumETTOBs() override;
     
@@ -65,7 +65,7 @@ protected:
         int m_SumlowEta =0;
         int m_SumhighEta=0;
         
-        std::map<int,std::vector<int> > m_map_Etvalues;
+        std::unordered_map<int,std::vector<int> > m_map_Etvalues;
         
         
   };
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXtauAlgo.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXtauAlgo.h
index 40478f8f2a3d..394133defcbd 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXtauAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/jFEXtauAlgo.h
@@ -51,7 +51,7 @@ namespace LVL1 {
     virtual int getClusterEt() override;
     virtual int getIsLocalMaxima() override;
     virtual int getFirstEtRing()  override;
-    virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)  override;
+    virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)  override;
     
     
     virtual std::unique_ptr<jFEXtauTOB> getTauTOBs(int mphi, int meta) override;
@@ -76,7 +76,7 @@ protected:
 	    bool m_seedSet=false;
 	    bool m_isLocalMaxima=false;
           
-        std::map<int,std::vector<int> > m_map_Etvalues;
+        std::unordered_map<int,std::vector<int> > m_map_Etvalues;
 
         struct color {
             std::string RED      ="\033[1;31m";
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx
index 9b9ee4411b4a..b6c5b3316a91 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx
@@ -305,7 +305,7 @@ StatusCode jFEXFPGA::execute() {
 
         m_FCALJets =  m_jFEXForwardJetsAlgoTool->calculateJetETs();
 
-        for(std::map<int, jFEXForwardJetsInfo>::iterator it = m_FCALJets.begin(); it!=(m_FCALJets.end()); ++it) {
+        for(std::unordered_map<int, jFEXForwardJetsInfo>::iterator it = m_FCALJets.begin(); it!=(m_FCALJets.end()); ++it) {
 
             jFEXForwardJetsInfo FCALJets = it->second;
             int iphi = FCALJets.getCentreLocalTTPhi();
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXForwardJetsAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXForwardJetsAlgo.cxx
index 99f02273652c..7f1fa48758c8 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXForwardJetsAlgo.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXForwardJetsAlgo.cxx
@@ -116,9 +116,9 @@ unsigned int LVL1::jFEXForwardJetsAlgo::getTTowerET(int nphi, int neta ) {
     return 0;
 }
 
-std::map<int, jFEXForwardJetsInfo> LVL1::jFEXForwardJetsAlgo::FcalJetsTowerIDLists() {
+std::unordered_map<int, jFEXForwardJetsInfo> LVL1::jFEXForwardJetsAlgo::FcalJetsTowerIDLists() {
 
-    std::map<int, jFEXForwardJetsInfo> FCALJetTowerIDLists;
+    std::unordered_map<int, jFEXForwardJetsInfo> FCALJetTowerIDLists;
 
     std::vector<int> lower_centre_neta;
     std::vector<int> upper_centre_neta;
@@ -236,10 +236,10 @@ std::map<int, jFEXForwardJetsInfo> LVL1::jFEXForwardJetsAlgo::FcalJetsTowerIDLis
 
 
 
-std::map<int, jFEXForwardJetsInfo> LVL1::jFEXForwardJetsAlgo::isSeedLocalMaxima() {
+std::unordered_map<int, jFEXForwardJetsInfo> LVL1::jFEXForwardJetsAlgo::isSeedLocalMaxima() {
     //std::vector<int> localMaximas;
-    std::map<int, jFEXForwardJetsInfo> localMaximaCandidates = FcalJetsTowerIDLists();
-    std::map<int, jFEXForwardJetsInfo> localMaximaList ;
+    std::unordered_map<int, jFEXForwardJetsInfo> localMaximaCandidates = FcalJetsTowerIDLists();
+    std::unordered_map<int, jFEXForwardJetsInfo> localMaximaList ;
     SG::ReadHandle<jTowerContainer> my_jTowerContainer(m_jFEXForwardJetsAlgo_jTowerContainerKey/*,ctx*/);
 
     size_t isLocalMaxima = 0;
@@ -320,7 +320,7 @@ std::map<int, jFEXForwardJetsInfo> LVL1::jFEXForwardJetsAlgo::isSeedLocalMaxima(
 }
 
 
-std::map<int, jFEXForwardJetsInfo> LVL1::jFEXForwardJetsAlgo::calculateJetETs() {
+std::unordered_map<int, jFEXForwardJetsInfo> LVL1::jFEXForwardJetsAlgo::calculateJetETs() {
     
     // setting the lower/upper eta range for the FCAL 2 and 3 since they are not added in the seed information yet 
     int lowerFCAL_eta = FEXAlgoSpaceDefs::jFEX_algoSpace_C_lowerFCAL_eta;
@@ -331,7 +331,7 @@ std::map<int, jFEXForwardJetsInfo> LVL1::jFEXForwardJetsAlgo::calculateJetETs()
         upperFCAL_eta = FEXAlgoSpaceDefs::jFEX_algoSpace_A_upperFCAL_eta;
     } 
     // Adding the FCAL 2 and 3 TT in the seed, 1st and 2nd energy rings
-    std::map<int, jFEXForwardJetsInfo> localMaximas = isSeedLocalMaxima();
+    std::unordered_map<int, jFEXForwardJetsInfo> localMaximas = isSeedLocalMaxima();
     for(std::pair<int, jFEXForwardJetsInfo> element : localMaximas) {
         jFEXForwardJetsInfo myFCALJetInfoClass = element.second;
 
@@ -381,7 +381,7 @@ std::map<int, jFEXForwardJetsInfo> LVL1::jFEXForwardJetsAlgo::calculateJetETs()
 }
 
 
-void LVL1::jFEXForwardJetsAlgo::setFPGAEnergy(std::map<int,std::vector<int> > et_map){
+void LVL1::jFEXForwardJetsAlgo::setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map){
     m_map_Etvalues=et_map;
 }
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXLargeRJetAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXLargeRJetAlgo.cxx
index 145498a7b05a..fd7d3c8ec11b 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXLargeRJetAlgo.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXLargeRJetAlgo.cxx
@@ -102,7 +102,7 @@ int LVL1::jFEXLargeRJetAlgo::getTTowerET(unsigned int TTID ) {
 }
 
 
-void LVL1::jFEXLargeRJetAlgo::setFPGAEnergy(std::map<int,std::vector<int> > et_map){
+void LVL1::jFEXLargeRJetAlgo::setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map){
     m_map_Etvalues=et_map;
 }
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXOutputCollection.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXOutputCollection.cxx
index e6093cf50373..96b26c061b44 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXOutputCollection.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXOutputCollection.cxx
@@ -69,28 +69,28 @@ void LVL1::jFEXOutputCollection::addValue_pileup(std::string key, int value)
 
 void LVL1::jFEXOutputCollection::fill_smallRJet()
 {
-  std::map<std::string, int>* values_local = new std::map<std::string, int>(m_values_tem_smallRJet);
+  std::unordered_map<std::string, int>* values_local = new std::unordered_map<std::string, int>(m_values_tem_smallRJet);
   m_allvalues_smallRJet.push_back(values_local);
   m_values_tem_smallRJet.clear();
 
 }
 void LVL1::jFEXOutputCollection::fill_largeRJet()
 {
-  std::map<std::string, int>* values_local = new std::map<std::string, int>(m_values_tem_largeRJet);
+  std::unordered_map<std::string, int>* values_local = new std::unordered_map<std::string, int>(m_values_tem_largeRJet);
   m_allvalues_largeRJet.push_back(values_local);
   m_values_tem_largeRJet.clear();
 
 }
 void LVL1::jFEXOutputCollection::fill_tau()
 {
-  std::map<std::string, int>* values_local = new std::map<std::string, int>(m_values_tem_tau);
+  std::unordered_map<std::string, int>* values_local = new std::unordered_map<std::string, int>(m_values_tem_tau);
   m_allvalues_tau.push_back(values_local);
   m_values_tem_tau.clear();
 
 }
 void LVL1::jFEXOutputCollection::fill_pileup()
 {
-  std::map<std::string, int>* values_local = new std::map<std::string, int>(m_values_tem_pileup);
+  std::unordered_map<std::string, int>* values_local = new std::unordered_map<std::string, int>(m_values_tem_pileup);
   m_allvalues_pileup.push_back(values_local);
   m_values_tem_pileup.clear();
 
@@ -115,19 +115,19 @@ int LVL1::jFEXOutputCollection::pileupsize()
   return m_allvalues_pileup.size();
 }
 
-std::map<std::string, int>* LVL1::jFEXOutputCollection::get_smallRJet(int location)
+std::unordered_map<std::string, int>* LVL1::jFEXOutputCollection::get_smallRJet(int location)
 {
   return m_allvalues_smallRJet[location];
 }
-std::map<std::string, int>* LVL1::jFEXOutputCollection::get_largeRJet(int location)
+std::unordered_map<std::string, int>* LVL1::jFEXOutputCollection::get_largeRJet(int location)
 {
   return m_allvalues_largeRJet[location];
 }
-std::map<std::string, int>* LVL1::jFEXOutputCollection::get_tau(int location)
+std::unordered_map<std::string, int>* LVL1::jFEXOutputCollection::get_tau(int location)
 {
   return m_allvalues_tau[location];
 }
-std::map<std::string, int>* LVL1::jFEXOutputCollection::get_pileup(int location)
+std::unordered_map<std::string, int>* LVL1::jFEXOutputCollection::get_pileup(int location)
 {
   return m_allvalues_pileup[location];
 }
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXPileupAndNoise.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXPileupAndNoise.cxx
index 1747441302b7..d4e17cc5a74a 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXPileupAndNoise.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXPileupAndNoise.cxx
@@ -296,10 +296,10 @@ void LVL1::jFEXPileupAndNoise::ApplyPileupMet  (){
 
 
 
-std::map<int,std::vector<int> > LVL1::jFEXPileupAndNoise::Get_EM_Et_values(){
+std::unordered_map<int,std::vector<int> > LVL1::jFEXPileupAndNoise::Get_EM_Et_values(){
     
     // map for energies sent to the FPGA
-    std::map<int,std::vector<int> > map_Etvalues;
+    std::unordered_map<int,std::vector<int> > map_Etvalues;
     map_Etvalues.clear();
     
     // tmp variable to fill the map
@@ -378,10 +378,10 @@ std::map<int,std::vector<int> > LVL1::jFEXPileupAndNoise::Get_EM_Et_values(){
     return map_Etvalues;
 }
 
-std::map<int,std::vector<int> > LVL1::jFEXPileupAndNoise::Get_HAD_Et_values(){
+std::unordered_map<int,std::vector<int> > LVL1::jFEXPileupAndNoise::Get_HAD_Et_values(){
     
     // map for energies sent to the FPGA
-    std::map<int,std::vector<int> > map_Etvalues;
+    std::unordered_map<int,std::vector<int> > map_Etvalues;
     map_Etvalues.clear();
     
     // tmp variable to fill the map
@@ -461,7 +461,7 @@ std::map<int,std::vector<int> > LVL1::jFEXPileupAndNoise::Get_HAD_Et_values(){
 
 
 
-void LVL1::jFEXPileupAndNoise::ApplyNoiseCuts(std::map<int,std::vector<int> > & map_Etvalues, int Jet_NoiseCut, int Met_NoiseCut){
+void LVL1::jFEXPileupAndNoise::ApplyNoiseCuts(std::unordered_map<int,std::vector<int> > & map_Etvalues, int Jet_NoiseCut, int Met_NoiseCut){
 
     for(auto [key,vec] : map_Etvalues){
         
@@ -478,12 +478,12 @@ void LVL1::jFEXPileupAndNoise::ApplyNoiseCuts(std::map<int,std::vector<int> > &
 
 
 
-std::map<int,std::vector<int> > LVL1::jFEXPileupAndNoise::GetEt_values(){
+std::unordered_map<int,std::vector<int> > LVL1::jFEXPileupAndNoise::GetEt_values(){
     
     // map for energies sent to the FPGA
-    std::map<int,std::vector<int> > map_Etvalues;
-    std::map<int,std::vector<int> > map_Etvalues_EM;
-    std::map<int,std::vector<int> > map_Etvalues_HAD;
+    std::unordered_map<int,std::vector<int> > map_Etvalues;
+    std::unordered_map<int,std::vector<int> > map_Etvalues_EM;
+    std::unordered_map<int,std::vector<int> > map_Etvalues_HAD;
     map_Etvalues.clear();
     map_Etvalues_EM.clear();
     map_Etvalues_HAD.clear();    
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSmallRJetAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSmallRJetAlgo.cxx
index bed53bb82987..43337a7e19cc 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSmallRJetAlgo.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXSmallRJetAlgo.cxx
@@ -220,7 +220,7 @@ unsigned int LVL1::jFEXSmallRJetAlgo::getTTIDcentre(){
 }
 
 
-void LVL1::jFEXSmallRJetAlgo::setFPGAEnergy(std::map<int,std::vector<int> > et_map){
+void LVL1::jFEXSmallRJetAlgo::setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map){
     m_map_Etvalues=et_map;
 }
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXmetAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXmetAlgo.cxx
index 673c4f9ca73f..a272ebd247e3 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXmetAlgo.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXmetAlgo.cxx
@@ -263,7 +263,7 @@ int LVL1::jFEXmetAlgo::getTTowerET(unsigned int TTID ) {
 }
 
 
-void LVL1::jFEXmetAlgo::setFPGAEnergy(std::map<int,std::vector<int> > et_map){
+void LVL1::jFEXmetAlgo::setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map){
     m_map_Etvalues=et_map;
 }
 }// end of namespace LVL1
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXsumETAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXsumETAlgo.cxx
index e6bb5f75c392..36feeb096458 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXsumETAlgo.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXsumETAlgo.cxx
@@ -196,7 +196,7 @@ int LVL1::jFEXsumETAlgo::getTTowerET(unsigned int TTID ) {
 }
 
 
-void LVL1::jFEXsumETAlgo::setFPGAEnergy(std::map<int,std::vector<int> > et_map){
+void LVL1::jFEXsumETAlgo::setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map){
     m_map_Etvalues=et_map;
 }
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXtauAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXtauAlgo.cxx
index cf8f892858bc..548869e4a928 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXtauAlgo.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXtauAlgo.cxx
@@ -230,7 +230,7 @@ int LVL1::jFEXtauAlgo::realValue(int ID, int eta){
   
 }
 
-void LVL1::jFEXtauAlgo::setFPGAEnergy(std::map<int,std::vector<int> > et_map){
+void LVL1::jFEXtauAlgo::setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map){
     m_map_Etvalues=et_map;
 }
 
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXForwardJetsAlgo.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXForwardJetsAlgo.h
index 2e0f2972b68c..6b2970c66b0f 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXForwardJetsAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXForwardJetsAlgo.h
@@ -33,10 +33,10 @@ namespace LVL1{
       virtual unsigned int localPhi(int , int ) =0;
       virtual unsigned int localEta(int , int ) =0;
       virtual unsigned int getTTowerET(int, int) =0;
-      virtual std::map<int, jFEXForwardJetsInfo> FcalJetsTowerIDLists() =0;
-      virtual std::map<int, jFEXForwardJetsInfo> isSeedLocalMaxima() =0;
-      virtual std::map<int, jFEXForwardJetsInfo> calculateJetETs() =0;
-      virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)   =0;
+      virtual std::unordered_map<int, jFEXForwardJetsInfo> FcalJetsTowerIDLists() =0;
+      virtual std::unordered_map<int, jFEXForwardJetsInfo> isSeedLocalMaxima() =0;
+      virtual std::unordered_map<int, jFEXForwardJetsInfo> calculateJetETs() =0;
+      virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)   =0;
 
    private:
 
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXLargeRJetAlgo.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXLargeRJetAlgo.h
index 9543341db992..582d8093d375 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXLargeRJetAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXLargeRJetAlgo.h
@@ -27,7 +27,7 @@ namespace LVL1{
       virtual unsigned int getRingET() = 0;
       virtual unsigned int getLargeClusterET(unsigned int smallClusterET, unsigned int largeRingET) = 0;
       virtual std::unique_ptr<jFEXLargeRJetTOB> getLargeRJetTOBs(int smallClusterET,int TTID) = 0;
-      virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)   =0;
+      virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)   =0;
 
    private:
 
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXPileupAndNoise.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXPileupAndNoise.h
index e44e18fe589c..c3edec47b82e 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXPileupAndNoise.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXPileupAndNoise.h
@@ -29,9 +29,9 @@ class IjFEXPileupAndNoise : virtual public IAlgTool {
         virtual void setup(int FPGA[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_thin_algoSpace_width]) =0;
         virtual void setup(int FPGA[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]) =0;        
         
-        virtual std::map<int,std::vector<int> > GetEt_values() =0;        
-        virtual std::map<int,std::vector<int> > Get_EM_Et_values() =0;        
-        virtual std::map<int,std::vector<int> > Get_HAD_Et_values() =0;        
+        virtual std::unordered_map<int,std::vector<int> > GetEt_values() =0;        
+        virtual std::unordered_map<int,std::vector<int> > Get_EM_Et_values() =0;        
+        virtual std::unordered_map<int,std::vector<int> > Get_HAD_Et_values() =0;        
         
         virtual std::vector<int> CalculatePileup() =0;
         virtual void ApplyPileupJets() =0;
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXSmallRJetAlgo.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXSmallRJetAlgo.h
index ff2132d45de3..1e6e2575e8a4 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXSmallRJetAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXSmallRJetAlgo.h
@@ -35,7 +35,7 @@ namespace LVL1{
       virtual bool checkDisplacedLM() = 0;
       virtual std::unique_ptr<jFEXSmallRJetTOB> getSmallRJetTOBs() = 0; 
       virtual unsigned int getTTIDcentre() =0;
-      virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)   =0;
+      virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)   =0;
 
    private:
 
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXmetAlgo.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXmetAlgo.h
index ac1ba439dfd3..bca0fbf70c67 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXmetAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXmetAlgo.h
@@ -33,7 +33,7 @@ class IjFEXmetAlgo : virtual public IAlgTool {
         virtual int GetMetXComponent()  =0;
         virtual int GetMetYComponent()  =0;
         virtual int getTTowerET(unsigned int TTID ) =0; 
-        virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)   =0;
+        virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)   =0;
         
 
         virtual std::unique_ptr<jFEXmetTOB> getmetTOBs() = 0;
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXsumETAlgo.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXsumETAlgo.h
index ac97d0ea22ad..f6741a682135 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXsumETAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXsumETAlgo.h
@@ -33,7 +33,7 @@ class IjFEXsumETAlgo : virtual public IAlgTool {
         virtual void buildFWDSumET()  =0;
         virtual int getETlowerEta(uint )  =0;
         virtual int getETupperEta(uint )  =0;
-        virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)  =0;
+        virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)  =0;
         
 
         virtual std::unique_ptr<jFEXsumETTOB> getsumETTOBs() = 0;
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXtauAlgo.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXtauAlgo.h
index dfa765bec8db..293c4bf6f8ea 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXtauAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IjFEXtauAlgo.h
@@ -35,7 +35,7 @@ class IjFEXtauAlgo : virtual public IAlgTool {
         virtual int getClusterEt()  =0;
         virtual int getIsLocalMaxima()  =0;
         virtual int getFirstEtRing()  =0;
-        virtual void setFPGAEnergy(std::map<int,std::vector<int> > et_map)   =0;
+        virtual void setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map)   =0;
         
 
         virtual std::unique_ptr<jFEXtauTOB> getTauTOBs(int, int) = 0;
-- 
GitLab


From ce1982e12f650940ffae5b04191fda7a3660b2c5 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Fri, 10 Sep 2021 17:35:27 +0200
Subject: [PATCH 100/347] Support executor substeps in transforms

---
 .../python/AllConfigFlags.py                  |   8 +-
 Simulation/Digitization/python/PileUpUtils.py |  17 ++-
 .../python/RunDependentMCTaskIterator.py      |  12 +-
 .../PileUpProfile_run310000_splitting.py      |  19 +++
 .../RunDependentSimData/share/configCommon.py |  16 ++-
 .../share/configLumi_run310000_splitting.py   |  28 ++++
 .../share/CommonSkeletonJobOptions.py         |  10 +-
 ..._Digi_tf_multistep_presampling_CA_vs_CG.sh | 124 ++++++++++++++++
 ...ultistep_MP_presampling_reproducibility.sh | 135 ++++++++++++++++++
 Tools/Campaigns/python/MC21.py                |   8 ++
 Tools/Campaigns/python/__init__.py            |   4 +-
 .../python/CommonRunArgsToFlags.py            |  14 ++
 Tools/PyJobTransforms/python/transform.py     |  36 +++++
 Tools/PyJobTransforms/python/trfArgClasses.py |   5 +-
 Tools/PyJobTransforms/python/trfArgs.py       |   3 +
 Tools/PyJobTransforms/python/trfExe.py        |  84 +++++++++--
 .../PyJobTransforms/python/trfExeStepTools.py |  71 +++++++++
 Tools/PyJobTransforms/python/trfJobOptions.py |  22 ++-
 Tools/PyJobTransforms/python/trfMPTools.py    |   2 +
 Tools/PyJobTransforms/python/trfMTTools.py    |   4 +-
 Tools/PyJobTransforms/python/trfValidation.py |   7 +
 21 files changed, 599 insertions(+), 30 deletions(-)
 create mode 100644 Simulation/RunDependentSim/RunDependentSimData/python/PileUpProfile_run310000_splitting.py
 create mode 100644 Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run310000_splitting.py
 create mode 100755 Simulation/Tests/DigitizationTests/test/test_Digi_tf_multistep_presampling_CA_vs_CG.sh
 create mode 100755 Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_multistep_MP_presampling_reproducibility.sh
 create mode 100644 Tools/PyJobTransforms/python/trfExeStepTools.py

diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py
index c4c9023a4566..b39c26cfcb11 100644
--- a/Control/AthenaConfiguration/python/AllConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AllConfigFlags.py
@@ -23,8 +23,12 @@ def _createCfgFlags():
     from AthenaCommon.Constants import INFO
     acf.addFlag('Exec.OutputLevel',INFO) #Global Output Level
     acf.addFlag('Exec.MaxEvents',-1) 
-    acf.addFlag("Exec.SkipEvents",0)
-    acf.addFlag("Exec.DebugStage","")
+    acf.addFlag('Exec.SkipEvents',0)
+    acf.addFlag('Exec.DebugStage','')
+
+    acf.addFlag('ExecutorSplitting.TotalSteps', 0)
+    acf.addFlag('ExecutorSplitting.Step', -1)
+    acf.addFlag('ExecutorSplitting.TotalEvents', -1)
 
     #Flags describing the input data 
     acf.addFlag('Input.Files', ["_ATHENA_GENERIC_INPUTFILE_NAME_",] ) # former global.InputFiles
diff --git a/Simulation/Digitization/python/PileUpUtils.py b/Simulation/Digitization/python/PileUpUtils.py
index 6c9cc6d7dd68..992b9d3453b2 100644
--- a/Simulation/Digitization/python/PileUpUtils.py
+++ b/Simulation/Digitization/python/PileUpUtils.py
@@ -134,6 +134,12 @@ def generatePileUpProfile(flags,
 
     jobNumber = flags.Digitization.JobNumber
     maxEvents = flags.Exec.MaxEvents
+    totalEvents = flags.Exec.MaxEvents
+    skipEvents = flags.Exec.SkipEvents
+
+    # executor splitting
+    if flags.ExecutorSplitting.TotalSteps > 1:
+        totalEvents = flags.ExecutorSplitting.TotalEvents
 
     if maxEvents == -1:
         raise SystemExit("maxEvents = %d is not supported! Please set this to the number of events per file times the number of files per job." % (
@@ -152,6 +158,10 @@ def generatePileUpProfile(flags,
     #  the number of events specified by this run is not evenly
     #  divisible by trfMaxEvents.
     generatedProfile = loadPileUpProfile(flags, profile)
+    # do executor step filtering
+    if flags.ExecutorSplitting.TotalSteps > 1:
+        generatedProfile = list(filter(lambda lb: 'step' not in lb or lb['step'] == flags.ExecutorSplitting.Step, generatedProfile))
+
     runMaxEvents = sum(lb["evts"] for lb in generatedProfile)
     logger.info("There are %d events in this run.", runMaxEvents)
     jobsPerRun = int(ceil(float(runMaxEvents)/corrMaxEvents))
@@ -172,13 +182,18 @@ def generatePileUpProfile(flags,
             jobnumber=(jobNumber-1),
             task=generatedProfile,
             maxEvents=maxEvents,
+            totalEvents=totalEvents,
+            skipEvents=skipEvents,
             sequentialEventNumbers=sequentialEventNumbers)
     else:
         # Load needed tools
         from Digitization.RunDependentMCTaskIterator import getRunLumiInfoFragment
         fragment = getRunLumiInfoFragment(
             jobnumber=(jobNumber-1),
-            task=generatedProfile, maxEvents=maxEvents,
+            task=generatedProfile,
+            maxEvents=maxEvents,
+            totalEvents=totalEvents,
+            skipEvents=skipEvents,
             sequentialEventNumbers=sequentialEventNumbers)
     
     # Remove lumiblocks with no events
diff --git a/Simulation/Digitization/python/RunDependentMCTaskIterator.py b/Simulation/Digitization/python/RunDependentMCTaskIterator.py
index 1b120b71a871..39526e31a85b 100644
--- a/Simulation/Digitization/python/RunDependentMCTaskIterator.py
+++ b/Simulation/Digitization/python/RunDependentMCTaskIterator.py
@@ -11,7 +11,7 @@ import itertools
 import random
 from operator import itemgetter
 
-def getRunLumiInfoFragment(jobnumber,task,maxEvents,sequentialEventNumbers=False):
+def getRunLumiInfoFragment(jobnumber,task,maxEvents,totalEvents,skipEvents,sequentialEventNumbers=False):
     """Calculate the specific configuration of the current job in the digi
     task. Try to make each fragment utilize the same amount of CPU and
     Cache resources.  Exploits the fact that the task when sorted by
@@ -35,11 +35,11 @@ def getRunLumiInfoFragment(jobnumber,task,maxEvents,sequentialEventNumbers=False
     
     fragment=sorted(sum([hi_mu_frag,lo_mu_frag],[]),key=lambda job: job['run'])
     if sequentialEventNumbers:
-        return defineSequentialEventNumbers(jobnumber,fragment,maxEvents)
+        return defineSequentialEventNumbers(jobnumber,fragment,totalEvents,skipEvents)
     else:
         return fragment
 
-def getRandomlySampledRunLumiInfoFragment(jobnumber,task,maxEvents,sequentialEventNumbers=False):
+def getRandomlySampledRunLumiInfoFragment(jobnumber,task,maxEvents,totalEvents,skipEvents,sequentialEventNumbers=False):
     """Calculate the specific configuration of the current job in the digi
     task. Sample the mu values randomly.
     """
@@ -52,7 +52,7 @@ def getRandomlySampledRunLumiInfoFragment(jobnumber,task,maxEvents,sequentialEve
 
     # sample mu profile
     new_frag = []
-    evt_nbr = jobnumber * maxEvents
+    evt_nbr = jobnumber * totalEvents + skipEvents
     for i in range(maxEvents):
         evt_nbr += 1
 
@@ -160,11 +160,11 @@ def taskLookupTable(task):
             table.append(i)
     return table
 
-def defineSequentialEventNumbers(jobnumber,fragment,maxEvents):
+def defineSequentialEventNumbers(jobnumber,fragment,totalEvents,skipEvents):
     """ Calculate sequential event numbers for the defined getFragment.
     """
     new_frag = []
-    evt_nbr = jobnumber * maxEvents
+    evt_nbr = jobnumber * totalEvents + skipEvents
     for t in fragment:
         for i in range(t['evts']):
             evt_nbr += 1
diff --git a/Simulation/RunDependentSim/RunDependentSimData/python/PileUpProfile_run310000_splitting.py b/Simulation/RunDependentSim/RunDependentSimData/python/PileUpProfile_run310000_splitting.py
new file mode 100644
index 000000000000..766f51020bef
--- /dev/null
+++ b/Simulation/RunDependentSim/RunDependentSimData/python/PileUpProfile_run310000_splitting.py
@@ -0,0 +1,19 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+def setupProfile(flags, scaleTaskLength=1):
+
+  def _evts(x):
+    return int(scaleTaskLength * x)
+
+  return [
+    {'run':310000, 'lb':1, 'starttstamp':1550000000, 'dt':0.000, 'evts':_evts(1), 'mu':20.500, 'force_new':False, 'step': 0},
+    {'run':310000, 'lb':2, 'starttstamp':1550000060, 'dt':0.000, 'evts':_evts(1), 'mu':21.500, 'force_new':False, 'step': 0},
+    {'run':310000, 'lb':3, 'starttstamp':1550000120, 'dt':0.000, 'evts':_evts(1), 'mu':22.500, 'force_new':False, 'step': 0},
+    {'run':310000, 'lb':4, 'starttstamp':1550000180, 'dt':0.000, 'evts':_evts(1), 'mu':10.500, 'force_new':False, 'step': 1},
+    {'run':310000, 'lb':5, 'starttstamp':1550000240, 'dt':0.000, 'evts':_evts(1), 'mu':11.500, 'force_new':False, 'step': 1},
+    {'run':310000, 'lb':6, 'starttstamp':1550000300, 'dt':0.000, 'evts':_evts(1), 'mu':1.500, 'force_new':False, 'step': 2},
+    {'run':310000, 'lb':7, 'starttstamp':1550000360, 'dt':0.000, 'evts':_evts(1), 'mu':2.500, 'force_new':False, 'step': 2},
+    {'run':310000, 'lb':8, 'starttstamp':1550000420, 'dt':0.000, 'evts':_evts(1), 'mu':3.500, 'force_new':False, 'step': 2},
+    {'run':310000, 'lb':9, 'starttstamp':1550000480, 'dt':0.000, 'evts':_evts(1), 'mu':4.500, 'force_new':False, 'step': 2},
+    {'run':310000, 'lb':10, 'starttstamp':1550000540, 'dt':0.000, 'evts':_evts(1), 'mu':5.500, 'force_new':False, 'step': 2},
+  ]
diff --git a/Simulation/RunDependentSim/RunDependentSimData/share/configCommon.py b/Simulation/RunDependentSim/RunDependentSimData/share/configCommon.py
index fa4892859cba..d7682bf869dc 100644
--- a/Simulation/RunDependentSim/RunDependentSimData/share/configCommon.py
+++ b/Simulation/RunDependentSim/RunDependentSimData/share/configCommon.py
@@ -8,6 +8,17 @@ if 'runArgs' in dir():
     if hasattr(runArgs,"jobNumber") and hasattr(runArgs,"maxEvents"):
         trfJobNumber = runArgs.jobNumber
         trfMaxEvents = runArgs.maxEvents
+        trfTotalEvents = runArgs.maxEvents
+        trfSkipEvents = runArgs.skipEvents if hasattr(runArgs, "skipEvents") else 0
+
+        # do executor step filtering
+        if hasattr(runArgs, "totalExecutorSteps") and runArgs.totalExecutorSteps > 1:
+            JobMaker = list(filter(lambda lb: 'step' not in lb or lb['step'] == runArgs.executorStep, JobMaker))
+            if runArgs.totalExecutorSteps != len(runArgs.executorEventCounts):
+                raise ValueError("Mismatch between total executor steps and event fractions size!")
+            trfMaxEvents = runArgs.executorEventCounts[runArgs.executorStep]
+            trfSkipEvents = runArgs.executorEventSkips[runArgs.executorStep]
+
         if runArgs.maxEvents==-1:
             raise SystemExit("maxEvents = %d is not supported! Please set this to the number of events per file times the number of files per job."%(runArgs.maxEvents,))
         if not 'DoNotCorrectMaxEvents' in dir():
@@ -21,6 +32,7 @@ else:
     #this is a test job not a trf job
     trfJobNumber=1
     trfMaxEvents=10
+    trfTotalEvents=10
     corrMaxEvents=float(trfMaxEvents)
     
 #We may need to repeat this run for long production jobs.
@@ -45,11 +57,11 @@ if randomMuSampling:
     digilog.info('Mu values will be sampled randomly from the set profile.')
     #Load needed tools 
     from Digitization.RunDependentMCTaskIterator import getRandomlySampledRunLumiInfoFragment
-    fragment=getRandomlySampledRunLumiInfoFragment(jobnumber=(trfJobNumber-1),task=JobMaker,maxEvents=trfMaxEvents,sequentialEventNumbers=sequentialEventNumbers)
+    fragment=getRandomlySampledRunLumiInfoFragment(jobnumber=(trfJobNumber-1),task=JobMaker,maxEvents=trfMaxEvents,totalEvents=trfTotalEvents,skipEvents=trfSkipEvents,sequentialEventNumbers=sequentialEventNumbers)
 else:
     #Load needed tools 
     from Digitization.RunDependentMCTaskIterator import getRunLumiInfoFragment
-    fragment=getRunLumiInfoFragment(jobnumber=(trfJobNumber-1),task=JobMaker,maxEvents=trfMaxEvents,sequentialEventNumbers=sequentialEventNumbers)
+    fragment=getRunLumiInfoFragment(jobnumber=(trfJobNumber-1),task=JobMaker,maxEvents=trfMaxEvents,totalEvents=trfTotalEvents,skipEvents=trfSkipEvents,sequentialEventNumbers=sequentialEventNumbers)
 
 from RunDependentSimComps.RunLumiConfigTools import condenseRunLumiInfoFragment
 digilog.info( 'Writing RunDMC trigger configuration fragment to file.  listOfRunsEvents = %s' %
diff --git a/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run310000_splitting.py b/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run310000_splitting.py
new file mode 100644
index 000000000000..05fe5f48cfea
--- /dev/null
+++ b/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run310000_splitting.py
@@ -0,0 +1,28 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+# We need to be able to adjust for different dataset sizes.
+if not 'ScaleTaskLength' in dir():   ScaleTaskLength = 1
+_evts = lambda x: int(ScaleTaskLength * x)
+
+if not 'logging' in dir(): import logging
+digilog = logging.getLogger('Digi_trf')
+digilog.info('doing RunLumiOverride configuration from file.')
+JobMaker=[
+  {'run':310000, 'lb':1, 'starttstamp':1550000000, 'dt':0.000, 'evts':_evts(1), 'mu':20.500, 'force_new':False, 'step': 0},
+  {'run':310000, 'lb':2, 'starttstamp':1550000060, 'dt':0.000, 'evts':_evts(1), 'mu':21.500, 'force_new':False, 'step': 0},
+  {'run':310000, 'lb':3, 'starttstamp':1550000120, 'dt':0.000, 'evts':_evts(1), 'mu':22.500, 'force_new':False, 'step': 0},
+  {'run':310000, 'lb':4, 'starttstamp':1550000180, 'dt':0.000, 'evts':_evts(1), 'mu':10.500, 'force_new':False, 'step': 1},
+  {'run':310000, 'lb':5, 'starttstamp':1550000240, 'dt':0.000, 'evts':_evts(1), 'mu':11.500, 'force_new':False, 'step': 1},
+  {'run':310000, 'lb':6, 'starttstamp':1550000300, 'dt':0.000, 'evts':_evts(1), 'mu':1.500, 'force_new':False, 'step': 2},
+  {'run':310000, 'lb':7, 'starttstamp':1550000360, 'dt':0.000, 'evts':_evts(1), 'mu':2.500, 'force_new':False, 'step': 2},
+  {'run':310000, 'lb':8, 'starttstamp':1550000420, 'dt':0.000, 'evts':_evts(1), 'mu':3.500, 'force_new':False, 'step': 2},
+  {'run':310000, 'lb':9, 'starttstamp':1550000480, 'dt':0.000, 'evts':_evts(1), 'mu':4.500, 'force_new':False, 'step': 2},
+  {'run':310000, 'lb':10, 'starttstamp':1550000540, 'dt':0.000, 'evts':_evts(1), 'mu':5.500, 'force_new':False, 'step': 2},
+#--> end hiding
+]
+
+include('RunDependentSimData/configCommon.py')
+
+#cleanup python memory
+if not "RunDMC_testing_configuration" in dir():
+    del JobMaker
diff --git a/Simulation/SimuJobTransforms/share/CommonSkeletonJobOptions.py b/Simulation/SimuJobTransforms/share/CommonSkeletonJobOptions.py
index 8bfa9167662b..f799fe221b52 100644
--- a/Simulation/SimuJobTransforms/share/CommonSkeletonJobOptions.py
+++ b/Simulation/SimuJobTransforms/share/CommonSkeletonJobOptions.py
@@ -11,9 +11,15 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
 
 ## Max/skip events
 if hasattr(runArgs,"skipEvents"):
-    athenaCommonFlags.SkipEvents.set_Value_and_Lock( runArgs.skipEvents )
+    if hasattr(runArgs,"totalExecutorSteps") and runArgs.totalExecutorSteps > 1:
+        athenaCommonFlags.SkipEvents.set_Value_and_Lock( runArgs.executorEventSkips[runArgs.executorStep] )
+    else:
+        athenaCommonFlags.SkipEvents.set_Value_and_Lock( runArgs.skipEvents )
 if hasattr(runArgs,"maxEvents"):
-    athenaCommonFlags.EvtMax.set_Value_and_Lock( runArgs.maxEvents )
+    if hasattr(runArgs,"totalExecutorSteps") and runArgs.totalExecutorSteps > 1:
+        athenaCommonFlags.EvtMax.set_Value_and_Lock( runArgs.executorEventCounts[runArgs.executorStep] )
+    else:
+        athenaCommonFlags.EvtMax.set_Value_and_Lock( runArgs.maxEvents )
 else:
     athenaCommonFlags.EvtMax=-1
 
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_multistep_presampling_CA_vs_CG.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_multistep_presampling_CA_vs_CG.sh
new file mode 100755
index 000000000000..c9fc9428395d
--- /dev/null
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_multistep_presampling_CA_vs_CG.sh
@@ -0,0 +1,124 @@
+#!/bin/sh
+#
+# art-description: Run a digitization example to compare configuration between ConfGetter and the new ComponentAccumulator approach.
+# art-type: grid
+# art-include: master/Athena
+# art-output: multistep_presampling.CG.RDO.pool.root
+# art-output: multistep_presampling.CA.RDO.pool.root
+# art-output: log.*
+# art-output: DigiPUConfig*
+
+Events=100
+DigiOutFileNameCG="multistep_presampling.CG.RDO.pool.root"
+DigiOutFileNameCA="multistep_presampling.CA.RDO.pool.root"
+HSHitsFile="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/mc16_13TeV.900149.PG_single_nu_Pt50.simul.HITS.e8307_s3482/HITS.24078104._234467.pool.root.1"
+HighPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.800831.Py8EG_minbias_inelastic_highjetphotonlepton.simul.HITS_FILT.e8341_s3687_s3704/*"
+LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.900311.Epos_minbias_inelastic_lowjetphoton.simul.HITS_FILT.e8341_s3687_s3704/*"
+
+
+# config only
+Digi_tf.py \
+--splitConfig 'HITtoRDO:Campaigns.BeamspotSplitMC21a' \
+--detectors Truth \
+--PileUpPresampling True \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--digiSeedOffset1 170 --digiSeedOffset2 170 \
+--digiSteeringConf "StandardSignalOnlyTruth" \
+--geometryVersion default:ATLAS-R2-2016-01-00-01 \
+--inputHITSFile ${HSHitsFile} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \
+--jobNumber 568 \
+--maxEvents ${Events} \
+--outputRDOFile ${DigiOutFileNameCG} \
+--numberOfLowPtMinBias 22.4 \
+--numberOfHighPtMinBias 0.1 \
+--pileupInitialBunch -32 \
+--pileupFinalBunch 6 \
+--preExec "HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.OldBeamSpotZSize.set_Value_and_Lock(0);digitizationFlags.HighPtMinBiasInputColOffset=-1;" \
+--preInclude 'HITtoRDO:Campaigns/MC20e.py,RunDependentSimData/configEvtNbr_sequential.py,Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run310000_splitting.py' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--skipEvents 15 \
+--athenaopts '"--config-only=DigiPUConfigCG.pkl"'
+
+# full run
+Digi_tf.py \
+--splitConfig 'HITtoRDO:Campaigns.BeamspotSplitMC21a' \
+--detectors Truth \
+--PileUpPresampling True \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--digiSeedOffset1 170 --digiSeedOffset2 170 \
+--digiSteeringConf "StandardSignalOnlyTruth" \
+--geometryVersion default:ATLAS-R2-2016-01-00-01 \
+--inputHITSFile ${HSHitsFile} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \
+--jobNumber 568 \
+--maxEvents ${Events} \
+--outputRDOFile ${DigiOutFileNameCG} \
+--numberOfLowPtMinBias 22.4 \
+--numberOfHighPtMinBias 0.1 \
+--pileupInitialBunch -32 \
+--pileupFinalBunch 6 \
+--preExec "HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.OldBeamSpotZSize.set_Value_and_Lock(0);digitizationFlags.HighPtMinBiasInputColOffset=-1;" \
+--preInclude 'HITtoRDO:Campaigns/MC20e.py,RunDependentSimData/configEvtNbr_sequential.py,Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run310000_splitting.py' \
+--postExec 'HITtoRDO:job+=CfgMgr.JobOptsDumperAlg(FileName="DigiPUConfigCG.txt")' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--skipEvents 15
+
+rc=$?
+status=$rc
+echo "art-result: $rc CGdigi"
+mv runargs.HITtoRDOExecutorStep0.py runargs.legacy.HITtoRDOExecutorStep0.py 
+mv runargs.HITtoRDOExecutorStep1.py runargs.legacy.HITtoRDOExecutorStep1.py 
+mv runargs.HITtoRDOExecutorStep2.py runargs.legacy.HITtoRDOExecutorStep2.py 
+mv runargs.RDOMergeAthenaMP0.py runargs.legacy.RDOMergeAthenaMP0.py
+mv log.HITtoRDOExecutorStep0 legacy.HITtoRDOExecutorStep0
+mv log.HITtoRDOExecutorStep1 legacy.HITtoRDOExecutorStep1
+mv log.HITtoRDOExecutorStep2 legacy.HITtoRDOExecutorStep2
+mv log.RDOMergeAthenaMP0 legacy.RDOMergeAthenaMP0
+
+rc2=-9999
+if [ $rc -eq 0 ]
+then
+    Digi_tf.py \
+    --CA 'HITtoRDO:True' \
+    --splitConfig 'HITtoRDO:Campaigns.BeamspotSplitMC21a' \
+    --detectors Truth \
+    --PileUpPresampling True \
+    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+    --digiSeedOffset1 170 --digiSeedOffset2 170 \
+    --digiSteeringConf "StandardSignalOnlyTruth" \
+    --geometryVersion default:ATLAS-R2-2016-01-00-01 \
+    --inputHITSFile ${HSHitsFile} \
+    --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
+    --inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \
+    --jobNumber 568 \
+    --maxEvents ${Events} \
+    --outputRDOFile ${DigiOutFileNameCA} \
+    --numberOfLowPtMinBias 22.4 \
+    --numberOfHighPtMinBias 0.1 \
+    --postInclude 'HITtoRDO:PyJobTransforms.UseFrontier' 'HITtoRDO:Digitization.DigitizationSteering.DigitizationTestingPostInclude' \
+    --preInclude 'HITtoRDO:Campaigns.MC20e' \
+    --preExec 'HITtoRDO:ConfigFlags.Digitization.PU.ProfileConfig="RunDependentSimData.PileUpProfile_run310000_splitting";' \
+    --skipEvents 15
+
+    rc2=$?
+    status=$rc2
+fi
+
+echo  "art-result: $rc2 CAdigi"
+
+rc3=-9999
+if [ $rc2 -eq 0 ]
+then
+    acmd.py diff-root ${DigiOutFileNameCG} ${DigiOutFileNameCA} \
+        --mode=semi-detailed --error-mode resilient --order-trees \
+        --ignore-leaves RecoTimingObj_p1_HITStoRDO_timings index_ref
+    rc3=$?
+    status=$rc3
+fi
+
+echo  "art-result: $rc3 comparison"
+
+exit $status
diff --git a/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_multistep_MP_presampling_reproducibility.sh b/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_multistep_MP_presampling_reproducibility.sh
new file mode 100755
index 000000000000..900f3b9d1a54
--- /dev/null
+++ b/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_multistep_MP_presampling_reproducibility.sh
@@ -0,0 +1,135 @@
+#!/bin/sh
+#
+# art-description: Run multistep pile-up presampling
+# art-type: grid
+# art-athena-mt: 8
+# art-include: master/Athena
+# art-output: multistep_presampling_SP.RDO.pool.root
+# art-output: multistep_presampling_MP_fork_evt0.RDO.pool.root
+# art-output: multistep_presampling_MP_fork_evt1.RDO.pool.root
+
+export ATHENA_CORE_NUMBER=8
+
+Events=100
+DigiOutFileNameSP="multistep_presampling_SP.RDO.pool.root"
+DigiOutFileNameMP0="multistep_presampling_MP_fork_evt0.RDO.pool.root"
+DigiOutFileNameMP1="multistep_presampling_MP_fork_evt1.RDO.pool.root"
+
+HSHitsFile="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/mc16_13TeV.900149.PG_single_nu_Pt50.simul.HITS.e8307_s3482/HITS.24078104._234467.pool.root.1"
+HighPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.800831.Py8EG_minbias_inelastic_highjetphotonlepton.simul.HITS_FILT.e8341_s3687_s3704/*"
+LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.900311.Epos_minbias_inelastic_lowjetphoton.simul.HITS_FILT.e8341_s3687_s3704/*"
+
+
+Digi_tf.py \
+--splitConfig 'HITtoRDO:Campaigns.BeamspotSplitMC21a' \
+--detectors Truth \
+--PileUpPresampling True \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--digiSeedOffset1 170 --digiSeedOffset2 170 \
+--digiSteeringConf "StandardSignalOnlyTruth" \
+--geometryVersion default:ATLAS-R2-2016-01-00-01 \
+--inputHITSFile ${HSHitsFile} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \
+--jobNumber 568 \
+--maxEvents ${Events} \
+--outputRDOFile ${DigiOutFileNameSP} \
+--numberOfLowPtMinBias 22.4 \
+--numberOfHighPtMinBias 0.1 \
+--pileupInitialBunch -32 \
+--pileupFinalBunch 6 \
+--preExec "HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.OldBeamSpotZSize.set_Value_and_Lock(0);" \
+--preInclude 'HITtoRDO:Campaigns/MC20e.py,RunDependentSimData/configEvtNbr_sequential.py,Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run310000_splitting.py' \
+--postExec "HITtoRDO:ServiceMgr.PileUpEventLoopMgr.AllowSerialAndMPToDiffer=False" \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--skipEvents 0
+
+rc=$?
+status=$rc
+echo "art-result: $rc Digi_tf.py SP"
+
+Digi_tf.py \
+--multiprocess --athenaMPEventsBeforeFork 0 \
+--splitConfig 'HITtoRDO:Campaigns.BeamspotSplitMC21a' \
+--detectors Truth \
+--PileUpPresampling True \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--digiSeedOffset1 170 --digiSeedOffset2 170 \
+--digiSteeringConf "StandardSignalOnlyTruth" \
+--geometryVersion default:ATLAS-R2-2016-01-00-01 \
+--inputHITSFile ${HSHitsFile} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \
+--jobNumber 568 \
+--maxEvents ${Events} \
+--outputRDOFile ${DigiOutFileNameMP0} \
+--numberOfLowPtMinBias 22.4 \
+--numberOfHighPtMinBias 0.1 \
+--pileupInitialBunch -32 \
+--pileupFinalBunch 6 \
+--preExec "HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.OldBeamSpotZSize.set_Value_and_Lock(0);" \
+--preInclude 'HITtoRDO:Campaigns/MC20e.py,RunDependentSimData/configEvtNbr_sequential.py,Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run310000_splitting.py' \
+--postExec "HITtoRDO:ServiceMgr.PileUpEventLoopMgr.AllowSerialAndMPToDiffer=False" \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--skipEvents 0
+
+rc2=$?
+if [ $status -eq 0 ]; then
+  status=$rc2
+fi
+echo "art-result: $rc2 Digi_tf.py MP fork after 0"
+
+Digi_tf.py \
+--multiprocess --athenaMPEventsBeforeFork 1 \
+--splitConfig 'HITtoRDO:Campaigns.BeamspotSplitMC21a' \
+--detectors Truth \
+--PileUpPresampling True \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--digiSeedOffset1 170 --digiSeedOffset2 170 \
+--digiSteeringConf "StandardSignalOnlyTruth" \
+--geometryVersion default:ATLAS-R2-2016-01-00-01 \
+--inputHITSFile ${HSHitsFile} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \
+--jobNumber 568 \
+--maxEvents ${Events} \
+--outputRDOFile ${DigiOutFileNameMP1} \
+--numberOfLowPtMinBias 22.4 \
+--numberOfHighPtMinBias 0.1 \
+--pileupInitialBunch -32 \
+--pileupFinalBunch 6 \
+--preExec "HITtoRDO:from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.OldBeamSpotZSize.set_Value_and_Lock(0);" \
+--preInclude 'HITtoRDO:Campaigns/MC20e.py,RunDependentSimData/configEvtNbr_sequential.py,Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run310000_splitting.py' \
+--postExec "HITtoRDO:ServiceMgr.PileUpEventLoopMgr.AllowSerialAndMPToDiffer=False" \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--skipEvents 0
+
+rc3=$?
+if [ $status -eq 0 ]; then
+  status=$rc3
+fi
+echo "art-result: $rc3 Digi_tf.py MP fork after 1"
+
+rc4=-9999
+if [ $status -eq 0 ] && [ $rc -eq 0 ] && [ $rc2 -eq 0 ]
+then
+    acmd.py diff-root ${DigiOutFileNameSP} ${DigiOutFileNameMP0} \
+        --mode=semi-detailed --error-mode resilient --order-trees \
+        --ignore-leaves RecoTimingObj_p1_Bkg_HITStoRDO_timings index_ref
+    rc4=$?
+    status=$rc4
+fi
+echo "art-result: $rc4 SP vs MP fork after 0"
+
+rc5=-9999
+if [ $status -eq 0 ] && [ $rc -eq 0 ] && [ $rc3 -eq 0 ]
+then
+    acmd.py diff-root ${DigiOutFileNameSP} ${DigiOutFileNameMP1} \
+        --mode=semi-detailed --error-mode resilient --order-trees \
+        --ignore-leaves RecoTimingObj_p1_Bkg_HITStoRDO_timings index_ref
+    rc5=$?
+    status=$rc5
+fi
+echo "art-result: $rc5 SP vs MP fork after 1"
+
+exit $status
diff --git a/Tools/Campaigns/python/MC21.py b/Tools/Campaigns/python/MC21.py
index 5e1b30bb38d7..454a411b9895 100644
--- a/Tools/Campaigns/python/MC21.py
+++ b/Tools/Campaigns/python/MC21.py
@@ -33,3 +33,11 @@ def MC21NoPileUp(flags):
 
     flags.Tile.BestPhaseFromCOOL = False
     flags.Tile.correctTime = False
+
+
+def BeamspotSplitMC21a():
+    """MC21a beamspot splitting configuration"""
+    substeps = 3
+    event_fractions = [0.3, 0.3, 0.4]
+
+    return substeps, event_fractions
diff --git a/Tools/Campaigns/python/__init__.py b/Tools/Campaigns/python/__init__.py
index 1ea80b575a1a..8c972b6fa8de 100644
--- a/Tools/Campaigns/python/__init__.py
+++ b/Tools/Campaigns/python/__init__.py
@@ -2,12 +2,12 @@
 
 from .MC16 import MC16a, MC16d, MC16e, MC16NoPileUp
 from .MC20 import MC20a, MC20d, MC20e, MC20NoPileUp
-from .MC21 import MC21a, MC21NoPileUp
+from .MC21 import MC21a, MC21NoPileUp, BeamspotSplitMC21a
 from .PhaseII import PhaseIIPileUp, PhaseIINoPileUp
 
 __all__ = [
   'MC16a', 'MC16d', 'MC16e', 'MC16NoPileUp',
   'MC20a', 'MC20d', 'MC20e', 'MC20NoPileUp',
-  'MC21a', 'MC21NoPileUp',
+  'MC21a', 'MC21NoPileUp', 'BeamspotSplitMC21a',
   'PhaseIIPileUp', 'PhaseIINoPileUp',
 ]
diff --git a/Tools/PyJobTransforms/python/CommonRunArgsToFlags.py b/Tools/PyJobTransforms/python/CommonRunArgsToFlags.py
index 02d7972ed534..f3962800818c 100644
--- a/Tools/PyJobTransforms/python/CommonRunArgsToFlags.py
+++ b/Tools/PyJobTransforms/python/CommonRunArgsToFlags.py
@@ -24,3 +24,17 @@ def commonRunArgsToFlags(runArgs,configFlags):
 
     if hasattr(runArgs,"concurrentEvents"):
         configFlags.Concurrency.NumConcurrentEvents = runArgs.concurrentEvents
+
+    ## Executor steps
+    if hasattr(runArgs,"totalExecutorSteps"):
+        configFlags.ExecutorSplitting.TotalSteps = runArgs.totalExecutorSteps
+
+    if hasattr(runArgs,"executorStep"):
+        configFlags.ExecutorSplitting.Step = runArgs.executorStep
+
+    if hasattr(runArgs,"executorEventCounts"):
+        configFlags.ExecutorSplitting.TotalEvents = configFlags.Exec.MaxEvents
+        configFlags.Exec.MaxEvents = runArgs.executorEventCounts[configFlags.ExecutorSplitting.Step]
+
+    if hasattr(runArgs,"executorEventSkips"):
+        configFlags.Exec.SkipEvents = runArgs.executorEventSkips[configFlags.ExecutorSplitting.Step]
diff --git a/Tools/PyJobTransforms/python/transform.py b/Tools/PyJobTransforms/python/transform.py
index 431bf849ced1..946bfabe469d 100644
--- a/Tools/PyJobTransforms/python/transform.py
+++ b/Tools/PyJobTransforms/python/transform.py
@@ -8,6 +8,7 @@
 #
 
 import argparse
+import copy
 import os
 import os.path as path
 import re
@@ -24,6 +25,7 @@ from PyJobTransforms.trfSignal import setTrfSignalHandlers, resetTrfSignalHandle
 from PyJobTransforms.trfArgs import addStandardTrfArgs, addFileValidationArguments, addValidationArguments
 from PyJobTransforms.trfLogger import setRootLoggerLevel, stdLogLevels
 from PyJobTransforms.trfArgClasses import trfArgParser, argFile, argHISTFile, argument
+from PyJobTransforms.trfExeStepTools import executorStepSuffix, getTotalExecutorSteps
 from PyJobTransforms.trfExitCodes import trfExit
 from PyJobTransforms.trfUtils import shQuoteStrings, infanticide, pickledDump, JSONDump, cliToKey, convertToStr
 from PyJobTransforms.trfUtils import isInteractiveEnv, calcCpuTime, calcWallTime
@@ -436,6 +438,9 @@ class transform(object):
                             msg.debug('Did not find any argument matching data type {0} - setting to plain argFile: {1}'.format(dataType, self._dataDictionary[dataType]))
                     self._dataDictionary[dataType].name = fileName
 
+            # Do splitting if required
+            self.setupSplitting()
+
             # Now we can set the final executor configuration properly, with the final dataDictionary
             for executor in self._executors:
                 executor.conf.setFromTransform(self)
@@ -517,6 +522,37 @@ class transform(object):
         self._executorGraph = executorGraph(self._executors, self._inputData, self._outputData)
         self._executorGraph.doToposort()
     
+    ## @brief Setup executor splitting
+    def setupSplitting(self):
+        if 'splitConfig' not in self._argdict:
+            return
+
+        split = []
+        for executionStep in self._executorPath:
+            baseStepName = executionStep['name']
+            if baseStepName in split:
+                continue
+
+            baseExecutor = self._executorDictionary[baseStepName]
+            splitting = getTotalExecutorSteps(baseExecutor, argdict=self._argdict)
+            if splitting <= 1:
+                continue
+
+            msg.info('Splitting {0} into {1} substeps'.format(executionStep, splitting))
+            index = self._executorPath.index(executionStep)
+            baseStep = self._executorPath.pop(index)
+            for i in range(splitting):
+                name = baseStepName + executorStepSuffix + str(i)
+                step = copy.deepcopy(baseStep)
+                step['name'] = name
+                self._executorPath.insert(index + i, step)
+                executor = copy.deepcopy(baseExecutor)
+                executor.name = name
+                executor.conf.executorStep = i
+                executor.conf.totalExecutorSteps = splitting
+                self._executors.add(executor)
+                self._executorDictionary[name] = executor
+                split.append(name)
     
     ## @brief Trace the path through the executor graph
     #  @note This function might need to be called again when the number of 'substeps' is unknown
diff --git a/Tools/PyJobTransforms/python/trfArgClasses.py b/Tools/PyJobTransforms/python/trfArgClasses.py
index 5b6c6f97b3a8..80cb57a6b7a5 100644
--- a/Tools/PyJobTransforms/python/trfArgClasses.py
+++ b/Tools/PyJobTransforms/python/trfArgClasses.py
@@ -20,6 +20,7 @@ import PyJobTransforms.trfExceptions as trfExceptions
 
 from PyJobTransforms.trfFileUtils import athFileInterestingKeys, AthenaLiteFileInfo, NTUPEntries, HISTEntries, PRWEntries, urlType, ROOTGetSize
 from PyJobTransforms.trfUtils import call
+from PyJobTransforms.trfExeStepTools import commonExecutorStepName
 from PyJobTransforms.trfExitCodes import trfExit as trfExit
 from PyJobTransforms.trfDecorators import timelimited
 from PyJobTransforms.trfAMI import getAMIClient
@@ -1928,7 +1929,9 @@ class argSubstep(argument):
             name = exe.name
             substep = exe.substep
             first = exe.conf.firstExecutor
-            
+
+        name = commonExecutorStepName(name)
+
         value = None
         ## @note First we see if we have an explicit name or substep match, then a special 'first' or 'default' match
         if name in self._value:
diff --git a/Tools/PyJobTransforms/python/trfArgs.py b/Tools/PyJobTransforms/python/trfArgs.py
index f3756915350e..bd7c4bd2256c 100644
--- a/Tools/PyJobTransforms/python/trfArgs.py
+++ b/Tools/PyJobTransforms/python/trfArgs.py
@@ -79,6 +79,9 @@ def addAthenaArguments(parser, maxEventsDefaultSubstep='first', addValgrind=True
                         metavar='substep:POSTINCLUDE',
                         help='Python configuration fragment to include after main job options (can be optionally limited ' 
                         'to a single substep). Will split on commas: frag1.py,frag2.py is understood.')
+    parser.add_argument('--splitConfig', group = 'Athena', type=argFactory(trfArgClasses.argSubstepString),
+                        metavar='substep:SPLITCONFIG',
+                        help='Configuration file to internally split job into multiple parts (can be optionally limited to a single substep)')
     parser.add_argument('--maxEvents', group='Athena', type=argFactory(trfArgClasses.argSubstepInt, defaultSubstep=maxEventsDefaultSubstep), 
                         nargs='+', metavar='substep:maxEvents',
                         help='Set maximum events for each processing step (default substep is "{0}")'.format(maxEventsDefaultSubstep))
diff --git a/Tools/PyJobTransforms/python/trfExe.py b/Tools/PyJobTransforms/python/trfExe.py
index 1051be1aac63..ee0e080b918d 100755
--- a/Tools/PyJobTransforms/python/trfExe.py
+++ b/Tools/PyJobTransforms/python/trfExe.py
@@ -26,6 +26,7 @@ from PyJobTransforms.trfJobOptions import JobOptionsTemplate
 from PyJobTransforms.trfUtils import asetupReport, asetupReleaseIsOlderThan, unpackDBRelease, setupDBRelease, \
     cvmfsDBReleaseCheck, forceToAlphaNum, \
     ValgrindCommand, isInteractiveEnv, calcCpuTime, calcWallTime, analytic, reportEventsPassedSimFilter
+from PyJobTransforms.trfExeStepTools import commonExecutorStepName, executorStepSuffix
 from PyJobTransforms.trfExitCodes import trfExit
 from PyJobTransforms.trfLogger import stdLogLevels
 from PyJobTransforms.trfMPTools import detectAthenaMPProcs, athenaMPOutputHandler
@@ -64,7 +65,9 @@ class executorConfig(object):
         self._argdict = argdict
         self._dataDictionary = dataDictionary
         self._firstExecutor = firstExecutor
-       
+        self._executorStep = -1
+        self._totalExecutorSteps = 0
+
     @property
     def argdict(self):
         return self._argdict
@@ -88,7 +91,23 @@ class executorConfig(object):
     @firstExecutor.setter
     def firstExecutor(self, value):
         self._firstExecutor = value
-        
+
+    @property
+    def executorStep(self):
+        return self._executorStep
+
+    @executorStep.setter
+    def executorStep(self, value):
+        self._executorStep = value
+
+    @property
+    def totalExecutorSteps(self):
+        return self._totalExecutorSteps
+
+    @totalExecutorSteps.setter
+    def totalExecutorSteps(self, value):
+        self._totalExecutorSteps = value
+
     ## @brief Set configuration properties from the parent transform
     #  @note  It's not possible to set firstExecutor here as the transform holds
     #  the name of the first executor, which we don't know... (should we?)
@@ -190,7 +209,11 @@ class transformExecutor(object):
     @property
     def name(self):
         return self._name
-    
+
+    @name.setter
+    def name(self, value):
+        self._name = value
+
     @property
     def substep(self):
         if '_substep' in dir(self):
@@ -981,7 +1004,17 @@ class athenaExecutor(scriptExecutor):
                 msg.info("Disabling AthenaMP as number of input events to process is too low ({0} events for {1} workers)".format(expectedEvents, self._athenaMP))
                 self._disableMP = True
                 self._athenaMP = 0
-            
+
+        # Handle executor steps
+        if self.conf.totalExecutorSteps > 1:
+            for dataType in output:
+                if self.conf._dataDictionary[dataType].originalName:
+                    self.conf._dataDictionary[dataType].value[0] = self.conf._dataDictionary[dataType].originalName
+                else:
+                    self.conf._dataDictionary[dataType].originalName = self.conf._dataDictionary[dataType].value[0]
+                self.conf._dataDictionary[dataType].value[0] += "_{0}{1}".format(executorStepSuffix, self.conf.executorStep)
+                msg.info("Updated athena output filename for {0} to {1}".format(dataType, self.conf._dataDictionary[dataType].value[0]))
+
         # And if this is (still) athenaMP, then set some options for workers and output file report
         if self._athenaMP:
             self._athenaMPWorkerTopDir = 'athenaMP-workers-{0}-{1}'.format(self._name, self._substep)
@@ -1021,7 +1054,8 @@ class athenaExecutor(scriptExecutor):
             # so that the mother process output file (if it exists) can be used directly
             # as soft linking can lead to problems in the PoolFileCatalog (see ATLASJT-317)
             for dataType in output:
-                self.conf._dataDictionary[dataType].originalName = self.conf._dataDictionary[dataType].value[0]
+                if self.conf.totalExecutorSteps <= 1:
+                    self.conf._dataDictionary[dataType].originalName = self.conf._dataDictionary[dataType].value[0]
                 if 'eventService' not in self.conf.argdict or 'eventService' in self.conf.argdict and self.conf.argdict['eventService'].value is False:
                     if 'sharedWriter' in self.conf.argdict and self.conf.argdict['sharedWriter'].value:
                         msg.info("SharedWriter: not updating athena output filename for {0}".format(dataType))
@@ -1040,12 +1074,13 @@ class athenaExecutor(scriptExecutor):
             outputFiles = dict()
             for dataType in output:
                 outputFiles[dataType] = self.conf.dataDictionary[dataType]
-                
+
             # See if we have any 'extra' file arguments
+            nameForFiles = commonExecutorStepName(self._name)
             for dataType, dataArg in self.conf.dataDictionary.items():
-                if dataArg.io == 'input' and self._name in dataArg.executor:
+                if dataArg.io == 'input' and nameForFiles in dataArg.executor:
                     inputFiles[dataArg.subtype] = dataArg
-                
+
             msg.debug('Input Files: {0}; Output Files: {1}'.format(inputFiles, outputFiles))
             
             # Get the list of top options files that will be passed to athena (=runargs file + all skeletons)
@@ -1105,8 +1140,34 @@ class athenaExecutor(scriptExecutor):
     def postExecute(self):
         super(athenaExecutor, self).postExecute()
 
+        # Handle executor substeps
+        if self.conf.totalExecutorSteps > 1:
+            if self._athenaMP:
+                outputDataDictionary = dict([ (dataType, self.conf.dataDictionary[dataType]) for dataType in self._output ])
+                athenaMPOutputHandler(self._athenaMPFileReport, self._athenaMPWorkerTopDir, outputDataDictionary, self._athenaMP, False, self.conf.argdict)
+            if self.conf.executorStep == self.conf.totalExecutorSteps - 1:
+                # first loop over datasets for the output
+                for dataType in self._output:
+                    newValue = []
+                    if self._athenaMP:
+                        # assume the same number of workers all the time
+                        for i in range(self.conf.totalExecutorSteps):
+                            for v in self.conf.dataDictionary[dataType].value:
+                                newValue.append(v.replace('_{0}{1}_'.format(executorStepSuffix, self.conf.executorStep),
+                                                          '_{0}{1}_'.format(executorStepSuffix, i)))
+                    else:
+                        self.conf.dataDictionary[dataType].multipleOK = True
+                        # just combine all executors
+                        for i in range(self.conf.totalExecutorSteps):
+                            newValue.append(self.conf.dataDictionary[dataType].originalName + '_{0}{1}'.format(executorStepSuffix, i))
+                    self.conf.dataDictionary[dataType].value = newValue
+
+                    # do the merging if needed
+                    if self.conf.dataDictionary[dataType].io == "output" and len(self.conf.dataDictionary[dataType].value) > 1:
+                        self._smartMerge(self.conf.dataDictionary[dataType])
+
         # If this was an athenaMP run then we need to update output files
-        if self._athenaMP:
+        elif self._athenaMP:
             outputDataDictionary = dict([ (dataType, self.conf.dataDictionary[dataType]) for dataType in self._output ])
             ## @note Update argFile values to have the correct outputs from the MP workers
             skipFileChecks=False
@@ -1262,8 +1323,9 @@ class athenaExecutor(scriptExecutor):
         # Find options for the current substep. Name is prioritised (e.g. RAWtoESD) over alias (e.g. r2e). Last look for 'all'
         currentSubstep = None
         if 'athenaopts' in self.conf.argdict:
-            if self.name in self.conf.argdict['athenaopts'].value:
-                currentSubstep = self.name
+            currentName = commonExecutorStepName(self.name)
+            if currentName in self.conf.argdict['athenaopts'].value:
+                currentSubstep = currentName
                 if self.substep in self.conf.argdict['athenaopts'].value:
                     msg.info('Athenaopts found for {0} and {1}, joining options. '
                              'Consider changing your configuration to use just the name or the alias of the substep.'
diff --git a/Tools/PyJobTransforms/python/trfExeStepTools.py b/Tools/PyJobTransforms/python/trfExeStepTools.py
new file mode 100644
index 000000000000..463d8911ad7a
--- /dev/null
+++ b/Tools/PyJobTransforms/python/trfExeStepTools.py
@@ -0,0 +1,71 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+
+executorStepSuffix = 'ExecutorStep'
+
+
+def commonExecutorStepName(name):
+    """Remove executor step suffix from executor name."""
+    if executorStepSuffix in name:
+        name, _sep, _tail = name.rpartition(executorStepSuffix)
+    return name
+
+
+def loadSplitConfig(config):
+    """Load splitting configuration from file."""
+    parts = config.split('.')
+    if len(parts) < 2:
+        raise ValueError('Splitting config should be of the form Package.Module.Function or Package.Function if defined in __init__.py')
+
+    function = parts[-1]
+    module = '.'.join(parts[:-1])
+
+    from importlib import import_module
+    loaded_module = import_module(module)
+    function_def = getattr(loaded_module, function)
+    return function_def()
+
+
+def getTotalExecutorSteps(executor, argdict=None):
+    """Get total executor steps from executor."""
+    if not argdict:
+        argdict = executor.conf.argdict
+    if 'splitConfig' not in argdict:
+        return 0
+
+    splitConfig = argdict['splitConfig'].returnMyValue(exe=executor)
+    if not splitConfig:
+        return 0
+
+    steps, fractions = loadSplitConfig(splitConfig)
+    return steps
+
+
+def getExecutorStepEventCounts(executor, argdict=None):
+    """Get executor step event counts from executor config."""
+    if not argdict:
+        argdict = executor.conf.argdict
+    if 'splitConfig' not in argdict:
+        return []
+
+    maxEvents = argdict['maxEvents'].returnMyValue(exe=executor)
+    skipEvents = argdict['skipEvents'].returnMyValue(exe=executor)
+    splitConfig = argdict['splitConfig'].returnMyValue(exe=executor)
+    if not splitConfig:
+        return []
+
+    steps, fractions = loadSplitConfig(splitConfig)
+
+    if sum(fractions) != 1:
+        raise ValueError('Event fractions should total to 1!')
+
+    counts = []
+    for i in range(len(fractions) - 1):
+        counts.append(round(maxEvents * fractions[i]))
+    counts.append(maxEvents - sum(counts))
+
+    sums = []
+    for i in range(len(fractions)):
+        sums.append(skipEvents + sum(counts[:i]))
+
+    return counts, sums
diff --git a/Tools/PyJobTransforms/python/trfJobOptions.py b/Tools/PyJobTransforms/python/trfJobOptions.py
index ba10d6d1778a..6e898353908c 100644
--- a/Tools/PyJobTransforms/python/trfJobOptions.py
+++ b/Tools/PyJobTransforms/python/trfJobOptions.py
@@ -15,6 +15,7 @@ msg = logging.getLogger(__name__)
 
 import PyJobTransforms.trfArgClasses as trfArgClasses
 import PyJobTransforms.trfExceptions as trfExceptions
+from PyJobTransforms.trfExeStepTools import getExecutorStepEventCounts
 from PyJobTransforms.trfExitCodes import trfExit
 
 from PyJobTransforms.trfUtils import findFile
@@ -208,6 +209,21 @@ class JobOptionsTemplate(object):
                         print(f"AthenaMPJobProps.AthenaMPFlags.UseSharedWriter={self._exe.conf.argdict['sharedWriter'].value}", file=runargsFile)
                     if 'parallelCompression' in self._exe.conf.argdict:
                         print(f"AthenaMPJobProps.AthenaMPFlags.UseParallelCompression={self._exe.conf.argdict['parallelCompression'].value}", file=runargsFile)
+
+                # Executor substeps
+                print(os.linesep, '# Executor flags', file=runargsFile)
+                msg.debug('Adding runarg {0!s}={1!r}'.format('totalExecutorSteps', self._exe.conf.totalExecutorSteps))
+                print('{0}.{1!s} = {2!r}'.format(self._runArgsName, 'totalExecutorSteps', self._exe.conf.totalExecutorSteps), file=runargsFile)
+                if self._exe.conf.executorStep >= 0:
+                    msg.debug('Adding runarg {0!s}={1!r}'.format('executorStep', self._exe.conf.executorStep))
+                    print('{0}.{1!s} = {2!r}'.format(self._runArgsName, 'executorStep', self._exe.conf.executorStep), file=runargsFile)
+                    executorEventCounts, executorEventSkips = getExecutorStepEventCounts(self._exe)
+                    msg.debug('Adding runarg {0!s}={1!r}'.format('executorEventCounts', executorEventCounts))
+                    print('{0}.{1!s} = {2!r}'.format(self._runArgsName, 'executorEventCounts', executorEventCounts), file=runargsFile)
+                    msg.debug('Adding runarg {0!s}={1!r}'.format('executorEventSkips', executorEventSkips))
+                    print('{0}.{1!s} = {2!r}'.format(self._runArgsName, 'executorEventSkips', executorEventSkips), file=runargsFile)
+
+                # CA
                 if self._exe._isCAEnabled():
                     print(os.linesep, '# Threading flags', file=runargsFile)
                     #Pass the number of threads
@@ -223,7 +239,7 @@ class JobOptionsTemplate(object):
                     print('fromRunArgs({0})'.format(self._runArgsName),file=runargsFile)
 
                 msg.info('Successfully wrote runargs file {0}'.format(self._runArgsFile))
-                
+
             except (IOError, OSError) as e:
                 errMsg = 'Got an error when writing JO template {0}: {1}'.format(self._runArgsFile, e)
                 msg.error(errMsg)
@@ -251,7 +267,9 @@ class JobOptionsTemplate(object):
     #  @param input Input file list
     #  @param output Output file list
     #  @return List of runargs and skeletons to be processed by athena
-    def getTopOptions(self, input = dict(), output = dict()): 
+    def getTopOptions(self, input = dict(), output = dict()):
+        # Update the output name
+        self._runArgsFile = 'runargs.' + self._exe.name + '.py'
         # First Make the runArgs file:
         self.writeRunArgs(input = input, output = output)
         # Make sure runArgs and skeleton are valid
diff --git a/Tools/PyJobTransforms/python/trfMPTools.py b/Tools/PyJobTransforms/python/trfMPTools.py
index 926816bde4ed..125f47696cc8 100644
--- a/Tools/PyJobTransforms/python/trfMPTools.py
+++ b/Tools/PyJobTransforms/python/trfMPTools.py
@@ -16,6 +16,7 @@ msg = logging.getLogger(__name__)
 
 from xml.etree import ElementTree
 
+from PyJobTransforms.trfExeStepTools import commonExecutorStepName
 from PyJobTransforms.trfExitCodes import trfExit
 
 import PyJobTransforms.trfExceptions as trfExceptions
@@ -25,6 +26,7 @@ import PyJobTransforms.trfExceptions as trfExceptions
 #  @return Integer with the number of processes, N.B. 0 means non-MP serial mode
 def detectAthenaMPProcs(argdict = {}, currentSubstep = '', legacyThreadingRelease = False):
     athenaMPProcs = 0
+    currentSubstep = commonExecutorStepName(currentSubstep)
     
     # Try and detect if any AthenaMP has been enabled 
     try:
diff --git a/Tools/PyJobTransforms/python/trfMTTools.py b/Tools/PyJobTransforms/python/trfMTTools.py
index c025e04c9860..1b476b75f8f1 100644
--- a/Tools/PyJobTransforms/python/trfMTTools.py
+++ b/Tools/PyJobTransforms/python/trfMTTools.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
 
 ## @package PyJobTransforms.trfMTTools
 #
@@ -12,6 +12,7 @@ import os
 import logging
 msg = logging.getLogger(__name__)
 
+from PyJobTransforms.trfExeStepTools import commonExecutorStepName
 from PyJobTransforms.trfExitCodes import trfExit
 
 import PyJobTransforms.trfExceptions as trfExceptions
@@ -22,6 +23,7 @@ import PyJobTransforms.trfExceptions as trfExceptions
 def detectAthenaMTThreads(argdict = {}, currentSubstep = '', legacyThreadingRelease = False):
     athenaMTThreads = 0
     athenaConcurrentEvents = 0
+    currentSubstep = commonExecutorStepName(currentSubstep)
 
     if legacyThreadingRelease:
         return athenaMTThreads, athenaConcurrentEvents
diff --git a/Tools/PyJobTransforms/python/trfValidation.py b/Tools/PyJobTransforms/python/trfValidation.py
index 9545c52c6511..238507b896ec 100644
--- a/Tools/PyJobTransforms/python/trfValidation.py
+++ b/Tools/PyJobTransforms/python/trfValidation.py
@@ -22,6 +22,7 @@ msg = logging.getLogger(__name__)
 
 from PyUtils import RootUtils
 
+from PyJobTransforms.trfExeStepTools import getExecutorStepEventCounts
 from PyJobTransforms.trfExitCodes import trfExit
 from PyJobTransforms.trfLogger import stdLogLevels
 from PyJobTransforms.trfArgClasses import argFile
@@ -989,6 +990,12 @@ class eventMatch(object):
             else:
                 self._maxEvents = None
 
+            # Executor substeps handling
+            if self._executor.conf.totalExecutorSteps > 1 and self._executor.conf.executorStep < self._executor.conf.totalExecutorSteps - 1:
+                executorEventCounts, executorEventSkips = getExecutorStepEventCounts(self._executor)
+                self._maxEvents = executorEventCounts[self._executor.conf.executorStep]
+                self._skipEvents = executorEventSkips[self._executor.conf.executorStep]
+
             # Global eventAcceptanceEfficiency set?
             if "eventAcceptanceEfficiency" in self._executor.conf.argdict:
                 self._evAccEff = self._executor.conf.argdict['eventAcceptanceEfficiency'].returnMyValue(exe=self._executor)
-- 
GitLab


From 85f67b079a7d981195848c1dc449d46b8df52c58 Mon Sep 17 00:00:00 2001
From: Peter Berta <peter.berta@cern.ch>
Date: Tue, 14 Sep 2021 13:03:19 +0200
Subject: [PATCH 101/347] Merge branch 'propagat_TE_data' into '22.0-mc20'

[ATR-24058][ATR-24141] Working to add R2 trigger TE data to R3 JSON structure to enable feature access from R22 AODs created from R2 data

See merge request atlas/athena!46419

(cherry picked from commit 8944255495157e07876c404f2f27a012e17505b8)

6a3c59d7 working to add R2 TE data to R3 JSON structure
b9133381 Add standalone signatures data
86dc0214 do not copy seq list, causes segfault on destruct
f09bf609 Change RAWtoALL/ESD/AOD slimming of R2 trigger navigation structures. Remove...
---
 .../share/TrigDecTool_jobOptions.py           |  23 ++-
 .../TrigConfIO/src/JsonFileWriterHLT.cxx      |  46 ++++++
 .../src/test/Run2toRun3ConvertersHLT.cxx      |  55 +++++++
 .../TrigConfxAOD/Root/prepareTriggerMenu.cxx  | 151 +++++++++++++-----
 .../TrigNavTools/python/TrigNavToolsConfig.py |   2 +
 .../python/HLTTriggerResultGetter.py          |   5 +-
 6 files changed, 228 insertions(+), 54 deletions(-)

diff --git a/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py b/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py
index c6abfcbd234a..c348dd10f752 100644
--- a/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py
+++ b/Control/AthenaMonitoring/share/TrigDecTool_jobOptions.py
@@ -20,20 +20,15 @@ if DQMonFlags.useTrigger():
          from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
          cfg = TriggerConfigGetter()
 
-   if not hasattr(ToolSvc, DQMonFlags.nameTrigDecTool().split('/')[-1]):
-      if rec.doTrigger():
-         tdt_local_logger.error('DQ Monitoring is being asked to set up the TrigDecisionTool for some reason.  THIS IS A TERRIBLE IDEA AND SHOULD BE CONSIDERED A BUG!')
-      from AthenaMonitoring.TriggerInterface import getTrigDecisionTool
-      from AthenaConfiguration.OldFlags2NewFlags import getNewConfigFlags
-      # Translate all needed flags from old jobProperties to a new AthConfigFlag Container
-      ConfigFlags = getNewConfigFlags()
-
-      from AthenaConfiguration import ComponentAccumulator
-      ComponentAccumulator.CAtoGlobalWrapper(getTrigDecisionTool, ConfigFlags)
-
-      monTrigDecTool = getattr(ToolSvc, 'TrigDecisionTool')
-   else:
-      monTrigDecTool = getattr(ToolSvc, DQMonFlags.nameTrigDecTool().split('/')[-1])
+   from AthenaCommon.Configurable import Configurable
+   Configurable.configurableRun3Behavior+=1
+   from TrigDecisionTool.TrigDecisionToolConfig import getTrigDecisionTool 
+   tdtAcc = getTrigDecisionTool(ConfigFlags)
+   Configurable.configurableRun3Behavior-=1
+
+   from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable, appendCAtoAthena
+   monTrigDecTool = conf2toConfigurable(tdtAcc.getPrimary())
+   appendCAtoAthena( tdtAcc )
    tdt_local_logger.info('Scheduled monitoring TDT %s', monTrigDecTool)
 
    tdt_local_logger.info('Scheduling the trigger translator')
diff --git a/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileWriterHLT.cxx b/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileWriterHLT.cxx
index eb1a38ac4df2..afe0b97cd363 100644
--- a/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileWriterHLT.cxx
+++ b/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileWriterHLT.cxx
@@ -18,9 +18,36 @@ TrigConf::JsonFileWriterHLT::JsonFileWriterHLT() :
 {}
 
 
+/// Helper function ptree key->[] to std::vector<T>
+template<typename T>
+std::vector<T> ToVector(const TrigConf::DataStructure& ds, const std::string& child){
+   using ptree = boost::property_tree::ptree;
+   std::vector<T> return_vector;
+   for( const ptree::value_type& entry : ds.data().get_child(child) ) {
+      return_vector.push_back( entry.second.get_value<T>() );
+   }
+   return return_vector;
+}
+
+/// Helper function ptree key->[[]] to std::vector<std::vector<T>>
+template<typename T>
+std::vector<std::vector<T>> ToVectorVector(const TrigConf::DataStructure& ds, const std::string& child){
+   using ptree = boost::property_tree::ptree;
+   std::vector<std::vector<T>> return_vector;
+   for( const ptree::value_type& outer : ds.data().get_child(child) ) {
+      return_vector.push_back(std::vector<T>());
+      for (const ptree::value_type& inner : outer.second) {
+         return_vector.back().push_back( inner.second.get_value<T>() );
+      }
+   }
+   return return_vector;
+}
+
+
 bool
 TrigConf::JsonFileWriterHLT::writeJsonFile(const std::string & filename, const HLTMenu & menu) const
 {
+   using ptree = boost::property_tree::ptree;
    json chains({});
    for ( const auto & chain : menu ) {
       json jChain({});
@@ -32,6 +59,17 @@ TrigConf::JsonFileWriterHLT::writeJsonFile(const std::string & filename, const H
       jChain["groups"] = chain.groups();
       jChain["streams"] = chain.streams();
       jChain["seqeuncers"] = chain.sequencers();
+
+      // Optional Run2 payload
+      if (chain.hasChild("signature")) {
+         json jSig({});
+         jSig["counters"] = ToVector<uint32_t>(chain, "signature.counters");
+         jSig["logics"] = ToVector<int>(chain, "signature.logics");
+         jSig["labels"] = ToVector<std::string>(chain, "signature.labels");
+         jSig["outputTEs"] = ToVectorVector<std::string>(chain, "signature.outputTEs");
+         jChain["signature"] = jSig;
+      }
+
       chains[chain.name()] = jChain;
    }
 
@@ -58,6 +96,14 @@ TrigConf::JsonFileWriterHLT::writeJsonFile(const std::string & filename, const H
    j["sequencers"] = sequencers;
    j["streams"] = streams;
 
+   // Optional Run2 payload
+   if (menu.hasChild("sequence_run2")) {
+      json jSequence({});
+      jSequence["outputTEs"] = ToVector<std::string>(menu, "sequence_run2.outputTEs");
+      jSequence["inputTEs"] = ToVectorVector<std::string>(menu, "sequence_run2.inputTEs");
+      jSequence["algorithms"] = ToVectorVector<std::string>(menu, "sequence_run2.algorithms");
+      j["sequence_run2"] = jSequence;
+   }
 
    std::ofstream outfile(filename);
    outfile << std::setw(4) << j << std::endl;
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/test/Run2toRun3ConvertersHLT.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/test/Run2toRun3ConvertersHLT.cxx
index 4fb708f85cd7..8ff5ce4f87ce 100644
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/test/Run2toRun3ConvertersHLT.cxx
+++ b/Trigger/TrigConfiguration/TrigConfStorage/src/test/Run2toRun3ConvertersHLT.cxx
@@ -81,6 +81,35 @@ bool convertHLTMenu(const TrigConf::HLTFrame* frame, TrigConf::HLTMenu& menu) {
 
       pChain.add_child("groups", asArray(cptr->groups()));
 
+      // Signature data
+      // Note: This is run-2 only.
+      // It is propagated here to allow legacy trigger feature access.
+      std::vector<uint32_t> counters;
+      std::vector<int> logics;
+      std::vector<std::string> labels;
+      ptree outputTEs_outerArray; // outputTEs is a std::vector<std::vector<std::string>>
+
+      for(auto& signature : cptr->signatureList() ){
+         uint32_t cntr = signature->signature_counter();
+         counters.push_back(cntr);
+         logics.push_back(signature->logic());
+         labels.push_back(signature->label());
+         ptree outputTEs_innerArray;
+         for(auto& outputTE : signature->outputTEs()){
+            outputTEs_innerArray.push_back( ptree::value_type("", outputTE->name()) );
+         }
+         outputTEs_outerArray.push_back( ptree::value_type("", outputTEs_innerArray) );
+      }
+
+      ptree pSig; 
+      pSig.add_child("counters", asArray(counters));
+      pSig.add_child("logics", asArray(logics));
+      pSig.add_child("outputTEs", outputTEs_outerArray);
+      pSig.add_child("labels", asArray(labels));
+
+      pChain.add_child("signature", pSig);
+      // End of signature data
+
       pChains.push_back(std::make_pair(cptr->chain_name(), pChain));
    }
    ptree pStreams;
@@ -100,6 +129,32 @@ bool convertHLTMenu(const TrigConf::HLTFrame* frame, TrigConf::HLTMenu& menu) {
    pSequencers.add_child("missing", asArray(std::vector<std::string>({""})));
    top.add_child("sequencers", pSequencers);
 
+   // Set run2 sequence information:
+   const TrigConf::HLTSequenceList& sequenceList = frame->getHLTSequenceList();
+   std::vector<std::string> outputTEs;
+   ptree inputTEs_outerArray;  // sequenceInputTEs is a std::vector<std::vector<std::string>>
+   ptree algorithms_outerArray;  // sequenceAlgorithms is a std::vector<std::vector<std::string>>
+   for(auto& seq : sequenceList){
+      outputTEs.push_back(seq->outputTE()->name());
+
+      ptree inputTEs_innerArray;
+      for(auto& input : seq->inputTEs()) {
+         inputTEs_innerArray.push_back( ptree::value_type("", input->name()) );
+      }
+      inputTEs_outerArray.push_back( ptree::value_type("", inputTEs_innerArray) );
+
+      ptree algorithms_innerArray;
+      for(const std::string& alg : seq->algorithms()) {
+         algorithms_innerArray.push_back( ptree::value_type("", alg) );
+      }
+      algorithms_outerArray.push_back( ptree::value_type("", algorithms_innerArray) );
+   }
+   ptree pSequence;
+   pSequence.add_child("outputTEs", asArray(outputTEs));
+   pSequence.add_child("inputTEs", inputTEs_outerArray);
+   pSequence.add_child("algorithms", algorithms_outerArray);
+   top.add_child("sequence_run2", pSequence);
+
    menu.setData(std::move(top));
    menu.setSMK(frame->smk());
    return true;
diff --git a/Trigger/TrigConfiguration/TrigConfxAOD/Root/prepareTriggerMenu.cxx b/Trigger/TrigConfiguration/TrigConfxAOD/Root/prepareTriggerMenu.cxx
index 2653c3bc03ed..59346e632f5f 100644
--- a/Trigger/TrigConfiguration/TrigConfxAOD/Root/prepareTriggerMenu.cxx
+++ b/Trigger/TrigConfiguration/TrigConfxAOD/Root/prepareTriggerMenu.cxx
@@ -253,6 +253,32 @@ namespace TrigConf {
       return StatusCode::SUCCESS;
    }
 
+
+   /// Helper function ptree key->[] to std::vector<T>
+   template<typename T>
+   std::vector<T> ToVector(const TrigConf::DataStructure& ds, const std::string& child){
+      using ptree = boost::property_tree::ptree;
+      std::vector<T> return_vector;
+      for( const ptree::value_type& entry : ds.data().get_child(child) ) {
+         return_vector.push_back( entry.second.get_value<T>() );
+      }
+      return return_vector;
+   }
+
+   /// Helper function ptree key->[[]] to std::vector<std::vector<T>>
+   template<typename T>
+   std::vector<std::vector<T>> ToVectorVector(const TrigConf::DataStructure& ds, const std::string& child){
+      using ptree = boost::property_tree::ptree;
+      std::vector<std::vector<T>> return_vector;
+      for( const ptree::value_type& outer : ds.data().get_child(child) ) {
+         return_vector.push_back(std::vector<T>());
+         for (const ptree::value_type& inner : outer.second) {
+            return_vector.back().push_back( inner.second.get_value<T>() );
+         }
+      }
+      return return_vector;
+   }
+
    /// Load JSON derived data into legacy structures to maintain 
    /// compatiblity with existing code.
    ///
@@ -315,46 +341,75 @@ namespace TrigConf {
       // Fill the HLT configuration:
       if (loadedHlt.isInitialized()) {
          for (const Chain& loadedChain : loadedHlt) {
-             // Figure out which level this chain is from:
-             std::string level = "";
-             if( loadedChain.name().find( "L2_" ) == 0 ) {
-                level = "L2";
-             } else if( loadedChain.name().find( "EF_" ) == 0 ) {
-                level = "EF";
-             } else if( loadedChain.name().find( "HLT_" ) == 0 ) {
-                level = "HLT";
-             } else {
-                msg << MSG::WARNING << "prepareTriggerMenu(...): "
-                    << "Couldn't figure out 'level' for chain: "
-                    << loadedChain.name() << endmsg;
-             }
-             // An empty signature list for the chain:
-             // This is not populated from JSON data
-             std::vector< HLTSignature* > signatures;
+            // Figure out which level this chain is from:
+            std::string level = "";
+            if( loadedChain.name().find( "L2_" ) == 0 ) {
+               level = "L2";
+            } else if( loadedChain.name().find( "EF_" ) == 0 ) {
+               level = "EF";
+            } else if( loadedChain.name().find( "HLT_" ) == 0 ) {
+               level = "HLT";
+            } else {
+               msg << MSG::WARNING << "prepareTriggerMenu(...): "
+                   << "Couldn't figure out 'level' for chain: "
+                   << loadedChain.name() << endmsg;
+            }
+
+            // An empty signature list for the chain:
+            std::vector< HLTSignature* > signatures;
+
+            // Optional Run2 payload
+            std::vector<uint32_t> counters;
+            std::vector<int> logics;
+            std::vector<std::vector<std::string>> outputTEs;
+            if (loadedChain.hasChild("signature")) {
+               counters = ToVector<uint32_t>(loadedChain, "signature.counters");
+               logics = ToVector<int>(loadedChain, "signature.logics");
+               outputTEs = ToVectorVector<std::string>(loadedChain, "signature.outputTEs");
+            }
+
+            if( msg.level() <= MSG::VERBOSE ) {
+               msg << MSG::VERBOSE << "chain " << loadedChain.name()
+                   << " has counter " << loadedChain.counter()
+                   << " and " << counters.size() << " signatures (runs 1,2 only)" << endmsg;
+            }
+
+            for( size_t sig = 0; sig < counters.size(); ++sig ) {
+               std::vector< HLTTriggerElement* > outTEs;
+               for( size_t outTEcounter = 0; outTEcounter< outputTEs[ sig ].size(); ++outTEcounter ) {
+                  HLTTriggerElement* element = new HLTTriggerElement( outputTEs[ sig ][ outTEcounter ] );
+                  outTEs.push_back( element );
+               }
+               HLTSignature* signature = new HLTSignature( counters[ sig ], logics[ sig ], outTEs );
+               signatures.push_back( signature );
+               if( msg.level() <= MSG::VERBOSE ) {
+                  msg << MSG::VERBOSE << "prepared signature: " << *( signatures.back() ) << endmsg;
+               }
+            }
  
-             // Create the chain object:
-             HLTChain* chain = new HLTChain( loadedChain.name(),
-                                             loadedChain.counter(),
-                                             1, // Chain version not important
-                                             level,
-                                             loadedChain.l1item(), // L1 seeds (string)
-                                             -1, // Lower chain ID not important
-                                             signatures ); // Note: Empty
+            // Create the chain object:
+            HLTChain* chain = new HLTChain( loadedChain.name(),
+                                            loadedChain.counter(),
+                                            1, // Chain version not important
+                                            level,
+                                            loadedChain.l1item(), // L1 seeds (string)
+                                            -1, // Lower chain ID not important
+                                            signatures ); // Empty for R3 JSONs
  
-             chain->set_rerun_prescale( -1.0 ); // Not used in R3
-             chain->set_pass_through( -1.0 );  // Not used in R3
-             chain->set_leg_multiplicities( loadedChain.legMultiplicities() );
-
-             for (const std::string& group : loadedChain.groups()){
-                chain->addGroup(group);
-             }
-
-             if (loadedHltps.isInitialized()) {
-                const HLTPrescalesSet::HLTPrescale& loadedPrescale = loadedHltps.prescale( loadedChain.name() );
-                chain->set_prescale( loadedPrescale.prescale );
-             } else {
-                chain->set_prescale( 0 );
-             }
+            chain->set_rerun_prescale( -1.0 ); // Not used in R3
+            chain->set_pass_through( -1.0 );  // Not used in R3
+            chain->set_leg_multiplicities( loadedChain.legMultiplicities() );
+
+            for (const std::string& group : loadedChain.groups()){
+               chain->addGroup(group);
+            }
+
+            if (loadedHltps.isInitialized()) {
+               const HLTPrescalesSet::HLTPrescale& loadedPrescale = loadedHltps.prescale( loadedChain.name() );
+               chain->set_prescale( loadedPrescale.prescale );
+            } else {
+               chain->set_prescale( 0 );
+            }
  
             // Add it to the list of chains:
             if( ! chainList.addHLTChain( chain ) ) {
@@ -367,7 +422,25 @@ namespace TrigConf {
          }
       }
 
-      // Do not add sequence info to legacy structures (format is different)
+      // Add sequence information if it's available (R1 or R2 menu):
+      if( loadedHlt.hasChild("sequence_run2") ) {
+         std::vector<std::string> menu_outputTEs = ToVector<std::string>(loadedHlt, "sequence_run2.outputTEs");
+         std::vector<std::vector<std::string>> menu_inputTEs = ToVectorVector<std::string>(loadedHlt, "sequence_run2.inputTEs");
+         std::vector<std::vector<std::string>> menu_algorithms = ToVectorVector<std::string>(loadedHlt, "sequence_run2.algorithms");
+
+         for( size_t i = 0; i< menu_outputTEs.size(); ++i ) {
+            HLTTriggerElement* outputTE = new HLTTriggerElement( menu_outputTEs[ i ] );
+            std::vector< HLTTriggerElement* > inputTEs;
+            for( size_t j = 0; j < menu_inputTEs[ i ].size(); ++j ) {
+               HLTTriggerElement* te = new HLTTriggerElement( menu_inputTEs[ i ][ j ] );
+               inputTEs.push_back( te );
+            }
+            HLTSequence* sequence = new HLTSequence( inputTEs, outputTE, menu_algorithms[ i ] );
+            sequenceList.addHLTSequence( sequence );
+            // This throws a runtime_error if it fails, which we don't need to
+            // handle, since this is a FATAL error anyways.
+         }
+      }
 
       // Bunchgroup data is TODO
       // Create a new BunchGroupSet object, since an existing one can't be
diff --git a/Trigger/TrigEvent/TrigNavTools/python/TrigNavToolsConfig.py b/Trigger/TrigEvent/TrigNavTools/python/TrigNavToolsConfig.py
index 38a25cd47382..f889159b005c 100644
--- a/Trigger/TrigEvent/TrigNavTools/python/TrigNavToolsConfig.py
+++ b/Trigger/TrigEvent/TrigNavTools/python/TrigNavToolsConfig.py
@@ -21,6 +21,8 @@ def navigationThinningSvc (config):
     svc.Actions = [ 'DropFeatures', 'Reload', 'SyncThinning', 'DropChains', 'Save', 'Restore']
   if config['mode'] == 'cleanup':    
     svc.Actions = [ 'DropFeatures', 'Reload', 'SyncThinning', 'Save']
+  if config['mode'] == 'cleanup_noreload':    
+    svc.Actions = [ 'DropFeatures', 'SyncThinning', 'Save']
 
   if 'Print' in svc.Actions:
     from AthenaCommon.Constants import DEBUG
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerResultGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerResultGetter.py
index 75464ade9623..d768b74bde85 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerResultGetter.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerResultGetter.py
@@ -381,7 +381,10 @@ class HLTTriggerResultGetter(Configured):
 
             edmlist = list(y.split('-')[0] for x in edm.values() for y in x) #flatten names
           
-            svc = navigationThinningSvc ({'name':'HLTNav_%s'%stream, 'mode':'cleanup', 
+            # TimM Sep 2021: In MT the 'reload' slimming option in the R2 navigation thinning service was found to be creating
+            # AODs which would crash when trying to return features. We therefore remove this option by using the added 'cleanup_noreload'
+            # configuration, see ATR-24141 for details. 
+            svc = navigationThinningSvc ({'name':'HLTNav_%s'%stream, 'mode':'cleanup_noreload', 
                                           'result':'HLTResult_HLT',
                                           'features':edmlist})
 
-- 
GitLab


From 58af080645213eca097edef3909bd623a9a85b53 Mon Sep 17 00:00:00 2001
From: Johannes Josef Junggeburth <johannes.josef.junggeburth@CERN.CH>
Date: Tue, 14 Sep 2021 16:23:26 +0200
Subject: [PATCH 102/347] Make the MuonCandidateAlg reentrant

---
 .../src/MuonCombinedMuonCandidateAlg.cxx             | 12 ++++++------
 .../src/MuonCombinedMuonCandidateAlg.h               |  8 ++++----
 .../MuonCombinedBaseTools/src/MuonCandidateTool.cxx  |  7 +------
 .../MuonCombinedBaseTools/src/MuonCandidateTool.h    |  3 ---
 .../MuonCombinedToolInterfaces/IMuonCandidateTool.h  |  5 +----
 5 files changed, 12 insertions(+), 23 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedMuonCandidateAlg.cxx b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedMuonCandidateAlg.cxx
index 6e3eee3bc66c..86ddf77e2ed4 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedMuonCandidateAlg.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedMuonCandidateAlg.cxx
@@ -5,7 +5,7 @@
 #include "MuonCombinedMuonCandidateAlg.h"
 
 MuonCombinedMuonCandidateAlg::MuonCombinedMuonCandidateAlg(const std::string& name, ISvcLocator* pSvcLocator) :
-    AthAlgorithm(name, pSvcLocator) {}
+    AthReentrantAlgorithm(name, pSvcLocator) {}
 
 StatusCode MuonCombinedMuonCandidateAlg::initialize() {
     ATH_CHECK(m_muonCandidateTool.retrieve());
@@ -15,9 +15,9 @@ StatusCode MuonCombinedMuonCandidateAlg::initialize() {
     return StatusCode::SUCCESS;
 }
 
-StatusCode MuonCombinedMuonCandidateAlg::execute() {
+StatusCode MuonCombinedMuonCandidateAlg::execute(const EventContext& ctx) const {
     // retrieve MuonSpectrometer tracks
-    SG::ReadHandle<xAOD::TrackParticleContainer> muonTrackParticles(m_muonTrackParticleLocation);
+    SG::ReadHandle<xAOD::TrackParticleContainer> muonTrackParticles(m_muonTrackParticleLocation, ctx);
     if (!muonTrackParticles.isValid()) {
         ATH_MSG_ERROR("Could not read " << m_muonTrackParticleLocation);
         return StatusCode::FAILURE;
@@ -26,11 +26,11 @@ StatusCode MuonCombinedMuonCandidateAlg::execute() {
         ATH_MSG_WARNING(m_muonTrackParticleLocation << " not present");
         return StatusCode::SUCCESS;
     }
-    SG::WriteHandle<MuonCandidateCollection> muonCandidates(m_candidateCollectionName);
+    SG::WriteHandle<MuonCandidateCollection> muonCandidates(m_candidateCollectionName, ctx);
     ATH_CHECK(muonCandidates.record(std::make_unique<MuonCandidateCollection>()));
-    SG::WriteHandle<TrackCollection> msOnlyTracks(m_msOnlyTracks);
+    SG::WriteHandle<TrackCollection> msOnlyTracks(m_msOnlyTracks, ctx);
     ATH_CHECK(msOnlyTracks.record(std::make_unique<TrackCollection>()));
-    m_muonCandidateTool->create(*muonTrackParticles, *muonCandidates, *msOnlyTracks);
+    m_muonCandidateTool->create(*muonTrackParticles, *muonCandidates, *msOnlyTracks,ctx);
 
     return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedMuonCandidateAlg.h b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedMuonCandidateAlg.h
index ed68ef17e889..93c9d4129d7c 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedMuonCandidateAlg.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedMuonCandidateAlg.h
@@ -7,7 +7,7 @@
 
 #include <string>
 
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "MuonCombinedEvent/MuonCandidateCollection.h"
 #include "MuonCombinedToolInterfaces/IMuonCandidateTool.h"
@@ -16,14 +16,14 @@
 #include "TrkTrack/TrackCollection.h"
 #include "xAODTracking/TrackParticleContainer.h"
 
-class MuonCombinedMuonCandidateAlg : public AthAlgorithm {
+class MuonCombinedMuonCandidateAlg : public AthReentrantAlgorithm {
 public:
     MuonCombinedMuonCandidateAlg(const std::string& name, ISvcLocator* pSvcLocator);
 
     ~MuonCombinedMuonCandidateAlg() = default;
 
-    StatusCode initialize();
-    StatusCode execute();
+    StatusCode initialize() override;
+    StatusCode execute(const EventContext& ctx) const override;
 
 private:
     ToolHandle<MuonCombined::IMuonCandidateTool> m_muonCandidateTool{
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx
index f70030fa1704..4b5cba59ba7f 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx
@@ -36,12 +36,7 @@ namespace MuonCombined {
         ATH_CHECK(m_beamSpotKey.initialize());
         return StatusCode::SUCCESS;
     }
-
-    void MuonCandidateTool::create(const xAOD::TrackParticleContainer& tracks, MuonCandidateCollection& outputCollection,
-                                   TrackCollection& outputTracks) const {
-        create(tracks, outputCollection, outputTracks, Gaudi::Hive::currentContext());
-    }
-    void MuonCandidateTool::create(const xAOD::TrackParticleContainer& tracks, MuonCandidateCollection& outputCollection,
+     void MuonCandidateTool::create(const xAOD::TrackParticleContainer& tracks, MuonCandidateCollection& outputCollection,
                                    TrackCollection& outputTracks, const EventContext& ctx) const {
         ATH_MSG_DEBUG("Producing MuonCandidates for " << tracks.size());
         unsigned int ntracks = 0;
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h
index faaa13582815..d15cabba7967 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h
@@ -30,9 +30,6 @@ namespace MuonCombined {
         /**IMuonCandidateTool interface: build a MuonCandidateCollection from a TrackCollection of spectrometer tracks */
         virtual void create(const xAOD::TrackParticleContainer& tracks, MuonCandidateCollection& outputCollection,
                             TrackCollection& outputTracks, const EventContext& ctx) const override;
-        virtual void create(const xAOD::TrackParticleContainer& tracks, MuonCandidateCollection& outputCollection,
-                            TrackCollection& outputTracks) const override;
-
     private:
         ToolHandle<Muon::MuonEDMPrinterTool> m_printer{this, "Printer", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
         ToolHandle<Rec::ICombinedMuonTrackBuilder> m_trackBuilder{this, "TrackBuilder",
diff --git a/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonCandidateTool.h b/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonCandidateTool.h
index 0bcf0e66ed3f..e07730f4909b 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonCandidateTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonCandidateTool.h
@@ -28,10 +28,7 @@ namespace MuonCombined {
         virtual void create(const xAOD::TrackParticleContainer& tracks, MuonCandidateCollection& outputCollection,
                             TrackCollection& outputTracks, const EventContext& ctx) const = 0;
 
-        /// Old method to maintain backwards compabilitiy
-        virtual void create(const xAOD::TrackParticleContainer& tracks, MuonCandidateCollection& outputCollection,
-                            TrackCollection& outputTracks) const = 0;
-
+       
         virtual ~IMuonCandidateTool() = default;
     };
 
-- 
GitLab


From 845ca103fa3715888a3549effbbced7378486a1f Mon Sep 17 00:00:00 2001
From: Patrick Karl Czodrowski <patrick.czodrowski@cern.ch>
Date: Tue, 14 Sep 2021 18:32:24 +0200
Subject: [PATCH 103/347] ATR-24071 - ctp sim fix jet and other new items for
 old data inputs

---
 .../TrigT1/TrigT1CTP/src/CTPSimulation.cxx    | 23 +++++++++++--------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/Trigger/TrigT1/TrigT1CTP/src/CTPSimulation.cxx b/Trigger/TrigT1/TrigT1CTP/src/CTPSimulation.cxx
index 8aca40f482fc..ff03f73a045b 100644
--- a/Trigger/TrigT1/TrigT1CTP/src/CTPSimulation.cxx
+++ b/Trigger/TrigT1/TrigT1CTP/src/CTPSimulation.cxx
@@ -134,7 +134,6 @@ StatusCode
 LVL1CTP::CTPSimulation::createMultiplicityHist(const std::string & type, unsigned int maxMult ) const {
 
    StatusCode sc;
-
    std::map<std::string,std::vector<std::string>> typeMapping = {
       { "muon", {"MU"} },
       { "jet", {"JET", "jJ", "gJ"} },
@@ -167,16 +166,22 @@ LVL1CTP::CTPSimulation::setMultiplicityHistLabels(const TrigConf::L1Menu& l1menu
       { "em", {"EM", "eEM"} },
       { "tau", {"TAU", "eTAU", "jTAU", "cTAU"} }
    };
+
+
    std::vector<TrigConf::L1Threshold> thrV;
    for( const std::string & t : typeMapping[type] ) {
-      auto hist = get2DHist( "/multi/" + type + "/" + t + "Mult" );
-      auto & thrV = l1menu.thresholds(t);
-      while( hist->GetNbinsX() < (int)thrV.size() ) {
-         hist->LabelsInflate("xaxis");
-      }
-      for(auto thr : thrV) {
-         hist->GetXaxis()->SetBinLabel(thr->mapping()+1, thr->name().c_str() );
-      }
+     try {
+       auto hist = get2DHist( "/multi/" + type + "/" + t + "Mult" );
+       auto & thrV = l1menu.thresholds(t);
+       while( hist->GetNbinsX() < (int)thrV.size() ) {
+	 hist->LabelsInflate("xaxis");
+       }
+       for(auto thr : thrV) {
+	 hist->GetXaxis()->SetBinLabel(thr->mapping()+1, thr->name().c_str() );
+       }
+     } catch (std::exception & ex) {
+       ATH_MSG_DEBUG("Caught exception when setting new JSON MultiplicityHistLabel " << t << " : " << ex.what());
+     }
    }
    return sc;
 }
-- 
GitLab


From fafa1c22ab8788e3e3f327e54d2b5695900fae4b Mon Sep 17 00:00:00 2001
From: Aleksandra Poreba <aleksandra.poreba@cern.ch>
Date: Tue, 14 Sep 2021 18:46:25 +0200
Subject: [PATCH 104/347] Add access to Run 3 database objects via Frontier

---
 .../python/TriggerConfigAccessBase.py         | 31 +++++++++++++++----
 .../TrigConfigSvc/python/TrigConfFrontier.py  | 21 +++++++------
 2 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/Trigger/TrigConfiguration/TrigConfIO/python/TriggerConfigAccessBase.py b/Trigger/TrigConfiguration/TrigConfIO/python/TriggerConfigAccessBase.py
index f002d441afa3..a88e24c2bbcd 100644
--- a/Trigger/TrigConfiguration/TrigConfIO/python/TriggerConfigAccessBase.py
+++ b/Trigger/TrigConfiguration/TrigConfIO/python/TriggerConfigAccessBase.py
@@ -107,6 +107,12 @@ class ConfigDBLoader(ConfigLoader):
         # now get the account and pw for oracle connections
         credentials = odict().fromkeys(listOfServices)
         authFile = ConfigDBLoader.getResolvedFileName("authentication.xml", "CORAL_AUTH_PATH")
+
+        for svc in filter(lambda s : s.startswith("frontier:"), listOfServices):
+            credentials[svc] = dict()
+            credentials[svc]["user"] = svc
+            credentials[svc]["password"] = ""
+
         for svc in filter(lambda s : s.startswith("oracle:"), listOfServices):
             ap = ET.parse(authFile)
             count = 0
@@ -125,19 +131,29 @@ class ConfigDBLoader(ConfigLoader):
                 if connSvc.startswith("oracle:"):
                     from cx_Oracle import connect
                     [tns,schema] = connSvc.split("/")[-2:]
-                    connection = connect(userpw["user"], userpw["password"], tns, threaded=False)
+                    cursor = connect(userpw["user"], userpw["password"], tns, threaded=False).cursor()
                 elif connSvc.startswith("frontier:"):
-                    raise NotImplementedError("Python-loading of trigger configuration from Frontier has not yet been implemented")
+                    import re, os
+                    pattern = r"frontier://ATLF/\(\)/(.*)"
+                    m = re.match(pattern,connSvc)
+                    if not m:
+                        raise RuntimeError("connection string '%s' doesn't match the pattern '%s'?" % (connSvc, pattern))
+                    (schema, ) = m.groups()
+
+                    from TrigConfigSvc.TrigConfFrontier import getFrontierCursor
+                    cursor = getFrontierCursor(urls = os.getenv('FRONTIER_SERVER', None), schema = schema, loglevel=2)
+                    cursor.encoding = "latin-1"
                 elif connSvc.startswith("sqlite_file:"):
                     raise NotImplementedError("Python-loading of trigger configuration from sqlite has not yet been implemented")
-                return connection, schema
+                return cursor, schema
             except Exception as e:
                 raise RuntimeError(e)
+
+
     def load(self):
         from cx_Oracle import DatabaseError
         credentials = ConfigDBLoader.getConnectionParameters(self.dbalias)
-        connection, self.schema = ConfigDBLoader.getConnection(credentials)
-        cursor = connection.cursor()
+        cursor, self.schema = ConfigDBLoader.getConnection(credentials)
         qdict = { "schema" : self.schema, "dbkey" : self.dbkey }
         failures = []
         config = None
@@ -148,7 +164,10 @@ class ConfigDBLoader(ConfigLoader):
                 failures += [ (q.format(**qdict), str(e)) ]
             else:
                 configblob = cursor.fetchall()[0][0]
-                config = json.loads(configblob.read().decode("utf-8"), object_pairs_hook = odict)
+                # Decode oracle result
+                if type(configblob) != str:
+                    configblob = configblob.read().decode("utf-8")
+                config = json.loads(configblob, object_pairs_hook = odict)
                 break
         if not config:
             for q,f in failures:
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfFrontier.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfFrontier.py
index bf78add175fb..c092e1de4758 100755
--- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfFrontier.py
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfFrontier.py
@@ -74,12 +74,13 @@ def replacebindvars(query, bindvars):
 
 
 class FrontierCursor(object):
-    def __init__(self, urls, schema, refreshFlag=False, doDecode=True, retrieveZiplevel="zip"):
+    def __init__(self, urls, schema, refreshFlag=False, doDecode=True, retrieveZiplevel="zip", encoding="utf-8"):
         self.urls = [str(x) + "/Frontier" for x in urls]#Add /Frontier to each URL
         self.schema = schema
         self.refreshFlag = refreshFlag
         self.retrieveZiplevel = retrieveZiplevel
         self.doDecode = doDecode
+        self.encoding = encoding
 
     def __str__(self):
         s = "Using Frontier URL: %s\n" % self.urls
@@ -105,10 +106,9 @@ class FrontierCursor(object):
                 compQuery = zlib.compress(query.encode("utf-8"),9)
                 base64Query = base64.binascii.b2a_base64(compQuery).decode("utf-8")
                 encQuery = base64Query.replace("+", ".").replace("\n","").replace("/","-").replace("=","_")
-
+                log.debug("Frontier Request  : %s", encQuery)
                 frontierRequest="%s/type=frontier_request:1:DEFAULT&encoding=BLOB%s&p1=%s" % (url, self.retrieveZiplevel, encQuery)
                 request = urllib.request.Request(frontierRequest)
-
                 if self.refreshFlag:
                     request.add_header("pragma", "no-cache")
 
@@ -119,7 +119,7 @@ class FrontierCursor(object):
                 log.debug("Query started: %s", time.strftime("%m/%d/%y %H:%M:%S %Z", queryStart))
 
                 t1 = time.time()
-                result = urllib.request.urlopen(request,None,10).read().decode()
+                result = urllib.request.urlopen(request,None,10).read().decode('utf-8')
                 t2 = time.time()
 
                 queryEnd = time.localtime()
@@ -142,11 +142,12 @@ class FrontierCursor(object):
     def decodeResult(self):
         log = logging.getLogger( "TrigConfFrontier.py" )
         from xml.dom.minidom import parseString
-        import base64, zlib, curses.ascii
+        import base64, zlib, curses.ascii, re
         #print ("Query result:\n", self.result)
         dom = parseString(self.result)
         dataList = dom.getElementsByTagName("data")
         keepalives = 0
+        result = []
         # Control characters represent records, but I won't bother with that now,
         # and will simply replace those by space.
         for data in dataList:
@@ -165,12 +166,12 @@ class FrontierCursor(object):
             
                 row = base64.decodebytes(node.data.encode())
                 if self.retrieveZiplevel != "":
-                    row = zlib.decompress(row).decode("utf-8")
-
+                    row = zlib.decompress(row).decode(self.encoding)
+                
                 #Hack to get these lines to work in python 2
                 if sys.version_info[0] < 3: 
                     row = row.encode('ascii', 'xmlcharrefreplace')
-             
+
                 endFirstRow = row.find('\x07')
                 firstRow = row[:endFirstRow]
                 for c in firstRow:
@@ -196,8 +197,10 @@ class FrontierCursor(object):
                 row = row[endFirstRow+1:]
 
                 row_h = row.rstrip('\x07')
+
+                if 'BLOB' in types:
+                    row_h = re.sub("^.*?{","{",row_h)
                 
-                import re
                 row_h = row_h.replace("\x07\x06",'.nNn.\x06')
 
                 #                pattern = re.compile("\x06\x00\x00\x00.",flags=re.S)
-- 
GitLab


From ff484aaf3970ff3e8c4fbc5d92151dc4892ba628 Mon Sep 17 00:00:00 2001
From: Vladimir Lyubushkin <vladimir.lyubushkin@cern.ch>
Date: Tue, 14 Sep 2021 18:52:50 +0200
Subject: [PATCH 105/347] B-physics migration of combined dielectron+muon
 chains, e.g.
 'HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_mu4_L1BPH-0M9-EM7-EM5_MU6' (ATR-23839)

---
 .../python/TrigBmumuxComboHypoConfig.py       |  28 +-
 .../python/TrigMultiTrkComboHypoConfig.py     |  43 +-
 .../TrigBphysHypo/src/ITrigBphysState.h       |  38 +-
 .../TrigBphysHypo/src/TrigBmumuxComboHypo.cxx | 253 ++++---
 .../TrigBphysHypo/src/TrigBmumuxComboHypo.h   |  97 ++-
 .../src/TrigMultiTrkComboHypo.cxx             | 709 +++++++++++-------
 .../TrigBphysHypo/src/TrigMultiTrkComboHypo.h | 207 +++--
 .../src/TrigMultiTrkComboHypoTool.cxx         |  81 +-
 .../src/TrigMultiTrkComboHypoTool.h           |   9 +-
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    |  71 +-
 .../share/ref_v1Dev_decodeBS_build.ref        |  58 +-
 .../TrigEDMConfig/python/TriggerEDMRun3.py    |   5 +
 .../Egamma/ElectronChainConfiguration.py      |  22 +-
 .../python/HLTMenuConfig/Menu/ChainMerging.py |   3 +-
 .../python/HLTMenuConfig/Menu/LS2_v1.py       |  13 +-
 .../HLTMenuConfig/Menu/SignatureDicts.py      |   2 +-
 16 files changed, 1074 insertions(+), 565 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigBmumuxComboHypoConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigBmumuxComboHypoConfig.py
index 3746904608f2..2b1874949c0a 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigBmumuxComboHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigBmumuxComboHypoConfig.py
@@ -80,17 +80,23 @@ def BmumuxComboHypoCfg(name):
         LambdaBToMuMuProtonKaon_dimuonMassRange = (2500., 4300.),
         LambdaBToMuMuProtonKaon_massRange = (4800., 6400.),
         LambdaBToMuMuProtonKaon_chi2 = 60.,
-        # Bc -> J/psi D+ (-> phi pi)
-        BcToDsMuMuPhiPi = True,
-        Bc_DsMuMuKaon_minKaonPt = 1000,
-        Bc_rangePhiDs_MassCut = (980, 1080),
-        Bc_rangeDs_MassCut  = (1600, 2400),
-        Bc_DsMuMu_chi2 = 60,
-        # Bc -> J/psi D+ (-> K pi pi)
-        BcToDpMuMuPhiPi = True,
-        Bc_DpMuMuKaon_minKaonPt = 1000,
-        Bc_rangeDp_MassCut = (1500, 2300),
-        Bc_DpMuMu_chi2  = 60,
+        # B_c+ -> J/psi(-> mu+ mu-) D_s+(->phi(-> K+ K-) pi+)
+        BcToDsMuMu = True,
+        BcToDsMuMu_minKaonPt = 1000.,
+        BcToDsMuMu_minPionPt = 1000.,
+        BcToDsMuMu_massRange = (5500., 7300.),
+        BcToDsMuMu_dimuonMassRange = (2500., 4300.),
+        BcToDsMuMu_phiMassRange = (940., 1100.),
+        BcToDsMuMu_DsMassRange = (1850., 2100.),
+        BcToDsMuMu_chi2 = 60.,
+        # B_c+ -> J/psi(-> mu+ mu-) D+(-> K- pi+ pi+)
+        BcToDplusMuMu = True,
+        BcToDplusMuMu_minKaonPt = 1000.,
+        BcToDplusMuMu_minPionPt = 1000.,
+        BcToDplusMuMu_massRange = (5500., 7300.),
+        BcToDplusMuMu_dimuonMassRange = (2500., 4300.),
+        BcToDplusMuMu_DplusMassRange = (1750., 2000.),
+        BcToDplusMuMu_chi2 = 60.,
         MonTool = TrigBmumuxComboHypoMonitoring('TrigBmumuxComboHypoMonitoring'))
 
     return hypo
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py
index 75ae77d5b07a..23cf2612c8b1 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py
@@ -63,7 +63,7 @@ def StreamerDimuEFComboHypoCfg(name):
         trigSequenceName = 'StreamerDimu',
         trigLevel = 'EF')
     hypo.chi2 = 20.
-    hypo.massRanges = [ (100., 6000.) ]
+    hypo.massRange = [ (100., 6000.) ]
     return hypo
 
 def StreamerDiElecFastComboHypoCfg(name):
@@ -78,6 +78,18 @@ def StreamerDiElecFastComboHypoCfg(name):
         trackCollection='HLT_IDTrack_Electron_FTF')
     return hypo
 
+def StreamerNoMuonDiElecFastComboHypoCfg(name):
+    log.debug('StreamerNoMuonDiElecFastComboHypoCfg.name = %s ', name)
+
+    config = TrigMultiTrkComboHypoConfig()
+    hypo = config.ConfigurationComboHypo(
+        isStreamer = True,
+        trigSequenceName = 'NoMuonDiElecFast',
+        trigLevel = 'L2',
+        doElectrons = True,
+        trackCollection='HLT_IDTrack_Electron_FTF')
+    return hypo
+
 def DiElecPrecisionComboHypoCfg(name):
     log.debug('DiElecPrecisionComboHypoCfg.name = %s ', name)
 
@@ -90,6 +102,17 @@ def DiElecPrecisionComboHypoCfg(name):
         outputTrigBphysCollection = 'HLT_DiElecPrecision')
     return hypo
 
+def NoMuonDiElecPrecisionComboHypoCfg(name):
+    log.debug('NoMuonDiElecPrecisionComboHypoCfg.name = %s ', name)
+
+    config = TrigMultiTrkComboHypoConfig()
+    hypo = config.ConfigurationComboHypo(
+        isStreamer = False,
+        trigSequenceName = 'NoMuonDiElecPrecision',
+        trigLevel = 'EF',
+        doElectrons = True,
+        outputTrigBphysCollection = 'HLT_NoMuonDiElecPrecision')
+    return hypo
 
 def TrigMultiTrkComboHypoToolFromDict(chainDict):
     config = TrigMultiTrkComboHypoConfig()
@@ -125,15 +148,14 @@ class TrigMultiTrkComboHypoConfig(object):
             MaxChi2OfVtxEstimation = 2000.)
 
         if doElectrons:
-            trackMasses = [0.511,0.511]
             tool = CompFactory.TrigMultiTrkComboHypo(
               name = baseName+'ComboHypo',
               isStreamer = isStreamer,
               doElectrons = True,
               trigLevel = trigLevel,
-              nTracks = 2,
-              trackMasses = trackMasses,
-              massRanges = [ (100., 20000.) ],
+              nTracks = [ 2 ],
+              massRange = [ (100., 20000.) ],
+              trackPtThresholds = [ [ 4000., 4000. ] ],
               TrackCollectionKey = trackCollection,
               TrigBphysCollectionKey = outputTrigBphysCollection,
               VertexFitter = VertexFitter,
@@ -146,8 +168,8 @@ class TrigMultiTrkComboHypoConfig(object):
             name = baseName+'ComboHypo',
             isStreamer = isStreamer,
             trigLevel = trigLevel,
-            nTracks = 2,
-            massRanges = [ (100., 20000.) ],
+            nTracks = [ 2 ],
+            massRange = [ (100., 20000.) ],
             TrackCollectionKey = trackCollection,
             TrigBphysCollectionKey = outputTrigBphysCollection,
             VertexFitter = VertexFitter,
@@ -179,5 +201,12 @@ class TrigMultiTrkComboHypoConfig(object):
         if 'Lxy0' in chainDict['topo']:
             tool.LxyCut = 0.0
 
+        if 'BPH-0DR3-EM7J15' in chainDict['L1item']:
+            tool.isMergedElectronChain = True
+
+        signatures = chainDict['signatures']
+        tool.isCombinedChain = (signatures.count(signatures[0]) != len(signatures))
+        tool.legMultiplicities = chainDict['chainMultiplicities']
+
         tool.MonTool = TrigMultiTrkComboHypoToolMonitoring('MonTool')
         return tool
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/ITrigBphysState.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/ITrigBphysState.h
index 803de129bd8a..dba23410f673 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/ITrigBphysState.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/ITrigBphysState.h
@@ -1,19 +1,51 @@
 /*
-  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 TRIG_ITrigBphysState_H
 #define TRIG_ITrigBphysState_H
 
+#include "xAODTrigger/TrigCompositeContainer.h"
+#include "xAODTrigBphys/TrigBphysContainer.h"
+#include "BeamSpotConditionsData/BeamSpotData.h"
+
+
+class EventContext;
+
+
 /**
  * @class ITrigBphysState
  * @brief Base class for TrigBphys state objects
  */
 
-class ITrigBphysState
-{
+class ITrigBphysState {
  public:
+  ITrigBphysState() = delete;
+  ITrigBphysState(const EventContext& context,
+                  const TrigCompositeUtils::DecisionContainer& previousDecisions,
+                  TrigCompositeUtils::DecisionContainer& decisions,
+                  xAOD::TrigBphysContainer* trigBphysCollection = nullptr,
+                  const InDet::BeamSpotData* beamSpotData = nullptr)
+      : m_context(&context),
+        m_previousDecisions(&previousDecisions),
+        m_decisions(&decisions),
+        m_trigBphysCollection(trigBphysCollection),
+        m_beamSpotData(beamSpotData) {}
   virtual ~ITrigBphysState() = default;
+
+  inline const EventContext& context() const { return *m_context; }
+  inline const TrigCompositeUtils::DecisionContainer& previousDecisions() const { return *m_previousDecisions; }
+  inline TrigCompositeUtils::DecisionContainer& decisions() { return *m_decisions; }
+  inline xAOD::TrigBphysContainer& trigBphysCollection() { return *m_trigBphysCollection; }
+  void setTrigBphysCollection(xAOD::TrigBphysContainer* trigBphysCollection) { m_trigBphysCollection = trigBphysCollection; }
+  Amg::Vector3D beamSpotPosition() const { return (m_beamSpotData ? m_beamSpotData->beamPos() : Amg::Vector3D::Zero(3)); }
+
+ private:
+  const EventContext* m_context;
+  const TrigCompositeUtils::DecisionContainer* m_previousDecisions;
+  TrigCompositeUtils::DecisionContainer* m_decisions;
+  xAOD::TrigBphysContainer* m_trigBphysCollection;
+  const InDet::BeamSpotData* m_beamSpotData;
 };
 
 #endif  // TRIG_ITrigBphysState_H
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBmumuxComboHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBmumuxComboHypo.cxx
index faf37b5d48f8..c8273b0753f3 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBmumuxComboHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBmumuxComboHypo.cxx
@@ -25,16 +25,14 @@
 #include "AthViews/ViewHelper.h"
 #include "AthContainers/AuxElement.h"
 
-#include "Math/Vector4D.h"
 #include "Math/GenVector/VectorUtil.h"
 
+
 using TrigCompositeUtils::Decision;
 using TrigCompositeUtils::DecisionContainer;
 using TrigCompositeUtils::DecisionID;
 using TrigCompositeUtils::DecisionIDContainer;
-using TrigCompositeUtils::comboHypoAlgNodeName;
 
-using GenVecFourMom_t = ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double>>;
 
 const std::vector<std::vector<double>> TrigBmumuxComboHypo::s_trkMass{
   {PDG::mMuon, PDG::mMuon},
@@ -107,11 +105,12 @@ StatusCode TrigBmumuxComboHypo::execute(const EventContext& context) const {
   ATH_CHECK( trigBphysHandle.record(std::make_unique<xAOD::TrigBphysContainer>(),
                                     std::make_unique<xAOD::TrigBphysAuxContainer>()) );
 
-  auto state = makeState(&context, previousDecisionsHandle.cptr(), outputDecisionsHandle.ptr(), trigBphysHandle.ptr());
-  ATH_CHECK( mergeMuonsFromViews(*state) );
+  auto state = std::make_unique<TrigBmumuxState>(context, *previousDecisionsHandle, *outputDecisionsHandle, trigBphysHandle.ptr());
+
+  ATH_CHECK( mergeMuonsFromDecisions(*state) );
   ATH_CHECK( findDimuonCandidates(*state) );
 
-  if ( !state->dimuons.empty() ) {
+  if (!state->dimuons.empty()) {
     ATH_CHECK( mergeTracksFromViews(*state) );
     ATH_CHECK( findBmumuxCandidates(*state) );
     ATH_CHECK( createDecisionObjects(*state) );
@@ -122,33 +121,19 @@ StatusCode TrigBmumuxComboHypo::execute(const EventContext& context) const {
 }
 
 
-std::unique_ptr<TrigBmumuxState> TrigBmumuxComboHypo::makeState(const EventContext* context,
-                                                                const DecisionContainer* previousDecisions,
-                                                                DecisionContainer* decisions,
-                                                                xAOD::TrigBphysContainer* trigBphysCollection) const {
-  auto state = std::make_unique<TrigBmumuxState>();
-  state->context = context;
-  state->previousDecisions = previousDecisions;
-  state->decisions = decisions;
-  state->trigBphysCollection = trigBphysCollection;
-  state->dimuons.setStore(&state->dimuonsStore);
-  return state;
-}
-
-
-StatusCode TrigBmumuxComboHypo::mergeMuonsFromViews(TrigBmumuxState& state) const {
+StatusCode TrigBmumuxComboHypo::mergeMuonsFromDecisions(TrigBmumuxState& state) const {
 
   auto& muons = state.muons;
   muons.clear();
 
   // all muons from views are already connected with previous decisions by TrigMuonEFHypoAlg
-  for (const Decision* decision : *state.previousDecisions) {
+  for (const Decision* decision : state.previousDecisions()) {
     ATH_CHECK( decision->hasObjectLink(TrigCompositeUtils::featureString(), ClassID_traits<xAOD::MuonContainer>::ID()) );
     auto muonEL = decision->objectLink<xAOD::MuonContainer>(TrigCompositeUtils::featureString());
     const xAOD::Muon* muon = *muonEL;
     if (!muon->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle)) continue;
 
-    auto decisionEL = TrigCompositeUtils::decisionToElementLink(decision, *state.context);
+    auto decisionEL = TrigCompositeUtils::decisionToElementLink(decision, state.context());
     auto itr = std::find_if(muons.begin(), muons.end(), [this, muon = muon](const auto& x){ return isIdenticalTracks(muon, *x.link); });
     if (itr == muons.end()) {
       muons.push_back({muonEL, ElementLinkVector<DecisionContainer>(1, decisionEL), DecisionIDContainer()});
@@ -182,6 +167,7 @@ StatusCode TrigBmumuxComboHypo::mergeMuonsFromViews(TrigBmumuxState& state) cons
       }
     }
   }
+
   return StatusCode::SUCCESS;
 }
 
@@ -192,12 +178,12 @@ StatusCode TrigBmumuxComboHypo::mergeTracksFromViews(TrigBmumuxState& state) con
   tracks.clear();
 
   size_t viewCounter = 0;
-  for (const Decision* decision : *state.previousDecisions) {
+  for (const Decision* decision : state.previousDecisions()) {
     auto viewLinkInfo = TrigCompositeUtils::findLink<ViewContainer>(decision, TrigCompositeUtils::viewString(), true);
     ATH_CHECK( viewLinkInfo.isValid() );
     auto viewEL = viewLinkInfo.link;
 
-    auto tracksHandle = ViewHelper::makeHandle(*viewEL, m_trackParticleContainerKey, *state.context);
+    auto tracksHandle = ViewHelper::makeHandle(*viewEL, m_trackParticleContainerKey, state.context());
     ATH_CHECK( tracksHandle.isValid() );
     ATH_MSG_DEBUG( "tracks handle " << m_trackParticleContainerKey << " size: " << tracksHandle->size() );
 
@@ -281,18 +267,19 @@ StatusCode TrigBmumuxComboHypo::findDimuonCandidates(TrigBmumuxState& state) con
       }
 
       // fit muons to the common vertex and pass this vertex to the dimuons collection which also takes the ownership of the created object
-      xAOD::Vertex* vertex = fit(state.context, trackParticleLinks);
+      auto vertex = fit(state.context(), trackParticleLinks);
       if (!vertex) continue;
-      state.trigBphysMuonIndices.emplace_back(std::array<size_t, 2>{itrk1, itrk2});
-      state.dimuons.push_back(vertex);
 
       // convert vertex to trigger object and add it to the output xAOD::TrigBphysContainer
-      xAOD::TrigBphys* trigBphys = makeTriggerObject(vertex);
+      xAOD::TrigBphys* trigBphys = makeTriggerObject(*vertex);
       if (!trigBphys) {
         ATH_MSG_ERROR( "xAOD::Vertex could not be converted to xAOD::TrigBphys object: please enable MakeExtendedVertex option in vertex fitter " << m_vertexFitter->name() );
         return StatusCode::FAILURE;
       }
-      state.trigBphysCollection->push_back(trigBphys);
+
+      state.dimuons.push_back(vertex.release());
+      state.trigBphysMuonIndices.emplace_back(std::array<size_t, 2>{itrk1, itrk2});
+      state.trigBphysCollection().push_back(trigBphys);
     }
   }
   mon_nDimuon = state.dimuons.size();
@@ -312,12 +299,12 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
 
   const auto& tracks = state.tracks;
   mon_nTrk = tracks.size();
-  mon_nBPhysObject = state.trigBphysCollection->size();
+  mon_nBPhysObject = state.trigBphysCollection().size();
 
   for (size_t idx = 0; idx < state.dimuons.size(); ++idx) {
     const xAOD::Vertex* dimuon = state.dimuons.get(idx);
 
-    auto dimuonTriggerObjectEL = ElementLink<xAOD::TrigBphysContainer>(*state.trigBphysCollection, idx);
+    auto dimuonTriggerObjectEL = ElementLink<xAOD::TrigBphysContainer>(state.trigBphysCollection(), idx);
     ATH_CHECK( dimuonTriggerObjectEL.isValid() );
 
     // vtx1 = {mu1, mu2, trk1}
@@ -328,6 +315,7 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
     std::vector<ElementLink<xAOD::TrackParticleContainer>> trackParticleLinks_vtx2(trackParticleLinks_vtx1);
     trackParticleLinks_vtx2.emplace_back();
 
+    // vtx3 = {mu1, mu2, trk1, trk2, trk3}
     std::vector<ElementLink<xAOD::TrackParticleContainer>> trackParticleLinks_vtx3(trackParticleLinks_vtx2);
     trackParticleLinks_vtx3.emplace_back();
 
@@ -363,17 +351,17 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
       auto p_trk1 = trk1->genvecP4();
       auto charge1 = trk1->charge();
 
-      xAOD::Vertex* vtx1 = nullptr;
+      std::unique_ptr<xAOD::Vertex> vtx1;
       bool makeFit_vtx1 = true;
 
       // B+ -> mu+ mu- K+
       if (m_BplusToMuMuKaon &&
           p_trk1.Pt() > m_BplusToMuMuKaon_minKaonPt &&
           isInMassRange((p_dimuon + p_trk1.SetM(PDG::mKaon)).M(), m_BplusToMuMuKaon_massRange)) {
-        vtx1 = fit(state.context, trackParticleLinks_vtx1, kB_2mu1trk, *dimuonTriggerObjectEL);
+        vtx1 = fit(state.context(), trackParticleLinks_vtx1, kB_2mu1trk, *dimuonTriggerObjectEL);
         makeFit_vtx1 = false;
         if (vtx1 && vtx1->chiSquared() < m_BplusToMuMuKaon_chi2) {
-          xAOD::TrigBphys* trigBphys = makeTriggerObject(vtx1, xAOD::TrigBphys::BKMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon}, dimuonTriggerObjectEL);
+          xAOD::TrigBphys* trigBphys = makeTriggerObject(*vtx1, xAOD::TrigBphys::BKMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon}, dimuonTriggerObjectEL);
           ATH_CHECK( state.addTriggerObject(trigBphys) );
         }
       }
@@ -384,17 +372,15 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
           isInMassRange(p_dimuon.M(), m_BcToMuMuPion_dimuonMassRange) &&
           isInMassRange((p_dimuon + p_trk1.SetM(PDG::mPion)).M() - p_dimuon.M() + PDG::mJpsi, m_BcToMuMuPion_massRange)) {
         if (!vtx1 && makeFit_vtx1) {
-          vtx1 = fit(state.context, trackParticleLinks_vtx1, kB_2mu1trk, *dimuonTriggerObjectEL);
+          vtx1 = fit(state.context(), trackParticleLinks_vtx1, kB_2mu1trk, *dimuonTriggerObjectEL);
           makeFit_vtx1 = false;
         }
         if (vtx1 && vtx1->chiSquared() < m_BcToMuMuPion_chi2) {
-          xAOD::TrigBphys* trigBphys = makeTriggerObject(vtx1, xAOD::TrigBphys::BCPIMUMU, {PDG::mMuon, PDG::mMuon, PDG::mPion}, dimuonTriggerObjectEL);
+          xAOD::TrigBphys* trigBphys = makeTriggerObject(*vtx1, xAOD::TrigBphys::BCPIMUMU, {PDG::mMuon, PDG::mMuon, PDG::mPion}, dimuonTriggerObjectEL);
           ATH_CHECK( state.addTriggerObject(trigBphys) );
         }
       }
-
-      delete vtx1;
-      vtx1 = nullptr;
+      vtx1.reset();
 
       // dimuon + 2 tracks
       for (size_t itrk2 = itrk1 + 1; itrk2 < selectedTracks.size(); ++itrk2) {
@@ -406,7 +392,7 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
         auto p_trk2 = trk2->genvecP4();
         auto charge2 = trk2->charge();
 
-        xAOD::Vertex* vtx2 = nullptr;
+        std::unique_ptr<xAOD::Vertex> vtx2;
         bool makeFit_vtx2 = true;
 
         // B_s0 -> mu+ mu- phi(-> K+ K-)
@@ -416,10 +402,10 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
             p_trk2.Pt() > m_BsToMuMuPhi1020_minKaonPt &&
             isInMassRange((p_trk1.SetM(PDG::mKaon) + p_trk2.SetM(PDG::mKaon)).M(), m_BsToMuMuPhi1020_phiMassRange) &&
             isInMassRange((p_dimuon + p_trk1.SetM(PDG::mKaon) + p_trk2.SetM(PDG::mKaon)).M(), m_BsToMuMuPhi1020_massRange)) {
-          vtx2 = fit(state.context, trackParticleLinks_vtx2, kB_2mu2trk, *dimuonTriggerObjectEL);
+          vtx2 = fit(state.context(), trackParticleLinks_vtx2, kB_2mu2trk, *dimuonTriggerObjectEL);
           makeFit_vtx2 = false;
           if (vtx2 && vtx2->chiSquared() < m_BsToMuMuPhi1020_chi2) {
-            xAOD::TrigBphys* trigBphys = makeTriggerObject(vtx2, xAOD::TrigBphys::BSPHIMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon, PDG::mKaon}, dimuonTriggerObjectEL);
+            xAOD::TrigBphys* trigBphys = makeTriggerObject(*vtx2, xAOD::TrigBphys::BSPHIMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon, PDG::mKaon}, dimuonTriggerObjectEL);
             ATH_CHECK( state.addTriggerObject(trigBphys) );
           }
         }
@@ -432,11 +418,11 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
             isInMassRange((p_trk1.SetM(PDG::mKaon) + p_trk2.SetM(PDG::mPion)).M(), m_BdToMuMuKstar0_KstarMassRange) &&
             isInMassRange((p_dimuon + p_trk1.SetM(PDG::mKaon) + p_trk2.SetM(PDG::mPion)).M(), m_BdToMuMuKstar0_massRange)) {
           if (!vtx2 && makeFit_vtx2) {
-            vtx2 = fit(state.context, trackParticleLinks_vtx2, kB_2mu2trk, *dimuonTriggerObjectEL);
+            vtx2 = fit(state.context(), trackParticleLinks_vtx2, kB_2mu2trk, *dimuonTriggerObjectEL);
             makeFit_vtx2 = false;
           }
           if (vtx2 && vtx2->chiSquared() < m_BdToMuMuKstar0_chi2) {
-            xAOD::TrigBphys* trigBphys = makeTriggerObject(vtx2, xAOD::TrigBphys::BDKSTMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon, PDG::mPion}, dimuonTriggerObjectEL);
+            xAOD::TrigBphys* trigBphys = makeTriggerObject(*vtx2, xAOD::TrigBphys::BDKSTMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon, PDG::mPion}, dimuonTriggerObjectEL);
             ATH_CHECK( state.addTriggerObject(trigBphys) );
           }
         }
@@ -448,11 +434,11 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
             isInMassRange((p_trk1.SetM(PDG::mPion) + p_trk2.SetM(PDG::mKaon)).M(), m_BdToMuMuKstar0_KstarMassRange) &&
             isInMassRange((p_dimuon + p_trk1.SetM(PDG::mPion) + p_trk2.SetM(PDG::mKaon)).M(), m_BdToMuMuKstar0_massRange)) {
           if (!vtx2 && makeFit_vtx2) {
-            vtx2 = fit(state.context, trackParticleLinks_vtx2, kB_2mu2trk, *dimuonTriggerObjectEL);
+            vtx2 = fit(state.context(), trackParticleLinks_vtx2, kB_2mu2trk, *dimuonTriggerObjectEL);
             makeFit_vtx2 = false;
           }
           if (vtx2 && vtx2->chiSquared() < m_BdToMuMuKstar0_chi2) {
-            xAOD::TrigBphys* trigBphys = makeTriggerObject(vtx2, xAOD::TrigBphys::BDKSTMUMU, {PDG::mMuon, PDG::mMuon, PDG::mPion, PDG::mKaon}, dimuonTriggerObjectEL);
+            xAOD::TrigBphys* trigBphys = makeTriggerObject(*vtx2, xAOD::TrigBphys::BDKSTMUMU, {PDG::mMuon, PDG::mMuon, PDG::mPion, PDG::mKaon}, dimuonTriggerObjectEL);
             ATH_CHECK( state.addTriggerObject(trigBphys) );
           }
         }
@@ -466,11 +452,11 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
             isInMassRange(p_dimuon.M(), m_LambdaBToMuMuProtonKaon_dimuonMassRange) &&
             isInMassRange((p_dimuon + p_trk1.SetM(PDG::mProton) + p_trk2.SetM(PDG::mKaon)).M() - p_dimuon.M() + PDG::mJpsi, m_LambdaBToMuMuProtonKaon_massRange)) {
           if (!vtx2 && makeFit_vtx2) {
-            vtx2 = fit(state.context, trackParticleLinks_vtx2, kB_2mu2trk, *dimuonTriggerObjectEL);
+            vtx2 = fit(state.context(), trackParticleLinks_vtx2, kB_2mu2trk, *dimuonTriggerObjectEL);
             makeFit_vtx2 = false;
           }
           if (vtx2 && vtx2->chiSquared() < m_LambdaBToMuMuProtonKaon_chi2) {
-            xAOD::TrigBphys* trigBphys = makeTriggerObject(vtx2, xAOD::TrigBphys::LBPQMUMU, {PDG::mMuon, PDG::mMuon, PDG::mProton, PDG::mKaon}, dimuonTriggerObjectEL);
+            xAOD::TrigBphys* trigBphys = makeTriggerObject(*vtx2, xAOD::TrigBphys::LBPQMUMU, {PDG::mMuon, PDG::mMuon, PDG::mProton, PDG::mKaon}, dimuonTriggerObjectEL);
             ATH_CHECK( state.addTriggerObject(trigBphys) );
           }
         }
@@ -483,66 +469,80 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
             isInMassRange(p_dimuon.M(), m_LambdaBToMuMuProtonKaon_dimuonMassRange) &&
             isInMassRange((p_dimuon + p_trk1.SetM(PDG::mKaon) + p_trk2.SetM(PDG::mProton)).M() - p_dimuon.M() + PDG::mJpsi, m_LambdaBToMuMuProtonKaon_massRange)) {
           if (!vtx2 && makeFit_vtx2) {
-            vtx2 = fit(state.context, trackParticleLinks_vtx2, kB_2mu2trk, *dimuonTriggerObjectEL);
+            vtx2 = fit(state.context(), trackParticleLinks_vtx2, kB_2mu2trk, *dimuonTriggerObjectEL);
             makeFit_vtx2 = false;
           }
           if (vtx2 && vtx2->chiSquared() < m_LambdaBToMuMuProtonKaon_chi2) {
-            xAOD::TrigBphys* trigBphys = makeTriggerObject(vtx2, xAOD::TrigBphys::LBPQMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon, PDG::mProton}, dimuonTriggerObjectEL);
+            xAOD::TrigBphys* trigBphys = makeTriggerObject(*vtx2, xAOD::TrigBphys::LBPQMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon, PDG::mProton}, dimuonTriggerObjectEL);
             ATH_CHECK( state.addTriggerObject(trigBphys) );
           }
         }
+        vtx2.reset();
+
+        for (size_t itrk3 = 0; itrk3 < selectedTracks.size(); ++itrk3) {
+          const xAOD::TrackParticle* trk3 = *selectedTracks[itrk3];
+          if (itrk3 == itrk1 || itrk3 == itrk2 || isIdenticalTracks(mu1, trk3) || isIdenticalTracks(mu2, trk3)) continue;
+
+          trackParticleLinks_vtx3[2] = selectedTracks[itrk1];
+          trackParticleLinks_vtx3[3] = selectedTracks[itrk2];
+          trackParticleLinks_vtx3[4] = selectedTracks[itrk3];
+          auto p_trk3 = trk3->genvecP4();
+          auto charge3 = trk3->charge();
+
+          std::unique_ptr<xAOD::Vertex> vtx3;
+          bool makeFit_vtx3 = true;
+
+          // B_c+ -> J/psi(-> mu+ mu-) D_s+(->phi(-> K+ K-) pi+)
+          p_trk1.SetM(PDG::mKaon);  // D_s+.phi.K+
+          p_trk2.SetM(PDG::mKaon);  // D_s+.phi.K-
+          p_trk3.SetM(PDG::mPion);  // D_s+.pi+
+          if (m_BcToDsMuMu &&
+              charge1 * charge2 < 0. &&
+              p_trk1.Pt() > m_BcToDsMuMu_minKaonPt &&
+              p_trk2.Pt() > m_BcToDsMuMu_minKaonPt &&
+              p_trk3.Pt() > m_BcToDsMuMu_minPionPt &&
+              isInMassRange(p_dimuon.M(), m_BcToDsMuMu_dimuonMassRange) &&
+              isInMassRange((p_trk1 + p_trk2).M(), m_BcToDsMuMu_phiMassRange) &&
+              isInMassRange((p_trk1 + p_trk2 + p_trk3).M(), m_BcToDsMuMu_DsMassRange) &&
+              isInMassRange((p_dimuon + p_trk1 + p_trk2 + p_trk3).M() - p_dimuon.M() + PDG::mJpsi, m_BcToDsMuMu_massRange)) {
+            if (!vtx3 && makeFit_vtx3) {
+              vtx3 = fit(state.context(), trackParticleLinks_vtx3, kB_2mu3trk, *dimuonTriggerObjectEL);
+              makeFit_vtx3 = false;
+            }
+            if (vtx3 && vtx3->chiSquared() < m_BcToDsMuMu_chi2) {
+              xAOD::TrigBphys* trigBphys = makeTriggerObject(*vtx3, xAOD::TrigBphys::BCDSMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon, PDG::mKaon, PDG::mPion}, dimuonTriggerObjectEL);
+              ATH_CHECK( state.addTriggerObject(trigBphys) );
+            }
+          }
 
-        delete vtx2;
-        vtx2 = nullptr;
-
-
-        for (size_t itrk3 = itrk2 + 1; itrk3 < selectedTracks.size(); ++itrk3) {
-           const xAOD::TrackParticle* trk3 = *selectedTracks[itrk3];
-           if (isIdenticalTracks(mu1, trk3) || isIdenticalTracks(mu2, trk3)) continue;
-           bool makeFit_vtx3 = true;
-           xAOD::Vertex* vtx3 = nullptr;
-           trackParticleLinks_vtx3[2] = selectedTracks[itrk1];
-           trackParticleLinks_vtx3[3] = selectedTracks[itrk2];
-           trackParticleLinks_vtx3[4] = selectedTracks[itrk3];
-           auto p_trk3 = trk3->genvecP4();
-           //auto charge3 = trk3->charge();
-
-
-           if(m_Bc_DsMuMuDecay &&
-                p_trk1.Pt() > m_LambdaBToMuMuProtonKaon_minKaonPt &&
-                p_trk2.Pt() > m_LambdaBToMuMuProtonKaon_minKaonPt &&
-                isInMassRange((p_trk1.SetM(PDG::mKaon) + p_trk2.SetM(PDG::mKaon)).M(), m_rangePhiDs_MassCut) &&
-                isInMassRange((p_trk1.SetM(PDG::mKaon) + p_trk2.SetM(PDG::mKaon) + p_trk3.SetM(PDG::mPion)).M(), m_rangeDs_MassCut) ){
-              if (!vtx3 && makeFit_vtx3){
-                  vtx3 = fit(state.context, trackParticleLinks_vtx3, kB_2mu3trk, *dimuonTriggerObjectEL);
-                  makeFit_vtx3 = false;
-              }
-              if(vtx3 && vtx3->chiSquared() < m_Bc_DsMuMu_chi2){
-                  xAOD::TrigBphys* trigBphys = makeTriggerObject(vtx3, xAOD::TrigBphys::BCDSMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon, PDG::mKaon, PDG::mPion}, dimuonTriggerObjectEL);
-                  ATH_CHECK( state.addTriggerObject(trigBphys) );
-              }
-           }
-
-           if(m_Bc_DpMuMuDecay &&
-                p_trk1.Pt() > m_Bc_DpMuMuKaon_minKaonPt &&
-                isInMassRange((p_trk1.SetM(PDG::mKaon) + p_trk2.SetM(PDG::mPion) + p_trk3.SetM(PDG::mPion)).M(), m_rangeDp_MassCut) ){
-              if (!vtx3 && makeFit_vtx3){
-                  vtx3 = fit(state.context, trackParticleLinks_vtx3, kB_2mu3trk, *dimuonTriggerObjectEL);
-                  makeFit_vtx3 = false;
-              }
-              if(vtx3 && vtx3->chiSquared() < m_Bc_DpMuMu_chi2){
-                  xAOD::TrigBphys* trigBphys = makeTriggerObject(vtx3, xAOD::TrigBphys::BCDPMUMU, {PDG::mMuon, PDG::mMuon, PDG::mKaon, PDG::mPion, PDG::mPion}, dimuonTriggerObjectEL);
-                  ATH_CHECK( state.addTriggerObject(trigBphys) );
-              }
-           }
-           delete vtx3;
-           vtx3 = nullptr;
-        }
+          // B_c+ -> J/psi(-> mu+ mu-) D+(-> K- pi+ pi+)
+          p_trk1.SetM(PDG::mPion);  // D+.pi+
+          p_trk2.SetM(PDG::mPion);  // D+.pi+
+          p_trk3.SetM(PDG::mKaon);  // D+.K-
+          if (m_BcToDplusMuMu &&
+              charge1 * charge2 > 0. && charge1 * charge3 < 0. &&
+              p_trk1.Pt() > m_BcToDplusMuMu_minPionPt &&
+              p_trk2.Pt() > m_BcToDplusMuMu_minPionPt &&
+              p_trk3.Pt() > m_BcToDplusMuMu_minKaonPt &&
+              isInMassRange(p_dimuon.M(), m_BcToDplusMuMu_dimuonMassRange) &&
+              isInMassRange((p_trk1 + p_trk2 + p_trk3).M(), m_BcToDplusMuMu_DplusMassRange) &&
+              isInMassRange((p_dimuon + p_trk1 + p_trk2 + p_trk3).M() - p_dimuon.M() + PDG::mJpsi, m_BcToDplusMuMu_massRange)) {
+            if (!vtx3 && makeFit_vtx3) {
+              vtx3 = fit(state.context(), trackParticleLinks_vtx3, kB_2mu3trk, *dimuonTriggerObjectEL);
+              makeFit_vtx3 = false;
+            }
+            if (vtx3 && vtx3->chiSquared() < m_BcToDplusMuMu_chi2) {
+              xAOD::TrigBphys* trigBphys = makeTriggerObject(*vtx3, xAOD::TrigBphys::BCDPMUMU, {PDG::mMuon, PDG::mMuon, PDG::mPion, PDG::mPion, PDG::mKaon}, dimuonTriggerObjectEL);
+              ATH_CHECK( state.addTriggerObject(trigBphys) );
+            }
+          }
+          vtx3.reset();
 
+        }
       }
     }
   }
-  mon_nBPhysObject = state.trigBphysCollection->size() - mon_nBPhysObject;
+  mon_nBPhysObject = state.trigBphysCollection().size() - mon_nBPhysObject;
 
   return StatusCode::SUCCESS;
 }
@@ -550,13 +550,13 @@ StatusCode TrigBmumuxComboHypo::findBmumuxCandidates(TrigBmumuxState& state) con
 
 StatusCode TrigBmumuxComboHypo::createDecisionObjects(TrigBmumuxState& state) const {
 
-  for (const xAOD::TrigBphys* triggerObject : *state.trigBphysCollection) {
+  for (const xAOD::TrigBphys* triggerObject : state.trigBphysCollection()) {
     // skip all dimuon trigger objects, they are already linked to the Bmumux trigger objects via lowerChainLink()
     if (triggerObject->particleType() == xAOD::TrigBphys::MULTIMU) continue;
 
     ATH_MSG_DEBUG( "Found xAOD::TrigBphys object: mass = " << triggerObject->mass() );
 
-    auto triggerObjectEL = ElementLink<xAOD::TrigBphysContainer>(*state.trigBphysCollection, triggerObject->index());
+    auto triggerObjectEL = ElementLink<xAOD::TrigBphysContainer>(state.trigBphysCollection(), triggerObject->index());
     ATH_CHECK( triggerObjectEL.isValid() );
 
     const xAOD::TrigBphys* dimuonTriggerObject = triggerObject->lowerChain();
@@ -576,7 +576,7 @@ StatusCode TrigBmumuxComboHypo::createDecisionObjects(TrigBmumuxState& state) co
     }
 
     // create a new output Decision object, backed by the 'decisions' container.
-    Decision* decision = TrigCompositeUtils::newDecisionIn(state.decisions, comboHypoAlgNodeName());
+    Decision* decision = TrigCompositeUtils::newDecisionIn(&state.decisions(), TrigCompositeUtils::comboHypoAlgNodeName());
 
     std::vector<const DecisionIDContainer*> previousDecisionIDs;
     for (const size_t& i : state.trigBphysMuonIndices.at(muonindex)) {
@@ -600,10 +600,12 @@ StatusCode TrigBmumuxComboHypo::createDecisionObjects(TrigBmumuxState& state) co
 }
 
 
-xAOD::Vertex* TrigBmumuxComboHypo::fit(const EventContext* context,
-                                       const std::vector<ElementLink<xAOD::TrackParticleContainer>>& trackParticleLinks,
-                                       Decay decay,
-                                       const xAOD::TrigBphys* dimuon) const {
+std::unique_ptr<xAOD::Vertex> TrigBmumuxComboHypo::fit(
+    const EventContext& context,
+    const std::vector<ElementLink<xAOD::TrackParticleContainer>>& trackParticleLinks,
+    Decay decay,
+    const xAOD::TrigBphys* dimuon) const {
+
   ATH_MSG_DEBUG( "Perform vertex fit" );
 
   if (trackParticleLinks.size() < 2) {
@@ -632,17 +634,17 @@ xAOD::Vertex* TrigBmumuxComboHypo::fit(const EventContext* context,
   }
   ATH_MSG_DEBUG( "Starting point: (" << startingPoint(0) << ", " << startingPoint(1) << ", " << startingPoint(2) << ")" );
 
-  auto fitterState = m_vertexFitter->makeState(*context);
+  auto fitterState = m_vertexFitter->makeState(context);
   m_vertexFitter->setMassInputParticles(s_trkMass[static_cast<size_t>(decay)], *fitterState);
-  xAOD::Vertex* vertex = m_vertexFitter->fit(tracklist, startingPoint, *fitterState);
+  std::unique_ptr<xAOD::Vertex> vertex(m_vertexFitter->fit(tracklist, startingPoint, *fitterState));
   if (!vertex) {
     ATH_MSG_DEBUG( "Vertex fit fails" );
-    return nullptr;
+    return vertex;
   }
   if (vertex->chiSquared() > 150. || (decay == Decay::kPsi_2mu && vertex->chiSquared() > m_dimuon_chi2)) {
     ATH_MSG_DEBUG( "Fit is successful, but vertex chi2 is too high, we are not going to save it (chi2 = " << vertex->chiSquared() << ")" );
-    delete vertex;
-    return nullptr;
+    vertex.reset();
+    return vertex;
   }
   ATH_MSG_DEBUG( "Fit is successful" );
 
@@ -654,17 +656,18 @@ xAOD::Vertex* TrigBmumuxComboHypo::fit(const EventContext* context,
 }
 
 
-xAOD::TrigBphys* TrigBmumuxComboHypo::makeTriggerObject(const xAOD::Vertex* vertex,
-                                                        xAOD::TrigBphys::pType type,
-                                                        const std::vector<double>& trkMass,
-                                                        const ElementLink<xAOD::TrigBphysContainer>& dimuonLink) const {
+xAOD::TrigBphys* TrigBmumuxComboHypo::makeTriggerObject(
+    const xAOD::Vertex& vertex,
+    xAOD::TrigBphys::pType type,
+    const std::vector<double>& trkMass,
+    const ElementLink<xAOD::TrigBphysContainer>& dimuonLink) const {
 
   // refitted track momentum as a 4-vector for mass hypothesis defined by the given decay value
-  GenVecFourMom_t momentum;
-  std::vector<GenVecFourMom_t> momenta;
-  if (!vertex->vxTrackAtVertexAvailable()) return nullptr;
-  for (size_t i = 0; i < vertex->vxTrackAtVertex().size(); ++i) {
-    const Trk::TrackParameters* perigee = vertex->vxTrackAtVertex()[i].perigeeAtVertex();
+  xAOD::TrackParticle::GenVecFourMom_t momentum;
+  std::vector<xAOD::TrackParticle::GenVecFourMom_t> momenta;
+  if (!vertex.vxTrackAtVertexAvailable()) return nullptr;
+  for (size_t i = 0; i < vertex.vxTrackAtVertex().size(); ++i) {
+    const Trk::TrackParameters* perigee = vertex.vxTrackAtVertex()[i].perigeeAtVertex();
     if (!perigee) return nullptr;
     const Amg::Vector3D& p = perigee->momentum();
     momenta.emplace_back(p.x(), p.y(), p.z(), trkMass[i]);
@@ -678,14 +681,14 @@ xAOD::TrigBphys* TrigBmumuxComboHypo::makeTriggerObject(const xAOD::Vertex* vert
   result->initialise(0, momentum.Eta(), momentum.Phi(), momentum.Pt(), type, mass, xAOD::TrigBphys::EF);
 
   result->setFitmass(momentum.M());
-  result->setFitx(vertex->x());
-  result->setFity(vertex->y());
-  result->setFitz(vertex->z());
-  result->setFitchi2(vertex->chiSquared());
-  result->setFitndof(vertex->numberDoF());
+  result->setFitx(vertex.x());
+  result->setFity(vertex.y());
+  result->setFitz(vertex.z());
+  result->setFitchi2(vertex.chiSquared());
+  result->setFitndof(vertex.numberDoF());
 
   // set all the particles associated with the decay
-  result->setTrackParticleLinks(vertex->trackParticleLinks());
+  result->setTrackParticleLinks(vertex.trackParticleLinks());
 
   // use lowerChainLink() as a link to the preceding dimuon trigger object
   if (type != xAOD::TrigBphys::MULTIMU) {
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBmumuxComboHypo.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBmumuxComboHypo.h
index 29f8f78ae632..710dcfd3c403 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBmumuxComboHypo.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigBmumuxComboHypo.h
@@ -44,10 +44,17 @@ typedef struct PDG20 PDG;
  */
 class TrigBmumuxState: public ::ITrigBphysState {
  public:
-  const EventContext* context;
-  const TrigCompositeUtils::DecisionContainer* previousDecisions;
-  TrigCompositeUtils::DecisionContainer* decisions;
-  xAOD::TrigBphysContainer* trigBphysCollection;
+  TrigBmumuxState() = delete;
+  TrigBmumuxState(const EventContext& context,
+                  const TrigCompositeUtils::DecisionContainer& previousDecisions,
+                  TrigCompositeUtils::DecisionContainer& decisions,
+                  xAOD::TrigBphysContainer* trigBphysCollection = nullptr,
+                  const InDet::BeamSpotData* beamSpotData = nullptr)
+      : ITrigBphysState(context, previousDecisions, decisions, trigBphysCollection, beamSpotData) {
+    dimuons.setStore(&dimuonsStore);
+  }
+  virtual ~TrigBmumuxState() = default;
+
   struct Muon {
     ElementLink<xAOD::MuonContainer> link;
     ElementLinkVector<TrigCompositeUtils::DecisionContainer> decisionLinks;
@@ -62,7 +69,7 @@ class TrigBmumuxState: public ::ITrigBphysState {
     if (!triggerObject) {
       return StatusCode::FAILURE;
     }
-    trigBphysCollection->push_back(triggerObject);
+    trigBphysCollection().push_back(triggerObject);
     return StatusCode::SUCCESS;
   }
 };
@@ -85,26 +92,28 @@ class TrigBmumuxComboHypo: public ::ComboHypo {
   enum Decay : size_t {
     kPsi_2mu,      // psi -> mu+ mu-
     kB_2mu1trk,    // B -> mu+ mu- trk1
-    kB_2mu2trk,     // B -> mu+ mu- trk1 trk2
+    kB_2mu2trk,    // B -> mu+ mu- trk1 trk2
     kB_2mu3trk     // B -> mu+ mu- trk1 trk2 trk3
   };
 
  private:
-  std::unique_ptr<TrigBmumuxState> makeState(const EventContext* context,
-                                             const TrigCompositeUtils::DecisionContainer* previousDecisions,
-                                             TrigCompositeUtils::DecisionContainer* decisions,
-                                             xAOD::TrigBphysContainer* trigBphysCollection) const;
-  StatusCode mergeMuonsFromViews(TrigBmumuxState&) const;
+  StatusCode mergeMuonsFromDecisions(TrigBmumuxState&) const;
   StatusCode mergeTracksFromViews(TrigBmumuxState&) const;
   StatusCode findDimuonCandidates(TrigBmumuxState&) const;
   StatusCode findBmumuxCandidates(TrigBmumuxState&) const;
   StatusCode createDecisionObjects(TrigBmumuxState&) const;
-  xAOD::Vertex* fit(const EventContext* context, const std::vector<ElementLink<xAOD::TrackParticleContainer>>& tracklist,
-                                     Decay = kPsi_2mu, const xAOD::TrigBphys* dimuon = nullptr) const;
-  xAOD::TrigBphys* makeTriggerObject(const xAOD::Vertex*,
-                                     xAOD::TrigBphys::pType type = xAOD::TrigBphys::MULTIMU,
-                                     const std::vector<double>& trkMass = {PDG::mMuon, PDG::mMuon},
-                                     const ElementLink<xAOD::TrigBphysContainer>& dimuonLink = ElementLink<xAOD::TrigBphysContainer>()) const;
+
+  std::unique_ptr<xAOD::Vertex> fit(
+      const EventContext& context,
+      const std::vector<ElementLink<xAOD::TrackParticleContainer>>& trackParticleLinks,
+      Decay decay = kPsi_2mu,
+      const xAOD::TrigBphys* dimuon = nullptr) const;
+
+  xAOD::TrigBphys* makeTriggerObject(
+      const xAOD::Vertex&,
+      xAOD::TrigBphys::pType type = xAOD::TrigBphys::MULTIMU,
+      const std::vector<double>& trkMass = {PDG::mMuon, PDG::mMuon},
+      const ElementLink<xAOD::TrigBphysContainer>& dimuonLink = ElementLink<xAOD::TrigBphysContainer>()) const;
 
   bool isIdenticalTracks(const xAOD::TrackParticle* lhs, const xAOD::TrackParticle* rhs) const;
   bool isIdenticalTracks(const xAOD::Muon* lhs, const xAOD::Muon* rhs) const;
@@ -206,25 +215,39 @@ class TrigBmumuxComboHypo: public ::ComboHypo {
   Gaudi::Property<float> m_LambdaBToMuMuProtonKaon_chi2 {this,
     "LambdaBToMuMuProtonKaon_chi2", 60., "maximum chi2 of the fitted Lambda_b0 vertex"};
 
-  Gaudi::Property<bool> m_Bc_DsMuMuDecay {this,
-    "BcToDsMuMuPhiPi", true, "switch on/off B_c -> J/psi(-> mu+ mu-) phi Pi decay"};
-  Gaudi::Property<double> m_Bc_DsMuMuKaon_minKaonPt {this,
-    "Bc_DsMuMuKaon_minKaonPt", 1000., "minimum pT of kaon track"};
-  Gaudi::Property<std::pair<double, double>> m_rangePhiDs_MassCut {this,
-    "Bc_rangePhiDs_MassCut", {980., 1080.}, "range for mass of phi"};
-  Gaudi::Property<std::pair<double, double>> m_rangeDs_MassCut {this,
-    "Bc_rangeDs_MassCut", { 1600., 2400.} , "range for mass of Ds"};
-  Gaudi::Property<float> m_Bc_DsMuMu_chi2 {this,
-    "Bc_DsMuMu_chi2", 60., "maximum chi2 of the fitted Bc vertex"};
-
-  Gaudi::Property<bool> m_Bc_DpMuMuDecay {this,
-    "BcToDpMuMuPhiPi", true, "switch on/off B_c -> J/psi(-> mu+ mu-) phi Pi decay"};
-  Gaudi::Property<double> m_Bc_DpMuMuKaon_minKaonPt {this,
-    "Bc_DpMuMuKaon_minKaonPt", 1000., "minimum pT of kaon track"};
-  Gaudi::Property<std::pair<double, double>> m_rangeDp_MassCut {this,
-    "Bc_rangeDp_MassCut", { 1500., 2300.} , "range for mass of Ds"};
-  Gaudi::Property<float> m_Bc_DpMuMu_chi2 {this,
-    "Bc_DpMuMu_chi2", 60., "maximum chi2 of the fitted Bc vertex"};
+  // B_c+ -> J/psi(-> mu+ mu-) D_s+(->phi(-> K+ K-) pi+)
+  Gaudi::Property<bool> m_BcToDsMuMu {this,
+    "BcToDsMuMu", true, "switch on/off B_c+ -> J/psi(-> mu+ mu-) D_s+(->phi(-> K+ K-) pi+) decay"};
+  Gaudi::Property<double> m_BcToDsMuMu_minKaonPt {this,
+    "BcToDsMuMu_minKaonPt", 1000., "minimum pT of kaon track from phi(1020)"};
+  Gaudi::Property<double> m_BcToDsMuMu_minPionPt {this,
+    "BcToDsMuMu_minPionPt", 1000., "minimum pT of pion track from D_s+"};
+  Gaudi::Property<std::pair<double, double>> m_BcToDsMuMu_massRange {this,
+    "BcToDsMuMu_massRange", {5500., 7300.}, "B_c+ mass range"};
+  Gaudi::Property<std::pair<double, double>> m_BcToDsMuMu_dimuonMassRange {this,
+    "BcToDsMuMu_dimuonMassRange", {2500., 4300.}, "dimuon mass range for B_c+ -> J/psi D_s+ decay"};
+  Gaudi::Property<std::pair<double, double>> m_BcToDsMuMu_phiMassRange {this,
+    "BcToDsMuMu_phiMassRange", {940., 1100.}, "phi(1020) mass range"};
+  Gaudi::Property<std::pair<double, double>> m_BcToDsMuMu_DsMassRange {this,
+    "BcToDsMuMu_DsMassRange", {1850., 2100.}, "D_s+ mass range"};
+  Gaudi::Property<float> m_BcToDsMuMu_chi2 {this,
+    "BcToDsMuMu_chi2", 60., "maximum chi2 of the fitted B_c+ vertex"};
+
+  // B_c+ -> J/psi(-> mu+ mu-) D+(-> K- pi+ pi+)
+  Gaudi::Property<bool> m_BcToDplusMuMu {this,
+    "BcToDplusMuMu", true, "switch on/off B_c+ -> J/psi(-> mu+ mu-) D+(-> K- pi+ pi+) decay"};
+  Gaudi::Property<double> m_BcToDplusMuMu_minKaonPt {this,
+    "BcToDplusMuMu_minKaonPt", 1000., "minimum pT of kaon track from D+"};
+  Gaudi::Property<double> m_BcToDplusMuMu_minPionPt {this,
+    "BcToDplusMuMu_minPionPt", 1000., "minimum pT of pion track from D+"};
+  Gaudi::Property<std::pair<double, double>> m_BcToDplusMuMu_massRange {this,
+    "BcToDplusMuMu_massRange", {5500., 7300.}, "B_c+ mass range"};
+  Gaudi::Property<std::pair<double, double>> m_BcToDplusMuMu_dimuonMassRange {this,
+    "BcToDplusMuMu_dimuonMassRange", {2500., 4300.}, "dimuon mass range for B_c+ -> J/psi D+ decay"};
+  Gaudi::Property<std::pair<double, double>> m_BcToDplusMuMu_DplusMassRange {this,
+    "BcToDplusMuMu_DplusMassRange", {1750., 2000.}, "D+ mass range"};
+  Gaudi::Property<float> m_BcToDplusMuMu_chi2 {this,
+    "BcToDplusMuMu_chi2", 60., "maximum chi2 of the fitted B_c+ vertex"};
 
 
   // external tools
@@ -240,7 +263,7 @@ class TrigBmumuxComboHypo: public ::ComboHypo {
   TrigCompositeUtils::DecisionIDContainer m_allowedIDs;
 
   const static std::vector<std::vector<double>> s_trkMass;
-  
+
 };
 
 #endif  // TRIG_TrigBmumuxComboHypo_H
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
index 1a4b08aac892..e46466eb247b 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
@@ -15,6 +15,7 @@
 #include <algorithm>
 #include <numeric>
 
+#include "Constants.h"
 #include "TrigMultiTrkComboHypo.h"
 
 #include "xAODMuon/Muon.h"
@@ -36,12 +37,16 @@
 #include "Math/GenVector/VectorUtil.h"
 #include "Math/Vector2D.h"
 
+
 using TrigCompositeUtils::Decision;
 using TrigCompositeUtils::DecisionContainer;
 using TrigCompositeUtils::DecisionID;
 using TrigCompositeUtils::DecisionIDContainer;
 using ROOT::Math::XYVector;
 
+typedef struct PDG20 PDG;
+
+
 TrigMultiTrkComboHypo::TrigMultiTrkComboHypo(const std::string& name, ISvcLocator* pSvcLocator)
     : ::ComboHypo(name, pSvcLocator) {}
 
@@ -52,27 +57,45 @@ StatusCode TrigMultiTrkComboHypo::initialize() {
   ATH_CHECK( ::ComboHypo::initialize() );
 
   // check consistency of the properties
-  if (m_trkMass.size() != m_nTrk) {
-    ATH_MSG_ERROR( "Requested " << m_nTrk.value() << " tracks per vertex, but only provided " << m_trkMass.size() << " track masses");
-    return StatusCode::FAILURE;
+  ATH_CHECK( !m_nTrk.empty() );
+
+  if (m_trkMass.empty()) {
+    ATH_MSG_INFO( "trackMasses value is not specified, muon/electron mass will be used" );
+    for (const auto& n : m_nTrk) {
+      m_trkMass.value().emplace_back(std::vector<double>(n, (m_doElectrons ? PDG::mElectron : PDG::mMuon)));
+    }
   }
-  if (m_trkPt.size() != m_nTrk) {
-    ATH_MSG_ERROR( "Requested " << m_nTrk.value() << " tracks per vertex, but only provided " << m_trkPt.size() << " track pT thresholds");
-    return StatusCode::FAILURE;
+  if (m_trkPt.empty()) {
+    ATH_MSG_INFO( "trackPtThresholds value is not specified" );
+    for (const auto& n : m_nTrk) {
+      m_trkPt.value().emplace_back(std::vector<double>(n, -100.));
+    }
+  }
+  m_trkPtMin = m_trkPt[0].back();
+  for (size_t i = 0; i < m_trkPt.size(); ++i) {
+    m_trkPtMin = std::min(m_trkPtMin, m_trkPt[i].back());
+  }
+
+  ATH_CHECK( m_trkMass.size() == m_nTrk.size() );
+  ATH_CHECK( m_trkPt.size() == m_nTrk.size() );
+
+  for (size_t i = 0; i < m_nTrk.size(); ++i) {
+    ATH_CHECK( m_trkMass[i].size() == m_nTrk[i] );
+    ATH_CHECK( m_trkPt[i].size() == m_nTrk[i] );
+    ATH_CHECK( std::is_sorted(m_trkPt[i].begin(), m_trkPt[i].end(), std::greater<>()) );
   }
 
   for (const auto& range : m_massRange.value()) {
-    if (range.first > range.second) {
-      ATH_MSG_ERROR( "Mass range incorrect values: {Mi_min, Mi_max}" );
-      return StatusCode::FAILURE;
-    }
+    ATH_CHECK( range.first < range.second );
   }
 
   // dump numerical values
   if (msgLvl(MSG::DEBUG)) {
-    msg() << MSG::DEBUG << "vertex topology:" << std::endl;
-    for (size_t i = 0; i < m_nTrk; ++i) {
-      msg() << MSG::DEBUG << "  " << i << "  trk: mass = " <<  m_trkMass[i] << ", Pt > " << m_trkPt[i] << std::endl;
+    for (size_t i = 0; i < m_nTrk.size(); ++i) {
+      ATH_MSG_DEBUG( "vertex topology: nTrk = " << m_nTrk[i] );
+      for (size_t j = 0; j < m_nTrk[i]; ++j) {
+        ATH_MSG_DEBUG( "  " << j + 1 << "  trk: mass = " <<  m_trkMass[i][j] << ", Pt > " << m_trkPt[i][j] );
+      }
     }
     msg() << MSG::DEBUG << "  mass range: {";
     for (const auto& range : m_massRange.value()) {
@@ -89,6 +112,8 @@ StatusCode TrigMultiTrkComboHypo::initialize() {
     return StatusCode::FAILURE;
   }
 
+  ATH_CHECK( !(m_trigLevel == "L2IO" && m_doElectrons) );
+
   if (m_trigLevel == "L2") {
     ATH_CHECK( m_trackParticleContainerKey.initialize() );
     renounce(m_trackParticleContainerKey);
@@ -123,6 +148,29 @@ StatusCode TrigMultiTrkComboHypo::initialize() {
       ATH_MSG_DEBUG( " +++ " << HLT::Identifier(id) );
     }
   }
+  if (m_doElectrons) {
+    for (const DecisionID& id : m_allowedIDs) {
+      std::string name = HLT::Identifier(id).name();
+      bool isMergedElectronChain = false;
+      for (size_t i = 0; i < m_mergedElectronChains.size(); ++i) {
+        if (name.find(m_mergedElectronChains.value().at(i)) != std::string::npos) {
+          isMergedElectronChain = true;
+          break;
+        }
+      }
+      (isMergedElectronChain ? m_mergedElectronIDs.insert(id) : m_resolvedElectronIDs.insert(id));
+    }
+    if (msgLvl(MSG::DEBUG)) {
+      ATH_MSG_DEBUG( "Well-separated electron decisions:" );
+      for (const DecisionID& id : m_resolvedElectronIDs) {
+        ATH_MSG_DEBUG( " +++ " << HLT::Identifier(id) );
+      }
+      ATH_MSG_DEBUG( "Overlapping electron decisions:" );
+      for (const DecisionID& id : m_mergedElectronIDs) {
+        ATH_MSG_DEBUG( " +++ " << HLT::Identifier(id) );
+      }
+    }
+  }
 
   if (!m_monTool.empty()) {
     ATH_CHECK( m_monTool.retrieve() );
@@ -145,46 +193,56 @@ StatusCode TrigMultiTrkComboHypo::execute(const EventContext& context) const {
   CHECK( previousDecisionsHandle.isValid() );
   ATH_MSG_DEBUG( "Running with "<< previousDecisionsHandle->size() << " previous decisions" );
 
-  // create the mutable output DecisionContainer and register it to StoreGate
   SG::WriteHandle<DecisionContainer> outputDecisionsHandle = TrigCompositeUtils::createAndStore(decisionsOutput().at(0), context);
 
-  std::unique_ptr<TrigMultiTrkStateCand<xAOD::MuonContainer>> muonstate;
-  std::unique_ptr<TrigMultiTrkStateCand<xAOD::ElectronContainer>> electronstate;
-  TrigMultiTrkState* commonstate=nullptr;
-  if(m_doElectrons == true){
-      electronstate = std::make_unique<TrigMultiTrkStateCand<xAOD::ElectronContainer>>();
-      commonstate = electronstate.get();
-  }else{
-      muonstate = std::make_unique<TrigMultiTrkStateCand<xAOD::MuonContainer>>();
-      commonstate = muonstate.get();
+  const InDet::BeamSpotData* beamSpotData = nullptr;
+  if (!m_isStreamer) {
+    SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle {m_beamSpotKey, context};
+    ATH_CHECK( beamSpotHandle.isValid() );
+    beamSpotData = *beamSpotHandle;
+  }
+
+  std::unique_ptr<TrigMultiTrkState<xAOD::MuonContainer>> muonState;
+  std::unique_ptr<TrigMultiTrkState<xAOD::ElectronContainer>> electronState;
+  TrigMultiTrkStateBase* commonState = nullptr;
+  if (m_doElectrons) {
+    electronState = std::make_unique<TrigMultiTrkState<xAOD::ElectronContainer>>(context, *previousDecisionsHandle, *outputDecisionsHandle, nullptr, beamSpotData);
+    commonState = electronState.get();
+  }
+  else {
+    muonState = std::make_unique<TrigMultiTrkState<xAOD::MuonContainer>>(context, *previousDecisionsHandle, *outputDecisionsHandle, nullptr, beamSpotData);
+    commonState = muonState.get();
   }
-  FillState(commonstate, &context, previousDecisionsHandle.cptr(), outputDecisionsHandle.ptr(), nullptr);
 
   if (m_isStreamer) {
     if (m_trigLevel == "L2") {
-      ATH_CHECK( mergeTracksFromViews(*commonstate) );
+      ATH_CHECK( mergeTracksFromViews(*commonState) );
     }
-    else {
-      ATH_CHECK( mergeTracksFromDecisions(*commonstate) );
+    else if (m_trigLevel == "L2IO") {
+      ATH_CHECK( mergeTracksFromDecisions<xAOD::L2CombinedMuonContainer>(*commonState) );
+    }
+    else if (m_trigLevel == "EF") {
+      ATH_CHECK( (m_doElectrons ? mergeTracksFromDecisions<xAOD::ElectronContainer>(*commonState) : mergeTracksFromDecisions<xAOD::MuonContainer>(*commonState)) );
     }
-    ATH_CHECK( filterTrackCombinations(*commonstate) );
-    ATH_CHECK( copyDecisionObjects(*commonstate) );
+    ATH_CHECK( filterTrackCombinations(*commonState) );
+    ATH_CHECK( copyDecisionObjects(*commonState) );
   }
   else {
-
     auto trigBphysHandle = SG::makeHandle(m_trigBphysContainerKey, context);
     ATH_CHECK( trigBphysHandle.record(std::make_unique<xAOD::TrigBphysContainer>(),
                                       std::make_unique<xAOD::TrigBphysAuxContainer>()) );
-    commonstate->trigBphysCollection = trigBphysHandle.ptr();
+    commonState->setTrigBphysCollection(trigBphysHandle.ptr());
 
-    if(m_doElectrons == true){
-        ATH_CHECK( mergeFromDecisions(*electronstate) );
-        ATH_CHECK( findDiTrackCandidates(*electronstate) );
-    } else{
-        ATH_CHECK( mergeFromDecisions(*muonstate) );
-        ATH_CHECK( findDiTrackCandidates(*muonstate) );
+    if (m_doElectrons) {
+      ATH_CHECK( mergeLeptonsFromDecisions(*electronState) );
+      ATH_CHECK( findMultiLeptonCandidates(*electronState) );
+      ATH_CHECK( processMergedElectrons(*electronState) );
     }
-    ATH_CHECK( createDecisionObjects(*commonstate) );
+    else {
+      ATH_CHECK( mergeLeptonsFromDecisions(*muonState) );
+      ATH_CHECK( findMultiLeptonCandidates(*muonState) );
+    }
+    ATH_CHECK( createDecisionObjects(*commonState) );
   }
 
   ATH_MSG_DEBUG( "TrigMultiTrkHypo::execute() terminates with StatusCode::SUCCESS" );
@@ -192,38 +250,37 @@ StatusCode TrigMultiTrkComboHypo::execute(const EventContext& context) const {
 }
 
 
-void TrigMultiTrkComboHypo::FillState(TrigMultiTrkState* state,
-                                                                    const EventContext* context,
-                                                                    const DecisionContainer* previousDecisions,
-                                                                    DecisionContainer* decisions,
-                                                                    xAOD::TrigBphysContainer* trigBphysCollection) const {
-  state->context = context;
-  state->previousDecisions = previousDecisions;
-  state->decisions = decisions;
-  state->trigBphysCollection = trigBphysCollection;
-}
-
 template<typename T>
-StatusCode TrigMultiTrkComboHypo::mergeFromDecisions(TrigMultiTrkStateCand<T>& state) const {
+StatusCode TrigMultiTrkComboHypo::mergeLeptonsFromDecisions(TrigMultiTrkState<T>& state) const {
 
-  auto& leptons = state.LegList;
+  auto& leptons = state.leptons();
   leptons.clear();
 
-  // all muons from views are already connected with previous decisions by TrigMuonEFHypoAlg
-  for (const Decision* decision : *state.previousDecisions) {
-    if (!TrigCompositeUtils::isAnyIDPassing(decision, m_allowedIDs)) continue;
+  // all muons/electrons from views are already connected with previous decisions by TrigMuonEFHypoAlg
+  for (const Decision* decision : state.previousDecisions()) {
+    if (!TrigCompositeUtils::isAnyIDPassing(decision, (m_doElectrons ? m_resolvedElectronIDs : m_allowedIDs))) continue;
 
     ATH_CHECK( decision->hasObjectLink(TrigCompositeUtils::featureString(), ClassID_traits<T>::ID()) );
     auto leptonEL = decision->objectLink<T>(TrigCompositeUtils::featureString());
     const auto lepton = *leptonEL;
-    if constexpr (std::is_same<T, xAOD::MuonContainer>::value){
-       if (!lepton->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle)) continue;
-       if (!lepton->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle)) continue;
-    } else {
-       if (!lepton->trackParticle()) continue;
-    }
-    auto decisionEL = TrigCompositeUtils::decisionToElementLink(decision, *state.context);
-    auto itr = std::find_if(leptons.begin(), leptons.end(), [this, lepton = lepton](const auto& x){ return this->isIdenticalTracks(lepton, *x.link); });
+    if constexpr(std::is_same<T, xAOD::MuonContainer>::value) {
+      if (!lepton->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle)) continue;
+      if (!lepton->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle)) continue;
+    }
+    else if constexpr(std::is_same<T, xAOD::ElectronContainer>::value) {
+      if (!lepton->trackParticle()) continue;
+    }
+    else {
+      ATH_MSG_ERROR( "mergeLeptonsFromDecisions(): no scenario for the provided CONTAINER is specified" );
+      return StatusCode::FAILURE;
+    }
+    auto decisionEL = TrigCompositeUtils::decisionToElementLink(decision, state.context());
+
+    auto itr = leptons.end();
+    if (m_applyOverlapRemoval) {
+      itr = std::find_if(leptons.begin(), leptons.end(),
+                         [this, lepton = lepton](const auto& x){ return this->isIdenticalTracks(lepton, *x.link); });
+    }
     if (itr == leptons.end()) {
       leptons.push_back({leptonEL, ElementLinkVector<DecisionContainer>(1, decisionEL), DecisionIDContainer()});
     }
@@ -248,59 +305,60 @@ StatusCode TrigMultiTrkComboHypo::mergeFromDecisions(TrigMultiTrkStateCand<T>& s
     for (const auto& item : leptons) {
       const auto lepton = *item.link;
       const xAOD::TrackParticle* track;
-      if constexpr (std::is_same<T, xAOD::MuonContainer>::value){
-         track = *lepton->inDetTrackParticleLink();
-      }else{
-         track = *lepton->trackParticleLink();
+      if constexpr(std::is_same<T, xAOD::MuonContainer>::value) {
+        track = lepton->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle);
+      }
+      else {
+        track = lepton->trackParticle();
       }
       ATH_MSG_DEBUG( " -- lepton InDetTrackParticle pt/eta/phi/q: " << track->pt() << " / " << track->eta() << " / " << track->phi() << " / " << track->charge() );
-      ATH_MSG_DEBUG( "    lepton pt (muon: CombinedTrackParticle): " << lepton->pt() );
+      ATH_MSG_DEBUG( "    lepton pt (muon: CombinedTrackParticle): " << lepton->pt() << " / " << lepton->eta() << " / " << lepton->phi() << " / " << lepton->charge() );
       ATH_MSG_DEBUG( "    allowed decisions:" );
       for (const DecisionID& id : item.decisionIDs) {
         ATH_MSG_DEBUG( "    +++ " << HLT::Identifier(id) );
       }
     }
   }
+
   return StatusCode::SUCCESS;
 }
 
 
+StatusCode TrigMultiTrkComboHypo::mergeTracksFromViews(TrigMultiTrkStateBase& state) const {
 
-
-StatusCode TrigMultiTrkComboHypo::mergeTracksFromViews(TrigMultiTrkState& state) const {
-
-  auto& tracks = state.tracks;
+  auto& tracks = state.tracks();
   tracks.clear();
 
-  size_t viewCounter = 0;
-  for (const Decision* decision : *state.previousDecisions) {
+  std::set<const SG::View*> views;
+  for (const Decision* decision : state.previousDecisions()) {
     if (!TrigCompositeUtils::isAnyIDPassing(decision, m_allowedIDs)) continue;
 
     auto viewLinkInfo = TrigCompositeUtils::findLink<ViewContainer>(decision, TrigCompositeUtils::viewString(), true);
     ATH_CHECK( viewLinkInfo.isValid() );
-    auto viewEL = viewLinkInfo.link;
+    const SG::View* view = *viewLinkInfo.link;
+    if (views.find(view) != views.end()) continue;  // tracks from this view have already been fetched
 
-    auto tracksHandle = ViewHelper::makeHandle(*viewEL, m_trackParticleContainerKey, *state.context);
+    auto tracksHandle = ViewHelper::makeHandle(view, m_trackParticleContainerKey, state.context());
     ATH_CHECK( tracksHandle.isValid() );
     ATH_MSG_DEBUG( "tracks handle " << m_trackParticleContainerKey << " size: " << tracksHandle->size() );
 
     std::vector<ElementLink<xAOD::TrackParticleContainer>> tracksFromView;
     tracksFromView.reserve(tracksHandle->size());
     for (size_t idx = 0; idx < tracksHandle->size(); ++idx) {
-      tracksFromView.emplace_back(ViewHelper::makeLink<xAOD::TrackParticleContainer>(*viewEL, tracksHandle, idx));
+      tracksFromView.emplace_back(ViewHelper::makeLink<xAOD::TrackParticleContainer>(view, tracksHandle, idx));
     }
 
     for (const auto& trackEL : tracksFromView) {
       const xAOD::TrackParticle* track = *trackEL;
-      if (track->definingParametersCovMatrixVec().empty() || track->pt() < m_trkPt.value().back()) continue;
+      if (track->definingParametersCovMatrixVec().empty() || track->pt() < m_trkPtMin) continue;
 
-      if (viewCounter == 0 ||
+      if (views.empty() || !m_applyOverlapRemoval ||
           std::find_if(tracks.begin(), tracks.end(),
                        [this,track = track](const auto& x){ return isIdenticalTracks(track, *x); }) == tracks.end()) {
         tracks.emplace_back(trackEL);
       }
     }
-    viewCounter++;
+    views.insert(view);
   }
   std::sort(tracks.begin(), tracks.end(), [](const auto& lhs, const auto& rhs){ return ((*lhs)->pt() > (*rhs)->pt()); });
 
@@ -311,41 +369,47 @@ StatusCode TrigMultiTrkComboHypo::mergeTracksFromViews(TrigMultiTrkState& state)
       ATH_MSG_DEBUG( " -- track pt/eta/phi/q: " << track->pt() << " / " << track->eta() << " / " << track->phi() << " / " << track->charge() );
     }
   }
+
   return StatusCode::SUCCESS;
 }
 
 
-StatusCode TrigMultiTrkComboHypo::mergeTracksFromDecisions(TrigMultiTrkState& state) const {
+template<typename CONTAINER>
+StatusCode TrigMultiTrkComboHypo::mergeTracksFromDecisions(TrigMultiTrkStateBase& state) const {
 
-  auto& tracks = state.tracks;
+  auto& tracks = state.tracks();
   tracks.clear();
 
-  // all muons from views are already connected with previous decisions by TrigMuonEFHypoAlg
-  for (const Decision* decision : *state.previousDecisions) {
+  // all muons/electrons from views are already connected with previous decisions by TrigMuonEFHypoAlg or by TrigEgammaPrecisionElectronHypoAlg
+  for (const Decision* decision : state.previousDecisions()) {
     if (!TrigCompositeUtils::isAnyIDPassing(decision, m_allowedIDs)) continue;
 
+    ATH_CHECK( decision->hasObjectLink(TrigCompositeUtils::featureString(), ClassID_traits<CONTAINER>::ID()) );
+    auto leptonEL = decision->objectLink<CONTAINER>(TrigCompositeUtils::featureString());
+    const auto lepton = *leptonEL;
+
     ElementLink<xAOD::TrackParticleContainer> trackEL;
-    if (m_trigLevel == "EF") {
-      ATH_CHECK( decision->hasObjectLink(TrigCompositeUtils::featureString(), ClassID_traits<xAOD::MuonContainer>::ID()) );
-      auto muonEL = decision->objectLink<xAOD::MuonContainer>(TrigCompositeUtils::featureString());
-      const xAOD::Muon* muon = *muonEL;
-      if (!muon->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle)) continue;
-      if (!muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle)) continue;
-      trackEL = muon->inDetTrackParticleLink();
+    if constexpr(std::is_same<CONTAINER, xAOD::MuonContainer>::value) {
+      if (!lepton->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle)) continue;
+      if (!lepton->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle)) continue;
+      trackEL = lepton->inDetTrackParticleLink();
     }
-    else if (m_trigLevel == "L2IO") {
-      ATH_CHECK( decision->hasObjectLink(TrigCompositeUtils::featureString(), ClassID_traits<xAOD::L2CombinedMuonContainer>::ID()) );
-      auto muonEL = decision->objectLink<xAOD::L2CombinedMuonContainer>(TrigCompositeUtils::featureString());
-      const xAOD::L2CombinedMuon* muon = *muonEL;
-      trackEL = muon->idTrackLink();
+    else if constexpr(std::is_same<CONTAINER, xAOD::L2CombinedMuonContainer>::value) {
+      if (!lepton->idTrack()) continue;
+      trackEL = lepton->idTrackLink();
+    }
+    else if constexpr(std::is_same<CONTAINER, xAOD::ElectronContainer>::value) {
+      if (!lepton->trackParticle()) continue;
+      trackEL = lepton->trackParticleLink();
     }
     else {
-      ATH_MSG_ERROR( "mergeTracksFromDecisions() expects trigLevel to be L2IO or EF, but " << m_trigLevel << " provided" );
+      ATH_MSG_ERROR( "mergeTracksFromDecisions(): no scenario for the provided CONTAINER is specified" );
       return StatusCode::FAILURE;
     }
-    if (!trackEL.isValid()) continue;
 
-    if (std::find_if(tracks.begin(), tracks.end(),
+    if (!trackEL.isValid()) continue;
+    if (!m_applyOverlapRemoval ||
+        std::find_if(tracks.begin(), tracks.end(),
                      [this, track = *trackEL](const auto& x){ return isIdenticalTracks(track, *x); }) == tracks.end()) {
       tracks.emplace_back(trackEL);
     }
@@ -359,14 +423,15 @@ StatusCode TrigMultiTrkComboHypo::mergeTracksFromDecisions(TrigMultiTrkState& st
       ATH_MSG_DEBUG( " -- track pt/eta/phi/q: " << track->pt() << " / " << track->eta() << " / " << track->phi() << " / " << track->charge() );
     }
   }
+
   return StatusCode::SUCCESS;
 }
 
 
-StatusCode TrigMultiTrkComboHypo::filterTrackCombinations(TrigMultiTrkState& state) const {
+StatusCode TrigMultiTrkComboHypo::filterTrackCombinations(TrigMultiTrkStateBase& state) const {
 
-  state.isEventAccepted = 0;
-  auto& tracks = state.tracks;
+  const auto& tracks = state.tracks();
+  state.setEventAccepted(false);
 
   // monitored variables
   auto mon_nAcceptedTrk = Monitored::Scalar<int>("nAcceptedTrk", tracks.size());
@@ -378,86 +443,84 @@ StatusCode TrigMultiTrkComboHypo::filterTrackCombinations(TrigMultiTrkState& sta
     mon_nAcceptedTrk, mon_nVertexFitterCalls, mon_isEventAccepted,
     mon_timer);
 
-  // combination is a selection of items from a collection, such that the order of selection does not matter
-  // tracks have already been sorted over pT, the algorithm will keep this order in created subsets of tracks, i.e.
-  // for m_nTrk = 2 combinations are [0, 1], [0, 2], ..., [1, 2], [1, 3], ...
-  // for m_nTrk = 3 combinations are [0, 1, 2], [0, 1, 3], ..., [0, 2, 3], [0, 2, 4], ..., [1, 2, 3], [1, 2, 4], ...
+  for (size_t iTrk = 0; iTrk < m_nTrk.size(); ++iTrk) {
+    if (state.isEventAccepted()) break;
+    size_t nTrk = m_nTrk[iTrk];
 
-  if (tracks.size() < m_nTrk) {
-    ATH_MSG_DEBUG( "Could not build a subset of " << m_nTrk.value() << " tracks from collection which contains only " << tracks.size() << " objects" );
-    return StatusCode::SUCCESS;
-  }
-  ATH_MSG_DEBUG( "Consider combinations of " << m_nTrk.value() << " tracks from collection which contains " << tracks.size() << " objects until find a good one" );
-
-  std::vector<ElementLink<xAOD::TrackParticleContainer>> tracklist(m_nTrk);
-  std::vector<xAOD::TrackParticle::GenVecFourMom_t> p(m_nTrk);
-
-  // tracks from the current combination will have non-zero value against their position in the 'idx' vector
-  // consider first m_nTrk tracks as an initial combination, then get the next one with std::prev_permutation()
-  std::vector<char> idx(tracks.size(), 0);
-  std::fill(idx.begin(), idx.begin() + m_nTrk, 1);
-  do {
-    // fill tracklist and momenta of tracks, also check that the track pT passes the threshold value
-    bool isValidCombination = true;
-    size_t j = 0;
-    for (size_t i = 0; i < idx.size(); ++i) {
-      if (!idx[i]) continue;
-      const auto& trackEL = tracks[i];
-      tracklist[j] = trackEL;
-      p[j] = (*trackEL)->genvecP4();
-      p[j].SetM(m_trkMass[j]);
-      if (p[j].Pt() < m_trkPt[j]) {
-        isValidCombination = false;
-        break;
-      }
-      ++j;
+    if (tracks.size() < nTrk) {
+      ATH_MSG_DEBUG( "Could not build a subset of " << nTrk << " tracks from collection which contains only " << tracks.size() << " objects" );
+      continue;
     }
-    if (!isValidCombination) continue;
-
-    if (msgLvl(MSG::DEBUG)) {
-      ATH_MSG_DEBUG( "Dump found tracks before vertex fit: pT / eta / phi / charge" );
-      for (size_t i = 0; i < tracklist.size(); ++i) {
-        const auto track = *tracklist[i];
-        ATH_MSG_DEBUG( "track " << i + 1 << ": " << p[i].Pt() << " / " << p[i].Eta() << " / " << p[i].Phi() << " / " << track->charge() );
+    ATH_MSG_DEBUG( "Consider combinations of " << nTrk << " tracks from collection which contains " << tracks.size() << " objects until find a good one" );
+
+    std::vector<ElementLink<xAOD::TrackParticleContainer>> tracklist(nTrk);
+    std::vector<xAOD::TrackParticle::GenVecFourMom_t> p(nTrk);
+
+    // tracks from the current combination will have non-zero value against their position in the 'idx' vector
+    // consider first nTrk tracks as an initial combination, then get the next one with std::prev_permutation()
+    std::vector<char> idx(tracks.size(), 0);
+    std::fill(idx.begin(), idx.begin() + nTrk, 1);
+    do {
+      // fill tracklist and momenta of tracks, also check that the track pT passes the threshold value
+      bool isValidCombination = true;
+      size_t j = 0;
+      for (size_t i = 0; i < idx.size(); ++i) {
+        if (!idx[i]) continue;
+        const auto& trackEL = tracks[i];
+        tracklist[j] = trackEL;
+        p[j] = (*trackEL)->genvecP4();
+        p[j].SetM(m_trkMass[iTrk][j]);
+        if (p[j].Pt() < m_trkPt[iTrk][j]) {
+          isValidCombination = false;
+          break;
+        }
+        ++j;
+      }
+      if (!isValidCombination) continue;
+
+      if (msgLvl(MSG::DEBUG)) {
+        ATH_MSG_DEBUG( "Dump found tracks before vertex fit: pT / eta / phi / charge" );
+        for (size_t i = 0; i < tracklist.size(); ++i) {
+          const auto track = *tracklist[i];
+          ATH_MSG_DEBUG( "track " << i + 1 << ": " << p[i].Pt() << " / " << p[i].Eta() << " / " << p[i].Phi() << " / " << track->charge() );
+        }
       }
-    }
 
-    auto mass = (std::accumulate(p.begin(), p.end(), xAOD::TrackParticle::GenVecFourMom_t())).M();
-    ATH_MSG_DEBUG( "invariant mass: " << mass );
+      auto mass = (std::accumulate(p.begin(), p.end(), xAOD::TrackParticle::GenVecFourMom_t())).M();
+      ATH_MSG_DEBUG( "invariant mass: " << mass );
 
-    if (!isInMassRange(mass)) continue;
+      if (!isInMassRange(mass)) continue;
 
-    auto fitterState = m_vertexFitter->makeState(*state.context);
-    std::unique_ptr<xAOD::Vertex> vertex(fit(tracklist, fitterState.get()));
-    ++mon_nVertexFitterCalls;
-    if (!vertex) continue;
+      auto fitterState = m_vertexFitter->makeState(state.context());
+      auto vertex = fit(tracklist, m_trkMass[iTrk], *fitterState);
+      ++mon_nVertexFitterCalls;
+      if (!vertex) continue;
 
-    ATH_MSG_DEBUG( "Filter found a subset of tracks which passed the rough selection: stop looking for other combinations" );
-    state.isEventAccepted = 1;
-    break;
+      ATH_MSG_DEBUG( "Filter found a subset of tracks which passed the rough selection: stop looking for other combinations" );
+      state.setEventAccepted(true);
+      break;
 
-  } while (std::prev_permutation(idx.begin(), idx.end()));
+    } while (std::prev_permutation(idx.begin(), idx.end()));
+  }
 
-  if (!state.isEventAccepted) {
+  if (!state.isEventAccepted()) {
     ATH_MSG_DEBUG( "Filter could not find a good subset of tracks" );
   }
 
-  mon_isEventAccepted = state.isEventAccepted;
+  mon_isEventAccepted = state.isEventAccepted();
 
   return StatusCode::SUCCESS;
 }
 
-template<typename T>
-StatusCode TrigMultiTrkComboHypo::findDiTrackCandidates(TrigMultiTrkStateCand<T>& state) const {
 
-  state.trigBphysIndices.clear();
-  auto& legs = state.LegList;
+template<typename T>
+StatusCode TrigMultiTrkComboHypo::findMultiLeptonCandidates(TrigMultiTrkState<T>& state) const {
 
-  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle {m_beamSpotKey, *state.context};
-  ATH_CHECK( beamSpotHandle.isValid() );
+  state.trigBphysLegIndices().clear();
+  const auto& leptons = state.leptons();
 
   // monitored variables
-  auto mon_nAcceptedTrk = Monitored::Scalar<int>("nAcceptedTrk", legs.size());
+  auto mon_nAcceptedTrk = Monitored::Scalar<int>("nAcceptedTrk", leptons.size());
   auto mon_nCombination = Monitored::Scalar<int>("nCombination", 0);
   auto mon_nCombinationBeforeFit = Monitored::Scalar<int>("nCombinationBeforeFit", 0);
   auto mon_nBPhysObject = Monitored::Scalar<int>("nBPhysObject", 0);
@@ -469,9 +532,9 @@ StatusCode TrigMultiTrkComboHypo::findDiTrackCandidates(TrigMultiTrkStateCand<T>
   std::vector<float> etatrack1, etatrack2;
   std::vector<int> bphysCharge;
   auto mon_trkMassBeforeFit = Monitored::Collection("trkMassBeforeFit", trkMassBeforeFit);
-  auto mon_bphysChi2 = Monitored::Collection("bphysChi2", *state.trigBphysCollection, &xAOD::TrigBphys::fitchi2);
-  auto mon_bphysLxy = Monitored::Collection("bphysLxy", *state.trigBphysCollection, &xAOD::TrigBphys::lxy);
-  auto mon_bphysFitMass = Monitored::Collection("bphysFitMass", *state.trigBphysCollection, [](const xAOD::TrigBphys* x){ return x->fitmass()*0.001; });
+  auto mon_bphysChi2 = Monitored::Collection("bphysChi2", state.trigBphysCollection(), &xAOD::TrigBphys::fitchi2);
+  auto mon_bphysLxy = Monitored::Collection("bphysLxy", state.trigBphysCollection(), &xAOD::TrigBphys::lxy);
+  auto mon_bphysFitMass = Monitored::Collection("bphysFitMass", state.trigBphysCollection(), [](const xAOD::TrigBphys* x){ return x->fitmass()*0.001; });
   auto mon_bphysMass = Monitored::Collection("bphysMass", bphysMass);
   auto mon_d0track1 = Monitored::Collection("bphysd0_trk1", d0track1);
   auto mon_d0track2 = Monitored::Collection("bphysd0_trk2", d0track2);
@@ -488,90 +551,151 @@ StatusCode TrigMultiTrkComboHypo::findDiTrackCandidates(TrigMultiTrkStateCand<T>
     mon_trkMassBeforeFit, mon_bphysChi2, mon_bphysLxy, mon_bphysFitMass, mon_bphysMass, mon_bphysCharge, mon_d0track1, mon_d0track2,
     mon_timer, mon_pttrack1, mon_pttrack2, mon_etatrack1, mon_etatrack2);
 
-  if (legs.size() < m_nTrk) {
-    ATH_MSG_DEBUG( "Could not build a subset of " << m_nTrk.value() << " legs from collection which contains only " << legs.size() << " objects" );
-    return StatusCode::SUCCESS;
-  }
-  ATH_MSG_DEBUG( "Consider all combinations of " << m_nTrk.value() << "legs from collection which contains " << legs.size() << " objects" );
-
-  std::vector<size_t> leptonIndices(m_nTrk);
-  std::vector<ElementLink<xAOD::TrackParticleContainer>> tracklist(m_nTrk);
-  std::vector<xAOD::TrackParticle::GenVecFourMom_t> p(m_nTrk);
-
-  std::vector<char> leptonTags(legs.size(), 0);
-  std::fill(leptonTags.begin(), leptonTags.begin() + m_nTrk, 1);
-  do {
-    // fill tracklist and momenta of muons in the current subset
-    bool isValidCombination = true;
-    int charge = 0;
-    size_t j = 0;
-    for (size_t i = 0; i < leptonTags.size(); ++i) {
-      if (!leptonTags[i]) continue;
-      leptonIndices[j] = i;
-      auto leg = *legs[i].link;
-      charge += static_cast<int>(lround(leg->charge()));
-      ElementLink<xAOD::TrackParticleContainer> trackEL;
-      if constexpr(std::is_same<T, xAOD::MuonContainer>::value){
-         trackEL = leg->inDetTrackParticleLink();
-      } else{
-         trackEL = leg->trackParticleLink();
+  for (size_t iTrk = 0; iTrk < m_nTrk.size(); ++iTrk) {
+    size_t nTrk = m_nTrk[iTrk];
+
+    if (leptons.size() < nTrk) {
+      ATH_MSG_DEBUG( "Could not build a subset of " << nTrk << " legs from collection which contains only " << leptons.size() << " objects" );
+      continue;
+    }
+    ATH_MSG_DEBUG( "Consider all combinations of " << nTrk << " legs from collection which contains " << leptons.size() << " objects" );
+
+    std::vector<size_t> leptonIndices(nTrk);
+    std::vector<ElementLink<xAOD::TrackParticleContainer>> tracklist(nTrk);
+    std::vector<xAOD::TrackParticle::GenVecFourMom_t> p(nTrk);
+
+    std::vector<char> combination(leptons.size(), 0);
+    std::fill(combination.begin(), combination.begin() + nTrk, 1);
+    do {
+      // fill tracklist and momenta of muons in the current subset
+      bool isValidCombination = true;
+      int charge = 0;
+      size_t j = 0;
+      for (size_t i = 0; i < combination.size(); ++i) {
+        if (!combination[i]) continue;
+        leptonIndices[j] = i;
+        auto leg = *leptons[i].link;
+        charge += static_cast<int>(lround(leg->charge()));
+        ElementLink<xAOD::TrackParticleContainer> trackEL;
+        if constexpr(std::is_same<T, xAOD::MuonContainer>::value) {
+          trackEL = leg->inDetTrackParticleLink();
+        }
+        else {
+          trackEL = leg->trackParticleLink();
+        }
+        tracklist[j] = trackEL;
+        p[j] = (*trackEL)->genvecP4();
+        p[j].SetM(m_trkMass[iTrk][j]);
+        if (p[j].Pt() < m_trkPt[iTrk][j]) {
+          isValidCombination = false;
+          break;
+        }
+        ++j;
       }
-      tracklist[j] = trackEL;
-      p[j] = (*trackEL)->genvecP4();
-      p[j].SetM(m_trkMass[j]);
-      if (p[j].Pt() < m_trkPt[j]) {
-        isValidCombination = false;
-        break;
+      if (!isValidCombination) continue;
+
+      if (msgLvl(MSG::DEBUG)) {
+        ATH_MSG_DEBUG( "Dump found leptons before vertex fit: pT / eta / phi / charge" );
+        for (size_t i = 0; i < tracklist.size(); ++i) {
+          const auto track = *tracklist[i];
+          ATH_MSG_DEBUG( "legs " << i + 1 << ": " << p[i].Pt() << " / " << p[i].Eta() << " / " << p[i].Phi() << " / " << track->charge() );
+        }
       }
-      ++j;
-    }
-    if (!isValidCombination) continue;
 
-    if (msgLvl(MSG::DEBUG)) {
-      ATH_MSG_DEBUG( "Dump found leptons before vertex fit: pT / eta / phi / charge" );
-      for (size_t i = 0; i < tracklist.size(); ++i) {
-        const auto track = *tracklist[i];
-        ATH_MSG_DEBUG( "legs " << i + 1 << ": " << p[i].Pt() << " / " << p[i].Eta() << " / " << p[i].Phi() << " / " << track->charge() );
-      }
-    }
+      auto mass = (std::accumulate(p.begin(), p.end(), xAOD::TrackParticle::GenVecFourMom_t())).M();
+      ATH_MSG_DEBUG( "invariant mass: " << mass );
 
-    auto mass = (std::accumulate(p.begin(), p.end(), xAOD::TrackParticle::GenVecFourMom_t())).M();
-    ATH_MSG_DEBUG( "invariant mass: " << mass );
+      mon_nCombination++;
+      trkMassBeforeFit.push_back(mass * 0.001);
+      if (!isInMassRange(mass)) continue;
 
-    mon_nCombination++;
-    trkMassBeforeFit.push_back(mass * 0.001);
-    if (!isInMassRange(mass)) continue;
+      mon_nCombinationBeforeFit++;
+      auto fitterState = m_vertexFitter->makeState(state.context());
+      auto vertex = fit(tracklist, m_trkMass[iTrk], *fitterState);
+      if (!vertex) continue;
+      xAOD::TrigBphys* trigBphys = makeTrigBPhys(*vertex, m_trkMass[iTrk], state.beamSpotPosition(), *fitterState);
+      state.addTrigBphysObject(trigBphys, leptonIndices);
 
-    mon_nCombinationBeforeFit++;
-    auto fitterState = m_vertexFitter->makeState(*state.context);
-    std::unique_ptr<xAOD::Vertex> vertex(fit(tracklist, fitterState.get()));
-    if (!vertex) continue;
-    xAOD::TrigBphys* trigBphys = makeTrigBPhys(vertex.get(), fitterState.get(), beamSpotHandle->beamPos());
-    state.trigBphysCollection->push_back(trigBphys);
-    state.trigBphysIndices.push_back(leptonIndices);
+      mon_nBPhysObject++;
+      bphysMass.push_back(mass * 0.001);
+      bphysCharge.push_back(charge);
+      d0track1.push_back((*tracklist[0])->d0());
+      d0track2.push_back((*tracklist[1])->d0());
+      pttrack1.push_back((*tracklist[0])->pt() * 0.001);
+      pttrack2.push_back((*tracklist[1])->pt() * 0.001);
+      etatrack1.push_back((*tracklist[0])->eta());
+      etatrack2.push_back((*tracklist[1])->eta());
+
+    } while (std::prev_permutation(combination.begin(), combination.end()));
+  }
+  return StatusCode::SUCCESS;
+}
 
-    mon_nBPhysObject++;
-    bphysMass.push_back(mass * 0.001);
-    bphysCharge.push_back(charge);
-    d0track1.push_back((*tracklist[0])->d0());
-    d0track2.push_back((*tracklist[1])->d0());
-    pttrack1.push_back((*tracklist[0])->pt() * 0.001);
-    pttrack2.push_back((*tracklist[1])->pt() * 0.001);
-    etatrack1.push_back((*tracklist[0])->eta());
-    etatrack2.push_back((*tracklist[1])->eta());
 
-  } while (std::prev_permutation(leptonTags.begin(), leptonTags.end()));
+StatusCode TrigMultiTrkComboHypo::processMergedElectrons(TrigMultiTrkState<xAOD::ElectronContainer>& state) const {
+
+  ATH_MSG_DEBUG( "Try to find electrons originating from the same EM cluster" );
+
+  // some electrons can be already attached to the list, add electrons from BPH-0DR3-EM7J15 clusters to the end
+  auto& leptons = state.leptons();
+
+  if (m_mergedElectronIDs.empty()) {
+    ATH_MSG_DEBUG( "no chains similar to BPH-0DR3-EM7J15 have been requested, should not look for close-by electrons" );
+    return StatusCode::SUCCESS;
+  }
+
+  const std::vector<double> particleMasses(2, PDG::mElectron);
+
+  for (const Decision* decision : state.previousDecisions()) {
+    if (!TrigCompositeUtils::isAnyIDPassing(decision, m_mergedElectronIDs)) continue;
+
+    auto decisionEL = TrigCompositeUtils::decisionToElementLink(decision, state.context());
+    ATH_CHECK( decision->hasObjectLink(TrigCompositeUtils::featureString(), ClassID_traits<xAOD::ElectronContainer>::ID()) );
+    auto electronEL = decision->objectLink<xAOD::ElectronContainer>(TrigCompositeUtils::featureString());
+    const auto electron = *electronEL;
+    if (!electron->trackParticle()) continue;
+
+    // get all electrons from the same SG::View, i.e. from the same initialRoI
+    const auto electronContainer = electronEL.getStorableObjectPointer();
+    if (electronContainer->size() <= 1) continue;
+
+    // add electron from decision to state.leptons
+    DecisionIDContainer decisionIDs;
+    TrigCompositeUtils::decisionIDs(decision, decisionIDs);
+    leptons.push_back({electronEL, ElementLinkVector<DecisionContainer>(1, decisionEL), decisionIDs});
+
+    // get initialRoI this electron originating from
+    auto roiInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>(decision, TrigCompositeUtils::initialRoIString(), true);
+    ATH_CHECK( roiInfo.isValid() );
+    auto initialRoI = *roiInfo.link;
+
+    // try to build di-electron pairs: first electron is always from decision, second from the same SG::View
+    std::vector<ElementLink<xAOD::TrackParticleContainer>> tracklist(2);
+    tracklist[0] = electron->trackParticleLink();
+    for (size_t i = 0; i < electronContainer->size(); ++i) {
+      const auto electronFromView = electronContainer->at(i);
+      if (electronFromView == electron) continue;
+      if (!electronFromView->trackParticle()) continue;
+      tracklist[1] = electronFromView->trackParticleLink();
+
+      auto fitterState = m_vertexFitter->makeState(state.context());
+      auto vertex = fit(tracklist, particleMasses, *fitterState);
+      if (!vertex) continue;
+      xAOD::TrigBphys* trigBphys = makeTrigBPhys(*vertex, particleMasses, state.beamSpotPosition(), *fitterState);
+      trigBphys->setRoiId(initialRoI->roiWord());
+      state.addTrigBphysObject(trigBphys, std::vector<size_t>(1, leptons.size() - 1));
+    }
+  }
 
   return StatusCode::SUCCESS;
 }
 
 
+StatusCode TrigMultiTrkComboHypo::copyDecisionObjects(TrigMultiTrkStateBase& state) const {
 
-StatusCode TrigMultiTrkComboHypo::copyDecisionObjects(TrigMultiTrkState& state) const {
-
-  if (state.isEventAccepted) {
+  if (state.isEventAccepted()) {
     ATH_MSG_DEBUG( "Copying decisions from " << decisionsInput().at(0).key() << " to " << decisionsOutput().at(0).key() );
-    for (const Decision* previousDecision : *state.previousDecisions) {
+    for (const Decision* previousDecision : state.previousDecisions()) {
       if (!TrigCompositeUtils::isAnyIDPassing(previousDecision, m_allowedIDs)) continue;
 
       DecisionIDContainer previousDecisionIDs;
@@ -580,39 +704,42 @@ StatusCode TrigMultiTrkComboHypo::copyDecisionObjects(TrigMultiTrkState& state)
       std::set_intersection(previousDecisionIDs.begin(), previousDecisionIDs.end(), m_allowedIDs.begin(), m_allowedIDs.end(),
                             std::inserter(decisionIDs, decisionIDs.begin()));
 
-      Decision* decision = TrigCompositeUtils::newDecisionIn(state.decisions, TrigCompositeUtils::comboHypoAlgNodeName());
-      TrigCompositeUtils::linkToPrevious(decision, previousDecision, *state.context);
+      Decision* decision = TrigCompositeUtils::newDecisionIn(&state.decisions(), TrigCompositeUtils::comboHypoAlgNodeName());
+      TrigCompositeUtils::linkToPrevious(decision, previousDecision, state.context());
       TrigCompositeUtils::insertDecisionIDs(decisionIDs, decision);
     }
-  }
 
+    // copy additional decisions for combined chains, as 'HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_mu4_L1BPH-0M9-EM7-EM5_MU6'
+    ATH_CHECK( copyAdditionalDecisionObjects(state) );
+  }
   return StatusCode::SUCCESS;
 }
 
 
-StatusCode TrigMultiTrkComboHypo::createDecisionObjects(TrigMultiTrkState& state) const {
+StatusCode TrigMultiTrkComboHypo::createDecisionObjects(TrigMultiTrkStateBase& state) const {
 
   size_t idx = 0;
-  for (const xAOD::TrigBphys* triggerObject : *state.trigBphysCollection) {
+  for (const xAOD::TrigBphys* triggerObject : state.trigBphysCollection()) {
     ATH_MSG_DEBUG( "Found xAOD::TrigBphys: mass / chi2 = " << triggerObject->mass() << " / " << triggerObject->fitchi2() );
 
-    auto triggerObjectEL = ElementLink<xAOD::TrigBphysContainer>(*state.trigBphysCollection, triggerObject->index());
+    auto triggerObjectEL = ElementLink<xAOD::TrigBphysContainer>(state.trigBphysCollection(), triggerObject->index());
     ATH_CHECK( triggerObjectEL.isValid() );
 
     // create a new output Decision object, backed by the 'decisions' container.
-    Decision* decision = TrigCompositeUtils::newDecisionIn(state.decisions, TrigCompositeUtils::comboHypoAlgNodeName());
+    Decision* decision = TrigCompositeUtils::newDecisionIn(&state.decisions(), TrigCompositeUtils::comboHypoAlgNodeName());
 
     std::vector<const DecisionIDContainer*> previousDecisionIDs;
-    for (const size_t& i : state.trigBphysIndices[idx]) {
+    for (const size_t& i : state.getTrigBphysLegIndices(idx)) {
 
-          // attach all previous decisions: if the same previous decision is called twice, that's fine - internally takes care of that
-          // we already have an array of links to the previous decisions, so there is no need to use TrigCompositeUtils::linkToPrevious()
-          decision->addObjectCollectionLinks(TrigCompositeUtils::seedString(), state.getDecisionLinks(i));
-          previousDecisionIDs.push_back(&state.getDecisionID(i));
+      // attach all previous decisions: if the same previous decision is called twice, that's fine - internally takes care of that
+      // we already have an array of links to the previous decisions, so there is no need to use TrigCompositeUtils::linkToPrevious()
+      decision->addObjectCollectionLinks(TrigCompositeUtils::seedString(), state.getDecisionLinks(i));
+      previousDecisionIDs.push_back(&state.getDecisionIDs(i));
     }
 
     // set mandatory feature ElementLink to xAOD::TrigBphys object
     decision->setObjectLink<xAOD::TrigBphysContainer>(TrigCompositeUtils::featureString(), triggerObjectEL);
+    decision->setDetail<int32_t>("noCombo", 1);
 
     for (const auto& tool : hypoTools()) {
       ATH_MSG_DEBUG( "Go to " << tool );
@@ -621,12 +748,46 @@ StatusCode TrigMultiTrkComboHypo::createDecisionObjects(TrigMultiTrkState& state
     ++idx;
   }
 
+  // copy additional decisions from Empty muon step for Combined chains, as 'HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_mu4_L1BPH-0M9-EM7-EM5_MU6'
+  ATH_CHECK( copyAdditionalDecisionObjects(state) );
+
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode TrigMultiTrkComboHypo::copyAdditionalDecisionObjects(TrigMultiTrkStateBase& state) const {
+
+  if (decisionsInput().size() > 1) {
+    ATH_MSG_DEBUG( "Found more than one decision input key, decisionsInput().size = " << decisionsInput().size() );
+    for (size_t i = 1; i < decisionsInput().size(); ++i) {
+      ATH_MSG_DEBUG( "Copying decisions from " << decisionsInput().at(i).key() << " to " << decisionsOutput().at(i).key() );
+      auto previousDecisionsHandle = SG::makeHandle(decisionsInput().at(i), state.context());
+      CHECK( previousDecisionsHandle.isValid() );
+      ATH_MSG_DEBUG( "Running with "<< previousDecisionsHandle->size() << " previous decisions" );
+      SG::WriteHandle<DecisionContainer> outputDecisionsHandle = TrigCompositeUtils::createAndStore(decisionsOutput().at(i), state.context());
+      for (const Decision* previousDecision : *previousDecisionsHandle) {
+        if (!TrigCompositeUtils::isAnyIDPassing(previousDecision, m_allowedIDs)) continue;
+
+        DecisionIDContainer previousDecisionIDs;
+        TrigCompositeUtils::decisionIDs(previousDecision, previousDecisionIDs);
+        DecisionIDContainer decisionIDs;
+        std::set_intersection(previousDecisionIDs.begin(), previousDecisionIDs.end(), m_allowedIDs.begin(), m_allowedIDs.end(),
+                              std::inserter(decisionIDs, decisionIDs.begin()));
+
+        Decision* decision = TrigCompositeUtils::newDecisionIn(outputDecisionsHandle.ptr(), TrigCompositeUtils::comboHypoAlgNodeName());
+        TrigCompositeUtils::linkToPrevious(decision, previousDecision, state.context());
+        TrigCompositeUtils::insertDecisionIDs(decisionIDs, decision);
+      }
+    }
+  }
   return StatusCode::SUCCESS;
 }
 
 
-xAOD::Vertex* TrigMultiTrkComboHypo::fit(const std::vector<ElementLink<xAOD::TrackParticleContainer>>& trackParticleLinks,
-         Trk::IVKalState* fitterState) const {
+std::unique_ptr<xAOD::Vertex> TrigMultiTrkComboHypo::fit(
+    const std::vector<ElementLink<xAOD::TrackParticleContainer>>& trackParticleLinks,
+    const std::vector<double>& particleMasses,
+    Trk::IVKalState& fitterState) const {
 
   ATH_MSG_DEBUG( "Perform vertex fit" );
   std::vector<const xAOD::TrackParticle*> tracklist(trackParticleLinks.size(), nullptr);
@@ -641,16 +802,16 @@ xAOD::Vertex* TrigMultiTrkComboHypo::fit(const std::vector<ElementLink<xAOD::Tra
   if (errorcode != 0) startingPoint = Amg::Vector3D::Zero(3);
   ATH_MSG_DEBUG( "Starting point: (" << startingPoint(0) << ", " << startingPoint(1) << ", " << startingPoint(2) << ")" );
 
-  m_vertexFitter->setMassInputParticles(m_trkMass, *fitterState);
-  xAOD::Vertex* vertex = m_vertexFitter->fit(tracklist, startingPoint, *fitterState);
+  m_vertexFitter->setMassInputParticles(particleMasses, fitterState);
+  std::unique_ptr<xAOD::Vertex> vertex(m_vertexFitter->fit(tracklist, startingPoint, fitterState));
   if (!vertex) {
     ATH_MSG_DEBUG( "Vertex fit fails" );
-    return nullptr;
+    return vertex;
   }
   if (vertex->chiSquared() > m_chi2) {
     ATH_MSG_DEBUG( "Fit is successful, but vertex chi2 is too high, we are not going to save it (chi2 = " << vertex->chiSquared() << " > " << m_chi2.value() << ")" );
-    delete vertex;
-    return nullptr;
+    vertex.reset();
+    return vertex;
   }
   ATH_MSG_DEBUG( "Fit is successful" );
   vertex->clearTracks();
@@ -659,18 +820,23 @@ xAOD::Vertex* TrigMultiTrkComboHypo::fit(const std::vector<ElementLink<xAOD::Tra
 }
 
 
-xAOD::TrigBphys* TrigMultiTrkComboHypo::makeTrigBPhys(xAOD::Vertex* vertex, Trk::IVKalState* fitterState, const Amg::Vector3D& beamspot) const {
+xAOD::TrigBphys* TrigMultiTrkComboHypo::makeTrigBPhys(
+    const xAOD::Vertex& vertex,
+    const std::vector<double>& particleMasses,
+    const Amg::Vector3D& beamSpot,
+    const Trk::IVKalState& fitterState) const {
+
   double invariantMass = 0.;
   double invariantMassError = 0.;
-  if (!m_vertexFitter->VKalGetMassError(invariantMass, invariantMassError, *fitterState).isSuccess()) {
+  if (!m_vertexFitter->VKalGetMassError(invariantMass, invariantMassError, fitterState).isSuccess()) {
     ATH_MSG_DEBUG( "Warning from TrkVKalVrtFitter: can not calculate uncertainties" );
     invariantMass = -9999.;
   }
 
-  xAOD::TrackParticle::GenVecFourMom_t momentum(0, 0, 0, 0);
-  for (size_t i = 0; i < vertex->nTrackParticles(); ++i) {
-    auto p = vertex->trackParticle(i)->genvecP4();
-    p.SetM(m_trkMass[i]);
+  xAOD::TrackParticle::GenVecFourMom_t momentum;
+  for (size_t i = 0; i < vertex.nTrackParticles(); ++i) {
+    auto p = vertex.trackParticle(i)->genvecP4();
+    p.SetM(particleMasses[i]);
     momentum += p;
   }
 
@@ -678,14 +844,15 @@ xAOD::TrigBphys* TrigMultiTrkComboHypo::makeTrigBPhys(xAOD::Vertex* vertex, Trk:
   result->makePrivateStore();
   result->initialise(0, momentum.Eta(), momentum.Phi(), momentum.Pt(), xAOD::TrigBphys::MULTIMU, momentum.M(), xAOD::TrigBphys::EF);
 
+  if (m_doElectrons) result->setParticleType(xAOD::TrigBphys::JPSIEE);
   result->setFitmass(invariantMass);
-  result->setFitchi2(vertex->chiSquared());
-  result->setFitndof(vertex->numberDoF());
-  result->setFitx(vertex->x());
-  result->setFity(vertex->y());
-  result->setFitz(vertex->z());
-  result->setTrackParticleLinks(vertex->trackParticleLinks());
-  result->setLxy(Lxy(result, beamspot));
+  result->setFitchi2(vertex.chiSquared());
+  result->setFitndof(vertex.numberDoF());
+  result->setFitx(vertex.x());
+  result->setFity(vertex.y());
+  result->setFitz(vertex.z());
+  result->setTrackParticleLinks(vertex.trackParticleLinks());
+  result->setLxy(Lxy(*result, beamSpot));
 
   ATH_MSG_DEBUG(
     "TrigBphys objects:\n\t  " <<
@@ -697,8 +864,8 @@ xAOD::TrigBphys* TrigMultiTrkComboHypo::makeTrigBPhys(xAOD::Vertex* vertex, Trk:
     "mass:          " << result->mass() << "\n\t  " <<
     "fitmass:       " << result->fitmass() << "\n\t  " <<
     "chi2/NDF:      " << result->fitchi2() << " / " << result->fitndof() << "\n\t  " <<
-    "vertex:        (" << result->fitx() << ", " << result->fity() << ", " << result->fitz() << "\n\t  " <<
-    "Lxy            " << result->lxy() << ")" );
+    "vertex:        (" << result->fitx() << ", " << result->fity() << ", " << result->fitz() << ")\n\t  " <<
+    "Lxy:           " << result->lxy() );
 
   return result;
 }
@@ -722,10 +889,10 @@ bool TrigMultiTrkComboHypo::isIdenticalTracks(const xAOD::Electron* lhs, const x
 }
 
 
-float TrigMultiTrkComboHypo::Lxy(const xAOD::TrigBphys* vertex, const Amg::Vector3D& beamSpot) const {
+float TrigMultiTrkComboHypo::Lxy(const xAOD::TrigBphys& vertex, const Amg::Vector3D& beamSpot) const {
 
-  XYVector R(vertex->fitx() - beamSpot.x(), vertex->fity() - beamSpot.y());
-  const auto& trackParticleLinks = vertex->trackParticleLinks();
+  XYVector R(vertex.fitx() - beamSpot.x(), vertex.fity() - beamSpot.y());
+  const auto& trackParticleLinks = vertex.trackParticleLinks();
   auto pT = std::accumulate(trackParticleLinks.begin(), trackParticleLinks.end(), XYVector(),
                             [](const auto& pT, const auto& trackEL){ const auto& p = (*trackEL)->genvecP4(); return pT + XYVector(p.x(), p.y()); });
   return R.Dot(pT.unit());
@@ -743,5 +910,3 @@ bool TrigMultiTrkComboHypo::isInMassRange(double mass) const {
   }
   return result;
 }
-
-TrigMultiTrkState::~TrigMultiTrkState(){ }
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.h
index 825222b9dc85..442527191337 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.h
@@ -43,6 +43,8 @@
 #include "TrigMultiTrkComboHypoTool.h"
 #include "BeamSpotConditionsData/BeamSpotData.h"
 
+#include "AthViews/View.h"
+
 namespace Trk {
 class IVKalState;
 }
@@ -53,34 +55,66 @@ class IVKalState;
  * @brief State class for TrigMultiTrkComboHypo algorithm
  */
 
-class TrigMultiTrkState: public ::ITrigBphysState {
+class TrigMultiTrkStateBase: public ::ITrigBphysState {
  public:
-  virtual ~TrigMultiTrkState();
-  const EventContext* context;
-  const TrigCompositeUtils::DecisionContainer* previousDecisions;
-  TrigCompositeUtils::DecisionContainer* decisions;
-  xAOD::TrigBphysContainer* trigBphysCollection;
-  std::vector<ElementLink<xAOD::TrackParticleContainer>> tracks;
-  int isEventAccepted;
-  std::vector<std::vector<size_t>> trigBphysIndices;
-  virtual ElementLinkVector<TrigCompositeUtils::DecisionContainer>& getDecisionLinks(size_t) =0 ;
-  virtual TrigCompositeUtils::DecisionIDContainer& getDecisionID(size_t) =0 ;
+  TrigMultiTrkStateBase() = delete;
+  TrigMultiTrkStateBase(const EventContext& context,
+                        const TrigCompositeUtils::DecisionContainer& previousDecisions,
+                        TrigCompositeUtils::DecisionContainer& decisions,
+                        xAOD::TrigBphysContainer* trigBphysCollection = nullptr,
+                        const InDet::BeamSpotData* beamSpotData = nullptr)
+      : ITrigBphysState(context, previousDecisions, decisions, trigBphysCollection, beamSpotData),
+        m_isEventAccepted(0) {}
+  virtual ~TrigMultiTrkStateBase() = default;
+  virtual ElementLinkVector<TrigCompositeUtils::DecisionContainer>& getDecisionLinks(size_t) = 0;
+  virtual TrigCompositeUtils::DecisionIDContainer& getDecisionIDs(size_t) = 0;
+  virtual void addTrigBphysObject(xAOD::TrigBphys*, const std::vector<size_t>& legIndices) = 0;
+
+  void setEventAccepted(bool flag = true) { m_isEventAccepted = (flag ? 1 : 0); }
+  inline int isEventAccepted() const { return m_isEventAccepted; }
+  inline std::vector<std::vector<size_t>>& trigBphysLegIndices() { return m_trigBphysLegIndices; }
+  inline std::vector<size_t>& getTrigBphysLegIndices(size_t idx) { return m_trigBphysLegIndices[idx]; }
+  inline std::vector<ElementLink<xAOD::TrackParticleContainer>>& tracks() { return m_tracks; }
+
+ private:
+  int m_isEventAccepted;
+  std::vector<std::vector<size_t>> m_trigBphysLegIndices;
+  std::vector<ElementLink<xAOD::TrackParticleContainer>> m_tracks;
 };
 
+
 template<typename CONTAINER>
-class TrigMultiTrkStateCand : public TrigMultiTrkState{
+class TrigMultiTrkState : public TrigMultiTrkStateBase {
  public:
-  virtual ~TrigMultiTrkStateCand() = default;
-  struct LEG {
+  TrigMultiTrkState() = delete;
+  TrigMultiTrkState(const EventContext& context,
+                    const TrigCompositeUtils::DecisionContainer& previousDecisions,
+                    TrigCompositeUtils::DecisionContainer& decisions,
+                    xAOD::TrigBphysContainer* trigBphysCollection = nullptr,
+                    const InDet::BeamSpotData* beamSpotData = nullptr)
+      : TrigMultiTrkStateBase(context, previousDecisions, decisions, trigBphysCollection, beamSpotData) {}
+  virtual ~TrigMultiTrkState() = default;
+
+  struct LEPTON {
     ElementLink<CONTAINER> link;
     ElementLinkVector<TrigCompositeUtils::DecisionContainer> decisionLinks;
     TrigCompositeUtils::DecisionIDContainer decisionIDs;
   };
-  std::vector<LEG> LegList;
-  virtual ElementLinkVector<TrigCompositeUtils::DecisionContainer>& getDecisionLinks(size_t i)  override 
-  { return LegList.at(i).decisionLinks; }
-  virtual TrigCompositeUtils::DecisionIDContainer& getDecisionID(size_t i)  override
-  { return LegList.at(i).decisionIDs; }
+
+  std::vector<LEPTON>& leptons() { return m_leptons; }
+  virtual ElementLinkVector<TrigCompositeUtils::DecisionContainer>& getDecisionLinks(size_t i) override final {
+    return m_leptons.at(i).decisionLinks;
+  }
+  virtual TrigCompositeUtils::DecisionIDContainer& getDecisionIDs(size_t i) override final {
+    return m_leptons.at(i).decisionIDs;
+  }
+  virtual void addTrigBphysObject(xAOD::TrigBphys* trigBphysObject, const std::vector<size_t>& legIndices) override final {
+    trigBphysCollection().push_back(trigBphysObject);
+    trigBphysLegIndices().push_back(legIndices);
+  }
+
+ private:
+  std::vector<LEPTON> m_leptons;
 };
 
 
@@ -95,32 +129,88 @@ class TrigMultiTrkComboHypo: public ::ComboHypo {
 
  private:
 
-  void              FillState(TrigMultiTrkState* state,
-                       const EventContext* context,
-                       const TrigCompositeUtils::DecisionContainer* previousDecisions,
-                       TrigCompositeUtils::DecisionContainer* decisions,
-                       xAOD::TrigBphysContainer* trigBphysCollection) const;
+  /**
+   * @brief Go through state.previousDecisions() and fetch xAOD::TrackParticle objects associated with the nearest SG::View.
+   * Enable overlap removal to get collection of unique objects at state.tracks().
+   */
+  StatusCode mergeTracksFromViews(TrigMultiTrkStateBase&) const;
+
+  /**
+   * @brief Go through state.previousDecisions(), fetch xAOD::Muons/xAOD::Electron objects attached to decisions
+   * and save links to the their xAOD::TrackParticle objects in state.tracks().
+   */
+  template<typename CONTAINER>
+  StatusCode mergeTracksFromDecisions(TrigMultiTrkStateBase&) const;
+
+  /**
+   * @brief Go through state.previousDecisions(), fetch xAOD::Muons/xAOD::Electron objects attached to decisions
+   * and save links to them in state.leptons().
+   */
+  template<typename CONTAINER>
+  StatusCode mergeLeptonsFromDecisions(TrigMultiTrkState<CONTAINER>&) const;
+
+  /**
+   * @brief Make all possible combinations from state.leptons(), fit tracks to the common vertex,
+   * create xAOD::TrigBphys objects and put them into state.trigBphysCollection()
+   *
+   * combination is a selection of items from a collection, such that the order of items does not matter
+   * leptons/tracks have already been sorted over pT, the algorithm will keep this order in created subsets of tracks, i.e.
+   * for nTrk = 2 combinations are [0, 1], [0, 2], ..., [1, 2], [1, 3], ...
+   * for nTrk = 3 combinations are [0, 1, 2], [0, 1, 3], ..., [0, 2, 3], [0, 2, 4], ..., [1, 2, 3], [1, 2, 4], ...
+   */
+  template<typename CONTAINER>
+  StatusCode findMultiLeptonCandidates(TrigMultiTrkState<CONTAINER>&) const;
+
+  /**
+   * @brief Make all possible combinations from state.tracks(), fit tracks to the common vertex
+   * and set state.isEventAccepted to true if at least one good combination is found;
+   * no xAOD::TrigBphys objects will be created.
+   */
+  StatusCode filterTrackCombinations(TrigMultiTrkStateBase&) const;
+
+  /**
+   * @brief Make all possible combinations from electrons originating from the same BPH-0DR3-EM7J15 cluster,
+   * only one track should pass e5_lhvloose requirements;
+   * initialRoI word will be saved into xAOD::TrigBphys objects.
+   */
+  StatusCode processMergedElectrons(TrigMultiTrkState<xAOD::ElectronContainer>&) const;
+
+  /**
+   * @brief All appropriate decisions from state.previousDecisions() will be copied to state.decisions()
+   * if flag state.isEventAccepted() is set by filterTrackCombinations() method;
+   * to be used only in Streamer mode.
+   */
+  StatusCode copyDecisionObjects(TrigMultiTrkStateBase&) const;
+
+  /**
+   * @brief For chains from CombinedSlice (similar to 'HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_mu4_L1BPH-0M9-EM7-EM5_MU6')
+   * we have decisionsInput().size() > 1, so that we should copy decisions created by EmptySteps from muon part.
+   */
+  StatusCode copyAdditionalDecisionObjects(TrigMultiTrkStateBase&) const;
+
+  /**
+   * @brief Create a decision for each xAOD::TrigBphys object from state.trigBphysCollection() and save it to state.decisions();
+   * use hypoTools() to assign correct decisionIDs, not compatible with Streamer mode.
+   */
+  StatusCode createDecisionObjects(TrigMultiTrkStateBase&) const;
+
+
+  std::unique_ptr<xAOD::Vertex> fit(
+      const std::vector<ElementLink<xAOD::TrackParticleContainer>>& trackParticleLinks,
+      const std::vector<double>& particleMasses,
+      Trk::IVKalState& fitterState) const;
+
+  xAOD::TrigBphys* makeTrigBPhys(
+      const xAOD::Vertex& vertex,
+      const std::vector<double>& particleMasses,
+      const Amg::Vector3D& beamSpot,
+      const Trk::IVKalState& fitterState) const;
 
-  template<typename T>
-  StatusCode mergeFromDecisions(TrigMultiTrkStateCand<T>&) const;
-
-  StatusCode mergeTracksFromViews(TrigMultiTrkState&) const;
-  StatusCode mergeTracksFromDecisions(TrigMultiTrkState&) const;
-  StatusCode filterTrackCombinations(TrigMultiTrkState&) const;
-  StatusCode copyDecisionObjects(TrigMultiTrkState&) const;
-  
-  template<typename T>
-  StatusCode findDiTrackCandidates(TrigMultiTrkStateCand<T>&) const;
-
-  StatusCode createDecisionObjects(TrigMultiTrkState&) const;
-
-  xAOD::Vertex* fit(const std::vector<ElementLink<xAOD::TrackParticleContainer>>& tracklist, Trk::IVKalState*) const;
-  xAOD::TrigBphys* makeTrigBPhys(xAOD::Vertex* vertex, Trk::IVKalState* fitterState, const Amg::Vector3D& beamspot) const;
   bool isIdenticalTracks(const xAOD::TrackParticle* lhs, const xAOD::TrackParticle* rhs) const;
   bool isIdenticalTracks(const xAOD::Muon* lhs, const xAOD::Muon* rhs) const;
   bool isIdenticalTracks(const xAOD::Electron* lhs, const xAOD::Electron* rhs) const;
   bool isInMassRange(double mass) const;
-  float Lxy(const xAOD::TrigBphys*, const Amg::Vector3D&) const;
+  float Lxy(const xAOD::TrigBphys& vertex, const Amg::Vector3D& beamSpot) const;
 
   SG::ReadHandleKey<xAOD::TrackParticleContainer>
     m_trackParticleContainerKey {this, "TrackCollectionKey", "Tracks", "input TrackParticle container name"};
@@ -131,16 +221,28 @@ class TrigMultiTrkComboHypo: public ::ComboHypo {
   SG::ReadCondHandleKey<InDet::BeamSpotData>
     m_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
 
-  Gaudi::Property<unsigned int> m_nTrk {this, "nTracks", 2, "number of tracks in the vertex"};
-  Gaudi::Property<std::vector<double>> m_trkMass {this, "trackMasses", {105.6583745, 105.6583745}, "track masses for vertex reco (one per track)"};
-  Gaudi::Property<std::vector<float>> m_trkPt {this, "trkPtThresholds", {3650., 3650.} ,"minimum track pTs (one per track, sorted descending)"};
-  Gaudi::Property<std::vector<std::pair<double, double>>> m_massRange {this, "massRanges", { {0., 100000.} }, "mass ranges"};
-  Gaudi::Property<float> m_deltaR {this, "deltaR", 0.01, "minimum deltaR between same-sign tracks (overlap removal)"};
-  Gaudi::Property<float> m_chi2 {this, "chi2", 150., "chi2 cut for the fitted vertex"};
-
-  Gaudi::Property<bool> m_isStreamer {this, "isStreamer", false, "if true we do not create trigger objects, just copy all appropriate decisions to the next step or break the chain"};
-  Gaudi::Property<bool> m_doElectrons {this, "doElectrons", false, "use electrons instead of muons"};
-  Gaudi::Property<std::string> m_trigLevel {this, "trigLevel", "EF", "trigger Level to set for created TrigBphys objects"};
+  Gaudi::Property<std::vector<unsigned int>> m_nTrk {this, "nTracks", {2},
+    "number of tracks to be fitted into the common vertex"};
+  Gaudi::Property<std::vector<std::vector<double>>> m_trkMass {this, "trackMasses", {},
+    "track masses for vertex reco (one per track); muon mass is used by default"};
+  Gaudi::Property<std::vector<std::vector<double>>> m_trkPt {this, "trackPtThresholds", { {3650., 3650.} },
+    "minimum track transverse momenta (one per track, sorted descending)"};
+  Gaudi::Property<std::vector<std::pair<double, double>>> m_massRange {this, "massRange", { {0., 100000.} },
+    "range of the invariant mass of the track combinations"};
+  Gaudi::Property<bool> m_applyOverlapRemoval {this, "applyOverlapRemoval", true,
+    "apply overlap removal for the close-by same-sign objects from different views"};
+  Gaudi::Property<float> m_deltaR {this, "deltaR", 0.01,
+    "minimum deltaR between same-sign tracks (overlap removal)"};
+  Gaudi::Property<float> m_chi2 {this, "chi2", 150.,
+    "chi2 cut for the fitted vertex"};
+  Gaudi::Property<bool> m_isStreamer {this, "isStreamer", false,
+    "if true we do not create trigger objects, just copy all appropriate decisions to the next step or break the chain"};
+  Gaudi::Property<bool> m_doElectrons {this, "doElectrons", false,
+    "use electrons if true, otherwise use muons"};
+  Gaudi::Property<std::string> m_trigLevel {this, "trigLevel", "EF",
+    "trigger Level to set for created TrigBphys objects: L2, L2IO or EF"};
+  Gaudi::Property<std::vector<std::string>> m_mergedElectronChains {this, "mergedElectronChains", {"BPH-0DR3-EM7J15"},
+    "patterns for BPH-0DR3-EM7J15 like chains"};
 
   ToolHandle<InDet::VertexPointEstimator> m_vertexPointEstimator {this, "VertexPointEstimator", "", "tool to find starting point for the vertex fitter"};
   ToolHandle<Trk::TrkVKalVrtFitter> m_vertexFitter {this, "VertexFitter", "", "VKalVrtFitter tool to fit tracks into the common vertex"};
@@ -148,6 +250,11 @@ class TrigMultiTrkComboHypo: public ::ComboHypo {
   ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "", "monitoring tool"};
 
   TrigCompositeUtils::DecisionIDContainer m_allowedIDs;
+  TrigCompositeUtils::DecisionIDContainer m_resolvedElectronIDs;
+  TrigCompositeUtils::DecisionIDContainer m_mergedElectronIDs;
+
+  double m_trkPtMin;
+
 };
 
 #endif  // TRIG_TrigMultiTrkComboHypo_H
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.cxx
index aeb01c226a41..adf27b7b2c69 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.cxx
@@ -30,12 +30,32 @@ TrigMultiTrkComboHypoTool::TrigMultiTrkComboHypoTool(const std::string& type, co
 StatusCode TrigMultiTrkComboHypoTool::initialize() {
   ATH_MSG_DEBUG( "configuration for '" << this->name() << "'" << endmsg <<
                  "   AcceptAll = " << (m_acceptAll ? "True" : "False") << endmsg <<
+                 "   isCombinedChain = "  << (m_isCombinedChain ? "True" : "False") << endmsg <<
+                 "   isMergedElectronChain = "  << (m_isMergedElectronChain ? "True" : "False") << endmsg <<
                  "   mass range: ( " <<  m_massRange.value().first << ", " << m_massRange.value().second << " )" << endmsg <<
                  "   chi2 cut: " << m_chi2 << endmsg <<
-                 "   " << (m_totalCharge < 0 ? "total charge cut is disabled" : "total charge cut: only right charge combinations"));
-  ATH_MSG_DEBUG("   LxyCut: > " << m_LxyCut.value());
+                 "   " << (m_totalCharge < 0 ? "total charge cut is disabled" : "total charge cut: only right charge combinations") << endmsg <<
+                 "   LxyCut: > " << m_LxyCut.value() );
 
   ATH_CHECK( m_nTrk >= 2 );
+  ATH_CHECK( !(m_isMergedElectronChain && m_legMultiplicities[0] != 1) );
+
+  ATH_CHECK( !m_legMultiplicities.empty() );
+  if ( m_legMultiplicities.size() > 1 ) {  // chain with asymmetric legs, as HLT_mu6_2mu4_bDimu_L1MU6_3MU4
+    // here we consider each decision as an individual object, i.e. for HLT_mu6_2mu4_bDimu_L1MU6_3MU4 we use
+    // m_legDecisionIDs = {createLegName("HLT_mu6_2mu4_bDimu_L1MU6_3MU4", 0),
+    //                     createLegName("HLT_mu6_2mu4_bDimu_L1MU6_3MU4", 1),
+    //                     createLegName("HLT_mu6_2mu4_bDimu_L1MU6_3MU4", 1)};
+    for (size_t legIndex = 0; legIndex < m_legMultiplicities.size(); ++legIndex) {
+      // can not use legDecisionId(legIndex) at initialize() step, use TrigCompositeUtils::createLegName() instead
+      auto legId = TrigCompositeUtils::createLegName(decisionId(), legIndex);
+      m_legDecisionIDs.insert(m_legDecisionIDs.end(), m_legMultiplicities[legIndex], legId.numeric());
+    }
+  }
+  else {  // chain with symmetric legs, as HLT_2mu4_bDimu_L12MU4
+    m_legDecisionIDs.insert(m_legDecisionIDs.end(), m_legMultiplicities[0], decisionId().numeric());
+  }
+  ATH_CHECK( m_nTrk <= m_legDecisionIDs.size() || m_isMergedElectronChain );
 
   if (!m_monTool.empty()) {
     ATH_CHECK( m_monTool.retrieve() );
@@ -65,8 +85,11 @@ bool TrigMultiTrkComboHypoTool::passed(const xAOD::TrigBphys* trigBphys) const {
 
   auto mon = Monitored::Group( m_monTool, mon_totalCharge, mon_chi2, mon_mass, mon_pT_trk1, mon_pT_trk2, mon_Lxy, mon_D0_trk1, mon_D0_trk2, mon_Eta1, mon_Eta2);
 
-  if (m_acceptAll || (isInMassRange(trigBphys->mass()) && passedChi2Cut(trigBphys->fitchi2()) && passedChargeCut(totalCharge(trigBphys)) &&
-             trigBphys->lxy() > m_LxyCut )) {
+  if (m_acceptAll || (trigBphys->nTrackParticles() == m_nTrk &&
+                      isInMassRange(trigBphys->mass()) &&
+                      passedChi2Cut(trigBphys->fitchi2()) &&
+                      passedChargeCut(totalCharge(trigBphys)) &&
+                      trigBphys->lxy() > m_LxyCut)) {
     mon_Lxy = trigBphys->lxy();
     mon_totalCharge = totalCharge(trigBphys);
     mon_chi2 = trigBphys->fitchi2();
@@ -93,13 +116,21 @@ StatusCode TrigMultiTrkComboHypoTool::decideOnSingleObject(Decision* decision, c
   auto trigBphysEL = decision->objectLink<xAOD::TrigBphysContainer>(TrigCompositeUtils::featureString());
   ATH_CHECK( trigBphysEL.isValid() );
 
-  ATH_CHECK( previousDecisionIDs.size() == m_nTrk );
+  if (previousDecisionIDs.size() != (m_isMergedElectronChain ? 1 : m_nTrk.value())) {
+    return StatusCode::SUCCESS;
+  }
+
   if (!checkPreviousDecisionIDs(previousDecisionIDs)) {
     return StatusCode::SUCCESS;
   }
 
-  if (passed(*trigBphysEL)) {
+  if (m_acceptAll || passed(*trigBphysEL)) {
     TrigCompositeUtils::addDecisionID(decisionId(), decision);
+    if (m_isCombinedChain) {
+      for (size_t i = 0; i < m_nTrk; ++i) {
+        TrigCompositeUtils::addDecisionID(m_legDecisionIDs[i], decision);
+      }
+    }
   }
 
   return StatusCode::SUCCESS;
@@ -113,9 +144,16 @@ bool TrigMultiTrkComboHypoTool::checkPreviousDecisionIDs(const std::vector<const
   // trigger with asymmetric legs (like HLT_mu6_2mu4_bDimu_L1MU6_3MU4) is treated in a specific way:
   // all 6 possible combinations should be checked: {leg0, leg1}, {leg0, leg2}, {leg1, leg0}, {leg1, leg2}, {leg2, leg0}, {leg2, leg1}
 
-  if (decisionId() == legDecisionId(0)) {  // trigger with symmetric legs like HLT_3mu6_bDimu_L13MU6
+  if (m_isMergedElectronChain) {
+    if (!TrigCompositeUtils::passed(m_legDecisionIDs.at(0), *previousDecisionIDs[0])) {
+      ATH_MSG_DEBUG( "Trigger for close-by electrons didn't pass previous decision" );
+      return false;
+    }
+    return true;
+  }
+  else if (decisionId() == legDecisionId(0)) {  // trigger with symmetric legs like HLT_3mu6_bDimu_L13MU6
     for (size_t i = 0; i < m_nTrk; ++i) {
-      if (!TrigCompositeUtils::passed(decisionId().numeric(), *previousDecisionIDs[i])) {	
+      if (!TrigCompositeUtils::passed(decisionId().numeric(), *previousDecisionIDs[i])) {
         ATH_MSG_DEBUG( "Trigger with symmetric legs didn't pass previous decision" );
         return false;
       }
@@ -125,29 +163,14 @@ bool TrigMultiTrkComboHypoTool::checkPreviousDecisionIDs(const std::vector<const
   }
   else {  // trigger with asymmetric legs like HLT_mu6_2mu4_bDimu_L1MU6_3MU4
 
-    std::vector<size_t> a;
-    std::vector<HLT::Identifier> legDecisionIdToCheck;
-
-    size_t count = 0;
-    for (size_t legIndex = 0; legIndex < legMultiplicity().size(); ++legIndex) {
-      for (size_t objectIndex = 0; objectIndex < (size_t) legMultiplicity().at(legIndex); ++objectIndex) {
-        a.push_back(count++);
-        legDecisionIdToCheck.push_back(legDecisionId(legIndex));
-      }
-    }
-    // For HLT_mu6_2mu4_bDimu_L1MU6_3MU4
-    // a = [0,1,2]
-    // legDecisionIdToCheck = [
-    //  createLegName("HLT_mu6_2mu4_bDimu_L1MU6_3MU4", 0), 
-    //  createLegName("HLT_mu6_2mu4_bDimu_L1MU6_3MU4", 1), 
-    //  createLegName("HLT_mu6_2mu4_bDimu_L1MU6_3MU4", 1)]
-
+    std::vector<size_t> a(m_legDecisionIDs.size());
+    std::iota(a.begin(), a.end(), 0);  // {0, 1, 2, .., m_legDecisionIDs().size() - 1}
     int i = 1;
     bool result = true;
     do {
       result = true;
       for (size_t k = 0; k < m_nTrk; ++k) {
-        result = result && TrigCompositeUtils::passed(legDecisionIdToCheck.at( a.at(k) ).numeric(), *previousDecisionIDs[k]);
+        result = result && TrigCompositeUtils::passed(m_legDecisionIDs.at(a[k]), *previousDecisionIDs[k]);
       }
       if (msgLvl(MSG::DEBUG)) {
         msg() << "combination #" << i++ << ": { ";
@@ -156,7 +179,7 @@ bool TrigMultiTrkComboHypoTool::checkPreviousDecisionIDs(const std::vector<const
       }
       if (result) break;
     } while (std::next_permutation(a.begin(), a.end()));
-    ATH_MSG_DEBUG( "Trigger with asymmetric legs " << (result ? "passed" : "didn't pass" ) << " previous decision" );
+    ATH_MSG_DEBUG( "Trigger with asymmetric legs " << (result ? "passed" : "didn't pass") << " previous decision" );
     return result;
   }
   return true;
@@ -182,7 +205,7 @@ int TrigMultiTrkComboHypoTool::totalCharge(const xAOD::TrigBphys* trigBphys) con
 }
 
 
-bool TrigMultiTrkComboHypoTool::executeAlg(const std::vector<Combo::LegDecision>&) const { 
-  ATH_MSG_ERROR("executeAlg not supported for TrigBmumuxComboHypoTool.");
+bool TrigMultiTrkComboHypoTool::executeAlg(const std::vector<Combo::LegDecision>&) const {
+  ATH_MSG_ERROR( "executeAlg() is not supported by TrigMultiTrkComboHypoTool" );
   return true;
 }
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.h
index 1be2f0790bab..3d9b9b635de0 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.h
@@ -50,9 +50,14 @@ class TrigMultiTrkComboHypoTool: public ComboHypoToolBase {
   Gaudi::Property<int> m_totalCharge {this, "totalCharge", 0, "magnitude of the total charge to accept, negative is none" };
   Gaudi::Property<std::pair<double, double>> m_massRange {this, "massRange", {-99., -9.}, "range for the fitted mass, no selection applied if negative"};
   Gaudi::Property<float> m_chi2 {this, "chi2", -99. , "Chi2 cut for vertex (0 < chi2 < cut), no selection applied if negative" };
-  Gaudi::Property<bool> m_acceptAll {this, "AcceptAll", false, "if AcceptAll flag is set to true, no selection will be applied for xAOD::TrigBphys object" };
+  Gaudi::Property<bool> m_acceptAll {this, "AcceptAll", false, "if AcceptAll flag is set to true, no selection will be applied for xAOD::TrigBphys object"};
   Gaudi::Property<float> m_LxyCut {this, "LxyCut", -999., "Applies an Lxy Cut if set > -999"};
-  ToolHandle<GenericMonitoringTool> m_monTool { this, "MonTool", "", "Monitoring tool" };
+  Gaudi::Property<bool> m_isCombinedChain {this, "isCombinedChain", false, "true for chains with different signatures, e.g. HLT_e9_mu6"};
+  Gaudi::Property<bool> m_isMergedElectronChain {this, "isMergedElectronChain", false, "true for close-by electrons, e.g. HLT_e5_lhvloose_L1BPH-0DR3-EM7J15"};
+  Gaudi::Property<std::vector<unsigned int>> m_legMultiplicities {this, "legMultiplicities", {2}, "taken from dict[chainMultiplicities]"};
+  ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "", "Monitoring tool" };
+
+  std::vector<TrigCompositeUtils::DecisionID> m_legDecisionIDs;
 };
 
 #endif  // TRIG_TrigMultiTrkComboHypoTool_H
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 94d030e48011..a74abab6b289 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -70,15 +70,27 @@ HLT_2e5_lhvloose_bBeeM6000_L12EM3:
   eventCount: 0
   stepCounts:
     0: 15
-    1: 8
-    2: 6
-    3: 5
+    1: 6
+    2: 4
+    3: 4
   stepFeatures:
     0: 50
     1: 104
-    2: 20
-    3: 15
-    4: 5
+    2: 14
+    3: 10
+    4: 3
+HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
+  eventCount: 0
+  stepCounts:
+    0: 6
+    1: 2
+    2: 1
+    3: 1
+  stepFeatures:
+    0: 18
+    1: 50
+    2: 4
+    3: 2
 HLT_2g10_loose_mu20_L1MU14FCH:
   eventCount: 0
   stepCounts:
@@ -455,6 +467,19 @@ HLT_2mu4_bBmumu_L1BPH-2M9-0DR15-2MU3V:
   eventCount: 0
 HLT_2mu4_bBmumu_Lxy0_L1BPH-2M9-0DR15-2MU3V:
   eventCount: 0
+HLT_2mu4_bBmumux_BcmumuDploose_L12MU3V:
+  eventCount: 0
+  stepCounts:
+    0: 4
+    1: 3
+    2: 3
+    3: 1
+  stepFeatures:
+    0: 9
+    1: 9
+    2: 10
+    3: 8
+    4: 4
 HLT_2mu4_bBmumux_BcmumuDsloose_L12MU3V:
   eventCount: 0
   stepCounts:
@@ -3413,6 +3438,19 @@ HLT_e5_lhtight_noringer_e9_etcut_Jpsiee_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
+HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
+  eventCount: 0
+  stepCounts:
+    0: 11
+    1: 11
+    2: 11
+    3: 11
+  stepFeatures:
+    0: 16
+    1: 50
+    2: 18
+    3: 15
+    4: 9
 HLT_e5_lhvloose_j70_0eta320_j50_0eta490_j0_DJMASS1000j50_xe50_tcpufit_L1MJJ-500-NFF:
   eventCount: 0
   stepCounts:
@@ -3609,6 +3647,27 @@ HLT_e9_lhtight_noringer_e4_etcut_Jpsiee_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e9_lhtight_noringer_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
+HLT_e9_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
+  eventCount: 0
+  stepCounts:
+    0: 11
+    1: 11
+    2: 8
+    3: 8
+  stepFeatures:
+    0: 16
+    1: 50
+    2: 11
+    3: 11
+    4: 8
+HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
+  eventCount: 0
+  stepCounts:
+    0: 3
+  stepFeatures:
+    0: 21
+    1: 52
+    2: 3
 HLT_e9_lhvloose_mu20_mu8noL1_L1MU14FCH:
   eventCount: 0
   stepCounts:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index d72ef10d7fb1..3c58ae9b5a49 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -34,6 +34,18 @@ HLT_2e5_lhvloose_bBeeM6000_L12EM3:
     1: 49
     2: 4
     3: 4
+HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
+  eventCount: 0
+  stepCounts:
+    0: 1
+    1: 1
+    2: 1
+    3: 1
+  stepFeatures:
+    0: 5
+    1: 9
+    2: 2
+    3: 2
 HLT_2g10_loose_mu20_L1MU14FCH:
   eventCount: 0
 HLT_2g15_loose_25dphiAA_invmAA80_L1DPHI-M70-2eEM12M:
@@ -93,18 +105,6 @@ HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100:
   eventCount: 0
 HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100:
   eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j135XXj60_L1J100:
-  eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100:
-  eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100:
-  eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j135XXj60_L1J100:
-  eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j180XXj80_L1J100:
-  eventCount: 0
-HLT_2j250_pf_ftf_0eta240_j120_pf_ftf_0eta240_presel2j225XXj100_L1J100:
-  eventCount: 0
 HLT_2j330_a10sd_cssk_pf_jes_ftf_35smcINF_L1J100:
   eventCount: 0
 HLT_2j330_a10sd_cssk_pf_jes_ftf_35smcINF_L1SC111-CJ15:
@@ -165,6 +165,12 @@ HLT_2mu4_bBmumu_L1BPH-2M9-0DR15-2MU3V:
   eventCount: 0
 HLT_2mu4_bBmumu_Lxy0_L1BPH-2M9-0DR15-2MU3V:
   eventCount: 0
+HLT_2mu4_bBmumux_BcmumuDploose_L12MU3V:
+  eventCount: 0
+  stepCounts:
+    0: 1
+  stepFeatures:
+    0: 2
 HLT_2mu4_bBmumux_BcmumuDsloose_L12MU3V:
   eventCount: 0
   stepCounts:
@@ -1086,6 +1092,18 @@ HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
     1: 8
     2: 2
     3: 2
+HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
+  eventCount: 0
+  stepCounts:
+    0: 7
+    1: 6
+    2: 5
+    3: 5
+  stepFeatures:
+    0: 9
+    1: 19
+    2: 6
+    3: 5
 HLT_e5_lhvloose_j70_0eta320_j50_0eta490_j0_DJMASS1000j50_xe50_tcpufit_L1MJJ-500-NFF:
   eventCount: 0
 HLT_e5_lhvloose_nopix_lrtloose_idperf_probe_g25_medium_L1EM20VH:
@@ -1138,6 +1156,22 @@ HLT_e9_lhtight_noringer_e4_etcut_Jpsiee_L1JPSI-1M5-EM7:
     0: 11
 HLT_e9_lhtight_noringer_e4_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
+HLT_e9_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
+  eventCount: 0
+  stepCounts:
+    0: 6
+    1: 5
+    2: 2
+    3: 2
+  stepFeatures:
+    0: 7
+    1: 16
+    2: 2
+    3: 2
+HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
+  eventCount: 0
+  stepFeatures:
+    0: 6
 HLT_e9_lhvloose_mu20_mu8noL1_L1MU14FCH:
   eventCount: 0
 HLT_eb_low_L1RD2_FILLED:
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index f5a53a04448e..cf796e7a24bc 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -401,6 +401,11 @@ TriggerHLTListRun3 = [
     ('xAOD::TrackParticleContainer#HLT_IDTrack_Bmumux_IDTrig',              'BS ESD AODFULL', 'Bphys', 'inViews:BmumuxViews'),
     ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_Bmumux_IDTrigAux.',       'BS ESD AODFULL', 'Bphys'),
     ('TrigRoiDescriptorCollection#HLT_Roi_Bmumux',                          'BS ESD AODFULL', 'Bphys'),
+    # Bphysics Di-electron chains
+    ('xAOD::TrigBphysContainer#HLT_DiElecPrecision',                        'BS ESD AODFULL AODSLIM AODVERYSLIM AODBLSSLIM', 'Bphys'),
+    ('xAOD::TrigBphysAuxContainer#HLT_DiElecPrecisionAux.',                 'BS ESD AODFULL AODSLIM AODVERYSLIM AODBLSSLIM', 'Bphys'),
+    ('xAOD::TrigBphysContainer#HLT_NoMuonDiElecPrecision',                  'BS ESD AODFULL AODSLIM AODVERYSLIM AODBLSSLIM', 'Bphys'),
+    ('xAOD::TrigBphysAuxContainer#HLT_NoMuonDiElecPrecisionAux.',           'BS ESD AODFULL AODSLIM AODVERYSLIM AODBLSSLIM', 'Bphys'),
 
     # xAOD muons (msonly (x2: roi+FS), combined (x2: FS+RoI)
     ('xAOD::MuonContainer#HLT_Muons_RoI',                                       'BS ESD AODFULL', 'Muon', 'inViews:MUEFSAViewRoIs'),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronChainConfiguration.py
index f655c8ba9d44..1c5f16799e3c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronChainConfiguration.py
@@ -21,7 +21,7 @@ from .PrecisionElectronMenuSequences_LRT import precisionElectronMenuSequence_LR
 from .PrecisionTrackingMenuSequences import precisionTrackingMenuSequence
 from .PrecisionTrackingMenuSequences_LRT import precisionTrackingMenuSequence_LRT
 
-from TrigBphysHypo.TrigMultiTrkComboHypoConfig import StreamerDiElecFastComboHypoCfg, DiElecPrecisionComboHypoCfg, TrigMultiTrkComboHypoToolFromDict
+from TrigBphysHypo.TrigMultiTrkComboHypoConfig import StreamerNoMuonDiElecFastComboHypoCfg, NoMuonDiElecPrecisionComboHypoCfg, StreamerDiElecFastComboHypoCfg, DiElecPrecisionComboHypoCfg, TrigMultiTrkComboHypoToolFromDict
 
 from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
 #----------------------------------------------------------------
@@ -201,9 +201,14 @@ class ElectronChainConfiguration(ChainConfigurationBase):
         return self.getStep(1,stepName,[ fastCaloCfg], is_probe_leg=is_probe_leg)
 
     def getFastElectron(self,is_probe_leg=False):
-        if "bBeeM6000" in self.chainDict['topo']:
-            stepName = "fast_electron_bBee"
-            return self.getStep(2,stepName,sequenceCfgArray=[fastElectronSequenceCfg], comboHypoCfg=StreamerDiElecFastComboHypoCfg)
+        if "bBeeM6000" in self.chainDict['topo'] and 'BPH-0DR3-EM7J15' not in self.chainDict['L1item']:
+            signatures = self.chainDict['signatures']
+            if signatures.count(signatures[0]) == len(signatures):
+                stepName = "noMuon_fast_electron_bBee"
+                return self.getStep(2,stepName,sequenceCfgArray=[fastElectronSequenceCfg], comboHypoCfg=StreamerNoMuonDiElecFastComboHypoCfg)
+            else:
+                stepName = "fast_electron_bBee"
+                return self.getStep(2,stepName,sequenceCfgArray=[fastElectronSequenceCfg], comboHypoCfg=StreamerDiElecFastComboHypoCfg)
         elif 'idperf' in self.chainPart['idperfInfo']:
             stepName = "fast_electron_idperf"
             return self.getStep(2,stepName,[ fastElectronSequenceCfg_idperf], is_probe_leg=is_probe_leg)
@@ -258,8 +263,13 @@ class ElectronChainConfiguration(ChainConfigurationBase):
             stepName = "precision_electron_Heg"+str(isocut)
             return self.getStep(5,stepName,sequenceCfgArray=[precisionElectronSequenceCfg], comboTools=[diEgammaHegMassComboHypoToolFromDict])
         elif "bBeeM6000" in  self.chainDict['topo']:
-            stepName = "precision_electron_bBee"+isocut
-            return self.getStep(5,stepName,sequenceCfgArray=[precisionElectronSequenceCfg], comboHypoCfg=DiElecPrecisionComboHypoCfg, comboTools=[TrigMultiTrkComboHypoToolFromDict])
+            signatures = self.chainDict['signatures']
+            if signatures.count(signatures[0]) == len(signatures):
+                stepName = "noMuon_precision_electron_bBee"+str(isocut)
+                return self.getStep(5,stepName,sequenceCfgArray=[precisionElectronSequenceCfg], comboHypoCfg=NoMuonDiElecPrecisionComboHypoCfg, comboTools=[TrigMultiTrkComboHypoToolFromDict])
+            else:
+                stepName = "precision_electron_bBee"+str(isocut)
+                return self.getStep(5,stepName,sequenceCfgArray=[precisionElectronSequenceCfg], comboHypoCfg=DiElecPrecisionComboHypoCfg, comboTools=[TrigMultiTrkComboHypoToolFromDict])
         elif self.chainPart['extra'] == 'ion':
             stepName = "precision_ion_electron" + str(isocut)
             return self.getStep(5,stepName,[precisionElectronSequenceCfg_ion], is_probe_leg=is_probe_leg)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
index 16111f4b91d6..ba7b751fb448 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainMerging.py
@@ -478,7 +478,8 @@ def makeCombinedStep(parallel_steps, stepNumber, chainDefList, allSteps = [], cu
             if len(step.sequences) > 1:
                 log.debug("[makeCombinedStep] combining in an already combined chain")
 
-            comboHypo = step.comboHypoCfg
+            if comboHypo is None or step.comboHypoCfg.__name__ != "ComboHypoCfg":
+                comboHypo = step.comboHypoCfg
             currentStepName = step.name
             #remove redundant instances of StepN_ and merged_ (happens when merging already merged chains)
             if re.search('^Step[0-9]_',currentStepName):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index f31e39cd77d9..300933c398dd 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -176,6 +176,10 @@ def setupMenu():
 
         #ATR-22749
         ChainProp(name='HLT_2e5_lhvloose_bBeeM6000_L12EM3', l1SeedThresholds=['EM3'], groups=BphysElectronGroup),
+        ChainProp(name='HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5', l1SeedThresholds=['EM3'], groups=BphysElectronGroup),
+        ChainProp(name='HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5', l1SeedThresholds=['EM7','EM3'], groups=BphysElectronGroup),
+        ChainProp(name='HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15', l1SeedThresholds=['EM7'], groups=BphysElectronGroup),
+        ChainProp(name='HLT_e9_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15', l1SeedThresholds=['EM7'], groups=BphysElectronGroup),
 
         #ART-23577
         ChainProp(name='HLT_e20_lhloose_L1EM7_AFP_A_OR_C', l1SeedThresholds=['EM7'], groups=SingleElectronGroup+LowMuGroup),
@@ -867,6 +871,7 @@ def setupMenu():
         ChainProp(name='HLT_2mu4_bBmumux_BdmumuKst_L12MU3V', stream=["BphysDelayed"], groups=BphysicsGroup+EOFBPhysL1MuGroup),
         ChainProp(name='HLT_2mu4_bBmumux_LbPqKm_L12MU3V', stream=["BphysDelayed"], groups=BphysicsGroup+EOFBPhysL1MuGroup),
         ChainProp(name='HLT_2mu4_bBmumux_BcmumuDsloose_L12MU3V', stream=["BphysDelayed"], groups=BphysicsGroup+EOFBPhysL1MuGroup),
+        ChainProp(name='HLT_2mu4_bBmumux_BcmumuDploose_L12MU3V', stream=["BphysDelayed"], groups=BphysicsGroup+EOFBPhysL1MuGroup),
 
         #ATR-23576; dimuon + L1Topo; primary triggers; should be moved to Physics after validation
         ChainProp(name='HLT_2mu4_bBmumu_Lxy0_L1BPH-2M9-0DR15-2MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup+EOFBPhysL1MuGroup),
@@ -1045,9 +1050,11 @@ def setupMenu():
 
 
         #Combined BPhys
-        #ATR-22749; chain configuration is broken, temporarily comment them out, see ATR-23839
-        #ChainProp(name='HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_mu6_noL2Comb_L1BPH-0M9-EM7-EM5_MU5VF', l1SeedThresholds=['EM7','EM3','MU5VF'], groups=BphysElectronGroup),
-        #ChainProp(name='HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_2mu4_noL2Comb_L1BPH-0M9-EM7-EM5_2MU3V', l1SeedThresholds=['EM7','EM3','MU3V'], groups=BphysElectronGroup),
+        #ATR-22749; chain configuration is broken, temporarily comment them out, see ATR-23839 and ATR-23965
+        #ChainProp(name='HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_mu6_l2io_L1BPH-0M9-EM7-EM5_MU5VF', l1SeedThresholds=['EM7','EM3','MU5VF'], groups=BphysElectronGroup),
+        #ChainProp(name='HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_2mu4_l2io_L1BPH-0M9-EM7-EM5_2MU3V', l1SeedThresholds=['EM7','EM3','MU3V'], groups=BphysElectronGroup),
+        #ChainProp(name='HLT_e5_lhvloose_bBeeM6000_mu6_l2io_L1BPH-0DR3-EM7J15_MU5VF', l1SeedThresholds=['EM7','MU5VF'], groups=BphysElectronGroup),
+        #ChainProp(name='HLT_e5_lhvloose_bBeeM6000_2mu4_l2io_L1BPH-0DR3-EM7J15_2MU3V', l1SeedThresholds=['EM7','MU3V'], groups=BphysElectronGroup),
 
         # Tests of potential TLA chains for cost/rate
         # ATR-19317 - dijet+ISR 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 72f12b0b2ed7..c521388f51dc 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -356,7 +356,7 @@ MuonChainParts_Default = {
 AllowedTopos_Bphysics = [
     'bJpsimumu','bJpsi','bUpsimumu','bUpsi','bBmumu','bDimu','bDimu2700','bDimu6000','bPhi','bTau','bJpsimumul2io',
     'Lxy0',
-    'bBmumux','BpmumuKp','BcmumuPi','BsmumuPhi','BdmumuKst','LbPqKm', 'BcmumuDsloose'
+    'bBmumux','BpmumuKp','BcmumuPi','BsmumuPhi','BdmumuKst','LbPqKm', 'BcmumuDsloose', 'BcmumuDploose'
 ]
 
 # ---- Bphysics Dictionary of all allowed Values ----
-- 
GitLab


From aca5e2aa3b30ebf157a52077cd779838b325a90a Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 5 Aug 2021 23:07:17 -0400
Subject: [PATCH 106/347] LArConditionsCommon: Don't fail if Digitization
 doesn't exist.

Don't fail configuration if the Digitization package doesn't exist.
Helps with testing in partial builds.
(This is a conditions package and that is simulation, so we really
shouldn't be depending on that in the first place.)
---
 .../LArConditionsCommon/share/LArIdMap_MC_jobOptions.py    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/LArCalorimeter/LArExample/LArConditionsCommon/share/LArIdMap_MC_jobOptions.py b/LArCalorimeter/LArExample/LArConditionsCommon/share/LArIdMap_MC_jobOptions.py
index b787a0499d15..660033bacc7d 100755
--- a/LArCalorimeter/LArExample/LArConditionsCommon/share/LArIdMap_MC_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArConditionsCommon/share/LArIdMap_MC_jobOptions.py
@@ -12,8 +12,11 @@ from LArRecUtils.LArRecUtilsConf import LArOnOffMappingAlg, LArFebRodMappingAlg,
 
 larCondFlags.config_idmap_MC() 
 
-from Digitization.DigitizationFlags import digitizationFlags
-isPileUpDigi = digitizationFlags.doXingByXingPileUp()
+isPileUpDigi = False
+from PyUtils.moduleExists import moduleExists
+if moduleExists ('Digitization'):
+  from Digitization.DigitizationFlags import digitizationFlags
+  isPileUpDigi = digitizationFlags.doXingByXingPileUp()
 
 LArDBConnection = ""
 LArDB = "LAR_OFL"
-- 
GitLab


From 4799ed743613311d0360a2b6167c09befb7aa9ae Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 31 Aug 2021 19:47:50 -0400
Subject: [PATCH 107/347] AmdcDb: Enable thread-safety checking.

Enable thread-safety checking.
---
 .../AmdcDb/AmdcDb/ATLAS_CHECK_THREAD_SAFETY   |  1 +
 .../AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx      | 56 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)
 create mode 100644 MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/ATLAS_CHECK_THREAD_SAFETY

diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/ATLAS_CHECK_THREAD_SAFETY b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..b95a3cf3c49f
--- /dev/null
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+MuonSpectrometer/Amdcsimrec/AmdcDb
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx
index a571d091bf4f..5d1aef2c4084 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.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 "AmdcDb/AmdcDbSvcMakerFromRDB.h"
@@ -89,7 +89,7 @@ using namespace AmdcDb_detail;
 namespace {
 
 
-VarDesc AMDC_Vars[] = {
+const VarDesc AMDC_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::String, "VNAME", "NAME"},
   {VarDesc::Int, "LENAMDC", "STRING LENGTH"},
@@ -97,7 +97,7 @@ VarDesc AMDC_Vars[] = {
   {VarDesc::String, "DATA", "(NLINE)-ASCII"},
 };
 
-VarDesc AGDD_Vars[] = {
+const VarDesc AGDD_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::String, "VNAME", "NAME"},
   {VarDesc::Int, "LENAGDD", "STRING LENGTH"},
@@ -105,7 +105,7 @@ VarDesc AGDD_Vars[] = {
   {VarDesc::String, "DATA", "(NLINE)-ASCII"},
 };
 
-VarDesc ATYP_Vars[] = {
+const VarDesc ATYP_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JTYP", "AMDB STATION TYPE"},
   {VarDesc::String, "TYP", "AMDB STATION NAME"},
@@ -114,7 +114,7 @@ VarDesc ATYP_Vars[] = {
 };
 
 
-VarDesc ACUT_Vars[] = {
+const VarDesc ACUT_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "I", "INDEX"},
   {VarDesc::Int, "ICUT", "CUT-OUT INDEX"},
@@ -122,7 +122,7 @@ VarDesc ACUT_Vars[] = {
 };
 
 
-VarDesc WRPC_Vars[] = {
+const VarDesc WRPC_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   //DRING: What is it?       						        
   {VarDesc::Int, "NVRS", "VERSION OF RPC TECHNOLOGY"},
@@ -148,7 +148,7 @@ VarDesc WRPC_Vars[] = {
 };
 
 
-VarDesc AWLN_Vars[] = {
+const VarDesc AWLN_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "JSTA TYPE NUMBER"},
   {VarDesc::FloatCM, "SPITCH", "S-STRIPS PITCH"},
@@ -164,7 +164,7 @@ VarDesc AWLN_Vars[] = {
 };
 
 
-VarDesc WTGC_Vars[] = {
+const VarDesc WTGC_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "JSTA INDEX"},
   {VarDesc::Int, "NBEVOL", "NUMBER OF DETAILS"},
@@ -184,7 +184,7 @@ VarDesc WTGC_Vars[] = {
 };
 
 
-VarDesc GGLN_Vars[] = {
+const VarDesc GGLN_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "JSTA INDEX"},
   {VarDesc::Int, "NWGS_0", "N OF GROUPS OF WIRES (GANG) PER CH. IN E"},
@@ -219,7 +219,7 @@ VarDesc GGLN_Vars[] = {
 };
 
 
-VarDesc ATLN_Vars[] = {
+const VarDesc ATLN_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "I", "INDEX"},
   {VarDesc::Int, "ICOVOL", "MATERIAL CODE"},
@@ -230,7 +230,7 @@ VarDesc ATLN_Vars[] = {
 };
 
 
-VarDesc WCSC_Vars[] = {
+const VarDesc WCSC_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "JSTA TYPE NUMBER"},
   {VarDesc::Int, "LAYCSC", "NBER OF CSCS LAYERS"},
@@ -261,7 +261,7 @@ VarDesc WCSC_Vars[] = {
 };
 
 
-VarDesc DBAM_Vars[] = {
+const VarDesc DBAM_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "NVRS", "VERSION OF READING"},
   {VarDesc::String, "AMDB", "AMDB NAME"},
@@ -272,7 +272,7 @@ VarDesc DBAM_Vars[] = {
 };
 
 
-VarDesc ASMP_Vars[] = {
+const VarDesc ASMP_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "INDX", "STATION NUMBER (INSIDE TYPE)"},
   {VarDesc::Int, "N", "NUMBER OF ELEMENTS"},
@@ -280,7 +280,7 @@ VarDesc ASMP_Vars[] = {
 };
 
 
-VarDesc WDED_Vars[] = {
+const VarDesc WDED_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "INDEX"},
   {VarDesc::Int, "NB", "NUMBER OF DETAILS"},
@@ -290,7 +290,7 @@ VarDesc WDED_Vars[] = {
 };
 
 
-VarDesc WLBI_Vars[] = {
+const VarDesc WLBI_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "INDEX"},
   {VarDesc::Int, "NUM", "NUMBER OF OBJECTS"},
@@ -301,7 +301,7 @@ VarDesc WLBI_Vars[] = {
 };
 
 
-VarDesc WCRO_Vars[] = {
+const VarDesc WCRO_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "INDEX"},
   {VarDesc::Int, "NUM", "NUMBER OF OBJECTS"},
@@ -311,7 +311,7 @@ VarDesc WCRO_Vars[] = {
 };
 
 
-VarDesc WCMI_Vars[] = {
+const VarDesc WCMI_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "INDEX"},
   {VarDesc::Int, "NUM", "NUMBER OF OBJECTS"},
@@ -321,7 +321,7 @@ VarDesc WCMI_Vars[] = {
 };
 
 
-VarDesc WCHV_Vars[] = {
+const VarDesc WCHV_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "INDEX"},
   {VarDesc::Int, "NUM", "NUMBER OF OBJECTS"},
@@ -331,7 +331,7 @@ VarDesc WCHV_Vars[] = {
 };
 
 
-VarDesc WSUP_Vars[] = {
+const VarDesc WSUP_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "INDEX"},
   {VarDesc::Int, "NXXSUP", "MAX NB. FOR X FRAGMENTS"},
@@ -349,7 +349,7 @@ VarDesc WSUP_Vars[] = {
 };
 
 
-VarDesc WSPA_Vars[] = {
+const VarDesc WSPA_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "JSTA", "JSTA INDEX"},
   {VarDesc::Int, "NB", "NUMBER OF DETAILS"},
@@ -358,7 +358,7 @@ VarDesc WSPA_Vars[] = {
 };
 
 
-VarDesc WMDT_Vars[] = {
+const VarDesc WMDT_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::String, "TYP", "NAME"},
   {VarDesc::Int, "IW", "INDEX"},
@@ -380,7 +380,7 @@ VarDesc WMDT_Vars[] = {
 };
 
 
-VarDesc ALIN_Vars[] = {
+const VarDesc ALIN_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::FloatCM, "DX", "X RELATIVE POSITION OF THE SUB-CUT"},
   {VarDesc::FloatCM, "DY", "Y RELATIVE POSITION OF THE SUB-CUT"},
@@ -396,7 +396,7 @@ VarDesc ALIN_Vars[] = {
 };
 
 
-VarDesc ALMN_Vars[] = {
+const VarDesc ALMN_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::Int, "I", "ELEMENT NUMBER"},
   {VarDesc::FloatCM, "DX", "X RELATIVE POSITION OF THE OBJECT"},
@@ -420,7 +420,7 @@ VarDesc ALMN_Vars[] = {
 };
 
 
-VarDesc APTP_Vars[] = {
+const VarDesc APTP_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   //DRING: What is it?
   {VarDesc::Int, "LINE", "LINE NUMBER"},
@@ -446,7 +446,7 @@ VarDesc APTP_Vars[] = {
 };
 
 
-VarDesc ASZT_Vars[] = {
+const VarDesc ASZT_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::String, "TYP", "STATION TYPE"},
   {VarDesc::Int, "JFF", "PHI POSITION"},
@@ -461,7 +461,7 @@ VarDesc ASZT_Vars[] = {
 };
 
 
-VarDesc ISZT_Vars[] = {
+const VarDesc ISZT_Vars[] = {
   {VarDesc::Int, "VERS", "VERSION"},
   {VarDesc::String, "TYP", "STATION TYPE"},
   {VarDesc::Int, "JFF", "PHI POSITION"},
@@ -477,7 +477,7 @@ VarDesc ISZT_Vars[] = {
 };
 
 
-VarDesc HwSwId_Vars[] = {
+const VarDesc HwSwId_Vars[] = {
   {VarDesc::String, "HARDNAME", "Hard name"},
   {VarDesc::String, "SOFTNAME", "Soft name"},
   {VarDesc::Int, "SOFTOCTANT", "Soft octant"},
@@ -485,7 +485,7 @@ VarDesc HwSwId_Vars[] = {
 };
 
 
-VarDesc Xtomo_Vars[] = {
+const VarDesc Xtomo_Vars[] = {
   {VarDesc::String, "XtomoChberName", "XtomoChberName"},
   {VarDesc::String, "XtomoSite", "XtomoSite     "},
   {VarDesc::Int, "XtomoSiteId", "XtomoSiteId   "},
-- 
GitLab


From 2fdd5a53ad2b9366e39d6b48456aa5eb06b898b0 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Sep 2021 13:09:32 -0400
Subject: [PATCH 108/347] GeoModelXml: Fix compilation with gcc11.

Need to convert XMLCh to a char* to use it with a MsgStream.
---
 .../GeoModelXml/src/LogvolProcessor.cxx                | 10 +++++++---
 DetectorDescription/GeoModelXml/src/MakeShaperef.cxx   |  4 +++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/DetectorDescription/GeoModelXml/src/LogvolProcessor.cxx b/DetectorDescription/GeoModelXml/src/LogvolProcessor.cxx
index 65a33e8a23f9..237771bb7102 100644
--- a/DetectorDescription/GeoModelXml/src/LogvolProcessor.cxx
+++ b/DetectorDescription/GeoModelXml/src/LogvolProcessor.cxx
@@ -68,9 +68,11 @@ GeoNameTag *physVolName;
         DOMNode *parent = refShape->getParentNode();
         if (XMLString::compareIString(parent->getNodeName(), XMLString::transcode("shapes")) != 0) {
 
+            char* shape_s = XMLString::transcode (shape);
             msglog << MSG::FATAL << "Processing logvol " << name << 
                     ". Error in gmx file. An IDREF for a logvol shape did not refer to a shape.\n" <<
-                    "Shape ref was " << shape << "; exiting" << endmsg;
+              "Shape ref was " << shape_s << "; exiting" << endmsg;
+            XMLString::release (&shape_s);
             exit (1); // Need to improve...
         }
 //
@@ -92,10 +94,12 @@ GeoNameTag *physVolName;
         parent = refMaterial->getParentNode();
 	XMLCh * materials_tmp = XMLString::transcode("materials");
         if (XMLString::compareIString(parent->getNodeName(), materials_tmp) != 0) {
+            char* material_s = XMLString::transcode (material);
             msglog << MSG::FATAL << "Processing logvol " << name << 
                     ". Error in gmx file. An IDREF for a logvol material did not refer to a material.\n" <<
-                    "Material ref was " << material << "; exiting" << endmsg;
-            exit (1); // Need to improve...
+                    "Material ref was " << material_s << "; exiting" << endmsg;
+           XMLString::release (&material_s);
+           exit (1); // Need to improve...
         }
 
         GeoMaterial *m = (GeoMaterial *) gmxUtil.tagHandler.material.process(refMaterial, gmxUtil);
diff --git a/DetectorDescription/GeoModelXml/src/MakeShaperef.cxx b/DetectorDescription/GeoModelXml/src/MakeShaperef.cxx
index fe8a6a1cf812..7bcb5b2374eb 100644
--- a/DetectorDescription/GeoModelXml/src/MakeShaperef.cxx
+++ b/DetectorDescription/GeoModelXml/src/MakeShaperef.cxx
@@ -31,9 +31,11 @@ const RCBase *MakeShaperef::process(const DOMElement *element, GmxUtil &gmxUtil)
 //
     DOMNode *parent = shape->getParentNode();
     if (XMLString::compareIString(parent->getNodeName(), shapes_tmp) != 0) {
+        char* idref_s = XMLString::transcode (idref);
         OUTPUT_STREAM;
         msglog << MSG::FATAL << "Error processing <shaperef> tag: An IDREF for a shape did not refer to a shape.\nShape ref was " << 
-               idref << "; exiting" << endmsg;
+               idref_s << "; exiting" << endmsg;
+        XMLString::release (&idref_s);
         exit (1); // Need to improve...
     }
 //
-- 
GitLab


From 3fc4d5ae92e8576c18fba75c186c6c3d86ec0101 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Sep 2021 20:24:44 -0400
Subject: [PATCH 109/347] DBLock: Enable thread-safety checking.

Enable thread-safety checking.
---
 Database/DBLock/DBLock/ATLAS_CHECK_THREAD_SAFETY | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 Database/DBLock/DBLock/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Database/DBLock/DBLock/ATLAS_CHECK_THREAD_SAFETY b/Database/DBLock/DBLock/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..11c5dccbfedd
--- /dev/null
+++ b/Database/DBLock/DBLock/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Database/DBLock
-- 
GitLab


From 269e649f996c5c68fde40f0ce0c8dd65e67dc97c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 4 Aug 2021 16:03:31 -0400
Subject: [PATCH 110/347] AthenaServices: Fix clang warning.

Spurious copy in range-for.
---
 Control/AthenaServices/src/AthenaOutputStream.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Control/AthenaServices/src/AthenaOutputStream.cxx b/Control/AthenaServices/src/AthenaOutputStream.cxx
index 690509763bf4..8338597bd1c6 100644
--- a/Control/AthenaServices/src/AthenaOutputStream.cxx
+++ b/Control/AthenaServices/src/AthenaOutputStream.cxx
@@ -1058,7 +1058,7 @@ void AthenaOutputStream::handleVariableSelection (const SG::IConstAuxStore& auxs
   SG::auxid_set_t selected = sel.getSelectedAuxIDs( all );
 
   // Loop over all and build a list of vetoed AuxIDs from non selected ones
-  for( const auto& auxid : all ) {
+  for( const SG::auxid_t auxid : all ) {
     if ( !selected.test( auxid ) ) {
       vset.insert( auxid );
     }
-- 
GitLab


From 931c97359ae39d40a961ce450ce78134050ad89e Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Tue, 14 Sep 2021 21:59:28 +0200
Subject: [PATCH 111/347] change postfix to prefix increment

---
 .../src/DivisiveMultiSeedFinder.cxx           | 137 +-----------------
 .../src/HistogrammingMultiSeedFinder.cxx      |   5 +-
 .../src/SlidingWindowMultiSeedFinder.cxx      |   5 +-
 3 files changed, 8 insertions(+), 139 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx
index e8b401b117a7..c5af16f66fdd 100644
--- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx
+++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx
@@ -4,7 +4,6 @@
 
 #include "InDetMultipleVertexSeedFinder/DivisiveMultiSeedFinder.h"
 #include "TrkTrack/Track.h"
-//#include "TrkParameters/TrackParameters.h"
 #include "TrkToolInterfaces/ITrackSelectorTool.h"
 #include "InDetMultipleVertexSeedFinderUtils/InDetTrackZ0SortingTool.h"
 #include "InDetMultipleVertexSeedFinderUtils/InDetTrackClusterCleaningTool.h"
@@ -151,7 +150,6 @@ namespace InDet
     double currentTrackZ0 = lexPerigee->parameters()[Trk::z0];
     delete lexPerigee;
   
-//    double currentTrackZ0 = preselectedTracks[indexOfSorted[i]]->perigeeParameters()->parameters()[Trk::z0];
    
     if(fabs(currentTrackZ0 - lastTrackZ0)<m_sepDistance)
     {
@@ -269,7 +267,7 @@ namespace InDet
     std::vector<const Trk::TrackParameters*> perigeeList;
     std::vector<const Trk::TrackParticleBase*>::const_iterator trackBegin=tracks.begin();
     std::vector<const Trk::TrackParticleBase*>::const_iterator trackEnd=tracks.end();
-    for (std::vector<const Trk::TrackParticleBase*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;trackIter++)
+    for (std::vector<const Trk::TrackParticleBase*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;++trackIter)
     {
       perigeeList.push_back(&((*trackIter)->definingParameters()));
     }
@@ -284,7 +282,6 @@ namespace InDet
 
   }
 
- // std::cout<<"Number after pre-selection : "<<preselectedTracks.size()<<std::endl;
   
 //step 2: sorting in z0
 //output container  
@@ -439,9 +436,7 @@ namespace InDet
   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;
+
 
    for (std::vector<const xAOD::TrackParticle*>::const_iterator itr  = tracks.begin(); itr != tracks.end(); ++itr) {
      if (m_trkFilter->decision(**itr,beamposition)) preselectedTracks.push_back(*itr);
@@ -452,7 +447,7 @@ namespace InDet
     std::vector<const Trk::TrackParameters*> perigeeList;
     std::vector<const xAOD::TrackParticle*>::const_iterator trackBegin=tracks.begin();
     std::vector<const xAOD::TrackParticle*>::const_iterator trackEnd=tracks.end();
-    for (std::vector<const xAOD::TrackParticle*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;trackIter++)
+    for (std::vector<const xAOD::TrackParticle*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;++trackIter)
     {
       perigeeList.push_back(&((*trackIter)->perigeeParameters()));
     }
@@ -471,7 +466,6 @@ namespace InDet
 	    beamposition->setCovariancePosition(myVertex->covariancePosition());
 	  }
 
- // std::cout<<"Number after pre-selection : "<<preselectedTracks.size()<<std::endl;
   
 //step 2: sorting in z0
 //output container  
@@ -621,128 +615,5 @@ namespace InDet
   return result;
     
   }
-  /*
-  std::vector<int> DivisiveMultiSeedFinder::m_z0sort(std::vector<const xAOD::TrackParticle*>& tracks,xAOD::Vertex * reference) const
-  {
-    
-    // std::vector<int> no_perigee(0);
-    std::map<double, int> mapOfZ0; 
-    std::vector<const xAOD::TrackParticle*>::const_iterator tb = tracks.begin();
-    std::vector<const xAOD::TrackParticle*>::const_iterator te = tracks.end();
-    unsigned int j=0;
-    
-    for(;tb != te ;++tb)
-      {
-	const Trk::TrackParameters * perigee = 0;
-	
-	
-	//here we want to make an extrapolation    
-	Trk::PerigeeSurface perigeeSurface(reference->position());
-	perigee = m_extrapolator->extrapolate(**tb,
-					      perigeeSurface,
-					      Trk::anyDirection,true, Trk::pion);  
-	
-	if(perigee)
-	  {
-	    double trkZ0 = perigee->parameters()[Trk::z0];
-	    mapOfZ0.insert(std::map<double, int>::value_type(trkZ0,j)); 
-	    delete perigee;
-	    perigee =0;
-	    
-	  }else{
-	  msg(MSG::WARNING)  << "This track particle has no perigee state. Not egligible for sorting. Will NOT be written to the sorted vector" << endmsg;
-	  //    no_perigee.push_back(j);
-	}//end of perigee existance check
-	++j;
-      }//end of loop over all track particle base's
-    
-    //creating an output vector, filling it and returning
-    std::vector<int> result(0);
-    
-    //sorted part  
-    std::map<double, int>::const_iterator mb = mapOfZ0.begin();
-    std::map<double, int>::const_iterator me = mapOfZ0.end(); 
-    for(;mb!=me;++mb) result.push_back((*mb).second);
-    
-    //part failed sorting
-    //  std::vector<int>::const_iterator ib = no_perigee.begin();
-    //  std::vector<int>::const_iterator ie = no_perigee.end();
-    //  for(;ib!=ie;++ib) result.push_back(*ib);  
-    return result;
-  }
-  */
-  /*
-  std::pair<std::vector<const Trk::TrackParameters *>, 
-	    std::vector<const xAOD::TrackParticle *> > DivisiveMultiSeedFinder::m_clusterAndOutliers(std::vector<const xAOD::TrackParticle *> cluster, xAOD::Vertex * reference) const
-	    {
-	      
-	      std::vector<const Trk::TrackParameters*> clusterSeed(0);
-	      std::vector<const xAOD::TrackParticle*> outliers(0);
-	      
-	      double z_center = 0;
-	      
-	      std::vector<const xAOD::TrackParticle*>::const_iterator inb = cluster.begin();
-	      std::vector<const xAOD::TrackParticle*>::const_iterator ine = cluster.end();
-	      
-	      unsigned int cluster_size = 0;
-	      
-	      msg(MSG::DEBUG)<<"Receiving a cluster of size: "<< cluster.size()<<endmsg;
-	      
-	      Trk::PerigeeSurface perigeeSurface(reference->position());
-	      
-	      //first getting the cluster center  
-	      for(std::vector<const xAOD::TrackParticle*>::const_iterator i = inb; i != ine; ++i)
-		{
-		  const Trk::TrackParameters * perigee(0);
-	  
-		  perigee = m_extrapolator->extrapolate(**i,perigeeSurface,Trk::anyDirection,true, Trk::pion);
-		  
-		  if(perigee)
-		    { 
-		      z_center += perigee->parameters()[Trk::z0];
-		      msg(MSG::DEBUG)<<"Adding parameters: "<<perigee->parameters()[Trk::z0] <<endmsg;
-		      ++cluster_size;
-		    }else{
-		    msg(MSG::WARNING)<<" The TrackParticleBase provided does not contain perigee parameters"<<endmsg;
-		  }//end of perigee security check
-		}//end of loop definig the center of a cluster
-	      msg(MSG::DEBUG)<<"Z center is: "<<z_center<<" for  tracks: "<<cluster_size<<endmsg;
-	      
-	      z_center = z_center/cluster_size;
-	      
-	      msg(MSG::DEBUG)<<"Looping over the cluster" <<endmsg;
-	      
-	      for(std::vector<const xAOD::TrackParticle*>::const_iterator i = inb; i != ine; ++i)
-		{
-		  const Trk::TrackParameters * measPerigee(0);
-		  measPerigee = m_extrapolator->extrapolate(**i,perigeeSurface,Trk::anyDirection,true, Trk::pion);
-		  
-		  if(0!=measPerigee)
-		    {
-		      double z0 = measPerigee->parameters()[Trk::z0];
-		      const AmgSymMatrix(5) * cov = measPerigee->covariance();    
-		      double sigma_z0 = Amg::error(*cov,Trk::z0);
-		      
-		      msg(MSG::DEBUG)<<"Perigee Z0 and corresponding sigma "<<z0<<" "<<sigma_z0<<endmsg;
-		      msg(MSG::DEBUG)<<"Center of the cluster "<<z_center<<endmsg;
-		      msg(MSG::DEBUG)<<"Offset "<<3.0<<endmsg;
-		      msg(MSG::DEBUG)<<"discriminant "<<fabs(z_center-z0)<<" "<< sigma_z0*3.0 <<endmsg;
-		      
-		      //if the track is closer than several standard deviations, keep it    
-		      if(fabs(z_center-z0)< sigma_z0*3.0) clusterSeed.push_back(&((*i)->perigeeParameters())); 
-		      
-		      //declare it an outlier otherwise
-		      else outliers.push_back(*i);
-		    }else{
-		    outliers.push_back(*i);
-		    msg(MSG::WARNING)  << "This track has no meas perigee. Regarded as outlyer" << endmsg;
-		  }//end of measured perigee check
-		}//end of separation loop
-	      
-	      std::pair<std::vector<const Trk::TrackParameters *>, 
-		std::vector<const xAOD::TrackParticle *> > result(clusterSeed, outliers);
-	      return result;
-	      
-	    }
-  */  
+ 
 }//end of namespace definitions
diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx
index 723ae4e038d0..3f17911b0f03 100644
--- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx
+++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx
@@ -4,7 +4,6 @@
 
 #include "InDetMultipleVertexSeedFinder/HistogrammingMultiSeedFinder.h"
 #include "TrkTrack/Track.h"
-//#include "TrkParameters/TrackParameters.h"
 #include "TrkToolInterfaces/ITrackSelectorTool.h"
 #include "InDetMultipleVertexSeedFinderUtils/InDetTrackClusterCleaningTool.h"
 #include "TrkParticleBase/TrackParticleBase.h"
@@ -264,7 +263,7 @@ namespace InDet
     std::vector<const Trk::TrackParameters*> perigeeList;
     std::vector<const Trk::TrackParticleBase*>::const_iterator trackBegin=tracks.begin();
     std::vector<const Trk::TrackParticleBase*>::const_iterator trackEnd=tracks.end();
-    for (std::vector<const Trk::TrackParticleBase*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;trackIter++)
+    for (std::vector<const Trk::TrackParticleBase*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;++trackIter)
     {
       perigeeList.push_back(&((*trackIter)->definingParameters()));
     }
@@ -434,7 +433,7 @@ namespace InDet
     std::vector<const Trk::TrackParameters*> perigeeList;
     std::vector<const xAOD::TrackParticle*>::const_iterator trackBegin=tracks.begin();
     std::vector<const xAOD::TrackParticle*>::const_iterator trackEnd=tracks.end();
-    for (std::vector<const xAOD::TrackParticle*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;trackIter++)
+    for (std::vector<const xAOD::TrackParticle*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;++trackIter)
     {
       perigeeList.push_back(&((*trackIter)->perigeeParameters()));
     }
diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx
index 2b2ea28f871f..f5b87237ccde 100644
--- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx
+++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx
@@ -3,7 +3,6 @@
 */
 
 #include "InDetMultipleVertexSeedFinder/SlidingWindowMultiSeedFinder.h"
-//#include "TrkParameters/TrackParameters.h"
 #include "TrkTrack/Track.h"
 #include "VxVertex/Vertex.h"
 
@@ -207,7 +206,7 @@ namespace InDet
     std::vector<const Trk::TrackParameters*> perigeeList;
     std::vector<const Trk::TrackParticleBase*>::const_iterator trackBegin=tracks.begin();
     std::vector<const Trk::TrackParticleBase*>::const_iterator trackEnd=tracks.end();
-    for (std::vector<const Trk::TrackParticleBase*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;trackIter++)
+    for (std::vector<const Trk::TrackParticleBase*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;++trackIter)
     {
       perigeeList.push_back(&((*trackIter)->definingParameters()));
     }
@@ -332,7 +331,7 @@ std::vector< std::vector<const Trk::TrackParameters *> > SlidingWindowMultiSeedF
     std::vector<const Trk::TrackParameters*> perigeeList;
     std::vector<const xAOD::TrackParticle*>::const_iterator trackBegin=tracks.begin();
     std::vector<const xAOD::TrackParticle*>::const_iterator trackEnd=tracks.end();
-    for (std::vector<const xAOD::TrackParticle*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;trackIter++)
+    for (std::vector<const xAOD::TrackParticle*>::const_iterator trackIter=trackBegin;trackIter!=trackEnd;++trackIter)
       {
 	perigeeList.push_back(&((*trackIter)->perigeeParameters()));
       }
-- 
GitLab


From 61a95c8c5792798291bb7dfb1b181ee01de3c35b Mon Sep 17 00:00:00 2001
From: aakilgal <aakilgal@hepatl34.uoregon.edu>
Date: Tue, 14 Sep 2021 14:17:56 -0700
Subject: [PATCH 112/347] Added new emerging jets chains

---
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 497 +++++++++++++++---
 .../share/ref_v1Dev_decodeBS_build.ref        | 120 ++++-
 .../python/HLTMenuConfig/Menu/LS2_v1.py       |  77 ++-
 3 files changed, 611 insertions(+), 83 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index a17147e56e33..603b467d90a5 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -175,10 +175,78 @@ HLT_2j100_L1CEP-CjJ50:
   eventCount: 0
 HLT_2j100_L1CEP-CjJ60:
   eventCount: 0
+HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 14
+    1: 7
+  stepFeatures:
+    0: 14
+    1: 18
+HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 14
+    1: 7
+  stepFeatures:
+    0: 14
+    1: 18
+    2: 1
+HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 14
+    1: 7
+  stepFeatures:
+    0: 14
+    1: 18
+    2: 3
+HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 14
+    1: 7
+  stepFeatures:
+    0: 14
+    1: 18
 HLT_2j120_mb_afprec_afpdijet_L1CEP-CjJ50:
   eventCount: 0
 HLT_2j135_mb_afprec_afpdijet_L1CEP-CjJ60:
   eventCount: 0
+HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J100:
+  eventCount: 0
+  stepCounts:
+    0: 5
+    1: 3
+  stepFeatures:
+    0: 5
+    1: 6
+HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J100:
+  eventCount: 0
+  stepCounts:
+    0: 5
+    1: 3
+  stepFeatures:
+    0: 5
+    1: 6
+    2: 1
+HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100:
+  eventCount: 0
+  stepCounts:
+    0: 5
+    1: 3
+  stepFeatures:
+    0: 5
+    1: 6
+    2: 1
+HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J100:
+  eventCount: 0
+  stepCounts:
+    0: 5
+    1: 3
+  stepFeatures:
+    0: 5
+    1: 6
 HLT_2j20_mb_afprec_afpdijet_L1RD0_FILLED:
   eventCount: 0
   stepCounts:
@@ -4631,6 +4699,155 @@ HLT_g45_loose_6j45_L14J15p0ETA25:
     1: 8
     2: 8
     3: 4
+HLT_g45_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 9
+    1: 7
+    2: 7
+    3: 5
+    4: 5
+    5: 4
+  stepFeatures:
+    0: 14
+    1: 10
+    2: 10
+    3: 5
+    4: 5
+    5: 13
+HLT_g45_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 9
+    1: 7
+    2: 7
+    3: 5
+    4: 5
+    5: 4
+  stepFeatures:
+    0: 14
+    1: 10
+    2: 10
+    3: 5
+    4: 5
+    5: 13
+HLT_g45_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 1
+  stepCounts:
+    0: 9
+    1: 7
+    2: 7
+    3: 5
+    4: 5
+    5: 4
+    6: 1
+  stepFeatures:
+    0: 14
+    1: 10
+    2: 10
+    3: 5
+    4: 5
+    5: 13
+    6: 2
+HLT_g45_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 9
+    1: 7
+    2: 7
+    3: 5
+    4: 5
+    5: 3
+  stepFeatures:
+    0: 14
+    1: 10
+    2: 10
+    3: 5
+    4: 5
+    5: 8
+HLT_g45_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 9
+    1: 7
+    2: 7
+    3: 5
+    4: 5
+    5: 3
+  stepFeatures:
+    0: 14
+    1: 10
+    2: 10
+    3: 5
+    4: 5
+    5: 8
+HLT_g45_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 1
+  stepCounts:
+    0: 9
+    1: 7
+    2: 7
+    3: 5
+    4: 5
+    5: 3
+    6: 1
+  stepFeatures:
+    0: 14
+    1: 10
+    2: 10
+    3: 5
+    4: 5
+    5: 8
+    6: 2
+HLT_g45_tight_icaloloose_3j35_pf_ftf_0eta240_2j55_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 9
+    1: 7
+    2: 7
+    3: 5
+    4: 5
+    5: 3
+  stepFeatures:
+    0: 14
+    1: 10
+    2: 10
+    3: 5
+    4: 10
+    5: 27
+HLT_g45_tight_icaloloose_3j35_pf_ftf_0eta240_2j55_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 9
+    1: 7
+    2: 7
+    3: 5
+    4: 5
+    5: 3
+  stepFeatures:
+    0: 14
+    1: 10
+    2: 10
+    3: 5
+    4: 10
+    5: 27
+HLT_g45_tight_icaloloose_3j35_pf_ftf_0eta240_2j55_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 9
+    1: 7
+    2: 7
+    3: 5
+    4: 5
+    5: 3
+  stepFeatures:
+    0: 14
+    1: 10
+    2: 10
+    3: 5
+    4: 10
+    5: 27
+    6: 4
 HLT_g50_loose_L1EM20VH:
   eventCount: 4
   stepCounts:
@@ -4657,6 +4874,106 @@ HLT_g60_loose_L1EM22VHI:
     3: 3
 HLT_g60_loose_LArPEBHLT_L1EM20VHI:
   eventCount: 0
+HLT_g60_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 4
+    1: 4
+    2: 4
+    3: 2
+    4: 2
+    5: 2
+  stepFeatures:
+    0: 9
+    1: 7
+    2: 7
+    3: 2
+    4: 2
+    5: 7
+HLT_g60_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 4
+    1: 4
+    2: 4
+    3: 2
+    4: 2
+    5: 2
+  stepFeatures:
+    0: 9
+    1: 7
+    2: 7
+    3: 2
+    4: 2
+    5: 7
+HLT_g60_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 1
+  stepCounts:
+    0: 4
+    1: 4
+    2: 4
+    3: 2
+    4: 2
+    5: 2
+    6: 1
+  stepFeatures:
+    0: 9
+    1: 7
+    2: 7
+    3: 2
+    4: 2
+    5: 7
+    6: 2
+HLT_g60_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 4
+    1: 4
+    2: 4
+    3: 2
+    4: 2
+    5: 2
+  stepFeatures:
+    0: 9
+    1: 7
+    2: 7
+    3: 2
+    4: 2
+    5: 5
+HLT_g60_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 4
+    1: 4
+    2: 4
+    3: 2
+    4: 2
+    5: 2
+  stepFeatures:
+    0: 9
+    1: 7
+    2: 7
+    3: 2
+    4: 2
+    5: 5
+HLT_g60_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 1
+  stepCounts:
+    0: 4
+    1: 4
+    2: 4
+    3: 2
+    4: 2
+    5: 2
+    6: 1
+  stepFeatures:
+    0: 9
+    1: 7
+    2: 7
+    3: 2
+    4: 2
+    5: 5
+    6: 2
 HLT_g80_loose_L1EM22VHI:
   eventCount: 2
   stepCounts:
@@ -4685,6 +5002,54 @@ HLT_g85_tight_3j50_L1EM22VHI:
     2: 6
     3: 1
     4: 5
+HLT_g85_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 3
+    1: 3
+    2: 3
+    3: 1
+    4: 1
+    5: 1
+  stepFeatures:
+    0: 7
+    1: 6
+    2: 6
+    3: 1
+    4: 1
+    5: 2
+HLT_g85_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 3
+    1: 3
+    2: 3
+    3: 1
+    4: 1
+    5: 1
+  stepFeatures:
+    0: 7
+    1: 6
+    2: 6
+    3: 1
+    4: 1
+    5: 2
+HLT_g85_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 3
+    1: 3
+    2: 3
+    3: 1
+    4: 1
+    5: 1
+  stepFeatures:
+    0: 7
+    1: 6
+    2: 6
+    3: 1
+    4: 1
+    5: 2
 HLT_g90_loose_xe90_cell_L1EM22VHI:
   eventCount: 0
   stepCounts:
@@ -4947,26 +5312,6 @@ HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1SC111-CJ15:
     0: 5
     1: 10
     2: 2
-HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1J100:
-  eventCount: 4
-  stepCounts:
-    0: 5
-    1: 5
-    2: 4
-  stepFeatures:
-    0: 5
-    1: 10
-    2: 5
-HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1SC111-CJ15:
-  eventCount: 4
-  stepCounts:
-    0: 5
-    1: 5
-    2: 4
-  stepFeatures:
-    0: 5
-    1: 10
-    2: 5
 HLT_j110_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100:
   eventCount: 0
   stepCounts:
@@ -4991,6 +5336,42 @@ HLT_j110_a10sd_cssk_pf_jes_ftf_L1J30:
   stepFeatures:
     0: 17
     1: 21
+HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 14
+    1: 14
+  stepFeatures:
+    0: 14
+    1: 25
+HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J50:
+  eventCount: 1
+  stepCounts:
+    0: 14
+    1: 14
+    2: 1
+  stepFeatures:
+    0: 14
+    1: 25
+    2: 1
+HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J50:
+  eventCount: 5
+  stepCounts:
+    0: 14
+    1: 14
+    2: 5
+  stepFeatures:
+    0: 14
+    1: 25
+    2: 5
+HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 14
+    1: 14
+  stepFeatures:
+    0: 14
+    1: 25
 HLT_j110_a10t_lcw_jes_L1J30:
   eventCount: 16
   stepCounts:
@@ -5144,26 +5525,6 @@ HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1SC111-CJ15:
     0: 5
     1: 7
     2: 2
-HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1J100:
-  eventCount: 4
-  stepCounts:
-    0: 5
-    1: 4
-    2: 4
-  stepFeatures:
-    0: 5
-    1: 7
-    2: 5
-HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1SC111-CJ15:
-  eventCount: 4
-  stepCounts:
-    0: 5
-    1: 4
-    2: 4
-  stepFeatures:
-    0: 5
-    1: 7
-    2: 5
 HLT_j175_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100:
   eventCount: 0
   stepCounts:
@@ -5188,6 +5549,42 @@ HLT_j175_a10sd_cssk_pf_jes_ftf_L1J50:
   stepFeatures:
     0: 14
     1: 10
+HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J100:
+  eventCount: 0
+  stepCounts:
+    0: 5
+    1: 5
+  stepFeatures:
+    0: 5
+    1: 8
+HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J100:
+  eventCount: 1
+  stepCounts:
+    0: 5
+    1: 5
+    2: 1
+  stepFeatures:
+    0: 5
+    1: 8
+    2: 1
+HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100:
+  eventCount: 2
+  stepCounts:
+    0: 5
+    1: 5
+    2: 2
+  stepFeatures:
+    0: 5
+    1: 8
+    2: 2
+HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J100:
+  eventCount: 0
+  stepCounts:
+    0: 5
+    1: 5
+  stepFeatures:
+    0: 5
+    1: 8
 HLT_j175_a10t_lcw_jes_L1J50:
   eventCount: 9
   stepCounts:
@@ -5396,26 +5793,6 @@ HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1SC111-CJ15:
   stepFeatures:
     0: 5
     1: 5
-HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1J100:
-  eventCount: 3
-  stepCounts:
-    0: 5
-    1: 4
-    2: 3
-  stepFeatures:
-    0: 5
-    1: 5
-    2: 3
-HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1SC111-CJ15:
-  eventCount: 3
-  stepCounts:
-    0: 5
-    1: 4
-    2: 3
-  stepFeatures:
-    0: 5
-    1: 5
-    2: 3
 HLT_j260_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100:
   eventCount: 0
   stepCounts:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index a5b647448f10..17d96f09f0b9 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -72,10 +72,42 @@ HLT_2j100_L1CEP-CjJ50:
   eventCount: 0
 HLT_2j100_L1CEP-CjJ60:
   eventCount: 0
+HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 4
+  stepFeatures:
+    0: 4
+HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 4
+  stepFeatures:
+    0: 4
+HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 4
+  stepFeatures:
+    0: 4
+HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 4
+  stepFeatures:
+    0: 4
 HLT_2j120_mb_afprec_afpdijet_L1CEP-CjJ50:
   eventCount: 0
 HLT_2j135_mb_afprec_afpdijet_L1CEP-CjJ60:
   eventCount: 0
+HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J100:
+  eventCount: 0
+HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J100:
+  eventCount: 0
+HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100:
+  eventCount: 0
+HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J100:
+  eventCount: 0
 HLT_2j20_mb_afprec_afpdijet_L1RD0_FILLED:
   eventCount: 0
   stepCounts:
@@ -1538,18 +1570,54 @@ HLT_g40_loose_mu40_msonly_L1MU14FCH:
   eventCount: 0
 HLT_g45_loose_6j45_L14J15p0ETA25:
   eventCount: 0
+HLT_g45_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g45_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g45_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g45_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g45_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g45_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g45_tight_icaloloose_3j35_pf_ftf_0eta240_2j55_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g45_tight_icaloloose_3j35_pf_ftf_0eta240_2j55_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g45_tight_icaloloose_3j35_pf_ftf_0eta240_2j55_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 0
 HLT_g50_loose_L1EM20VH:
   eventCount: 0
 HLT_g60_loose_L1EM22VHI:
   eventCount: 0
 HLT_g60_loose_LArPEBHLT_L1EM20VHI:
   eventCount: 0
+HLT_g60_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g60_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g60_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g60_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g60_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g60_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 0
 HLT_g80_loose_L1EM22VHI:
   eventCount: 0
 HLT_g80_loose_LArPEBHLT_L1EM20VHI:
   eventCount: 0
 HLT_g85_tight_3j50_L1EM22VHI:
   eventCount: 0
+HLT_g85_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g85_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI:
+  eventCount: 0
+HLT_g85_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI:
+  eventCount: 0
 HLT_g90_loose_xe90_cell_L1EM22VHI:
   eventCount: 0
 HLT_j0_DIJET20j12etXX110djmass_L1J20:
@@ -1690,10 +1758,6 @@ HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100:
   eventCount: 0
 HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1SC111-CJ15:
   eventCount: 0
-HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1J100:
-  eventCount: 0
-HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1SC111-CJ15:
-  eventCount: 0
 HLT_j110_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100:
   eventCount: 0
 HLT_j110_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1SC111-CJ15:
@@ -1706,6 +1770,38 @@ HLT_j110_a10sd_cssk_pf_jes_ftf_L1J30:
   stepFeatures:
     0: 7
     1: 5
+HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 4
+    1: 1
+  stepFeatures:
+    0: 4
+    1: 1
+HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 4
+    1: 1
+  stepFeatures:
+    0: 4
+    1: 1
+HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 4
+    1: 1
+  stepFeatures:
+    0: 4
+    1: 1
+HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J50:
+  eventCount: 0
+  stepCounts:
+    0: 4
+    1: 1
+  stepFeatures:
+    0: 4
+    1: 1
 HLT_j110_a10t_lcw_jes_L1J30:
   eventCount: 4
   stepCounts:
@@ -1780,10 +1876,6 @@ HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100:
   eventCount: 0
 HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1SC111-CJ15:
   eventCount: 0
-HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1J100:
-  eventCount: 0
-HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1SC111-CJ15:
-  eventCount: 0
 HLT_j175_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100:
   eventCount: 0
 HLT_j175_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1SC111-CJ15:
@@ -1794,6 +1886,14 @@ HLT_j175_a10sd_cssk_pf_jes_ftf_L1J50:
     0: 4
   stepFeatures:
     0: 4
+HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J100:
+  eventCount: 0
+HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J100:
+  eventCount: 0
+HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100:
+  eventCount: 0
+HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J100:
+  eventCount: 0
 HLT_j175_a10t_lcw_jes_L1J50:
   eventCount: 0
 HLT_j175_mb_afprec_afpdijet_L1AFP_A_AND_C_TOF_J75:
@@ -1880,10 +1980,6 @@ HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100:
   eventCount: 0
 HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1SC111-CJ15:
   eventCount: 0
-HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1J100:
-  eventCount: 0
-HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1SC111-CJ15:
-  eventCount: 0
 HLT_j260_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100:
   eventCount: 0
 HLT_j260_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1SC111-CJ15:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index cb9c60d55973..d6abefdd850a 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -474,42 +474,68 @@ def setupMenu():
         # Piggybacking on HH4b, exact thresholds for preselections to be determined later - this is for rate and cost
         ChainProp(name='HLT_j60_j45_2j20_JetDS_L1J45p0ETA21_3J15p0ETA25', l1SeedThresholds=['FSNOSEED']*3, stream=['JetDS'], groups=PrimaryLegGroup+MultiJetGroup),
 
+        # Emerging Jets test chains ATR-21593
+
+        # dijet emtopo RC jets
         ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p0dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p1dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
 
         ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p0dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p1dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
 
         ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p0dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p1dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
 
         ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p0dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p1dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1SC111-CJ15',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
 
         ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p0dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p1dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1SC111-CJ15',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
 
         ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p0dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p1dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p2dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
-        ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_ExoticPTF0p3dR1p2_L1SC111-CJ15', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+
+        # dijet pflow jet chains
+        ChainProp(name='HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+
+        ChainProp(name='HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J50', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J50', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J50', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+
+        ChainProp(name='HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J100', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+
+        ChainProp(name='HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p0dR1p2_L1J50', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p1dR1p2_L1J50', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_ExoticPTF0p2dR1p2_L1J50', groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+
+        # dijet Trackless jets chains
+        ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1J100',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+
+        ChainProp(name='HLT_j260_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1SC111-CJ15',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_j175_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1SC111-CJ15',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
         ChainProp(name='HLT_j110_a10r_subjesIS_ftf_0eta200_TracklessdR1p2_L1SC111-CJ15',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
 
+        ChainProp(name='HLT_j175_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J100',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_j110_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J50',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_2j175_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J100',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+        ChainProp(name='HLT_2j110_a10sd_pf_nojcalib_ftf_0eta200_TracklessdR1p2_L1J50',    groups=SingleJetGroup, l1SeedThresholds=['FSNOSEED']),
+
+        # end of emerging jets chains
+
+
+
        
         # ATR-22096
         ChainProp(name='HLT_j420_ftf_L1J100', l1SeedThresholds=['FSNOSEED'],             groups=SingleJetGroup+SupportLegGroup),
@@ -1127,6 +1153,35 @@ def setupMenu():
         ChainProp(name='HLT_e14_lhtight_mu6_dRAB15_invmAB10_L1LFV-eEM12L-MU5VF', l1SeedThresholds=['eEM10L','MU5VF'], stream=[PhysicsStream], groups=BphysicsGroup), #TODO: eEM12L->eEM10L in HLT seeding to fix
         ChainProp(name='HLT_e12_lhtight_mu11_dRAB15_invmAB10_L1LFV-eEM8L-MU8VF', l1SeedThresholds=['eEM8L','MU8VF'], stream=[PhysicsStream], groups=BphysicsGroup),    
 
+
+        # Emerging Jets test chains ATR-21593
+        # dijet + photon pflow emerging jets chains
+        ChainProp(name='HLT_g85_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+        ChainProp(name='HLT_g85_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+        ChainProp(name='HLT_g85_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+
+        ChainProp(name='HLT_g60_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+        ChainProp(name='HLT_g60_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+        ChainProp(name='HLT_g60_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+
+        ChainProp(name='HLT_g45_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+        ChainProp(name='HLT_g45_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+        ChainProp(name='HLT_g45_tight_icaloloose_2j85_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+
+
+        ChainProp(name='HLT_g45_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+        ChainProp(name='HLT_g45_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+        ChainProp(name='HLT_g45_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+
+        ChainProp(name='HLT_g60_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+        ChainProp(name='HLT_g60_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+        ChainProp(name='HLT_g60_tight_icaloloose_2j55_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED']),
+
+        ChainProp(name='HLT_g45_tight_icaloloose_3j35_pf_ftf_0eta240_2j55_pf_ftf_0eta200_ExoticPTF0p0dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup+MultiJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED','FSNOSEED']),
+        ChainProp(name='HLT_g45_tight_icaloloose_3j35_pf_ftf_0eta240_2j55_pf_ftf_0eta200_ExoticPTF0p1dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup+MultiJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED','FSNOSEED']),
+        ChainProp(name='HLT_g45_tight_icaloloose_3j35_pf_ftf_0eta240_2j55_pf_ftf_0eta200_ExoticPTF0p2dR1p2_L1EM22VHI', groups=PrimaryLegGroup+EgammaJetGroup+MultiJetGroup, l1SeedThresholds=['EM22VHI','FSNOSEED','FSNOSEED']),
+
+
         ]
 
     TriggerFlags.HeavyIonSlice.signatures  = TriggerFlags.HeavyIonSlice.signatures() + []
-- 
GitLab


From d353228278868ff3fdcbdb84b391f7cd52d91794 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Wed, 15 Sep 2021 09:07:08 +0200
Subject: [PATCH 113/347] Do not allow MT in smart merge jobs

---
 Tools/PyJobTransforms/python/trfArgClasses.py | 15 ++++++++----
 Tools/PyJobTransforms/python/trfExe.py        | 23 +++++++++++++++----
 2 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/Tools/PyJobTransforms/python/trfArgClasses.py b/Tools/PyJobTransforms/python/trfArgClasses.py
index 5b6c6f97b3a8..7065e81f303e 100644
--- a/Tools/PyJobTransforms/python/trfArgClasses.py
+++ b/Tools/PyJobTransforms/python/trfArgClasses.py
@@ -1359,7 +1359,8 @@ class argPOOLFile(argAthenaFile):
         myMergeConf = executorConfig(myargdict, myDataDictionary)
         myMerger = athenaExecutor(name='POOLMergeAthenaMP{0}{1}'.format(self._subtype, counter), conf=myMergeConf, 
                                   skeletonFile = 'RecJobTransforms/skeleton.MergePool_tf.py',
-                                  inData=set(['POOL_MRG_INPUT']), outData=set(['POOL_MRG_OUTPUT']), disableMP=True)
+                                  inData=set(['POOL_MRG_INPUT']), outData=set(['POOL_MRG_OUTPUT']),
+                                  disableMT=True, disableMP=True)
         myMerger.doAll(input=set(['POOL_MRG_INPUT']), output=set(['POOL_MRG_OUTPUT']))
         
         # OK, if we got to here with no exceptions, we're good shape
@@ -1396,7 +1397,8 @@ class argHITSFile(argPOOLFile):
         myMergeConf = executorConfig(myargdict, myDataDictionary)
         myMerger = athenaExecutor(name = mySubstepName, skeletonFile = 'SimuJobTransforms/skeleton.HITSMerge.py',
                                   conf=myMergeConf, 
-                                  inData=set(['HITS']), outData=set(['HITS_MRG']), disableMP=True)
+                                  inData=set(['HITS']), outData=set(['HITS_MRG']),
+                                  disableMT=True, disableMP=True)
         myMerger.doAll(input=set(['HITS']), output=set(['HITS_MRG']))
         
         # OK, if we got to here with no exceptions, we're good shape
@@ -1434,7 +1436,8 @@ class argEVNT_TRFile(argPOOLFile):
         myMergeConf = executorConfig(myargdict, myDataDictionary)
         myMerger = athenaExecutor(name = mySubstepName, skeletonFile = 'SimuJobTransforms/skeleton.EVNT_TRMerge.py',
                                   conf=myMergeConf, 
-                                  inData=set(['EVNT_TR']), outData=set(['EVNT_TR_MRG']), disableMP=True)
+                                  inData=set(['EVNT_TR']), outData=set(['EVNT_TR_MRG']),
+                                  disableMT=True, disableMP=True)
         myMerger.doAll(input=set(['EVNT_TR']), output=set(['EVNT_TR_MRG']))
         
         # OK, if we got to here with no exceptions, we're good shape
@@ -1471,7 +1474,8 @@ class argRDOFile(argPOOLFile):
         myMergeConf = executorConfig(myargdict, myDataDictionary)
         myMerger = athenaExecutor(name = 'RDOMergeAthenaMP{0}'.format(counter), skeletonFile = 'RecJobTransforms/skeleton.MergeRDO_tf.py',
                                   conf=myMergeConf, 
-                                  inData=set(['RDO']), outData=set(['RDO_MRG']), disableMP=True)
+                                  inData=set(['RDO']), outData=set(['RDO_MRG']),
+                                  disableMT=True, disableMP=True)
         myMerger.doAll(input=set(['RDO']), output=set(['RDO_MRG']))
         
         # OK, if we got to here with no exceptions, we're good shape
@@ -1508,7 +1512,8 @@ class argEVNTFile(argPOOLFile):
         myMergeConf = executorConfig(myargdict, myDataDictionary)
         myMerger = athenaExecutor(name = mySubstepName, skeletonFile = 'PyJobTransforms/skeleton.EVNTMerge.py',
                                   conf=myMergeConf, 
-                                  inData=set(['EVNT']), outData=set(['EVNT_MRG']), disableMP=True)
+                                  inData=set(['EVNT']), outData=set(['EVNT_MRG']),
+                                  disableMT=True, disableMP=True)
         myMerger.doAll(input=set(['EVNT']), output=set(['EVNT_MRG']))
         
         # OK, if we got to here with no exceptions, we're good shape
diff --git a/Tools/PyJobTransforms/python/trfExe.py b/Tools/PyJobTransforms/python/trfExe.py
index 1051be1aac63..486810aabc6e 100755
--- a/Tools/PyJobTransforms/python/trfExe.py
+++ b/Tools/PyJobTransforms/python/trfExe.py
@@ -833,6 +833,7 @@ class athenaExecutor(scriptExecutor):
     #  executor to the workflow graph, run the executor manually with these data parameters (useful for 
     #  post-facto executors, e.g., for AthenaMP merging)
     #  @param memMonitor Enable subprocess memory monitoring
+    #  @param disableMT Ensure that AthenaMT is not used
     #  @param disableMP Ensure that AthenaMP is not used
     #  @note The difference between @c extraRunargs, @c runtimeRunargs and @c literalRunargs is that: @c extraRunargs 
     #  uses repr(), so the RHS is the same as the python object in the transform; @c runtimeRunargs uses str() so 
@@ -842,7 +843,7 @@ class athenaExecutor(scriptExecutor):
                  inData = set(), outData = set(), inputDataTypeCountCheck = None, exe = 'athena.py', exeArgs = ['athenaopts'], 
                  substep = None, inputEventTest = True, perfMonFile = None, tryDropAndReload = True, extraRunargs = {}, runtimeRunargs = {},
                  literalRunargs = [], dataArgs = [], checkEventCount = False, errorMaskFiles = None,
-                 manualDataDictionary = None, memMonitor = True, disableMP = False):
+                 manualDataDictionary = None, memMonitor = True, disableMT = False, disableMP = False):
         
         self._substep = forceToAlphaNum(substep)
         self._inputEventTest = inputEventTest
@@ -853,6 +854,7 @@ class athenaExecutor(scriptExecutor):
         self._dataArgs = dataArgs
         self._errorMaskFiles = errorMaskFiles
         self._inputDataTypeCountCheck = inputDataTypeCountCheck
+        self._disableMT = disableMT
         self._disableMP = disableMP
         self._skeletonCA=skeletonCA
 
@@ -897,6 +899,14 @@ class athenaExecutor(scriptExecutor):
     @disableMP.setter
     def disableMP(self, value):
         self._disableMP = value
+    
+    @property
+    def disableMT(self):
+        return self._disableMT
+    
+    @disableMT.setter
+    def disableMT(self, value):
+        self._disableMT = value
         
     def preExecute(self, input = set(), output = set()):
         self.setPreExeStart()
@@ -972,6 +982,9 @@ class athenaExecutor(scriptExecutor):
             # Try to detect AthenaMP mode and number of workers
             self._athenaMP = detectAthenaMPProcs(self.conf.argdict, self.name, legacyThreadingRelease)
 
+        if self._disableMT:
+            self._athenaMT = 0
+
         if self._disableMP:
             self._athenaMP = 0
         else:
@@ -1340,13 +1353,13 @@ class athenaExecutor(scriptExecutor):
             msg.info('Skipping test for "--drop-and-reload" in this executor')
             
         # For AthenaMT apply --threads=N if threads have been configured via ATHENA_CORE_NUMBER + multithreaded
-        if self._athenaMT != 0 :
+        if self._athenaMT != 0 and not self._disableMT:
             if not ('athenaopts' in self.conf.argdict and
                 any('--threads' in opt for opt in self.conf.argdict['athenaopts'].value[currentSubstep])):
                 self._cmd.append('--threads=%s' % str(self._athenaMT))
 
-        # For AthenaMP apply --threads=N if threads have been configured via ATHENA_CORE_NUMBER + multiprocess
-        if (self._athenaMP !=0 and not self._disableMP):
+        # For AthenaMP apply --nprocs=N if threads have been configured via ATHENA_CORE_NUMBER + multiprocess
+        if self._athenaMP != 0 and not self._disableMP:
             if not ('athenaopts' in self.conf.argdict and
                 any('--nprocs' in opt for opt in self.conf.argdict['athenaopts'].value[currentSubstep])):
                 self._cmd.append('--nprocs=%s' % str(self._athenaMP))
@@ -1403,6 +1416,8 @@ class athenaExecutor(scriptExecutor):
                     print('export CORAL_DBLOOKUP_PATH={directory}'.format(directory = path.join(dbroot, 'XMLConfig')), file=wrapper)
                     print('export TNS_ADMIN={directory}'.format(directory = path.join(dbroot, 'oracle-admin')), file=wrapper)
                     print('DATAPATH={dbroot}:$DATAPATH'.format(dbroot = dbroot), file=wrapper)
+                if self._disableMT:
+                    print("# AthenaMT explicitly disabled for this executor", file=wrapper)
                 if self._disableMP:
                     print("# AthenaMP explicitly disabled for this executor", file=wrapper)
                 if self._envUpdate.len > 0:
-- 
GitLab


From 395c23dfd49340a28ad0cd2780f314e943ab5ab4 Mon Sep 17 00:00:00 2001
From: sutt <sutt@cern.ch>
Date: Wed, 15 Sep 2021 09:11:08 +0200
Subject: [PATCH 114/347] Run the TnP analysis also for the truth selection

The TnP selection was only run for the truth selection
This adds a TnP triuth selection driver file and runs the Tnp selection
also now for the truth selection.

In addition, it modified the selection cuts used by the TnP selection to
be the same as that for the standard analyses. In principle we might need
to modify that selection to closer to the analysis that is used for the
full offline analyses.
---
 .../share/TIDAdata-run3-TnP.dat               | 46 ++++++++++
 .../share/TIDAdata-run3-offline-TnP.dat       | 92 +++----------------
 .../python/TrigInDetArtSteps.py               |  1 +
 .../test/test_trigID_el_zee_pu40_TnP.py       |  6 +-
 4 files changed, 62 insertions(+), 83 deletions(-)
 create mode 100755 Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat

diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat
new file mode 100755
index 000000000000..9977ae675c00
--- /dev/null
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-TnP.dat
@@ -0,0 +1,46 @@
+// emacs: this is -*- c++ -*-
+
+#include "TIDAdata_cuts.dat"
+
+ZmassMin = 0.0;
+ZmassMax = 110.0;
+
+doTnPHistos = 1;
+
+
+refChain = "Truth";
+//refChain = "Offline";
+//refChain = "Electrons";
+//refChain = "Muons";
+//refChain = "Taus";
+
+
+MinVertices = 0;
+
+
+// #include "TIDAdata-chains-run3.dat"
+
+testChains = {};
+
+
+InitialiseFirstEvent = 1;
+
+outputFile = "data-output.root";
+DataFiles = { "TrkNtuple-0000.root"};
+//DataSets = {"./"}
+
+
+#include "TIDAbeam.dat"
+
+TagnProbe = {
+        "HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:0",
+        "HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:1",
+	//"HLT_mu10_ivarmedium_mu10_10invm70_L12MU10:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon:0",
+        //"HLT_mu10_ivarmedium_mu10_10invm70_L12MU10:HLT_IDTrack_Muon_FTF:HLT_Roi_L2SAMuon:1",
+
+	"HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:HLT_Roi_FastElectron:0",
+	"HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:HLT_IDTrack_Electron_IDTrig:HLT_Roi_FastElectron:1"
+        //"HLT_mu10_ivarmedium_mu10_10invm70_L12MU10:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon:0",
+        //"HLT_mu10_ivarmedium_mu10_10invm70_L12MU10:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon:1"
+}; 
+
diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat
index f1e2cd4c1735..20ab9c09e141 100755
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-run3-offline-TnP.dat
@@ -1,86 +1,32 @@
 // emacs: this is -*- c++ -*-
 
-//NFiles  = 10;
-
-pT     = 10000;
-eta    = 2.5;
-// npix   = 1;
-// nsct   = 2;
-
-/// hmmm
-/// npix   = 4; /// double up, this is number of degrees of freedomw and really means 2 pixle "clusters"  
-npix   = 2; /// double up, this is number of degrees of freedomw and so 4 really means 2 pixeL "clusters"  
-nsct   = 4;
-
-nholes = 2;
-
-expectBL=1;
-
-pT_rec  = 0;
-eta_rec = 5;
-Rmatch = 0.05;
-
-
-dumpflag = 1;
-
-a0v = 10.5;
-z0v = 10.5;
+#include "TIDAdata_cuts-offline.dat"
 
 ZmassMin = 0.0;
 ZmassMax = 110.0;
 
 doTnPHistos = 1;
 
+//refChain = "Truth";
 refChain = "Offline";
 //refChain = "Electrons";
-//refChain = "Muons_Medium";
+//refChain = "Muons";
 //refChain = "Taus";
 
-/// NB: For the "Truth" chains, need to specify what 
-///     sort of particle (ie which pdgID) is needed
-/// Fixme: should add a flag to enable/disable this
-///        what if we want all final state particles
-///        independent of pdgID?
-
-//pdgId=11; // electron --entered in command line now
-
-// Nentries = 10000;
-
-// MinVertices = 0;
-
-// VertexSelection    = "0"; // possible flags: BestPT2, LeadPT, Ntracks
-// VertexSelectionRec = "0";
-
-// FilterRoi = { 2.4, 1, 2 };
+MinVertices = 0;
 
-testChains = {
-  //  "Offline",
-  //  "Muons",
-  //  "Electrons",                                                                        
-  //  "Electrons_MediumCB",
-  //  "Electrons_TightCB",
-  //  "Electrons_MediumLH",
-  //  "Electrons_TightLH",
+/// do not loadthe chains for the TnP analyses
+/// #include "TIDAdata-chains-run3.dat"
 
-//  "HLT_mu40_idperf:InDetTrigTrackingxAODCnv_Muon_FTF",
-//  "HLT_mu40_idperf:InDetTrigTrackingxAODCnv_Muon_IDTrig",
+testChains = {};
 
-//  "HLT_mu6_idperf:InDetTrigTrackingxAODCnv_Muon_FTF",
-//  "HLT_mu6_idperf:InDetTrigTrackingxAODCnv_Muon_IDTrig",
-
-//  "HLT_mu10_idperf:InDetTrigTrackingxAODCnv_Muon_FTF",
-//  "HLT_mu10_idperf:InDetTrigTrackingxAODCnv_Muon_IDTrig",
-
-//  "HLT_mu20_idperf:InDetTrigTrackingxAODCnv_Muon_FTF",
-//  "HLT_mu20_idperf:InDetTrigTrackingxAODCnv_Muon_IDTrig",
+outputFile = "data-output.root";
+DataFiles = { "TrkNtuple-0000.root"};
+//DataSets = {"/eos/atlas/atlascerngroupdisk/trig-id/data18_13TeV/muon-tnp/user.maparo.00363979.physics_Main.merge.AOD.f1002_m2037-20191004-141732_EXT0"};
+//DataSets = {"/eos/atlas/atlascerngroupdisk/trig-id/data18_13TeV/muon-tnp/user.maparo.00358395.physics_Main.merge.AOD.f961_m2015-20191004-141716_EXT0"};
 
-//  "HLT_mu24_idperf:InDetTrigTrackingxAODCnv_Muon_FTF",
-//  "HLT_mu24_idperf:InDetTrigTrackingxAODCnv_Muon_IDTrig"
+#include "TIDAbeam.dat"
 
-//	"HLT_mu13_mu13_idperf_Zmumu:L2_muon_combMuon10GeV_v15a_MU10_wOvlpRm/InDetTrigTrackingxAODCnv_Muon_FTF:L2_muon_combMuon10GeV_v15a_MU10_wOvlpRm/forID1",
-//	"HLT_mu13_mu13_idperf_Zmumu:L2_mucomb_mu10idperf_MU10/InDetTrigTrackingxAODCnv_Muon_FTF:L2_mucomb_mu10idperf_MU10/forID1"
-};
- 
 
 TagnProbe = {
         "HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:HLT_IDTrack_Electron_FTF:HLT_Roi_FastElectron:0",
@@ -94,17 +40,3 @@ TagnProbe = {
         //"HLT_mu10_ivarmedium_mu10_10invm70_L12MU10:HLT_IDTrack_Muon_IDTrig:HLT_Roi_L2SAMuon:1"
 }; 
 
-
-InitialiseFirstEvent = 1;
-
-outputFile = "data-electron-tnp.root";
-
-//#include "dataset.dat"
-
-// GRL = "/afs/cern.ch/user/s/sutt/tida/data16_13TeV.periodAllYear_HEAD_DQDefects-00-02-02_PHYS_StandardGRL_All_Good_25ns.xml";
-
-//#include "grl.dat"
-
-DataFiles = {"TrkNtuple-0000.root"};
-//DataSets = {"/eos/atlas/atlascerngroupdisk/trig-id/data18_13TeV/muon-tnp/user.maparo.00363979.physics_Main.merge.AOD.f1002_m2037-20191004-141732_EXT0"};
-//DataSets = {"/eos/atlas/atlascerngroupdisk/trig-id/data18_13TeV/muon-tnp/user.maparo.00358395.physics_Main.merge.AOD.f961_m2015-20191004-141716_EXT0"};
diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index f9c3bba04f9c..68623080c215 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -235,6 +235,7 @@ class TrigInDetRdictStep(Step):
             os.system( 'get_files -data TIDAdata-run3-larged0-el.dat &> /dev/null' )
             os.system( 'get_files -data TIDAdata-run3-lrt.dat &> /dev/null' )
             os.system( 'get_files -data TIDAdata-run3-minbias.dat &> /dev/null' )
+            os.system( 'get_files -data TIDAdata-run3-TnP.dat &> /dev/null' )
             os.system( 'get_files -data TIDAdata_cuts.dat &> /dev/null' )
             os.system( 'get_files -data TIDAdata-run3-offline.dat &> /dev/null' )
             os.system( 'get_files -data TIDAdata-run3-offline-rzMatcher.dat &> /dev/null' )
diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py
index 670bde036701..db2e6f636626 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_el_zee_pu40_TnP.py
@@ -36,12 +36,12 @@ Release = "current"
 GridFiles = True
 preinclude_file = 'all:TrigInDetValidation/TIDV_cond_fix.py' #conditions fix for ATR-23982. In future find a more recent RDO 
 
-Jobs = [( "Truth",       " TIDAdata-run3.dat                        -o data-hists.root -p 11" ),
+Jobs = [( "Truth",       " TIDAdata-run3-TnP.dat                    -o data-hists.root -p 11" ),
         ( "Offline",     " TIDAdata-run3-offline-TnP.dat -r Offline -o data-hists-offline.root" )] 
  
-Comp = [( "L2ele",              "L2electron",      "data-hists.root",         " -c TIDAhisto-panel.dat      -d HLTL2-plots " ),
+Comp = [( "L2ele",              "L2electronTnP",      "data-hists.root",         " -c TIDAhisto-panel.dat      -d HLTL2-plots " ),
         ( "L2eleoffline",       "L2electronTnP",      "data-hists-offline.root", " -c TIDAhisto-panel-TnP.dat  -d HLTL2-plots-offline " ),
-        ( "EFele",              "EFelectron",      "data-hists.root",         " -c TIDAhisto-panel.dat      -d HLTEF-plots " ),
+        ( "EFele",              "EFelectronTnP",      "data-hists.root",         " -c TIDAhisto-panel.dat      -d HLTEF-plots " ),
         ( "EFeleoffline",       "EFelectronTnP",      "data-hists-offline.root", " -c TIDAhisto-panel-TnP.dat  -d HLTEF-plots-offline " ) ]
 
 
-- 
GitLab


From b18a52541d1bc2e272bfa0db7bed7b496da31dbe Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Wed, 15 Sep 2021 09:12:42 +0200
Subject: [PATCH 115/347] Remove references to AtlasGeometryCfg in
 TrigT1CaloMonitoring

---
 .../TrigT1CaloMonitoring/python/JepJemMonitorAlgorithm.py   | 6 +-----
 .../TrigT1CaloMonitoring/python/PprMonitorAlgorithm.py      | 6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/python/JepJemMonitorAlgorithm.py b/Trigger/TrigT1/TrigT1CaloMonitoring/python/JepJemMonitorAlgorithm.py
index cd28f18b4273..903ce60ff031 100644
--- a/Trigger/TrigT1/TrigT1CaloMonitoring/python/JepJemMonitorAlgorithm.py
+++ b/Trigger/TrigT1/TrigT1CaloMonitoring/python/JepJemMonitorAlgorithm.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
 #
 def JepJemMonitoringConfig(inputFlags):
     '''Function to configure LVL1 JepJem algorithm in the monitoring system.'''
@@ -10,10 +10,6 @@ def JepJemMonitoringConfig(inputFlags):
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     result = ComponentAccumulator()
 
-    # any things that need setting up for job e.g.
-    #from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg
-    #result.merge(AtlasGeometryCfg(inputFlags))
-
     # make the athena monitoring helper
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'JepJemMonitoringCfg')
diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/python/PprMonitorAlgorithm.py b/Trigger/TrigT1/TrigT1CaloMonitoring/python/PprMonitorAlgorithm.py
index 7279d5286420..18cb9f14c2db 100644
--- a/Trigger/TrigT1/TrigT1CaloMonitoring/python/PprMonitorAlgorithm.py
+++ b/Trigger/TrigT1/TrigT1CaloMonitoring/python/PprMonitorAlgorithm.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
 #
 
 def PprMonitoringConfig(inputFlags):
@@ -11,10 +11,6 @@ def PprMonitoringConfig(inputFlags):
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     result = ComponentAccumulator()
 
-    # any things that need setting up for job e.g.
-    #from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg
-    #result.merge(AtlasGeometryCfg(inputFlags))
-
     # make the athena monitoring helper
     from AthenaMonitoring import AthMonitorCfgHelper
     helper = AthMonitorCfgHelper(inputFlags,'PprMonitoringCfg')
-- 
GitLab


From 53fb387038bb95ab52dc6d0faa21160dbe3ea7d9 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Wed, 15 Sep 2021 09:14:49 +0200
Subject: [PATCH 116/347] LArByteStream: Depend on LAr GeoModel directly

---
 .../LArByteStream/python/LArRawCalibDataReadingConfig.py    | 6 ++----
 .../LArCnv/LArByteStream/python/LArRawDataReadingConfig.py  | 6 ++----
 .../LArByteStream/python/LArRawSCDataReadingConfig.py       | 6 ++----
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/LArCalorimeter/LArCnv/LArByteStream/python/LArRawCalibDataReadingConfig.py b/LArCalorimeter/LArCnv/LArByteStream/python/LArRawCalibDataReadingConfig.py
index d0bac9050b65..dcda51c63b66 100644
--- a/LArCalorimeter/LArCnv/LArByteStream/python/LArRawCalibDataReadingConfig.py
+++ b/LArCalorimeter/LArCnv/LArByteStream/python/LArRawCalibDataReadingConfig.py
@@ -8,8 +8,8 @@ LArRawCalibDataReadingAlg=CompFactory.LArRawCalibDataReadingAlg
 
 def LArRawCalibDataReadingCfg(configFlags,gain="HIGH",doAccDigit=False,doAccCalibDigit=False,doCalibDigit=False):
     acc=ComponentAccumulator()
-    from DetDescrCnvSvc.DetDescrCnvSvcConfig import DetDescrCnvSvcCfg
-    acc.merge(DetDescrCnvSvcCfg(configFlags))
+    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
+    acc.merge(LArGMCfg(configFlags))
     acc.merge(ByteStreamReadCfg(configFlags))    
     accKey=""
     accCalibKey=""
@@ -41,8 +41,6 @@ if __name__=="__main__":
     ConfigFlags.lock()
 
     acc = MainServicesCfg( ConfigFlags )
-    from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg
-    acc.merge(AtlasGeometryCfg(ConfigFlags))
     acc.merge(LArRawCalibDataReadingCfg(ConfigFlags,doAccCalibDigit=True))
     
     from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg 
diff --git a/LArCalorimeter/LArCnv/LArByteStream/python/LArRawDataReadingConfig.py b/LArCalorimeter/LArCnv/LArByteStream/python/LArRawDataReadingConfig.py
index 4294ea67645c..d6c017c5c58c 100644
--- a/LArCalorimeter/LArCnv/LArByteStream/python/LArRawDataReadingConfig.py
+++ b/LArCalorimeter/LArCnv/LArByteStream/python/LArRawDataReadingConfig.py
@@ -8,8 +8,8 @@ LArRawDataReadingAlg=CompFactory.LArRawDataReadingAlg
 
 def LArRawDataReadingCfg(configFlags, **kwargs):
     acc=ComponentAccumulator()
-    from DetDescrCnvSvc.DetDescrCnvSvcConfig import DetDescrCnvSvcCfg
-    acc.merge(DetDescrCnvSvcCfg(configFlags))
+    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
+    acc.merge(LArGMCfg(configFlags))
     acc.merge(ByteStreamReadCfg(configFlags))
 
     if configFlags.Overlay.DataOverlay:
@@ -42,8 +42,6 @@ if __name__=="__main__":
     ConfigFlags.lock()
 
     acc = MainServicesCfg( ConfigFlags )
-    from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg
-    acc.merge(AtlasGeometryCfg(ConfigFlags))
     acc.merge(LArRawDataReadingCfg(ConfigFlags))
     
     DumpLArRawChannels=CompFactory.DumpLArRawChannels
diff --git a/LArCalorimeter/LArCnv/LArByteStream/python/LArRawSCDataReadingConfig.py b/LArCalorimeter/LArCnv/LArByteStream/python/LArRawSCDataReadingConfig.py
index 72fd8a8ceef4..bdf4f4f50892 100644
--- a/LArCalorimeter/LArCnv/LArByteStream/python/LArRawSCDataReadingConfig.py
+++ b/LArCalorimeter/LArCnv/LArByteStream/python/LArRawSCDataReadingConfig.py
@@ -10,8 +10,8 @@ LArLATOMEDecoder=CompFactory.LArLATOMEDecoder
 
 def LArRawSCDataReadingCfg(configFlags, **kwargs):
     acc=ComponentAccumulator()
-    from DetDescrCnvSvc.DetDescrCnvSvcConfig import DetDescrCnvSvcCfg
-    acc.merge(DetDescrCnvSvcCfg(configFlags))
+    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
+    acc.merge(LArGMCfg(configFlags))
     acc.merge(ByteStreamReadCfg(configFlags))
 
     LArRawSCDataReadingAlg1 = LArRawSCDataReadingAlg(**kwargs)
@@ -38,8 +38,6 @@ if __name__=="__main__":
     ConfigFlags.lock()
 
     acc = MainServicesCfg( ConfigFlags )
-    from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg
-    acc.merge(AtlasGeometryCfg(ConfigFlags))
     acc.merge(LArRawSCDataReadingCfg(ConfigFlags))
     
     acc.run(2,OutputLevel=DEBUG)
-- 
GitLab


From 2b0b8ee431944b17af86c51d324f0037c81526f8 Mon Sep 17 00:00:00 2001
From: Johannes Josef Junggeburth <johannes.josef.junggeburth@CERN.CH>
Date: Wed, 15 Sep 2021 09:32:28 +0200
Subject: [PATCH 117/347] Make the segment tag reentrant

---
 .../src/MuonSegmentTagAlg.cxx                 | 12 +++++-----
 .../MuonCombinedAlgs/src/MuonSegmentTagAlg.h  |  8 +++----
 .../src/MuonSegmentTagTool.cxx                | 24 ++++++++-----------
 .../src/MuonSegmentTagTool.h                  | 12 +++++-----
 .../IMuonSegmentTagTool.h                     | 17 +++++++------
 5 files changed, 36 insertions(+), 37 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.cxx b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.cxx
index 69bbecab87e0..a99ef4293d09 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.cxx
@@ -6,7 +6,7 @@
 
 #include "xAODMuon/MuonSegmentContainer.h"
 
-MuonSegmentTagAlg::MuonSegmentTagAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator) {}
+MuonSegmentTagAlg::MuonSegmentTagAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator) {}
 
 StatusCode MuonSegmentTagAlg::initialize() {
     ATH_CHECK(m_muonSegmentTagTool.retrieve());
@@ -17,8 +17,8 @@ StatusCode MuonSegmentTagAlg::initialize() {
     return StatusCode::SUCCESS;
 }
 
-StatusCode MuonSegmentTagAlg::execute() {
-    SG::ReadHandle<InDetCandidateCollection> indetCandidateCollection(m_indetCandidateCollectionName);
+StatusCode MuonSegmentTagAlg::execute(const EventContext& ctx) const  {
+    SG::ReadHandle<InDetCandidateCollection> indetCandidateCollection(m_indetCandidateCollectionName, ctx);
     if (!indetCandidateCollection.isValid()) {
         ATH_MSG_ERROR("Could not read " << m_indetCandidateCollectionName);
         return StatusCode::FAILURE;
@@ -28,7 +28,7 @@ StatusCode MuonSegmentTagAlg::execute() {
         return StatusCode::SUCCESS;
     }
 
-    SG::ReadHandle<xAOD::MuonSegmentContainer> segments(m_muonSegmentCollectionName);
+    SG::ReadHandle<xAOD::MuonSegmentContainer> segments(m_muonSegmentCollectionName, ctx);
     if (!segments.isPresent()) {
         ATH_MSG_WARNING(m_muonSegmentCollectionName << " not found in StoreGate");
         return StatusCode::SUCCESS;
@@ -38,10 +38,10 @@ StatusCode MuonSegmentTagAlg::execute() {
         return StatusCode::FAILURE;
     }
 
-    SG::WriteHandle<MuonCombined::InDetCandidateToTagMap> tagMap(m_tagMap);
+    SG::WriteHandle<MuonCombined::InDetCandidateToTagMap> tagMap(m_tagMap, ctx);
     ATH_CHECK(tagMap.record(std::make_unique<MuonCombined::InDetCandidateToTagMap>()));
 
-    m_muonSegmentTagTool->tag(*indetCandidateCollection, *segments, tagMap.ptr());
+    m_muonSegmentTagTool->tag(ctx, *indetCandidateCollection, *segments, tagMap.ptr());
 
     return StatusCode::SUCCESS;
 }
diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.h b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.h
index 9a23f7d20499..cfb62a21c370 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.h
@@ -5,7 +5,7 @@
 #ifndef MUONCOMBINEDALGS_MUONSEGMENTAGALG_H
 #define MUONCOMBINEDALGS_MUONSEGMENTAGALG_H
 
-#include "AthenaBaseComps/AthAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "MuonCombinedEvent/InDetCandidateCollection.h"
 #include "MuonCombinedEvent/InDetCandidateToTagMap.h"
@@ -15,14 +15,14 @@
 #include "StoreGate/WriteHandleKey.h"
 #include "xAODMuon/MuonSegmentContainer.h"
 
-class MuonSegmentTagAlg : public AthAlgorithm {
+class MuonSegmentTagAlg : public AthReentrantAlgorithm {
 public:
     MuonSegmentTagAlg(const std::string& name, ISvcLocator* pSvcLocator);
 
     ~MuonSegmentTagAlg() = default;
 
-    StatusCode initialize();
-    StatusCode execute();
+    StatusCode initialize()override;
+    StatusCode execute(const EventContext& ctx) const ;
 
 private:
     ToolHandle<MuonCombined::IMuonSegmentTagTool> m_muonSegmentTagTool{
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx
index 527ce0fa201b..f5bc79053502 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.cxx
@@ -77,7 +77,7 @@ namespace MuonCombined {
         return StatusCode::SUCCESS;
     }
 
-    void MuonSegmentTagTool::tag(const InDetCandidateCollection& inDetCandidates, const xAOD::MuonSegmentContainer& xaodSegments,
+    void MuonSegmentTagTool::tag(const EventContext& ctx, const InDetCandidateCollection& inDetCandidates, const xAOD::MuonSegmentContainer& xaodSegments,
                                  InDetCandidateToTagMap* tagMap) const {
         // loop over segments are extract MuonSegments + create links between segments and xAOD segments
         std::map<const Muon::MuonSegment*, ElementLink<xAOD::MuonSegmentContainer>> segmentToxAODSegmentMap;
@@ -94,12 +94,11 @@ namespace MuonCombined {
                 segmentToxAODSegmentMap[mseg] = link;
             }
         }
-        tag(inDetCandidates, segments, &segmentToxAODSegmentMap, tagMap);
+        tag(ctx, inDetCandidates, segments, &segmentToxAODSegmentMap, tagMap);
     }
     // todo: fix segmentToxAODSegmentMap
-    void MuonSegmentTagTool::tag(const InDetCandidateCollection& inDetCandidates, const std::vector<const Muon::MuonSegment*>& segments,
+    void MuonSegmentTagTool::tag(const EventContext& ctx, const InDetCandidateCollection& inDetCandidates, const std::vector<const Muon::MuonSegment*>& segments,
                                  SegmentMap* segmentToxAODSegmentMap, InDetCandidateToTagMap* tagMap) const {
-        const EventContext& ctx = Gaudi::Hive::currentContext();
         MSSurfaces surfaces{};
 
         std::vector<const Muon::MuonSegment*> FilteredSegmentCollection;
@@ -158,7 +157,7 @@ namespace MuonCombined {
         ATH_MSG_DEBUG("performing tag of " << inDetCandidates.size() << " tracks with " << FilteredSegmentCollection.size()
                                            << " segments. ");
         // Checking which surfaces have segments, to avoid useless extrapolations
-        std::vector<bool> hasSeg(12, false);
+        std::array<bool,12> hasSeg{false};
         if (m_doBidirectional) {
             for (const Muon::MuonSegment* itSeg : FilteredSegmentCollection) {
                 Identifier chId = m_edmHelperSvc->chamberId(*itSeg);
@@ -231,8 +230,7 @@ namespace MuonCombined {
             ++m_ntotTracks;
             bool hasMatch = m_doBidirectional;
             if (!m_doBidirectional) {
-                hasSeg.clear();
-                hasSeg.resize(12, false);
+                hasSeg.fill(false);
                 bool hasAngleMatch = false;
                 const Amg::Vector3D id_mom = track->perigeeParameters()->momentum();
                 const double qID = track->perigeeParameters()->charge();
@@ -319,7 +317,7 @@ namespace MuonCombined {
 
                 std::unique_ptr<const Trk::TrackParameters> atSurface;
                 std::unique_ptr<const Trk::TrackParameters> nextSurface;
-                std::vector<bool> hasSurf(12, false);
+                std::array<bool,12> hasSurf{false};
 
                 for (unsigned int surface_counter = 0; surface_counter < 12; ++surface_counter, ++extrapolation_counter) {
                     ATH_MSG_DEBUG("Surface " << surface_counter);
@@ -640,12 +638,10 @@ namespace MuonCombined {
             segmentsInfoTag.reserve(segmentsInfoFinal.size());
             bool match = false;
             for (unsigned int ns1 = 0; ns1 < segmentsInfoFinal.size(); ns1++) {
-                if (segmentsInfoFinal[ns1].track == track) {
-                    if (segmentsInfoFinal[ns1].nsegments > 0) {
-                        segmentsInfoTag.push_back(segmentsInfoFinal[ns1]);
-                        match = true;                      
-                    }
-                }
+                if (segmentsInfoFinal[ns1].track == track && segmentsInfoFinal[ns1].nsegments > 0) {
+                    segmentsInfoTag.push_back(segmentsInfoFinal[ns1]);
+                    match = true;                      
+                }                
             }
             if (match) {
                 ATH_MSG_DEBUG("make Segment Tag object for " << m_printer->print(*track) << " nr segments " << segmentsInfoTag.size());
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.h b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.h
index 44f27449e768..5ba5c25596b7 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonSegmentTagTool.h
@@ -42,14 +42,14 @@ namespace MuonCombined {
         MuonSegmentTagTool(const std::string& type, const std::string& name, const IInterface* parent);
         ~MuonSegmentTagTool() = default;
 
-        StatusCode initialize();
-        StatusCode finalize();
+        StatusCode initialize()override;
+        StatusCode finalize()override;
 
         /**IMuonSegmentTagTool interface: build muons from ID and MuonSegments */
-        void tag(const InDetCandidateCollection& inDetCandidates, const xAOD::MuonSegmentContainer& segments,
-                 InDetCandidateToTagMap* tagMap) const;
-        void tag(const InDetCandidateCollection& inDetCandidates, const std::vector<const Muon::MuonSegment*>& segments,
-                 SegmentMap* segmentToxAODSegmentMap, InDetCandidateToTagMap* tagMap) const;
+        void tag(const EventContext& ctx, const InDetCandidateCollection& inDetCandidates, const xAOD::MuonSegmentContainer& segments,
+                 InDetCandidateToTagMap* tagMap) const override;
+        void tag(const EventContext& ctx, const InDetCandidateCollection& inDetCandidates, const std::vector<const Muon::MuonSegment*>& segments,
+                 SegmentMap* segmentToxAODSegmentMap, InDetCandidateToTagMap* tagMap) const override;
 
     private:
         void printTable(const std::vector<std::string>& didEx, const std::vector<std::string> &segStation,
diff --git a/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonSegmentTagTool.h b/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonSegmentTagTool.h
index 93c250170711..903564bd4b28 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonSegmentTagTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonSegmentTagTool.h
@@ -15,8 +15,7 @@
 
 namespace MuonCombined {
 
-    static const InterfaceID IID_IMuonSegmentTagTool("MuonCombined::IMuonSegmentTagTool", 1, 0);
-
+  
     /** @class IMuonSegmentTagTool
         @brief interface for tools building muons from ID and MuonSegments
 
@@ -25,19 +24,23 @@ namespace MuonCombined {
 
     class IMuonSegmentTagTool : virtual public IAlgTool {
     public:
+        
         using SegmentMap = std::map<const Muon::MuonSegment*, ElementLink<xAOD::MuonSegmentContainer> >;
 
-        static const InterfaceID& interfaceID();
+        virtual ~IMuonSegmentTagTool() = default;
+        static const InterfaceID& interfaceID(){
+            static const InterfaceID IID_IMuonSegmentTagTool("MuonCombined::IMuonSegmentTagTool", 1, 0);
+            return IID_IMuonSegmentTagTool;
+        }
 
         /**IMuonSegmentTagTool interface: build muons from ID and MuonSegments */
-        virtual void tag(const InDetCandidateCollection& inDetCandidates, const xAOD::MuonSegmentContainer& segments,
+        virtual void tag(const EventContext& ctx, const InDetCandidateCollection& inDetCandidates, const xAOD::MuonSegmentContainer& segments,
                          InDetCandidateToTagMap* tagMap) const = 0;
-        virtual void tag(const InDetCandidateCollection& inDetCandidates, const std::vector<const Muon::MuonSegment*>& segments,
+        virtual void tag(const EventContext& ctx,  const InDetCandidateCollection& inDetCandidates, const std::vector<const Muon::MuonSegment*>& segments,
                          SegmentMap* segmentToxAODSegmentMap, InDetCandidateToTagMap* tagMap) const = 0;
     };
 
-    inline const InterfaceID& IMuonSegmentTagTool::interfaceID() { return IID_IMuonSegmentTagTool; }
-
+ 
 }  // namespace MuonCombined
 
 #endif
-- 
GitLab


From fe392798706c481167cc1959fd4035d215703587 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 15 Sep 2021 10:37:18 +0200
Subject: [PATCH 118/347] LArRamp: (minor) cleanup of algorithm, get old-style
 JO into a working state

---
 .../LArCalibUtils/LArRampBuilder.h            |  2 --
 .../LArCalibUtils/src/LArRampBuilder.cxx      |  6 ++--
 .../share/LArCalib_Ramp_jobOptions.py         | 30 ++++++++-----------
 3 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h
index 19cbd73f2148..33912650484f 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h
@@ -92,7 +92,6 @@ private:
   ToolHandle<LArParabolaPeakRecoTool> m_peakParabolaTool;
   ToolHandle<LArShapePeakRecoTool>    m_peakShapeTool;
   ToolHandle<LArOFPeakRecoTool>       m_peakOFTool;
-  ToolHandle<ICaloSuperCellIDTool> m_sc2ccMappingTool;
 
   unsigned m_event_counter; 
   int m_delay;
@@ -125,7 +124,6 @@ private:
   UnsignedIntegerProperty m_minDAC;
 
   int m_DeadChannelCut;
-  std::string m_folderName;
   int m_shapeMethodDAC;
   unsigned int m_DAC0;
 
diff --git a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx
index f2c2232229a4..d5698b5dec90 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx
@@ -23,8 +23,7 @@ LArRampBuilder::LArRampBuilder(const std::string& name, ISvcLocator* pSvcLocator
   : AthAlgorithm(name, pSvcLocator),
     m_peakParabolaTool("LArParabolaPeakRecoTool"),
     m_peakShapeTool("LArShapePeakRecoTool"),
-    m_peakOFTool("LArOFPeakRecoTool"),
-    m_sc2ccMappingTool("CaloSuperCellIDTool"),
+    m_peakOFTool(this),
     m_event_counter(0),
     m_recoType(OF),
     m_onlineHelper(),
@@ -37,12 +36,11 @@ LArRampBuilder::LArRampBuilder(const std::string& name, ISvcLocator* pSvcLocator
   declareProperty("SubtractDac0",    m_dac0sub=true);
   declareProperty("StoreRawRamp",    m_saveRawRamp=false);
   declareProperty("StoreRecRamp",    m_saveRecRamp=true);
-  declareProperty("FolderName",      m_folderName="LArElecCalibTB04");
   declareProperty("Polynom",         m_degree=1);
   declareProperty("RampRange",       m_maxADC=0);
   declareProperty("doSatSlope",      m_satSlope=true);
   declareProperty("ConsecutiveADCs", m_consADC=50);
-  declareProperty("RecoType",        m_recoTypeProp=std::string("Parabola")) ;
+  declareProperty("RecoType",        m_recoTypeProp=std::string("OF")) ;
   declareProperty("correctBias",     m_correctBias=false);
   declareProperty("ShapeMethodDAC",  m_shapeMethodDAC=400);
   declareProperty("DAC0",            m_DAC0=0); 
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py
index 3a6df4e78bfa..2ec7d31a3644 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py
@@ -53,7 +53,7 @@ if not 'FullFileName' in dir():
       if (int(RunNumberList[0]))<99800 :
          Trigger = "*"+Partition
       else :
-         Trigger = "calibration_LArElec-Ramp"+".*"+Partition   
+         Trigger = "calibration_LArElec-Ramp"+".*"
    
    FullFileName = []
    for RunNumber in RunNumberList :
@@ -416,9 +416,9 @@ from IOVDbSvc.CondDB import conddb
 PoolFileList     = []
 
 if 'BadChannelsFolder' not in dir():
-   BadChannelsFolder="/LAR/BadChannels/BadChannels"
+   BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels"
 if 'MissingFEBsFolder' not in dir():
-   MissingFEBsFolder="/LAR/BadChannels/MissingFEBs"
+   MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs"
 
 if not 'InputBadChannelSQLiteFile' in dir():
    RampLog.info( "Read Bad Channels from Oracle DB")
@@ -605,7 +605,7 @@ if ( PeakOF ):
     from LArRecUtils.LArRecUtilsConf import LArOFPeakRecoTool
     theLArOFPeakRecoTool=LArOFPeakRecoTool()
     theLArOFPeakRecoTool.UseShape = False
-    ToolSvc+=theLArOFPeakRecoTool
+    theLArRampBuilder.PeakOFTool=theLArOFPeakRecoTool
 else :
     theLArRampBuilder.RecoType = "Parabola"
     from LArRecUtils.LArRecUtilsConf import LArParabolaPeakRecoTool
@@ -690,7 +690,8 @@ if ( ApplyAdHocCorrection ):
 ######################################################################
 
 if ( doLArCalibDataQuality  ) :
-   ServiceMgr.ToolSvc+=theLArRampValBCMask
+   from LArCalibDataQuality.LArCalibDataQualityConf import LArRampValidationAlg
+   from LArCalibDataQuality.Thresholds import rampThr, rampThrFEB
    theRampValidationAlg=LArRampValidationAlg("RampVal")
    theRampValidationAlg.RampTolerance=rampThr
    theRampValidationAlg.RampToleranceFEB=rampThrFEB
@@ -751,7 +752,7 @@ if ( doMonitoring ) :
       os.remove(OutputRampRootFileDir+ "/" +RootHistOutputFileName)
    ServiceMgr += THistSvc()
 
-   ServiceMgr.THistSvc.Output = ["GLOBAL DATAFILE='"+OutputRampRootFileDir+ "/" +RootHistOutputFileName+"' OPT='New'"]
+   #ServiceMgr.THistSvc.Output = ["GLOBAL DATAFILE='"+OutputRampRootFileDir+ "/" +RootHistOutputFileName+"' OPT='NEW'"]
    
 if WriteNtuple or doMonitoring:
 
@@ -806,18 +807,11 @@ if (WriteNtuple):
       from LArCalibTools.LArCalibToolsConf import LArAverages2Ntuple
       
       if not SuperCells:
-         LArAverages2NtupleHIGH=LArAverages2Ntuple("LArAverages2NtupleHIGH")
-         LArAverages2NtupleHIGH.ContainerKey = "HIGH"
-         topSequence+= LArAverages2NtupleHIGH
-         
-         LArAverages2NtupleMEDIUM=LArAverages2Ntuple("LArAverages2NtupleMEDIUM")
-         LArAverages2NtupleMEDIUM.ContainerKey = "MEDIUM"
-         topSequence+= LArAverages2NtupleMEDIUM
-
-         LArAverages2NtupleLOW=LArAverages2Ntuple("LArAverages2NtupleLOW")
-         LArAverages2NtupleLOW.ContainerKey = "LOW"
-         topSequence+= LArAverages2NtupleLOW
-      
+         for g in GainList:
+            LArAverages2Ntuple=LArAverages2Ntuple("LArAverages2Ntuple"+g)
+            LArAverages2Ntuple.ContainerKey = g
+            topSequence+= LArAverages2Ntuple
+               
       if SuperCells:
          LArAverages2NtupleSC=LArAverages2Ntuple("LArAverages2NtupleSC")
          LArAverages2NtupleSC.ContainerKey = "SC"
-- 
GitLab


From e1101a3273504912f556104f97e4d9b68cae90f0 Mon Sep 17 00:00:00 2001
From: Debo <debottam.bakshi.gupta@cern.ch>
Date: Wed, 15 Sep 2021 11:59:29 +0200
Subject: [PATCH 119/347] Extending monitoring ranges of HTRatio* variables

---
 .../TrigTRTHighTHitCounter/python/TrigTRTHTHhypoTool.py       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/python/TrigTRTHTHhypoTool.py b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/python/TrigTRTHTHhypoTool.py
index b3a9dc620c1e..0497ce37d12a 100644
--- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/python/TrigTRTHTHhypoTool.py
+++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/python/TrigTRTHTHhypoTool.py
@@ -6,8 +6,8 @@ from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool,
 def _IncTool(name):
     
     monTool = GenericMonitoringTool("MonTool_"+name)
-    monTool.Histograms = [ defineHistogram('HTRatioRoad', type='TH1F', path='EXPERT', title="TrigTRTHTH Hypo HTRatioRoad", xbins=10, xmin=0.0, xmax=0.9),
-                           defineHistogram('HTRatioWedge', type='TH1F', path='EXPERT', title="TrigTRTHTH Hypo HTRatioWedge", xbins=10, xmin=0.0, xmax=0.9),
+    monTool.Histograms = [ defineHistogram('HTRatioRoad', type='TH1F', path='EXPERT', title="TrigTRTHTH Hypo HTRatioRoad", xbins=10, xmin=0.0, xmax=1.0),
+                           defineHistogram('HTRatioWedge', type='TH1F', path='EXPERT', title="TrigTRTHTH Hypo HTRatioWedge", xbins=10, xmin=0.0, xmax=1.0),
                            defineHistogram('TRTHTHitsRoad', type='TH1F', path='EXPERT', title="TrigTRTHTH Hypo TRTHTHitsRoad", xbins=100, xmin=0, xmax=100),
                            defineHistogram('TRTHTHitsWedge', type='TH1F', path='EXPERT', title="TrigTRTHTH Hypo TRTHTHitsWedge", xbins=100, xmin=0, xmax=100),]
 
-- 
GitLab


From 8402426be34b7715ef5bd05046ec6734590b352f Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Wed, 15 Sep 2021 12:32:59 +0200
Subject: [PATCH 120/347] solve cppcheck warnings

---
 .../src/TRT_TrackExtensionTool_DAF.cxx                   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/src/TRT_TrackExtensionTool_DAF.cxx b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/src/TRT_TrackExtensionTool_DAF.cxx
index 0f3d4f0a295b..6c3f92550a6d 100755
--- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/src/TRT_TrackExtensionTool_DAF.cxx
+++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_DAF/src/TRT_TrackExtensionTool_DAF.cxx
@@ -220,6 +220,7 @@ InDet::TRT_TrackExtensionTool_DAF::extendTrack(const EventContext& ctx,
     const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
     if (fieldCondObj == nullptr) {
         ATH_MSG_ERROR("InDet::TRT_TrackExtensionTool_xk::findSegment: Failed to retrieve AtlasFieldCacheCondObj with key " << m_fieldCondObjInputKey.key());
+        return event_data.m_measurement;
     }
     MagField::AtlasFieldCache fieldCache;
     fieldCondObj->getInitializedCache (fieldCache);
@@ -404,7 +405,7 @@ InDet::TRT_TrackExtensionTool_DAF::elementWiseExtension(int beginIndex,
         ATH_MSG_DEBUG( "There are "  << container->size() << " entries in the TRT_DriftCircleCollection" );
         // loop over RIOs in the collection
         InDet::TRT_DriftCircleCollection::const_iterator driftCircleIterator = container->begin();
-        for (; driftCircleIterator != container->end(); driftCircleIterator++) {
+        for (; driftCircleIterator != container->end(); ++driftCircleIterator) {
             // get the straw center of the RIO
             Amg::Vector3D strawGlobPos( event_data.m_detectorElements[index]->center( (*driftCircleIterator)->identify() ) );
             ATH_MSG_DEBUG("straw center at: ("<< strawGlobPos.x() <<", "<< strawGlobPos.y() << ")" );
@@ -538,7 +539,7 @@ InDet::TRT_TrackExtensionTool_DAF::groupedBarrelExtension(int beginIndex,
         ATH_MSG_DEBUG( "There are "  << container->size() << " entries in the TRT_DriftCircleCollection" );
 
         InDet::TRT_DriftCircleCollection::const_iterator driftCircleIterator = container->begin();
-        for (; driftCircleIterator != container->end(); driftCircleIterator++) {
+        for (; driftCircleIterator != container->end(); ++driftCircleIterator) {
             // get the straw center of the RIO
             Amg::Vector3D strawGlobPos( event_data.m_detectorElements[index]->center( (*driftCircleIterator)->identify() ) );
             strawGlobPos[Amg::z]=0.;
@@ -653,7 +654,7 @@ InDet::TRT_TrackExtensionTool_DAF::groupedBarrelExtension(int beginIndex,
     // --------
     // delete the global positions
     std::vector< Amg::Vector3D* >::iterator globPosIterator = trackGlobalPos.begin();
-    for (; globPosIterator != trackGlobalPos.end(); globPosIterator++ ) {
+    for (; globPosIterator != trackGlobalPos.end(); ++globPosIterator ) {
         delete (*globPosIterator);
         (*globPosIterator) = 0;
     }
@@ -700,7 +701,7 @@ InDet::TRT_TrackExtensionTool_DAF::groupedBarrelExtension(int beginIndex,
 
     // delete the RIOlists
     std::vector< std::list< const Trk::PrepRawData* >* >::iterator RIOlistIterator = groupedRIOs.begin();
-    for (; RIOlistIterator != groupedRIOs.end(); RIOlistIterator++ ) {
+    for (; RIOlistIterator != groupedRIOs.end(); ++RIOlistIterator ) {
         // just delete the list, the entries (RIOs) belong to the driftcircle collection
         delete (*RIOlistIterator);
         (*RIOlistIterator) = 0;
-- 
GitLab


From eb3b2c09d48624512f00a6f11479bf176e69bf01 Mon Sep 17 00:00:00 2001
From: "Ewelina.Maria.Lobodzinska" <ewelina.maria.lobodzinska@cern.ch>
Date: Wed, 15 Sep 2021 13:40:30 +0200
Subject: [PATCH 121/347] Pythia8_i: correct the units to avoid crashes in
 TestHepMC

---
 Generators/Pythia8_i/Pythia8_i/Pythia8_i.h | 10 ++++++--
 Generators/Pythia8_i/src/Pythia8_i.cxx     | 28 ++++++++++++----------
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h b/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h
index ef126b6bbb08..33f50aecaa0b 100644
--- a/Generators/Pythia8_i/Pythia8_i/Pythia8_i.h
+++ b/Generators/Pythia8_i/Pythia8_i/Pythia8_i.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
   Author: James Monk
 */
 
@@ -16,7 +16,13 @@
 
 //#include "Pythia8/../Pythia8Plugins/HepMC2.h"
 #ifdef HEPMC3
-#include "Pythia8ToHepMC3.h"
+  #ifdef PYTHIA_VERSION_INTEGER 
+     #if PYTHIA_VERSION_INTEGER > 8299
+        #include "Pythia8Plugins/HepMC3.h"
+     #else
+        #include "Pythia8ToHepMC3.h"
+     #endif
+  #endif
 namespace HepMC {
 typedef HepMC3::Pythia8ToHepMC3 Pythia8ToHepMC;
 }
diff --git a/Generators/Pythia8_i/src/Pythia8_i.cxx b/Generators/Pythia8_i/src/Pythia8_i.cxx
index 462f69a2a860..b1422074f0da 100644
--- a/Generators/Pythia8_i/src/Pythia8_i.cxx
+++ b/Generators/Pythia8_i/src/Pythia8_i.cxx
@@ -115,7 +115,6 @@ m_athenaTool("")
   m_particleIDs["LEAD"]        = LEAD;
 
   ATH_MSG_INFO("XML Path is " + xmlpath());
-
   m_pythia = std::make_unique<Pythia8::Pythia> (xmlpath());
 #ifdef HEPMC3
   m_runinfo = std::make_shared<HepMC3::GenRunInfo>();
@@ -241,6 +240,8 @@ StatusCode Pythia8_i::genInitialize() {
     return StatusCode::FAILURE;
   }
 
+
+
   if(m_useRndmGenSvc){
 
     ATH_MSG_INFO(" !!!!!!!!!!!!  WARNING ON PYTHIA RANDOM NUMBERS !!!!!!!!!! ");
@@ -530,7 +531,6 @@ StatusCode Pythia8_i::fillEvt(HepMC::GenEvent *evt){
         }
         ++id;
       }
-
       std::map<std::string, Pythia8::LHAweight>::const_iterator weightName = m_pythia->info.init_weights->find(wgt->first);
       if(weightName != m_pythia->info.init_weights->end()){
         fWeights[weightName->second.contents] = mergingWeight * wgt->second.contents;
@@ -545,8 +545,7 @@ StatusCode Pythia8_i::fillEvt(HepMC::GenEvent *evt){
 
   for(int iw = firstWeight; iw < m_pythia->info.PYTHIA8_NWEIGHTS(); ++iw){
 
-    std::string wtName = ((int)m_showerWeightNames.size() == m_pythia->info.PYTHIA8_NWEIGHTS())? m_showerWeightNames[iw]: "ShowerWt_" +
-std::to_string(iw);
+    std::string wtName = ((int)m_showerWeightNames.size() == m_pythia->info.PYTHIA8_NWEIGHTS())? m_showerWeightNames[iw]: "ShowerWt_" +std::to_string(iw);
 
     if(m_pythia->info.PYTHIA8_NWEIGHTS() != 1){
       if(m_internal_event_number == 1) {
@@ -560,13 +559,15 @@ std::to_string(iw);
   }
 
 #ifdef HEPMC3
-  if(m_internal_event_number == 1){
-    std::vector<std::string> names;
-    for (auto w: fWeights)   names.push_back(w.first);
-    if (!evt->run_info()) evt->set_run_info(m_runinfo);
-    evt->run_info()->set_weight_names(names);
-  }
-  for (auto w: fWeights) {evt->weight(w.first)=w.second;}
+  std::vector<std::string> names;
+  for (auto w: fWeights)   names.push_back(w.first);
+  if (!evt->run_info()) evt->set_run_info(m_runinfo);
+  evt->run_info()->set_weight_names(names);
+// added conversion GeV ->  MeV to ensure correct units
+  GeVToMeV(evt);
+
+  for (auto w: fWeights) {
+      evt->weight(w.first)=w.second;}
 #else
   evt->weights().clear();
   for (auto w: fWeights) {evt->weights()[w.first]=w.second;}
@@ -580,7 +581,6 @@ std::to_string(iw);
 StatusCode Pythia8_i::genFinalize(){
 
   ATH_MSG_INFO(">>> Pythia8_i from genFinalize");
-
   m_pythia->stat();
 
   Pythia8::Info info = m_pythia->info;
@@ -636,7 +636,7 @@ StatusCode Pythia8_i::genFinalize(){
 void Pythia8_i::addLHEToHepMC(HepMC::GenEvent *evt){
 
 #ifdef HEPMC3
-  HepMC::GenEvent *procEvent = new HepMC::GenEvent(evt->momentum_unit(), evt->length_unit());
+  HepMC::GenEvent *procEvent = new HepMC::GenEvent();
 
   // Adding the LHE event to the HepMC results in undecayed partons in the event record.
   // Pythia's HepMC converter throws up undecayed partons, so we ignore that
@@ -654,6 +654,7 @@ void Pythia8_i::addLHEToHepMC(HepMC::GenEvent *evt){
   if(beams[0]->momentum().pz() * procBeams[0]->momentum().pz() < 0.) std::swap(procBeams[0],procBeams[1]);
   for (auto p: procBeams[0]->end_vertex()->particles_out())  beams[0]->end_vertex()->add_particle_out(p);
   for (auto p: procBeams[1]->end_vertex()->particles_out())  beams[1]->end_vertex()->add_particle_out(p);
+
 #else
   HepMC::GenEvent *procEvent = new HepMC::GenEvent(evt->momentum_unit(), evt->length_unit());
 
@@ -732,6 +733,7 @@ double Pythia8_i::pythiaVersion()const{
 ////////////////////////////////////////////////////////////////////////
 std::string Pythia8_i::xmlpath(){
 
+  
   std::string foundpath = "";
 
 // Try to find the xmldoc directory using PathResolver:
-- 
GitLab


From 10e5d5edf0e0d00a1fb38a8e6fc67de51ebbbad9 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Wed, 15 Sep 2021 15:00:55 +0200
Subject: [PATCH 122/347] LArCalib_Delay_OFCCali.py:Run StripsXtalkCorr and
 ShortCorr only for if sub-calo is EM

---
 .../LArCalibProcessing/python/LArCalibConfigFlags.py   |  1 +
 .../python/LArCalib_Delay_OFCCali.py                   | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
index 50d9144ce145..8ae18a2b8194 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
@@ -41,6 +41,7 @@ def addLArCalibFlags(flags):
     flags.addFlag("LArCalib.Input.RunNumbers",[])
     flags.addFlag("LArCalib.Input.Type","calibration_LArElec-Pedestal")
     flags.addFlag("LArCalib.Input.Files",_getInputFiles)
+    flags.addFlag("LArCalib.Input.SubDet","") #EM, HEC or FCAL 
     
     flags.addFlag("LArCalib.Input.Database","LAR_OFL") #In practice, a sqlite file
 
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
index 279a3ac992d3..c0e5d5beeb45 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
@@ -42,12 +42,14 @@ def LArDelay_OFCCaliCfg(flags):
     result.merge(LArFebErrorSummaryMakerCfg(flags))
     result.getEventAlgo("LArFebErrorSummaryMaker").CheckAllFEB=False
 
-    from LArCalibProcessing.LArStripsXtalkCorrConfig import LArStripsXtalkCorrCfg
-    result.merge(LArStripsXtalkCorrCfg(flags,[digKey,]))
     
+    if flags.LArCalib.Input.SubDet == "EM":
+        from LArCalibProcessing.LArStripsXtalkCorrConfig import LArStripsXtalkCorrCfg
+        result.merge(LArStripsXtalkCorrCfg(flags,[digKey,]))
     
-    theLArCalibShortCorrector = CompFactory.LArCalibShortCorrector(KeyList = [digKey,])
-    result.addEventAlgo(theLArCalibShortCorrector)
+    
+        theLArCalibShortCorrector = CompFactory.LArCalibShortCorrector(KeyList = [digKey,])
+        result.addEventAlgo(theLArCalibShortCorrector)
 
 
     theLArCaliWaveBuilder = CompFactory.LArCaliWaveBuilder()
-- 
GitLab


From e0ce141269f7c55056a8174d5ef99ba5789ca002 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Wed, 15 Sep 2021 15:14:56 +0200
Subject: [PATCH 123/347] Fix Run3 Navingation dumper to only use navigation
 container

---
 Trigger/TrigValidation/TrigValAlgs/src/TrigEDMChecker.cxx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigValidation/TrigValAlgs/src/TrigEDMChecker.cxx b/Trigger/TrigValidation/TrigValAlgs/src/TrigEDMChecker.cxx
index dc3ed7c68133..82a4bba5316b 100644
--- a/Trigger/TrigValidation/TrigValAlgs/src/TrigEDMChecker.cxx
+++ b/Trigger/TrigValidation/TrigValAlgs/src/TrigEDMChecker.cxx
@@ -4266,10 +4266,13 @@ StatusCode TrigEDMChecker::TrigCompositeNavigationToDot(std::string& returnValue
 
   // Now process them
   for (const std::string& key : keys) {
-    if (m_doDumpAllTrigComposite && key.find("HLTNav_") != 0) { // Nav containers should always start with HLTNav_
-      continue;
+    if ( not m_doDumpAllTrigComposite ) {
+      if ( key.find("HLTNav_") != 0) { // Nav containers should always start with HLTNav_
+        continue;
+      }
     }
     ATH_CHECK( evtStore()->retrieve( container, key ) );
+    ATH_MSG_DEBUG("Processing collection " << key << " to be added to the navigation graph");
     // ss << "    rank=same" << std::endl; // dot cannot handle this is seems
     bool writtenHeader = false;
     for (const Decision* tc : *container ) {
-- 
GitLab


From 6dec25d540f2c7063cad274984d9c6dafdf6b95a Mon Sep 17 00:00:00 2001
From: Oliver Majersky <oliver.majersky@cern.ch>
Date: Wed, 15 Sep 2021 16:06:28 +0200
Subject: [PATCH 124/347] Fix AnalysisTop validation configuration.

---
 .../TopPhys/xAOD/TopAnalysis/share/validation-cuts.txt          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/validation-cuts.txt b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/validation-cuts.txt
index 2bdac70188d3..b5c72415469f 100644
--- a/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/validation-cuts.txt
+++ b/PhysicsAnalysis/TopPhys/xAOD/TopAnalysis/share/validation-cuts.txt
@@ -103,7 +103,7 @@ BTaggingTrackJetWP DL1:Continuous DL1r:FixedCutBEff_77
 SaveBootstrapWeights False
 NumberOfBootstrapReplicas 100
 
-NEvents 500
+#NEvents 500
 
 ### Global lepton trigger scale factor example
 UseGlobalLeptonTriggerSF True
-- 
GitLab


From 87f54da8704591fbe6706d03eba2daf1c50926fd Mon Sep 17 00:00:00 2001
From: Frank Berghaus <frank.berghaus@cern.ch>
Date: Wed, 15 Sep 2021 09:25:42 -0500
Subject: [PATCH 125/347] MetaDataSvc does not set In(Out)putKey of
 FileMetaDataTool Fix ATEAM-779

When setting up for EventFormat and FileMetaData the MetaDataSvc was
attempting to set the properties InputKey and OutputKey. As These
properties were removed from FileMetaDataTool these no longer need to be
set, and trying to do so will cause an error.
---
 Control/AthenaServices/src/MetaDataSvc.cxx                    | 4 ++--
 Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Control/AthenaServices/src/MetaDataSvc.cxx b/Control/AthenaServices/src/MetaDataSvc.cxx
index fe387873ba5b..9b84aa492777 100644
--- a/Control/AthenaServices/src/MetaDataSvc.cxx
+++ b/Control/AthenaServices/src/MetaDataSvc.cxx
@@ -476,7 +476,7 @@ StatusCode MetaDataSvc::addProxyToInputMetaDataStore(const std::string& tokenStr
       } else {
          toolInstName = toolName;
       }
-      if (clid == 178309087 || clid == 243004407) { // Some MetaData have multiple objects needing seperate tools for propagation
+      if (clid == 243004407) { // Some MetaData have multiple objects needing seperate tools for propagation
          toolInstName += "_" + keyName;
       }
       bool foundTool = false;
@@ -494,7 +494,7 @@ StatusCode MetaDataSvc::addProxyToInputMetaDataStore(const std::string& tokenStr
             ATH_MSG_FATAL("Cannot get " << toolInstName);
             return(StatusCode::FAILURE);
          }
-         if (clid == 178309087 || clid == 243004407) { // Set keys for FileMetaDataTool and EventFormatMetaDataTool
+         if (clid == 243004407) { // Set keys for FileMetaDataTool and EventFormatMetaDataTool
             IProperty* property = dynamic_cast<IProperty*>(metadataTool.get());
             if (property == nullptr) {
                ATH_MSG_FATAL("addProxyToInputMetaDataStore: Cannot set input key " << tokenStr);
diff --git a/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h b/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h
index 68dff5d25d98..4a8dade40b56 100644
--- a/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h
+++ b/Event/xAOD/xAODMetaDataCnv/xAODMetaDataCnv/FileMetaDataTool.h
@@ -7,6 +7,7 @@
 
 // System include(s):
 #include <string>
+#include <vector>
 
 // Infrastructure include(s):
 #include "AsgTools/AsgMetadataTool.h"
-- 
GitLab


From 746d609ca0b41d58f7f80f456afc82b0f1e6a94a Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Tue, 14 Sep 2021 18:16:54 +0200
Subject: [PATCH 126/347] Move RDO merge skeleton under Simulation domain

---
 .../SimuJobTransforms}/scripts/RDOMerge_tf.py               | 6 ++----
 .../SimuJobTransforms/share/skeleton.RDOMerge.py            | 0
 Tools/PyJobTransforms/python/trfArgClasses.py               | 2 +-
 Tools/PyJobTransforms/scripts/Merge_tf.py                   | 5 ++++-
 4 files changed, 7 insertions(+), 6 deletions(-)
 rename {Reconstruction/RecJobTransforms => Simulation/SimuJobTransforms}/scripts/RDOMerge_tf.py (77%)
 rename Reconstruction/RecJobTransforms/share/skeleton.MergeRDO_tf.py => Simulation/SimuJobTransforms/share/skeleton.RDOMerge.py (100%)

diff --git a/Reconstruction/RecJobTransforms/scripts/RDOMerge_tf.py b/Simulation/SimuJobTransforms/scripts/RDOMerge_tf.py
similarity index 77%
rename from Reconstruction/RecJobTransforms/scripts/RDOMerge_tf.py
rename to Simulation/SimuJobTransforms/scripts/RDOMerge_tf.py
index a41d18a34a26..ff8e0ddf1095 100755
--- a/Reconstruction/RecJobTransforms/scripts/RDOMerge_tf.py
+++ b/Simulation/SimuJobTransforms/scripts/RDOMerge_tf.py
@@ -13,12 +13,11 @@ from PyJobTransforms.transform import transform
 from PyJobTransforms.trfExe import athenaExecutor
 from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments
 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
-from RecJobTransforms.recTransformUtils import addCommonRecTrfArgs
 from SimuJobTransforms.simTrfArgs import addForwardDetTrfArgs
 
 import PyJobTransforms.trfArgClasses as trfArgClasses
 
-ListOfDefaultPositionalKeys=['--AFPOn', '--ALFAOn', '--DBRelease', '--FwdRegionOn', '--LucidOn', '--ZDCOn', '--amiConfig', '--amiMetadataTag', '--asetup', '--athena', '--athenaopts', '--autoConfiguration', '--beamType', '--checkEventCount', '--command', '--conditionsTag', '--env', '--eventAcceptanceEfficiency', '--execOnly', '--geometryVersion', '--ignoreErrors', '--ignoreFilters', '--ignorePatterns', '--inputRDOFile', '--maxEvents', '--noimf', '--notcmalloc', '--outputRDO_MRGFile', '--postExec', '--postInclude', '--preExec', '--preInclude', '--reportName', '--runNumber', '--showGraph', '--showPath', '--showSteps', '--skipEvents', '--skipFileValidation', '--skipInputFileValidation', '--skipOutputFileValidation']
+ListOfDefaultPositionalKeys=['--AFPOn', '--ALFAOn', '--DBRelease', '--FwdRegionOn', '--LucidOn', '--ZDCOn', '--amiConfig', '--amiMetadataTag', '--asetup', '--athena', '--athenaopts', '--beamType', '--checkEventCount', '--command', '--conditionsTag', '--env', '--eventAcceptanceEfficiency', '--execOnly', '--geometryVersion', '--ignoreErrors', '--ignoreFilters', '--ignorePatterns', '--inputRDOFile', '--maxEvents', '--noimf', '--notcmalloc', '--outputRDO_MRGFile', '--postExec', '--postInclude', '--preExec', '--preInclude', '--reportName', '--runNumber', '--showGraph', '--showPath', '--showSteps', '--skipEvents', '--skipFileValidation', '--skipInputFileValidation', '--skipOutputFileValidation']
 
 @stdTrfExceptionHandler
 @sigUsrStackTrace
@@ -36,7 +35,7 @@ def main():
 
 def getTransform():
     executorSet = set()
-    executorSet.add(athenaExecutor(name = 'RDOMerge', skeletonFile = 'RecJobTransforms/skeleton.MergeRDO_tf.py',
+    executorSet.add(athenaExecutor(name = 'RDOMerge', skeletonFile = 'SimuJobTransforms/skeleton.RDOMerge.py',
                                    inData = ['RDO'], outData = ['RDO_MRG']))
 
     trf = transform(executor = executorSet)
@@ -44,7 +43,6 @@ def getTransform():
     addAthenaArguments(trf.parser)
     addDetectorArguments(trf.parser)
     addForwardDetTrfArgs(trf.parser)
-    addCommonRecTrfArgs(trf.parser)
     addMyArgs(trf.parser)
     return trf
 
diff --git a/Reconstruction/RecJobTransforms/share/skeleton.MergeRDO_tf.py b/Simulation/SimuJobTransforms/share/skeleton.RDOMerge.py
similarity index 100%
rename from Reconstruction/RecJobTransforms/share/skeleton.MergeRDO_tf.py
rename to Simulation/SimuJobTransforms/share/skeleton.RDOMerge.py
diff --git a/Tools/PyJobTransforms/python/trfArgClasses.py b/Tools/PyJobTransforms/python/trfArgClasses.py
index 5b6c6f97b3a8..47bbcd90e8a6 100644
--- a/Tools/PyJobTransforms/python/trfArgClasses.py
+++ b/Tools/PyJobTransforms/python/trfArgClasses.py
@@ -1469,7 +1469,7 @@ class argRDOFile(argPOOLFile):
         myDataDictionary = {'RDO' : argHITSFile(inputs, type=self.type, io='input'),
                             'RDO_MRG' : argHITSFile(output, type=self.type, io='output')}
         myMergeConf = executorConfig(myargdict, myDataDictionary)
-        myMerger = athenaExecutor(name = 'RDOMergeAthenaMP{0}'.format(counter), skeletonFile = 'RecJobTransforms/skeleton.MergeRDO_tf.py',
+        myMerger = athenaExecutor(name = 'RDOMergeAthenaMP{0}'.format(counter), skeletonFile = 'SimuJobTransforms/skeleton.RDOMerge.py',
                                   conf=myMergeConf, 
                                   inData=set(['RDO']), outData=set(['RDO_MRG']), disableMP=True)
         myMerger.doAll(input=set(['RDO']), output=set(['RDO_MRG']))
diff --git a/Tools/PyJobTransforms/scripts/Merge_tf.py b/Tools/PyJobTransforms/scripts/Merge_tf.py
index 38e180005331..1971051cd331 100755
--- a/Tools/PyJobTransforms/scripts/Merge_tf.py
+++ b/Tools/PyJobTransforms/scripts/Merge_tf.py
@@ -49,7 +49,7 @@ def getTransform():
                                    inData = ['AOD_MRG'], outData = ['TAG'],))
     executorSet.add(tagMergeExecutor(name = 'TAGFileMerge', exe = 'CollAppend', inData = set(['TAG']), outData = set(['TAG_MRG'])))
     executorSet.add(DQMergeExecutor(name = 'DQHistogramMerge', inData = [('HIST_ESD', 'HIST_AOD'), 'HIST'], outData = ['HIST_MRG']))
-    executorSet.add(athenaExecutor(name = 'RDOMerge', skeletonFile = 'RecJobTransforms/skeleton.MergeRDO_tf.py',
+    executorSet.add(athenaExecutor(name = 'RDOMerge', skeletonFile = 'SimuJobTransforms/skeleton.RDOMerge.py',
                                    inData = ['RDO'], outData = ['RDO_MRG']))
     executorSet.add(bsMergeExecutor(name = 'RAWFileMerge', exe = 'file_merging', inData = set(['BS']), outData = set(['BS_MRG'])))
     executorSet.add(athenaExecutor(name = 'EVNTMerge', skeletonFile = 'PyJobTransforms/skeleton.EVNTMerge.py',inData = ['EVNT'], outData = ['EVNT_MRG']))
@@ -139,6 +139,9 @@ def addMyArgs(parser):
     parser.add_argument('--outputRDO_MRGFile', '--outputRDOFile', 
                         type=trfArgClasses.argFactory(trfArgClasses.argRDOFile, io='output'),
                         help='Output merged RDO file', group='RDOMerge_tf')
+    parser.add_argument('--PileUpPresampling',
+                        type=trfArgClasses.argFactory(trfArgClasses.argBool),
+                        help='Run digitization with pile-up presampling configuration.', group='RDOMerge_tf')
 
     parser.defineArgGroup('RAWMerge_tf', 'RAWMerge specific options')
     parser.add_argument('--inputBSFile', nargs='+', 
-- 
GitLab


From 0ccda124fa89ea152f4e2ef0119409fe3758d9d4 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Wed, 15 Sep 2021 16:33:06 +0200
Subject: [PATCH 127/347] Add CA-based skeletons for HITSMerge and RDOMerge

---
 .../python/FilterHit_Skeleton.py              |  27 +---
 .../python/G4AtlasAlg_Skeleton.py             |  25 +---
 .../python/HITSMerge_Skeleton.py              |  84 ++++++++++++
 .../SimuJobTransforms/python/ISF_Skeleton.py  |  25 +---
 .../python/RDOMerge_Skeleton.py               | 122 ++++++++++++++++++
 .../python/SimTransformUtils.py               |   3 +-
 .../python/SimulationHelpers.py               |  26 ++++
 .../SimuJobTransforms/scripts/RDOMerge_tf.py  |   1 +
 Tools/PyJobTransforms/python/trfArgClasses.py |   2 +
 Tools/PyJobTransforms/scripts/Merge_tf.py     |  39 +++---
 10 files changed, 271 insertions(+), 83 deletions(-)
 create mode 100644 Simulation/SimuJobTransforms/python/HITSMerge_Skeleton.py
 create mode 100644 Simulation/SimuJobTransforms/python/RDOMerge_Skeleton.py
 create mode 100644 Simulation/SimuJobTransforms/python/SimulationHelpers.py

diff --git a/Simulation/SimuJobTransforms/python/FilterHit_Skeleton.py b/Simulation/SimuJobTransforms/python/FilterHit_Skeleton.py
index 9402340a5214..762449172007 100644
--- a/Simulation/SimuJobTransforms/python/FilterHit_Skeleton.py
+++ b/Simulation/SimuJobTransforms/python/FilterHit_Skeleton.py
@@ -97,26 +97,11 @@ def fromRunArgs(runArgs):
     else:
         raise RuntimeError('No input HITS file defined')
 
-    if hasattr(runArgs, 'detectors'):
-        detectors = runArgs.detectors
-    else:
-        from AthenaConfiguration.AutoConfigFlags import getDefaultDetectors
-        detectors = getDefaultDetectors(ConfigFlags.GeoModel.AtlasVersion)
-
-    # Support switching on Forward Detectors
-    if hasattr(runArgs, 'LucidOn'):
-        detectors = detectors+['Lucid']
-    if hasattr(runArgs, 'ZDCOn'):
-        detectors = detectors+['ZDC']
-    if hasattr(runArgs, 'AFPOn'):
-        detectors = detectors+['AFP']
-    if hasattr(runArgs, 'ALFAOn'):
-        detectors = detectors+['ALFA']
-    if hasattr(runArgs, 'FwdRegionOn'):
-        detectors = detectors+['FwdRegion']
-
-    # Setup common simulation flags
-    defaultFilterHitFlags(ConfigFlags, detectors)
+    # Generate detector list and setup detector flags
+    from SimuJobTransforms.SimulationHelpers import getDetectorsFromRunArgs
+    detectors = getDetectorsFromRunArgs(ConfigFlags, runArgs)
+    from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
+    setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
 
     ## from SimuJobTransforms.HitsFilePeeker import HitsFilePeeker
     ## HitsFilePeeker(runArgs, filterHitLog)
@@ -128,7 +113,7 @@ def fromRunArgs(runArgs):
         else:
             ConfigFlags.Output.HITSFileName  = runArgs.outputHITS_FILTFile
     else:
-        raise RuntimeError('No outputHITSFile defined')
+        raise RuntimeError('No outputHITS_FILTFile defined')
 
     # Pre-include
     processPreInclude(runArgs, ConfigFlags)
diff --git a/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py b/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py
index 12b5b9e551bf..2a196a592e20 100644
--- a/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py
+++ b/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py
@@ -38,26 +38,9 @@ def fromRunArgs(runArgs):
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     commonRunArgsToFlags(runArgs, ConfigFlags)
 
-    if hasattr(runArgs, 'detectors'):
-        detectors = runArgs.detectors
-    else:
-        from AthenaConfiguration.AutoConfigFlags import getDefaultDetectors
-        detectors = getDefaultDetectors(ConfigFlags.GeoModel.AtlasVersion)
-
-    # Support switching on simulation of Forward Detectors
-    if hasattr(runArgs, 'LucidOn'):
-        detectors = detectors+['Lucid']
-    if hasattr(runArgs, 'ZDCOn'):
-        detectors = detectors+['ZDC']
-    if hasattr(runArgs, 'AFPOn'):
-        detectors = detectors+['AFP']
-    if hasattr(runArgs, 'ALFAOn'):
-        detectors = detectors+['ALFA']
-    if hasattr(runArgs, 'FwdRegionOn'):
-        detectors = detectors+['FwdRegion']
-    #TODO here support switching on Cavern geometry
-    #if hasattr(runArgs, 'CavernOn'):
-    #    detectors = detectors+['Cavern']
+    # Generate detector list
+    from SimuJobTransforms.SimulationHelpers import getDetectorsFromRunArgs
+    detectors = getDetectorsFromRunArgs(ConfigFlags, runArgs)
 
     if hasattr(runArgs, 'simulator'):
         ConfigFlags.Sim.ISF.Simulator = runArgs.simulator
@@ -156,7 +139,7 @@ def fromRunArgs(runArgs):
     # Lock flags
     ConfigFlags.lock()
 
-    from CommonSimulationSteering import CommonSimulationCfg
+    from SimuJobTransforms.CommonSimulationSteering import CommonSimulationCfg
     cfg = CommonSimulationCfg(ConfigFlags, log)
 
     # Post-include
diff --git a/Simulation/SimuJobTransforms/python/HITSMerge_Skeleton.py b/Simulation/SimuJobTransforms/python/HITSMerge_Skeleton.py
new file mode 100644
index 000000000000..043a7b868e37
--- /dev/null
+++ b/Simulation/SimuJobTransforms/python/HITSMerge_Skeleton.py
@@ -0,0 +1,84 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+import sys
+from PyJobTransforms.CommonRunArgsToFlags import commonRunArgsToFlags
+from PyJobTransforms.TransformUtils import processPreExec, processPreInclude, processPostExec, processPostInclude
+
+
+def fromRunArgs(runArgs):
+    from AthenaCommon.Configurable import Configurable
+    Configurable.configurableRun3Behavior = True
+
+    from AthenaCommon.Logging import logging
+    log = logging.getLogger('HITSMerge_tf')
+    log.info('****************** STARTING HIT MERGING *****************')
+
+    log.info('**** Transformation run arguments')
+    log.info(str(runArgs))
+
+    log.info('**** Setting-up configuration flags')
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    commonRunArgsToFlags(runArgs, ConfigFlags)
+
+    if hasattr(runArgs, 'inputHITSFile'):
+        ConfigFlags.Input.Files = runArgs.inputHITSFile
+    else:
+        raise RuntimeError('No input HITS file defined')
+
+    if hasattr(runArgs, 'outputHITS_MRGFile'):
+        if runArgs.outputHITS_MRGFile == 'None':
+            ConfigFlags.Output.HITSFileName = ''
+            # TODO decide if we need a specific HITS_MRGFileName flag
+        else:
+            ConfigFlags.Output.HITSFileName  = runArgs.outputHITS_MRGFile
+    else:
+        raise RuntimeError('No outputHITS_MRGFile defined')
+
+    # Generate detector list and setup detector flags
+    from SimuJobTransforms.SimulationHelpers import getDetectorsFromRunArgs
+    detectors = getDetectorsFromRunArgs(ConfigFlags, runArgs)
+    from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
+    setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
+
+    # Pre-include
+    processPreInclude(runArgs, ConfigFlags)
+
+    # Pre-exec
+    processPreExec(runArgs, ConfigFlags)
+
+    # Lock flags
+    ConfigFlags.lock()
+
+    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    cfg = MainServicesCfg(ConfigFlags)
+
+    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
+    cfg.merge(PoolReadCfg(ConfigFlags))
+    cfg.merge(PoolWriteCfg(ConfigFlags))
+
+    # Minor geometry dependencies
+    if ConfigFlags.Detector.GeometryLAr:
+        from LArGeoAlgsNV.LArGMConfig import LArGMCfg
+        cfg.merge(LArGMCfg(ConfigFlags))
+    if ConfigFlags.Detector.GeometryTile:
+        from TileGeoModel.TileGMConfig import TileGMCfg
+        cfg.merge(TileGMCfg(ConfigFlags))
+
+    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
+    cfg.merge(OutputStreamCfg(ConfigFlags, 'HITS', disableEventTag=True))
+    cfg.getEventAlgo('OutputStreamHITS').TakeItemsFromInput = True
+
+    # Post-include
+    processPostInclude(runArgs, ConfigFlags, cfg)
+
+    # Post-exec
+    processPostExec(runArgs, ConfigFlags, cfg)
+
+    import time
+    tic = time.time()
+    # Run the final accumulator
+    sc = cfg.run()
+    log.info("Ran HITSMerge_tf in " + str(time.time()-tic) + " seconds")
+
+    sys.exit(not sc.isSuccess())
diff --git a/Simulation/SimuJobTransforms/python/ISF_Skeleton.py b/Simulation/SimuJobTransforms/python/ISF_Skeleton.py
index b9aad23154e8..09ae87185c5b 100644
--- a/Simulation/SimuJobTransforms/python/ISF_Skeleton.py
+++ b/Simulation/SimuJobTransforms/python/ISF_Skeleton.py
@@ -48,26 +48,9 @@ def fromRunArgs(runArgs):
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     commonRunArgsToFlags(runArgs, ConfigFlags)
 
-    if hasattr(runArgs, 'detectors'):
-        detectors = runArgs.detectors
-    else:
-        from AthenaConfiguration.AutoConfigFlags import getDefaultDetectors
-        detectors = getDefaultDetectors(ConfigFlags.GeoModel.AtlasVersion)
-
-    # Support switching on simulation of Forward Detectors
-    if hasattr(runArgs, 'LucidOn'):
-        detectors = detectors+['Lucid']
-    if hasattr(runArgs, 'ZDCOn'):
-        detectors = detectors+['ZDC']
-    if hasattr(runArgs, 'AFPOn'):
-        detectors = detectors+['AFP']
-    if hasattr(runArgs, 'ALFAOn'):
-        detectors = detectors+['ALFA']
-    if hasattr(runArgs, 'FwdRegionOn'):
-        detectors = detectors+['FwdRegion']
-    #TODO here support switching on Cavern geometry
-    #if hasattr(runArgs, 'CavernOn'):
-    #    detectors = detectors+['Cavern']
+    # Generate detector list
+    from SimuJobTransforms.SimulationHelpers import getDetectorsFromRunArgs
+    detectors = getDetectorsFromRunArgs(ConfigFlags, runArgs)
 
     if hasattr(runArgs, 'simulator'):
        ConfigFlags.Sim.ISF.Simulator = runArgs.simulator
@@ -166,7 +149,7 @@ def fromRunArgs(runArgs):
     # Lock flags
     ConfigFlags.lock()
 
-    from CommonSimulationSteering import CommonSimulationCfg
+    from SimuJobTransforms.CommonSimulationSteering import CommonSimulationCfg
     cfg = CommonSimulationCfg(ConfigFlags, log)
 
     # Post-include
diff --git a/Simulation/SimuJobTransforms/python/RDOMerge_Skeleton.py b/Simulation/SimuJobTransforms/python/RDOMerge_Skeleton.py
new file mode 100644
index 000000000000..a8f141bf4af2
--- /dev/null
+++ b/Simulation/SimuJobTransforms/python/RDOMerge_Skeleton.py
@@ -0,0 +1,122 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+import sys
+from PyJobTransforms.CommonRunArgsToFlags import commonRunArgsToFlags
+from PyJobTransforms.TransformUtils import processPreExec, processPreInclude, processPostExec, processPostInclude
+
+
+def fromRunArgs(runArgs):
+    from AthenaCommon.Configurable import Configurable
+    Configurable.configurableRun3Behavior = True
+
+    from AthenaCommon.Logging import logging
+    log = logging.getLogger('RDOMerge_tf')
+    log.info('****************** STARTING RDO MERGING *****************')
+
+    log.info('**** Transformation run arguments')
+    log.info(str(runArgs))
+
+    log.info('**** Setting-up configuration flags')
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    commonRunArgsToFlags(runArgs, ConfigFlags)
+
+    if hasattr(runArgs, "PileUpPresampling"):
+        from AthenaConfiguration.Enums import ProductionStep
+        ConfigFlags.Common.ProductionStep = ProductionStep.PileUpPresampling
+
+    if hasattr(runArgs, 'inputRDOFile'):
+        ConfigFlags.Input.Files = runArgs.inputRDOFile
+    else:
+        raise RuntimeError('No input RDO file defined')
+
+    if hasattr(runArgs, 'outputRDO_MRGFile'):
+        if runArgs.outputRDO_MRGFile == 'None':
+            ConfigFlags.Output.RDOFileName = ''
+            # TODO decide if we need a specific RDO_MRGFileName flag
+        else:
+            ConfigFlags.Output.RDOFileName  = runArgs.outputRDO_MRGFile
+    else:
+        raise RuntimeError('No outputRDO_MRGFile defined')
+
+    # Generate detector list and setup detector flags
+    from SimuJobTransforms.SimulationHelpers import getDetectorsFromRunArgs
+    detectors = getDetectorsFromRunArgs(ConfigFlags, runArgs)
+    from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
+    setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
+
+    # Pre-include
+    processPreInclude(runArgs, ConfigFlags)
+
+    # Pre-exec
+    processPreExec(runArgs, ConfigFlags)
+
+    # Lock flags
+    ConfigFlags.lock()
+
+    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+    cfg = MainServicesCfg(ConfigFlags)
+
+    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
+    cfg.merge(PoolReadCfg(ConfigFlags))
+    cfg.merge(PoolWriteCfg(ConfigFlags))
+
+    # Geometry dependencies
+    if ConfigFlags.Detector.EnablePixel:
+        from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
+        cfg.merge(PixelGeometryCfg(ConfigFlags))
+    if ConfigFlags.Detector.EnableSCT:
+        from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg
+        cfg.merge(SCT_GeometryCfg(ConfigFlags))
+    if ConfigFlags.Detector.EnableTRT:
+        from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg
+        cfg.merge(TRT_GeometryCfg(ConfigFlags))
+
+    if ConfigFlags.Detector.EnableITkPixel:
+        from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelGeometryCfg
+        cfg.merge(ITkPixelGeometryCfg(ConfigFlags))
+    if ConfigFlags.Detector.EnableITkStrip:
+        from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripGeometryCfg
+        cfg.merge(ITkStripGeometryCfg(ConfigFlags))
+
+    if ConfigFlags.Detector.EnableHGTD:
+        from HGTD_GeoModel.HGTD_GeoModelConfig import HGTD_GeometryCfg
+        cfg.merge(HGTD_GeometryCfg(ConfigFlags))
+
+    if ConfigFlags.Detector.EnableLAr:
+        from LArGeoAlgsNV.LArGMConfig import LArGMCfg
+        cfg.merge(LArGMCfg(ConfigFlags))
+    if ConfigFlags.Detector.EnableTile:
+        from TileGeoModel.TileGMConfig import TileGMCfg
+        cfg.merge(TileGMCfg(ConfigFlags))
+        from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
+        cfg.merge(TileCablingSvcCfg(ConfigFlags))
+
+    if ConfigFlags.Detector.EnableMuon:
+        from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
+        cfg.merge(MuonGeoModelCfg(ConfigFlags))
+        if ConfigFlags.Detector.EnableRPC:
+            from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg
+            cfg.merge(RPCCablingConfigCfg(ConfigFlags))
+
+    from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
+    cfg.merge(OutputStreamCfg(ConfigFlags, 'RDO'))
+    cfg.getEventAlgo('OutputStreamRDO').TakeItemsFromInput = True
+
+    # Silence HepMcParticleLink warnings
+    from Digitization.DigitizationSteering import DigitizationMessageSvcCfg
+    cfg.merge(DigitizationMessageSvcCfg(ConfigFlags))
+
+    # Post-include
+    processPostInclude(runArgs, ConfigFlags, cfg)
+
+    # Post-exec
+    processPostExec(runArgs, ConfigFlags, cfg)
+
+    import time
+    tic = time.time()
+    # Run the final accumulator
+    sc = cfg.run()
+    log.info("Ran RDOMerge_tf in " + str(time.time()-tic) + " seconds")
+
+    sys.exit(not sc.isSuccess())
diff --git a/Simulation/SimuJobTransforms/python/SimTransformUtils.py b/Simulation/SimuJobTransforms/python/SimTransformUtils.py
index a3bf68cc5343..db6bdd85856d 100644
--- a/Simulation/SimuJobTransforms/python/SimTransformUtils.py
+++ b/Simulation/SimuJobTransforms/python/SimTransformUtils.py
@@ -191,7 +191,8 @@ def addConfigurableSimSubstep(executorSet, confName, extraSkeleton, confSubStep,
 
 def addStandardHITSMergeSubstep(executorSet):
     executorSet.add(athenaExecutor(name = 'HITSMerge', substep="hitsmerge", skeletonFile = 'SimuJobTransforms/skeleton.HITSMerge.py',
-                                              tryDropAndReload = False, inputDataTypeCountCheck = ['HITS']))
+                                   skeletonCA = 'SimuJobTransforms.HITSMerge_Skeleton',
+                                   tryDropAndReload = False, inputDataTypeCountCheck = ['HITS']))
 
 def addAFII_HITSMergeSubstep(executorSet):
     executorSet.add(athenaExecutor(name = 'HITSMerge', substep="hitsmerge", skeletonFile = 'SimuJobTransforms/skeleton.HITSMerge.py',
diff --git a/Simulation/SimuJobTransforms/python/SimulationHelpers.py b/Simulation/SimuJobTransforms/python/SimulationHelpers.py
new file mode 100644
index 000000000000..96721e0dece2
--- /dev/null
+++ b/Simulation/SimuJobTransforms/python/SimulationHelpers.py
@@ -0,0 +1,26 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+def getDetectorsFromRunArgs(ConfigFlags, runArgs):
+    """Generate detector list based on runtime arguments."""
+    if hasattr(runArgs, 'detectors'):
+        detectors = runArgs.detectors
+    else:
+        from AthenaConfiguration.AutoConfigFlags import getDefaultDetectors
+        detectors = getDefaultDetectors(ConfigFlags.GeoModel.AtlasVersion)
+
+    # Support switching on Forward Detectors
+    if hasattr(runArgs, 'LucidOn'):
+        detectors = detectors+['Lucid']
+    if hasattr(runArgs, 'ZDCOn'):
+        detectors = detectors+['ZDC']
+    if hasattr(runArgs, 'AFPOn'):
+        detectors = detectors+['AFP']
+    if hasattr(runArgs, 'ALFAOn'):
+        detectors = detectors+['ALFA']
+    if hasattr(runArgs, 'FwdRegionOn'):
+        detectors = detectors+['FwdRegion']
+    # TODO here support switching on Cavern geometry
+    # if hasattr(runArgs, 'CavernOn'):
+    #     detectors = detectors+['Cavern']
+
+    return detectors
diff --git a/Simulation/SimuJobTransforms/scripts/RDOMerge_tf.py b/Simulation/SimuJobTransforms/scripts/RDOMerge_tf.py
index ff8e0ddf1095..59c5f496b9f7 100755
--- a/Simulation/SimuJobTransforms/scripts/RDOMerge_tf.py
+++ b/Simulation/SimuJobTransforms/scripts/RDOMerge_tf.py
@@ -36,6 +36,7 @@ def main():
 def getTransform():
     executorSet = set()
     executorSet.add(athenaExecutor(name = 'RDOMerge', skeletonFile = 'SimuJobTransforms/skeleton.RDOMerge.py',
+                                   skeletonCA = 'SimuJobTransforms.RDOMerge_Skeleton',
                                    inData = ['RDO'], outData = ['RDO_MRG']))
 
     trf = transform(executor = executorSet)
diff --git a/Tools/PyJobTransforms/python/trfArgClasses.py b/Tools/PyJobTransforms/python/trfArgClasses.py
index 47bbcd90e8a6..5773aa6d012e 100644
--- a/Tools/PyJobTransforms/python/trfArgClasses.py
+++ b/Tools/PyJobTransforms/python/trfArgClasses.py
@@ -1395,6 +1395,7 @@ class argHITSFile(argPOOLFile):
                             'HITS_MRG' : argHITSFile(output, type=self.type, io='output')}
         myMergeConf = executorConfig(myargdict, myDataDictionary)
         myMerger = athenaExecutor(name = mySubstepName, skeletonFile = 'SimuJobTransforms/skeleton.HITSMerge.py',
+                                  skeletonCA = 'SimuJobTransforms.HITSMerge_Skeleton',
                                   conf=myMergeConf, 
                                   inData=set(['HITS']), outData=set(['HITS_MRG']), disableMP=True)
         myMerger.doAll(input=set(['HITS']), output=set(['HITS_MRG']))
@@ -1470,6 +1471,7 @@ class argRDOFile(argPOOLFile):
                             'RDO_MRG' : argHITSFile(output, type=self.type, io='output')}
         myMergeConf = executorConfig(myargdict, myDataDictionary)
         myMerger = athenaExecutor(name = 'RDOMergeAthenaMP{0}'.format(counter), skeletonFile = 'SimuJobTransforms/skeleton.RDOMerge.py',
+                                  skeletonCA = 'SimuJobTransforms.RDOMerge_Skeleton',
                                   conf=myMergeConf, 
                                   inData=set(['RDO']), outData=set(['RDO_MRG']), disableMP=True)
         myMerger.doAll(input=set(['RDO']), output=set(['RDO_MRG']))
diff --git a/Tools/PyJobTransforms/scripts/Merge_tf.py b/Tools/PyJobTransforms/scripts/Merge_tf.py
index 1971051cd331..f56ff2006a08 100755
--- a/Tools/PyJobTransforms/scripts/Merge_tf.py
+++ b/Tools/PyJobTransforms/scripts/Merge_tf.py
@@ -49,8 +49,6 @@ def getTransform():
                                    inData = ['AOD_MRG'], outData = ['TAG'],))
     executorSet.add(tagMergeExecutor(name = 'TAGFileMerge', exe = 'CollAppend', inData = set(['TAG']), outData = set(['TAG_MRG'])))
     executorSet.add(DQMergeExecutor(name = 'DQHistogramMerge', inData = [('HIST_ESD', 'HIST_AOD'), 'HIST'], outData = ['HIST_MRG']))
-    executorSet.add(athenaExecutor(name = 'RDOMerge', skeletonFile = 'SimuJobTransforms/skeleton.RDOMerge.py',
-                                   inData = ['RDO'], outData = ['RDO_MRG']))
     executorSet.add(bsMergeExecutor(name = 'RAWFileMerge', exe = 'file_merging', inData = set(['BS']), outData = set(['BS_MRG'])))
     executorSet.add(athenaExecutor(name = 'EVNTMerge', skeletonFile = 'PyJobTransforms/skeleton.EVNTMerge.py',inData = ['EVNT'], outData = ['EVNT_MRG']))
 
@@ -69,16 +67,30 @@ def getTransform():
     addD3PDArguments(trf.parser, transform=trf, addD3PDMRGtypes=True)
     addExtraDPDTypes(trf.parser, transform=trf, NTUPMergerArgs = True)
 
-    # Add HITSMerge only if SimuJobTransforms is available
+    # Add HITSMerge and RDOMerge only if SimuJobTransforms is available
     try:
         from SimuJobTransforms.SimTransformUtils import addHITSMergeArguments
         addHITSMergeArguments(trf.parser)
-        simStepSet = set()
-        simStepSet.add(athenaExecutor(name = 'HITSMerge', substep="hitsmerge", skeletonFile = 'SimuJobTransforms/skeleton.HITSMerge.py',
-                                   tryDropAndReload = False, inData = ['HITS'], outData = ['HITS_MRG']))
-        trf.appendToExecutorSet(list(simStepSet)[0])
+        trf.appendToExecutorSet(athenaExecutor(name = 'HITSMerge', substep="hitsmerge", skeletonFile = 'SimuJobTransforms/skeleton.HITSMerge.py',
+                                               skeletonCA = 'SimuJobTransforms.HITSMerge_Skeleton',
+                                               tryDropAndReload = False, inData = ['HITS'], outData = ['HITS_MRG']))
+
+        trf.appendToExecutorSet(athenaExecutor(name = 'RDOMerge', skeletonFile = 'SimuJobTransforms/skeleton.RDOMerge.py',
+                                skeletonCA = 'SimuJobTransforms.RDOMerge_Skeleton',
+                                inData = ['RDO'], outData = ['RDO_MRG']))
+
+        trf.parser.defineArgGroup('RDOMerge_tf', 'RDO merge job specific options')
+        trf.parser.add_argument('--inputRDOFile', nargs='+',
+                                type=trfArgClasses.argFactory(trfArgClasses.argRDOFile, io='input'),
+                                help='Input RDO file', group='RDOMerge_tf')
+        trf.parser.add_argument('--outputRDO_MRGFile', '--outputRDOFile', 
+                                type=trfArgClasses.argFactory(trfArgClasses.argRDOFile, io='output'),
+                                help='Output merged RDO file', group='RDOMerge_tf')
+        trf.parser.add_argument('--PileUpPresampling',
+                                type=trfArgClasses.argFactory(trfArgClasses.argBool),
+                                help='Run digitization with pile-up presampling configuration.', group='RDOMerge_tf')
     except ImportError as e:
-        msg.warning('Failed to import simulation arguments ({0}). HITSMerge will not be available.'.format(e))
+        msg.warning('Failed to import simulation arguments ({0}). HITSMerge and RDOMerge will not be available.'.format(e))
 
 
     return trf
@@ -132,17 +144,6 @@ def addMyArgs(parser):
                         type=trfArgClasses.argFactory(trfArgClasses.argHISTFile, io='output', runarg=True, type='hist'), 
                         help='Output DQ monitoring file', group='DQHistMerge_tf')
 
-    parser.defineArgGroup('RDOMerge_tf', 'RDO merge job specific options')
-    parser.add_argument('--inputRDOFile', nargs='+',
-                        type=trfArgClasses.argFactory(trfArgClasses.argRDOFile, io='input'),
-                        help='Input RDO file', group='RDOMerge_tf')
-    parser.add_argument('--outputRDO_MRGFile', '--outputRDOFile', 
-                        type=trfArgClasses.argFactory(trfArgClasses.argRDOFile, io='output'),
-                        help='Output merged RDO file', group='RDOMerge_tf')
-    parser.add_argument('--PileUpPresampling',
-                        type=trfArgClasses.argFactory(trfArgClasses.argBool),
-                        help='Run digitization with pile-up presampling configuration.', group='RDOMerge_tf')
-
     parser.defineArgGroup('RAWMerge_tf', 'RAWMerge specific options')
     parser.add_argument('--inputBSFile', nargs='+', 
                         type=trfArgClasses.argFactory(trfArgClasses.argBSFile, io='input'),
-- 
GitLab


From c0c6dbcbf14802a71c6cd788762a7767d44d5d1a Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Wed, 15 Sep 2021 16:34:24 +0200
Subject: [PATCH 128/347] Make output POOL settings more flexible

---
 .../python/PoolWriteConfig.py                 | 43 +++++++++++--------
 .../python/CommonSimulationSteering.py        |  5 ---
 .../python/FilterHit_Skeleton.py              |  8 +---
 3 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py
index 0dcf592cd522..8352f051e2a8 100644
--- a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py
@@ -7,7 +7,7 @@ from AthenaConfiguration.ComponentFactory import CompFactory
 AthenaPoolCnvSvc=CompFactory.AthenaPoolCnvSvc
 
 
-def PoolWriteCfg(flags):
+def PoolWriteCfg(flags, forceTreeAutoFlush=-1):
     """Return ComponentAccumulator configured to Write POOL files"""
     # based on WriteAthenaPool._configureWriteAthenaPool
     acc = ComponentAccumulator()
@@ -31,51 +31,58 @@ def PoolWriteCfg(flags):
 
     if flags.Output.EVNT_TRFileName:
         # Use LZMA w/ Level 1
-        PoolAttributes += [ pah.setFileCompAlg( flags.Output.EVNT_TRFileName, 2 ) ]
+        comp_alg = 1 if '_000' in flags.Output.HITSFileName or 'tmp.' in flags.Output.HITSFileName else 2
+        auto_flush = forceTreeAutoFlush if forceTreeAutoFlush != -1 else 1
+        PoolAttributes += [ pah.setFileCompAlg( flags.Output.EVNT_TRFileName, comp_alg ) ]
         PoolAttributes += [ pah.setFileCompLvl( flags.Output.EVNT_TRFileName, 1 ) ]
         # Flush the CollectionTree, POOLContainer, and POOLContainerForm to disk at every 1 events
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.EVNT_TRFileName, "CollectionTree", 1 ) ]
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.EVNT_TRFileName, "POOLContainer", 1 ) ]
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.EVNT_TRFileName, "POOLContainerForm", 1 ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.EVNT_TRFileName, "CollectionTree", auto_flush ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.EVNT_TRFileName, "POOLContainer", auto_flush ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.EVNT_TRFileName, "POOLContainerForm", auto_flush ) ]
 
     if flags.Output.HITSFileName:
         # Use LZMA w/ Level 1
-        PoolAttributes += [ pah.setFileCompAlg( flags.Output.HITSFileName, 2 ) ]
+        comp_alg = 1 if '_000' in flags.Output.HITSFileName or 'tmp.' in flags.Output.HITSFileName else 2
+        auto_flush = forceTreeAutoFlush if forceTreeAutoFlush != -1 else 10
+        PoolAttributes += [ pah.setFileCompAlg( flags.Output.HITSFileName, comp_alg ) ]
         PoolAttributes += [ pah.setFileCompLvl( flags.Output.HITSFileName, 1 ) ]
         # Flush the CollectionTree, POOLContainer, and POOLContainerForm to disk at every 1 events
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.HITSFileName, "CollectionTree", 1 ) ]
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.HITSFileName, "POOLContainer", 1 ) ]
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.HITSFileName, "POOLContainerForm", 1 ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.HITSFileName, "CollectionTree", auto_flush ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.HITSFileName, "POOLContainer", auto_flush ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.HITSFileName, "POOLContainerForm", auto_flush ) ]
 
     if flags.Output.RDOFileName:
         # Use LZMA w/ Level 1
         comp_alg = 1 if '_000' in flags.Output.RDOFileName or 'tmp.' in flags.Output.RDOFileName else 2
+        auto_flush = forceTreeAutoFlush if forceTreeAutoFlush != -1 else 10
         PoolAttributes += [ pah.setFileCompAlg( flags.Output.RDOFileName, comp_alg ) ]
         PoolAttributes += [ pah.setFileCompLvl( flags.Output.RDOFileName, 1 ) ]
         # Flush the CollectionTree, POOLContainer, and POOLContainerForm to disk at every 10 events
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.RDOFileName, "CollectionTree", 10 ) ]
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.RDOFileName, "POOLContainer", 10 ) ]
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.RDOFileName, "POOLContainerForm", 10 ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.RDOFileName, "CollectionTree", auto_flush ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.RDOFileName, "POOLContainer", auto_flush ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.RDOFileName, "POOLContainerForm", auto_flush ) ]
 
     if flags.Output.ESDFileName:
         # Use LZMA w/ Level 1
         comp_alg = 1 if '_000' in flags.Output.ESDFileName or 'tmp.' in flags.Output.ESDFileName else 2
+        auto_flush = forceTreeAutoFlush if forceTreeAutoFlush != -1 else 10
         PoolAttributes += [ pah.setFileCompAlg( flags.Output.ESDFileName, comp_alg ) ]
         PoolAttributes += [ pah.setFileCompLvl( flags.Output.ESDFileName, 1 ) ]
         # Flush the CollectionTree, POOLContainer, and POOLContainerForm to disk at every 10 events
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.ESDFileName, "CollectionTree", 10 ) ]
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.ESDFileName, "POOLContainer", 10 ) ]
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.ESDFileName, "POOLContainerForm", 10 ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.ESDFileName, "CollectionTree", auto_flush ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.ESDFileName, "POOLContainer", auto_flush ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.ESDFileName, "POOLContainerForm", auto_flush ) ]
 
     if flags.Output.AODFileName:
         # Use LZMA w/ Level 1
         comp_alg = 1 if '_000' in flags.Output.AODFileName or 'tmp.' in flags.Output.AODFileName else 2
+        auto_flush = forceTreeAutoFlush if forceTreeAutoFlush != -1 else 100
         PoolAttributes += [ pah.setFileCompAlg( flags.Output.AODFileName, comp_alg ) ]
         PoolAttributes += [ pah.setFileCompLvl( flags.Output.AODFileName, 1 ) ]
         # Flush the CollectionTree, POOLContainer, and POOLContainerForm to disk at every 100 events
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.AODFileName, "CollectionTree", 100 ) ]
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.AODFileName, "POOLContainer", 100 ) ]
-        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.AODFileName, "POOLContainerForm", 100 ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.AODFileName, "CollectionTree", auto_flush ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.AODFileName, "POOLContainer", auto_flush ) ]
+        PoolAttributes += [ pah.setTreeAutoFlush( flags.Output.AODFileName, "POOLContainerForm", auto_flush ) ]
 
     acc.addService(AthenaPoolCnvSvc(PoolAttributes = PoolAttributes))
     acc.addService(CompFactory.EvtPersistencySvc(CnvServices=["AthenaPoolCnvSvc"]))
diff --git a/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py b/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
index 3ba30b6774e3..f4ecb2cffe02 100644
--- a/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
+++ b/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
@@ -73,9 +73,4 @@ def CommonSimulationCfg(ConfigFlags, log):
         cfg.merge( OutputStreamCfg(ConfigFlags,"EVNT_TR", ItemList=getStreamEVNT_TR_ItemList(ConfigFlags), disableEventTag=True) )
         cfg.getEventAlgo("OutputStreamEVNT_TR").AcceptAlgs=[AcceptAlgName]
 
-    # FIXME hack because deduplication is broken
-    PoolAttributes = ["TREE_BRANCH_OFFSETTAB_LEN = '100'"]
-    PoolAttributes += ["DatabaseName = '" + ConfigFlags.Output.HITSFileName + "'; ContainerName = 'TTree=CollectionTree'; TREE_AUTO_FLUSH = '1'"]
-    cfg.getService("AthenaPoolCnvSvc").PoolAttributes += PoolAttributes
-
     return cfg
diff --git a/Simulation/SimuJobTransforms/python/FilterHit_Skeleton.py b/Simulation/SimuJobTransforms/python/FilterHit_Skeleton.py
index 9402340a5214..25992f89346d 100644
--- a/Simulation/SimuJobTransforms/python/FilterHit_Skeleton.py
+++ b/Simulation/SimuJobTransforms/python/FilterHit_Skeleton.py
@@ -145,7 +145,8 @@ def fromRunArgs(runArgs):
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
     from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
     cfg.merge(PoolReadCfg(ConfigFlags))
-    cfg.merge(PoolWriteCfg(ConfigFlags))
+    # force TreeAutoFlush=1 as events will be accessed randomly
+    cfg.merge(PoolWriteCfg(ConfigFlags, forceTreeAutoFlush=1))
 
     # add LArHitFilter + AddressRemappingSvc
     if ConfigFlags.Detector.EnableLAr:
@@ -218,11 +219,6 @@ def fromRunArgs(runArgs):
     from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
     cfg.merge( OutputStreamCfg(ConfigFlags,"HITS", ItemList=getStreamHITS_ItemList(ConfigFlags), disableEventTag=True) )
 
-    # FIXME hack because deduplication is broken
-    PoolAttributes = ["TREE_BRANCH_OFFSETTAB_LEN = '100'"]
-    PoolAttributes += ["DatabaseName = '" + ConfigFlags.Output.HITSFileName + "'; ContainerName = 'TTree=CollectionTree'; TREE_AUTO_FLUSH = '1'"]
-    cfg.getService("AthenaPoolCnvSvc").PoolAttributes += PoolAttributes
-
     # Post-include
     processPostInclude(runArgs, ConfigFlags, cfg)
 
-- 
GitLab


From 1eb3d0b46b1642627c9d7dfb728a018ca9e837e4 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Wed, 15 Sep 2021 19:24:05 +0200
Subject: [PATCH 129/347] MuonCondData+MuonCondSvc: Enable thread-safety
 checking.

---
 .../MuonCondData/ATLAS_CHECK_THREAD_SAFETY          |  1 +
 .../MuonCondData/CscCondDataCollectionBase.h        |  9 +--------
 .../MuonCondSvc/MuonCondSvc/CscCoolStrSvc.h         |  5 +++--
 .../MuonCondSvc/src/CscCoolStrSvc.cxx               | 13 +++++++------
 4 files changed, 12 insertions(+), 16 deletions(-)
 create mode 100644 MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/ATLAS_CHECK_THREAD_SAFETY

diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/ATLAS_CHECK_THREAD_SAFETY b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..20bfa081ecf8
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDataCollectionBase.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDataCollectionBase.h
index 41fe3500f0f1..89ac26a17d9a 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDataCollectionBase.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDataCollectionBase.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 CSCCONDDATACOLLECTIONBASE_H 
@@ -15,7 +15,6 @@
 **/
 
 #include "AthContainers/DataVector.h"
-#include "StoreGate/DataHandle.h"
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
 #include "MuonCondData/CscCondData.h"
 
@@ -75,10 +74,6 @@ namespace MuonCalib {
       //Get size
       virtual size_t getSize() const = 0; 
 
-      const DataHandle<CondAttrListCollection> & atrcHandle() const {
-        return m_atrcHandle;
-      }
-
       //record an entry to the DataVector 
       virtual StatusCode recordFromSS(std::istringstream & ss, const unsigned int & index) = 0;
 
@@ -104,8 +99,6 @@ namespace MuonCalib {
 
       int m_numBits;
       int m_bitOffset;
-      
-      const DataHandle<CondAttrListCollection> m_atrcHandle;
   };
 
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.h
index 2b90dca2e85e..1e693c1ea65e 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.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 MUONCONDSVC_CSCCOOLSTRSVC_H
@@ -181,7 +181,8 @@ namespace MuonCalib {
 
     /**Map is an easier way to reference parameters by name than the dbCache*/
     std::map<std::string, CscCondDataCollectionBase*> m_parNameMap;
-    std::map<std::string, CscCondDataCollectionBase*> m_parSGKeyMap;
+    std::map<std::string, std::pair<CscCondDataCollectionBase*,
+                                    const DataHandle<CondAttrListCollection> > > m_parSGKeyMap;
 
     const CscCondDataCollection<float>* m_rmsCondData;
     const CscCondDataCollection<float>* m_slopeCondData;
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx
index d84c5e0a3103..dc8919b6f9e5 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.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
 */
 
 //Service designed to read in calibration files to the cool database. Can also read them
@@ -326,7 +326,7 @@ namespace MuonCalib {
 
       //Store the pointers in maps for easy lookup later
       m_parNameMap[name] = coll;
-      m_parSGKeyMap[sgKey] = coll;
+      m_parSGKeyMap[sgKey].first = coll;
       
       if( name == "rms" ) m_rmsCondData = dynamic_cast<CscCondDataCollection<float>*>(coll);
       else if( m_pslopeFromDB && name == "pslope" ) m_slopeCondData = dynamic_cast<CscCondDataCollection<float>*>(coll);
@@ -340,7 +340,8 @@ namespace MuonCalib {
         if( !m_statusCondData ) ATH_MSG_WARNING("Wrong data type for status bit " << dataType);
       }else  ATH_MSG_WARNING("Data type not cached, a direct access should be provided " << name);
       
-      const DataHandle<CondAttrListCollection> & dataHandle = coll->atrcHandle();
+      
+      const DataHandle<CondAttrListCollection> & dataHandle = m_parSGKeyMap[sgKey].second;
 
       //Registering callback function. The callback funciton will now be called
       //whenever the parameter in question is altered. i.e. whenever it goes
@@ -804,7 +805,7 @@ namespace MuonCalib {
   {
     if(msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Caching parameter " << parKey);
     ///*****//
-    std::map<std::string, CscCondDataCollectionBase*>::iterator collItr = m_parSGKeyMap.find(parKey);
+    auto collItr = m_parSGKeyMap.find(parKey);
 
     if(collItr == m_parSGKeyMap.end())
     {
@@ -813,7 +814,7 @@ namespace MuonCalib {
       return StatusCode::RECOVERABLE;
     }
 
-    CscCondDataCollectionBase * coll = dynamic_cast<CscCondDataCollectionBase *>( collItr->second);
+    CscCondDataCollectionBase * coll = dynamic_cast<CscCondDataCollectionBase *>( collItr->second.first);
 
     coll->reset(); //Clear vector and set to size dictated by maxIndex
 
@@ -823,7 +824,7 @@ namespace MuonCalib {
     const unsigned int & numCoolChannels = coll->getNumCoolChan();
 
 
-    const CondAttrListCollection * atrc = &*(coll->atrcHandle());
+    const CondAttrListCollection * atrc = &*(collItr->second.second);
 
     //now cycle through all chambers in database;
     unsigned int numCoolChannelsFound = 0;
-- 
GitLab


From d1c6679376c83fe879969cfca938388aa91c194a Mon Sep 17 00:00:00 2001
From: Chav Chhiv Chau <chav.chhiv.chau@cern.ch>
Date: Wed, 15 Sep 2021 19:27:26 +0200
Subject: [PATCH 130/347] Add a detailed description of wire digit time with
 distance of closest approach

---
 .../sTGC_Digitization/sTgcDigitMaker.h        |  30 +-
 .../share/sTGC_Digitization_timeArrival.dat   |  39 +++
 .../sTGC_Digitization/src/sTgcDigitMaker.cxx  | 282 ++++++++++++++----
 .../src/sTgcDigitizationTool.cxx              |  11 +-
 4 files changed, 305 insertions(+), 57 deletions(-)
 create mode 100644 MuonSpectrometer/MuonDigitization/sTGC_Digitization/share/sTGC_Digitization_timeArrival.dat

diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h
index a02703fefcd9..c7bc27353772 100644
--- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h
+++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h
@@ -20,6 +20,7 @@
 #include "GaudiKernel/StatusCode.h"
 #include "Identifier/Identifier.h"
 #include "AthenaKernel/MsgStreamMember.h"
+#include "MuonSimEvent/sTGCSimHit.h"
 
 namespace CLHEP {
   class HepRandomEngine;
@@ -33,7 +34,6 @@ namespace MuonGM {
 class sTgcDigitCollection;
 class sTgcHitIdHelper;
 class sTgcIdHelper;
-class sTGCSimHit; 
 
 //--- class description
 class sTgcDigitMaker {
@@ -76,6 +76,16 @@ class sTgcDigitMaker {
     OFFSET_CHANNELTYPE = 0
   };
 
+  /** Parameters of a gamma probability distribution function, required for 
+   *  estimating wire digit's time of arrival.
+   *  More detail in the dat file.
+   */
+  struct GammaParameter {
+    double lowEdge; // low side of the interval in ns
+    double kParameter;
+    double thetaParameter;
+    double mostProbableTime;
+  };
 
   /**
      Reads parameters for intrinsic time response from timejitter.dat.
@@ -108,6 +118,8 @@ class sTgcDigitMaker {
   void readFileOfTimeWindowOffset();
   /** Read share/sTGC_Digitization_alignment.dat file */
   //void readFileOfAlignment();
+  /** Read share/sTGC_Digitization_timeArrival.dat */
+  void readFileOfTimeArrival();
   ///** Get energy threshold value for each chamber */
   double getEnergyThreshold(const std::string& stationName, int stationEta, int stationPhi, int multiPlet, int gasGap, int channelType) const;
   //void randomCrossTalk(const Identifier elemId, const int gasGap, const int channelType, const int channel,
@@ -122,6 +134,19 @@ class sTgcDigitMaker {
   //void adHocPositionShift(const std::string stationName, int stationEta, int stationPhi,
   //                        const Amg::Vector3D direCos, Amg::Vector3D &localPos) const;
 
+  /** Compute the distance between a track segment and a wire. 
+   *  Expected distance is between zero and half of wire pitch (i.e. 0.9 mm),
+   *  but can be greater if particle passes through the edge of a chamber.
+   *  Assumig the hit is near wire k, the sign of the distance returned is:
+   *   - negative if particle crosses the wire surface between wire k and wire k-1
+   *   + positive if particle crosses the wire surface between wire k and wire k+1
+   *  In case of error, the function returns -9.99.
+   */
+  double distanceToWire(Amg::Vector3D& position, Amg::Vector3D& direction, Identifier id, int wire_number) const;
+
+  /** Find the gamma pdf parameters of a given distance */
+  GammaParameter getGammaParameter(double distance) const;
+
   /** Energy threshold value for each chamber */
   double m_energyThreshold[N_STATIONNAME][N_STATIONETA][N_STATIONPHI][N_MULTIPLET][N_GASGAP][N_CHANNELTYPE]{};
   ///** Cross talk probabilty for each chamber */
@@ -143,6 +168,9 @@ class sTgcDigitMaker {
 
   std::vector<std::vector<float> > m_vecAngle_Time;
 
+  // Parameters of the gamma pdf required for determining digit time
+  std::vector<GammaParameter> m_gammaParameter;
+
   CLHEP::HepRandomEngine* m_engine{}; // not owned here
   const sTgcHitIdHelper* m_hitIdHelper{}; // not owned here
   const MuonGM::MuonDetectorManager* m_mdManager{}; // not owned here
diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/share/sTGC_Digitization_timeArrival.dat b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/share/sTGC_Digitization_timeArrival.dat
new file mode 100644
index 000000000000..21db68524e9e
--- /dev/null
+++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/share/sTGC_Digitization_timeArrival.dat
@@ -0,0 +1,39 @@
+# Characterization of the time of arrival
+#
+# Time of arrival is obtained from Garfield simulation. It is parametrized as 
+# a function of the distance of closest approach, i.e. the shortest distance 
+# from a particle's trajectory to the nearest wire.
+# The approach is the following: dividing the Garfield data into 9 intervals 
+# of 0.1 mm (distance of closest approach), then fit the time distribution in
+# each interval.
+# 
+# In each interval, the time of arrival distribution can be described by a 
+# gamma distribution with three parameters: 
+#  - the usual k and theta parameters, and 
+#  - t0--the shift from zero.
+# The gamma probability distribution function is:
+#   P(t) = 1 / (\Gamma(k) * {\theta}^k) * (t - t0)^{k-1} * exp(-(t - t0) / {\theta})
+# where t is the time of arrival to be selected and t0 is the earliest time of 
+# arrival allowed.
+#
+# The current implementation in Athena use the parameters k and theta, and the 
+# most probable value (peak of the gamma pdf) instead of t0. First, a gamma 
+# random number generator is launched to choose a time, say a value val, then 
+# it is shifted by the best-fitted most probable value minus (k-1)*theta. The 
+# best-fitted most probable value (mpv) already includes t0, while the product 
+# (k-1)*theta gives the most probable value of the gamma pdf begining at origin.
+# In other word, t0 = mpv - (k-1)*theta and the resulting time of arrival is 
+# given by 
+#       time = val + (mpv - (k-1) * theta).
+#
+# Below are the parameters to be read. Line starting with '#' is not read.
+# keyword  low_edge[mm]  k  theta  mpv[ns]
+bin 0.0  1.000  0.833  0.0  
+bin 0.1  2.342  0.455  0.899
+bin 0.2  3.474  0.391  2.220
+bin 0.3  4.153  0.376  3.733
+bin 0.4  5.778  0.321  5.441
+bin 0.5  5.046  0.364  7.186
+bin 0.6  5.981  0.392  9.300
+bin 0.7  5.771  0.533  11.997
+bin 0.8  3.068  1.488  16.095
diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx
index 144bf193683f..685898b31a42 100644
--- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx
+++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx
@@ -5,7 +5,6 @@
 #include "sTGC_Digitization/sTgcDigitMaker.h"
 
 #include "MuonDigitContainer/sTgcDigitCollection.h"
-#include "MuonSimEvent/sTGCSimHit.h"
 #include "MuonSimEvent/sTgcHitIdHelper.h"
 #include "MuonSimEvent/sTgcSimIdToOfflineId.h"
 #include "MuonIdHelpers/sTgcIdHelper.h"
@@ -83,6 +82,9 @@ StatusCode sTgcDigitMaker::initialize(CLHEP::HepRandomEngine *rndmEngine, const
 
   readFileOfTimeJitter();
 
+  // Read share/sTGC_Digitization_timeArrivale.dat, containing the digit time of arrival
+  readFileOfTimeArrival();
+
   // getting our random numbers stream
   m_engine = rndmEngine;
 
@@ -127,42 +129,136 @@ std::unique_ptr<sTgcDigitCollection> sTgcDigitMaker::executeDigi(const sTGCSimHi
   //////////  convert ID for this digitizer system 
   sTgcSimIdToOfflineId simToOffline(m_idHelper);  
   int simId = hit->sTGCId();
-  Identifier layid = simToOffline.convert(simId);
+  Identifier offlineId = simToOffline.convert(simId);
+  std::string stationName= m_idHelper->stationNameString(m_idHelper->stationName(offlineId));
+  int stationEta = m_idHelper->stationEta(offlineId);
+  int stationPhi  = m_idHelper->stationPhi(offlineId);
+  int multiPlet = m_idHelper->multilayer(offlineId);
+  int gasGap = m_idHelper->gasGap(offlineId);
+  Identifier layid = m_idHelper->channelID(m_idHelper->stationName(offlineId), stationEta, stationPhi, 
+                                           multiPlet, gasGap, sTgcIdHelper::sTgcChannelTypes::Wire, 1);
+
   ATH_MSG_VERBOSE("sTgc hit:  time " << hit->globalTime() << " position " << hit->globalPosition().x() << "  " << hit->globalPosition().y() << "  " << hit->globalPosition().z() << " mclink " << hit->particleLink() << " PDG ID " << hit->particleEncoding() );
 
-  std::string stName = m_idHelper->stationNameString(m_idHelper->stationName(layid));
-  int isSmall = stName[2] == 'S';
+  int isSmall = stationName[2] == 'S';
 
-  ATH_MSG_DEBUG("Retrieving detector element for: isSmall " << isSmall << " eta " << m_idHelper->stationEta(layid) << " phi " << m_idHelper->stationPhi(layid) << " ml " << m_idHelper->multilayer(layid) << " energyDeposit "<<energyDeposit );
+  ATH_MSG_DEBUG("Retrieving detector element for: isSmall " << isSmall << " eta " << stationEta << " phi " << stationPhi << " ml " << multiPlet << " energyDeposit "<<energyDeposit );
 
   const MuonGM::sTgcReadoutElement* detEl = m_mdManager->getsTgcReadoutElement(layid);
   if( !detEl ){
-    ATH_MSG_WARNING("Failed to retrieve detector element for: isSmall " << isSmall << " eta " << m_idHelper->stationEta(layid) << " phi " << m_idHelper->stationPhi(layid) << " ml " << m_idHelper->multilayer(layid) );
+    ATH_MSG_WARNING("Failed to retrieve detector element for: isSmall " << isSmall << " eta " << stationEta << " phi " << stationPhi << " ml " << multiPlet );
     return nullptr;
   }
  
   // DO THE DIGITIZATTION HERE ////////
 
-  //#################################################################################
-  //############### find the detectorElement and check efficiency ###################
-  //#################################################################################
-
-  std::string stationName= m_idHelper->stationNameString(m_idHelper->stationName(layid));
-  int stationEta = m_idHelper->stationEta(layid);
-  int stationPhi  = m_idHelper->stationPhi(layid);
-  int multiPlet = m_idHelper->multilayer(layid);
-  int gasGap = m_idHelper->gasGap(layid);
-
-  // Get wire surface here for effiency purposes
-  int surfHash_wire =  detEl->surfaceHash(gasGap, 2);
+  // Retrieve the wire surface
+  int surfHash_wire = detEl->surfaceHash(gasGap, sTgcIdHelper::sTgcChannelTypes::Wire);
   const Trk::PlaneSurface& SURF_WIRE = detEl->surface(surfHash_wire); // get the wire surface
 
+  // Hit global position
   Amg::Vector3D GPOS(hit->globalPosition().x(),hit->globalPosition().y(),hit->globalPosition().z());
-  Amg::Vector3D hitOnSurface_wire = SURF_WIRE.transform().inverse()*GPOS;
+  // Hit global direction
+  const Amg::Vector3D GLODIRE(hit->globalDirection().x(), hit->globalDirection().y(), hit->globalDirection().z());
+
+  // Hit position in the wire surface's coordinate frame 
+  Amg::Vector3D hitOnSurface_wire = SURF_WIRE.transform().inverse() * GPOS;
   Amg::Vector2D posOnSurf_wire(hitOnSurface_wire.x(), hitOnSurface_wire.y());
 
-  if (m_doEfficiencyCorrection){ // HV efficiency correction
-    Identifier tempId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, 2, 1, true);
+  /* Determine the closest wire and the distance of closest approach
+   * Since most particles pass through the the wire plane between two wires,
+   * the nearest wire should be one of these two wire. Otherwise, the particle's
+   * trajectory is uncommon, and such rare case is not supported yet.
+   *
+   * Finding that nearest wire follows the following steps:
+   * - Compute the distance to the wire at the center of the current wire pitch
+   * - Compute the distance to the other adjacent wire and, if it is smaller, 
+   *   verify the distance to the next to the adjacent wire
+   */
+
+  // hit direction in the wire surface's coordinate frame
+  Amg::Vector3D loc_dire_wire = SURF_WIRE.transform().inverse().linear()*GLODIRE;
+
+  // Wire number of the current wire pitch
+  int wire_number = detEl->getDesign(layid)->wireNumber(posOnSurf_wire);
+
+  // Compute the distance from the hit to the wire, return value of -9.99 if unsuccessful
+  double dist_wire = distanceToWire(hitOnSurface_wire, loc_dire_wire, layid, wire_number);
+  if (dist_wire < -9.) {
+    ATH_MSG_WARNING("Failed to get the distance between the hit at (" 
+                    << hitOnSurface_wire.x() << ", " << hitOnSurface_wire.y() << ")"
+                    << " and wire number = " << wire_number 
+                    << ", chamber stationName: " << stationName 
+                    << ", stationEta: " << stationEta
+                    << ", stationPhi: " << stationPhi
+                    << ", multiplet:" << multiPlet
+                    << ", gas gap: " << gasGap);
+  } else {
+    // Determine the other adjacent wire, which is +1 if particle passes through the 
+    // wire plane between wires wire_number and wire_number+1 and -1 if particle
+    // passes through between wires wire_number and wire_number-1
+    int adjacent = 1;
+    if (dist_wire < 0.) {adjacent = -1;}
+
+    // Compute distance to the other adjacent wire
+    double dist_wire_adj = distanceToWire(hitOnSurface_wire, loc_dire_wire, layid, wire_number + adjacent);
+    if (std::abs(dist_wire_adj) < std::abs(dist_wire)) {
+      dist_wire = dist_wire_adj;
+      wire_number = wire_number + adjacent;
+
+      // Check the next to the adjacent wire to catch uncommon track
+      if ((wire_number + adjacent) > 1) {
+        double tmp_dist = distanceToWire(hitOnSurface_wire, loc_dire_wire, layid, wire_number + adjacent * 2);
+        if (std::abs(tmp_dist) < std::abs(dist_wire)) {
+          ATH_MSG_WARNING("Wire number is more than one wire pitch away for hit position = (" 
+                          << hitOnSurface_wire.x() << ", " << hitOnSurface_wire.y() << ")"
+                          << ", wire number = " << wire_number + adjacent * 2
+                          << ", with d(-2) = " << tmp_dist
+                          << ", while d(0) = " << dist_wire
+                          << ", chamber stationName = " << stationName
+                          << ", stationEta = " << stationEta
+                          << ", stationPhi = " << stationPhi
+                          << ", multiplet = " << multiPlet
+                          << ", gas gap = " << gasGap);
+        }
+      }
+    }
+  }
+
+  // Distance should be in the range [0, 0.9] mm, unless particle passes through 
+  // the wire plane near the edges
+  double wire_pitch = detEl->wirePitch();
+  if ((dist_wire > -9.) && (std::abs(dist_wire) > (wire_pitch / 2))) {
+    ATH_MSG_DEBUG("Distance to the nearest wire (" << std::abs(dist_wire) << ") is greater than expected.");
+  }
+
+  // Get the gamma pdf parameters associated with the distance of closest approach.
+  GammaParameter gamma_par = getGammaParameter(std::abs(dist_wire));
+  // Compute the most probable value of the gamma pdf
+  double gamma_mpv = (gamma_par.kParameter - 1) * gamma_par.thetaParameter;
+  // If the most probable value is near zero, then ensure it is zero
+  if ((gamma_par.mostProbableTime) < 0.1) {gamma_mpv = 0.;}
+  double t0_par = gamma_par.mostProbableTime - gamma_mpv;
+
+  // Digit time follows a gamma distribution, so a value val is 
+  // chosen using a gamma random generator then shifted by t0
+  // to account for drift time.
+  // Note: CLHEP::RandGamma takes the parameters k and lambda, 
+  // where lambda = 1 / theta.
+  double digit_time = t0_par + CLHEP::RandGamma::shoot(m_engine, gamma_par.kParameter, 1/gamma_par.thetaParameter);
+  if (digit_time < 0.0) {
+    // Ensure the digit time is positive
+    digit_time = -1.0 * digit_time;
+  }
+  ATH_MSG_DEBUG("sTgcDigitMaker distance = " << dist_wire 
+                << ", time = " << digit_time
+                << ", k parameter = " << gamma_par.kParameter
+                << ", theta parameter = " << gamma_par.thetaParameter
+                << ", most probable time = " << gamma_par.mostProbableTime);
+
+  //// HV efficiency correction
+  if (m_doEfficiencyCorrection){
+    Identifier tempId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, sTgcIdHelper::sTgcChannelTypes::Wire, 1, true);
     // Transform STL and STS to 0 and 1 respectively
     int stNameInt = (stationName=="STL") ? 0 : 1;
     // If inside eta0 bin of QL1/QS1, remove 1 from eta index
@@ -190,18 +286,6 @@ std::unique_ptr<sTgcDigitCollection> sTgcDigitMaker::executeDigi(const sTGCSimHi
 
   bool isValid = 0;
 
-
-  // #################################################################
-  // get the GlobalPosition (propergated to the wire surface)
-  // #################################################################
-
-  const Amg::Vector3D GLODIRE(hit->globalDirection().x(), hit->globalDirection().y(), hit->globalDirection().z());
-
-  // get strip surface 
-  int surfHash_strip =  detEl->surfaceHash(gasGap, 1);
-  const Trk::PlaneSurface& SURF_STRIP = detEl->surface(surfHash_strip); // get the strip surface
-
-
   // #################################################################
   //***************************** BCTAGGER ******************************** 
   // #################################################################
@@ -218,27 +302,13 @@ std::unique_ptr<sTgcDigitCollection> sTgcDigitMaker::executeDigi(const sTGCSimHi
   //// bunch time
   //float bunchTime = globalHitTime - tofCorrection;
 
-  Trk::LocalDirection LocDirection;
-  SURF_STRIP.globalToLocalDirection(GLODIRE, LocDirection);
-
-  float inAngle_space = std::fabs( LocDirection.angleXZ() / CLHEP::degree);
-  float inAngle_time = std::fabs( LocDirection.angleYZ() / CLHEP::degree);
-
-  if(inAngle_time > 90)  inAngle_time  = inAngle_time  -90.; 
-  if(inAngle_space > 90) inAngle_space = inAngle_space -90.; 
-
-  static const float jitterInitial = 9999.;
-  float timeJitterDetector = jitterInitial; // calculated at central strip but also used in all the strips fired by the same hit 
-  if(timeJitterDetector > jitterInitial-0.1) {
-    timeJitterDetector = timeJitter(inAngle_time);
-  }
 
   //const float stripPropagationTime = 3.3*CLHEP::ns/CLHEP::m * detEl->distanceToReadout(posOnSurf_strip, elemId); // 8.5*ns/m was used until MC10. 
   const float stripPropagationTime = 0.; // 8.5*ns/m was used until MC10. 
 
-  float sDigitTimeWire = timeJitterDetector;
-  float sDigitTimePad = timeJitterDetector + m_timeWindowOffsetPad;
-  float sDigitTimeStrip = timeJitterDetector + m_timeWindowOffsetStrip + stripPropagationTime;
+  float sDigitTimeWire = digit_time;
+  float sDigitTimePad = sDigitTimeWire + m_timeWindowOffsetPad;
+  float sDigitTimeStrip = sDigitTimeWire + m_timeWindowOffsetStrip + stripPropagationTime;
 
 
   //if(m_doTimeCorrection) sDigitTime = bunchTime + timeJitterDetector + timeJitterElectronics + stripPropagationTime;
@@ -270,6 +340,10 @@ std::unique_ptr<sTgcDigitCollection> sTgcDigitMaker::executeDigi(const sTGCSimHi
 
   Identifier newId = m_idHelper->channelID(m_idHelper->parentID(layid), multiPlet, gasGap, channelType, 1, true);
 
+  // get strip surface 
+  int surfHash_strip =  detEl->surfaceHash(gasGap, 1);
+  const Trk::PlaneSurface& SURF_STRIP = detEl->surface(surfHash_strip); // get the strip surface
+
   Amg::Vector3D hitOnSurface_strip = SURF_STRIP.transform().inverse()*GPOS;
 
   Amg::Vector2D posOnSurf_strip(hitOnSurface_strip.x(),hitOnSurface_strip.y());
@@ -481,6 +555,57 @@ std::unique_ptr<sTgcDigitCollection> sTgcDigitMaker::executeDigi(const sTGCSimHi
   return digits;
 }
 
+//+++++++++++++++++++++++++++++++++++++++++++++++
+double sTgcDigitMaker::distanceToWire(Amg::Vector3D& position, Amg::Vector3D& direction, Identifier id, int wire_number) const
+{
+  // Wire number should be one or greater
+  if (wire_number < 1) {
+    return -9.99;
+  }
+
+  // Get the current sTGC element (a four-layer chamber)
+  const MuonGM::sTgcReadoutElement* detEl = m_mdManager->getsTgcReadoutElement(id);
+
+  // Wire number too large
+  if (wire_number > detEl->numberOfWires(id)) {
+    return -9.99;
+  }
+
+  // Wire pitch
+  double wire_pitch = detEl->wirePitch();
+  // Wire local position on the wire plane, the y-coordinate is arbitrary and z-coordinate is zero
+  double wire_posX = detEl->positionFirstWire(id) + (wire_number - 1) * wire_pitch;
+  Amg::Vector3D wire_position(wire_posX, position.y(), 0.);
+  // The wires are parallel to Y in the wire plane's coordinate frame
+  Amg::Vector3D wire_direction(0., 1., 0.);
+
+  // Determine the sign of the distance, which is: 
+  //  - negative if particle crosses the wire surface on the wire_number-1 side and 
+  //  + positive if particle crosses the wire surface on the wire_number+1 side
+  double sign = 1.0;
+  if ((position.x() - wire_posX) < 0.) {
+    sign = -1.0;
+  }
+
+  // Distance of closest approach is the distance between the two lines: 
+  //      - particle's segment
+  //      - wire line
+
+  // Find a line perpendicular to both hit direction and wire direction
+  Amg::Vector3D perp_line = direction.cross(wire_direction);
+  double norm_line = std::sqrt(perp_line.dot(perp_line));
+  if (norm_line < 1.0e-5) {
+    ATH_MSG_WARNING("Unable to compute the distance of closest approach," 
+                    << " a negative value is assumed to indicate the error.");
+    return -9.99;
+  }
+  // Compute the distance of closest approach, which is given by the projection of 
+  // the vector going from hit position to wire position onto the perpendicular line
+  double distance = std::abs((position - wire_position).dot(perp_line) / norm_line);
+     
+  return (sign * distance);
+}
+
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void sTgcDigitMaker::readFileOfTimeJitter()
 {
@@ -1057,6 +1182,63 @@ int sTgcDigitMaker::getIStationName(const std::string& stationName) const {
   return iStationName;
 }
 
+//+++++++++++++++++++++++++++++++++++++++++++++++
+void sTgcDigitMaker::readFileOfTimeArrival() {
+  // Verify the file sTGC_Digitization_timeArrival.dat exists
+  const std::string file_name = "sTGC_Digitization_timeArrival.dat";
+  std::string file_path = PathResolver::find_file(file_name.c_str(), "DATAPATH");
+  if(file_path.empty()) {
+    ATH_MSG_FATAL("readFileOfTimeWindowOffset(): Could not find file " << file_name.c_str() );
+    return;
+  }
+
+  // Open the sTGC_Digitization_timeArrival.dat file
+  std::ifstream ifs;
+  ifs.open(file_path.c_str(), std::ios::in);
+  if(ifs.bad()) {
+    ATH_MSG_FATAL("sTgcDigitMaker: Failed to open time of arrival file " << file_name.c_str() );
+    return;
+  }
+
+  // Read the sTGC_Digitization_timeWindowOffset.dat file
+  std::string line;
+  GammaParameter param;
+
+  while (std::getline(ifs, line)) {
+    std::string key;
+    std::istringstream iss(line);
+    iss >> key;
+    if (key.compare("bin") == 0) {
+      iss >> param.lowEdge >> param.kParameter >> param.thetaParameter >> param.mostProbableTime;
+      m_gammaParameter.push_back(param);
+    } 
+  }
+
+  // Close the file
+  ifs.close();
+}
+
+//+++++++++++++++++++++++++++++++++++++++++++++++
+sTgcDigitMaker::GammaParameter sTgcDigitMaker::getGammaParameter(double distance) const {
+
+  double d = distance;
+  if (d < 0.) {
+    ATH_MSG_WARNING("getGammaParameter: expecting a positive distance, but got negative value: " << d
+                     << ". Proceed to the calculation with the absolute value.");
+    d = -1.0 * d;
+  }
+
+  // Find the parameters assuming the container is sorted
+  int index{-1};
+  for (auto& par: m_gammaParameter) {
+    if (distance < par.lowEdge) {
+      break;
+    }
+    ++index;
+  }
+  return m_gammaParameter.at(index);
+}
+
 ////+++++++++++++++++++++++++++++++++++++++++++++++
 //void sTgcDigitMaker::adHocPositionShift(const std::string stationName, int stationEta, int stationPhi,
 //                                       const Amg::Vector3D direCos, Amg::Vector3D &localPos) const {
diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx
index 03ba1f4a404c..2efa5b375437 100644
--- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx
@@ -433,9 +433,9 @@ StatusCode sTgcDigitizationTool::doDigitization(const EventContext& ctx) {
       Amg::Vector3D LOCDIRE = SURF_WIRE.transform().inverse()*GLODIRE - SURF_WIRE.transform().inverse()*GLOBAL_ORIG;
       Amg::Vector3D LPOS = SURF_WIRE.transform().inverse() * HPOS;  //Position of the hit on the wire plane in local coordinates
 
-      ATH_MSG_VERBOSE("Local Z " << LOCAL_Z );
-      ATH_MSG_VERBOSE("Local Direction " << LOCDIRE );
-      ATH_MSG_VERBOSE("Local Position " << LPOS );
+      ATH_MSG_VERBOSE("Local Z: (" << LOCAL_Z.x() << ", " << LOCAL_Z.y() << ", " << LOCAL_Z.y() <<")" );
+      ATH_MSG_VERBOSE("Local Direction: (" << LOCDIRE.x() << ", " << LOCDIRE.y() << ", " << LOCDIRE.z() << ")" );
+      ATH_MSG_VERBOSE("Local Position: (" << LPOS.x() << ", " << LPOS.y() << ", " << LPOS.z() << ")" );
 
       double e = 1e-5;
 
@@ -459,8 +459,8 @@ StatusCode sTgcDigitizationTool::doDigitization(const EventContext& ctx) {
       Amg::Vector3D HITONSURFACE_WIRE = LPOS + scale * LOCDIRE;  //Hit on the wire surface attached to the closest wire in local coordinates
       Amg::Vector3D G_HITONSURFACE_WIRE = SURF_WIRE.transform() * HITONSURFACE_WIRE;  //The hit on the wire in Global coordinates
 
-      ATH_MSG_VERBOSE("Local Hit on Wire Surface " << HITONSURFACE_WIRE );
-      ATH_MSG_VERBOSE("Global Hit on Wire Surface " << G_HITONSURFACE_WIRE );
+      ATH_MSG_VERBOSE("Local Hit on Wire Surface: (" << HITONSURFACE_WIRE.x() << ", " << HITONSURFACE_WIRE.y() << ", " << HITONSURFACE_WIRE.z() << ")"  );
+      ATH_MSG_VERBOSE("Global Hit on Wire Surface: (" << G_HITONSURFACE_WIRE.x() << ", " << G_HITONSURFACE_WIRE.y() << ", " << G_HITONSURFACE_WIRE.z() << ")" );
 
       ATH_MSG_DEBUG("sTgcDigitizationTool::doDigitization hits mapped");
 
@@ -529,7 +529,6 @@ StatusCode sTgcDigitizationTool::doDigitization(const EventContext& ctx) {
         if(eventId != 0)  //hit not from the main signal subevent
           isPileup = 1;
 
-        ATH_MSG_VERBOSE("...Check time 5: " << newTime );
         // Create a new digit with updated time and BCTag
         sTgcDigit newDigit(newDigitId, newBcTag, newTime, newCharge, isDead, isPileup);
         ATH_MSG_VERBOSE("Unmerged Digit") ;
-- 
GitLab


From e3971c332dcdacc3f6ff646860a9a7313867948f Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Wed, 15 Sep 2021 20:06:04 +0200
Subject: [PATCH 131/347] 22.0-cppcheck-InDetTrackingGeometry

---
 .../src/StagedTrackingGeometryBuilder.cxx                   | 2 +-
 .../InDetSimpleVisual/src/GetDetectorPositions.cxx          | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
index 3d474b5ad6da..6a2f4bead130 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
@@ -592,7 +592,7 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::createTrackingV
             if (!ringSet.size() || zPos>ringSet.back()->surfaceRepresentation().center().z()) ringSet.push_back(ring);
             else {
               std::vector<const Trk::Layer*>::iterator lit = ringSet.begin();
-              while (lit!=ringSet.end() && zPos>(*lit)->surfaceRepresentation().center().z()) lit++;
+              while (lit!=ringSet.end() && zPos>(*lit)->surfaceRepresentation().center().z()) ++lit;
               ringSet.insert(lit,ring);  
             }   
           }
diff --git a/InnerDetector/InDetGraphics/InDetAlignVisual/InDetSimpleVisual/src/GetDetectorPositions.cxx b/InnerDetector/InDetGraphics/InDetAlignVisual/InDetSimpleVisual/src/GetDetectorPositions.cxx
index 0a59e59857f8..c80a6a4507d4 100644
--- a/InnerDetector/InDetGraphics/InDetAlignVisual/InDetSimpleVisual/src/GetDetectorPositions.cxx
+++ b/InnerDetector/InDetGraphics/InDetAlignVisual/InDetSimpleVisual/src/GetDetectorPositions.cxx
@@ -32,8 +32,8 @@
 
 #include "StoreGate/ReadCondHandle.h"
 
-#include <stdlib.h>
-#include <string.h>
+#include <cstdlib>
+#include <string>
 #include <vector>
 
 /** Constructor */
@@ -255,7 +255,7 @@ void GetDetectorPositions::writeSimpleTRTPositions(){
   std::vector<Identifier>::const_iterator trtStrawLayIt = m_TRTHelper->straw_layer_begin();
   std::vector<Identifier>::const_iterator trtStrawLayItE = m_TRTHelper->straw_layer_end();
 
-  for(; trtStrawLayIt != trtStrawLayItE; trtStrawLayIt++  ) {
+  for(; trtStrawLayIt != trtStrawLayItE; ++trtStrawLayIt  ) {
     writeTRTPositions(*trtStrawLayIt);
   }
 
-- 
GitLab


From 1481bac414f3c101038fb248c60e6e3580f19034 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Wed, 15 Sep 2021 20:15:20 +0200
Subject: [PATCH 132/347] 22.0-cppcheck-TRT_PAI_Process

---
 .../TRT_PAI_Process/src/TRT_PAI_Process.cxx   |  2 +-
 .../src/TRT_PAI_effectiveGas.cxx              | 37 ++++++++++---------
 .../TRT_PAI_Process/src/TRT_PAI_element.cxx   |  6 +--
 .../TRT_PAI_Process/src/TRT_PAI_element.h     |  3 +-
 .../src/TRT_PAI_gasComponent.h                |  2 +-
 5 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_Process.cxx b/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_Process.cxx
index 5a4a8a253212..77221e85ca9d 100644
--- a/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_Process.cxx
+++ b/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_Process.cxx
@@ -101,7 +101,7 @@ StatusCode TRT_PAI_Process::initialize() {
 
   // Print out elements
   {
-    for (element_type::iterator ei=elements.begin(); ei!=elements.end(); ei++) {
+    for (element_type::iterator ei=elements.begin(); ei!=elements.end(); ++ei) {
       ATH_MSG_DEBUG ( ". Element "  << (*ei).second.getName()
                       << ", A= "    << (*ei).second.getAtomicA()
                       << ", Z= "    << (*ei).second.getAtomicZ()
diff --git a/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_effectiveGas.cxx b/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_effectiveGas.cxx
index 5525b660a8ce..10da665cbf6c 100644
--- a/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_effectiveGas.cxx
+++ b/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_effectiveGas.cxx
@@ -13,6 +13,8 @@
 #include <vector>
 #include <iostream>
 #include <complex>
+#include <cmath>
+#include <algorithm> //for std::max, std::clamp
 
 #include "CLHEP/Units/SystemOfUnits.h"
 
@@ -23,8 +25,8 @@ TRT_PAI_effectiveGas::TRT_PAI_effectiveGas(TRT_PAI_gasMixture * gm,
 					   double Emax,
 					   double tempK,
 					   double eps)
-  : m_lnEmin(log(Emin)),
-    m_lnEmax(log(Emax)),
+  : m_lnEmin(std::log(Emin)),
+    m_lnEmax(std::log(Emax)),
     m_eps(eps),
     m_msg("TRT_PAI_effectiveGas")
 {
@@ -55,12 +57,10 @@ TRT_PAI_effectiveGas::TRT_PAI_effectiveGas(TRT_PAI_gasMixture * gm,
   m_S1  = mb/(2.*M_PI*M_PI*r0*he*Zeff);  // x-section to F.osc
   m_S2  = 2.*M_PI*r0*m_ne*Qe*Qe/erg;   // dN/dx scale
 
-// ATH_MSG_DEBUG ( "Gas density          " << rho );
   ATH_MSG_DEBUG ( "effectiveGas: Electron density     " << m_ne );
   ATH_MSG_DEBUG ( "effectiveGas: Plasma freq**2 {eV}  " << m_Wp2 );
   ATH_MSG_DEBUG ( "effectiveGas: x-section to F.osc   " << m_S1 );
   ATH_MSG_DEBUG ( "effectiveGas: dN/dx scale          " << m_S2 );
-// ATH_MSG_DEBUG ( "effectiveGas: Zeff= " << Zeff << ", Aeff= " << Aeff );
 
   // Merge all energy levels into ELvls
   std::vector<float> tempv;
@@ -91,7 +91,6 @@ TRT_PAI_effectiveGas::TRT_PAI_effectiveGas(TRT_PAI_gasMixture * gm,
 
   int NLvls = m_lnELvls.size();
 
-  // ATH_MSG_DEBUG( "NLvls= " << NLvls );
 
   // Expand vectors to correct dimension
   m_lnFosc.resize(NLvls);
@@ -110,10 +109,12 @@ TRT_PAI_effectiveGas::TRT_PAI_effectiveGas(TRT_PAI_gasMixture * gm,
 	double lnSig = TRT_PAI_utils::Interpolate( m_lnELvls[i],
 						   pe->getLnELvls(),
 						   pe->getLnSigmas() );
-	fosc += exp(lnSig) * gm->getElemWeight(k);
+	fosc += std::exp(lnSig) * gm->getElemWeight(k);
       }
     }
-    m_lnFosc[i] = log(fosc);
+    //clamp, just in case
+    fosc = std::clamp(fosc, 1e-300,1e+300);
+    m_lnFosc[i] = std::log(fosc);
   }
 
   // Create array of integrated cross-sections
@@ -132,7 +133,7 @@ TRT_PAI_effectiveGas::TRT_PAI_effectiveGas(TRT_PAI_gasMixture * gm,
 		     m_eps,
 		     0.);
     sigma  += dsigma;
-    lnSigma = log(sigma);
+    lnSigma = std::log(sigma);
     m_lnIntegratedSigmas[i] = lnSigma;
   }
 
@@ -142,7 +143,7 @@ TRT_PAI_effectiveGas::TRT_PAI_effectiveGas(TRT_PAI_gasMixture * gm,
     m_lnIntegratedSigmas[i] -= lnSigma;
   }
 
-  double cnst = log(0.5*M_PI*m_Wp2);
+  double cnst = std::log(M_PI_2*m_Wp2);
   for (int i=0; i<NLvls; i++) {
     m_lnEpsI[i]  =  cnst - m_lnELvls[i] + m_lnFosc[i];
     float xint = XGInt(&TRT_PAI_effectiveGas::XFReal,
@@ -150,7 +151,7 @@ TRT_PAI_effectiveGas::TRT_PAI_effectiveGas(TRT_PAI_gasMixture * gm,
 		       m_lnEmax,
 		       m_eps,
 		       m_lnELvls[i] );
-    m_lnEpsR[i]  = m_Wp2 * exp(m_lnELvls[i]) * xint;
+    m_lnEpsR[i]  = m_Wp2 * std::exp(m_lnELvls[i]) * xint;
   }
   return;
 }
@@ -163,7 +164,7 @@ double TRT_PAI_effectiveGas::XSigma (double lnE, double dummy) {
 				    m_lnELvls,
 				    m_lnFosc);
   xsig = std::max(xsig,-99.);
-  xsig = exp( xsig + lnE );
+  xsig = std::exp( xsig + lnE );
   return xsig;
 }
 
@@ -174,16 +175,16 @@ double TRT_PAI_effectiveGas::XFReal (double lnD, double lnE) {
   double fp = 0.;
   if ( lnE+lnD > m_lnEmin ) {
     fp = TRT_PAI_utils::Interpolate(lnE+lnD, m_lnELvls, m_lnFosc);
-    fp = exp(std::max(fp, -99.0));
+    fp = std::exp(std::max(fp, -99.0));
   }
 
   double fm = 0.;
   if (lnE-lnD > m_lnEmin ) {
     fm = TRT_PAI_utils::Interpolate(lnE-lnD, m_lnELvls, m_lnFosc);
-    fm = exp(std::max(fm, -99.0));
+    fm = std::exp(std::max(fm, -99.0));
   }
 
-  double x = exp(lnD);
+  double x = std::exp(lnD);
   return x/(x*x-1.)*(fp-fm);
 }
 
@@ -238,20 +239,20 @@ double TRT_PAI_effectiveGas::dndedx(double lnE, double gamma) {
   using namespace TRT_PAI_physicsConstants;
   using namespace TRT_PAI_utils;
 
-  double E       = exp(lnE);
+  double E       = std::exp(lnE);
   double gammaSq = gamma*gamma;
   double betaSq  = 1.-1./gammaSq;
 
   double er = Interpolate(lnE, m_lnELvls, m_lnEpsR);
   double ei = Interpolate(lnE, m_lnELvls, m_lnEpsI);
 
-  std::complex<double> Ceps1(er/(E*E), exp(ei));
+  std::complex<double> Ceps1(er/(E*E), std::exp(ei));
   std::complex<double> C1 = 1./gammaSq - Ceps1*betaSq;
-  std::complex<double> C2 = C1/(1.+Ceps1) * log(2.*betaSq*MeeV/(E*C1));
+  std::complex<double> C2 = C1/(1.+Ceps1) * std::log(2.*betaSq*MeeV/(E*C1));
 
   double x;
   x = Interpolate(lnE, m_lnELvls, m_lnIntegratedSigmas);
-  x = m_S2/betaSq * E * ( -2.*imag(C2)/(m_Wp2*M_PI) + (1.-exp(x))/(E*E) );
+  x = m_S2/betaSq * E * ( -2.*imag(C2)/(m_Wp2*M_PI) + (1.-std::exp(x))/(E*E) );
 
   return x;
 }
diff --git a/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_element.cxx b/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_element.cxx
index 3ac9cf909d9d..64deb63e69a3 100644
--- a/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_element.cxx
+++ b/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_element.cxx
@@ -10,7 +10,7 @@
 
 //____________________________________________________________________________
 
-TRT_PAI_element::TRT_PAI_element(std::string nm,
+TRT_PAI_element::TRT_PAI_element(const std::string & nm,
 				 const float *E,
 				 const float *S,
 				 int          N,
@@ -21,8 +21,8 @@ TRT_PAI_element::TRT_PAI_element(std::string nm,
   m_atomicZ(Z)
 {
   for ( int i=0; i<N; ++i ) {
-    m_lnEnergyLvls.push_back( log(E[i]) );
-    m_lnCrossScts.push_back( log(S[i]) );
+    m_lnEnergyLvls.push_back( std::log(E[i]) );
+    m_lnCrossScts.push_back( std::log(S[i]) );
   }
   return;
 }
diff --git a/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_element.h b/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_element.h
index 42b1f36845ee..bf8b2defbc87 100755
--- a/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_element.h
+++ b/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_element.h
@@ -6,7 +6,6 @@
 #define TRT_PAI_element_h
 
 #include <string>
-#include <iostream>
 #include <vector>
 
 /**
@@ -28,7 +27,7 @@ public:
    * \param Z:  atomic Z
    * \param A:  atomic A
    */
-  TRT_PAI_element(std::string nm,
+  TRT_PAI_element(const std::string & nm,
 		  const float *E,
 		  const float *S,
 		  int N,
diff --git a/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_gasComponent.h b/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_gasComponent.h
index 27119e059bb6..a0b18b063bdd 100644
--- a/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_gasComponent.h
+++ b/InnerDetector/InDetSimUtils/TRT_PAI_Process/src/TRT_PAI_gasComponent.h
@@ -25,7 +25,7 @@ public:
    *Constructor of gas component
    * \param nm: component name
    */
-  TRT_PAI_gasComponent(std::string nm) : m_name(nm) {};
+  TRT_PAI_gasComponent(const std::string & nm) : m_name(nm) {};
 
   /**
    * Add element to gas component
-- 
GitLab


From 662bc4ae5815cbfa666a4cbb578ec719811304f9 Mon Sep 17 00:00:00 2001
From: David Richard Shope <david.richard.shope@cern.ch>
Date: Wed, 15 Sep 2021 20:23:18 +0200
Subject: [PATCH 133/347] Port HGTD fast digi from 21.9 to master

---
 .../HGTD_FastDigitization/CMakeLists.txt      |  21 +
 .../ATLAS_CHECK_THREAD_SAFETY                 |   1 +
 .../HGTD_SmearedDigitizationTool.h            | 144 ++++++
 .../python/HGTD_SmearedDigitizationConfig.py  |   3 +
 .../src/HGTD_SmearedDigitizationTool.cxx      | 419 ++++++++++++++++++
 .../HGTD_FastDigitization_entries.cxx         |   7 +
 .../HGTD_EventAthenaPool/CMakeLists.txt       |  11 +
 .../src/HGTD_ClusterContainerCnv.cxx          |  45 ++
 .../src/HGTD_ClusterContainerCnv.h            |  48 ++
 9 files changed, 699 insertions(+)
 create mode 100644 HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/CMakeLists.txt
 create mode 100644 HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/ATLAS_CHECK_THREAD_SAFETY
 create mode 100644 HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h
 create mode 100644 HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/python/HGTD_SmearedDigitizationConfig.py
 create mode 100644 HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx
 create mode 100644 HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/components/HGTD_FastDigitization_entries.cxx
 create mode 100644 HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/CMakeLists.txt
 create mode 100644 HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx
 create mode 100644 HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.h

diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/CMakeLists.txt b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/CMakeLists.txt
new file mode 100644
index 000000000000..532889477ff0
--- /dev/null
+++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+#Declare the package name:
+atlas_subdir( HGTD_FastDigitization )
+
+find_package( CLHEP )
+find_package( HepMC )
+find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
+
+atlas_add_component( HGTD_FastDigitization
+                     src/*.cxx
+                     src/components/*.cxx
+                     INCLUDE_DIRS HGTD_FastDigitization ${CLHEP_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES}
+                     ${HEPMC_LIBRARIES} AthenaBaseComps GaudiKernel
+                     HGTD_Identifier HGTD_ReadoutGeometry TrkTruthData
+                     PileUpToolsLib HitManagement InDetSimEvent InDetPrepRawData
+                     HGTD_PrepRawData AthenaKernel )
+
+atlas_install_headers( HGTD_FastDigitization )
+atlas_install_python_modules( python/*.py )
diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/ATLAS_CHECK_THREAD_SAFETY b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..a065b04a5ac8
--- /dev/null
+++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization
diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h
new file mode 100644
index 000000000000..e03a34270d77
--- /dev/null
+++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h
@@ -0,0 +1,144 @@
+/**
+ * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
+ *
+ * @file HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h
+ * @author Alexander Leopold <alexander.leopold@cern.ch>
+ * @author
+ * @date May, 2021
+ * @brief Tool to do a fast digitization, meant mainily for standalone reco
+ *        developments. Smearing of the SiHit intersection position as well
+ *        as the SiHit time can be turned on and off (both on by default).
+ *        Per SiHit, only the pixel at the point of intersection, which is the
+ *        halfway between start and end, and only its identifier is stored in
+ *        rdo_list of the HGTD_Cluster, even if more pixels have been crossed.
+ */
+
+#ifndef HGTD_FASTSIDIGITIZATION_HGTD_SMEAREDDIGITIZATIONTOOL_H
+#define HGTD_FASTSIDIGITIZATION_HGTD_SMEAREDDIGITIZATIONTOOL_H
+
+#include "AthenaKernel/IAthRNGSvc.h"
+#include "GaudiKernel/ITHistSvc.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "GaudiKernel/AlgTool.h"
+#include "HGTD_PrepRawData/HGTD_Cluster.h"
+#include "HGTD_PrepRawData/HGTD_ClusterCollection.h"
+#include "HGTD_PrepRawData/HGTD_ClusterContainer.h"
+#include "HitManagement/TimedHitCollection.h"
+#include "HitManagement/TimedHitPtr.h"
+#include "InDetSimEvent/SiHit.h"
+#include "InDetSimEvent/SiHitCollection.h"
+#include "PileUpTools/PileUpToolBase.h"
+#include "PileUpTools/PileUpMergeSvc.h"
+#include <string>
+
+// forward declarations
+class HGTD_DetectorManager;
+class HGTD_ID;
+class PRD_MultiTruthCollection;
+class TFile;
+class TTree;
+
+namespace CLHEP {
+class HepRandomEngine;
+}
+
+class HGTD_SmearedDigitizationTool : virtual public PileUpToolBase {
+public:
+  using Cluster_t = HGTD::HGTD_Cluster;
+  using ClusterCollection_t = HGTD::HGTD_ClusterCollection;
+  using ClusterContainer_t = HGTD::HGTD_ClusterContainer;
+
+  using HGTD_DetElement_RIO_Map_t =
+      std::multimap<IdentifierHash, const Cluster_t*>;
+
+  HGTD_SmearedDigitizationTool(const std::string& type, const std::string& name,
+                               const IInterface* parent);
+
+  ~HGTD_SmearedDigitizationTool();
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+
+  // main method to be called when using this tool
+  virtual StatusCode processAllSubEvents(const EventContext& ctx) override;
+
+private:
+  // methods called within processAllSubEvents
+  StatusCode retrieveTruth();
+
+  TimedHitCollection<SiHit> setupTimedHitCollection();
+
+  // creat HGTD_Cluster from SiHit
+  StatusCode digitize(const EventContext& ctx);
+
+  StatusCode fillMultiTruthCollection(PRD_MultiTruthCollection*, Cluster_t*,
+                                      TimedHitPtr<SiHit>);
+
+  StatusCode fillClusterContainer();
+
+  float smearPosition(float pos, float sig, float boundary, CLHEP::HepRandomEngine * rndmEngine);
+
+  float smearMeanTime(float time, float time_res, CLHEP::HepRandomEngine * rndmEngine);
+
+  const HGTD_DetectorManager* m_hgtd_det_manager{nullptr};
+  const HGTD_ID* m_hgtd_idhelper{nullptr};
+
+  PRD_MultiTruthCollection* m_prd_truth_coll{nullptr};
+  std::string m_prd_truth_coll_name{"PRD_MultiTruthPixel"};
+
+  ServiceHandle<PileUpMergeSvc> m_merge_svc{this, "MergeSvc", "PileUpMergeSvc", "Merge service used in HGTD fast digitization"}; //!
+  ServiceHandle<IAthRNGSvc> m_rndm_svc{this, "RndmSvc", "AthRNGSvc", "Random number service used in HGTD fast digitization"}; //!< Random number service
+
+  ClusterContainer_t* m_cluster_container{nullptr};
+  StringProperty m_cluster_name{this, "HGTD_ClustersContainerName", "HGTD_Cluster", "Name of the HGTD cluster container"};
+
+  StringProperty m_si_hit_collection_name{this, "SiHitCollectionName", "HGTD_Hits", "Name of the Si Hit collection"};
+  TimedHitCollection<SiHit>* m_timed_hit_collection{nullptr};
+
+  std::unique_ptr<HGTD_DetElement_RIO_Map_t> m_det_element_rio_map{nullptr};
+
+  BooleanProperty m_smear_intersection_position{this, "SmearIntersectionPosition", true, ""};
+  BooleanProperty m_smear_mean_time{this, "SmearMeanTime", true, ""};
+  BooleanProperty m_write_tree{this, "WriteTree", false, ""};
+
+  // will default to 1.3x1.3 pitch size for HGTD, but can be set via property
+  FloatProperty m_pitch_x{this, "pitch_X", 1.3, ""};
+  FloatProperty m_pitch_y{this, "pitch_Y", 1.3, ""};
+  float m_time_res{0.035}; // time resolution in ns
+
+  // variables used only for writing out validation tree (not written by default)
+
+  ITHistSvc* m_hist_svc;
+  std::unique_ptr<TFile> m_output_file;
+  std::unique_ptr<TTree> m_tree;
+
+  float m_x_hit;
+  float m_y_hit;
+  float m_x_hit_smeared;
+  float m_y_hit_smeared;
+
+  float m_x_entry_hit;
+  float m_y_entry_hit;
+  float m_z_entry_hit;
+  float m_x_exit_hit;
+  float m_y_exit_hit;
+  float m_z_exit_hit;
+
+  float m_hit_time;
+  float m_hit_time_smeared;
+
+  float m_x_cluster_global;
+  float m_y_cluster_global;
+  float m_z_cluster_global;
+
+  float m_err_x_hit;
+  float m_err_y_hit;
+
+  static constexpr float m_sqrt12 = std::sqrt(12.);
+
+  static constexpr unsigned int m_crazy_bc =
+      std::numeric_limits<int32_t>::max();
+};
+
+#endif // HGTD_FASTSIDIGITIZATION_HGTD_SMEAREDDIGITIZATIONTOOL_H
diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/python/HGTD_SmearedDigitizationConfig.py b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/python/HGTD_SmearedDigitizationConfig.py
new file mode 100644
index 000000000000..8290a311b959
--- /dev/null
+++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/python/HGTD_SmearedDigitizationConfig.py
@@ -0,0 +1,3 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+# TODO: placeholder until configuration of HGTD fast digi is implemented in master
diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx
new file mode 100644
index 000000000000..a70832bed18a
--- /dev/null
+++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx
@@ -0,0 +1,419 @@
+/**
+ * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
+ *
+ * @file HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx
+ * @author Alexander Leopold <alexander.leopold@cern.ch>
+ * @author
+ * @date May, 2021
+ * @brief Implementation file for class HGTD_SmearedDigitizationTool
+ */
+
+#include "HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h"
+
+#include "AthenaKernel/RNGWrapper.h"
+#include "CLHEP/Random/RandFlat.h"
+#include "CLHEP/Random/RandGauss.h"
+#include "CLHEP/Random/RandomEngine.h"
+#include "EventPrimitives/EventPrimitivesHelpers.h"
+#include "HGTD_Identifier/HGTD_ID.h"
+#include "HGTD_ReadoutGeometry/HGTD_DetectorManager.h"
+#include "InDetSimEvent/SiHit.h"
+#include "PileUpTools/PileUpMergeSvc.h"
+#include "TrkTruthData/PRD_MultiTruthCollection.h"
+
+#include "TFile.h"
+#include "TTree.h"
+
+HGTD_SmearedDigitizationTool::HGTD_SmearedDigitizationTool(
+  const std::string& type, const std::string& name, const IInterface* parent) :
+  PileUpToolBase(type, name, parent) {
+}
+
+HGTD_SmearedDigitizationTool::~HGTD_SmearedDigitizationTool(){}
+
+StatusCode HGTD_SmearedDigitizationTool::initialize() {
+
+  ATH_MSG_DEBUG("HGTD_SmearedDigitizationTool::initialize()");
+
+  // Get the HGTD Detector Manager
+  ATH_CHECK(detStore()->retrieve(m_hgtd_det_manager, "HGTD"));
+
+  // Get the HGTD ID helper
+  ATH_CHECK(detStore()->retrieve(m_hgtd_idhelper, "HGTD_ID"));
+
+  // locate the PileUpMergeSvc
+  ATH_CHECK(m_merge_svc.retrieve());
+
+  if (m_write_tree) {
+    ATH_CHECK(service("THistSvc", m_hist_svc));
+    m_output_file = std::make_unique<TFile>("HGTD_SmearedDigiOutput.root", "RECREATE");
+    m_tree = std::make_unique<TTree>("SmearedDigiTree", "SmearedDigiTree");
+    m_tree->Branch("m_x_hit", &m_x_hit);
+    m_tree->Branch("m_y_hit", &m_y_hit);
+    m_tree->Branch("m_x_entry_hit", &m_x_entry_hit);
+    m_tree->Branch("m_y_entry_hit", &m_y_entry_hit);
+    m_tree->Branch("m_z_entry_hit", &m_z_entry_hit);
+    m_tree->Branch("m_x_exit_hit", &m_x_exit_hit);
+    m_tree->Branch("m_y_exit_hit", &m_y_exit_hit);
+    m_tree->Branch("m_z_exit_hit", &m_z_exit_hit);
+    m_tree->Branch("m_x_cluster_global", &m_x_cluster_global);
+    m_tree->Branch("m_y_cluster_global", &m_y_cluster_global);
+    m_tree->Branch("m_z_cluster_global", &m_z_cluster_global);
+    m_tree->Branch("m_x_hit_smeared", &m_x_hit_smeared);
+    m_tree->Branch("m_y_hit_smeared", &m_y_hit_smeared);
+    m_tree->Branch("m_hit_time", &m_hit_time);
+    m_tree->Branch("m_hit_time_smeared", &m_hit_time_smeared);
+    m_tree->Branch("m_err_x_hit", &m_err_x_hit);
+    m_tree->Branch("m_err_y_hit", &m_err_y_hit);
+
+    ATH_CHECK(m_hist_svc->regTree("HGTD_ClusterSmearedDigi", m_tree.get()));
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+// Finalize method:
+StatusCode HGTD_SmearedDigitizationTool::finalize() {
+
+  ATH_MSG_DEBUG("HGTD_SmearedDigitizationTool::finalize()");
+
+  if (m_write_tree) {
+    m_output_file->cd();
+    m_tree->Write();
+    m_output_file->Close();
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode HGTD_SmearedDigitizationTool::processAllSubEvents(const EventContext& ctx) {
+
+  ATH_MSG_DEBUG("[HGTD_SmearedDigitizationTool::processAllSubEvents]");
+
+  m_cluster_container =
+      new ClusterContainer_t(m_hgtd_idhelper->wafer_hash_max());
+
+  m_cluster_container->cleanup();
+
+  ATH_CHECK(evtStore()->record(m_cluster_container, m_cluster_name));
+
+  ATH_CHECK(retrieveTruth());
+
+  auto timed_hit_collection = setupTimedHitCollection();
+  m_timed_hit_collection =
+      &timed_hit_collection; // avoids allocating dynamically
+
+  ATH_CHECK(digitize(ctx));
+
+  // TODO: also needs an EventContext (is it the equivalent of createAndStoreRIOs in SiSmearedDigitizationTool)?
+  ATH_CHECK(fillClusterContainer());
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode HGTD_SmearedDigitizationTool::retrieveTruth() {
+
+  m_prd_truth_coll = new PRD_MultiTruthCollection;
+
+  if ((evtStore()->contains<PRD_MultiTruthCollection>(m_prd_truth_coll_name))) {
+    ATH_CHECK((evtStore()->retrieve(m_prd_truth_coll, m_prd_truth_coll_name)));
+  } else {
+    ATH_CHECK(evtStore()->record(m_prd_truth_coll, m_prd_truth_coll_name));
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+TimedHitCollection<SiHit>
+HGTD_SmearedDigitizationTool::setupTimedHitCollection() {
+  // Define Hit Collection
+  TimedHitCollection<SiHit> timed_hit_coll;
+
+  //  get the container(s)
+  typedef PileUpMergeSvc::TimedList<SiHitCollection>::type TimedHitCollList_t;
+
+  // this is a list<pair<time_t, DataLink<SCTUncompressedHitCollection> > >
+  TimedHitCollList_t hit_coll_list;
+  unsigned int num_si_hits(0);
+  if (!(m_merge_svc
+            ->retrieveSubEvtsData(m_si_hit_collection_name, hit_coll_list,
+                                  num_si_hits)
+            .isSuccess()) and
+      hit_coll_list.size() == 0) {
+    ATH_MSG_ERROR("Could not fill TimedHitCollList_t");
+    return timed_hit_coll;
+  }
+
+  ATH_MSG_DEBUG(hit_coll_list.size() << " SiHitCollections with key "
+                                     << m_si_hit_collection_name << " found");
+
+  timed_hit_coll.reserve(num_si_hits);
+
+  // loop on the hit collections
+  for(auto hit_coll : hit_coll_list) {
+    const SiHitCollection* si_collection(hit_coll.second);
+    timed_hit_coll.insert(hit_coll.first, si_collection);
+    ATH_MSG_DEBUG("SiHitCollection found with " << si_collection->size()
+                                                << " hits");
+  }
+  return timed_hit_coll;
+}
+
+StatusCode HGTD_SmearedDigitizationTool::digitize(const EventContext& ctx) {
+  ATH_MSG_DEBUG("--- HGTD_SmearedDigitizationTool: in digitize() ---");
+
+  m_det_element_rio_map = std::make_unique<HGTD_DetElement_RIO_Map_t>();
+
+  // Set the RNG to use for this event.
+  ATHRNG::RNGWrapper* rngWrapper = m_rndm_svc->getEngine(this);
+  rngWrapper->setSeed(name(), ctx);
+  CLHEP::HepRandomEngine* rndmEngine = rngWrapper->getEngine(ctx);
+
+  // i, e are iterator and end of one detector element
+  TimedHitCollection<SiHit>::const_iterator i, e;
+
+  while (m_timed_hit_collection->nextDetectorElement(i, e) and i != e) {
+    TimedHitPtr<SiHit> hit(*i++);
+
+    // FIXME should I cut on the deposited energy??
+    // n electrons = hit->energyLoss() / electron ionisation energy
+    // n * e * gain  > 4fCs
+
+    int endcap = hit->getBarrelEndcap();
+    int layer = hit->getLayerDisk();
+    int phi_module = hit->getPhiModule();
+    int eta_module = hit->getEtaModule();
+
+    ATH_MSG_DEBUG("HGTD DetectorElement --> endcap "
+                  << endcap << ", layer_disk " << layer << ", phi_module "
+                  << phi_module << ", eta_module " << eta_module);
+
+    const InDetDD::SolidStateDetectorElementBase* curr_det_element =
+        m_hgtd_det_manager->getDetectorElement(endcap, layer, phi_module,
+                                               eta_module);
+
+    if (!curr_det_element) {
+      ATH_MSG_ERROR("could not get detector element for SolidStateDetector");
+      continue;
+    }
+
+    IdentifierHash wafer_id =
+        m_hgtd_idhelper->wafer_hash(curr_det_element->identify());
+
+    HepGeom::Point3D<double> hit_loc_start_pos = hit->localStartPosition();
+    HepGeom::Point3D<double> hit_loc_end_pos = hit->localEndPosition();
+
+    HepGeom::Point3D<double> hit_glob_start_pos =
+        curr_det_element->hitLocalToLocal3D(hit_loc_start_pos);
+    HepGeom::Point3D<double> hit_glob_end_pos =
+        curr_det_element->hitLocalToLocal3D(hit_loc_end_pos);
+
+    double globa_entry_x = hit_glob_start_pos.x();
+    double globa_entry_y = hit_glob_start_pos.y();
+    m_x_entry_hit = globa_entry_x;
+    m_y_entry_hit = globa_entry_y;
+    m_z_entry_hit = hit_glob_start_pos.z();
+
+    double globa_exit_x = hit_glob_end_pos.x();
+    double globa_exit_y = hit_glob_end_pos.y();
+    m_x_exit_hit = globa_exit_x;
+    m_y_exit_hit = globa_exit_y;
+    m_z_exit_hit = hit_glob_end_pos.z();
+
+    double dist_x = std::abs(std::abs(globa_exit_x) - std::abs(globa_entry_x));
+    double dist_y = std::abs(std::abs(globa_exit_y) - std::abs(globa_entry_y));
+
+    Amg::Vector2D local_entry(globa_entry_x, globa_entry_y);
+    Amg::Vector2D local_exit(globa_exit_x, globa_exit_y);
+
+    // get the identifier of the entry and the exit
+    Identifier entry_id = curr_det_element->identifierOfPosition(local_entry);
+    Identifier exit_id = curr_det_element->identifierOfPosition(local_exit);
+
+    // now get the cellIds and check whether they're valid
+    InDetDD::SiCellId entry_cell_id =
+        curr_det_element->cellIdFromIdentifier(entry_id);
+    InDetDD::SiCellId exit_cell_id =
+        curr_det_element->cellIdFromIdentifier(exit_id);
+
+    ATH_MSG_DEBUG("--- HGTD_SmearedDigitizationTool: entryId "
+                  << entry_id << " --- exitId " << exit_id);
+    ATH_MSG_DEBUG("--- HGTD_SmearedDigitizationTool: entryCellId "
+                  << entry_cell_id << " --- exitCellId " << exit_cell_id);
+
+    if (not entry_cell_id.isValid() or not exit_cell_id.isValid()) {
+      continue;
+    }
+
+    // the intersecetion id and cellId of it. yes, this is correct
+    double intersection_x = 0.5 * (globa_entry_x + globa_exit_x);
+    double intersection_y = 0.5 * (globa_entry_y + globa_exit_y);
+    m_x_hit = intersection_x;
+    m_y_hit = intersection_y;
+
+    // calculate how many pixels the particle crosses in x and y direction
+    double times_x = floor(dist_x / m_pitch_x);
+    double times_y = floor(dist_y / m_pitch_y);
+
+    double sigma_x = m_pitch_x / m_sqrt12;
+    double sigma_y = m_pitch_y / m_sqrt12;
+
+    int element_x = times_x + 1;
+    int element_y = times_y + 1;
+
+    // Smear pixel in x and y direction
+    // FIXME make sure the length width dimensions are correct!!!
+    if (m_smear_intersection_position) {
+      intersection_x = smearPosition(intersection_x, sigma_x,
+                                     curr_det_element->width() / 2.,
+                                     rndmEngine);
+      intersection_y = smearPosition(intersection_y, sigma_y,
+                                     curr_det_element->length() / 2.,
+                                     rndmEngine);
+    }
+    m_x_hit_smeared = intersection_x;
+    m_y_hit_smeared = intersection_y;
+
+    Amg::Vector2D intersection(intersection_x, intersection_y);
+
+    Identifier intersection_id =
+        curr_det_element->identifierOfPosition(intersection);
+
+    // the pixel positions and other elements for the geometrical clustering
+    std::vector<Identifier> rdo_list = {intersection_id};
+
+    InDetDD::SiCellId current_cell_id =
+        curr_det_element->cellIdFromIdentifier(intersection_id);
+
+    if (!current_cell_id.isValid()) {
+      continue;
+    }
+
+    double length_x = element_x * m_pitch_x;
+    double length_y = element_y * m_pitch_y;
+
+    InDet::SiWidth si_width(Amg::Vector2D(element_x, element_y),
+                            Amg::Vector2D(length_x, length_y));
+
+    AmgSymMatrix(2) covariance;
+    covariance.setIdentity();
+    covariance(Trk::locX, Trk::locX) = sigma_x * sigma_x;
+    covariance(Trk::locY, Trk::locY) = sigma_y * sigma_y;
+    Amg::MatrixX cluster_err = Amg::MatrixX(covariance);
+
+    float hit_time = hit->meanTime();
+    m_hit_time = hit_time;
+    if (m_smear_mean_time) {
+      hit_time = smearMeanTime(hit_time, m_time_res, rndmEngine);
+    }
+    m_hit_time_smeared = hit_time;
+
+    std::vector<int> tot_vec = {0}; // dummy, not used in reco currently
+
+    Cluster_t* cluster = new Cluster_t(intersection_id, intersection, std::move(rdo_list),
+                                       si_width, curr_det_element, std::move(cluster_err),
+                                       hit_time, m_time_res, tot_vec);
+
+    m_x_cluster_global = (cluster->globalPosition()).x();
+    m_y_cluster_global = (cluster->globalPosition()).y();
+    m_z_cluster_global = (cluster->globalPosition()).z();
+    m_err_x_hit = Amg::error(cluster->localCovariance(), Trk::locX);
+    m_err_y_hit = Amg::error(cluster->localCovariance(), Trk::locY);
+
+    if (m_write_tree) {
+      m_tree->Fill();
+    }
+
+    m_det_element_rio_map->insert(
+        std::pair<IdentifierHash, const Cluster_t*>(wafer_id, cluster));
+
+    ATH_CHECK(fillMultiTruthCollection(m_prd_truth_coll, cluster, hit));
+
+  } // END while
+  return StatusCode::SUCCESS;
+}
+
+float HGTD_SmearedDigitizationTool::smearPosition(float pos, float sig,
+                                                  float boundary, CLHEP::HepRandomEngine * rndmEngine) {
+  ATH_MSG_DEBUG("[HGTD_SmearedDigitizationTool::smearPosition] pos: "
+                << pos << " sig: " << sig << " boundary: " << boundary);
+  float smeared_pos = pos;
+  float smear_para = 0.;
+  if (sig != 0.) {
+    do {
+      smear_para = CLHEP::RandGauss::shoot(rndmEngine, 0., sig);
+
+    } while (std::abs(smeared_pos + smear_para) > boundary);
+    smeared_pos += smear_para;
+  }
+  return smeared_pos;
+}
+
+float HGTD_SmearedDigitizationTool::smearMeanTime(float time, float time_res, CLHEP::HepRandomEngine * rndmEngine) {
+  return time + CLHEP::RandGauss::shoot(rndmEngine, 0., time_res);
+}
+
+StatusCode HGTD_SmearedDigitizationTool::fillMultiTruthCollection(
+    PRD_MultiTruthCollection* map, Cluster_t* cluster, TimedHitPtr<SiHit> hit) {
+
+  // FIXME is this a dummy or does this actually mean something>
+  EBC_EVCOLL ev_coll = EBC_MAINEVCOLL; // enum from HepMcParticleLink.h, usually
+                                       // contains the HS GenEvent
+
+  HepMcParticleLink::PositionFlag is_event_index_is_position = (hit.eventId() == 0)? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_INDEX;
+  HepMcParticleLink trk_link(hit->trackNumber(), hit.eventId(), ev_coll,
+                             is_event_index_is_position);
+
+  ATH_MSG_DEBUG("Truth map filling with cluster "
+                << *cluster << " and link = " << trk_link);
+
+  if (trk_link.isValid()) {
+    const int barcode(trk_link.barcode());
+    if (barcode != 0 && barcode != m_crazy_bc) {
+      map->insert(std::make_pair(cluster->identify(), trk_link));
+    }
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode HGTD_SmearedDigitizationTool::fillClusterContainer() {
+  ATH_MSG_DEBUG(
+      "--- HGTD_SmearedDigitizationTool: in fillClusterContainer() ---");
+  using RIO_map_t = HGTD_DetElement_RIO_Map_t;
+
+  RIO_map_t::iterator i = m_det_element_rio_map->begin();
+  RIO_map_t::iterator e = m_det_element_rio_map->end();
+
+  for (; i != e; i = m_det_element_rio_map->upper_bound(i->first)) {
+
+    std::pair<RIO_map_t::iterator, RIO_map_t::iterator> range;
+    range = m_det_element_rio_map->equal_range(i->first);
+
+    RIO_map_t::iterator first_det_elem = range.first;
+
+    IdentifierHash wafer_id = first_det_elem->first;
+
+    const InDetDD::SolidStateDetectorElementBase* det_element =
+        m_hgtd_det_manager->getDetectorElement(wafer_id);
+
+    ClusterCollection_t* cluster_coll = new ClusterCollection_t(wafer_id);
+    cluster_coll->setIdentifier(det_element->identify());
+
+    for (RIO_map_t::iterator iter = range.first; iter != range.second; ++iter) {
+
+      Cluster_t* cluster = const_cast<Cluster_t*>((*iter).second);
+      cluster->setHashAndIndex(cluster_coll->identifyHash(),
+                               cluster_coll->size());
+      cluster_coll->push_back(cluster);
+    }
+
+    if (m_cluster_container->addCollection(cluster_coll, wafer_id)
+            .isFailure()) {
+      ATH_MSG_WARNING("Could not add collection to Identifiable container!");
+    }
+  } // end for
+
+  m_det_element_rio_map->clear();
+  return StatusCode::SUCCESS;
+}
diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/components/HGTD_FastDigitization_entries.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/components/HGTD_FastDigitization_entries.cxx
new file mode 100644
index 000000000000..08b35cec77a1
--- /dev/null
+++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/components/HGTD_FastDigitization_entries.cxx
@@ -0,0 +1,7 @@
+/**
+ *  * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
+ *   */
+
+#include "HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h"
+
+DECLARE_COMPONENT( HGTD_SmearedDigitizationTool )
diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/CMakeLists.txt b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/CMakeLists.txt
new file mode 100644
index 000000000000..a1f3287d15b9
--- /dev/null
+++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+# Declare the package name:
+atlas_subdir( HGTD_EventAthenaPool )
+
+# Component(s) in the package:
+atlas_add_poolcnv_library( HGTD_EventAthenaPoolPoolCnv
+                           src/*.cxx
+                           FILES HGTD_PrepRawData/HGTD_ClusterContainer.h
+                           TYPES_WITH_NAMESPACE HGTD::HGTD_ClusterContainer
+                           LINK_LIBRARIES AthenaPoolUtilities AthenaPoolCnvSvcLib AtlasSealCLHEP GaudiKernel HGTD_PrepRawData HGTD_EventTPCnv )
diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx
new file mode 100644
index 000000000000..b734c14665ba
--- /dev/null
+++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx
@@ -0,0 +1,45 @@
+/**
+ * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
+ *
+ * @file HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.cxx
+ * @author Noemi Calace <noemi.calace@cern.ch>
+ * @date June, 2021
+ * @brief
+ */
+
+#include "HGTD_ClusterContainerCnv.h"
+#include "GaudiKernel/MsgStream.h"
+
+#include <memory>
+
+#include <iostream>
+
+HGTD_ClusterContainerCnv::HGTD_ClusterContainerCnv(ISvcLocator* svcloc)
+    : HGTD_ClusterContainerCnvBase(svcloc) {}
+
+HGTD::HGTD_ClusterContainer* HGTD_ClusterContainerCnv::createTransient() {
+
+  static pool::Guid p1_guid(
+      "7B3D57D6-F590-4266-974D-A0807122DA5F"); // with HGTD_Cluster_p1
+  ATH_MSG_DEBUG("createTransient(): main converter");
+
+  HGTD::HGTD_ClusterContainer* p_collection(0);
+  if (compareClassGuid(p1_guid)) {
+    ATH_MSG_DEBUG("createTransient(): T/P version 1 detected");
+    std::auto_ptr<HGTD::HGTD_ClusterContainer_p1> p_coll(
+        poolReadObject<HGTD::HGTD_ClusterContainer_p1>());
+    p_collection = m_converter_p1.createTransient(p_coll.get(), msg());
+  } else {
+    throw std::runtime_error(
+        "Unsupported persistent version of PlanarClusterContainer");
+  }
+  return p_collection;
+}
+
+HGTD_ClusterContainer_PERS* HGTD_ClusterContainerCnv::createPersistent(
+    HGTD::HGTD_ClusterContainer* transCont) {
+  HGTD_ClusterContainer_PERS* pldc_p =
+      m_converter_p1.createPersistent(transCont, msg());
+
+  return pldc_p;
+}
diff --git a/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.h b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.h
new file mode 100644
index 000000000000..3e18ea77b9e4
--- /dev/null
+++ b/HighGranularityTimingDetector/HGTD_EventCnv/HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.h
@@ -0,0 +1,48 @@
+/**
+ * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
+ *
+ * @file HGTD_EventAthenaPool/src/HGTD_ClusterContainerCnv.h
+ * @author Noemi Calace <noemi.calace@cern.ch>
+ * @date June, 2021
+ * @brief
+ */
+
+#ifndef HGTD_CLUSTERCONTAINERCNV_H
+#define HGTD_CLUSTERCONTAINERCNV_H
+
+#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
+#include "GaudiKernel/MsgStream.h"
+#include "HGTD_PrepRawData/HGTD_ClusterCollection.h"
+#include "HGTD_PrepRawData/HGTD_ClusterContainer.h"
+
+#include "HGTD_EventTPCnv/HGTD_ClusterContainerCnv_p1.h"
+
+// the latest persistent representation type of DataCollection:
+typedef HGTD::HGTD_ClusterContainer_p1 HGTD_ClusterContainer_PERS;
+typedef T_AthenaPoolCustomCnv<HGTD::HGTD_ClusterContainer,
+                              HGTD_ClusterContainer_PERS>
+    HGTD_ClusterContainerCnvBase;
+
+/**
+** Create derived converter to customize the saving of identifiable
+** container
+**/
+
+class HGTD_ClusterContainerCnv : public HGTD_ClusterContainerCnvBase {
+  friend class CnvFactory<HGTD_ClusterContainerCnv>;
+
+  // Converters need to be initialized (use ID helpers)
+  // Thus they can't be local
+
+public:
+  HGTD_ClusterContainerCnv(ISvcLocator* svcloc);
+protected:
+  virtual HGTD_ClusterContainer_PERS*
+  createPersistent(HGTD::HGTD_ClusterContainer* transCont) override;
+  virtual HGTD::HGTD_ClusterContainer* createTransient() override;
+
+private:
+  HGTD::HGTD_ClusterContainerCnv_p1 m_converter_p1;
+};
+
+#endif // HGTD_CLUSTERCONTAINERCNV_H
-- 
GitLab


From d31e41e762e6bbacf38d519aeabbeb903a5573b5 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 5 Aug 2021 12:40:57 -0400
Subject: [PATCH 134/347] DecisionHandling: Fix clang warning.

Spurious copy in range-for.
---
 Trigger/TrigSteer/DecisionHandling/src/ComboHypoToolBase.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigSteer/DecisionHandling/src/ComboHypoToolBase.cxx b/Trigger/TrigSteer/DecisionHandling/src/ComboHypoToolBase.cxx
index 2ef980bba9ac..efc062e09dce 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ComboHypoToolBase.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/ComboHypoToolBase.cxx
@@ -267,7 +267,7 @@ StatusCode ComboHypoToolBase::printDebugInformation(const Combo::LegDecisionsMap
     // Only print for this chain
     if (id == m_decisionId or (isLegId(id) and m_decisionId == getIDFromLeg(id))) { 
       ATH_MSG_DEBUG("-- " << HLT::Identifier(id) << " with " << ELV.size() << " elements");
-      for (const auto& EL : ELV) {
+      for (const auto EL : ELV) {
         ATH_MSG_DEBUG("-- -- container:" << EL.dataID() << ", index:" << EL.index());
       }
     }
-- 
GitLab


From a51769889844359fcca6f6b7bd96ae4ddd375b59 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Tue, 14 Sep 2021 20:04:58 +0200
Subject: [PATCH 135/347] GeneratorObjects: Fix potential race.

Fix a potential race in eventIndex() between updating m_ptrs and m_extBarcode.
See ATLASSIM-5304.
---
 .../src/HepMcParticleLink.cxx                 | 24 ++++++++++++-------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
index d744c198a05a..0fbd7512e88a 100644
--- a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
+++ b/Generators/GeneratorObjects/src/HepMcParticleLink.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
 */
 
 
@@ -211,6 +211,11 @@ const HepMC::GenParticle* HepMcParticleLink::cptr() const
 
       if (0 != pEvt) {
         auto pp = HepMC::barcode_to_particle(pEvt,barcode());
+        // Be sure to update m_extBarcode before m_ptrs;
+        // otherwise, the logic in eventIndex() won't work correctly.
+        if (position != ExtendedBarCode::UNDEFINED) {
+          m_extBarcode.makeIndex (pEvt->event_number(), position);
+        }
         if (pp) {
 #ifdef HEPMC3
           m_ptrs.set (sg, pp.get());
@@ -220,9 +225,6 @@ const HepMC::GenParticle* HepMcParticleLink::cptr() const
           p=pp;
 #endif
         }
-        if (position != ExtendedBarCode::UNDEFINED) {
-          m_extBarcode.makeIndex (pEvt->event_number(), position);
-        }
       } else {
         MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
         if (position != ExtendedBarCode::UNDEFINED) {
@@ -343,6 +345,15 @@ HepMcParticleLink::index_type HepMcParticleLink::eventIndex() const
       if (pEvt) {
         const int event_number = pEvt->event_number();
         auto pp = HepMC::barcode_to_particle(pEvt,barcode());
+        // Be sure to update m_extBarcode before m_ptrs.
+        // Otherwise, if two threads run this method simultaneously,
+        // one thread could see index == UNDEFINED, but where m_ptr
+        // is already updated so we get nullptr back for sg.
+        if(event_number>-1) {
+          index = static_cast<index_type>(event_number);
+          m_extBarcode.makeIndex (index, position);
+          return index;
+        }
         if (pp) {
 #ifdef HEPMC3
           m_ptrs.set (sg, pp.get());
@@ -350,11 +361,6 @@ HepMcParticleLink::index_type HepMcParticleLink::eventIndex() const
           m_ptrs.set (sg, pp);
 #endif
         }
-        if(event_number>-1) {
-          index = static_cast<index_type>(event_number);
-          m_extBarcode.makeIndex (index, position);
-          return index;
-        }
       }
     }
   }
-- 
GitLab


From e190a678b110a2375bc52ad7660f151d67ca7b74 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Sep 2021 13:40:20 -0400
Subject: [PATCH 136/347] PixelReadoutGeometry: Fix compilation warnings.

Signed/unsigned comparison.
---
 .../test/ITkPixelReadoutManager_test.cxx      | 104 +++++++++---------
 1 file changed, 52 insertions(+), 52 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/PixelReadoutGeometry/test/ITkPixelReadoutManager_test.cxx b/InnerDetector/InDetDetDescr/PixelReadoutGeometry/test/ITkPixelReadoutManager_test.cxx
index 0933201803ec..63e9460b8040 100644
--- a/InnerDetector/InDetDetDescr/PixelReadoutGeometry/test/ITkPixelReadoutManager_test.cxx
+++ b/InnerDetector/InDetDetDescr/PixelReadoutGeometry/test/ITkPixelReadoutManager_test.cxx
@@ -150,31 +150,31 @@ namespace PixelTesting
     Identifier close3 = element->identifierFromCellId(InDetDD::SiCellId(p_design->rowsPerCircuit(), p_design->columnsPerCircuit() + 2));
     Identifier close4 = element->identifierFromCellId(InDetDD::SiCellId(p_design->rowsPerCircuit() + 2, p_design->columnsPerCircuit()));
 
-    ASSERT_EQ( m_svc->getRow(edge1, moduleId), 0 );
-    ASSERT_EQ( m_svc->getRow(edge2, moduleId), 0 );
-    ASSERT_EQ( m_svc->getRow(edge3, moduleId), 0 );
-    ASSERT_EQ( m_svc->getRow(edge4, moduleId), 0 );
-    ASSERT_EQ( m_svc->getRow(center1, moduleId), p_design->rowsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getRow(center2, moduleId), p_design->rowsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getRow(center3, moduleId), p_design->rowsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getRow(center4, moduleId), p_design->rowsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getRow(close1, moduleId), p_design->rowsPerCircuit() - 3 );
-    ASSERT_EQ( m_svc->getRow(close2, moduleId), p_design->rowsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getRow(close3, moduleId), p_design->rowsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getRow(close4, moduleId), p_design->rowsPerCircuit() - 3 );
-
-    ASSERT_EQ( m_svc->getColumn(edge1, moduleId), 0 );
-    ASSERT_EQ( m_svc->getColumn(edge2, moduleId), 0 );
-    ASSERT_EQ( m_svc->getColumn(edge3, moduleId), 0 );
-    ASSERT_EQ( m_svc->getColumn(edge4, moduleId), 0 );
-    ASSERT_EQ( m_svc->getColumn(center1, moduleId), p_design->columnsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getColumn(center2, moduleId), p_design->columnsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getColumn(center3, moduleId), p_design->columnsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getColumn(center4, moduleId), p_design->columnsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getColumn(close1, moduleId), p_design->columnsPerCircuit() - 1 );
-    ASSERT_EQ( m_svc->getColumn(close2, moduleId), p_design->columnsPerCircuit() - 3 );
-    ASSERT_EQ( m_svc->getColumn(close3, moduleId), p_design->columnsPerCircuit() - 3 );
-    ASSERT_EQ( m_svc->getColumn(close4, moduleId), p_design->columnsPerCircuit() - 1 );
+    ASSERT_EQ( m_svc->getRow(edge1, moduleId), 0u );
+    ASSERT_EQ( m_svc->getRow(edge2, moduleId), 0u );
+    ASSERT_EQ( m_svc->getRow(edge3, moduleId), 0u );
+    ASSERT_EQ( m_svc->getRow(edge4, moduleId), 0u );
+    ASSERT_EQ( m_svc->getRow(center1, moduleId), static_cast<uint32_t>(p_design->rowsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getRow(center2, moduleId), static_cast<uint32_t>(p_design->rowsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getRow(center3, moduleId), static_cast<uint32_t>(p_design->rowsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getRow(center4, moduleId), static_cast<uint32_t>(p_design->rowsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getRow(close1, moduleId), static_cast<uint32_t>(p_design->rowsPerCircuit() - 3) );
+    ASSERT_EQ( m_svc->getRow(close2, moduleId), static_cast<uint32_t>(p_design->rowsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getRow(close3, moduleId), static_cast<uint32_t>(p_design->rowsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getRow(close4, moduleId), static_cast<uint32_t>(p_design->rowsPerCircuit() - 3) );
+
+    ASSERT_EQ( m_svc->getColumn(edge1, moduleId), 0u );
+    ASSERT_EQ( m_svc->getColumn(edge2, moduleId), 0u );
+    ASSERT_EQ( m_svc->getColumn(edge3, moduleId), 0u );
+    ASSERT_EQ( m_svc->getColumn(edge4, moduleId), 0u );
+    ASSERT_EQ( m_svc->getColumn(center1, moduleId), static_cast<uint32_t>(p_design->columnsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getColumn(center2, moduleId), static_cast<uint32_t>(p_design->columnsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getColumn(center3, moduleId), static_cast<uint32_t>(p_design->columnsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getColumn(center4, moduleId), static_cast<uint32_t>(p_design->columnsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getColumn(close1, moduleId), static_cast<uint32_t>(p_design->columnsPerCircuit() - 1) );
+    ASSERT_EQ( m_svc->getColumn(close2, moduleId), static_cast<uint32_t>(p_design->columnsPerCircuit() - 3) );
+    ASSERT_EQ( m_svc->getColumn(close3, moduleId), static_cast<uint32_t>(p_design->columnsPerCircuit() - 3) );
+    ASSERT_EQ( m_svc->getColumn(close4, moduleId), static_cast<uint32_t>(p_design->columnsPerCircuit() - 1) );
 
     ASSERT_EQ( m_svc->getDiodeType(edge1), PixelDiodeType::NORMAL );
     ASSERT_EQ( m_svc->getDiodeType(edge2), PixelDiodeType::NORMAL );
@@ -189,18 +189,18 @@ namespace PixelTesting
     ASSERT_EQ( m_svc->getDiodeType(close3), PixelDiodeType::LONG );
     ASSERT_EQ( m_svc->getDiodeType(close4), PixelDiodeType::LONG );
     
-    ASSERT_EQ( m_svc->getFE(edge1, moduleId), 0 );
-    ASSERT_EQ( m_svc->getFE(edge2, moduleId), 1 );
-    ASSERT_EQ( m_svc->getFE(edge3, moduleId), 2 );
-    ASSERT_EQ( m_svc->getFE(edge4, moduleId), 3 );
-    ASSERT_EQ( m_svc->getFE(center1, moduleId), 0 );
-    ASSERT_EQ( m_svc->getFE(center2, moduleId), 2 );
-    ASSERT_EQ( m_svc->getFE(center3, moduleId), 1 );
-    ASSERT_EQ( m_svc->getFE(center4, moduleId), 3 );
-    ASSERT_EQ( m_svc->getFE(close1, moduleId), 0 );
-    ASSERT_EQ( m_svc->getFE(close2, moduleId), 0 );
-    ASSERT_EQ( m_svc->getFE(close3, moduleId), 3 );
-    ASSERT_EQ( m_svc->getFE(close4, moduleId), 3 );
+    ASSERT_EQ( m_svc->getFE(edge1, moduleId), 0u );
+    ASSERT_EQ( m_svc->getFE(edge2, moduleId), 1u );
+    ASSERT_EQ( m_svc->getFE(edge3, moduleId), 2u );
+    ASSERT_EQ( m_svc->getFE(edge4, moduleId), 3u );
+    ASSERT_EQ( m_svc->getFE(center1, moduleId), 0u );
+    ASSERT_EQ( m_svc->getFE(center2, moduleId), 2u );
+    ASSERT_EQ( m_svc->getFE(center3, moduleId), 1u );
+    ASSERT_EQ( m_svc->getFE(center4, moduleId), 3u );
+    ASSERT_EQ( m_svc->getFE(close1, moduleId), 0u );
+    ASSERT_EQ( m_svc->getFE(close2, moduleId), 0u );
+    ASSERT_EQ( m_svc->getFE(close3, moduleId), 3u );
+    ASSERT_EQ( m_svc->getFE(close4, moduleId), 3u );
 
     ASSERT_EQ( m_svc->getPixelId(moduleId, 0, 0, 0), edge1 );
     ASSERT_EQ( m_svc->getPixelId(moduleId, 1, 0, 0), edge2 );
@@ -234,17 +234,17 @@ namespace PixelTesting
     Identifier edge4s = elementS->identifierFromCellId(InDetDD::SiCellId(p_designS->rows() - 1, p_designS->columns() - 1));
     Identifier centers = elementS->identifierFromCellId(InDetDD::SiCellId(p_designS->rows() / 2, p_designS->columns() / 2));
 
-    ASSERT_EQ( m_svc->getRow(edge1s, moduleId), 0 );
-    ASSERT_EQ( m_svc->getRow(edge2s, moduleId), 0 );
-    ASSERT_EQ( m_svc->getRow(edge3s, moduleId), p_designS->rows() - 1 );
-    ASSERT_EQ( m_svc->getRow(edge4s, moduleId), p_designS->rows() - 1 );
-    ASSERT_EQ( m_svc->getRow(centers, moduleId), p_designS->rows() / 2);
+    ASSERT_EQ( m_svc->getRow(edge1s, moduleId), 0u );
+    ASSERT_EQ( m_svc->getRow(edge2s, moduleId), 0u );
+    ASSERT_EQ( m_svc->getRow(edge3s, moduleId), static_cast<uint32_t>(p_designS->rows() - 1) );
+    ASSERT_EQ( m_svc->getRow(edge4s, moduleId), static_cast<uint32_t>(p_designS->rows() - 1) );
+    ASSERT_EQ( m_svc->getRow(centers, moduleId), static_cast<uint32_t>(p_designS->rows() / 2) );
 
-    ASSERT_EQ( m_svc->getColumn(edge1s, moduleId), 0 );
-    ASSERT_EQ( m_svc->getColumn(edge2s, moduleId), p_designS->columns() - 1 );
-    ASSERT_EQ( m_svc->getColumn(edge3s, moduleId), 0 );
-    ASSERT_EQ( m_svc->getColumn(edge4s, moduleId), p_designS->columns() - 1 );
-    ASSERT_EQ( m_svc->getColumn(centers, moduleId), p_designS->columns() / 2 );
+    ASSERT_EQ( m_svc->getColumn(edge1s, moduleId), 0u );
+    ASSERT_EQ( m_svc->getColumn(edge2s, moduleId), static_cast<uint32_t>(p_designS->columns() - 1) );
+    ASSERT_EQ( m_svc->getColumn(edge3s, moduleId), 0u );
+    ASSERT_EQ( m_svc->getColumn(edge4s, moduleId), static_cast<uint32_t>(p_designS->columns() - 1) );
+    ASSERT_EQ( m_svc->getColumn(centers, moduleId), static_cast<uint32_t>(p_designS->columns() / 2) );
 
     ASSERT_EQ( m_svc->getDiodeType(edge1s), PixelDiodeType::NORMAL );
     ASSERT_EQ( m_svc->getDiodeType(edge2s), PixelDiodeType::NORMAL );
@@ -252,11 +252,11 @@ namespace PixelTesting
     ASSERT_EQ( m_svc->getDiodeType(edge4s), PixelDiodeType::NORMAL );
     ASSERT_EQ( m_svc->getDiodeType(centers), PixelDiodeType::NORMAL );
 
-    ASSERT_EQ( m_svc->getFE(edge1s, moduleId), 0 );
-    ASSERT_EQ( m_svc->getFE(edge2s, moduleId), 0 );
-    ASSERT_EQ( m_svc->getFE(edge3s, moduleId), 0 );
-    ASSERT_EQ( m_svc->getFE(edge4s, moduleId), 0 );
-    ASSERT_EQ( m_svc->getFE(centers, moduleId), 0 );
+    ASSERT_EQ( m_svc->getFE(edge1s, moduleId), 0u );
+    ASSERT_EQ( m_svc->getFE(edge2s, moduleId), 0u );
+    ASSERT_EQ( m_svc->getFE(edge3s, moduleId), 0u );
+    ASSERT_EQ( m_svc->getFE(edge4s, moduleId), 0u );
+    ASSERT_EQ( m_svc->getFE(centers, moduleId), 0u );
 
     ASSERT_EQ( m_svc->getPixelId(moduleId, 0, 0, 0), edge1s );
     ASSERT_EQ( m_svc->getPixelId(moduleId, 0, 0, p_designS->columns() - 1), edge2s );
-- 
GitLab


From 5b99b9dcb24865cb47711bc205dd85571cdda9ba Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Sep 2021 14:15:08 -0400
Subject: [PATCH 137/347] TrkParametersBase: Fix compilation warning.

Use of uninitialized eigen object in test.
---
 Tracking/TrkEvent/TrkParametersBase/test/ParametersBase_test.cxx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Tracking/TrkEvent/TrkParametersBase/test/ParametersBase_test.cxx b/Tracking/TrkEvent/TrkParametersBase/test/ParametersBase_test.cxx
index 775e12bcf86f..0ee7b0d38ae2 100644
--- a/Tracking/TrkEvent/TrkParametersBase/test/ParametersBase_test.cxx
+++ b/Tracking/TrkEvent/TrkParametersBase/test/ParametersBase_test.cxx
@@ -197,6 +197,7 @@ BOOST_AUTO_TEST_SUITE(ParametersBaseTest)
     BOOST_TEST(*(x.covariance()) == *covariance,"Covariance has been set");
     //update both
     AmgVector(DIM) otherParameters;
+    otherParameters.setZero();
     std::optional<AmgSymMatrix(DIM)> otherCovariance{2.*m};
     x.updateParameters(otherParameters, *otherCovariance);
     const bool test = (x.parameters() == otherParameters) and (*(x.covariance()) == *otherCovariance);
-- 
GitLab


From bc87ec1b2381a482641b8f56c09ba6be3c5d0d78 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Wed, 15 Sep 2021 16:08:41 +0200
Subject: [PATCH 138/347] TrigBphysHypo: Fix clang warning.

Unused lambda capture.
---
 .../TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
index e46466eb247b..424520c51d6c 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
@@ -410,7 +410,7 @@ StatusCode TrigMultiTrkComboHypo::mergeTracksFromDecisions(TrigMultiTrkStateBase
     if (!trackEL.isValid()) continue;
     if (!m_applyOverlapRemoval ||
         std::find_if(tracks.begin(), tracks.end(),
-                     [this, track = *trackEL](const auto& x){ return isIdenticalTracks(track, *x); }) == tracks.end()) {
+                     [this, track = *trackEL](const auto& x){ return this->isIdenticalTracks(track, *x); }) == tracks.end()) {
       tracks.emplace_back(trackEL);
     }
   }
-- 
GitLab


From a66b0bbf0243a790dd92e65b12a482c0e66f9def Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 6 Sep 2021 23:45:08 -0400
Subject: [PATCH 139/347] STgcClusterization: Fix compilation with gcc11.

Get isnan from std::.
---
 .../STgcClusterization/src/CaruanaSTgcClusterBuilderTool.cxx    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/CaruanaSTgcClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/CaruanaSTgcClusterBuilderTool.cxx
index 791c7517e4c1..37706e772fd6 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/CaruanaSTgcClusterBuilderTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/CaruanaSTgcClusterBuilderTool.cxx
@@ -172,7 +172,7 @@ StatusCode Muon::CaruanaSTgcClusterBuilderTool::getClusters(std::vector<Muon::sT
           if (!caruanaFail){
             Amg::Vector3D caruanaPars = (elementPosMatrix.inverse())*chargeVector;
             reconstructedPosX = clusterCenter - caruanaPars(1)/(2*caruanaPars(2));
-            if (isnan(reconstructedPosX)) caruanaFail = true;       // In the event that the caruanaPars(2) parameter is 0 we reconstruct and infinite position. In this case we must revert back to the weighted mean method.
+            if (std::isnan(reconstructedPosX)) caruanaFail = true;       // In the event that the caruanaPars(2) parameter is 0 we reconstruct and infinite position. In this case we must revert back to the weighted mean method.
 
             if (!caruanaFail){
               // Find the channel that the cluster position reconstructs on top of and set the cluster id to it's id
-- 
GitLab


From 772b6e5cdf7c0aa8a0ee88350c9c6706fd686d71 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 9 Aug 2021 15:50:34 -0400
Subject: [PATCH 140/347] AthAllocators: Add protect()/unprotect().

Add protect() and unprotect() methods to underlying block allocators,
to all write-protecting the memory.
---
 .../AthAllocators/AthAllocators/ArenaBlock.h  | 38 +++++++
 .../AthAllocators/ArenaBlock.icc              |  4 +-
 .../AthAllocators/ArenaBlockAllocatorBase.h   | 27 ++++-
 .../AthAllocators/ArenaHeapSTLAllocator.h     | 64 ++++++++++--
 .../AthAllocators/ArenaHeapSTLAllocator.icc   | 83 ++++++++++++++--
 .../AthAllocators/ArenaPoolSTLAllocator.h     | 60 ++++++++++--
 .../AthAllocators/ArenaPoolSTLAllocator.icc   | 83 +++++++++++++++-
 .../ArenaSharedHeapSTLAllocator.h             | 53 +++++++++-
 .../ArenaSharedHeapSTLAllocator.icc           | 45 ++++++++-
 .../AthAllocators/AthAllocators/exceptions.h  | 34 ++++++-
 .../AthAllocators/maybeUnprotect.h            | 40 ++++++++
 .../AthAllocators/AthAllocators/preDelete.h   | 26 +++++
 .../AthAllocators/preDeleteAlloc.h            | 26 +++++
 .../share/ArenaBlockAllocatorBase_test.ref    |  3 +
 .../AthAllocators/share/ArenaBlock_test.ref   |  5 +
 .../share/ArenaHeapSTLAllocator_test.ref      |  4 +-
 .../share/ArenaPoolSTLAllocator_test.ref      |  2 +
 .../ArenaSharedHeapSTLAllocator_test.ref      |  2 +
 .../AthAllocators/share/exceptions_test.ref   |  4 +-
 Control/AthAllocators/src/ArenaBlock.cxx      | 64 ++++++++++++
 .../src/ArenaBlockAllocatorBase.cxx           | 49 +++++++++-
 .../src/ArenaSharedHeapSTLAllocator.cxx       | 36 ++++++-
 Control/AthAllocators/src/exceptions.cxx      | 48 ++++++++-
 .../test/ArenaBlockAllocatorBase_test.cxx     | 88 +++++++++++++++++
 .../AthAllocators/test/ArenaBlock_test.cxx    | 98 ++++++++++++++++++-
 .../test/ArenaHeapSTLAllocator_test.cxx       | 70 ++++++++++++-
 .../test/ArenaPoolSTLAllocator_test.cxx       | 67 +++++++++++++
 .../test/ArenaSharedHeapSTLAllocator_test.cxx | 67 +++++++++++++
 .../AthAllocators/test/exceptions_test.cxx    |  6 +-
 29 files changed, 1133 insertions(+), 63 deletions(-)
 create mode 100644 Control/AthAllocators/AthAllocators/maybeUnprotect.h
 create mode 100644 Control/AthAllocators/AthAllocators/preDelete.h
 create mode 100644 Control/AthAllocators/AthAllocators/preDeleteAlloc.h

diff --git a/Control/AthAllocators/AthAllocators/ArenaBlock.h b/Control/AthAllocators/AthAllocators/ArenaBlock.h
index 24e2797d004c..248e4a807cb0 100644
--- a/Control/AthAllocators/AthAllocators/ArenaBlock.h
+++ b/Control/AthAllocators/AthAllocators/ArenaBlock.h
@@ -158,6 +158,44 @@ public:
   static size_t nactive();
 
 
+  /**
+   * @brief Write-protect this block.
+   *
+   * Adjust protection on the memory allocated for this block
+   * to disallow writes.
+   */
+  void protect();
+
+
+  /**
+   * @brief Write-enable this block.
+   *
+   * Adjust protection on the memory allocated for this block
+   * to allow writes.
+   */
+  void unprotect();
+
+
+  /**
+   * @brief Write-protect all blocks in a list.
+   * @param p The first block to protect.
+   *
+   * Adjust protection on the memory allocated for these blocks
+   * to disallow writes.
+   */
+  static void protectList (ArenaBlock* p);
+
+
+  /**
+   * @brief Write-enable all blocks in a list.
+   * @param p The first block to protect.
+   *
+   * Adjust protection on the memory allocated for these blocks
+   * to allow writes.
+   */
+  static void unprotectList (ArenaBlock* p);
+
+
 private:
   /// Prohibit calling these.
   ArenaBlock (size_t n, size_t elt_size);
diff --git a/Control/AthAllocators/AthAllocators/ArenaBlock.icc b/Control/AthAllocators/AthAllocators/ArenaBlock.icc
index 2719a1265df0..57bb20f2043a 100644
--- a/Control/AthAllocators/AthAllocators/ArenaBlock.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaBlock.icc
@@ -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: ArenaBlock.icc 470529 2011-11-24 23:54:22Z ssnyder $
 /**
  * @file  AthAllocators/ArenaBlock.icc
  * @author scott snyder
diff --git a/Control/AthAllocators/AthAllocators/ArenaBlockAllocatorBase.h b/Control/AthAllocators/AthAllocators/ArenaBlockAllocatorBase.h
index 0ee5ccc08dbe..48d9687fe341 100644
--- a/Control/AthAllocators/AthAllocators/ArenaBlockAllocatorBase.h
+++ b/Control/AthAllocators/AthAllocators/ArenaBlockAllocatorBase.h
@@ -1,11 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
-
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id: ArenaBlockAllocatorBase.h 470529 2011-11-24 23:54:22Z ssnyder $
-
 /**
  * @file  AthAllocators/ArenaBlockAllocatorBase.h
  * @author scott snyder
@@ -125,6 +121,24 @@ public:
   const Params& params() const;
 
 
+  /**
+   * @brief Write-protect the memory managed by this allocator.
+   *
+   * Adjust protection on the memory managed by this allocator
+   * to disallow writes.
+   */
+  void protect();
+
+
+  /**
+   * @brief Write-enable the memory managed by this allocator.
+   *
+   * Adjust protection on the memory managed by this allocator
+   * to allow writes.
+   */
+  void unprotect();
+
+
 protected:
   /**
    * @brief Return an empty block, either newly-allocated or from the
@@ -143,6 +157,9 @@ protected:
 
   /// The statistics structure.
   ArenaAllocatorBase::Stats m_stats;
+
+  /// Flag whether the arena has been protected.
+  bool m_protected;
 };
 
 
diff --git a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h
index da4e2ece5cdf..66e8766297cd 100644
--- a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h
+++ b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h
@@ -1,11 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
-
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id: ArenaHeapSTLAllocator.h,v 1.2 2008-08-26 02:12:26 ssnyder Exp $
-
 /**
  * @file  AthAllocators/ArenaHeapSTLAllocator.h
  * @author scott snyder
@@ -307,7 +303,25 @@ public:
   /**
    * @brief Return a pointer to the underlying allocator (may be 0).
    */
-  const ArenaAllocatorBase* poolptr() const;
+  const ArenaBlockAllocatorBase* poolptr() const;
+
+
+  /**
+   * @brief Write-protect the memory managed by this allocator.
+   *
+   * Adjust protection on the memory managed by this allocator
+   * to disallow writes.
+   */
+  void protect();
+
+
+  /**
+   * @brief Write-enable the memory managed by this allocator.
+   *
+   * Adjust protection on the memory managed by this allocator
+   * to allow writes.
+   */
+  void unprotect();
 
 
 private:
@@ -404,7 +418,7 @@ public:
   /**
    * @brief Return a pointer to the underlying allocator (may be 0).
    */
-  const ArenaAllocatorBase* poolptr() const;
+  const ArenaBlockAllocatorBase* poolptr() const;
 
 
   /**
@@ -425,7 +439,7 @@ private:
   std::string m_name;
 
   /// Point at an underlying allocator from a different specialization.
-  const ArenaAllocatorBase* m_poolptr;
+  const ArenaBlockAllocatorBase* m_poolptr;
 };
 
 
@@ -447,7 +461,7 @@ public:
    */
   template <class U, class V>
   ArenaNonConstHeapSTLAllocator (const ArenaHeapSTLAllocator<U, V>& a,
-                                 ArenaAllocatorBase* poolptr_nc);
+                                 ArenaBlockAllocatorBase* poolptr_nc);
 
 
   /**
@@ -492,12 +506,42 @@ public:
   void reserve (size_t size);
 
 
+  /**
+   * @brief Write-protect the memory managed by this allocator.
+   *
+   * Adjust protection on the memory managed by this allocator
+   * to disallow writes.
+   */
+  void protect();
+
+
+  /**
+   * @brief Write-enable the memory managed by this allocator.
+   *
+   * Adjust protection on the memory managed by this allocator
+   * to allow writes.
+   */
+  void unprotect();
+
+
 private:
   /// Non-const pointer to the underlying allocator.
-  ArenaAllocatorBase* m_poolptr_nc;
+  ArenaBlockAllocatorBase* m_poolptr_nc;
 };
 
 
+/**
+ * @brief Hook for unprotecting an arena.
+ *
+ * Sometimes we need to ensure that an arena is unprotected before we start
+ * destroying an object that contains the arena.  To do that without
+ * making assumptions about whether the arena supports an unprotect
+ * operation, call this function.
+ */
+template <class T, class VETO>
+void maybeUnprotect (ArenaHeapSTLAllocator<T, VETO>& a);
+
+
 } // namespace SG
 
 
diff --git a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc
index 817ef56b94f8..b9f346b5bcfa 100644
--- a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc
@@ -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: ArenaHeapSTLAllocator.icc,v 1.2 2008-08-26 02:12:26 ssnyder Exp $
 /**
  * @file  AthAllocators/ArenaHeapSTLAllocator.icc
  * @author scott snyder
@@ -383,12 +381,40 @@ ArenaAllocatorBase::Stats ArenaHeapSTLAllocator<T, VETO>::stats() const
  * @brief Return a pointer to the underlying allocator (may be 0).
  */
 template <class T, class VETO>
-const ArenaAllocatorBase* ArenaHeapSTLAllocator<T, VETO>::poolptr() const
+const ArenaBlockAllocatorBase* ArenaHeapSTLAllocator<T, VETO>::poolptr() const
 {
   return &m_pool;
 }
 
 
+/**
+ * @brief Write-protect the memory managed by this allocator.
+ *
+ * Adjust protection on the memory managed by this allocator
+ * to disallow writes.
+ */
+template <class T, class VETO>
+inline
+void ArenaHeapSTLAllocator<T, VETO>::protect()
+{
+  m_pool.protect();
+}
+
+
+/**
+ * @brief Write-enable the memory managed by this allocator.
+ *
+ * Adjust protection on the memory managed by this allocator
+ * to allow writes.
+ */
+template <class T, class VETO>
+inline
+void ArenaHeapSTLAllocator<T, VETO>::unprotect()
+{
+  m_pool.unprotect();
+}
+
+
 //****************************************************************************
 // Vetoed specialization.
 //
@@ -468,7 +494,7 @@ ArenaHeapSTLAllocator<T, T>::stats() const
  * @brief Return a pointer to the underlying allocator (may be 0).
  */
 template <class T>
-const ArenaAllocatorBase* ArenaHeapSTLAllocator<T, T>::poolptr() const
+const ArenaBlockAllocatorBase* ArenaHeapSTLAllocator<T, T>::poolptr() const
 {
   return m_poolptr;
 }
@@ -488,7 +514,7 @@ template <class T>
 template <class U, class V>
 ArenaNonConstHeapSTLAllocator<T>::ArenaNonConstHeapSTLAllocator
   (const ArenaHeapSTLAllocator<U, V>& a,
-   ArenaAllocatorBase* poolptr_nc)
+   ArenaBlockAllocatorBase* poolptr_nc)
     : ArenaHeapSTLAllocator<T, T>(a),
     m_poolptr_nc (poolptr_nc)
 {
@@ -552,6 +578,34 @@ void ArenaNonConstHeapSTLAllocator<T>::reserve (size_t size)
 }
 
 
+/**
+ * @brief Write-protect the memory managed by this allocator.
+ *
+ * Adjust protection on the memory managed by this allocator
+ * to disallow writes.
+ */
+template <class T>
+inline
+void ArenaNonConstHeapSTLAllocator<T>::protect()
+{
+  if (m_poolptr_nc)
+    m_poolptr_nc->protect();
+}
+
+
+/**
+ * @brief Write-enable the memory managed by this allocator.
+ *
+ * Adjust protection on the memory managed by this allocator
+ * to allow writes.
+ */
+template <class T>
+inline
+void ArenaNonConstHeapSTLAllocator<T>::unprotect()
+{
+  if (m_poolptr_nc)
+    m_poolptr_nc->unprotect();
+}
 
 
 /**
@@ -568,7 +622,22 @@ ArenaHeapSTLAllocator<T, T>::get_allocator ATLAS_NOT_CONST_THREAD_SAFE (CONT& c)
   typename std::remove_const<CONT>::type& cc = c;
   ArenaHeapSTLAllocator<T, T> a (cc.get_allocator());
   return ArenaNonConstHeapSTLAllocator<T> (a,
-                                           const_cast<ArenaAllocatorBase*>(a.poolptr()));
+                                           const_cast<ArenaBlockAllocatorBase*>(a.poolptr()));
+}
+
+
+/**
+ * @brief Hook for unprotecting an arena.
+ *
+ * Sometimes we need to ensure that an arena is unprotected before we start
+ * destroying an object that contains the arena.  To do that without
+ * making assumptions about whether the arena supports an unprotect
+ * operation, call this function.
+ */
+template <class T, class VETO>
+void maybeUnprotect (ArenaHeapSTLAllocator<T, VETO>& a)
+{
+  a.unprotect();
 }
 
 
diff --git a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h
index bad199238874..082d34d0046c 100644
--- a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h
+++ b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h
@@ -1,6 +1,6 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 /**
  * @file  AthAllocators/ArenaPoolSTLAllocator.h
@@ -318,7 +318,25 @@ public:
   /**
    * @brief Return a pointer to the underlying allocator (may be 0).
    */
-  const ArenaAllocatorBase* poolptr() const;
+  const ArenaBlockAllocatorBase* poolptr() const;
+
+
+  /**
+   * @brief Write-protect the memory managed by this allocator.
+   *
+   * Adjust protection on the memory managed by this allocator
+   * to disallow writes.
+   */
+  void protect();
+
+
+  /**
+   * @brief Write-enable the memory managed by this allocator.
+   *
+   * Adjust protection on the memory managed by this allocator
+   * to allow writes.
+   */
+  void unprotect();
 
 
 private:
@@ -483,7 +501,7 @@ public:
   /**
    * @brief Return a pointer to the underlying allocator (may be 0).
    */
-  const ArenaAllocatorBase* poolptr() const;
+  const ArenaBlockAllocatorBase* poolptr() const;
 
 
   /**
@@ -504,7 +522,7 @@ private:
   std::string m_name;
 
   /// Point at an underlying allocator from a different specialization.
-  const ArenaAllocatorBase* m_poolptr;
+  const ArenaBlockAllocatorBase* m_poolptr;
 };
 
 
@@ -527,7 +545,7 @@ public:
    */
   template <class U, class V>
   ArenaNonConstPoolSTLAllocator (const ArenaPoolSTLAllocator<U, V>& a,
-                                 ArenaAllocatorBase* poolptr_nc);
+                                 ArenaBlockAllocatorBase* poolptr_nc);
 
 
   /**
@@ -572,12 +590,42 @@ public:
   void reserve (size_t size);
 
 
+  /**
+   * @brief Write-protect the memory managed by this allocator.
+   *
+   * Adjust protection on the memory managed by this allocator
+   * to disallow writes.
+   */
+  void protect();
+
+
+  /**
+   * @brief Write-enable the memory managed by this allocator.
+   *
+   * Adjust protection on the memory managed by this allocator
+   * to allow writes.
+   */
+  void unprotect();
+
+
 private:
   /// Non-const pointer to the underlying allocator.
-  ArenaAllocatorBase* m_poolptr_nc;
+  ArenaBlockAllocatorBase* m_poolptr_nc;
 };
 
 
+/**
+ * @brief Hook for unprotecting an arena.
+ *
+ * Sometimes we need to ensure that an arena is unprotected before we start
+ * destroying an object that contains the arena.  To do that without
+ * making assumptions about whether the arena supports an unprotect
+ * operation, call this function.
+ */
+template <class T, class VETO>
+void maybeUnprotect (ArenaPoolSTLAllocator<T, VETO>& a);
+
+
 } // namespace SG
 
 
diff --git a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc
index 7d853e6bd125..5fb443f98fd3 100644
--- a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc
@@ -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  AthAllocators/ArenaPoolSTLAllocator.icc
@@ -381,12 +381,40 @@ ArenaAllocatorBase::Stats ArenaPoolSTLAllocator<T, VETO>::stats() const
  * @brief Return a pointer to the underlying allocator (may be 0).
  */
 template <class T, class VETO>
-const ArenaAllocatorBase* ArenaPoolSTLAllocator<T, VETO>::poolptr() const
+const ArenaBlockAllocatorBase* ArenaPoolSTLAllocator<T, VETO>::poolptr() const
 {
   return &m_pool;
 }
 
 
+/**
+ * @brief Write-protect the memory managed by this allocator.
+ *
+ * Adjust protection on the memory managed by this allocator
+ * to disallow writes.
+ */
+template <class T, class VETO>
+inline
+void ArenaPoolSTLAllocator<T, VETO>::protect()
+{
+  m_pool.protect();
+}
+
+
+/**
+ * @brief Write-enable the memory managed by this allocator.
+ *
+ * Adjust protection on the memory managed by this allocator
+ * to allow writes.
+ */
+template <class T, class VETO>
+inline
+void ArenaPoolSTLAllocator<T, VETO>::unprotect()
+{
+  m_pool.unprotect();
+}
+
+
 //****************************************************************************
 // Pointer specialization.
 //
@@ -523,7 +551,7 @@ ArenaPoolSTLAllocator<T, ATHVETO>::stats() const
  * @brief Return a pointer to the underlying allocator (may be 0).
  */
 template <class T>
-const ArenaAllocatorBase* ArenaPoolSTLAllocator<T, ATHVETO>::poolptr() const
+const ArenaBlockAllocatorBase* ArenaPoolSTLAllocator<T, ATHVETO>::poolptr() const
 {
   return m_poolptr;
 }
@@ -543,7 +571,7 @@ template <class T>
 template <class U, class V>
 ArenaNonConstPoolSTLAllocator<T>::ArenaNonConstPoolSTLAllocator
   (const ArenaPoolSTLAllocator<U, V>& a,
-   ArenaAllocatorBase* poolptr_nc)
+   ArenaBlockAllocatorBase* poolptr_nc)
     : ArenaPoolSTLAllocator<T, T>(a),
     m_poolptr_nc (poolptr_nc)
 {
@@ -607,6 +635,36 @@ void ArenaNonConstPoolSTLAllocator<T>::reserve (size_t size)
 }
 
 
+/**
+ * @brief Write-protect the memory managed by this allocator.
+ *
+ * Adjust protection on the memory managed by this allocator
+ * to disallow writes.
+ */
+template <class T>
+inline
+void ArenaNonConstPoolSTLAllocator<T>::protect()
+{
+  if (m_poolptr_nc)
+    m_poolptr_nc->protect();
+}
+
+
+/**
+ * @brief Write-enable the memory managed by this allocator.
+ *
+ * Adjust protection on the memory managed by this allocator
+ * to allow writes.
+ */
+template <class T>
+inline
+void ArenaNonConstPoolSTLAllocator<T>::unprotect()
+{
+  if (m_poolptr_nc)
+    m_poolptr_nc->unprotect();
+}
+
+
 /**
  * @brief Return an allocator supporting non-const methods from
  *        a non-const container reference.
@@ -621,11 +679,26 @@ ArenaPoolSTLAllocator<T, ATHVETO>::get_allocator ATLAS_NOT_CONST_THREAD_SAFE (CO
   typename std::remove_const<CONT>::type& cc = c;
   ArenaPoolSTLAllocator<T, T> a (cc.get_allocator());
   return ArenaNonConstPoolSTLAllocator<T> (a,
-                                           const_cast<ArenaAllocatorBase*>(a.poolptr()));
+                                           const_cast<ArenaBlockAllocatorBase*>(a.poolptr()));
 }
 
 
 #undef ATHVETO
 
 
+/**
+ * @brief Hook for unprotecting an arena.
+ *
+ * Sometimes we need to ensure that an arena is unprotected before we start
+ * destroying an object that contains the arena.  To do that without
+ * making assumptions about whether the arena supports an unprotect
+ * operation, call this function.
+ */
+template <class T, class VETO>
+void maybeUnprotect (ArenaPoolSTLAllocator<T, VETO>& a)
+{
+  a.unprotect();
+}
+
+
 } // namespace SG
diff --git a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h
index b51d78dcd2b1..def334eb7ebe 100644
--- a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h
+++ b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h
@@ -1,10 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
-
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id: ArenaSharedHeapSTLAllocator.h 552460 2013-06-25 17:29:25Z ssnyder $
 /**
  * @file AthAllocators/ArenaSharedHeapSTLAllocator.h
  * @author scott snyder <snyder@bnl.gov>
@@ -156,6 +153,24 @@ public:
   void report (std::ostream& os) const;
 
 
+  /**
+   * @brief Write-protect the memory managed by these allocators.
+   *
+   * Adjust protection on the memory managed by these allocators
+   * to disallow writes.
+   */
+  void protect();
+
+
+  /**
+   * @brief Write-enable the memory managed by these allocators.
+   *
+   * Adjust protection on the memory managed by these allocators
+   * to allow writes.
+   */
+  void unprotect();
+
+
 private:
   /**
    * @brief Return the allocator index to use for type @c T.
@@ -428,6 +443,24 @@ public:
   void report (std::ostream& os) const;
   
 
+  /**
+   * @brief Write-protect the memory managed by these allocators.
+   *
+   * Adjust protection on the memory managed by these allocators
+   * to disallow writes.
+   */
+  void protect();
+
+
+  /**
+   * @brief Write-enable the memory managed by these allocators.
+   *
+   * Adjust protection on the memory managed by these allocators
+   * to allow writes.
+   */
+  void unprotect();
+
+
 private:
   ArenaSharedHeapSTLHeader* m_header;
   ArenaHeapAllocator* m_pool;
@@ -441,6 +474,18 @@ void swap (ArenaSharedHeapSTLAllocator<T>& a, ArenaSharedHeapSTLAllocator<T>& b)
 }
 
 
+/**
+ * @brief Hook for unprotecting an arena.
+ *
+ * Sometimes we need to ensure that an arena is unprotected before we start
+ * destroying an object that contains the arena.  To do that without
+ * making assumptions about whether the arena supports an unprotect
+ * operation, call this function.
+ */
+template <class T>
+void maybeUnprotect (ArenaSharedHeapSTLAllocator<T>& a);
+
+
 } // namespace SG
 
 
diff --git a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc
index 14e0ced47591..ef78c763db9a 100644
--- a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc
@@ -1,8 +1,6 @@
 /*
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id: ArenaSharedHeapSTLAllocator.icc 496835 2012-04-20 07:58:52Z ssnyder $
 /**
  * @file AthAllocators/ArenaSharedHeapSTLAllocator.icc
  * @author scott snyder <snyder@bnl.gov>
@@ -496,4 +494,47 @@ void ArenaSharedHeapSTLAllocator<T>::report (std::ostream& os) const
 }
 
 
+/**
+ * @brief Write-protect the memory managed by these allocators.
+ *
+ * Adjust protection on the memory managed by these allocators
+ * to disallow writes.
+ */
+template <class T>
+inline
+void ArenaSharedHeapSTLAllocator<T>::protect()
+{
+  m_header->protect();
+}
+
+
+/**
+ * @brief Write-enable the memory managed by these allocators.
+ *
+ * Adjust protection on the memory managed by these allocators
+ * to allow writes.
+ */
+template <class T>
+inline
+void ArenaSharedHeapSTLAllocator<T>::unprotect()
+{
+  m_header->unprotect();
+}
+
+
+/**
+ * @brief Hook for unprotecting an arena.
+ *
+ * Sometimes we need to ensure that an arena is unprotected before we start
+ * destroying an object that contains the arena.  To do that without
+ * making assumptions about whether the arena supports an unprotect
+ * operation, call this function.
+ */
+template <class T>
+void maybeUnprotect (ArenaSharedHeapSTLAllocator<T>& a)
+{
+  a.unprotect();
+}
+
+
 } // namespace SG
diff --git a/Control/AthAllocators/AthAllocators/exceptions.h b/Control/AthAllocators/AthAllocators/exceptions.h
index 6bdb6d91b8e8..1234a1922e84 100644
--- a/Control/AthAllocators/AthAllocators/exceptions.h
+++ b/Control/AthAllocators/AthAllocators/exceptions.h
@@ -1,10 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
-
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file AthAllocators/exceptions.h
  * @author scott snyder <snyder@bnl.gov>
@@ -38,6 +35,35 @@ public:
 };
 
 
+/**
+ * @brief Exception --- Attempt to change memory protection failed.
+ */
+class ExcProtection
+  : public std::runtime_error
+{
+public:
+  /**
+   * @brief Constructor.
+   * @param errnum The system error code.
+   */
+  ExcProtection (int errnum);
+};
+
+
+/**
+ * @brief Exception --- Attempt to change protected arena.
+ */
+class ExcProtected
+  : public std::runtime_error
+{
+public:
+  /**
+   * @brief Constructor.
+   */
+  ExcProtected();
+};
+
+
 } // namespace SG
 
 
diff --git a/Control/AthAllocators/AthAllocators/maybeUnprotect.h b/Control/AthAllocators/AthAllocators/maybeUnprotect.h
new file mode 100644
index 000000000000..169201bcfbbb
--- /dev/null
+++ b/Control/AthAllocators/AthAllocators/maybeUnprotect.h
@@ -0,0 +1,40 @@
+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+/*
+ * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file AthAllocators/maybeUnprotect.h
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Aug, 2021
+ * @brief Hook for unprotecting an arena.
+ */
+
+
+#ifndef ATHALLOCATORS_MAYBEUNPROTECT_H
+#define ATHALLOCATORS_MAYBEUNPROTECT_H
+
+
+namespace SG {
+
+
+/**
+ * @brief Hook for unprotecting an arena.
+ *
+ * Sometimes we need to ensure that an arena is unprotected before we start
+ * destroying an object that contains the arena.  To do that without
+ * making assumptions about whether the arena supports an unprotect
+ * operation, call this function.
+ *
+ * This is the generic version, which is a no-op.  It will be specialized
+ * as appropriate for individual allocators.
+ */
+template <class ALLOC>
+void maybeUnprotect (ALLOC&)
+{
+}
+
+
+} // namespace SG
+
+
+#endif // not ATHALLOCATORS_MAYBEUNPROTECT_H
diff --git a/Control/AthAllocators/AthAllocators/preDelete.h b/Control/AthAllocators/AthAllocators/preDelete.h
new file mode 100644
index 000000000000..4efd4e7a648b
--- /dev/null
+++ b/Control/AthAllocators/AthAllocators/preDelete.h
@@ -0,0 +1,26 @@
+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+/*
+ * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file AthAllocators/preDelete.h
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Aug, 2021
+ * @brief 
+ */
+
+
+#ifndef ATHALLOCATORS_PREDELETE_H
+#define ATHALLOCATORS_PREDELETE_H
+
+
+namespace SG {
+
+
+template <class ALLOC>
+void preDeleteAlloc (ALLOC&)
+{
+}
+
+
+#endif // not ATHALLOCATORS_PREDELETE_H
diff --git a/Control/AthAllocators/AthAllocators/preDeleteAlloc.h b/Control/AthAllocators/AthAllocators/preDeleteAlloc.h
new file mode 100644
index 000000000000..d97feae58eb5
--- /dev/null
+++ b/Control/AthAllocators/AthAllocators/preDeleteAlloc.h
@@ -0,0 +1,26 @@
+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+/*
+ * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
+ */
+/**
+ * @file AthAllocators/preDeleteAlloc.h
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Aug, 2021
+ * @brief Hook 
+ */
+
+
+#ifndef ATHALLOCATORS_PREDELETE_H
+#define ATHALLOCATORS_PREDELETE_H
+
+
+namespace SG {
+
+
+template <class ALLOC>
+void preDeleteAlloc (ALLOC&)
+{
+}
+
+
+#endif // not ATHALLOCATORS_PREDELETE_H
diff --git a/Control/AthAllocators/share/ArenaBlockAllocatorBase_test.ref b/Control/AthAllocators/share/ArenaBlockAllocatorBase_test.ref
index e69de29bb2d1..3f53ace59731 100644
--- a/Control/AthAllocators/share/ArenaBlockAllocatorBase_test.ref
+++ b/Control/AthAllocators/share/ArenaBlockAllocatorBase_test.ref
@@ -0,0 +1,3 @@
+AthAllocators/ArenaBlockAllocatorBase_test
+test1
+test2
diff --git a/Control/AthAllocators/share/ArenaBlock_test.ref b/Control/AthAllocators/share/ArenaBlock_test.ref
index e69de29bb2d1..0d352c22a05b 100644
--- a/Control/AthAllocators/share/ArenaBlock_test.ref
+++ b/Control/AthAllocators/share/ArenaBlock_test.ref
@@ -0,0 +1,5 @@
+AthAllocators/ArenaBlock_test
+test1
+test2
+test3
+test4
diff --git a/Control/AthAllocators/share/ArenaHeapSTLAllocator_test.ref b/Control/AthAllocators/share/ArenaHeapSTLAllocator_test.ref
index 52017886c7f5..1445868efcd9 100644
--- a/Control/AthAllocators/share/ArenaHeapSTLAllocator_test.ref
+++ b/Control/AthAllocators/share/ArenaHeapSTLAllocator_test.ref
@@ -1,5 +1,7 @@
+AthAllocators/ArenaHeapSTLAllocator_test
 test1
 test2
 test3
-test3
+test4
 test5
+test6
diff --git a/Control/AthAllocators/share/ArenaPoolSTLAllocator_test.ref b/Control/AthAllocators/share/ArenaPoolSTLAllocator_test.ref
index 59a6107ed26e..e915cbfb400b 100644
--- a/Control/AthAllocators/share/ArenaPoolSTLAllocator_test.ref
+++ b/Control/AthAllocators/share/ArenaPoolSTLAllocator_test.ref
@@ -1,5 +1,7 @@
+AthAllocators/ArenaPoolSTLAllocator_test
 test1
 test2
 test3
 test4
 test6
+test7
diff --git a/Control/AthAllocators/share/ArenaSharedHeapSTLAllocator_test.ref b/Control/AthAllocators/share/ArenaSharedHeapSTLAllocator_test.ref
index 45aaa06da1e7..a16b7e43034a 100644
--- a/Control/AthAllocators/share/ArenaSharedHeapSTLAllocator_test.ref
+++ b/Control/AthAllocators/share/ArenaSharedHeapSTLAllocator_test.ref
@@ -1,5 +1,7 @@
+AthAllocators/ArenaSharedHeapSTLAllocator_test
 test1
 test2
 test3
 test4
 test5
+test6
diff --git a/Control/AthAllocators/share/exceptions_test.ref b/Control/AthAllocators/share/exceptions_test.ref
index 293e5e85574f..03902d229da3 100644
--- a/Control/AthAllocators/share/exceptions_test.ref
+++ b/Control/AthAllocators/share/exceptions_test.ref
@@ -1,2 +1,4 @@
 test1
-Attempt to assign between ArenaSharedHeapSTLAllocators for different arenas.
+SG::ExcDifferentAreas: Attempt to assign between ArenaSharedHeapSTLAllocators for different arenas.
+SG::ExcProtection: Attempt to change memory protection failed: Invalid argument
+SG::ExcProtected: Attempt to change protected arena.
diff --git a/Control/AthAllocators/src/ArenaBlock.cxx b/Control/AthAllocators/src/ArenaBlock.cxx
index dbab9ddb5962..01bb5569a10e 100644
--- a/Control/AthAllocators/src/ArenaBlock.cxx
+++ b/Control/AthAllocators/src/ArenaBlock.cxx
@@ -12,9 +12,11 @@
 
 
 #include "AthAllocators/ArenaBlock.h"
+#include "AthAllocators/exceptions.h"
 #include <cstdlib>
 #include <unistd.h>
 #include <cassert>
+#include <sys/mman.h>
 
 
 namespace SG {
@@ -159,4 +161,66 @@ size_t ArenaBlock::overhead()
 }
 
 
+/**
+ * @brief Write-protect this block.
+ *
+ * Adjust protection on the memory allocated for this block
+ * to disallow writes.
+ */
+void ArenaBlock::protect()
+{
+  int stat = mprotect (this, m_size*m_elt_size+ArenaBlockBodyOffset,
+                       PROT_READ);
+  if (stat) {
+    throw SG::ExcProtection (stat);
+  }
+}
+
+
+/**
+ * @brief Write-enable this block.
+ *
+ * Adjust protection on the memory allocated for this block
+ * to allow writes.
+ */
+void ArenaBlock::unprotect()
+{
+  int stat = mprotect (this, m_size*m_elt_size+ArenaBlockBodyOffset,
+                       PROT_READ + PROT_WRITE);
+  if (stat) {
+    throw SG::ExcProtection (stat);
+  }
+}
+
+
+/**
+ * @brief Write-protect all blocks in a list.
+ * @param p The first block to protect.
+ *
+ * Adjust protection on the memory allocated for these blocks
+ * to disallow writes.
+ */
+void ArenaBlock::protectList (ArenaBlock* p)
+{
+  for (; p; p = p->link()) {
+    p->protect();
+  }
+}
+
+
+/**
+ * @brief Write-enable all blocks in a list.
+ * @param p The first block to protect.
+ *
+ * Adjust protection on the memory allocated for these blocks
+ * to allow writes.
+ */
+void ArenaBlock::unprotectList (ArenaBlock* p)
+{
+  for (; p; p = p->link()) {
+    p->unprotect();
+  }
+}
+
+
 } // namespace SG
diff --git a/Control/AthAllocators/src/ArenaBlockAllocatorBase.cxx b/Control/AthAllocators/src/ArenaBlockAllocatorBase.cxx
index d96ac519df50..861f857f0b9d 100644
--- a/Control/AthAllocators/src/ArenaBlockAllocatorBase.cxx
+++ b/Control/AthAllocators/src/ArenaBlockAllocatorBase.cxx
@@ -11,6 +11,7 @@
 
 #include "AthAllocators/ArenaBlockAllocatorBase.h"
 #include "AthAllocators/ArenaBlock.h"
+#include "AthAllocators/exceptions.h"
 
 
 namespace SG {
@@ -25,7 +26,8 @@ ArenaBlockAllocatorBase::ArenaBlockAllocatorBase (const Params& params)
   : m_params (params),
     m_blocks (nullptr),
     m_freeblocks (nullptr),
-    m_stats()
+    m_stats(),
+    m_protected (false)
 {
 }
 
@@ -50,11 +52,13 @@ ArenaBlockAllocatorBase::ArenaBlockAllocatorBase
     : m_params (other.m_params),
       m_blocks (other.m_blocks),
       m_freeblocks (other.m_freeblocks),
-      m_stats (other.m_stats)
+      m_stats (other.m_stats),
+      m_protected (other.m_protected)
 {
   other.m_blocks = nullptr;
   other.m_freeblocks = nullptr;
   other.m_stats.clear();
+  other.m_protected = false;
 }
 
 
@@ -71,9 +75,11 @@ ArenaBlockAllocatorBase::operator=
     m_blocks = other.m_blocks;
     m_freeblocks = other.m_freeblocks;
     m_stats = other.m_stats;
+    m_protected = other.m_protected;
     other.m_blocks = nullptr;
     other.m_freeblocks = nullptr;
     other.m_stats.clear();
+    other.m_protected = false;
   }
   return *this;
 }
@@ -89,6 +95,7 @@ void ArenaBlockAllocatorBase::swap (ArenaBlockAllocatorBase& other)
     std::swap (m_blocks, other.m_blocks);
     std::swap (m_freeblocks, other.m_freeblocks);
     std::swap (m_stats, other.m_stats);
+    std::swap (m_protected, other.m_protected);
   }
 }
 
@@ -112,6 +119,9 @@ void ArenaBlockAllocatorBase::swap (ArenaBlockAllocatorBase& other)
  */
 void ArenaBlockAllocatorBase::reserve (size_t size)
 {
+  if (m_protected) {
+    throw SG::ExcProtected();
+  }
   if (size > m_stats.elts.total) {
     // Growing the pool.
     // Make a new block of the required size (but not less than nblock).
@@ -164,6 +174,9 @@ void ArenaBlockAllocatorBase::reserve (size_t size)
  */
 void ArenaBlockAllocatorBase::erase()
 {
+  if (m_protected) {
+    throw SG::ExcProtected();
+  }
   // Do we need to run clear() on the allocated elements?
   // If so, do so via reset().
   if (m_params.mustClear && m_params.clear) {
@@ -223,6 +236,10 @@ ArenaBlockAllocatorBase::params() const
  */
 ArenaBlock* ArenaBlockAllocatorBase::getBlock()
 {
+  if (m_protected) {
+    throw SG::ExcProtected();
+  }
+
   ArenaBlock* newblock = m_freeblocks;
   if (newblock) {
     // There's something on the free list.  Remove it and update statistics.
@@ -247,4 +264,32 @@ ArenaBlock* ArenaBlockAllocatorBase::getBlock()
 }
 
 
+/**
+ * @brief Write-protect the memory managed by this allocator.
+ *
+ * Adjust protection on the memory managed by this allocator
+ * to disallow writes.
+ */
+void ArenaBlockAllocatorBase::protect()
+{
+  SG::ArenaBlock::protectList (m_blocks);
+  m_protected = true;
+}
+
+
+/**
+ * @brief Write-enable the memory managed by this allocator.
+ *
+ * Adjust protection on the memory managed by this allocator
+ * to allow writes.
+ */
+void ArenaBlockAllocatorBase::unprotect()
+{
+  if (m_protected) {
+    SG::ArenaBlock::unprotectList (m_blocks);
+    m_protected = false;
+  }
+}
+
+
 } // namespace SG
diff --git a/Control/AthAllocators/src/ArenaSharedHeapSTLAllocator.cxx b/Control/AthAllocators/src/ArenaSharedHeapSTLAllocator.cxx
index c5ac810e00f6..fbeccd51fabe 100644
--- a/Control/AthAllocators/src/ArenaSharedHeapSTLAllocator.cxx
+++ b/Control/AthAllocators/src/ArenaSharedHeapSTLAllocator.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: ArenaSharedHeapSTLAllocator.cxx 470825 2011-11-25 23:20:57Z ssnyder $
 /**
  * @file AthAllocators/src/ArenaSharedHeapSTLAllocator.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -75,4 +73,36 @@ void ArenaSharedHeapSTLHeader::report (std::ostream& os) const
 }
 
 
+/**
+ * @brief Write-protect the memory managed by these allocators.
+ *
+ * Adjust protection on the memory managed by these allocators
+ * to disallow writes.
+ */
+void ArenaSharedHeapSTLHeader::protect()
+{
+  for (ArenaHeapAllocator* a : m_allocators) {
+    if (a) {
+      a->protect();
+    }
+  }
+}
+
+
+/**
+ * @brief Write-enable the memory managed by these allocators.
+ *
+ * Adjust protection on the memory managed by these allocators
+ * to allow writes.
+ */
+void ArenaSharedHeapSTLHeader::unprotect()
+{
+  for (ArenaHeapAllocator* a : m_allocators) {
+    if (a) {
+      a->unprotect();
+    }
+  }
+}
+
+
 } // namespace SG
diff --git a/Control/AthAllocators/src/exceptions.cxx b/Control/AthAllocators/src/exceptions.cxx
index 6fd52f12ccc7..08a27d545aed 100644
--- a/Control/AthAllocators/src/exceptions.cxx
+++ b/Control/AthAllocators/src/exceptions.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 AthAllocators/src/exceptions.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -10,9 +8,9 @@
  * @brief Exceptions that can be thrown from AthAllocators.
  */
 
-
 #include "AthAllocators/exceptions.h"
 #include <sstream>
+#include <string.h>
 
 
 namespace SG {
@@ -25,7 +23,47 @@ namespace SG {
  * @brief Constructor.
  */
 ExcDifferentArenas::ExcDifferentArenas()
-  : std::runtime_error ("Attempt to assign between ArenaSharedHeapSTLAllocators for different arenas.")
+  : std::runtime_error ("SG::ExcDifferentAreas: Attempt to assign between ArenaSharedHeapSTLAllocators for different arenas.")
+{
+}
+
+
+//*************************************************************************
+
+
+std::string excProtection_format (int errnum)
+{
+  std::ostringstream os;
+  os << "SG::ExcProtection: Attempt to change memory protection failed: ";
+  char errbuf[256];
+#ifdef _GNU_SOURCE
+  os << strerror_r (errnum, errbuf, sizeof(errbuf));
+#else
+  strerror_r (errnum, errbuf, sizeof(errbuf));
+  os << errbuf;
+#endif
+  return os.str();
+}
+
+
+/**
+ * @brief Constructor.
+ * @param errnum The system error code.
+ */
+ExcProtection::ExcProtection (int errnum)
+  : std::runtime_error (excProtection_format (errnum))
+{
+}
+
+
+//*************************************************************************
+
+
+/**
+ * @brief Constructor.
+ */
+ExcProtected::ExcProtected()
+  : std::runtime_error ("SG::ExcProtected: Attempt to change protected arena.")
 {
 }
 
diff --git a/Control/AthAllocators/test/ArenaBlockAllocatorBase_test.cxx b/Control/AthAllocators/test/ArenaBlockAllocatorBase_test.cxx
index 39954cd4aa24..c14897a1cb4b 100644
--- a/Control/AthAllocators/test/ArenaBlockAllocatorBase_test.cxx
+++ b/Control/AthAllocators/test/ArenaBlockAllocatorBase_test.cxx
@@ -11,11 +11,15 @@
 #undef NDEBUG
 #include "AthAllocators/ArenaBlockAllocatorBase.h"
 #include "AthAllocators/ArenaBlock.h"
+#include "AthAllocators/exceptions.h"
+#include "TestTools/expect_exception.h"
 #include "CxxUtils/checker_macros.h"
 #include <cassert>
 #include <atomic>
 #include <vector>
 #include <iostream>
+#include <setjmp.h>
+#include <signal.h>
 
 
 struct Payload
@@ -53,6 +57,17 @@ std::atomic<int> Payload::n;
 std::vector<int> Payload::v;
 
 
+Payload& payload (SG::ArenaBlock* bl, size_t i=0)
+{
+  while (bl && i >= bl->size()) {
+    i -= bl->size();
+    bl = bl->link();
+  }
+  assert (bl != nullptr);
+  return *(Payload*)bl->index (i, sizeof(Payload));
+}
+
+
 class TestAlloc
   : public SG::ArenaBlockAllocatorBase
 {
@@ -60,6 +75,7 @@ public:
   TestAlloc (const Params& params) : SG::ArenaBlockAllocatorBase (params){}
   virtual void reset() override {}
 
+  using SG::ArenaBlockAllocatorBase::getBlock;
   using SG::ArenaBlockAllocatorBase::m_blocks;
   using SG::ArenaBlockAllocatorBase::m_freeblocks;
 };
@@ -86,6 +102,8 @@ void test_stats (const SG::ArenaBlockAllocatorBase& bab,
 
 void test1()
 {
+  std::cout << "test1\n";
+
   TestAlloc bab
     (SG::ArenaAllocatorBase::initParams<Payload, true> (100, "foo"));
   assert (bab.name() == "foo");
@@ -158,8 +176,78 @@ void test1()
   assert (bab2.m_freeblocks == freeblocks);
 }
 
+
+jmp_buf jmp ATLAS_THREAD_SAFE;
+void handler (int)
+{
+  siglongjmp (jmp, 1);
+}
+void setsig()
+{
+  struct sigaction act;
+  act.sa_handler = handler;
+  sigemptyset (&act.sa_mask);
+  act.sa_flags = 0;
+  if (sigaction (SIGSEGV, &act, nullptr) != 0) std::abort();
+}
+void resetsig()
+{
+  struct sigaction act;
+  act.sa_handler = SIG_DFL;
+  sigemptyset (&act.sa_mask);
+  act.sa_flags = 0;
+  if (sigaction (SIGSEGV, &act, nullptr) != 0) std::abort();
+  sigset_t sigs;
+  if (sigemptyset (&sigs) != 0) std::abort();
+  if (sigaddset (&sigs, SIGSEGV) != 0) std::abort();
+  if (sigprocmask (SIG_UNBLOCK, &sigs, nullptr) != 0) std::abort();
+}
+
+template <typename CALLABLE>
+void expect_signal (CALLABLE code)
+{
+  // volatile to avoid gcc -Wclobbered warning.
+  volatile bool handled = false;
+  if (sigsetjmp (jmp, 0)) {
+    handled = true;
+  }
+  else {
+    setsig();
+    code();
+  }
+  resetsig();
+  assert (handled);
+}
+
+
+// Test protect().
+void test2()
+{
+  std::cout << "test2\n";
+  TestAlloc bab
+    (SG::ArenaAllocatorBase::initParams<Payload, true> (100, "foo"));
+  while (bab.stats().elts.total < 1000) {
+    bab.getBlock();
+  }
+  payload (bab.m_blocks, 500).x = 42;
+  bab.protect();
+  expect_signal ([&]() { payload (bab.m_blocks, 500).x = 43; });
+
+  EXPECT_EXCEPTION( SG::ExcProtected, bab.reserve (500) );
+  EXPECT_EXCEPTION( SG::ExcProtected, bab.erase() );
+  EXPECT_EXCEPTION( SG::ExcProtected, bab.getBlock() );
+
+  bab.unprotect();
+  assert (payload (bab.m_blocks, 500).x == 42);
+  payload (bab.m_blocks, 500).x = 43;
+  assert (payload (bab.m_blocks, 500).x == 43);
+}
+
+
 int main()
 {
+  std::cout << "AthAllocators/ArenaBlockAllocatorBase_test\n";
   test1();
+  test2();
   return 0;
 }
diff --git a/Control/AthAllocators/test/ArenaBlock_test.cxx b/Control/AthAllocators/test/ArenaBlock_test.cxx
index d151bb34f023..d165936807a2 100644
--- a/Control/AthAllocators/test/ArenaBlock_test.cxx
+++ b/Control/AthAllocators/test/ArenaBlock_test.cxx
@@ -14,6 +14,9 @@
 #include "CxxUtils/checker_macros.h"
 #include <cassert>
 #include <vector>
+#include <iostream>
+#include <setjmp.h>
+#include <signal.h>
 
 
 ATLAS_NO_CHECK_FILE_THREAD_SAFETY;
@@ -80,6 +83,7 @@ Payload& payload (SG::ArenaBlock* bl, size_t i=0)
 
 void test1()
 {
+  std::cout << "test1\n";
   assert (SG::ArenaBlock::nactive() == 0);
   SG::ArenaBlock* bl = SG::ArenaBlock::newBlock (20, elt_size, nullptr);
   assert (SG::ArenaBlock::nactive() == 1);
@@ -100,6 +104,7 @@ void test1()
 
 void test2()
 {
+  std::cout << "test2\n";
   SG::ArenaBlock* b1 = SG::ArenaBlock::newBlock (20, elt_size,
                                                  Payload::constructor);
   SG::ArenaBlock* b2 = SG::ArenaBlock::newBlock (20, elt_size,
@@ -137,17 +142,108 @@ void test2()
   }
 
   Payload::v.clear();
+  size_t totsize = b1->size() + b2->size() + b3->size();
   SG::ArenaBlock::destroyList (b1, Payload::destructor);
-  assert (Payload::v.size() == b1->size() + b2->size() + b3->size());
+  assert (Payload::v.size() == totsize);
   for (size_t j = 0; j < Payload::v.size(); ++j) {
     assert (Payload::v[j] == -(int)j);
   }
 }
 
 
+jmp_buf jmp;
+void handler (int)
+{
+  siglongjmp (jmp, 1);
+}
+void setsig()
+{
+  struct sigaction act;
+  act.sa_handler = handler;
+  sigemptyset (&act.sa_mask);
+  act.sa_flags = 0;
+  if (sigaction (SIGSEGV, &act, nullptr) != 0) std::abort();
+}
+void resetsig()
+{
+  struct sigaction act;
+  act.sa_handler = SIG_DFL;
+  sigemptyset (&act.sa_mask);
+  act.sa_flags = 0;
+  if (sigaction (SIGSEGV, &act, nullptr) != 0) std::abort();
+  sigset_t sigs;
+  if (sigemptyset (&sigs) != 0) std::abort();
+  if (sigaddset (&sigs, SIGSEGV) != 0) std::abort();
+  if (sigprocmask (SIG_UNBLOCK, &sigs, nullptr) != 0) std::abort();
+}
+
+template <typename CALLABLE>
+void expect_signal (CALLABLE code)
+{
+  // volatile to avoid gcc -Wclobbered warning.
+  volatile bool handled = false;
+  if (sigsetjmp (jmp, 0)) {
+    handled = true;
+  }
+  else {
+    setsig();
+    code();
+  }
+  resetsig();
+  assert (handled);
+}
+
+// Test protect().
+void test3()
+{
+  std::cout << "test3\n";
+  SG::ArenaBlock* b1 = SG::ArenaBlock::newBlock (20, elt_size, nullptr);
+  word(b1, 10) = 42;
+  assert (word(b1, 10) == 42);
+  b1->protect();
+  assert (word(b1, 10) == 42);
+  expect_signal ([&]() { word(b1, 10) = 43; });
+  b1->unprotect();
+  assert (word(b1, 10) == 42);
+  word(b1, 10) = 43;
+  assert (word(b1, 10) == 43);
+  SG::ArenaBlock::destroy (b1, nullptr);
+}
+
+
+// Test protectList().
+void test4()
+{
+  std::cout << "test4\n";
+  SG::ArenaBlock* b1 = SG::ArenaBlock::newBlock (20, elt_size, nullptr);
+  SG::ArenaBlock* b2 = SG::ArenaBlock::newBlock (20, elt_size, nullptr);
+  b1->link() = b2;
+  word(b1, 10) = 42;
+  word(b2, 10) = 442;
+  assert (word(b1, 10) == 42);
+  assert (word(b2, 10) == 442);
+  SG::ArenaBlock::protectList (b1);
+  assert (word(b1, 10) == 42);
+  assert (word(b2, 10) == 442);
+  expect_signal ([&]() { word(b1, 10) = 43; });
+  expect_signal ([&]() { word(b2, 10) = 443; });
+  SG::ArenaBlock::unprotectList (b1);
+  assert (word(b1, 10) == 42);
+  assert (word(b2, 10) == 442);
+  word(b1, 10) = 43;
+  word(b2, 10) = 443;
+  assert (word(b1, 10) == 43);
+  assert (word(b2, 10) == 443);
+  SG::ArenaBlock::destroyList (b1, nullptr);
+}
+
+
 int main()
 {
+  std::cout << "AthAllocators/ArenaBlock_test\n";
   test1();
   test2();
+  test3();
+  test4();
   return 0;
 }
diff --git a/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx b/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx
index 0ce661c65393..ddc6419f0cdd 100644
--- a/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx
@@ -17,6 +17,8 @@
 #include <cassert>
 #include <iostream>
 #include <atomic>
+#include <setjmp.h>
+#include <signal.h>
 
 
 //==========================================================================
@@ -291,7 +293,7 @@ void test4()
   Payload::v.clear();
   Payload::n = 0;
 
-  std::cout << "test3\n";
+  std::cout << "test4\n";
 
   typedef SG::ArenaHeapSTLAllocator<int> allocator_t;
   typedef std::list<int,  allocator_t> list_t;
@@ -417,12 +419,78 @@ void test5()
 }
 
 
+jmp_buf jmp ATLAS_THREAD_SAFE;
+void handler (int)
+{
+  siglongjmp (jmp, 1);
+}
+void setsig()
+{
+  struct sigaction act;
+  act.sa_handler = handler;
+  sigemptyset (&act.sa_mask);
+  act.sa_flags = 0;
+  if (sigaction (SIGSEGV, &act, nullptr) != 0) std::abort();
+}
+void resetsig()
+{
+  struct sigaction act;
+  act.sa_handler = SIG_DFL;
+  sigemptyset (&act.sa_mask);
+  act.sa_flags = 0;
+  if (sigaction (SIGSEGV, &act, nullptr) != 0) std::abort();
+  sigset_t sigs;
+  if (sigemptyset (&sigs) != 0) std::abort();
+  if (sigaddset (&sigs, SIGSEGV) != 0) std::abort();
+  if (sigprocmask (SIG_UNBLOCK, &sigs, nullptr) != 0) std::abort();
+}
+
+template <typename CALLABLE>
+void expect_signal (CALLABLE code)
+{
+  // volatile to avoid gcc -Wclobbered warning.
+  volatile bool handled = false;
+  if (sigsetjmp (jmp, 0)) {
+    handled = true;
+  }
+  else {
+    setsig();
+    code();
+  }
+  resetsig();
+  assert (handled);
+}
+
+
+// protect
+void test6()
+{
+  std::cout << "test6\n";
+
+  SG::ArenaHeapSTLAllocator<Payload, int> b1;
+  Payload* p = b1.allocate (1);
+  p->x = 42;
+  b1.protect();
+  assert (p->x == 42);
+  expect_signal ([&]() { p->x = 43; });
+  b1.unprotect();
+  assert (p->x == 42);
+  p->x = 43;
+  assert (p->x == 43);
+
+  b1.protect();
+  SG::maybeUnprotect (b1);
+}
+
+
 int main()
 {
+  std::cout << "AthAllocators/ArenaHeapSTLAllocator_test\n";
   test1();
   test2();
   test3();
   test4();
   test5();
+  test6();
   return 0;
 }
diff --git a/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx b/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx
index 9ca0f7616ee9..0dae06d846aa 100644
--- a/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx
@@ -18,6 +18,8 @@
 #include <atomic>
 #include <set>
 #include <unordered_map>
+#include <setjmp.h>
+#include <signal.h>
 
 
 //==========================================================================
@@ -414,12 +416,77 @@ void test6()
 }
 
 
+jmp_buf jmp ATLAS_THREAD_SAFE;
+void handler (int)
+{
+  siglongjmp (jmp, 1);
+}
+void setsig()
+{
+  struct sigaction act;
+  act.sa_handler = handler;
+  sigemptyset (&act.sa_mask);
+  act.sa_flags = 0;
+  if (sigaction (SIGSEGV, &act, nullptr) != 0) std::abort();
+}
+void resetsig()
+{
+  struct sigaction act;
+  act.sa_handler = SIG_DFL;
+  sigemptyset (&act.sa_mask);
+  act.sa_flags = 0;
+  if (sigaction (SIGSEGV, &act, nullptr) != 0) std::abort();
+  sigset_t sigs;
+  if (sigemptyset (&sigs) != 0) std::abort();
+  if (sigaddset (&sigs, SIGSEGV) != 0) std::abort();
+  if (sigprocmask (SIG_UNBLOCK, &sigs, nullptr) != 0) std::abort();
+}
+
+template <typename CALLABLE>
+void expect_signal (CALLABLE code)
+{
+  // volatile to avoid gcc -Wclobbered warning.
+  volatile bool handled = false;
+  if (sigsetjmp (jmp, 0)) {
+    handled = true;
+  }
+  else {
+    setsig();
+    code();
+  }
+  resetsig();
+  assert (handled);
+}
+
+
+// Test protect().
+void test7()
+{
+  std::cout << "test7\n";
+  SG::ArenaPoolSTLAllocator<Payload, int> b1 (100, "b1");
+  Payload* p = b1.allocate (1);
+  p->x = 42;
+  b1.protect();
+  assert (p->x == 42);
+  expect_signal ([&]() { p->x = 43; });
+  b1.unprotect();
+  assert (p->x == 42);
+  p->x = 43;
+  assert (p->x == 43);
+
+  b1.protect();
+  SG::maybeUnprotect (b1);
+}
+
+
 int main()
 {
+  std::cout << "AthAllocators/ArenaPoolSTLAllocator_test\n";
   test1();
   test2();
   test3();
   test4();
   test6();
+  test7();
   return 0;
 }
diff --git a/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx b/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx
index 94b0c4b0d616..8c0d921e60c8 100644
--- a/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx
@@ -21,6 +21,8 @@
 #include <cassert>
 #include <iostream>
 #include <atomic>
+#include <setjmp.h>
+#include <signal.h>
 
 
 //==========================================================================
@@ -441,13 +443,78 @@ void test5()
 }
 
 
+jmp_buf jmp ATLAS_THREAD_SAFE;
+void handler (int)
+{
+  siglongjmp (jmp, 1);
+}
+void setsig()
+{
+  struct sigaction act;
+  act.sa_handler = handler;
+  sigemptyset (&act.sa_mask);
+  act.sa_flags = 0;
+  if (sigaction (SIGSEGV, &act, nullptr) != 0) std::abort();
+}
+void resetsig()
+{
+  struct sigaction act;
+  act.sa_handler = SIG_DFL;
+  sigemptyset (&act.sa_mask);
+  act.sa_flags = 0;
+  if (sigaction (SIGSEGV, &act, nullptr) != 0) std::abort();
+  sigset_t sigs;
+  if (sigemptyset (&sigs) != 0) std::abort();
+  if (sigaddset (&sigs, SIGSEGV) != 0) std::abort();
+  if (sigprocmask (SIG_UNBLOCK, &sigs, nullptr) != 0) std::abort();
+}
+
+template <typename CALLABLE>
+void expect_signal (CALLABLE code)
+{
+  // volatile to avoid gcc -Wclobbered warning.
+  volatile bool handled = false;
+  if (sigsetjmp (jmp, 0)) {
+    handled = true;
+  }
+  else {
+    setsig();
+    code();
+  }
+  resetsig();
+  assert (handled);
+}
+
+
+// Test protect().
+void test6()
+{
+  std::cout << "test6\n";
+  SG::ArenaSharedHeapSTLAllocator<Payload> b1 (100);
+  Payload* p = b1.allocate (1);
+  p->x = 42;
+  b1.protect();
+  assert (p->x == 42);
+  expect_signal ([&]() { p->x = 43; });
+  b1.unprotect();
+  assert (p->x == 42);
+  p->x = 43;
+  assert (p->x == 43);
+
+  b1.protect();
+  SG::maybeUnprotect (b1);
+}
+
+
 int main()
 {
+  std::cout << "AthAllocators/ArenaSharedHeapSTLAllocator_test\n";
   test1();
   test2();
   test3();
   test4();
   test5();
+  test6();
   assert (SG::ArenaBlock::nactive() == 0);
   return 0;
 }
diff --git a/Control/AthAllocators/test/exceptions_test.cxx b/Control/AthAllocators/test/exceptions_test.cxx
index 59d598b264af..b52c3a8e88a4 100644
--- a/Control/AthAllocators/test/exceptions_test.cxx
+++ b/Control/AthAllocators/test/exceptions_test.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 AthAllocators/test/exceptions_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -21,6 +19,8 @@ void test1()
   std::cout << "test1\n";
 
   std::cout << SG::ExcDifferentArenas().what() << "\n";
+  std::cout << SG::ExcProtection(EINVAL).what() << "\n";
+  std::cout << SG::ExcProtected().what() << "\n";
 }
 
 
-- 
GitLab


From 30e77e9e06059b5c63e67d3eb7fa1a22e41433a6 Mon Sep 17 00:00:00 2001
From: Andrew Mehta <andrew.mehta@cern.ch>
Date: Thu, 16 Sep 2021 13:49:41 +0200
Subject: [PATCH 141/347] Update version.txt

---
 Projects/AnalysisBase/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/AnalysisBase/version.txt b/Projects/AnalysisBase/version.txt
index 4e6c0846b4b0..0225b4b60b12 100644
--- a/Projects/AnalysisBase/version.txt
+++ b/Projects/AnalysisBase/version.txt
@@ -1 +1 @@
-22.2.42
+22.2.43
-- 
GitLab


From 95773e92ca7440327265048cd759e95076be5118 Mon Sep 17 00:00:00 2001
From: Andrew Mehta <andrew.mehta@cern.ch>
Date: Thu, 16 Sep 2021 13:50:14 +0200
Subject: [PATCH 142/347] Update version.txt

---
 Projects/AthAnalysis/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/AthAnalysis/version.txt b/Projects/AthAnalysis/version.txt
index 4e6c0846b4b0..0225b4b60b12 100644
--- a/Projects/AthAnalysis/version.txt
+++ b/Projects/AthAnalysis/version.txt
@@ -1 +1 @@
-22.2.42
+22.2.43
-- 
GitLab


From 7b124e5ab701508d20ea6d21e4cfc81457091bce Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Thu, 16 Sep 2021 15:05:01 +0200
Subject: [PATCH 143/347] convert to all-unique_ptr c'tor for TSoS

---
 .../AthenaPoolTest/src/FakeTrackBuilder.cxx   | 42 ++++++++-----------
 1 file changed, 18 insertions(+), 24 deletions(-)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/FakeTrackBuilder.cxx b/AtlasTest/DatabaseTest/AthenaPoolTest/src/FakeTrackBuilder.cxx
index 5a9a4b87c6d0..40fc9bd544c7 100644
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/FakeTrackBuilder.cxx
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/FakeTrackBuilder.cxx
@@ -39,6 +39,7 @@
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
 
 #include "GeoPrimitives/GeoPrimitives.h"
+#include <memory>
 
 
 Trk::Track* FakeTrackBuilder::buildTrack(const InDetDD::SiDetectorElementCollection* elements) {
@@ -48,38 +49,32 @@ Trk::Track* FakeTrackBuilder::buildTrack(const InDetDD::SiDetectorElementCollect
   //std::cout<<counter++<<std::endl;
   auto trackStateOnSurfaces = DataVector<const Trk::TrackStateOnSurface>();
   PerigeeSurface periSurf;
-  const RIO_OnTrack*              rot            = nullptr;
-  const TrackParameters*          trackParameter = new Perigee(4.0, 3.0, 2.0, 1.0, 0.001, periSurf);
-  const FitQuality*               fitQoS         = nullptr;
-  const MaterialEffectsBase*      mefBase        = nullptr;
-
-  trackStateOnSurfaces.push_back( new TrackStateOnSurface(rot, trackParameter, fitQoS,  mefBase) );
+  auto           trackParameter = std::make_unique<Perigee>(4.0, 3.0, 2.0, 1.0, 0.001, periSurf);
+  //parameters to TrackStateOnSurface are unique_ptr to: RIO_OnTrack, TrackParameters, FitQuality, MaterialEffectsBase
+  trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter), nullptr,  nullptr) );
 
   //std::cout<<counter++<<std::endl;
 
   // test state #1 - arbitrary TP AtaCylinder
   Trk::CylinderSurface surface(1.0, 2*M_PI, 4.0);
-  trackParameter = surface.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt).release();
-  trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, trackParameter, nullptr,  nullptr) );
+  auto trackParameter2=surface.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt);
+  trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter2), nullptr,  nullptr) );
 
   // test state #2 - arbitrary TP AtaDisc
   Amg::Translation3D amgtranslation(1.,2.,3.);
   Amg::Transform3D amgTransf = Amg::Transform3D(amgtranslation);
   DiscSurface discSf(amgTransf, 1.0, 2.0);
-  trackParameter = discSf.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt).release();
-  trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, trackParameter, nullptr,  nullptr) );
+  auto trackParameter3 = discSf.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt);
+  trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter3), nullptr,  nullptr) );
 
   // test state #3 - arbitrary AtaPlane + Estimated Brem
   Amg::Transform3D amgTransf2(amgtranslation);
   PlaneSurface planeSf(amgTransf2, 1.0, 2.0);
-  trackParameter = planeSf.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt).release();
-  const MaterialEffectsBase *ebr
-    = new EstimatedBremOnTrack((0.7), -0.3,
-  0.3, 0.03,
-  planeSf);
+  auto trackParameter4 = planeSf.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt);
+  auto ebr = std::make_unique<EstimatedBremOnTrack>((0.7), -0.3,0.3, 0.03,planeSf);
   std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> type1(0);
   type1.set(Trk::TrackStateOnSurface::BremPoint);
-  trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, trackParameter, nullptr,  ebr,type1) );
+  trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter4), nullptr,  std::move(ebr),type1) );
 
   if (elements){
     // test state #4 - AtaPlane at a valid detector element + MatEffects
@@ -97,21 +92,21 @@ Trk::Track* FakeTrackBuilder::buildTrack(const InDetDD::SiDetectorElementCollect
 
     //AtaPlane on det el
     const PlaneSurface& planeDetElSf = dynamic_cast<const PlaneSurface&>(detEl->surface());
-    trackParameter = planeDetElSf.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt).release();
+    auto trackParameter5 = planeDetElSf.createUniqueParameters<5,Trk::Charged>(0.0,1.0,3.0,4.0,0.5,std::nullopt);
 
-    mefBase = new Trk::MaterialEffectsOnTrack(70.7,std::move(scatt),eloss,planeDetElSf, mefPattern);
+    auto mefBase = std::make_unique<Trk::MaterialEffectsOnTrack>(70.7,std::move(scatt),eloss,planeDetElSf, mefPattern);
     std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
     typePattern.set(Trk::TrackStateOnSurface::Scatterer);
-    trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, trackParameter, nullptr, mefBase,  typePattern) );
+    trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter5), nullptr, std::move(mefBase),  typePattern) );
   }
   //Curvi
   Amg::Vector3D pos(1.0,2.0,3.0);
   Amg::Vector3D mom(4.0,5.0,6.0);
 
-  trackParameter = new CurvilinearParameters(pos,mom,1.0);
+  auto trackParameter6 = std::make_unique<CurvilinearParameters>(pos,mom,1.0);
   std::bitset<TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
   typePattern.set(Trk::TrackStateOnSurface::Parameter);
-  trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, trackParameter, nullptr, nullptr,  typePattern) );
+  trackStateOnSurfaces.push_back( new TrackStateOnSurface(nullptr, std::move(trackParameter6), nullptr, nullptr,  typePattern) );
   
   AmgSymMatrix(2)  locCov;
   locCov.setIdentity();           // sets it to identity
@@ -148,10 +143,9 @@ Trk::Track* FakeTrackBuilder::buildTrack(const InDetDD::SiDetectorElementCollect
         = new std::vector<double>;
       assgnProb->push_back(0.4);
       assgnProb->push_back(0.6);
-      InDet::CompetingPixelClustersOnTrack* cProt
-        = new InDet::CompetingPixelClustersOnTrack(childrots,assgnProb);
+      auto cProt= std::make_unique<InDet::CompetingPixelClustersOnTrack>(childrots,assgnProb);
       trackStateOnSurfaces.push_back( new TrackStateOnSurface(
-        cProt,nullptr,nullptr,nullptr));
+        std::move(cProt),nullptr,nullptr,nullptr));
     }
   }
   //std::cout<<counter++<<std::endl;
-- 
GitLab


From eacaf806756b4f3af316a427a5854ee2db8186f9 Mon Sep 17 00:00:00 2001
From: Edward Moyse <edward.moyse@cern.ch>
Date: Thu, 16 Sep 2021 15:33:40 +0200
Subject: [PATCH 144/347] Removed commented verbose.

---
 .../VP1/VP1Systems/VP1TrackSystems/src/TrackCollHandleBase.cxx   | 1 -
 1 file changed, 1 deletion(-)

diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollHandleBase.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollHandleBase.cxx
index 864eb1c0957d..53b7213dedf4 100644
--- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollHandleBase.cxx
+++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackCollHandleBase.cxx
@@ -318,7 +318,6 @@ bool TrackCollHandleBase::cut(TrackHandleBase* handle)
    if (m_cut_etaptphi_allwillfail)
     return false;
 
-  // messageVerbose("TrackCollHandleBase::cut - checking hit cuts.");
   if (mightHaveSubSystemHitInfo()&&!m_cut_requiredNHits.isEmpty()&&handle->hasSubSystemHitInfo()) {
     //assert(m_cut_requiredNHits.count()==4); // for old code
     assert(m_cut_requiredNHits.count()==5);
-- 
GitLab


From a1d9c2e589c174bc361d63e0bb749bac371394c0 Mon Sep 17 00:00:00 2001
From: Peter Berta <peter.berta@cern.ch>
Date: Thu, 16 Sep 2021 11:35:34 +0200
Subject: [PATCH 145/347] Merge branch 'master-DQegamma_07092021_for22.0-mc20'
 into '22.0-mc20'

Urgent - Master dqegamma 07092021 for22.0 mc20

See merge request atlas/athena!46488

(cherry picked from commit 01eb11871934dfcaf316e0c6f4b736caaa524066)

51262cd6 Bugfix to take into account possible multi chain setup for TnP monitors
4841e140 Bugfix to remove the trigger requirement of TnP monitors
4fdb1eec New trigger setup for JPsi and no trigger for Zee (TnP monitors)
401990f9 Bug fix on the TnP configuration
---
 .../python/SetupEgammaMonitoring.py           | 39 ++++++++++++-------
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py b/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py
index a3c7e65039d3..d0a142fd8543 100755
--- a/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py
+++ b/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py
@@ -2,12 +2,14 @@
 #  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 
-'''@file SetupEgammaMonitoring.py
+'''
+@file SetupEgammaMonitoring.py
 @author B. Laforge
 4 May 2020
 @brief Example python configuration for the Run III AthenaMonitoring package
 '''
 from AthenaConfiguration.ComponentFactory import CompFactory
+import TrigEgammaMonitoring.TrigEgammaMonitCategory as egammaConf
 
 def BookHistogramsPerRegions(thegroupe,theparttype,thename,title,path,xbins,xmin,xmax,thetype="TH1F",thecut="is_pt_gt_4gev"):
     '''
@@ -601,8 +603,6 @@ def MonitorElectronConfig(inputFlags):
     ### STEP 3 ###
     # Edit properties of algorithms
 
-    import TrigEgammaMonitoring.TrigEgammaMonitCategory as egammaConf
-
     elLHTightMonAlg.ParticleContainerName = "Electrons"
     elLHTightMonAlg.RecoName = "LHTight"
     elLHTightMonAlg.ParticlePrefix = "electron"
@@ -705,8 +705,6 @@ def MonitorPhotonConfig(inputFlags):
     ### STEP 3 ###
     # Edit properties of algorithms
 
-    import TrigEgammaMonitoring.TrigEgammaMonitCategory as egammaConf
-
     phCBTightMonAlg.ParticleContainerName = "Photons"
     phCBTightMonAlg.RecoName = "Tight"
     phCBTightMonAlg.ParticlePrefix = "photon"
@@ -770,8 +768,6 @@ def MonitorTnPConfig(inputFlags):
     ### STEP 3 ###
     # Edit properties of algorithms
 
-    import TrigEgammaMonitoring.TrigEgammaMonitCategory as egammaConf
-
     ZeeMonAlg.ParticleContainerName = "Electrons"
     ZeeMonAlg.RecoName = "LHLoose"
     ZeeMonAlg.ParticlePrefix = "electron"
@@ -780,17 +776,33 @@ def MonitorTnPConfig(inputFlags):
     ZeeMonAlg.MassLowerCut = 70000.
     ZeeMonAlg.MassUpperCut = 110000.
     ZeeMonAlg.TnPType = "Z"
-    ZeeMonAlg.TriggerChain = egammaConf.monitoring_Zee[0]
+
+    # get trigger chain from egammaConf.monitoring_Zee
+    chain=""
+    for el in egammaConf.monitoring_Zee:
+        if chain != "":
+            chain = chain + ", " + el
+        else :
+            chain = el
+    #ZeeMonAlg.TriggerChain = chain
 
     JPsiMonAlg.ParticleContainerName = "Electrons"
     JPsiMonAlg.RecoName = "LHLoose"
     JPsiMonAlg.ParticlePrefix = "electron"
     JPsiMonAlg.MassPeak = 3097.
     JPsiMonAlg.ElectronEtCut = 3000.
-    JPsiMonAlg.MassLowerCut = 2500.
-    JPsiMonAlg.MassUpperCut = 3500.
+    JPsiMonAlg.MassLowerCut = 2000.
+    JPsiMonAlg.MassUpperCut = 5000.
     JPsiMonAlg.TnPType = "JPsi"
-    JPsiMonAlg.TriggerChain =egammaConf.monitoring_Jpsiee[0]
+
+    # get trigger chain from egammaConf.monitoring_Jpsiee
+    chain =""
+    for el in egammaConf.monitoring_Jpsiee:
+        if chain != "":
+            chain = chain + ", " + el
+        else :
+            chain = el
+    JPsiMonAlg.TriggerChain = chain
 
     ### STEP 4 ###
 
@@ -836,8 +848,6 @@ def MonitorForwardElectronConfig(inputFlags):
     ### STEP 3 ###
     # Edit properties of algorithms
 
-    import TrigEgammaMonitoring.TrigEgammaMonitCategory as egammaConf
-
     # fwdelLHTightMonAlg.ParticleContainerName = "ForwardElectrons"
     # fwdelLHTightMonAlg.RecoName = "LHTight"
     # fwdelLHTightMonAlg.ParticlePrefix = "FwdElectron"
@@ -931,7 +941,7 @@ if __name__=='__main__':
     from AthenaCommon.Logging import log
     from AthenaCommon.Constants import INFO
     log.setLevel(INFO)
-
+    
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
@@ -970,6 +980,7 @@ if __name__=='__main__':
     #MonitorElectronAcc.getEventAlgo('elLHLooseMonAlg').OutputLevel = 2 # 2 = DEBUG
     #MonitorPhotonAcc.getEventAlgo('phCBLooseMonAlg').OutputLevel = 2 # 2 = DEBUG
     #MonitorTnPAcc.getEventAlgo('TnPZeeMonAlg').OutputLevel = 2 # 2 = DEBUG
+    #MonitorTnPAcc.getEventAlgo('TnPJpsiMonAlg').OutputLevel = 2 # 2 = DEBUG
     #MonitorFwdElectronAcc.getEventAlgo('fwdelCBTightMonAlg').OutputLevel = 2 # 2 = DEBUG
 
     MonitorFwdElectronAcc = MonitorForwardElectronConfig(ConfigFlags)
-- 
GitLab


From d3658df08e59c9da05ba0dce1fa2e6fb9e567618 Mon Sep 17 00:00:00 2001
From: Teng Jian Khoo <teng.jian.khoo@cern.ch>
Date: Thu, 16 Sep 2021 16:17:23 +0200
Subject: [PATCH 146/347] Implement capability to disable chains in a menu from
 the command line

---
 .../TriggerJobOpts/share/runHLT_standalone.py       |  3 +++
 .../python/HLTMenuConfig/Menu/GenerateMenuMT.py     | 13 +++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index ba04783d7f8b..67b24ec53b01 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -69,6 +69,7 @@ class opt:
     enabledSignatures = []
     disabledSignatures = []
     selectChains      = []
+    disableChains     = []
 
 
 #
@@ -508,6 +509,8 @@ if not opt.createHLTMenuExternally:
 
     if (opt.selectChains):
         menu.selectChainsForTesting = opt.selectChains
+    elif (opt.disableChains):
+        menu.disableChains = opt.disableChains
 
     # generating the HLT structure requires
     # the HLTSeeding to be defined in the topSequence
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index 7387a2487f98..6f9bc3ca904f 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -54,6 +54,7 @@ class GenerateMenuMT(object, metaclass=Singleton):
         self.chainsInMenu = []
         self.listOfErrorChainDefs = []
         self.selectChainsForTesting = []
+        self.disableChains = []
         
         self.allChainsForAlignment = []
         self.chainDicts = []
@@ -359,6 +360,18 @@ class GenerateMenuMT(object, metaclass=Singleton):
                 raise Exception("[getChainsFromMenu] Cannot test one or more requested chains, exiting.")
             chains = selectedChains
 
+        if self.disableChains:
+            if self.selectChainsForTesting:
+                log.error("Either select chains or disable chains, not both. Will not proceed.")
+                raise Exception("[getChainsFromMenu] Both selectChains and disableChains options provided -- potential conflict!")
+            log.info("Eliminating chains from the menu")
+            chainNames = [ch.name for ch in chains]
+            missingNames = [ch for ch in self.disableChains if ch not in chainNames]
+            if missingNames:
+                log.warning("The following chains were specified in disableChains but were not found in the menu: %s", str(missingNames))
+            selectedChains = [ch for ch in chains if ch.name not in self.disableChains]
+            chains = selectedChains
+
         if len(chains) == 0:
             log.warning("There seem to be no chains in the menu - please check")
         else:
-- 
GitLab


From 6f9338789df807d62ecf260cb91894dce42b75f7 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Sun, 13 Sep 2020 02:43:32 +0200
Subject: [PATCH 147/347] For miha

---
 .../GeoSpecialShapes/LArWheelCalculator.h     |   4 +-
 .../vec_parametrized_sincos.h                 | 166 ++++++++++++++++++
 .../LArWheelCalculator_Impl/sincos_poly.cxx   | 162 +++++++++++------
 3 files changed, 273 insertions(+), 59 deletions(-)
 create mode 100644 DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h

diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
index fa5ffa628579..eb194b740f5f 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
@@ -11,7 +11,7 @@
 #ifndef XAOD_STANDALONE
     #include "AthenaKernel/CLASS_DEF.h"
 #endif // XAOD_STANDALONE
-
+#include "vec_parametrized_sincos.h"
 #include "GeoSpecialShapes/LArWheelCalculatorEnums.h"
 
 #define LARWC_SINCOS_POLY 5
@@ -207,8 +207,8 @@ class LArWheelCalculator
 
     LArWheelCalculator_Impl::IDistanceCalculator *m_distanceCalcImpl;
     LArWheelCalculator_Impl::IFanCalculator *m_fanCalcImpl;
-
     void fill_sincos_parameterization();
+    vsincos_par m_vsincos_par{};
 };
 
 #ifndef XAOD_STANDALONE
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h
new file mode 100644
index 000000000000..d4ce048d8550
--- /dev/null
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h
@@ -0,0 +1,166 @@
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @brief vectorized version of parametrized sincos
+ * @ author Miha Muskinja, Chistos
+ */
+#ifndef VEC_PARAMETRIZED_SINCOS_H
+#define VEC_PARAMETRIZED_SINCOS_H
+
+#include "CxxUtils/features.h"
+#include "CxxUtils/restrict.h"
+#include "CxxUtils/vec.h"
+struct vsincos_par
+{
+
+  alignas(32) double sincos_parametrization[3][4] = {};
+
+#if HAVE_FUNCTION_MULTIVERSIONING
+#if defined(__x86_64__)
+
+  __attribute__((target("avx2,fma")))
+
+  void
+  evaluate(const double r,
+           double& ATH_RESTRICT sin_a,
+           double& ATH_RESTRICT cos_a) const ATH_RESTRICT
+  {
+    // P0 = s4x^4 + s2x^2 + s0
+    // P1 = s5x^4 + s3x^3 + s1
+    // P2 = c4x^4 + c2x^2 + c0
+    // P3 = c5x^4 + c3x^2 + c1
+
+    // [s4, s5, c4, c5]
+    const double r2 = r * r;
+    CxxUtils::vec<double, 4> P = {
+      sincos_parametrization[0][0],
+      sincos_parametrization[0][1],
+      sincos_parametrization[0][2],
+      sincos_parametrization[0][3],
+    };
+
+    // [s4, s5, c4, c5] * r2 * r2
+    // +
+    // [s2, s3, c3, c3] * r2
+    // +
+    // s0, s1, c0, c1
+    CxxUtils::vec<double, 4> param_1 = {
+      sincos_parametrization[1][0],
+      sincos_parametrization[1][1],
+      sincos_parametrization[1][2],
+      sincos_parametrization[1][3],
+    };
+    CxxUtils::vec<double, 4> param_2 = {
+      sincos_parametrization[2][0],
+      sincos_parametrization[2][1],
+      sincos_parametrization[2][2],
+      sincos_parametrization[2][3],
+    };
+
+    P = r2 * P + param_1;
+    P = r2 * P + param_2;
+    CxxUtils::vec<double, 4> P2 = { P[1], P[0], P[3], P[2] };
+    CxxUtils::vec<double, 4> res = r * P2 + P;
+    sin_a = res[0];
+    cos_a = res[2];
+  }
+
+  __attribute__((target("avx2")))
+
+  void
+  eval(const double r,
+       double& ATH_RESTRICT sin_a,
+       double& ATH_RESTRICT cos_a) const ATH_RESTRICT
+  {
+    // P0 = s4x^4 + s2x^2 + s0
+    // P1 = s5x^4 + s3x^3 + s1
+    // P2 = c4x^4 + c2x^2 + c0
+    // P3 = c5x^4 + c3x^2 + c1
+
+    // [s4, s5, c4, c5]
+    const double r2 = r * r;
+    CxxUtils::vec<double, 4> P = {
+      sincos_parametrization[0][0],
+      sincos_parametrization[0][1],
+      sincos_parametrization[0][2],
+      sincos_parametrization[0][3],
+    };
+
+    // [s4, s5, c4, c5] * r2 * r2
+    // +
+    // [s2, s3, c3, c3] * r2
+    // +
+    // s0, s1, c0, c1
+    CxxUtils::vec<double, 4> param_1 = {
+      sincos_parametrization[1][0],
+      sincos_parametrization[1][1],
+      sincos_parametrization[1][2],
+      sincos_parametrization[1][3],
+    };
+    CxxUtils::vec<double, 4> param_2 = {
+      sincos_parametrization[2][0],
+      sincos_parametrization[2][1],
+      sincos_parametrization[2][2],
+      sincos_parametrization[2][3],
+    };
+
+    P = r2 * P + param_1;
+    P = r2 * P + param_2;
+    CxxUtils::vec<double, 4> P2 = { P[1], P[0], P[3], P[2] };
+    CxxUtils::vec<double, 4> res = r * P2 + P;
+    sin_a = res[0];
+    cos_a = res[2];
+  }
+
+  __attribute__((target("default")))
+#endif // x86
+#endif // FMV
+
+  void
+  eval(const double r,
+       double& ATH_RESTRICT sin_a,
+       double& ATH_RESTRICT cos_a) const ATH_RESTRICT
+  {
+    // P0 = s4x^4 + s2x^2 + s0
+    // P1 = s5x^4 + s3x^3 + s1
+    // P2 = c4x^4 + c2x^2 + c0
+    // P3 = c5x^4 + c3x^2 + c1
+
+    // [s4, s5, c4, c5]
+    const double r2 = r * r;
+    CxxUtils::vec<double, 4> P = {
+      sincos_parametrization[0][0],
+      sincos_parametrization[0][1],
+      sincos_parametrization[0][2],
+      sincos_parametrization[0][3]
+    };
+
+    // [s4, s5, c4, c5] * r2 * r2
+    // +
+    // [s2, s3, c3, c3] * r2
+    // +
+    // s0, s1, c0, c1
+    CxxUtils::vec<double, 4> param_1 = {
+      sincos_parametrization[1][0],
+      sincos_parametrization[1][1],
+      sincos_parametrization[1][2],
+      sincos_parametrization[1][3]
+    };
+    CxxUtils::vec<double, 4> param_2 = {
+      sincos_parametrization[2][0],
+      sincos_parametrization[2][1],
+      sincos_parametrization[2][2],
+      sincos_parametrization[2][3]
+    };
+
+    P = r2 * P + param_1;
+    P = r2 * P + param_2;
+    sin_a = r * P[1] + P[0];
+    cos_a = r * P[3] + P[2];
+  }
+};
+
+#endif
+
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
index 8b277aecf824..8c14cda669db 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
@@ -8,28 +8,29 @@
 
 #include "CLHEP/Units/SystemOfUnits.h"
 
+#include "TDecompLU.h"
+#include "TDecompSVD.h"
 #include "TMath.h"
 #include "TMatrixD.h"
-#include "TVectorD.h"
 #include "TMatrixDLazy.h"
-#include "TDecompLU.h"
-#include "TDecompSVD.h"
+#include "TVectorD.h"
 
-#include <sys/time.h>
-#include <iostream>
 #include <iomanip>
+#include <iostream>
 #include <math.h>
 #include <mutex>
+#include <sys/time.h>
 
 #define DEBUGPRINT 0
 
 template<typename T>
-std::ostream & operator << (std::ostream & ostr, const TVectorT<T> & v)
+std::ostream&
+operator<<(std::ostream& ostr, const TVectorT<T>& v)
 {
   std::ios_base::fmtflags save_flags(ostr.flags());
   ostr << '[';
   ostr << std::scientific;
-  for(Int_t idx=v.GetLwb();idx<v.GetUpb();idx++) {
+  for (Int_t idx = v.GetLwb(); idx < v.GetUpb(); idx++) {
     ostr << v[idx] << ", ";
   }
   ostr << v[v.GetUpb()];
@@ -38,41 +39,44 @@ std::ostream & operator << (std::ostream & ostr, const TVectorT<T> & v)
   return ostr;
 }
 
-
-// find best approximation of y values using linear combination of basis functions in bf
-static TVectorD findLinearApproximation(
-    const Int_t dataLen, const Int_t nBasisFuntions,
-    const TVectorD &y, const TMatrixD & bf)
+// find best approximation of y values using linear combination of basis
+// functions in bf
+static TVectorD
+findLinearApproximation(const Int_t dataLen,
+                        const Int_t nBasisFuntions,
+                        const TVectorD& y,
+                        const TMatrixD& bf)
 {
   TMatrixDSym A(nBasisFuntions);
   TVectorD vY(nBasisFuntions);
 
-  for(Int_t j = 0; j < nBasisFuntions; ++ j){
-    for(Int_t k = 0; k < nBasisFuntions; ++ k){
+  for (Int_t j = 0; j < nBasisFuntions; ++j) {
+    for (Int_t k = 0; k < nBasisFuntions; ++k) {
       Double_t Ajk = 0.0;
-      for(Int_t i = 0; i < dataLen; ++ i){
+      for (Int_t i = 0; i < dataLen; ++i) {
         Ajk += bf(j, i) * bf(k, i);
       }
       A(j, k) = Ajk;
     }
   }
 
-  for(Int_t k = 0; k < nBasisFuntions; ++ k){
+  for (Int_t k = 0; k < nBasisFuntions; ++k) {
     Double_t vYk = 0.0;
-    for(Int_t i = 0; i < dataLen; ++ i){
-      vYk += y[i]*bf(k,i);
+    for (Int_t i = 0; i < dataLen; ++i) {
+      vYk += y[i] * bf(k, i);
     }
     vY[k] = vYk;
   }
 
   TMatrixDSym Ainv(A);
   Ainv.Invert();
-  return Ainv*vY;
+  return Ainv * vY;
 }
 
 using namespace CLHEP;
 
-void LArWheelCalculator::fill_sincos_parameterization()
+void
+LArWheelCalculator::fill_sincos_parameterization()
 {
   const Int_t nrPolyDegree = LARWC_SINCOS_POLY;
 #if LARWC_SINCOS_POLY > 4 && DEBUGPRINT
@@ -92,37 +96,56 @@ void LArWheelCalculator::fill_sincos_parameterization()
   static double cos_parametrization[2][nBasisFunctions];
 
   // Reuse the computation if already performed
-  size_t S = m_isInner? 0: 1;
-  if(filled[S]){
-    for(Int_t i = 0; i < nBasisFunctions; ++ i){
+  size_t S = m_isInner ? 0 : 1;
+  if (filled[S]) {
+    for (Int_t i = 0; i < nBasisFunctions; ++i) {
       m_sin_parametrization[i] = sin_parametrization[S][i];
       m_cos_parametrization[i] = cos_parametrization[S][i];
     }
+    // To Miha not  sure this is the right order just assuem here
+    // s4, s5, c4, c5
+    // s2, s3, c2, c3
+    // s0, s1, c0, c1
+    m_vsincos_par.sincos_parametrization[0][1] = m_sin_parametrization[4];
+    m_vsincos_par.sincos_parametrization[0][1] = m_sin_parametrization[5];
+    m_vsincos_par.sincos_parametrization[0][2] = m_cos_parametrization[4];
+    m_vsincos_par.sincos_parametrization[0][3] = m_cos_parametrization[5];
+    m_vsincos_par.sincos_parametrization[1][0] = m_sin_parametrization[2];
+    m_vsincos_par.sincos_parametrization[1][1] = m_sin_parametrization[3];
+    m_vsincos_par.sincos_parametrization[1][2] = m_cos_parametrization[2];
+    m_vsincos_par.sincos_parametrization[1][3] = m_cos_parametrization[3];
+    m_vsincos_par.sincos_parametrization[2][0] = m_sin_parametrization[0];
+    m_vsincos_par.sincos_parametrization[2][1] = m_sin_parametrization[1];
+    m_vsincos_par.sincos_parametrization[2][2] = m_cos_parametrization[0];
+    m_vsincos_par.sincos_parametrization[2][3] = m_cos_parametrization[1];
     return;
   }
 
-  //const Double_t Rmin = m_isInner? 290.*mm: 600.*mm;
-  //const Double_t Rmax = m_isInner? 710.*mm: 2050.*mm;
-  const Double_t Rmin = m_isInner? 250.*mm: 560.*mm;
-  const Double_t Rmax = m_isInner? 750.*mm: 2090.*mm;
-  //const Double_t Rmin = m_isInner? 220.*mm: 530.*mm;
-  //const Double_t Rmax = m_isInner? 780.*mm: 2120.*mm;
-  const Double_t Rstep = 1.*mm;
-  const Int_t nrPoints = (Rmax - Rmin) * (1./Rstep);
+  // const Double_t Rmin = m_isInner? 290.*mm: 600.*mm;
+  // const Double_t Rmax = m_isInner? 710.*mm: 2050.*mm;
+  const Double_t Rmin = m_isInner ? 250. * mm : 560. * mm;
+  const Double_t Rmax = m_isInner ? 750. * mm : 2090. * mm;
+  // const Double_t Rmin = m_isInner? 220.*mm: 530.*mm;
+  // const Double_t Rmax = m_isInner? 780.*mm: 2120.*mm;
+  const Double_t Rstep = 1. * mm;
+  const Int_t nrPoints = (Rmax - Rmin) * (1. / Rstep);
   const Int_t dataLen = nrPoints + 1;
 
-  TVectorD x(dataLen);  // angle points
-  TVectorD ysin(dataLen);  // to be approximated function values at angle points - sin
-  TVectorD ycos(dataLen);  // to be approximated function values at angle points - cos
-  TMatrixD bf(nBasisFunctions, dataLen); // Matrix of values of basis functions at angle points
+  TVectorD x(dataLen); // angle points
+  TVectorD ysin(
+    dataLen); // to be approximated function values at angle points - sin
+  TVectorD ycos(
+    dataLen); // to be approximated function values at angle points - cos
+  TMatrixD bf(nBasisFunctions,
+              dataLen); // Matrix of values of basis functions at angle points
 
-  for(Int_t i = 0; i < dataLen; ++ i){
+  for (Int_t i = 0; i < dataLen; ++i) {
     const Double_t a = Rmin + i * Rstep;
     x[i] = a;
     CxxUtils::sincos scalpha(parameterized_slant_angle(a));
     ysin[i] = scalpha.sn;
     ycos[i] = scalpha.cs;
-    for(Int_t n = 0; n < nBasisFunctions; ++ n) {
+    for (Int_t n = 0; n < nBasisFunctions; ++n) {
       bf(n, i) = pow(a, n);
     }
   }
@@ -132,13 +155,29 @@ void LArWheelCalculator::fill_sincos_parameterization()
   TVectorD params_cos =
     findLinearApproximation(dataLen, nBasisFunctions, ycos, bf);
 
-  for(Int_t i = 0; i < nBasisFunctions; ++ i){
+  for (Int_t i = 0; i < nBasisFunctions; ++i) {
     m_sin_parametrization[i] = params_sin[i];
     m_cos_parametrization[i] = params_cos[i];
     sin_parametrization[S][i] = params_sin[i];
     cos_parametrization[S][i] = params_cos[i];
   }
 
+  // To Miha not  sure this is the right order just assuem here
+  // s4, s5, c4, c5
+  // s2, s3, c2, c3
+  // s0, s1, c0, c1
+  m_vsincos_par.sincos_parametrization[0][1] = m_sin_parametrization[4];
+  m_vsincos_par.sincos_parametrization[0][1] = m_sin_parametrization[5];
+  m_vsincos_par.sincos_parametrization[0][2] = m_cos_parametrization[4];
+  m_vsincos_par.sincos_parametrization[0][3] = m_cos_parametrization[5];
+  m_vsincos_par.sincos_parametrization[1][0] = m_sin_parametrization[2];
+  m_vsincos_par.sincos_parametrization[1][1] = m_sin_parametrization[3];
+  m_vsincos_par.sincos_parametrization[1][2] = m_cos_parametrization[2];
+  m_vsincos_par.sincos_parametrization[1][3] = m_cos_parametrization[3];
+  m_vsincos_par.sincos_parametrization[2][0] = m_sin_parametrization[0];
+  m_vsincos_par.sincos_parametrization[2][1] = m_sin_parametrization[1];
+  m_vsincos_par.sincos_parametrization[2][2] = m_cos_parametrization[0];
+  m_vsincos_par.sincos_parametrization[2][3] = m_cos_parametrization[1];
   filled[S] = true;
 
   // FIXME: nothing below is needed unless debug printing
@@ -153,26 +192,26 @@ void LArWheelCalculator::fill_sincos_parameterization()
 
   double dsin = 0., dcos = 0.;
   double dtrig = 0.;
-  for(double r = Rmin + 40.; r < Rmax - 40.; r += Rstep / 10.){
+  for (double r = Rmin + 40.; r < Rmax - 40.; r += Rstep / 10.) {
     CxxUtils::sincos scalpha(parameterized_slant_angle(r));
     double sin_a, cos_a;
     parameterized_sincos(r, sin_a, cos_a);
     double ds = fabs(scalpha.sn - sin_a);
-    if(ds > dsin){
+    if (ds > dsin) {
       dsin = ds;
 #if DEBUGPRINT
       dsinr = r;
 #endif
     }
     double dc = fabs(scalpha.cs - cos_a);
-    if(dc > dcos){
+    if (dc > dcos) {
       dcos = dc;
 #if DEBUGPRINT
       dcosr = r;
 #endif
     }
-    double dt = fabs(sin_a*sin_a + cos_a*cos_a - 1.);
-    if(dt > dtrig){
+    double dt = fabs(sin_a * sin_a + cos_a * cos_a - 1.);
+    if (dt > dtrig) {
       dtrig = dt;
 #if DEBUGPRINT
       dtrigr = r;
@@ -189,36 +228,45 @@ void LArWheelCalculator::fill_sincos_parameterization()
 
 #ifdef HARDDEBUG
   TVectorD y_test(dataLen);
-  const Int_t nIter=10000;
-  std::cout << "Perfomance test started, " << nIter << " iterations" << std::endl;
+  const Int_t nIter = 10000;
+  std::cout << "Perfomance test started, " << nIter << " iterations"
+            << std::endl;
 
   double y_testsin[dataLen];
   double y_testcos[dataLen];
   struct timeval tvsincos_start, tvsincos_stop;
   gettimeofday(&tvsincos_start, 0);
-  for(Int_t iIter=0;iIter<nIter;iIter++) {
-    for(Int_t i=0;i<dataLen;i++) {
+  for (Int_t iIter = 0; iIter < nIter; iIter++) {
+    for (Int_t i = 0; i < dataLen; i++) {
       sincos(parameterized_slant_angle(x[i]), &y_testsin[i], &y_testcos[i]);
     }
   }
   gettimeofday(&tvsincos_stop, 0);
-  double timeSinCos=(tvsincos_stop.tv_sec-tvsincos_start.tv_sec + 1E-6*(tvsincos_stop.tv_usec-tvsincos_start.tv_usec))/nIter;
+  double timeSinCos =
+    (tvsincos_stop.tv_sec - tvsincos_start.tv_sec +
+     1E-6 * (tvsincos_stop.tv_usec - tvsincos_start.tv_usec)) /
+    nIter;
 
-  std::cout.unsetf ( std::ios::fixed | std::ios::scientific );
-  std::cout << "Time to fill 2x" << dataLen << " elements using sincos function: " << timeSinCos << std::endl;
+  std::cout.unsetf(std::ios::fixed | std::ios::scientific);
+  std::cout << "Time to fill 2x" << dataLen
+            << " elements using sincos function: " << timeSinCos << std::endl;
 
   struct timeval tvpoly_start, tvpoly_stop;
   gettimeofday(&tvpoly_start, 0);
-  for(Int_t iIter=0;iIter<nIter;iIter++) {
-    for(Int_t i=0;i<dataLen;i++) {
+  for (Int_t iIter = 0; iIter < nIter; iIter++) {
+    for (Int_t i = 0; i < dataLen; i++) {
       parameterized_sincos(x[i], y_testsin[i], y_testcos[i]);
     }
   }
   gettimeofday(&tvpoly_stop, 0);
-  double timePoly=(tvpoly_stop.tv_sec - tvpoly_start.tv_sec + 1E-6*(tvpoly_stop.tv_usec - tvpoly_start.tv_usec))/nIter;
-  std::cout << "Time to fill 2x" << dataLen << " elements using approximation sin&cos: " << timePoly << std::endl;
-  std::cout.unsetf ( std::ios::fixed | std::ios::scientific );
-  std::cout << "Approximation is " << timeSinCos/timePoly << " faster " << std::endl;
+  double timePoly = (tvpoly_stop.tv_sec - tvpoly_start.tv_sec +
+                     1E-6 * (tvpoly_stop.tv_usec - tvpoly_start.tv_usec)) /
+                    nIter;
+  std::cout << "Time to fill 2x" << dataLen
+            << " elements using approximation sin&cos: " << timePoly
+            << std::endl;
+  std::cout.unsetf(std::ios::fixed | std::ios::scientific);
+  std::cout << "Approximation is " << timeSinCos / timePoly << " faster "
+            << std::endl;
 #endif
-
 }
-- 
GitLab


From 6801e6140c2ace1e6a155e51f50f0bfb1490e987 Mon Sep 17 00:00:00 2001
From: MihaMuskinja <miha.muskinja@gmail.com>
Date: Sun, 13 Sep 2020 07:13:27 +0200
Subject: [PATCH 148/347] fix in parameterization

---
 .../src/LArWheelCalculator_Impl/sincos_poly.cxx           | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
index 8c14cda669db..e18e7556928f 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
@@ -106,7 +106,7 @@ LArWheelCalculator::fill_sincos_parameterization()
     // s4, s5, c4, c5
     // s2, s3, c2, c3
     // s0, s1, c0, c1
-    m_vsincos_par.sincos_parametrization[0][1] = m_sin_parametrization[4];
+    m_vsincos_par.sincos_parametrization[0][0] = m_sin_parametrization[4];
     m_vsincos_par.sincos_parametrization[0][1] = m_sin_parametrization[5];
     m_vsincos_par.sincos_parametrization[0][2] = m_cos_parametrization[4];
     m_vsincos_par.sincos_parametrization[0][3] = m_cos_parametrization[5];
@@ -166,7 +166,7 @@ LArWheelCalculator::fill_sincos_parameterization()
   // s4, s5, c4, c5
   // s2, s3, c2, c3
   // s0, s1, c0, c1
-  m_vsincos_par.sincos_parametrization[0][1] = m_sin_parametrization[4];
+  m_vsincos_par.sincos_parametrization[0][0] = m_sin_parametrization[4];
   m_vsincos_par.sincos_parametrization[0][1] = m_sin_parametrization[5];
   m_vsincos_par.sincos_parametrization[0][2] = m_cos_parametrization[4];
   m_vsincos_par.sincos_parametrization[0][3] = m_cos_parametrization[5];
@@ -195,7 +195,11 @@ LArWheelCalculator::fill_sincos_parameterization()
   for (double r = Rmin + 40.; r < Rmax - 40.; r += Rstep / 10.) {
     CxxUtils::sincos scalpha(parameterized_slant_angle(r));
     double sin_a, cos_a;
+    double sin_a_v, cos_a_v;
     parameterized_sincos(r, sin_a, cos_a);
+    m_vsincos_par.eval(r, sin_a_v, cos_a_v);
+    std::cout << "default: " << r << " " << sin_a << " " << cos_a << std::endl;
+    std::cout << "vec: " << r << " " << sin_a_v << " " << cos_a_v << std::endl;
     double ds = fabs(scalpha.sn - sin_a);
     if (ds > dsin) {
       dsin = ds;
-- 
GitLab


From b7d4b877cba0acb6d2ad8910322d214f61eb7d7e Mon Sep 17 00:00:00 2001
From: MihaMuskinja <miha.muskinja@gmail.com>
Date: Sun, 13 Sep 2020 20:03:26 +0200
Subject: [PATCH 149/347] replace sincos

---
 .../DistanceCalculatorSaggingOff.cxx          | 30 +++++++++++++++----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
index c8bdbaa421bf..637f0725d065 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
@@ -48,7 +48,11 @@ namespace LArWheelCalculator_Impl
     const double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->parameterized_sincos(P.y(), sin_a, cos_a);
+    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
+    // std::cout << sin_a << " " << cos_a << std::endl;
+    // double cos_a_old, sin_a_old;
+    // lwc()->parameterized_sincos(P.y(), sin_a_old, cos_a_old);
+    // std::cout << "old " << sin_a_old << " " << cos_a_old << std::endl;
 #endif
     // determination of the nearest quarter-wave number
     int nqwave = (z < 0.) ? 0 : int(z / lwc()->m_QuarterWaveLength);
@@ -160,7 +164,11 @@ namespace LArWheelCalculator_Impl
     double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->parameterized_sincos(P.y(), sin_a, cos_a);
+    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
+    // std::cout << sin_a << " " << cos_a << std::endl;
+    // double cos_a_old, sin_a_old;
+    // lwc()->parameterized_sincos(P.y(), sin_a_old, cos_a_old);
+    // std::cout << "old " << sin_a_old << " " << cos_a_old << std::endl;
 #endif
 
     bool sqw = false;
@@ -251,7 +259,11 @@ namespace LArWheelCalculator_Impl
     const double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->parameterized_sincos(P.y(), sin_a, cos_a);
+    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
+    // std::cout << sin_a << " " << cos_a << std::endl;
+    // double cos_a_old, sin_a_old;
+    // lwc()->parameterized_sincos(P.y(), sin_a_old, cos_a_old);
+    // std::cout << "old " << sin_a_old << " " << cos_a_old << std::endl;
 #endif
 
     int nqwave;
@@ -339,7 +351,11 @@ namespace LArWheelCalculator_Impl
     double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->parameterized_sincos(P.y(), sin_a, cos_a);
+    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
+    // std::cout << sin_a << " " << cos_a << std::endl;
+    // double cos_a_old, sin_a_old;
+    // lwc()->parameterized_sincos(P.y(), sin_a_old, cos_a_old);
+    // std::cout << "old " << sin_a_old << " " << cos_a_old << std::endl;
 #endif
 
     bool sqw = false;
@@ -434,7 +450,11 @@ namespace LArWheelCalculator_Impl
     // parameterized sine
 #else
     double cos_a, sin_a;
-    lwc()->parameterized_sincos(P.y(), sin_a, cos_a);
+    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
+    // std::cout << sin_a << " " << cos_a << std::endl;
+    // double cos_a_old, sin_a_old;
+    // lwc()->parameterized_sincos(P.y(), sin_a_old, cos_a_old);
+    // std::cout << "old " << sin_a_old << " " << cos_a_old << std::endl;
 #endif
 
     // determination of the nearest quarter-wave number
-- 
GitLab


From 5d314e654e1c0710d6701b4debb8ac6892b61142 Mon Sep 17 00:00:00 2001
From: Miha Muskinja <miha.muskinja@cern.ch>
Date: Thu, 28 Jan 2021 15:44:01 -0800
Subject: [PATCH 150/347] store pre-vectorized parameterization

---
 .../GeoSpecialShapes/LArWheelCalculator.h     |   6 +-
 .../vec_parametrized_sincos.h                 | 103 +---------
 .../LArWheelCalculator_Impl/sincos_poly.cxx   | 183 ++++++++----------
 3 files changed, 94 insertions(+), 198 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
index eb194b740f5f..6ae538d4eb8e 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
@@ -11,7 +11,9 @@
 #ifndef XAOD_STANDALONE
     #include "AthenaKernel/CLASS_DEF.h"
 #endif // XAOD_STANDALONE
-#include "vec_parametrized_sincos.h"
+#if !defined(__CLING__)
+    #include "vec_parametrized_sincos.h"
+#endif
 #include "GeoSpecialShapes/LArWheelCalculatorEnums.h"
 
 #define LARWC_SINCOS_POLY 5
@@ -208,7 +210,9 @@ class LArWheelCalculator
     LArWheelCalculator_Impl::IDistanceCalculator *m_distanceCalcImpl;
     LArWheelCalculator_Impl::IFanCalculator *m_fanCalcImpl;
     void fill_sincos_parameterization();
+#if !defined(__CLING__)
     vsincos_par m_vsincos_par{};
+#endif
 };
 
 #ifndef XAOD_STANDALONE
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h
index d4ce048d8550..6d5d867f73d4 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h
@@ -15,7 +15,9 @@
 struct vsincos_par
 {
 
-  alignas(32) double sincos_parametrization[3][4] = {};
+  CxxUtils::vec<double, 4> param_0 = {};
+  CxxUtils::vec<double, 4> param_1 = {};
+  CxxUtils::vec<double, 4> param_2 = {};
 
 #if HAVE_FUNCTION_MULTIVERSIONING
 #if defined(__x86_64__)
@@ -27,39 +29,8 @@ struct vsincos_par
            double& ATH_RESTRICT sin_a,
            double& ATH_RESTRICT cos_a) const ATH_RESTRICT
   {
-    // P0 = s4x^4 + s2x^2 + s0
-    // P1 = s5x^4 + s3x^3 + s1
-    // P2 = c4x^4 + c2x^2 + c0
-    // P3 = c5x^4 + c3x^2 + c1
-
-    // [s4, s5, c4, c5]
     const double r2 = r * r;
-    CxxUtils::vec<double, 4> P = {
-      sincos_parametrization[0][0],
-      sincos_parametrization[0][1],
-      sincos_parametrization[0][2],
-      sincos_parametrization[0][3],
-    };
-
-    // [s4, s5, c4, c5] * r2 * r2
-    // +
-    // [s2, s3, c3, c3] * r2
-    // +
-    // s0, s1, c0, c1
-    CxxUtils::vec<double, 4> param_1 = {
-      sincos_parametrization[1][0],
-      sincos_parametrization[1][1],
-      sincos_parametrization[1][2],
-      sincos_parametrization[1][3],
-    };
-    CxxUtils::vec<double, 4> param_2 = {
-      sincos_parametrization[2][0],
-      sincos_parametrization[2][1],
-      sincos_parametrization[2][2],
-      sincos_parametrization[2][3],
-    };
-
-    P = r2 * P + param_1;
+    CxxUtils::vec<double, 4> P = r2 * param_0 + param_1;
     P = r2 * P + param_2;
     CxxUtils::vec<double, 4> P2 = { P[1], P[0], P[3], P[2] };
     CxxUtils::vec<double, 4> res = r * P2 + P;
@@ -74,39 +45,8 @@ struct vsincos_par
        double& ATH_RESTRICT sin_a,
        double& ATH_RESTRICT cos_a) const ATH_RESTRICT
   {
-    // P0 = s4x^4 + s2x^2 + s0
-    // P1 = s5x^4 + s3x^3 + s1
-    // P2 = c4x^4 + c2x^2 + c0
-    // P3 = c5x^4 + c3x^2 + c1
-
-    // [s4, s5, c4, c5]
     const double r2 = r * r;
-    CxxUtils::vec<double, 4> P = {
-      sincos_parametrization[0][0],
-      sincos_parametrization[0][1],
-      sincos_parametrization[0][2],
-      sincos_parametrization[0][3],
-    };
-
-    // [s4, s5, c4, c5] * r2 * r2
-    // +
-    // [s2, s3, c3, c3] * r2
-    // +
-    // s0, s1, c0, c1
-    CxxUtils::vec<double, 4> param_1 = {
-      sincos_parametrization[1][0],
-      sincos_parametrization[1][1],
-      sincos_parametrization[1][2],
-      sincos_parametrization[1][3],
-    };
-    CxxUtils::vec<double, 4> param_2 = {
-      sincos_parametrization[2][0],
-      sincos_parametrization[2][1],
-      sincos_parametrization[2][2],
-      sincos_parametrization[2][3],
-    };
-
-    P = r2 * P + param_1;
+    CxxUtils::vec<double, 4> P = r2 * param_0 + param_1;
     P = r2 * P + param_2;
     CxxUtils::vec<double, 4> P2 = { P[1], P[0], P[3], P[2] };
     CxxUtils::vec<double, 4> res = r * P2 + P;
@@ -123,39 +63,8 @@ struct vsincos_par
        double& ATH_RESTRICT sin_a,
        double& ATH_RESTRICT cos_a) const ATH_RESTRICT
   {
-    // P0 = s4x^4 + s2x^2 + s0
-    // P1 = s5x^4 + s3x^3 + s1
-    // P2 = c4x^4 + c2x^2 + c0
-    // P3 = c5x^4 + c3x^2 + c1
-
-    // [s4, s5, c4, c5]
     const double r2 = r * r;
-    CxxUtils::vec<double, 4> P = {
-      sincos_parametrization[0][0],
-      sincos_parametrization[0][1],
-      sincos_parametrization[0][2],
-      sincos_parametrization[0][3]
-    };
-
-    // [s4, s5, c4, c5] * r2 * r2
-    // +
-    // [s2, s3, c3, c3] * r2
-    // +
-    // s0, s1, c0, c1
-    CxxUtils::vec<double, 4> param_1 = {
-      sincos_parametrization[1][0],
-      sincos_parametrization[1][1],
-      sincos_parametrization[1][2],
-      sincos_parametrization[1][3]
-    };
-    CxxUtils::vec<double, 4> param_2 = {
-      sincos_parametrization[2][0],
-      sincos_parametrization[2][1],
-      sincos_parametrization[2][2],
-      sincos_parametrization[2][3]
-    };
-
-    P = r2 * P + param_1;
+    CxxUtils::vec<double, 4> P = r2 * param_0 + param_1;
     P = r2 * P + param_2;
     sin_a = r * P[1] + P[0];
     cos_a = r * P[3] + P[2];
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
index e18e7556928f..b0df77c99124 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
@@ -8,29 +8,28 @@
 
 #include "CLHEP/Units/SystemOfUnits.h"
 
-#include "TDecompLU.h"
-#include "TDecompSVD.h"
 #include "TMath.h"
 #include "TMatrixD.h"
-#include "TMatrixDLazy.h"
 #include "TVectorD.h"
+#include "TMatrixDLazy.h"
+#include "TDecompLU.h"
+#include "TDecompSVD.h"
 
-#include <iomanip>
+#include <sys/time.h>
 #include <iostream>
+#include <iomanip>
 #include <math.h>
 #include <mutex>
-#include <sys/time.h>
 
 #define DEBUGPRINT 0
 
 template<typename T>
-std::ostream&
-operator<<(std::ostream& ostr, const TVectorT<T>& v)
+std::ostream & operator << (std::ostream & ostr, const TVectorT<T> & v)
 {
   std::ios_base::fmtflags save_flags(ostr.flags());
   ostr << '[';
   ostr << std::scientific;
-  for (Int_t idx = v.GetLwb(); idx < v.GetUpb(); idx++) {
+  for(Int_t idx=v.GetLwb();idx<v.GetUpb();idx++) {
     ostr << v[idx] << ", ";
   }
   ostr << v[v.GetUpb()];
@@ -39,44 +38,41 @@ operator<<(std::ostream& ostr, const TVectorT<T>& v)
   return ostr;
 }
 
-// find best approximation of y values using linear combination of basis
-// functions in bf
-static TVectorD
-findLinearApproximation(const Int_t dataLen,
-                        const Int_t nBasisFuntions,
-                        const TVectorD& y,
-                        const TMatrixD& bf)
+
+// find best approximation of y values using linear combination of basis functions in bf
+static TVectorD findLinearApproximation(
+    const Int_t dataLen, const Int_t nBasisFuntions,
+    const TVectorD &y, const TMatrixD & bf)
 {
   TMatrixDSym A(nBasisFuntions);
   TVectorD vY(nBasisFuntions);
 
-  for (Int_t j = 0; j < nBasisFuntions; ++j) {
-    for (Int_t k = 0; k < nBasisFuntions; ++k) {
+  for(Int_t j = 0; j < nBasisFuntions; ++ j){
+    for(Int_t k = 0; k < nBasisFuntions; ++ k){
       Double_t Ajk = 0.0;
-      for (Int_t i = 0; i < dataLen; ++i) {
+      for(Int_t i = 0; i < dataLen; ++ i){
         Ajk += bf(j, i) * bf(k, i);
       }
       A(j, k) = Ajk;
     }
   }
 
-  for (Int_t k = 0; k < nBasisFuntions; ++k) {
+  for(Int_t k = 0; k < nBasisFuntions; ++ k){
     Double_t vYk = 0.0;
-    for (Int_t i = 0; i < dataLen; ++i) {
-      vYk += y[i] * bf(k, i);
+    for(Int_t i = 0; i < dataLen; ++ i){
+      vYk += y[i]*bf(k,i);
     }
     vY[k] = vYk;
   }
 
   TMatrixDSym Ainv(A);
   Ainv.Invert();
-  return Ainv * vY;
+  return Ainv*vY;
 }
 
 using namespace CLHEP;
 
-void
-LArWheelCalculator::fill_sincos_parameterization()
+void LArWheelCalculator::fill_sincos_parameterization()
 {
   const Int_t nrPolyDegree = LARWC_SINCOS_POLY;
 #if LARWC_SINCOS_POLY > 4 && DEBUGPRINT
@@ -96,56 +92,53 @@ LArWheelCalculator::fill_sincos_parameterization()
   static double cos_parametrization[2][nBasisFunctions];
 
   // Reuse the computation if already performed
-  size_t S = m_isInner ? 0 : 1;
-  if (filled[S]) {
-    for (Int_t i = 0; i < nBasisFunctions; ++i) {
+  size_t S = m_isInner? 0: 1;
+  if(filled[S]){
+    for(Int_t i = 0; i < nBasisFunctions; ++ i){
       m_sin_parametrization[i] = sin_parametrization[S][i];
       m_cos_parametrization[i] = cos_parametrization[S][i];
     }
-    // To Miha not  sure this is the right order just assuem here
+
     // s4, s5, c4, c5
     // s2, s3, c2, c3
     // s0, s1, c0, c1
-    m_vsincos_par.sincos_parametrization[0][0] = m_sin_parametrization[4];
-    m_vsincos_par.sincos_parametrization[0][1] = m_sin_parametrization[5];
-    m_vsincos_par.sincos_parametrization[0][2] = m_cos_parametrization[4];
-    m_vsincos_par.sincos_parametrization[0][3] = m_cos_parametrization[5];
-    m_vsincos_par.sincos_parametrization[1][0] = m_sin_parametrization[2];
-    m_vsincos_par.sincos_parametrization[1][1] = m_sin_parametrization[3];
-    m_vsincos_par.sincos_parametrization[1][2] = m_cos_parametrization[2];
-    m_vsincos_par.sincos_parametrization[1][3] = m_cos_parametrization[3];
-    m_vsincos_par.sincos_parametrization[2][0] = m_sin_parametrization[0];
-    m_vsincos_par.sincos_parametrization[2][1] = m_sin_parametrization[1];
-    m_vsincos_par.sincos_parametrization[2][2] = m_cos_parametrization[0];
-    m_vsincos_par.sincos_parametrization[2][3] = m_cos_parametrization[1];
+    m_vsincos_par.param_0[0] = m_sin_parametrization[4];
+    m_vsincos_par.param_0[1] = m_sin_parametrization[5];
+    m_vsincos_par.param_0[2] = m_cos_parametrization[4];
+    m_vsincos_par.param_0[3] = m_cos_parametrization[5];
+    m_vsincos_par.param_1[0] = m_sin_parametrization[2];
+    m_vsincos_par.param_1[1] = m_sin_parametrization[3];
+    m_vsincos_par.param_1[2] = m_cos_parametrization[2];
+    m_vsincos_par.param_1[3] = m_cos_parametrization[3];
+    m_vsincos_par.param_2[0] = m_sin_parametrization[0];
+    m_vsincos_par.param_2[1] = m_sin_parametrization[1];
+    m_vsincos_par.param_2[2] = m_cos_parametrization[0];
+    m_vsincos_par.param_2[3] = m_cos_parametrization[1];
     return;
   }
 
-  // const Double_t Rmin = m_isInner? 290.*mm: 600.*mm;
-  // const Double_t Rmax = m_isInner? 710.*mm: 2050.*mm;
-  const Double_t Rmin = m_isInner ? 250. * mm : 560. * mm;
-  const Double_t Rmax = m_isInner ? 750. * mm : 2090. * mm;
-  // const Double_t Rmin = m_isInner? 220.*mm: 530.*mm;
-  // const Double_t Rmax = m_isInner? 780.*mm: 2120.*mm;
-  const Double_t Rstep = 1. * mm;
-  const Int_t nrPoints = (Rmax - Rmin) * (1. / Rstep);
+  //const Double_t Rmin = m_isInner? 290.*mm: 600.*mm;
+  //const Double_t Rmax = m_isInner? 710.*mm: 2050.*mm;
+  const Double_t Rmin = m_isInner? 250.*mm: 560.*mm;
+  const Double_t Rmax = m_isInner? 750.*mm: 2090.*mm;
+  //const Double_t Rmin = m_isInner? 220.*mm: 530.*mm;
+  //const Double_t Rmax = m_isInner? 780.*mm: 2120.*mm;
+  const Double_t Rstep = 1.*mm;
+  const Int_t nrPoints = (Rmax - Rmin) * (1./Rstep);
   const Int_t dataLen = nrPoints + 1;
 
-  TVectorD x(dataLen); // angle points
-  TVectorD ysin(
-    dataLen); // to be approximated function values at angle points - sin
-  TVectorD ycos(
-    dataLen); // to be approximated function values at angle points - cos
-  TMatrixD bf(nBasisFunctions,
-              dataLen); // Matrix of values of basis functions at angle points
+  TVectorD x(dataLen);  // angle points
+  TVectorD ysin(dataLen);  // to be approximated function values at angle points - sin
+  TVectorD ycos(dataLen);  // to be approximated function values at angle points - cos
+  TMatrixD bf(nBasisFunctions, dataLen); // Matrix of values of basis functions at angle points
 
-  for (Int_t i = 0; i < dataLen; ++i) {
+  for(Int_t i = 0; i < dataLen; ++ i){
     const Double_t a = Rmin + i * Rstep;
     x[i] = a;
     CxxUtils::sincos scalpha(parameterized_slant_angle(a));
     ysin[i] = scalpha.sn;
     ycos[i] = scalpha.cs;
-    for (Int_t n = 0; n < nBasisFunctions; ++n) {
+    for(Int_t n = 0; n < nBasisFunctions; ++ n) {
       bf(n, i) = pow(a, n);
     }
   }
@@ -155,29 +148,28 @@ LArWheelCalculator::fill_sincos_parameterization()
   TVectorD params_cos =
     findLinearApproximation(dataLen, nBasisFunctions, ycos, bf);
 
-  for (Int_t i = 0; i < nBasisFunctions; ++i) {
+  for(Int_t i = 0; i < nBasisFunctions; ++ i){
     m_sin_parametrization[i] = params_sin[i];
     m_cos_parametrization[i] = params_cos[i];
     sin_parametrization[S][i] = params_sin[i];
     cos_parametrization[S][i] = params_cos[i];
   }
 
-  // To Miha not  sure this is the right order just assuem here
   // s4, s5, c4, c5
   // s2, s3, c2, c3
   // s0, s1, c0, c1
-  m_vsincos_par.sincos_parametrization[0][0] = m_sin_parametrization[4];
-  m_vsincos_par.sincos_parametrization[0][1] = m_sin_parametrization[5];
-  m_vsincos_par.sincos_parametrization[0][2] = m_cos_parametrization[4];
-  m_vsincos_par.sincos_parametrization[0][3] = m_cos_parametrization[5];
-  m_vsincos_par.sincos_parametrization[1][0] = m_sin_parametrization[2];
-  m_vsincos_par.sincos_parametrization[1][1] = m_sin_parametrization[3];
-  m_vsincos_par.sincos_parametrization[1][2] = m_cos_parametrization[2];
-  m_vsincos_par.sincos_parametrization[1][3] = m_cos_parametrization[3];
-  m_vsincos_par.sincos_parametrization[2][0] = m_sin_parametrization[0];
-  m_vsincos_par.sincos_parametrization[2][1] = m_sin_parametrization[1];
-  m_vsincos_par.sincos_parametrization[2][2] = m_cos_parametrization[0];
-  m_vsincos_par.sincos_parametrization[2][3] = m_cos_parametrization[1];
+  m_vsincos_par.param_0[0] = m_sin_parametrization[4];
+  m_vsincos_par.param_0[1] = m_sin_parametrization[5];
+  m_vsincos_par.param_0[2] = m_cos_parametrization[4];
+  m_vsincos_par.param_0[3] = m_cos_parametrization[5];
+  m_vsincos_par.param_1[0] = m_sin_parametrization[2];
+  m_vsincos_par.param_1[1] = m_sin_parametrization[3];
+  m_vsincos_par.param_1[2] = m_cos_parametrization[2];
+  m_vsincos_par.param_1[3] = m_cos_parametrization[3];
+  m_vsincos_par.param_2[0] = m_sin_parametrization[0];
+  m_vsincos_par.param_2[1] = m_sin_parametrization[1];
+  m_vsincos_par.param_2[2] = m_cos_parametrization[0];
+  m_vsincos_par.param_2[3] = m_cos_parametrization[1];
   filled[S] = true;
 
   // FIXME: nothing below is needed unless debug printing
@@ -192,7 +184,7 @@ LArWheelCalculator::fill_sincos_parameterization()
 
   double dsin = 0., dcos = 0.;
   double dtrig = 0.;
-  for (double r = Rmin + 40.; r < Rmax - 40.; r += Rstep / 10.) {
+  for(double r = Rmin + 40.; r < Rmax - 40.; r += Rstep / 10.){
     CxxUtils::sincos scalpha(parameterized_slant_angle(r));
     double sin_a, cos_a;
     double sin_a_v, cos_a_v;
@@ -201,21 +193,21 @@ LArWheelCalculator::fill_sincos_parameterization()
     std::cout << "default: " << r << " " << sin_a << " " << cos_a << std::endl;
     std::cout << "vec: " << r << " " << sin_a_v << " " << cos_a_v << std::endl;
     double ds = fabs(scalpha.sn - sin_a);
-    if (ds > dsin) {
+    if(ds > dsin){
       dsin = ds;
 #if DEBUGPRINT
       dsinr = r;
 #endif
     }
     double dc = fabs(scalpha.cs - cos_a);
-    if (dc > dcos) {
+    if(dc > dcos){
       dcos = dc;
 #if DEBUGPRINT
       dcosr = r;
 #endif
     }
-    double dt = fabs(sin_a * sin_a + cos_a * cos_a - 1.);
-    if (dt > dtrig) {
+    double dt = fabs(sin_a*sin_a + cos_a*cos_a - 1.);
+    if(dt > dtrig){
       dtrig = dt;
 #if DEBUGPRINT
       dtrigr = r;
@@ -232,45 +224,36 @@ LArWheelCalculator::fill_sincos_parameterization()
 
 #ifdef HARDDEBUG
   TVectorD y_test(dataLen);
-  const Int_t nIter = 10000;
-  std::cout << "Perfomance test started, " << nIter << " iterations"
-            << std::endl;
+  const Int_t nIter=10000;
+  std::cout << "Perfomance test started, " << nIter << " iterations" << std::endl;
 
   double y_testsin[dataLen];
   double y_testcos[dataLen];
   struct timeval tvsincos_start, tvsincos_stop;
   gettimeofday(&tvsincos_start, 0);
-  for (Int_t iIter = 0; iIter < nIter; iIter++) {
-    for (Int_t i = 0; i < dataLen; i++) {
+  for(Int_t iIter=0;iIter<nIter;iIter++) {
+    for(Int_t i=0;i<dataLen;i++) {
       sincos(parameterized_slant_angle(x[i]), &y_testsin[i], &y_testcos[i]);
     }
   }
   gettimeofday(&tvsincos_stop, 0);
-  double timeSinCos =
-    (tvsincos_stop.tv_sec - tvsincos_start.tv_sec +
-     1E-6 * (tvsincos_stop.tv_usec - tvsincos_start.tv_usec)) /
-    nIter;
+  double timeSinCos=(tvsincos_stop.tv_sec-tvsincos_start.tv_sec + 1E-6*(tvsincos_stop.tv_usec-tvsincos_start.tv_usec))/nIter;
 
-  std::cout.unsetf(std::ios::fixed | std::ios::scientific);
-  std::cout << "Time to fill 2x" << dataLen
-            << " elements using sincos function: " << timeSinCos << std::endl;
+  std::cout.unsetf ( std::ios::fixed | std::ios::scientific );
+  std::cout << "Time to fill 2x" << dataLen << " elements using sincos function: " << timeSinCos << std::endl;
 
   struct timeval tvpoly_start, tvpoly_stop;
   gettimeofday(&tvpoly_start, 0);
-  for (Int_t iIter = 0; iIter < nIter; iIter++) {
-    for (Int_t i = 0; i < dataLen; i++) {
+  for(Int_t iIter=0;iIter<nIter;iIter++) {
+    for(Int_t i=0;i<dataLen;i++) {
       parameterized_sincos(x[i], y_testsin[i], y_testcos[i]);
     }
   }
   gettimeofday(&tvpoly_stop, 0);
-  double timePoly = (tvpoly_stop.tv_sec - tvpoly_start.tv_sec +
-                     1E-6 * (tvpoly_stop.tv_usec - tvpoly_start.tv_usec)) /
-                    nIter;
-  std::cout << "Time to fill 2x" << dataLen
-            << " elements using approximation sin&cos: " << timePoly
-            << std::endl;
-  std::cout.unsetf(std::ios::fixed | std::ios::scientific);
-  std::cout << "Approximation is " << timeSinCos / timePoly << " faster "
-            << std::endl;
+  double timePoly=(tvpoly_stop.tv_sec - tvpoly_start.tv_sec + 1E-6*(tvpoly_stop.tv_usec - tvpoly_start.tv_usec))/nIter;
+  std::cout << "Time to fill 2x" << dataLen << " elements using approximation sin&cos: " << timePoly << std::endl;
+  std::cout.unsetf ( std::ios::fixed | std::ios::scientific );
+  std::cout << "Approximation is " << timeSinCos/timePoly << " faster " << std::endl;
 #endif
-}
+
+}
\ No newline at end of file
-- 
GitLab


From 0b91e34d9768925240a91805953a42d9f048eac5 Mon Sep 17 00:00:00 2001
From: Miha Muskinja <miha.muskinja@cern.ch>
Date: Thu, 28 Jan 2021 17:49:06 -0800
Subject: [PATCH 151/347] remove comments and add DEBUGPRINT

---
 .../DistanceCalculatorSaggingOff.cxx          | 20 -------------------
 .../LArWheelCalculator_Impl/sincos_poly.cxx   |  4 +++-
 2 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
index 637f0725d065..4c73adce874c 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
@@ -49,10 +49,6 @@ namespace LArWheelCalculator_Impl
 #else // parameterized sine
     double cos_a, sin_a;
     lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
-    // std::cout << sin_a << " " << cos_a << std::endl;
-    // double cos_a_old, sin_a_old;
-    // lwc()->parameterized_sincos(P.y(), sin_a_old, cos_a_old);
-    // std::cout << "old " << sin_a_old << " " << cos_a_old << std::endl;
 #endif
     // determination of the nearest quarter-wave number
     int nqwave = (z < 0.) ? 0 : int(z / lwc()->m_QuarterWaveLength);
@@ -165,10 +161,6 @@ namespace LArWheelCalculator_Impl
 #else // parameterized sine
     double cos_a, sin_a;
     lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
-    // std::cout << sin_a << " " << cos_a << std::endl;
-    // double cos_a_old, sin_a_old;
-    // lwc()->parameterized_sincos(P.y(), sin_a_old, cos_a_old);
-    // std::cout << "old " << sin_a_old << " " << cos_a_old << std::endl;
 #endif
 
     bool sqw = false;
@@ -260,10 +252,6 @@ namespace LArWheelCalculator_Impl
 #else // parameterized sine
     double cos_a, sin_a;
     lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
-    // std::cout << sin_a << " " << cos_a << std::endl;
-    // double cos_a_old, sin_a_old;
-    // lwc()->parameterized_sincos(P.y(), sin_a_old, cos_a_old);
-    // std::cout << "old " << sin_a_old << " " << cos_a_old << std::endl;
 #endif
 
     int nqwave;
@@ -352,10 +340,6 @@ namespace LArWheelCalculator_Impl
 #else // parameterized sine
     double cos_a, sin_a;
     lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
-    // std::cout << sin_a << " " << cos_a << std::endl;
-    // double cos_a_old, sin_a_old;
-    // lwc()->parameterized_sincos(P.y(), sin_a_old, cos_a_old);
-    // std::cout << "old " << sin_a_old << " " << cos_a_old << std::endl;
 #endif
 
     bool sqw = false;
@@ -451,10 +435,6 @@ namespace LArWheelCalculator_Impl
 #else
     double cos_a, sin_a;
     lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
-    // std::cout << sin_a << " " << cos_a << std::endl;
-    // double cos_a_old, sin_a_old;
-    // lwc()->parameterized_sincos(P.y(), sin_a_old, cos_a_old);
-    // std::cout << "old " << sin_a_old << " " << cos_a_old << std::endl;
 #endif
 
     // determination of the nearest quarter-wave number
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
index b0df77c99124..86cd40c3f600 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
@@ -190,8 +190,10 @@ void LArWheelCalculator::fill_sincos_parameterization()
     double sin_a_v, cos_a_v;
     parameterized_sincos(r, sin_a, cos_a);
     m_vsincos_par.eval(r, sin_a_v, cos_a_v);
+#if DEBUGPRINT
     std::cout << "default: " << r << " " << sin_a << " " << cos_a << std::endl;
     std::cout << "vec: " << r << " " << sin_a_v << " " << cos_a_v << std::endl;
+#endif
     double ds = fabs(scalpha.sn - sin_a);
     if(ds > dsin){
       dsin = ds;
@@ -256,4 +258,4 @@ void LArWheelCalculator::fill_sincos_parameterization()
   std::cout << "Approximation is " << timeSinCos/timePoly << " faster " << std::endl;
 #endif
 
-}
\ No newline at end of file
+}
-- 
GitLab


From 53a95f7747ad0168209a92fec6a78e3e5497f6d0 Mon Sep 17 00:00:00 2001
From: Miha Muskinja <miha.muskinja@cern.ch>
Date: Thu, 28 Jan 2021 19:21:33 -0800
Subject: [PATCH 152/347] use HAVE_VECTOR_SIZE_ATTRIBUTE to check for CLING

---
 .../GeoSpecialShapes/LArWheelCalculator.h                | 9 ++++++---
 .../GeoSpecialShapes/vec_parametrized_sincos.h           | 3 +--
 .../DistanceCalculatorSaggingOff.cxx                     | 2 +-
 .../src/LArWheelCalculator_Impl/sincos_poly.cxx          | 2 +-
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
index 6ae538d4eb8e..70faa362228e 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.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 GEOSPECIALSHAPES_LARWHEELCALCULATOR_H
@@ -7,11 +7,14 @@
 
 #include <vector>
 
+// FMV and other checks
+#include "CxxUtils/features.h"
+
 #include "CLHEP/Vector/ThreeVector.h"
 #ifndef XAOD_STANDALONE
     #include "AthenaKernel/CLASS_DEF.h"
 #endif // XAOD_STANDALONE
-#if !defined(__CLING__)
+#if HAVE_VECTOR_SIZE_ATTRIBUTE
     #include "vec_parametrized_sincos.h"
 #endif
 #include "GeoSpecialShapes/LArWheelCalculatorEnums.h"
@@ -210,7 +213,7 @@ class LArWheelCalculator
     LArWheelCalculator_Impl::IDistanceCalculator *m_distanceCalcImpl;
     LArWheelCalculator_Impl::IFanCalculator *m_fanCalcImpl;
     void fill_sincos_parameterization();
-#if !defined(__CLING__)
+#if HAVE_VECTOR_SIZE_ATTRIBUTE
     vsincos_par m_vsincos_par{};
 #endif
 };
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h
index 6d5d867f73d4..be996d7507b3 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.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
 */
 
 /**
@@ -9,7 +9,6 @@
 #ifndef VEC_PARAMETRIZED_SINCOS_H
 #define VEC_PARAMETRIZED_SINCOS_H
 
-#include "CxxUtils/features.h"
 #include "CxxUtils/restrict.h"
 #include "CxxUtils/vec.h"
 struct vsincos_par
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
index 4c73adce874c..06239cc8c1f4 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.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 "DistanceCalculatorSaggingOff.h"
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
index 86cd40c3f600..917badd4cd08 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.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 "GeoSpecialShapes/LArWheelCalculator.h"
-- 
GitLab


From f95ce4ea9b74e34caf6bbee9b41b3578c3d1906c Mon Sep 17 00:00:00 2001
From: Miha Muskinja <miha.muskinja@cern.ch>
Date: Thu, 4 Feb 2021 09:30:36 -0800
Subject: [PATCH 153/347] dynamically chose the sincos calculator

---
 .../GeoSpecialShapes/LArWheelCalculator.h              |  8 ++++++++
 .../GeoSpecialShapes/src/LArWheelCalculator.cxx        |  3 +++
 .../DistanceCalculatorSaggingOff.cxx                   | 10 +++++-----
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
index 70faa362228e..0da3b1906837 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
@@ -126,6 +126,9 @@ class LArWheelCalculator
     std::pair<int, int> GetPhiGapAndSide(const CLHEP::Hep3Vector &p) const;
     double AmplitudeOfSurface(const CLHEP::Hep3Vector& P, int side, int fan_number) const;
 
+    /// Set the sincos calculator
+    // void SetVectorizedSincos() {m_sincos_calculator = &m_vsincos_par.eval;};
+
     /// @}
 
   private:
@@ -216,6 +219,11 @@ class LArWheelCalculator
 #if HAVE_VECTOR_SIZE_ATTRIBUTE
     vsincos_par m_vsincos_par{};
 #endif
+
+  private:
+    typedef void (LArWheelCalculator::*SincosCalculator)(const double, double &, double &) const;
+    SincosCalculator m_sincos_calculator;
+    void EvalSincos(const double P, double &x, double &y) const {(this->*m_sincos_calculator)(P, x, y);};
 };
 
 #ifndef XAOD_STANDALONE
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx
index 11a481c860f3..cec1e276735f 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx
@@ -443,6 +443,9 @@ LArWheelCalculator::LArWheelCalculator(LArG4::LArWheelCalculator_t a_wheelType,
      fclose(O);
      exit(0);
   */
+
+   // set the sincos calculator
+   m_sincos_calculator = &LArWheelCalculator::parameterized_sincos;
 }
 
 /* converts module gap number into wheel gap number */
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
index 06239cc8c1f4..0163f1ba9442 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
@@ -48,7 +48,7 @@ namespace LArWheelCalculator_Impl
     const double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
+    lwc()->EvalSincos(P.y(), sin_a, cos_a);
 #endif
     // determination of the nearest quarter-wave number
     int nqwave = (z < 0.) ? 0 : int(z / lwc()->m_QuarterWaveLength);
@@ -160,7 +160,7 @@ namespace LArWheelCalculator_Impl
     double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
+    lwc()->EvalSincos(P.y(), sin_a, cos_a);
 #endif
 
     bool sqw = false;
@@ -251,7 +251,7 @@ namespace LArWheelCalculator_Impl
     const double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
+    lwc()->EvalSincos(P.y(), sin_a, cos_a);
 #endif
 
     int nqwave;
@@ -339,7 +339,7 @@ namespace LArWheelCalculator_Impl
     double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
+    lwc()->EvalSincos(P.y(), sin_a, cos_a);
 #endif
 
     bool sqw = false;
@@ -434,7 +434,7 @@ namespace LArWheelCalculator_Impl
     // parameterized sine
 #else
     double cos_a, sin_a;
-    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
+    lwc()->EvalSincos(P.y(), sin_a, cos_a);
 #endif
 
     // determination of the nearest quarter-wave number
-- 
GitLab


From 5890b559b2c13636e20eb29d43d2031286f6c1ed Mon Sep 17 00:00:00 2001
From: Alaettin Serhan Mete <alaettin.serhan.mete@cern.ch>
Date: Thu, 16 Sep 2021 17:19:51 +0200
Subject: [PATCH 154/347] Drop BDT tree caches to avoid unnecessary memory
 allocations

---
 Reconstruction/MVAUtils/Root/BDT.cxx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Reconstruction/MVAUtils/Root/BDT.cxx b/Reconstruction/MVAUtils/Root/BDT.cxx
index 46ed101c7229..50cdfe10397f 100644
--- a/Reconstruction/MVAUtils/Root/BDT.cxx
+++ b/Reconstruction/MVAUtils/Root/BDT.cxx
@@ -58,6 +58,7 @@ BDT::BDT(::TTree *tree)
 {
   // at runtime decide which flavour of BDT we need to build
   // the information is coming from the title of the TTree
+  if (tree) tree->SetCacheSize(0); // Avoid unnecessary memory allocations
   std::map<std::string, std::string> options = parseOptions(tree->GetTitle());
   std::string creator = get_default_string_map(options, std::string("creator"));
   if (creator == "lgbm")
-- 
GitLab


From 92e99d546d9a870d2717167f419f5dea24f3daa0 Mon Sep 17 00:00:00 2001
From: Tim Martin <Tim.Martin@cern.ch>
Date: Thu, 16 Sep 2021 17:53:33 +0200
Subject: [PATCH 155/347] Save probe-leg data to the trigger EDM

---
 .../TrigOutputHandling/src/HLTEDMCreator.cxx  | 45 ++++++++++++++-----
 1 file changed, 33 insertions(+), 12 deletions(-)

diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx
index f56234a606d4..8d3a97e0df3f 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx
+++ b/Trigger/TrigSteer/TrigOutputHandling/src/HLTEDMCreator.cxx
@@ -284,11 +284,11 @@ StatusCode HLTEDMCreator::createIfMissing( const EventContext& context, const Co
       // What we write will either be a dummy (empty) container, or be populated from N in-View collections.
       SG::ReadHandle<T> readHandle( writeHandleKey.key() );
       if ( readHandle.isValid() ) {
-	ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " already present" );
-	generator.create(false, false);
+        ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " already present" );
+        generator.create(false, false);
       } else {
-	ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " was absent, creating it" );
-	generator.create(true, true);
+        ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " was absent, creating it" );
+        generator.create(true, true);
       }
 
     } else {
@@ -302,10 +302,10 @@ StatusCode HLTEDMCreator::createIfMissing( const EventContext& context, const Co
       if ( handles.out.size() == 1  ) {
       	generator.create(true, true);
       } else  {
-	const bool doCreate = i == 0 or handles.out.at(i-1).key() != handles.out.at(i).key();
-	const bool doRecord = i == handles.out.size()-1 or handles.out.at(i+1).key() != handles.out.at(i).key();
-	ATH_MSG_DEBUG( "Instrucring generator " <<  (doCreate ? "to" : "NOT TO") <<  " create collection and " << (doRecord ? "to" : "NOT TO") << " record collection in this iteration");
-	generator.create(doCreate, doRecord);
+        const bool doCreate = i == 0 or handles.out.at(i-1).key() != handles.out.at(i).key();
+        const bool doRecord = i == handles.out.size()-1 or handles.out.at(i+1).key() != handles.out.at(i).key();
+        ATH_MSG_DEBUG( "Instrucring generator " <<  (doCreate ? "to" : "NOT TO") <<  " create collection and " << (doRecord ? "to" : "NOT TO") << " record collection in this iteration");
+        generator.create(doCreate, doRecord);
       }
 
       SG::ReadHandleKey<ViewContainer> viewsReadHandleKey = handles.views.at(i);
@@ -313,12 +313,33 @@ StatusCode HLTEDMCreator::createIfMissing( const EventContext& context, const Co
 
       auto viewsHandle = SG::makeHandle( viewsReadHandleKey, context );
       if ( viewsHandle.isValid() ) {
-	SG::ReadHandleKey<T> inViewReadHandleKey = handles.in.at(i);
-	ATH_MSG_DEBUG("Will be merging from " << viewsHandle->size() << " views using in-view key " << inViewReadHandleKey.key() );
-	ATH_CHECK( (this->*merger)( *viewsHandle, inViewReadHandleKey , context, *generator.data.get() ) );
+        SG::ReadHandleKey<T> inViewReadHandleKey = handles.in.at(i);
+        ATH_MSG_DEBUG("Will be merging from " << viewsHandle->size() << " views using in-view key " << inViewReadHandleKey.key() );
+        ATH_CHECK( (this->*merger)( *viewsHandle, inViewReadHandleKey , context, *generator.data.get() ) );
       } else {
-	ATH_MSG_DEBUG("Views " << viewsReadHandleKey.key() << " are missing. Will leave " << writeHandleKey.key() << " output collection empty.");
+        ATH_MSG_DEBUG("Views " << viewsReadHandleKey.key() << " are missing. Will leave " << writeHandleKey.key() << " output collection empty.");
       }
+
+      // Also consider probe variants of each EventView.
+      // Not every container will have a corresponding set of (typically) lower-pT probe ROIs, but it's safer to always test.
+      static const std::string probe_suffix = "_probe";
+      const std::string viewsReadHandleKeyProbe = viewsReadHandleKey.key() + probe_suffix;
+      ATH_MSG_VERBOSE("Will try to merge from the " << viewsReadHandleKeyProbe <<  " view container into that output");
+
+      // Falling back to direct SG access here to avoid uninitiated key errors. This is safe to do in the context of the Trigger ControlFlow.
+      // I.e. if this collection is to exist in this event, then it is guaranteed to have been produced prior to this alg executing.
+      const ViewContainer* viewsContainer_probe = nullptr;
+      if (evtStore()->contains<ViewContainer>(viewsReadHandleKeyProbe)) {
+        ATH_CHECK(evtStore()->retrieve(viewsContainer_probe, viewsReadHandleKeyProbe));
+      }
+      if ( viewsContainer_probe ) {
+        SG::ReadHandleKey<T> inViewReadHandleKey = handles.in.at(i);
+        ATH_MSG_DEBUG("Will be merging from " << viewsContainer_probe->size() << " probe views using in-view key " << inViewReadHandleKey.key() );
+        ATH_CHECK( (this->*merger)( *viewsContainer_probe, inViewReadHandleKey , context, *generator.data.get() ) );
+      } else {
+        ATH_MSG_VERBOSE("Probe views " << viewsReadHandleKeyProbe << " are missing.");
+      }
+
     }
 
     auto writeHandle = SG::makeHandle( writeHandleKey, context );
-- 
GitLab


From b32459ea91f09b9f12c7e3c8d3091cedb8b44b80 Mon Sep 17 00:00:00 2001
From: Teng Jian Khoo <teng.jian.khoo@cern.ch>
Date: Thu, 16 Sep 2021 17:58:46 +0200
Subject: [PATCH 156/347] Permit both selectChains and disableChains to be set
 on menu; break later to have the possibility to crash

---
 Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 67b24ec53b01..0fd26c12a6ad 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -509,7 +509,7 @@ if not opt.createHLTMenuExternally:
 
     if (opt.selectChains):
         menu.selectChainsForTesting = opt.selectChains
-    elif (opt.disableChains):
+    if (opt.disableChains):
         menu.disableChains = opt.disableChains
 
     # generating the HLT structure requires
-- 
GitLab


From 40aeaa746d86668e914ec2506ae64e45b992e4db Mon Sep 17 00:00:00 2001
From: Lidija Zivkovic <lidija.zivkovic@cern.ch>
Date: Thu, 16 Sep 2021 19:00:35 +0200
Subject: [PATCH 157/347] ATR-24106 - Forward detectors menu implementation for
 Oct 2021 Pilot Beam

---
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 30 +++++++++++++++++++
 .../share/ref_v1Dev_decodeBS_build.ref        | 30 +++++++++++++++++++
 .../CommonSequences/EventBuildingSequences.py |  5 ++++
 .../HLTMenuConfig/Menu/EventBuildingInfo.py   |  3 +-
 .../Menu/PhysicsP1_pp_run3_v1.py              | 24 ++++++++++++++-
 .../python/HLTMenuConfig/Menu/StreamInfo.py   |  1 +
 6 files changed, 91 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index a17147e56e33..f15508a59331 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -8991,6 +8991,30 @@ HLT_noalg_L1AFP_A_AND_C_TOF_T0T1_J50:
   eventCount: 0
 HLT_noalg_L1AFP_A_AND_C_TOF_T0T1_J75:
   eventCount: 0
+HLT_noalg_L1AFP_FSA_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSA_TOF_T0_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSA_TOF_T1_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSA_TOF_T2_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSA_TOF_T3_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSC_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSC_TOF_T0_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSC_TOF_T1_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSC_TOF_T2_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSC_TOF_T3_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_NSA_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_NSC_BGRP0:
+  eventCount: 0
 HLT_noalg_L1All:
   eventCount: 20
 HLT_noalg_L1Bkg:
@@ -9281,6 +9305,12 @@ HLT_noalg_LArPEBCalib_L1RD0_EMPTY:
   eventCount: 0
 HLT_noalg_SCTPEB_L1RD0_EMPTY:
   eventCount: 0
+HLT_noalg_ZDCPEB_L1ZDC_A:
+  eventCount: 0
+HLT_noalg_ZDCPEB_L1ZDC_AND:
+  eventCount: 0
+HLT_noalg_ZDCPEB_L1ZDC_C:
+  eventCount: 0
 HLT_noalg_idmon_L1RD0_EMPTY:
   eventCount: 0
 HLT_noalg_idmon_L1RD0_FILLED:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index a5b647448f10..3a7e106fde18 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -3463,6 +3463,30 @@ HLT_noalg_L1AFP_A_AND_C_TOF_T0T1_J50:
   eventCount: 0
 HLT_noalg_L1AFP_A_AND_C_TOF_T0T1_J75:
   eventCount: 0
+HLT_noalg_L1AFP_FSA_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSA_TOF_T0_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSA_TOF_T1_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSA_TOF_T2_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSA_TOF_T3_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSC_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSC_TOF_T0_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSC_TOF_T1_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSC_TOF_T2_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_FSC_TOF_T3_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_NSA_BGRP0:
+  eventCount: 0
+HLT_noalg_L1AFP_NSC_BGRP0:
+  eventCount: 0
 HLT_noalg_L1All:
   eventCount: 50
 HLT_noalg_L1Bkg:
@@ -3749,6 +3773,12 @@ HLT_noalg_LArPEBCalib_L1RD0_EMPTY:
   eventCount: 0
 HLT_noalg_SCTPEB_L1RD0_EMPTY:
   eventCount: 0
+HLT_noalg_ZDCPEB_L1ZDC_A:
+  eventCount: 0
+HLT_noalg_ZDCPEB_L1ZDC_AND:
+  eventCount: 0
+HLT_noalg_ZDCPEB_L1ZDC_C:
+  eventCount: 0
 HLT_noalg_idmon_L1RD0_EMPTY:
   eventCount: 0
 HLT_noalg_idmon_L1RD0_FILLED:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequences.py
index 7a4615e95910..917782bf0953 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/EventBuildingSequences.py
@@ -143,6 +143,11 @@ def pebInfoWriterTool(name, eventBuildType):
             SubDetector.MUON_CSC_ENDCAP_A_SIDE,
             SubDetector.MUON_CSC_ENDCAP_C_SIDE
          ])
+    elif 'ZDCPEB' == eventBuildType:
+        tool = StaticPEBInfoWriterToolCfg(name)
+        tool.addSubDets([SubDetector.FORWARD_ZDC,
+                         SubDetector.TDAQ_CTP
+        ])
 
     elif eventBuildType in DataScoutingInfo.getAllDataScoutingIdentifiers():
         # Pure DataScouting configuration
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/EventBuildingInfo.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/EventBuildingInfo.py
index 6e2e288ef527..46a5be5e10f8 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/EventBuildingInfo.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/EventBuildingInfo.py
@@ -33,7 +33,8 @@ PartialEventBuildingIdentifiers = [
     'SCTPEB',
     'TilePEB',
     'AlfaPEB',
-    'CSCPEB'
+    'CSCPEB',
+    'ZDCPEB'
 ]
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
index fc4645ef0da2..65199269b0b5 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
@@ -14,7 +14,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp
 import TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 as physics_menu 
 
 from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import (PhysicsStream,SingleMuonGroup,EgammaStreamersGroup,
-    TauStreamersGroup,JetStreamersGroup,METStreamersGroup,MinBiasGroup,ZeroBiasGroup,SupportLegGroup, LowMuGroup)
+                                                                 TauStreamersGroup,JetStreamersGroup,METStreamersGroup,MinBiasGroup,ZeroBiasGroup,SupportLegGroup, LowMuGroup)
 
 
 def addP1Signatures():
@@ -218,6 +218,28 @@ def addP1Signatures():
         ChainProp(name='HLT_noalg_L1MU5VF_AFP_A_OR_C', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+LowMuGroup+SupportLegGroup),
         ChainProp(name='HLT_noalg_L1MU5VF_AFP_A_AND_C', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+LowMuGroup+SupportLegGroup),
 
+        # Calibration AFP
+        # low mu?
+        ChainProp(name='HLT_noalg_L1AFP_NSA_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+LowMuGroup+SupportLegGroup),
+        ChainProp(name='HLT_noalg_L1AFP_NSC_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+LowMuGroup+SupportLegGroup),
+        # all mu
+        ChainProp(name='HLT_noalg_L1AFP_FSA_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_L1AFP_FSC_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_L1AFP_FSA_TOF_T0_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_L1AFP_FSA_TOF_T1_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_L1AFP_FSA_TOF_T2_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_L1AFP_FSA_TOF_T3_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_L1AFP_FSC_TOF_T0_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_L1AFP_FSC_TOF_T1_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_L1AFP_FSC_TOF_T2_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_L1AFP_FSC_TOF_T3_BGRP0', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+       
+
+        # ZDCCalib
+        ChainProp(name='HLT_noalg_ZDCPEB_L1ZDC_A', l1SeedThresholds=['FSNOSEED'], stream=['ZDCCalib'], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_ZDCPEB_L1ZDC_C', l1SeedThresholds=['FSNOSEED'], stream=['ZDCCalib'], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+        ChainProp(name='HLT_noalg_ZDCPEB_L1ZDC_AND', l1SeedThresholds=['FSNOSEED'], stream=['ZDCCalib'], groups=MinBiasGroup+['PS:Online']+SupportLegGroup),
+ 
     ]
     TriggerFlags.MonitorSlice.signatures   = TriggerFlags.MonitorSlice.signatures() + [
         ChainProp(name='HLT_timeburner_L1All', l1SeedThresholds=['FSNOSEED'], stream=['DISCARD'], groups=['PS:Online','RATE:DISCARD','BW:DISCARD']),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/StreamInfo.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/StreamInfo.py
index 463400ea33bc..cca589465285 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/StreamInfo.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/StreamInfo.py
@@ -70,6 +70,7 @@ _all_streams = [
     StreamInfo('ALFACalib', 'calibration', False, False),
     StreamInfo('LArPEB', 'calibration', False, False),
     StreamInfo('L1TopoMismatches', 'calibration', False, True),
+    StreamInfo('ZDCCalib', 'calibration', False, False),
     # HI STREAMS
     StreamInfo('HardProbes', 'physics', True, True),
     StreamInfo('MinBias', 'physics', True, True),
-- 
GitLab


From d04e882ed3cb32f2dd21335a4ad7d1d45af27ddd Mon Sep 17 00:00:00 2001
From: Adam Edward Barton <adam.edward.barton@cern.ch>
Date: Thu, 16 Sep 2021 20:01:56 +0200
Subject: [PATCH 158/347] Allow VertexPointEstimator to return early to prevent
 FPE errors ATR-24159

---
 .../InDetConversionFinderTools/VertexPointEstimator.h    | 1 +
 .../src/VertexPointEstimator.cxx                         | 9 ++++++++-
 .../test/VertexPointEstimator_test.cxx                   | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/InnerDetector/InDetRecTools/InDetConversionFinderTools/InDetConversionFinderTools/VertexPointEstimator.h b/InnerDetector/InDetRecTools/InDetConversionFinderTools/InDetConversionFinderTools/VertexPointEstimator.h
index 609ecb27eb99..abecc23fdc9a 100644
--- a/InnerDetector/InDetRecTools/InDetConversionFinderTools/InDetConversionFinderTools/VertexPointEstimator.h
+++ b/InnerDetector/InDetRecTools/InDetConversionFinderTools/InDetConversionFinderTools/VertexPointEstimator.h
@@ -86,6 +86,7 @@ namespace InDet {
     std::vector<double> m_maxHl;         /**maximum ratio H/l */
     std::vector<double> m_maxPhi;        /**maximum DPhi at the estimated vertex position */
     double m_maxChi2;                    /** max chi2 of the estimated vertex position*/
+    bool m_returnOnError;
   };
   
 }
diff --git a/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/VertexPointEstimator.cxx b/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/VertexPointEstimator.cxx
index 684aa92d8cd8..f8aebc6deb13 100644
--- a/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/VertexPointEstimator.cxx
+++ b/InnerDetector/InDetRecTools/InDetConversionFinderTools/src/VertexPointEstimator.cxx
@@ -27,7 +27,7 @@ namespace InDet {
   // ----------------------------------
   VertexPointEstimator::VertexPointEstimator(const std::string& type, const std::string& name, const IInterface* parent) :
     AthAlgTool(type, name, parent),
-    m_maxChi2(20.)
+    m_maxChi2(20.), m_returnOnError(true)
   {
     declareInterface<VertexPointEstimator>(this);
     /// Cuts for selecting track pairs
@@ -77,6 +77,7 @@ namespace InDet {
     declareProperty("MaxDeltaR",              m_maxDr);
     declareProperty("MaxHl",                  m_maxHl);
     declareProperty("MaxPhi",                 m_maxPhi);
+    declareProperty("ReturnOnError",          m_returnOnError);
   }
 
   // ----------------------------------
@@ -246,6 +247,7 @@ namespace InDet {
     if (D == 0.) {
       ATH_MSG_DEBUG("Concentric circles, should not happen return (0,0,0)");
       errorcode = 1;
+      if(m_returnOnError) return intPoint;
     }
     U = D - RA[0] - RA[1]; // signed separation, if > 0., the circles do not intersect, if < 0., they might
     //  rotate, translate to a system, where the two circle centres lie on the X axis
@@ -312,6 +314,7 @@ namespace InDet {
         //Cut if distance of minimum approach is too big
         ATH_MSG_DEBUG("XY distance of minimum approach is too large, return (0,0,0)");
         errorcode = 2;
+        if(m_returnOnError) return intPoint;
       }
     }
     
@@ -351,6 +354,7 @@ namespace InDet {
     if (std::max(A,B) < minArcLength || std::max(A,B) > maxArcLength) {          // limit the minimum arc length
       ATH_MSG_DEBUG("Unacceptable arc length");
       errorcode = 5;
+      if(m_returnOnError) return intPoint;
     }
     
     int J = 0;
@@ -364,17 +368,20 @@ namespace InDet {
     if(deltaR>maxDr || deltaR<minDr){
       ATH_MSG_DEBUG("Unaceptable circle distance");
       errorcode = 6;
+      if(m_returnOnError) return intPoint;
     }
     
     if(hl>maxHl){
       ATH_MSG_DEBUG("Unacceptable h/D ratio");
       errorcode = 7;
+      if(m_returnOnError) return intPoint;
     }
     
     deltaPhi = PHI; // quick fix: cannot get rid of (double) PHI as it is passed by ref and deltaPhi is a float
     if(deltaPhi>maxPhi){
       ATH_MSG_DEBUG("Unacceptable difference in phi");
       errorcode = 8;
+      if(m_returnOnError) return intPoint;
     }
 
     return intPoint;
diff --git a/InnerDetector/InDetRecTools/InDetConversionFinderTools/test/VertexPointEstimator_test.cxx b/InnerDetector/InDetRecTools/InDetConversionFinderTools/test/VertexPointEstimator_test.cxx
index 0e7295d387a7..3e64c80df567 100644
--- a/InnerDetector/InDetRecTools/InDetConversionFinderTools/test/VertexPointEstimator_test.cxx
+++ b/InnerDetector/InDetRecTools/InDetConversionFinderTools/test/VertexPointEstimator_test.cxx
@@ -112,7 +112,7 @@ int main()
 
   ToolHandle<InDet::VertexPointEstimator> tool ("InDet::VertexPointEstimator");
   assert( tool.retrieve().isSuccess() );
-
+  tool->setProperty("ReturnOnError", false).ignore();
   test1 (*tool);
 
   return 0;
-- 
GitLab


From 768c82f9f3345c789d5d6be18a16f9d2f78b823e Mon Sep 17 00:00:00 2001
From: Daniele Zanzi <daniele.zanzi@cern.ch>
Date: Thu, 16 Sep 2021 20:13:57 +0200
Subject: [PATCH 159/347] test triggers for 4mu (ATR-22782)

---
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    |  10 ++
 .../share/ref_v1Dev_decodeBS_build.ref        |  10 ++
 .../python/HLTMenuConfig/Menu/LS2_v1.py       |   7 +
 .../TriggerMenuMT/python/L1/Config/ItemDef.py |   7 +
 .../python/L1/Config/TopoAlgoDef.py           | 162 +++++++-----------
 .../python/L1/Menu/Menu_MC_pp_v8.py           |   6 +-
 .../python/L1/Menu/Menu_MC_pp_v8_inputs.py    |  54 +++---
 7 files changed, 130 insertions(+), 126 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index ef4d01498a13..59fab20f0fac 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -463,6 +463,16 @@ HLT_2mu4_L12MU3V:
     1: 6
     2: 10
     3: 8
+HLT_2mu4_L1BPH-0M16-15DR99-2MU3V:
+  eventCount: 0
+HLT_2mu4_L1BPH-0M16-20DR99-2MU3V:
+  eventCount: 0
+HLT_2mu4_L1BPH-8M15-15DR99-2MU3V:
+  eventCount: 0
+HLT_2mu4_L1BPH-8M15-20DR99-2MU3V:
+  eventCount: 0
+HLT_2mu4_L1BPH-8M15-20DR99-C-2MU3V:
+  eventCount: 0
 HLT_2mu4_bBmumu_L1BPH-2M9-0DR15-2MU3V:
   eventCount: 0
 HLT_2mu4_bBmumu_Lxy0_L1BPH-2M9-0DR15-2MU3V:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 0e0f85158dac..a3166c83e5d9 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -161,6 +161,16 @@ HLT_2mu4_L12MU3V:
     0: 1
   stepFeatures:
     0: 2
+HLT_2mu4_L1BPH-0M16-15DR99-2MU3V:
+  eventCount: 0
+HLT_2mu4_L1BPH-0M16-20DR99-2MU3V:
+  eventCount: 0
+HLT_2mu4_L1BPH-8M15-15DR99-2MU3V:
+  eventCount: 0
+HLT_2mu4_L1BPH-8M15-20DR99-2MU3V:
+  eventCount: 0
+HLT_2mu4_L1BPH-8M15-20DR99-C-2MU3V:
+  eventCount: 0
 HLT_2mu4_bBmumu_L1BPH-2M9-0DR15-2MU3V:
   eventCount: 0
 HLT_2mu4_bBmumu_Lxy0_L1BPH-2M9-0DR15-2MU3V:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 75641a8e53be..98347c34eb30 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -159,6 +159,13 @@ def setupMenu():
         ChainProp(name='HLT_3mu4_L1BPH-0M10-3MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
         ChainProp(name='HLT_3mu4_L1BPH-0M10C-3MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
 
+        # ATR-22782
+        ChainProp(name='HLT_2mu4_L1BPH-0M16-20DR99-2MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_2mu4_L1BPH-0M16-15DR99-2MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_2mu4_L1BPH-8M15-20DR99-C-2MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_2mu4_L1BPH-8M15-20DR99-2MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+        ChainProp(name='HLT_2mu4_L1BPH-8M15-15DR99-2MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup),
+
         #ATR-21566, di-muon TLA, TODO: TLA implementation and change stream
         ChainProp(name='HLT_2mu4_os_dRAA12_L1BPH-0DR12C-2MU3V', l1SeedThresholds=['MU3V'], groups=MultiMuonGroup),
  
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
index bb695dae28c8..19d34e9730c1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
@@ -1482,6 +1482,13 @@ class ItemDef:
             MenuItem("L1_2MU5VF-BO"  ).setLogic( d.TOPO_MULT_CMU6ab.x(2) & d.MU5VF.x(2) & physcond)
             MenuItem("L1_MU5VFMU3V-BO").setLogic( d.TOPO_MULT_CMU4ab.x(2) & d.TOPO_MULT_CMU6ab & d.MU5VF & physcond)
 
+            #ATR-22782
+            MenuItem('L1_BPH-0M16-20DR99-2MU3V'       ).setLogic( d.TOPO_0INVM16_20DR99_2MU4ab & physcond)
+            MenuItem('L1_BPH-0M16-15DR99-2MU3V'       ).setLogic( d.TOPO_0INVM16_15DR99_2MU4ab & physcond)
+            MenuItem('L1_BPH-8M15-20DR99-2MU3V'       ).setLogic( d.TOPO_8INVM15_20DR99_2MU4ab & physcond)
+            MenuItem('L1_BPH-8M15-15DR99-2MU3V'       ).setLogic( d.TOPO_8INVM15_15DR99_2MU4ab & physcond)
+            MenuItem('L1_BPH-8M15-20DR99-C-2MU3V'     ).setLogic( d.TOPO_8INVM15_20DR99_C_2MU4ab & physcond)
+
             # ATR-19510, SM Low-mass DY
             MenuItem('L1_DY-BOX-2MU3V' ).setLogic( d.TOPO_5DETA99_5DPHI99_2MU4ab & d.MU3V.x(2) & physcond)
             MenuItem('L1_DY-BOX-MU5VFMU3V').setLogic( d.TOPO_5DETA99_5DPHI99_MU6ab_MU4ab & d.MU5VF & physcond)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
index c96281b8b6b8..fa001fd0875c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
@@ -1346,109 +1346,71 @@ class TopoAlgoDef:
         tm.registerTopoAlgo(alg)
 
 
-        #ATR-19720, L1_BPH-8M15-0DR22-2MU6
+        #ATR-19720 and ATR-22782, BPH DR+M dimuon, 1 input list
         # TODO: update with phase1 muons
-        toponame = "8INVM15-0DR22-2MU6ab"
-        log.debug("Define %s", toponame)
-        inputList = ['MUab']
-        alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame )
-        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinMSqr',     8*8*_et_conversion*_et_conversion)
-        alg.addvariable('MaxMSqr',   15*15*_et_conversion*_et_conversion)
-        alg.addvariable('MinET1',        6*_et_conversion)
-        alg.addvariable('MinET2',        6*_et_conversion)
-        alg.addvariable('DeltaRMin',     0*_dr_conversion*_dr_conversion)
-        alg.addvariable('DeltaRMax', 22*22*_dr_conversion*_dr_conversion)
-        tm.registerTopoAlgo(alg)
-
-        #ATR-19720, L1_BPH-2M9-2DR15-2MU6
-        # TODO: update with phase1 muons
-        toponame = "2INVM9-2DR15-2MU6ab"
-        log.debug("Define %s", toponame)
-        inputList = ['MUab']
-        alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame )
-        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinMSqr',     2*2*_et_conversion*_et_conversion)
-        alg.addvariable('MaxMSqr',     9*9*_et_conversion*_et_conversion)
-        alg.addvariable('MinET1',        6*_et_conversion)
-        alg.addvariable('MinET2',        6*_et_conversion)
-        alg.addvariable('DeltaRMin',   2*2*_dr_conversion*_dr_conversion)
-        alg.addvariable('DeltaRMax', 15*15*_dr_conversion*_dr_conversion)
-        tm.registerTopoAlgo(alg)
-
-        #ATR-19720, L1_BPH-2M9-0DR15-MU6MU4
-        # TODO: update with phase1 muons
-        toponame = "2INVM9-0DR15-MU6ab-MU4ab"
-        log.debug("Define %s", toponame)
-        inputList = ['MUab']
-        alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame )
-        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinMSqr',     2*2*_et_conversion*_et_conversion)
-        alg.addvariable('MaxMSqr',     9*9*_et_conversion*_et_conversion)
-        alg.addvariable('MinET1',        6*_et_conversion)
-        alg.addvariable('MinET2',        4*_et_conversion)
-        alg.addvariable('DeltaRMin',     0*_dr_conversion*_dr_conversion)
-        alg.addvariable('DeltaRMax', 15*15*_dr_conversion*_dr_conversion)
-        tm.registerTopoAlgo(alg)
-
-        #ATR-19639, L1_BPH-2M9-0DR15-C-MU6MU4, with opposite charge
-        # TODO: update with phase1 muons
-        toponame = "2INVM9-0DR15-C-MU6ab-MU4ab"
-        log.debug("Define %s", toponame)
-        inputList = ['MUab']
-        alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1Charge( name = toponame, inputs = inputList, outputs = toponame )
-        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinMSqr',     2*2*_et_conversion*_et_conversion)
-        alg.addvariable('MaxMSqr',     9*9*_et_conversion*_et_conversion)
-        alg.addvariable('MinET1',        6*_et_conversion)
-        alg.addvariable('MinET2',        4*_et_conversion)
-        alg.addvariable('DeltaRMin',     0*_dr_conversion*_dr_conversion)
-        alg.addvariable('DeltaRMax', 15*15*_dr_conversion*_dr_conversion)
-        tm.registerTopoAlgo(alg)
-
-        #ATR-19720, L1_BPH-8M15-0DR22-MU6MU4-BO
-        # TODO: update with phase1 muons
-        toponame = "8INVM15-0DR22-MU6ab-MU4ab"
-        log.debug("Define %s", toponame)
-        inputList = ['MUab']
-        alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame )
-        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinMSqr',     8*8*_et_conversion*_et_conversion)
-        alg.addvariable('MaxMSqr',   15*15*_et_conversion*_et_conversion)
-        alg.addvariable('MinET1',        6*_et_conversion)
-        alg.addvariable('MinET2',        4*_et_conversion)
-        alg.addvariable('DeltaRMin',     0*_dr_conversion*_dr_conversion)
-        alg.addvariable('DeltaRMax', 22*22*_dr_conversion*_dr_conversion)
-        tm.registerTopoAlgo(alg)
+        listofalgos=[
+            {"minInvm": 8, "maxInvm": 15, "minDr": 0, "maxDr": 22, "mult": 2, "otype" : "MU", "ocut1": 6,  "olist" : "ab", "ocut2": 6,}, #8INVM15-0DR22-2MU6ab 
+            {"minInvm": 2, "maxInvm": 9,  "minDr": 2, "maxDr": 15, "mult": 2, "otype" : "MU", "ocut1": 6,  "olist" : "ab", "ocut2": 6,}, #2INVM9-2DR15-2MU6ab 
+            {"minInvm": 2, "maxInvm": 9,  "minDr": 0, "maxDr": 15, "mult": 1, "otype" : "MU", "ocut1": 6,  "olist" : "ab", "ocut2": 4,}, #2INVM9-0DR15-MU6ab-MU4ab 
+            {"minInvm": 8, "maxInvm": 15, "minDr": 0, "maxDr": 22, "mult": 1, "otype" : "MU", "ocut1": 6,  "olist" : "ab", "ocut2": 4,}, #8INVM15-0DR22-MU6ab-MU4ab
+            {"minInvm": 2, "maxInvm": 9,  "minDr": 0, "maxDr": 15, "mult": 2, "otype" : "MU", "ocut1": 4,  "olist" : "ab", "ocut2": 4,}, #2INVM9-0DR15-2MU4ab
+
+            {"minInvm": 0, "maxInvm": 16, "minDr": 20, "maxDr": 99, "mult": 2, "otype" : "MU", "ocut1": 4,  "olist" : "ab", "ocut2": 4,}, #0INVM16-20DR99-2MU4ab
+            {"minInvm": 0, "maxInvm": 16, "minDr": 15, "maxDr": 99, "mult": 2, "otype" : "MU", "ocut1": 4,  "olist" : "ab", "ocut2": 4,}, #0INVM16-15DR99-2MU4ab
+            {"minInvm": 8, "maxInvm": 15, "minDr": 20, "maxDr": 99, "mult": 2, "otype" : "MU", "ocut1": 4,  "olist" : "ab", "ocut2": 4,}, #8INVM15-20DR99-2MU4ab
+            {"minInvm": 8, "maxInvm": 15, "minDr": 15, "maxDr": 99, "mult": 2, "otype" : "MU", "ocut1": 4,  "olist" : "ab", "ocut2": 4,}, #8INVM15-15DR99-2MU4ab
+        ]
+        for x in listofalgos:
+            class d:
+                pass
+            for k in x:
+                setattr (d, k, x[k])
+            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype, str(d.ocut1), d.olist)
+            obj2 = "-%s%s%s" % (d.otype, str(d.ocut2), d.olist)
+            toponame = "%iINVM%i-%iDR%i-%s%s"  % (d.minInvm, d.maxInvm, d.minDr, d.maxDr, obj1, "" if d.mult>1 else obj2)
+            log.debug("Define %s", toponame)
+            inputList = [d.otype + d.olist] 
+            algoname = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1
+            alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ])
+            alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+            alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+            alg.addgeneric('NumResultBits', 1)
+            alg.addvariable('MinET1',    d.ocut1*_et_conversion)
+            alg.addvariable('MinET2',    d.ocut2*_et_conversion)
+            alg.addvariable('MinMSqr',   d.minInvm*d.minInvm*_et_conversion*_et_conversion)
+            alg.addvariable('MaxMSqr',   d.maxInvm*d.maxInvm*_et_conversion*_et_conversion)
+            alg.addvariable('DeltaRMin', d.minDr*d.minDr*_dr_conversion*_dr_conversion)
+            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr*_dr_conversion*_dr_conversion)
+            tm.registerTopoAlgo(alg)
 
-        #ATR-19720, L1_BPH-2M9-0DR15-2MU4
+        #ATR-19639 and ATR-22782, BPH DR+M+OS dimuon, 1 input list
         # TODO: update with phase1 muons
-        toponame = "2INVM9-0DR15-2MU4ab"
-        log.debug("Define %s", toponame)
-        inputList = ['MUab']
-        alg = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame )
-        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinMSqr',     2*2*_et_conversion*_et_conversion)
-        alg.addvariable('MaxMSqr',     9*9*_et_conversion*_et_conversion)
-        alg.addvariable('MinET1',        4*_et_conversion)
-        alg.addvariable('MinET2',        4*_et_conversion)
-        alg.addvariable('DeltaRMin',     0*_dr_conversion*_dr_conversion)
-        alg.addvariable('DeltaRMax', 15*15*_dr_conversion*_dr_conversion)
-        tm.registerTopoAlgo(alg)
-       
-
+        listofalgos=[
+            {"minInvm": 2, "maxInvm": 9,  "minDr": 0, "maxDr": 15, "mult": 1, "otype" : "MU", "ocut1": 6,  "olist" : "ab", "ocut2": 4,}, #2INVM9-0DR15-C-MU6ab-MU4ab 
+            {"minInvm": 8, "maxInvm": 15, "minDr": 20, "maxDr": 99, "mult": 2, "otype" : "MU", "ocut1": 4,  "olist" : "ab", "ocut2": 4,}, #8INVM15-20DR99-C-2MU4ab
+        ]
+        for x in listofalgos:
+            class d:
+                pass
+            for k in x:
+                setattr (d, k, x[k])
+            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype, str(d.ocut1), d.olist)
+            obj2 = "-%s%s%s" % (d.otype, str(d.ocut2), d.olist)
+            toponame = "%iINVM%i-%iDR%i-C-%s%s"  % (d.minInvm, d.maxInvm, d.minDr, d.maxDr, obj1, "" if d.mult>1 else obj2)
+            log.debug("Define %s", toponame)
+            inputList = [d.otype + d.olist]
+            algoname = AlgConf.InvariantMassInclusiveDeltaRSqrIncl1Charge
+            alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ])
+            alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
+            alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
+            alg.addgeneric('NumResultBits', 1)
+            alg.addvariable('MinET1',    d.ocut1*_et_conversion)
+            alg.addvariable('MinET2',    d.ocut2*_et_conversion)
+            alg.addvariable('MinMSqr',   d.minInvm*d.minInvm*_et_conversion*_et_conversion)
+            alg.addvariable('MaxMSqr',   d.maxInvm*d.maxInvm*_et_conversion*_et_conversion)
+            alg.addvariable('DeltaRMin', d.minDr*d.minDr*_dr_conversion*_dr_conversion)
+            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr*_dr_conversion*_dr_conversion)
+            tm.registerTopoAlgo(alg)
 
  
         # CEP_CjJ
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
index 7282b2e218f4..2cf10d6e5761 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
@@ -317,7 +317,11 @@ def defineMenu():
         'L1_BPH-0M10C-3MU3V',
         #ATR-21566 
         'L1_BPH-0DR12C-2MU3V',
-         
+
+        #ATR-22782
+        'L1_BPH-0M16-20DR99-2MU3V', 'L1_BPH-0M16-15DR99-2MU3V',
+        'L1_BPH-8M15-20DR99-C-2MU3V', 'L1_BPH-8M15-20DR99-2MU3V', 'L1_BPH-8M15-15DR99-2MU3V',          
+
         # INVM + DPHI 
         'L1_jMJJ-400-NFF-0DPHI22',
         'L1_jMJJ-400-NFF-0DPHI24',
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
index 1c3df87f8fd1..43471727c35c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
@@ -147,20 +147,19 @@ def defineInputsMenu():
                 "fpga" : 0,
                 "clock" : 0,
                 "algorithms" : [
-                    TopoMenuDef( '2DISAMB-jJ25ab-0DR25-eTAU20abi-eTAU12abi',   outputbits = 0 ),
-                    TopoMenuDef( '2DISAMB-jJ25ab-0DR28-eTAU20abi-eTAU12abi',   outputbits = 1 ),
-                    TopoMenuDef( 'jINVM_DPHI_NFF',                             outputbits = (2,5), outputlines = ['400INVM-0DPHI26-jJ30s6-AjJ20s6',
-                                                                                                                  '400INVM-0DPHI24-jJ30s6-AjJ20s6',
-                                                                                                                  '400INVM-0DPHI22-jJ30s6-AjJ20s6',
-                                                                                                                  '400INVM-0DPHI20-jJ30s6-AjJ20s6'] ),
-                    TopoMenuDef( '0INVM10-3MU4ab',                             outputbits = 6 ), #BLS
-                    TopoMenuDef( 'LATE-MU10s1',                                outputbits = 7 ),
-                    TopoMenuDef( 'MULT-CMU4ab',                                outputbits = (8,9), outputlines = ['MULT-CMU4ab[0]', 'MULT-CMU4ab[1]'] ), # BLS, 2bits  # TODO: needed?
-                    TopoMenuDef( 'MULT-CMU6ab',                                outputbits = (10,11), outputlines = ['MULT-CMU6ab[0]', 'MULT-CMU6ab[1]'] ), # BLS, 2bits # TODO: needed?
-                    TopoMenuDef( '0DR04-MU4ab-CjJ15ab',                        outputbits = 12 ), #Bjet, TODO: not a primary
-                    TopoMenuDef( '0DR04-MU6ab-CjJ20ab',                        outputbits = 13 ), #Bjet, TODO: not a primary
-                    TopoMenuDef( '0INVM10C-3MU4ab',                            outputbits = 14 ), #BLS
-                    TopoMenuDef( '2INVM9-0DR15-C-MU6ab-MU4ab',                 outputbits = 15 ), #BLS 
+                    TopoMenuDef( '8INVM15-20DR99-C-2MU4ab',                    outputbits = 0 ), #BLS, test
+                    TopoMenuDef( '0INVM16-20DR99-2MU4ab',                      outputbits = 1 ), #BLS, test
+                    TopoMenuDef( '0INVM16-15DR99-2MU4ab',                      outputbits = 2 ), #BLS, test
+                    TopoMenuDef( '8INVM15-20DR99-2MU4ab',                      outputbits = 3 ), #BLS, test
+                    TopoMenuDef( '8INVM15-15DR99-2MU4ab',                      outputbits = 4 ), #BLS, test
+                    TopoMenuDef( '0INVM10-3MU4ab',                             outputbits = 5 ), #BLS
+                    TopoMenuDef( 'LATE-MU10s1',                                outputbits = 6 ),
+                    TopoMenuDef( 'MULT-CMU4ab',                                outputbits = (7,8), outputlines = ['MULT-CMU4ab[0]', 'MULT-CMU4ab[1]'] ), # BLS, 2bits  # TODO: needed?
+                    TopoMenuDef( 'MULT-CMU6ab',                                outputbits = (9,10), outputlines = ['MULT-CMU6ab[0]', 'MULT-CMU6ab[1]'] ), # BLS, 2bits # TODO: needed?
+                    TopoMenuDef( '0DR04-MU4ab-CjJ15ab',                        outputbits = 11 ), #Bjet, TODO: not a primary
+                    TopoMenuDef( '0DR04-MU6ab-CjJ20ab',                        outputbits = 12 ), #Bjet, TODO: not a primary
+                    TopoMenuDef( '0INVM10C-3MU4ab',                            outputbits = 13 ), #BLS
+                    TopoMenuDef( '2INVM9-0DR15-C-MU6ab-MU4ab',                 outputbits = 14 ), #BLS 
                 ]
             },            
 
@@ -168,16 +167,10 @@ def defineInputsMenu():
                 "fpga" : 0,
                 "clock" : 1,
                 "algorithms" : [
-                    TopoMenuDef( '0DR25-eTAU20abi-eTAU12abi',                  outputbits = 0 ),
-                    TopoMenuDef( '0DR28-eTAU20abi-eTAU12abi',                  outputbits = 1 ), 
-                    TopoMenuDef( 'jINVM',                                       outputbits = (2,5), outputlines = ['300INVM-AjJ30s6-AjJ20s6',
-                                                                                                                  '400INVM-AjJ30s6-AjJ20s6',
-                                                                                                                  '500INVM-AjJ30s6-AjJ20s6', 
-                                                                                                                  '700INVM-AjJ30s6-AjJ20s6'] ),
-                    TopoMenuDef( 'jINVM_DPHI',                                  outputbits = (6,9), outputlines = ['400INVM-0DPHI26-AjJ30s6-AjJ20s6',
-                                                                                                                   '400INVM-0DPHI24-AjJ30s6-AjJ20s6',
-                                                                                                                   '400INVM-0DPHI22-AjJ30s6-AjJ20s6',
-                                                                                                                   '400INVM-0DPHI20-AjJ30s6-AjJ20s6'] ),
+                    TopoMenuDef( '2DISAMB-jJ25ab-0DR25-eTAU20abi-eTAU12abi',   outputbits = 0 ),
+                    TopoMenuDef( '2DISAMB-jJ25ab-0DR28-eTAU20abi-eTAU12abi',   outputbits = 1 ),
+                    TopoMenuDef( '0DR25-eTAU20abi-eTAU12abi',                  outputbits = 2 ),
+                    TopoMenuDef( '0DR28-eTAU20abi-eTAU12abi',                  outputbits = 3 ), 
                 ]
             },
             
@@ -206,7 +199,18 @@ def defineInputsMenu():
                 "fpga" : 1,
                 "clock" : 1,
                 "algorithms" : [
-                    # EMPTY SO FAR...
+                    TopoMenuDef( 'jINVM_DPHI_NFF',                             outputbits = (0,3), outputlines = ['400INVM-0DPHI26-jJ30s6-AjJ20s6',
+                                                                                                                  '400INVM-0DPHI24-jJ30s6-AjJ20s6',
+                                                                                                                  '400INVM-0DPHI22-jJ30s6-AjJ20s6',
+                                                                                                                  '400INVM-0DPHI20-jJ30s6-AjJ20s6'] ),
+                    TopoMenuDef( 'jINVM',                                       outputbits = (4,7), outputlines = ['300INVM-AjJ30s6-AjJ20s6',
+                                                                                                                  '400INVM-AjJ30s6-AjJ20s6',
+                                                                                                                  '500INVM-AjJ30s6-AjJ20s6',
+                                                                                                                  '700INVM-AjJ30s6-AjJ20s6'] ),
+                    TopoMenuDef( 'jINVM_DPHI',                                  outputbits = (8,11), outputlines = ['400INVM-0DPHI26-AjJ30s6-AjJ20s6',
+                                                                                                                   '400INVM-0DPHI24-AjJ30s6-AjJ20s6',
+                                                                                                                   '400INVM-0DPHI22-AjJ30s6-AjJ20s6',
+                                                                                                                   '400INVM-0DPHI20-AjJ30s6-AjJ20s6'] ),
                 ]
             }
         ]
-- 
GitLab


From 3a053c77773e60af3f980b414237a35b4766b3d1 Mon Sep 17 00:00:00 2001
From: Minlin Wu <minlin.wu@cern.ch>
Date: Thu, 16 Sep 2021 20:16:22 +0200
Subject: [PATCH 160/347] MuonPRDTest: Fix CSC tester and CSC/TGC Digit
 Positions

---
 .../MuonPRDTest/share/NSWPRDValAlg.reco.py    |   1 +
 .../MuonPRDTest/src/CSCDigitVariables.cxx     | 203 ++++++------------
 .../MuonPRDTest/src/CSCDigitVariables.h       |  48 ++---
 .../MuonPRDTest/src/CSCSDOVariables.cxx       |  68 +++---
 .../MuonPRDTest/src/CSCSDOVariables.h         |   4 +-
 .../MuonPRDTest/src/NSWPRDValAlg.cxx          |   4 +
 .../MuonPRDTest/src/NSWPRDValAlg.h            |   3 +
 .../MuonPRDTest/src/TGCDigitVariables.cxx     |  36 +++-
 8 files changed, 157 insertions(+), 210 deletions(-)

diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/share/NSWPRDValAlg.reco.py b/MuonSpectrometer/MuonValidation/MuonPRDTest/share/NSWPRDValAlg.reco.py
index a972cb093aed..fd3b60fe3009 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/share/NSWPRDValAlg.reco.py
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/share/NSWPRDValAlg.reco.py
@@ -45,6 +45,7 @@ NSWPRDValAlg.doTGCRDO = False
 NSWPRDValAlg.doTGCPRD = False
 
 NSWPRDValAlg.doCSCHit = False # no CSC_Hits present in RDO files
+NSWPRDValAlg.doCSCSDO = True
 NSWPRDValAlg.doCSCDigit = False # no CSC_DIGITS present in RDO files
 NSWPRDValAlg.doCSCRDO = False
 NSWPRDValAlg.doCSCPRD = False
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.cxx
index 172ab6bf89ee..56ea0840b9dd 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.cxx
@@ -5,8 +5,6 @@
 #include "CSCDigitVariables.h"
 #include "AthenaKernel/errorcheck.h"
 
-#include "MuonSimData/CscSimDataCollection.h"
-
 #include "MuonDigitContainer/CscDigitContainer.h"
 #include "MuonDigitContainer/CscDigit.h"
 
@@ -24,10 +22,6 @@ StatusCode CSCDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* M
   // clear variables
   CHECK( this->clearVariables() );
 
-  // get truth information container of digitization
-  const CscSimDataCollection* csc_SdoContainer = nullptr;
-  CHECK( m_evtStore->retrieve(csc_SdoContainer, "CSC_SDO") );
-
   // get digit container (a container corresponds to a multilayer of a module)
   const CscDigitContainer *csc_DigitContainer = nullptr;
   CHECK( m_evtStore->retrieve(csc_DigitContainer, m_ContainerName.c_str()) );
@@ -39,11 +33,9 @@ StatusCode CSCDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* M
     // a digit collection is instanciated for each container, i.e. holds all digits of a multilayer
     const CscDigitCollection* coll = it;
 
-    // loop on all digits inside a collection, i.e. multilayer
-    for (unsigned int item=0; item<coll->size(); item++) {
+    for (auto digit: *coll) {
 
       // get specific digit and identify it
-      const CscDigit* digit = coll->at(item);
       Identifier Id = digit->identify();
 
       std::string stName   = m_CscIdHelper->stationNameString(m_CscIdHelper->stationName(Id));
@@ -52,11 +44,9 @@ StatusCode CSCDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* M
       int chlayer          = m_CscIdHelper->chamberLayer(Id);
       int wlayer           = m_CscIdHelper->wireLayer(Id);
       int gas_gap          = m_CscIdHelper->gasGap(Id);
-      // channel here seems to be sth like the channel/strip closest to the initial Geant4 hit
-      // that is entering the digitzation process (probably only of limited use)
       int channel          = m_CscIdHelper->strip(Id);
     
-      ATH_MSG_DEBUG(     "MicroMegas Digit Offline id:  Station Name [" << stName << " ]"
+      ATH_MSG_DEBUG(     "CSC Digit Offline id:  Station Name [" << stName << " ]"
                       << " Station Eta ["  << stationEta      << "]"
                       << " Station Phi ["  << stationPhi      << "]"
                       << " ChamberLayer  ["   << chlayer       << "]"
@@ -66,61 +56,57 @@ StatusCode CSCDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* M
 
       // module details down to the level of channel which is closest to the Geant4 hit
       // to be stored in the ntuple
-      m_CSC_dig_stationName->push_back(stName);
-      m_CSC_dig_stationEta->push_back(stationEta);
-      m_CSC_dig_stationPhi->push_back(stationPhi);
-      m_CSC_dig_chlayer->push_back(chlayer);
-      m_CSC_dig_wlayer->push_back(wlayer);
-      m_CSC_dig_gas_gap->push_back(gas_gap);
-      m_CSC_dig_channel->push_back(channel);
+      m_CSC_dig_stationName.push_back(stName);
+      m_CSC_dig_stationEta.push_back(stationEta);
+      m_CSC_dig_stationPhi.push_back(stationPhi);
+      m_CSC_dig_chlayer.push_back(chlayer);
+      m_CSC_dig_wlayer.push_back(wlayer);
+      m_CSC_dig_gas_gap.push_back(gas_gap);
+      m_CSC_dig_channel.push_back(channel);
 
       const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(Id);
-      if (!rdoEl) throw std::runtime_error(Form("File: %s, Line: %d\nCSCDigitVariables::fillVariables() - Failed to retrieve CscReadoutElement for %s", __FILE__, __LINE__, m_CscIdHelper->print_to_string(Id).c_str()));
-
-      // retrieve the MC truth associated with the digit (means the Geant4 hit information)
-      if (csc_SdoContainer) {
-        // search the truth container with the Id of the digit
-        const CscSimData csc_sdo = (csc_SdoContainer->find(Id))->second;
-        std::vector<CscSimData::Deposit> deposits;
-        // get the truth deposits
-        csc_sdo.deposits(deposits);
-
-        // use the information of the first deposit
-        int    truth_barcode   = deposits[0].first.barcode();
-        double truth_localPosX = deposits[0].second.zpos();
-        double truth_localPosY = deposits[0].second.ypos();
-        double truth_charge    = deposits[0].second.charge();
-
-        // get global and local coordinates of this first deposit
-        Amg::Vector2D hit_on_surface(truth_localPosX, truth_localPosY);
-        Amg::Vector3D hit_gpos(0., 0., 0.);
-        rdoEl->surface(Id).localToGlobal(hit_on_surface, Amg::Vector3D(0., 0., 0.), hit_gpos);
-
-        ATH_MSG_DEBUG("CSC Digit, truth barcode=" << truth_barcode);
-        ATH_MSG_DEBUG("CSC Digit, truth localPosX=" << std::setw(9) << std::setprecision(2) << truth_localPosX
-                      << ", truth localPosY=" << std::setw(9) << std::setprecision(2) << truth_localPosY
-                      << ", truth charge=" << std::setw(8) << std::setprecision(5) << truth_charge);
-
-        // truth information like positions and barcode
-        // to be stored in the ntuple
-        m_CSC_dig_truth_barcode->push_back( truth_barcode );
-        m_CSC_dig_truth_localPosX->push_back( truth_localPosX );
-        m_CSC_dig_truth_localPosY->push_back( truth_localPosY );
-
-        m_CSC_dig_truth_globalPosX->push_back( hit_gpos[0] );
-        m_CSC_dig_truth_globalPosY->push_back( hit_gpos[1] );
-        m_CSC_dig_truth_globalPosZ->push_back( hit_gpos[2] );
-
-        m_CSC_dig_truth_charge->push_back( truth_charge );
-
-      }
+	  if (!rdoEl) {
+	    ATH_MSG_ERROR("CSCDigitVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ << m_CscIdHelper->print_to_string(Id).c_str());
+	    return StatusCode::FAILURE;
+	  }
+
 
+      Amg::Vector3D gpos(0.,0.,0.);
+      Amg::Vector2D lpos(0.,0.);
+
+      rdoEl->surface(Id).localToGlobal(lpos,gpos,gpos);
+
+      m_CSC_dig_globalPosX.push_back( gpos.x() );
+      m_CSC_dig_globalPosY.push_back( gpos.y() );
+      m_CSC_dig_globalPosZ.push_back( gpos.z() );
+      
       // digit counter for the ntuple
       m_CSC_nDigits++;
     }
+
+    // Local digit position information loss after localToGlobal transformation, fill the local positions in another loop for retrieving the local positions
+    for (auto Digit: *coll) {
+
+      // get specific digit and identify it
+      Identifier id = Digit->identify();
+
+      const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(id);
+	  if (!rdoEl) {
+	    ATH_MSG_ERROR("CSCDigitVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ << m_CscIdHelper->print_to_string(id).c_str());
+	    return StatusCode::FAILURE;
+	  }
+
+      Amg::Vector3D glopos(0.,0.,0.);
+      Amg::Vector2D lopos(0.,0.);
+
+      rdoEl->surface(id).globalToLocal(glopos,glopos,lopos);
+      m_CSC_dig_localPosX.push_back( lopos.x() );
+      m_CSC_dig_localPosY.push_back( lopos.y() );
+    }
+
   }
 
-  ATH_MSG_DEBUG("processed " << m_CSC_nDigits << " MicroMegas hits");
+  ATH_MSG_DEBUG("processed " << m_CSC_nDigits << " CSC hits");
   return StatusCode::SUCCESS;
 }
 
@@ -131,25 +117,19 @@ StatusCode CSCDigitVariables::clearVariables()
 {
   m_CSC_nDigits = 0;
 
-  // information of the module down to the channel closest to the initial G4 hit
-  // size of vector is m_CSC_nDigits
-  m_CSC_dig_stationName->clear();
-  m_CSC_dig_stationEta->clear();
-  m_CSC_dig_stationPhi->clear();
-  m_CSC_dig_chlayer->clear();
-  m_CSC_dig_wlayer->clear();
-  m_CSC_dig_gas_gap->clear();
-  m_CSC_dig_channel->clear();
-
-  // truth information of the (1st) Geant4 hit that caused this
-  // digit to be recorded (size is m_CSC_nDigits)
-  m_CSC_dig_truth_barcode->clear();
-  m_CSC_dig_truth_localPosX->clear();
-  m_CSC_dig_truth_localPosY->clear();
-  m_CSC_dig_truth_globalPosX->clear();
-  m_CSC_dig_truth_globalPosY->clear();
-  m_CSC_dig_truth_globalPosZ->clear();
-  m_CSC_dig_truth_charge->clear();
+  m_CSC_dig_stationName.clear();
+  m_CSC_dig_stationEta.clear();
+  m_CSC_dig_stationPhi.clear();
+  m_CSC_dig_chlayer.clear();
+  m_CSC_dig_wlayer.clear();
+  m_CSC_dig_gas_gap.clear();
+  m_CSC_dig_channel.clear();
+
+  m_CSC_dig_localPosX.clear();
+  m_CSC_dig_localPosY.clear();
+  m_CSC_dig_globalPosX.clear();
+  m_CSC_dig_globalPosY.clear();
+  m_CSC_dig_globalPosZ.clear();
 
   return StatusCode::SUCCESS;
 }
@@ -159,21 +139,6 @@ StatusCode CSCDigitVariables::clearVariables()
 /** ---------- to be called on initialization level of main alg */
 StatusCode CSCDigitVariables::initializeVariables()
 {
-  m_CSC_nDigits = 0;
-  m_CSC_dig_stationName = new std::vector<std::string>;
-  m_CSC_dig_stationEta  = new std::vector<int>();
-  m_CSC_dig_stationPhi  = new std::vector<int>();
-  m_CSC_dig_chlayer   = new std::vector<int>();
-  m_CSC_dig_gas_gap     = new std::vector<int>();
-  m_CSC_dig_channel     = new std::vector<int>();
-
-  m_CSC_dig_truth_barcode    = new std::vector<int>;
-  m_CSC_dig_truth_localPosX  = new std::vector<double>;
-  m_CSC_dig_truth_localPosY  = new std::vector<double>;
-  m_CSC_dig_truth_globalPosX = new std::vector<double>;
-  m_CSC_dig_truth_globalPosY = new std::vector<double>;
-  m_CSC_dig_truth_globalPosZ = new std::vector<double>;
-  m_CSC_dig_truth_charge = new std::vector<double>;
 
   if(m_tree) {
     m_tree->Branch("Digits_CSC",    &m_CSC_nDigits, "Digits_CSC_n/i");
@@ -184,57 +149,17 @@ StatusCode CSCDigitVariables::initializeVariables()
     m_tree->Branch("Digits_CSC_wireLayer",   &m_CSC_dig_wlayer);
     m_tree->Branch("Digits_CSC_gas_gap",     &m_CSC_dig_gas_gap);
     m_tree->Branch("Digits_CSC_channel",     &m_CSC_dig_channel);
-
-    m_tree->Branch("Digits_CSC_truth_barcode",    &m_CSC_dig_truth_barcode);
-    m_tree->Branch("Digits_CSC_truth_localPosX",  &m_CSC_dig_truth_localPosX);
-    m_tree->Branch("Digits_CSC_truth_localPosY",  &m_CSC_dig_truth_localPosY);
-    m_tree->Branch("Digits_CSC_truth_globalPosX", &m_CSC_dig_truth_globalPosX);
-    m_tree->Branch("Digits_CSC_truth_globalPosY", &m_CSC_dig_truth_globalPosY);
-    m_tree->Branch("Digits_CSC_truth_globalPosZ", &m_CSC_dig_truth_globalPosZ);
-    m_tree->Branch("Digits_CSC_truth_charge", &m_CSC_dig_truth_charge);
-
+    m_tree->Branch("Digits_CSC_localPosX",  &m_CSC_dig_localPosX);
+    m_tree->Branch("Digits_CSC_localPosY",  &m_CSC_dig_localPosY);
+    m_tree->Branch("Digits_CSC_globalPosX", &m_CSC_dig_globalPosX);
+    m_tree->Branch("Digits_CSC_globalPosY", &m_CSC_dig_globalPosY);
+    m_tree->Branch("Digits_CSC_globalPosZ", &m_CSC_dig_globalPosZ);
   }
 
   return StatusCode::SUCCESS;
 }
 
-
-/** ---------- freeing resources and resetting pointers */
-/** ---------- to be called on finalize level of main alg */
 void CSCDigitVariables::deleteVariables()
 {
-  delete m_CSC_dig_stationName;
-  delete m_CSC_dig_stationEta;
-  delete m_CSC_dig_stationPhi;
-  delete m_CSC_dig_chlayer;
-  delete m_CSC_dig_wlayer;
-  delete m_CSC_dig_gas_gap;
-  delete m_CSC_dig_channel;
-
-  delete m_CSC_dig_truth_barcode;
-  delete m_CSC_dig_truth_localPosX;
-  delete m_CSC_dig_truth_localPosY;
-  delete m_CSC_dig_truth_globalPosX;
-  delete m_CSC_dig_truth_globalPosY;
-  delete m_CSC_dig_truth_globalPosZ;
-  delete m_CSC_dig_truth_charge;
-
-  m_CSC_nDigits = 0;
-  m_CSC_dig_stationName = nullptr;
-  m_CSC_dig_stationEta = nullptr;
-  m_CSC_dig_stationPhi = nullptr;
-  m_CSC_dig_chlayer = nullptr;
-  m_CSC_dig_wlayer = nullptr;
-  m_CSC_dig_gas_gap = nullptr;
-  m_CSC_dig_channel = nullptr;
-  
-  m_CSC_dig_truth_barcode    = nullptr;
-  m_CSC_dig_truth_localPosX  = nullptr;
-  m_CSC_dig_truth_localPosY  = nullptr;
-  m_CSC_dig_truth_globalPosX = nullptr;
-  m_CSC_dig_truth_globalPosY = nullptr;
-  m_CSC_dig_truth_globalPosZ = nullptr;
-  m_CSC_dig_truth_charge = nullptr;
-
   return;
-}
+}
\ No newline at end of file
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.h
index e1524e617d15..05d643f833e9 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.h
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCDigitVariables.h
@@ -19,23 +19,7 @@ class CSCDigitVariables : public ValAlgVariables
                    TTree* tree,
 						 std::string containername,
 						 MSG::Level msglvl) :
-ValAlgVariables(evtStore, detManager, tree, containername, msglvl),
-    m_CscIdHelper(0),
-    m_CSC_nDigits(0),
-    m_CSC_dig_stationName(0),
-    m_CSC_dig_stationEta(0),
-    m_CSC_dig_stationPhi(0),
-    m_CSC_dig_chlayer(0),
-    m_CSC_dig_wlayer(0),
-    m_CSC_dig_gas_gap(0),
-    m_CSC_dig_channel(0),
-    m_CSC_dig_truth_barcode(0),
-    m_CSC_dig_truth_localPosX(0),
-    m_CSC_dig_truth_localPosY(0),
-    m_CSC_dig_truth_globalPosX(0),
-    m_CSC_dig_truth_globalPosY(0),
-    m_CSC_dig_truth_globalPosZ(0),
-    m_CSC_dig_truth_charge(0)
+    ValAlgVariables(evtStore, detManager, tree, containername, msglvl)
   {
     setHelper(idhelper);
   }
@@ -52,7 +36,7 @@ ValAlgVariables(evtStore, detManager, tree, containername, msglvl),
 
   void setHelper(const MuonIdHelper* idhelper){
     m_CscIdHelper = dynamic_cast<const CscIdHelper*>(idhelper);
-    if(m_CscIdHelper == 0) {
+    if(!m_CscIdHelper) {
        ATH_MSG_ERROR("casting IdHelper to CscIdhelper failed");
        throw;
     }
@@ -64,22 +48,18 @@ ValAlgVariables(evtStore, detManager, tree, containername, msglvl),
   const CscIdHelper* m_CscIdHelper;
 
   int m_CSC_nDigits;
-  std::vector<std::string> *m_CSC_dig_stationName;
-  std::vector<int> *m_CSC_dig_stationEta;
-  std::vector<int> *m_CSC_dig_stationPhi;
-  std::vector<int> *m_CSC_dig_chlayer;
-  std::vector<int> *m_CSC_dig_wlayer;
-  std::vector<int> *m_CSC_dig_gas_gap;
-  std::vector<int> *m_CSC_dig_channel;
-
-  std::vector< int    > *m_CSC_dig_truth_barcode;
-  std::vector< double > *m_CSC_dig_truth_localPosX;
-  std::vector< double > *m_CSC_dig_truth_localPosY;
-  std::vector< double > *m_CSC_dig_truth_globalPosX;
-  std::vector< double > *m_CSC_dig_truth_globalPosY;
-  std::vector< double > *m_CSC_dig_truth_globalPosZ;
-  std::vector< double > *m_CSC_dig_truth_charge;
-
+  std::vector<std::string> m_CSC_dig_stationName;
+  std::vector<int> m_CSC_dig_stationEta;
+  std::vector<int> m_CSC_dig_stationPhi;
+  std::vector<int> m_CSC_dig_chlayer;
+  std::vector<int> m_CSC_dig_wlayer;
+  std::vector<int> m_CSC_dig_gas_gap;
+  std::vector<int> m_CSC_dig_channel;
+  std::vector< double > m_CSC_dig_localPosX;
+  std::vector< double > m_CSC_dig_localPosY;
+  std::vector< double > m_CSC_dig_globalPosX;
+  std::vector< double > m_CSC_dig_globalPosY;
+  std::vector< double > m_CSC_dig_globalPosZ;
 };
 
 #endif // CSCDIGITVARIABLES_H
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCSDOVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCSDOVariables.cxx
index cf08c7e14f10..ecc780c6cc74 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCSDOVariables.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCSDOVariables.cxx
@@ -3,8 +3,9 @@
 */
 
 #include "CSCSDOVariables.h"
-#include "MuonSimData/MuonSimDataCollection.h"
+#include "MuonSimData/CscSimDataCollection.h"
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "MuonReadoutGeometry/CscReadoutElement.h"
 #include "TTree.h"
 
 StatusCode CscSDOVariables::fillVariables(const MuonGM::MuonDetectorManager* MuonDetMgr)
@@ -14,14 +15,14 @@ StatusCode CscSDOVariables::fillVariables(const MuonGM::MuonDetectorManager* Muo
 
   ATH_CHECK( this->clearVariables() );
 
-  ATH_MSG_DEBUG( "Retrieve CSC SDO container with name = " << m_ContainerName.c_str() );
-  const MuonSimDataCollection* cscSdoContainer = nullptr;
-  ATH_CHECK( m_evtStore->retrieve(cscSdoContainer, m_ContainerName.c_str()) );
+  ATH_MSG_DEBUG( "Retrieve CSC SDO container with name = " << "CSC_SDO" );
+  const CscSimDataCollection* cscSdoContainer = nullptr;
+  ATH_CHECK( m_evtStore->retrieve(cscSdoContainer, "CSC_SDO") );
 
   for (const auto& coll : *cscSdoContainer ) {
 
     const Identifier id = coll.first;
-    const MuonSimData csc_sdo = coll.second;
+    const CscSimData csc_sdo = coll.second;
 
     // Get information on the SDO
     std::string stName   = m_CscIdHelper->stationNameString(m_CscIdHelper->stationName(id));
@@ -52,29 +53,48 @@ StatusCode CscSDOVariables::fillVariables(const MuonGM::MuonDetectorManager* Muo
     m_csc_sdo_Strip.push_back(strip);
 
     ATH_MSG_DEBUG( "Get the truth deposits from the SDO." );
-    std::vector<MuonSimData::Deposit> deposits;
+    std::vector<CscSimData::Deposit> deposits;
     csc_sdo.deposits(deposits);
 
-    const Amg::Vector3D hit_gpos = csc_sdo.globalPosition();
-    m_csc_sdo_globalPosX.push_back( hit_gpos.x() );
-    m_csc_sdo_globalPosY.push_back( hit_gpos.y() );
-    m_csc_sdo_globalPosZ.push_back( hit_gpos.z() );
+    int    truth_barcode   = deposits[0].first.barcode();
+    double truth_localPosX = deposits[0].second.zpos();
+    double truth_localPosY = deposits[0].second.ypos();
+    double truth_charge    = deposits[0].second.charge();
 
-    m_csc_sdo_globaltime.push_back( csc_sdo.getTime() );
     m_csc_sdo_word.push_back( csc_sdo.word() );    
 
-    // use the information of the first deposit
-    int barcode = deposits[0].first.barcode();
-    double MuonMCdata_firstentry = deposits[0].second.firstEntry();
-    double MuonMCdata_secondentry = deposits[0].second.secondEntry();
+    const MuonGM::CscReadoutElement* rdoEl = MuonDetMgr->getCscReadoutElement(id);
+	if (!rdoEl) {
+	  ATH_MSG_ERROR("CSCSDOVariables::fillVariables() - Failed to retrieve CscReadoutElement for" << __FILE__ << __LINE__ << m_CscIdHelper->print_to_string(id).c_str());
+	  return StatusCode::FAILURE;
+	}
 
-    ATH_MSG_DEBUG("CSC SDO barcode=" << barcode);
-    ATH_MSG_DEBUG("CSC SDO localPosX=" << std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry
-                               << ", localPosY=" << std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry);
+    Amg::Vector2D hit_on_surface(truth_localPosX, truth_localPosY);
+    Amg::Vector3D hit_gpos(0., 0., 0.);
+    rdoEl->surface(id).localToGlobal(hit_on_surface, Amg::Vector3D(0., 0., 0.), hit_gpos);
+
+    ATH_MSG_DEBUG("CSC Digit, truth barcode=" << truth_barcode);
+    ATH_MSG_DEBUG("CSC Digit, truth localPosX=" << std::setw(9) << std::setprecision(2) << truth_localPosX
+                  << ", truth localPosY=" << std::setw(9) << std::setprecision(2) << truth_localPosY
+                  << ", truth charge=" << std::setw(8) << std::setprecision(5) << truth_charge);
+
+    // truth information like positions and barcode
+    // to be stored in the ntuple
+    m_csc_sdo_barcode.push_back( truth_barcode );
+
+    if ( rdoEl->surface(id).insideBounds(hit_on_surface,0.,0.) ){
+      m_csc_sdo_localPosX.push_back( truth_localPosX );
+      m_csc_sdo_localPosY.push_back( truth_localPosY );
+    }
+
+    if ( rdoEl->surface(id).isOnSurface(hit_gpos,true,0.,0.) ){
+      m_csc_sdo_globalPosX.push_back( hit_gpos[0] );
+      m_csc_sdo_globalPosY.push_back( hit_gpos[1] );
+      m_csc_sdo_globalPosZ.push_back( hit_gpos[2] );
+    }
+
+    m_csc_sdo_charge.push_back( truth_charge );
 
-    m_csc_sdo_barcode.push_back( barcode );
-    m_csc_sdo_localPosX.push_back( MuonMCdata_firstentry );
-    m_csc_sdo_localPosY.push_back( MuonMCdata_secondentry );
 
     m_csc_nsdo++;
   }
@@ -97,7 +117,7 @@ StatusCode CscSDOVariables::clearVariables()
   m_csc_sdo_globalPosX.clear();
   m_csc_sdo_globalPosY.clear();
   m_csc_sdo_globalPosZ.clear();
-  m_csc_sdo_globaltime.clear();
+  m_csc_sdo_charge.clear();
   m_csc_sdo_localPosX.clear();
   m_csc_sdo_localPosY.clear();
   return StatusCode::SUCCESS;
@@ -120,9 +140,9 @@ StatusCode CscSDOVariables::initializeVariables()
     m_tree->Branch("SDO_CSC_globalPosX",    &m_csc_sdo_globalPosX);
     m_tree->Branch("SDO_CSC_globalPosY",    &m_csc_sdo_globalPosY);
     m_tree->Branch("SDO_CSC_globalPosZ",    &m_csc_sdo_globalPosZ);
-    m_tree->Branch("SDO_CSC_global_time",   &m_csc_sdo_globaltime);
+    m_tree->Branch("SDO_CSC_charge",      &m_csc_sdo_charge);
     m_tree->Branch("SDO_CSC_localPosX",     &m_csc_sdo_localPosX);
     m_tree->Branch("SDO_CSC_localPosY",     &m_csc_sdo_localPosY);
   }
   return StatusCode::SUCCESS;
-}
+}
\ No newline at end of file
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCSDOVariables.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCSDOVariables.h
index 02d9be1c4135..843266ba3e58 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCSDOVariables.h
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/CSCSDOVariables.h
@@ -48,14 +48,12 @@ class CscSDOVariables : public ValAlgVariables
   std::vector<int> m_csc_sdo_chamberLayer;
   std::vector<int> m_csc_sdo_wireLayer;
   std::vector<int> m_csc_sdo_Strip;
-
   std::vector<int>    m_csc_sdo_word;
   std::vector<int>    m_csc_sdo_barcode;
   std::vector<double> m_csc_sdo_globalPosX;
   std::vector<double> m_csc_sdo_globalPosY;
   std::vector<double> m_csc_sdo_globalPosZ;
-  std::vector<double> m_csc_sdo_globaltime;
-
+  std::vector<double> m_csc_sdo_charge;
   std::vector<double> m_csc_sdo_localPosX;
   std::vector<double> m_csc_sdo_localPosY;
 
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx
index cdab75cb2497..0f4dc2595ff9 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.cxx
@@ -129,6 +129,10 @@ StatusCode NSWPRDValAlg::initialize() {
      m_testers.emplace_back( std::make_unique<CSCSimHitVariables>(evtStore().get(), m_muonDetMgrDS,
                                              &m_idHelperSvc->cscIdHelper(), m_tree, m_CSC_SimContainerName, msgLevel()));
   }
+  if (m_doCSCSDO){
+     m_testers.emplace_back(std::make_unique<CscSDOVariables>(evtStore().get(), m_muonDetMgrDS,
+                                                &m_idHelperSvc->cscIdHelper(), m_tree, m_CSC_SDOContainerName, msgLevel()));
+  }
   if (m_doCSCDigit){
      m_testers.emplace_back( std::make_unique<CSCDigitVariables>(evtStore().get(), m_muonDetMgrDS,
                                                 &m_idHelperSvc->cscIdHelper(), m_tree, m_CSC_DigitContainerName, msgLevel()));
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h
index d9c60be02a95..0089d7461b83 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h
@@ -24,6 +24,7 @@
 #include "RPCSDOVariables.h"
 #include "RPCDigitVariables.h"
 #include "CSCSimHitVariables.h"
+#include "CSCSDOVariables.h"
 #include "CSCDigitVariables.h"
 #include "CSCRDOVariables.h"
 #include "CSCPRDVariables.h"
@@ -93,6 +94,7 @@ class NSWPRDValAlg: public AthAlgorithm
    Gaudi::Property<bool>  m_doMMRDO{this, "doMMRDO", false};            // switch on the output of the MicroMegas RDO
    Gaudi::Property<bool>  m_doMMPRD{this, "doMMPRD", false};            // switch on the output of the MicroMegas prepdata
    Gaudi::Property<bool>  m_doCSCHit{this, "doCSCHit", false};           // switch on the output of the CSC simulated hits
+   Gaudi::Property<bool>  m_doCSCSDO{this, "doCSCSDO", false};           // switch on the output of the CSC SDO
    Gaudi::Property<bool>  m_doCSCDigit{this, "doCSCDigit", false};         // switch on the output of the CSC digitization
    Gaudi::Property<bool>  m_doCSCRDO{this, "doCSCRDO", false};           // switch on the output of the CSC RDO
    Gaudi::Property<bool>  m_doCSCPRD{this, "doCSCPRD", false};           // switch on the output of the CSC prepdata
@@ -127,6 +129,7 @@ class NSWPRDValAlg: public AthAlgorithm
   Gaudi::Property<std::string> m_NSWMM_PRDContainerName{this, "NSWMM_PRDContainerName", "MM_Measurements"};
 
   Gaudi::Property<std::string> m_CSC_SimContainerName{this,"CSC_SimContainerName", "CSC_Hits"};
+  Gaudi::Property<std::string> m_CSC_SDOContainerName{this,"CSC_SDOContainerName",  "CSCSDO"};
   Gaudi::Property<std::string> m_CSC_DigitContainerName{this, "CSC_DigitContainerName", "CSC_DIGITS"};
   Gaudi::Property<std::string> m_CSC_RDOContainerName{this,"CSC_RDOContainerName",  "CSCRDO"};
   Gaudi::Property<std::string> m_CSC_PRDContainerName{this,"CSC_PRDContainerName", "CSC_Clusters"  };
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCDigitVariables.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCDigitVariables.cxx
index 6229fe2f2984..6d9919a90691 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCDigitVariables.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/TGCDigitVariables.cxx
@@ -44,7 +44,7 @@ StatusCode TGCDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* M
       int channel          = m_TgcIdHelper->channel(Id);
       int isStrip          = m_TgcIdHelper->isStrip(Id);
     
-      ATH_MSG_DEBUG(     "MicroMegas Digit Offline id:  Station Name [" << stName << " ]"
+      ATH_MSG_DEBUG(     "TGC Digit Offline id:  Station Name [" << stName << " ]"
                          << " Station Eta ["  << stationEta      << "]"
                          << " Station Phi ["  << stationPhi      << "]"
                          << " GasGap ["       << gas_gap         << "]"
@@ -68,22 +68,39 @@ StatusCode TGCDigitVariables::fillVariables(const MuonGM::MuonDetectorManager* M
 
       Amg::Vector3D gpos(0.,0.,0.);
       Amg::Vector2D lpos(0.,0.);
-      
-      rdoEl->stripNumber(lpos,Id);
-      rdoEl->stripPosition(Id,lpos);
-      rdoEl->surface(Id).globalToLocal(gpos,gpos,lpos);
-      
-      m_TGC_dig_localPosX.push_back( lpos.x() );
-      m_TGC_dig_localPosY.push_back( lpos.y() );
+
+      rdoEl->surface(Id).localToGlobal(lpos,gpos,gpos);
       m_TGC_dig_globalPosX.push_back( gpos.x() );
       m_TGC_dig_globalPosY.push_back( gpos.y() );
       m_TGC_dig_globalPosZ.push_back( gpos.z() );
 
+
       // digit counter for the ntuple
       m_TGC_nDigits++;
     }
+
+    // Local digit position information loss after localToGlobal transformation, fill the local positions in another loop for retrieving the local positions
+    for (auto Digit: *coll) {
+
+      // get specific digit and identify it
+      Identifier id = Digit->identify();
+
+      const MuonGM::TgcReadoutElement* rdoEl = MuonDetMgr->getTgcReadoutElement(id);
+	  if (!rdoEl) {
+	    ATH_MSG_ERROR("TGCDigitVariables::fillVariables() - Failed to retrieve TgcReadoutElement for" << __FILE__ << __LINE__ << m_TgcIdHelper->print_to_string(id).c_str());
+	    return StatusCode::FAILURE;
+	  }
+
+      Amg::Vector3D glopos(0.,0.,0.);
+      Amg::Vector2D lopos(0.,0.);
+
+      rdoEl->surface(id).globalToLocal(glopos,glopos,lopos);
+      m_TGC_dig_localPosX.push_back( lopos.x() );
+      m_TGC_dig_localPosY.push_back( lopos.y() );
+    }
+
   }
-  ATH_MSG_DEBUG("processed " << m_TGC_nDigits << " MicroMegas hits");
+  ATH_MSG_DEBUG("processed " << m_TGC_nDigits << " TGC hits");
   return StatusCode::SUCCESS;
 }
 
@@ -142,4 +159,3 @@ void TGCDigitVariables::deleteVariables()
 {
   return;
 }
-
-- 
GitLab


From 35178e4e2c051d310942ec534e92f6f15765df3a Mon Sep 17 00:00:00 2001
From: Thomas Strebler <thomas.strebler@cern.ch>
Date: Thu, 16 Sep 2021 20:21:22 +0200
Subject: [PATCH 161/347] ITk LRT config

---
 .../InDetConfig/python/ITkConfigFlags.py      |  9 +++++
 .../InDetConfig/python/ITkTrackRecoConfig.py  | 40 +++++++++++++++----
 .../python/ITkTrackingCommonConfig.py         | 11 ++---
 .../python/ITkTrackingSiPatternConfig.py      | 31 +++++++-------
 .../InDetConfig/python/TrackingCutsFlags.py   |  6 +--
 .../SiSpacePointsSeedMaker_ITK.h              |  4 +-
 6 files changed, 66 insertions(+), 35 deletions(-)

diff --git a/InnerDetector/InDetConfig/python/ITkConfigFlags.py b/InnerDetector/InDetConfig/python/ITkConfigFlags.py
index dcb7be158f9b..af8482c2c198 100644
--- a/InnerDetector/InDetConfig/python/ITkConfigFlags.py
+++ b/InnerDetector/InDetConfig/python/ITkConfigFlags.py
@@ -66,4 +66,13 @@ def createITkConfigFlags():
   itkcf.addFlag("ITk.doRobustReco", False) # Switch for running Robust settings
   itkcf.addFlag("ITk.useNewSiSPSeededTF", False ) # Switch for using new SiSPSeededTrackFinder strategy
 
+  from InDetConfig.TrackingCutsFlags import createITkTrackingFlags, createITkLargeD0TrackingFlags, createITkConversionFindingTrackingFlags, createITkFastTrackingFlags, createITkLargeD0FastTrackingFlags
+
+  itkcf.addFlagsCategory ("ITk.Tracking", createITkTrackingFlags, prefix=True)
+  itkcf.addFlagsCategory ("ITk.LargeD0Tracking", createITkLargeD0TrackingFlags, prefix=True)
+  itkcf.addFlagsCategory ("ITk.ConversionFindingTracking", createITkConversionFindingTrackingFlags, prefix=True)
+  itkcf.addFlagsCategory ("ITk.FastTracking", createITkFastTrackingFlags, prefix=True)
+  itkcf.addFlagsCategory ("ITk.LargeD0FastTracking", createITkLargeD0FastTrackingFlags, prefix=True)
+
+
   return itkcf
diff --git a/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py b/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py
index 47de8244cc9d..ee58becf6991 100644
--- a/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py
+++ b/InnerDetector/InDetConfig/python/ITkTrackRecoConfig.py
@@ -179,10 +179,29 @@ def ITkTrackCollectionCnvToolCfg(flags, name="ITkTrackCollectionCnvTool", ITkTra
     result.setPrivateTools(CompFactory.xAODMaker.TrackCollectionCnvTool(name, **kwargs))
     return result
 
-def ITkTrackParticleCnvAlgCfg(flags, name="ITkTrackParticleCnvAlg", OutputTrackParticleContainer="InDetTrackParticles", **kwargs):
+def ITkTrackCollectionMergerAlgCfg(flags, name="ITkTrackCollectionMerger", InputCombinedTracks=None, **kwargs):
+    result = ComponentAccumulator()
+
+    kwargs.setdefault("TracksLocation", InputCombinedTracks)
+    kwargs.setdefault("OutputTracksLocation", 'CombinedITkTracks')
+    from InDetConfig.ITkTrackingCommonConfig import ITkPRDtoTrackMapToolGangedPixelsCfg
+    ITkPRDtoTrackMapToolGangedPixels = result.popToolsAndMerge(ITkPRDtoTrackMapToolGangedPixelsCfg(flags))
+    kwargs.setdefault("AssociationTool", ITkPRDtoTrackMapToolGangedPixels)
+    kwargs.setdefault("AssociationMapName", 'ITkPRDToTrackMapCombinedITkTracks')
+    kwargs.setdefault("UpdateSharedHits", True)
+    kwargs.setdefault("UpdateAdditionalInfo", True)
+    from InDetConfig.ITkTrackingCommonConfig import ITkTrackSummaryToolSharedHitsCfg
+    TrackSummaryTool = result.popToolsAndMerge(ITkTrackSummaryToolSharedHitsCfg(flags))
+    kwargs.setdefault("SummaryTool", TrackSummaryTool)
+
+    result.addEventAlgo(CompFactory.Trk.TrackCollectionMerger(name, **kwargs))
+    return result
+
+def ITkTrackParticleCnvAlgCfg(flags, name="ITkTrackParticleCnvAlg", TrackContainerName="CombinedITkTracks", OutputTrackParticleContainer="InDetTrackParticles", **kwargs):
     result = ComponentAccumulator()
     kwargs.setdefault("ConvertTracks", True)
     kwargs.setdefault("ConvertTrackParticles", False)
+    kwargs.setdefault("TrackContainerName", TrackContainerName)
     kwargs.setdefault("xAODContainerName", OutputTrackParticleContainer)
     kwargs.setdefault("xAODTrackParticlesFromTracksContainerName", OutputTrackParticleContainer)
     if "TrackParticleCreator" not in kwargs:
@@ -263,16 +282,23 @@ def ITkTrackRecoCfg(flags):
     from InDetConfig.ITkSiliconPreProcessing import ITkRecPreProcessingSiliconCfg
     result.merge(ITkRecPreProcessingSiliconCfg(flags))
 
-    from InDetConfig.TrackingCutsFlags import createITkTrackingFlags
-    createTrackingFlags = createITkTrackingFlags
     if flags.ITk.doFastTracking:
-        from InDetConfig.TrackingCutsFlags import createITkFastTrackingFlags
-        createTrackingFlags = createITkFastTrackingFlags
-    flags.addFlagsCategory ("ITk.Tracking", createTrackingFlags, prefix=True)
+        flags = flags.cloneAndReplace("ITk.Tracking","ITk.FastTracking")
 
     from InDetConfig.ITkTrackingSiPatternConfig import ITkTrackingSiPatternCfg
     result.merge(ITkTrackingSiPatternCfg(flags, [], "ResolvedTracks", "SiSPSeededTracks"))
-    result.merge(ITkTrackParticleCnvAlgCfg(flags, TrackContainerName="ResolvedTracks"))
+    InputCombinedITkTracks = ["ResolvedTracks"]
+
+    # LRT
+    if flags.ITk.doITkLargeD0:
+        flagsLRT = flags.cloneAndReplace("ITk.Tracking","ITk.LargeD0Tracking")
+        if flags.ITk.doFastTracking:
+            flagsLRT = flags.cloneAndReplace("ITk.Tracking","ITk.LargeD0FastTracking")
+        result.merge(ITkTrackingSiPatternCfg(flagsLRT, ['ResolvedTracks'], "ResolvedLargeD0Tracks", "SiSPSeededLargeD0Tracks"))
+        InputCombinedITkTracks += ["ResolvedLargeD0Tracks"]
+
+    result.merge(ITkTrackCollectionMergerAlgCfg(flags, InputCombinedTracks=InputCombinedITkTracks))
+    result.merge(ITkTrackParticleCnvAlgCfg(flags))
 
     if flags.ITk.doVertexFinding:
         from InDetConfig.VertexFindingConfig import primaryVertexFindingCfg
diff --git a/InnerDetector/InDetConfig/python/ITkTrackingCommonConfig.py b/InnerDetector/InDetConfig/python/ITkTrackingCommonConfig.py
index 2dcbd3f1063c..298cadb86a36 100644
--- a/InnerDetector/InDetConfig/python/ITkTrackingCommonConfig.py
+++ b/InnerDetector/InDetConfig/python/ITkTrackingCommonConfig.py
@@ -25,13 +25,9 @@ def stripArgs(kwargs, copy_list) :
 
 def ITkEtaDependentCutsSvcCfg(flags, name = 'ITkEtaDependentCutsSvc', **kwargs):
     acc = ComponentAccumulator()
-    the_name = makeName(name, kwargs)
+    the_name = name + flags.ITk.Tracking.extension
 
     cuts = flags.ITk.Tracking
-    if flags.ITk.Tracking.extension == "ITkLargeD0Tracking":
-        cuts = flags.ITk.LargeD0Tracking
-    elif flags.ITk.Tracking.extension == "ITkConversionFindingTracking":
-        cuts = flags.ITk.ConversionFindingTracking        
 
     kwargs.setdefault("etaBins",              cuts.etaBins)
     kwargs.setdefault("etaWidthBrem",         cuts.etaWidthBrem)
@@ -846,9 +842,10 @@ def ITkAmbiScoringToolBaseCfg(flags, name='ITkAmbiScoringTool', **kwargs) :
 
     if 'InDetEtaDependentCutsSvc' not in kwargs :
         acc.merge(ITkEtaDependentCutsSvcCfg(flags))
-        kwargs.setdefault("InDetEtaDependentCutsSvc", acc.getService("ITkEtaDependentCutsSvc"))
+        kwargs.setdefault("InDetEtaDependentCutsSvc", acc.getService("ITkEtaDependentCutsSvc"+flags.ITk.Tracking.extension))
 
-    acc.addPublicTool(CompFactory.InDet.InDetAmbiScoringTool(name = name, **kwargs), primary=True)
+    the_name = name + flags.ITk.Tracking.extension
+    acc.addPublicTool(CompFactory.InDet.InDetAmbiScoringTool(name = the_name, **kwargs), primary=True)
     return acc
 
 def ITkCosmicsScoringToolBaseCfg(flags, name='ITkCosmicsScoringTool', **kwargs) :
diff --git a/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py b/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py
index 1ee21cc54d78..5475bf5e3133 100644
--- a/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py
+++ b/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py
@@ -10,8 +10,8 @@ def ITkSiSpacePointsSeedMakerCfg(flags, name="ITkSpSeedsMaker", InputCollections
     # --- decide if use the association tool
     #
     if (len(InputCollections) > 0) and \
-        (flags.ITk.Tracking.extension == "ITkLargeD0" \
-         or flags.ITk.Tracking.extension == "ITkConversionFinding"):
+        (flags.ITk.Tracking.extension == "LargeD0" \
+         or flags.ITk.Tracking.extension == "ConversionFinding"):
         usePrdAssociationTool = True
     else:
         usePrdAssociationTool = False
@@ -47,7 +47,7 @@ def ITkSiSpacePointsSeedMakerCfg(flags, name="ITkSpSeedsMaker", InputCollections
         kwargs.setdefault("maxRadius2", flags.ITk.Tracking.radMax)
         kwargs.setdefault("maxRadius3", flags.ITk.Tracking.radMax)
 
-    if flags.ITk.Tracking.extension == "ITkLargeD0":
+    if flags.ITk.Tracking.extension == "LargeD0":
         kwargs.setdefault("maxSeedsForSpacePoint", 5)
         kwargs.setdefault("isLRT", True)
         kwargs.setdefault("maxZPPP", flags.ITk.Tracking.maxZSpacePointsPPPSeeds)
@@ -56,9 +56,8 @@ def ITkSiSpacePointsSeedMakerCfg(flags, name="ITkSpSeedsMaker", InputCollections
     if flags.ITk.doFastTracking :
         kwargs.setdefault("useFastTracking", True)
         kwargs.setdefault("maxSeedsForSpacePoint", 3)
-        if flags.ITk.Tracking.extension == "ITk":
-            kwargs.setdefault("useSCT", False)
-        elif flags.ITk.Tracking.extension == "ITkLargeD0":
+        kwargs.setdefault("useSCT", False)
+        if flags.ITk.Tracking.extension == "LargeD0":
             kwargs.setdefault("usePixel", False)
 
     ITkSiSpacePointsSeedMaker = SiSpacePointsSeedMaker (name = name+flags.ITk.Tracking.extension, **kwargs)
@@ -148,7 +147,7 @@ def ITkSiCombinatorialTrackFinder_xkCfg(flags, name="ITkSiComTrackFinder", **kwa
 
 def ITkSiTrackMaker_xkCfg(flags, name="ITkSiTrackMaker", InputCollections = None, **kwargs) :
     acc = ComponentAccumulator()
-    useBremMode = flags.ITk.Tracking.extension == "ITk"
+    useBremMode = flags.ITk.Tracking.extension == "" #Disabled for second passes in reco
     ITkSiDetElementsRoadMaker = acc.popToolsAndMerge(ITkSiDetElementsRoadMaker_xkCfg(flags))
 
     if flags.ITk.Tracking.useITkPixel:
@@ -171,7 +170,7 @@ def ITkSiTrackMaker_xkCfg(flags, name="ITkSiTrackMaker", InputCollections = None
     #
     # --- decide if use the association tool
     #
-    if (len(InputCollections) > 0) and (flags.ITk.Tracking.extension == "ITkLargeD0" or flags.ITk.Tracking.extension == "ITkConversionFinding"):
+    if (len(InputCollections) > 0) and (flags.ITk.Tracking.extension == "LargeD0" or flags.ITk.Tracking.extension == "ConversionFinding"):
         usePrdAssociationTool = True
     else:
         usePrdAssociationTool = False
@@ -212,10 +211,10 @@ def ITkSiTrackMaker_xkCfg(flags, name="ITkSiTrackMaker", InputCollections = None
     elif flags.ITk.doHeavyIon:
         kwargs.setdefault("TrackPatternRecoInfo", 'SiSpacePointsSeedMaker_HeavyIon')
 
-    elif flags.ITk.Tracking.extension == "ITkConversionFinding":
+    elif flags.ITk.Tracking.extension == "ConversionFinding":
         kwargs.setdefault("TrackPatternRecoInfo", 'SiSpacePointsSeedMaker_SLHCConversionTracks')
 
-    elif flags.ITk.Tracking.extension == "ITkLargeD0":
+    elif flags.ITk.Tracking.extension == "LargeD0":
         kwargs.setdefault("TrackPatternRecoInfo", 'SiSpacePointsSeedMaker_LargeD0')
 
     else:
@@ -241,7 +240,7 @@ def ITkSiSPSeededTrackFinderCfg(flags, name="ITkSiSpTrackFinder", InputCollectio
     #
     # --- decide if use the association tool
     #
-    if (len(InputCollections) > 0) and (flags.ITk.Tracking.extension == "ITkLargeD0" or flags.ITk.Tracking.extension == "ITkConversionFinding"):
+    if (len(InputCollections) > 0) and (flags.ITk.Tracking.extension == "LargeD0" or flags.ITk.Tracking.extension == "ConversionFinding"):
         usePrdAssociationTool = True
     else:
         usePrdAssociationTool = False
@@ -294,7 +293,7 @@ def ITkSiSPSeededTrackFinderCfg(flags, name="ITkSiSpTrackFinder", InputCollectio
 
         if 'InDetEtaDependentCutsSvc' not in kwargs :
             acc.merge(TC.ITkEtaDependentCutsSvcCfg(flags))
-            kwargs.setdefault("InDetEtaDependentCutsSvc", acc.getService("ITkEtaDependentCutsSvc"))
+            kwargs.setdefault("InDetEtaDependentCutsSvc", acc.getService("ITkEtaDependentCutsSvc"+flags.ITk.Tracking.extension))
 
     ITkSiSPSeededTrackFinder = CompFactory.InDet.SiSPSeededTrackFinder(name = name+flags.ITk.Tracking.extension, **kwargs)
     acc.addEventAlgo(ITkSiSPSeededTrackFinder)
@@ -360,7 +359,7 @@ def ITkAmbiTrackSelectionToolCfg(flags, name="ITkAmbiTrackSelectionTool", **kwar
 
     if 'InDetEtaDependentCutsSvc' not in kwargs :
         acc.merge(TC.ITkEtaDependentCutsSvcCfg(flags))
-        kwargs.setdefault("InDetEtaDependentCutsSvc", acc.getService("ITkEtaDependentCutsSvc"))
+        kwargs.setdefault("InDetEtaDependentCutsSvc", acc.getService("ITkEtaDependentCutsSvc"+flags.ITk.Tracking.extension))
 
     if flags.ITk.doTIDE_Ambi:
         AmbiTrackSelectionTool = CompFactory.InDet.InDetDenseEnvAmbiTrackSelectionTool
@@ -416,7 +415,7 @@ def ITkDenseEnvironmentsAmbiguityScoreProcessorToolCfg(flags, name = "ITkAmbigui
 def ITkDenseEnvironmentsAmbiguityProcessorToolCfg(flags, name = "ITkAmbiguityProcessor", ClusterSplitProbContainer='', **kwargs) :
     acc = ComponentAccumulator()
 
-    useBremMode = flags.ITk.Tracking.extension == "ITk"
+    useBremMode = flags.ITk.Tracking.extension == "" #Disabled for second passes in reco
 
     #
     # --- set up different Scoring Tool for collisions and cosmics
@@ -492,7 +491,7 @@ def ITkDenseEnvironmentsAmbiguityProcessorToolCfg(flags, name = "ITkAmbiguityPro
 
 def ITkSimpleAmbiguityProcessorToolCfg(flags, name = "ITkAmbiguityProcessor", ClusterSplitProbContainer='', **kwargs) :
     acc = ComponentAccumulator()
-    useBremMode = flags.ITk.Tracking.extension == "ITk"
+    useBremMode = flags.ITk.Tracking.extension == "" #Disabled for second passes in reco
 
     #
     # --- set up different Scoring Tool for collisions and cosmics
@@ -593,7 +592,7 @@ def ITkTrackingSiPatternCfg(flags, InputCollections = None, ResolvedTrackCollect
     #
     # --- decide if use the association tool
     #
-    if (len(InputCollections) > 0) and (flags.ITk.Tracking.extension == "ITkLargeD0" or flags.ITk.Tracking.extension == "ITkConversionFinding"):
+    if (len(InputCollections) > 0) and (flags.ITk.Tracking.extension == "LargeD0" or flags.ITk.Tracking.extension == "ConversionFinding"):
         usePrdAssociationTool = True
     else:
         usePrdAssociationTool = False
diff --git a/InnerDetector/InDetConfig/python/TrackingCutsFlags.py b/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
index 9bc05fe90207..8ea44d2ee4ab 100644
--- a/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
+++ b/InnerDetector/InDetConfig/python/TrackingCutsFlags.py
@@ -374,7 +374,7 @@ def createTrackingFlags():
 ### ITk mode ####################
 def createITkTrackingFlags():
     icf = createTrackingFlags()   
-    icf.extension               = "ITk"
+    icf.extension               = ""
 
     icf.useEtaDepCuts           = True
     icf.etaBins                 = [-1.0, 2.0, 2.6, 4.0]
@@ -434,7 +434,7 @@ def createITkFastTrackingFlags():
 def createITkLargeD0TrackingFlags():
 
     icf = createTrackingFlags()
-    icf.extension               = "ITkLargeD0"
+    icf.extension               = "LargeD0"
 
     icf.useEtaDepCuts      = True
     icf.maxPT              = [1.0 * Units.TeV]
@@ -654,7 +654,7 @@ def createLowPtTrackingFlags():
 ## ITkConversionFinding mode ########################
 def createITkConversionFindingTrackingFlags(): #To be updated
     icf = createTrackingFlags()
-    icf.extension               = "ITkConversionFinding"
+    icf.extension               = "ConversionFinding"
 
     icf.useEtaDepCuts           = True
     icf.etaBins                 = [-1.0,4.0]
diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ITK.h b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ITK.h
index 75851a2532cb..6d0dcbfd9f3c 100644
--- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ITK.h
+++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ITK.h
@@ -212,8 +212,10 @@ namespace InDet {
     BooleanProperty m_isLRT{this, "isLRT", false};
     FloatProperty m_drminPPP{this, "mindRadiusPPP", 6.};
     FloatProperty m_drmaxPPP{this, "maxdRadiusPPP", 140.};
+    FloatProperty m_zmaxPPP{this, "maxZPPP", 2700.};
     FloatProperty m_drminSSS{this, "mindRadiusSSS", 20.};
     FloatProperty m_drmaxSSS{this, "maxdRadiusSSS", 3000.};
+    FloatProperty m_zmaxSSS{this, "maxZSSS", 2700.};
     FloatProperty m_dImpactCutSlopeUnconfirmedSSS{this, "dImpactCutSlopeUnconfirmedSSS", 1.0};
     FloatProperty m_dImpactCutSlopeUnconfirmedPPP{this, "dImpactCutSlopeUnconfirmedPPP", 0.};
     FloatProperty m_seedScoreBonusConfirmationSeed{this, "seedScoreBonusConfirmationSeed", -200.};
@@ -267,9 +269,7 @@ namespace InDet {
     float m_COF{0.};
     float m_dzMaxFast   {200.};
     float m_R2MaxFast   {2500.};        
-    float m_zmaxPPP     {2700.};
     float m_rmaxPPP     {140.};   
-    float m_zmaxSSS     {2700.};
     float m_dzmaxSSS    {900.};    
     float m_drminSeedConf{5.};
     //@}
-- 
GitLab


From 9d019b577d9d55223dd4fb45ced162d8429679a8 Mon Sep 17 00:00:00 2001
From: Peter Kramer <peter.kramer@cern.ch>
Date: Thu, 16 Sep 2021 20:23:02 +0200
Subject: [PATCH 162/347] MuonTrackMonitoring name changes

---
 .../src/MuonTrackMonitorAlgorithm.cxx                | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonTrackMonitorAlgorithm.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonTrackMonitorAlgorithm.cxx
index de6661ecafa4..6a5b2522e23c 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonTrackMonitorAlgorithm.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonTrackMonitorAlgorithm.cxx
@@ -328,13 +328,9 @@ StatusCode	MuonTrackMonitorAlgorithm::plotResonanceCandidates(std::string resona
 
 	/// Declaring all variables that are initialized via Python will be plotted
 	auto tool = getGroup("MuonTrackMonitorAlgorithm");
-	auto Sector = Monitored::Scalar<float>((resonanceName+"Sector").c_str(), 0);
-	auto Chamber = Monitored::Scalar<float>((resonanceName+"Chamber").c_str(), 0);
-	auto SectorEff = Monitored::Scalar<float>((resonanceName+"SectorEff").c_str(), 0);
-	auto ChamberEff = Monitored::Scalar<float>((resonanceName+"ChamberEff").c_str(), 0);
 	auto Eta = Monitored::Scalar<float>((resonanceName+"Eta").c_str(), 0);
 	auto Mass = Monitored::Scalar<float>((resonanceName+"Mass").c_str(), 0);
-	auto MuonLumiBlock = Monitored::Scalar<float>((resonanceName+"MuonLumiBlock").c_str(), 0);	
+	auto MuonLumiBlock = Monitored::Scalar<float>((resonanceName+"_MuonLumiBlock").c_str(), 0);	
     auto muMinusEta = Monitored::Scalar<float>("muMinusEta", -9);
     auto muPlusEta = Monitored::Scalar<float>("muPlusEta", -9);
     auto Eta2D = Monitored::Scalar<const char*>("Eta2D", "");
@@ -406,14 +402,14 @@ StatusCode	MuonTrackMonitorAlgorithm::plotResonanceCandidates(std::string resona
             Mass = resonance_Mass;
             Eta = resonance_Eta;
 			fill(tool, Mass, Eta, Eta2D, muMinusEta, muPlusEta);
-			
+		
 			MuonLumiBlock =  lumiBlockID;
 			fill(tool, MuonLumiBlock);			
 		}
     }
 
 	/// Fill the relevant Muon Information for each Z Boson Candidate Muon
-	ATH_CHECK( FillMuonInformation("Z", vecMuons) );		
+	ATH_CHECK( FillMuonInformation(resonanceName, vecMuons) );		
 
 	return StatusCode::SUCCESS;
 }
@@ -424,7 +420,6 @@ StatusCode	MuonTrackMonitorAlgorithm::analyseResonanceCandidates(const xAOD::Muo
 	std::vector<const xAOD::Muon*>	vecMuons_ZBoson_Candidates;
 	std::vector<const xAOD::Muon*>	vecMuons_JPsi_Candidates;
 
-	
 	/// Select Muons Relevant for Z
 	for(const auto muon : Muons) {
 		xAOD::Muon::MuonType muonType = muon->muonType();
@@ -455,6 +450,7 @@ StatusCode	MuonTrackMonitorAlgorithm::analyseResonanceCandidates(const xAOD::Muo
 			}
 		}
 	}
+
     ATH_CHECK( plotResonanceCandidates("Z", vecMuons_ZBoson_Candidates, lumiBlockID) );
     ATH_CHECK( plotResonanceCandidates("JPsi", vecMuons_JPsi_Candidates, lumiBlockID) );
 
-- 
GitLab


From c4a71d726d07c7b35b1307d2773d0efbe1af608c Mon Sep 17 00:00:00 2001
From: Cecilia Tosciri <cecilia.tosciri@cern.ch>
Date: Thu, 16 Sep 2021 20:26:30 +0200
Subject: [PATCH 163/347] gFEXDriver FPE issue fixed and
 gTowerCollection::findTower fixed

---
 .../L1CaloFEXSim/FEXAlgoSpaceDefs.h           |  7 +++
 .../L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJAlgo.h  | 16 +++---
 .../L1CaloFEXSim/gTowerContainer.h            |  2 +-
 .../L1CaloFEXSim/src/gFEXCompression.cxx      |  4 +-
 .../L1CaloFEX/L1CaloFEXSim/src/gFEXFPGA.cxx   | 14 +++--
 .../L1CaloFEXSim/src/gFEXJetAlgo.cxx          |  4 --
 .../L1CaloFEXSim/src/gFEXJwoJAlgo.cxx         | 55 +++++++++----------
 .../L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx    |  8 ++-
 .../L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx | 22 --------
 .../L1CaloFEXSim/src/gTowerContainer.cxx      | 45 +++++++++++----
 10 files changed, 92 insertions(+), 85 deletions(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/FEXAlgoSpaceDefs.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/FEXAlgoSpaceDefs.h
index 948eb236338a..a59281499536 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/FEXAlgoSpaceDefs.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/FEXAlgoSpaceDefs.h
@@ -86,6 +86,13 @@ namespace LVL1 {
     constexpr static bool ENABLE_INTER_C = false;
     constexpr static int gJetTOBfib = 4;
     constexpr static int BTOBFIB = 6;
+    //define constants needed by gFEX JwoJ algorithm
+    constexpr static unsigned int aFPGA_A = 1;
+    constexpr static unsigned int bFPGA_A = 1;
+    constexpr static unsigned int aFPGA_B = 1;
+    constexpr static unsigned int bFPGA_B = 1;
+    constexpr static int gblockThreshold = 25000;//MeV
+
 
   };
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJAlgo.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJAlgo.h
index b520dafc181e..49f5b8ec9514 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJAlgo.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXJwoJAlgo.h
@@ -56,21 +56,21 @@ namespace LVL1 {
     virtual void gBlockAB(gTowersCentral twrs, gTowersCentral & gBlkSum);
 
     virtual void metFPGA(gTowersCentral twrs, gTowersCentral & gBlkSum,
-                           unsigned short & MHT_x, unsigned short & MHT_y,
-                           unsigned short & MST_x, unsigned short & MST_y,
-                           unsigned short & MET_x, unsigned short & MET_y);
+                           unsigned int & MHT_x, unsigned int & MHT_y,
+                           unsigned int & MST_x, unsigned int & MST_y,
+                           unsigned int & MET_x, unsigned int & MET_y);
 
-    virtual void metTotal(unsigned short A_MET_x, unsigned short A_MET_y,
-                          unsigned short B_MET_x, unsigned short B_MET_y,
-                          unsigned short & MET_x, unsigned short & MET_y, unsigned short & MET);
+    virtual void metTotal(unsigned int A_MET_x, unsigned int A_MET_y,
+                          unsigned int B_MET_x, unsigned int B_MET_y,
+                          unsigned int & MET_x, unsigned int & MET_y, unsigned int & MET);
 
     virtual void sumEtFPGA(gTowersCentral twrs, unsigned int & partial_sumEt);
 
     virtual void sumEt(unsigned int  A_sumEt, unsigned int  B_sumEt, unsigned int & total_sumEt);
 
-    virtual unsigned short sinLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw);
+    virtual unsigned int sinLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw);
 
-    virtual unsigned short cosLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw);
+    virtual unsigned int cosLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw);
 
 
   };
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gTowerContainer.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gTowerContainer.h
index e7e250e8e870..f38f0f0f4741 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gTowerContainer.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gTowerContainer.h
@@ -66,7 +66,7 @@ class gTowerContainer : public DataVector<LVL1::gTower>
   IMessageSvc* msgSvc() const;
 
   //* @brief Keeps track of the towerID of each gTower associated to each MAP index *.
-  std::map<int,int> m_map_towerID_containerIndex;
+  std::unordered_map<int,int> m_map_towerID_containerIndex;
 };
 
 }
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXCompression.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXCompression.cxx
index 9366bbf5898d..57a471986370 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXCompression.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXCompression.cxx
@@ -11,8 +11,8 @@
 
 namespace LVL1 {
 
-const int gFEXCompression::s_steps[] = {12800, 50, 25, 50, 100, 25600};
-const int gFEXCompression::s_minET[] = {-101200, -50000, -12800, 12800, 51200, 200000};
+const int gFEXCompression::s_steps[] = {12800, 50, 25, 50, 100, 25600};//MeV
+const int gFEXCompression::s_minET[] = {-101200, -50000, -12800, 12800, 51200, 200000};//MeV
 const int gFEXCompression::s_minCode[] = {2, 6, 750, 1774, 2542, 4030};
 
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXFPGA.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXFPGA.cxx
index f298abc88313..804e546e5b8c 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXFPGA.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXFPGA.cxx
@@ -90,12 +90,13 @@ namespace LVL1 {
 
       for (int myrow = 0; myrow<rows; myrow++){
          for (int mycol = 0; mycol<cols; mycol++){
+            output_gTower_energies[myrow][mycol] = 0;
+            if (m_gTowersIDs_central[myrow][mycol] == 0) continue;
             const LVL1::gTower * tmpTower = jk_gFEXFPGA_gTowerContainer->findTower(m_gTowersIDs_central[myrow][mycol]);
-            int et =  tmpTower->getET();
-            output_gTower_energies[myrow][mycol] = et;
+            if (tmpTower == nullptr) continue;
+            output_gTower_energies[myrow][mycol] = tmpTower->getET();
          }
       }
-
    }
 
    void gFEXFPGA::GetEnergyMatrix(gTowersForward & output_gTower_energies) const{
@@ -107,12 +108,13 @@ namespace LVL1 {
 
       for (int myrow = 0; myrow<rows; myrow++){
          for (int mycol = 0; mycol<cols; mycol++){
+            output_gTower_energies[myrow][mycol] = 0;
+            if (m_gTowersIDs_forward[myrow][mycol] == 0) continue;
             const LVL1::gTower * tmpTower = jk_gFEXFPGA_gTowerContainer->findTower(m_gTowersIDs_forward[myrow][mycol]);
-            int et =  tmpTower->getET();
-            output_gTower_energies[myrow][mycol] = et;
+            if (tmpTower == nullptr) continue;
+            output_gTower_energies[myrow][mycol] = tmpTower->getET();
          }
       }
-
    }
 
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJetAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJetAlgo.cxx
index 7d540c062c35..83ac7649468f 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJetAlgo.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJetAlgo.cxx
@@ -59,10 +59,6 @@ std::vector<std::unique_ptr<gFEXJetTOB>> gFEXJetAlgo::largeRfinder(
   std::array<std::array<int, 3>, FEXAlgoSpaceDefs::BTOBFIB> gBlockTOBeta = {{ {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}} }};
   std::array<std::array<int, 3>, FEXAlgoSpaceDefs::BTOBFIB> gBlockTOBphi = {{ {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}} }};
 
-  // std::array<std::array<int, 3>, 4> gBlockTOBv   = {{ {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}} }};
-  // std::array<std::array<int, 3>, 4> gBlockTOBeta = {{ {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}} }};
-  // std::array<std::array<int, 3>, 4> gBlockTOBphi = {{ {{0,0,0}}, {{0,0,0}}, {{0,0,0}}, {{0,0,0}} }};
-
 
   // calculate A & B  remote partial sums first
   gTowersPartialSums RAlps_out, RArps_out;
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx
index 6a2d1baea8fc..5fc418980c68 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx
@@ -47,7 +47,7 @@ void gFEXJwoJAlgo::setAlgoConstant(unsigned int aFPGA_A, unsigned int bFPGA_A,
 
 
 std::vector<std::unique_ptr<gFEXJwoJTOB>> gFEXJwoJAlgo::jwojAlgo(gTowersCentral Atwr, gTowersCentral Btwr,
-                                                                std::array<uint32_t, 4> & outTOB) {
+                                                                 std::array<uint32_t, 4> & outTOB) {
 
 
   // find gBlocks
@@ -59,29 +59,29 @@ std::vector<std::unique_ptr<gFEXJwoJTOB>> gFEXJwoJAlgo::jwojAlgo(gTowersCentral
   gBlockAB(Btwr, gBLKB);
 
   //FPGA A observables
-  unsigned short A_MHT_x = 0x0;
-  unsigned short A_MHT_y = 0x0;
-  unsigned short A_MST_x = 0x0;
-  unsigned short A_MST_y = 0x0;
-  unsigned short A_MET_x = 0x0;
-  unsigned short A_MET_y = 0x0;
+  unsigned int A_MHT_x = 0x0;
+  unsigned int A_MHT_y = 0x0;
+  unsigned int A_MST_x = 0x0;
+  unsigned int A_MST_y = 0x0;
+  unsigned int A_MET_x = 0x0;
+  unsigned int A_MET_y = 0x0;
 
   unsigned int A_sumEt = 0x0;
 
   //FPGA B observables
-  unsigned short B_MHT_x = 0x0;
-  unsigned short B_MHT_y = 0x0;
-  unsigned short B_MST_x = 0x0;
-  unsigned short B_MST_y = 0x0;
-  unsigned short B_MET_x = 0x0;
-  unsigned short B_MET_y = 0x0;
+  unsigned int B_MHT_x = 0x0;
+  unsigned int B_MHT_y = 0x0;
+  unsigned int B_MST_x = 0x0;
+  unsigned int B_MST_y = 0x0;
+  unsigned int B_MET_x = 0x0;
+  unsigned int B_MET_y = 0x0;
 
   unsigned int B_sumEt = 0x0;
 
   //Global observables
-  unsigned short MET_x = 0x0;
-  unsigned short MET_y = 0x0;
-  unsigned short MET = 0x0;
+  unsigned int MET_x = 0x0;
+  unsigned int MET_y = 0x0;
+  unsigned int MET = 0x0;
 
   unsigned int total_sumEt = 0x0;
   unsigned int MHT_x = 0x0;
@@ -227,13 +227,12 @@ void gFEXJwoJAlgo::gBlockAB(gTowersCentral twrs, gTowersCentral & gBlkSum){
 
 
 void gFEXJwoJAlgo::metFPGA(gTowersCentral twrs, gTowersCentral & gBlkSum,
-                           unsigned short & MHT_x, unsigned short & MHT_y,
-                           unsigned short & MST_x, unsigned short & MST_y,
-                           unsigned short & MET_x, unsigned short & MET_y){
+                           unsigned int & MHT_x, unsigned int & MHT_y,
+                           unsigned int & MST_x, unsigned int & MST_y,
+                           unsigned int & MET_x, unsigned int & MET_y){
 
   int rows = twrs.size();
   int cols = twrs[0].size();
-
   for( int irow = 0; irow < rows; irow++ ){
     for(int jcolumn = 0; jcolumn<cols; jcolumn++){
       if(gBlkSum[irow][jcolumn] > m_gBlockthreshold){
@@ -246,15 +245,15 @@ void gFEXJwoJAlgo::metFPGA(gTowersCentral twrs, gTowersCentral & gBlkSum,
       }
     }
   }
-
   MET_x = m_aFPGA_A * MHT_x + m_bFPGA_A * MST_x;
   MET_y = m_aFPGA_B * MHT_y + m_bFPGA_B * MST_y;
 
+
 }
 
-void gFEXJwoJAlgo::metTotal(unsigned short A_MET_x, unsigned short A_MET_y,
-                            unsigned short B_MET_x, unsigned short B_MET_y,
-                            unsigned short & MET_x, unsigned short & MET_y, unsigned short & MET){
+void gFEXJwoJAlgo::metTotal(unsigned int A_MET_x, unsigned int A_MET_y,
+                            unsigned int B_MET_x, unsigned int B_MET_y,
+                            unsigned int & MET_x, unsigned int & MET_y, unsigned int & MET){
 
   MET_x = A_MET_x + B_MET_x;
   MET_y = A_MET_y + B_MET_y;
@@ -285,25 +284,25 @@ void gFEXJwoJAlgo::sumEt(unsigned int  A_sumEt, unsigned int  B_sumEt, unsigned
 //----------------------------------------------------------------------------------
 // bitwise simulation of sine LUT in firmware
 //----------------------------------------------------------------------------------
-unsigned short gFEXJwoJAlgo::sinLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw)
+unsigned int gFEXJwoJAlgo::sinLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw)
 {
   float c = ((float)phiIDX)/pow(2,aw);
   float rad = 2*M_PI*c;
   float rsin = sin(rad);
 
-  return static_cast<unsigned short>(round((pow(2.0,dw-1)-1.0)*rsin));
+  return static_cast<unsigned int>(round((pow(2.0,dw-1)-1.0)*rsin));
 }
 
 //----------------------------------------------------------------------------------
 // bitwise simulation cosine LUT in firmware
 //----------------------------------------------------------------------------------
-unsigned short gFEXJwoJAlgo::cosLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw)
+unsigned int gFEXJwoJAlgo::cosLUT(unsigned int phiIDX, unsigned int aw, unsigned int dw)
 {
   float c = ((float)phiIDX)/pow(2,aw);
   float rad = 2*M_PI*c;
   float rcos = cos(rad);
 
-  return static_cast<unsigned short>(round((pow(2.0,dw-1)-1.0)*rcos));
+  return static_cast<unsigned int>(round((pow(2.0,dw-1)-1.0)*rcos));
 }
 
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
index 604c5eee9822..38013afcae06 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
@@ -105,7 +105,6 @@ StatusCode gFEXSim::executegFEXSim(gTowersIDs tmp_gTowersIDs_subset){
    //Use a matrix with 32 rows, even if FPGA-C (positive) mostly deals with regions of 16 bins in phi.
    //However, one small region in eta (2.5<|eta|<2.8) has 32 bins in phi. So we use a matrix 32x14
    //but we fill half of it in the region 2.8<|eta|<4.8.
-   // int tmp_gTowersIDs_subset_forwardFPGA[32][7];
    gTowersForward tmp_gTowersIDs_subset_forwardFPGA;
    memset(&tmp_gTowersIDs_subset_forwardFPGA, 0, sizeof tmp_gTowersIDs_subset_forwardFPGA);
    for (int myrow = 0; myrow<32; myrow++){
@@ -129,7 +128,6 @@ StatusCode gFEXSim::executegFEXSim(gTowersIDs tmp_gTowersIDs_subset){
    //Use a matrix with 32 rows, even if FPGA-C (negative) mostly deals with regions of 16 bins in phi.
    //However, one small region in eta (2.5<|eta|<2.8) has 32 bins in phi. So we use a matrix 32x14
    //but we fill half of it in the region 2.8<|eta|<4.8.
-   // int tmp_gTowersIDs_subset_forwardFPGA[32][7];
    gTowersForward tmp_gTowersIDs_subset_forwardFPGA_N;
    memset(&tmp_gTowersIDs_subset_forwardFPGA_N, 0, sizeof tmp_gTowersIDs_subset_forwardFPGA_N);
    for (int myrow = 0; myrow<16; myrow++){
@@ -196,11 +194,15 @@ StatusCode gFEXSim::executegFEXSim(gTowersIDs tmp_gTowersIDs_subset){
    ATH_CHECK( m_gFEXJwoJAlgoTool.retrieve() );
    std::array<uint32_t, 4> outTOB = {0};
 
+   m_gFEXJwoJAlgoTool->setAlgoConstant(FEXAlgoSpaceDefs::aFPGA_A, FEXAlgoSpaceDefs::bFPGA_A,
+                                       FEXAlgoSpaceDefs::aFPGA_B, FEXAlgoSpaceDefs::bFPGA_B,
+                                       FEXAlgoSpaceDefs::gblockThreshold);
+
    auto global_tobs = m_gFEXJwoJAlgoTool->jwojAlgo(Atwr, Btwr, outTOB);
 
    m_gGlobalTobWords.resize(4);
 
-//Placing the global TOBs into a dedicated array
+   //Placing the global TOBs into a dedicated array
    m_gGlobalTobWords[0] = outTOB[0];//
    m_gGlobalTobWords[1] = outTOB[1];//
    m_gGlobalTobWords[2] = outTOB[2];//
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
index 609368c9ea2b..40728c9fe851 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
@@ -106,10 +106,8 @@ namespace LVL1 {
 
 
       // Since gFEX consists of a single module, here we are just (re)assigning the gTowerID
-      std::map<int,gTower> tmp_gTowersColl_subset;
 
       // Defining a matrix 32x38 corresponding to the gFEX structure (32 phi x 38 eta in the most general case - forward region has 16 phi bins)
-      // int tmp_gTowersIDs_subset [32][38];
       typedef  std::array<std::array<int, 38>, 32> gTowersIDs;
       gTowersIDs tmp_gTowersIDs_subset;
 
@@ -121,8 +119,6 @@ namespace LVL1 {
          for(int thisRow=0; thisRow<rows/2; thisRow++){
             int towerid = initialFCAL - ((thisCol) * 16) + thisRow;
             tmp_gTowersIDs_subset[thisRow][thisCol] = towerid;
-            tmp_gTowersColl_subset.insert( std::map<int, gTower>::value_type(towerid,   *(this_gTowerContainer->findTower(towerid))));
-
          }
       }
 
@@ -131,8 +127,6 @@ namespace LVL1 {
          for(int thisRow=0; thisRow<rows/2; thisRow++){
             int towerid = initialTRANSFCAL - ((thisCol-4) * 16) + thisRow;
             tmp_gTowersIDs_subset[thisRow][thisCol] = towerid;
-            tmp_gTowersColl_subset.insert( std::map<int, gTower>::value_type(towerid,   *(this_gTowerContainer->findTower(towerid))));
-
          }
       }
 
@@ -141,8 +135,6 @@ namespace LVL1 {
          for(int thisRow=0; thisRow<rows; thisRow++){
             int towerid = initialEMEC - ((thisCol-6) * 32) + thisRow;
             tmp_gTowersIDs_subset[thisRow][thisCol] = towerid;
-            tmp_gTowersColl_subset.insert( std::map<int, gTower>::value_type(towerid,   *(this_gTowerContainer->findTower(towerid))));
-
          }
       }
 
@@ -151,8 +143,6 @@ namespace LVL1 {
          int thisCol = 11;
          int towerid = initialTRANSEMB + thisRow;
          tmp_gTowersIDs_subset[thisRow][thisCol] = towerid;
-         tmp_gTowersColl_subset.insert( std::map<int, gTower>::value_type(towerid,   *(this_gTowerContainer->findTower(towerid))));
-
       }
 
       // set the EMB negative part
@@ -160,8 +150,6 @@ namespace LVL1 {
          for(int thisRow=0; thisRow<rows; thisRow++){
            int towerid = initialEMB - ( (thisCol-12) * 32) + thisRow;
            tmp_gTowersIDs_subset[thisRow][thisCol] = towerid;
-           tmp_gTowersColl_subset.insert( std::map<int, gTower>::value_type(towerid,   *(this_gTowerContainer->findTower(towerid))));
-
          }
       }
 
@@ -170,8 +158,6 @@ namespace LVL1 {
          for(int thisRow=0; thisRow<rows; thisRow++){
             int towerid = initialposEMB + ( (thisCol-19) * 32) + thisRow;
             tmp_gTowersIDs_subset[thisRow][thisCol] = towerid;
-            tmp_gTowersColl_subset.insert( std::map<int, gTower>::value_type(towerid,   *(this_gTowerContainer->findTower(towerid))));
-
          }
       }
 
@@ -180,16 +166,12 @@ namespace LVL1 {
          int thisCol = 26;
          int towerid = initialposTRANSEMB + thisRow;
          tmp_gTowersIDs_subset[thisRow][thisCol] = towerid;
-         tmp_gTowersColl_subset.insert( std::map<int, gTower>::value_type(towerid,   *(this_gTowerContainer->findTower(towerid))));
-
       }
       // set the EMEC positive part
       for(int thisCol=27; thisCol<32; thisCol++){
          for(int thisRow=0; thisRow<rows; thisRow++){
             int towerid = initialposEMEC + ((thisCol-27) * 32) + thisRow;
             tmp_gTowersIDs_subset[thisRow][thisCol] = towerid;
-            tmp_gTowersColl_subset.insert( std::map<int, gTower>::value_type(towerid,   *(this_gTowerContainer->findTower(towerid))));
-
          }
       }
 
@@ -198,8 +180,6 @@ namespace LVL1 {
          for(int thisRow=0; thisRow<rows/2; thisRow++){
             int towerid = initialposTRANSFCAL + ((thisCol-32) * 16) + thisRow;
             tmp_gTowersIDs_subset[thisRow][thisCol] = towerid;
-            tmp_gTowersColl_subset.insert( std::map<int, gTower>::value_type(towerid,   *(this_gTowerContainer->findTower(towerid))));
-
          }
       }
 
@@ -208,8 +188,6 @@ namespace LVL1 {
          for(int thisRow=0; thisRow<rows/2; thisRow++){
             int towerid = initialposFCAL + ((thisCol-34) * 16) + thisRow;
             tmp_gTowersIDs_subset[thisRow][thisCol] = towerid;
-            tmp_gTowersColl_subset.insert( std::map<int, gTower>::value_type(towerid,   *(this_gTowerContainer->findTower(towerid))));
-
          }
       }
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gTowerContainer.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gTowerContainer.cxx
index 8c55ede29741..3dfdb08cd442 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gTowerContainer.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gTowerContainer.cxx
@@ -35,22 +35,45 @@ void gTowerContainer::print() const {
 
 const LVL1::gTower * gTowerContainer::findTower(int towerID) const
 {
-  int container_index = -1;
-  container_index = m_map_towerID_containerIndex.find(towerID)->second;
-  if(container_index >= 0){
-    return (*this)[container_index];
+
+  const auto it = m_map_towerID_containerIndex.find(towerID);
+
+  if (it == m_map_towerID_containerIndex.end()) {
+    REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "gTowerContainer") << "Requested tower ID "
+                                                                  << towerID
+                                                                  << " not found in container.";
+    return nullptr;
   }
-  return nullptr;
+
+  const int container_index = it->second;
+
+  if (container_index < 0) {
+    return nullptr;
+  }
+
+  return (*this)[container_index];
 }
 
+
 LVL1::gTower * gTowerContainer::findTower(int towerID)
 {
- int container_index = -1;
- container_index = m_map_towerID_containerIndex.find(towerID)->second;
- if(container_index >= 0){
-   return (*this)[container_index];
- }
- return nullptr;
+
+  const auto it = m_map_towerID_containerIndex.find(towerID);
+
+  if (it == m_map_towerID_containerIndex.end()) {
+    REPORT_MESSAGE_WITH_CONTEXT (MSG::WARNING, "gTowerContainer") << "Requested tower ID "
+                                                                  << towerID
+                                                                  << " not found in container.";
+    return nullptr;
+  }
+
+  const int container_index = it->second;
+
+  if (container_index < 0) {
+    return nullptr;
+  }
+
+  return (*this)[container_index];
 }
 
 void gTowerContainer::clearContainerMap()
-- 
GitLab


From f0481ff8c7bf0dc6a8dc630e891657bafbad3da7 Mon Sep 17 00:00:00 2001
From: Miha Muskinja <miha.muskinja@cern.ch>
Date: Thu, 16 Sep 2021 11:43:32 -0700
Subject: [PATCH 164/347] directly call the vector sincos function

---
 .../GeoSpecialShapes/LArWheelCalculator.h     |  7 --
 .../vec_parametrized_sincos.h                 | 95 ++++++++++---------
 .../src/LArWheelCalculator.cxx                |  3 -
 .../DistanceCalculatorSaggingOff.cxx          | 10 +-
 .../LArWheelCalculator_Impl/sincos_poly.cxx   | 10 +-
 5 files changed, 62 insertions(+), 63 deletions(-)

diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
index 0da3b1906837..345de3971416 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h
@@ -126,9 +126,6 @@ class LArWheelCalculator
     std::pair<int, int> GetPhiGapAndSide(const CLHEP::Hep3Vector &p) const;
     double AmplitudeOfSurface(const CLHEP::Hep3Vector& P, int side, int fan_number) const;
 
-    /// Set the sincos calculator
-    // void SetVectorizedSincos() {m_sincos_calculator = &m_vsincos_par.eval;};
-
     /// @}
 
   private:
@@ -220,10 +217,6 @@ class LArWheelCalculator
     vsincos_par m_vsincos_par{};
 #endif
 
-  private:
-    typedef void (LArWheelCalculator::*SincosCalculator)(const double, double &, double &) const;
-    SincosCalculator m_sincos_calculator;
-    void EvalSincos(const double P, double &x, double &y) const {(this->*m_sincos_calculator)(P, x, y);};
 };
 
 #ifndef XAOD_STANDALONE
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h
index be996d7507b3..f662fbf17993 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/vec_parametrized_sincos.h
@@ -3,9 +3,10 @@
 */
 
 /**
- * @brief vectorized version of parametrized sincos
- * @ author Miha Muskinja, Chistos
- */
+  * @brief vectorized version of parametrized sincos
+  * see ATLASSIM-4753 for details
+  * @author Miha Muskinja, Chistos Anastopoulos
+*/
 #ifndef VEC_PARAMETRIZED_SINCOS_H
 #define VEC_PARAMETRIZED_SINCOS_H
 
@@ -14,61 +15,61 @@
 struct vsincos_par
 {
 
-  CxxUtils::vec<double, 4> param_0 = {};
-  CxxUtils::vec<double, 4> param_1 = {};
-  CxxUtils::vec<double, 4> param_2 = {};
+    CxxUtils::vec<double, 4> param_0 = {};
+    CxxUtils::vec<double, 4> param_1 = {};
+    CxxUtils::vec<double, 4> param_2 = {};
 
 #if HAVE_FUNCTION_MULTIVERSIONING
 #if defined(__x86_64__)
 
-  __attribute__((target("avx2,fma")))
+    __attribute__((target("avx2,fma")))
+
+    void
+    evaluate(const double r,
+             double &ATH_RESTRICT sin_a,
+             double &ATH_RESTRICT cos_a) const ATH_RESTRICT
+    {
+        const double r2 = r * r;
+        CxxUtils::vec<double, 4> P = r2 * param_0 + param_1;
+        P = r2 * P + param_2;
+        CxxUtils::vec<double, 4> P2 = {P[1], P[0], P[3], P[2]};
+        CxxUtils::vec<double, 4> res = r * P2 + P;
+        sin_a = res[0];
+        cos_a = res[2];
+    }
 
-  void
-  evaluate(const double r,
-           double& ATH_RESTRICT sin_a,
-           double& ATH_RESTRICT cos_a) const ATH_RESTRICT
-  {
-    const double r2 = r * r;
-    CxxUtils::vec<double, 4> P = r2 * param_0 + param_1;
-    P = r2 * P + param_2;
-    CxxUtils::vec<double, 4> P2 = { P[1], P[0], P[3], P[2] };
-    CxxUtils::vec<double, 4> res = r * P2 + P;
-    sin_a = res[0];
-    cos_a = res[2];
-  }
+    __attribute__((target("avx2")))
 
-  __attribute__((target("avx2")))
+    void
+    eval(const double r,
+         double &ATH_RESTRICT sin_a,
+         double &ATH_RESTRICT cos_a) const ATH_RESTRICT
+    {
+        const double r2 = r * r;
+        CxxUtils::vec<double, 4> P = r2 * param_0 + param_1;
+        P = r2 * P + param_2;
+        CxxUtils::vec<double, 4> P2 = {P[1], P[0], P[3], P[2]};
+        CxxUtils::vec<double, 4> res = r * P2 + P;
+        sin_a = res[0];
+        cos_a = res[2];
+    }
 
-  void
-  eval(const double r,
-       double& ATH_RESTRICT sin_a,
-       double& ATH_RESTRICT cos_a) const ATH_RESTRICT
-  {
-    const double r2 = r * r;
-    CxxUtils::vec<double, 4> P = r2 * param_0 + param_1;
-    P = r2 * P + param_2;
-    CxxUtils::vec<double, 4> P2 = { P[1], P[0], P[3], P[2] };
-    CxxUtils::vec<double, 4> res = r * P2 + P;
-    sin_a = res[0];
-    cos_a = res[2];
-  }
+    __attribute__((target("default")))
 
-  __attribute__((target("default")))
 #endif // x86
 #endif // FMV
 
-  void
-  eval(const double r,
-       double& ATH_RESTRICT sin_a,
-       double& ATH_RESTRICT cos_a) const ATH_RESTRICT
-  {
-    const double r2 = r * r;
-    CxxUtils::vec<double, 4> P = r2 * param_0 + param_1;
-    P = r2 * P + param_2;
-    sin_a = r * P[1] + P[0];
-    cos_a = r * P[3] + P[2];
-  }
+    void
+    eval(const double r,
+         double &ATH_RESTRICT sin_a,
+         double &ATH_RESTRICT cos_a) const ATH_RESTRICT
+    {
+        const double r2 = r * r;
+        CxxUtils::vec<double, 4> P = r2 * param_0 + param_1;
+        P = r2 * P + param_2;
+        sin_a = r * P[1] + P[0];
+        cos_a = r * P[3] + P[2];
+    }
 };
 
 #endif
-
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx
index cec1e276735f..11a481c860f3 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx
@@ -443,9 +443,6 @@ LArWheelCalculator::LArWheelCalculator(LArG4::LArWheelCalculator_t a_wheelType,
      fclose(O);
      exit(0);
   */
-
-   // set the sincos calculator
-   m_sincos_calculator = &LArWheelCalculator::parameterized_sincos;
 }
 
 /* converts module gap number into wheel gap number */
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
index 0163f1ba9442..06239cc8c1f4 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx
@@ -48,7 +48,7 @@ namespace LArWheelCalculator_Impl
     const double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->EvalSincos(P.y(), sin_a, cos_a);
+    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
 #endif
     // determination of the nearest quarter-wave number
     int nqwave = (z < 0.) ? 0 : int(z / lwc()->m_QuarterWaveLength);
@@ -160,7 +160,7 @@ namespace LArWheelCalculator_Impl
     double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->EvalSincos(P.y(), sin_a, cos_a);
+    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
 #endif
 
     bool sqw = false;
@@ -251,7 +251,7 @@ namespace LArWheelCalculator_Impl
     const double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->EvalSincos(P.y(), sin_a, cos_a);
+    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
 #endif
 
     int nqwave;
@@ -339,7 +339,7 @@ namespace LArWheelCalculator_Impl
     double cos_a = scalpha.cs, sin_a = scalpha.sn;
 #else // parameterized sine
     double cos_a, sin_a;
-    lwc()->EvalSincos(P.y(), sin_a, cos_a);
+    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
 #endif
 
     bool sqw = false;
@@ -434,7 +434,7 @@ namespace LArWheelCalculator_Impl
     // parameterized sine
 #else
     double cos_a, sin_a;
-    lwc()->EvalSincos(P.y(), sin_a, cos_a);
+    lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a);
 #endif
 
     // determination of the nearest quarter-wave number
diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
index 917badd4cd08..deebabc0c293 100644
--- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
+++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx
@@ -99,6 +99,8 @@ void LArWheelCalculator::fill_sincos_parameterization()
       m_cos_parametrization[i] = cos_parametrization[S][i];
     }
 
+    // Parameterization for the vectorized sincos calculation
+    // see ATLASSIM-4753 for details
     // s4, s5, c4, c5
     // s2, s3, c2, c3
     // s0, s1, c0, c1
@@ -155,6 +157,8 @@ void LArWheelCalculator::fill_sincos_parameterization()
     cos_parametrization[S][i] = params_cos[i];
   }
 
+  // Parameterization for the vectorized sincos calculation
+  // see ATLASSIM-4753 for details
   // s4, s5, c4, c5
   // s2, s3, c2, c3
   // s0, s1, c0, c1
@@ -191,8 +195,12 @@ void LArWheelCalculator::fill_sincos_parameterization()
     parameterized_sincos(r, sin_a, cos_a);
     m_vsincos_par.eval(r, sin_a_v, cos_a_v);
 #if DEBUGPRINT
-    std::cout << "default: " << r << " " << sin_a << " " << cos_a << std::endl;
+    std::streamsize ss = std::cout.precision();
+    std::cout.precision(16);
+    std::cout << "def: " << r << " " << sin_a << " " << cos_a << std::endl;
     std::cout << "vec: " << r << " " << sin_a_v << " " << cos_a_v << std::endl;
+    std::cout << "dif: " << r << " " << (sin_a - sin_a_v) / sin_a << " " << (cos_a - cos_a_v) / cos_a << std::endl;
+    std::cout.precision(ss);
 #endif
     double ds = fabs(scalpha.sn - sin_a);
     if(ds > dsin){
-- 
GitLab


From 0647e0c7d2e7985211e658d2f6389059972a611f Mon Sep 17 00:00:00 2001
From: Miha Muskinja <miha.muskinja@cern.ch>
Date: Thu, 16 Sep 2021 11:58:14 -0700
Subject: [PATCH 165/347] updated ref  file

---
 Tools/PROCTools/python/RunTier0TestsTools.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Tools/PROCTools/python/RunTier0TestsTools.py b/Tools/PROCTools/python/RunTier0TestsTools.py
index ccabca200d7b..c5c0d855bbf6 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'           : 'v12',
+                's3505-22.0'           : 'v13',
                 # OverlayTier0Test_required-test
                 'overlay-d1498-21.0'   : 'v2',
                 'overlay-d1498-22.0'   : 'v38',
-- 
GitLab


From 42f76d8139d1faca3f65d4db17d92c15a247d892 Mon Sep 17 00:00:00 2001
From: Chav Chhiv Chau <chav.chhiv.chau@cern.ch>
Date: Thu, 16 Sep 2021 15:01:41 -0400
Subject: [PATCH 166/347] Remove the timeJitter method in sTgcDigitMaker

timeJitter provides an incorrect description of the sTGC time
response. It is replaced by a more detailed model that parametrizes
the time as a function of the distance between a track and the nearest
wire, see merge request !46472. So timeJitter is not used anymore.
---
 .../sTGC_Digitization/sTgcDigitMaker.h        | 11 ---
 .../share/sTGC_Digitization_timejitter.dat    | 13 ---
 .../sTGC_Digitization/src/sTgcDigitMaker.cxx  | 79 -------------------
 3 files changed, 103 deletions(-)
 delete mode 100644 MuonSpectrometer/MuonDigitization/sTGC_Digitization/share/sTGC_Digitization_timejitter.dat

diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h
index c7bc27353772..3885ae285249 100644
--- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h
+++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitMaker.h
@@ -87,15 +87,6 @@ class sTgcDigitMaker {
     double mostProbableTime;
   };
 
-  /**
-     Reads parameters for intrinsic time response from timejitter.dat.
-  */
-  void  readFileOfTimeJitter();
-  /**
-     Calculates intrinsic time response according to incident angle of a track based on time response parameters
-  */
-  float timeJitter(float inAngle_time) const;
-
   /**
      Determines whether a hit is detected or not.
   */
@@ -166,8 +157,6 @@ class sTgcDigitMaker {
   ///** Alignment ths constants. Rotation around the global phi direction */
   //double m_alignmentTHS[N_STATIONNAME][N_STATIONETA][N_STATIONPHI];
 
-  std::vector<std::vector<float> > m_vecAngle_Time;
-
   // Parameters of the gamma pdf required for determining digit time
   std::vector<GammaParameter> m_gammaParameter;
 
diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/share/sTGC_Digitization_timejitter.dat b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/share/sTGC_Digitization_timejitter.dat
deleted file mode 100644
index 1f4a23e117a1..000000000000
--- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/share/sTGC_Digitization_timejitter.dat
+++ /dev/null
@@ -1,13 +0,0 @@
-  0 41 0.0805 0.1412 0.0998 0.0782 0.0687 0.0646 0.0638 0.0623 0.0519 0.0447 0.0395 0.0348 0.0311 0.0231 0.0215 0.0194 0.0142 0.0139 0.0091 0.0075 0.0050 0.0045 0.0038 0.0034 0.0025 0.0024 0.0012 0.0015 0.0012 0.0010 0.0005 0.0005 0.0008 0.0009 0.0003 0.0002 0.0004 0.0001 0.0000 0.0000 0.0000
-  5 41 0.0772 0.1440 0.0972 0.0799 0.0736 0.0688 0.0646 0.0614 0.0505 0.0441 0.0383 0.0352 0.0317 0.0235 0.0230 0.0187 0.0138 0.0142 0.0120 0.0107 0.0091 0.0066 0.0012 0.0004 0.0001 0.0000 0.0000 0.0001 0.0000 0.0000 0.0000 0.0000 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 10 41 0.0797 0.1456 0.0925 0.0827 0.0746 0.0668 0.0623 0.0591 0.0517 0.0485 0.0438 0.0372 0.0359 0.0299 0.0239 0.0206 0.0199 0.0166 0.0070 0.0013 0.0003 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 15 41 0.0860 0.1486 0.1012 0.0832 0.0771 0.0709 0.0618 0.0563 0.0557 0.0453 0.0472 0.0381 0.0340 0.0350 0.0270 0.0250 0.0060 0.0007 0.0005 0.0002 0.0002 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 20 41 0.0894 0.1517 0.1000 0.0866 0.0734 0.0713 0.0650 0.0616 0.0556 0.0551 0.0480 0.0440 0.0369 0.0383 0.0197 0.0026 0.0006 0.0001 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 25 41 0.0842 0.1597 0.1047 0.0925 0.0791 0.0746 0.0693 0.0644 0.0599 0.0570 0.0547 0.0442 0.0450 0.0087 0.0014 0.0002 0.0001 0.0002 0.0000 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 30 41 0.0898 0.1682 0.1128 0.0938 0.0856 0.0781 0.0724 0.0693 0.0663 0.0607 0.0573 0.0392 0.0049 0.0011 0.0001 0.0003 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 35 41 0.0946 0.1843 0.1212 0.1023 0.0864 0.0799 0.0769 0.0693 0.0730 0.0647 0.0416 0.0043 0.0009 0.0003 0.0002 0.0000 0.0000 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 40 41 0.1029 0.1856 0.1318 0.1087 0.0984 0.0896 0.0865 0.0766 0.0755 0.0389 0.0037 0.0009 0.0004 0.0001 0.0000 0.0002 0.0002 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 45 41 0.1128 0.2075 0.1301 0.1191 0.1051 0.1026 0.0934 0.0891 0.0345 0.0032 0.0019 0.0003 0.0001 0.0001 0.0002 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 50 41 0.1214 0.2264 0.1512 0.1290 0.1183 0.1127 0.1038 0.0295 0.0049 0.0017 0.0006 0.0001 0.0002 0.0002 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 55 41 0.1365 0.2545 0.1686 0.1493 0.1411 0.1182 0.0255 0.0039 0.0013 0.0009 0.0001 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
- 60 41 0.1558 0.2972 0.1983 0.1697 0.1373 0.0301 0.0075 0.0026 0.0007 0.0004 0.0002 0.0002 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx
index 685898b31a42..09648ea7582b 100644
--- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx
+++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitMaker.cxx
@@ -80,8 +80,6 @@ StatusCode sTgcDigitMaker::initialize(CLHEP::HepRandomEngine *rndmEngine, const
   // initialize the TGC identifier helper
   m_idHelper = m_mdManager->stgcIdHelper();
 
-  readFileOfTimeJitter();
-
   // Read share/sTGC_Digitization_timeArrivale.dat, containing the digit time of arrival
   readFileOfTimeArrival();
 
@@ -606,83 +604,6 @@ double sTgcDigitMaker::distanceToWire(Amg::Vector3D& position, Amg::Vector3D& di
   return (sign * distance);
 }
 
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void sTgcDigitMaker::readFileOfTimeJitter()
-{
-
-  const char* const fileName = "sTGC_Digitization_timejitter.dat";
-  std::string fileWithPath = PathResolver::find_file (fileName, "DATAPATH");
-
-  std::ifstream ifs;
-  if (!fileWithPath.empty()) {
-    ifs.open(fileWithPath.c_str(), std::ios::in);
-  }
-  else {
-    ATH_MSG_FATAL("readFileOfTimeJitter(): Could not find file " << fileName );
-    exit(-1);
-  }
-
-  if(ifs.bad()){
-    ATH_MSG_FATAL("readFileOfTimeJitter(): Could not open file "<< fileName );
-    exit(-1);
-  }
-
-  int angle = 0;
-  int bins = 0;
-  int i = 0;
-  float prob = 0.;
-
-  while(ifs.good()){
-    ifs >> angle >> bins;
-    if (ifs.eof()) break;
-    if(msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "readFileOfTimeJitter(): Timejitter, angle, Number of bins, prob. dist.: " << angle << " " << bins << " ";
-    m_vecAngle_Time.resize(i + 1);
-    for (int j = 0; j < 41/*bins*/; j++) {
-      ifs >> prob;
-      m_vecAngle_Time[i].push_back(prob);
-      if (j == 0)
-        if(msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "readFileOfTimeJitter(): ";
-      if(msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << prob << " ";
-    }
-    if(msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << endmsg;
-    i++;
-  }
-  ifs.close();
-}
-
-//+++++++++++++++++++++++++++++++++++++++++++++++
-float sTgcDigitMaker::timeJitter(float inAngle_time) const
-{
-
-  int   ithAngle = static_cast<int>(inAngle_time/5.);
-  float wAngle = inAngle_time/5. - static_cast<float>(ithAngle);
-  int   jthAngle;
-  if (ithAngle > 11) {
-    ithAngle = 12;
-    jthAngle = 12;
-  }
-  else {
-    jthAngle = ithAngle+1;
-  }
-
-  float jitter;
-  float prob = 1.;
-  float probRef = 0.;
-
-  while (prob > probRef) {
-    prob   = CLHEP::RandFlat::shoot(m_engine, 0.0, 1.0);
-    jitter = CLHEP::RandFlat::shoot(m_engine, 0.0, 1.0)*40.; // trial time jitter in nsec
-    int ithJitter = static_cast<int>(jitter);
-    // probability distribution calculated from weighted sum between neighboring bins of angles
-    probRef = (1.-wAngle)*m_vecAngle_Time[ithAngle][ithJitter]
-      +    wAngle *m_vecAngle_Time[jthAngle][ithJitter];
-  }
-
-  ATH_MSG_VERBOSE("sTgcDigitMaker::timeJitter : angle = " << inAngle_time 
-                  << ";  timeJitterDetector = " << jitter );
-
-  return jitter;
-}
 //+++++++++++++++++++++++++++++++++++++++++++++++
 bool sTgcDigitMaker::efficiencyCheck(const int channelType) const {
   if(channelType == 0) { // wire group
-- 
GitLab


From bdead100ef54112acf5c5de5e4f521a1c4a4e98c Mon Sep 17 00:00:00 2001
From: Peter Berta <peter.berta@cern.ch>
Date: Thu, 16 Sep 2021 17:12:00 +0200
Subject: [PATCH 167/347] Merge branch 'cherry-pick-516a8d27' into '22.0-mc20'

Added missing xAOD::TrigConfKeys from DESDM_MCP

See merge request atlas/athena!46545

(cherry picked from commit 48abef953c0301a70f293fd6cdaf9c94779b341b)

ce302f9e Added missing xAOD::TrigConfKeys from DESDM_MCP
---
 PhysicsAnalysis/PrimaryDPDMaker/share/PerfDESDM_MS.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PhysicsAnalysis/PrimaryDPDMaker/share/PerfDESDM_MS.py b/PhysicsAnalysis/PrimaryDPDMaker/share/PerfDESDM_MS.py
index 17116d50b1e7..f5fec1a443d3 100644
--- a/PhysicsAnalysis/PrimaryDPDMaker/share/PerfDESDM_MS.py
+++ b/PhysicsAnalysis/PrimaryDPDMaker/share/PerfDESDM_MS.py
@@ -337,6 +337,8 @@ AlignmentTriggerMuonStream.AddItem(["xAOD::TrigNavigation#TrigNavigation"])
 AlignmentTriggerMuonStream.AddItem(["xAOD::TrigNavigationAuxInfo#TrigNavigationAux."])
 AlignmentTriggerMuonStream.AddItem(["xAOD::TrigDecision#xTrigDecision"])
 AlignmentTriggerMuonStream.AddItem(["xAOD::TrigDecisionAuxInfo#xTrigDecisionAux."])
+AlignmentTriggerMuonStream.AddItem(["xAOD::TrigConfKeys#TrigConfKeys"])
+AlignmentTriggerMuonStream.AddItem(["HLT::HLTResult#HLTResult_HLT"])
 AlignmentTriggerMuonStream.AddItem(["xAOD::MuonRoIContainer#LVL1MuonRoIs"])
 AlignmentTriggerMuonStream.AddItem(["xAOD::MuonRoIAuxContainer#LVL1MuonRoIsAux."])
 AlignmentTriggerMuonStream.AddItem(["Muon::RpcPrepDataContainer#*"])
-- 
GitLab


From 450af8a29d68504477f78bfa1bc724fd0e027635 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Thu, 16 Sep 2021 17:32:17 +0200
Subject: [PATCH 168/347] Fix for TRTSensitiveDetector when using the
 G4GammaGeneralProcess

---
 .../TRT_G4_SD/src/TRTSensitiveDetector.cxx        | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx
index 3805ef6dfeb7..23b32f43f501 100644
--- a/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx
+++ b/InnerDetector/InDetG4/TRT_G4_SD/src/TRTSensitiveDetector.cxx
@@ -30,6 +30,7 @@
 #include "G4Positron.hh"
 #include "G4ProcessManager.hh"
 #include "G4ProcessVector.hh"
+#include "G4GammaGeneralProcess.hh"
 #include "G4NistManager.hh"
 
 //stl includes
@@ -186,8 +187,22 @@ void TRTSensitiveDetector::Initialize(G4HCofThisEvent* /*pHCofThisEvent*/)
             m_phot = (*pVec)[ip];
             break;
           }
+        if((*pVec)[ip]->GetProcessName()=="GammaGeneralProc")
+          {
+            G4GammaGeneralProcess *genproc = static_cast<G4GammaGeneralProcess*>((*pVec)[ip]);
+            G4VEmProcess *proc = genproc->GetEmProcess("phot");
+            if (proc && proc->GetProcessName()=="phot")
+              {
+                m_phot = proc;
+                break;
+              }
+          }
       }
   }
+  if(!m_phot) {
+    G4cout << GetName() << "ERROR Did not find the photoelectic process!!!" << G4endl;
+  }
+
 
   if (!m_HitColl.isValid()) m_HitColl = std::make_unique<TRTUncompressedHitCollection>();
 
-- 
GitLab


From 07bb1571a9fd9299bbc51308e62625227487564c Mon Sep 17 00:00:00 2001
From: Christina Nelson <christina.nelson@cern.ch>
Date: Thu, 16 Sep 2021 23:21:40 +0200
Subject: [PATCH 169/347] re-enabling jets in the AOD for ART

---
 Reconstruction/Jet/JetValidation/test/test_jet.sh         | 2 +-
 Reconstruction/Jet/JetValidation/test/test_jet_noPtCut.sh | 2 +-
 Reconstruction/Jet/JetValidation/test/test_met.sh         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Reconstruction/Jet/JetValidation/test/test_jet.sh b/Reconstruction/Jet/JetValidation/test/test_jet.sh
index 7907455ef062..34c65c574481 100755
--- a/Reconstruction/Jet/JetValidation/test/test_jet.sh
+++ b/Reconstruction/Jet/JetValidation/test/test_jet.sh
@@ -31,7 +31,7 @@ Reco_tf.py \
     --valid=True \
     --validationFlags 'doInDet,doJet' \
     --autoConfiguration everything \
-    --preExec 'from RecExConfig.RecFlags import rec;rec.doTrigger=False'
+    --preExec 'from RecExConfig.RecFlags import rec;rec.doTrigger=False; from JetRec.JetRecFlags import jetFlags; jetFlags.writeJetsToAOD.set_Value_and_Lock(True)'
 
 rc=$?
 echo "art-result: $rc Reco"
diff --git a/Reconstruction/Jet/JetValidation/test/test_jet_noPtCut.sh b/Reconstruction/Jet/JetValidation/test/test_jet_noPtCut.sh
index 2b72a3e524a1..b4c2317f5cc9 100755
--- a/Reconstruction/Jet/JetValidation/test/test_jet_noPtCut.sh
+++ b/Reconstruction/Jet/JetValidation/test/test_jet_noPtCut.sh
@@ -31,7 +31,7 @@ Reco_tf.py \
     --valid=True \
     --validationFlags 'doInDet,doJet' \
     --autoConfiguration everything \
-    --preExec 'from RecExConfig.RecFlags import rec;rec.doTrigger=False; from JetRec.JetRecFlags import jetFlags; jetFlags.useCalibJetThreshold.set_Value_and_Lock(False)'
+    --preExec 'from RecExConfig.RecFlags import rec;rec.doTrigger=False; from JetRec.JetRecFlags import jetFlags; jetFlags.useCalibJetThreshold.set_Value_and_Lock(False); jetFlags.writeJetsToAOD.set_Value_and_Lock(True)'
 
 rc=$?
 echo "art-result: $rc Reco"
diff --git a/Reconstruction/Jet/JetValidation/test/test_met.sh b/Reconstruction/Jet/JetValidation/test/test_met.sh
index e704fb72f705..5ff3bf9faa46 100755
--- a/Reconstruction/Jet/JetValidation/test/test_met.sh
+++ b/Reconstruction/Jet/JetValidation/test/test_met.sh
@@ -31,7 +31,7 @@ Reco_tf.py \
     --valid=True \
     --validationFlags 'doInDet,doMET' \
     --autoConfiguration everything \
-    --preExec 'from RecExConfig.RecFlags import rec;rec.doTrigger=False'
+    --preExec 'from RecExConfig.RecFlags import rec;rec.doTrigger=False; from JetRec.JetRecFlags import jetFlags; jetFlags.writeJetsToAOD.set_Value_and_Lock(True)'
 
 rc=$?
 echo "art-result: $rc Reco"
-- 
GitLab


From 152d805611057d4348cb1d658336718fb979e909 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 30 Aug 2021 22:33:26 -0400
Subject: [PATCH 170/347] MuonCondData: Fix cppcheck warnings.

Fix cppcheck warnings.
---
 .../MuonCondData/MuonCondData/CscCondData.h            |  4 ++--
 .../MuonCondData/MuonCondData/CscCondDbData.h          |  4 ++--
 .../MuonCondData/MuonCondData/RpcCondDbData.h          | 10 +++++-----
 .../MuonCondData/MuonCondData/RpcConditionPar.h        |  4 ++--
 .../MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx | 10 +++++-----
 .../MuonCondData/src/RpcConditionPar.cxx               |  4 ++--
 6 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondData.h
index 7d9e8f8150db..eae7aa5c2ded 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondData.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondData.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 CSCCONDDATA_H
@@ -19,7 +19,7 @@ namespace MuonCalib {
   template <class data_type> class CscCondData
   {
     public:
-      CscCondData(const data_type & value) { m_value = value; }
+    CscCondData(const data_type & value) : m_value (value) {  }
       void setValue(const data_type & value);
       inline const data_type & getValue() const;
     private:
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h
index 40d27267e79c..6c291243e3de 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.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 MUONCONDDATA_CSCCONDDBDATA_H
@@ -124,7 +124,7 @@ private:
 public:
 
     // readChannelParam
-    template <typename T> StatusCode readChannelParam(IdentifierHash hash, T& val, std::string parName) const{
+    template <typename T> StatusCode readChannelParam(IdentifierHash hash, T& val, const std::string& parName) const{
 
         if     (parName == "f001"   ) { float theVal; return readChannelF001   (hash, theVal); val = theVal; }
         else if(parName == "noise"  ) { float theVal; return readChannelNoise  (hash, theVal); val = theVal; }
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCondDbData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCondDbData.h
index 521d934614ca..3640c4975205 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCondDbData.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCondDbData.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 MUONCONDDATA_RPCCONDDBDATA_H
@@ -28,10 +28,10 @@ public:
     RpcCondDbData();
     virtual ~RpcCondDbData() = default;
 
-    void setDeadPanel       (std::string, Identifier        );
+    void setDeadPanel       (const std::string&, Identifier );
     void setDeadStrip       (Identifier                     );
     void setDeadStripInt    (Identifier, int                );
-    void setDeadStripList   (Identifier, std::string        );
+    void setDeadStripList   (Identifier, const std::string& );
     void setEfficiency      (Identifier, double             );
     void setFracClusterSize1(Identifier, double             );
     void setFracClusterSize2(Identifier, double             );
@@ -40,9 +40,9 @@ public:
     void setGapEfficiency   (Identifier, double             );
     void setLowEffPanel     (Identifier                     );
     void setMeanClusterSize (Identifier, double             );
-    void setOffPanel        (std::string, Identifier        );
+    void setOffPanel        (const std::string&, Identifier );
     void setProjectedTrack  (Identifier, int                );
-    void setStripTime       (Identifier, std::vector<double>);
+    void setStripTime       (Identifier, const std::vector<double>&);
 
     const std::vector<std::string>& getDeadPanels() const;
     const std::vector<std::string>& getOffPanels () const;
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcConditionPar.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcConditionPar.h
index 031ef4395a20..130170890698 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcConditionPar.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcConditionPar.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 MUONCONDDATA_RPCCONDITIONPAR_H
@@ -23,7 +23,7 @@ class RpcConditionPar{
   Identifier  identify()      {return m_panel;}
   //std::string key()           {return m_stationKey;}
 
-  void setParametersPanel(std::string info_panel, std::string info_strip);
+  void setParametersPanel(const std::string& info_panel, const std::string& info_strip);
 
   void getParametersPanel(std::string& info_panel, std::string& info_strip);
   
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx
index c56dcd491c06..b51fe176ea8b 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx
@@ -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
 */
 
 #include "MuonCondData/RpcCondDbData.h"
@@ -13,7 +13,7 @@ RpcCondDbData::RpcCondDbData(){
 
 // setDeadPanel
 void
-RpcCondDbData::setDeadPanel(std::string name, Identifier Id){
+RpcCondDbData::setDeadPanel(const std::string& name, Identifier Id){
     if(std::find(m_cachedDeadPanelsId.begin(), m_cachedDeadPanelsId.end(), Id)!=m_cachedDeadPanelsId.end()) return;
     m_cachedDeadPanels  .push_back(name);
     m_cachedDeadPanelsId.push_back(Id  );
@@ -35,7 +35,7 @@ RpcCondDbData::setDeadStripInt(Identifier chamberId, int striplist){
 
 // setDeadStripList
 void
-RpcCondDbData::setDeadStripList(Identifier chamberId, std::string striplist){
+RpcCondDbData::setDeadStripList(Identifier chamberId, const std::string& striplist){
     if(m_cachedDeadStripList.count(chamberId)) return;
     m_cachedDeadStripList[chamberId] = striplist;
 }
@@ -98,7 +98,7 @@ RpcCondDbData::setMeanClusterSize(Identifier chamberId, double mcs){
 
 // setOffPanel
 void
-RpcCondDbData::setOffPanel(std::string name, Identifier Id){
+RpcCondDbData::setOffPanel(const std::string& name, Identifier Id){
     if(std::find(m_cachedOffPanelsId.begin(), m_cachedOffPanelsId.end(), Id)!=m_cachedOffPanelsId.end()) return;
     m_cachedOffPanels  .push_back(name);
     m_cachedOffPanelsId.push_back(Id  );
@@ -113,7 +113,7 @@ RpcCondDbData::setProjectedTrack(Identifier chamberId, int projectedTracks){
 
 // setStripTime
 void
-RpcCondDbData::setStripTime(Identifier stripId, std::vector<double> time){
+RpcCondDbData::setStripTime(Identifier stripId, const std::vector<double>& time){
     if(m_cachedStripTime.count(stripId)) return;
     m_cachedStripTime[stripId] = time;
 }
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcConditionPar.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcConditionPar.cxx
index 856a9375f12e..f7afa9a4dde6 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcConditionPar.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcConditionPar.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
 */
 
 
@@ -26,7 +26,7 @@ RpcConditionPar::RpcConditionPar()
 RpcConditionPar::~RpcConditionPar()
 { }
 
-void RpcConditionPar::setParametersPanel(std::string info_panel, std::string info_strip)
+void RpcConditionPar::setParametersPanel(const std::string& info_panel, const std::string& info_strip)
 {
   m_info_panel	= info_panel;
   m_info_strip	= info_strip;
-- 
GitLab


From c1160c34fd7212cd0bac2f33e6e9920cc83cbafa Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 31 Aug 2021 20:20:45 -0400
Subject: [PATCH 171/347] AmdcDb: Fix cppcheck warnings.

Fix cppcheck warnings.
---
 .../Amdcsimrec/AmdcDb/AmdcDb/AmdcDb2Sql.h            |  6 +++---
 .../Amdcsimrec/AmdcDb/AmdcDb/AmdcDbRecord.h          |  4 ++--
 .../Amdcsimrec/AmdcDb/AmdcDb/AmdcDbSvcMakerFromRDB.h | 12 ++++++------
 MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx    |  3 +--
 .../Amdcsimrec/AmdcDb/src/AmdcDb2Sql.cxx             |  8 ++++----
 .../Amdcsimrec/AmdcDb/src/AmdcDbRecord.cxx           |  4 ++--
 .../Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromAmdc.cxx |  4 ++--
 .../Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx  | 10 +++++-----
 8 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb2Sql.h b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb2Sql.h
index 592dc485a46e..9229d6be6606 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb2Sql.h
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDb2Sql.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 AMDCDB_AMDCDB2SQL_H
@@ -31,13 +31,13 @@ public:
    void SetUseKeysOn(int UseKeysOn);
    
    /**Production of sql files */
-   void DoIt(std::string TagFileName,std::string tag,IRDBAccessSvc* pIRDBAccessSvc);
+   void DoIt(const std::string& TagFileName,const std::string& tag,IRDBAccessSvc* pIRDBAccessSvc);
 
 private:
 ///////////////////////////////////
 
    /**Base Production of sql files */
-   void DoSql(std::string TagFileName,std::string NameOfTheSet,std::string tag, IRDBAccessSvc* pIRDBAccessSvc);
+   void DoSql(const std::string& TagFileName,const std::string& NameOfTheSet,std::string tag, IRDBAccessSvc* pIRDBAccessSvc);
 
    int m_AsNewTableOn ; //!< Control swl file prod 
    int m_UseKeysOn    ; //!< Control swl file prod 
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDbRecord.h b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDbRecord.h
index 8830b0b3e256..111af6a8b30a 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDbRecord.h
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDbRecord.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 AMDCDB_AMDCDBRECORD_H
@@ -22,7 +22,7 @@
 
 class AmdcDbRecord : public IRDBRecord{
 public:
-    AmdcDbRecord(long UniversalId,std::string NameOfTheRecord);
+    AmdcDbRecord(long UniversalId,const std::string& NameOfTheRecord);
     virtual ~AmdcDbRecord();
 
 public:
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDbSvcMakerFromRDB.h b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDbSvcMakerFromRDB.h
index 322fb11b5217..146e63e14425 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDbSvcMakerFromRDB.h
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/AmdcDb/AmdcDbSvcMakerFromRDB.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 AMDCDB_AMDCDBSVCMAKERFROMRDB_H
@@ -37,12 +37,12 @@ public:
    void SetEpsLengthMM(int EpsLengthMM);
    void SetEpsLengthCM(int EpsLengthCM);
    void SetEpsAngle   (int EpsAngle   );
-   void SetEpsLengthMM(std::string NameOfTheSet, int EpsLengthMM);
-   void SetEpsLengthCM(std::string NameOfTheSet, int EpsLengthCM);
-   void SetEpsAngle   (std::string NameOfTheSet, int EpsAngle   );
+   void SetEpsLengthMM(const std::string& NameOfTheSet, int EpsLengthMM);
+   void SetEpsLengthCM(const std::string& NameOfTheSet, int EpsLengthCM);
+   void SetEpsAngle   (const std::string& NameOfTheSet, int EpsAngle   );
    void Set(
-            std::string detectorKey  ,
-            std::string detectorNode ,
+            const std::string& detectorKey  ,
+            const std::string& detectorNode ,
             IRDBAccessSvc* pIRDBAccessSvc,
 	    AmdcDbSvc* pAmdcDbSvc
 	   );
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx
index bec013addc0e..bef510fafb22 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.cxx
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb.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 "StoreGate/StoreGateSvc.h"
@@ -27,7 +27,6 @@ AmdcDb::AmdcDb(const std::string& name,ISvcLocator* svc)
   m_AmdcDbSvcFromAmdc = 0 ;
   m_AmdcDbSvcFromRDB  = 0 ;
 
-  m_AMDBtag = "" ;
   m_UglyCodeOn = 0 ;
 
   m_FromAmdcEpsLengthMM = 4 ;
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb2Sql.cxx b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb2Sql.cxx
index 5389b2f202a8..d18981ade241 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb2Sql.cxx
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDb2Sql.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 "RDBAccessSvc/IRDBAccessSvc.h"
@@ -26,7 +26,7 @@ AmdcDb2Sql::~AmdcDb2Sql(){}
 void AmdcDb2Sql::SetAsNewTableOn(int AsNewTableOn){ m_AsNewTableOn  = AsNewTableOn ;}
 void AmdcDb2Sql::SetUseKeysOn(int UseKeysOn){ m_UseKeysOn  = UseKeysOn ;}
 
-void AmdcDb2Sql::DoIt(std::string TagFileName,std::string tag,IRDBAccessSvc* pIRDBAccessSvc){
+void AmdcDb2Sql::DoIt(const std::string& TagFileName,const std::string& tag,IRDBAccessSvc* pIRDBAccessSvc){
 
   DoSql(TagFileName,"AMDC",tag,pIRDBAccessSvc);
   DoSql(TagFileName,"AGDD",tag,pIRDBAccessSvc);
@@ -60,7 +60,7 @@ void AmdcDb2Sql::DoIt(std::string TagFileName,std::string tag,IRDBAccessSvc* pIR
 
 }
 
-void AmdcDb2Sql::DoSql(std::string TagFileName,std::string NameOfTheSet,std::string tag, IRDBAccessSvc* pIRDBAccessSvc) {
+void AmdcDb2Sql::DoSql(const std::string& TagFileName,const std::string& NameOfTheSet,std::string tag, IRDBAccessSvc* pIRDBAccessSvc) {
 
   std::ofstream OutFile;
   std::string FileName = TagFileName + ".";
@@ -159,7 +159,7 @@ void AmdcDb2Sql::DoSql(std::string TagFileName,std::string NameOfTheSet,std::str
 
   int ElementKounter = -1;
   it = pIRDBRecordset->begin();
-  for ( ; it<pIRDBRecordset->end(); it++){
+  for ( ; it<pIRDBRecordset->end(); ++it){
     pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
     if (pAmdcDbRecord == 0){
       OutFile << "No way to cast in AmdcDbRecord for " << NameOfTheSet << std::endl;
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbRecord.cxx b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbRecord.cxx
index 0e5b658bf253..4c4cf5b61d98 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbRecord.cxx
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbRecord.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 "AmdcDb/AmdcDbRecord.h"
@@ -8,7 +8,7 @@
 #include <fstream>
 #include <iomanip>
 
-AmdcDbRecord::AmdcDbRecord(long UniversalId,std::string NameOfTheRecord){
+AmdcDbRecord::AmdcDbRecord(long UniversalId,const std::string& NameOfTheRecord){
 
   m_MapOfint["Dummy"]    =  0  ; m_MapOfint.clear();
   m_MapOfdouble["Dummy"] =  0. ; m_MapOfdouble.clear();
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromAmdc.cxx b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromAmdc.cxx
index 55b09b2279db..3efac076b372 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromAmdc.cxx
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromAmdc.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 "AmdcDb/AmdcDbSvcMakerFromAmdc.h"
@@ -203,7 +203,7 @@ if (Ifound == 1 ){
 
       DbVar = "JTYP"    ; DbVarComment="AMDB STATION TYPE"                  ; iDbVal = DB_JTYP                                    ; pAmdcDbRecord->addInt(DbVar,DbVarComment,iDbVal);
 
-      DbVar = "TYP"     ; DbVarComment="AMDB STATION NAME"	            ; sDbVal = sDbVal = pAmdcsimrec->StationName(DB_JTYP) ; pAmdcDbRecord->addString(DbVar,DbVarComment,sDbVal);
+      DbVar = "TYP"     ; DbVarComment="AMDB STATION NAME"	            ; sDbVal = pAmdcsimrec->StationName(DB_JTYP) ; pAmdcDbRecord->addString(DbVar,DbVarComment,sDbVal);
 
 //DRING: What is it? This a guess     						        
       DbVar = "NSTA"    ; DbVarComment="NUMBER OF STATIONS OF THIS TYPE"    ; iDbVal = iDbVal_NSTA                                ; pAmdcDbRecord->addInt(DbVar,DbVarComment,iDbVal);
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx
index 5d1aef2c4084..e87c4d87f77d 100755
--- a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx
+++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx
@@ -549,12 +549,12 @@ AmdcDbSvcMakerFromRDB::AmdcDbSvcMakerFromRDB(){
 void AmdcDbSvcMakerFromRDB::SetEpsLengthMM(int EpsLengthMM){ m_EpsLengthMM  = EpsLengthMM ;}
 void AmdcDbSvcMakerFromRDB::SetEpsLengthCM(int EpsLengthCM){ m_EpsLengthCM  = EpsLengthCM ;}
 void AmdcDbSvcMakerFromRDB::SetEpsAngle(int EpsAngle){ m_EpsAngle  = EpsAngle ;}
-void AmdcDbSvcMakerFromRDB::SetEpsLengthMM(std::string NameOfTheSet, int EpsLengthMM) { m_Map_Set_EpsLengthMM[NameOfTheSet] = EpsLengthMM ; }
-void AmdcDbSvcMakerFromRDB::SetEpsLengthCM(std::string NameOfTheSet, int EpsLengthCM) { m_Map_Set_EpsLengthCM[NameOfTheSet] = EpsLengthCM ; }
-void AmdcDbSvcMakerFromRDB::SetEpsAngle   (std::string NameOfTheSet, int EpsAngle   ) { m_Map_Set_EpsAngle   [NameOfTheSet] = EpsAngle    ; }
+void AmdcDbSvcMakerFromRDB::SetEpsLengthMM(const std::string& NameOfTheSet, int EpsLengthMM) { m_Map_Set_EpsLengthMM[NameOfTheSet] = EpsLengthMM ; }
+void AmdcDbSvcMakerFromRDB::SetEpsLengthCM(const std::string& NameOfTheSet, int EpsLengthCM) { m_Map_Set_EpsLengthCM[NameOfTheSet] = EpsLengthCM ; }
+void AmdcDbSvcMakerFromRDB::SetEpsAngle   (const std::string& NameOfTheSet, int EpsAngle   ) { m_Map_Set_EpsAngle   [NameOfTheSet] = EpsAngle    ; }
 void AmdcDbSvcMakerFromRDB::Set(
-            std::string detectorKey  ,
-            std::string detectorNode ,
+            const std::string& detectorKey  ,
+            const std::string& detectorNode ,
             IRDBAccessSvc* pIRDBAccessSvc,
 	    AmdcDbSvc* pAmdcDbSvc
 ){ 
-- 
GitLab


From 5f5ba3d685f0a4abef49830f25146457aa5357c9 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Sep 2021 12:45:09 -0400
Subject: [PATCH 172/347] GeoModelXml: Fix placement of using directives.

Do not put using directives in the global namespace in headers.
---
 .../GeoModelXml/GeoModelXml/createdomdocument.h            | 7 ++-----
 DetectorDescription/GeoModelXml/src/Gmx2Geo.cxx            | 1 +
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/DetectorDescription/GeoModelXml/GeoModelXml/createdomdocument.h b/DetectorDescription/GeoModelXml/GeoModelXml/createdomdocument.h
index bc7772436d8b..ed2614ac8456 100644
--- a/DetectorDescription/GeoModelXml/GeoModelXml/createdomdocument.h
+++ b/DetectorDescription/GeoModelXml/GeoModelXml/createdomdocument.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 CREATEDOMDOCUMENT_H
 #define CREATEDOMDOCUMENT_H
@@ -8,9 +8,6 @@
 #include <xercesc/dom/DOMLSParser.hpp>
 #include <iostream>
 
-using namespace std;
-using namespace xercesc;
-
-DOMDocument *createDOMDocument(string xmlFile, DOMLSParser *parser, unsigned int flags = 0);
+xercesc::DOMDocument *createDOMDocument(std::string xmlFile, xercesc::DOMLSParser *parser, unsigned int flags = 0);
 
 #endif // CREATEDOMDOCUMENT_H
diff --git a/DetectorDescription/GeoModelXml/src/Gmx2Geo.cxx b/DetectorDescription/GeoModelXml/src/Gmx2Geo.cxx
index 4315458a0306..51f9a015d8b7 100644
--- a/DetectorDescription/GeoModelXml/src/Gmx2Geo.cxx
+++ b/DetectorDescription/GeoModelXml/src/Gmx2Geo.cxx
@@ -27,6 +27,7 @@
 #include "GeoModelXml/createdomdocument.h"
 
 using namespace std;
+using namespace xercesc;
 
 Gmx2Geo::Gmx2Geo(const string xmlFile, GeoPhysVol *addHere, GmxInterface &gmxInterface, unsigned int flags) {
 //
-- 
GitLab


From c63db3115b432598408e28026639b7942926338e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 31 Aug 2021 20:27:22 -0400
Subject: [PATCH 173/347] MuonGMdbObjects: Enable thread-safety checking.

Enable thread-safety checking.
---
 .../MuonGMdbObjects/MuonGMdbObjects/ATLAS_CHECK_THREAD_SAFETY    | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 MuonSpectrometer/MuonGMdbObjects/MuonGMdbObjects/ATLAS_CHECK_THREAD_SAFETY

diff --git a/MuonSpectrometer/MuonGMdbObjects/MuonGMdbObjects/ATLAS_CHECK_THREAD_SAFETY b/MuonSpectrometer/MuonGMdbObjects/MuonGMdbObjects/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..f351733cd91b
--- /dev/null
+++ b/MuonSpectrometer/MuonGMdbObjects/MuonGMdbObjects/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+MuonSpectrometer/MuonGMdbObjects
-- 
GitLab


From edbdda9879fd8a8de6f92ad9e0a0e218195a7050 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 16 Sep 2021 16:17:44 +0200
Subject: [PATCH 174/347] MuonCombinedAlgs: Fix clang warning.

Missing override keyword.
---
 .../MuonCombinedAlgs/src/MuonSegmentTagAlg.h                | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.h b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.h
index cfb62a21c370..f7c49ddb817a 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonSegmentTagAlg.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 MUONCOMBINEDALGS_MUONSEGMENTAGALG_H
@@ -21,8 +21,8 @@ public:
 
     ~MuonSegmentTagAlg() = default;
 
-    StatusCode initialize()override;
-    StatusCode execute(const EventContext& ctx) const ;
+    virtual StatusCode initialize()override;
+    virtual StatusCode execute(const EventContext& ctx) const override;
 
 private:
     ToolHandle<MuonCombined::IMuonSegmentTagTool> m_muonSegmentTagTool{
-- 
GitLab


From 48bad43570b6674eee49cc0ba02f574683fe5767 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Thu, 16 Sep 2021 16:37:45 +0200
Subject: [PATCH 175/347] HGTD_FastDigitization: Fix compilation with clang.

Clang can't evaluate math library functions in constexpr.
But making a symbol for m_sqrt12 doesn't really buy us anything, so just
remove the symbol.
---
 .../HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h      | 2 --
 .../src/HGTD_SmearedDigitizationTool.cxx                      | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h
index e03a34270d77..ad42e081b9f1 100644
--- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h
+++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/HGTD_FastDigitization/HGTD_SmearedDigitizationTool.h
@@ -135,8 +135,6 @@ private:
   float m_err_x_hit;
   float m_err_y_hit;
 
-  static constexpr float m_sqrt12 = std::sqrt(12.);
-
   static constexpr unsigned int m_crazy_bc =
       std::numeric_limits<int32_t>::max();
 };
diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx
index a70832bed18a..d39917cc145a 100644
--- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx
+++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx
@@ -255,8 +255,8 @@ StatusCode HGTD_SmearedDigitizationTool::digitize(const EventContext& ctx) {
     double times_x = floor(dist_x / m_pitch_x);
     double times_y = floor(dist_y / m_pitch_y);
 
-    double sigma_x = m_pitch_x / m_sqrt12;
-    double sigma_y = m_pitch_y / m_sqrt12;
+    double sigma_x = m_pitch_x / std::sqrt(12);
+    double sigma_y = m_pitch_y / std::sqrt(12);
 
     int element_x = times_x + 1;
     int element_y = times_y + 1;
-- 
GitLab


From 8509fd39cbe041635e791644916ae39f781754f3 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Sep 2021 16:49:51 -0400
Subject: [PATCH 176/347] HGTD_GeoModel: Fix identifier naming.

Identifiers should not start with underscores.
---
 .../HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorTool.cxx   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorTool.cxx b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorTool.cxx
index 04b9b3ad1182..e1e7ce92c409 100644
--- a/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorTool.cxx
+++ b/HighGranularityTimingDetector/HGTD_DetDescr/HGTD_GeoModel/src/HGTD_DetectorTool.cxx
@@ -74,9 +74,9 @@ StatusCode HGTD_DetectorTool::create() {
 StatusCode HGTD_DetectorTool::clear() {
 
     // Release manager from the detector store
-    SG::DataProxy* _proxy = detStore()->proxy(ClassID_traits< HGTD_DetectorManager >::ID(),m_detectorManager->getName());
-    if (_proxy) {
-      _proxy->reset();
+    SG::DataProxy* proxy = detStore()->proxy(ClassID_traits< HGTD_DetectorManager >::ID(),m_detectorManager->getName());
+    if (proxy) {
+      proxy->reset();
       m_detectorManager = nullptr;
     }
 
-- 
GitLab


From 8d31e1b1566ef5fb7ec5757ed9d065920bb2b568 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Fri, 17 Sep 2021 07:52:16 +0200
Subject: [PATCH 177/347] LArGeoCode+LArGeoRAL+LArG4Barrel+LArG4EC: Make
 VDetectorParameters const.

---
 .../LArG4Barrel/src/CryostatCalibrationLArCalculator.h      | 4 ++--
 .../LArG4/LArG4Barrel/src/LArBarrelCalculator.cxx           | 2 +-
 LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelGeometry.cxx  | 6 +++---
 .../LArG4/LArG4Barrel/src/LArBarrelPresamplerCalculator.cxx | 4 ++--
 .../LArG4/LArG4Barrel/src/LArStraightAbsorbers.cxx          | 4 ++--
 .../LArG4/LArG4Barrel/src/LArStraightElectrodes.cxx         | 4 ++--
 .../LArG4/LArG4EC/src/CryostatCalibrationLArCalculator.h    | 4 ++--
 .../LArG4/LArG4EC/src/EMECSupportCalibrationCalculator.cc   | 2 +-
 .../LArGeoModel/LArGeoCode/LArGeoCode/VDetectorParameters.h | 4 ++--
 LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RAL.h        | 4 ++--
 LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALEmb.h     | 2 +-
 LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALEmec.h    | 4 ++--
 .../LArGeoModel/LArGeoRAL/LArGeoRAL/RALExperimentalHall.h   | 4 ++--
 LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALHec.h     | 4 ++--
 LArCalorimeter/LArGeoModel/LArGeoRAL/src/RAL.cxx            | 4 ++--
 LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALEmb.cxx         | 2 +-
 LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALEmec.cxx        | 2 +-
 .../LArGeoModel/LArGeoRAL/src/RALExperimentalHall.cxx       | 2 +-
 LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALHec.cxx         | 2 +-
 19 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/CryostatCalibrationLArCalculator.h b/LArCalorimeter/LArG4/LArG4Barrel/src/CryostatCalibrationLArCalculator.h
index a034ae12ee80..7ae9714deaae 100644
--- a/LArCalorimeter/LArG4/LArG4Barrel/src/CryostatCalibrationLArCalculator.h
+++ b/LArCalorimeter/LArG4/LArG4Barrel/src/CryostatCalibrationLArCalculator.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
 */
 
 // LArG4::BarrelCryostat::CalibrationLArCalculator
@@ -69,7 +69,7 @@ namespace LArG4 {
       CaloG4::SimulationEnergies m_energyCalculator;
 
       // Access to parameters.
-      LArVG4DetectorParameters* m_parameters;
+      const LArVG4DetectorParameters* m_parameters;
 
       ServiceHandle<ILArCalibCalculatorSvc> m_defaultCalculator;
 
diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelCalculator.cxx b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelCalculator.cxx
index 8d94e24403cf..7b6445d5aba9 100644
--- a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelCalculator.cxx
+++ b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelCalculator.cxx
@@ -87,7 +87,7 @@ StatusCode LArBarrelCalculator::initialize()
   }
 
   // Access source of detector parameters.
-  LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
+  const LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
 
   // Get the out-of-time cut from the detector parameters routine.
   m_OOTcut = parameters->GetValue("LArExpHallOutOfTimeCut"); //FIXME should be done via configurables
diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelGeometry.cxx b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelGeometry.cxx
index 98c60b6a3b14..872d047bd2c2 100644
--- a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelGeometry.cxx
+++ b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelGeometry.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
 */
 
 /********************************************************************
@@ -78,7 +78,7 @@ namespace LArG4 {
       // initialize the geometry.
       // Access source of detector parameters.
 
-      LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
+      const LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
 
       // number of straight sections (should be 14)
       m_Nbrt = (int) (parameters->GetValue("LArEMBnoOFAccZigs"));
@@ -330,7 +330,7 @@ namespace LArG4 {
       static bool FILL = true;
       if (FILL) {
 
-        LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
+        const LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
 
         // maximum eta barrel 1.475 (at r=1500.024)
         Eta_max = parameters->GetValue("LArEMBMaxEtaAcceptance");
diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerCalculator.cxx b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerCalculator.cxx
index 9370663a1c65..a1bc8a3f5829 100644
--- a/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerCalculator.cxx
+++ b/LArCalorimeter/LArG4/LArG4Barrel/src/LArBarrelPresamplerCalculator.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
 */
 
 // Prepared 05-Dec-2002 Bill Seligman
@@ -60,7 +60,7 @@ StatusCode LArBarrelPresamplerCalculator::initialize()
   // Initialize private members.
 
   // Access source of detector parameters.
-  LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
+  const LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
 
   // Initialize the geometry calculator
   ATH_CHECK(m_geometry.retrieve());
diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/LArStraightAbsorbers.cxx b/LArCalorimeter/LArG4/LArG4Barrel/src/LArStraightAbsorbers.cxx
index 841b607b2a29..946f19aec849 100644
--- a/LArCalorimeter/LArG4/LArG4Barrel/src/LArStraightAbsorbers.cxx
+++ b/LArCalorimeter/LArG4/LArG4Barrel/src/LArStraightAbsorbers.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 "LArStraightAbsorbers.h"
@@ -23,7 +23,7 @@ LArStraightAbsorbers*  LArStraightAbsorbers::GetInstance(const std::string& strD
 
 LArStraightAbsorbers::LArStraightAbsorbers(std::string strDetector)
 {
-  LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
+  const LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
   if (parameters->GetValue("LArEMBPhiAtCurvature",0)>0.)  m_parity=0;  // first wave goes up
   else                                                    m_parity=1;  // first wave goes down
 
diff --git a/LArCalorimeter/LArG4/LArG4Barrel/src/LArStraightElectrodes.cxx b/LArCalorimeter/LArG4/LArG4Barrel/src/LArStraightElectrodes.cxx
index 61bd7b055c2c..c1ae4d8d4393 100644
--- a/LArCalorimeter/LArG4/LArG4Barrel/src/LArStraightElectrodes.cxx
+++ b/LArCalorimeter/LArG4/LArG4Barrel/src/LArStraightElectrodes.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 "LArStraightElectrodes.h"
@@ -22,7 +22,7 @@ LArStraightElectrodes*  LArStraightElectrodes::GetInstance(const std::string& st
 
 LArStraightElectrodes::LArStraightElectrodes(std::string strDetector)
 {
-  LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
+  const LArVG4DetectorParameters* parameters = LArVG4DetectorParameters::GetInstance();
   if (parameters->GetValue("LArEMBPhiAtCurvature",0)>0.)  m_parity=0;  // first wave goes up
   else                                                    m_parity=1;  // first wave goes down
 
diff --git a/LArCalorimeter/LArG4/LArG4EC/src/CryostatCalibrationLArCalculator.h b/LArCalorimeter/LArG4/LArG4EC/src/CryostatCalibrationLArCalculator.h
index 43b5548d5d3c..5f3e15a195de 100644
--- a/LArCalorimeter/LArG4/LArG4EC/src/CryostatCalibrationLArCalculator.h
+++ b/LArCalorimeter/LArG4/LArG4EC/src/CryostatCalibrationLArCalculator.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
 */
 
 // LArG4::EndcapCryostat::CalibrationLArCalculator
@@ -69,7 +69,7 @@ namespace LArG4 {
       CaloG4::SimulationEnergies m_energyCalculator;
 
       // Access to parameters.
-      LArVG4DetectorParameters* m_parameters{nullptr};
+      const LArVG4DetectorParameters* m_parameters{nullptr};
 
       // For the default calculator (hopefully temporary).
       ServiceHandle<ILArCalibCalculatorSvc> m_defaultCalculator;
diff --git a/LArCalorimeter/LArG4/LArG4EC/src/EMECSupportCalibrationCalculator.cc b/LArCalorimeter/LArG4/LArG4EC/src/EMECSupportCalibrationCalculator.cc
index 2725ddf2302a..b35f400fb51d 100644
--- a/LArCalorimeter/LArG4/LArG4EC/src/EMECSupportCalibrationCalculator.cc
+++ b/LArCalorimeter/LArG4/LArG4EC/src/EMECSupportCalibrationCalculator.cc
@@ -54,7 +54,7 @@ namespace LArG4 {
       ~Parameters();
 
       // Access to parameters.
-      LArVG4DetectorParameters* m_parameters;
+      const LArVG4DetectorParameters* m_parameters;
 
       double m_zShift;                 // 40.0
       double m_zEMECRefPoint;          // 3689.5000
diff --git a/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/VDetectorParameters.h b/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/VDetectorParameters.h
index 09cf0299d7d9..92dc8af2ea17 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/VDetectorParameters.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/VDetectorParameters.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
 */
 
 // VDetectorParameters
@@ -53,7 +53,7 @@ namespace LArGeo {
 			    const int i1 = INT_MIN,
 			    const int i2 = INT_MIN,
 			    const int i3 = INT_MIN,
-			    const int i4 = INT_MIN ) = 0;
+			    const int i4 = INT_MIN ) const = 0;
 
   protected:
     VDetectorParameters() {};
diff --git a/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RAL.h b/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RAL.h
index 97dbc7e6a728..1e485722f577 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RAL.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RAL.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
 */
 
 // RAL.h
@@ -35,7 +35,7 @@ namespace LArGeo {
                             const int i1 = INT_MIN,
                             const int i2 = INT_MIN,
                             const int i3 = INT_MIN,
-                            const int i4 = INT_MIN );
+                            const int i4 = INT_MIN ) const override;
 
   private:
 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALEmb.h b/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALEmb.h
index efb8dab64d10..353726d8f0f9 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALEmb.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALEmb.h
@@ -29,7 +29,7 @@ namespace LArGeo {
                             const int i1 = INT_MIN,
                             const int i2 = INT_MIN,
                             const int i3 = INT_MIN,
-                            const int i4 = INT_MIN );
+                            const int i4 = INT_MIN ) const override;
 
   private:
 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALEmec.h b/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALEmec.h
index 06fad87f7fc6..a737954f7f1c 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALEmec.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALEmec.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
 */
 
 // RALEmec.h
@@ -29,7 +29,7 @@ namespace LArGeo {
                             const int i1 = INT_MIN,
                             const int i2 = INT_MIN,
                             const int i3 = INT_MIN,
-                            const int i4 = INT_MIN );
+                            const int i4 = INT_MIN ) const override;
 
   private:
 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALExperimentalHall.h b/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALExperimentalHall.h
index 2b30553ac36f..73244943121d 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALExperimentalHall.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALExperimentalHall.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
 */
 
 // RALExperimentalHall.h
@@ -29,7 +29,7 @@ namespace LArGeo {
                             const int i1 = INT_MIN,
                             const int i2 = INT_MIN,
                             const int i3 = INT_MIN,
-                            const int i4 = INT_MIN );
+                            const int i4 = INT_MIN ) const override;
 
   private:
 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALHec.h b/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALHec.h
index 1309202a40a8..ff4b2c9a4de2 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALHec.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoRAL/LArGeoRAL/RALHec.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
 */
 
 // RALHec.h
@@ -29,7 +29,7 @@ namespace LArGeo {
                             const int i1 = INT_MIN,
                             const int i2 = INT_MIN,
                             const int i3 = INT_MIN,
-                            const int i4 = INT_MIN );
+                            const int i4 = INT_MIN ) const override;
 
   private:
 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RAL.cxx b/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RAL.cxx
index 838112c7fc21..67b4301674be 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RAL.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RAL.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 "LArGeoRAL/RAL.h"
@@ -35,7 +35,7 @@ namespace LArGeo {
 			   const int a1,
 			   const int a2,
 			   const int a3,
-			   const int a4 ) 
+			   const int a4 ) const
   {
 
     // Call the appropriate GetValue() based on the contents of the
diff --git a/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALEmb.cxx b/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALEmb.cxx
index 1c7d4e812285..1faba64d9385 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALEmb.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALEmb.cxx
@@ -148,7 +148,7 @@ double LArGeo::RALEmb::GetValue(const std::string& a_name,
                                 const int /*a1*/,
                                 const int /*a2*/,
                                 const int /*a3*/,
-                                const int /*a4*/ ) 
+                                const int /*a4*/ ) const
 {
   
   std::ostringstream A0STR;
diff --git a/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALEmec.cxx b/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALEmec.cxx
index f4ef558cbf5f..688c25ae71dc 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALEmec.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALEmec.cxx
@@ -105,7 +105,7 @@ double LArGeo::RALEmec::GetValue(const std::string& a_name,
                                  const int a1,
                                  const int /*a2*/,
                                  const int /*a3*/,
-                                 const int /*a4*/ ) 
+                                 const int /*a4*/ ) const
 {
   
   std::ostringstream A0STR;
diff --git a/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALExperimentalHall.cxx b/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALExperimentalHall.cxx
index 22dee3412cac..c29d080e0f7e 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALExperimentalHall.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALExperimentalHall.cxx
@@ -86,7 +86,7 @@ double LArGeo::RALExperimentalHall::GetValue(const std::string& a_name,
                                              const int /*a1*/,
                                              const int /*a2*/,
                                              const int /*a3*/,
-                                             const int /*a4*/ ) 
+                                             const int /*a4*/ ) const
 {
   
   if ( a_name == "LArExpHallOutOfTimeCut"     ) return 2.5*CLHEP::ns;
diff --git a/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALHec.cxx b/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALHec.cxx
index 4cff7fded272..09ce10734a20 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALHec.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoRAL/src/RALHec.cxx
@@ -97,7 +97,7 @@ double LArGeo::RALHec::GetValue(const std::string& a_name,
                                 const int /*a1*/,
                                 const int /*a2*/,
                                 const int /*a3*/,
-                                const int /*a4*/ ) 
+                                const int /*a4*/ ) const
 {
   
   std::ostringstream A0STR;
-- 
GitLab


From ffeba38cae98d688f0c37457f08cd98f09cef8c6 Mon Sep 17 00:00:00 2001
From: Alison Elliot <alison.elliot@cern.ch>
Date: Fri, 17 Sep 2021 10:17:42 +0200
Subject: [PATCH 178/347] restoring gfex bitwise simulation in trigger tests
 since blocker FPE error is solved

---
 .../TriggerJobOpts/python/Lvl1SimulationConfig.py         | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py
index f76e5664d6f5..749107c862d7 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py
@@ -111,10 +111,10 @@ def Lvl1SimulationSequence( ConfigFlags ):
         l1CaloSimSeq.jFEXDriver.jSuperCellTowerMapperTool.SCell=SCellType
         l1CaloSimSeq.jFEXDriver.jFEXSysSimTool.SCell=SCellType
 
-        #l1CaloSimSeq += CfgMgr.LVL1__gFEXDriver('gFEXDriver',
-        #    SCell=SCellType )
-        #l1CaloSimSeq.gFEXDriver.gSuperCellTowerMapperTool.SCell=SCellType
-        #l1CaloSimSeq.gFEXDriver.gFEXSysSimTool.SCell=SCellType
+        l1CaloSimSeq += CfgMgr.LVL1__gFEXDriver('gFEXDriver',
+            SCell=SCellType )
+        l1CaloSimSeq.gFEXDriver.gSuperCellTowerMapperTool.SCell=SCellType
+        l1CaloSimSeq.gFEXDriver.gFEXSysSimTool.SCell=SCellType
 
     ##################################################
     # Muons
-- 
GitLab


From 6d41f649661498c5674c1fc53b64adf766904b8a Mon Sep 17 00:00:00 2001
From: Aleksandra Poreba <aleksandra.poreba@cern.ch>
Date: Fri, 17 Sep 2021 11:19:59 +0200
Subject: [PATCH 179/347] Retrieve database details during cost initialisation

---
 .../share/RunTrigCostAnalysis.py              | 48 +++++++++++--------
 1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py b/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py
index a378c686f250..d72669b366b2 100755
--- a/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py
+++ b/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py
@@ -67,7 +67,6 @@ def readMCpayload(args):
 
 # Read algorithm and class names from HLTJobOptions file
 def readHashes(joFileName="", smk=0, dbAlias=""):
-
   joData = {}
 
   try:
@@ -139,26 +138,6 @@ def hltConfigSvcCfg(flags, smk, dbAlias):
   else:
     log.debug("Reading HLTMenu from database {0} {1}".format(smk, dbAlias))
 
-    if not smk or not dbAlias:
-      # Try to read keys from COOL (for P1 data)
-      from TrigConfStorage.TriggerCoolUtil import TriggerCoolUtil
-      dbconn = TriggerCoolUtil.GetConnection("CONDBR2")
-      runNumber = GetFileMD(ConfigFlags.Input.Files)['runNumbers'][0]
-      configKeys = TriggerCoolUtil.getHLTConfigKeys(dbconn, [[runNumber, runNumber]])
-
-      if configKeys and runNumber in configKeys.keys():
-        if not smk:
-          smk = configKeys[runNumber]['SMK']
-
-        if not dbAlias:
-          # For example TRIGGERDBDEV1;22.0.20;Athena -> TRIGGERDBDEV1
-          dbAlias = configKeys[runNumber]['DB'].split(";")[0]
-
-      else:
-        log.error("Menu not found!")
-
-    log.debug("Config keys are SMK: {0} DB alias: {1}".format(smk, dbAlias))
-
     hltConfigSvc.InputType = "DB"
     hltConfigSvc.JsonFileName = ""
     hltConfigSvc.TriggerDB = dbAlias
@@ -169,6 +148,29 @@ def hltConfigSvcCfg(flags, smk, dbAlias):
   return acc
 
 
+def readConfigFromCool(smk, dbAlias):
+  # Try to read keys from COOL (for P1 data)
+  from TrigConfStorage.TriggerCoolUtil import TriggerCoolUtil
+  dbconn = TriggerCoolUtil.GetConnection("CONDBR2")
+  runNumber = GetFileMD(ConfigFlags.Input.Files)['runNumbers'][0]
+  configKeys = TriggerCoolUtil.getHLTConfigKeys(dbconn, [[runNumber, runNumber]])
+
+  if configKeys and runNumber in configKeys.keys():
+    if not smk:
+      smk = configKeys[runNumber]['SMK']
+
+    if not dbAlias:
+      # For example TRIGGERDBDEV1;22.0.20;Athena -> TRIGGERDBDEV1
+      dbAlias = configKeys[runNumber]['DB'].split(";")[0]
+
+    log.debug("Config keys are SMK: {0} DB alias: {1}".format(smk, dbAlias))
+
+  else:
+    log.error("Configuration keys not found!")
+
+  return (smk, dbAlias)
+
+
 # Get HLT Menu from json file or from DB
 def getHltMenu():
   # Try to find local menu file
@@ -236,6 +238,10 @@ if __name__=='__main__':
   histSvc.Output += ["COSTSTREAM DATAFILE='" + args.outputHist + "' OPT='RECREATE'"]
   cfg.addService(histSvc)
 
+  # Retrieve config from cool database
+  if not args.smk or not args.dbAlias:
+    (args.smk, args.dbAlias) = readConfigFromCool(args.smk, args.dbAlias)
+
   cfg.merge(hltConfigSvcCfg(ConfigFlags, args.smk, args.dbAlias))
   cfg.merge(trigCostAnalysisCfg(ConfigFlags, args, ConfigFlags.Input.isMC))
 
-- 
GitLab


From a837ab95bdeaa66c6383fa42c4bcadebaf70af0c Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 17 Sep 2021 16:01:21 +0200
Subject: [PATCH 180/347] One step of egamma reco

---
 .../python/EMBremCollectionBuilderConfig.py   | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilderConfig.py

diff --git a/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilderConfig.py b/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilderConfig.py
new file mode 100644
index 000000000000..47ed195389b1
--- /dev/null
+++ b/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilderConfig.py
@@ -0,0 +1,19 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+def EMBremCollectionBuilderCfg(flags, 
+                                name="EMBremCollectionBuilder", 
+                                **kwargs):
+    acc = ComponentAccumulator()
+    if "TrackParticleCreatorTool" not in kwargs:
+        from InDetConfig.TrackRecoConfig import TrackParticleCreatorToolCfg
+        kwargs["TrackParticleCreatorTool"] = acc.popToolsAndMerge(TrackParticleCreatorToolCfg(flags, "GSFBuildInDetParticleCreatorTool"))
+    # TBC
+    # if "TrackRefitTool" not in kwargs:
+    #     kwargs["TrackRefitTool"] = acc.popToolsAndMerge( )
+
+    alg = CompFactory.EMBremCollectionBuilder(name, **kwargs)
+    acc.addEventAlgo(alg)
+    return acc
\ No newline at end of file
-- 
GitLab


From 2e4a0c1fc31134b62a6dcbad13240c3da7ce5dc0 Mon Sep 17 00:00:00 2001
From: Ke Li <ke.li@cern.ch>
Date: Fri, 17 Sep 2021 17:11:23 +0200
Subject: [PATCH 181/347] update the RDO with new conditions tags

---
 .../InDetPhysValMonitoring/test/test_mu1GeV_reco.sh         | 6 +++---
 .../InDetPhysValMonitoring/test/test_mu20GeV_reco.sh        | 6 +++---
 .../InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh     | 6 +++---
 .../InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh     | 6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh
index e78212f8dc27..b547d02e5023 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh
@@ -1,8 +1,8 @@
 #!/bin/bash
 # art-description: art job for InDetPhysValMonitoring, Single muon 1GeV
 # art-type: grid
-# art-input: user.keli.mc16_13TeV.422032.ParticleGun_single_mu_Pt1.recon.RDO.e7967_e5984_s3126_r11774_tid20254908_00
-# art-input-nfiles: 10
+# art-input: user.goblirsc:mcforArt_2021-09-16_sglMu1_RDO
+# art-input-nfiles: 1
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
@@ -85,7 +85,7 @@ case $ArtProcess in
       InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
       InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
       InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-      InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+      InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
       rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
       rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
       rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh
index 377cb6271a1a..0ef48c0f9fee 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh
@@ -1,8 +1,8 @@
 #!/bin/bash
 # art-description: art job for InDetPhysValMonitoring, Single muon 20GeV
 # art-type: grid
-# art-input: user.keli.mc16_13TeV.422035.ParticleGun_single_mu_Pt20.recon.RDO.e7967_e5984_s3126_r11774_tid20255026_00
-# art-input-nfiles: 10
+# art-input: user.goblirsc:mcforArt_2021-09-16_sglMu20_RDO
+# art-input-nfiles: 1
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
@@ -85,7 +85,7 @@ case $ArtProcess in
       InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
       InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
       InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-      InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+      InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
       rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
       rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
       rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh
index b7e183e734eb..11463572f93c 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh
@@ -1,8 +1,8 @@
 #!/bin/bash
 # art-description: art job for InDetPhysValMonitoring, Single ele 10GeV
 # art-type: grid
-# art-input: user.keli:user.keli.mc16_13TeV.422047.ParticleGun_single_piplus_Pt1.recon.RDO.e7967_e5984_s3126_r11774_tid20255143_00
-# art-input-nfiles: 10
+# art-input: user.goblirsc:mcforArt_2021-09-16_sglpiplus1_RDO
+# art-input-nfiles: 1
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
@@ -85,7 +85,7 @@ case $ArtProcess in
       InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
       InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
       InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-      InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+      InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
       rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
       rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
       rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh
index 5e521d61c0da..4798affc52f2 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh
@@ -1,8 +1,8 @@
 #!/bin/bash
 # art-description: art job for InDetPhysValMonitoring, Single ele 10GeV
 # art-type: grid
-# art-input: user.keli:user.keli.mc16_13TeV.422048.ParticleGun_single_piplus_Pt5.recon.RDO.e7967_e5984_s3126_r11774_tid20255160_00
-# art-input-nfiles: 10
+# art-input: user.goblirsc:mcforArt_2021-09-16_sglpiplus5_RDO
+# art-input-nfiles: 1
 # art-cores: 4
 # art-memory: 4096
 # art-include: master/Athena
@@ -85,7 +85,7 @@ case $ArtProcess in
       InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
       InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
       InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-      InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+      InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
       rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
       rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
       rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
-- 
GitLab


From 3818739e1b3605db550fc0ab17bc709d2268e684 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Fri, 17 Sep 2021 19:05:15 +0200
Subject: [PATCH 182/347] 22.0-cppcheck-final-InnerDetector

---
 .../PixelGeoModel/src/PixelDetectorDC1DC2.h       |  4 ++--
 .../SCTExtension/src/SCTExtensionAlg.cxx          |  4 ++--
 .../src/InDetExtensionProcessor.cxx               |  4 ++--
 .../src/InDetAdaptiveMultiPriVxFinderTool.cxx     |  6 +++---
 .../src/InDetIterativePriVxFinderTool.cxx         |  5 +++--
 .../src/JetFitterTrackSelectorTool.cxx            |  2 +-
 .../InDetTestBLayer/src/InDetTestBLayerTool.cxx   | 15 +++++++--------
 .../src/TRT_SeededSpacePointFinder_ATL.cxx        |  2 +-
 .../src/TRT_TrackExtensionToolCosmics.cxx         |  2 +-
 .../src/TRTTrackHoleSearchTool.cxx                | 11 +++++------
 10 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h
index f1444fb42b0d..5956209050ab 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h
+++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/PixelDetectorDC1DC2.h
@@ -149,7 +149,7 @@ class GeoPixelDiskSupports : public GeoVPixelFactory {
  private:
   std::vector<double> m_rmin,m_rmax,m_halflength,m_zpos;
   std::vector<std::string> m_material;
-  int m_nframe;
+  int m_nframe{0};
 
 };
 
@@ -299,7 +299,7 @@ class GeoPixelServices : public GeoVPixelFactory {
   std::vector<double> m_rmin,m_rmax,m_halflength,m_zpos;
   std::vector<std::string> m_material;
   std::string m_zone;
-  int m_nframe;
+  int m_nframe{0};
 
 
 };
diff --git a/InnerDetector/InDetPerformance/SCTExtension/src/SCTExtensionAlg.cxx b/InnerDetector/InDetPerformance/SCTExtension/src/SCTExtensionAlg.cxx
index 7563b0f67e31..09f867200883 100644
--- a/InnerDetector/InDetPerformance/SCTExtension/src/SCTExtensionAlg.cxx
+++ b/InnerDetector/InDetPerformance/SCTExtension/src/SCTExtensionAlg.cxx
@@ -49,7 +49,7 @@ StatusCode SCTExtensionAlg::execute(const EventContext& ctx) const {
   int n_tracks=0;
   int n_tracklets=0;
 
-  for (mytracklet = tracklets->begin(); mytracklet != tracklets->end(); mytracklet++) // Loop over tracklets
+  for (mytracklet = tracklets->begin(); mytracklet != tracklets->end(); ++mytracklet) // Loop over tracklets
     { 
       n_tracklets++;
       int nSharedHits=0;
@@ -80,7 +80,7 @@ StatusCode SCTExtensionAlg::execute(const EventContext& ctx) const {
         } // End: tracklet_Measurements
   
       xAOD::TrackParticleContainer::const_iterator mytrack;
-      for (mytrack = trks->begin(); mytrack != trks->end(); mytrack++) // Loop over tracks for each tracklet
+      for (mytrack = trks->begin(); mytrack != trks->end(); ++mytrack) // Loop over tracks for each tracklet
         { 
           n_tracks++;
           const xAOD::TrackParticle* trackParticle = *mytrack;
diff --git a/InnerDetector/InDetRecAlgs/InDetExtensionProcessor/src/InDetExtensionProcessor.cxx b/InnerDetector/InDetRecAlgs/InDetExtensionProcessor/src/InDetExtensionProcessor.cxx
index cf1a643c2ec5..19348d6653e5 100644
--- a/InnerDetector/InDetRecAlgs/InDetExtensionProcessor/src/InDetExtensionProcessor.cxx
+++ b/InnerDetector/InDetRecAlgs/InDetExtensionProcessor/src/InDetExtensionProcessor.cxx
@@ -223,7 +223,7 @@ InDet::InDetExtensionProcessor::createExtendedTracks(const EventContext& ctx,
             // loop over extension RIO-on-tracks and add PRD it into vecPrdComb
             DataVector<const Trk::MeasurementBase>::const_iterator RIOit =
               pThisExtensionPair->first->measurementsOnTrack()->begin();
-            for (; RIOit != pThisExtensionPair->first->measurementsOnTrack()->end(); RIOit++) {
+            for (; RIOit != pThisExtensionPair->first->measurementsOnTrack()->end(); ++RIOit) {
               const Trk::RIO_OnTrack* rot = dynamic_cast <const Trk::RIO_OnTrack*> (*RIOit);
               if (!rot) ATH_MSG_ERROR("cast to ROT failed, should not happen here !");
               else vecPrdComb.push_back(rot->prepRawData());
@@ -290,7 +290,7 @@ InDet::InDetExtensionProcessor::createExtendedTracks(const EventContext& ctx,
             // extract RIO-on-tracks from extension
             DataVector<const Trk::MeasurementBase>::const_iterator RIOit =
               pThisExtensionPair->first->measurementsOnTrack()->begin();
-            for (; RIOit != pThisExtensionPair->first->measurementsOnTrack()->end(); RIOit++) {
+            for (; RIOit != pThisExtensionPair->first->measurementsOnTrack()->end(); ++RIOit) {
               rotSet.push_back(*RIOit);
             }
             // merge RIO-on-track lists
diff --git a/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetAdaptiveMultiPriVxFinderTool.cxx b/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetAdaptiveMultiPriVxFinderTool.cxx
index 0a709419daf1..66017d334f5f 100755
--- a/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetAdaptiveMultiPriVxFinderTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetAdaptiveMultiPriVxFinderTool.cxx
@@ -147,7 +147,7 @@ InDetAdaptiveMultiPriVxFinderTool::findVertex(
 
   bool selectionPassed;
   for (TrackDataVecIter itr = (*trackTES).begin(); itr != (*trackTES).end();
-       itr++) {
+       ++itr) {
     if (m_useBeamConstraint) {
       selectionPassed =
         static_cast<bool>(m_trkFilter->accept(**itr, &beamposition));
@@ -204,7 +204,7 @@ InDetAdaptiveMultiPriVxFinderTool::findVertex(
   bool selectionPassed;
   for (TrackParticleDataVecIter itr = (*trackParticles).begin();
        itr != (*trackParticles).end();
-       itr++) {
+       ++itr) {
     if (m_useBeamConstraint) {
       selectionPassed =
         static_cast<bool>(m_trkFilter->accept(**itr, &beamposition));
@@ -1012,7 +1012,7 @@ InDetAdaptiveMultiPriVxFinderTool::estimateSignalCompatibility(
 
     for (std::vector<Trk::VxTrackAtVertex*>::iterator i = begintracks;
          i != endtracks;
-         i++) {
+         ++i) {
 
       if (((*i)->vtxCompatibility() < m_finalCutMaxVertexChi2 &&
            m_useFastCompatibility) ||
diff --git a/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetIterativePriVxFinderTool.cxx b/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetIterativePriVxFinderTool.cxx
index d4a75ecfd4f8..69ab8b5b8fd4 100755
--- a/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetIterativePriVxFinderTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetPriVxFinderTool/src/InDetIterativePriVxFinderTool.cxx
@@ -168,7 +168,7 @@ InDetIterativePriVxFinderTool::findVertex(const EventContext& ctx,
 
   bool selectionPassed;
   for (TrackDataVecIter itr = (*trackTES).begin(); itr != (*trackTES).end();
-       itr++) {
+       ++itr) {
 
     if (m_useBeamConstraint && beamSpot != nullptr) {
       Trk::RecVertex beamPosition{ beamSpot->beamVtx() };
@@ -1032,7 +1032,8 @@ InDetIterativePriVxFinderTool::removeCompatibleTracks(
     const Trk::TrackParameters* myPerigee = (*perigeesToFitIter);
 
     if (myPerigee == nullptr) {
-      ATH_MSG_ERROR(" Cast to perigee gives 0 pointer ");
+      ATH_MSG_ERROR(" Cast to perigee gives null pointer ");
+      return;
     }
 
     double chi2 = compatibility(*myPerigee, *myxAODVertex);
diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx
index 182c1f0941b5..4dc7a0436ed4 100644
--- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx
@@ -59,7 +59,7 @@ using namespace InDet;
       std::vector<const xAOD::IParticle*>::const_iterator   trk_end = inputTracks.end();  
 
       int counter = 0;
-      for ( ; trk_iter != trk_end; trk_iter++ ) {
+      for ( ; trk_iter != trk_end; ++trk_iter ) {
 	// Convert xAOD::IParticle to xAOD::TrackParticle
 	const xAOD::TrackParticle * tmp = dynamic_cast< const xAOD::TrackParticle* > ( *trk_iter );
 	assert( tmp != nullptr ); // in principle should really check that inputTracks only contains TrackParticle objects
diff --git a/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx b/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx
index 0a09718bf02a..8cf7ec0b8889 100644
--- a/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx
@@ -16,6 +16,7 @@
 #include "TrkMeasurementBase/MeasurementBase.h"
 #include "TrkSurfaces/CylinderSurface.h"
 #include "TrkTrack/Track.h"
+#include <cmath>
 
 using Amg::Transform3D;
 // don't want to include TrackSummary in the header
@@ -438,8 +439,8 @@ InDet::InDetTestBLayerTool::getTrackStateOnPixelLayerInfo(
     float error_locx = -9999;
     float error_locy = -9999;
 
-    error_locx = sqrt((*trkParam->covariance())(Trk::locX, Trk::locX));
-    error_locy = sqrt((*trkParam->covariance())(Trk::locY, Trk::locY));
+    error_locx = std::sqrt((*trkParam->covariance())(Trk::locX, Trk::locX));
+    error_locy = std::sqrt((*trkParam->covariance())(Trk::locY, Trk::locY));
 
     blayerInfo.errLocalX(error_locx);
     blayerInfo.errLocalY(error_locy);
@@ -447,12 +448,10 @@ InDet::InDetTestBLayerTool::getTrackStateOnPixelLayerInfo(
     bool isgood =
       m_pixelCondSummaryTool->isGood(id, InDetConditions::PIXEL_MODULE);
 
-    double phitol = 2.5;
-    double etatol = 5.;
-    if (trkParam) {
-      phitol = 3. * sqrt((*trkParam->covariance())(Trk::locX, Trk::locX));
-      etatol = 3. * sqrt((*trkParam->covariance())(Trk::locY, Trk::locY));
-    }
+    //defaults would be phitol = 2.5, etatol = 5.
+    double phitol = 3. * std::sqrt((*trkParam->covariance())(Trk::locX, Trk::locX));
+    double etatol = 3. * std::sqrt((*trkParam->covariance())(Trk::locY, Trk::locY));
+    
 
     bool isIn = true;
     if (sielem) {
diff --git a/InnerDetector/InDetRecTools/TRT_SeededSpacePointFinderTool/src/TRT_SeededSpacePointFinder_ATL.cxx b/InnerDetector/InDetRecTools/TRT_SeededSpacePointFinderTool/src/TRT_SeededSpacePointFinder_ATL.cxx
index 6949fb9ba288..6de3eb38f7b9 100755
--- a/InnerDetector/InDetRecTools/TRT_SeededSpacePointFinderTool/src/TRT_SeededSpacePointFinder_ATL.cxx
+++ b/InnerDetector/InDetRecTools/TRT_SeededSpacePointFinderTool/src/TRT_SeededSpacePointFinder_ATL.cxx
@@ -808,7 +808,7 @@ InDet::TRT_SeededSpacePointFinder_ATL::production2Spb(const EventContext& ctx,
   zSP.reserve(spcount);
 
   // // // // // // <Fill m_prod_bypass and the local array // // // //
-  for (; r != re; r++) {
+  for (; r != re; ++r) {
 	  const Trk::SpacePoint *vrpi = (*r).first;
 
 	  geo_info.push_back((*r).second);
diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionToolCosmics.cxx b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionToolCosmics.cxx
index 40eb4282fbc3..b0f3d03bc194 100755
--- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionToolCosmics.cxx
+++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionToolCosmics.cxx
@@ -328,7 +328,7 @@ void InDet::TRT_TrackExtensionToolCosmics::analyze_tpars(const std::vector<const
 	  
 	  //take the closest one in case it satisfies some default cuts
 	  InDet::TRT_DriftCircleCollection::const_iterator driftCircleIterator = container->begin();
-	  for (; driftCircleIterator != container->end(); driftCircleIterator++) {
+	  for (; driftCircleIterator != container->end(); ++driftCircleIterator) {
 
 	    //get the associated surface of the driftcircle
 	    const Trk::Surface &dc_surface=(*driftCircleIterator)->detectorElement()->surface((*driftCircleIterator)->identify());
diff --git a/InnerDetector/InDetRecTools/TRT_TrackHoleSearch/src/TRTTrackHoleSearchTool.cxx b/InnerDetector/InDetRecTools/TRT_TrackHoleSearch/src/TRTTrackHoleSearchTool.cxx
index 08a99937ed67..36c178b904d6 100644
--- a/InnerDetector/InDetRecTools/TRT_TrackHoleSearch/src/TRTTrackHoleSearchTool.cxx
+++ b/InnerDetector/InDetRecTools/TRT_TrackHoleSearch/src/TRTTrackHoleSearchTool.cxx
@@ -17,8 +17,7 @@
 // athena
 #include "TrkTrack/Track.h"
 #include "TrkTrack/TrackStateOnSurface.h"
-//#include "TrkParameters/MeasuredTrackParameters.h"
-//#include "TrkParameters/Perigee.h"
+
 #include "TrkParameters/TrackParameters.h"
 #include "TrkSurfaces/CylinderSurface.h"
 #include "TrkSurfaces/Surface.h"
@@ -371,8 +370,8 @@ void TRTTrackHoleSearchTool::dump_bad_straw_log() const {
 	ATH_MSG_DEBUG( "TRTTrackHoleSearchTool::dump_bad_straw_log" );
 	std::ofstream out("TRT_ConditionsSummarySvc_bad_straws.log");
 	out << "# id  barrel_ec  phi_module  layer_or_wheel  straw_layer  straw" << std::endl;
-	for(std::vector<Identifier>::const_iterator it = m_TRT_ID->straw_layer_begin(); it != m_TRT_ID->straw_layer_end(); it++) {
-		for(int i=0; i<= m_TRT_ID->straw_max(*it); i++) {
+	for(std::vector<Identifier>::const_iterator it = m_TRT_ID->straw_layer_begin(); it != m_TRT_ID->straw_layer_end(); ++it) {
+		for(int i=0; i<= m_TRT_ID->straw_max(*it); ++i) {
 			Identifier id = m_TRT_ID->straw_id(*it, i);
 			if(!m_conditions_svc->isGood(id)) {
 				out << id.getString()
@@ -420,8 +419,8 @@ TRTTrackHoleSearchTool::find_last_hit_before_trt(const DataVector<const Trk::Tra
 	if(track_states.size() < 2 || track_state == track_states.begin()) {
 		return track_states.end();
 	}
-	track_state--; // step back and look for last measurement before the TRT hit
-	for(; track_state != track_states.begin(); track_state--) {
+	--track_state; // step back and look for last measurement before the TRT hit
+	for(; track_state != track_states.begin(); --track_state) {
 		if((*track_state)->type(Trk::TrackStateOnSurface::Measurement)) {
 			break;
 		}
-- 
GitLab


From 67d7c4d8c4689c965a95af76cf3ce13e87befbe7 Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 17 Sep 2021 19:07:10 +0200
Subject: [PATCH 183/347] Refactor of nav conversion for easier code analysis

---
 .../src/Run2ToRun3TrigNavConverter.cxx        | 623 +++++++++---------
 .../src/Run2ToRun3TrigNavConverter.h          |   6 +-
 2 files changed, 315 insertions(+), 314 deletions(-)

diff --git a/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx b/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx
index 75f1e62069a2..a786dc21771d 100644
--- a/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx
+++ b/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx
@@ -20,33 +20,28 @@
 #include <random>
 
 
-Run2ToRun3TrigNavConverter::Run2ToRun3TrigNavConverter(const std::string &name, ISvcLocator *pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator)
-{
-}
-
-Run2ToRun3TrigNavConverter::~Run2ToRun3TrigNavConverter()
-{
-}
+Run2ToRun3TrigNavConverter::Run2ToRun3TrigNavConverter(const std::string& name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator){}
 
-StatusCode Run2ToRun3TrigNavConverter::initialize()
-{
+Run2ToRun3TrigNavConverter::~Run2ToRun3TrigNavConverter(){}
 
+StatusCode Run2ToRun3TrigNavConverter::initialize() {
 
   ATH_CHECK(m_trigNavWriteKey.initialize());
   ATH_CHECK(m_configSvc.retrieve());
   ATH_CHECK(m_clidSvc.retrieve());
-  ATH_CHECK( m_tdt.empty() != m_trigNavKey.key().empty() ); //either of the two has to be enabled but not both
-  if ( !m_tdt.empty() ) {
+  ATH_CHECK(m_tdt.empty() != m_trigNavKey.key().empty()); //either of the two has to be enabled but not both
+  if (!m_tdt.empty()) {
     ATH_CHECK(m_tdt.retrieve());
-    ATH_MSG_INFO( "Will use Trigger Navigation from TrigDecisionTool");
-  } else { 
+    ATH_MSG_INFO("Will use Trigger Navigation from TrigDecisionTool");
+  }
+  else {
     ATH_CHECK(m_trigNavKey.initialize(SG::AllowEmpty));
-    ATH_MSG_INFO( "Will use Trigger Navigation decoded from TrigNavigation object");
+    ATH_MSG_INFO("Will use Trigger Navigation decoded from TrigNavigation object");
   }
   // retrievig CLID from names and storing to set
-  for (const auto &name : m_collectionsToSave)
+  for (const auto& name : m_collectionsToSave)
   {
-    CLID id{0};
+    CLID id{ 0 };
     ATH_CHECK(m_clidSvc->getIDOfTypeName(name, id));
     m_setCLID.insert(id);
   }
@@ -58,8 +53,6 @@ StatusCode Run2ToRun3TrigNavConverter::initialize()
   for (const auto& name : m_roisToSave) {
     m_setRoiName.push_back(name);
   }
-  
-
 
   ATH_CHECK(m_clidSvc->getIDOfTypeName("TrigRoiDescriptor", m_roIDescriptorCLID));
   ATH_CHECK(m_clidSvc->getIDOfTypeName("TrigRoiDescriptorCollection", m_roIDescriptorCollectionCLID));
@@ -75,114 +68,118 @@ StatusCode Run2ToRun3TrigNavConverter::initialize()
   return StatusCode::SUCCESS;
 }
 
-StatusCode Run2ToRun3TrigNavConverter::finalize()
-{
+StatusCode Run2ToRun3TrigNavConverter::finalize() {
   return StatusCode::SUCCESS;
 }
 
 
-StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) const
+StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) const
 {
-  const HLT::TrigNavStructure* navDecoderPtr = nullptr;
+  const HLT::TrigNavStructure* run2NavigationPtr = nullptr;
   HLT::StandaloneNavigation standaloneNav;
-  if (!m_trigNavKey.key().empty()) {    
+  if (!m_trigNavKey.key().empty()) {
     SG::ReadHandle navReadHandle(m_trigNavKey, context);
     ATH_CHECK(navReadHandle.isValid());
     standaloneNav.deserialize(navReadHandle->serialized());
-    navDecoderPtr = &standaloneNav;
-  } else {
-    navDecoderPtr = m_tdt->ExperimentalAndExpertMethods().getNavigation();
+    run2NavigationPtr = &standaloneNav;
   }
-  const HLT::TrigNavStructure& navDecoder = *navDecoderPtr;
+  else {
+    run2NavigationPtr = m_tdt->ExperimentalAndExpertMethods().getNavigation();
+  }
+  const HLT::TrigNavStructure& run2Navigation = *run2NavigationPtr;
 
 
   // string identifier for TE
   std::map< int, std::string > hash2string;
-  for (auto p : m_configSvc->chains()) { 
-    for (auto s_iter = p->signatures().begin(); s_iter != p->signatures().end(); ++s_iter) { 
-      for (auto te : (*s_iter)->outputTEs()) { 
-          int hash = TrigConf::HLTUtils::string2hash( te->name() );
-          hash2string[ hash ] = te->name();
+  for (auto p : m_configSvc->chains()) {
+    for (auto s_iter = p->signatures().begin(); s_iter != p->signatures().end(); ++s_iter) {
+      for (auto te : (*s_iter)->outputTEs()) {
+        int hash = TrigConf::HLTUtils::string2hash(te->name());
+        hash2string[hash] = te->name();
       }
     }
-  } 
+  }
 
   if (m_onlyFeaturePriting)
-    return printFeatures(navDecoder);
+    return printFeatures(run2Navigation);
 
   SG::WriteHandle<TrigCompositeUtils::DecisionContainer> outputNavigation = TrigCompositeUtils::createAndStore(m_trigNavWriteKey, context);
   auto decisionOutput = outputNavigation.ptr();
-  TrigCompositeUtils::Decision *passRawOutput = TrigCompositeUtils::newDecisionIn(decisionOutput, "HLTPassRaw");
+  TrigCompositeUtils::Decision* passRawOutput = TrigCompositeUtils::newDecisionIn(decisionOutput, "HLTPassRaw");
 
-  if (m_doPrint)
-  {
+  if (m_doPrint) {
     std::string dump;
-    navDecoder.printASCIIArt(dump);
+    run2Navigation.printASCIIArt(dump);
     ATH_MSG_INFO(dump);
   }
 
   // auxiliary random objects
+  /*
   std::random_device rd;
   std::mt19937_64 gen(rd());
   std::uniform_int_distribution<uint32_t> dis;
+  */
 
-  std::vector<HLT::TriggerElement *> tes;
-  TE_Decision_map mapTEtoDecision;                          // TE - Decision (xAOD::TrigComposite)
-  TE_Decision_map mapTEtoDecisionActive;                    // TE Active - Decision (xAOD::TrigComposite)
-  std::vector<TrigCompositeUtils::Decision *> decisionLast; // storing "last" decision in a chain
+  std::vector<HLT::TriggerElement*> tes;
+  TEDecisionMap mapTEtoHNodes;                          // TE - Decision (xAOD::TrigComposite)
+  TEDecisionMap mapTEtoIMNodes;                    // TE Active - Decision (xAOD::TrigComposite)
+  std::vector<TrigCompositeUtils::Decision*> decisionLast; // storing "last" decision in a chain
 
   DecisionObjMap decisionObj;
   DecisionObjStringMap decisionObjFeatureless;
   L1ObjMap l1Obj;
-  
+
   std::vector<HLT::TriggerElement::FeatureAccessHelper> featureRoI; // for keeping predecessing TE with RoI
 
   // @@@@@@@@@@@@@@@@@@@@@@@@@@ getDecisionObject @@@@@@@@@@@@@@@@@@@@@@@@@@
-  auto getDecisionObject = [&](const HLT::TriggerElement::FeatureAccessHelper &elemFE, size_t idx, TrigCompositeUtils::DecisionContainer *dOutput, size_t &kIn, HLT::TriggerElement* ptrTE = nullptr) {
-  // kIn: flag with the information about the decision objects (DO)
-  // 0: DO pair has been found and returned (no new pair created)
-  // 1: H node created for a feature unit from collection, IM retrieved (not created)
-  // 2: a new DO pair created (that is: H and IM node)
-    auto [sgKey, sgCLID, sgName] = getSgKey(navDecoder, elemFE);
-    auto it = decisionObj.find(sgKey + idx);
-    if (it != decisionObj.end())
-    {
-      kIn = 0;
-      return it->second;
-    }
+  auto getDecisionObject = [&](const HLT::TriggerElement::FeatureAccessHelper& elemFE,
+    size_t idx,
+    TrigCompositeUtils::DecisionContainer* dOutput,
+    size_t& kIn,
+    HLT::TriggerElement* ptrTE = nullptr) {
+      // kIn: flag with the information about the decision objects (DO)
+      // 0: DO pair has been found and returned (no new pair created)
+      // 1: H node created for a feature unit from collection, IM retrieved (not created)
+      // 2: a new DO pair created (that is: H and IM node)
+
+      auto [sgKey, sgCLID, sgName] = getSgKey(run2Navigation, elemFE);
+      auto it = decisionObj.find(sgKey + idx);
+      if (it != decisionObj.end()) {
+        kIn = 0;
+        ATH_MSG_DEBUG("Reusing = " << ptrTE << " IM " << it->second.second->index() << " H " << it->second.first->index());
+        return it->second;
+      }
 
-    kIn = 2;
-    if (idx == elemFE.getIndex().objectsBegin())
-    {
-      auto d2 = TrigCompositeUtils::newDecisionIn(dOutput); // IM
-      d2->setName(TrigCompositeUtils::inputMakerNodeName());
-      auto d1 = TrigCompositeUtils::newDecisionIn(dOutput); // H
-      d1->setName(TrigCompositeUtils::hypoAlgNodeName());
-      TrigCompositeUtils::linkToPrevious(d1, d2, context); // H low IM up
-      ATH_MSG_DEBUG("TE FE link creator H lower IM upper = " << ptrTE << " " << d1 << " " << d2);
-      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H creation] " << "(" << d1->index() << ")");
-      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[IM creation] " << "(" << d2->index() << ")");
-      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H -> IM seed link] " << "(" << d1->index() << " -> " << d2->index() << ")");
-      return std::make_pair(d1, d2);
-    }
+      kIn = 2;
+      if (idx == elemFE.getIndex().objectsBegin()) {
+        auto imNode = TrigCompositeUtils::newDecisionIn(dOutput); // IM
+        imNode->setName(TrigCompositeUtils::inputMakerNodeName());
+        auto hNode = TrigCompositeUtils::newDecisionIn(dOutput); // H
+        hNode->setName(TrigCompositeUtils::hypoAlgNodeName());
+        TrigCompositeUtils::linkToPrevious(hNode, imNode, context); // H low IM up
+        ATH_MSG_DEBUG("TE FE link creator H lower IM upper = " << ptrTE << " " << hNode << " " << imNode);
+        ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H creation] " << "(" << hNode->index() << ")");
+        ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[IM creation] " << "(" << imNode->index() << ")");
+        ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H -> IM seed link] " << "(" << hNode->index() << " -> " << imNode->index() << ")");
+        return std::make_pair(hNode, imNode);
+      }
 
-    kIn = 1;
-    auto d1 = TrigCompositeUtils::newDecisionIn(dOutput); // H
-    d1->setName(TrigCompositeUtils::hypoAlgNodeName());
-    auto d2 = (decisionObj.find(sgKey + elemFE.getIndex().objectsBegin())->second).second;
-    ATH_MSG_DEBUG("TE FE link creator H lower IM upper = " << ptrTE << " " << d1 << " " << d2);
-    TrigCompositeUtils::linkToPrevious(d1, d2, context); // H low IM up
-    ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H creation] " << "(" << d1->index() << ")");
-    ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H -> IM seed link] " << "(" << d1->index() << " -> " << d2->index() << ")");
-    return std::make_pair(d1, d2);
+      kIn = 1;
+      auto hNode = TrigCompositeUtils::newDecisionIn(dOutput); // H
+      hNode->setName(TrigCompositeUtils::hypoAlgNodeName());
+      auto imNode = (decisionObj.find(sgKey + elemFE.getIndex().objectsBegin())->second).second;
+      ATH_MSG_DEBUG("TE FE link creator H lower IM upper = " << ptrTE << " " << hNode << " " << imNode);
+      TrigCompositeUtils::linkToPrevious(hNode, imNode, context); // H low IM up
+      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H creation] " << "(" << hNode->index() << ")");
+      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H -> IM seed link] " << "(" << hNode->index() << " -> " << imNode->index() << ")");
+      return std::make_pair(hNode, imNode);
   };
 
   // @@@@@@@@@@@@@@@@@@@@@@@@@@ getL1Object @@@@@@@@@@@@@@@@@@@@@@@@@@
-  auto getL1Object = [&](const HLT::TriggerElement::FeatureAccessHelper &elemFE, size_t idx, TrigCompositeUtils::DecisionContainer *dOutput, size_t &kIn) {
-    auto [sgKey, sgCLID, sgName] = getSgKey(navDecoder, elemFE);
+  auto getL1Object = [&](const HLT::TriggerElement::FeatureAccessHelper& elemFE, size_t idx, TrigCompositeUtils::DecisionContainer* dOutput, size_t& kIn) {
+    auto [sgKey, sgCLID, sgName] = getSgKey(run2Navigation, elemFE);
     auto it = l1Obj.find(sgKey + idx);
-    if (it != l1Obj.end())
-    {
+    if (it != l1Obj.end()) {
       kIn = 0;
       return it->second;
     }
@@ -202,25 +199,25 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
       auto c = p;
       HLT::Identifier chainId = HLT::Identifier(chainName);
 
-        // @@@@@@@@@@@@@@@@@@@@@@@@@@ ordered_sorter @@@@@@@@@@@@@@@@@@@@@@@@@@
-        auto ordered_sorter = [&](const auto& left, const auto& right) {
-           return std::find(cbegin(m_setRoiName), cend(m_setRoiName), left) < std::find(cbegin(m_setRoiName), cend(m_setRoiName), right);
-        };
-        std::map<std::string, HLT::TriggerElement::FeatureAccessHelper, decltype(ordered_sorter)> mp(ordered_sorter);
-        // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+      // @@@@@@@@@@@@@@@@@@@@@@@@@@ ordered_sorter @@@@@@@@@@@@@@@@@@@@@@@@@@
+      auto ordered_sorter = [&](const auto& left, const auto& right) {
+        return std::find(cbegin(m_setRoiName), cend(m_setRoiName), left) < std::find(cbegin(m_setRoiName), cend(m_setRoiName), right);
+      };
+      std::map<std::string, HLT::TriggerElement::FeatureAccessHelper, decltype(ordered_sorter)> mp(ordered_sorter);
+      // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
       ATH_MSG_DEBUG(" CHAIN name " << chainName);
-      bool kTErejection { false };
+      bool kTErejection{ false };
       for (auto s_iter = c->signatures().begin(), first_s_iter = s_iter; s_iter != c->signatures().end(); ++s_iter)
       {
         if (kTErejection) break;
-        std::vector<TrigCompositeUtils::Decision *> tempDecisionVector;
+        std::vector<TrigCompositeUtils::Decision*> tempDecisionVector;
         for (auto te : (*s_iter)->outputTEs())
         {
           tes.clear();
-          navDecoder.getAllOfType(te->id(), tes, false);
-          ATH_MSG_DEBUG(" TE size " << tes.size());
-          if (tes.size()==0) {
+          run2Navigation.getAllOfType(te->id(), tes, false);
+          ATH_MSG_DEBUG(" TE size " << tes.size() << " name " << hash2string[te->id()]);
+          if (tes.size() == 0) {
             kTErejection = true;
             break;
           }
@@ -233,73 +230,72 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
 
             tempDecisionVector.clear();
 
-            auto vectorTEfeatures_ptr = getTEfeatures(teptr, navDecoder);
-            auto vectorTEROIfeatures_ptr = getTEROIfeatures( teptr, navDecoder );
+            auto vectorTEfeatures_ptr = getTEfeatures(teptr, run2Navigation);
+            auto vectorTEROIfeatures_ptr = getTEROIfeatures(teptr, run2Navigation);
             auto vectorTRACKfeatures_ptr = getTRACKfeatures(teptr);
 
             mp.clear();
 
             // @@@@@@@@@@@@@@@@@@@@@@@@@@ roiFinder @@@@@@@@@@@@@@@@@@@@@@@@@@
             std::function<void(HLT::TriggerElement*)> roiFinder = [&](HLT::TriggerElement* ptrTE) {
-                auto vecTEpred = navDecoder.getDirectPredecessors(ptrTE);
-                if (vecTEpred.empty()) {
-                  return nullptr;
-                } else {
+              auto vecTEpred = run2Navigation.getDirectPredecessors(ptrTE);
+              if (vecTEpred.empty()) {
+                return nullptr;
+              }
+              else {
+                for (auto pred : vecTEpred) { // vector predecessors TE
+                  auto vectorTEROIfeatures_ptr = getTEROIfeatures(pred, run2Navigation);
+                  if (vectorTEROIfeatures_ptr.empty() == false) {
+                    auto [sgKey, sgCLID, sgName] = getSgKey(run2Navigation, vectorTEROIfeatures_ptr.front());
+                    mp[sgName] = vectorTEROIfeatures_ptr.front();
+                  }
+                }
+                if (mp.empty()) {
                   for (auto pred : vecTEpred) { // vector predecessors TE
-                    auto vectorTEROIfeatures_ptr = getTEROIfeatures( pred, navDecoder );
-                    if (vectorTEROIfeatures_ptr.empty()==false) {
-                      auto [sgKey, sgCLID, sgName] = getSgKey(navDecoder,vectorTEROIfeatures_ptr.front());
-                      mp[sgName] = vectorTEROIfeatures_ptr.front();
-                    } 
-                  }        
-                  if (mp.empty()) {
-                    for (auto pred : vecTEpred) { // vector predecessors TE
-                      roiFinder(pred);
-                    }
+                    roiFinder(pred);
                   }
                 }
-                return nullptr; 
+              }
+              return nullptr;
             };
 
             // @@@@@@@@@@@@@@@@@@@@@@@@@@ featureFinder @@@@@@@@@@@@@@@@@@@@@@@@@@
-            std::function<uint32_t(HLT::TriggerElement*,uint32_t&)> featureFinder = [&](HLT::TriggerElement* ptrTE, uint32_t& deepLvl) {
-                auto vecTEpred = navDecoder.getDirectPredecessors(ptrTE);
-                if (vecTEpred.empty()==false)                     
-                {
-                  for (auto pred : vecTEpred) { // vector predecessors TE
-                    auto vectorTEfeatures_ptr = getTEfeatures( pred, navDecoder, false ); // any feature collection
-                    if (vectorTEfeatures_ptr.size()==1 && (vectorTEfeatures_ptr.front().getIndex().objectsBegin()==vectorTEfeatures_ptr.front().getIndex().objectsEnd())) {
+            std::function<uint32_t(HLT::TriggerElement*, uint32_t&)> featureFinder = [&](HLT::TriggerElement* ptrTE, uint32_t& deepLvl) {
+              auto vecTEpred = run2Navigation.getDirectPredecessors(ptrTE);
+              if (vecTEpred.empty() == false) {
+                for (auto pred : vecTEpred) { // vector predecessors TE
+                  auto vectorTEfeatures_ptr = getTEfeatures(pred, run2Navigation, false); // any feature collection
+                  if (vectorTEfeatures_ptr.size() == 1 && (vectorTEfeatures_ptr.front().getIndex().objectsBegin() == vectorTEfeatures_ptr.front().getIndex().objectsEnd())) {
                     //if (vectorTEfeatures_ptr.front().getIndex().objectsBegin()==vectorTEfeatures_ptr.front().getIndex().objectsEnd()) {
-                       break; // this is empty FE, treat it is as zero FE
-                    }
-                    if (vectorTEfeatures_ptr.empty()==false) 
-                    {
-                      auto featureBegin = 10000*vectorTEfeatures_ptr.front().getIndex().objectsBegin();
-                      auto [sgKey, sgCLID, sgName] = getSgKey(navDecoder,vectorTEfeatures_ptr.front());
-                      return sgKey+featureBegin+deepLvl; // first found 
-                    } 
+                    break; // this is empty FE, treat it is as zero FE
                   }
-                  // if no success after scan of TE predecessors we go one level up
-                  ++deepLvl;
-                  uint32_t keySearch { 0 };
-                  for (auto pred : vecTEpred) { 
-                    keySearch = featureFinder(pred,deepLvl); // recursive call
-                    if (keySearch != 0) return keySearch; // first found
+                  if (vectorTEfeatures_ptr.empty() == false) {                  
+                    auto featureBegin = 10000 * vectorTEfeatures_ptr.front().getIndex().objectsBegin();
+                    auto [sgKey, sgCLID, sgName] = getSgKey(run2Navigation, vectorTEfeatures_ptr.front());
+                    return sgKey + featureBegin + deepLvl; // first found 
                   }
                 }
-                return (uint32_t)0; // no TE predecessor, no FE at all or recursive search failed
+                // if no success after scan of TE predecessors we go one level up
+                ++deepLvl;
+                uint32_t keySearch{ 0 };
+                for (auto pred : vecTEpred) {
+                  keySearch = featureFinder(pred, deepLvl); // recursive call
+                  if (keySearch != 0) return keySearch; // first found
+                }
+              }
+              return (uint32_t)0; // no TE predecessor, no FE at all or recursive search failed
             };
 
             // @@@@@@@@@@@@@@@@@@@@@@@@@@ getTEObject @@@@@@@@@@@@@@@@@@@@@@@@@@
-            auto getTEObject = [&](HLT::TriggerElement* ptrTE, uint32_t& deepLevel, TrigCompositeUtils::DecisionContainer *dOutput) -> DecisionPair& {
-                // this is featureless case
-                std::string teName = hash2string[ ptrTE->getId() ];
-                if (teName != "") {
-                  auto it = decisionObjFeatureless.find(teName);
-                  if (it != decisionObjFeatureless.end()) return it->second;
-                }
+            auto getTEObject = [&](HLT::TriggerElement* ptrTE, uint32_t& deepLevel, TrigCompositeUtils::DecisionContainer* dOutput) -> DecisionPair& {
+              // this is featureless case
+              std::string teName = hash2string[ptrTE->getId()];
+              if (teName != "") {
+                auto it = decisionObjFeatureless.find(teName);
+                if (it != decisionObjFeatureless.end()) return it->second;
+              }
 
-                deepLevel = 0; // at this moment obsolte, but see below
+              deepLevel = 0; // at this moment obsolte, but see below
 /*
                 // THIS BLOCK is left intetionally here as an alternative approach.
 
@@ -313,60 +309,53 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
                   sgKeyProxy = 1000000 + dis(gen); // let us random it
                 }
 */
-                auto d2 = TrigCompositeUtils::newDecisionIn(dOutput); // IM
-                d2->setName(TrigCompositeUtils::inputMakerNodeName());
-                auto d1 = TrigCompositeUtils::newDecisionIn(dOutput); // H
-                d1->setName(TrigCompositeUtils::hypoAlgNodeName());
-                TrigCompositeUtils::linkToPrevious(d1, d2, context);
-                ATH_MSG_DEBUG("TE link creator H lower IM upper = " << ptrTE << " " << d1 << " " << d2);
-                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[H creation] " << "(" << d1->index() << ")");
-                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[IM creation] " << "(" << d2->index() << ")");
-                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[H -> IM seed link] " << "(" << d1->index() << " -> " << d2->index() << ")");
-                //return decisionObjFeatureless[sgKeyProxy] = std::make_pair(d1, d2); // intentionally left, see above
-                return decisionObjFeatureless[teName] = std::make_pair(d1, d2);
+              auto d2 = TrigCompositeUtils::newDecisionIn(dOutput); // IM
+              d2->setName(TrigCompositeUtils::inputMakerNodeName());
+              auto d1 = TrigCompositeUtils::newDecisionIn(dOutput); // H
+              d1->setName(TrigCompositeUtils::hypoAlgNodeName());
+              TrigCompositeUtils::linkToPrevious(d1, d2, context);
+              ATH_MSG_DEBUG("TE link creator H lower IM upper = " << ptrTE << " " << d1 << " " << d2);
+              ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[H creation] " << "(" << d1->index() << ")");
+              ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[IM creation] " << "(" << d2->index() << ")");
+              ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[H -> IM seed link] " << "(" << d1->index() << " -> " << d2->index() << ")");
+              //return decisionObjFeatureless[sgKeyProxy] = std::make_pair(d1, d2); // intentionally left, see above
+              return decisionObjFeatureless[teName] = std::make_pair(d1, d2);
             };
 
 
             if (vectorTEROIfeatures_ptr.empty()) {
               roiFinder(teptr);
-            } else {
-              auto [sgKey, sgCLID, sgName] = getSgKey(navDecoder,vectorTEROIfeatures_ptr.front());
+            }
+            else {
+              auto [sgKey, sgCLID, sgName] = getSgKey(run2Navigation, vectorTEROIfeatures_ptr.front());
               mp[sgName] = vectorTEROIfeatures_ptr.front();
             }
 
 
             // @@@@@@@@@@@@@@@@@@@@@@@@@@ vector TE - EMPTY @@@@@@@@@@@@@@@@@@@@@@@@@@
-            if ( vectorTEfeatures_ptr.empty() || 
-               ( /*vectorTEfeatures_ptr.size() == 1 && */ // alternative check
-                 (vectorTEfeatures_ptr[0].getIndex().objectsBegin() == vectorTEfeatures_ptr[0].getIndex().objectsEnd()) )
-               ) 
-            {
+            if (vectorTEfeatures_ptr.empty() || vectorTEfeatures_ptr[0].getIndex().objectsBegin() == vectorTEfeatures_ptr[0].getIndex().objectsEnd()) {
 
 
-              uint32_t dLevel { 1 };
-              auto [ decisionFeature, decisionPtr ] = getTEObject(teptr,dLevel,decisionOutput); // H IM
-              ATH_MSG_DEBUG("JUST AFTER " << "[TE] " << teptr <<  " [H] " << decisionFeature->index() << " [IM] " << decisionPtr->index() << " dLevel=" << dLevel);
-              auto decision = decisionPtr; // IM
+              uint32_t dLevel{ 1 };
+              auto [hNode, imNode] = getTEObject(teptr, dLevel, decisionOutput); // H IM
+              ATH_MSG_DEBUG("JUST AFTER " << "[TE] " << teptr << " [H] " << hNode->index() << " [IM] " << imNode->index() << " dLevel=" << dLevel);
+              auto decision = imNode; // IM
 
-              tempDecisionVector.push_back(decisionFeature);
+              tempDecisionVector.push_back(hNode);
 
               if (teptr->getActiveState()) {
-                TrigCompositeUtils::addDecisionID(chainId, decisionFeature); // H
-                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[H Index] (" << decisionFeature->index() << ") [Chain ID] " << chainId);
+                TrigCompositeUtils::addDecisionID(chainId, hNode); // H
+                ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[H Index] (" << hNode->index() << ") [Chain ID] " << chainId);
               }
               TrigCompositeUtils::addDecisionID(chainId, decision); // IM
               ATH_MSG_DEBUG("REGTEST " << "[TE featureless] " << "[IM Index] (" << decision->index() << ") [Chain ID] " << chainId);
-              
-              ElementLink<xAOD::TrigCompositeContainer> linkToSelf = TrigCompositeUtils::decisionToElementLink(decisionFeature, context);
-              decisionFeature->setObjectLink<xAOD::TrigCompositeContainer>(TrigCompositeUtils::featureString(), linkToSelf);
-              if ( std::find(begin(mapTEtoDecision[teptr]),end(mapTEtoDecision[teptr]),decisionFeature) == mapTEtoDecision[teptr].end() ) {
-                mapTEtoDecision[teptr].push_back(decisionFeature); // H
-              }
-              if ( std::find(begin(mapTEtoDecisionActive[teptr]),end(mapTEtoDecisionActive[teptr]),decision) == mapTEtoDecisionActive[teptr].end() ) {
-                mapTEtoDecisionActive[teptr].push_back(decision); // IM
-              }
 
-              TrigCompositeUtils::Decision *l1_decision{nullptr};
+              ElementLink<xAOD::TrigCompositeContainer> linkToSelf = TrigCompositeUtils::decisionToElementLink(hNode, context);
+              hNode->setObjectLink<xAOD::TrigCompositeContainer>(TrigCompositeUtils::featureString(), linkToSelf);
+              ATH_CHECK(insertDecisionToTEMap(hNode, teptr,  mapTEtoHNodes));
+              ATH_CHECK(insertDecisionToTEMap(imNode, teptr, mapTEtoIMNodes));
+
+              TrigCompositeUtils::Decision* l1_decision{ nullptr };
               if (s_iter == first_s_iter)
               {
                 l1_decision = TrigCompositeUtils::newDecisionIn(decisionOutput);
@@ -379,32 +368,32 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
 
 
               if (mp.empty() == false) {
-                ATH_CHECK(addTEROIfeatures(navDecoder, (mp.begin())->second, decision)); 
+                ATH_CHECK(addTEROIfeatures(run2Navigation, (mp.begin())->second, decision));
               }
 
-              for (const auto &rNodes : HLT::TrigNavStructure::getRoINodes(teptr))
+              for (const auto& rNodes : HLT::TrigNavStructure::getRoINodes(teptr))
               {
                 if (HLT::TrigNavStructure::isRoINode(rNodes))
                 {
-                  //////////////////auto vectorROIfeatures_ptr = getROIfeatures(rNodes, navDecoder);
-                  auto vectorROIfeatures_ptr = getTEROIfeatures(rNodes, navDecoder);
+                  //////////////////auto vectorROIfeatures_ptr = getROIfeatures(rNodes, run2Navigation);
+                  auto vectorROIfeatures_ptr = getTEROIfeatures(rNodes, run2Navigation);
                   for (auto featureRoI : vectorROIfeatures_ptr)
                   {
                     if (mp.empty()) {
-                      ATH_CHECK(addTEROIfeatures(navDecoder, featureRoI, decision)); // roi link to initialRoi
+                      ATH_CHECK(addTEROIfeatures(run2Navigation, featureRoI, decision)); // roi link to initialRoi
                     }
                   }
 
                   //### TRACKS ### check for track features and connect the same RoI
                   if (!vectorROIfeatures_ptr.empty())
-                    for (const auto &elemTRACK : vectorTRACKfeatures_ptr)
+                    for (const auto& elemTRACK : vectorTRACKfeatures_ptr)
                     {
-                      for (size_t i{elemTRACK.getIndex().objectsBegin()}; i < elemTRACK.getIndex().objectsEnd(); ++i)
+                      for (size_t i{ elemTRACK.getIndex().objectsBegin() }; i < elemTRACK.getIndex().objectsEnd(); ++i)
                       {
                         ElementLink<TrigRoiDescriptorCollection> ROIElementLink = decision->objectLink<TrigRoiDescriptorCollection>(TrigCompositeUtils::roiString());
                         if (ROIElementLink.isValid())
                         {
-                          ATH_CHECK(addTRACKfeatures(navDecoder, elemTRACK, decision, ROIElementLink));
+                          ATH_CHECK(addTRACKfeatures(run2Navigation, elemTRACK, decision, ROIElementLink));
                         }
                       }
                     }
@@ -413,100 +402,96 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
             }
 
 
-           // @@@@@@@@@@@@@@@@@@@@@@@@@@ vector TE - FULL @@@@@@@@@@@@@@@@@@@@@@@@@@
-            if ( vectorTEfeatures_ptr.empty()==false &&
-                 vectorTEfeatures_ptr[0].getIndex().objectsBegin() < vectorTEfeatures_ptr[0].getIndex().objectsEnd() )
+            // @@@@@@@@@@@@@@@@@@@@@@@@@@ vector TE - FULL @@@@@@@@@@@@@@@@@@@@@@@@@@
+            if (vectorTEfeatures_ptr.empty() == false &&
+              vectorTEfeatures_ptr[0].getIndex().objectsBegin() < vectorTEfeatures_ptr[0].getIndex().objectsEnd())
             {
 
-            for (const auto &elemFE : vectorTEfeatures_ptr)
-            {
-              TrigCompositeUtils::Decision *decision{nullptr};
-
-              for (size_t i{elemFE.getIndex().objectsBegin()}; i < elemFE.getIndex().objectsEnd(); ++i)
+              for (const auto& elemFE : vectorTEfeatures_ptr)
               {
-                size_t kInsert{0};
-                auto [decisionFeature, decisionPtr] = getDecisionObject(elemFE, i, decisionOutput, kInsert, teptr); // H IM
-                decision = decisionPtr; // IM
+                TrigCompositeUtils::Decision* decision{ nullptr };
 
-                if (mp.empty() == false) {
-                      ATH_CHECK(addTEROIfeatures(navDecoder, (mp.begin())->second, decision)); // updated roi on the way
-                }
+                for (size_t objectIndex{ elemFE.getIndex().objectsBegin() }; objectIndex < elemFE.getIndex().objectsEnd(); ++objectIndex)
+                {
+                  size_t kInsert{ 0 };
+                  auto [hNode, imNode] = getDecisionObject(elemFE, objectIndex, decisionOutput, kInsert, teptr); // H IM
+                  decision = imNode; // IM
+
+                  if (mp.empty() == false) {
+                    ATH_CHECK(addTEROIfeatures(run2Navigation, (mp.begin())->second, imNode)); // updated roi on the way
+                  }
 
 
-                if (teptr->getActiveState()) {
-                  TrigCompositeUtils::addDecisionID(chainId, decisionFeature); // H
-                  ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H Index] (" << decisionFeature->index() << ") [Chain ID] " << chainId);
-                }
-                TrigCompositeUtils::addDecisionID(chainId, decision); // IM
-                ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[IM Index] (" << decision->index() << ") [Chain ID] " << chainId);
+                  if (teptr->getActiveState()) {
+                    TrigCompositeUtils::addDecisionID(chainId, hNode); // H
+                    ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[H Index] (" << hNode->index() << ") [Chain ID] " << chainId);
+                  }
+                  TrigCompositeUtils::addDecisionID(chainId, imNode); // IM
+                  ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[IM Index] (" << imNode->index() << ") [Chain ID] " << chainId);
 
 
-                tempDecisionVector.push_back(decisionFeature);
+                  tempDecisionVector.push_back(hNode);
 
-                if (kInsert)
-                {
-                  auto mp = std::make_pair(decisionFeature, decision);
-                  ATH_CHECK(addTEfeatures(navDecoder, elemFE, mp, i, &decisionObj));
-                }
-                if ( std::find(begin(mapTEtoDecision[teptr]),end(mapTEtoDecision[teptr]),decisionFeature) == mapTEtoDecision[teptr].end() ) {
-                  mapTEtoDecision[teptr].push_back(decisionFeature); // H
-                }
-                if ( std::find(begin(mapTEtoDecisionActive[teptr]),end(mapTEtoDecisionActive[teptr]),decision) == mapTEtoDecisionActive[teptr].end() ) {
-                  mapTEtoDecisionActive[teptr].push_back(decision); // IM
+                  if (kInsert)
+                  {
+                    auto mp = std::make_pair(hNode, imNode);
+                    ATH_CHECK(addTEfeatures(run2Navigation, elemFE, mp, objectIndex, &decisionObj));
+                  }
+                  ATH_CHECK(insertDecisionToTEMap(hNode, teptr, mapTEtoHNodes));
+                  ATH_CHECK(insertDecisionToTEMap(imNode, teptr, mapTEtoIMNodes));
                 }
-              }
 
-              for (const auto &rNodes : HLT::TrigNavStructure::getRoINodes(teptr))
-              {
-                if (HLT::TrigNavStructure::isRoINode(rNodes))
+                for (const auto& rNodes : HLT::TrigNavStructure::getRoINodes(teptr))
                 {
-                  ///////////////auto vectorROIfeatures_ptr = getROIfeatures(rNodes,navDecoder);
-                  auto vectorROIfeatures_ptr = getTEROIfeatures(rNodes,navDecoder);
-                  for (auto featureRoI : vectorROIfeatures_ptr)
+                  if (HLT::TrigNavStructure::isRoINode(rNodes))
                   {
-                    if (s_iter == first_s_iter)
+                    ///////////////auto vectorROIfeatures_ptr = getROIfeatures(rNodes,run2Navigation);
+                    auto vectorROIfeatures_ptr = getTEROIfeatures(rNodes, run2Navigation);
+                    for (auto featureRoI : vectorROIfeatures_ptr)
                     {
-                      size_t kInsert{0};
-                      auto l1_decision = getL1Object(featureRoI, featureRoI.getIndex().objectsBegin(), decisionOutput, kInsert);
-                      TrigCompositeUtils::addDecisionID(chainId, l1_decision);
-                      if (kInsert)
+                      if (s_iter == first_s_iter)
                       {
-                        ATH_CHECK(addROIfeatures(navDecoder, featureRoI, l1_decision, -1, &l1Obj)); // test coding for initialRoi
-                      }
-                      // check for updated roi
-                      if (mp.empty()) {
-                        ATH_CHECK(addTEROIfeatures(navDecoder, featureRoI, decision)); // roi link to initialRoi
+                        size_t kInsert{ 0 };
+                        auto l1_decision = getL1Object(featureRoI, featureRoI.getIndex().objectsBegin(), decisionOutput, kInsert);
+                        TrigCompositeUtils::addDecisionID(chainId, l1_decision);
+                        if (kInsert)
+                        {
+                          ATH_CHECK(addROIfeatures(run2Navigation, featureRoI, l1_decision, -1, &l1Obj)); // test coding for initialRoi
+                        }
+                        // check for updated roi
+                        if (mp.empty()) {
+                          ATH_CHECK(addTEROIfeatures(run2Navigation, featureRoI, decision)); // roi link to initialRoi
+                        }
+                        TrigCompositeUtils::linkToPrevious(decision, l1_decision, context);
+                        ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[L1 creation] " << "(" << l1_decision->index() << ") [Chain ID] " << chainId);
+                        ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[IM -> L1 seed link] " << "(" << decision->index() << " -> " << l1_decision->index() << ")");
                       }
-                      TrigCompositeUtils::linkToPrevious(decision, l1_decision, context);
-                      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[L1 creation] " << "(" << l1_decision->index() << ") [Chain ID] " << chainId);
-                      ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[IM -> L1 seed link] " << "(" << decision->index() << " -> " << l1_decision->index() << ")");
-                    }
-                    else
-                    {
-                      // check for updated roi
-                      if (mp.empty()) {
-                        ATH_CHECK(addTEROIfeatures(navDecoder, featureRoI, decision)); // roi link to initialRoi
+                      else
+                      {
+                        // check for updated roi
+                        if (mp.empty()) {
+                          ATH_CHECK(addTEROIfeatures(run2Navigation, featureRoI, decision)); // roi link to initialRoi
+                        }
                       }
                     }
-                  }
-                  //### TRACKS ### check for track features and connect the same RoI
-                  if (!vectorROIfeatures_ptr.empty())
-                  for (const auto &elemTRACK : vectorTRACKfeatures_ptr)
-                  {
-                    for (size_t i{elemTRACK.getIndex().objectsBegin()}; i < elemTRACK.getIndex().objectsEnd(); ++i)
-                    {
-                        if (mp.empty()) {
+                    //### TRACKS ### check for track features and connect the same RoI
+                    if (!vectorROIfeatures_ptr.empty())
+                      for (const auto& elemTRACK : vectorTRACKfeatures_ptr)
+                      {
+                        for (size_t i{ elemTRACK.getIndex().objectsBegin() }; i < elemTRACK.getIndex().objectsEnd(); ++i)
+                        {
+                          if (mp.empty()) {
                             ElementLink<TrigRoiDescriptorCollection> ROIElementLink = decision->objectLink<TrigRoiDescriptorCollection>(TrigCompositeUtils::roiString());
                             if (ROIElementLink.isValid())
                             {
-                                ATH_CHECK(addTRACKfeatures(navDecoder, elemTRACK, decision, ROIElementLink));
+                              ATH_CHECK(addTRACKfeatures(run2Navigation, elemTRACK, decision, ROIElementLink));
                             }
+                          }
                         }
-                    }
+                      }
                   }
                 }
               }
-            }
             } // eof if - TE full
 
             decisionLast.insert(decisionLast.end(), tempDecisionVector.begin(), tempDecisionVector.end());
@@ -519,26 +504,26 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
 
       //for (const auto &last : decisionLast)
       //{
-        if (decisionLast.empty()==false) {
-          auto last = decisionLast.back();
-          auto sf_decision = TrigCompositeUtils::newDecisionIn(decisionOutput);
-          sf_decision->setName("SF");
-          TrigCompositeUtils::addDecisionID(chainId, sf_decision);
-          TrigCompositeUtils::linkToPrevious(sf_decision, last, context);
-          TrigCompositeUtils::linkToPrevious(passRawOutput, sf_decision, context);
-          ATH_MSG_DEBUG("REGTEST " << "[SF creation] " << "(" << sf_decision->index() << ") [Chain ID] " << chainId);
-          ATH_MSG_DEBUG("REGTEST " << "[SF -> H seed link] " << "(" << sf_decision->index() << " -> " << last->index() << ")");
-          ATH_MSG_DEBUG("REGTEST " << "[RAW -> SF seed link] " << "(" << passRawOutput->index() << " -> " << sf_decision->index() << ")");
-        }
+      if (decisionLast.empty() == false) {
+        auto last = decisionLast.back();
+        auto sf_decision = TrigCompositeUtils::newDecisionIn(decisionOutput);
+        sf_decision->setName("SF");
+        TrigCompositeUtils::addDecisionID(chainId, sf_decision);
+        TrigCompositeUtils::linkToPrevious(sf_decision, last, context);
+        TrigCompositeUtils::linkToPrevious(passRawOutput, sf_decision, context);
+        ATH_MSG_DEBUG("REGTEST " << "[SF creation] " << "(" << sf_decision->index() << ") [Chain ID] " << chainId);
+        ATH_MSG_DEBUG("REGTEST " << "[SF -> H seed link] " << "(" << sf_decision->index() << " -> " << last->index() << ")");
+        ATH_MSG_DEBUG("REGTEST " << "[RAW -> SF seed link] " << "(" << passRawOutput->index() << " -> " << sf_decision->index() << ")");
+      }
       //}
-      
+
       TrigCompositeUtils::decisionIDs(passRawOutput).push_back(chainId);
     }
   }
 
 
-  for (auto &[teptr, decisions] : mapTEtoDecisionActive) {
-    if (decisions.size()==1) {
+  for (auto& [teptr, decisions] : mapTEtoIMNodes) {
+    if (decisions.size() == 1) {
       ATH_MSG_DEBUG("TE IMs = " << teptr << " IM Index=" << decisions[0]->index() << " " << decisions);
     }
     else {
@@ -547,8 +532,8 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
     }
   }
 
-  for (auto &[teptr, decisions] : mapTEtoDecision) {
-    if (decisions.size()==1) {
+  for (auto& [teptr, decisions] : mapTEtoHNodes) {
+    if (decisions.size() == 1) {
       ATH_MSG_DEBUG("TE Hs = " << teptr << " H Index=" << decisions[0]->index() << " " << decisions);
     }
     else {
@@ -557,33 +542,36 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext &context) cons
     }
   }
 
-  for (auto &[teptr, decisions] : mapTEtoDecisionActive) {
-    for (auto prep_ptr : navDecoder.getDirectPredecessors(teptr)) {
+  for (auto& [teptr, decisions] : mapTEtoIMNodes) {
+    for (auto prep_ptr : run2Navigation.getDirectPredecessors(teptr)) {
       ATH_MSG_DEBUG("TE predTE (from IM) = " << teptr << " " << prep_ptr);
     }
   }
 
   std::set<std::string> regtestSorted;
-  for (auto &[teptr, decisions] : mapTEtoDecisionActive)
+  for (auto& [tePtr, imNodes] : mapTEtoIMNodes)
   { // loop over all IM nodes
 
-    for (auto prep_ptr : navDecoder.getDirectPredecessors(teptr))
+    for (auto predtePtr : run2Navigation.getDirectPredecessors(tePtr))
     {
-      if (teptr != prep_ptr)
-      if (mapTEtoDecision.find(prep_ptr) != mapTEtoDecision.end())
-      {
-        for (auto& d : decisions)
-        { // this is IM loop
-          ATH_MSG_DEBUG("TE predTE linking pre = " << teptr << " " << prep_ptr << " " << d);
-          for (auto& pd : mapTEtoDecision[prep_ptr])
-          { // this is H loop
-            TrigCompositeUtils::linkToPrevious(d, pd, context);
-            ATH_MSG_DEBUG("TE predTE linking IM lower H upper = " << teptr << " " << prep_ptr << " " << d << " " << pd);
-            regtestSorted.insert("REGTEST [IM -> H seed link] (" + std::to_string(d->index()) + " -> " + std::to_string(pd->index()) + ")");
+      if (tePtr != predtePtr)
+        if (mapTEtoHNodes.find(predtePtr) != mapTEtoHNodes.end())
+        {
+          for (auto& imNode : imNodes)
+          { // this is IM loop
+            ATH_MSG_DEBUG("TE corresponding to IM = "
+              << tePtr << " " << hash2string[tePtr->getId()]
+              << " seeded by TE " << predtePtr << " " << hash2string[predtePtr->getId()]
+              << " IM node " << imNode);
+            for (auto& hNode : mapTEtoHNodes[predtePtr])
+            { // this is H loop
+              TrigCompositeUtils::linkToPrevious(imNode, hNode, context);
+              ATH_MSG_DEBUG("TE predTE linking IM lower H upper = " << tePtr << " " << predtePtr << " " << imNode << " " << hNode);
+              regtestSorted.insert("REGTEST [IM -> H seed link] (" + std::to_string(imNode->index()) + " -> " + std::to_string(hNode->index()) + ")");
+            }
           }
         }
-      }
-    } // for (auto prep_ptr : navDecoder....
+    } // for (auto prep_ptr : run2Navigation....
   }
   for (const auto& p : regtestSorted) {
     ATH_MSG_DEBUG(p);
@@ -613,23 +601,23 @@ std::tuple<uint32_t, CLID, std::string> Run2ToRun3TrigNavConverter::getSgKey(con
   }
 
   const auto sgStringKey = HLTNavDetails::formatSGkey("HLT", type_name, hltLabel);
-  const bool isAvailable = evtStore()->contains( saveCLID,  sgStringKey);
-  ATH_MSG_DEBUG(" Objects presence " << helper << " " << sgStringKey <<  (isAvailable? " present" : " absent"));
-  if ( ! isAvailable ) {
+  const bool isAvailable = evtStore()->contains(saveCLID, sgStringKey);
+  ATH_MSG_DEBUG(" Objects presence " << helper << " " << sgStringKey << (isAvailable ? " present" : " absent"));
+  if (!isAvailable) {
     return { 0, 0, "" };
   }
 
   const auto sgIntKey = evtStore()->stringToKey(sgStringKey, saveCLID);
 
-  ATH_MSG_DEBUG(" getSgKey: sgKey, sgCLID, sgName " << sgIntKey << " " <<  saveCLID << " " << hltLabel);
+  ATH_MSG_DEBUG(" getSgKey: sgKey, sgCLID, sgName " << sgIntKey << " " << saveCLID << " " << hltLabel);
   return { sgIntKey, saveCLID, hltLabel }; // sgKey, sgCLID, sgName
 }
 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ addTEROIfeatures @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-StatusCode Run2ToRun3TrigNavConverter::addTEROIfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper &helper, TrigCompositeUtils::Decision *&decisionPtr) const
+StatusCode Run2ToRun3TrigNavConverter::addTEROIfeatures(const HLT::TrigNavStructure& navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper, TrigCompositeUtils::Decision*& decisionPtr) const
 {
   auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder, helper);
-  ATH_MSG_DEBUG("In addTEROIfeatures sgKey, sgCLID, sgName index-begin " << sgKey << " " <<  sgCLID << " " << sgName << " " << helper.getIndex().objectsBegin());
+  ATH_MSG_DEBUG("In addTEROIfeatures sgKey, sgCLID, sgName index-begin " << sgKey << " " << sgCLID << " " << sgName << " " << helper.getIndex().objectsBegin());
   if (sgKey != 0) {
     decisionPtr->typelessSetObjectLink(TrigCompositeUtils::roiString(), sgKey, sgCLID, helper.getIndex().objectsBegin());
   }
@@ -638,7 +626,7 @@ StatusCode Run2ToRun3TrigNavConverter::addTEROIfeatures(const HLT::TrigNavStruct
 }
 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ addROIfeatures @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-StatusCode Run2ToRun3TrigNavConverter::addROIfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper &helper, TrigCompositeUtils::Decision *&decisionPtr, int idx, L1ObjMap *om) const
+StatusCode Run2ToRun3TrigNavConverter::addROIfeatures(const HLT::TrigNavStructure& navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper, TrigCompositeUtils::Decision*& decisionPtr, int idx, L1ObjMap* om) const
 {
   auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder, helper);
 
@@ -662,21 +650,21 @@ StatusCode Run2ToRun3TrigNavConverter::addROIfeatures(const HLT::TrigNavStructur
 }
 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ addTRACKfeatures @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-StatusCode Run2ToRun3TrigNavConverter::addTRACKfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper &helper, TrigCompositeUtils::Decision *&decisionPtr, ElementLink<TrigRoiDescriptorCollection> &rLink) const
+StatusCode Run2ToRun3TrigNavConverter::addTRACKfeatures(const HLT::TrigNavStructure& navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper, TrigCompositeUtils::Decision*& decisionPtr, ElementLink<TrigRoiDescriptorCollection>& rLink) const
 {
   SG::AuxElement::Decorator<ElementLink<TrigRoiDescriptorCollection>> viewBookkeeper("viewIndex");
   auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder, helper);
   ATH_MSG_DEBUG("sgKey, sgCLID, sgName " << sgKey << " " << sgCLID << " " << sgName);
-  if (decisionPtr != nullptr && sgCLID==1287425431) // CLASS_DEF( xAOD::TrackParticleContainer, 1287425431, 1 )
+  if (decisionPtr != nullptr && sgCLID == 1287425431) // CLASS_DEF( xAOD::TrackParticleContainer, 1287425431, 1 )
   {
     decisionPtr->typelessSetObjectLink("TEMP_TRACKS", sgKey, sgCLID, helper.getIndex().objectsBegin(), helper.getIndex().objectsEnd());
     ElementLinkVector<xAOD::TrackParticleContainer> tracks = decisionPtr->objectCollectionLinks<xAOD::TrackParticleContainer>("TEMP_TRACKS");
     decisionPtr->removeObjectCollectionLinks("TEMP_TRACKS");
-    for (const ElementLink<xAOD::TrackParticleContainer> &track : tracks)
+    for (const ElementLink<xAOD::TrackParticleContainer>& track : tracks)
     {
       if (track.isValid())
       {
-        const xAOD::TrackParticle *t = *track;
+        const xAOD::TrackParticle* t = *track;
         viewBookkeeper(*t) = rLink;
       }
     }
@@ -685,7 +673,7 @@ StatusCode Run2ToRun3TrigNavConverter::addTRACKfeatures(const HLT::TrigNavStruct
 }
 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ addTEfeatures @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-StatusCode Run2ToRun3TrigNavConverter::addTEfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper &helper, std::pair<TrigCompositeUtils::Decision *, TrigCompositeUtils::Decision *> &decisionPtr, int idx, DecisionObjMap *om) const
+StatusCode Run2ToRun3TrigNavConverter::addTEfeatures(const HLT::TrigNavStructure& navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper, std::pair<TrigCompositeUtils::Decision*, TrigCompositeUtils::Decision*>& decisionPtr, int idx, DecisionObjMap* om) const
 {
   auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder, helper);
 
@@ -707,7 +695,7 @@ StatusCode Run2ToRun3TrigNavConverter::addTEfeatures(const HLT::TrigNavStructure
 }
 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ getTEfeatures @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavConverter::getTEfeatures(const HLT::TriggerElement *te_ptr, const HLT::TrigNavStructure &navigationDecoder, bool filterOnCLID) const
+const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavConverter::getTEfeatures(const HLT::TriggerElement* te_ptr, const HLT::TrigNavStructure& navigationDecoder, bool filterOnCLID) const
 {
   std::vector<HLT::TriggerElement::FeatureAccessHelper> ptrFAHelper;
   for (HLT::TriggerElement::FeatureAccessHelper helper : te_ptr->getFeatureAccessHelpers())
@@ -723,11 +711,11 @@ const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavCon
 }
 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ getTEROIfeatures @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavConverter::getTEROIfeatures(const HLT::TriggerElement *te_ptr, const HLT::TrigNavStructure &navigationDecoder) const
+const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavConverter::getTEROIfeatures(const HLT::TriggerElement* te_ptr, const HLT::TrigNavStructure& navigationDecoder) const
 {
   // @@@@@@@@@@@@@@@@@@@@@@@@@@ ordered_sorter @@@@@@@@@@@@@@@@@@@@@@@@@@
   auto ordered_sorter = [&](const auto& left, const auto& right) -> bool {
-      return std::find(cbegin(m_setRoiName), cend(m_setRoiName), left) < std::find(cbegin(m_setRoiName), cend(m_setRoiName), right);
+    return std::find(cbegin(m_setRoiName), cend(m_setRoiName), left) < std::find(cbegin(m_setRoiName), cend(m_setRoiName), right);
   };
 
   std::map<std::string, HLT::TriggerElement::FeatureAccessHelper, decltype(ordered_sorter)> mp(ordered_sorter);
@@ -735,30 +723,30 @@ const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavCon
 
   for (HLT::TriggerElement::FeatureAccessHelper helper : te_ptr->getFeatureAccessHelpers())
   {
-    auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder,helper);
+    auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder, helper);
     ATH_MSG_DEBUG(" getTEROIfeatures name " << sgName);
-       if (std::find(m_setRoiName.begin(), m_setRoiName.end(), sgName) == m_setRoiName.end()) {
-       // do not filter continue;
-       continue;
-       }
-       ATH_MSG_DEBUG(" getTEROIfeatures name accepted " << sgName);
-      mp[sgName] = helper;
+    if (std::find(m_setRoiName.begin(), m_setRoiName.end(), sgName) == m_setRoiName.end()) {
+      // do not filter continue;
+      continue;
+    }
+    ATH_MSG_DEBUG(" getTEROIfeatures name accepted " << sgName);
+    mp[sgName] = helper;
   }
 
   for (const auto& p : mp) {
-    auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder,p.second);
+    auto [sgKey, sgCLID, sgName] = getSgKey(navigationDecoder, p.second);
     ATH_MSG_DEBUG("CHECK getTEROIfeatures name accepted " << sgName);
   }
 
   std::vector<HLT::TriggerElement::FeatureAccessHelper> ptrFAHelper;
-  std::transform(cbegin(mp),cend(mp),back_inserter(ptrFAHelper),
-  [](const std::map<std::string, HLT::TriggerElement::FeatureAccessHelper>::value_type& p ){return p.second;});
+  std::transform(cbegin(mp), cend(mp), back_inserter(ptrFAHelper),
+    [](const std::map<std::string, HLT::TriggerElement::FeatureAccessHelper>::value_type& p) {return p.second;});
 
   return ptrFAHelper;
 }
 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ getTRACKfeatures @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavConverter::getTRACKfeatures(const HLT::TriggerElement *te_ptr) const
+const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavConverter::getTRACKfeatures(const HLT::TriggerElement* te_ptr) const
 {
   std::vector<HLT::TriggerElement::FeatureAccessHelper> ptrFAHelper;
   for (HLT::TriggerElement::FeatureAccessHelper helper : te_ptr->getFeatureAccessHelpers())
@@ -772,7 +760,7 @@ const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavCon
 }
 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ getROIfeatures @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavConverter::getROIfeatures(const HLT::TriggerElement *te_ptr, const HLT::TrigNavStructure &navigationDecoder) const
+const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavConverter::getROIfeatures(const HLT::TriggerElement* te_ptr, const HLT::TrigNavStructure& navigationDecoder) const
 {
 
   std::vector<HLT::TriggerElement::FeatureAccessHelper> ptrFAHelper;
@@ -791,7 +779,7 @@ const std::vector<HLT::TriggerElement::FeatureAccessHelper> Run2ToRun3TrigNavCon
 }
 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ printFeatures @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-StatusCode Run2ToRun3TrigNavConverter::printFeatures(const HLT::TrigNavStructure &nav) const
+StatusCode Run2ToRun3TrigNavConverter::printFeatures(const HLT::TrigNavStructure& nav) const
 {
   std::set<std::string> totset;
 
@@ -802,7 +790,7 @@ StatusCode Run2ToRun3TrigNavConverter::printFeatures(const HLT::TrigNavStructure
     {
       for (auto configTE : signature->outputTEs())
       {
-        std::vector<HLT::TriggerElement *> tes;
+        std::vector<HLT::TriggerElement*> tes;
         nav.getAllOfType(configTE->id(), tes, false);
         for (auto te : tes)
         {
@@ -828,3 +816,12 @@ StatusCode Run2ToRun3TrigNavConverter::printFeatures(const HLT::TrigNavStructure
 
   return StatusCode::SUCCESS;
 }
+
+
+StatusCode  Run2ToRun3TrigNavConverter::insertDecisionToTEMap( TrigCompositeUtils::Decision* d, const HLT::TriggerElement* te, TEDecisionMap& mapToFill) const { 
+  auto& entryToFill = mapToFill[te];
+  auto iter = std::find(entryToFill.begin(), entryToFill.end(), d);
+  if (iter == entryToFill.end() )
+    entryToFill.push_back(d);
+  return StatusCode::SUCCESS;
+}
diff --git a/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.h b/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.h
index cf40997e583e..0992eda6d664 100644
--- a/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.h
+++ b/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.h
@@ -68,6 +68,9 @@ private:
     using FElessObjMap = std::map<TrigCompositeUtils::Decision*,std::pair<TrigCompositeUtils::Decision*,const HLT::TriggerElement*>>; // decisionFeature-H no FE ->, decision,TEptr
     using L1ObjMap = std::map<uint32_t,TrigCompositeUtils::Decision*>; // L1decision
     using TEMap = std::map<const HLT::TriggerElement*, bool>; // map of TEs (true FE, false FE-less)
+    using TEDecisionMap = std::map<const HLT::TriggerElement*, std::vector<TrigCompositeUtils::Decision*>>;
+
+
 
     std::tuple<uint32_t,CLID,std::string> getSgKey(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper) const;
     StatusCode addTEfeatures(const HLT::TrigNavStructure &navigationDecoder, const HLT::TriggerElement::FeatureAccessHelper& helper, DecisionPair&  decisionPtr, int idx, DecisionObjMap* om) const;
@@ -79,6 +82,8 @@ private:
     const std::vector<HLT::TriggerElement::FeatureAccessHelper> getROIfeatures(const HLT::TriggerElement *te_ptr, const HLT::TrigNavStructure &navigationDecoder) const;
     const std::vector<HLT::TriggerElement::FeatureAccessHelper> getTRACKfeatures(const HLT::TriggerElement *te_ptr) const;
 
+    StatusCode insertDecisionToTEMap( TrigCompositeUtils::Decision* d, const HLT::TriggerElement* te, TEDecisionMap& mapToFill) const;
+
 
     CLID m_roIDescriptorCLID { 0 };
     CLID m_roIDescriptorCollectionCLID { 0 };
@@ -92,7 +97,6 @@ private:
     CLID m_TauTrackContainerCLID { 0 };
 
 
-    using TE_Decision_map = std::map<HLT::TriggerElement*, std::vector<TrigCompositeUtils::Decision*>>;
     StatusCode printFeatures(const HLT::TrigNavStructure& ) const;
 };
 
-- 
GitLab


From 3222bc0f865e51416900f94c872b1b4737fedacf Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Fri, 17 Sep 2021 19:23:34 +0200
Subject: [PATCH 184/347] AGDDKernel+AGDDModel+AGDDControl+MuonAGDDBase: Remove
 AGDDBuilder singleton.

---
 .../AGDDControl/AGDD2GeoModelBuilder.h        |  52 ++++----
 .../AGDDControl/src/AGDD2GeoModelBuilder.cxx  | 122 +++++++++---------
 .../AGDD/AGDDKernel/AGDDKernel/AGDDBuilder.h  |  50 ++++---
 .../AGDD/AGDDKernel/AGDDKernel/AGDDVolume.h   |  27 ++--
 .../AGDD/AGDDKernel/src/AGDDBuilder.cxx       |   3 +-
 .../AGDD/AGDDKernel/src/AGDDVolume.cxx        |   4 +-
 .../AGDD/AGDDModel/AGDDModel/AGDDBolt.h       |  34 ++---
 .../AGDD/AGDDModel/AGDDModel/AGDDBox.h        |  26 ++--
 .../AGDDModel/AGDDModel/AGDDComposition.h     |   4 +-
 .../AGDD/AGDDModel/AGDDModel/AGDDCons.h       |   6 +-
 .../AGDD/AGDDModel/AGDDModel/AGDDElcyl.h      |  28 ++--
 .../AGDD/AGDDModel/AGDDModel/AGDDGvxy.h       |  14 +-
 .../AGDD/AGDDModel/AGDDModel/AGDDIbeam.h      |  40 +++---
 .../AGDDModel/AGDDModel/AGDDIntersection.h    |   8 +-
 .../AGDD/AGDDModel/AGDDModel/AGDDPcon.h       |  38 +++---
 .../AGDD/AGDDModel/AGDDModel/AGDDPgon.h       |  42 +++---
 .../AGDD/AGDDModel/AGDDModel/AGDDSnake.h      |  14 +-
 .../AGDDModel/AGDDModel/AGDDSubtraction.h     |   8 +-
 .../AGDD/AGDDModel/AGDDModel/AGDDTrd.h        |  40 +++---
 .../AGDD/AGDDModel/AGDDModel/AGDDTubs.h       |  38 +++---
 .../AGDD/AGDDModel/AGDDModel/AGDDUbeam.h      |  40 +++---
 .../AGDD/AGDDModel/AGDDModel/AGDDUnion.h      |   8 +-
 .../AGDD/AGDDModel/src/AGDDBolt.cxx           |  17 +--
 .../AGDD/AGDDModel/src/AGDDBox.cxx            |  17 +--
 .../AGDD/AGDDModel/src/AGDDComposition.cxx    |   8 +-
 .../AGDD/AGDDModel/src/AGDDCons.cxx           |  18 +--
 .../AGDD/AGDDModel/src/AGDDElcyl.cxx          |  17 +--
 .../AGDD/AGDDModel/src/AGDDGvxy.cxx           |  17 +--
 .../AGDD/AGDDModel/src/AGDDIBeam.cxx          |  17 +--
 .../AGDD/AGDDModel/src/AGDDIntersection.cxx   |  17 +--
 .../AGDD/AGDDModel/src/AGDDPcon.cxx           |  17 +--
 .../AGDD/AGDDModel/src/AGDDPgon.cxx           |  17 +--
 .../AGDD/AGDDModel/src/AGDDSnake.cxx          |  17 +--
 .../AGDD/AGDDModel/src/AGDDSubtraction.cxx    |  17 +--
 .../AGDD/AGDDModel/src/AGDDTrd.cxx            |  17 +--
 .../AGDD/AGDDModel/src/AGDDTubs.cxx           |  17 +--
 .../AGDD/AGDDModel/src/AGDDUBeam.cxx          |  17 +--
 .../AGDD/AGDDModel/src/AGDDUnion.cxx          |  17 +--
 .../MuonAGDDBase/MuonAGDDBase/AGDDMMSpacer.h  |  18 +--
 .../MuonAGDDBase/AGDDMicromegas.h             |   8 +-
 .../MuonAGDDBase/AGDDMuonStation.h            |  20 +--
 .../MuonAGDDBase/MuonAGDDBase/AGDDsTGC.h      |   8 +-
 .../MuonAGDDBase/src/AGDDMMSpacer.cxx         |   8 +-
 .../MuonAGDDBase/src/AGDDMicromegas.cxx       |  10 +-
 .../MuonAGDDBase/src/AGDDMuonStation.cxx      |  10 +-
 .../MuonAGDDBase/src/AGDDsTGC.cxx             |  10 +-
 46 files changed, 460 insertions(+), 542 deletions(-)

diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDD2GeoModelBuilder.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDD2GeoModelBuilder.h
index d3d25f8c42cd..1674ee1f129e 100644
--- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDD2GeoModelBuilder.h
+++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDD2GeoModelBuilder.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 AGDD2GeoModelBuilder_H
@@ -37,39 +37,39 @@ public:
 	AGDD2GeoModelBuilder();
 	~AGDD2GeoModelBuilder()=default;
 	// elements & materials 
-	GeoElement* CreateElement(const std::string&);
-	const GeoMaterial* CreateMaterial(const std::string&);
-	void CreateElements();
-	void CreateMaterial();
+	GeoElement* CreateElement(const std::string&) const;
+	const GeoMaterial* CreateMaterial(const std::string&) const;
+	void CreateElements() const override;
+	void CreateMaterial() const override;
 		
-	void CreateBox(AGDDBox*);
-	void CreateTrd(AGDDTrd*);
-	void CreateTubs(AGDDTubs*);
-	void CreateElcyl(AGDDElcyl*);
-	void CreateCons(AGDDCons*);
-	void CreatePcon(AGDDPcon*);
-	void CreatePgon(AGDDPgon*);
-	void CreateGvxy(AGDDGvxy*);
-	void CreateSnake(AGDDSnake*);
-	void CreateUnion(AGDDUnion*);
-	void CreateIntersection(AGDDIntersection*);
-	void CreateSubtraction(AGDDSubtraction*);
+	void CreateBox(AGDDBox*) const override;
+	void CreateTrd(AGDDTrd*) const override;
+	void CreateTubs(AGDDTubs*) const override;
+	void CreateElcyl(AGDDElcyl*) const override;
+	void CreateCons(AGDDCons*) const override;
+	void CreatePcon(AGDDPcon*) const override;
+	void CreatePgon(AGDDPgon*) const override;
+	void CreateGvxy(AGDDGvxy*) const override;
+	void CreateSnake(AGDDSnake*) const override;
+	void CreateUnion(AGDDUnion*) const override;
+	void CreateIntersection(AGDDIntersection*) const override;
+	void CreateSubtraction(AGDDSubtraction*) const override;
 	
-	void CreateBolt(AGDDBolt*);
-	void CreateIbeam(AGDDIbeam*);
-	void CreateUbeam(AGDDUbeam*);
+	void CreateBolt(AGDDBolt*) const override;
+	void CreateIbeam(AGDDIbeam*) const override;
+	void CreateUbeam(AGDDUbeam*) const override;
 	
-	void CreateVolume(AGDDVolume*);
-	void CreateComposition(AGDDComposition*);
+	void CreateVolume(AGDDVolume*) const override;
+	void CreateComposition(AGDDComposition*) const override;
 
 	void SetMotherVolume(GeoPhysVol *v) {m_mother=v;}
-	void BuildAllVolumes();
-	void BuildFromSection(std::string);
-	void BuildFromVolume(std::string);
+	void BuildAllVolumes() const;
+	void BuildFromSection(const std::string&) const override;
+	void BuildFromVolume(const std::string&) const override;
 
 private:
 	GeoPhysVol *m_mother;
-	const GeoMaterial* GetMMMaterial(const std::string&);
+	const GeoMaterial* GetMMMaterial(const std::string&) const;
 
     /** phi method (cf. EventPrimitives/AmgMatrixBasePlugin.h) */
     inline double phi(const GeoTrf::Vector3D &vec) const {
diff --git a/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx b/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx
index e5b6a83a1ae7..767b990372a5 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/AGDD2GeoModelBuilder.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 "AGDDControl/AGDD2GeoModelBuilder.h"
@@ -69,7 +69,7 @@ AGDD2GeoModelBuilder::AGDD2GeoModelBuilder() :
   m_mother(nullptr) {
 }
 
-GeoElement* AGDD2GeoModelBuilder::CreateElement(const std::string& name)
+GeoElement* AGDD2GeoModelBuilder::CreateElement(const std::string& name) const
 {
 	AGDDMaterialStore *ms=AGDDMaterialStore::GetMaterialStore();
 	AGDDElement *el=ms->GetElement(name);
@@ -88,7 +88,7 @@ GeoElement* AGDD2GeoModelBuilder::CreateElement(const std::string& name)
 	else
 		return nullptr;
 }
-const GeoMaterial* AGDD2GeoModelBuilder::CreateMaterial(const std::string& name)
+const GeoMaterial* AGDD2GeoModelBuilder::CreateMaterial(const std::string& name) const
 {
 
 //  give priority to GeoModel's Material Manager in retrieving materials
@@ -176,7 +176,7 @@ const GeoMaterial* AGDD2GeoModelBuilder::CreateMaterial(const std::string& name)
 	else
 		return nullptr;
 }
-void AGDD2GeoModelBuilder::CreateElements()
+void AGDD2GeoModelBuilder::CreateElements() const
 {
 	AGDDMaterialStore *ms=AGDDMaterialStore::GetMaterialStore();
 	ElementIterator it;
@@ -185,7 +185,7 @@ void AGDD2GeoModelBuilder::CreateElements()
 		CreateElement((*it).second->GetName());
 	}
 }
-void AGDD2GeoModelBuilder::CreateMaterial()
+void AGDD2GeoModelBuilder::CreateMaterial() const
 {
 	AGDDMaterialStore *ms=AGDDMaterialStore::GetMaterialStore();
 	MaterialIterator it;
@@ -194,7 +194,7 @@ void AGDD2GeoModelBuilder::CreateMaterial()
 		CreateMaterial((*it).second->GetName());
 	}
 }
-void AGDD2GeoModelBuilder::CreateBox(AGDDBox* v)
+void AGDD2GeoModelBuilder::CreateBox(AGDDBox* v) const
 {
 	void *p=v->GetSolid();
 	if (!p)
@@ -203,7 +203,7 @@ void AGDD2GeoModelBuilder::CreateBox(AGDDBox* v)
 		v->SetSolid(solid);
 	}
 }
-void AGDD2GeoModelBuilder::CreateTrd(AGDDTrd* v)
+void AGDD2GeoModelBuilder::CreateTrd(AGDDTrd* v) const
 {
 	void *p=v->GetSolid();
 	if (!p)
@@ -213,7 +213,7 @@ void AGDD2GeoModelBuilder::CreateTrd(AGDDTrd* v)
 	}
 }
 
-void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
+void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v) const
 {
 // here begins a nasty piece of code
 	static GeoBox *box1=new GeoBox(1.*GeoModelKernelUnits::km,1*GeoModelKernelUnits::km,1*GeoModelKernelUnits::km);
@@ -298,7 +298,7 @@ void AGDD2GeoModelBuilder::CreateSnake(AGDDSnake* v)
 	v->SetSolid(solid);
 }
 
-void AGDD2GeoModelBuilder::CreateCons(AGDDCons* v)
+void AGDD2GeoModelBuilder::CreateCons(AGDDCons* v) const
 {
 	void *p=v->GetSolid();
 	if (!p)
@@ -307,7 +307,7 @@ void AGDD2GeoModelBuilder::CreateCons(AGDDCons* v)
 		v->SetSolid(solid);
 	}
 }
-void AGDD2GeoModelBuilder::CreateTubs(AGDDTubs* v)
+void AGDD2GeoModelBuilder::CreateTubs(AGDDTubs* v) const
 {
 	void *p=v->GetSolid();
 	if (!p)
@@ -317,7 +317,7 @@ void AGDD2GeoModelBuilder::CreateTubs(AGDDTubs* v)
 	}
 }
 
-void AGDD2GeoModelBuilder::CreateElcyl(AGDDElcyl* v)
+void AGDD2GeoModelBuilder::CreateElcyl(AGDDElcyl* v) const
 {
 	void *p=v->GetSolid();
 	if (!p)
@@ -327,7 +327,7 @@ void AGDD2GeoModelBuilder::CreateElcyl(AGDDElcyl* v)
 	}
 }
 
-void AGDD2GeoModelBuilder::CreateGvxy(AGDDGvxy* v)
+void AGDD2GeoModelBuilder::CreateGvxy(AGDDGvxy* v) const
 {
 	void *p=v->GetSolid();
 	if (!p)
@@ -356,19 +356,19 @@ void AGDD2GeoModelBuilder::CreateGvxy(AGDDGvxy* v)
 	}
 }
 
-void AGDD2GeoModelBuilder::CreateUnion(AGDDUnion* v)
+void AGDD2GeoModelBuilder::CreateUnion(AGDDUnion* v) const
 {
 	int nPos=v->NrOfDaughter();
 	AGDDPositioner* pos=v->GetDaughter(0);
 	AGDDVolume *vol=pos->GetVolume();
-	vol->CreateSolid();
+	vol->CreateSolid(*this);
 	GeoShape *sV=(GeoShape*)(vol->GetSolid());
 	sV=new GeoShapeShift(sV,pos->Transform());
  	for (int i=1;i<nPos;i++)
  	{
  		AGDDPositioner* pp=v->GetDaughter(i);
  		AGDDVolume *vv=pp->GetVolume();
- 		vv->CreateSolid();
+ 		vv->CreateSolid(*this);
  		GeoShape *nsV=(GeoShape*)(vv->GetSolid());
 		nsV=new GeoShapeShift(nsV,pp->Transform());
  		sV=new GeoShapeUnion(sV,nsV);
@@ -377,19 +377,19 @@ void AGDD2GeoModelBuilder::CreateUnion(AGDDUnion* v)
 	v->SetColor(vol->GetColor());
 	v->SetSolid(sV);
 }
-void AGDD2GeoModelBuilder::CreateIntersection(AGDDIntersection* v)
+void AGDD2GeoModelBuilder::CreateIntersection(AGDDIntersection* v) const
 {
 	int nPos=v->NrOfDaughter();
 	AGDDPositioner* pos=v->GetDaughter(0);
 	AGDDVolume *vol=pos->GetVolume();
-	vol->CreateSolid();
+	vol->CreateSolid(*this);
 	GeoShape *sV=(GeoShape*)(vol->GetSolid());
 	sV=new GeoShapeShift(sV,pos->Transform());
  	for (int i=1;i<nPos;i++)
  	{
  		AGDDPositioner* pp=v->GetDaughter(i);
  		AGDDVolume *vv=pp->GetVolume();
- 		vv->CreateSolid();
+ 		vv->CreateSolid(*this);
  		GeoShape *nsV=(GeoShape*)(vv->GetSolid());
 		nsV=new GeoShapeShift(nsV,pp->Transform());
  		sV=new GeoShapeIntersection(sV,nsV);
@@ -397,19 +397,19 @@ void AGDD2GeoModelBuilder::CreateIntersection(AGDDIntersection* v)
 	v->SetMaterial(vol->GetMaterial());
 	v->SetSolid(sV);
 }
-void AGDD2GeoModelBuilder::CreateSubtraction(AGDDSubtraction* v)
+void AGDD2GeoModelBuilder::CreateSubtraction(AGDDSubtraction* v) const
 {
 	int nPos=v->NrOfDaughter();
 	AGDDPositioner* pos=v->GetDaughter(0);
 	AGDDVolume *vol=pos->GetVolume();
-	vol->CreateSolid();
+	vol->CreateSolid(*this);
 	GeoShape *sV=(GeoShape*)(vol->GetSolid());
 	sV=new GeoShapeShift(sV,pos->Transform());
  	for (int i=1;i<nPos;i++)
  	{
  		AGDDPositioner* pp=v->GetDaughter(i);
  		AGDDVolume *vv=pp->GetVolume();
- 		vv->CreateSolid();
+ 		vv->CreateSolid(*this);
  		GeoShape *nsV=(GeoShape*)(vv->GetSolid());
 		nsV=new GeoShapeShift(nsV,pp->Transform());
  		sV=new GeoShapeSubtraction(sV,nsV);
@@ -418,7 +418,7 @@ void AGDD2GeoModelBuilder::CreateSubtraction(AGDDSubtraction* v)
 	v->SetSolid(sV);
 }
 
-void AGDD2GeoModelBuilder::CreatePcon(AGDDPcon* v)
+void AGDD2GeoModelBuilder::CreatePcon(AGDDPcon* v) const
 {
 	void *p=v->GetSolid();
 	if (!p)
@@ -436,13 +436,13 @@ void AGDD2GeoModelBuilder::CreatePcon(AGDDPcon* v)
 	}
 }
 
-void AGDD2GeoModelBuilder::CreatePgon(AGDDPgon* v)
+void AGDD2GeoModelBuilder::CreatePgon(AGDDPgon* v) const
 {
 	void *p=v->GetSolid();
 	if (!p)
 	{
 		int nPlanes=v->NrOfPlanes();
-		GeoPgon* solid=new GeoPgon(v->Phi0()*GeoModelKernelUnits::degree,v->Dphi()*GeoModelKernelUnits::degree,v->_nbPhi);
+		GeoPgon* solid=new GeoPgon(v->Phi0()*GeoModelKernelUnits::degree,v->Dphi()*GeoModelKernelUnits::degree,v->m_nbPhi);
 		for (int i=0;i<nPlanes;i++)
 		{
 			double ri=v->Rin(i);
@@ -455,7 +455,7 @@ void AGDD2GeoModelBuilder::CreatePgon(AGDDPgon* v)
 }
 
 
-void AGDD2GeoModelBuilder::CreateComposition(AGDDComposition *v)
+void AGDD2GeoModelBuilder::CreateComposition(AGDDComposition *v) const
 {
 	static int ifirst=1;
 	static const GeoMaterial *ether=0;
@@ -507,7 +507,7 @@ void AGDD2GeoModelBuilder::CreateComposition(AGDDComposition *v)
 			if (!temp) 
 			{
 			  // if it's the first occurrence of this Volume, build it 
-			  vol->CreateVolume();
+			  vol->CreateVolume(*this);
 			  if (isDetElement) {
 			    detVol=(GeoFullPhysVol*)(vol->GetVolume());
 				if (p) p->theVolume=detVol;
@@ -532,7 +532,7 @@ void AGDD2GeoModelBuilder::CreateComposition(AGDDComposition *v)
 	}
 }
 
-void AGDD2GeoModelBuilder::CreateVolume(AGDDVolume* v)
+void AGDD2GeoModelBuilder::CreateVolume(AGDDVolume* v) const
 {
 	const GeoMaterial *mat=CreateMaterial(ALIAS(v->GetMaterial()));
 	
@@ -554,7 +554,7 @@ void AGDD2GeoModelBuilder::CreateVolume(AGDDVolume* v)
 	}
 }
 
-void AGDD2GeoModelBuilder::BuildAllVolumes()
+void AGDD2GeoModelBuilder::BuildAllVolumes() const
 {
   AGDDVolumeStore *vs=AGDDVolumeStore::GetVolumeStore();
   AGDDVolumeMap::const_iterator it;
@@ -565,7 +565,7 @@ void AGDD2GeoModelBuilder::BuildAllVolumes()
   	AGDDVolume* vol=(*it).second;
 	if (!vol->HasParent())
 	{
-		vol->CreateVolume();
+		vol->CreateVolume(*this);
 		AGDDComposition *vv=dynamic_cast<AGDDComposition *>(vol);
 		
 		if (vv)
@@ -588,7 +588,7 @@ void AGDD2GeoModelBuilder::BuildAllVolumes()
   }
 }
 
-void AGDD2GeoModelBuilder::BuildFromSection(std::string s)
+void AGDD2GeoModelBuilder::BuildFromSection(const std::string& s) const
 {
   GeoTrf::Transform3D trf = GeoTrf::Transform3D::Identity();
 
@@ -607,7 +607,7 @@ void AGDD2GeoModelBuilder::BuildFromSection(std::string s)
           AGDDVolume* vol=(*it).second;
           if (vol->GetName()==topVolumeName)
           {
-             vol->CreateVolume();
+             vol->CreateVolume(*this);
 
              AGDDComposition *vv=dynamic_cast<AGDDComposition *>(vol);
 
@@ -635,7 +635,7 @@ void AGDD2GeoModelBuilder::BuildFromSection(std::string s)
   	    AGDDVolume* vol=(*it).second;
 	    if (!vol->HasParent())
 	    {
-		  vol->CreateVolume();
+		  vol->CreateVolume(*this);
 		  AGDDComposition *vv=dynamic_cast<AGDDComposition *>(vol);
 		
 		  if (vv)
@@ -661,7 +661,7 @@ void AGDD2GeoModelBuilder::BuildFromSection(std::string s)
     log<<MSG::WARNING<<"BuildFromSection() - This section is flagged as not to be built!"<<endmsg;
   }
 }
-void AGDD2GeoModelBuilder::BuildFromVolume(std::string s)
+void AGDD2GeoModelBuilder::BuildFromVolume(const std::string& s) const
 {
     GeoTrf::Transform3D trf = GeoTrf::Transform3D::Identity();
   
@@ -672,7 +672,7 @@ void AGDD2GeoModelBuilder::BuildFromVolume(std::string s)
 		log<<MSG::WARNING<<"BuildFromVolume() - Volume "<<s<<" not found in the store! Exiting..."<<endmsg;
 		return;
 	}
-	vol->CreateVolume();
+	vol->CreateVolume(*this);
 		GeoPhysVol *vvv=(GeoPhysVol*)(vol->GetVolume());
 		if (vvv)
 		{
@@ -687,64 +687,64 @@ void AGDD2GeoModelBuilder::BuildFromVolume(std::string s)
 		}
 }
 
-void AGDD2GeoModelBuilder::CreateBolt(AGDDBolt *b)
+void AGDD2GeoModelBuilder::CreateBolt(AGDDBolt *b) const
 {
 	void *p=b->GetSolid();
 	if (!p)
 	{
-		GeoShape* solid=new GeoTubs(0,b->_diameter/2.,b->_length/2.,0.,360.*GeoModelKernelUnits::degree);
+		GeoShape* solid=new GeoTubs(0,b->m_diameter/2.,b->m_length/2.,0.,360.*GeoModelKernelUnits::degree);
 		
 		GeoPgon* s=new GeoPgon(0.,360*GeoModelKernelUnits::degree,6);
-		s->addPlane(-b->_length/2.,0,b->_headDiameter/2.);
-		s->addPlane(-b->_length/2.+b->_headLength,0,b->_headDiameter/2.);
+		s->addPlane(-b->m_length/2.,0,b->m_headDiameter/2.);
+		s->addPlane(-b->m_length/2.+b->m_headLength,0,b->m_headDiameter/2.);
 		solid=new GeoShapeUnion(solid,s);		
 		b->SetSolid(solid);
 	}
 }
 
-void AGDD2GeoModelBuilder::CreateIbeam(AGDDIbeam *b)
+void AGDD2GeoModelBuilder::CreateIbeam(AGDDIbeam *b) const
 {
 	void *p=b->GetSolid();
 	if (!p)
 	{
 		GeoSimplePolygonBrep* solid;
 		solid = new GeoSimplePolygonBrep(b->GetLength()/2.);
-		solid->addVertex(b->_width/2.,b->_height/2);
-		solid->addVertex(-b->_width/2.,b->_height/2);
-		solid->addVertex(-b->_width/2.,b->_smallHeight/2);
-		solid->addVertex(-b->_smallWidth/2.,b->_smallHeight/2);
-		solid->addVertex(-b->_smallWidth/2.,-b->_smallHeight/2);
-		solid->addVertex(-b->_width/2.,-b->_smallHeight/2);
-		solid->addVertex(-b->_width/2.,-b->_height/2);
-		solid->addVertex(b->_width/2.,-b->_height/2);
-		solid->addVertex(b->_width/2.,-b->_smallHeight/2);
-		solid->addVertex(b->_smallWidth/2.,-b->_smallHeight/2);
-		solid->addVertex(b->_smallWidth/2.,b->_smallHeight/2);
-		solid->addVertex(b->_width/2.,b->_smallHeight/2);
+		solid->addVertex(b->m_width/2.,b->m_height/2);
+		solid->addVertex(-b->m_width/2.,b->m_height/2);
+		solid->addVertex(-b->m_width/2.,b->m_smallHeight/2);
+		solid->addVertex(-b->m_smallWidth/2.,b->m_smallHeight/2);
+		solid->addVertex(-b->m_smallWidth/2.,-b->m_smallHeight/2);
+		solid->addVertex(-b->m_width/2.,-b->m_smallHeight/2);
+		solid->addVertex(-b->m_width/2.,-b->m_height/2);
+		solid->addVertex(b->m_width/2.,-b->m_height/2);
+		solid->addVertex(b->m_width/2.,-b->m_smallHeight/2);
+		solid->addVertex(b->m_smallWidth/2.,-b->m_smallHeight/2);
+		solid->addVertex(b->m_smallWidth/2.,b->m_smallHeight/2);
+		solid->addVertex(b->m_width/2.,b->m_smallHeight/2);
 		b->SetSolid(solid);
 	}
 }
 
-void AGDD2GeoModelBuilder::CreateUbeam(AGDDUbeam *b)
+void AGDD2GeoModelBuilder::CreateUbeam(AGDDUbeam *b) const
 {
 	void *p=b->GetSolid();
 	if (!p)
 	{
 		GeoSimplePolygonBrep* solid;
 		solid = new GeoSimplePolygonBrep(b->GetLength()/2.);
-		solid->addVertex(b->_width/2.,b->_smallHeight/2.);
-		solid->addVertex(-b->_width/2.,b->_smallHeight/2.);
-		solid->addVertex(-b->_width/2.,-b->_height+b->_smallHeight/2.);
-		solid->addVertex(-b->_width/2.+b->_smallWidth,-b->_height+b->_smallHeight/2.);
-		solid->addVertex(-b->_width/2.+b->_smallWidth,-b->_smallHeight/2.);
-		solid->addVertex(b->_width/2.-b->_smallWidth,-b->_smallHeight/2.);
-		solid->addVertex(b->_width/2.-b->_smallWidth,-b->_height+b->_smallHeight/2.);
-		solid->addVertex(b->_width/2.,-b->_height+b->_smallHeight/2.);
+		solid->addVertex(b->m_width/2.,b->m_smallHeight/2.);
+		solid->addVertex(-b->m_width/2.,b->m_smallHeight/2.);
+		solid->addVertex(-b->m_width/2.,-b->m_height+b->m_smallHeight/2.);
+		solid->addVertex(-b->m_width/2.+b->m_smallWidth,-b->m_height+b->m_smallHeight/2.);
+		solid->addVertex(-b->m_width/2.+b->m_smallWidth,-b->m_smallHeight/2.);
+		solid->addVertex(b->m_width/2.-b->m_smallWidth,-b->m_smallHeight/2.);
+		solid->addVertex(b->m_width/2.-b->m_smallWidth,-b->m_height+b->m_smallHeight/2.);
+		solid->addVertex(b->m_width/2.,-b->m_height+b->m_smallHeight/2.);
 		b->SetSolid(solid);
 	}
 }
 
-const GeoMaterial* AGDD2GeoModelBuilder::GetMMMaterial(const std::string& name)
+const GeoMaterial* AGDD2GeoModelBuilder::GetMMMaterial(const std::string& name) const
 {
     StoreGateSvc* pDetStore=nullptr;
     ISvcLocator* svcLocator = Gaudi::svcLocator();
diff --git a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDBuilder.h b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDBuilder.h
index 6766c501df0b..6793748211a5 100644
--- a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDBuilder.h
+++ b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDBuilder.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 AGDDBuilder_H
@@ -29,39 +29,35 @@ class AGDDUbeam;
 class AGDDBuilder {
 public:
 	// constructor
-	AGDDBuilder() {s_theBuilder=this;}
+	AGDDBuilder() {}
 	virtual ~AGDDBuilder() {}
 	// elements & materials 
-	virtual void CreateElements()=0;
-	virtual void CreateMaterial()=0;
+	virtual void CreateElements() const =0;
+	virtual void CreateMaterial() const =0;
 	
 	// solids, volumes and composition
-	virtual void CreateBox(AGDDBox*)=0;
-	virtual void CreateTrd(AGDDTrd*)=0;
-	virtual void CreateTubs(AGDDTubs*)=0;
-	virtual void CreateElcyl(AGDDElcyl*)=0;
-	virtual void CreateCons(AGDDCons*)=0;
-	virtual void CreatePcon(AGDDPcon*)=0;
-	virtual void CreatePgon(AGDDPgon*)=0;
-	virtual void CreateGvxy(AGDDGvxy*)=0;
-	virtual void CreateSnake(AGDDSnake*)=0;
-	virtual void CreateUnion(AGDDUnion*)=0;
-	virtual void CreateIntersection(AGDDIntersection*)=0;
-	virtual void CreateSubtraction(AGDDSubtraction*)=0;
+	virtual void CreateBox(AGDDBox*) const =0;
+	virtual void CreateTrd(AGDDTrd*) const =0;
+	virtual void CreateTubs(AGDDTubs*) const =0;
+	virtual void CreateElcyl(AGDDElcyl*) const =0;
+	virtual void CreateCons(AGDDCons*) const =0;
+	virtual void CreatePcon(AGDDPcon*) const =0;
+	virtual void CreatePgon(AGDDPgon*) const =0;
+	virtual void CreateGvxy(AGDDGvxy*) const =0;
+	virtual void CreateSnake(AGDDSnake*) const =0;
+	virtual void CreateUnion(AGDDUnion*) const =0;
+	virtual void CreateIntersection(AGDDIntersection*) const =0;
+	virtual void CreateSubtraction(AGDDSubtraction*) const =0;
 	
-	virtual void CreateBolt(AGDDBolt*)=0;
-	virtual void CreateIbeam(AGDDIbeam*)=0;
-	virtual void CreateUbeam(AGDDUbeam*)=0;
+	virtual void CreateBolt(AGDDBolt*) const =0;
+	virtual void CreateIbeam(AGDDIbeam*) const =0;
+	virtual void CreateUbeam(AGDDUbeam*) const =0;
 	
-	virtual void CreateVolume(AGDDVolume*)=0;
-	virtual void CreateComposition(AGDDComposition*)=0;
+	virtual void CreateVolume(AGDDVolume*) const =0;
+	virtual void CreateComposition(AGDDComposition*) const =0;
 
-	virtual void BuildFromSection(std::string)=0;
-	virtual void BuildFromVolume(std::string)=0;
-
-    static AGDDBuilder* CurrentBuilder() {return s_theBuilder;}
-private:
-    static AGDDBuilder* s_theBuilder;
+	virtual void BuildFromSection(const std::string&) const =0;
+	virtual void BuildFromVolume(const std::string&) const =0;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDVolume.h b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDVolume.h
index 835ce1431856..22859113bc63 100644
--- a/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDVolume.h
+++ b/DetectorDescription/AGDD/AGDDKernel/AGDDKernel/AGDDVolume.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 AGDDVolume_H
@@ -9,19 +9,20 @@
 #include <vector>
 
 #include "AGDDKernel/AGDDPositioner.h"
+class AGDDBuilder;
 
 class AGDDVolume {
 public:
-	AGDDVolume(std::string s, bool v=false);
+	AGDDVolume(const std::string& s, bool v=false);
 	virtual ~AGDDVolume() {}
-	std::string GetName() {return m_name;}
-	void SetMaterial(std::string n) {m_material=n;}
-	virtual void CreateSolid() {}
-	virtual void CreateVolume() {}
-	void AddDaughter(AGDDPositioner* v) ;
+	const std::string& GetName() const {return m_name;}
+	void SetMaterial(const std::string& n) {m_material=n;}
+        virtual void CreateSolid (const AGDDBuilder& /*builder*/) {}
+        virtual void CreateVolume (const AGDDBuilder& /*builder*/) {}
+	void AddDaughter(AGDDPositioner* v);
 	AGDDPositioner* GetDaughter(int i) {return m_theDaughters[i];}
-	int NrOfDaughter() {return m_theDaughters.size();}
-	bool HasParent() {return (m_theParents.size());}
+	int NrOfDaughter() const {return m_theDaughters.size();}
+	bool HasParent() const {return (m_theParents.size());}
 	void AddParent(AGDDVolume *v) {m_theParents.push_back(v);}
 	void *GetVolume() {return m_theVolume;}
 	void *GetSolid() {return m_theSolid;}
@@ -29,11 +30,11 @@ public:
 	void SetVolume(void *p) {m_theVolume=p;}
 	void SetColor(std::string c) {m_color=c;}
 	void IsSensitiveVolume(bool v); 
-	bool IsSensitiveVolume() {return m_isSensitive;}
-	std::string GetColor() {return m_color;}
-	std::string GetMaterial() {return m_material;}
-protected:
+	bool IsSensitiveVolume() const {return m_isSensitive;}
+        const std::string& GetColor() const {return m_color;}
+	const std::string& GetMaterial() const {return m_material;}
  
+protected:
 	std::string m_name;
 	std::string m_material;
 	std::vector<AGDDPositioner*> m_theDaughters;
diff --git a/DetectorDescription/AGDD/AGDDKernel/src/AGDDBuilder.cxx b/DetectorDescription/AGDD/AGDDKernel/src/AGDDBuilder.cxx
index 6b7620627959..ca5aff054d6f 100644
--- a/DetectorDescription/AGDD/AGDDKernel/src/AGDDBuilder.cxx
+++ b/DetectorDescription/AGDD/AGDDKernel/src/AGDDBuilder.cxx
@@ -1,7 +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
 */
 
 #include "AGDDKernel/AGDDBuilder.h"
 
-AGDDBuilder* AGDDBuilder::s_theBuilder=0;
diff --git a/DetectorDescription/AGDD/AGDDKernel/src/AGDDVolume.cxx b/DetectorDescription/AGDD/AGDDKernel/src/AGDDVolume.cxx
index 85031e0abe3a..bfdb474b5965 100644
--- a/DetectorDescription/AGDD/AGDDKernel/src/AGDDVolume.cxx
+++ b/DetectorDescription/AGDD/AGDDKernel/src/AGDDVolume.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 "AGDDKernel/AGDDVolumeStore.h"
@@ -7,7 +7,7 @@
 #include "AGDDKernel/AGDDSection.h"
 #include "AGDDKernel/AGDDVolume.h"
 
-AGDDVolume::AGDDVolume(std::string n,bool v):m_name(n),m_theSolid(0),m_theVolume(0),m_isSensitive(v)
+AGDDVolume::AGDDVolume(const std::string& n,bool v):m_name(n),m_theSolid(0),m_theVolume(0),m_isSensitive(v)
 {
 	AGDDVolumeStore::GetVolumeStore()->RegisterVolume(this);
 	AGDDSectionStore *ss=AGDDSectionStore::GetSectionStore();
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDBolt.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDBolt.h
index bbb01b24b36e..9a6bad487421 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDBolt.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDBolt.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 AGDDBolt_H
@@ -12,26 +12,26 @@
 
 class AGDDBolt: public AGDDVolume {
 public:
-	AGDDBolt(std::string s):AGDDVolume(s),_length(0),_headLength(0),
-										 _diameter(0),_headDiameter(0) {}
+	AGDDBolt(const std::string& s):AGDDVolume(s),m_length(0),m_headLength(0),
+										 m_diameter(0),m_headDiameter(0) {}
 	~AGDDBolt() {}
-	void CreateVolume();
-	void CreateSolid();
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 	
-	void SetHeadLength(double l) {_headLength=l;}
-	void SetLength(double l) {_length=l;}
-	void SetHeadDiameter(double l) {_headDiameter=l;}
-	void SetDiameter(double l) {_diameter=l;}
+	void SetHeadLength(double l) {m_headLength=l;}
+	void SetLength(double l) {m_length=l;}
+	void SetHeadDiameter(double l) {m_headDiameter=l;}
+	void SetDiameter(double l) {m_diameter=l;}
 	
-	double GetHeadLength() {return _headLength;}
-	double GetLength() {return _length;}
-	double GetHeadDiameter() {return _headDiameter;}
-	double GetDiameter() {return _diameter;}
+	double GetHeadLength() const {return m_headLength;}
+	double GetLength() const {return m_length;}
+	double GetHeadDiameter() const {return m_headDiameter;}
+	double GetDiameter() const {return m_diameter;}
 	
-	double _length;
-	double _headLength;
-	double _diameter;
-	double _headDiameter;
+	double m_length;
+	double m_headLength;
+	double m_diameter;
+	double m_headDiameter;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDBox.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDBox.h
index f6263e1ab946..59da9f1c4912 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDBox.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDBox.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 AGDDBox_H
@@ -12,22 +12,22 @@
 
 class AGDDBox: public AGDDVolume {
 public:
-	AGDDBox(std::string s):AGDDVolume(s),_x(0),_y(0),_z(0) {}
+	AGDDBox(const std::string& s):AGDDVolume(s),m_x(0),m_y(0),m_z(0) {}
 	~AGDDBox() {}
 	void SetXYZ(std::vector<double> v) 
 	{
-		_x=v[0];
-		_y=v[1];
-		_z=v[2];
+		m_x=v[0];
+		m_y=v[1];
+		m_z=v[2];
 	}
-	double x() {return _x;}
-	double y() {return _y;}
-	double z() {return _z;}
-	void CreateVolume();
-	void CreateSolid();
-	double _x;
-	double _y;
-	double _z;
+	double x() const {return m_x;}
+	double y() const {return m_y;}
+	double z() const {return m_z;}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
+	double m_x;
+	double m_y;
+	double m_z;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDComposition.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDComposition.h
index 99d170629020..849a1c4e521e 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDComposition.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDComposition.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 AGDDComposition_H
@@ -14,7 +14,7 @@ class AGDDComposition: public AGDDVolume {
 public:
 	AGDDComposition(std::string s):AGDDVolume(s) {}
 	~AGDDComposition() {}
-	void CreateVolume();
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
 private:
 };
 
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDCons.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDCons.h
index 1a27d9aed970..3e850e0f3c43 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDCons.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDCons.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 AGDDCons_H
@@ -31,8 +31,8 @@ public:
 	double phi0() {return _phi0;}
 	double dphi() {return _dphi;}
 	double z() {return _z;}
-	void CreateVolume();
-	void CreateSolid();
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 	double _rin1;
 	double _rin2;
 	double _rou1;
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDElcyl.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDElcyl.h
index 5563a24b7307..d983bfd89e64 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDElcyl.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDElcyl.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 AGDDElcyl_H
@@ -12,21 +12,21 @@
 
 class AGDDElcyl: public AGDDVolume {
 public:
-	AGDDElcyl(std::string s):AGDDVolume(s),_dx(0),_dy(0),_z(0) {}
-	void SetRXio_RYio_Z(std::vector<double> v) 
+	AGDDElcyl(const std::string& s):AGDDVolume(s),m_dx(0),m_dy(0),m_z(0) {}
+	void SetRXio_RYio_Z(const std::vector<double>& v) 
 	{
-		_dx=v[0];
-		_dy=v[1];
-		_z=v[2];
+		m_dx=v[0];
+		m_dy=v[1];
+		m_z=v[2];
 	}
-	void CreateVolume();
-	void CreateSolid();
-	double dx() {return _dx;}
-	double dy() {return _dy;}
-	double z() {return _z;}
-	double _dx;
-	double _dy;
-	double _z;
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
+	double dx() const {return m_dx;}
+	double dy() const {return m_dy;}
+	double z() const {return m_z;}
+	double m_dx;
+	double m_dy;
+	double m_z;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDGvxy.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDGvxy.h
index 0c8f93bc408f..dc2d4471e874 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDGvxy.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDGvxy.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 AGDDGvxy_H
@@ -13,7 +13,7 @@
 
 class AGDDGvxy: public AGDDVolume {
 public:
-	AGDDGvxy(std::string s):AGDDVolume(s),m_dz(0) {}
+	AGDDGvxy(const std::string& s):AGDDVolume(s),m_dz(0) {}
 	void SetDz(double v) 
 	{
 		m_dz=v;
@@ -23,11 +23,11 @@ public:
 //		std::cout<<" GVXY setting point "<<p.x()<<" "<<p.y()<<std::endl;
 		m_points.push_back(p);
 	}
-	int NrOfPoints() {return m_points.size();}
-	TwoPoint GetPoint(int i) {return m_points[i];}
-	double GetDz() {return m_dz;}
-	void CreateVolume();
-	void CreateSolid();
+	int NrOfPoints() const {return m_points.size();}
+	TwoPoint GetPoint(int i) const {return m_points[i];}
+	double GetDz() const {return m_dz;}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 private:
 	double m_dz;
 	std::vector<TwoPoint> m_points;
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDIbeam.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDIbeam.h
index 3b282bad034e..5bc10410bcca 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDIbeam.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDIbeam.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 AGDDIbeam_H
@@ -12,28 +12,28 @@
 
 class AGDDIbeam: public AGDDVolume {
 public:
-	AGDDIbeam(std::string s):AGDDVolume(s),_width(0),_smallWidth(0),_height(0),
-								_smallHeight(0),_z(0) {}
-	void CreateVolume();
-	void CreateSolid();
+	AGDDIbeam(const std::string& s):AGDDVolume(s),m_width(0),m_smallWidth(0),m_height(0),
+								m_smallHeight(0),m_z(0) {}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 	
-	void SetWidth(double l) {_width=l;}
-	void SetSmallWidth(double l) {_smallWidth=l;}
-	void SetHeigth(double l) {_height=l;}
-	void SetSmallHeigth(double l) {_smallHeight=l;}
-	void SetLength(double l) {_z=l;}
+	void SetWidth(double l) {m_width=l;}
+	void SetSmallWidth(double l) {m_smallWidth=l;}
+	void SetHeigth(double l) {m_height=l;}
+	void SetSmallHeigth(double l) {m_smallHeight=l;}
+	void SetLength(double l) {m_z=l;}
 	
-	double GetWidth() {return _width;}
-	double GetSmallWidth() {return _smallWidth;}
-	double GetHeigth() {return _height;}
-	double GetSmallHeigth() {return _smallHeight;}
-	double GetLength() {return _z;}
+	double GetWidth() const {return m_width;}
+	double GetSmallWidth() const {return m_smallWidth;}
+	double GetHeigth() const {return m_height;}
+	double GetSmallHeigth() const {return m_smallHeight;}
+	double GetLength() const {return m_z;}
 	
-	double _width;
-	double _smallWidth;
-	double _height;
-	double _smallHeight;
-	double _z;
+	double m_width;
+	double m_smallWidth;
+	double m_height;
+	double m_smallHeight;
+	double m_z;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDIntersection.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDIntersection.h
index 5677e03f0af7..0708d86be5f6 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDIntersection.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDIntersection.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 AGDDIntersection_H
@@ -12,9 +12,9 @@
 
 class AGDDIntersection: public AGDDVolume {
 public:
-	AGDDIntersection(std::string s):AGDDVolume(s) {}
-	void CreateVolume();
-	void CreateSolid();
+	AGDDIntersection(const std::string& s):AGDDVolume(s) {}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 private:
 };
 
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDPcon.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDPcon.h
index 5d2bd4ad829f..7bca91d1b2e5 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDPcon.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDPcon.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 AGDDPcon_H
@@ -12,28 +12,28 @@
 
 class AGDDPcon: public AGDDVolume {
 public:
-	AGDDPcon(std::string s):AGDDVolume(s),_phi0(0),_dphi(0) {}
+	AGDDPcon(const std::string& s):AGDDVolume(s),m_phi0(0),m_dphi(0) {}
 	void SetPlane(double ri,double ro,double z) 
 	{
-		_rin.push_back(ri);
-		_rou.push_back(ro);
-		_z.push_back(z);
+		m_rin.push_back(ri);
+		m_rou.push_back(ro);
+		m_z.push_back(z);
 	}
-	void SetProfile(double phi0,double dphi) {_phi0=phi0;_dphi=dphi;}
-	int NrOfPlanes() {return _rin.size();}
-	double Rin(int i) {return _rin[i];}
-	double Rout(int i) {return _rou[i];}
-	double Z(int i) {return _z[i];}
-	double Phi0() {return _phi0;}
-	double Dphi() {return _dphi;}
-	void CreateVolume();
-	void CreateSolid();
-	std::vector<double> _rin;
-	std::vector<double> _rou;
-	std::vector<double> _z;
+	void SetProfile(double phi0,double dphi) {m_phi0=phi0;m_dphi=dphi;}
+	int NrOfPlanes() const {return m_rin.size();}
+	double Rin(int i) const {return m_rin[i];}
+	double Rout(int i) const {return m_rou[i];}
+	double Z(int i) const {return m_z[i];}
+	double Phi0() const {return m_phi0;}
+	double Dphi() const {return m_dphi;}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
+	std::vector<double> m_rin;
+	std::vector<double> m_rou;
+	std::vector<double> m_z;
 	
-	double _phi0;
-	double _dphi;
+	double m_phi0;
+	double m_dphi;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDPgon.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDPgon.h
index c8298b6ccb96..a1a8c7fcdfe2 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDPgon.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDPgon.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 AGDDPgon_H
@@ -12,30 +12,30 @@
 
 class AGDDPgon: public AGDDVolume {
 public:
-	AGDDPgon(std::string s):AGDDVolume(s),_phi0(0),_dphi(0),_nbPhi(0) {}
+	AGDDPgon(const std::string& s):AGDDVolume(s),m_phi0(0),m_dphi(0),m_nbPhi(0) {}
 	void SetPlane(double ri,double ro,double z) 
 	{
-		_rin.push_back(ri);
-		_rou.push_back(ro);
-		_z.push_back(z);
+		m_rin.push_back(ri);
+		m_rou.push_back(ro);
+		m_z.push_back(z);
 	}
-	void SetProfile(double phi0,double dphi) {_phi0=phi0;_dphi=dphi;}
-	void SetNbPhi(int i) {_nbPhi=i;}
-	int NrOfPlanes() {return _rin.size();}
-	double Rin(int i) {return _rin[i];}
-	double Rout(int i) {return _rou[i];}
-	double Z(int i) {return _z[i];}
-	double Phi0() {return _phi0;}
-	double Dphi() {return _dphi;}
-	void CreateVolume();
-	void CreateSolid();
-	std::vector<double> _rin;
-	std::vector<double> _rou;
-	std::vector<double> _z;
+	void SetProfile(double phi0,double dphi) {m_phi0=phi0;m_dphi=dphi;}
+	void SetNbPhi(int i) {m_nbPhi=i;}
+	int NrOfPlanes() const {return m_rin.size();}
+	double Rin(int i) const {return m_rin[i];}
+	double Rout(int i) const {return m_rou[i];}
+	double Z(int i) const {return m_z[i];}
+	double Phi0() const {return m_phi0;}
+	double Dphi() const {return m_dphi;}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
+	std::vector<double> m_rin;
+	std::vector<double> m_rou;
+	std::vector<double> m_z;
 	
-	double _phi0;
-	double _dphi;
-	int _nbPhi;
+	double m_phi0;
+	double m_dphi;
+	int m_nbPhi;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h
index 803f0fbc3fda..efaded32ad2e 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSnake.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 AGDDSnake_H
@@ -13,17 +13,17 @@
 
 class AGDDSnake: public AGDDVolume {
 public:
-	AGDDSnake(std::string s):AGDDVolume(s),m_radius(0) {}
+	AGDDSnake(const std::string& s):AGDDVolume(s),m_radius(0) {}
 	void SetPoint(GeoTrf::Vector3D p)
 	{
 		m_points.push_back(p);
 	}
-	int NrOfPoints() {return m_points.size();}
-	double Radius() {return m_radius;}
+	int NrOfPoints() const {return m_points.size();}
+	double Radius() const {return m_radius;}
 	void Radius(double d) {m_radius=d;}
-	GeoTrf::Vector3D GetPoint(int i) {return m_points[i];}
-	void CreateVolume();
-	void CreateSolid();
+	GeoTrf::Vector3D GetPoint(int i) const {return m_points[i];}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 private:
 	double m_radius;
 	std::vector<GeoTrf::Vector3D> m_points;
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSubtraction.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSubtraction.h
index c5398650bf1c..713fb40f9c69 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSubtraction.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDSubtraction.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 AGDDSubtraction_H
@@ -12,9 +12,9 @@
 
 class AGDDSubtraction: public AGDDVolume {
 public:
-	AGDDSubtraction(std::string s):AGDDVolume(s) {}
-	void CreateVolume();
-	void CreateSolid();
+	AGDDSubtraction(const std::string& s):AGDDVolume(s) {}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 private:
 };
 
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDTrd.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDTrd.h
index 6eb3c0588f99..040827d18ba5 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDTrd.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDTrd.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 AGDDTrd_H
@@ -12,27 +12,27 @@
 
 class AGDDTrd: public AGDDVolume {
 public:
-	AGDDTrd(std::string s):AGDDVolume(s),_x1(0),_x2(0),_y1(0),_y2(0),_z(0) {}
-	void SetXYZ(std::vector<double> v) 
+	AGDDTrd(const std::string& s):AGDDVolume(s),m_x1(0),m_x2(0),m_y1(0),m_y2(0),m_z(0) {}
+	void SetXYZ(const std::vector<double>& v) 
 	{
-		_x1=v[0];
-		_x2=v[1];
-		_y1=v[2];
-		_y2=v[3];
-		_z=v[4];
+		m_x1=v[0];
+		m_x2=v[1];
+		m_y1=v[2];
+		m_y2=v[3];
+		m_z=v[4];
 	}
-	double x1() {return _x1;}
-	double x2() {return _x2;}
-	double y1() {return _y1;}
-	double y2() {return _y2;}
-	double z() {return _z;}
-	void CreateVolume();
-	void CreateSolid();
-	double _x1;
-	double _x2;
-	double _y1;
-	double _y2;
-	double _z;
+	double x1() const {return m_x1;}
+	double x2() const {return m_x2;}
+	double y1() const {return m_y1;}
+	double y2() const {return m_y2;}
+	double z() const {return m_z;}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
+	double m_x1;
+	double m_x2;
+	double m_y1;
+	double m_y2;
+	double m_z;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDTubs.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDTubs.h
index 868a2d30c467..d6f98e3a3f61 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDTubs.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDTubs.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 AGDDTubs_H
@@ -12,26 +12,26 @@
 
 class AGDDTubs: public AGDDVolume {
 public:
-	AGDDTubs(std::string s):AGDDVolume(s),_rin(0),_rou(0),_z(0),_phi0(0),_dphi(0) {}
-	void SetRio_Z(std::vector<double> v) 
+	AGDDTubs(const std::string& s):AGDDVolume(s),m_rin(0),m_rou(0),m_z(0),m_phi0(0),m_dphi(0) {}
+	void SetRio_Z(const std::vector<double>& v) 
 	{
-		_rin=v[0];
-		_rou=v[1];
-		_z=v[2];
+		m_rin=v[0];
+		m_rou=v[1];
+		m_z=v[2];
 	}
-	void SetProfile(double p0,double dp) {_phi0=p0;_dphi=dp;}
-	void CreateVolume();
-	void CreateSolid();
-	double rin() {return _rin;}
-	double rou() {return _rou;}
-	double z() {return _z;}
-	double phi0() {return _phi0;}
-	double dphi() {return _dphi;}
-	double _rin;
-	double _rou;
-	double _z;
-	double _phi0;
-	double _dphi;
+	void SetProfile(double p0,double dp) {m_phi0=p0;m_dphi=dp;}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
+	double rin() const {return m_rin;}
+	double rou() const {return m_rou;}
+	double z() const {return m_z;}
+	double phi0() const {return m_phi0;}
+	double dphi() const {return m_dphi;}
+	double m_rin;
+	double m_rou;
+	double m_z;
+	double m_phi0;
+	double m_dphi;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDUbeam.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDUbeam.h
index 6534b83b8b64..007f31d7da70 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDUbeam.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDUbeam.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 AGDDUbeam_H
@@ -12,28 +12,28 @@
 
 class AGDDUbeam: public AGDDVolume {
 public:
-	AGDDUbeam(std::string s):AGDDVolume(s),_width(0),_smallWidth(0),_height(0),
-								_smallHeight(0),_z(0) {}
-	void CreateVolume();
-	void CreateSolid();
+	AGDDUbeam(const std::string& s):AGDDVolume(s),m_width(0),m_smallWidth(0),m_height(0),
+								m_smallHeight(0),m_z(0) {}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 	
-	void SetWidth(double l) {_width=l;}
-	void SetSmallWidth(double l) {_smallWidth=l;}
-	void SetHeigth(double l) {_height=l;}
-	void SetSmallHeigth(double l) {_smallHeight=l;}
-	void SetLength(double l) {_z=l;}
+	void SetWidth(double l) {m_width=l;}
+	void SetSmallWidth(double l) {m_smallWidth=l;}
+	void SetHeigth(double l) {m_height=l;}
+	void SetSmallHeigth(double l) {m_smallHeight=l;}
+	void SetLength(double l) {m_z=l;}
 	
-	double GetWidth() {return _width;}
-	double GetSmallWidth() {return _smallWidth;}
-	double GetHeigth() {return _height;}
-	double GetSmallHeigth() {return _smallHeight;}
-	double GetLength() {return _z;}
+	double GetWidth() const {return m_width;}
+	double GetSmallWidth() const {return m_smallWidth;}
+	double GetHeigth() const {return m_height;}
+	double GetSmallHeigth() const {return m_smallHeight;}
+	double GetLength() const {return m_z;}
 	
-	double _width;
-	double _smallWidth;
-	double _height;
-	double _smallHeight;
-	double _z;
+	double m_width;
+	double m_smallWidth;
+	double m_height;
+	double m_smallHeight;
+	double m_z;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDUnion.h b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDUnion.h
index fe7819270bf2..451555b4065f 100644
--- a/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDUnion.h
+++ b/DetectorDescription/AGDD/AGDDModel/AGDDModel/AGDDUnion.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 AGDDUnion_H
@@ -12,9 +12,9 @@
 
 class AGDDUnion: public AGDDVolume {
 public:
-	AGDDUnion(std::string s):AGDDVolume(s) {}
-	void CreateVolume();
-	void CreateSolid();
+	AGDDUnion(const std::string& s):AGDDVolume(s) {}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 private:
 };
 
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDBolt.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDBolt.cxx
index 7e25ed581c15..7a1145b3c92e 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDBolt.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDBolt.cxx
@@ -1,23 +1,18 @@
 /*
-  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 "AGDDModel/AGDDBolt.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDBolt::CreateSolid() 
+void AGDDBolt::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateBolt(this);
+	builder.CreateBolt(this);
 }
 
-void AGDDBolt::CreateVolume() 
+void AGDDBolt::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDBox.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDBox.cxx
index a418e7eeeced..45a614f0106a 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDBox.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDBox.cxx
@@ -1,23 +1,18 @@
 /*
-  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 "AGDDModel/AGDDBox.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDBox::CreateSolid() 
+void AGDDBox::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateBox(this);
+	builder.CreateBox(this);
 }
 
-void AGDDBox::CreateVolume() 
+void AGDDBox::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDComposition.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDComposition.cxx
index 8c762c172da4..d145493704b4 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDComposition.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDComposition.cxx
@@ -1,14 +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 "AGDDModel/AGDDComposition.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDComposition::CreateVolume() 
+void AGDDComposition::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateComposition(this);
+	builder.CreateComposition(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDCons.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDCons.cxx
index 160aa5f0f45c..d81e260cebb5 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDCons.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDCons.cxx
@@ -1,23 +1,17 @@
 /*
-  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 "AGDDModel/AGDDCons.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDCons::CreateSolid() 
+void AGDDCons::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateCons(this);
-
+	builder.CreateCons(this);
 }
-void AGDDCons::CreateVolume() 
+void AGDDCons::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDElcyl.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDElcyl.cxx
index 50ebf93b0880..ea77452fd0ba 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDElcyl.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDElcyl.cxx
@@ -1,22 +1,17 @@
 /*
-  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 "AGDDModel/AGDDElcyl.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDElcyl::CreateSolid() 
+void AGDDElcyl::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateElcyl(this);
+	builder.CreateElcyl(this);
 }
-void AGDDElcyl::CreateVolume() 
+void AGDDElcyl::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
-	builder->CreateVolume(this);
+	CreateSolid (builder);
+	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDGvxy.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDGvxy.cxx
index 8cc51af20aa3..83218fc8e425 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDGvxy.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDGvxy.cxx
@@ -1,24 +1,19 @@
 /*
-  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 "AGDDModel/AGDDGvxy.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDGvxy::CreateSolid() 
+void AGDDGvxy::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateGvxy(this);
+	builder.CreateGvxy(this);
 }
 
 
-void AGDDGvxy::CreateVolume() 
+void AGDDGvxy::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDIBeam.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDIBeam.cxx
index 1f5b52a42e8b..cc1c5228dd36 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDIBeam.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDIBeam.cxx
@@ -1,23 +1,18 @@
 /*
-  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 "AGDDModel/AGDDIbeam.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDIbeam::CreateSolid() 
+void AGDDIbeam::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateIbeam(this);
+	builder.CreateIbeam(this);
 }
 
-void AGDDIbeam::CreateVolume() 
+void AGDDIbeam::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDIntersection.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDIntersection.cxx
index 61fa7d466444..f200425b6391 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDIntersection.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDIntersection.cxx
@@ -1,24 +1,19 @@
 /*
-  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 "AGDDModel/AGDDIntersection.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDIntersection::CreateSolid() 
+void AGDDIntersection::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateIntersection(this);
+	builder.CreateIntersection(this);
 }
 
 
-void AGDDIntersection::CreateVolume() 
+void AGDDIntersection::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDPcon.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDPcon.cxx
index b7a9943f5894..ae9ed6882e64 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDPcon.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDPcon.cxx
@@ -1,23 +1,18 @@
 /*
-  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 "AGDDModel/AGDDPcon.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDPcon::CreateSolid() 
+void AGDDPcon::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreatePcon(this);
+	builder.CreatePcon(this);
 }
 
-void AGDDPcon::CreateVolume() 
+void AGDDPcon::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDPgon.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDPgon.cxx
index f042ec660e32..21ae1522c4ff 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDPgon.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDPgon.cxx
@@ -1,23 +1,18 @@
 /*
-  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 "AGDDModel/AGDDPgon.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDPgon::CreateSolid() 
+void AGDDPgon::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreatePgon(this);
+	builder.CreatePgon(this);
 }
 
-void AGDDPgon::CreateVolume() 
+void AGDDPgon::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDSnake.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDSnake.cxx
index 47101d2cfe03..deaec2d1f4cd 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDSnake.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDSnake.cxx
@@ -1,24 +1,19 @@
 /*
-  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 "AGDDModel/AGDDSnake.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDSnake::CreateSolid() 
+void AGDDSnake::CreateSolid (const AGDDBuilder& builder) 
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateSnake(this);
+	builder.CreateSnake(this);
 }
 
 
-void AGDDSnake::CreateVolume() 
+void AGDDSnake::CreateVolume (const AGDDBuilder& builder) 
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDSubtraction.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDSubtraction.cxx
index de2ff3ee379c..2ae6f156b9ed 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDSubtraction.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDSubtraction.cxx
@@ -1,24 +1,19 @@
 /*
-  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 "AGDDModel/AGDDSubtraction.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDSubtraction::CreateSolid() 
+void AGDDSubtraction::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateSubtraction(this);
+	builder.CreateSubtraction(this);
 }
 
 
-void AGDDSubtraction::CreateVolume() 
+void AGDDSubtraction::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDTrd.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDTrd.cxx
index 24705030de2b..7b4a117ed5b8 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDTrd.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDTrd.cxx
@@ -1,23 +1,18 @@
 /*
-  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 "AGDDModel/AGDDTrd.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDTrd::CreateSolid() 
+void AGDDTrd::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateTrd(this);
+	builder.CreateTrd(this);
 }
 
-void AGDDTrd::CreateVolume() 
+void AGDDTrd::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDTubs.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDTubs.cxx
index 9f4a6e005bc4..93905c3bdc20 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDTubs.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDTubs.cxx
@@ -1,22 +1,17 @@
 /*
-  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 "AGDDModel/AGDDTubs.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDTubs::CreateSolid() 
+void AGDDTubs::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateTubs(this);
+	builder.CreateTubs(this);
 }
-void AGDDTubs::CreateVolume() 
+void AGDDTubs::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
-	builder->CreateVolume(this);
+	CreateSolid (builder);
+	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDUBeam.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDUBeam.cxx
index ec28f37a6c17..06b5288e9419 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDUBeam.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDUBeam.cxx
@@ -1,23 +1,18 @@
 /*
-  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 "AGDDModel/AGDDUbeam.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDUbeam::CreateSolid() 
+void AGDDUbeam::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateUbeam(this);
+	builder.CreateUbeam(this);
 }
 
-void AGDDUbeam::CreateVolume() 
+void AGDDUbeam::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/DetectorDescription/AGDD/AGDDModel/src/AGDDUnion.cxx b/DetectorDescription/AGDD/AGDDModel/src/AGDDUnion.cxx
index 041614c9461e..ffeeb4b79c9f 100644
--- a/DetectorDescription/AGDD/AGDDModel/src/AGDDUnion.cxx
+++ b/DetectorDescription/AGDD/AGDDModel/src/AGDDUnion.cxx
@@ -1,23 +1,18 @@
 /*
-  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 "AGDDModel/AGDDUnion.h"
 #include "AGDDKernel/AGDDBuilder.h"
 
-void AGDDUnion::CreateSolid() 
+void AGDDUnion::CreateSolid (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	builder->CreateUnion(this);
+	builder.CreateUnion(this);
 }
 
-void AGDDUnion::CreateVolume() 
+void AGDDUnion::CreateVolume (const AGDDBuilder& builder)
 {
-	AGDDBuilder* builder=AGDDBuilder::CurrentBuilder();
-
-	CreateSolid();
-
- 	builder->CreateVolume(this);
+	CreateSolid (builder);
+ 	builder.CreateVolume(this);
 }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMMSpacer.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMMSpacer.h
index 125029ef54b9..d608656d66ca 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMMSpacer.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMMSpacer.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
 */
 
 #ifndef AGDDMMSpacer_H
@@ -14,8 +14,8 @@ class GeoMaterial;
 
 class AGDDMMSpacer: public AGDDVolume {
 public:
-	AGDDMMSpacer(std::string s):AGDDVolume(s),m_small_x(0),m_large_x(0),m_y(0),m_z(0) {}
-	void SetXYZ(std::vector<double> v) 
+	AGDDMMSpacer(const std::string& s):AGDDVolume(s),m_small_x(0),m_large_x(0),m_y(0),m_z(0) {}
+	void SetXYZ(const std::vector<double>& v) 
 	{
 		m_small_x=v[0];
 		m_large_x=v[1];
@@ -26,13 +26,13 @@ public:
 	void large_x(double x) {m_large_x=x;}
 	void y(double yval) {m_y=yval;}
 	void z(double zval) {m_z=zval;}
-	double small_x() {return m_small_x;}
-	double large_x() {return m_large_x;}
-	double y() {return m_y;}
-	double z() {return m_z;}
+	double small_x() const {return m_small_x;}
+	double large_x() const {return m_large_x;}
+	double y() const {return m_y;}
+	double z() const {return m_z;}
 	std::string tech;
-	void CreateVolume();
-	void CreateSolid();
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 private:
 	double m_small_x;
 	double m_large_x;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMicromegas.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMicromegas.h
index cba26ff377c1..60a6da2164ce 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMicromegas.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMicromegas.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 AGDDMicromegas_H
@@ -15,10 +15,10 @@
 
 class AGDDMicromegas: public MMDetectorDescription, public AGDDVolume {
 public:
-    AGDDMicromegas(std::string s);
+    AGDDMicromegas(const std::string& s);
 
-	void CreateVolume();
-	void CreateSolid();
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 
 private:
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMuonStation.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMuonStation.h
index 5525ac8000fc..68198152671c 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMuonStation.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDMuonStation.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
 */
 
 #ifndef AGDDMuonStation_H
@@ -14,8 +14,8 @@ class GeoMaterial;
 
 class AGDDMuonStation: public AGDDVolume {
 public:
-	AGDDMuonStation(std::string s):AGDDVolume(s),m_small_x(0),m_large_x(0),m_y(0),m_z(0) {}
-	void SetXYZ(std::vector<double> v) 
+	AGDDMuonStation(const std::string& s):AGDDVolume(s),m_small_x(0),m_large_x(0),m_y(0),m_z(0) {}
+	void SetXYZ(const std::vector<double>& v) 
 	{
 		m_small_x=v[0];
 		m_large_x=v[1];
@@ -26,19 +26,19 @@ public:
 	void large_x(double x) {m_large_x=x;}
 	void y(double yval) {m_y=yval;}
 	void z(double zval) {m_z=zval;}
-	double small_x() {return m_small_x;}
-	double large_x() {return m_large_x;}
-	double y() {return m_y;}
-	double z() {return m_z;}
-	void CreateVolume();
-	void CreateSolid();
+	double small_x() const {return m_small_x;}
+	double large_x() const {return m_large_x;}
+	double y() const {return m_y;}
+	double z() const {return m_z;}
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 private:
 	double m_small_x;
 	double m_large_x;
 	double m_y;
 	double m_z;
 	
-        const GeoMaterial* GetMMMaterial(std::string);
+        const GeoMaterial* GetMMMaterial(const std::string&) const;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDsTGC.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDsTGC.h
index 8892be187fe7..7c78f5240989 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDsTGC.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/AGDDsTGC.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 AGDDsTGC_H
@@ -15,10 +15,10 @@
 
 class AGDDsTGC: public sTGCDetectorDescription, public AGDDVolume {
 public:
-    AGDDsTGC(std::string s);
+    AGDDsTGC(const std::string& s);
 
-	void CreateVolume();
-	void CreateSolid();
+        virtual void CreateVolume (const AGDDBuilder& builder) override;
+	virtual void CreateSolid (const AGDDBuilder& builder) override;
 
 private:
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMMSpacer.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMMSpacer.cxx
index dc8312d152e9..02e64e87d829 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMMSpacer.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMMSpacer.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
 */
 
 
@@ -20,12 +20,12 @@
 #include "MuonGeoModel/MMSpacerComponent.h"
 #include "MuonGeoModel/MMSpacer.h"
 
-void AGDDMMSpacer::CreateSolid() 
+void AGDDMMSpacer::CreateSolid (const AGDDBuilder& /*builder*/)
 {
 //	std::cout<<"this is AGDDMMSpacer::CreateSolid()"<<std::endl;
 }
 
-void AGDDMMSpacer::CreateVolume() 
+void AGDDMMSpacer::CreateVolume (const AGDDBuilder& builder)
 {
 //    std::cout<<"this is AGDDMMSpacer::CreateVolume()"<<std::endl;
 	
@@ -38,7 +38,7 @@ void AGDDMMSpacer::CreateVolume()
 	MuonGM::MMSpacer cham(mm_comp);
 	GeoPhysVol *vvv=cham.build(1);
 
-	CreateSolid();
+	CreateSolid (builder);
 
 	if (!GetVolume())
 	{
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMicromegas.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMicromegas.cxx
index f1c0bfd5e4d7..a5b603bfc794 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMicromegas.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMicromegas.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 "MuonAGDDBase/AGDDMicromegas.h"
@@ -26,14 +26,14 @@
 
 using MuonGM::MYSQL;
 
-AGDDMicromegas::AGDDMicromegas(std::string s): 
+AGDDMicromegas::AGDDMicromegas(const std::string& s): 
 	MMDetectorDescription(s),AGDDVolume(s,true)
 {
 	s_current=this;
 	Register();
 }
 
-void AGDDMicromegas::CreateSolid() 
+void AGDDMicromegas::CreateSolid (const AGDDBuilder& /*builder*/)
 {
 //	std::cout<<"this is AGDDMicromegas::CreateSolid()"<<std::endl;
 //	void *p=GetSolid();
@@ -47,7 +47,7 @@ void AGDDMicromegas::CreateSolid()
 
 }
 
-void AGDDMicromegas::CreateVolume() 
+void AGDDMicromegas::CreateVolume (const AGDDBuilder& builder)
 {
 //    std::cout<<"this is AGDDMicromegas::CreateVolume()"<<std::endl;
 	
@@ -61,7 +61,7 @@ void AGDDMicromegas::CreateVolume()
 	MuonGM::Micromegas *cham=new MuonGM::Micromegas(mm_comp);
 	GeoPhysVol *vvv=(GeoPhysVol*)cham->build(1);
 
-	CreateSolid();
+	CreateSolid (builder);
 
 	if (!GetVolume())
 	{
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMuonStation.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMuonStation.cxx
index c33b93bbf26e..b3245684b94f 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMuonStation.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDMuonStation.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
 */
 
 
@@ -16,7 +16,7 @@
 #include "GaudiKernel/Bootstrap.h"
 #include "GeoModelInterfaces/StoredMaterialManager.h"
 
-void AGDDMuonStation::CreateSolid() 
+void AGDDMuonStation::CreateSolid (const AGDDBuilder& /*builder*/)
 {
 	std::cout<<"this is AGDDMuonStation::CreateSolid()"<<std::endl;
 	void *p=GetSolid();
@@ -29,7 +29,7 @@ void AGDDMuonStation::CreateSolid()
 	}
 }
 
-void AGDDMuonStation::CreateVolume() 
+void AGDDMuonStation::CreateVolume (const AGDDBuilder& builder)
 {
     std::cout<<"this is AGDDMuonStation::CreateVolume()"<<std::endl;
 	static int ifirst=1;
@@ -41,7 +41,7 @@ void AGDDMuonStation::CreateVolume()
 		if (!air) std::cout<<" Air not found!"<<std::endl;
 	}
 
-	CreateSolid();
+	CreateSolid (builder);
 
 	if (!GetVolume())
 	{
@@ -55,7 +55,7 @@ void AGDDMuonStation::CreateVolume()
 	}
 }
 
-const GeoMaterial* AGDDMuonStation::GetMMMaterial(std::string name)
+const GeoMaterial* AGDDMuonStation::GetMMMaterial(const std::string& name) const
 {
 	StoreGateSvc* pDetStore=0;
 	ISvcLocator* svcLocator = Gaudi::svcLocator();
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDsTGC.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDsTGC.cxx
index 783c8d6ab4c6..c39afddec11f 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDsTGC.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/AGDDsTGC.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
 */
 
 
@@ -30,19 +30,19 @@
 using MuonGM::MYSQL;
 
 
-AGDDsTGC::AGDDsTGC(std::string s):
+AGDDsTGC::AGDDsTGC(const std::string& s):
     sTGCDetectorDescription(s),AGDDVolume(s,true)
 {
     s_current=this;
     Register();
 }
 
-void AGDDsTGC::CreateSolid() 
+void AGDDsTGC::CreateSolid (const AGDDBuilder& /*builder*/)
 {
 
 }
 
-void AGDDsTGC::CreateVolume() 
+void AGDDsTGC::CreateVolume (const AGDDBuilder& builder)
 {
 	
 	MuonGM::sTGCComponent *stgc_comp=new MuonGM::sTGCComponent;
@@ -57,7 +57,7 @@ void AGDDsTGC::CreateVolume()
 	MuonGM::sTGC *cham=new MuonGM::sTGC(stgc_comp);
 	GeoPhysVol *vvv=(GeoPhysVol*)cham->build(1);
 
-	CreateSolid();
+	CreateSolid (builder);
 
 	if (!GetVolume())
 	{
-- 
GitLab


From 8a4c55e2be91606a171dd66b740b5136f8d8b76e Mon Sep 17 00:00:00 2001
From: Joao Victor Da Fonseca Pinto <joao.victor.da.fonseca.pinto@cern.ch>
Date: Fri, 17 Sep 2021 19:33:20 +0200
Subject: [PATCH 185/347] Add monitoring tool for Zee, Jpsiee and Heg chains

---
 .../python/TrigEgammaMonitCategoryMT.py       |  31 +++
 .../python/TrigEgammaMonitorAlgorithm.py      |   4 +-
 .../python/TrigEgammaMonitoringMTConfig.py    |  74 ++++++-
 .../src/TrigEgammaMonitorBaseAlgorithm.cxx    |  98 ++++-----
 .../src/TrigEgammaMonitorBaseAlgorithm.h      |  31 ++-
 .../TrigEgammaMonitorElectronAlgorithm.cxx    |   2 +-
 .../src/TrigEgammaMonitorPhotonAlgorithm.cxx  |   3 +-
 .../TrigEgammaMonitorTagAndProbeAlgorithm.cxx |  22 +-
 .../src/TrigEgammaMonitorTopoAlgorithm.cxx    | 205 ++++++++++++++++++
 .../src/TrigEgammaMonitorTopoAlgorithm.h      |  55 +++++
 .../src/components/.__afs533D                 |   5 -
 .../TrigEgammaMonitoring_entries.cxx          |   9 +
 12 files changed, 438 insertions(+), 101 deletions(-)
 create mode 100644 Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.cxx
 create mode 100644 Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.h
 delete mode 100644 Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/.__afs533D

diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategoryMT.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategoryMT.py
index 9f6f78e0a7d4..bb1117870ec7 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategoryMT.py
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitCategoryMT.py
@@ -30,6 +30,11 @@ monitoringTP_electron = [
         'HLT_e26_lhtight_ivarmedium_L1EM22VHI',
         ]
 
+
+
+
+
+
 validation_photon = [
         'HLT_g20_loose_L1EM15VHI',
         'HLT_g20_medium_L1EM15VHI',
@@ -96,3 +101,29 @@ validation_Zee = [
 single_electron_triggers = set(monitoring_electron + monitoringTP_electron + validation_electron + validationTP_electron)
 single_photon_triggers = set(monitoring_photon + validation_photon)
 
+
+
+#
+# Topo chains
+#
+
+topo_config = {
+                    'Zee'   : {'mass':(50 , 130) , 'dphi':(1.5,   5) },
+                    'Jpsiee': {'mass':( 1 ,   5) , 'dphi':(1.5,   5) },
+                    'Heg'   : {'mass':(90 , 140) , 'dphi':(1.5,   5) },
+              }
+
+monitoring_topo = [
+
+        # HLT_e26_lhtight_e15_etcut_Zee_L1EM22VHI
+        {# leg0 e26_lhtight, leg1 e15_etcut
+          "trigger_num" : "HLT_e26_lhtight_e15_etcut_Zee_L1EM22VHI",
+          "trigger_den" : "HLT_e26_lhtight_e15_etcut_L1EM22VHI",
+          "leg0_key"    : "Electrons", # HLT/Offline key
+          "leg1_key"    : "Electrons", # HLT/Offline key
+          "topo"        : "Zee",
+        },
+
+        ]
+
+
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py
index fdd0f1f700e7..d7b0517fb41c 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitorAlgorithm.py
@@ -66,7 +66,7 @@ if __name__=='__main__':
     # Set the Athena configuration flags
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
-    path = '/afs/cern.ch/work/j/jodafons/public/valid_sampleA/valid1.361106.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zee.recon.AOD.e5112_s3214_d1606_r12262_tid23444302_00/AOD.23444302._000098.pool.root.1'
+    path = '/afs/cern.ch/work/j/jodafons/public/valid_sampleA/valid1.361106.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zee.recon.AOD.e5112_s3214_d1664_r12816_tid26220709_00/AOD.26220709._000003.pool.root.1'
 
     ConfigFlags.Input.Files = [path]
     ConfigFlags.Input.isMC = True
@@ -89,4 +89,4 @@ if __name__=='__main__':
     #trigEgammaMonitorAcc.getEventAlgo('TrigEgammaMonAlg').OutputLevel = 2 # DEBUG
     cfg.printConfig(withDetails=False) # set True for exhaustive info
 
-    cfg.run(10) #use cfg.run(20) to only run on first 20 events
+    cfg.run(20) #use cfg.run(20) to only run on first 20 events
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringMTConfig.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringMTConfig.py
index 7aea6893125b..c4aa83470302 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringMTConfig.py
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/TrigEgammaMonitoringMTConfig.py
@@ -43,6 +43,7 @@ class TrigEgammaMonAlgBuilder:
   activate_photon = False
   activate_zee = False
   activate_jpsiee = False
+  activate_topo = False
   tagItems = []
   jpsitagItems = []
   electronList = []
@@ -94,6 +95,7 @@ class TrigEgammaMonAlgBuilder:
         self.activate_jpsiee=True 
         self.activate_electron=True
         self.activate_photon=True
+        self.activate_topo= True
     elif self.HI_mode or self.pPb_mode or self.cosmic_mode:
       self.activate_electron=True
       self.activate_photon=True
@@ -165,13 +167,14 @@ class TrigEgammaMonAlgBuilder:
 
   def setDefaultProperties(self):
    
-    from TrigEgammaMonitoring.TrigEgammaMonitCategoryMT import monitoring_photon, monitoring_electron, monitoringTP_electron,validation_photon , validation_electron, validationTP_electron, validation_jpsi, validationTP_jpsiee, validation_Zee
+    from TrigEgammaMonitoring.TrigEgammaMonitCategoryMT import monitoring_photon, monitoring_electron, monitoringTP_electron, monitoring_topo, validation_photon , validation_electron, validationTP_electron, validation_jpsi, validationTP_jpsiee, validation_Zee
     
     if self.pp_mode:
         self.electronList = monitoring_electron
         self.photonList   = monitoring_photon
         self.tpList       = monitoringTP_electron
         self.tagItems     = [] # monitoring_tags
+        self.topoList     = monitoring_topo
     elif self.mc_mode:
         self.electronList = validation_electron + validation_Zee
         self.photonList   = validation_photon
@@ -179,8 +182,9 @@ class TrigEgammaMonAlgBuilder:
         self.jpsiList     = validation_jpsi
         self.jpsitagItems = validationTP_jpsiee
         self.tagItems     = [] #monitoring_tags    
+        self.topoList     = monitoring_topo
+
 
- 
   #
   # Create all minitor algorithms
   #
@@ -388,12 +392,13 @@ class TrigEgammaMonAlgBuilder:
       self.elMonAlg.ForceEtThreshold=True
       self.elMonAlg.TriggerList=self.electronList
       self.elMonAlg.DetailedHistograms=self.detailedHistograms
+      self.elMonAlg.DoEmulation = False
+
       if self.emulator:
         self.elMonAlg.DoEmulation = True
         self.emulator.TriggerList += self.electronList
         self.elMonAlg.EmulationTool = self.emulator.core()
-      else:
-        self.elMonAlg.DoEmulation = False
+        
 
     if self.activate_photon:
 
@@ -408,15 +413,33 @@ class TrigEgammaMonAlgBuilder:
       self.phMonAlg.TriggerList=self.photonList
       self.phMonAlg.DetailedHistograms=self.detailedHistograms
       self.phMonAlg.ForcePidSelection=True
+      self.phMonAlg.DoEmulation = False
+
       if self.emulator:
         self.phMonAlg.DoEmulation = True
         self.emulator.TriggerList += self.photonList
         self.phMonAlg.EmulationTool = self.emulator.core()
-      else:
-        self.phMonAlg.DoEmulation = False
 
 
 
+    if self.activate_topo:
+
+      self.__logger.info( "Creating the combo monitor algorithm...")
+      self.topoMonAlg = self.helper.addAlgorithm( CompFactory.TrigEgammaMonitorTopoAlgorithm, "TrigEgammaMonitorTopoAlgorithm" )
+      self.topoMonAlg.MatchTool = EgammaMatchTool
+      self.topoMonAlg.ElectronKey = 'Electrons'
+      self.topoMonAlg.PhotonKey = 'Photons'
+      self.topoMonAlg.isEMResultNames=self.isemnames
+      self.topoMonAlg.LHResultNames=self.lhnames
+      self.topoMonAlg.DNNResultNames=self.dnnnames
+      self.topoMonAlg.ElectronIsEMSelector =[TightElectronSelector,MediumElectronSelector,LooseElectronSelector]
+      self.topoMonAlg.ElectronLikelihoodTool =[TightLHSelector,MediumLHSelector,LooseLHSelector]
+      self.topoMonAlg.DetailedHistograms=self.detailedHistograms
+      self.topoMonAlg.TriggerListConfig  = self.topoList # this is a list of dicts
+
+      
+
+
   
   def configureHistograms(self):
     
@@ -447,6 +470,12 @@ class TrigEgammaMonAlgBuilder:
     if self.activate_photon:
       self.bookExpertHistograms( self.phMonAlg, self.phMonAlg.TriggerList )
   
+
+    # configure topo chains
+    if self.activate_topo:
+      self.bookTopoHistograms( self.topoMonAlg, self.topoMonAlg.TriggerListConfig )
+
+
   # If we've already defined the group, return the object already defined
   @functools.lru_cache(None)
   def addGroup( self, monAlg, name, path ):
@@ -992,8 +1021,39 @@ class TrigEgammaMonAlgBuilder:
 
 
 
+  def bookTopoHistograms(self, monAlg, trigger_configs ):
+    
+    from TrigEgammaMonitoring.TrigEgammaMonitorHelper import TH1F, TProfile
+    from TrigEgammaMonitoring.TrigEgammaMonitCategoryMT import topo_config
+  
 
-
+    for d in trigger_configs:
+
+      trigger = d['trigger_num']
+
+      if not d['topo'] in topo_config.keys():
+        self.__logger.fatal("Mon combo tool only support Zee, Jpsiee, Heg trigger. Current chain is %s", trigger)
+
+      monGroup_on  = self.addGroup( monAlg, trigger+'_Efficiency_HLT', self.basePath+'/'+trigger+'/Efficiency/HLT' )
+      monGroup_off = self.addGroup( monAlg, trigger+'_Efficiency_Offline', self.basePath+'/'+trigger+'/Efficiency/Offline' )
+
+      xmin = topo_config[d['topo']]['mass'][0]
+      xmax = topo_config[d['topo']]['mass'][1]
+      self.addHistogram(monGroup_on, TH1F("mass", "Online M(ee); m_ee [GeV] ; Count", 50, xmin, xmax))
+      self.addHistogram(monGroup_on, TH1F("match_mass", "Online M(ee); m_ee [GeV] ; Count", 50, xmin, xmax))
+      self.addHistogram(monGroup_on, TProfile("mass,match_mass", "Online #epsilon(M(ee)); m_ee; #epsilon(M(ee))", 50, xmin, xmax))
+      self.addHistogram(monGroup_off, TH1F("mass", "Offline M(ee); m_ee [GeV] ; Count", 50, xmin, xmax))
+      self.addHistogram(monGroup_off, TH1F("match_mass", "Offline M(ee); m_ee [GeV] ; Count", 50, xmin, xmax))
+      self.addHistogram(monGroup_off, TProfile("mass,match_mass", "Offline #epsilon(M(ee)); p_{T} ; #epsilon(M(ee))", 50, xmin, xmax))
+
+      xmin = topo_config[d['topo']]['dphi'][0]
+      xmax = topo_config[d['topo']]['dphi'][1]
+      self.addHistogram(monGroup_on, TH1F("dphi", "Online #Delta#phi; #Delte#phi; Count", 50, xmin, xmax))
+      self.addHistogram(monGroup_on, TH1F("match_dphi", "Online #Delta#phi; #Delte#phi; Count", 50, xmin, xmax))
+      self.addHistogram(monGroup_on, TProfile("dphi,match_dphi", "Online #epsilon(#Delta#phi); #Delta#phi; #epsilon(#Delta#phi)", 50, xmin, xmax))
+      self.addHistogram(monGroup_off, TH1F("dphi", "Offline #Delta#phi; #Delte#phi; Count", 50, xmin, xmax))
+      self.addHistogram(monGroup_off, TH1F("match_dphi", "Offline #Delta#phi; #Delte#phi; Count", 50, xmin, xmax))
+      self.addHistogram(monGroup_off, TProfile("dphi,match_dphi", "Offline #epsilon(#Delta#phi); #Delta#phi; #epsilon(#Delta#phi)", 50, xmin, xmax))
 
 
   #
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorBaseAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorBaseAlgorithm.cxx
index d31fab222aa7..6a1ade063afe 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorBaseAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorBaseAlgorithm.cxx
@@ -31,10 +31,11 @@ StatusCode TrigEgammaMonitorBaseAlgorithm::initialize()
   ATH_CHECK(m_electronIsEMTool.retrieve());
   ATH_CHECK(m_electronLHTool.retrieve());
   ATH_CHECK(m_electronDNNTool.retrieve());
-
   for(const auto& cut:m_trigLevel)
     m_accept.addCut(cut,cut);
 
+
+
   return StatusCode::SUCCESS;
 }
 
@@ -629,59 +630,6 @@ void TrigEgammaMonitorBaseAlgorithm::setTrigInfo(const std::string& trigger){
 
 
 
-bool TrigEgammaMonitorBaseAlgorithm::splitTriggerName(const std::string& trigger, 
-                                                  std::string &p1trigger, 
-                                                  std::string &p2trigger) const {
-
-  p1trigger="";
-  p2trigger="";
-
-  std::string hltinfo=trigger;
-  if(boost::contains(hltinfo,"HLT")) hltinfo.erase(0,4);
-  std::vector<std::string> strs;
-  boost::split(strs,hltinfo,boost::is_any_of("_"));
-
-  if((strs.at(0))[0]=='2'){
-    ((p1trigger+=("HLT_"+((strs.at(0)).substr(1,(int)strs.at(0).find_last_of(strs.at(0)))))+="_"));
-
-    for(unsigned int i=1; i<strs.size();i++){
-      if(strs.at(i)=="Jpsiee") continue;
-      (p1trigger+="_")+=strs.at(i);
-    }
-
-    p2trigger=p1trigger;
-    return true;
-  }
-  else{
-
-    if(strs.size()<4){
-      return false;
-    }
-
-    int index=-1;
-    p1trigger+=("HLT_"+strs.at(0));
-
-    for(int i=1; index<0;i++)
-      {
-        (p1trigger+="_")+=strs.at(i);
-
-        if(strs.at(i+1)[0]=='e' || strs.at(i+1)[0]=='g') index=(i+1);
-      }
-
-    p2trigger+=("HLT_"+strs.at(index));
-
-    for(unsigned int i=index+1; i< strs.size();i++){
-      if(strs.at(i)=="Jpsiee") continue;
-      (p2trigger+="_")+=strs.at(i);
-    }
-    return true;
-  }
-
-
-}
-
-
-
 void TrigEgammaMonitorBaseAlgorithm::parseTriggerName(const std::string& trigger, 
                                                   const std::string& defaultPid,
                                                   bool &isL1,
@@ -748,7 +696,6 @@ void TrigEgammaMonitorBaseAlgorithm::parseTriggerName(const std::string& trigger
         }
 
         //Get the L1 information
-
         if(boost::contains(strs.back(),"L1")){
             std::string l1info = strs.back();
             l1info.erase(0,4);
@@ -791,17 +738,17 @@ std::string TrigEgammaMonitorBaseAlgorithm::getL1Item(const std::string& trigger
 }
 
 
+bool TrigEgammaMonitorBaseAlgorithm::isHLTTruncated() const {
+    return m_trigdec->ExperimentalAndExpertMethods().isHLTTruncated();
+}
+
+
 
 
 
 const std::vector<std::string> TrigEgammaMonitorBaseAlgorithm::m_trigLevel = {"L1Calo","L2Calo","L2","EFCalo","EFTrack","HLT"};
 
-const std::map<std::string,std::string> TrigEgammaMonitorBaseAlgorithm::m_trigLvlMap = {{"L1Calo","Trigger L1Calo step"},
-                                                                                        {"L2Calo","Trigger L2Calo step"},
-                                                                                        {"L2","Trigger L2 step"},
-                                                                                        {"EFCalo","Trigger EFCalo step"},
-                                                                                        {"EFTrack","Trigger EFTrack step"},
-                                                                                        {"HLT","Trigger HLT accept"}};
+
 
 const std::map<std::string, std::string> TrigEgammaMonitorBaseAlgorithm::m_pidMap = { {"vloose"   , "loose"   },
                                                                                       {"loose"    , "loose"   },
@@ -818,5 +765,34 @@ const std::map<std::string, std::string> TrigEgammaMonitorBaseAlgorithm::m_pidMa
                                                                                       {"dnnmedium" , "dnnmedium"},
                                                                                       {"dnntight"  , "dnntight" } };
 
+//!=============================================================================
+
+// Define the parser
+#include "GaudiKernel/ParsersFactory.h"
 
+namespace Gaudi
+{
+  namespace Parsers
+  {
+    // Parse function... nothing special, but it must be done explicitely.
+    StatusCode parse( VecDict_t& result, const std::string& input ) { return parse_( result, input ); }
+  }
+}
+
+// We also need to be able to print an object of our type as a string that both
+// Python and our parser can understand,
+#include "GaudiKernel/ToStream.h"
+namespace std
+{
+  // This is an example valid for any mapping type.
+  ostream& operator<<( ostream& s, const Gaudi::Parsers::VecDict_t& vecDict )
+  {
+    s << '{';
+    for ( const auto& dict : vecDict ) {
+      Gaudi::Utils::toStream( dict, s );
+    }
+    s << '}';
+    return s;
+  }
+}
 
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorBaseAlgorithm.h b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorBaseAlgorithm.h
index ded311cdda76..7a3bd1d92e2a 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorBaseAlgorithm.h
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorBaseAlgorithm.h
@@ -55,6 +55,8 @@ typedef struct _triginfo
     bool isLRT; // LRT chain
 } TrigInfo;
 
+
+
 class TrigEgammaMonitorBaseAlgorithm : public AthMonitorAlgorithm {
 
   public:
@@ -78,7 +80,7 @@ class TrigEgammaMonitorBaseAlgorithm : public AthMonitorAlgorithm {
  
 
     static const std::vector<std::string> m_trigLevel;
-    static const std::map<std::string,std::string> m_trigLvlMap;
+    //static const std::map<std::string,std::string> m_trigLvlMap;
     static const std::map<std::string, std::string> m_pidMap;
 
 
@@ -132,14 +134,12 @@ class TrigEgammaMonitorBaseAlgorithm : public AthMonitorAlgorithm {
     const ToolHandle<TrigEgammaMatchingToolMT>& match() const {return m_matchTool;}
     /*! Set the accept object for all trigger levels */
     asg::AcceptData setAccept(const TrigCompositeUtils::Decision*, const TrigInfo&) const;
-    /*! Get the trigger info parsed from the chain name */
+    /*! Get the trigger info parsed from the chain name (only single lepton triggers) */
     TrigInfo getTrigInfo(const std::string&) const;
     /*! Get delta R */
     float dR(const float, const float, const float, const float) const;
-    /*! Simple setter to pick up correct probe PID for given trigger */
+    /*! Simple setter to pick up correct probe PID for given trigger (only single lepton triggers) */
     void parseTriggerName(const std::string&,const std::string&, bool&, std::string &,float &, float &, std::string &,std::string &, bool&, bool&) const;
-    /*! Split double object trigger in two simple object trigger */
-    bool splitTriggerName(const std::string&, std::string &, std::string &) const;
     /*! Creates static map to return L1 item from trigger name */
     std::string getL1Item(const std::string& trigger) const;
     /*! Check if electron fulfils isolation criteria */
@@ -150,8 +150,9 @@ class TrigEgammaMonitorBaseAlgorithm : public AthMonitorAlgorithm {
     std::string getProbePid(const std::string&) const;
     /*! Set the trigger info parsed from the chain name */
     void setTrigInfo(const std::string&);
-    
-    
+    /*! */
+    bool isHLTTruncated() const;
+   
   
     /** Features helper **/
    
@@ -281,10 +282,24 @@ class TrigEgammaMonitorBaseAlgorithm : public AthMonitorAlgorithm {
       GETTER(deltaPhiRescaled3)
 #undef GETTER
 
+};
 
 
 
+namespace Gaudi
+{
+  namespace Parsers
+  {
+    typedef std::map<std::string, std::string> Dict_t;
+
+    // A typedef may save a lot of mistakes
+    typedef std::vector<Dict_t> VecDict_t;
+
+    // Parse function... nothing special, but it must be done explicitely.
+    StatusCode parse( VecDict_t & result, const std::string& input );
+  }
+}
+
 
-};
 #endif
 
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorElectronAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorElectronAlgorithm.cxx
index 5a7875483fc3..a48a52c5907c 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorElectronAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorElectronAlgorithm.cxx
@@ -43,7 +43,7 @@ StatusCode TrigEgammaMonitorElectronAlgorithm::fillHistograms( const EventContex
 
     ATH_MSG_DEBUG("Executing TrigEgammaMonitorElectronAlgorithm");
 
-    if(tdt()->ExperimentalAndExpertMethods().isHLTTruncated()){
+    if(isHLTTruncated()){
         ATH_MSG_WARNING("HLTResult truncated, skip trigger analysis");
         return StatusCode::SUCCESS; 
     }
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorPhotonAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorPhotonAlgorithm.cxx
index 123d946fb31c..c5242d1b5a10 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorPhotonAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorPhotonAlgorithm.cxx
@@ -46,7 +46,7 @@ StatusCode TrigEgammaMonitorPhotonAlgorithm::fillHistograms( const EventContext&
     ATH_MSG_DEBUG("Executing TrigEgammaMonitorPhotonAlgorithm");
 
 
-    if(tdt()->ExperimentalAndExpertMethods().isHLTTruncated()){
+    if(isHLTTruncated()){
         ATH_MSG_WARNING("HLTResult truncated, skip trigger analysis");
         return StatusCode::SUCCESS; 
     }
@@ -73,6 +73,7 @@ StatusCode TrigEgammaMonitorPhotonAlgorithm::fillHistograms( const EventContext&
         for (const auto& itr : pairObjs) {
           pairObjsRaw.emplace_back(itr.first.get(), itr.second);
         }
+        
         fillDistributions( pairObjsRaw, info );
         fillEfficiencies( pairObjsRaw, info );
         fillResolutions( pairObjsRaw, info );
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.cxx
index b13003523240..b90583968f78 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTagAndProbeAlgorithm.cxx
@@ -83,7 +83,7 @@ StatusCode TrigEgammaMonitorTagAndProbeAlgorithm::fillHistograms( const EventCon
 
 
     // Check HLTResult
-    if(tdt()->ExperimentalAndExpertMethods().isHLTTruncated()){
+    if(isHLTTruncated()){
         ATH_MSG_WARNING("HLTResult truncated, skip trigger analysis");
         return StatusCode::SUCCESS;
     }
@@ -385,24 +385,14 @@ bool TrigEgammaMonitorTagAndProbeAlgorithm::isTagElectron( const ToolHandle<Gene
     // Check matching to a given trigger
     // The statement below is more general
     bool tagPassed=false;
-    for(unsigned int ilist = 0; ilist != m_tagTrigList.size(); ilist++) {
-      std::string tag = m_tagTrigList[ilist];
+    for( auto& tag : m_tagTrigList){
       if(tdt()->isPassed(tag)){ 
-        if(m_tp){
-          std::string p1trigger;
-          std::string p2trigger;
-          if(splitTriggerName(tag,p1trigger,p2trigger)){
-            if(fabs(p1trigger.find("tight"))<14) tag=p1trigger;
-            if(fabs(p2trigger.find("tight"))<14) tag=p2trigger;
-          }
-          if( match()->isPassed(el,tag) )
-            tagPassed=true;
-        }
-        else{
-          tagPassed=true; 
-        }
+        tagPassed=true;
+        break;
       }
     }
+
+
     if(!tagPassed) {
         ATH_MSG_DEBUG("Failed tag trigger "); 
         return false;
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.cxx
new file mode 100644
index 000000000000..9eb954ac7eca
--- /dev/null
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.cxx
@@ -0,0 +1,205 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigEgammaMonitorTopoAlgorithm.h"
+#include "TrigDecisionTool/FeatureRequestDescriptor.h"
+#include "xAODBase/IParticleContainer.h"
+
+using namespace Trig;
+
+
+TrigEgammaMonitorTopoAlgorithm::TrigEgammaMonitorTopoAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ):
+  TrigEgammaMonitorBaseAlgorithm( name, pSvcLocator )
+{}
+
+//!=========================================================================
+
+TrigEgammaMonitorTopoAlgorithm::~TrigEgammaMonitorTopoAlgorithm()
+{}
+
+//!=========================================================================
+
+StatusCode TrigEgammaMonitorTopoAlgorithm::initialize() 
+{
+  ATH_MSG_INFO("TrigEgammaMonitorTopoAlgorithm::initialize()...");
+  
+  ATH_CHECK(TrigEgammaMonitorBaseAlgorithm::initialize());
+
+  ATH_CHECK(m_offElectronKey.initialize());
+  ATH_CHECK(m_offPhotonKey.initialize());
+
+  return StatusCode::SUCCESS;
+}
+
+//!=========================================================================
+
+StatusCode TrigEgammaMonitorTopoAlgorithm::fillHistograms( const EventContext& ctx ) const  
+{
+
+    ATH_MSG_DEBUG("Executing TrigEgammaMonitorTopoAlgorithm");
+
+    if(isHLTTruncated()){
+        ATH_MSG_WARNING("HLTResult truncated, skip trigger analysis");
+        return StatusCode::SUCCESS; 
+    }
+    
+    // Open the offline electron container
+    SG::ReadHandle<xAOD::ElectronContainer> offElectrons(m_offElectronKey, ctx);
+    SG::ReadHandle<xAOD::PhotonContainer> offPhotons(m_offPhotonKey, ctx);
+
+    if(!offElectrons.isValid())
+    {
+      ATH_MSG_WARNING("Failed to retrieve offline Electrons ");
+      return StatusCode::SUCCESS;
+    }
+
+    if(!offPhotons.isValid())
+    {
+      ATH_MSG_WARNING("Failed to retrieve offline Photons ");
+      return StatusCode::SUCCESS;
+    }
+    
+
+    for ( auto &d : m_trigListConfig)
+    {
+      std::string trigger_num = d.at("trigger_num");
+      std::string trigger_den = d.at("trigger_den");
+
+      auto monGroup_online  = getGroup( trigger_num + "_Efficiency_HLT" );
+      auto monGroup_offline = getGroup( trigger_num + "_Efficiency_Offline" );
+
+      std::vector<float> mass_vec, mass_off_vec, match_mass_vec, match_mass_off_vec;
+      std::vector<float> dphi_vec, dphi_off_vec, match_dphi_vec, match_dphi_off_vec;
+
+      auto mass_col             = Monitored::Collection( "mass"         , mass_vec            );
+      auto mass_off_col         = Monitored::Collection( "mass"         , mass_off_vec        );
+      auto match_mass_col       = Monitored::Collection( "match_mass"   , match_mass_vec      );
+      auto match_mass_off_col   = Monitored::Collection( "match_mass"   , match_mass_off_vec  );
+      auto dphi_col             = Monitored::Collection( "dphi"         , dphi_vec            );
+      auto dphi_off_col         = Monitored::Collection( "dphi"         , dphi_off_vec        );
+      auto match_dphi_col       = Monitored::Collection( "match_dphi"   , match_dphi_vec      );
+      auto match_dphi_off_col   = Monitored::Collection( "match_dphi"   , match_dphi_off_vec  );
+      
+
+      std::vector<Legs> legs_den_vec, legs_num_vec;
+
+      make_legs( trigger_num , d.at("leg0_key"), d.at("leg1_key"), legs_num_vec);
+      make_legs( trigger_den , d.at("leg0_key"), d.at("leg1_key"), legs_den_vec);
+
+      
+      // Fill denominator histograms
+      for (auto &legs : legs_den_vec){
+        // Fill online mass
+        if( legs.leg0 && legs.leg1 ){
+          mass_vec.push_back( (legs.leg0->p4() + legs.leg1->p4()).M() );
+          dphi_vec.push_back( legs.leg0->p4().DeltaPhi(legs.leg1->p4()) );
+
+          const xAOD::IParticle *leg0_off, *leg1_off =nullptr;
+          if( match( *offElectrons, legs.leg0, leg0_off) &&
+              match( *offElectrons, legs.leg1, leg1_off))
+          {
+            if (! (leg0_off == leg1_off)){ // should not be the same electron
+              mass_off_vec.push_back(  (leg0_off->p4() + leg1_off->p4()).M() );
+              dphi_off_vec.push_back( leg0_off->p4().DeltaPhi(leg1_off->p4()) );
+            }
+          }
+        }
+      } // Loop over denominator legs
+
+      
+       // Fill denominator histograms
+      for (auto &legs : legs_num_vec){
+
+        // Fill online mass
+        if( legs.leg0 && legs.leg1 ){
+          match_mass_vec.push_back( (legs.leg0->p4() + legs.leg1->p4()).M() );
+          match_dphi_vec.push_back( legs.leg0->p4().DeltaPhi(legs.leg1->p4()) );
+
+          const xAOD::IParticle *leg0_off, *leg1_off =nullptr;
+          if( match( *offElectrons, legs.leg0, leg0_off) &&
+              match( *offElectrons, legs.leg1, leg1_off))
+          {
+            if (! (leg0_off == leg1_off)){ // should not be the same electron
+              match_mass_off_vec.push_back(  (leg0_off->p4() + leg1_off->p4()).M() );
+              match_dphi_off_vec.push_back( leg0_off->p4().DeltaPhi(leg1_off->p4()) );
+            }
+          }
+        }
+
+      }// Loop over numerator legs
+
+      fill(monGroup_online, mass_col, match_mass_col, dphi_col, match_dphi_col);
+      fill(monGroup_offline, mass_off_col, match_mass_off_col, dphi_off_col, match_dphi_off_col);
+
+    }// Loop over all triggers
+
+    return StatusCode::SUCCESS;
+}
+
+//!=========================================================================
+
+bool TrigEgammaMonitorTopoAlgorithm::match( const xAOD::IParticleContainer &container,
+                                             const xAOD::IParticle *part_on , 
+                                             const xAOD::IParticle *&part_off) const
+{
+  part_off=nullptr;
+  float min_deltaR = 999;
+  for (auto part : container){
+    float dR = part_on->p4().DeltaR(part->p4());
+    if ( dR < min_deltaR ){
+      part_off = part;
+      min_deltaR = dR;
+    }
+  }
+  return ( (min_deltaR < m_dR) && part_off);
+}
+
+//!=========================================================================
+
+void TrigEgammaMonitorTopoAlgorithm::make_legs( std::string trigger, 
+                                                 std::string key_leg0,
+                                                 std::string key_leg1,
+                                                 std::vector<Legs> &legs_vec ) const
+{
+  // Configure TDT to get each leg. only electrons that fired this triggers (e.g: e26_lhtight_e15_etcut_(Zee))
+  // are retrieved (passed by HLT and has at least one Electron online object)
+  Trig::FeatureRequestDescriptor frd_leg0;
+  frd_leg0.reset();
+  frd_leg0.setChainGroup(trigger);
+  frd_leg0.setCondition(TrigDefs::Physics); // Only fired trigger
+  frd_leg0.setRequireSGKey( TrigEgammaMonitorBaseAlgorithm::match()->key(key_leg0));
+  frd_leg0.setRestrictRequestToLeg(0);
+  
+  Trig::FeatureRequestDescriptor frd_leg1;
+  frd_leg1.reset();
+  frd_leg1.setChainGroup(trigger);
+  frd_leg1.setCondition(TrigDefs::Physics); // Only fired trigger
+  frd_leg1.setRequireSGKey( TrigEgammaMonitorBaseAlgorithm::match()->key(key_leg1));
+  frd_leg1.setRestrictRequestToLeg(1);
+
+  // Get all combinations given by the L1
+  auto vec_leg0=tdt()->features<xAOD::IParticleContainer>(frd_leg0);
+  auto vec_leg1=tdt()->features<xAOD::IParticleContainer>(frd_leg1);
+  
+  ATH_MSG_DEBUG("We have " << vec_leg0.size() << " combinations for leg0 from " << trigger);
+  ATH_MSG_DEBUG("We have " << vec_leg1.size() << " combinations for leg1 from " << trigger);
+
+  for ( auto & leg0_feat : vec_leg0){
+
+    for ( auto & leg1_feat : vec_leg1){
+      // Check if all links are valid
+      if ( !leg0_feat.isValid() || !leg1_feat.isValid() )
+        continue;
+      //auto leg0 = static_cast<xAOD::Egamma>(*leg0_feat.link);
+      //auto leg1 = static_cast<xAOD::Egamma>(*leg1_feat.link);
+      auto leg0 = (*leg0_feat.link);
+      auto leg1 = (*leg1_feat.link);
+
+      if (leg0 == leg1) continue;
+
+      legs_vec.push_back( Legs{leg0 , leg1} );
+    } // Loop over leg 1
+  } // Loop over leg 0
+}
+
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.h b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.h
new file mode 100644
index 000000000000..1819ec7e8c36
--- /dev/null
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.h
@@ -0,0 +1,55 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TrigEgammaMonitorTopoAlgorithm_H
+#define TrigEgammaMonitorTopoAlgorithm_H
+
+
+#include "TrigEgammaMonitorBaseAlgorithm.h"
+#include "xAODBase/IParticleContainer.h"
+
+
+
+
+class TrigEgammaMonitorTopoAlgorithm: public TrigEgammaMonitorBaseAlgorithm 
+{
+
+
+  struct Legs{
+      const xAOD::IParticle *leg0; // online electron leg 0
+      const xAOD::IParticle *leg1; // online electron leg 1
+  };
+
+  public:
+
+    TrigEgammaMonitorTopoAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
+
+    virtual ~TrigEgammaMonitorTopoAlgorithm() override;
+
+    virtual StatusCode initialize() override;
+    
+    virtual StatusCode fillHistograms( const EventContext& ctx) const override;
+
+ 
+  
+  private:
+ 
+    /*! List of configurations 
+     *
+     * d = {'trigger_num' : 'HLT_e26_lhtight_e15_etcut_Zee', 'trigger_den' : 'HLT_e26_lhtight_e15_etcut', 'leg0_type':'electron', 'leg1_type':'electron'}
+     */
+    Gaudi::Property<std::vector<std::map<std::string, std::string>>> m_trigListConfig{this, "TriggerListConfig", {}};
+    /*! Min Delta R between online and offline */
+    Gaudi::Property<float> m_dR{this, "DeltaR", 0.07};
+    /*! Event Wise offline ElectronContainer Access and end iterator */
+    SG::ReadHandleKey<xAOD::ElectronContainer> m_offElectronKey{ this, "ElectronKey", "Electrons", ""};
+    SG::ReadHandleKey<xAOD::PhotonContainer> m_offPhotonKey{ this, "PhotonKey", "Photons", ""};
+
+    /*! Get all combinations */
+    void make_legs( std::string trigger, std::string key_leg0, std::string key_leg1, std::vector<Legs> &) const;
+    bool match( const xAOD::IParticleContainer &container,const xAOD::IParticle *part_on , const xAOD::IParticle *&part_off) const;
+
+};
+
+#endif
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/.__afs533D b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/.__afs533D
deleted file mode 100644
index 7aa2ac6e7eda..000000000000
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/.__afs533D
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "../TrigEgammaMonitorBaseAlgorithm.h"
-#include "../TrigEgammaTapMonitorAlgorithm.h"
-
-DECLARE_COMPONENT(TrigEgammaMonitorBaseAlgorithm)
-DECLARE_COMPONENT(TrigEgammaTaPMonitorAlgorithm)
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx
index e6cb500b7a36..b2b31005295c 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx
@@ -1,8 +1,15 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+// offline monitoring
 #include "../TrigEgammaMonitorBaseAlgorithm.h"
 #include "../TrigEgammaMonitorAnalysisAlgorithm.h"
 #include "../TrigEgammaMonitorElectronAlgorithm.h"
 #include "../TrigEgammaMonitorPhotonAlgorithm.h"
 #include "../TrigEgammaMonitorTagAndProbeAlgorithm.h"
+#include "../TrigEgammaMonitorTopoAlgorithm.h"
+// online monitoring
 #include "../egammaMonitorElectronAlgorithm.h"
 #include "../egammaMonitorPhotonAlgorithm.h"
 #include "../egammaMonitorSuperClusterAlgorithm.h"
@@ -13,6 +20,8 @@ DECLARE_COMPONENT(TrigEgammaMonitorAnalysisAlgorithm)
 DECLARE_COMPONENT(TrigEgammaMonitorElectronAlgorithm)
 DECLARE_COMPONENT(TrigEgammaMonitorPhotonAlgorithm)
 DECLARE_COMPONENT(TrigEgammaMonitorTagAndProbeAlgorithm)
+DECLARE_COMPONENT(TrigEgammaMonitorTopoAlgorithm)
+
 DECLARE_COMPONENT(egammaMonitorElectronAlgorithm)
 DECLARE_COMPONENT(egammaMonitorPhotonAlgorithm)
 DECLARE_COMPONENT(egammaMonitorSuperClusterAlgorithm)
-- 
GitLab


From 8a009ccf75d11c5721740314cddd71937a119d6f Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Fri, 17 Sep 2021 19:40:39 +0200
Subject: [PATCH 186/347] Expanded defaults elimination in confTool diff
 functionality

---
 .../python/iconfTool/iconfTool                |  2 +-
 .../python/iconfTool/models/loaders.py        | 39 ++++++++++++-------
 Control/AthenaConfiguration/share/confTool.py |  2 -
 3 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/Control/AthenaConfiguration/python/iconfTool/iconfTool b/Control/AthenaConfiguration/python/iconfTool/iconfTool
index c472ef6d3229..d63b1f1d1e4c 100755
--- a/Control/AthenaConfiguration/python/iconfTool/iconfTool
+++ b/Control/AthenaConfiguration/python/iconfTool/iconfTool
@@ -47,7 +47,7 @@ if __name__ == '__main__':
                                           checked_elements)
         gui_loader = DoublePad(loader)
     else:
-        loader = ComponentsFileLoader(args.input)
+        loader = ComponentsFileLoader(args.input, args)
         gui_loader = GuiLoader(loader)
 
     gui_loader.load_gui()
diff --git a/Control/AthenaConfiguration/python/iconfTool/models/loaders.py b/Control/AthenaConfiguration/python/iconfTool/models/loaders.py
index 94a9449094ed..0ee3de4ad3cf 100755
--- a/Control/AthenaConfiguration/python/iconfTool/models/loaders.py
+++ b/Control/AthenaConfiguration/python/iconfTool/models/loaders.py
@@ -74,6 +74,14 @@ baseParser.add_argument(
     action="store_true"
 )
 
+baseParser.add_argument(
+    "--ignoreDefaultNamedComps",
+    help="""Ignores default handles that have full type specified. That is, if the setting is actually: Tool/A and the default value was just A, the Tool/A is assumed to be default and eliminated.
+    Beware that there is a caveat, the ignored class name may be actually different from the default (there is no way to check that in python).""",
+    action="store_true"
+)
+
+
 baseParser.add_argument(
     "--shortenDefaultComponents",
     help="Automatically shorten componet names that have a default name i.e. ToolX/ToolX to ToolX. It helps comparing Run2 & Run3 configurations where these are handled differently",
@@ -154,7 +162,7 @@ def renameComps(dic, args) -> Dict:
         conf[rename_comps(key)] = value
     return conf
 
-def ignoreDefaults(dic, args) -> Dict:
+def ignoreDefaults(allconf, args) -> Dict:
     name_to_type=dict()
     conf = {}
 
@@ -167,7 +175,7 @@ def ignoreDefaults(dic, args) -> Dict:
             from AthenaConfiguration.ComponentFactory import CompFactory
             comp_cls = CompFactory.getComp(component_type)
         except Exception:
-            logger.debug("Could not find the configuration class %s no defaults for are eliminated", component_name)
+            logger.debug("Could not find the configuration class %s no defaults for it can be eliminated", component_name)
             return val_dict
         c = {}
 
@@ -177,8 +185,10 @@ def ignoreDefaults(dic, args) -> Dict:
             else:    
                 default = str(comp_cls._descriptors[k].default)
                 sv = str(v)
-                if default == sv or default.replace("StoreGateSvc+", "") == sv.replace("StoreGateSvc+", ""):
-                    logger.debug("Dropped default value %s of property %s in %s", str(v), str(k), component_name)
+                if default == sv or default.replace("StoreGateSvc+", "") == sv.replace("StoreGateSvc+", ""): 
+                    logger.debug("Dropped default value %s of property %s in %s because the default is %s", sv, k, component_name, str(default))
+                elif args.ignoreDefaultNamedComps and isinstance(v, str) and sv.endswith(f"/{default}"):
+                    logger.debug("Dropped speculatively value %s of property %s in %s because the default it ends with %s", sv, k, component_name, str(default))
                 else:
                     c[k] = v
                     logger.debug("Keep value %s of property %s in %s because it is different from default %s", str(v), str(k), component_name, str(comp_cls._descriptors[k].default))
@@ -186,6 +196,7 @@ def ignoreDefaults(dic, args) -> Dict:
 
      # collect types for all componets (we look for A/B or lost of A/B strings)
     def collect_types(value):
+        """Updates name_to_type mapping"""
         parseable = False
         try:
             s = ast.literal_eval(str(value))
@@ -202,12 +213,12 @@ def ignoreDefaults(dic, args) -> Dict:
         if isinstance(value, dict):
             [ collect_types(v) for v in value.values() ]
 
-    for (key, value) in dic.items():
-        collect_types(value)
-    for (key, value) in dic.items():
-        remaining = drop_defaults(key, value)
+    for (comp_name, comp_settings) in allconf.items():
+        collect_types(comp_settings)
+    for (comp_name, comp_settings) in allconf.items():
+        remaining = drop_defaults(comp_name, comp_settings)
         if len(remaining) != 0: # ignore components that have only default settings
-            conf[key] = remaining
+            conf[comp_name] = remaining
     return conf
 
 def shortenDefaultComponents(dic, args) -> Dict:
@@ -246,7 +257,7 @@ def loadConfigFile(fname, args) -> Dict:
     Supports reading: Pickled file with the CA or properties & JSON
     """
     if args.debug:
-        print("Debugging info in ", logger.handlers[0].baseFilename)
+        print("Debugging info from reading ", fname, " in ", logger.handlers[0].baseFilename)
         logger.setLevel(logging.DEBUG)
 
     conf = {}
@@ -324,15 +335,15 @@ def loadConfigFile(fname, args) -> Dict:
     return conf
 
 class ComponentsFileLoader:
-    def __init__(self, file_path: str, checked_elements=set()) -> None:
+    def __init__(self, file_path: str, args, checked_elements=set()) -> None:
         self.file_path: str = file_path
         self.checked_elements: Set[str] = checked_elements
+        self.args = args
 
     def _load_file_data(self) -> Dict:
         logger.info(f"Loading {self.file_path}")
-        return loadConfigFile(self.file_path)
-        with open(self.file_path, "rb") as f:
-            return dict(pickle.load(f))
+        return loadConfigFile(self.file_path, self.args)
+
 
     def load_structure(self) -> ComponentsStructure:
         data = self._load_file_data()
diff --git a/Control/AthenaConfiguration/share/confTool.py b/Control/AthenaConfiguration/share/confTool.py
index 6272a35a28e2..b9763596a064 100755
--- a/Control/AthenaConfiguration/share/confTool.py
+++ b/Control/AthenaConfiguration/share/confTool.py
@@ -4,8 +4,6 @@
 #  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 #
 
-from __future__ import print_function
-
 import ast
 import json
 import pickle
-- 
GitLab


From 9af404f45c7f63b41b5fc536d9305b228d18bd4f Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Fri, 17 Sep 2021 19:47:03 +0200
Subject: [PATCH 187/347] MuonCondSvc+MuonCondInterface: Enable thread-safety
 checking.

---
 .../MuonCondInterface/CscICoolStrSvc.h        |  5 +-
 .../MuonCondInterface/ICSCConditionsSvc.h     |  5 +-
 .../MuonCondInterface/ICSC_DCSConditionsSvc.h |  4 +-
 .../MuonCondInterface/IRPCConditionsSvc.h     |  5 +-
 .../MuonCondInterface/IRPC_DCSConditionsSvc.h |  4 +-
 .../IRPC_STATUSConditionsSvc.h                |  4 +-
 .../MuonCondInterface/ITGCConditionsSvc.h     |  5 +-
 .../ITGC_STATUSConditionsSvc.h                |  4 +-
 .../MuonCondInterface/ITriggerCoolSvc.h       |  5 +-
 .../MuonCondInterface/RpcICoolStrSvc.h        |  5 +-
 .../MuonCondSvc/ATLAS_CHECK_THREAD_SAFETY     |  1 +
 .../MuonCondSvc/CSCCondSummarySvc.h           |  4 +-
 .../MuonCondSvc/CSC_DCSConditionsSvc.h        |  4 +-
 .../MuonCondSvc/MuonCondSvc/CscCoolStrSvc.h   |  5 +-
 .../MuonCondSvc/MuonCondSvc/CscCoolStrSvc.icc | 19 ++--
 .../MuonCondSvc/RPCCondSummarySvc.h           | 16 +---
 .../MuonCondSvc/RPC_DCSConditionsSvc.h        | 15 +--
 .../MuonCondSvc/RPC_STATUSConditionsSvc.h     | 17 +---
 .../MuonCondSvc/MuonCondSvc/RpcCoolStrSvc.h   |  4 +-
 .../MuonCondSvc/TGCCondSummarySvc.h           |  4 +-
 .../MuonCondSvc/TGC_STATUSConditionsSvc.h     |  4 +-
 .../MuonCondSvc/MuonCondSvc/TriggerCoolSvc.h  | 11 +--
 .../MuonCondSvc/src/CscCoolStrSvc.cxx         | 10 +-
 .../MuonCondSvc/src/RPCCondSummarySvc.cxx     | 57 +++++------
 .../MuonCondSvc/src/RPC_DCSConditionsSvc.cxx  | 55 +++++------
 .../MuonCondSvc/src/TriggerCoolSvc.cxx        | 94 +++++++++----------
 26 files changed, 151 insertions(+), 215 deletions(-)
 create mode 100644 MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/ATLAS_CHECK_THREAD_SAFETY

diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/CscICoolStrSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/CscICoolStrSvc.h
index ff02c41fca6a..dd0ff7c16669 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/CscICoolStrSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/CscICoolStrSvc.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 MUONCONDSVC_CSCICOOLSTRSVC_H
@@ -12,6 +12,7 @@
 #include <string>
 #include <vector>
 #include "GaudiKernel/IInterface.h"
+#include "CxxUtils/checker_macros.h"
 
 //#include "MuonCondData/CscCalibData.h"
 
@@ -22,7 +23,7 @@ namespace MuonCalib {
   class CscCondDataContainer;
   class CscCondDataCollectionBase;
 
-  class CscICoolStrSvc : virtual public IInterface {
+  class ATLAS_NOT_THREAD_SAFE CscICoolStrSvc : virtual public IInterface {
 
     public:
       static const InterfaceID& interfaceID();
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ICSCConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ICSCConditionsSvc.h
index 5f9ba63cb1bc..4d1bfd220d88 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ICSCConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ICSCConditionsSvc.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
 */
 
 //vitrual interface for all the Muon CSC technologies 
@@ -13,6 +13,7 @@
 //STL includes
 #include <list>
 #include <string>
+#include "CxxUtils/checker_macros.h"
 
 //forward declarations
 class Identifier;
@@ -20,7 +21,7 @@ class IdentifierHash;
 class StatusCode;
 
 
-class ICSCConditionsSvc: virtual public IInterface{
+class ATLAS_NOT_THREAD_SAFE ICSCConditionsSvc: virtual public IInterface{
 public:
   virtual ~ICSCConditionsSvc(){}
   static const InterfaceID & interfaceID(); //!< reimplemented from IInterface
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ICSC_DCSConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ICSC_DCSConditionsSvc.h
index 6075a186148c..b9b85bf67cb2 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ICSC_DCSConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ICSC_DCSConditionsSvc.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 ICSC_DCSCONDITIONSSVC_H
@@ -19,7 +19,7 @@ class IdentifierHash;
 class StatusCode;
 
 
-class ICSC_DCSConditionsSvc : virtual public ICSCConditionsSvc {
+class ATLAS_NOT_THREAD_SAFE ICSC_DCSConditionsSvc : virtual public ICSCConditionsSvc {
 
 public:
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPCConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPCConditionsSvc.h
index d2d0efd0a519..81e1a0da1311 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPCConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPCConditionsSvc.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
 */
 
 //vitrual interface for all the Muon RPC technologies 
@@ -9,6 +9,7 @@
 
 #include "GaudiKernel/IInterface.h"
 #include "AthenaKernel/IOVSvcDefs.h"
+#include "CxxUtils/checker_macros.h"
 
 #include <list>
 #include <string>
@@ -18,7 +19,7 @@
 class Identifier;
 class StatusCode;
 
-class IRPCConditionsSvc: virtual public IInterface{
+class ATLAS_NOT_THREAD_SAFE IRPCConditionsSvc: virtual public IInterface{
 public:
   virtual ~IRPCConditionsSvc(){}
   static const InterfaceID & interfaceID(); //!< reimplemented from IInterface
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPC_DCSConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPC_DCSConditionsSvc.h
index 08e02bb7c421..7caa37cf390a 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPC_DCSConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPC_DCSConditionsSvc.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 IRPC_DCSCONDITIONSSVC_H
@@ -21,7 +21,7 @@ class StatusCode;
 
 
 
-class IRPC_DCSConditionsSvc : virtual public IRPCConditionsSvc {
+class ATLAS_NOT_THREAD_SAFE IRPC_DCSConditionsSvc : virtual public IRPCConditionsSvc {
   
 
 public:
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPC_STATUSConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPC_STATUSConditionsSvc.h
index 79ac84666b8c..6da1199b4084 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPC_STATUSConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IRPC_STATUSConditionsSvc.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 IRPC_STATUSCONDITIONSSVC_H
@@ -18,7 +18,7 @@ class Identifier;
 class IdentifierHash;
 class StatusCode;
 
-class IRPC_STATUSConditionsSvc : virtual public IRPCConditionsSvc {
+class ATLAS_NOT_THREAD_SAFE IRPC_STATUSConditionsSvc : virtual public IRPCConditionsSvc {
   
 
 public:
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCConditionsSvc.h
index 07578d183cc4..0e62eb2ba7fe 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGCConditionsSvc.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
 */
 
 //vitrual interface for all the Muon TGC technologies 
@@ -13,13 +13,14 @@
 #include <list>
 #include <string>
 #include "AthenaKernel/IOVSvcDefs.h"
+#include "CxxUtils/checker_macros.h"
 //forward declarations
 class Identifier;
 class IdentifierHash;
 class StatusCode;
 
 
-class ITGCConditionsSvc: virtual public IInterface{
+class ATLAS_NOT_THREAD_SAFE ITGCConditionsSvc: virtual public IInterface{
 public:
   virtual ~ITGCConditionsSvc(){}
   static const InterfaceID & interfaceID(); //!< reimplemented from IInterface
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGC_STATUSConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGC_STATUSConditionsSvc.h
index 5fc23c1d79cd..4fc02de77475 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGC_STATUSConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITGC_STATUSConditionsSvc.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 ITGC_STATUSCONDITIONSSVC_H
@@ -21,7 +21,7 @@ class StatusCode;
 //static const InterfaceID IID_TGC_STATUSConditionsSvc("TGC_STATUSConditionsSvc", 1, 0);
 
 
-class ITGC_STATUSConditionsSvc : virtual public ITGCConditionsSvc {
+class ATLAS_NOT_THREAD_SAFE ITGC_STATUSConditionsSvc : virtual public ITGCConditionsSvc {
   
 
 public:
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITriggerCoolSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITriggerCoolSvc.h
index 3a1141fc13d2..a7a67161f000 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITriggerCoolSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ITriggerCoolSvc.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 MUONCONDSVC_ITRIGGERCOOLSVC_H
@@ -9,12 +9,13 @@
 
 #include <string>
 #include "GaudiKernel/IInterface.h"
+#include "CxxUtils/checker_macros.h"
 
 
 namespace MuonCalib {
 
    
-class ITriggerCoolSvc : virtual public IInterface {
+class ATLAS_NOT_THREAD_SAFE ITriggerCoolSvc : virtual public IInterface {
   
  public:
   static const InterfaceID& interfaceID();
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/RpcICoolStrSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/RpcICoolStrSvc.h
index 3a794cee7814..f11dc40f7db7 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/RpcICoolStrSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/RpcICoolStrSvc.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 MUONCONDSVC_RPCICOOLSTRSVC_H
@@ -13,6 +13,7 @@
 
 #include <string>
 #include "GaudiKernel/IInterface.h"
+#include "CxxUtils/checker_macros.h"
 
 
 namespace MuonCalib {
@@ -20,7 +21,7 @@ namespace MuonCalib {
     class RpcCalibData;
     class RpcCondParType;
 
-    class RpcICoolStrSvc : virtual public IInterface {
+    class ATLAS_NOT_THREAD_SAFE RpcICoolStrSvc : virtual public IInterface {
 
         public:
             static const InterfaceID& interfaceID();
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/ATLAS_CHECK_THREAD_SAFETY b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..b0bc4c6fec3b
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CSCCondSummarySvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CSCCondSummarySvc.h
index 7774bf0f676f..3990d41e1790 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CSCCondSummarySvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CSCCondSummarySvc.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 MUONCONDSVC_CSCCONDSUMMARYSVC_H
@@ -22,7 +22,7 @@
 template <class TYPE> class SvcFactory;
 class ISvcLocator;
 
-class CSCCondSummarySvc: virtual public ICSCConditionsSvc, public AthService {
+class ATLAS_NOT_THREAD_SAFE CSCCondSummarySvc: virtual public ICSCConditionsSvc, public AthService {
   friend class SvcFactory<CSCCondSummarySvc>;
 public:
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CSC_DCSConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CSC_DCSConditionsSvc.h
index 2f99c415b627..a86c3cc305ea 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CSC_DCSConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CSC_DCSConditionsSvc.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 MUONCONDSVC_CSC_DCSCONDITIONSSVC_H
@@ -30,7 +30,7 @@ class StatusCode;
 class ICSC_DCSConditionsTool;
 class IIOVSvc;
 
-class CSC_DCSConditionsSvc : public AthService, virtual public ICSC_DCSConditionsSvc {
+class ATLAS_NOT_THREAD_SAFE CSC_DCSConditionsSvc : public AthService, virtual public ICSC_DCSConditionsSvc {
 friend class SvcFactory<CSC_DCSConditionsSvc>;   
  public:
   CSC_DCSConditionsSvc (const std::string& name, ISvcLocator* pSvcLocator);
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.h
index 1e693c1ea65e..ddd39f61dad3 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.h
@@ -21,6 +21,7 @@
 #include <string>
 #include <sstream>
 #include <fstream>
+#include <atomic>
 
 template <class TYPE> class SvcFactory;
 
@@ -35,7 +36,7 @@ namespace MuonCalib {
 
     Contains the major code to write and read calibration files to the database. 
    */
-  class CscCoolStrSvc : public AthService, public virtual CscICoolStrSvc
+  class ATLAS_NOT_THREAD_SAFE CscCoolStrSvc : public AthService, public virtual CscICoolStrSvc
   {
     friend class SvcFactory<CscCoolStrSvc>;
 
@@ -196,7 +197,7 @@ namespace MuonCalib {
     /**Flags*/
     bool m_preCache;
 
-    mutable int m_numFailedRequests;
+    mutable std::atomic<int> m_numFailedRequests;
     int m_maxFailedRequests;
 
     std::vector<std::string> m_parNameVec, m_parSGKeyVec, m_parFolderVec,  m_parDataTypeVec, m_parCatVec,
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.icc b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.icc
index 99cb5e94308e..29f378a6b17e 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.icc
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.icc
@@ -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
 */
 
 namespace MuonCalib {
@@ -18,9 +18,10 @@ namespace MuonCalib {
     if( itr == m_parNameMap.end())
     {
       if(parName == "t0phase" || parName == "t0base"){
-        static bool firstTime = true;
-        if(firstTime) ATH_MSG_WARNING("Attempted to request t0 parameters (t0phase or t0base) from CscCoolStrSvc. These are not yet implemented but will be in the near future. You can probably ignore this WARNING.");
-        firstTime = false;
+        static std::atomic_flag firstTime = ATOMIC_FLAG_INIT;
+        if(!firstTime.test_and_set()) {
+          ATH_MSG_WARNING("Attempted to request t0 parameters (t0phase or t0base) from CscCoolStrSvc. These are not yet implemented but will be in the near future. You can probably ignore this WARNING.");
+        }
         return StatusCode::RECOVERABLE;
       }
       
@@ -60,11 +61,12 @@ namespace MuonCalib {
         condData = coll->at(newHash);
         if(condData)  
         {
-          if(m_numFailedRequests < m_maxFailedRequests)
+          int numFailedRequests = m_numFailedRequests++;
+          if(numFailedRequests < m_maxFailedRequests)
             ATH_MSG_WARNING("Invalid chamber layer requested when retrieveing "
                   << parName
                   << ". Tried corresponding channel in valid chamber layer and found good data.");
-          if(m_numFailedRequests++ == m_maxFailedRequests)
+          if(numFailedRequests == m_maxFailedRequests)
             ATH_MSG_WARNING("Reached maximum number of problematic requests to CscCoolStrSvc. No further warnings will be printed.");
         }
       }
@@ -76,10 +78,11 @@ namespace MuonCalib {
     {
       //Return a default value
       retData = coll->getParDefault();
-      if(m_numFailedRequests < m_maxFailedRequests) {
+      int numFailedRequests = m_numFailedRequests++;
+      if(numFailedRequests < m_maxFailedRequests) {
         ATH_MSG_WARNING("Requested index " << index << " has no data cached for parameter " << parName << ". Either its not valid (such as a hash Id for a chamber never installed) or there was a problem caching the database to memory. Returning default value of " << retData);
       }
-      if(m_numFailedRequests++ == m_maxFailedRequests) ATH_MSG_WARNING("Reached maximum number of failed requests to CscCoolStrSvc. No further warnings will be printed."); 
+      if(numFailedRequests == m_maxFailedRequests) ATH_MSG_WARNING("Reached maximum number of failed requests to CscCoolStrSvc. No further warnings will be printed."); 
     }
     else
     {
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPCCondSummarySvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPCCondSummarySvc.h
index cbcb2140ce11..2e9adf919025 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPCCondSummarySvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPCCondSummarySvc.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 MUONCONDSVC_RPCCONDSUMMARYSVC_H
@@ -21,7 +21,7 @@
 //forward declarations
 template <class TYPE> class SvcFactory;
 
-class RPCCondSummarySvc: virtual public IRPCConditionsSvc, public AthService{
+class ATLAS_NOT_THREAD_SAFE RPCCondSummarySvc: virtual public IRPCConditionsSvc, public AthService{
   friend class SvcFactory<RPCCondSummarySvc>;
 public:
   
@@ -57,18 +57,6 @@ public:
 
   bool m_usesimulation;  
 
- protected: 
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
-  static  std::map<Identifier ,std::string> s_RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
-  static  std::map<Identifier ,float> s_RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
-  static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
-  static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
-  static  std::map<Identifier,     std::vector<double> >& s_RPCCondSummarySvc_RPC_StripTimeMap_empty;  
 private:
   
   ServiceHandleArray<IRPCConditionsSvc> m_reportingServices; //!< list of services to be used
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPC_DCSConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPC_DCSConditionsSvc.h
index 4878ac3d39ff..b37963275e0b 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPC_DCSConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPC_DCSConditionsSvc.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 MUONCONDSVC_RPC_DCSCONDITIONSSVC_H
@@ -30,7 +30,7 @@ class StatusCode;
 class IRPC_DCSConditionsTool;
 class IIOVSvc;
 
-class RPC_DCSConditionsSvc : public AthService, virtual public IRPC_DCSConditionsSvc {
+class ATLAS_NOT_THREAD_SAFE RPC_DCSConditionsSvc : public AthService, virtual public IRPC_DCSConditionsSvc {
 friend class SvcFactory<RPC_DCSConditionsSvc>;   
  public:
   RPC_DCSConditionsSvc (const std::string& name, ISvcLocator* pSvcLocator);
@@ -84,17 +84,6 @@ friend class SvcFactory<RPC_DCSConditionsSvc>;
   std::vector<Identifier> m_cachedeffPanelId;
 
 
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
-static  std::map<Identifier ,std::string> s_RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
-static  std::map<Identifier ,float> s_RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
-static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
-static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
- static  std::map<Identifier ,std::vector<double> > s_RPCCondSummarySvc_RPC_StripTimeMap_empty;
  private:
   
   
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPC_STATUSConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPC_STATUSConditionsSvc.h
index 8f7e0dcb400d..e1d5f753d47d 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPC_STATUSConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RPC_STATUSConditionsSvc.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 MUONCONDSVC_RPC_STATUSCONDITIONSSVC_H
@@ -30,7 +30,7 @@ class StatusCode;
 class IRpcDetectorStatusDbTool;
 class IIOVSvc;
 
-class RPC_STATUSConditionsSvc : public AthService, virtual public IRPC_STATUSConditionsSvc {
+class ATLAS_NOT_THREAD_SAFE RPC_STATUSConditionsSvc : public AthService, virtual public IRPC_STATUSConditionsSvc {
 friend class SvcFactory<RPC_STATUSConditionsSvc>;   
  public:
   RPC_STATUSConditionsSvc (const std::string& name, ISvcLocator* pSvcLocator);
@@ -85,19 +85,6 @@ friend class SvcFactory<RPC_STATUSConditionsSvc>;
   std::vector<Identifier> m_cachedoffPanelId;
  
  private:
-  
-   static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
-  
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
-  static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
-  static  std::map<Identifier ,std::string> s_RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
-  static  std::map<Identifier ,float> s_RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
-  static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
-  static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
-  static  std::map<Identifier ,std::vector<double> > s_RPCCondSummarySvc_RPC_StripTimeMap_empty;
   std::string         m_DataLocation;
   std::string         m_dbToolType;
   std::string         m_dbToolName;
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RpcCoolStrSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RpcCoolStrSvc.h
index 632bd4496215..c90261e04894 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RpcCoolStrSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RpcCoolStrSvc.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 MUONCONDSVC_RPCCOOLSTRSVC_H
@@ -41,7 +41,7 @@ namespace MuonCalib {
 
   class RpcCalibDBEntry;
 
-  class RpcCoolStrSvc : public AthService, virtual public RpcICoolStrSvc
+  class ATLAS_NOT_THREAD_SAFE RpcCoolStrSvc : public AthService, virtual public RpcICoolStrSvc
   {
    friend class SvcFactory<RpcCoolStrSvc>;
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGCCondSummarySvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGCCondSummarySvc.h
index e73ddccdadc3..67c0e634c3b7 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGCCondSummarySvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGCCondSummarySvc.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 MUONCONDSVC_TGCCONDSUMMARYSVC_H
@@ -20,7 +20,7 @@
 
 template <class TYPE> class SvcFactory;
 
-class TGCCondSummarySvc: virtual public ITGCConditionsSvc, public AthService{
+class ATLAS_NOT_THREAD_SAFE TGCCondSummarySvc: virtual public ITGCConditionsSvc, public AthService{
   friend class SvcFactory<TGCCondSummarySvc>;
 public:
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGC_STATUSConditionsSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGC_STATUSConditionsSvc.h
index 7a32e4cd3e15..f17a92f49ac4 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGC_STATUSConditionsSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TGC_STATUSConditionsSvc.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 MUONCONDSVC_TGC_STATUSCONDITIONSSVC_H
@@ -38,7 +38,7 @@ class ITGC_STATUSConditionsTool;
 class IIOVSvc;
 
 
-class TGC_STATUSConditionsSvc : public AthService, virtual public ITGC_STATUSConditionsSvc {
+class ATLAS_NOT_THREAD_SAFE TGC_STATUSConditionsSvc : public AthService, virtual public ITGC_STATUSConditionsSvc {
 
   friend class SvcFactory<TGC_STATUSConditionsSvc>;   
   
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TriggerCoolSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TriggerCoolSvc.h
index 0b3085e6f18a..08ac698d8138 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TriggerCoolSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/TriggerCoolSvc.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 MUONCONDSVC_TRIGGERCOOLSVC_H
@@ -31,7 +31,7 @@
 template <class TYPE> class SvcFactory;
 namespace MuonCalib {
 
-  class TriggerCoolSvc : public AthService, virtual public ITriggerCoolSvc
+  class ATLAS_NOT_THREAD_SAFE TriggerCoolSvc : public AthService, virtual public ITriggerCoolSvc
 {
   
  friend class SvcFactory<TriggerCoolSvc>; 
@@ -65,16 +65,9 @@ namespace MuonCalib {
   StoreGateSvc* p_detstore;
   
  
-  mutable MsgStream m_log;
-  
   /**Cool folder name*/
   std::string m_etafolder;
   std::string m_phifolder;
-
-  bool m_debugLevel;
-  
-    
-  
 };
 
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx
index dc8919b6f9e5..495b075a11c3 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx
@@ -1008,13 +1008,12 @@ namespace MuonCalib {
           // CSCCool database contains still all CSCs. A clean fix would be to have a dedicated database for every layout.
           bool isValid = true;
           chanId = m_idHelperSvc->cscIdHelper().channelID(stationName, stationEta, stationPhi, chamberLayer, iLayer, measuresPhi, iStrip, true, &isValid);
-          static bool conversionFailPrinted = false;
+          static std::atomic_flag conversionFailPrinted = ATOMIC_FLAG_INIT;
           if (!isValid) {
-            if (!conversionFailPrinted) {
+            if (!conversionFailPrinted.test_and_set()) {
               ATH_MSG_WARNING("Failed to retrieve offline identifier from ASM cool string " << asmIDstr
                                     << ". This is likely due to the fact that the CSCCool database contains more entries than "
                                     << "the detector layout.");
-              conversionFailPrinted = true;
             }
             continue;
           }
@@ -1197,13 +1196,12 @@ namespace MuonCalib {
     // CSCCool database contains still all CSCs. A clean fix would be to have a dedicated database for every layout.
     bool isValid = true;
     channelId = m_idHelperSvc->cscIdHelper().channelID(stationName,eta,phi,chamLay,wireLay,measuresPhi,strip,true,&isValid);
-    static bool conversionFailPrinted = false;
+    static std::atomic_flag conversionFailPrinted = ATOMIC_FLAG_INIT;
     if (!isValid) {
-      if (!conversionFailPrinted) {
+      if (!conversionFailPrinted.test_and_set()) {
         ATH_MSG_WARNING("Failed to retrieve offline identifier from online identifier " << onlineId
                               << ". This is likely due to the fact that the CSCCool database contains more entries than "
                               << "the detector layout.");
-        conversionFailPrinted = true;
       }
       return StatusCode::FAILURE;
     }
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPCCondSummarySvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPCCondSummarySvc.cxx
index af101c556dc5..12bf5f1bf64b 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPCCondSummarySvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPCCondSummarySvc.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 "MuonCondSvc/RPCCondSummarySvc.h"
@@ -200,8 +200,7 @@ const std::vector<Identifier>& RPCCondSummarySvc::offPanelId() const{
 // only for simulation
 
 const std::map<Identifier,double>& RPCCondSummarySvc::RPC_EfficiencyMap(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
-  s_RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty.clear();
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
 
@@ -212,14 +211,13 @@ static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelEfficiencyMap_
   }
   ATH_MSG_DEBUG(" Efficiency per Panel RPC  RPCConditionsSummarySvc ");
   ATH_MSG_DEBUG("Efficiency Map per RPC panel");
-  return s_RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
+  return RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
 }
 
 
 const std::map<Identifier,double>& RPCCondSummarySvc::RPC_EfficiencyGapMap(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
  
-  s_RPCCondSummarySvc_RPC_GapEfficiencyMap_empty.clear();
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
   for (;svc not_eq lastSvc;++svc){
@@ -228,13 +226,12 @@ static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_GapEfficiencyMap_em
   }
   ATH_MSG_DEBUG(" GapEfficiency per  RPC  RPCConditionsSummarySvc ");
   ATH_MSG_DEBUG("GapEfficiency Map per RPC ");
-  return s_RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
+  return RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
 }
 
 const std::map<Identifier,double>& RPCCondSummarySvc::RPC_MeanClusterSizeMap(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
 
-  s_RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty.clear();
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
 
@@ -244,13 +241,12 @@ static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelMeanClusterSiz
   }
   ATH_MSG_DEBUG(" MeanClusterSize per Panel RPC  RPCConditionsSummarySvc ");
   ATH_MSG_DEBUG("MeanClusterSize Map per RPC panel");
-  return s_RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
+  return RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
 }
 
 const std::map<Identifier,double>& RPCCondSummarySvc::RPC_FracClusterSize1Map(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
  
-  s_RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty.clear();
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
 
@@ -260,13 +256,12 @@ static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSiz
   }
   ATH_MSG_DEBUG("FracClusterSize1 per Panel RPC  RPCConditionsSummarySvc ");
   ATH_MSG_DEBUG("FracClusterSize1 Map per RPC panel");
-  return s_RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
+  return RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
 }
 
 const std::map<Identifier,double>& RPCCondSummarySvc::RPC_FracClusterSize2Map(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
  
-  s_RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty.clear();
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
 
@@ -276,13 +271,12 @@ static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSiz
   }
   ATH_MSG_DEBUG("FracClusterSize2 per Panel RPC  RPCConditionsSummarySvc ");
   ATH_MSG_DEBUG("FracClusterSize2 Map per RPC panel");
-  return s_RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
+  return RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
 }
 
 const std::map<Identifier,double>& RPCCondSummarySvc::RPC_FracClusterSize3Map(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
  
-  s_RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty.clear();
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
 
@@ -292,13 +286,12 @@ static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSiz
   }
   ATH_MSG_DEBUG("FracClusterSize3 per Panel RPC  RPCConditionsSummarySvc ");
   ATH_MSG_DEBUG("FracClusterSize3 Map per RPC panel");
-  return s_RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
+  return RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
 }
 
 const std::map<Identifier,std::string>& RPCCondSummarySvc::RPC_DeadStripListMap(){
-static  std::map<Identifier ,std::string> s_RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
+  static const std::map<Identifier ,std::string> RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
 
-  s_RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty.clear();
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
   for (;svc not_eq lastSvc;++svc){
@@ -307,13 +300,12 @@ static  std::map<Identifier ,std::string> s_RPCCondSummarySvc_RPC_PanelDeadStrip
   }
   ATH_MSG_DEBUG("DeadStripList per Panel RPC  RPCConditionsSummarySvc");
   ATH_MSG_DEBUG("DeadStripList Map per RPC panel");
-  return s_RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
+  return RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
 }
 
 const std::map<Identifier,float>& RPCCondSummarySvc::RPC_FracDeadStripMap(){
-static  std::map<Identifier ,float> s_RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
+  static const std::map<Identifier ,float> RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
 
-  s_RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty.clear();
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
 
@@ -323,13 +315,12 @@ static  std::map<Identifier ,float> s_RPCCondSummarySvc_RPC_PanelFracDeadStripMa
   }
   ATH_MSG_DEBUG("FracDeadStrip per Panel RPC  RPCConditionsSummarySvc");
   ATH_MSG_DEBUG("FracDeadStrip Map per RPC panel");
-  return s_RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
+  return RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
 }
 
 const std::map<Identifier,int>& RPCCondSummarySvc::RPC_ProjectedTracksMap(){
-static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
+  static const std::map<Identifier ,int> RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
 
-  s_RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty.clear();
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
 
@@ -339,13 +330,12 @@ static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelProjectedTracksMa
   }
   ATH_MSG_DEBUG("ProjectedTracks per Panel RPC  RPCConditionsSummarySvc");
   ATH_MSG_DEBUG("ProjectedTracks Map per RPC panel");
-  return s_RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
+  return RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
 }
 
 const std::map<Identifier,int>& RPCCondSummarySvc::RPC_DeadStripList(){
-static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
+  static const std::map<Identifier ,int> RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
 
-  s_RPCCondSummarySvc_RPC_PanelDeadStripList_empty.clear();
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
   for (;svc not_eq lastSvc;++svc){
@@ -354,13 +344,12 @@ static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelDeadStripList_emp
   }
   ATH_MSG_DEBUG("DeadStripList per Panel RPC  RPCConditionsSummarySvc");
   ATH_MSG_DEBUG("DeadStripList Map per RPC panel");
-  return s_RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
+  return RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
 } 
 
 const std::map<Identifier,std::vector<double> >& RPCCondSummarySvc::RPC_TimeMapforStrip(){
-static  std::map<Identifier ,std::vector<double> > s_RPCCondSummarySvc_RPC_StripTimeMap_empty;
+  static const std::map<Identifier ,std::vector<double> > RPCCondSummarySvc_RPC_StripTimeMap_empty;
 
-  s_RPCCondSummarySvc_RPC_StripTimeMap_empty.clear();
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
   for (;svc not_eq lastSvc;++svc){
@@ -369,7 +358,7 @@ static  std::map<Identifier ,std::vector<double> > s_RPCCondSummarySvc_RPC_Strip
   }
   ATH_MSG_DEBUG(" Strip Time per Panel RPC  RPCConditionsSummarySvc ");
   ATH_MSG_DEBUG("Strip Time Map per RPC panel");
-  return s_RPCCondSummarySvc_RPC_StripTimeMap_empty;
+  return RPCCondSummarySvc_RPC_StripTimeMap_empty;
 }
 
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPC_DCSConditionsSvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPC_DCSConditionsSvc.cxx
index f57d8f2e6cce..55e5ce82c643 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPC_DCSConditionsSvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPC_DCSConditionsSvc.cxx
@@ -188,103 +188,92 @@ const std::vector<Identifier>& RPC_DCSConditionsSvc::offPanelId() const{
 
 
 const std::map<Identifier,double>& RPC_DCSConditionsSvc::RPC_EfficiencyMap(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
- s_RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty.clear(); 
+  static const  std::map<Identifier ,double> RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
  ATH_MSG_VERBOSE("Efficiency Map per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
+  return RPCCondSummarySvc_RPC_PanelEfficiencyMap_empty;
 }
 const std::map<Identifier,double>& RPC_DCSConditionsSvc::RPC_EfficiencyGapMap(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
  
-  s_RPCCondSummarySvc_RPC_GapEfficiencyMap_empty.clear(); 
   ATH_MSG_VERBOSE("EfficiencyGap Map per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
+  return RPCCondSummarySvc_RPC_GapEfficiencyMap_empty;
 }
 
 
 const std::map<Identifier,double>& RPC_DCSConditionsSvc::RPC_MeanClusterSizeMap(){
- static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
 
-  s_RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty.clear();
   ATH_MSG_VERBOSE("MeanClusterSize Map per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
+  return RPCCondSummarySvc_RPC_PanelMeanClusterSizeMap_empty;
 }
 
 
 const std::map<Identifier,double>& RPC_DCSConditionsSvc::RPC_FracClusterSize1Map(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
  
-  s_RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty.clear(); 
   ATH_MSG_VERBOSE("FracClusterSize1 Map per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
+  return RPCCondSummarySvc_RPC_PanelFracClusterSize1Map_empty;
 }
 
 
 const std::map<Identifier,double>& RPC_DCSConditionsSvc::RPC_FracClusterSize2Map(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
  
-  s_RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty.clear();
   ATH_MSG_VERBOSE("FracClusterSize2 Map per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
+  return RPCCondSummarySvc_RPC_PanelFracClusterSize2Map_empty;
 }
 
 const std::map<Identifier,double>& RPC_DCSConditionsSvc::RPC_FracClusterSize3Map(){
-static  std::map<Identifier ,double> s_RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
+  static const std::map<Identifier ,double> RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
  
-  s_RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty.clear();
   ATH_MSG_VERBOSE("FracClusterSize3 Map per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
+  return RPCCondSummarySvc_RPC_PanelFracClusterSize3Map_empty;
 }
 
 const std::map<Identifier,std::string>& RPC_DCSConditionsSvc::RPC_DeadStripListMap(){
- static  std::map<Identifier ,std::string> s_RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
+ static const std::map<Identifier ,std::string> RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
 
-  s_RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty.clear();
   ATH_MSG_VERBOSE("DeadStripList Map per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
+  return RPCCondSummarySvc_RPC_PanelDeadStripListMap_empty;
 }
 
 
 const std::map<Identifier,float>& RPC_DCSConditionsSvc::RPC_FracDeadStripMap(){
-static  std::map<Identifier ,float> s_RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
+  static const std::map<Identifier ,float> RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
 
-  s_RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty.clear(); 
   ATH_MSG_VERBOSE("FracDeadStrip Map per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
+  return RPCCondSummarySvc_RPC_PanelFracDeadStripMap_empty;
 }
 
 const std::map<Identifier,int>& RPC_DCSConditionsSvc::RPC_ProjectedTracksMap(){
-static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
+  static const std::map<Identifier ,int> RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
 
-  s_RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty.clear(); 
   ATH_MSG_VERBOSE("ProjectedTracks Map per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
+  return RPCCondSummarySvc_RPC_PanelProjectedTracksMap_empty;
 }
 
 
 const std::map<Identifier,int>& RPC_DCSConditionsSvc::RPC_DeadStripList(){
-static  std::map<Identifier ,int> s_RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
+  static const std::map<Identifier ,int> RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
 
-  s_RPCCondSummarySvc_RPC_PanelDeadStripList_empty.clear(); 
   ATH_MSG_VERBOSE("DeadStripList per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
+  return RPCCondSummarySvc_RPC_PanelDeadStripList_empty;
 }
 
 const std::map<Identifier,std::vector<double> >& RPC_DCSConditionsSvc::RPC_TimeMapforStrip(){
-static  std::map<Identifier ,std::vector<double> > s_RPCCondSummarySvc_RPC_StripTimeMap_empty;
+  static const std::map<Identifier ,std::vector<double> > RPCCondSummarySvc_RPC_StripTimeMap_empty;
 
-  s_RPCCondSummarySvc_RPC_StripTimeMap_empty.clear(); 
   ATH_MSG_VERBOSE("StripTimeMap per RPC panel" );
  
-  return s_RPCCondSummarySvc_RPC_StripTimeMap_empty;
+  return RPCCondSummarySvc_RPC_StripTimeMap_empty;
 }
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TriggerCoolSvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TriggerCoolSvc.cxx
index 4efe439a682f..c72f5e46b174 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TriggerCoolSvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TriggerCoolSvc.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 <fstream>
@@ -22,10 +22,8 @@ namespace MuonCalib{
 TriggerCoolSvc::TriggerCoolSvc(const std::string& name, ISvcLocator* svc) :
   AthService(name,svc),
   p_detstore(0),
-  m_log(msgSvc(),name),  
   m_etafolder("/RPC/TRIGGER/CM_THR_ETA"),
-  m_phifolder("/RPC/TRIGGER/CM_THR_PHI"),
-  m_debugLevel(false)
+  m_phifolder("/RPC/TRIGGER/CM_THR_PHI")
 {
   //declare properties
   declareProperty("EtaFolder",m_etafolder);
@@ -51,21 +49,17 @@ StatusCode TriggerCoolSvc::queryInterface(const InterfaceID& riid, void** ppvInt
 
 StatusCode TriggerCoolSvc::initialize()
 {
-  // service initialisation 
-  m_log.setLevel(outputLevel());    //individual outputlevel not known before inialize
-  m_debugLevel = (m_log.level() <= MSG::DEBUG);
-  
-  m_log << MSG::INFO << "Initializing TriggerCoolSvc" <<endmsg;
+  ATH_MSG_INFO ("Initializing TriggerCoolSvc");
   
   // get detector store, linked to cool database by other algorithms in your
   // jobOptions file.
   if (StatusCode::SUCCESS!=service("DetectorStore",p_detstore)) {
-    m_log << MSG::FATAL << "Detector store not found" << endmsg; 
+    ATH_MSG_FATAL( "Detector store not found"  );
     return StatusCode::FAILURE;
   }
   
-  m_log << MSG::INFO << "using folder phi ******************** " << m_phifolder<<endmsg;
-  m_log << MSG::INFO << "using folder eta ********************" << m_etafolder<<endmsg;
+  ATH_MSG_INFO( "using folder phi ******************** " << m_phifolder );
+  ATH_MSG_INFO( "using folder eta ********************" << m_etafolder );
   
 
   // StoreGateSvc* detStore= 0;
@@ -78,7 +72,7 @@ StatusCode TriggerCoolSvc::initialize()
   
 StatusCode TriggerCoolSvc::finalize()
 {
-  m_log << MSG::DEBUG << "in finalize()" << endmsg;
+  ATH_MSG_DEBUG( "in finalize()"  );
   return StatusCode::SUCCESS;
 }
 
@@ -89,7 +83,7 @@ StatusCode TriggerCoolSvc::writeToDBEta(const std::string& etafolder, const std:
 					const int chan, const std::string& sequence,const std::string& info) const{
   
   // this writes the contents of theEntries in the db
-  m_log << MSG::INFO << "using folder eta ********************" << m_phifolder<<endmsg;
+  ATH_MSG_INFO( "using folder eta ********************" << m_phifolder );
 
   // reading files to store in string
  
@@ -100,7 +94,7 @@ StatusCode TriggerCoolSvc::writeToDBEta(const std::string& etafolder, const std:
     fseek (f, 0L, SEEK_END);
     unsigned int size = ftell (f);
     fseek (f, 0L, SEEK_SET);
-    m_log << MSG::INFO << "Input Th0 file size is " << size << endmsg;
+    ATH_MSG_INFO( "Input Th0 file size is " << size  );
 
     std::vector<char> sbuf(size);
 
@@ -108,7 +102,7 @@ StatusCode TriggerCoolSvc::writeToDBEta(const std::string& etafolder, const std:
        size_t readbytes = 0;
        readbytes = fread(&sbuf[0],size,1,f);
        if(readbytes == 0)
-         m_log << MSG::ERROR << "Empty file read!" << size << endmsg;
+         ATH_MSG_ERROR( "Empty file read!" << size  );
     }
     
     fclose (f);
@@ -121,38 +115,37 @@ StatusCode TriggerCoolSvc::writeToDBEta(const std::string& etafolder, const std:
   
   CondAttrListCollection* atrc=0;
   if (!p_detstore->contains<CondAttrListCollection>(etafolder)) {
-    m_log << MSG::DEBUG << "Creating new CondAttrListCollection for folder "
-	  << etafolder << endmsg;
+    ATH_MSG_DEBUG( "Creating new CondAttrListCollection for folder "
+                   << etafolder  );
     CondAttrListCollection* atrc=new CondAttrListCollection(true);
     if (StatusCode::SUCCESS!=p_detstore->record(atrc,etafolder)) {
-      m_log << MSG::ERROR << "Could not create CondAttrListCollection " <<
-	etafolder << endmsg;
+      ATH_MSG_ERROR( "Could not create CondAttrListCollection " <<
+                     etafolder  );
       return StatusCode::FAILURE;
     }
   }
   
   // do const cast here so we can add to already exisiting collections
   const CondAttrListCollection* catrc=0;
-  m_log << MSG::DEBUG << "Attempting to retrieve collection (const)" << endmsg;
+  ATH_MSG_DEBUG( "Attempting to retrieve collection (const)"  );
   if (StatusCode::SUCCESS!=p_detstore->retrieve(catrc,etafolder)) {
-    m_log << MSG::ERROR << "Could not retrieve CondAttrListCollection " <<
-      etafolder << endmsg;
+    ATH_MSG_ERROR( "Could not retrieve CondAttrListCollection " <<
+                   etafolder  );
     return StatusCode::FAILURE;
   }
   atrc=const_cast<CondAttrListCollection*>(catrc);
   if (atrc==0) {
-    m_log << MSG::ERROR << "Could not retrieve non-const pointer to atrc" <<
-      endmsg;
+    ATH_MSG_ERROR( "Could not retrieve non-const pointer to atrc"  );
     return StatusCode::FAILURE;
   }
 
   // check channel zero is not being requested
   if (chan==0) {
-    m_log << MSG::ERROR << "Channel 0 cannot be used" << endmsg;
+    ATH_MSG_ERROR( "Channel 0 cannot be used"  );
     return StatusCode::FAILURE;
   }
   
-  m_log << MSG::DEBUG << "About to create AttributeListSpecification" << endmsg;
+  ATH_MSG_DEBUG( "About to create AttributeListSpecification"  );
   
   coral::AttributeListSpecification* aspec=0;
   aspec=new coral::AttributeListSpecification();
@@ -171,9 +164,9 @@ StatusCode TriggerCoolSvc::writeToDBEta(const std::string& etafolder, const std:
 
   std::ostringstream atrstring;
   alist.print(atrstring);
-  m_log << MSG::DEBUG << "About to add channel to: " << atrc << endmsg;
+  ATH_MSG_DEBUG( "About to add channel to: " << atrc  );
   atrc->add(channum,alist);
-  m_log << MSG::DEBUG << " craetion folder" << endmsg;
+  ATH_MSG_DEBUG( " creation folder"  );
   return StatusCode::SUCCESS;
 
   
@@ -189,12 +182,12 @@ StatusCode TriggerCoolSvc::writeToDBPhi(const std::string& phifolder, const std:
     fseek (f, 0L, SEEK_END);
     int size = ftell (f);
     fseek (f, 0L, SEEK_SET);
-    m_log << MSG::INFO << "Input file size is " << size << endmsg;
+    ATH_MSG_INFO( "Input file size is " << size  );
     std::vector<char> sbuf(size);
     size_t readbytes = 0;
     readbytes = fread(&sbuf[0],size,1,f);
     if(readbytes == 0)
-      m_log << MSG::ERROR << "Empty file read!" << size << endmsg;
+      ATH_MSG_ERROR( "Empty file read!" << size  );
     fclose (f);
     
     std::string sdata_Th0(sbuf.begin(),sbuf.begin()+size);
@@ -203,44 +196,43 @@ StatusCode TriggerCoolSvc::writeToDBPhi(const std::string& phifolder, const std:
     
   }
  
-  //m_log << MSG::DEBUG << " Data++++++" << sdata_Th0_new<<endmsg;
+  //ATH_MSG_DEBUG( " Data++++++" << sdata_Th0_new );
   //std::cout<< "dentro writeToDBPhi ************************88 " <<std::endl;
-  //m_log << MSG::DEBUG << " folder" << phifolder<<endmsg;
-  //m_log << MSG::DEBUG << " filename " << filename_CM<<endmsg;
+  //ATH_MSG_DEBUG( " folder" << phifolder );
+  //ATH_MSG_DEBUG( " filename " << filename_CM );
   CondAttrListCollection* atrc=0;
   if (!p_detstore->contains<CondAttrListCollection>(phifolder)) {
-    m_log << MSG::DEBUG << "Creating new CondAttrListCollection for folder "
-	  << phifolder << endmsg;
+    ATH_MSG_DEBUG( "Creating new CondAttrListCollection for folder "
+                   << phifolder  );
     CondAttrListCollection* atrc=new CondAttrListCollection(true);
     if (StatusCode::SUCCESS!=p_detstore->record(atrc,phifolder)) {
-      m_log << MSG::ERROR << "Could not create CondAttrListCollection " <<
-	phifolder << endmsg;
+      ATH_MSG_ERROR( "Could not create CondAttrListCollection " <<
+                     phifolder  );
       return StatusCode::FAILURE;
     }
   }
   
   // do const cast here so we can add to already exisiting collections
   const CondAttrListCollection* catrc=0;
-  m_log << MSG::DEBUG << "Attempting to retrieve collection (const)" << endmsg;
+  ATH_MSG_DEBUG( "Attempting to retrieve collection (const)"  );
   if (StatusCode::SUCCESS!=p_detstore->retrieve(catrc,phifolder)) {
-    m_log << MSG::ERROR << "Could not retrieve CondAttrListCollection " <<
-      phifolder << endmsg;
+    ATH_MSG_ERROR( "Could not retrieve CondAttrListCollection " <<
+                   phifolder  );
     return StatusCode::FAILURE;
   }
   atrc=const_cast<CondAttrListCollection*>(catrc);
   if (atrc==0) {
-    m_log << MSG::ERROR << "Could not retrieve non-const pointer to atrc" <<
-      endmsg;
+    ATH_MSG_ERROR( "Could not retrieve non-const pointer to atrc"  );
     return StatusCode::FAILURE;
   }
 
   // check channel zero is not being requested
   if (chan==0) {
-    m_log << MSG::ERROR << "Channel 0 cannot be used" << endmsg;
+    ATH_MSG_ERROR( "Channel 0 cannot be used"  );
     return StatusCode::FAILURE;
   }
   
-  m_log << MSG::DEBUG << "About to create AttributeListSpecification" << endmsg;
+  ATH_MSG_DEBUG( "About to create AttributeListSpecification"  );
   
   coral::AttributeListSpecification* aspec=0;
   aspec=new coral::AttributeListSpecification();
@@ -258,10 +250,10 @@ StatusCode TriggerCoolSvc::writeToDBPhi(const std::string& phifolder, const std:
 
   std::ostringstream atrstring;
   alist.print(atrstring);
-  m_log << MSG::DEBUG << "About to add channel to: " << atrc << endmsg;
+  ATH_MSG_DEBUG( "About to add channel to: " << atrc  );
   std::cout<< "channel ************************ " <<chan<<std::endl;
   atrc->add(channum,alist);
-  m_log << MSG::DEBUG << " craetion folder" << endmsg;
+  ATH_MSG_DEBUG( " creation folder"  );
   return StatusCode::SUCCESS;
 
   
@@ -274,8 +266,8 @@ StatusCode TriggerCoolSvc::getData(const std::string& phifolder, const int chan)
   std::string th0="";
   std::string info="";
   if (StatusCode::SUCCESS!=p_detstore->retrieve(atrc,phifolder)) {
-    log << MSG::ERROR << "getData failed for folder " << phifolder << " channel "
-	<< chan << endmsg;
+    ATH_MSG_ERROR( "getData failed for folder " << phifolder << " channel "
+                   << chan  );
     return StatusCode::FAILURE;
   }
   CondAttrListCollection::ChanNum channum=chan;
@@ -289,9 +281,9 @@ StatusCode TriggerCoolSvc::getData(const std::string& phifolder, const int chan)
     if (log.level() < MSG::INFO) {
       std::ostringstream atrstring;
       atr.toOutputStream(atrstring);
-      log << MSG::DEBUG << "read Channum " << channum << " atrlist: " << atrstring.str() << endmsg;
+      ATH_MSG_DEBUG( "read Channum " << channum << " atrlist: " << atrstring.str()  );
     } else {
-      log << MSG::ERROR << "Invalid channel number" << endmsg;
+      ATH_MSG_ERROR( "Invalid channel number"  );
       return StatusCode::FAILURE;
     }
     return StatusCode::SUCCESS;
-- 
GitLab


From d1481befd2694630933e24179b903e1390e7a883 Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Fri, 17 Sep 2021 20:00:30 +0200
Subject: [PATCH 188/347] Migrate SimEventFilter to be an AthReentrantAlgorithm

---
 .../ISF_Core/ISF_Algorithms/CMakeLists.txt    |  7 ++++-
 .../python/ISF_AlgorithmsConfig.py            |  1 +
 .../python/ISF_AlgorithmsConfigNew.py         |  1 +
 .../ISF_Algorithms/src/SimEventFilter.cxx     | 30 ++++++++-----------
 .../ISF_Algorithms/src/SimEventFilter.h       | 18 ++++++-----
 .../src/components/ISF_Algorithms_entries.cxx |  4 +++
 Tools/PyJobTransforms/python/trfUtils.py      |  4 +--
 7 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt b/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt
index 7036f3cc549c..7e9720aa04ae 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/CMakeLists.txt
@@ -11,6 +11,10 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 find_package( GTest )
 find_package( GMock )
 find_package( Eigen )
+set( extra_libs )
+if( NOT SIMULATIONBASE )
+   set( extra_libs EventBookkeeperToolsLib )
+endif()
 
 # Component(s) in the package:
 atlas_add_component( ISF_Algorithms
@@ -19,7 +23,8 @@ atlas_add_component( ISF_Algorithms
    LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} GaudiKernel
    AthenaBaseComps StoreGateLib AtlasDetDescr GeneratorObjects HepMC_InterfacesLib
    ISF_Event ISF_InterfacesLib ISF_HepMC_Interfaces PmbCxxUtils InDetSimEvent
-   CaloSimEvent LArSimEvent TileSimEvent MuonSimEvent TrackRecordLib RecEvent )
+   CaloSimEvent LArSimEvent TileSimEvent MuonSimEvent TrackRecordLib RecEvent
+   ${extra_libs} )
 
 atlas_add_test( CollectionMerger_test
    SOURCES test/CollectionMerger_test.cxx src/CollectionMerger.h
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py
index 41bcba5f3151..54a0154f93eb 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py
@@ -60,6 +60,7 @@ def getSimEventFilter(name="ISF_SimEventFilter", **kwargs):
     return simEventFilter
 
 def getInvertedSimEventFilter(name="ISF_InvertedSimEventFilter", **kwargs):
+    kwargs.setdefault("FilterKey", "ISF_InvertedSimEventFilter")
     kwargs.setdefault("InvertFilter", True)
     return getSimEventFilter(name, **kwargs)
 
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigNew.py b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigNew.py
index b2f095b0519e..984a3cc8f375 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigNew.py
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfigNew.py
@@ -18,6 +18,7 @@ def SimEventFilterCfg(flags, name="ISF_SimEventFilter", sequenceName='SimSequenc
     return result
 
 def InvertedSimEventFilterCfg(flags, name="ISF_InvertedSimEventFilter", sequenceName='CopyHitSequence', **kwargs):
+    kwargs.setdefault("FilterKey", "ISF_InvertedSimEventFilter")
     kwargs.setdefault("InvertFilter", True)
     return SimEventFilterCfg(flags, name, sequenceName, **kwargs)
 
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimEventFilter.cxx b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimEventFilter.cxx
index dd3710ecc14b..97723bc84982 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimEventFilter.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimEventFilter.cxx
@@ -2,12 +2,16 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
+#ifndef SIMULATIONBASE
 // ISF_Algs includes
 #include "SimEventFilter.h"
 // FrameWork includes
 #include "Gaudi/Property.h"
 // McEventCollection
 #include "GeneratorObjects/McEventCollection.h"
+//
+#include "EventBookkeeperTools/FilterReporter.h"
+
 
 ///////////////////////////////////////////////////////////////////
 // Public methods:
@@ -16,17 +20,15 @@
 // Constructors
 ////////////////
 ISF::SimEventFilter::SimEventFilter( const std::string& name, ISvcLocator* pSvcLocator ) :
-  ::AthFilterAlgorithm( name, pSvcLocator )
+  ::AthReentrantAlgorithm( name, pSvcLocator )
 {
-  setFilterDescription("Filter to select events where two particle filter chains gave different selection results for at least one particle");
-
 }
 
 // Athena Algorithm's Hooks
 ////////////////////////////
 StatusCode ISF::SimEventFilter::initialize()
 {
-
+  ATH_CHECK(m_filterParams.initialize(false));
   ATH_MSG_VERBOSE ( "--------------------------------------------------------" );
   ATH_MSG_VERBOSE ( "Initializing the ISF Sim Filter " );
 
@@ -44,16 +46,14 @@ StatusCode ISF::SimEventFilter::finalize()
 {
   ATH_MSG_VERBOSE ( "Finalizing ..." );
 
-  //TODO: thread safe output of filter decisions
-
-  ATH_MSG_INFO(" pass = "<<m_pass<<" / "<<m_total<<" = "<<(m_total>0 ? (100.0*m_pass)/m_total : 0)<<"%");
+  ATH_MSG_INFO(m_filterParams.summary());
   ATH_MSG_VERBOSE(" =====================================================================");
 
   return StatusCode::SUCCESS;
 }
 
 /** check if the given particle passes all filters */
-bool ISF::SimEventFilter::passesFilters(HepMC::ConstGenParticlePtr part, ToolHandleArray<IGenParticleFilter>& filters) const
+bool ISF::SimEventFilter::passesFilters(HepMC::ConstGenParticlePtr part, const ToolHandleArray<IGenParticleFilter>& filters) const
 {
   // TODO: implement this as a std::find_if with a lambda function
   for ( const auto& filter : filters ) {
@@ -73,11 +73,12 @@ bool ISF::SimEventFilter::passesFilters(HepMC::ConstGenParticlePtr part, ToolHan
   return true;
 }
 
-StatusCode ISF::SimEventFilter::execute()
+StatusCode ISF::SimEventFilter::execute(const EventContext &ctx) const
 {
   ATH_MSG_DEBUG ("Executing ...");
 
-  SG::ReadHandle<McEventCollection> inputHardScatterEvgen(m_inputHardScatterEvgenKey);
+  FilterReporter filter(m_filterParams, false, ctx);
+  SG::ReadHandle<McEventCollection> inputHardScatterEvgen(m_inputHardScatterEvgenKey, ctx);
   if (!inputHardScatterEvgen.isValid()) {
     ATH_MSG_FATAL("Unable to read input GenEvent collection '" << inputHardScatterEvgen.key() << "'");
     return StatusCode::FAILURE;
@@ -162,13 +163,8 @@ StatusCode ISF::SimEventFilter::execute()
     pass =! pass;
   }
 
-  if (pass) {
-    ++m_pass;
-  }
-
-  ++m_total;
-
-  setFilterPassed(pass);
+  filter.setPassed(pass);
 
   return StatusCode::SUCCESS;
 }
+#endif // SimEventFilter currently will not compile in the AthSimulation Project
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimEventFilter.h b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimEventFilter.h
index 07cac6586fcf..7092912a8158 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimEventFilter.h
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimEventFilter.h
@@ -1,17 +1,20 @@
 /*
-  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 ISF_ALGORITHMS_SIMEVENTFILTER_H
 #define ISF_ALGORITHMS_SIMEVENTFILTER_H 1
 
+#ifndef SIMULATIONBASE
+
 // STL includes
 #include <string>
 
 // FrameWork includes
 #include "StoreGate/ReadHandle.h"
 #include "GaudiKernel/ToolHandle.h"
-#include "AthenaBaseComps/AthFilterAlgorithm.h"
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include <EventBookkeeperTools/FilterReporterParams.h>
 
 // ISF_Interfaces includes
 #include "ISF_HepMC_Interfaces/IGenParticleFilter.h"
@@ -21,7 +24,7 @@
 
 namespace ISF {
 
-  class SimEventFilter : public AthFilterAlgorithm {
+  class SimEventFilter : public AthReentrantAlgorithm {
 
   public:
     /** Constructor with parameters */
@@ -32,13 +35,13 @@ namespace ISF {
 
     /** Athena algorithm's interface method initialize() */
     virtual StatusCode  initialize() override final; /** Athena algorithm's interface method execute() */
-    virtual StatusCode  execute() override final;
+    virtual StatusCode  execute(const EventContext& ctx) const override final;
 
     /** Athena algorithm's interface method finalize() */
     virtual StatusCode  finalize() override final;
 
   private:
-    bool passesFilters(HepMC::ConstGenParticlePtr part, ToolHandleArray<IGenParticleFilter>& filters) const;
+    bool passesFilters(HepMC::ConstGenParticlePtr part, const ToolHandleArray<IGenParticleFilter>& filters) const;
 
     /** Input truth collections */
     SG::ReadHandleKey<McEventCollection> m_inputHardScatterEvgenKey{this, "InputHardScatterCollection", "", "Input Hard Scatter EVGEN collection."}; //!< input hard scatter collection
@@ -51,11 +54,10 @@ namespace ISF {
     ToolHandleArray<IGenParticleFilter>  m_genParticleOldFilters{this, "GenParticleOldFilters", {}, "Tools for filtering out GenParticles with the old selection."};       //!< HepMC::GenParticle filters for old selection
     ToolHandleArray<IGenParticleFilter>  m_genParticleNewFilters{this, "GenParticleNewFilters", {}, "Tools for filtering out GenParticles with the new selection."};       //!< HepMC::GenParticle filters for new selection
 
+    FilterReporterParams m_filterParams {this, "ISF_SimEventFilter", "Decides whether particles should be resimulated or simply copied."};
     Gaudi::Property<bool>  m_invertfilter{this, "InvertFilter", false, "Invert filter decision."}; //!< invert filter decision at the end
-
-    int                                  m_pass = 0; //< number of events passing the filter
-    int                                  m_total = 0 ; //< number of total events seen
   };
 }
 
+#endif // SimEventFilter currently will not compile in the AthSimulation Project
 #endif //> !ISF_ALGORITHMS_SIMEVENTFILTER_H
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/components/ISF_Algorithms_entries.cxx b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/components/ISF_Algorithms_entries.cxx
index d6a02d0890b9..6d66be3f44ae 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/components/ISF_Algorithms_entries.cxx
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/components/ISF_Algorithms_entries.cxx
@@ -2,12 +2,16 @@
 #include "../SimKernelMT.h"
 #include "../CollectionMerger.h"
 #include "../SimHitTreeCreator.h"
+#ifndef SIMULATIONBASE
 #include "../SimEventFilter.h"
+#endif // SimEventFilter currently will not compile in the AthSimulation Project
 #include "../RenameHitCollectionsAlg.h"
 
 DECLARE_COMPONENT( ISF::SimKernel )
 DECLARE_COMPONENT( ISF::SimKernelMT )
 DECLARE_COMPONENT( ISF::CollectionMerger )
 DECLARE_COMPONENT( ISF::SimHitTreeCreator )
+#ifndef SIMULATIONBASE
 DECLARE_COMPONENT( ISF::SimEventFilter )
+#endif // SimEventFilter currently will not compile in the AthSimulation Project
 DECLARE_COMPONENT( ISF::RenameHitCollectionsAlg )
diff --git a/Tools/PyJobTransforms/python/trfUtils.py b/Tools/PyJobTransforms/python/trfUtils.py
index cadf5b81039d..55fdeeca2fca 100644
--- a/Tools/PyJobTransforms/python/trfUtils.py
+++ b/Tools/PyJobTransforms/python/trfUtils.py
@@ -1664,10 +1664,10 @@ def bind_port(host, port):
 def reportEventsPassedSimFilter(log):
 
     # Currently the pattern which contains the information for passed events is for example like:
-    # ISF_SimEventFilter   INFO  pass = 0 / 0 = 0%
+    #  ISF_SimEventFilter   INFO accepted 1 out of 10 events for filter ISF_SimEventFilter (SimEventFilter)
     # In case the filter name truncated by ... due to long timestamps, the pattern could still match
     # e.g. ISF_SimEventFi... or ISF_SimEventFil...
-    regExp = re.compile(r'ISF_SimEventFi[lter|...]+\s.*INFO.*pass\s*=\s*(?P<events>[0-9]*)\s*\/\s*(?P<total>[0-9]*).*')
+    regExp = re.compile(r'ISF_SimEventFi[lter|...]+\s.*INFO.*accepted\s*(?P<events>[0-9]*)\s*out of\s*(?P<total>[0-9]*).*')
     try:
         myGen = lineByLine(log)
     except IOError as e:
-- 
GitLab


From f08d66d2d8cc8afb5e460b76690a8b3a0c0b40ea Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Fri, 17 Sep 2021 20:03:18 +0200
Subject: [PATCH 189/347] 22.0-cppcheck-InDetValidation

---
 .../InDetPhysValMonitoring/util/postProcessIDPVMHistos.cxx  | 2 +-
 .../src/SegmentDriftCircleAssValidation.cxx                 | 4 ++--
 .../src/SCT_ClusterValidationNtupleWriter.cxx               | 6 +++---
 .../Root/InDetVertexTruthMatchTool.cxx                      | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/util/postProcessIDPVMHistos.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/util/postProcessIDPVMHistos.cxx
index 8a99345601b2..3bede129e1f2 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/util/postProcessIDPVMHistos.cxx
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/util/postProcessIDPVMHistos.cxx
@@ -26,7 +26,7 @@
 using namespace std;
 
 
-bool file_exists(const string p_name) {
+bool file_exists(const string & p_name) {
   return (gSystem->AccessPathName(p_name.c_str(), kFileExists))?
     false : true;    
 }
diff --git a/InnerDetector/InDetValidation/InDetSegmentDriftCircleAssValidation/src/SegmentDriftCircleAssValidation.cxx b/InnerDetector/InDetValidation/InDetSegmentDriftCircleAssValidation/src/SegmentDriftCircleAssValidation.cxx
index e354d9d331f1..afad772dd61c 100644
--- a/InnerDetector/InDetValidation/InDetSegmentDriftCircleAssValidation/src/SegmentDriftCircleAssValidation.cxx
+++ b/InnerDetector/InDetValidation/InDetSegmentDriftCircleAssValidation/src/SegmentDriftCircleAssValidation.cxx
@@ -483,7 +483,7 @@ void InDet::SegmentDriftCircleAssValidation::efficiencyReconstruction()
     else if(rd > 0.25) d=3; 
     else if(rd <= 0.25) d=4; 
     ++m_efficiency[d]; ++m_events;
-    p++;
+    ++p;
   }
 
 }
@@ -627,7 +627,7 @@ InDet::SegmentDriftCircleAssValidation::findTruth (const InDet::TRT_DriftCircle*
     typedef PRD_MultiTruthCollection::const_iterator TruthIter;
 
     std::pair<TruthIter, TruthIter> r = prdCollection->equal_range(d->identify());
-    for(TruthIter i=r.first; i!=r.second;i++){
+    for(TruthIter i=r.first; i!=r.second;++i){
       if(i==prdCollection->end()) continue;
       mc.push_back(i);
     }
diff --git a/InnerDetector/InDetValidation/InDetTrackValidation/src/SCT_ClusterValidationNtupleWriter.cxx b/InnerDetector/InDetValidation/InDetTrackValidation/src/SCT_ClusterValidationNtupleWriter.cxx
index fbc087ef73d9..954ac9448a3b 100755
--- a/InnerDetector/InDetValidation/InDetTrackValidation/src/SCT_ClusterValidationNtupleWriter.cxx
+++ b/InnerDetector/InDetValidation/InDetTrackValidation/src/SCT_ClusterValidationNtupleWriter.cxx
@@ -358,7 +358,7 @@ StatusCode InDet::SCT_ClusterValidationNtupleWriter::execute() {
             ATH_MSG_WARNING("for current track is TrackStateOnSurfaces == Null, no data will be written for this track");
           } else {
             // Loop over all track states on surfaces
-            for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it=trackStates->begin(); it!=trackStates->end(); it++) {
+            for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it=trackStates->begin(); it!=trackStates->end(); ++it) {
               // Get pointer to RIO of right type
               const InDet::SiClusterOnTrack *clus =
                 dynamic_cast<const InDet::SiClusterOnTrack*>((*it)->measurementOnTrack());
@@ -393,14 +393,14 @@ StatusCode InDet::SCT_ClusterValidationNtupleWriter::execute() {
     // -----------------------
     // get all the RIO_Collections in the container
     InDet::SCT_ClusterContainer::const_iterator containerIterator = m_riocontainer->begin();
-    for( ; containerIterator != m_riocontainer->end(); containerIterator++) {
+    for( ; containerIterator != m_riocontainer->end(); ++containerIterator) {
       ATH_MSG_DEBUG( "There are "  << (*containerIterator)->size() << " entries in the PrepRawDataCollection" );
  
       // ---------------------------------
       //get all the RIOs in the collection
 
       InDet::SCT_ClusterCollection::const_iterator rioIterator = (*containerIterator)->begin();
-      for (; rioIterator != (*containerIterator)->end(); rioIterator++) {
+      for (; rioIterator != (*containerIterator)->end(); ++rioIterator) {
         // get the surface center of the RIO
         if (!(*rioIterator)) {
           ATH_MSG_WARNING( "nullptr to RIO" );
diff --git a/InnerDetector/InDetValidation/InDetTruthVertexValidation/Root/InDetVertexTruthMatchTool.cxx b/InnerDetector/InDetValidation/InDetTruthVertexValidation/Root/InDetVertexTruthMatchTool.cxx
index a570df2f86eb..dcc5f3100a88 100644
--- a/InnerDetector/InDetValidation/InDetTruthVertexValidation/Root/InDetVertexTruthMatchTool.cxx
+++ b/InnerDetector/InDetValidation/InDetTruthVertexValidation/Root/InDetVertexTruthMatchTool.cxx
@@ -44,7 +44,7 @@ namespace {
 // Needed because the track->truth assoc gives us the particles but they don't store event normally
 // Add as decoration to avoid full loop for every track ( this time only once per event )
 // Use a vector so any number of truth event collections can be used at once -- but the pointers need to be valid
-void createTruthMap(std::vector<const xAOD::TruthEventBaseContainer *> truthEventContainers ) {
+void createTruthMap(const std::vector<const xAOD::TruthEventBaseContainer *> & truthEventContainers ) {
 
   static const xAOD::TruthParticle::Decorator<ElementLink<xAOD::TruthEventBaseContainer> > backLinkDecor("TruthEventLink");
 
@@ -70,7 +70,7 @@ void createTruthMap(std::vector<const xAOD::TruthEventBaseContainer *> truthEven
 
 }
 
-void createTrackTruthMap(std::vector<const xAOD::TruthEventBaseContainer *> truthEventContainers,
+void createTrackTruthMap(const std::vector<const xAOD::TruthEventBaseContainer *> & truthEventContainers,
                          const xAOD::TrackParticleContainer & trackParticleContainer,
                          float matchCut)
 {
-- 
GitLab


From a8bd69cfc062a8aadfce627d1373384f09eb6fcb Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 17 Sep 2021 04:22:14 +0200
Subject: [PATCH 190/347] GeneratorObjectsTPCnv: Clear flow information when
 reading.

For versions p2, p3, and p4, we weren't clearing flow information before
filling it.  Since these objects are managed by a DataPool, than means
that the flow information is garbage when we read these versions.
Fixed.

See ATLASSIM-5403.
---
 Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx | 1 +
 Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx | 1 +
 Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx | 1 +
 3 files changed, 3 insertions(+)

diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx
index 1918f155e1c8..a9110d0a7244 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p2.cxx
@@ -288,6 +288,7 @@ McEventCollectionCnv_p2::createGenParticle( const GenParticle_p2& persPart,
 
   // fillin' the flow
   const unsigned int nFlow = persPart.m_flow.size();
+  p->m_flow.clear();
   for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
     p->m_flow.set_icode( persPart.m_flow[iFlow].first,
                          persPart.m_flow[iFlow].second );
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx
index db3e6b74e11e..2a8fbfe64aee 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p3.cxx
@@ -315,6 +315,7 @@ McEventCollectionCnv_p3::createGenParticle( const GenParticle_p3& persPart,
 
   // setup flow
   const unsigned int nFlow = persPart.m_flow.size();
+  p->m_flow.clear();
   for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow ) {
     p->m_flow.set_icode( persPart.m_flow[iFlow].first,
                          persPart.m_flow[iFlow].second );
diff --git a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx
index 5f6ca99d7230..a4643fad10b6 100755
--- a/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/McEventCollectionCnv_p4.cxx
@@ -537,6 +537,7 @@ McEventCollectionCnv_p4::createGenParticle( const GenParticle_p4& persPart,
 
   // setup flow
   const unsigned int nFlow = persPart.m_flow.size();
+  p->m_flow.clear();
   for ( unsigned int iFlow= 0; iFlow != nFlow; ++iFlow )
     {
       p->m_flow.set_icode( persPart.m_flow[iFlow].first,
-- 
GitLab


From 4f5ecad127deb83680e81c431316f7d4e675cfc3 Mon Sep 17 00:00:00 2001
From: Judith Hofer <judith.hoefer@desy.de>
Date: Fri, 17 Sep 2021 20:16:07 +0200
Subject: [PATCH 191/347] Add null pointer check in FTag Physval code.

---
 .../JetTagDQA/src/BTaggingValidationPlots.cxx | 36 ++++++++++++-------
 .../JetTagDQA/src/BTaggingValidationPlots.h   | 14 ++++++++
 .../JetTagDQA/src/PhysValBTag.cxx             |  3 ++
 3 files changed, 41 insertions(+), 12 deletions(-)

diff --git a/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/BTaggingValidationPlots.cxx b/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/BTaggingValidationPlots.cxx
index 9f29e26bfdb7..0a86b247797a 100644
--- a/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/BTaggingValidationPlots.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/BTaggingValidationPlots.cxx
@@ -836,12 +836,18 @@ namespace JetTagDQA{
         jet->getAssociatedObjects<xAOD::TruthParticle>(labelB, BHadrons);
         // get the Lxy
         if(BHadrons.size() >= 1){
-          // get the Lxy
-          Lxy = BHadrons[0]->decayVtx()->perp();
-          m_Truth_Lxy_b ->Fill(Lxy, event->beamSpotWeight());
-          // get the deltaR wrt to the jet axis
-          double dR = jet->p4().DeltaR(BHadrons[0]->p4());
-          m_deltaR_truthBHadron_jet_b->Fill(dR, event->beamSpotWeight());
+          // check if the BHadron is not a null pointer
+          if(! BHadrons[0]){
+            ATH_MSG_WARNING("A BHadron in the 'ConeExclBHadronsFinal' collection is a null pointer. Might be related to ATLPHYSVAL-783.");
+          } 
+          else{
+            // get the Lxy
+            Lxy = BHadrons[0]->decayVtx()->perp();
+            m_Truth_Lxy_b ->Fill(Lxy, event->beamSpotWeight());
+            // get the deltaR wrt to the jet axis
+            double dR = jet->p4().DeltaR(BHadrons[0]->p4());
+            m_deltaR_truthBHadron_jet_b->Fill(dR, event->beamSpotWeight());
+          }
         }
       }
   
@@ -853,12 +859,18 @@ namespace JetTagDQA{
         jet->getAssociatedObjects<xAOD::TruthParticle>(labelC, CHadrons);
         // get the Lxy
         if(CHadrons.size() >= 1){
-          // get the Lxy
-          Lxy = CHadrons[0]->decayVtx()->perp();
-          m_Truth_Lxy_c ->Fill(Lxy, event->beamSpotWeight());
-          // get the deltaR wrt to the jet axis
-          double dR = jet->p4().DeltaR(CHadrons[0]->p4());
-          m_deltaR_truthCHadron_jet_c->Fill(dR, event->beamSpotWeight());
+          // check if the CHadron is not a null pointer
+          if(! CHadrons[0]){
+            ATH_MSG_WARNING("A CHadron in the 'ConeExclCHadronsFinal' collection is a null pointer. Might be related to ATLPHYSVAL-783.");
+          } 
+          else{
+            // get the Lxy
+            Lxy = CHadrons[0]->decayVtx()->perp();
+            m_Truth_Lxy_c ->Fill(Lxy, event->beamSpotWeight());
+            // get the deltaR wrt to the jet axis
+            double dR = jet->p4().DeltaR(CHadrons[0]->p4());
+            m_deltaR_truthCHadron_jet_c->Fill(dR, event->beamSpotWeight());
+          }
         }
       }
 
diff --git a/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/BTaggingValidationPlots.h b/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/BTaggingValidationPlots.h
index 836543efaa1e..9f46861ffa80 100644
--- a/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/BTaggingValidationPlots.h
+++ b/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/BTaggingValidationPlots.h
@@ -7,6 +7,8 @@
     
 #include "xAODBase/IParticle.h"
 #include "TrkValHistUtils/PlotBase.h"
+#include "AthenaKernel/MsgStreamMember.h"
+#include "AthenaBaseComps/AthMsgStreamMacros.h"
 #include "CLHEP/Units/SystemOfUnits.h"
 #include "xAODBTagging/BTagging.h" 
 #include "xAODJet/JetContainer.h"
@@ -648,6 +650,18 @@ namespace JetTagDQA{
       template <class T>
       void fillHistoWithTruthCases(T value, TH1* histo_incl, TH1* histo_b, TH1* histo_c, TH1* histo_l, TH1* histo_muon, const int& truth_label, const bool& has_muon, const xAOD::EventInfo* event);
 
+    protected:
+      // Log a message using the Athena controlled logging system
+      MsgStream& msg(MSG::Level lvl) const {
+        return m_msg.get() << lvl;
+      }
+      // Check whether the logging system is active at the provided verbosity level
+      bool msgLvl(MSG::Level lvl) {
+        return m_msg.get().level() <= lvl;
+      }
+      // Private message stream member
+      mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
+
   };
     
 }
diff --git a/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/PhysValBTag.cxx b/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/PhysValBTag.cxx
index 6cb869a91cab..33b2ef47e972 100644
--- a/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/PhysValBTag.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagValidation/JetTagDQA/src/PhysValBTag.cxx
@@ -268,6 +268,9 @@ namespace JetTagDQA {
           // fill discriminant related vars
           (plot_i->second).fillDiscriminantVariables(btag, jet, jet_Lxy, truth_label, contains_muon, m_onZprime, nJetsThatPassedWPCuts, event);
         }
+        else{
+          ATH_MSG_WARNING("btag (obtained by xAOD::BTaggingUtilities::getBTagging(*jet)) is a null pointer.");
+        }
       }
 
       // fill multiplicities
-- 
GitLab


From 3f3c310983778b5cb232005096ae368a47e12315 Mon Sep 17 00:00:00 2001
From: Jiri Masik <jiri.masik@cern.ch>
Date: Fri, 17 Sep 2021 20:18:19 +0200
Subject: [PATCH 192/347] adjust the precision hit cut to work with recent Rt
 calibrations

---
 .../python/InDetTrigTrackingCuts.py           |   4 +
 .../TrigInDetConfig/python/InDetPT.py         |   6 +-
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 166 +++++++++---------
 3 files changed, 89 insertions(+), 87 deletions(-)

diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigTrackingCuts.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigTrackingCuts.py
index 7908a9579556..4d3d980a010a 100755
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigTrackingCuts.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigTrackingCuts.py
@@ -61,6 +61,7 @@ class InDetTrigTrackingCuts :
 
     # --- this is for the TRT-extension + segements and backtracking
     self.__minTRTonTrk               = 9
+    self.__minTRTPrecFrac            = 0.3
     self.__useParameterizedTRTCuts   = False
     self.__useNewParameterizationTRT = False
 
@@ -536,6 +537,9 @@ class InDetTrigTrackingCuts :
   def minTRTonTrk( self ) :
     return self.__minTRTonTrk
 
+  def minTRTPrecFrac( self ) :
+    return self.__minTRTPrecFrac
+
   def useParameterizedTRTCuts( self ) :
     return self.__useParameterizedTRTCuts
 
diff --git a/Trigger/TrigTools/TrigInDetConfig/python/InDetPT.py b/Trigger/TrigTools/TrigInDetConfig/python/InDetPT.py
index 837b15f49c46..546ea33f124b 100644
--- a/Trigger/TrigTools/TrigInDetConfig/python/InDetPT.py
+++ b/Trigger/TrigTools/TrigInDetConfig/python/InDetPT.py
@@ -516,10 +516,10 @@ def trtExtensionProcessor_builder( signature, config, summaryTool, inputTracks,
                                               useSCT             = cutValues.useSCT(),
                                               doEmCaloSeed       = False,
                                               minTRTonTrk        = cutValues.minTRTonTrk(),
+                                              minTRTPrecisionFraction = cutValues.minTRTPrecFrac(),
                                               #useSigmaChi2   = False # tuning from Thijs
                                               DriftCircleCutTool = InDetTrigTRTDriftCircleCut,
                                               minPt              = config.pTmin )
-    
     ToolSvc += scoringTool
 
 
@@ -533,15 +533,13 @@ def trtExtensionProcessor_builder( signature, config, summaryTool, inputTracks,
                                                             NewTrackName       = outputTracks,
                                                             TrackFitter        = InDetTrigTrackFitter,
                                                             TrackSummaryTool   = summaryTool,
-                                                            ScoringTool        = scoringTool, #TODO do I provide the same tool as for ambiguity solver?
+                                                            ScoringTool        = scoringTool, 
                                                             suppressHoleSearch = False,
                                                             RefitPrds = not (InDetTrigFlags.refitROT() or (InDetTrigFlags.trtExtensionType() == 'DAF')))
                                                             # Check these option after DAF is implemented
                                                             # tryBremFit         = InDetFlags.doBremRecovery(),
                                                             # caloSeededBrem     = InDetFlags.doCaloSeededBrem(),
                                                             # pTminBrem          = NewTrackingCuts.minPTBrem() )
-                                                            # RefitPrds          = not (InDetFlags.refitROT() or (InDetFlags.trtExtensionType() is 'DAF')))
-    
     return trtExtensionProcessor
 
 
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 2626736d9f4a..59d441b65546 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -520,17 +520,17 @@ HLT_2mu15_L12MU8F:
     2: 2
     3: 2
 HLT_2mu4_L12MU3V:
-  eventCount: 3
+  eventCount: 2
   stepCounts:
     0: 4
     1: 3
     2: 3
-    3: 3
+    3: 2
   stepFeatures:
     0: 8
     1: 6
     2: 10
-    3: 8
+    3: 6
 HLT_2mu4_L1BPH-0M16-15DR99-2MU3V:
   eventCount: 0
 HLT_2mu4_L1BPH-0M16-20DR99-2MU3V:
@@ -556,7 +556,7 @@ HLT_2mu4_bBmumux_BcmumuDploose_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_bBmumux_BcmumuDsloose_L12MU3V:
   eventCount: 0
@@ -569,7 +569,7 @@ HLT_2mu4_bBmumux_BcmumuDsloose_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_bBmumux_BcmumuPi_L12MU3V:
   eventCount: 0
@@ -582,7 +582,7 @@ HLT_2mu4_bBmumux_BcmumuPi_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_bBmumux_BdmumuKst_L12MU3V:
   eventCount: 1
@@ -596,7 +596,7 @@ HLT_2mu4_bBmumux_BdmumuKst_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_bBmumux_BpmumuKp_L12MU3V:
   eventCount: 1
@@ -610,7 +610,7 @@ HLT_2mu4_bBmumux_BpmumuKp_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_bBmumux_BpmumuKp_L1BPH-2M9-0DR15-2MU3V:
   eventCount: 0
@@ -625,7 +625,7 @@ HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_bBmumux_BsmumuPhi_L1BPH-2M9-0DR15-2MU3V:
   eventCount: 0
@@ -640,7 +640,7 @@ HLT_2mu4_bBmumux_LbPqKm_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_bDimu_L12MU3V:
   eventCount: 1
@@ -648,28 +648,28 @@ HLT_2mu4_bDimu_L12MU3V:
     0: 4
     1: 3
     2: 3
-    3: 3
+    3: 2
     4: 1
   stepFeatures:
     0: 9
     1: 9
     2: 10
-    3: 8
-    4: 8
+    3: 6
+    4: 6
 HLT_2mu4_bJpsimumu_L12MU3V:
   eventCount: 1
   stepCounts:
     0: 4
     1: 3
     2: 3
-    3: 3
+    3: 2
     4: 1
   stepFeatures:
     0: 9
     1: 9
     2: 10
-    3: 8
-    4: 8
+    3: 6
+    4: 6
 HLT_2mu4_bJpsimumu_Lxy0_L1BPH-2M9-0DR15-2MU3V:
   eventCount: 0
 HLT_2mu4_bUpsimumu_L12MU3V:
@@ -678,25 +678,25 @@ HLT_2mu4_bUpsimumu_L12MU3V:
     0: 4
     1: 3
     2: 3
-    3: 3
+    3: 2
   stepFeatures:
     0: 9
     1: 9
     2: 10
-    3: 8
-    4: 8
+    3: 6
+    4: 6
 HLT_2mu4_muonqual_L12MU3V:
-  eventCount: 3
+  eventCount: 2
   stepCounts:
     0: 4
     1: 3
     2: 3
-    3: 3
+    3: 2
   stepFeatures:
     0: 8
     1: 6
     2: 10
-    3: 8
+    3: 6
 HLT_2mu4_noL2Comb_bBmumux_BcmumuPi_L12MU3V:
   eventCount: 0
   stepCounts:
@@ -708,7 +708,7 @@ HLT_2mu4_noL2Comb_bBmumux_BcmumuPi_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_noL2Comb_bBmumux_BdmumuKst_L12MU3V:
   eventCount: 1
@@ -722,7 +722,7 @@ HLT_2mu4_noL2Comb_bBmumux_BdmumuKst_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_noL2Comb_bBmumux_BpmumuKp_L12MU3V:
   eventCount: 1
@@ -736,7 +736,7 @@ HLT_2mu4_noL2Comb_bBmumux_BpmumuKp_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_noL2Comb_bBmumux_BsmumuPhi_L12MU3V:
   eventCount: 0
@@ -749,7 +749,7 @@ HLT_2mu4_noL2Comb_bBmumux_BsmumuPhi_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_noL2Comb_bBmumux_LbPqKm_L12MU3V:
   eventCount: 0
@@ -762,7 +762,7 @@ HLT_2mu4_noL2Comb_bBmumux_LbPqKm_L12MU3V:
     0: 9
     1: 9
     2: 10
-    3: 8
+    3: 6
     4: 4
 HLT_2mu4_noL2Comb_bJpsimumu_L12MU3V:
   eventCount: 1
@@ -770,14 +770,14 @@ HLT_2mu4_noL2Comb_bJpsimumu_L12MU3V:
     0: 4
     1: 3
     2: 3
-    3: 3
+    3: 2
     4: 1
   stepFeatures:
     0: 9
     1: 9
     2: 10
-    3: 8
-    4: 8
+    3: 6
+    4: 6
 HLT_2mu4_os_dRAA12_L1BPH-0DR12C-2MU3V:
   eventCount: 1
   stepCounts:
@@ -789,7 +789,7 @@ HLT_2mu4_os_dRAA12_L1BPH-0DR12C-2MU3V:
     0: 6
     1: 6
     2: 10
-    3: 8
+    3: 6
 HLT_2mu50_msonly_L1MU14FCH:
   eventCount: 0
   stepCounts:
@@ -797,31 +797,31 @@ HLT_2mu50_msonly_L1MU14FCH:
   stepFeatures:
     0: 2
 HLT_2mu6_10invmAA70_L1MU5VF:
-  eventCount: 2
+  eventCount: 1
   stepCounts:
     0: 3
     1: 3
     2: 3
-    3: 2
+    3: 1
   stepFeatures:
     0: 6
     1: 6
     2: 8
-    3: 7
+    3: 5
 HLT_2mu6_2j50_0eta490_j0_DJMASS900j50_L1MJJ-500-NFF:
   eventCount: 0
 HLT_2mu6_L12MU5VF:
-  eventCount: 3
+  eventCount: 2
   stepCounts:
     0: 3
     1: 3
     2: 3
-    3: 3
+    3: 2
   stepFeatures:
     0: 6
     1: 6
     2: 8
-    3: 7
+    3: 5
 HLT_2mu6_bBmumu_L1BPH-2M9-2DR15-2MU5VF:
   eventCount: 0
 HLT_2mu6_bBmumu_Lxy0_L1BPH-2M9-2DR15-2MU5VF:
@@ -840,7 +840,7 @@ HLT_2mu6_bBmumux_BpmumuKp_L1LFV-MU5VF:
     0: 6
     1: 8
     2: 8
-    3: 7
+    3: 5
     4: 3
 HLT_2mu6_bBmumux_BsmumuPhi_L1BPH-2M9-2DR15-2MU5VF:
   eventCount: 0
@@ -855,7 +855,7 @@ HLT_2mu6_bBmumux_BsmumuPhi_L1LFV-MU5VF:
     0: 6
     1: 8
     2: 8
-    3: 7
+    3: 5
     4: 3
 HLT_2mu6_bDimu_L12MU5VF:
   eventCount: 1
@@ -863,14 +863,14 @@ HLT_2mu6_bDimu_L12MU5VF:
     0: 3
     1: 3
     2: 3
-    3: 3
+    3: 2
     4: 1
   stepFeatures:
     0: 6
     1: 8
     2: 8
-    3: 7
-    4: 7
+    3: 5
+    4: 5
 HLT_2mu6_bDimu_L1BPH-2M9-2DR15-2MU5VF:
   eventCount: 0
 HLT_2mu6_bDimu_L1LFV-MU5VF:
@@ -879,14 +879,14 @@ HLT_2mu6_bDimu_L1LFV-MU5VF:
     0: 3
     1: 3
     2: 3
-    3: 3
+    3: 2
     4: 1
   stepFeatures:
     0: 6
     1: 8
     2: 8
-    3: 7
-    4: 7
+    3: 5
+    4: 5
 HLT_2mu6_bJpsimumu_L1BPH-2M9-2DR15-2MU5VF:
   eventCount: 0
 HLT_2mu6_bJpsimumu_Lxy0_L1BPH-2M9-2DR15-2MU5VF:
@@ -897,57 +897,57 @@ HLT_2mu6_bPhi_L1LFV-MU5VF:
     0: 3
     1: 3
     2: 3
-    3: 3
+    3: 2
   stepFeatures:
     0: 6
     1: 8
     2: 8
-    3: 7
-    4: 7
+    3: 5
+    4: 5
 HLT_2mu6_bUpsimumu_L1BPH-8M15-0DR22-2MU5VF:
   eventCount: 0
 HLT_2mu6_l2io_L12MU5VF:
-  eventCount: 3
+  eventCount: 2
   stepCounts:
     0: 3
     1: 3
     2: 3
-    3: 3
+    3: 2
   stepFeatures:
     0: 6
     1: 8
     2: 8
-    3: 7
+    3: 5
 HLT_2mu6_mu4_bTau_L12MU5VF_3MU3V:
   eventCount: 0
 HLT_2mu6_mu4_bUpsi_L12MU5VF_3MU3V:
   eventCount: 0
 HLT_2mu6_muonqual_L12MU5VF:
-  eventCount: 3
+  eventCount: 2
   stepCounts:
     0: 3
     1: 3
     2: 3
-    3: 3
+    3: 2
   stepFeatures:
     0: 6
     1: 6
     2: 8
-    3: 7
+    3: 5
 HLT_2mu6_noL2Comb_bJpsimumu_L12MU5VF:
   eventCount: 1
   stepCounts:
     0: 3
     1: 3
     2: 3
-    3: 3
+    3: 2
     4: 1
   stepFeatures:
     0: 6
     1: 6
     2: 8
-    3: 7
-    4: 7
+    3: 5
+    4: 5
 HLT_3j200_L1J100:
   eventCount: 1
   stepCounts:
@@ -6325,15 +6325,15 @@ HLT_j450_pf_ftf_preselj135_L1J100:
     0: 5
     1: 2
 HLT_j45_0eta290_020jvt_020jvt_pf_ftf_bdl1r70_L1J20:
-  eventCount: 10
+  eventCount: 11
   stepCounts:
     0: 20
     1: 19
-    2: 10
+    2: 11
   stepFeatures:
     0: 20
     1: 62
-    2: 13
+    2: 14
 HLT_j45_0eta290_020jvt_pf_ftf_boffperf_L1J20:
   eventCount: 19
   stepCounts:
@@ -9070,7 +9070,7 @@ HLT_mu4_j20_0eta290_pf_ftf_boffperf_dRAB03_L1MU3V:
     0: 17
     1: 17
     2: 21
-    3: 17
+    3: 16
     4: 12
     5: 105
     6: 105
@@ -9088,7 +9088,7 @@ HLT_mu4_j20_0eta290_pf_ftf_boffperf_dRAB03_L1MU3V_J15:
     0: 17
     1: 17
     2: 21
-    3: 17
+    3: 16
     4: 12
     5: 105
     6: 105
@@ -9117,7 +9117,7 @@ HLT_mu4_l2io_L1MU3V:
     0: 17
     1: 25
     2: 21
-    3: 17
+    3: 16
 HLT_mu50_L1MU14FCH:
   eventCount: 3
   stepCounts:
@@ -9210,7 +9210,7 @@ HLT_mu6_L1MU5VF:
     0: 14
     1: 14
     2: 16
-    3: 15
+    3: 14
 HLT_mu6_LRT_idperf_L1MU5VF:
   eventCount: 11
   stepCounts:
@@ -9236,19 +9236,19 @@ HLT_mu6_idperf_L1MU5VF:
     2: 16
     3: 16
 HLT_mu6_ivarmedium_L1MU5VF:
-  eventCount: 7
+  eventCount: 6
   stepCounts:
     0: 11
     1: 11
     2: 11
     3: 11
-    4: 7
+    4: 6
   stepFeatures:
     0: 14
     1: 14
     2: 16
-    3: 15
-    4: 7
+    3: 14
+    4: 6
 HLT_mu6_j45_nojcalib_L1J20:
   eventCount: 10
   stepCounts:
@@ -9261,7 +9261,7 @@ HLT_mu6_j45_nojcalib_L1J20:
     0: 14
     1: 14
     2: 16
-    3: 15
+    3: 14
     4: 28
 HLT_mu6_msonly_L1MU5VF:
   eventCount: 11
@@ -9272,17 +9272,17 @@ HLT_mu6_msonly_L1MU5VF:
     0: 14
     1: 16
 HLT_mu6_mu4_L12MU3V:
-  eventCount: 3
+  eventCount: 2
   stepCounts:
     0: 4
     1: 4
     2: 4
-    3: 3
+    3: 2
   stepFeatures:
     0: 18
     1: 18
     2: 24
-    3: 17
+    3: 15
 HLT_mu6_mu4_bBmumu_L1BPH-2M9-0DR15-C-MU5VFMU3V:
   eventCount: 0
 HLT_mu6_mu4_bBmumu_L1BPH-2M9-0DR15-MU5VFMU3V:
@@ -9308,14 +9308,14 @@ HLT_mu6_mu4_bDimu_L1MU5VF_2MU3V:
   stepCounts:
     0: 4
     1: 3
-    2: 3
+    2: 2
     3: 1
   stepFeatures:
     0: 16
     1: 23
     2: 18
-    3: 15
-    4: 15
+    3: 13
+    4: 11
 HLT_mu6_mu4_bJpsimumu_L1BPH-2M9-0DR15-C-MU5VFMU3V:
   eventCount: 0
 HLT_mu6_mu4_bJpsimumu_L1BPH-2M9-0DR15-MU5VFMU3V:
@@ -9327,34 +9327,34 @@ HLT_mu6_mu4_bJpsimumu_Lxy0_L1BPH-2M9-0DR15-MU5VFMU3V:
 HLT_mu6_mu4_bUpsimumu_L1BPH-8M15-0DR22-MU5VFMU3V-BO:
   eventCount: 0
 HLT_mu6_mu6noL1_L1MU5VF:
-  eventCount: 4
+  eventCount: 3
   stepCounts:
     0: 11
     1: 11
     2: 11
     3: 11
     4: 4
-    5: 4
+    5: 3
   stepFeatures:
     0: 14
     1: 14
     2: 16
-    3: 15
+    3: 14
     4: 9
-    5: 8
+    5: 6
 HLT_mu6_noL2Comb_mu4_noL2Comb_bJpsimumu_L1MU5VF_2MU3V:
   eventCount: 1
   stepCounts:
     0: 4
     1: 3
-    2: 3
+    2: 2
     3: 1
   stepFeatures:
     0: 16
     1: 16
     2: 18
-    3: 15
-    4: 15
+    3: 13
+    4: 11
 HLT_mu6_xe30_mht_L1XE30:
   eventCount: 7
   stepCounts:
@@ -9367,7 +9367,7 @@ HLT_mu6_xe30_mht_L1XE30:
     0: 9
     1: 9
     2: 11
-    3: 10
+    3: 9
     4: 7
 HLT_mu80_L1MU14FCH:
   eventCount: 3
-- 
GitLab


From dc4b4d392deb05818f19439622dca48d439164a1 Mon Sep 17 00:00:00 2001
From: Marco Montella <marco.montella@cern.ch>
Date: Fri, 17 Sep 2021 20:22:51 +0200
Subject: [PATCH 193/347] Harmonisation of usage of RecoFragmentsPool in
 FastPhotonMenuSequences

---
 .../Egamma/FastPhotonMenuSequences.py         | 32 ++++++++++++++-----
 .../Egamma/PhotonChainConfiguration.py        |  2 +-
 .../Egamma/TLAPhotonMenuSequences.py          |  2 +-
 3 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/FastPhotonMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/FastPhotonMenuSequences.py
index f343aa5b43a0..3926ad842ff8 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/FastPhotonMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/FastPhotonMenuSequences.py
@@ -1,7 +1,9 @@
 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
+
+
 # menu components   
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool
 from AthenaCommon.CFElements import parOR, seqAND
 from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm
 from DecisionHandling.DecisionHandlingConf import ViewCreatorCentredOnClusterROITool
@@ -13,7 +15,7 @@ from AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
 
 
-def fastPhotonMenuSequence():
+def fastPhotonSequence(flags):
     """Creates secpond step photon sequence"""
     
     from TriggerMenuMT.HLTMenuConfig.CommonSequences.CaloSequences import CaloMenuDefs
@@ -56,19 +58,33 @@ def fastPhotonMenuSequence():
     l2PhotonViewsMaker.ViewNodeName = "photonInViewAlgs"
 
 
-    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastPhotonHypoAlg
-    thePhotonHypo = TrigEgammaFastPhotonHypoAlg()
-    thePhotonHypo.Photons = thePhotonFex.PhotonsName
-    thePhotonHypo.RunInView=True
-
+    
     # this needs to be added:
     #electronDecisionsDumper = DumpDecisions("electronDecisionsDumper", Decisions = [theElectronHypo.Output] )
 
     photonAthSequence = seqAND("photonAthSequence",  [l2PhotonViewsMaker, photonInViewAlgs] )
+    
+    return (photonAthSequence, l2PhotonViewsMaker)
+    
+
+
+def fastPhotonMenuSequence(flags=None):
+    """Creates secpond step photon sequence"""
+
+    # retrieve the reco sequence+IM
+    (photonAthSequence, l2PhotonViewsMaker) = RecoFragmentsPool.retrieve(fastPhotonSequence, flags=None)
+
+    # make the hypo
+    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastPhotonHypoAlg
+    thePhotonHypo = TrigEgammaFastPhotonHypoAlg()
+    thePhotonHypo.Photons = "HLT_FastPhotons"
+    thePhotonHypo.RunInView=True
+
     from TrigEgammaHypo.TrigEgammaFastPhotonHypoTool import TrigEgammaFastPhotonHypoToolFromDict
 
     return MenuSequence( Maker=l2PhotonViewsMaker,
                          Sequence=photonAthSequence,
                          Hypo=thePhotonHypo,
-                         HypoToolGen=TrigEgammaFastPhotonHypoToolFromDict)
+                         HypoToolGen=TrigEgammaFastPhotonHypoToolFromDict
+                         )
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonChainConfiguration.py
index 7a57158ae8d8..813c6539be12 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PhotonChainConfiguration.py
@@ -28,7 +28,7 @@ def fastPhotonCaloSequenceCfg( flags ):
     return fastCaloMenuSequence('Photon', doRinger=False)
     
 def fastPhotonSequenceCfg( flags ):    
-    return fastPhotonMenuSequence()
+    return fastPhotonMenuSequence( flags )
 
 def TLAPhotonSequenceCfg(flags,  HLT_threshold ):
     photonsIn = "HLT_egamma_Photons"
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/TLAPhotonMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/TLAPhotonMenuSequences.py
index f1a8d2456af9..4f8fcb85cd11 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/TLAPhotonMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/TLAPhotonMenuSequences.py
@@ -55,7 +55,7 @@ def TLAPhotonAthSequence(flags, photonsIn, HLT_threshold):
     tlaPhotonViewsMakerAlg.ViewFallThrough = True
     tlaPhotonViewsMakerAlg.RequireParentView = True
     tlaPhotonViewsMakerAlg.Views = "TLAPhotonsViews"
-    tlaPhotonViewsMakerAlg.mergeUsingFeature = True
+    tlaPhotonViewsMakerAlg.mergeUsingFeature = False
 
     tlaPhotonViewsMakerAlg.ViewNodeName = "tlaPhotonInViewAlgs"
 
-- 
GitLab


From abc7102cbd3ddb4867c7095db5b08465e4052498 Mon Sep 17 00:00:00 2001
From: Adam Edward Barton <adam.edward.barton@cern.ch>
Date: Fri, 17 Sep 2021 20:26:50 +0200
Subject: [PATCH 194/347] MuonSpectrometer: Parse database using string_view

---
 .../MuonAlignmentData/MuonAlignmentPar.h      |   2 +-
 .../src/MuonAlignmentPar.cxx                  |   4 +-
 .../src/MuonMDT_CablingAlg.cxx                |   7 +-
 .../MuonTGC_Cabling/src/TGCDatabasePPToSL.cxx |  20 +-
 .../src/TGCDatabaseSLBToROD.cxx               |  16 +-
 .../TGCcabling/src/TGCDatabasePPToSL.cxx      |  18 +-
 .../TGCcabling/src/TGCDatabaseSLBToROD.cxx    |  14 +-
 .../MuonCalibIdentifier/src/MdtGasChannel.cxx |   7 +-
 .../MuonPrdSelector/src/MuonIdCutTool.cxx     |  12 +-
 .../MuonCondAlg/src/CscCondDbAlg.cxx          |  37 ++--
 .../MuonCondAlg/src/MdtCondDbAlg.cxx          | 179 ++++++++--------
 .../MuonCondAlg/src/MuonAlignmentCondAlg.cxx  | 195 +++++++-----------
 .../src/MuonAlignmentErrorDbAlg.cxx           |   4 +-
 .../MuonCondAlg/src/RpcCondDbAlg.cxx          | 111 ++++------
 .../MuonCondData/MuonCondData/CscCondDbData.h |   4 +-
 .../MuonCondData/MuonCondData/MdtCondDbData.h |   8 +-
 .../MuonCondData/RpcCalibDBEntry.h            |   4 +-
 .../MuonCondData/src/CscCondDbData.cxx        |   8 +-
 .../MuonCondData/src/MdtCondDbData.cxx        |  16 +-
 .../MuonCondData/src/RpcCalibDBEntry.cxx      |  51 +++--
 .../MuonCondData/src/RpcCondDbData.cxx        |   4 +-
 .../MuonCondInterface/IMDT_MapConversion.h    |   2 +-
 .../MuonCondSvc/MuonCondSvc/MdtStringUtils.h  |   8 +
 .../MuonCondSvc/src/MdtStringUtils.cxx        |  53 +++++
 .../MuonCondSvc/src/NSWCondUtils.cxx          | 113 ++++------
 .../MuonCondSvc/src/RpcCoolStrSvc.cxx         |   8 +-
 .../MuonCondSvc/src/TGCTriggerDbAlg.cxx       |   2 +-
 .../MuonCondTool/MDT_MapConversion.h          |   2 +-
 .../src/CSC_DCSConditionsTool.cxx             | 108 +++++-----
 .../src/MDT_DCSConditionsRun2Tool.cxx         |  20 +-
 .../src/MDT_DCSConditionsTool.cxx             |  77 +++----
 .../MuonCondTool/src/MDT_DQConditionsTool.cxx |  50 ++---
 .../MuonCondTool/src/MDT_MapConversion.cxx    |  30 +--
 .../src/RPC_DCSConditionsTool.cxx             |  22 +-
 .../src/RpcDetectorStatusDbTool.cxx           | 106 ++++------
 .../MuonAGDDDescription/sTGCDetectorHelper.h  |   2 +
 .../src/sTGCDetectorHelper.cxx                |  19 +-
 .../MuonReadoutGeometry/GlobalUtilities.h     |   4 +-
 .../MuonReadoutGeometry/MuonStation.h         |   2 +-
 .../src/GlobalUtilities.cxx                   |  16 +-
 .../MuonReadoutGeometry/src/MuonStation.cxx   |   4 +-
 .../src/TgcReadoutElement.cxx                 |   6 +-
 .../src/MuonInertMaterialBuilder.cxx          |  17 +-
 .../src/MuonStationBuilder.cxx                |   9 +-
 .../src/MuonStationBuilderCond.cxx            |  76 +++----
 .../src/MuonStationTypeBuilder.cxx            |  50 ++---
 .../src/MuonTrackingGeometryBuilderCond.cxx   |   4 +-
 .../MuonG4SD/src/CSCSensitiveDetector.cxx     |   4 +-
 .../src/CSCSensitiveDetectorCosmics.cxx       |   4 +-
 .../MuonG4SD/src/MDTSensitiveDetector.cxx     |   8 +-
 .../src/MDTSensitiveDetectorCosmics.cxx       |   8 +-
 .../MuonG4SD/src/RPCSensitiveDetector.cxx     |   8 +-
 .../src/RPCSensitiveDetectorCosmics.cxx       |  12 +-
 .../MuonG4SD/src/TGCSensitiveDetector.cxx     |   5 +-
 .../src/TGCSensitiveDetectorCosmics.cxx       |   7 +-
 .../MuonGeoModel/MuonGeoModel/DBReader.h      |  40 ++--
 .../MuonGeoModel/MuonGeoModel/MuonChamber.h   |   2 +-
 .../MuonGeoModel/src/DBReader.cxx             |   2 +-
 .../MuonGeoModel/src/MuonChamber.cxx          | 127 ++++++------
 .../src/MuonSystemDescription.cxx             |   2 -
 .../MuonGeoModel/src/RDBReaderAtlas.cxx       |  69 +++----
 MuonSpectrometer/MuonGeoModel/src/Rpc.cxx     |   2 +-
 .../MuonGeoModel/src/SpacerBeam.cxx           |   8 +-
 .../MuonGeoModel/src/StandardComponent.cxx    |   8 +-
 MuonSpectrometer/MuonGeoModel/src/Station.cxx |  12 +-
 .../MuonIdHelpers/MuonIdHelpers/CscIdHelper.h |   2 +-
 .../MuonIdHelpers/MuonIdHelpers/MmIdHelper.h  |   2 +-
 .../MuonIdHelpers/MuonIdHelper.h              |   2 +-
 .../MuonIdHelpers/MuonIdHelpers/TgcIdHelper.h |   4 +-
 .../MuonIdHelpers/sTgcIdHelper.h              |   2 +-
 .../MuonIdHelpers/src/CscIdHelper.cxx         |   2 +-
 .../MuonIdHelpers/src/MmIdHelper.cxx          |   2 +-
 .../MuonIdHelpers/src/MuonIdHelper.cxx        |   2 +-
 .../MuonIdHelpers/src/TgcIdHelper.cxx         |   4 +-
 .../MuonIdHelpers/src/sTgcIdHelper.cxx        |   2 +-
 .../src/MuonSegmentTruthAssociationAlg.cxx    |   8 +-
 .../MdtRawDataMonitoring/MDTChamber.h         |   2 +-
 .../MdtRawDataMonitoring/MdtRawDataMonAlg.h   |   8 +-
 .../MdtRawDataMonitoring/MdtRawDataValAlg.h   |  10 +-
 .../MdtRawDataMonitoring/src/MDTChamber.cxx   |  71 ++++---
 .../src/MDTRawDataUtils.cxx                   |  16 +-
 .../src/MDTRawDataUtilsRun3.cxx               |   8 +-
 .../src/MdtRawDataValAlg.cxx                  |  20 +-
 83 files changed, 964 insertions(+), 1062 deletions(-)

diff --git a/MuonSpectrometer/MuonAlignment/MuonAlignmentData/MuonAlignmentData/MuonAlignmentPar.h b/MuonSpectrometer/MuonAlignment/MuonAlignmentData/MuonAlignmentData/MuonAlignmentPar.h
index 60c5629a97e7..409fc0f39b85 100755
--- a/MuonSpectrometer/MuonAlignment/MuonAlignmentData/MuonAlignmentData/MuonAlignmentPar.h
+++ b/MuonSpectrometer/MuonAlignment/MuonAlignmentData/MuonAlignmentData/MuonAlignmentPar.h
@@ -17,7 +17,7 @@ public:
     Identifier identify() const { return m_stationId; }
     std::string key() const { return m_stationKey; }
 
-    void setAmdbId(const std::string& type, int jff, int jzz, int job);
+    void setAmdbId(std::string_view type, int jff, int jzz, int job);
     void getAmdbId(std::string& type, int& jff, int& jzz, int& job) const;
 
     bool isNew() const { return m_isNew; }
diff --git a/MuonSpectrometer/MuonAlignment/MuonAlignmentData/src/MuonAlignmentPar.cxx b/MuonSpectrometer/MuonAlignment/MuonAlignmentData/src/MuonAlignmentPar.cxx
index 73ed0dd5a97c..3f658810ac0a 100755
--- a/MuonSpectrometer/MuonAlignment/MuonAlignmentData/src/MuonAlignmentPar.cxx
+++ b/MuonSpectrometer/MuonAlignment/MuonAlignmentData/src/MuonAlignmentPar.cxx
@@ -6,8 +6,8 @@
 
 MuonAlignmentPar::MuonAlignmentPar() : m_Jff(0), m_Jzz(0), m_Job(0), m_isNew(false) {}
 
-void MuonAlignmentPar::setAmdbId(const std::string& type, int jff, int jzz, int job) {
-    m_Type = type;
+void MuonAlignmentPar::setAmdbId(std::string_view type, int jff, int jzz, int job) {
+    m_Type = std::string(type);
     m_Jff = jff;
     m_Jzz = jzz;
     m_Job = job;
diff --git a/MuonSpectrometer/MuonCablings/MuonMDT_Cabling/src/MuonMDT_CablingAlg.cxx b/MuonSpectrometer/MuonCablings/MuonMDT_Cabling/src/MuonMDT_CablingAlg.cxx
index 088d736986f9..4328abcf2321 100644
--- a/MuonSpectrometer/MuonCablings/MuonMDT_Cabling/src/MuonMDT_CablingAlg.cxx
+++ b/MuonSpectrometer/MuonCablings/MuonMDT_Cabling/src/MuonMDT_CablingAlg.cxx
@@ -154,9 +154,8 @@ StatusCode MuonMDT_CablingAlg::execute(){
     // convert the subdetector id to integer
     int subdetectorId = atoi(subdetector_id.c_str());
 
-    std::string delimiter = ",";
-    std::vector<std::string> info_map;
-    MuonCalib::MdtStringUtils::tokenize(map,info_map,delimiter);   
+    char delimiter = ',';
+    auto info_map = MuonCalib::MdtStringUtils::tokenize(map,delimiter);   
     ATH_MSG_VERBOSE( " parsing of the map"  );
 
     int index=0;
@@ -170,7 +169,7 @@ StatusCode MuonMDT_CablingAlg::execute(){
 
     for(unsigned int i=0; i<info_map.size();i++){
       ATH_MSG_VERBOSE( i << "..."<< info_map[i] );
-      int info = atoi(info_map[i].c_str());
+      int info = MuonCalib::MdtStringUtils::atoi(info_map[i]);
       index++;
       // this is a tdcid
       if (index==1) {
diff --git a/MuonSpectrometer/MuonCablings/MuonTGC_Cabling/src/TGCDatabasePPToSL.cxx b/MuonSpectrometer/MuonCablings/MuonTGC_Cabling/src/TGCDatabasePPToSL.cxx
index 4b6ebf7dc731..57090fd3e05a 100644
--- a/MuonSpectrometer/MuonCablings/MuonTGC_Cabling/src/TGCDatabasePPToSL.cxx
+++ b/MuonSpectrometer/MuonCablings/MuonTGC_Cabling/src/TGCDatabasePPToSL.cxx
@@ -15,7 +15,7 @@ TGCDatabasePPToSL::TGCDatabasePPToSL(const std::string& filename,
     : TGCDatabase(TGCDatabase::PPToSL, filename, blockname)
 {
   // read out ascii file and fill database
-  if(m_database.size()==0) readDB();
+  if(m_database.empty()) readDB();
 }
 
 TGCDatabasePPToSL::TGCDatabasePPToSL(const TGCDatabasePPToSL& right)
@@ -28,10 +28,10 @@ void TGCDatabasePPToSL::readDB(void) {
   std::ifstream file(m_filename.c_str());
   std::string buf;
 
-  unsigned int space = m_blockname.find(" ");
-  std::string module = m_blockname.substr(0,space);
-  std::string region = m_blockname.substr(space+1,1);
-  std::string type = m_blockname.substr(space+2);
+  unsigned int space = m_blockname.find(' ');
+  std::string_view module =std::string_view( m_blockname).substr(0,space);
+  std::string_view region = std::string_view(m_blockname).substr(space+1,1);
+  std::string_view type = std::string_view(m_blockname).substr(space+2);
 
   int offset=-1;
   if(type == "WT") offset = 1;
@@ -44,16 +44,16 @@ void TGCDatabasePPToSL::readDB(void) {
   if(type == "S")  offset = 2;
 
   while(getline(file,buf)){
-    if(buf.substr(0,1)==region) break;
+    if(buf.compare(0,1,region)==0) break;
   }
 
   while(getline(file,buf)){
-    if(buf.substr(1,module.size())==module) break;
+    if(buf.compare(1,module.size(),module)==0) break;
   }
 
   while(getline(file,buf)){
-    if(buf.substr(0,2)!="  ") break;
-    if(buf.substr(2,1)=="0") offset--;
+    if(buf.compare(0,2,"  ")!=0) break;
+    if(buf.compare(2,1,"0")==0) offset--;
     if(offset==0){
       std::istringstream line(buf);
       std::vector<int> entry;
@@ -62,7 +62,7 @@ void TGCDatabasePPToSL::readDB(void) {
         line >> temp; 
         entry.push_back(temp);
       }
-      m_database.push_back(entry);
+      m_database.emplace_back(std::move(entry));
     }
   }
   
diff --git a/MuonSpectrometer/MuonCablings/MuonTGC_Cabling/src/TGCDatabaseSLBToROD.cxx b/MuonSpectrometer/MuonCablings/MuonTGC_Cabling/src/TGCDatabaseSLBToROD.cxx
index c02386de14ed..f889491cc46a 100644
--- a/MuonSpectrometer/MuonCablings/MuonTGC_Cabling/src/TGCDatabaseSLBToROD.cxx
+++ b/MuonSpectrometer/MuonCablings/MuonTGC_Cabling/src/TGCDatabaseSLBToROD.cxx
@@ -15,7 +15,7 @@ TGCDatabaseSLBToROD::TGCDatabaseSLBToROD(const std::string& filename,
    : TGCDatabase(TGCDatabase::SLBToROD, filename, blockname)
 {
   // read out ascii file and fill database
-  if(m_database.size()==0) readDB();
+  if(m_database.empty()) readDB();
 }
 
 TGCDatabaseSLBToROD::TGCDatabaseSLBToROD(const TGCDatabaseSLBToROD& right)
@@ -27,20 +27,20 @@ void TGCDatabaseSLBToROD::readDB(void) {
   std::ifstream file(m_filename.c_str());
   std::string buf;
 
-  unsigned int space = m_blockname.find(" ");
-  std::string module = m_blockname.substr(0,space);
-  std::string type = m_blockname.substr(space+1);
+  unsigned int space = m_blockname.find(' ');
+  std::string_view module = std::string_view(m_blockname).substr(0,space);
+  std::string_view type = std::string_view(m_blockname).substr(space+1);
 
   while(getline(file,buf)){
-    if(buf.substr(0,module.size())==module) break;
+    if(buf.compare(0,module.size(),module)==0) break;
   }
 
   while(getline(file,buf)){
-    if(buf.substr(1,type.size())==type) break;
+    if(buf.compare(1,type.size(),type)==0) break;
   }
 
   while(getline(file,buf)){
-    if(buf.substr(0,2)!="  ") break;
+    if(buf.compare(0,2,"  ")!=0) break;
     std::istringstream line(buf);
     std::vector<int> entry;
     for(int i=0; i<6; i++){
@@ -48,7 +48,7 @@ void TGCDatabaseSLBToROD::readDB(void) {
       line >> temp; 
       entry.push_back(temp);
     }
-    m_database.push_back(entry);
+    m_database.emplace_back(std::move(entry));
   }
   
   file.close();
diff --git a/MuonSpectrometer/MuonCablings/TGCcabling/src/TGCDatabasePPToSL.cxx b/MuonSpectrometer/MuonCablings/TGCcabling/src/TGCDatabasePPToSL.cxx
index dc396a4e24df..a3999dbbba1e 100755
--- a/MuonSpectrometer/MuonCablings/TGCcabling/src/TGCDatabasePPToSL.cxx
+++ b/MuonSpectrometer/MuonCablings/TGCcabling/src/TGCDatabasePPToSL.cxx
@@ -15,10 +15,10 @@ void TGCDatabasePPToSL::readDB (void) {
   std::ifstream file(m_filename.c_str());
   std::string buf;
 
-  unsigned int space = m_blockname.find(" ");
-  std::string module = m_blockname.substr(0,space);
-  std::string region = m_blockname.substr(space+1,1);
-  std::string type = m_blockname.substr(space+2);
+  unsigned int space = m_blockname.find(' ');
+  std::string_view module = std::string_view(m_blockname).substr(0,space);
+  std::string_view region = std::string_view(m_blockname).substr(space+1,1);
+  std::string_view type = std::string_view(m_blockname).substr(space+2);
 
   int offset=-1;
   if(type == "WT") offset = 1;
@@ -31,16 +31,16 @@ void TGCDatabasePPToSL::readDB (void) {
   if(type == "S")  offset = 2;
 
   while(getline(file,buf)){
-    if(buf.substr(0,1)==region) break;
+    if(buf.compare(0,1, region)==0) break;
   }
 
   while(getline(file,buf)){
-    if(buf.substr(1,module.size())==module) break;
+    if(buf.compare(1,module.size(), module)==0) break;
   }
 
   while(getline(file,buf)){
-    if(buf.substr(0,2)!="  ") break;
-    if(buf.substr(2,1)=="0") offset--;
+    if(buf.compare(0,2,"  ")!=0) break;
+    if(buf.compare(2,1,"0")==0) offset--;
     if(offset==0){
       std::istringstream line(buf);
       std::vector<int> entry;
@@ -49,7 +49,7 @@ void TGCDatabasePPToSL::readDB (void) {
         line >> temp; 
         entry.push_back(temp);
       }
-      m_database.push_back(entry);
+      m_database.emplace_back(std::move(entry));
     }
   }
   
diff --git a/MuonSpectrometer/MuonCablings/TGCcabling/src/TGCDatabaseSLBToROD.cxx b/MuonSpectrometer/MuonCablings/TGCcabling/src/TGCDatabaseSLBToROD.cxx
index 68642cc11b38..157b00c34443 100755
--- a/MuonSpectrometer/MuonCablings/TGCcabling/src/TGCDatabaseSLBToROD.cxx
+++ b/MuonSpectrometer/MuonCablings/TGCcabling/src/TGCDatabaseSLBToROD.cxx
@@ -15,20 +15,20 @@ void TGCDatabaseSLBToROD::readDB (void) {
   std::ifstream file(m_filename.c_str());
   std::string buf;
 
-  unsigned int space = m_blockname.find(" ");
-  std::string module = m_blockname.substr(0,space);
-  std::string type = m_blockname.substr(space+1);
+  unsigned int space = m_blockname.find(' ');
+  std::string_view module = std::string_view(m_blockname).substr(0,space);
+  std::string_view type = std::string_view(m_blockname).substr(space+1);
 
   while(getline(file,buf)){
-    if(buf.substr(0,module.size())==module) break;
+    if(buf.compare(0,module.size(),module)==0) break;
   }
 
   while(getline(file,buf)){
-    if(buf.substr(1,type.size())==type) break;
+    if(buf.compare(1,type.size(),type)==0) break;
   }
 
   while(getline(file,buf)){
-    if(buf.substr(0,2)!="  ") break;
+    if(buf.compare(0,2,"  ")!=0) break;
     std::istringstream line(buf);
     std::vector<int> entry;
     for(int i=0; i<4; i++){
@@ -36,7 +36,7 @@ void TGCDatabaseSLBToROD::readDB (void) {
       line >> temp; 
       entry.push_back(temp);
     }
-    m_database.push_back(entry);
+    m_database.emplace_back(std::move(entry));
   }
   
   file.close();
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MdtGasChannel.cxx b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MdtGasChannel.cxx
index 147869b686dc..3307f4a4e766 100644
--- a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MdtGasChannel.cxx
+++ b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MdtGasChannel.cxx
@@ -44,16 +44,13 @@ bool MdtGasChannel::readFile()
 		lnstr>>chan;
 		if(lnstr.eof()) continue;
 		lnstr>>stations;
-		if((pos=chan.find("/"))==std::string::npos) continue;
+		if((pos=chan.find('/'))==std::string::npos) continue;
 		chan[pos]=' ';
 		std::istringstream chanstr(chan);
 		GasChannel c;
 		chanstr>>c.first;
 		chanstr>>c.second;
-		while((pos=stations.find(","))!=std::string::npos)
-			{
-			stations[pos]=' ';
-			}
+		std::replace(stations.begin(), stations.end(), ',', ' ');
 		std::istringstream st_stream(stations);
 		std::string station;
 		while(1)
diff --git a/MuonSpectrometer/MuonCnv/MuonPrdSelector/src/MuonIdCutTool.cxx b/MuonSpectrometer/MuonCnv/MuonPrdSelector/src/MuonIdCutTool.cxx
index f017b71f949d..f7c7f3de6d63 100644
--- a/MuonSpectrometer/MuonCnv/MuonPrdSelector/src/MuonIdCutTool.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonPrdSelector/src/MuonIdCutTool.cxx
@@ -6,7 +6,7 @@
 
 #include "MuonCalibTools/IdToFixedIdTool.h"
 #include "MuonCalibIdentifier/MuonFixedId.h"
-
+#include "MuonCondSvc/MdtStringUtils.h"
 
 //Tool to impliment a set of cuts on an Identifier, and then determine if a given ID is in that set
 
@@ -72,15 +72,15 @@ StatusCode MuonIdCutTool::initialize() {
   int max = m_EELList.size();
   
   for(int i=0;i<max;i++){
-    std::string cut = m_EELList[i];
+    std::string_view cut = m_EELList[i];
     ATH_MSG_DEBUG( "EEL String: "  << cut  );
     size_t length = cut.size();
     size_t loc = cut.find('/');
     if (loc!=std::string::npos){
-      std::string etaString = cut.substr(0,loc);
-      std::string sectorString = cut.substr(loc+1,length-loc-1);
-      int eta = atoi(etaString.c_str());
-      int sector = atoi(sectorString.c_str());
+      std::string_view etaString = cut.substr(0,loc);
+      std::string_view sectorString = cut.substr(loc+1,length-loc-1);
+      int eta =   MuonCalib::MdtStringUtils::atoi(etaString);
+      int sector =  MuonCalib::MdtStringUtils::atoi(sectorString);
 
       ATH_MSG_DEBUG( "EEL eta/phi string: "<< etaString << " " << sectorString  );
       ATH_MSG_DEBUG( "EEL eta/phi int: "<< eta << " " << sector  );
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/CscCondDbAlg.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/CscCondDbAlg.cxx
index df7780722a85..ccda0c7b9747 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/CscCondDbAlg.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/CscCondDbAlg.cxx
@@ -115,7 +115,7 @@ StatusCode CscCondDbAlg::loadDataHv(writeHandle_t& writeHandle, CscCondDbData* w
     CondAttrListCollection::const_iterator itr;
     std::map<Identifier, int> layerMap;
     int hv_state, lv_state, hv_setpoint0, hv_setpoint1;
-
+    using namespace MuonCalib;
     unsigned int chan_index = 0;
     for (itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
         unsigned int chanNum = readCdo->chanNum(chan_index);
@@ -129,27 +129,26 @@ StatusCode CscCondDbAlg::loadDataHv(writeHandle_t& writeHandle, CscCondDbData* w
             hv_setpoint0 = *(static_cast<const int*>((atr["HVSetpoint0"]).addressOfData()));
             hv_setpoint1 = *(static_cast<const int*>((atr["HVSetpoint1"]).addressOfData()));
 
-            std::string delimiter = "_";
-            std::vector<std::string> tokens;
-            MuonCalib::MdtStringUtils::tokenize(csc_chan_name, tokens, delimiter);
+            char delimiter = '_';
+            auto tokens = MuonCalib::MdtStringUtils::tokenize(csc_chan_name, delimiter);
 
             if ((hv_state != 1 or lv_state != 1 or hv_setpoint0 < 1000 or hv_setpoint1 < 1000) && !tokens.empty()) {
-                std::string layer = tokens[1];
-                std::string number_layer = tokens[1].substr(1, 2);
-                int wirelayer = atoi(const_cast<char*>(number_layer.c_str()));
+                std::string_view layer = tokens[1];
+                std::string_view number_layer = tokens[1].substr(1, 2);
+                int wirelayer = MdtStringUtils::atoi(number_layer);
 
                 int eta = 0;
-                std::string eta_side = tokens[0].substr(0, 1);
-                if (eta_side == "A") eta = +1;
-                if (eta_side == "C") eta = -1;
+                char eta_side = tokens[0][0];
+                if (eta_side == 'A') eta = +1;
+                if (eta_side == 'C') eta = -1;
 
-                std::string chamber_name;
-                std::string size_side = tokens[0].substr(1, 1);
-                if (size_side == "L") chamber_name = "CSL";
-                if (size_side == "S") chamber_name = "CSS";
+                std::string_view chamber_name;
+                char size_side = tokens[0][1];
+                if (size_side == 'L') chamber_name = "CSL";
+                if (size_side == 'S') chamber_name = "CSS";
 
                 int phi = 0;
-                std::string sector_side = tokens[0].substr(2, 4);
+                std::string_view sector_side = tokens[0].substr(2, 4);
                 if (sector_side == "01" || sector_side == "02") phi = 1;
                 if (sector_side == "03" || sector_side == "04") phi = 2;
                 if (sector_side == "05" || sector_side == "06") phi = 3;
@@ -161,7 +160,13 @@ StatusCode CscCondDbAlg::loadDataHv(writeHandle_t& writeHandle, CscCondDbData* w
 
                 Identifier ChamberId = m_idHelperSvc->cscIdHelper().elementID(chamber_name, eta, phi);
                 Identifier WireLayerId = m_idHelperSvc->cscIdHelper().channelID(ChamberId, 1, wirelayer, 1, 1);
-                std::string WireLayerstring = chamber_name + "_" + eta_side + "_" + sector_side + "_" + layer;
+                std::string WireLayerstring = std::string(chamber_name);
+                WireLayerstring += '_';
+                WireLayerstring += eta_side;
+                WireLayerstring += '_';
+                WireLayerstring += sector_side;
+                WireLayerstring += '_';
+                WireLayerstring += layer;
 
                 writeCdo->setDeadLayer(WireLayerstring, WireLayerId);
                 if (layerMap.count(ChamberId) == 0) layerMap[ChamberId] = 0;
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MdtCondDbAlg.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MdtCondDbAlg.cxx
index fe6ec8a4636f..f5b84d4a9af8 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MdtCondDbAlg.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MdtCondDbAlg.cxx
@@ -111,34 +111,36 @@ StatusCode MdtCondDbAlg::loadDataPsHv(writeHandle_t& wh, MdtCondDbData* writeCdo
 
         if (atr.size() == 1) {
             hv_name = *(static_cast<const std::string*>((atr["fsm_currentState"]).addressOfData()));
-            std::string delimiter = " ";
-            std::vector<std::string> tokens;
-            MuonCalib::MdtStringUtils::tokenize(hv_name, tokens, delimiter);
+            char delimiter = ' ';
+            auto tokens = MuonCalib::MdtStringUtils::tokenize(hv_name, delimiter);
 
             std::string thename;
-            std::string delimiter2 = "_";
-            std::vector<std::string> tokens2;
-            MuonCalib::MdtStringUtils::tokenize(hv_payload, tokens2, delimiter2);
+            char delimiter2 = '_';
+            auto tokens2 = MuonCalib::MdtStringUtils::tokenize(hv_payload, delimiter2);
 
             if (tokens[0] != "ON" && tokens[0] != "STANDBY" && tokens[0] != "UNKNOWN") {
-                int multilayer = atoi((tokens2[3].c_str()));
-                std::string chamber_name = tokens2[2];
+                int multilayer = MuonCalib::MdtStringUtils::atoi(tokens2[3]);
+                const auto  &chamber_name = tokens2[2];
                 Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
                 if (ChamberId.is_valid()) {
                     Identifier MultiLayerId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, multilayer, 1, 1);
-                    thename = chamber_name + "_multilayer" + tokens2[3];
+                    thename = std::string(chamber_name);
+                    thename += "_multilayer";
+                    thename += tokens2[3];
                     writeCdo->setDeadMultilayer(thename, MultiLayerId);
                     writeCdo->setDeadChamber(ChamberId);
                     cachedDeadMultiLayersId_standby.push_back(MultiLayerId);
                 }
             }
             if (tokens[0] == "STANDBY") {
-                int multilayer = atoi((tokens2[3].c_str()));
-                std::string chamber_name = tokens2[2];
+                int multilayer = MuonCalib::MdtStringUtils::atoi(tokens2[3]);
+                const auto &chamber_name = tokens2[2];
                 Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
                 if (ChamberId.is_valid()) {
                     Identifier MultiLayerId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, multilayer, 1, 1);
-                    thename = chamber_name + "_multilayer" + tokens2[3];
+                    thename = std::string(chamber_name);
+                    thename += "_multilayer";
+                    thename += tokens2[3];
                     writeCdo->setDeadMultilayer(thename, MultiLayerId);
                     writeCdo->setDeadChamber(ChamberId);
                     cachedDeadMultiLayersId_standby.push_back(MultiLayerId);
@@ -188,17 +190,18 @@ StatusCode MdtCondDbAlg::loadDataPsHv(writeHandle_t& wh, MdtCondDbData* writeCdo
 
         if (atr_v0.size() == 1) {
             setPointsV0_name = *(static_cast<const float*>((atr_v0["readBackSettings_v0"]).addressOfData()));
-            std::string delimiter2 = "_";
-            std::vector<std::string> tokens2;
-            MuonCalib::MdtStringUtils::tokenize(setPointsV0_payload, tokens2, delimiter2);
-
-            int multilayer = atoi(tokens2[3].c_str());
-            std::string chamber_name = tokens2[2];
-            std::string thename = chamber_name + "_" + tokens2[3];
+            char delimiter2 = '_';
+            auto tokens2 = MuonCalib::MdtStringUtils::tokenize(setPointsV0_payload, delimiter2);
+
+            int multilayer = MuonCalib::MdtStringUtils::atoi(tokens2[3]);
+            const auto &chamber_name = tokens2[2];
+            std::string thename = std::string(chamber_name);
+            thename += '_';
+            thename += tokens2[3];
             Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name);
             Identifier MultiLayerId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, multilayer, 1, 1);
             chamberML_V0[MultiLayerId] = setPointsV0_name;
-            mlname[MultiLayerId] = thename;
+            mlname[MultiLayerId] = std::move(thename);
         }
     }
 
@@ -213,17 +216,18 @@ StatusCode MdtCondDbAlg::loadDataPsHv(writeHandle_t& wh, MdtCondDbData* writeCdo
         if (atr_v1.size() == 1) {
             setPointsV1_name = *(static_cast<const float*>((atr_v1["readBackSettings_v1"]).addressOfData()));
 
-            std::string delimiter2 = "_";
-            std::vector<std::string> tokens2;
-            MuonCalib::MdtStringUtils::tokenize(setPointsV1_payload, tokens2, delimiter2);
+            char delimiter2 = '_';
+            auto tokens2= MuonCalib::MdtStringUtils::tokenize(setPointsV1_payload, delimiter2);
 
-            int multilayer = atoi(tokens2[3].c_str());
-            std::string chamber_name = tokens2[2];
-            std::string thename = chamber_name + "_" + tokens2[3];
+            int multilayer = MuonCalib::MdtStringUtils::atoi(tokens2[3]);
+            const auto &chamber_name = tokens2[2];
+            std::string thename = std::string(chamber_name);
+            thename += '_';
+            thename += tokens2[3];
             Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name);
             Identifier MultiLayerId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, multilayer, 1, 1);
             chamberML_V1[MultiLayerId] = setPointsV1_name;
-            mlname[MultiLayerId] = thename;
+            mlname[MultiLayerId] = std::move(thename);
         }
     }
 
@@ -266,15 +270,13 @@ StatusCode MdtCondDbAlg::loadDataPsLv(writeHandle_t& wh, MdtCondDbData* writeCdo
 
         if (!atr.size()) { continue; }
         hv_name = *(static_cast<const std::string*>((atr["fsm_currentState"]).addressOfData()));
-        std::string delimiter = " ";
-        std::vector<std::string> tokens;
-        MuonCalib::MdtStringUtils::tokenize(hv_name, tokens, delimiter);
-        std::string delimiter2 = "_";
-        std::vector<std::string> tokens2;
-        MuonCalib::MdtStringUtils::tokenize(hv_payload, tokens2, delimiter2);
+        char delimiter = ' ';
+        auto tokens = MuonCalib::MdtStringUtils::tokenize(hv_name, delimiter);
+        char delimiter2 = '_';
+        auto tokens2 = MuonCalib::MdtStringUtils::tokenize(hv_payload, delimiter2);
 
         if (tokens[0] != "ON") {
-            std::string chamber_name = tokens2[2];
+            const auto &chamber_name = tokens2[2];
             Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
             if (ChamberId.is_valid()) { writeCdo->setDeadStation(chamber_name, ChamberId); }
         }
@@ -314,17 +316,16 @@ StatusCode MdtCondDbAlg::loadDataHv(writeHandle_t& wh, MdtCondDbData* writeCdo,
         hv_v1_ml2 = *(static_cast<const float*>((atr["v1set_ML2"]).addressOfData()));
 
         std::string thename;
-        std::string delimiter2 = "_";
-        std::vector<std::string> tokens2;
-        MuonCalib::MdtStringUtils::tokenize(hv_payload, tokens2, delimiter2);
+        char delimiter2 = '_';
+        auto tokens2 = MuonCalib::MdtStringUtils::tokenize(hv_payload, delimiter2);
 
         if (hv_name_ml1 != "ON" && hv_name_ml1 != "STANDBY" && hv_name_ml1 != "UNKNOWN") {
             int multilayer = 1;
-            std::string chamber_name = tokens2[0];
+            const auto &chamber_name = tokens2[0];
             Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
             if (ChamberId.is_valid()) {
                 Identifier MultiLayerId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, multilayer, 1, 1);
-                thename = chamber_name + "_multilayer1";
+                thename = std::string(chamber_name) + "_multilayer1";
                 writeCdo->setDeadMultilayer(thename, MultiLayerId);
                 writeCdo->setDeadChamber(ChamberId);
             }
@@ -332,11 +333,11 @@ StatusCode MdtCondDbAlg::loadDataHv(writeHandle_t& wh, MdtCondDbData* writeCdo,
 
         if (hv_name_ml1 == "STANDBY" && hv_v0_ml1 != hv_v1_ml1) {
             int multilayer = 1;
-            std::string chamber_name = tokens2[0];
+            const auto &chamber_name = tokens2[0];
             Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
             if (ChamberId.is_valid()) {
                 Identifier MultiLayerId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, multilayer, 1, 1);
-                thename = chamber_name + "_multilayer1";
+                thename = std::string(chamber_name) + "_multilayer1";
                 writeCdo->setDeadMultilayer(thename, MultiLayerId);
                 writeCdo->setDeadChamber(ChamberId);
             }
@@ -344,11 +345,11 @@ StatusCode MdtCondDbAlg::loadDataHv(writeHandle_t& wh, MdtCondDbData* writeCdo,
 
         if (hv_name_ml2 != "ON" && hv_name_ml2 != "STANDBY" && hv_name_ml2 != "UNKNOWN") {
             int multilayer = 2;
-            std::string chamber_name = tokens2[0];
+            const auto &chamber_name = tokens2[0];
             Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
             if (ChamberId.is_valid()) {
                 Identifier MultiLayerId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, multilayer, 1, 1);
-                thename = chamber_name + "_multilayer2";
+                thename = std::string(chamber_name) + "_multilayer2";
                 writeCdo->setDeadMultilayer(thename, MultiLayerId);
                 writeCdo->setDeadChamber(ChamberId);
             }
@@ -356,11 +357,11 @@ StatusCode MdtCondDbAlg::loadDataHv(writeHandle_t& wh, MdtCondDbData* writeCdo,
 
         if (hv_name_ml2 == "STANDBY" && hv_v0_ml2 != hv_v1_ml2) {
             int multilayer = 2;
-            std::string chamber_name = tokens2[0];
+            const auto &chamber_name = tokens2[0];
             Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
             if (ChamberId.is_valid()) {
                 Identifier MultiLayerId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, multilayer, 1, 1);
-                thename = chamber_name + "_multilayer2";
+                thename = std::string(chamber_name) + "_multilayer2";
                 writeCdo->setDeadMultilayer(thename, MultiLayerId);
                 writeCdo->setDeadChamber(ChamberId);
             }
@@ -368,12 +369,12 @@ StatusCode MdtCondDbAlg::loadDataHv(writeHandle_t& wh, MdtCondDbData* writeCdo,
 
         if (hv_name_ml2 != "ON" && hv_name_ml2 != "STANDBY" && hv_name_ml2 != "UNKNOWN" && hv_name_ml1 != "ON" &&
             hv_name_ml1 != "STANDBY" && hv_name_ml1 != "UNKNOWN") {
-            std::string chamber_name = tokens2[0];
+            const auto &chamber_name = tokens2[0];
             Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
             if (ChamberId.is_valid()) { writeCdo->setDeadStation(chamber_name, ChamberId); }
         }
         if (hv_name_ml2 == "STANDBY" && hv_v0_ml2 != hv_v1_ml2 && hv_name_ml1 == "STANDBY" && hv_v0_ml1 != hv_v1_ml1) {
-            std::string chamber_name = tokens2[0];
+            const auto &chamber_name = tokens2[0];
             Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
             if (ChamberId.is_valid()) { writeCdo->setDeadStation(chamber_name, ChamberId); }
         }
@@ -402,15 +403,13 @@ StatusCode MdtCondDbAlg::loadDataLv(writeHandle_t& wh, MdtCondDbData* writeCdo,
 
         if (!atr.size()) { continue; }
         hv_name = *(static_cast<const std::string*>((atr["fsmCurrentState_LV"]).addressOfData()));
-        std::string delimiter = " ";
-        std::vector<std::string> tokens;
-        MuonCalib::MdtStringUtils::tokenize(hv_name, tokens, delimiter);
-        std::string delimiter2 = "_";
-        std::vector<std::string> tokens2;
-        MuonCalib::MdtStringUtils::tokenize(hv_payload, tokens2, delimiter2);
+        char delimiter = ' ';
+        auto tokens = MuonCalib::MdtStringUtils::tokenize(hv_name, delimiter);
+        char delimiter2 = '_';
+        auto tokens2 = MuonCalib::MdtStringUtils::tokenize(hv_payload, delimiter2);
 
         if (tokens[0] != "ON") {
-            std::string chamber_name = tokens2[0];
+            const auto &chamber_name = tokens2[0];
             Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
             if (ChamberId.is_valid()) { writeCdo->setDeadStation(chamber_name, ChamberId); }
         }
@@ -437,12 +436,11 @@ StatusCode MdtCondDbAlg::loadDroppedChambers(writeHandle_t& wh, MdtCondDbData* w
         std::string chamber_dropped;
         chamber_dropped = *(static_cast<const std::string*>((atr["Chambers_disabled"]).addressOfData()));
 
-        std::string delimiter = " ";
-        std::vector<std::string> tokens;
-        MuonCalib::MdtStringUtils::tokenize(chamber_dropped, tokens, delimiter);
+        char delimiter = ' ';
+        auto tokens = MuonCalib::MdtStringUtils::tokenize(chamber_dropped, delimiter);
         for (unsigned int i = 0; i < tokens.size(); i++) {
             if (tokens[i] != "0") {
-                std::string chamber_name = tokens[i];
+                const auto &chamber_name = tokens[i];
                 Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name, true);
                 if (ChamberId.is_valid()) { writeCdo->setDeadStation(chamber_name, ChamberId); }
             }
@@ -474,22 +472,21 @@ StatusCode MdtCondDbAlg::loadMcDeadElements(writeHandle_t& wh, MdtCondDbData* wr
         list_tube = *(static_cast<const std::string*>((atr["Dead_tube"]).addressOfData()));
 
         std::string thename;
-        std::string delimiter = " ";
-        std::vector<std::string> tokens;
-        std::vector<std::string> tokens_mlayer;
-        std::vector<std::string> tokens_layer;
+        char delimiter = ' ';
         Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name);
-        MuonCalib::MdtStringUtils::tokenize(list_tube, tokens, delimiter);
-        MuonCalib::MdtStringUtils::tokenize(list_mlayer, tokens_mlayer, delimiter);
-        MuonCalib::MdtStringUtils::tokenize(list_layer, tokens_layer, delimiter);
+        auto tokens = MuonCalib::MdtStringUtils::tokenize(list_tube, delimiter);
+        auto tokens_mlayer = MuonCalib::MdtStringUtils::tokenize(list_mlayer, delimiter);
+        auto tokens_layer = MuonCalib::MdtStringUtils::tokenize(list_layer, delimiter);
 
         for (unsigned int i = 0; i < tokens.size(); i++) {
             if (tokens[i] != "0") {
-                int ml = atoi((tokens[i].substr(0, 1)).c_str());
-                int layer = atoi((tokens[i].substr(1, 2)).c_str());
-                int tube = atoi((tokens[i].substr(2)).c_str());
+                int ml = MuonCalib::MdtStringUtils::atoi(tokens[i].substr(0, 1));
+                int layer = MuonCalib::MdtStringUtils::atoi(tokens[i].substr(1, 2));
+                int tube = MuonCalib::MdtStringUtils::atoi(tokens[i].substr(2));
                 Identifier ChannelId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, ml, layer, tube);
-                thename = chamber_name + "_" + tokens[i];
+                thename = chamber_name;
+                thename += '_';
+                thename += tokens[i];
                 writeCdo->setDeadTube(thename, ChannelId);
                 writeCdo->setDeadChamber(ChamberId);
             }
@@ -497,9 +494,11 @@ StatusCode MdtCondDbAlg::loadMcDeadElements(writeHandle_t& wh, MdtCondDbData* wr
 
         for (unsigned int i = 0; i < tokens_mlayer.size(); i++) {
             if (tokens_mlayer[i] != "0") {
-                int ml = atoi((tokens_mlayer[i].substr(0)).c_str());
+                int ml = MuonCalib::MdtStringUtils::atoi(tokens_mlayer[i].substr(0));
                 Identifier ChannelId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, ml, 1, 1);
-                thename = chamber_name + "_" + tokens[i];
+                thename = chamber_name;
+                thename += '_';
+                thename += tokens[i];
                 writeCdo->setDeadMultilayer(thename, ChannelId);
                 writeCdo->setDeadChamber(ChamberId);
             }
@@ -507,10 +506,12 @@ StatusCode MdtCondDbAlg::loadMcDeadElements(writeHandle_t& wh, MdtCondDbData* wr
 
         for (unsigned int i = 0; i < tokens_layer.size(); i++) {
             if (tokens_layer[i] != "0") {
-                int ml = atoi((tokens_layer[i].substr(0, 1)).c_str());
-                int layer = atoi((tokens_layer[i].substr(1)).c_str());
+                int ml = MuonCalib::MdtStringUtils::atoi(tokens_layer[i].substr(0, 1));
+                int layer = MuonCalib::MdtStringUtils::atoi(tokens_layer[i].substr(1));
                 Identifier ChannelId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, ml, layer, 1);
-                thename = chamber_name + "_" + tokens[i];
+                thename = chamber_name;
+                thename += '_';
+                thename += tokens[i];
                 writeCdo->setDeadLayer(thename, ChannelId);
                 writeCdo->setDeadChamber(ChamberId);
             }
@@ -543,17 +544,19 @@ StatusCode MdtCondDbAlg::loadMcDeadTubes(writeHandle_t& wh, MdtCondDbData* write
         chamber_name = *(static_cast<const std::string*>((atr["Chamber_Name"]).addressOfData()));
 
         std::string thename;
-        std::vector<std::string> tokens;
-        std::string delimiter = " ";
-        MuonCalib::MdtStringUtils::tokenize(dead_tube, tokens, delimiter);
+        char delimiter = ' ';
+        auto tokens = MuonCalib::MdtStringUtils::tokenize(dead_tube, delimiter);
         Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name);
 
         for (unsigned int i = 0; i < tokens.size(); i++) {
-            int ml = atoi((tokens[i].substr(0, 1)).c_str());
-            int layer = atoi((tokens[i].substr(1, 2)).c_str());
-            int tube = atoi((tokens[i].substr(2)).c_str());
-            thename = chamber_name + "_" + tokens[i];
-            tube_list = tokens[i] + ".";
+            int ml = MuonCalib::MdtStringUtils::atoi(tokens[i].substr(0, 1));
+            int layer = MuonCalib::MdtStringUtils::atoi(tokens[i].substr(1, 2));
+            int tube = MuonCalib::MdtStringUtils::atoi(tokens[i].substr(2));
+            thename = chamber_name;
+            thename += '_';
+            thename += tokens[i];
+            tube_list = tokens[i];
+            tube_list += '.';
             Identifier ChannelId = m_idHelperSvc->mdtIdHelper().channelID(ChamberId, ml, layer, tube);
             writeCdo->setDeadTube(thename, ChannelId);
         }
@@ -585,15 +588,13 @@ StatusCode MdtCondDbAlg::loadMcNoisyChannels(writeHandle_t& wh, MdtCondDbData* w
 
         if (atr.size()) {
             hv_name = *(static_cast<const std::string*>((atr["fsm_currentState"]).addressOfData()));
-            std::string delimiter = " ";
-            std::vector<std::string> tokens;
-            MuonCalib::MdtStringUtils::tokenize(hv_name, tokens, delimiter);
-            std::string delimiter2 = "_";
-            std::vector<std::string> tokens2;
-            MuonCalib::MdtStringUtils::tokenize(hv_payload, tokens2, delimiter2);
+            char delimiter = ' ';
+            auto tokens = MuonCalib::MdtStringUtils::tokenize(hv_name, delimiter);
+            char delimiter2 = '_';
+            auto tokens2 = MuonCalib::MdtStringUtils::tokenize(hv_payload, delimiter2);
 
             if (tokens[0] != "ON") {
-                std::string chamber_name = tokens2[2];
+                const auto &chamber_name = tokens2[2];
                 Identifier ChamberId = m_condMapTool->ConvertToOffline(chamber_name);
                 writeCdo->setDeadStation(chamber_name, ChamberId);
             }
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MuonAlignmentCondAlg.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MuonAlignmentCondAlg.cxx
index 8705b75c43f0..7c64daf532f7 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MuonAlignmentCondAlg.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MuonAlignmentCondAlg.cxx
@@ -187,35 +187,30 @@ StatusCode MuonAlignmentCondAlg::loadAlignABLines() {
 }
 
 StatusCode MuonAlignmentCondAlg::loadAlignABLinesData(const std::string& folderName, const std::string& data, nlohmann::json& json, bool hasBLine) {
-    // Check the first word to see if it is a correction
-    std::string type;
 
+    using namespace MuonCalib;
     // Parse corrections
-    std::string since_str;
-    std::string till_str;
-    std::string delimiter = "\n";
+    char delimiter = '\n';
 
     json = nlohmann::json::array();
-    std::vector<std::string> lines;
-    MuonCalib::MdtStringUtils::tokenize(data, lines, delimiter);
-    for (const std::string& blobline : lines) {
+    auto lines = MdtStringUtils::tokenize(data, delimiter);
+    for (const std::string_view& blobline : lines) {
         nlohmann::json line;
-        std::string delimiter = ":";
-        std::vector<std::string> tokens;
-        MuonCalib::MdtStringUtils::tokenize(blobline, tokens, delimiter);
+        char delimiter = ':';
+        const auto tokens = MdtStringUtils::tokenize(blobline, delimiter);
 
         // Check if tokens is not empty
         if (tokens.empty()) {
             ATH_MSG_FATAL("Empty string retrieved from DB in folder " << folderName);
             return StatusCode::FAILURE;
         }
-        type = tokens[0];
+        const std::string_view &type = tokens[0];
         // Parse line
-        if (type.find('#') == 0) {
+        if (type[0] == '#') {
             // skip it
             continue;
         }
-        if (type.find("Corr") == 0) {
+        if (type.compare(0, 4, "Corr") == 0) {
             //#: Corr line is counter typ,  jff,  jzz, job,                         * Chamber information
             //#:                       svalue,  zvalue, tvalue,  tsv,  tzv,  ttv,   * A lines
             //#:                       bz, bp, bn, sp, sn, tw, pg, tr, eg, ep, en   * B lines
@@ -224,9 +219,8 @@ StatusCode MuonAlignmentCondAlg::loadAlignABLinesData(const std::string& folderN
             // Corr: EMS  4   1  0     2.260     3.461    28.639 -0.002402 -0.002013  0.000482    -0.006    -0.013 -0.006000  0.000000
             // 0.000000     0.026    -0.353  0.000000  0.070000  0.012000    -0.012    EMS1A08
 
-            std::string delimiter = " ";
-            std::vector<std::string> tokens;
-            MuonCalib::MdtStringUtils::tokenize(blobline, tokens, delimiter);
+            char delimiter = ' ';
+            auto tokens = MdtStringUtils::tokenize(blobline, delimiter);
 
             // Check if tokens has the right length
             // if (tokens.size() != 12 and tokens.size() != 23) {
@@ -237,7 +231,7 @@ StatusCode MuonAlignmentCondAlg::loadAlignABLinesData(const std::string& folderN
             }
 
             ATH_MSG_VERBOSE("Parsing Line = ");
-            for (const std::string& token : tokens) ATH_MSG_VERBOSE(token << " | ");
+            for (const std::string_view& token : tokens) ATH_MSG_VERBOSE(token << " | ");
             ATH_MSG_VERBOSE(" ");
 
             bool thisRowHasBLine = true;
@@ -254,16 +248,13 @@ StatusCode MuonAlignmentCondAlg::loadAlignABLinesData(const std::string& folderN
             int jff;
             int jzz;
             int job;
-            std::string stationType = tokens[ival++];
-            line["typ"] = stationType;
-            std::string jff_str = tokens[ival++];
-            sscanf(jff_str.c_str(), "%80d", &jff);
+            std::string stationType = std::string(tokens[ival++]);
+            line["typ"] = std::move(stationType);
+            jff = MdtStringUtils::atoi(tokens[ival++]);
             line["jff"] = jff;
-            std::string jzz_str = tokens[ival++];
-            sscanf(jzz_str.c_str(), "%80d", &jzz);
+            jzz = MdtStringUtils::atoi(tokens[ival++]);
             line["jzz"] = jzz;
-            std::string job_str = tokens[ival++];
-            sscanf(job_str.c_str(), "%80d", &job);
+            job = MdtStringUtils::atoi(tokens[ival++]);
             line["job"] = job;
 
             // A-line
@@ -273,78 +264,58 @@ StatusCode MuonAlignmentCondAlg::loadAlignABLinesData(const std::string& folderN
             float ths;
             float thz;
             float tht;
-            std::string s_str = tokens[ival++];
-            sscanf(s_str.c_str(), "%80f", &s);
+            s = MdtStringUtils::stof(tokens[ival++]);
             line["svalue"] = s;
-            std::string z_str = tokens[ival++];
-            sscanf(z_str.c_str(), "%80f", &z);
+            z = MdtStringUtils::stof(tokens[ival++]);
             line["zvalue"] = z;
-            std::string t_str = tokens[ival++];
-            sscanf(t_str.c_str(), "%80f", &t);
+            t = MdtStringUtils::stof(tokens[ival++]);
             line["tvalue"] = t;
-            std::string ths_str = tokens[ival++];
-            sscanf(ths_str.c_str(), "%80f", &ths);
+            ths = MdtStringUtils::stof(tokens[ival++]);
             line["tsv"] = ths;
-            std::string thz_str = tokens[ival++];
-            sscanf(thz_str.c_str(), "%80f", &thz);
+            thz = MdtStringUtils::stof(tokens[ival++]);
             line["tzv"] = thz;
-            std::string tht_str = tokens[ival++];
-            sscanf(tht_str.c_str(), "%80f", &tht);
+            tht = MdtStringUtils::stof(tokens[ival++]);
             line["ttv"] = tht;
 
             // B-line
             float bz, bp, bn, sp, sn, tw, pg, tr, eg, ep, en;
             float xAtlas, yAtlas;
-            std::string ChamberHwName = "";
 
             if (hasBLine && thisRowHasBLine) {
-                std::string tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &bz);
+                bz = MdtStringUtils::stof(tokens[ival++]);
                 line["bz"] = bz;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &bp);
+                bp = MdtStringUtils::stof(tokens[ival++]);
                 line["bp"] = bp;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &bn);
+                bn = MdtStringUtils::stof(tokens[ival++]);
                 line["bn"] = bn;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &sp);
+                sp = MdtStringUtils::stof(tokens[ival++]);
                 line["sp"] = sp;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &sn);
+                sn = MdtStringUtils::stof(tokens[ival++]);
                 line["sn"] = sn;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &tw);
+                tw = MdtStringUtils::stof(tokens[ival++]);
                 line["tw"] = tw;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &pg);
+                pg = MdtStringUtils::stof(tokens[ival++]);
                 line["pg"] = pg;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &tr);
+                tr = MdtStringUtils::stof(tokens[ival++]);
                 line["tr"] = tr;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &eg);
+                eg = MdtStringUtils::stof(tokens[ival++]);
                 line["eg"] = eg;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &ep);
+                ep = MdtStringUtils::stof(tokens[ival++]);
                 line["ep"] = ep;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &en);
+                en = MdtStringUtils::stof(tokens[ival++]);
                 line["en"] = en;
 
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &xAtlas);
+                xAtlas = MdtStringUtils::stof(tokens[ival++]);
                 line["xAtlas"] = xAtlas;
-                tmp_str = tokens[ival++];
-                sscanf(tmp_str.c_str(), "%80f", &yAtlas);
+                yAtlas = MdtStringUtils::stof(tokens[ival++]);
                 line["yAtlas"] = yAtlas;
 
                 // ChamberName (hardware convention)
-                line["hwElement"] = tokens[ival++];
+                line["hwElement"] = std::string(tokens[ival++]);
             }
         }
         if (line.empty()) continue;
-        json.push_back(line);
+        json.push_back(std::move(line));
     }
     return StatusCode::SUCCESS;
 }
@@ -802,43 +773,36 @@ StatusCode MuonAlignmentCondAlg::loadAlignILines(const std::string& folderName)
 }
 
 StatusCode MuonAlignmentCondAlg::loadAlignILinesData(const std::string& folderName, const std::string& data, nlohmann::json& json) {
-    // Check the first word to see if it is a correction
-    std::string type;
-
+    using namespace MuonCalib;
     // Parse corrections
-    std::string since_str;
-    std::string till_str;
-    std::string delimiter = "\n";
+    char delimiter = '\n';
 
     json = nlohmann::json::array();
-    std::vector<std::string> lines;
-    MuonCalib::MdtStringUtils::tokenize(data, lines, delimiter);
-    for (const std::string& blobline : lines) {
+    auto lines = MuonCalib::MdtStringUtils::tokenize(data, delimiter);
+    for (const std::string_view& blobline : lines) {
         nlohmann::json line;
-        std::string delimiter = ":";
-        std::vector<std::string> tokens;
-        MuonCalib::MdtStringUtils::tokenize(blobline, tokens, delimiter);
+        char delimiter = ':';
+        auto tokens = MuonCalib::MdtStringUtils::tokenize(blobline, delimiter);
         // Check if tokens is not empty
         if (tokens.empty()) {
             ATH_MSG_FATAL("Empty string retrieved from DB in folder " << folderName);
             return StatusCode::FAILURE;
         }
-        type = tokens[0];
+        const std::string_view &type = tokens[0];
         // Parse line
-        if (type.find('#') == 0) {
+        if ('#' == type[0]) {
             // skip it
             continue;
         }
-        if (type.find("Corr") == 0) {
+        if (type.compare(0, 4, "Corr") == 0) {
             //# Amdb like clob for ilines using geometry tag ISZT-R06-02
             //# ISZT_DATA_ID VERS TYP JFF JZZ JOB JLAY TRAS TRAZ TRAT ROTS ROTZ ROTT
             //
             //.... example
             // Corr:  CSL 1 -1 3 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
 
-            std::string delimiter = " ";
-            std::vector<std::string> tokens;
-            MuonCalib::MdtStringUtils::tokenize(blobline, tokens, delimiter);
+            char delimiter = ' ';
+            auto tokens = MuonCalib::MdtStringUtils::tokenize(blobline, delimiter);
             if (tokens.size() != 12) {
                 ATH_MSG_FATAL("Invalid length in string retrieved from DB in folder " << folderName << " String length is "
                                                                                       << tokens.size());
@@ -846,7 +810,7 @@ StatusCode MuonAlignmentCondAlg::loadAlignILinesData(const std::string& folderNa
             }
 
             ATH_MSG_VERBOSE("Parsing Line = ");
-            for (const std::string& token : tokens) ATH_MSG_VERBOSE(token << " | ");
+            for (const std::string_view& token : tokens) ATH_MSG_VERBOSE(token << " | ");
             ATH_MSG_VERBOSE(" ");
 
             // Start parsing
@@ -857,19 +821,15 @@ StatusCode MuonAlignmentCondAlg::loadAlignILinesData(const std::string& folderNa
             int jzz;
             int job;
             int jlay;
-            std::string stationType = tokens[ival++];
-            line["typ"] = stationType;
-            std::string jff_str = tokens[ival++];
-            sscanf(jff_str.c_str(), "%80d", &jff);
+            std::string stationType = std::string(tokens[ival++]);
+            line["typ"] = std::move(stationType);
+            jff = MdtStringUtils::atoi(tokens[ival++]);
             line["jff"] = jff;
-            std::string jzz_str = tokens[ival++];
-            sscanf(jzz_str.c_str(), "%80d", &jzz);
+            jzz = MdtStringUtils::atoi(tokens[ival++]);
             line["jzz"] = jzz;
-            std::string job_str = tokens[ival++];
-            sscanf(job_str.c_str(), "%80d", &job);
+            job = MdtStringUtils::atoi(tokens[ival++]);
             line["job"] = job;
-            std::string jlay_str = tokens[ival++];
-            sscanf(jlay_str.c_str(), "%80d", &jlay);
+            jlay = MdtStringUtils::atoi(tokens[ival++]);
             line["jlay"] = jlay;
 
             // I-line
@@ -879,27 +839,21 @@ StatusCode MuonAlignmentCondAlg::loadAlignILinesData(const std::string& folderNa
             float rots;
             float rotz;
             float rott;
-            std::string tras_str = tokens[ival++];
-            sscanf(tras_str.c_str(), "%80f", &tras);
+            tras = MdtStringUtils::stof(tokens[ival++]);
             line["tras"] = tras;
-            std::string traz_str = tokens[ival++];
-            sscanf(traz_str.c_str(), "%80f", &traz);
+            traz = MdtStringUtils::stof(tokens[ival++]);
             line["traz"] = traz;
-            std::string trat_str = tokens[ival++];
-            sscanf(trat_str.c_str(), "%80f", &trat);
+            trat = MdtStringUtils::stof(tokens[ival++]);
             line["trat"] = trat;
-            std::string rots_str = tokens[ival++];
-            sscanf(rots_str.c_str(), "%80f", &rots);
+            rots = MdtStringUtils::stof(tokens[ival++]);
             line["rots"] = rots;
-            std::string rotz_str = tokens[ival++];
-            sscanf(rotz_str.c_str(), "%80f", &rotz);
+            rotz = MdtStringUtils::stof(tokens[ival++]);
             line["rotz"] = rotz;
-            std::string rott_str = tokens[ival++];
-            sscanf(rott_str.c_str(), "%80f", &rott);
+            rott = MdtStringUtils::stof(tokens[ival++]);
             line["rott"] = rott;
         }
         if (line.empty()) continue;
-        json.push_back(line);
+        json.push_back(std::move(line));
     }
     return StatusCode::SUCCESS;
 }
@@ -957,34 +911,29 @@ StatusCode MuonAlignmentCondAlg::loadAlignAsBuilt(const std::string& folderName)
 
         ATH_MSG_DEBUG("Data load is " << data << " FINISHED HERE ");
 
-        // Check the first word to see if it is a correction
-        std::string type;
-
         // Parse corrections
-        std::string delimiter = "\n";
+        char delimiter = '\n';
 
-        std::vector<std::string> lines;
-        MuonCalib::MdtStringUtils::tokenize(data, lines, delimiter);
-        for (const std::string& blobline : lines) {
+        auto lines = MuonCalib::MdtStringUtils::tokenize(data, delimiter);
+        for (const std::string_view& blobline : lines) {
             ++nLines;
 
-            std::string delimiter = ":";
-            std::vector<std::string> tokens;
-            MuonCalib::MdtStringUtils::tokenize(blobline, tokens, delimiter);
+            char delimiter = ':';
+            auto tokens = MuonCalib::MdtStringUtils::tokenize(blobline, delimiter);
             // Check if tokens is not empty
             if (tokens.empty()) {
                 ATH_MSG_FATAL("Empty string retrieved from DB in folder " << folderName);
                 return StatusCode::FAILURE;
             }
-            type = tokens[0];
+            const std::string_view &type = tokens[0];
             // Parse line
-            if (type.find('#') == 0) {
+            if (type[0] == '#') {
                 // skip it
                 continue;
             }
 
-            if (type.find("Corr") == 0) {
-                if (!xPar.setFromAscii(blobline)) {
+            if (type.compare(0, 4, "Corr") == 0) {
+                if (!xPar.setFromAscii(std::string(blobline))) {
                     ATH_MSG_ERROR("Unable to parse AsBuilt params from Ascii line: " << blobline);
                     continue;
                 }
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MuonAlignmentErrorDbAlg.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MuonAlignmentErrorDbAlg.cxx
index 624856e73c02..6aba041fbc47 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MuonAlignmentErrorDbAlg.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MuonAlignmentErrorDbAlg.cxx
@@ -80,7 +80,7 @@ StatusCode MuonAlignmentErrorDbAlg::execute() {
     std::string line;
     while (getline(indata, line)) {
         // READING COMMENTS
-        if (line.substr(0, 1) == "#") {
+        if (line.compare(0, 1,"#") == 0) {
             // ATH_MSG_DEBUG("Reading a commented line saying " << line);
             continue;
         }
@@ -94,7 +94,7 @@ StatusCode MuonAlignmentErrorDbAlg::execute() {
         double rotation(0.);
 
         // GET INPUT FILE VERSION
-        if (line.substr(0, 7) == "version") {
+        if (line.compare(0, 7, "version") == 0) {
             std::istringstream(line) >> flag >> version_tag;
             ATH_MSG_INFO("*****************************************");
             ATH_MSG_INFO("Input file version " << version_tag);
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/RpcCondDbAlg.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/RpcCondDbAlg.cxx
index bb9336fec3e4..ae8acb085ee2 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/RpcCondDbAlg.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/RpcCondDbAlg.cxx
@@ -5,7 +5,7 @@
 #include "MuonCondAlg/RpcCondDbAlg.h"
 
 #include "AthenaKernel/IOVInfiniteRange.h"
-
+using namespace MuonCalib;
 // constructor
 RpcCondDbAlg::RpcCondDbAlg(const std::string& name, ISvcLocator* pSvcLocator) :
     AthReentrantAlgorithm(name, pSvcLocator), m_condSvc("CondSvc", name) {
@@ -92,7 +92,6 @@ StatusCode RpcCondDbAlg::loadDataDeadPanels(EventIDRange& rangeW, RpcCondDbData*
 
     ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size());
     ATH_MSG_DEBUG("Range of input is " << range << ", range of output is " << rangeW);
-
     CondAttrListCollection::const_iterator itr;
     unsigned int chan_index = 0;
     for (itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
@@ -110,17 +109,15 @@ StatusCode RpcCondDbAlg::loadDataDeadPanels(EventIDRange& rangeW, RpcCondDbData*
             ATH_MSG_DEBUG("panel_dead " << panel_dead);
             ATH_MSG_DEBUG("panel_reason " << panel_reason);
 
-            const char* ch_tmp;
-            std::string delimiter = ",";
-            std::vector<std::string> info_panel;
-            MuonCalib::MdtStringUtils::tokenize(panel_dead, info_panel, delimiter);
+            char delimiter = ',';
+            auto info_panel = MuonCalib::MdtStringUtils::tokenize(panel_dead, delimiter);
 
             Identifier PanelId;
 
             for (unsigned int i = 0; i < info_panel.size(); i++) {
-                ch_tmp = info_panel[i].c_str();
-                PanelId = atoi(ch_tmp);
-                ATH_MSG_DEBUG("info_panel " << ch_tmp << " " << atoi(ch_tmp));
+                const std::string_view &ch_tmp = info_panel[i];
+                PanelId =  MdtStringUtils::atoi(ch_tmp);
+                ATH_MSG_DEBUG("info_panel " << ch_tmp << " " << PanelId);
 
                 if (PanelId.get_compact()) {
                     ATH_MSG_DEBUG("DEADPANEL " << m_idHelperSvc->rpcIdHelper().show_to_string(PanelId));
@@ -175,16 +172,14 @@ StatusCode RpcCondDbAlg::loadDataOffPanels(EventIDRange& rangeW, RpcCondDbData*
             ATH_MSG_DEBUG("panel_off " << panel_off);
             ATH_MSG_DEBUG("panel_reason " << panel_reason);
 
-            const char* ch_tmp;
-            std::string delimiter = ",";
-            std::vector<std::string> info_panel;
-            MuonCalib::MdtStringUtils::tokenize(panel_off, info_panel, delimiter);
+            char delimiter = ',';
+            auto info_panel = MuonCalib::MdtStringUtils::tokenize(panel_off, delimiter);
 
             Identifier PanelId;
 
             for (unsigned int i = 0; i < info_panel.size(); i++) {
-                ch_tmp = info_panel[i].c_str();
-                PanelId = atoi(ch_tmp);
+                const std::string_view &ch_tmp = info_panel[i];
+                PanelId = MdtStringUtils::atoi(ch_tmp);
                 ATH_MSG_DEBUG("info_panel " << ch_tmp << " " << PanelId);
 
                 if (PanelId.get_compact()) {
@@ -224,14 +219,12 @@ StatusCode RpcCondDbAlg::loadMcElementStatus(EventIDRange& rangeW, RpcCondDbData
     ATH_MSG_DEBUG("Range of input is " << range << ", range of output is " << rangeW);
 
     CondAttrListCollection::const_iterator itr;
-
     unsigned int chan_index = 0;
     unsigned int iFracDeadStrip = 0;
     for (itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
         const coral::AttributeList& atr = itr->second;
         CondAttrListCollection::ChanNum channum = itr->first;
-        Identifier chamberId;
-        chamberId = channum;
+        Identifier chamberId = Identifier(channum);
 
         std::string eff_panel, striplist, eff;
 
@@ -244,58 +237,42 @@ StatusCode RpcCondDbAlg::loadMcElementStatus(EventIDRange& rangeW, RpcCondDbData
         ATH_MSG_DEBUG("striplist load is " << striplist << " " << striplist.size());
 
         // Efficiencies and Cluster Sizes
-        std::string delimiter = " ";
-        std::vector<std::string> info_panel;
-        std::vector<float> info_panel_test;
-        MuonCalib::MdtStringUtils::tokenize(eff_panel, info_panel, delimiter);
+        char delimiter = ' ';
+        const auto info_panel = MdtStringUtils::tokenize(eff_panel, delimiter);
 
-        const char* SDBversion = (info_panel[0].c_str());
-        int DBversion = atoi(SDBversion);
+        int DBversion = MdtStringUtils::atoi(info_panel[0]);
 
-        const char* SNStrip = (info_panel[2].c_str());
-        int npanelstrip = atoi(SNStrip);
+        int npanelstrip = MdtStringUtils::atoi(info_panel[2]);
 
-        const char* SProjectedTracks = (info_panel[1].c_str());
-        double ProjectedTracks = atof(SProjectedTracks);
+        double ProjectedTracks = MdtStringUtils::stof(info_panel[1]);
         writeCdo->setProjectedTrack(chamberId, ProjectedTracks);
 
-        const char* SEfficiency = (info_panel[3].c_str());
-        double Efficiency = atof(SEfficiency);
+        double Efficiency = MdtStringUtils::stof(info_panel[3]);
         writeCdo->setEfficiency(chamberId, Efficiency);
 
         if (Efficiency <= m_panelEfficiency) writeCdo->setLowEffPanel(chamberId);
 
-        const char* SGapEfficiency = (info_panel[5].c_str());
-        double GapEfficiency = atof(SGapEfficiency);
+        double GapEfficiency = MdtStringUtils::stof(info_panel[5]);
         writeCdo->setGapEfficiency(chamberId, GapEfficiency);
 
-        const char* SMeanClusterSize = (info_panel[17].c_str());
-        double MeanClusterSize = atof(SMeanClusterSize);
+        double MeanClusterSize = MdtStringUtils::stof(info_panel[17]);
         writeCdo->setMeanClusterSize(chamberId, MeanClusterSize);
 
         if (DBversion > 2) {
-            const char* SFracClusterSize1_a = (info_panel[19].c_str());
-            const  char* SFracClusterSize1_b = (info_panel[20].c_str());
-            double FracClusterSize1 = atof(SFracClusterSize1_a) + atof(SFracClusterSize1_b) * 10000;
+            double FracClusterSize1 = MdtStringUtils::stof(info_panel[19]) + MdtStringUtils::stof(info_panel[20]) * 10000;
             writeCdo->setFracClusterSize1(chamberId, FracClusterSize1);
 
-            const char* SFracClusterSize2_a = (info_panel[21].c_str());
-            const char* SFracClusterSize2_b = (info_panel[22].c_str());
-            double FracClusterSize2 = atof(SFracClusterSize2_a) + atof(SFracClusterSize2_b) * 10000;
+            double FracClusterSize2 = MdtStringUtils::stof(info_panel[21]) + MdtStringUtils::stof(info_panel[22]) * 10000;
             writeCdo->setFracClusterSize2(chamberId, FracClusterSize2);
 
-            const char* SFracClusterSize3_a = (info_panel[23].c_str());
-            const char* SFracClusterSize3_b = (info_panel[24].c_str());
-            double FracClusterSize3 = atof(SFracClusterSize3_a) + atof(SFracClusterSize3_b) * 10000;
+            double FracClusterSize3 = MdtStringUtils::stof(info_panel[23]) + MdtStringUtils::stof(info_panel[24]) * 10000;
             writeCdo->setFracClusterSize3(chamberId, FracClusterSize3);
         } else {
             if (info_panel.size() > 20) {
-                const char* SFracClusterSize1 = (info_panel[19].c_str());
-                double FracClusterSize1 = atof(SFracClusterSize1);
+                double FracClusterSize1 = MdtStringUtils::stof(info_panel[19]);
                 writeCdo->setFracClusterSize1(chamberId, FracClusterSize1);
 
-                const char* SFracClusterSize2 = (info_panel[20].c_str());
-                double FracClusterSize2 = atof(SFracClusterSize2);
+                double FracClusterSize2 = MdtStringUtils::stof(info_panel[20]);
                 writeCdo->setFracClusterSize2(chamberId, FracClusterSize2);
             } else {
                 writeCdo->setFracClusterSize1(chamberId, 0.6);
@@ -314,35 +291,23 @@ StatusCode RpcCondDbAlg::loadMcElementStatus(EventIDRange& rangeW, RpcCondDbData
 
         // update for the timing and error on timing
         // new info strip |status time error_on_time|
-        std::string delimiter_strip = "|";
-        std::vector<std::string> info_strip;
+        char delimiter_strip = '|';
         std::string strip_status_list = "";
-        std::vector<float> info_strip_test;
-
-        MuonCalib::MdtStringUtils::tokenize(striplist, info_strip, delimiter_strip);
-        const char* ch_strip2;
 
+        const auto info_strip= MuonCalib::MdtStringUtils::tokenize(striplist, delimiter_strip);
         if (info_strip.size() > 1) {
             for (unsigned int i = 0; i < info_strip.size(); ++i) {
-                ch_strip2 = (info_strip[i].c_str());
-
-                std::string delimiter_strip2 = "  ";
-                std::vector<std::string> info_strip2;
-                std::vector<float> info_strip_test2;
+                const std::string_view &ch_strip2 = info_strip[i];
 
-                MuonCalib::MdtStringUtils::tokenize(ch_strip2, info_strip2, delimiter_strip2);
+                char delimiter_strip2 = ' ';
 
-                const char* STime = (info_strip2[1].c_str());
-                double Time = atof(STime);
-                const char* SSigmaTime = (info_strip2[2].c_str());
-                double SigmaTime = atof(SSigmaTime);
-                const char* strip_status = (info_strip2[0].c_str());
+                auto info_strip2 = MdtStringUtils::tokenize(ch_strip2, delimiter_strip2);
 
-                strip_status_list = strip_status_list + strip_status;
+                double Time = MdtStringUtils::stof(info_strip2[1]);
+                double SigmaTime = MdtStringUtils::stof(info_strip2[2]);
+                const auto &strip_status = info_strip2[0];
 
-                std::vector<double> Time_vect;
-                Time_vect.push_back(Time);
-                Time_vect.push_back(SigmaTime);
+                strip_status_list += strip_status;
 
                 Identifier strip_id;
                 CondAttrListCollection::ChanNum stripnum;
@@ -351,7 +316,7 @@ StatusCode RpcCondDbAlg::loadMcElementStatus(EventIDRange& rangeW, RpcCondDbData
 
                 ATH_MSG_DEBUG("strip " << strip_id << " has time " << Time << " and " << SigmaTime);
 
-                writeCdo->setStripTime(strip_id, Time_vect);
+                writeCdo->setStripTime(strip_id, std::vector<double>{Time, SigmaTime});
 
                 ATH_MSG_VERBOSE("strip #" << i + 1 << " strip_id " << stripnum << " expanded "
                                           << m_idHelperSvc->rpcIdHelper().show_to_string(strip_id));
@@ -372,9 +337,9 @@ StatusCode RpcCondDbAlg::loadMcElementStatus(EventIDRange& rangeW, RpcCondDbData
             ATH_MSG_DEBUG("no timing info");
 
             for (unsigned int i = 0; i < striplist.size(); i++) {
-                std::string part_strip = striplist.substr(i, 1);
-                strip_status_list = strip_status_list + part_strip;
-                const char* ch_panel = (part_strip.c_str());
+                char part_strip = striplist[i];
+                strip_status_list += part_strip;
+                char ch_panel = part_strip;
 
                 Identifier strip_id;
                 CondAttrListCollection::ChanNum stripnum;
@@ -386,7 +351,7 @@ StatusCode RpcCondDbAlg::loadMcElementStatus(EventIDRange& rangeW, RpcCondDbData
 
                 ++countpanelstrip;
 
-                if (part_strip == "0") {
+                if (part_strip == '0') {
                     ++countdeadstrip;
                     writeCdo->setDeadStrip(strip_id);
                     if (i > 1 && i < striplist.size() - 2) {
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h
index 40d27267e79c..bfd695e67cc7 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h
@@ -43,8 +43,8 @@ public:
     void setChannelT0Phase(IdentifierHash, bool );
 
     void setDeadChannelHash(IdentifierHash);
-    void setDeadLayer     (std::string, Identifier);
-    void setDeadStation   (std::string, Identifier);
+    void setDeadLayer     (std::string_view, Identifier);
+    void setDeadStation   (std::string_view, Identifier);
    
     const std::vector<std::string>& getDeadLayers     () const;
     const std::vector<std::string>& getDeadStations   () const;
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/MdtCondDbData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/MdtCondDbData.h
index d01e400cd8bc..d20c494a9e56 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/MdtCondDbData.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/MdtCondDbData.h
@@ -29,10 +29,10 @@ public:
     
     virtual ~MdtCondDbData() = default;
 
-    void setDeadTube      (const std::string&, Identifier);
-    void setDeadLayer     (const std::string&, Identifier);
-    void setDeadMultilayer(const std::string&, Identifier);
-    void setDeadStation   (const std::string&, Identifier);
+    void setDeadTube      (std::string_view, Identifier);
+    void setDeadLayer     (std::string_view, Identifier);
+    void setDeadMultilayer(std::string_view, Identifier);
+    void setDeadStation   (std::string_view, Identifier);
     void setDeadChamber   (Identifier);
 
     void setNoisyTube      (Identifier);
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCalibDBEntry.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCalibDBEntry.h
index 06c4bfe5e751..0cc21163ec57 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCalibDBEntry.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCalibDBEntry.h
@@ -27,8 +27,8 @@ namespace MuonCalib{
     {
         public:
             RpcCalibDBEntry(){};
-            RpcCalibDBEntry(Identifier gapID, std::string etaRec, std::string etaDet, std::string phiRec1, std::string phiRec2, std::string phiDet1, std::string phiDet2);
-            RpcCalibDBEntry(Identifier gapID, std::string payload);
+            RpcCalibDBEntry(Identifier gapID, const std::string& etaRec, const std::string& etaDet, const std::string& phiRec1, const std::string& phiRec2, const std::string& phiDet1, const std::string& phiDet2);
+            RpcCalibDBEntry(Identifier gapID, std::string_view payload);
 
 	    void getColumns(std::string &recEta, std::string &detEta,std::string &recPhi1,std::string &recPhi2,std::string &detPhi1,std::string &detPhi2) const;  
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/CscCondDbData.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/CscCondDbData.cxx
index b6631b4fae9f..b22ab3df16a8 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/CscCondDbData.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/CscCondDbData.cxx
@@ -147,17 +147,17 @@ CscCondDbData::setDeadChannelHash(IdentifierHash hash){
 
 // setDeadLayer
 void
-CscCondDbData::setDeadLayer(std::string name, Identifier Id){
+CscCondDbData::setDeadLayer(std::string_view name, Identifier Id){
     if(std::find(m_cachedDeadLayersId.begin(), m_cachedDeadLayersId.end(), Id)!=m_cachedDeadLayersId.end()) return;
-    m_cachedDeadLayers  .push_back(name);
+    m_cachedDeadLayers  .push_back(std::string(name));
     m_cachedDeadLayersId.push_back(Id  );
 }
 
 // setDeadStation
 void
-CscCondDbData::setDeadStation(std::string name, Identifier Id){
+CscCondDbData::setDeadStation(std::string_view name, Identifier Id){
     if(std::find(m_cachedDeadStationsId.begin(), m_cachedDeadStationsId.end(), Id)!=m_cachedDeadStationsId.end()) return;
-    m_cachedDeadStations  .push_back(name);
+    m_cachedDeadStations  .push_back(std::string(name));
     m_cachedDeadStationsId.push_back(Id  );
 }
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/MdtCondDbData.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/MdtCondDbData.cxx
index 4b827d9a9012..f49c4122dd5f 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/MdtCondDbData.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/MdtCondDbData.cxx
@@ -10,33 +10,33 @@ MdtCondDbData::MdtCondDbData(const MdtIdHelper& id_helper):
     m_id_helper(id_helper){}
 // setDeadTube
 void
-MdtCondDbData::setDeadTube(const std::string& id_name, Identifier Id){
+MdtCondDbData::setDeadTube(std::string_view id_name, Identifier Id){
     if(std::find(m_cachedDeadTubesId.begin(), m_cachedDeadTubesId.end(), Id)!=m_cachedDeadTubesId.end()) return;
-    m_cachedDeadTubes  .push_back(id_name);
+    m_cachedDeadTubes  .push_back(std::string(id_name));
     m_cachedDeadTubesId.push_back(Id  );
 }
 
 // setDeadLayer
 void
-MdtCondDbData::setDeadLayer(const std::string& id_name, Identifier Id){
+MdtCondDbData::setDeadLayer(std::string_view id_name, Identifier Id){
     if(std::find(m_cachedDeadLayersId.begin(), m_cachedDeadLayersId.end(), Id)!=m_cachedDeadLayersId.end()) return;
-    m_cachedDeadLayers  .push_back(id_name);
+    m_cachedDeadLayers  .push_back(std::string(id_name));
     m_cachedDeadLayersId.push_back(Id  );
 }
 
 // setDeadMultilayer
 void
-MdtCondDbData::setDeadMultilayer(const std::string& id_name, Identifier Id){
+MdtCondDbData::setDeadMultilayer(std::string_view id_name, Identifier Id){
     if(std::find(m_cachedDeadMultilayersId.begin(), m_cachedDeadMultilayersId.end(), Id)!=m_cachedDeadMultilayersId.end()) return;
-    m_cachedDeadMultilayers  .push_back(id_name);
+    m_cachedDeadMultilayers  .push_back(std::string(id_name));
     m_cachedDeadMultilayersId.push_back(Id  );
 }
 
 // setDeadStation (= a chamber dead by itself)
 void
-MdtCondDbData::setDeadStation(const std::string& id_name, Identifier Id){
+MdtCondDbData::setDeadStation(std::string_view id_name, Identifier Id){
     if(std::find(m_cachedDeadStationsId.begin(), m_cachedDeadStationsId.end(), Id)!=m_cachedDeadStationsId.end()) return;
-    m_cachedDeadStations  .push_back(id_name);
+    m_cachedDeadStations  .push_back(std::string(id_name));
     m_cachedDeadStationsId.push_back(Id  );
 }
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCalibDBEntry.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCalibDBEntry.cxx
index 61f5901e6593..a2b25965fd1d 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCalibDBEntry.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCalibDBEntry.cxx
@@ -19,33 +19,33 @@ namespace MuonCalib{
     for(unsigned int k=0;k<m_thePhiData.size();k++) delete m_thePhiData[k];
   }
 
-  RpcCalibDBEntry::RpcCalibDBEntry(Identifier gapID, std::string payLoad):m_nRecEta(0),m_nDetEta(0), m_nRecPhi1(0),m_nRecPhi2(0),m_nDetPhi1(0),m_nDetPhi2(0),m_theGap(gapID) {
+  RpcCalibDBEntry::RpcCalibDBEntry(Identifier gapID, std::string_view payLoad):m_nRecEta(0),m_nDetEta(0), m_nRecPhi1(0),m_nRecPhi2(0),m_nDetPhi1(0),m_nDetPhi2(0),m_theGap(gapID) {
 
     
     std::string::size_type end=payLoad.find("END ");
-    std::string etaRec=payLoad.substr(0,end);
+    std::string_view etaRec=payLoad.substr(0,end);
     payLoad=payLoad.substr(end+4,payLoad.size()-end-4);
 
     end=payLoad.find("END ");
-    std::string etaDet=payLoad.substr(0,end);
+    std::string_view etaDet=payLoad.substr(0,end);
     payLoad=payLoad.substr(end+4,payLoad.size()-end-4);
 
     end=payLoad.find("END ");
-    std::string phiRec1=payLoad.substr(0,end);
+    std::string_view phiRec1=payLoad.substr(0,end);
     payLoad=payLoad.substr(end+4,payLoad.size()-end-4);
 
     end=payLoad.find("END ");
-    std::string phiRec2=payLoad.substr(0,end);
+    std::string_view phiRec2=payLoad.substr(0,end);
     payLoad=payLoad.substr(end+4,payLoad.size()-end-4);
 
     end=payLoad.find("END ");
-    std::string phiDet1=payLoad.substr(0,end);
+    std::string_view phiDet1=payLoad.substr(0,end);
     payLoad=payLoad.substr(end+4,payLoad.size()-end-4);
 
     end=payLoad.find("END ");
-    std::string phiDet2=payLoad.substr(0,end);
+    std::string_view phiDet2=payLoad.substr(0,end);
 
-    this->initData(etaRec, etaDet,phiRec1,phiRec2,phiDet1,phiDet2);
+    this->initData(std::string(etaRec), std::string(etaDet),std::string(phiRec1),std::string(phiRec2),std::string(phiDet1),std::string(phiDet2));
     
   }
 
@@ -53,23 +53,23 @@ namespace MuonCalib{
 
 
     unsigned long int pos = 0;
-    std::string::size_type start = etaRec.find_first_not_of(" ",pos);
+    std::string::size_type start = etaRec.find_first_not_of(' ',pos);
     if(start == std::string::npos) {
       std::cout << "RpcCalibDBEntry::initData -- problems extracting m_nRecEta -- crashing." << std::endl;
       throw;      
     }
-    std::string::size_type stop = etaRec.find_first_of(" ",start+1);
+    std::string::size_type stop = etaRec.find_first_of(' ',start+1);
     if (stop == std::string::npos) stop = etaRec.size();
     m_nRecEta = std::stoi(etaRec.substr(start,stop-start),nullptr);
     etaRec.erase(pos,stop-pos);
 
     pos = 0;
-    start = phiRec1.find_first_not_of(" ",pos);
+    start = phiRec1.find_first_not_of(' ',pos);
     if(start == std::string::npos) {
       std::cout << "RpcCalibDBEntry::initData -- problems extracting m_nRecPhi1 -- crashing." << std::endl;
       throw;      
     }
-    stop = phiRec1.find_first_of(" ",start+1);
+    stop = phiRec1.find_first_of(' ',start+1);
     if (stop == std::string::npos) stop = phiRec1.size();
     m_nRecPhi1 = std::stoi(phiRec1.substr(start,stop-start),nullptr);
     phiRec1.erase(pos,stop-pos);
@@ -163,7 +163,7 @@ namespace MuonCalib{
 
   // initialize from db columns
   
-  RpcCalibDBEntry::RpcCalibDBEntry(Identifier gapID, std::string etaRec, std::string etaDet, std::string phiRec1, std::string phiRec2, std::string phiDet1, std::string phiDet2 ):m_nRecEta(0),m_nDetEta(0), m_nRecPhi1(0),m_nRecPhi2(0),m_nDetPhi1(0),m_nDetPhi2(0),m_theGap(gapID)
+  RpcCalibDBEntry::RpcCalibDBEntry(Identifier gapID, const std::string& etaRec, const std::string& etaDet, const std::string& phiRec1, const std::string& phiRec2, const std::string& phiDet1, const std::string& phiDet2 ):m_nRecEta(0),m_nDetEta(0), m_nRecPhi1(0),m_nRecPhi2(0),m_nDetPhi1(0),m_nDetPhi2(0),m_theGap(gapID)
   {
     
     this->initData(etaRec, etaDet,phiRec1,phiRec2,phiDet1,phiDet2);
@@ -185,14 +185,14 @@ namespace MuonCalib{
 
     float eff, errEff, res1, res2, resX, errRes1, errRes2, errResX, time, errTime, noise, errNoise, noiseC, errNoiseC, cs, errCs;
     
-    recEta_str<<m_nRecEta<<" ";
-    detEta_str<<m_nDetEta<<" ";
+    recEta_str<<m_nRecEta<<' ';
+    detEta_str<<m_nDetEta<<' ';
 
-    recPhi1_str<<m_nRecPhi1<<" ";
-    detPhi1_str<<m_nDetPhi1<<" ";
+    recPhi1_str<<m_nRecPhi1<<' ';
+    detPhi1_str<<m_nDetPhi1<<' ';
 
-    recPhi2_str<<m_nRecPhi2<<" ";
-    detPhi2_str<<m_nDetPhi2<<" ";
+    recPhi2_str<<m_nRecPhi2<<' ';
+    detPhi2_str<<m_nDetPhi2<<' ';
 
 
 
@@ -217,12 +217,9 @@ namespace MuonCalib{
       cs=theData->getCs();
       errCs=theData->getErrCs();
 
-      //      std::cout<<" provo a metterci "<<eff<< " "<<errEff<< " "<<res1<< " "<<errRes1<< " "<<res2<< " "<<errRes2<< " "<<resX<< " "<<errResX<< " "<<time<< " "<<errTime<<std::endl;
+      recEta_str<< eff<< ' '<<errEff<< ' '<<res1<< ' '<<errRes1<< ' '<<res2<< ' '<<errRes2<< ' '<<resX<< ' '<<errResX<< ' '<<time<< ' '<<errTime<< ' ';
+      detEta_str<<noise<< ' '<<errNoise<< ' '<<noiseC<< ' '<<errNoiseC<< ' '<<cs<< ' '<<errCs<< ' ';
 
-      recEta_str<< eff<< " "<<errEff<< " "<<res1<< " "<<errRes1<< " "<<res2<< " "<<errRes2<< " "<<resX<< " "<<errResX<< " "<<time<< " "<<errTime<< " ";
-      detEta_str<<noise<< " "<<errNoise<< " "<<noiseC<< " "<<errNoiseC<< " "<<cs<< " "<<errCs<< " ";
-      
-      //      std::cout<<" vediamo se ha funzionato,  ora receta e' "<<recEta.str()<<std::endl;
 
     }
 
@@ -247,9 +244,9 @@ namespace MuonCalib{
       cs=theData->getCs();
       errCs=theData->getErrCs();
 
-      recPhi1_str<<eff<<" " <<res1<<" " <<res2<<" " <<resX<<" " <<time<< " ";
-      recPhi2_str<<errEff<<" " <<errRes1<<" " <<errRes2<<" " <<errResX<<" " <<errTime<< " ";
-      detPhi1_str<<noise<<" " <<errNoise<<" " <<noiseC<<" " <<errNoiseC<<" " <<cs<<" " <<errCs<< " ";
+      recPhi1_str<<eff<<' ' <<res1<<' ' <<res2<<' ' <<resX<<' ' <<time<< ' ';
+      recPhi2_str<<errEff<<' ' <<errRes1<<' ' <<errRes2<<' ' <<errResX<<' ' <<errTime<< ' ';
+      detPhi1_str<<noise<<' ' <<errNoise<<' ' <<noiseC<<' ' <<errNoiseC<<' ' <<cs<<' ' <<errCs<< ' ';
 
 
     }
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx
index c56dcd491c06..554275a4bfc8 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx
@@ -37,7 +37,7 @@ RpcCondDbData::setDeadStripInt(Identifier chamberId, int striplist){
 void
 RpcCondDbData::setDeadStripList(Identifier chamberId, std::string striplist){
     if(m_cachedDeadStripList.count(chamberId)) return;
-    m_cachedDeadStripList[chamberId] = striplist;
+    m_cachedDeadStripList[chamberId] = std::move(striplist);
 }
 
 // setEfficiency
@@ -115,7 +115,7 @@ RpcCondDbData::setProjectedTrack(Identifier chamberId, int projectedTracks){
 void
 RpcCondDbData::setStripTime(Identifier stripId, std::vector<double> time){
     if(m_cachedStripTime.count(stripId)) return;
-    m_cachedStripTime[stripId] = time;
+    m_cachedStripTime[stripId] = std::move(time);
 }
 
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IMDT_MapConversion.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IMDT_MapConversion.h
index ef1d9fbddc2d..bc4410e8bd33 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IMDT_MapConversion.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/IMDT_MapConversion.h
@@ -27,7 +27,7 @@ class IMDT_MapConversion: virtual public IAlgTool{
    static const InterfaceID& interfaceID() {return IID_IMDT_MapConversion;};
 
  
-   virtual const Identifier& ConvertToOffline(const std::string &OnlineId,
+   virtual const Identifier& ConvertToOffline(std::string_view OnlineId,
                                               bool quiet = false) const =0;
   
 };
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/MdtStringUtils.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/MdtStringUtils.h
index e1c733c7aab9..64ccc06d0d7a 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/MdtStringUtils.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/MdtStringUtils.h
@@ -11,6 +11,14 @@ class MdtStringUtils {
   static void tokenize(const std::string& str,
 		       std::vector<std::string>& tokens,
         	       const std::string& delimiters = " ");
+  static void tokenize(const std::string& str,
+           std::vector<std::string>& tokens,
+                 char delimiters = ' ');
+  static std::vector<std::string_view> tokenize(std::string_view str,
+                       char delimiters = ' ');
+  static int atoi(std::string_view);
+  static float stof(std::string_view);
+  static int atoi(char a) noexcept { return ((int)a) - ((int)'0'); }
 }; 
 }
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/MdtStringUtils.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/MdtStringUtils.cxx
index c1ad020b3383..f9108120674f 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/MdtStringUtils.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/MdtStringUtils.cxx
@@ -5,6 +5,7 @@
 #include <string>
 #include <vector>
 #include "MuonCondSvc/MdtStringUtils.h"
+#include <charconv>
 
 namespace MuonCalib {
 
@@ -29,4 +30,56 @@ void  MdtStringUtils::tokenize(const std::string& str,
     }
 }
 
+void  MdtStringUtils::tokenize(const std::string& str,
+                      std::vector<std::string>& tokens,
+                      char delimiter)
+{
+    // Skip delimiters at beginning.
+    std::string::size_type lastPos = str.find_first_not_of(delimiter, 0);
+    // Find first "non-delimiter".
+    std::string::size_type pos     = str.find_first_of(delimiter, lastPos);
+
+    while (std::string::npos != pos || std::string::npos != lastPos)
+    {
+        // Found a token, add it to the vector.
+        tokens.push_back(str.substr(lastPos, pos - lastPos));
+        // Skip delimiters.  Note the "not_of"
+        lastPos = str.find_first_not_of(delimiter, pos);
+        // Find next "non-delimiter"
+        pos = str.find_first_of(delimiter, lastPos);
+    //  std::cout << "Added token : " << tokens[tokens.size()-1] << "!" << std::endl;
+    }
+}
+
+std::vector<std::string_view>  MdtStringUtils::tokenize(std::string_view str,
+                      char delimiter)
+{
+    // Skip delimiters at beginning.
+    std::string::size_type lastPos = str.find_first_not_of(delimiter, 0);
+    // Find first "non-delimiter".
+    std::string::size_type pos     = str.find_first_of(delimiter, lastPos);
+    std::vector<std::string_view> tokens;
+    while (std::string::npos != pos || std::string::npos != lastPos)
+    {
+        // Found a token, add it to the vector.
+        tokens.push_back(str.substr(lastPos, pos - lastPos));
+        // Skip delimiters.  Note the "not_of"
+        lastPos = str.find_first_not_of(delimiter, pos);
+        // Find next "non-delimiter"
+        pos = str.find_first_of(delimiter, lastPos);
+    //  std::cout << "Added token : " << tokens[tokens.size()-1] << "!" << std::endl;
+    }
+    return tokens;
+}
+
+int MdtStringUtils::atoi(std::string_view str){
+   int result=-9999;
+   std::from_chars(str.data(), str.data() + str.size(), result);
+   return result;
+}
+
+float MdtStringUtils::stof(std::string_view str){
+    //TODO: Replace this with from_chars once the compilers support it!
+   return std::stof(std::string(str));
+}
 }
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/NSWCondUtils.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/NSWCondUtils.cxx
index efb5fe3edd69..dabdde1407fa 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/NSWCondUtils.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/NSWCondUtils.cxx
@@ -12,55 +12,53 @@
 #include "MuonCondSvc/NSWCondUtils.h"
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/getMessageSvc.h"
-
+#include <charconv>
+#include "boost/algorithm/string.hpp"
 namespace MuonCalib{
   void NSWCondUtils::setNSWABLinesFromAscii(const std::string& filename, ALineMapContainer& writeALines, BLineMapContainer& writeBLines, const sTgcIdHelper* stgcHelper, const MmIdHelper* mmHelper)
   {
+    using namespace MuonCalib;
     std::ifstream inputFile;
     inputFile.open(filename);
     int nLines = 1;
     int nNewALines = 0;
     int nNewBLines = 0;
     std::string line;
-    std::string type;
-    std::string since_str;
-    std::string till_str;
+    std::string_view since_str;
+    std::string_view till_str;
 
     while(std::getline(inputFile,line)){
 
       ++nLines;
 
-      std::vector<std::string> tokens;
-      std::string delimiter = ":";
-      MuonCalib::MdtStringUtils::tokenize(line, tokens, delimiter);
+      char delimiter = ':';
+      const auto tokens = MdtStringUtils::tokenize(line, delimiter);
 
-      type = tokens[0];
+      const auto &type = tokens[0];
 
-      if(type.find("#") == 0){
+      if(type[0] == '#' ){
         continue;
       }
 
-      if(type.find("Header") == 0){
-        std::string delimiter = "|";
-        std::vector<std::string> tokens;
-        MuonCalib::MdtStringUtils::tokenize(line, tokens, delimiter);
+      if(boost::algorithm::starts_with(type, "Header")){
+        char delimiter = '|';
+        auto tokens = MdtStringUtils::tokenize(line, delimiter);
         since_str = tokens[1];
         till_str = tokens[2];
       }
 
-      if(type.find("IOV") == 0){
-        std::string delimiter = " ";
-        MuonCalib::MdtStringUtils::tokenize(line, tokens, delimiter);
+      if(boost::algorithm::starts_with(type, "IOV")){
+        char delimiter = ' ';
+        auto tokens = MdtStringUtils::tokenize(line, delimiter);
         int ival = 1;
         long int iovThisBlob = 0; 
-        std::string str_iovThisBlob = tokens[ival];
-        sscanf(str_iovThisBlob.c_str(), "%80ld", &iovThisBlob);
+        std::string_view str_iovThisBlob = tokens[ival];
+        std::from_chars(str_iovThisBlob.data(), str_iovThisBlob.data() + str_iovThisBlob.size(), iovThisBlob);
       }
 
-      if(type.find("Corr") == 0){
-        std::string delimiter = " ";
-        std::vector<std::string> tokens;
-        MuonCalib::MdtStringUtils::tokenize(line, tokens, delimiter);
+      if(boost::algorithm::starts_with(type, "Corr")){
+        char delimiter = ' ';
+        auto tokens = MdtStringUtils::tokenize(line, delimiter);
 
         if(tokens.size() != 25){
           MsgStream log(Athena::getMessageSvc(), "NSWCondUtils");
@@ -70,60 +68,31 @@ namespace MuonCalib{
 
         int ival =1;
         int phi, eta, mult;
-        std::string stationType = tokens[ival++];
-        
-        std::string phi_str = tokens[ival++];
-        sscanf(phi_str.c_str(),"%80d",&phi);
-
-        std::string eta_str = tokens[ival++];
-        sscanf(eta_str.c_str(),"%80d",&eta);
-
-        std::string mult_str = tokens[ival++];
-        sscanf(mult_str.c_str(),"%80d",&mult);
+        std::string_view stationType = tokens[ival++];
+        phi = MdtStringUtils::atoi(tokens[ival++]);
+        eta = MdtStringUtils::atoi(tokens[ival++]);
+        mult = MdtStringUtils::atoi(tokens[ival++]);
 
         float s, z, t, rots, rotz, rott;
-
-        std::string s_str = tokens[ival++];
-        sscanf(s_str.c_str(),"%80f",&s);
-
-        std::string z_str = tokens[ival++];
-        sscanf(z_str.c_str(),"%80f",&z);
-
-        std::string t_str = tokens[ival++];
-        sscanf(t_str.c_str(),"%80f",&t);
-
-        std::string rots_str = tokens[ival++];
-        sscanf(rots_str.c_str(),"%80f",&rots);
-
-        std::string rotz_str = tokens[ival++];
-        sscanf(rotz_str.c_str(),"%80f",&rotz);
-
-        std::string rott_str = tokens[ival++];
-        sscanf(rott_str.c_str(),"%80f",&rott);
+        s = MdtStringUtils::stof(tokens[ival++]);
+        z = MdtStringUtils::stof(tokens[ival++]);
+        t = MdtStringUtils::stof(tokens[ival++]);
+        rots = MdtStringUtils::stof(tokens[ival++]);
+        rotz = MdtStringUtils::stof(tokens[ival++]);
+        rott = MdtStringUtils::stof(tokens[ival++]);
 
         float bz, bp, bn, sp, sn, tw, pg, tr, eg, ep, en;
-        std::string tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&bz);
-        tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&bp);
-        tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&bn);
-        tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&sp);
-        tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&sn);
-        tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&tw);
-        tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&pg);
-        tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&tr);
-        tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&eg);
-        tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&ep);
-        tmp_str = tokens[ival++];
-        sscanf(tmp_str.c_str(),"%80f",&en);
+        bz = MdtStringUtils::stof(tokens[ival++]);
+        bp = MdtStringUtils::stof(tokens[ival++]);
+        bn = MdtStringUtils::stof(tokens[ival++]);
+        sp = MdtStringUtils::stof(tokens[ival++]);
+        sn = MdtStringUtils::stof(tokens[ival++]);
+        tw = MdtStringUtils::stof(tokens[ival++]);
+        pg = MdtStringUtils::stof(tokens[ival++]);
+        tr = MdtStringUtils::stof(tokens[ival++]);
+        eg = MdtStringUtils::stof(tokens[ival++]);
+        ep = MdtStringUtils::stof(tokens[ival++]);
+        en = MdtStringUtils::stof(tokens[ival++]);
 
         Identifier id, id_mult;
         if(stationType == "MML" || stationType == "MMS"){
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcCoolStrSvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcCoolStrSvc.cxx
index 01ecaff64126..e7d64c3369b9 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcCoolStrSvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcCoolStrSvc.cxx
@@ -23,6 +23,7 @@
 #include "MuonCondData/RpcCalibDBEntry.h"
 #include "MuonCondData/RpcCalibDataContainer.h"
 #include "MuonCondSvc/RpcCoolStrSvc.h"
+#include "MuonCondSvc/MdtStringUtils.h"
 
 namespace MuonCalib {
 
@@ -130,9 +131,10 @@ namespace MuonCalib {
 
     while (getline(in, theLine)) { // Reads all lines
 
-      int delimiter=theLine.find(";");
-      Identifier gapID(atoi(theLine.substr(0,delimiter).c_str()));
-      std::string payLoad=theLine.substr(delimiter+2,theLine.size()-delimiter-2);
+      int delimiter=theLine.find(';');
+      std::string_view lineview(theLine);
+      Identifier gapID(MuonCalib::MdtStringUtils::atoi(lineview.substr(0,delimiter)));
+      std::string_view payLoad=lineview.substr(delimiter+2,theLine.size()-delimiter-2);
 
 
       const RpcCalibDBEntry* newEntry=new RpcCalibDBEntry(gapID, payLoad);
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TGCTriggerDbAlg.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TGCTriggerDbAlg.cxx
index 93d66ac6493f..9d84977eed69 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TGCTriggerDbAlg.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TGCTriggerDbAlg.cxx
@@ -195,7 +195,7 @@ void TGCTriggerDbAlg::fillReadMapBw(TGCTriggerData* writeCdo,
 
     char delimiter = '\n';
     std::string field, tag;
-    uint32_t phimod2 = modulename[moduleId].find("b") != std::string::npos ? 1 : 0;
+    uint32_t phimod2 = modulename[moduleId].find('b') != std::string::npos ? 1 : 0;
     uint32_t modaddr = ((modulenumber[moduleId] & TGCTriggerData::MODULE_MASK)<<TGCTriggerData::MODULE_SHIFT) +
                        ((phimod2 & TGCTriggerData::PHIMOD2_MASK)<<TGCTriggerData::PHIMOD2_SHIFT);
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/MuonCondTool/MDT_MapConversion.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/MuonCondTool/MDT_MapConversion.h
index 71ea00e53da6..d9f99406c3c6 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/MuonCondTool/MDT_MapConversion.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/MuonCondTool/MDT_MapConversion.h
@@ -31,7 +31,7 @@ public:
   virtual StatusCode initialize();
 
 
-  virtual const Identifier& ConvertToOffline(const std::string &OnlineId,
+  virtual const Identifier& ConvertToOffline(std::string_view OnlineId,
                                              bool quiet = false) const;
 
   //  const std::string OnlineName(Identifier OfflineId);
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/CSC_DCSConditionsTool.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/CSC_DCSConditionsTool.cxx
index 5ef7dfb1c311..48bd6ad5f80c 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/CSC_DCSConditionsTool.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/CSC_DCSConditionsTool.cxx
@@ -70,9 +70,11 @@ StatusCode CSC_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
   const CondAttrListCollection* atrc=nullptr;
   ATH_MSG_INFO("Try to read from folder <"<<m_hvFolder<<">");
   // Print out callback information
-  if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Level " << I << " Keys: ");
-  std::list<std::string>::const_iterator keyIt = keys.begin();
-  for (; keyIt != keys.end(); ++ keyIt)  if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(*keyIt << " ");  
+  if (msgLvl(MSG::DEBUG)) {
+    ATH_MSG_DEBUG("Level " << I << " Keys: ");
+    std::list<std::string>::const_iterator keyIt = keys.begin();
+    for (; keyIt != keys.end(); ++ keyIt)  ATH_MSG_DEBUG(*keyIt << " ");
+  }
 
   ATH_CHECK(detStore()->retrieve(atrc,m_hvFolder));
   ATH_MSG_INFO("CondAttrListCollection from DB folder have been obtained with size "<< atrc->size());
@@ -81,8 +83,6 @@ StatusCode CSC_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
   Identifier ChamberId;
   unsigned int layer_index=0;
   unsigned int chan_index=0;
-  std::map<Identifier,int>::const_iterator it;
-  std::pair<std::map<Identifier,int>::const_iterator,bool> ret;
   
   int hv_state, lv_state, hv_setpoint0, hv_setpoint1;
   for (itr = atrc->begin(); itr != atrc->end(); ++itr){
@@ -105,38 +105,34 @@ StatusCode CSC_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
    
     
     
-    std::string delimiter = "_";
-    std::vector<std::string> tokens;
-    MuonCalib::MdtStringUtils::tokenize(csc_chan_name,tokens,delimiter);
-
-    for (unsigned int i=0; i<tokens.size(); i++) {
-      
-      if(tokens[i]!="0"){
-	 if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Sequence for name string load is \n" << tokens[i]); 
-      }
-      
+    char delimiter = '_';
+    const auto tokens = MuonCalib::MdtStringUtils::tokenize(csc_chan_name,delimiter);
+    if (msgLvl(MSG::DEBUG)){
+       for (unsigned int i=0; i<tokens.size(); i++) {
+          if(tokens[i]!="0"){
+	           ATH_MSG_DEBUG("Sequence for name string load is \n" << tokens[i]); 
+       }
+     }
     }
 
-    
-
     if((hv_state!=1 or lv_state!=1 or hv_setpoint0 <1000 or hv_setpoint1 <1000) && !tokens.empty()){
       
       if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("NOT 0 HV : " << hv_state << " ChamberName : "<<tokens[0] << "wirelayer" << tokens[1]);
       int eta=0; int phi=0;
       //std::string chamber_name;
-      std::string layer = tokens[1];
-      std::string number_layer =tokens[1].substr(1,2);   
-      int wirelayer = atoi(const_cast<char*>(number_layer.c_str()));
+      std::string_view layer = tokens[1];
+      std::string_view number_layer =tokens[1].substr(1,2);
+      int wirelayer = MuonCalib::MdtStringUtils::atoi(number_layer);
       //std::string chamber_name = tokens[0];
-      std::string chamber_name;
-      std::string eta_side = tokens[0].substr(0,1);
-      if (eta_side == "A") eta = +1;
-      if (eta_side == "C") eta = -1;
-      std::string size_side = tokens[0].substr(1,1);
+      std::string_view chamber_name;
+      char eta_side = tokens[0][0];
+      if (eta_side == 'A') eta = +1;
+      if (eta_side == 'C') eta = -1;
+      char size_side = tokens[0][1];
       
-      if (size_side == "L") chamber_name = "CSL";
-      if (size_side == "S") chamber_name = "CSS";
-      std::string sector_side = tokens[0].substr(2,4);
+      if (size_side == 'L') chamber_name = "CSL";
+      if (size_side == 'S') chamber_name = "CSS";
+      std::string_view sector_side = tokens[0].substr(2,4);
       if (sector_side == "01" || sector_side == "02") phi=1;
       if (sector_side == "03" || sector_side == "04") phi=2;
       if (sector_side == "05" || sector_side == "06") phi=3;
@@ -149,9 +145,15 @@ StatusCode CSC_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
       ChamberId = m_idHelperSvc->cscIdHelper().elementID(chamber_name, eta, phi);
       Identifier WireLayerId = m_idHelperSvc->cscIdHelper().channelID(ChamberId, 1, wirelayer,1,1);
       if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("chamber Name = " <<chamber_name);
-      std::string WireLayerstring = chamber_name+"_"+eta_side+"_"+sector_side+"_"+layer;  
-      m_cachedDeadWireLayers.push_back(WireLayerstring);
-       if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Layers Off = " <<WireLayerstring);
+      std::string WireLayerstring = std::string(chamber_name);
+      WireLayerstring+='_';
+      WireLayerstring+=eta_side;
+      WireLayerstring+='_';
+      WireLayerstring+=sector_side;
+      WireLayerstring+='_';
+      WireLayerstring+=layer;
+      if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Layers Off = " <<WireLayerstring);
+      m_cachedDeadWireLayers.push_back(std::move(WireLayerstring));
       m_cachedDeadWireLayersId.push_back(WireLayerId);
 
       if(m_CSC_LayerMap.count(ChamberId))
@@ -188,10 +190,11 @@ StatusCode CSC_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
 StatusCode CSC_DCSConditionsTool::loadchamber(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
   ATH_MSG_INFO("Load chamber from DCS DB");
   // Print out callback information
-  if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("Level " << I << " Keys: ");
-  std::list<std::string>::const_iterator keyIt = keys.begin();
-  for (; keyIt != keys.end(); ++ keyIt)  if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(*keyIt << " ");
- 
+  if (msgLvl(MSG::DEBUG)) {
+    ATH_MSG_DEBUG("Level " << I << " Keys: ");
+    std::list<std::string>::const_iterator keyIt = keys.begin();
+    for (; keyIt != keys.end(); ++ keyIt)  ATH_MSG_DEBUG(*keyIt << " ");
+  }
   const CondAttrListCollection* atrc=nullptr;
   ATH_MSG_INFO("Try to read from folder <"<<m_chamberFolder<<">");
 
@@ -199,32 +202,26 @@ StatusCode CSC_DCSConditionsTool::loadchamber(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
   ATH_MSG_INFO(" CondAttrListCollection from DB folder have been obtained with size "<< atrc->size());
   
   CondAttrListCollection::const_iterator itr;
-  
-  std::map<Identifier,int>::const_iterator it;
-
-  std::pair<std::map<Identifier,int>::const_iterator,bool> ret;
 
-  std::vector<std::string> chamber_good;
+  std::vector<std::string> chamber_good;//Not string_view because of possible scoping issues
 
   for (itr = atrc->begin(); itr != atrc->end(); ++itr){
     
     const coral::AttributeList& atr=itr->second;
      if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("AttributeList  size : " << atr.size());
     
-    std::string chamber_enabled=*(static_cast<const std::string*>((atr["enabledChambers"]).addressOfData()));
+    const std::string &chamber_enabled=*(static_cast<const std::string*>((atr["enabledChambers"]).addressOfData()));
     
-    std::string delimiter = " ";
-    std::vector<std::string> tokens;
-    MuonCalib::MdtStringUtils::tokenize(chamber_enabled,tokens,delimiter);
+    char delimiter = ' ';
+    auto tokens = MuonCalib::MdtStringUtils::tokenize(chamber_enabled,delimiter);
     
     for (unsigned int i=0; i<tokens.size(); i++) {
-      chamber_good.push_back(tokens[i]);
+      chamber_good.emplace_back(tokens[i]);
     }
     
   }
   
-  std::string chamber_all[] = {"A01","A02","A03","A04","A05","A06","A07","A08","A09","A10","A11","A12","A13","A14","A15","A16","C01","C02","C03","C04","C05","C06","C07","C08","C09","C10","C11","C12","C13","C14","C15","C16"};
-  std::vector<std::string> chamber_v(chamber_all,chamber_all+32);      
+  std::vector<std::string_view> chamber_v{"A01","A02","A03","A04","A05","A06","A07","A08","A09","A10","A11","A12","A13","A14","A15","A16","C01","C02","C03","C04","C05","C06","C07","C08","C09","C10","C11","C12","C13","C14","C15","C16"};
   sort(chamber_v.begin(), chamber_v.end());
   
   for(unsigned int count=0; count<chamber_good.size(); count++){
@@ -233,7 +230,7 @@ StatusCode CSC_DCSConditionsTool::loadchamber(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
       if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG("found chamber good!\n" <<chamber_v[count]); 
     }else {
       if (msgLvl(MSG::DEBUG)) ATH_MSG_DEBUG(" not found = " << chamber_good[count]);
-      m_cachedDeadStationsStr.push_back(chamber_good[count]);
+      m_cachedDeadStationsStr.emplace_back(chamber_good[count]);
     }
     
   }
@@ -241,11 +238,11 @@ StatusCode CSC_DCSConditionsTool::loadchamber(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
   for(unsigned int tot=0; tot<m_cachedDeadStationsStr.size(); tot++){
     int eta=0; int phi=0;
 
-    std::string chamber_name;
-    std::string eta_side = m_cachedDeadStationsStr[tot].substr(0,1);
-    if (eta_side == "A") eta = +1;
-    if (eta_side == "C") eta = -1;
-    std::string sector_side = m_cachedDeadStationsStr[tot].substr(2,4);
+    std::string_view chamber_name;
+    char eta_side = m_cachedDeadStationsStr[tot][0];
+    if (eta_side == 'A') eta = +1;
+    if (eta_side == 'C') eta = -1;
+    std::string_view sector_side = std::string_view(m_cachedDeadStationsStr[tot]).substr(2,4);
     if (sector_side == "01" || sector_side == "02") phi=1;
     if (sector_side == "03" || sector_side == "04") phi=2;
     if (sector_side == "05" || sector_side == "06") phi=3;
@@ -271,9 +268,8 @@ StatusCode CSC_DCSConditionsTool::loadchamber(IOVSVC_CALLBACK_ARGS_P(I,keys)) {
   m_cachedDeadStationsId.insert( m_cachedDeadStationsId.end(),
 				 m_cachedDeadStationsId_chamber.begin(),m_cachedDeadStationsId_chamber.end());
   std::sort(m_cachedDeadStationsId.begin(),m_cachedDeadStationsId.end(),compareId);  
-  std::vector<Identifier>::const_iterator itId;
-  itId= std::unique(m_cachedDeadStationsId.begin(),m_cachedDeadStationsId.end());
-  m_cachedDeadStationsId.resize(itId -m_cachedDeadStationsId.begin());
+  std::vector<Identifier>::const_iterator itId= std::unique(m_cachedDeadStationsId.begin(),m_cachedDeadStationsId.end());
+  m_cachedDeadStationsId.resize(std::distance(m_cachedDeadStationsId.cbegin(), itId));
 
   return StatusCode::SUCCESS;
 }
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DCSConditionsRun2Tool.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DCSConditionsRun2Tool.cxx
index f3703324ae7b..f7e6e9f98de7 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DCSConditionsRun2Tool.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DCSConditionsRun2Tool.cxx
@@ -242,7 +242,7 @@ StatusCode MDT_DCSConditionsRun2Tool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
       hv_v1_ml2=*(static_cast<const float*>((atr["v1set_ML2"]).addressOfData()));
       
             
-      std::string delimiter2 = "_";
+      char delimiter2 = '_';
       std::vector<std::string> tokens2;
       
       MuonCalib::MdtStringUtils::tokenize(hv_payload,tokens2,delimiter2);
@@ -261,7 +261,7 @@ StatusCode MDT_DCSConditionsRun2Tool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 	//	m_log << MSG::INFO << "NOT ON and NOT STANDBY HV : " <<hv_name_ml1  << " ChamberName : "<<tokens2[0] << "multilayer 1"  <<endmsg;	
 	//	m_cachedDeadMultiLayers.push_back(1);
 	int multilayer =1;
-	std::string chamber_name = tokens2[0];
+	const std::string &chamber_name = tokens2[0];
 	Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
 	Identifier MultiLayerId = m_mdtIdHelper->channelID(ChamberId,multilayer,1,1);
 	m_cachedDeadMultiLayersId.push_back(MultiLayerId);
@@ -274,7 +274,7 @@ StatusCode MDT_DCSConditionsRun2Tool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 	//m_log << MSG::INFO << "STANDBY HV : " << hv_name_ml1<< " ChamberName : "<<tokens2[0] << "multilayer 1"<<endmsg;	
 	
 	int multilayer =1;
-	std::string chamber_name = tokens2[0];
+	const std::string &chamber_name = tokens2[0];
 	Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
 	Identifier MultiLayerId = m_mdtIdHelper->channelID(ChamberId,multilayer,1,1);
 	m_cachedDeadMultiLayersId.push_back(MultiLayerId);
@@ -285,7 +285,7 @@ StatusCode MDT_DCSConditionsRun2Tool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 	//m_log << MSG::INFO << "NOT ON and NOT STANDBY HV : " <<hv_name_ml2  << " ChamberName : "<<tokens2[0] << "multilayer 2"  <<endmsg;	
 	//m_cachedDeadMultiLayers.push_back(2);
 	int multilayer =1;
-	std::string chamber_name = tokens2[0];
+	const std::string &chamber_name = tokens2[0];
 	Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
 	Identifier MultiLayerId = m_mdtIdHelper->channelID(ChamberId,multilayer,1,1);
 	m_cachedDeadMultiLayersId.push_back(MultiLayerId);
@@ -298,7 +298,7 @@ StatusCode MDT_DCSConditionsRun2Tool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 	//m_log << MSG::INFO << "STANDBY HV : " << hv_name_ml2<< " ChamberName : "<<tokens2[0] << "multilayer 2"<<endmsg;	
 	
 	int multilayer =2;
-	std::string chamber_name = tokens2[0];
+	const std::string &chamber_name = tokens2[0];
 	Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
 	Identifier MultiLayerId = m_mdtIdHelper->channelID(ChamberId,multilayer,1,1);
 	m_cachedDeadMultiLayersId.push_back(MultiLayerId);
@@ -307,7 +307,7 @@ StatusCode MDT_DCSConditionsRun2Tool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
       if(hv_name_ml2 !="ON" && hv_name_ml2 !="STANDBY" && hv_name_ml2 !="UNKNOWN" && hv_name_ml1 !="ON" && hv_name_ml1 !="STANDBY" && hv_name_ml1 !="UNKNOWN" ){
 	
       m_cachedDeadStations.push_back(tokens2[0]);
-      std::string chamber_name=tokens2[0];
+      const std::string &chamber_name=tokens2[0];
       
       Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
       m_cachedDeadStationsId.push_back(ChamberId);
@@ -316,7 +316,7 @@ StatusCode MDT_DCSConditionsRun2Tool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
       if(hv_name_ml2=="STANDBY" && hv_v0_ml2 != hv_v1_ml2 && hv_name_ml1=="STANDBY" && hv_v0_ml1 != hv_v1_ml1){
  	
 	m_cachedDeadStations.push_back(tokens2[0]);
-      std::string chamber_name=tokens2[0];
+      const std::string &chamber_name=tokens2[0];
       
       Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
       m_cachedDeadStationsId.push_back(ChamberId);
@@ -378,7 +378,7 @@ StatusCode MDT_DCSConditionsRun2Tool::loadLV(IOVSVC_CALLBACK_ARGS_P(I,keys))
     if(atr.size()){
       hv_name=*(static_cast<const std::string*>((atr["fsmCurrentState_LV"]).addressOfData()));
       //m_log<<MSG::DEBUG<<" CondAttrListCollection ChanNum : "<<chanNum<<" ChanName : " << atrc->chanName(chanNum) <<endmsg;
-      std::string delimiter = " ";
+      char delimiter = ' ';
       std::vector<std::string> tokens;
       MuonCalib::MdtStringUtils::tokenize(hv_name,tokens,delimiter);
       for (unsigned int i=0; i<tokens.size(); i++)
@@ -389,7 +389,7 @@ StatusCode MDT_DCSConditionsRun2Tool::loadLV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 	  }
 	}
        
-      std::string delimiter2 = "_";
+      char delimiter2 = '_';
       std::vector<std::string> tokens2;
       MuonCalib::MdtStringUtils::tokenize(hv_payload,tokens2,delimiter2);
       
@@ -403,7 +403,7 @@ StatusCode MDT_DCSConditionsRun2Tool::loadLV(IOVSVC_CALLBACK_ARGS_P(I,keys))
       if(tokens[0]!="ON"){
 	 if( m_verbose ) m_log << MSG::VERBOSE << "NOT ON LV: " << tokens[0]<< " ChamberName : "<<tokens2[0] <<endmsg;
 	m_cachedDeadLVStations.push_back(tokens2[0]);
-	std::string chamber_name= tokens2[0];
+	const std::string &chamber_name= tokens2[0];
 	Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
 	m_cachedDeadLVStationsId.push_back(ChamberId);
 	 if( m_verbose ) m_log<<MSG::VERBOSE<<"Chamber off from LV Chamber !=ON "<<tokens2[0] <<endmsg;
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DCSConditionsTool.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DCSConditionsTool.cxx
index acfc96008d22..7c44fa34af1c 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DCSConditionsTool.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DCSConditionsTool.cxx
@@ -249,14 +249,13 @@ StatusCode MDT_DCSConditionsTool::loadDropChamber(IOVSVC_CALLBACK_ARGS_P(I,keys)
     
     chamber_dropped=*(static_cast<const std::string*>((atr["Chambers_disabled"]).addressOfData()));
     
-    std::string delimiter = " ";
-    std::vector<std::string> tokens;
-    MuonCalib::MdtStringUtils::tokenize(chamber_dropped,tokens,delimiter);
+    char delimiter = ' ';
+    auto tokens = MuonCalib::MdtStringUtils::tokenize(chamber_dropped,delimiter);
     for (unsigned int i=0; i<tokens.size(); i++) {
       if(tokens[i]!="0"){
 
-        m_cachedDeadStations.push_back(tokens[i]);
-	std::string chamber_name=tokens[i];
+        m_cachedDeadStations.push_back(std::string(tokens[i]));
+	std::string_view chamber_name=tokens[i];
 	 
 	Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
 	m_cachedDeadStationsId.push_back(ChamberId);
@@ -275,7 +274,7 @@ StatusCode MDT_DCSConditionsTool::loadDropChamber(IOVSVC_CALLBACK_ARGS_P(I,keys)
 StatusCode MDT_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 {
  
-
+  using namespace MuonCalib;
   m_log.setLevel(msgLevel());
   m_debug = m_log.level() <= MSG::DEBUG;
   m_verbose = m_log.level() <= MSG::VERBOSE;
@@ -359,9 +358,8 @@ StatusCode MDT_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
     if(atr.size()==1){
       hv_name=*(static_cast<const std::string*>((atr["fsm_currentState"]).addressOfData()));
       //m_log<<MSG::DEBUG<<" CondAttrListCollection ChanNum  : "<<chanNum<<" ChanName : " << atrc->chanName(chanNum) <<endmsg;
-      std::string delimiter = " ";
-      std::vector<std::string> tokens;
-      MuonCalib::MdtStringUtils::tokenize(hv_name,tokens,delimiter);
+      char delimiter = ' ';
+      auto tokens= MuonCalib::MdtStringUtils::tokenize(hv_name,delimiter);
       for (unsigned int i=0; i<tokens.size(); i++)
 	{
 	  
@@ -371,9 +369,8 @@ StatusCode MDT_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 	}
       
       
-      std::string delimiter2 = "_";
-      std::vector<std::string> tokens2;
-      MuonCalib::MdtStringUtils::tokenize(hv_payload,tokens2,delimiter2);
+      char delimiter2 = '_';
+      auto tokens2 = MuonCalib::MdtStringUtils::tokenize(hv_payload,delimiter2);
       
       for (unsigned int i=0; i<tokens2.size(); i++) {
 	if(tokens2[i]!="0"){
@@ -385,9 +382,9 @@ StatusCode MDT_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
       if(tokens[0]!="ON" && tokens[0]!="STANDBY" && tokens[0]!="UNKNOWN"){
 	
 	if( m_verbose ) m_log << MSG::VERBOSE << "NOT ON and NOT STANDBY HV : " << tokens[0]<< " ChamberName : "<<tokens2[2] << "multilayer" << tokens2[3]<<endmsg;	
-	m_cachedDeadMultiLayers.push_back(tokens2[2]);
-	int multilayer =atoi(tokens2[3].c_str());
-	std::string chamber_name = tokens2[2];
+	m_cachedDeadMultiLayers.push_back(std::string(tokens2[2]));
+	int multilayer =MdtStringUtils::atoi(tokens2[3]);
+	std::string_view chamber_name = tokens2[2];
 	Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
 	Identifier MultiLayerId = m_mdtIdHelper->channelID(ChamberId,multilayer,1,1);
 	m_cachedDeadMultiLayersId.push_back(MultiLayerId);
@@ -396,8 +393,8 @@ StatusCode MDT_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 	
 	if( m_verbose ) m_log << MSG::VERBOSE << "STANDBY HV : " << tokens[0]<< " ChamberName : "<<tokens2[2] << "multilayer" << tokens2[3]<<endmsg;	
 	
-	int multilayer =atoi(tokens2[3].c_str());
-	std::string chamber_name = tokens2[2];
+	int multilayer =MdtStringUtils::atoi(tokens2[3]);
+	std::string_view chamber_name = tokens2[2];
 	Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
 	Identifier MultiLayerId = m_mdtIdHelper->channelID(ChamberId,multilayer,1,1);
 	m_cachedDeadMultiLayersId_standby.push_back(MultiLayerId);
@@ -435,9 +432,8 @@ StatusCode MDT_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
       setPointsV0_name=*(static_cast<const float*>((atr_v0["readBackSettings_v0"]).addressOfData()));
       //m_log << MSG::DEBUG << "Sequence for name string load is inside V0\n" << "  "<<setPointsV0_name<< endmsg; 
       //m_log<<MSG::DEBUG<<" CondAttrListCollection ChanName : "<<atrc_v0->chanName(chanNum) <<endmsg;
-      std::string delimiter2 = "_";
-      std::vector<std::string> tokens2;
-      MuonCalib::MdtStringUtils::tokenize(setPointsV0_payload,tokens2,delimiter2);
+      char delimiter2 = '_';
+      const auto tokens2= MuonCalib::MdtStringUtils::tokenize(setPointsV0_payload,delimiter2);
       //m_ChamberML_V0_chanum.insert(std::make_pair(int(chanNum),float(setPointsV0_name)));
       m_ChamberML_V0_chanum[int(chanNum)]=float(setPointsV0_name);
 
@@ -451,8 +447,8 @@ StatusCode MDT_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 
       }
       
-      int multilayer =atoi(tokens2[3].c_str());
-      std::string chamber_name = tokens2[2];
+      int multilayer =MdtStringUtils::atoi(tokens2[3]);
+      const std::string_view &chamber_name = tokens2[2];
       
       Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
       Identifier MultiLayerId = m_mdtIdHelper->channelID(ChamberId,multilayer,1,1);
@@ -485,9 +481,8 @@ StatusCode MDT_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
     if(atr_v1.size()==1){
       setPointsV1_name=*(static_cast<const float*>((atr_v1["readBackSettings_v1"]).addressOfData()));
          
-      std::string delimiter2 = "_";
-      std::vector<std::string> tokens2;
-      MuonCalib::MdtStringUtils::tokenize(setPointsV1_payload,tokens2,delimiter2);
+      char delimiter2 = '_';
+      auto tokens2 = MuonCalib::MdtStringUtils::tokenize(setPointsV1_payload,delimiter2);
       //m_ChamberML_V1_chanum.insert(std::make_pair(int(chanNum),float(setPointsV1_name)));
       m_ChamberML_V1_chanum[int(chanNum)]=float(setPointsV1_name);
       
@@ -498,8 +493,8 @@ StatusCode MDT_DCSConditionsTool::loadHV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 	
       }
      
-      int multilayer =atoi(tokens2[3].c_str());
-      std::string chamber_name = tokens2[2];
+      int multilayer =MuonCalib::MdtStringUtils::atoi(tokens2[3]);
+      std::string_view chamber_name = tokens2[2];
       Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
       Identifier MultiLayerId = m_mdtIdHelper->channelID(ChamberId,multilayer,1,1);
       //m_ChamberML_V1.insert(std::make_pair(MultiLayerId,setPointsV1_name));
@@ -578,9 +573,8 @@ StatusCode MDT_DCSConditionsTool::loadLV(IOVSVC_CALLBACK_ARGS_P(I,keys))
     if(atr.size()==1){
       hv_name=*(static_cast<const std::string*>((atr["fsm_currentState"]).addressOfData()));
       //m_log<<MSG::DEBUG<<" CondAttrListCollection ChanNum : "<<chanNum<<" ChanName : " << atrc->chanName(chanNum) <<endmsg;
-      std::string delimiter = " ";
-      std::vector<std::string> tokens;
-      MuonCalib::MdtStringUtils::tokenize(hv_name,tokens,delimiter);
+      char delimiter = ' ';
+      const auto tokens = MuonCalib::MdtStringUtils::tokenize(hv_name,delimiter);
       for (unsigned int i=0; i<tokens.size(); i++)
 	{
 	  
@@ -590,9 +584,8 @@ StatusCode MDT_DCSConditionsTool::loadLV(IOVSVC_CALLBACK_ARGS_P(I,keys))
 	}
      
       
-      std::string delimiter2 = "_";
-      std::vector<std::string> tokens2;
-      MuonCalib::MdtStringUtils::tokenize(hv_payload,tokens2,delimiter2);
+      char delimiter2 = '_';
+      auto tokens2 = MuonCalib::MdtStringUtils::tokenize(hv_payload,delimiter2);
       
       for (unsigned int i=0; i<tokens2.size(); i++) {
 	if(tokens2[i]!="0"){
@@ -603,8 +596,8 @@ StatusCode MDT_DCSConditionsTool::loadLV(IOVSVC_CALLBACK_ARGS_P(I,keys))
       
       if(tokens[0]!="ON"){
 	 if( m_verbose ) m_log << MSG::VERBOSE << "NOT ON LV: " << tokens[0]<< " ChamberName : "<<tokens2[2] <<endmsg;
-	m_cachedDeadLVStations.push_back(tokens2[2]);
-	std::string chamber_name= tokens2[2];
+	m_cachedDeadLVStations.push_back(std::string(tokens2[2]));
+	std::string_view chamber_name= tokens2[2];
 	Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
 	m_cachedDeadLVStationsId.push_back(ChamberId);
 	 if( m_verbose ) m_log<<MSG::VERBOSE<<"Chamber off from LV Chamber !=ON "<<tokens2[2] <<endmsg;
@@ -689,18 +682,16 @@ StatusCode MDT_DCSConditionsTool::loadJTAG(IOVSVC_CALLBACK_ARGS_P(I,keys))
         
     if(atr.size()==1){
       hv_name=*(static_cast<const std::string*>((atr["fsm_currentState"]).addressOfData()));
-      std::string delimiter = " ";
-      std::vector<std::string> tokens;
-      MuonCalib::MdtStringUtils::tokenize(hv_name,tokens,delimiter);
+      char delimiter = ' ';
+      auto tokens = MuonCalib::MdtStringUtils::tokenize(hv_name,delimiter);
       for (unsigned int i=0; i<tokens.size(); i++)
 	{
 	  if(tokens[i]!="0"){
 	  }
 	}
       
-      std::string delimiter2 = "_";
-      std::vector<std::string> tokens2;
-      MuonCalib::MdtStringUtils::tokenize(hv_payload,tokens2,delimiter2);
+      char delimiter2 = '_';
+      auto tokens2 = MuonCalib::MdtStringUtils::tokenize(hv_payload,delimiter2);
       
       for (unsigned int i=0; i<tokens2.size(); i++) {
 	if(tokens2[i]!="0"){
@@ -710,8 +701,8 @@ StatusCode MDT_DCSConditionsTool::loadJTAG(IOVSVC_CALLBACK_ARGS_P(I,keys))
       
       if(tokens[0]!="INITIALIZED"){
 
-	m_cachedDeadJTAGStatus.push_back(tokens2[2]);
-	std::string chamber_name= tokens2[2];
+	m_cachedDeadJTAGStatus.push_back(std::string(tokens2[2]));
+	std::string_view chamber_name= tokens2[2];
 	Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
 	m_cachedDeadJTAGStatusId.push_back(ChamberId);
       }
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DQConditionsTool.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DQConditionsTool.cxx
index fcb4d6cb7c58..6ea08115db78 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DQConditionsTool.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_DQConditionsTool.cxx
@@ -206,7 +206,7 @@ StatusCode MDT_DQConditionsTool::loadDeadChamber(IOVSVC_CALLBACK_ARGS_P(I,keys))
   else
     if( m_debug ) m_log<<MSG::DEBUG<<" CondAttrListCollection from DB folder have been obtained with size "<< atrc->size() <<endmsg;
   
- 
+   using namespace MuonCalib;
   CondAttrListCollection::const_iterator itr;
  
   for (itr = atrc->begin(); itr != atrc->end(); ++itr) {
@@ -220,21 +220,18 @@ StatusCode MDT_DQConditionsTool::loadDeadChamber(IOVSVC_CALLBACK_ARGS_P(I,keys))
     list_layer=*(static_cast<const std::string*>((atr["Dead_layer"]).addressOfData()));
     list_tube=*(static_cast<const std::string*>((atr["Dead_tube"]).addressOfData()));
     
-    std::string delimiter = " ";
-    std::vector<std::string> tokens;
-    std::vector<std::string> tokens_mlayer;
-    std::vector<std::string> tokens_layer;
+    char delimiter = ' ';
     Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
-    MuonCalib::MdtStringUtils::tokenize(list_tube,tokens,delimiter);
-    MuonCalib::MdtStringUtils::tokenize(list_mlayer,tokens_mlayer,delimiter);
-    MuonCalib::MdtStringUtils::tokenize(list_layer,tokens_layer,delimiter);
+    const auto tokens = MuonCalib::MdtStringUtils::tokenize(list_tube,delimiter);
+    const auto tokens_mlayer = MuonCalib::MdtStringUtils::tokenize(list_mlayer,delimiter);
+    const auto tokens_layer = MuonCalib::MdtStringUtils::tokenize(list_layer,delimiter);
     
     for (unsigned int i=0; i<tokens.size(); i++) {
       if(tokens[i]!="0"){
         
-	int ml = atoi((tokens[i].substr(0,1)).c_str());
-	int layer= atoi((tokens[i].substr(1,2)).c_str());
-	int tube= atoi((tokens[i].substr(2)).c_str());
+	int ml = MdtStringUtils::atoi(tokens[i][0]);
+	int layer= MdtStringUtils::atoi(tokens[i].substr(1,2));
+	int tube= MdtStringUtils::atoi(tokens[i].substr(2));
 	
 	Identifier ChannelId =m_mdtIdHelper->channelID(ChamberId,ml,layer,tube); 
 	m_cachedDeadTubesId.push_back(ChannelId);
@@ -245,7 +242,7 @@ StatusCode MDT_DQConditionsTool::loadDeadChamber(IOVSVC_CALLBACK_ARGS_P(I,keys))
     for (unsigned int i=0; i<tokens_mlayer.size(); i++) {
       if(tokens_mlayer[i]!="0"){
         
-	int ml = atoi((tokens_mlayer[i].substr(0)).c_str());
+	int ml = MdtStringUtils::atoi(tokens_mlayer[i].substr(0));
 	
 	Identifier ChannelId =m_mdtIdHelper->channelID(ChamberId,ml,1,1); 
 	m_cachedDeadMultiLayersId.push_back(ChannelId);
@@ -256,8 +253,8 @@ StatusCode MDT_DQConditionsTool::loadDeadChamber(IOVSVC_CALLBACK_ARGS_P(I,keys))
     for (unsigned int i=0; i<tokens_layer.size(); i++) {
       if(tokens_layer[i]!="0"){
         
-	int ml = atoi((tokens_layer[i].substr(0,1)).c_str());
-	int layer = atoi((tokens_layer[i].substr(1)).c_str());
+	int ml = MdtStringUtils::atoi(tokens_layer[i].substr(0,1));
+	int layer = MdtStringUtils::atoi(tokens_layer[i].substr(1));
 		
 	Identifier ChannelId =m_mdtIdHelper->channelID(ChamberId,ml,layer,1); 
 	m_cachedDeadLayersId.push_back(ChannelId);
@@ -275,7 +272,7 @@ StatusCode MDT_DQConditionsTool::loadDeadChamber(IOVSVC_CALLBACK_ARGS_P(I,keys))
 	
 StatusCode MDT_DQConditionsTool::loadNoisyChamber(IOVSVC_CALLBACK_ARGS_P(I,keys))
 {
-
+  using namespace MuonCalib;
   m_log.setLevel(msgLevel());
   m_debug = m_log.level() <= MSG::DEBUG;
   m_verbose = m_log.level() <= MSG::VERBOSE; 
@@ -318,21 +315,18 @@ StatusCode MDT_DQConditionsTool::loadNoisyChamber(IOVSVC_CALLBACK_ARGS_P(I,keys)
     list_layer=*(static_cast<const std::string*>((atr["Noisy_layer"]).addressOfData()));
     list_tube=*(static_cast<const std::string*>((atr["Noisy_tube"]).addressOfData()));
     
-    std::string delimiter = " ";
-    std::vector<std::string> tokens;
-    std::vector<std::string> tokens_mlayer;
-    std::vector<std::string> tokens_layer;
+    char delimiter = ' ';
     Identifier ChamberId= m_condMapTool->ConvertToOffline(chamber_name);
-    MuonCalib::MdtStringUtils::tokenize(list_tube,tokens,delimiter);
-    MuonCalib::MdtStringUtils::tokenize(list_mlayer,tokens_mlayer,delimiter);
-    MuonCalib::MdtStringUtils::tokenize(list_layer,tokens_layer,delimiter);
+    auto tokens = MuonCalib::MdtStringUtils::tokenize(list_tube,delimiter);
+    auto tokens_mlayer = MuonCalib::MdtStringUtils::tokenize(list_mlayer,delimiter);
+    auto tokens_layer = MuonCalib::MdtStringUtils::tokenize(list_layer,delimiter);
     
     for (unsigned int i=0; i<tokens.size(); i++) {
       if(tokens[i]!="0"){
         
-	int ml = atoi((tokens[i].substr(0,1)).c_str());
-	int layer= atoi((tokens[i].substr(1,2)).c_str());
-	int tube= atoi((tokens[i].substr(2)).c_str());
+	int ml = MdtStringUtils::atoi(tokens[i][0]);
+	int layer= MdtStringUtils::atoi(tokens[i].substr(1,2));
+	int tube= MdtStringUtils::atoi(tokens[i].substr(2));
 	
 	Identifier ChannelId =m_mdtIdHelper->channelID(ChamberId,ml,layer,tube); 
 	m_cachedNoisyTubesId.push_back(ChannelId);
@@ -343,7 +337,7 @@ StatusCode MDT_DQConditionsTool::loadNoisyChamber(IOVSVC_CALLBACK_ARGS_P(I,keys)
     for (unsigned int i=0; i<tokens_mlayer.size(); i++) {
       if(tokens_mlayer[i]!="0"){
         
-	int ml = atoi((tokens_mlayer[i].substr(0)).c_str());
+	int ml = MdtStringUtils::atoi(tokens_mlayer[i].substr(0));
 	
 	Identifier ChannelId =m_mdtIdHelper->channelID(ChamberId,ml,1,1); 
 	m_cachedNoisyMultiLayersId.push_back(ChannelId);
@@ -354,8 +348,8 @@ StatusCode MDT_DQConditionsTool::loadNoisyChamber(IOVSVC_CALLBACK_ARGS_P(I,keys)
     for (unsigned int i=0; i<tokens_layer.size(); i++) {
       if(tokens_layer[i]!="0"){
         
-	int ml = atoi((tokens_layer[i].substr(0,1)).c_str());
-	int layer = atoi((tokens_layer[i].substr(1)).c_str());
+	int ml = MdtStringUtils::atoi(tokens_layer[i].substr(0,1));
+	int layer = MdtStringUtils::atoi(tokens_layer[i].substr(1));
 		
 	Identifier ChannelId =m_mdtIdHelper->channelID(ChamberId,ml,layer,1); 
 	m_cachedNoisyLayersId.push_back(ChannelId);
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_MapConversion.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_MapConversion.cxx
index b9f7e3828cfd..10dc7c3d3ad7 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_MapConversion.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_MapConversion.cxx
@@ -137,29 +137,21 @@ StatusCode MDT_MapConversion::initialize()
   
 }
 
-const Identifier& MDT_MapConversion::ConvertToOffline(const std::string &OnlineId,
+const Identifier& MDT_MapConversion::ConvertToOffline(std::string_view OnlineId,
                                                       bool quiet /*=false */) const
 {
-//  int size = m_Chamber_Map.size();
-  //log << MSG::VERBOSE << "*************** size is\n" << size<< endmsg;
-  std::map<std::string, Identifier>::iterator iter;
-  
-  //const Identifier m_Online_empty;
-  
-  if (!m_Chamber_Map.empty()){
-    const auto& mapit = m_Chamber_Map.find(OnlineId);
-    if (ATH_UNLIKELY(mapit == m_Chamber_Map.end())) {
-      if (!quiet) {
-        ATH_MSG_ERROR( "Lookup of ID " << OnlineId << " in MDT_MapConversion::ConvertToOffline failed" );
-      }
-      return m_Online_empty; // not quite right but should never get here
-    }
-    const Identifier & OfflineName = (mapit->second);
+
+  if(m_Chamber_Map.empty()) return m_Online_empty; 
+
+  for(const auto &mappair : m_Chamber_Map){
+    if(mappair.first != OnlineId) continue;
+    const Identifier & OfflineName = mappair.second;
     return OfflineName;
-  } else { 
-    return m_Online_empty; 
   }
-  
+  if (!quiet) {
+    ATH_MSG_ERROR( "Lookup of ID " << OnlineId << " in MDT_MapConversion::ConvertToOffline failed" );
+  }
+  return m_Online_empty; // not quite right but should never get here
   
 }
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/RPC_DCSConditionsTool.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/RPC_DCSConditionsTool.cxx
index 1d22116c46a4..064dd3098794 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/RPC_DCSConditionsTool.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/RPC_DCSConditionsTool.cxx
@@ -197,17 +197,16 @@ StatusCode RPC_DCSConditionsTool::loadPanelOff(IOVSVC_CALLBACK_ARGS_P(I,keys))
       if( m_debug )  m_log << MSG::DEBUG <<  "panel_off "<< panel_off << endmsg;
       if( m_debug )  m_log << MSG::DEBUG <<  "panel_reason "<< panel_reason_off << endmsg;
  
-      std::string delimiter = ",";
-      std::vector<std::string> info_panel;
-      MuonCalib::MdtStringUtils::tokenize(panel_off,info_panel,delimiter);
+      char delimiter = ',';
+      const auto info_panel = MuonCalib::MdtStringUtils::tokenize(panel_off,delimiter);
    
       Identifier PanelId;
     
       for(unsigned int i=0; i<info_panel.size();i++){
-        const char* ch_tmp= (info_panel[i].c_str());
-        if( m_debug )  m_log << MSG::DEBUG << " info_panel " << ch_tmp << " "<<atoi(ch_tmp)<< endmsg; 
+        const std::string_view &ch_tmp= info_panel[i];
+        if( m_debug )  m_log << MSG::DEBUG << " info_panel " << ch_tmp << " "<<MuonCalib::MdtStringUtils::atoi(ch_tmp)<< endmsg; 
       
-        PanelId= atoi(ch_tmp);
+        PanelId= MuonCalib::MdtStringUtils::atoi(ch_tmp);
     
         if(PanelId.get_compact()){
           if( m_debug )  m_log << MSG::DEBUG << "OFFPANEL "<<m_rpcIdHelper->show_to_string(PanelId) << endmsg;
@@ -274,17 +273,16 @@ StatusCode RPC_DCSConditionsTool::loadPanelDead(IOVSVC_CALLBACK_ARGS_P(I,keys))
       if( m_debug ) m_log << MSG::DEBUG <<  "panel_dead "<< panel_dead << endmsg;
       if( m_debug ) m_log << MSG::DEBUG <<  "panel_reason "<< panel_reason_dead << endmsg;
  
-      std::string delimiter = ",";
-      std::vector<std::string> info_panel;
-      MuonCalib::MdtStringUtils::tokenize(panel_dead,info_panel,delimiter);
+      char delimiter = ',';
+      const auto info_panel = MuonCalib::MdtStringUtils::tokenize(panel_dead,delimiter);
     
       Identifier PanelId;
     
       for(unsigned int i=0; i<info_panel.size();i++){
-        const char* ch_tmp= (info_panel[i].c_str());
-        if( m_debug ) m_log << MSG::DEBUG << " info_panel " << ch_tmp << " "<<atoi(ch_tmp)<< endmsg; 
+        const auto &ch_tmp= info_panel[i];
+        if( m_debug ) m_log << MSG::DEBUG << " info_panel " << ch_tmp << " "<<MuonCalib::MdtStringUtils::atoi(ch_tmp)<< endmsg; 
       
-        PanelId= atoi(ch_tmp);
+        PanelId= MuonCalib::MdtStringUtils::atoi(ch_tmp);
     
         if(PanelId.get_compact()){
           if( m_debug ) m_log << MSG::DEBUG << "DEADPANEL "<<  m_rpcIdHelper->show_to_string(PanelId) << endmsg;
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/RpcDetectorStatusDbTool.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/RpcDetectorStatusDbTool.cxx
index ef8a1f810670..279ee345d63b 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/RpcDetectorStatusDbTool.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/RpcDetectorStatusDbTool.cxx
@@ -166,14 +166,13 @@ StatusCode RpcDetectorStatusDbTool::loadRpcDqStatus(
       m_log << MSG::DEBUG << "striplist load is " << striplist << " "
             << striplist.size() << endmsg;
     }
-    std::string delimiter = " ";
-    std::vector<std::string> info_panel;
-    std::vector<float> info_panel_test;
-    MuonCalib::MdtStringUtils::tokenize(eff_panel, info_panel, delimiter);
+    char delimiter = ' ';
+    using namespace MuonCalib;
+    const auto info_panel = MdtStringUtils::tokenize(eff_panel, delimiter);
 
     if (m_verbose) {
       for (unsigned int i = 0; i < info_panel.size(); i++) {
-        const char* ch_tmp = (info_panel[i].c_str());
+        const auto &ch_tmp = info_panel[i];
         m_log << MSG::VERBOSE << " info_panel " << ch_tmp << endmsg;
         // version(3), # tracks, #strips, eff, errors, eff_gap, errors, res_cs1,
         // errors, res_cs2, errors, res_csother, errors, noise, errors,
@@ -182,8 +181,7 @@ StatusCode RpcDetectorStatusDbTool::loadRpcDqStatus(
       }
     }
 
-    const char* SDBversion = (info_panel[0].c_str());
-    int DBversion = atoi(SDBversion);
+    int DBversion = MdtStringUtils::atoi(info_panel[0]);
     if (m_FirstCall)
       m_log << MSG::INFO << " DB version  " << info_panel[0]
             << " Size of info_panel array = " << info_panel.size() << endmsg;
@@ -216,117 +214,104 @@ StatusCode RpcDetectorStatusDbTool::loadRpcDqStatus(
       m_log << MSG::INFO << " aver_cs9_up " << info_panel[24] << endmsg;
     }
 
-    const char* SNStrip = (info_panel[2].c_str());
-    int npanelstrip = atoi(SNStrip);
+    int npanelstrip = MdtStringUtils::atoi(info_panel[2]);
 
-    const char* SProjectedTracks = (info_panel[1].c_str());
-    double ProjectedTracks = atof(SProjectedTracks);
+    double ProjectedTracks = MdtStringUtils::stof(info_panel[1]);
     // m_RPC_PanelProjectedTracksMap.insert(std::make_pair(chamberId,ProjectedTracks));
     m_RPC_PanelProjectedTracksMap[chamberId] = ProjectedTracks;
 
     if (m_debug)
       m_log << MSG::DEBUG << "Size of  RPC_PanelProjectedTracksMap "
             << m_RPC_PanelProjectedTracksMap.size() << "; in panel " << channum
-            << " SProjectedTracks " << SProjectedTracks << " ProjectedTracks "
+            << " SProjectedTracks " << info_panel[1] << " ProjectedTracks "
             << ProjectedTracks << endmsg;
 
-    const char* SEfficiency = (info_panel[3].c_str());
-    double Efficiency = atof(SEfficiency);
+    double Efficiency = MdtStringUtils::stof(info_panel[3]);
     // m_RPC_PanelEfficiencyMap.insert(std::make_pair(chamberId,Efficiency));
     m_RPC_PanelEfficiencyMap[chamberId] = Efficiency;
 
     if (m_debug)
       m_log << MSG::DEBUG << "Size of  RPC_PanelEfficiencyMap "
             << m_RPC_PanelEfficiencyMap.size() << "; in panel " << channum
-            << " SEfficiency " << SEfficiency << " Efficiency " << Efficiency
+            << " SEfficiency " << info_panel[3] << " Efficiency " << Efficiency
             << endmsg;
 
-    const char* SGapEfficiency = (info_panel[5].c_str());
-    double GapEfficiency = atof(SGapEfficiency);
+    double GapEfficiency = MdtStringUtils::stof(info_panel[5]);
     // m_RPC_GapEfficiencyMap.insert(std::make_pair(chamberId,GapEfficiency));
     m_RPC_GapEfficiencyMap[chamberId] = GapEfficiency;
 
     if (m_debug)
       m_log << MSG::DEBUG << "Size of  RPC_GapEfficiencyMap "
             << m_RPC_GapEfficiencyMap.size() << "; in panel " << channum
-            << " SGapEfficiency " << SGapEfficiency << " GapEfficiency "
+            << " SGapEfficiency " << info_panel[5] << " GapEfficiency "
             << GapEfficiency << endmsg;
 
-    const char* SMeanClusterSizeMap = (info_panel[17].c_str());
-    double MeanClusterSizeMap = atof(SMeanClusterSizeMap);
+    double MeanClusterSizeMap = MdtStringUtils::stof(info_panel[17]);
     // m_RPC_PanelMeanClusterSizeMap.insert(std::make_pair(chamberId,MeanClusterSizeMap));
     m_RPC_PanelMeanClusterSizeMap[chamberId] = MeanClusterSizeMap;
 
     if (m_debug)
       m_log << MSG::DEBUG << "Size of  RPC_PanelMeanClusterSizeMap "
             << m_RPC_PanelMeanClusterSizeMap.size() << "; in panel " << channum
-            << " SMeanClusterSizeMap " << SMeanClusterSizeMap
+            << " SMeanClusterSizeMap " << info_panel[17]
             << " MeanClusterSizeMap " << MeanClusterSizeMap << endmsg;
     if (DBversion > 2) {
-      const char* SFracClusterSize1Map_a = (info_panel[19].c_str());
-      const char* SFracClusterSize1Map_b = (info_panel[20].c_str());
       double FracClusterSize1Map =
-        atof(SFracClusterSize1Map_a) + atof(SFracClusterSize1Map_b) * 10000;
+        MdtStringUtils::stof(info_panel[19]) + MdtStringUtils::stof(info_panel[20]) * 10000;
       // m_RPC_PanelFracClusterSize1Map.insert(std::make_pair(chamberId,FracClusterSize1Map));
       m_RPC_PanelFracClusterSize1Map[chamberId] = FracClusterSize1Map;
 
       if (m_debug)
         m_log << MSG::DEBUG << "Size of  RPC_PanelFracClusterSize1Map "
               << m_RPC_PanelFracClusterSize1Map.size() << "; in panel "
-              << channum << " SFracClusterSize1Map_a " << SFracClusterSize1Map_a
-              << " SFracClusterSize1Map_b " << SFracClusterSize1Map_b
+              << channum << " SFracClusterSize1Map_a " << info_panel[19]
+              << " SFracClusterSize1Map_b " << info_panel[20]
               << " FracClusterSize1Map " << FracClusterSize1Map << endmsg;
 
-      const char* SFracClusterSize2Map_a = (info_panel[21].c_str());
-      const char* SFracClusterSize2Map_b = (info_panel[22].c_str());
       double FracClusterSize2Map =
-        atof(SFracClusterSize2Map_a) + atof(SFracClusterSize2Map_b) * 10000;
+        MdtStringUtils::stof(info_panel[21]) + MdtStringUtils::stof(info_panel[22]) * 10000;
       // m_RPC_PanelFracClusterSize2Map.insert(std::make_pair(chamberId,FracClusterSize2Map));
       m_RPC_PanelFracClusterSize2Map[chamberId] = FracClusterSize2Map;
 
       if (m_debug)
         m_log << MSG::DEBUG << "Size of  RPC_PanelFracClusterSize2Map "
               << m_RPC_PanelFracClusterSize2Map.size() << "; in panel "
-              << channum << " SFracClusterSize2Map_a " << SFracClusterSize2Map_a
-              << " SFracClusterSize2Map_b " << SFracClusterSize2Map_b
+              << channum << " SFracClusterSize2Map_a " << info_panel[21]
+              << " SFracClusterSize2Map_b " << info_panel[22]
               << " FracClusterSize2Map " << FracClusterSize2Map << endmsg;
 
-      const char* SFracClusterSize3Map_a = (info_panel[23].c_str());
-      const char* SFracClusterSize3Map_b = (info_panel[24].c_str());
       double FracClusterSize3Map =
-        atof(SFracClusterSize3Map_a) + atof(SFracClusterSize3Map_b) * 10000;
+        MdtStringUtils::stof(info_panel[23]) + MdtStringUtils::stof(info_panel[24]) * 10000;
       // m_RPC_PanelFracClusterSize3Map.insert(std::make_pair(chamberId,FracClusterSize3Map));
       m_RPC_PanelFracClusterSize3Map[chamberId] = FracClusterSize3Map;
 
       if (m_debug)
         m_log << MSG::DEBUG << "Size of  RPC_PanelFracClusterSize3Map "
               << m_RPC_PanelFracClusterSize3Map.size() << "; in panel "
-              << channum << " SFracClusterSize3Map_a " << SFracClusterSize3Map_a
-              << " SFracClusterSize3Map_b " << SFracClusterSize3Map_b
+              << channum << " SFracClusterSize3Map_a " << info_panel[23]
+              << " SFracClusterSize3Map_b " << info_panel[24]
               << " FracClusterSize3Map " << FracClusterSize3Map << endmsg;
 
     } else {
       if (info_panel.size() > 20) {
-        const char* SFracClusterSize1Map = (info_panel[19].c_str());
-        double FracClusterSize1Map = atof(SFracClusterSize1Map);
+        double FracClusterSize1Map = MdtStringUtils::stof(info_panel[19]);
         // m_RPC_PanelFracClusterSize1Map.insert(std::make_pair(chamberId,FracClusterSize1Map));
         m_RPC_PanelFracClusterSize1Map[chamberId] = FracClusterSize1Map;
 
         if (m_debug)
           m_log << MSG::DEBUG << "Size of  RPC_PanelFracClusterSize1Map "
                 << m_RPC_PanelFracClusterSize1Map.size() << "; in panel "
-                << channum << " SFracClusterSize1Map " << SFracClusterSize1Map
+                << channum << " SFracClusterSize1Map " << info_panel[19]
                 << " FracClusterSize1Map " << FracClusterSize1Map << endmsg;
 
-        const char* SFracClusterSize2Map = (info_panel[20].c_str());
-        double FracClusterSize2Map = atof(SFracClusterSize2Map);
+        double FracClusterSize2Map = MdtStringUtils::stof(info_panel[20]);
         // m_RPC_PanelFracClusterSize2Map.insert(std::make_pair(chamberId,FracClusterSize2Map));
         m_RPC_PanelFracClusterSize2Map[chamberId] = FracClusterSize2Map;
 
         if (m_debug)
           m_log << MSG::DEBUG << "Size of  RPC_PanelFracClusterSize2Map "
                 << m_RPC_PanelFracClusterSize2Map.size() << "; in panel "
-                << channum << " SFracClusterSize2Map " << SFracClusterSize2Map
+                << channum << " SFracClusterSize2Map " << info_panel[20]
                 << " FracClusterSize2Map " << FracClusterSize2Map << endmsg;
       } else {
         // m_RPC_PanelFracClusterSize1Map.insert(std::make_pair(chamberId,0.6));
@@ -353,12 +338,10 @@ StatusCode RpcDetectorStatusDbTool::loadRpcDqStatus(
     // update for the timing and error on timing
     // new info strip |status time error_on_time|
 
-    std::string delimiter_strip = "|";
-    std::vector<std::string> info_strip;
+    char delimiter_strip = '|';
     std::string strip_status_list = "";
-    std::vector<float> info_strip_test;
 
-    MuonCalib::MdtStringUtils::tokenize(striplist, info_strip, delimiter_strip);
+    const auto info_strip = MdtStringUtils::tokenize(striplist, delimiter_strip);
 
     if (m_debug)
       m_log << MSG::DEBUG << "strip list " << striplist << " info list "
@@ -371,37 +354,32 @@ StatusCode RpcDetectorStatusDbTool::loadRpcDqStatus(
 
       for (unsigned int i = 0; i < info_strip.size(); i++) {
 
-        const char* ch_strip2 = (info_strip[i].c_str());
+        const auto &ch_strip2 = info_strip[i];
         if (m_verbose)
           m_log << MSG::VERBOSE << "strip # " << i
                 << " Status+Timing INFO (time, error) " << ch_strip2 << endmsg;
 
-        std::string delimiter_strip2 = "  ";
-        std::vector<std::string> info_strip2;
-        std::vector<float> info_strip_test2;
+        char delimiter_strip2 = ' ';
         // 	 //
-        MuonCalib::MdtStringUtils::tokenize(
-          ch_strip2, info_strip2, delimiter_strip2);
+        const auto info_strip2 = MdtStringUtils::tokenize(ch_strip2, delimiter_strip2);
 
         if (m_verbose) {
           for (unsigned int ii = 0; ii < info_strip2.size(); ii++) {
-            const char* ch_strip_new = (info_strip2[ii].c_str());
+            const auto& ch_strip_new = info_strip2[ii];
             m_log << MSG::VERBOSE << " info_strip with time " << info_strip2[ii]
                   << "  again  " << ch_strip_new << endmsg;
           }
         }
 
-        const char* STime = const_cast<char*>(info_strip2[1].c_str());
-        double Time = atof(STime);
-        const char* SSigmaTime = const_cast<char*>(info_strip2[2].c_str());
-        double SigmaTime = atof(SSigmaTime);
-        const char* strip_status = const_cast<char*>(info_strip2[0].c_str());
+        double Time = MdtStringUtils::stof(info_strip2[1]);
+        double SigmaTime = MdtStringUtils::stof(info_strip2[2]);
+        const std::string_view &strip_status = info_strip2[0];
 
         if (m_verbose)
           m_log << MSG::VERBOSE << "strip # " << i
                 << " after dec: Status+Timing INFO (time, error) "
                 << strip_status << " " << Time << "+/-" << SigmaTime << endmsg;
-        strip_status_list = strip_status_list + strip_status;
+        strip_status_list += strip_status;
 
         std::vector<double> Time_vect;
         Time_vect.push_back(Time);
@@ -418,7 +396,7 @@ StatusCode RpcDetectorStatusDbTool::loadRpcDqStatus(
                 << m_rpcIdHelper->show_to_string(strip_id) << endmsg;
 
         // m_RPC_StripTimeMap.insert(std::make_pair(strip_id,Time_vect));
-        m_RPC_StripTimeMap[strip_id] = Time_vect;
+        m_RPC_StripTimeMap[strip_id] = std::move(Time_vect);
 
         countpanelstrip++;
 
@@ -465,11 +443,11 @@ StatusCode RpcDetectorStatusDbTool::loadRpcDqStatus(
       }
       for (unsigned int i = 0; i < striplist.size(); i++) {
 
-        std::string part_strip = striplist.substr(i, 1);
+        char part_strip = striplist[i];
 
-        strip_status_list = strip_status_list + part_strip;
+        strip_status_list += part_strip;
 
-        const char* h_panel = (part_strip.c_str());
+        char h_panel = part_strip;
 
         Identifier strip_id;
         CondAttrListCollection::ChanNum stripnum;
@@ -484,7 +462,7 @@ StatusCode RpcDetectorStatusDbTool::loadRpcDqStatus(
 
         countpanelstrip++;
 
-        if (part_strip == "0") {
+        if (part_strip == '0') {
           if (m_debug && (!m_verbose))
             m_log << MSG::DEBUG << "strip #" << i + 1 << " info_strip "
                   << part_strip << " strip_id " << stripnum << " expanded "
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/sTGCDetectorHelper.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/sTGCDetectorHelper.h
index e03fb9b9e304..0036e8ab3e0b 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/sTGCDetectorHelper.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/MuonAGDDDescription/sTGCDetectorHelper.h
@@ -26,6 +26,8 @@ public:
 	sTGCDetectorDescription* Get_sTGCDetector(char type,int ieta,int iphi,int layer=1,char side='A');
 	sTGCDetectorDescription* Get_sTGCDetectorType(const std::string& type);
 	sTGCDetectorDescription* Get_sTGCDetectorSubType(const std::string& type);
+	sTGCDetectorDescription* Get_sTGCDetectorType(std::string_view type);
+	sTGCDetectorDescription* Get_sTGCDetectorSubType(std::string_view type);
 	AGDDPositionedDetector Get_sTGCPositionedDetector(char type,int ieta,int iphi,int layer=1,char side='A');
 	
 private:
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/sTGCDetectorHelper.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/sTGCDetectorHelper.cxx
index 5e51b3499bce..158ecfbb12f0 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/sTGCDetectorHelper.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDDescription/src/sTGCDetectorHelper.cxx
@@ -100,13 +100,28 @@ AGDDPositionedDetector sTGCDetectorHelper::Get_sTGCPositionedDetector(char type,
 
 sTGCDetectorDescription* sTGCDetectorHelper::Get_sTGCDetectorType(const std::string& type)
 {
-	if (m_sTGCList.find(type) != m_sTGCList.end()) return m_sTGCList[type];
+	if (auto itr = m_sTGCList.find(type); itr != m_sTGCList.end()) return itr->second;
 	return nullptr;
 }
 
 sTGCDetectorDescription* sTGCDetectorHelper::Get_sTGCDetectorSubType(const std::string& type)
 {
-	if (m_sTGCListSubType.find(type) != m_sTGCListSubType.end()) return m_sTGCListSubType[type];
+	if (auto itr = m_sTGCListSubType.find(type); itr != m_sTGCListSubType.end()) return itr->second;
 	return nullptr;
 }
 
+sTGCDetectorDescription* sTGCDetectorHelper::Get_sTGCDetectorType(std::string_view type)
+{
+	for(const auto &pair : m_sTGCList){
+     if(pair.first == type) return pair.second;
+	}
+	return nullptr;
+}
+
+sTGCDetectorDescription* sTGCDetectorHelper::Get_sTGCDetectorSubType(std::string_view type)
+{
+	for(const auto &pair : m_sTGCListSubType){
+     if(pair.first == type) return pair.second;
+	}
+	return nullptr;
+}
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/GlobalUtilities.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/GlobalUtilities.h
index 10844c9e1bd7..884a3f8e8073 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/GlobalUtilities.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/GlobalUtilities.h
@@ -15,8 +15,8 @@
 namespace MuonGM 
 {
     std::string buildString(int i, int ncha);
-    int strtoint(const std::string& str, unsigned int istart, unsigned int length);
-    int stationPhiTGC(const std::string& stName, int fi, int zi_input, const std::string& geometry_version);
+    int strtoint(std::string_view str, unsigned int istart, unsigned int length);
+    int stationPhiTGC(std::string_view stName, int fi, int zi_input, std::string_view geometry_version);
 }
 
 #endif // MUONREADOUTGEOMETRY_GLOBALUTILITIES_H
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonStation.h b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonStation.h
index 20876dc7f880..439092c03576 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonStation.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonStation.h
@@ -46,7 +46,7 @@ class MuonReadoutElement;
 class MuonStation {
 public:
 
-   MuonStation(std::string stName,
+   MuonStation(std::string_view stName,
                double m_Ssize, double m_Rsize, double m_Zsize,
                double m_LongSsize, double m_LongRsize, double m_LongZsize, int zi, int fi, 
                bool m_descratzneg);
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/GlobalUtilities.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/GlobalUtilities.cxx
index e121ecce535e..fb8da4a4574d 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/GlobalUtilities.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/GlobalUtilities.cxx
@@ -12,6 +12,7 @@
 #include <iostream>
 #include <sstream>
 #include <cmath>
+#include <charconv>
 
 namespace MuonGM 
 {
@@ -19,9 +20,7 @@ namespace MuonGM
 std::string buildString(int i, int ncha)
 {
   if (ncha<=0) {
-    std::ostringstream ostigg;
-    ostigg << i;
-    return ostigg.str();
+    return std::to_string(i);
   } else {
     int ij = i;
     std::ostringstream ostigg;
@@ -36,19 +35,20 @@ std::string buildString(int i, int ncha)
     
 
 
-int strtoint(const std::string& str, unsigned int istart, unsigned int length)
+int strtoint(std::string_view str, unsigned int istart, unsigned int length)
 {
-  std::string s(str.substr(istart,length));
-  int result = std::stoi(s);
+  std::string_view s(str.substr(istart,length));
+  int result = -999;
+  std::from_chars(s.data(), s.data() + s.size(), result);
   return result;
 }
 
 
 
-int stationPhiTGC(const std::string& stName, int fi, int zi_input, const std::string& geometry_version) 
+int stationPhiTGC(std::string_view stName, int fi, int zi_input, std::string_view geometry_version) 
 {
     // fi and zi_imput are the amdb indices (1, ... 8) and (-8, 8) are their ranges
-    std::string stName3 = stName.substr(0,3);
+    std::string_view stName3 = stName.substr(0,3);
     int stphi = 0;
 
     int zi = std::abs(zi_input);
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx
index cf89b0a461e5..1a436c71df43 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/MuonStation.cxx
@@ -18,12 +18,12 @@
 
 namespace MuonGM {
 
-MuonStation::MuonStation(std::string stName,
+MuonStation::MuonStation(std::string_view stName,
                          double Ssize, double Rsize, double Zsize,
                          double LongSsize, double LongRsize, double LongZsize, int zi, int fi, 
                          bool descratzneg)
 {
-  m_statname    = std::move(stName);
+  m_statname    = std::string(stName);
   m_Ssize       = Ssize      ;
   m_Rsize       = Rsize      ;
   m_Zsize       = Zsize      ;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx
index 60f7d9063550..f0e047b3a451 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx
@@ -262,12 +262,12 @@ int TgcReadoutElement::chamberType() const
 
 bool TgcReadoutElement::endcap() const
 {
-    return ("E" == stationType().substr(2,1));
+    return (0 == stationType().compare(2,1,"E"));
 }
 
 bool TgcReadoutElement::forward() const
 {
-    return ("F" == stationType().substr(2,1));
+    return (0 == stationType().compare(2,1,"F"));
 }
 
 bool TgcReadoutElement::doublet() const
@@ -484,7 +484,7 @@ float TgcReadoutElement::stripDeltaPhi(int gasGap) const
   float dphi;
 
   int iStation = atoi(getStationType().substr(1,1).c_str());
-  if (iStation != 4 || "E" != getStationType().substr(2,1)) { // except for station T4E
+  if (iStation != 4 || 0 != getStationType().compare(2,1,"E")) { // except for station T4E
     dphi = 360.*CLHEP::degree/((float) getNPhiChambers())/nDivInChamberPhi[iStation-1];
   }
   else { // T4E
diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx
index bb4ce9c84c0e..0bd15fa5ea07 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonInertMaterialBuilder.cxx
@@ -133,9 +133,9 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonInertMaterialBu
                 protMass += calculateVolume((*((*msTypeIter).first->constituents()))[ic].first.get()) *
                             (*((*msTypeIter).first->constituents()))[ic].second;
             }
-            perm = msTypeName.substr(0, 1) != "J" && m_blendLimit > 0 && protMass > m_blendLimit;
+            perm = msTypeName.compare(0, 1, "J") != 0 && m_blendLimit > 0 && protMass > m_blendLimit;
         }
-        if (perm) msTypeName = msTypeName + "PERM";
+        if (perm) msTypeName +=  "PERM";
         //
         const Trk::DetachedTrackingVolume* msTV = (*msTypeIter).first;
         for (unsigned int it = 0; it < (*msTypeIter).second.size(); it++) {
@@ -183,11 +183,8 @@ Muon::MuonInertMaterialBuilder::buildDetachedTrackingVolumeTypes(bool blend) {
     while (!vol.atEnd()) {
         const GeoVPhysVol* cv = &(*(vol.getVolume()));
         const GeoLogVol* clv = cv->getLogVol();
-        std::string vname = clv->getName();
-        //	if ( vname.size()<8 && vname.substr(0,3)=="NSW" && vname.substr(1,4)=="sTGC" ) {   // do nothing NSW sTGC station
-        //	} else if ( vname.size()<8 && vname.substr(0,3)=="NSW" && vname.substr(1,2)=="MM" ) {   // do nothing NSW MM station
-        //	} else if ( vname.size()>=8 && vname.substr(0,8)=="NewSmall" && vname.substr(1,4)=="sTGC" ) {  // do nothing, probably NSW
-        // station 	} else if ( vname.size()>=8 && vname.substr(0,8)=="NewSmall" && vname.substr(1,2)=="MM" ) {  // do nothing, probably
+        const std::string vnamestr = clv->getName();
+        std::string_view vname(vnamestr);
         // NSW station
         if (vname.size() > 7 && vname.substr(vname.size() - 7, 7) == "Station") {  // do nothing, active station
         } else {
@@ -240,7 +237,7 @@ Muon::MuonInertMaterialBuilder::buildDetachedTrackingVolumeTypes(bool blend) {
             if (!cv->getNChildVols()) {
                 std::vector<Amg::Transform3D> volTr;
                 volTr.push_back(vol.getTransform());
-                vols.emplace_back(clv, volTr);
+                vols.emplace_back(clv, std::move(volTr));
                 simpleTree = true;
             } else {
                 getObjsForTranslation(cv, Trk::s_idTransform, vols);
@@ -253,8 +250,8 @@ Muon::MuonInertMaterialBuilder::buildDetachedTrackingVolumeTypes(bool blend) {
             m_constituents.reserve(vols.size() + 3);
 
             for (unsigned int ish = 0; ish < vols.size(); ish++) {
-                std::string protoName = vname;
-                if (!simpleTree) protoName = vname + (vols[ish].first->getName());
+                std::string protoName = std::string(vname);
+                if (!simpleTree) protoName += (vols[ish].first->getName());
                 std::string pName = vols[ish].first->getName();
                 ATH_MSG_VERBOSE(" check in pName " << pName << ", made of " << vols[ish].first->getMaterial()->getName() << " x0 "
                                                    << vols[ish].first->getMaterial()->getRadLength() << ","
diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx
index 9d19da55f089..cb0dba7899d6 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilder.cxx
@@ -115,10 +115,10 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder:
     while (!vol.atEnd()) {
         const GeoVPhysVol* cv = &(*(vol.getVolume()));
         const GeoLogVol* clv = cv->getLogVol();
-        std::string vname = clv->getName();
+        const std::string &vname = clv->getName();
 
         // special treatment for NSW
-        if (vname.substr(0, 3) == "NSW" || vname.substr(0, 8) == "NewSmall") {
+        if (vname.compare(0, 3, "NSW") == 0 || vname.compare(0, 8, "NewSmall") == 0) {
             ATH_MSG_INFO(vname << " processing NSW ");
             std::vector<std::pair<const Trk::DetachedTrackingVolume*, std::vector<Amg::Transform3D> > > objs;
 
@@ -131,7 +131,7 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilder:
                 std::vector<Amg::Transform3D> volTr;
                 volTr.push_back(vol.getTransform());
                 std::pair<const GeoLogVol*, Trk::MaterialProperties*> cpair(clv, 0);
-                vols.emplace_back(cpair, volTr);
+                vols.emplace_back(cpair, std::move(volTr));
                 volNames.push_back(vname);
                 simpleTree = true;
             } else {
@@ -835,7 +835,8 @@ void Muon::MuonStationBuilder::glueComponents(const Trk::DetachedTrackingVolume*
 void Muon::MuonStationBuilder::identifyLayers(const Trk::DetachedTrackingVolume* station, int eta, int phi) const {
     ATH_MSG_VERBOSE(name() << " identifying layers ");
 
-    std::string stationName = station->trackingVolume()->volumeName();
+    const std::string &stationNamestr = station->trackingVolume()->volumeName();
+    std::string_view stationName(stationNamestr);
     ATH_MSG_VERBOSE(" in station " << station->name());
 
     if (stationName.substr(0, 1) == "C") {
diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilderCond.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilderCond.cxx
index 424f97b7a2e1..53837fed1756 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilderCond.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationBuilderCond.cxx
@@ -125,7 +125,7 @@ Muon::MuonStationBuilderCond::buildDetachedTrackingVolumes(const EventContext& c
         std::string vname = clv->getName();
 
         // special treatment for NSW
-        if (vname.substr(0, 3) == "NSW" || vname.substr(0, 8) == "NewSmall") {
+        if (vname.compare(0, 3,"NSW") == 0 || vname.compare(0, 8,"NewSmall") == 0) {
             ATH_MSG_INFO(vname << " processing NSW ");
             std::vector<std::pair<const Trk::DetachedTrackingVolume*, std::vector<Amg::Transform3D> > > objs;
 
@@ -138,7 +138,7 @@ Muon::MuonStationBuilderCond::buildDetachedTrackingVolumes(const EventContext& c
                 std::vector<Amg::Transform3D> volTr;
                 volTr.push_back(vol.getTransform());
                 std::pair<const GeoLogVol*, Trk::MaterialProperties*> cpair(clv, 0);
-                vols.emplace_back(cpair, volTr);
+                vols.emplace_back(cpair, std::move(volTr));
                 volNames.push_back(vname);
                 simpleTree = true;
             } else {
@@ -171,7 +171,7 @@ Muon::MuonStationBuilderCond::buildDetachedTrackingVolumes(const EventContext& c
 
                 // Got to mothervolume of sTGC_Sensitive/sTGC_Frame and MM_Sensitive/MM_Frame: TGCGas ArCo2
                 ATH_MSG_DEBUG(" ish " << ish << " protoName14 " << protoName.substr(1, 4) << " volName04 " << volNames[ish].substr(0, 4));
-                if (volNames[ish].substr(0, 4) != "sTGC" && volNames[ish].substr(0, 2) != "MM") continue;
+                if (volNames[ish].compare(0, 4,"sTGC") != 0 && volNames[ish].substr(0, 2) != "MM") continue;
 
                 std::string oName = protoName.substr(protoName.find('-') + 1);
                 Identifier nswId = m_muonStationTypeBuilder->identifyNSW(muonMgr, oName, vols[ish].second[0]);
@@ -500,9 +500,9 @@ Muon::MuonStationBuilderCond::buildDetachedTrackingVolumes(const EventContext& c
 
         }  // end NSW!
 
-        if (vname.size() > 7 && vname.substr(vname.size() - 7, 7) == "Station" &&
-            ((m_buildBarrel && vname.substr(0, 1) == "B") || (m_buildEndcap && vname.substr(0, 1) == "E") ||
-             (m_buildCsc && vname.substr(0, 1) == "C") || (m_buildTgc && vname.substr(0, 1) == "T"))) {
+        if (vname.size() > 7 && vname.compare(vname.size() - 7, 7, "Station") == 0 &&
+            ((m_buildBarrel && vname.compare(0, 1,"B") == 0) || (m_buildEndcap && vname.compare(0, 1,"E") == 0) ||
+             (m_buildCsc && vname.compare(0, 1,"C") == 0) || (m_buildTgc && vname.compare(0, 1, "T") == 0))) {
             int etaphi = vol.getId();  // retrive eta/phi indexes
             int sign = (etaphi < 0) ? -1 : 1;
             etaphi = sign * etaphi;
@@ -530,31 +530,31 @@ Muon::MuonStationBuilderCond::buildDetachedTrackingVolumes(const EventContext& c
             //
             if (!gmStation) ATH_MSG_WARNING("Muon station not found! " << vname << "," << eta << "," << phi);
             std::string stName = (clv->getName()).substr(0, vname.size() - 8);
-            if (stName.substr(0, 1) == "B" && eta < 0) { stName = (clv->getName()).substr(0, vname.size() - 8) + "-"; }
-            if (stName.substr(0, 1) == "T" || stName.substr(0, 1) == "C") { stName = vname.substr(0, 4); }
+            if (stName.compare(0, 1,"B") == 0 && eta < 0) { stName = (clv->getName()).substr(0, vname.size() - 8) + "-"; }
+            if (stName.compare(0, 1,"T") == 0 || stName.compare(0, 1,"C") == 0) { stName = vname.substr(0, 4); }
             // loop over prototypes
             const Trk::DetachedTrackingVolume* msTV = nullptr;
             for (msTypeIter = msTypes->begin(); msTypeIter != msTypes->end(); ++msTypeIter) {
                 std::string msTypeName = (*msTypeIter)->name();
-                if ((stName.substr(0, 1) == "T" && stName == msTypeName.substr(0, stName.size())) ||
-                    (stName.substr(0, 1) != "T" && stName == msTypeName)) {
+                if ((stName.compare(0, 1,"T") == 0 && 0 == msTypeName.compare(0, stName.size(),stName)) ||
+                    (stName.compare(0, 1, "T") != 0 && stName == msTypeName)) {
                     msTV = *msTypeIter;
                     if (msTV && gmStation) {
                         Amg::Transform3D transf = Amg::CLHEPTransformToEigen(gmStation->getTransform());
                         Identifier stId(0);
-                        if (m_idHelperSvc->hasCSC() && stName.substr(0, 1) == "C") {
+                        if (m_idHelperSvc->hasCSC() && stName.compare(0, 1,"C") == 0) {
                             stId = m_idHelperSvc->cscIdHelper().elementID(vname.substr(0, 3), eta, phi);
                         }
                         // adjust eta,phi
-                        if (msTypeName.substr(0, 1) == "C") {
+                        if (msTypeName.compare(0, 1,"C") == 0) {
                             eta = 1;
                             if (transf.translation().z() < 0) eta = 0;
                             double phic = transf.translation().phi() + 0.1;
                             phi = static_cast<int>(phic < 0 ? 4 * phic / M_PI + 8 : 4 * phic / M_PI);
                         }
-                        if (msTypeName.substr(0, 1) == "T") {
+                        if (msTypeName.compare(0, 1,"T") == 0) {
                             bool az = true;
-                            std::string msName = msTV->trackingVolume()->volumeName();
+                            std::string_view msName ( msTV->trackingVolume()->volumeName());
                             if (transf.translation().z() < 0) az = false;
                             if (msName.substr(7, 2) == "01") eta = az ? 5 : 4;
                             if (msName.substr(7, 2) == "02") eta = az ? 5 : 4;
@@ -579,19 +579,19 @@ Muon::MuonStationBuilderCond::buildDetachedTrackingVolumes(const EventContext& c
                             if (msName.substr(7, 2) == "21") eta = az ? 5 : 4;
                             if (msName.substr(7, 2) == "22") eta = az ? 5 : 4;
                         }
-                        if (m_idHelperSvc->hasTGC() && stName.substr(0, 1) == "T") {
+                        if (m_idHelperSvc->hasTGC() && stName.compare(0, 1, "T") == 0) {
                             int etaSt = eta - 4;
                             if (eta < 5) etaSt = eta - 5;
                             double phic = transf.translation().phi();
-                            if (msTypeName.substr(2, 1) == "E" && msTypeName.substr(0, 3) != "T4E")
+                            if (msTypeName.compare(2, 1, "E") == 0 && msTypeName.compare(0, 3, "T4E") != 0)
                                 phi = static_cast<int>(phic < 0 ? 24 * phic / M_PI + 48 : 24 * phic / M_PI);
                             else
                                 phi = static_cast<int>(phic < 0 ? 12 * phic / M_PI + 24 : 12 * phic / M_PI);
                             phi++;
                             stId = m_idHelperSvc->tgcIdHelper().elementID(vname.substr(0, 3), etaSt, phi);
-                        } else if (m_idHelperSvc->hasRPC() && stName.substr(0, 3) == "BML") {
+                        } else if (m_idHelperSvc->hasRPC() && stName.compare(0, 3, "BML") == 0) {
                             stId = m_idHelperSvc->rpcIdHelper().elementID(vname.substr(0, 3), eta, phi, 1);
-                        } else if (m_idHelperSvc->hasMDT() && stName.substr(0, 1) != "C") {
+                        } else if (m_idHelperSvc->hasMDT() && stName.compare(0, 1, "C") != 0) {
                             stId = m_idHelperSvc->mdtIdHelper().elementID(vname.substr(0, 3), eta, phi);
                         }
                         if (!(stId.get_compact()))
@@ -638,9 +638,9 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilderC
             const GeoVPhysVol* cv = &(*(vol.getVolume()));
             const GeoLogVol* clv = cv->getLogVol();
             const std::string& vname = clv->getName();
-            if (vname.size() > 7 && vname.substr(vname.size() - 7, 7) == "Station" &&
-                ((m_buildBarrel && vname.substr(0, 1) == "B") || (m_buildEndcap && vname.substr(0, 1) == "E") ||
-                 (m_buildCsc && vname.substr(0, 1) == "C") || (m_buildTgc && vname.substr(0, 1) == "T"))) {
+            if (vname.size() > 7 && vname.compare(vname.size() - 7, 7, "Station") == 0 &&
+                ((m_buildBarrel && vname.compare(0, 1, "B") == 0) || (m_buildEndcap && vname.compare(0, 1, "E") == 0) ||
+                 (m_buildCsc && vname.compare(0, 1, "C") == 0) || (m_buildTgc && vname.compare(0, 1,"T") == 0))) {
                 int etaphi = vol.getId();  // retrieve eta/phi indexes
                 int sign = (etaphi < 0) ? -1 : 1;
                 etaphi = sign * etaphi;
@@ -670,11 +670,11 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilderC
                 std::string name = (clv->getName()).substr(0, vname.size() - 8);
                 // is this station known ?
                 // if TGC station, look for 1 component instead
-                if (name.substr(0, 1) == "T") {
+                if (name.compare(0, 1,"T") == 0) {
                     std::string tgc_name = cv->getChildVol(0)->getLogVol()->getName();
                     name = tgc_name;
                 }
-                if (name.substr(0, 1) == "B" && eta < 0) { name = (clv->getName()).substr(0, vname.size() - 8) + "-"; }
+                if (name.compare(0, 1, "B") == 0 && eta < 0) { name = (clv->getName()).substr(0, vname.size() - 8) + "-"; }
                 unsigned is = 0;
                 for (unsigned in = 0; in < stations.size(); in++) {
                     if (stations[in] != nullptr && name == stations[in]->name()) is++;
@@ -683,9 +683,9 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilderC
                     ATH_MSG_VERBOSE(" new station type " << name << "," << clv->getShape()->type());
                     ATH_MSG_VERBOSE(" prototype built from eta, phi:" << eta << "," << phi);
 
-                    if (name.substr(0, 2) == "CS" || name.substr(0, 1) == "T") {
+                    if (name.compare(0, 2,"CS") == 0 || name.compare(0, 1,"T") == 0) {
                         if (m_muonStationTypeBuilder) {
-                            if (name.substr(0, 2) == "CS") {
+                            if (name.compare(0, 2, "CS") == 0) {
                                 Trk::TrackingVolume* csc_station = m_muonStationTypeBuilder->processCscStation(cv, name, cache);
                                 // create layer representation
                                 std::pair<const Trk::Layer*, const std::vector<const Trk::Layer*>*> layerRepr =
@@ -782,7 +782,7 @@ const std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonStationBuilderC
                                 delete envelope;
 
                                 // identify prototype
-                                if ((name.substr(0, 1) == "B" || name.substr(0, 1) == "E"))
+                                if ((name.compare(0, 1, "B") == 0 || name.compare(0, 1,"E") == 0))
                                     identifyPrototype(newType, eta, phi, Amg::CLHEPTransformToEigen(gmStation->getTransform()), muonMgr);
 
                                 // create layer representation
@@ -844,8 +844,8 @@ void Muon::MuonStationBuilderCond::identifyLayers(const Trk::DetachedTrackingVol
     std::string stationName = station->trackingVolume()->volumeName();
     ATH_MSG_VERBOSE(" in station " << station->name());
 
-    if (stationName.substr(0, 1) == "C") {
-        int st = stationName.substr(0, 3) == "CSS" ? 0 : 1;
+    if (stationName.compare(0, 1, "C") == 0) {
+        int st = stationName.compare(0, 3, "CSS") == 0 ? 0 : 1;
         const MuonGM::CscReadoutElement* cscRE = muonMgr->getCscReadoutElement(st, eta, phi, 0);
         int cLay = cscRE ? 0 : 1;
         if (!cscRE) cscRE = muonMgr->getCscReadoutElement(st, eta, phi, cLay);
@@ -870,21 +870,21 @@ void Muon::MuonStationBuilderCond::identifyLayers(const Trk::DetachedTrackingVol
         }
     }
 
-    if (stationName.substr(0, 1) == "T") {
+    if (stationName.compare(0, 1, "T") == 0) {
         int st = 7;
-        if (stationName.substr(0, 3) == "T1F") {
+        if (stationName.compare(0, 3, "T1F") == 0) {
             st = 0;
-        } else if (stationName.substr(0, 3) == "T1E") {
+        } else if (stationName.compare(0, 3, "T1E") == 0) {
             st = 1;
-        } else if (stationName.substr(0, 3) == "T2F") {
+        } else if (stationName.compare(0, 3, "T2F") == 0) {
             st = 2;
-        } else if (stationName.substr(0, 3) == "T2E") {
+        } else if (stationName.compare(0, 3, "T2E") == 0) {
             st = 3;
-        } else if (stationName.substr(0, 3) == "T3F") {
+        } else if (stationName.compare(0, 3, "T3F") == 0) {
             st = 4;
-        } else if (stationName.substr(0, 3) == "T3E") {
+        } else if (stationName.compare(0, 3, "T3E") == 0) {
             st = 5;
-        } else if (stationName.substr(0, 3) == "T4F") {
+        } else if (stationName.compare(0, 3, "T4F") == 0) {
             st = 6;
         }
 
@@ -946,7 +946,7 @@ void Muon::MuonStationBuilderCond::identifyLayers(const Trk::DetachedTrackingVol
         }
     }
 
-    if (m_idHelperSvc->hasMDT() && (stationName.substr(0, 1) == "B" || stationName.substr(0, 1) == "E")) {
+    if (m_idHelperSvc->hasMDT() && (stationName.compare(0, 1, "B") == 0 || stationName.compare(0, 1, "E") == 0)) {
         // recalculate id
         Identifier stId(station->layerRepresentation()->layerType());
 
@@ -1213,7 +1213,7 @@ void Muon::MuonStationBuilderCond::getNSWStationsForTranslation(
             childName = childName + st.str();
         }
 
-        std::string cName = childName.substr(0, 3) == "NSW" || childName.substr(0, 8) == "NewSmall" ? name : name + childName;
+        std::string cName = childName.compare(0, 3, "NSW") == 0 || childName.compare(0, 8, "NewSmall") == 0 ? name : name + childName;
         ATH_MSG_VERBOSE("child number,name,position:" << ic << ":" << clv->getName() << ":" << (transform * transf).translation().perp()
                                                       << "," << (transform * transf).translation().z() << ","
                                                       << (transform * transf).translation().phi());
diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx
index c21aacec4afa..8c39b0a713a6 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonStationTypeBuilder.cxx
@@ -148,9 +148,9 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processBoxStationC
         vol = new Trk::Volume(new Amg::Transform3D(transf), volBounds);
         ATH_MSG_VERBOSE("subvolume center:" << vol->center().x() << "," << vol->center().y() << "," << vol->center().z());
         std::string cname = clv->getName();
-        std::string vname = mv->getLogVol()->getName();
+        const std::string &vname = mv->getLogVol()->getName();
         int nameSize = vname.size() - 8;
-        if (cname.substr(0, nameSize) == vname.substr(0, nameSize)) cname = cname.substr(nameSize, cname.size() - nameSize);
+        if (cname.compare(0, nameSize, vname, 0, nameSize) == 0) cname = cname.substr(nameSize, cname.size() - nameSize);
         // order in X
         if (compVol.empty() || vol->center()[0] >= compVol.back()->center()[0]) {
             compVol.push_back(vol);
@@ -220,7 +220,7 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processBoxStationC
         if (uppX > maxX) ATH_MSG_WARNING(" clash between component and envelope:" << compName[i] << "upper:" << uppX << ">" << maxX);
 
         // close Rpc if no further components
-        if (openRpc && compName[i].substr(0, 3) != "RPC" && compName[i].substr(0, 3) != "Ded") {
+        if (openRpc && compName[i].compare(0, 3, "RPC") != 0 && compName[i].compare(0, 3, "Ded") != 0) {
             // low edge of current volume
             double Xcurr = compVol[i]->center()[0] - compBounds->halflengthX();
             if (Xcurr >= currX + rpclowXsize + rpcuppXsize) {
@@ -238,7 +238,7 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processBoxStationC
             }
         }
         // close spacer if no further components
-        if (openSpacer && compName[i].substr(0, 1) != "C" && compName[i].substr(0, 2) != "LB") {
+        if (openSpacer && compName[i].compare(0, 1, "C") != 0 && compName[i].compare(0, 2, "LB") != 0) {
             // low edge of current volume
             double Xcurr = compVol[i]->center()[0] - compBounds->halflengthX();
             if (Xcurr - currX - (spacerlowXsize + spaceruppXsize) >= -tolerance) {
@@ -253,7 +253,7 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processBoxStationC
                 ATH_MSG_WARNING("clash in spacer definition!");
             }
         }
-        if (compName[i].substr(0, 3) == "RPC" || compName[i].substr(0, 3) == "Ded") {
+        if (compName[i].compare(0, 3, "RPC") == 0 || compName[i].compare(0, 3, "Ded") == 0) {
             if (!openRpc) {
                 openRpc = true;
                 geoRpc.clear();
@@ -276,7 +276,7 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processBoxStationC
             }
             comp_processed = true;
         }
-        if (compName[i].substr(0, 1) == "C" || compName[i].substr(0, 2) == "LB") {
+        if (compName[i].compare(0, 1, "C") == 0 || compName[i].compare(0, 2, "LB") == 0) {
             if (!openSpacer) {
                 openSpacer = true;
                 geoSpacer.clear();
@@ -304,7 +304,7 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processBoxStationC
             }
             comp_processed = true;
         }
-        if (compName[i].substr(0, 3) == "MDT") {
+        if (compName[i].compare(0, 3, "MDT") == 0) {
             Trk::Volume* mdtVol;
             Trk::CuboidVolumeBounds* mdtBounds = nullptr;
             // remove z shift in transform !! bugfix !!
@@ -327,9 +327,9 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processBoxStationC
             }
             double shiftSign = 1.;
             if (std::abs(zShift) > 0.) {
-                std::string stName = mv->getLogVol()->getName();
-                if (stName.substr(0, 4) == "BIR3" || stName.substr(0, 4) == "BIR5" || stName.substr(0, 4) == "BIR7" ||
-                    stName.substr(0, 5) == "BIR10")
+                const std::string &stName = mv->getLogVol()->getName();
+                if (stName.compare(0, 4, "BIR3") == 0 || stName.compare(0, 4, "BIR5") == 0 || stName.compare(0, 4, "BIR7") == 0 ||
+                    stName.compare(0, 5, "BIR10") == 0)
                     shiftSign = -1.;
             }
             const Trk::TrackingVolume* mdtTrkVol =
@@ -440,7 +440,7 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processTrdStationC
         } else {
             double xSize = get_x_size(cv);
             // printChildren(cv);
-            if (clv->getName().substr(0, 1) != "C" && clv->getName().substr(0, 2) != "LB")
+            if (clv->getName().compare(0, 1, "C") != 0 && clv->getName().compare(0, 2, "LB") != 0)
                 transf *= Amg::AngleAxis3D(0.5 * M_PI, Amg::Vector3D(0., 1., 0.)) * Amg::AngleAxis3D(0.5 * M_PI, Amg::Vector3D(0., 0., 1.));
             volBounds =
                 new Trk::TrapezoidVolumeBounds(envelope->minHalflengthX(), envelope->maxHalflengthX(), envelope->halflengthY(), xSize);
@@ -449,7 +449,7 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processTrdStationC
         std::string cname = clv->getName();
         std::string vname = mv->getLogVol()->getName();
         int nameSize = vname.size() - 8;
-        if (cname.substr(0, nameSize) == vname.substr(0, nameSize)) cname = cname.substr(nameSize, cname.size() - nameSize);
+        if (cname.compare(0, nameSize, vname, 0, nameSize) == 0) cname = cname.substr(nameSize, cname.size() - nameSize);
         // order in X
         if (compVol.empty() || vol->center()[0] >= compVol.back()->center()[0]) {
             compVol.push_back(vol);
@@ -520,7 +520,7 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processTrdStationC
             return nullptr;
         }
         // close spacer if no further components
-        if (openSpacer && compName[i].substr(0, 1) != "C" && compName[i].substr(0, 2) != "LB") {
+        if (openSpacer && compName[i].compare(0, 1, "C") !=0  && compName[i].compare(0, 2, "LB") != 0) {
             if (Xcurr - currX - (spacerlowXsize + spaceruppXsize) >= -tolerance) {
                 Trk::TrapezoidVolumeBounds* spacerBounds = new Trk::TrapezoidVolumeBounds(envX1, envX2, envY, 0.5 * (Xcurr - currX));
                 Amg::Transform3D tr(Amg::Translation3D(currX + spacerBounds->halflengthZ(), 0., 0.) *
@@ -540,10 +540,10 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processTrdStationC
                 std::cout << "clash in spacer definition!" << std::endl;
             }
         }
-        if (compName[i].substr(0, 3) == "RPC" || compName[i].substr(0, 3) == "Ded") {
+        if (compName[i].compare(0, 3, "RPC") == 0 || compName[i].compare(0, 3, "Ded") == 0) {
             std::cout << " RPC components for endcaps not coded " << std::endl;
         }
-        if (compName[i].substr(0, 1) == "C" || compName[i].substr(0, 2) == "LB") {
+        if (compName[i].compare(0, 1, "C") == 0 || compName[i].compare(0, 2, "LB") == 0) {
             if (!openSpacer) {
                 openSpacer = true;
                 geoSpacer.clear();
@@ -585,7 +585,7 @@ const Trk::TrackingVolumeArray* Muon::MuonStationTypeBuilder::processTrdStationC
             }
             comp_processed = true;
         }
-        if (compName[i].substr(0, 3) == "MDT") {
+        if (compName[i].compare(0, 3, "MDT") == 0) {
             Trk::Volume* mdtVol = nullptr;
             Trk::TrapezoidVolumeBounds* mdtBounds = nullptr;
             if (lowX == currX) {
@@ -670,7 +670,7 @@ const Trk::TrackingVolume* Muon::MuonStationTypeBuilder::processMdtBox(Trk::Volu
         Trk::MaterialProperties* mdtMat = nullptr;
         double xv = 0.;
         int active = 0;
-        if ((clv->getName()).substr(0, 3) == "MDT") {
+        if ((clv->getName()).compare(0, 3, "MDT") == 0) {
             xv = 13.0055;  // the half-thickness
             if (!cache.m_mdtTubeMat) {
                 const GeoTube* tube = dynamic_cast<const GeoTube*>(clv->getShape());
@@ -825,7 +825,7 @@ const Trk::TrackingVolume* Muon::MuonStationTypeBuilder::processMdtTrd(Trk::Volu
             if (x1v == x2v) xv = x1v;
         }
         Trk::MaterialProperties* mdtMat = nullptr;
-        if ((clv->getName()).substr(0, 3) == "MDT") {
+        if ((clv->getName()).compare(0, 3, "MDT") == 0) {
             xv = 13.0055;  // the half-thickness
             if (!cache.m_mdtTubeMat) {
                 const GeoTube* tube = dynamic_cast<const GeoTube*>(clv->getShape());
@@ -968,7 +968,7 @@ const Trk::TrackingVolume* Muon::MuonStationTypeBuilder::processRpc(Trk::Volume*
             Amg::Transform3D cTr(transfc[ic] * Amg::AngleAxis3D(0.5 * M_PI, Amg::Vector3D(0., 1., 0.)) *
                                  Amg::AngleAxis3D(0.5 * M_PI, Amg::Vector3D(0., 0., 1.)));
             Trk::MaterialProperties rpcMat(0., 10.e10, 10.e10, 13., 26., 0.);  // default
-            if ((glv->getName()).substr(0, 3) == "Ded") {
+            if ((glv->getName()).compare(0, 3, "Ded") == 0) {
                 // find if material exists already
                 bool found = false;
                 for (unsigned int i = 0; i < cache.m_rpcDed.size(); i++) {
@@ -999,7 +999,7 @@ const Trk::TrackingVolume* Muon::MuonStationTypeBuilder::processRpc(Trk::Volume*
             layer = new Trk::PlaneLayer(cTr, bounds, rpcMaterial, thickness, od);
             layers.push_back(layer);
             // make preliminary identification of active layers
-            if ((glv->getName()).substr(0, 3) != "Ded") {
+            if ((glv->getName()).compare(0, 3, "Ded") != 0) {
                 layer->setLayerType(1);
             } else {
                 layer->setLayerType(0);
@@ -1021,7 +1021,7 @@ const Trk::TrackingVolume* Muon::MuonStationTypeBuilder::processRpc(Trk::Volume*
                 Amg::Transform3D cTr(transfc[ic] * Amg::AngleAxis3D(0.5 * M_PI, Amg::Vector3D(0., 1., 0.)) *
                                      Amg::AngleAxis3D(0.5 * M_PI, Amg::Vector3D(0., 0., 1.)));
                 Trk::MaterialProperties rpcMat(0., 10.e10, 10.e10, 13., 26., 0.);  // default
-                if ((glv->getName()).substr(0, 3) == "Ded") {
+                if ((glv->getName()).compare(0, 3, "Ded") == 0) {
                     // find if material exists already
                     bool found = false;
                     for (unsigned int i = 0; i < cache.m_rpcDed.size(); i++) {
@@ -1065,7 +1065,7 @@ const Trk::TrackingVolume* Muon::MuonStationTypeBuilder::processRpc(Trk::Volume*
                         double gy = gtrd->getYHalfLength1();
                         double gz = gtrd->getZHalfLength();
 
-                        if ((gclv->getName()).substr(0, 6) == "RPC_AL") {
+                        if ((gclv->getName()).compare(0, 6, "RPC_AL") == 0) {
                             if (std::abs(gx - 5.0) < 0.001) {
                                 if (!cache.m_rpcExtPanel) {
                                     double volc = 8 * gx * gy * gz;
@@ -1792,7 +1792,7 @@ void Muon::MuonStationTypeBuilder::collectMaterial(const GeoVPhysVol* pv, Trk::M
     std::string nm = lv->getName();
     if (nm.empty()) nm = "Spacer";
 
-    if (lv->getMaterial()->getName() != "Air" && nm.substr(0, 1) != "T") {
+    if (lv->getMaterial()->getName() != "Air" && nm.compare(0, 1,"T") != 0) {
         // get material properties from GeoModel
         Trk::Material newMP = m_materialConverter->convert(lv->getMaterial());
         // current volume
@@ -1872,7 +1872,7 @@ const Trk::LayerArray* Muon::MuonStationTypeBuilder::processCSCTrdComponent(cons
     double maxX = compBounds->maxHalflengthX();
     double halfY = compBounds->halflengthY();
     double halfZ = compBounds->halflengthZ();
-    if (name.substr(name.size() - 5, 5) == "CSC01") {
+    if (name.compare(name.size() - 5, 5, "CSC01") == 0) {
         if (!cache.m_matCSC01) {
             double vol = (minX + maxX) * 2 * halfY * thickness;
             cache.m_matCSC01 = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(pv, vol, thickness));
@@ -1998,7 +1998,7 @@ const Trk::LayerArray* Muon::MuonStationTypeBuilder::processCSCDiamondComponent(
     double halfY1 = compBounds->halflengthY1();
     double halfY2 = compBounds->halflengthY2();
     double halfZ = compBounds->halflengthZ();
-    if (name.substr(name.size() - 5, 5) == "CSC02") {
+    if (name.compare(name.size() - 5, 5, "CSC02") == 0) {
         if (!cache.m_matCSC02) {
             double vol = ((minX + medX) * 2 * halfY1 + (medX + maxX) * 2 * halfY2) * thickness;
             cache.m_matCSC02 = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(pv, vol, thickness));
diff --git a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx
index be7060dbdddd..787e406040f3 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonTrackingGeometry/src/MuonTrackingGeometryBuilderCond.cxx
@@ -165,7 +165,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> Muon::MuonTrackingGeometry
 
     if (inertObjs && m_blendInertMaterial && m_removeBlended) {
         while (m_inertPerm < inertObjs->size() &&
-               (*inertObjs)[m_inertPerm]->name().substr((*inertObjs)[m_inertPerm]->name().size() - 4, 4) == "PERM")
+               (*inertObjs)[m_inertPerm]->name().compare((*inertObjs)[m_inertPerm]->name().size() - 4, 4, "PERM") == 0)
             m_inertPerm++;
     }
 
@@ -2017,7 +2017,7 @@ std::vector<const Trk::DetachedTrackingVolume*>* Muon::MuonTrackingGeometryBuild
                     } else
                         accepted = true;
                     if (accepted) {
-                        bool perm = inert->name().substr(inert->name().size() - 4, 4) == "PERM";
+                        bool perm = inert->name().compare(inert->name().size() - 4, 4, "PERM") == 0;
                         if (!m_blendInertMaterial || !m_removeBlended || perm) detached.push_back(inert);
                         if (m_blendInertMaterial && !perm) blendVols.push_back(inert);
                         ATH_MSG_VERBOSE(" Inert volume accepted by rLimit " << inert->name() << " zMin " << zMin << " zMax " << zMax
diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/CSCSensitiveDetector.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/CSCSensitiveDetector.cxx
index 5e15094d353b..01ffe2c95503 100755
--- a/MuonSpectrometer/MuonG4/MuonG4SD/src/CSCSensitiveDetector.cxx
+++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/CSCSensitiveDetector.cxx
@@ -123,8 +123,8 @@ G4bool CSCSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory* /*ROH
 
       // now get the geoIdentifierTag of the rpc components
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/CSCSensitiveDetectorCosmics.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/CSCSensitiveDetectorCosmics.cxx
index 360b6687a350..f8caf9986a2e 100755
--- a/MuonSpectrometer/MuonG4/MuonG4SD/src/CSCSensitiveDetectorCosmics.cxx
+++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/CSCSensitiveDetectorCosmics.cxx
@@ -160,8 +160,8 @@ G4bool CSCSensitiveDetectorCosmics::ProcessHits(G4Step* aStep,G4TouchableHistory
 
       // now get the geoIdentifierTag of the rpc components
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.cxx
index afaaff0a3b2c..c1ef4370b4e5 100755
--- a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.cxx
+++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetector.cxx
@@ -166,8 +166,8 @@ int MDTSensitiveDetector::GetIdentifier(G4TouchableHistory* touchHist)
     else if ((npos = volName.find("component")) != std::string::npos  && (!isAssembly)) {     // multilayer
 
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
@@ -206,8 +206,8 @@ int MDTSensitiveDetector::GetIdentifier(G4TouchableHistory* touchHist)
       stationPhi = fi;
 
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.cxx
index 8449adffede4..7e86e0706c68 100755
--- a/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.cxx
+++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/MDTSensitiveDetectorCosmics.cxx
@@ -210,8 +210,8 @@ int MDTSensitiveDetectorCosmics::GetIdentifier(G4TouchableHistory* touchHist)
     else if ((npos = volName.find("component")) != std::string::npos && (!isAssembly)) {     // multilayer
 
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
@@ -250,8 +250,8 @@ int MDTSensitiveDetectorCosmics::GetIdentifier(G4TouchableHistory* touchHist)
       stationPhi = fi;
 
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/RPCSensitiveDetector.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/RPCSensitiveDetector.cxx
index 4f17034e9761..30d11eff3c7b 100755
--- a/MuonSpectrometer/MuonG4/MuonG4SD/src/RPCSensitiveDetector.cxx
+++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/RPCSensitiveDetector.cxx
@@ -157,8 +157,8 @@ G4bool RPCSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory*) {
 
       // now get the geoIdentifierTag of the rpc components
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           //G4cout << "first [ is at "<<loc1<<" first ] at "<<loc2 << G4endl;
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
@@ -177,8 +177,8 @@ G4bool RPCSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory*) {
       std::string::size_type loc1,loc2;
       tech=volName.substr(npos-5,5);
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/RPCSensitiveDetectorCosmics.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/RPCSensitiveDetectorCosmics.cxx
index 572cbd845d4c..c48869c99889 100755
--- a/MuonSpectrometer/MuonG4/MuonG4SD/src/RPCSensitiveDetectorCosmics.cxx
+++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/RPCSensitiveDetectorCosmics.cxx
@@ -182,8 +182,8 @@ G4bool RPCSensitiveDetectorCosmics::ProcessHits(G4Step* aStep,G4TouchableHistory
 
       // now get the geoIdentifierTag of the rpc components
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
@@ -202,8 +202,8 @@ G4bool RPCSensitiveDetectorCosmics::ProcessHits(G4Step* aStep,G4TouchableHistory
 
       std::string::size_type loc1,loc2;
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
@@ -222,8 +222,8 @@ G4bool RPCSensitiveDetectorCosmics::ProcessHits(G4Step* aStep,G4TouchableHistory
 
       std::string::size_type loc1,loc2;
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/TGCSensitiveDetector.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/TGCSensitiveDetector.cxx
index 4e87914aa0be..8ef51c2089c0 100755
--- a/MuonSpectrometer/MuonG4/MuonG4SD/src/TGCSensitiveDetector.cxx
+++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/TGCSensitiveDetector.cxx
@@ -189,8 +189,8 @@ G4bool TGCSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory*) {
 
       // now get the geoIdentifierTag of the rpc components
       int gmID = 0;
-      if ((loc1 = volName.find("[")) != std::string::npos) {
-        if ((loc2 = volName.find("]", loc1+1)) != std::string::npos) {
+      if ((loc1 = volName.find('[')) != std::string::npos) {
+        if ((loc2 = volName.find(']', loc1+1)) != std::string::npos) {
           std::istringstream istrvar(volName.substr(loc1+1,loc2-loc1-1));
           istrvar>>gmID;
         }
@@ -223,7 +223,6 @@ G4bool TGCSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory*) {
       }
     } else if ((npos = volName.find("TGCGas")) != std::string::npos) {
 
-      std::string currentTech = volName.substr(0,4);
       int volCopyNo = touchHist->GetVolume(i)->GetCopyNo();
 
       if (volCopyNo != 0)
diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/src/TGCSensitiveDetectorCosmics.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/src/TGCSensitiveDetectorCosmics.cxx
index bfd12f3444d6..862c5ca65e5a 100755
--- a/MuonSpectrometer/MuonG4/MuonG4SD/src/TGCSensitiveDetectorCosmics.cxx
+++ b/MuonSpectrometer/MuonG4/MuonG4SD/src/TGCSensitiveDetectorCosmics.cxx
@@ -102,7 +102,7 @@ G4bool TGCSensitiveDetectorCosmics::ProcessHits(G4Step* aStep,G4TouchableHistory
       } else {
         zside = -1;
       }
-      if (stationName.substr(2,1) == "F") {
+      if (stationName.compare(2,1, "F") == 0) {
 
         stationPhi    = (abs(volCopyNo%100)-1)*3;
         if (abs(volCopyNo/100) > 3) {
@@ -116,8 +116,8 @@ G4bool TGCSensitiveDetectorCosmics::ProcessHits(G4Step* aStep,G4TouchableHistory
           stationPhi = 24 - stationPhi;
         }
 
-      } else if (stationName.substr(2,1) == "E") {
-        if (stationName.substr(1,1) == "4") {
+      } else if (stationName.compare(2,1,"E") == 0) {
+        if (stationName.compare(1,1,"4") == 0) {
 
           stationPhi = (abs(volCopyNo%100)-1)*3+abs(volCopyNo/100);
 
@@ -168,7 +168,6 @@ G4bool TGCSensitiveDetectorCosmics::ProcessHits(G4Step* aStep,G4TouchableHistory
       }
     } else if ((npos = volName.find("TGCGas")) != std::string::npos) {
 
-      std::string currentTech = volName.substr(0,4);
       int volCopyNo = touchHist->GetVolume(i)->GetCopyNo();
 
       if (volCopyNo != 0)
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DBReader.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DBReader.h
index 8b3893f3d064..f6440bd1e038 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DBReader.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/DBReader.h
@@ -117,7 +117,7 @@ namespace MuonGM {
       public:
         virtual StatusCode ProcessDB() { return StatusCode::SUCCESS; };
         void setGeometryVersion(std::string s);
-        std::string getGeometryVersion() const;
+        const std::string& getGeometryVersion() const;
         void setManager(MuonDetectorManager *detmgr) { m_mgr = detmgr; };
 
         virtual ~DBReader(){};
@@ -161,7 +161,7 @@ namespace MuonGM {
         nmdt++;
 
         for (unsigned int i = 0; i < dhwmdt->size(); i++) {
-            if (s.substr(3, s.size() - 3) == MuonGM::buildString(wmdt[i].iw, 2)) {
+            if (s.compare(3, s.size() - 3, MuonGM::buildString(wmdt[i].iw, 2)) == 0) {
                 mdt->numOfLayers = wmdt[i].laymdt;
                 mdt->innerRadius = wmdt[i].tubrad * Gaudi::Units::cm;
                 mdt->totalThickness = wmdt[i].tubsta * Gaudi::Units::cm;
@@ -263,7 +263,7 @@ namespace MuonGM {
         int nStruct = dhwrpc->size();
         bool done = false;
         for (unsigned int i = 0; (i < dhwrpc->size() && !done); i++) {
-            if (s.substr(3, s.size() - 3) == MuonGM::buildString(wrpc[i].jsta, 2)) {
+            if (s.compare(3, s.size() - 3, MuonGM::buildString(wrpc[i].jsta, 2)) == 0) {
                 if (RPCprint) {
                     log << MSG::INFO << " ProcessRPC " << s << " index " << i << " jsta =" << wrpc[i].jsta << " strings comparison:: <" << s.substr(3, s.size() - 3) << ">=<"
                         << MuonGM::buildString(wrpc[i].jsta, 2) << ">" << endmsg;
@@ -328,7 +328,7 @@ namespace MuonGM {
         double p, t;
 
         for (unsigned int i = 0; i < dhwtgcall->size(); i++) {
-            if (s.substr(3, s.size() - 3) == MuonGM::buildString(wtgcall[i].jsta, 2)) {
+            if (s.compare(3, s.size() - 3,MuonGM::buildString(wtgcall[i].jsta, 2)) ==0 ) {
                 tgc->nlayers = wtgcall[i].nbevol;
                 tgc->thickness = wtgcall[i].widchb * Gaudi::Units::cm;
                 tgc->frame_h = wtgcall[i].fwirch * Gaudi::Units::cm;
@@ -388,7 +388,7 @@ namespace MuonGM {
         std::string tname = s;
         while (tname != "XXXXX") {
             for (unsigned int i = 0; i < dhwcsc->size(); i++) {
-                if (tname.substr(3, s.size() - 3) == MuonGM::buildString(wcsc[i].jsta, 2)) {
+                if (tname.compare(3, s.size() - 3, MuonGM::buildString(wcsc[i].jsta, 2)) == 0) {
                     csc->numOfLayers = wcsc[i].laycsc;
                     csc->totalThickness = wcsc[i].ttotal * Gaudi::Units::cm;
                     csc->thickness = csc->totalThickness;
@@ -478,7 +478,7 @@ namespace MuonGM {
         nspa++;
 
         for (unsigned int i = 0; i < dhwspa->size(); i++) {
-            if (s.substr(3, s.size() - 3) == MuonGM::buildString(wspa[i].jsta, 2)) {
+            if (s.compare(3, s.size() - 3, MuonGM::buildString(wspa[i].jsta, 2)) == 0) {
                 spa->thickness = wspa[i].tckspa * Gaudi::Units::cm;
             }
         }
@@ -494,10 +494,10 @@ namespace MuonGM {
         nsup++;
 
         for (unsigned int i = 0; i < dhwsup->size(); i++) {
-            if (s.substr(3, s.size() - 3) == MuonGM::buildString(wsup[i].jsta, 2)) {
+            if (s.compare(3, s.size() - 3, MuonGM::buildString(wsup[i].jsta, 2)) == 0) {
                 sup->alFlangeThickness = wsup[i].xxsup[0] * Gaudi::Units::cm;
 
-                if (s.substr(3, s.size() - 3) == "03") {
+                if (s.compare(3, s.size() - 3, "03") == 0) {
                     sup->alHorFlangeLength = (fabs)(wsup[i].zzsup[1]) * Gaudi::Units::cm;
                     sup->alVerFlangeLength = wsup[i].xxsup[1] * Gaudi::Units::cm - wsup[i].xxsup[0] * Gaudi::Units::cm;
                     sup->alVerProfileThickness = wsup[i].zzsup[3] * Gaudi::Units::cm;
@@ -544,7 +544,7 @@ namespace MuonGM {
         nded++;
 
         for (unsigned int i = 0; i < dhwded->size(); i++) {
-            if (s.substr(3, s.size() - 3) == MuonGM::buildString(wded[i].jsta, 2)) {
+            if (s.compare(3, s.size() - 3, MuonGM::buildString(wded[i].jsta, 2)) == 0) {
                 // a lot of confusion in the various versions of the geometry in nova
                 ded->AlThickness = 0.3 * Gaudi::Units::mm;
                 ded->thickness = (wded[i].auphcb) * Gaudi::Units::cm;
@@ -565,7 +565,7 @@ namespace MuonGM {
         nchv++;
 
         for (int i = 0; i < nStruct; i++) {
-            if (s.substr(3, s.size() - 3) == MuonGM::buildString(wchv[i].jsta, 2)) {
+            if (s.compare(3, s.size() - 3, MuonGM::buildString(wchv[i].jsta, 2)) == 0) {
                 chv->thickness = wchv[i].thickness * Gaudi::Units::cm;
                 chv->largeness = wchv[i].largeness * Gaudi::Units::cm;
                 chv->height = wchv[i].heightness * Gaudi::Units::cm;
@@ -584,7 +584,7 @@ namespace MuonGM {
         ncro++;
 
         for (int i = 0; i < nStruct; i++) {
-            if (s.substr(3, s.size() - 3) == MuonGM::buildString(wcro[i].jsta, 2)) {
+            if (s.compare(3, s.size() - 3, MuonGM::buildString(wcro[i].jsta, 2)) == 0) {
                 cro->thickness = wcro[i].thickness * Gaudi::Units::cm;
                 cro->largeness = wcro[i].largeness * Gaudi::Units::cm;
                 cro->height = wcro[i].heightness * Gaudi::Units::cm;
@@ -603,7 +603,7 @@ namespace MuonGM {
         ncmi++;
 
         for (int i = 0; i < nStruct; i++) {
-            if (s.substr(3, s.size() - 3) == MuonGM::buildString(wcmi[i].jsta, 2)) {
+            if (s.compare(3, s.size() - 3, MuonGM::buildString(wcmi[i].jsta, 2)) == 0) {
                 cmi->thickness = wcmi[i].thickness * Gaudi::Units::cm;
                 cmi->largeness = wcmi[i].largeness * Gaudi::Units::cm;
                 cmi->height = wcmi[i].heightness * Gaudi::Units::cm;
@@ -622,7 +622,7 @@ namespace MuonGM {
         nlbi++;
 
         for (int i = 0; i < nStruct; i++) {
-            if (s.substr(2, s.size() - 2) == MuonGM::buildString(wlbi[i].jsta, 2)) {
+            if (s.compare(2, s.size() - 2, MuonGM::buildString(wlbi[i].jsta, 2)) == 0) {
                 lbi->thickness = wlbi[i].thickness * Gaudi::Units::cm;
                 lbi->height = wlbi[i].height * Gaudi::Units::cm;
                 lbi->lowerThickness = wlbi[i].lowerThickness * Gaudi::Units::cm;
@@ -708,7 +708,7 @@ namespace MuonGM {
                 halfpitch = default_halfpitch;
                 for (int icomp = 0; icomp < stat->GetNrOfComponents(); ++icomp) {
                     const Component *c = stat->GetComponent(icomp);
-                    if (c->name.substr(0, 3) != "MDT")
+                    if (c->name.compare(0, 3,"MDT") != 0)
                         continue;
                     MDT *mdtobj = (MDT *)mysql->GetATechnology(c->name);
                     if (!mdtobj) {
@@ -733,7 +733,7 @@ namespace MuonGM {
                 p.phi = aptp[ipos].dphi + double(phiindex) * 45.;
                 p.radius = aptp[ipos].r * Gaudi::Units::cm;
                 p.z = aptp[ipos].z * Gaudi::Units::cm;
-                if (p.zindex < 0 && name.substr(0, 1) == "B" && hasMdts)
+                if (p.zindex < 0 && name.compare(0, 1,"B") == 0 && hasMdts)
                     p.z = p.z - halfpitch;
                 p.shift = aptp[ipos].s * Gaudi::Units::cm;
                 if (verbose_posmap) {
@@ -954,7 +954,7 @@ namespace MuonGM {
         MsgStream log(Athena::getMessageSvc(), "MuGM:ProcStations");
         log << MSG::INFO << " Processing Stations and Components" << endmsg;
 
-        std::string cartyp, cartec;
+        std::string  cartec;
         Station *stat = NULL, *previous_stat = NULL, *previous_stored = NULL;
 
         // control on new stations/subtypes
@@ -1037,7 +1037,7 @@ namespace MuonGM {
                 c = new TgcComponent;
             } else if (cartec == "CRO" || cartec == "CMI" || cartec == "CHV") {
                 c = new CbmComponent;
-            } else if (cartec.substr(0, 2) == "LB") {
+            } else if (cartec.compare(0, 2, "LB") == 0) {
                 c = new LbiComponent;
             } else {
                 c = new StandardComponent;
@@ -1074,7 +1074,7 @@ namespace MuonGM {
             } else if (cartec == "SPA") {
                 SpaComponent *derc = (SpaComponent *)c;
                 derc->maxwdy = derc->dy;
-                if (jtech == 6 && name.substr(0, 3) == "CSL") {
+                if (jtech == 6 && name.compare(0, 3, "CSL") == 0) {
                     derc->dy = 1129.20 * Gaudi::Units::mm; // AMDB-Q and CTB
                 }
             } else if (cartec == "MDT") {
@@ -1094,9 +1094,9 @@ namespace MuonGM {
                 // DHW 4 Feb 09 : no longer needed, read in above:   derc->iswap = 1;
             } else if (cartec == "DED") {
 
-            } else if (cartec == "SUP" || cartec == "TGC" || cartec == "CHV" || cartec == "CRO" || cartec == "CMI" || cartec.substr(0, 2) == "LB") {
+            } else if (cartec == "SUP" || cartec == "TGC" || cartec == "CHV" || cartec == "CRO" || cartec == "CMI" || cartec.compare(0, 2, "LB") == 0) {
 
-                if (cartec.substr(0, 2) == "LB") {
+                if (cartec.compare(0, 2, "LB") == 0) {
                     LbiComponent *derc = (LbiComponent *)c;
                     derc->associated_CMIsubtype = "";
                     if ((name == "BMF1" || name == "BMF2" || name == "BMF3" || name == "BMF4" || name == "BMF5" || name == "BMF6") && derc->name == "LB02") {
diff --git a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonChamber.h b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonChamber.h
index 4ed2fda6ad8b..90fec8552aa4 100644
--- a/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonChamber.h
+++ b/MuonSpectrometer/MuonGeoModel/MuonGeoModel/MuonChamber.h
@@ -34,7 +34,7 @@ namespace MuonGM {
 
         double rotangle[10];
 
-        int stationPhiTGC(const std::string& stName, int fi, int zi, const std::string& geometry_version) const;
+        int stationPhiTGC(std::string_view stName, int fi, int zi, std::string_view geometry_version) const;
         inline void setFineClashFixingFlag(int value);
 
         MuonChamber(Station *s);
diff --git a/MuonSpectrometer/MuonGeoModel/src/DBReader.cxx b/MuonSpectrometer/MuonGeoModel/src/DBReader.cxx
index 0cd538ff1d57..7438160a70f4 100644
--- a/MuonSpectrometer/MuonGeoModel/src/DBReader.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/DBReader.cxx
@@ -17,7 +17,7 @@ namespace MuonGM {
 
     void DBReader::setGeometryVersion(std::string geoVersion) { m_version = std::move(geoVersion); }
 
-    std::string DBReader::getGeometryVersion() const { return m_version; }
+    const std::string& DBReader::getGeometryVersion() const { return m_version; }
 
     std::string DBReader::TGCreadoutName(int ichtyp) {
         MsgStream log(Athena::getMessageSvc(), "DBReader::TGCreadoutName");
diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx
index aaea21962cbf..af83d67b604e 100644
--- a/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/MuonChamber.cxx
@@ -121,10 +121,11 @@ namespace MuonGM {
         MYSQL *mysql = MYSQL::GetPointer();
 
         double halfpitch = m_station->mdtHalfPitch();
-        std::string stName = m_station->GetName();
+        const std::string stName = m_station->GetName();
+
         const MdtIdHelper *mdt_id = manager->mdtIdHelper();
         int stationType = mdt_id->stationNameIndex(stName.substr(0, 3));
-        bool is_barrel = (stName.substr(0, 1) == "B");
+        bool is_barrel = (stName.compare(0, 1, "B") == 0);
 
         std::string geometry_version = manager->geometryVersion();
         double extratop = m_station->GetExtraTopThickness();
@@ -168,7 +169,7 @@ namespace MuonGM {
             double cxpos = 0;
             for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
                 comp = (StandardComponent *)m_station->GetComponent(i);
-                if ((comp->name).substr(0, 3) == "CSC") {
+                if ((comp->name).compare(0, 3, "CSC") == 0) {
                     clen = comp->dy;
                     cthick = comp->GetThickness();
                     cypos = clen - comp->posy + 1.0 - length / 2.;
@@ -223,8 +224,7 @@ namespace MuonGM {
                 int mdt_index[4] = {0, 0, 0, 0};
                 for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
                     comp = (StandardComponent *)m_station->GetComponent(i);
-                    std::string compName = (comp->name).substr(0, 3);
-                    if (compName == "MDT") {
+                    if (comp->name.compare(0,3,"MDT") == 0) {
                         mdt_index[index] = i;
                         index += 1;
                     }
@@ -296,7 +296,7 @@ namespace MuonGM {
         // double lengthShiftCP = 0.;
 
         // if this is a BOG, we want to make cutouts in the MOTHER VOLUME
-        if (stName.substr(0, 3) == "BOG" && (manager->IncludeCutoutsBogFlag() || manager->IncludeCutoutsFlag())) {
+        if (stName.compare(0, 3, "BOG") == 0 && (manager->IncludeCutoutsBogFlag() || manager->IncludeCutoutsFlag())) {
 
             if (verbose) {
                 log << MSG::VERBOSE << "amdb org: length= " << amdbOrigine_along_length << " thickness= " << amdbOrigine_along_thickness << endmsg;
@@ -339,7 +339,7 @@ namespace MuonGM {
                             }
                             // create the cutout with the full thickness of the STATION
                             cut->setThickness(totthick * 1.01); // extra to be sure
-                            if ((cut->subtype == mysql->allocPosFindSubtype(statType, fi, zi)) && (cut->icut == mysql->allocPosFindCutout(statType, fi, zi)) &&
+                            if ((cut->subtype == mysql->allocPosFindSubtype(std::string(statType), fi, zi)) && (cut->icut == mysql->allocPosFindCutout(std::string(statType), fi, zi)) &&
                                 (cut->ijob == c->index)) {
 
                                 foundCutouts = true;
@@ -352,7 +352,7 @@ namespace MuonGM {
 
         // remove overlaps between end-cap and forward region of TGC stations,
         // T[1-3]E1_station and T[1-3]F1_station
-        if (stName.substr(0, 1) == "T" && stName.substr(2, 1) == "E" && stName.substr(1, 1) != "4") {
+        if (stName.compare(0, 1, "T") == 0 && stName.compare(2, 1, "E") == 0 && stName.compare(1, 1, "4") != 0) {
             GeoTrd *strdoverlap = new GeoTrd(totthick / 4, totthick / 4, width / 2, longWidth / 2, 400. / 2);
             strd = &(strd->subtract((*strdoverlap) << GeoTrf::Translate3D(-totthick / 4., 0., -length / 2 + 400. / 2.)));
         }
@@ -363,7 +363,7 @@ namespace MuonGM {
         } else {
             mtrd = getMaterialManager()->getMaterial("std::Air");
         }
-        GeoLogVol *ltrd = new GeoLogVol(stName + "_Station", strd, mtrd);
+        GeoLogVol *ltrd = new GeoLogVol(std::string(stName) + "_Station", strd, mtrd);
         GeoPhysVol *ptrd = new GeoPhysVol(ltrd);
 
         double ypos;
@@ -385,7 +385,7 @@ namespace MuonGM {
 
         for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
             StandardComponent *d = (StandardComponent *)m_station->GetComponent(j);
-            std::string cn = (d->name).substr(0, 3);
+            std::string_view cn = std::string_view(d->name).substr(0, 3);
             if (cn == "RPC") {
                 nRpc++;
                 if (nRpc == 1)
@@ -394,7 +394,7 @@ namespace MuonGM {
                 // std::cerr << " nRpc, nDoubletR, depth " << nRpc << " " << nDoubletR
                 //           << " " << depth;
                 // BI RPC Chambers have one one doubletR
-                if (!(stname.substr(0, 2) == "BI") && nDoubletR == 1 && nRpc > 1 && depth * previous_depth < 0)
+                if (!(stname.compare(0, 2, "BI") == 0) && nDoubletR == 1 && nRpc > 1 && depth * previous_depth < 0)
                     nDoubletR++;
                 // std::cerr<<" updated to "<<nDoubletR<<std::endl;
 
@@ -424,7 +424,7 @@ namespace MuonGM {
         double LBpos[2] = {-1, -1};
         for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
             StandardComponent *c = (StandardComponent *)m_station->GetComponent(i);
-            std::string cname = (c->name).substr(0, 2);
+            std::string_view cname = std::string_view(c->name).substr(0, 2);
             if (cname == "LB") {
                 LBI *lb = (LBI *)mysql->GetTechnology(c->name);
                 LByShift = lb->yShift;
@@ -440,7 +440,7 @@ namespace MuonGM {
 
         for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
             StandardComponent *c = (StandardComponent *)m_station->GetComponent(i);
-            std::string cname = (c->name).substr(0, 3);
+            std::string_view cname = std::string_view(c->name).substr(0, 3);
             if (cname == "CRO" || cname == "CMI" || cname == "CHV") {
                 CbmComponent *ccbm = (CbmComponent *)c;
                 ccbm->lb_height = LBheight;
@@ -454,7 +454,7 @@ namespace MuonGM {
         std::string CMIcomponentNumber = "";
         for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
             StandardComponent *d = (StandardComponent *)m_station->GetComponent(j);
-            std::string cn = (d->name).substr(0, 3);
+            std::string_view cn = std::string_view(d->name).substr(0, 3);
             if (cn == "CMI") {
                 CMIcomponentNumber = (d->name).substr(3, 2);
                 break;
@@ -463,7 +463,7 @@ namespace MuonGM {
 
         for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
             StandardComponent *d = (StandardComponent *)m_station->GetComponent(j);
-            std::string cn = (d->name).substr(0, 2);
+            std::string_view cn = std::string_view(d->name).substr(0, 2);
             if (cn == "LB") {
                 LbiComponent *lbic = (LbiComponent *)d;
                 if (lbic) {
@@ -475,7 +475,7 @@ namespace MuonGM {
 
         // Build the MuonStation(readout-geometry) corresponding to this MuonChamber(raw-geometry)
         MuonStation *mstat;
-        if (stName.substr(0, 1) == "B") {
+        if (stName.compare(0, 1, "B") == 0) {
             mstat = new MuonStation(stName.substr(0, 3), width, totthick, length, longWidth, totthick, length, zi, fi + 1,
                                     (zi < 0 && !is_mirrored)); //!< fi here goes from 0 to 7; in amdb from 1 to 8;
         } else {
@@ -506,8 +506,8 @@ namespace MuonGM {
             zpos = -length / 2. + amdbOrigine_along_length + c->posy + c->dy / 2.;
             xpos = c->posx;
 
-            std::string techname = c->name;
-            std::string type = techname.substr(0, 3);
+            const std::string &techname = c->name;
+            std::string_view type = std::string_view(techname).substr(0, 3);
 
             GeoVPhysVol *lv = nullptr;
             GeoVPhysVol *lvd = nullptr;
@@ -530,7 +530,7 @@ namespace MuonGM {
                 Cutout *cut = m_station->GetCutout(ii);
                 cut->setThickness(cthickness * 1.01); // extra thickness to be sure
 
-                if ((cut->subtype == mysql->allocPosFindSubtype(statType, fi, zi)) && (cut->icut == mysql->allocPosFindCutout(statType, fi, zi)) && (cut->ijob == c->index)) {
+                if ((cut->subtype == mysql->allocPosFindSubtype(std::string(statType), fi, zi)) && (cut->icut == mysql->allocPosFindCutout(std::string(statType), fi, zi)) && (cut->ijob == c->index)) {
 
                     double tempdx = cut->dx;
                     double tempdy = cut->dy;
@@ -538,7 +538,7 @@ namespace MuonGM {
                     cut->dx = 0.;
                     cut->dy = 0.;
 
-                    if (stName.substr(0, 3) == "BOG") {
+                    if (stName.compare(0, 3, "BOG") == 0) {
                         // make the cutouts a bit longer
                         cut->lengthY = templengthY + 31.;
                     }
@@ -568,7 +568,7 @@ namespace MuonGM {
                     }
 
                     // Corrected cutout values for BMS7, BMS14
-                    if (stName.substr(0, 3) == "BMS") {
+                    if (stName.compare(0, 3, "BMS") == 0) {
                         if (fi == 3) {               // stationPhi = 4
                             if (std::abs(zi) == 1) { // stationEta = +-1
                                 double margin = 1.0; // make cutout a little bigger to avoid coincident boundaries
@@ -592,7 +592,7 @@ namespace MuonGM {
                     }
 
                     // the following is a fine tuning ----- MUST CHECK for a better solution
-                    if (stName.substr(0, 3) == "BOS" && zi == -6 && type == "MDT") {
+                    if (stName.compare(0, 3,"BOS") == 0 && zi == -6 && type == "MDT") {
                         cut->dy = c->dy - cut->dy - cut->lengthY - halfpitch;
                         cut->dead1 = 30.; // why this is not 30. or -30. already ?????
                         if (techname == "MDT03")
@@ -605,7 +605,7 @@ namespace MuonGM {
                     // this mirroring of the cutout is necessary only for barrel MDT chambers; for EC the cutout will be automatically mirrored
                     // this fix cannot be applied in 15.6.X.Y for layout < r.04.04 due to the frozen tier0 policy
 
-                    if (type == "MDT" && (is_mirrored || zi < 0) && stName.substr(0, 1) == "B") {
+                    if (type == "MDT" && (is_mirrored || zi < 0) && stName.compare(0, 1, "B") == 0) {
                         // MDT in chambers explicitly described at z<0 have to be
                         // rotated by 180deg to adj. tube staggering
                         // reverse the position (x amdb) of the cutout if the m_station is mirrored
@@ -621,11 +621,11 @@ namespace MuonGM {
                     } else if (type == "RPC" || type == "DED") {
                         Cutout *cutRpcType = new Cutout(*cut);
                         // temporary for testing fixes to r.03.09
-                        if (stName.substr(0, 3) == "BMS" && zi == 4 && (c->index == 20 || c->index == 21 || c->index == 24 || c->index == 25)) {
+                        if (stName.compare(0, 3, "BMS") == 0 && zi == 4 && (c->index == 20 || c->index == 21 || c->index == 24 || c->index == 25)) {
                             cutRpcType->dy = 1102.5;
                         }
 
-                        if (stName.substr(0, 3) == "BOS" && zi == 6 && type == "DED")
+                        if (stName.compare(0, 3, "BOS") == 0 && zi == 6 && type == "DED")
                             cutRpcType->dy = 706.;
 
                         cutRpcType->dy = cutRpcType->dy - c->posy;
@@ -671,10 +671,9 @@ namespace MuonGM {
             GeoTransform *xfcomponent{nullptr};
             GeoAlignableTransform *xfaligncomponent{nullptr};
             // for RPCs we need a vector of transforms for M28 geometry...
-            // std::vector<GeoTransform*> xfrpccomponent;
 
             if (type == "CRO") {
-                if (stName.substr(0, 1) != "B" && is_mirrored)
+                if (stName.compare(0, 1, "B") != 0 && is_mirrored)
                     mstat->setxAmdbCRO(-xpos);
                 else
                     mstat->setxAmdbCRO(xpos);
@@ -691,7 +690,7 @@ namespace MuonGM {
 
                 // ss - 24-05-2006 I don't really understand if this is needed at all
                 //      it was introduced by Isabel T.
-                if (zi < 0 && stName.substr(0, 3) == "BOG" && is_mirrored) {
+                if (zi < 0 && stName.compare(0, 3, "BOG") == 0 && is_mirrored) {
                     //      htcomponent = htcomponent*GeoTrf::RotateX3D(180.*Gaudi::Units::deg);
                     //      tubes OK but chambers wrong
                     //      htcomponent = GeoTrf::RotateX3D(180.*Gaudi::Units::deg)*htcomponent;
@@ -700,15 +699,15 @@ namespace MuonGM {
                 } // ss - 24-05-2006 I don't really understand if this is needed at all
 
                 xfaligncomponent = new GeoAlignableTransform(htcomponent);
-                std::string key = stName + techname;
+                std::string key =std::string( stName) + techname;
 
                 // for cutouts:
                 // MDT cutouts for BOS1,5, BMS7,14, (problem with BMS4,10), EMS, BMG and BIS MDT14
                 bool mdtCutoutFlag = ((stname == "BOS" && std::abs(zi) == 6) || stname == "BMG" || techname == "MDT14" || (stname == "BMS" && (std::abs(zi) == 1 && fi == 3)) ||
                                       (stname == "EMS" && (std::abs(zi) == 1 || std::abs(zi) == 3)));
-                if (((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi >= 0) {
+                if (((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi >= 0) {
                     key += "p" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0);
-                } else if (((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi < 0) {
+                } else if (((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG")) == 0) && zi < 0) {
                     key += "m" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0);
                 }
 
@@ -720,7 +719,7 @@ namespace MuonGM {
                             << manager->IncludeCutoutsFlag() << " manager->IncludeCutoutsBogFlag() " << manager->IncludeCutoutsBogFlag() << endmsg;
                     }
 
-                    if ((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) {
+                    if ((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
                         lvm = r->build(vcutdef);
                     } else {
                         lvm = r->build();
@@ -738,7 +737,7 @@ namespace MuonGM {
                 }
 
             } else if (type == "SPA" && manager->MinimalGeoFlag() == 0) {
-                if (techname == "SPA01" && stName.substr(0, 1) == "C") {
+                if (techname == "SPA01" && stName.compare(0, 1, "C") == 0) {
                     if (debug) {
                         log << MSG::DEBUG << "Ficticious spacer SPA01 in CSC chamber - skip it " << endmsg;
                     }
@@ -749,10 +748,10 @@ namespace MuonGM {
 
                 htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateZ3D(zpos);
                 xfcomponent = new GeoTransform(htcomponent);
-                std::string key = stName + techname;
-                if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi >= 0) {
+                std::string key = std::string(stName) + techname;
+                if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi >= 0) {
                     key += "p" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0);
-                } else if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi < 0) {
+                } else if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3,"BOG") == 0)) && zi < 0) {
                     key += "m" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0);
                 }
 
@@ -761,7 +760,7 @@ namespace MuonGM {
                     Spacer *r = new Spacer(c);
                     // log << MSG::DEBUG << " Building a SPA for m_station "
                     //     << key << " component name is " << c->name << endmsg;
-                    if (manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) {
+                    if (manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
                         lv = r->build(1);
                     } else {
                         lv = r->build();
@@ -778,7 +777,7 @@ namespace MuonGM {
                 BeamHeight = r->height;
                 ypos = c->posx;
                 double xpos = (c->posz + amdbOrigine_along_thickness) - thickness / 2. + BeamHeight / 2.;
-                if (type.substr(0, 2) == "LB")
+                if (type.compare(0, 2, "LB") == 0)
                     xpos -= LByShift;
 
                 double angle = 0.;
@@ -818,9 +817,9 @@ namespace MuonGM {
                 xfcomponent = new GeoTransform(htcomponent);
 
                 std::string key = stName + techname;
-                if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi >= 0) {
+                if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi >= 0) {
                     key += "p" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0);
-                } else if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi < 0) {
+                } else if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi < 0) {
                     key += "m" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0);
                 }
                 // can have LB of different length in same m_station:
@@ -831,13 +830,13 @@ namespace MuonGM {
                 //                   << key << " component name is "
                 //                   << c->name << endmsg;
                 GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
-                if (fpv == 0 || (stName.substr(0, 3) == "BOG" && type == "CMI")) {
-                    if (stName.substr(0, 3) == "BOG") {
+                if (fpv == 0 || (stName.compare(0, 3, "BOG") == 0 && type == "CMI")) {
+                    if (stName.compare(0, 3, "BOG") == 0) {
                         if (verbose) {
                             log << MSG::VERBOSE << " Building a SpacerBeam for station " << key << " component name is " << c->name << endmsg;
                         }
                     }
-                    if (manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) {
+                    if (manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
                         lvo = r->build(1, is_barrel);
                     } else {
                         lvo = r->build(is_barrel);
@@ -847,7 +846,7 @@ namespace MuonGM {
                     // end of bar.
                     // From centre, it is -height/2 in x, 0 in y, -length/2 in z
                 } else {
-                    if (stName.substr(0, 3) == "BOG")
+                    if (stName.compare(0, 3,"BOG") == 0)
                         if (verbose)
                             log << MSG::VERBOSE << " This spacerbeam for station " << key << " component name is " << c->name << " already exists; re-use it " << endmsg;
                     lvo = fpv;
@@ -886,17 +885,17 @@ namespace MuonGM {
                 bool rpcCutoutFlag = (stname == "BOS" && std::abs(zi) == 6) || (stname == "BMS" && (std::abs(zi) == 2 || std::abs(zi) == 4 || std::abs(zi) == 6)) ||
                                      (stname == "BMS" && std::abs(zi) == 1 && fi == 3);
                 std::string key = stName + techname;
-                if (((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi >= 0) {
+                if (((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi >= 0) {
                     key += "p" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0) + "_" +
                            buildString(vcutdef.size(), 0) + "_" + buildString(rp->iswap, 0);
-                } else if (((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi < 0) {
+                } else if (((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi < 0) {
                     key += "m" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0) + "_" +
                            buildString(vcutdef.size(), 0) + "_" + buildString(rp->iswap, 0);
                 }
                 GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
                 if (fpv == 0) {
                     Rpc *r = new Rpc(c);
-                    r->setLogVolName(stName + techname);
+                    r->setLogVolName(std::string(stName) + techname);
                     if (stName.find("BI") != std::string::npos) {
                         std::map<std::string, float>::const_iterator yItr = rpcYTrans.find(techname);
                         if (yItr != rpcYTrans.end())
@@ -906,7 +905,7 @@ namespace MuonGM {
                             r->z_translation = zItr->second;
                     }
 
-                    if ((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) {
+                    if ((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
                         lvr = r->build(manager->MinimalGeoFlag(), 1, vcutdef);
                     } else {
                         lvr = r->build(manager->MinimalGeoFlag());
@@ -931,11 +930,11 @@ namespace MuonGM {
 
                 bool dedCutoutFlag = (stname == "BOS" && std::abs(zi) == 6) || (stname == "BMS" && (std::abs(zi) == 2 || std::abs(zi) == 4 || std::abs(zi) == 6)) ||
                                      (stname == "BMS" && std::abs(zi) == 1 && fi == 3);
-                std::string key = stName + techname;
-                if (((manager->IncludeCutoutsFlag() && dedCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi >= 0) {
+                std::string key = std::string(stName) + techname;
+                if (((manager->IncludeCutoutsFlag() && dedCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3,"BOG") == 0)) && zi >= 0) {
                     key += "p" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0) + "_" +
                            buildString(vcutdef.size(), 0);
-                } else if (((manager->IncludeCutoutsFlag() && dedCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi < 0) {
+                } else if (((manager->IncludeCutoutsFlag() && dedCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi < 0) {
                     key += "m" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0) + "_" +
                            buildString(vcutdef.size(), 0);
                 }
@@ -946,7 +945,7 @@ namespace MuonGM {
                     Ded *r = new Ded(c);
                     if (verbose)
                         log << MSG::VERBOSE << " Building a DED for station " << key << " component name is " << c->name << endmsg;
-                    if ((manager->IncludeCutoutsFlag() && dedCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) {
+                    if ((manager->IncludeCutoutsFlag() && dedCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
                         lvd = r->build(1, vcutdef);
                     } else {
                         lvd = r->build();
@@ -968,10 +967,10 @@ namespace MuonGM {
                 double xpos = c->posx - SupComponent::yAMDB0(*c);
 
                 htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateY3D(xpos) * GeoTrf::TranslateZ3D(zpos);
-                std::string key = stName + techname;
-                if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi >= 0) {
+                std::string key = std::string(stName) + techname;
+                if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3,"BOG") == 0)) && zi >= 0) {
                     key += "p" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0);
-                } else if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.substr(0, 3) == "BOG")) && zi < 0) {
+                } else if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3,"BOG") == 0)) && zi < 0) {
                     key += "m" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0);
                 }
 
@@ -994,7 +993,7 @@ namespace MuonGM {
                 xfaligncomponent = new GeoAlignableTransform(htcomponent);
 
                 // Define key for this TGC component
-                std::string key = stName + techname;
+                std::string key = std::string(stName) + techname;
                 if (manager->IncludeCutoutsFlag()) {
                     if (mysql->allocPosFindCutout(statType, fi, zi) > 0) {
                         // If there is a cutout for this chamber, give it a special key
@@ -1013,7 +1012,7 @@ namespace MuonGM {
                 GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
                 if (fpv == 0) {
                     Tgc *t = new Tgc(c);
-                    t->setLogVolName(stName + techname);
+                    t->setLogVolName(std::string(stName) + techname);
                     if (manager->IncludeCutoutsFlag()) {
                         lvt = t->build(manager->MinimalGeoFlag(), 1, vcutdef);
                     } else {
@@ -1031,7 +1030,7 @@ namespace MuonGM {
                 htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateZ3D(zpos);
                 xfaligncomponent = new GeoAlignableTransform(htcomponent);
                 // Here define the key for this CSC component
-                std::string key = stName + techname;
+                std::string key = std::string(stName) + techname;
                 if (manager->IncludeCutoutsFlag() && zi >= 0) {
                     key += "p" + buildString(mysql->allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql->allocPosFindCutout(statType, fi, zi), 0);
                 } else if (manager->IncludeCutoutsFlag() && zi < 0) {
@@ -1041,7 +1040,7 @@ namespace MuonGM {
                 GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
                 if (fpv == 0) {
                     Csc *t = new Csc(c);
-                    t->setLogVolName(stName + techname);
+                    t->setLogVolName(std::string(stName) + techname);
 
                     if (manager->IncludeCutoutsFlag()) {
                         lvc = t->build(manager->MinimalGeoFlag(), 1, vcutdef);
@@ -1593,7 +1592,7 @@ namespace MuonGM {
         re->m_phistripwidth = re->m_phistrippitch - rc->stripSeparation;
         re->m_etastripwidth = re->m_etastrippitch - rc->stripSeparation;
         re->m_nphistripsperpanel = int((re->m_Ssize / re->m_nphistrippanels) / re->m_phistrippitch);
-        if (re->getStationName().substr(0, 3) != "BME")
+        if (re->getStationName().compare(0, 3, "BME") != 0)
             while ((re->m_nphistripsperpanel % 8) != 0) {
                 re->m_nphistripsperpanel--;
             }
@@ -1652,7 +1651,7 @@ namespace MuonGM {
         re->m_Zsize = cc->GetThickness();
         re->m_LongZsize = cc->GetThickness();
 
-        std::string tname = cc->name;
+        const std::string &tname = cc->name;
         int tname_index = MuonGM::strtoint(tname, 3, 2);
         re->setTechnologyName(tname);
 
@@ -1667,7 +1666,7 @@ namespace MuonGM {
         char index[2];
         sprintf(index, "%i", cc->index);
 
-        re->m_readout_name = stName.substr(0, 4) + "_" + index;
+        re->m_readout_name = stName.substr(0, 4) + '_' + index;
         re->m_readoutParams = mysql->GetTgcRPars(tname_index);
 
         if (re->m_readoutParams == 0) {
@@ -1714,8 +1713,8 @@ namespace MuonGM {
         log << MSG::INFO << "MuonChamber " << name << " :" << endmsg;
     }
 
-    int MuonChamber::stationPhiTGC(const std::string& stName, int fi, int zi_input, const std::string& geometry_version) const {
-        std::string stName3 = stName.substr(0, 3);
+    int MuonChamber::stationPhiTGC(std::string_view stName, int fi, int zi_input, std::string_view geometry_version) const {
+        std::string_view stName3 = stName.substr(0, 3);
         int stphi = 0;
 
         int zi = abs(zi_input);
diff --git a/MuonSpectrometer/MuonGeoModel/src/MuonSystemDescription.cxx b/MuonSpectrometer/MuonGeoModel/src/MuonSystemDescription.cxx
index b0f07b159f5f..6c38c4fa8ba3 100644
--- a/MuonSpectrometer/MuonGeoModel/src/MuonSystemDescription.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/MuonSystemDescription.cxx
@@ -10,8 +10,6 @@
 
 namespace MuonGM {
 
-    extern std::vector<std::string> tokenize(std::string);
-
     MuonSystemDescription::MuonSystemDescription(std::string n)
         : barrelInnerRadius(0.), innerRadius(0.), outerRadius(0.), endcapFrontFace(0.), length(0.), barreLength(0.), barrelInterRadius(0.), extraZ(0.), extraR(0.), m_name(std::move(n)) {}
 
diff --git a/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx b/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
index 92619a9d652d..85b8dcecb1f7 100644
--- a/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/RDBReaderAtlas.cxx
@@ -460,29 +460,29 @@ namespace MuonGM {
                 Component *c = station->GetComponent(ic);
                 if (c == NULL)
                     continue;
-                std::string cname = c->name;
+                const std::string &cname = c->name;
 
-                if (cname.substr(0, 3) == "CSC")
+                if (cname.compare(0, 3, "CSC") == 0)
                     MuonGM::ProcessCSC(m_dhwcsc, m_wcsc, cname);
-                else if (cname.substr(0, 3) == "MDT")
+                else if (cname.compare(0, 3, "MDT") == 0)
                     MuonGM::ProcessMDT(m_dhwmdt, m_wmdt, cname);
-                else if (cname.substr(0, 3) == "RPC")
+                else if (cname.compare(0, 3, "RPC") == 0)
                     MuonGM::ProcessRPC(m_dhwrpc, m_wrpc, m_dhwrpcall, m_wrpcall, cname);
-                else if (cname.substr(0, 3) == "TGC")
+                else if (cname.compare(0, 3, "TGC") == 0)
                     MuonGM::ProcessTGC(m_dhwtgc, m_wtgc, m_dhwtgcall, m_wtgcall, cname);
-                else if (cname.substr(0, 3) == "SPA")
+                else if (cname.compare(0, 3, "SPA") == 0)
                     MuonGM::ProcessSPA(m_dhwspa, m_wspa, cname);
-                else if (cname.substr(0, 3) == "DED")
+                else if (cname.compare(0, 3, "DED") == 0)
                     MuonGM::ProcessDED(m_dhwded, m_wded, cname);
-                else if (cname.substr(0, 3) == "SUP")
+                else if (cname.compare(0, 3, "SUP") == 0)
                     MuonGM::ProcessSUP(m_dhwsup, m_wsup, cname);
-                else if (cname.substr(0, 3) == "CHV" && have_spa_details)
+                else if (cname.compare(0, 3, "CHV") == 0 && have_spa_details)
                     MuonGM::ProcessCHV(m_dhwchv, m_wchv, cname);
-                else if (cname.substr(0, 3) == "CRO" && have_spa_details)
+                else if (cname.compare(0, 3, "CRO") == 0 && have_spa_details)
                     MuonGM::ProcessCRO(m_dhwcro, m_wcro, cname);
-                else if (cname.substr(0, 3) == "CMI" && have_spa_details)
+                else if (cname.compare(0, 3, "CMI") == 0 && have_spa_details)
                     MuonGM::ProcessCMI(m_dhwcmi, m_wcmi, cname);
-                else if (cname.substr(0, 2) == "LB" && have_spa_details)
+                else if (cname.compare(0, 2, "LB") == 0 && have_spa_details)
                     MuonGM::ProcessLBI(m_dhwlbi, m_wlbi, cname);
             }
         }
@@ -520,9 +520,8 @@ namespace MuonGM {
                     std::vector<float> iwgs1(180), iwgs2(180), iwgs3(180);
 
                     for (int i = 0; i < 3; i++) {
-                        std::ostringstream Astr;
-                        Astr << "_" << i;
-                        std::string A = Astr.str();
+                        std::string A("_");
+                        A+= std::to_string(i);
                         nwgs.push_back((*ggcd)[ich]->getDouble("NWGS" + A));
                         roffst.push_back((*ggcd)[ich]->getDouble("ROFFST" + A));
                         poffst.push_back((*ggcd)[ich]->getDouble("POFFST" + A));
@@ -530,24 +529,21 @@ namespace MuonGM {
                     }
 
                     for (int i = 0; i < nwgs[0]; i++) {
-                        std::ostringstream Astr;
-                        Astr << "_" << i;
-                        std::string A = Astr.str();
+                        std::string A("_");
+                        A+= std::to_string(i);
                         // float xxx = (*ggcd)[ich]->getDouble("IWGS1"+A);
                         iwgs1[i] = (float)(*ggcd)[ich]->getDouble("IWGS1" + A);
                     }
 
                     for (int i = 0; i < nwgs[1]; i++) {
-                        std::ostringstream Astr;
-                        Astr << "_" << i;
-                        std::string A = Astr.str();
+                        std::string A("_");
+                        A+= std::to_string(i);
                         iwgs2[i] = (float)(*ggcd)[ich]->getDouble("IWGS2" + A);
                     }
 
                     for (int i = 0; i < nwgs[2]; i++) {
-                        std::ostringstream Astr;
-                        Astr << "_" << i;
-                        std::string A = Astr.str();
+                        std::string A("_");
+                        A+= std::to_string(i);
                         iwgs3[i] = (float)(*ggcd)[ich]->getDouble("IWGS3" + A);
                     }
 
@@ -597,9 +593,8 @@ namespace MuonGM {
                 std::vector<float> iwgs1(130), iwgs2(130), iwgs3(130), slarge(33), sshort(33);
 
                 for (int i = 0; i < 3; i++) {
-                    std::ostringstream Astr;
-                    Astr << "_" << i;
-                    std::string A = Astr.str();
+                    std::string A("_");
+                    A+= std::to_string(i);
                     nwgs.push_back((*ggln)[ich]->getInt("NWGS" + A));
                     roffst.push_back((*ggln)[ich]->getInt("ROFFST" + A));
                     // poffst.push_back((*ggln)[ich]->getInt("POFFST"+A));
@@ -608,24 +603,21 @@ namespace MuonGM {
                 }
 
                 for (int i = 0; i < nwgs[0]; i++) {
-                    std::ostringstream Astr;
-                    Astr << "_" << i;
-                    std::string A = Astr.str();
+                    std::string A("_");
+                    A+= std::to_string(i);
                     // float xxx = (*ggln)[ich]->getInt("IWGS1"+A);
                     iwgs1[i] = (float)(*ggln)[ich]->getInt("IWGS1" + A);
                 }
 
                 for (int i = 0; i < nwgs[1]; i++) {
-                    std::ostringstream Astr;
-                    Astr << "_" << i;
-                    std::string A = Astr.str();
+                    std::string A("_");
+                    A+= std::to_string(i);
                     iwgs2[i] = (float)(*ggln)[ich]->getInt("IWGS2" + A);
                 }
 
                 for (int i = 0; i < nwgs[2]; i++) {
-                    std::ostringstream Astr;
-                    Astr << "_" << i;
-                    std::string A = Astr.str();
+                    std::string A("_");
+                    A+= std::to_string(i);
                     iwgs3[i] = (float)(*ggln)[ich]->getInt("IWGS3" + A);
                 }
 
@@ -633,9 +625,8 @@ namespace MuonGM {
                 float pdist = (*ggln)[ich]->getFloat("PDIST");
 
                 for (int i = 0; i < nsps[0] + 1; i++) {
-                    std::ostringstream Astr;
-                    Astr << "_" << i;
-                    std::string A = Astr.str();
+                    std::string A("_");
+                    A+= std::to_string(i);
                     slarge[i] = (float)(*ggln)[ich]->getFloat("SLARGE" + A);
                     sshort[i] = (float)(*ggln)[ich]->getFloat("SHORT" + A);
                 }
diff --git a/MuonSpectrometer/MuonGeoModel/src/Rpc.cxx b/MuonSpectrometer/MuonGeoModel/src/Rpc.cxx
index 3e72f1eca58b..cedf09fefe12 100644
--- a/MuonSpectrometer/MuonGeoModel/src/Rpc.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/Rpc.cxx
@@ -113,7 +113,7 @@ namespace MuonGM {
         if (minimalgeo == 1)
             return prpc;
 
-        if (geometry_version.substr(0, 1) != "M") {
+        if (geometry_version.compare(0, 1,"M") != 0) {
             // here layout P and following (hopefully!)
             if (idiv * jdiv != 1)
                 assert(0);
diff --git a/MuonSpectrometer/MuonGeoModel/src/SpacerBeam.cxx b/MuonSpectrometer/MuonGeoModel/src/SpacerBeam.cxx
index ea3f404ede02..177041ec9f4d 100644
--- a/MuonSpectrometer/MuonGeoModel/src/SpacerBeam.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/SpacerBeam.cxx
@@ -26,7 +26,7 @@ namespace MuonGM {
 
     SpacerBeam::SpacerBeam(Component *ss) : DetectorElement(ss->name), m_hole_pos1(0), m_hole_pos2(0), m_lb_height(0), m_lb_width(0), m_cross_excent(0) {
         StandardComponent *s = (StandardComponent *)ss;
-        std::string componentType = (s->name).substr(0, 3);
+        std::string_view componentType = std::string_view(s->name).substr(0, 3);
 
         double tol = 1.e-4;
 
@@ -84,11 +84,11 @@ namespace MuonGM {
         GeoPhysVol *pvol = 0;
         GeoLogVol *lvol = 0;
         const GeoMaterial *mat = getMaterialManager()->getMaterial("std::Aluminium");
-        if (name.substr(0, 3) == "CHV" || name.substr(0, 3) == "CRO" || name.substr(0, 3) == "CMI") {
+        if (name.compare(0, 3, "CHV") == 0 || name.compare(0, 3, "CRO") == 0 || name.compare(0, 3, "CMI") == 0) {
             double sinexc = 0.;
             double cosexc = 1.;
             double volumelargeness = largeness;
-            if ((name.substr(0, 3) == "CHV" || name.substr(0, 3) == "CRO") && !is_barrel) {
+            if ((name.compare(0, 3, "CHV") == 0 || name.compare(0, 3, "CRO") == 0) && !is_barrel) {
                 double ltemp = std::sqrt(length * length + excent * excent);
                 sinexc = std::abs(excent) / ltemp;
                 cosexc = length / ltemp;
@@ -121,7 +121,7 @@ namespace MuonGM {
             }
             return pvol;
 
-        } else if (name.substr(0, 2) == "LB") {
+        } else if (name.compare(0, 2, "LB") == 0) {
             const GeoShape *LBbox = new GeoBox(height / 2., (width - length / 4.) / 2., length / 2.);
             // (width - length/4) is temporary until excent parameter is put into LbiComponent
             GeoBox *innerBox = new GeoBox(height / 2. - thickness, width / 2. + 1., length / 2. - lowerThickness);
diff --git a/MuonSpectrometer/MuonGeoModel/src/StandardComponent.cxx b/MuonSpectrometer/MuonGeoModel/src/StandardComponent.cxx
index ced156aa4f0c..32e933c80307 100644
--- a/MuonSpectrometer/MuonGeoModel/src/StandardComponent.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/StandardComponent.cxx
@@ -68,16 +68,16 @@ namespace MuonGM {
         MYSQL *mysql = MYSQL::GetPointer();
         Technology *tec = mysql->GetTechnology(name);
 
-        if (name.substr(0, 3) == "CHV") {
+        if (name.compare(0, 3,"CHV") == 0) {
             CHV *chv = (CHV *)tec;
             return chv->height;
-        } else if (name.substr(0, 3) == "CRO") {
+        } else if (name.compare(0, 3,"CRO") == 0) {
             CRO *chv = (CRO *)tec;
             return chv->height;
-        } else if (name.substr(0, 3) == "CMI") {
+        } else if (name.compare(0, 3,"CMI") == 0) {
             CMI *chv = (CMI *)tec;
             return chv->height;
-        } else if (name.substr(0, 3) == "LBI" || name.substr(0, 2) == "LB") {
+        } else if (name.compare(0, 3,"LBI") == 0 || name.compare(0, 2,"LB") == 0) {
             LBI *chv = (LBI *)tec;
             return chv->height;
         }
diff --git a/MuonSpectrometer/MuonGeoModel/src/Station.cxx b/MuonSpectrometer/MuonGeoModel/src/Station.cxx
index bda7b6f53fff..5e7c09771345 100644
--- a/MuonSpectrometer/MuonGeoModel/src/Station.cxx
+++ b/MuonSpectrometer/MuonGeoModel/src/Station.cxx
@@ -317,10 +317,10 @@ namespace MuonGM {
         double ymin = getYMin();
         double w = 0;
         for (unsigned int i = 0; i < m_components.size(); i++) {
-            std::string n = m_components[i]->name.substr(0, 3);
+            std::string_view n = std::string_view(m_components[i]->name).substr(0, 3);
             if (n == "TGC") {
                 double dw = 20.;
-                std::string typetgc = m_components[i]->name.substr(3, 2);
+                std::string_view typetgc = std::string_view(m_components[i]->name).substr(3, 2);
                 // in case of station containing one module
                 if (typetgc == "01" || typetgc == "06" || typetgc == "12" || typetgc == "18" || typetgc == "19" || typetgc == "20" || typetgc == "21") {
                     dw = 0.;
@@ -366,10 +366,10 @@ namespace MuonGM {
                 w = m_components[i]->dx2;
             }
 
-            std::string n = m_components[i]->name.substr(0, 3);
+            std::string_view n = std::string_view(m_components[i]->name).substr(0, 3);
             if (n == "TGC") {
                 double dw = 20.;
-                std::string typetgc = m_components[i]->name.substr(3, 2);
+                std::string_view typetgc = std::string_view(m_components[i]->name).substr(3, 2);
                 // in case of one station containing one module
                 if (typetgc == "01" || typetgc == "06" || typetgc == "12" || typetgc == "18" || typetgc == "19" || typetgc == "20" || typetgc == "21") {
                     dw = 0.;
@@ -391,7 +391,7 @@ namespace MuonGM {
             }
         }
 
-        if (m_name.substr(0, 1) == "T")
+        if (m_name.compare(0, 1, "T") == 0)
             return w;
         else
             return maxdxmax;
@@ -428,7 +428,7 @@ namespace MuonGM {
 
             for (int icomp = 0; icomp < GetNrOfComponents(); ++icomp) {
                 const Component *c = GetComponent(icomp);
-                if (c->name.substr(0, 3) != "MDT")
+                if (c->name.compare(0, 3, "MDT") != 0)
                     continue;
                 MDT *mdtobj = (MDT *)mysql->GetATechnology(c->name);
                 if (!mdtobj) {
diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h
index cd343607fee6..95a0910b4391 100644
--- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h
+++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h
@@ -83,7 +83,7 @@ public:
     // Identifier builders
 
     Identifier elementID(int stationName, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
-    Identifier elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
+    Identifier elementID(std::string_view stationNameStr, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
     Identifier elementID(const Identifier& channelID) const;
     Identifier channelID(int stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip,
                          bool check = false, bool* isValid = 0) const;
diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MmIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MmIdHelper.h
index 63301a412d16..884458337102 100644
--- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MmIdHelper.h
+++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MmIdHelper.h
@@ -70,7 +70,7 @@ public:
 
     // Identifier builders
     Identifier elementID(int stationName, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
-    Identifier elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
+    Identifier elementID(std::string_view stationNameStr, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
     Identifier elementID(const Identifier& channelID) const;
 
     Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel, bool check = false,
diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h
index 0dfd2963c1d7..bde41c06ea84 100644
--- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h
+++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h
@@ -125,7 +125,7 @@ public:
 
     // Access to name and technology maps
 
-    int stationNameIndex(const std::string& name) const;
+    int stationNameIndex(std::string_view name) const;
     int technologyIndex(const std::string& name) const;
     const std::string& stationNameString(const int& index) const;
     const std::string& technologyString(const int& index) const;
diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/TgcIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/TgcIdHelper.h
index 837cbeabf4ec..71ee04c0baa3 100644
--- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/TgcIdHelper.h
+++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/TgcIdHelper.h
@@ -69,11 +69,11 @@ public:
     // Identifier builders
 
     Identifier elementID(int stationName, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
-    Identifier elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
+    Identifier elementID(std::string_view stationNameStr, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
     Identifier elementID(const Identifier& channelID) const;
     Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel, bool check = false,
                          bool* isValid = 0) const;
-    Identifier channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int gasGap, int isStrip, int channel,
+    Identifier channelID(std::string_view stationNameStr, int stationEta, int stationPhi, int gasGap, int isStrip, int channel,
                          bool check = false, bool* isValid = 0) const;
     Identifier channelID(const Identifier& id, int gasGap, int isStrip, int channel, bool check = false, bool* isValid = 0) const;
 
diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/sTgcIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/sTgcIdHelper.h
index 5b53afda513b..feda8faaf258 100644
--- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/sTgcIdHelper.h
+++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/sTgcIdHelper.h
@@ -72,7 +72,7 @@ public:
 
     // Identifier builders
     Identifier elementID(int stationName, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
-    Identifier elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
+    Identifier elementID(std::string_view stationNameStr, int stationEta, int stationPhi, bool check = false, bool* isValid = 0) const;
     Identifier elementID(const Identifier& channelID) const;
 
     Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel,
diff --git a/MuonSpectrometer/MuonIdHelpers/src/CscIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/CscIdHelper.cxx
index ecce2660248c..4bd0ff75e389 100644
--- a/MuonSpectrometer/MuonIdHelpers/src/CscIdHelper.cxx
+++ b/MuonSpectrometer/MuonIdHelpers/src/CscIdHelper.cxx
@@ -916,7 +916,7 @@ Identifier CscIdHelper::elementID(int stationName, int stationEta, int stationPh
     return result;
 }
 
-Identifier CscIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const {
+Identifier CscIdHelper::elementID(std::string_view stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const {
     Identifier id;
     int stationName = stationNameIndex(stationNameStr);
     id = elementID(stationName, stationEta, stationPhi, check, isValid);
diff --git a/MuonSpectrometer/MuonIdHelpers/src/MmIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/MmIdHelper.cxx
index a7a38c7d4ec4..d2479a2610f0 100644
--- a/MuonSpectrometer/MuonIdHelpers/src/MmIdHelper.cxx
+++ b/MuonSpectrometer/MuonIdHelpers/src/MmIdHelper.cxx
@@ -700,7 +700,7 @@ Identifier MmIdHelper::elementID(int stationName, int stationEta, int stationPhi
     return result;
 }
 /*******************************************************************************/
-Identifier MmIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const {
+Identifier MmIdHelper::elementID(std::string_view stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const {
     Identifier id;
     int stationName = stationNameIndex(stationNameStr);
     id = elementID(stationName, stationEta, stationPhi, check, isValid);
diff --git a/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx
index 85a45889ba1b..d8bb06dbd33a 100644
--- a/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx
+++ b/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx
@@ -968,7 +968,7 @@ bool MuonIdHelper::isForward(const int& stationNameIndex) const { return (m_isFo
 bool MuonIdHelper::isSmall(const int& stationNameIndex) const { return (m_isSmall.count(stationNameIndex) == 1); }
 /*******************************************************************************/
 // Access to name and technology maps
-int MuonIdHelper::stationNameIndex(const std::string& name) const {
+int MuonIdHelper::stationNameIndex(std::string_view name) const {
     int counter = 0;
     for (const std::string& station_name : m_stationNameVector) {
         if (name.compare(station_name) == 0) { return counter; }
diff --git a/MuonSpectrometer/MuonIdHelpers/src/TgcIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/TgcIdHelper.cxx
index aa935203b7cd..6da1e63f8997 100644
--- a/MuonSpectrometer/MuonIdHelpers/src/TgcIdHelper.cxx
+++ b/MuonSpectrometer/MuonIdHelpers/src/TgcIdHelper.cxx
@@ -624,7 +624,7 @@ Identifier TgcIdHelper::elementID(int stationName, int stationEta, int stationPh
     return result;
 }
 
-Identifier TgcIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const {
+Identifier TgcIdHelper::elementID( std::string_view stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const {
     Identifier id;
     int stationName = stationNameIndex(stationNameStr);
     id = elementID(stationName, stationEta, stationPhi, check, isValid);
@@ -653,7 +653,7 @@ Identifier TgcIdHelper::channelID(int stationName, int stationEta, int stationPh
     return result;
 }
 
-Identifier TgcIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int gasGap, int isStrip, int channel,
+Identifier TgcIdHelper::channelID(std::string_view stationNameStr, int stationEta, int stationPhi, int gasGap, int isStrip, int channel,
                                   bool check, bool* isValid) const {
     Identifier id;
     int stationName = stationNameIndex(stationNameStr);
diff --git a/MuonSpectrometer/MuonIdHelpers/src/sTgcIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/sTgcIdHelper.cxx
index 79e4a081cef8..e8f71e7e27b8 100644
--- a/MuonSpectrometer/MuonIdHelpers/src/sTgcIdHelper.cxx
+++ b/MuonSpectrometer/MuonIdHelpers/src/sTgcIdHelper.cxx
@@ -891,7 +891,7 @@ Identifier sTgcIdHelper::elementID(int stationName, int stationEta, int stationP
     return result;
 }
 /*******************************************************************************/
-Identifier sTgcIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const {
+Identifier sTgcIdHelper::elementID(std::string_view stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const {
     Identifier id;
     int stationName = stationNameIndex(stationNameStr);
     id = elementID(stationName, stationEta, stationPhi, check, isValid);
diff --git a/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.cxx b/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.cxx
index 1112de6087fb..51af0c9363a5 100644
--- a/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.cxx
+++ b/MuonSpectrometer/MuonTruthAlgs/src/MuonSegmentTruthAssociationAlg.cxx
@@ -67,11 +67,11 @@ namespace Muon {
             return StatusCode::SUCCESS;
         }
 
-        std::string truthSegmentContainerName = m_muonTruthSegmentContainerName.key();
-        int ppos = truthSegmentContainerName.find(".");
+        std::string truthSegmentContainerName (m_muonTruthSegmentContainerName.key());
+        int ppos = truthSegmentContainerName.find('.');
         truthSegmentContainerName = truthSegmentContainerName.substr(0, ppos);
-        std::string segmentCollectionName = m_muonSegmentCollectionName.key();
-        ppos = segmentCollectionName.find(".");
+        std::string segmentCollectionName( m_muonSegmentCollectionName.key());
+        ppos = segmentCollectionName.find('.');
         segmentCollectionName = segmentCollectionName.substr(0, ppos);
 
         std::vector<const Muon::MuonSegment*> muonSegments;
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MDTChamber.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MDTChamber.h
index e9dbdd103a08..e1f33e468b8f 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MDTChamber.h
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MDTChamber.h
@@ -22,7 +22,7 @@ class TH2F; // no TH2Fs are ever allocated by this class or owned
 class MDTChamber {
 
  public:
-  MDTChamber( std::string name );
+  MDTChamber( std::string_view name );
   ~MDTChamber();
 
   TH1F_LW* mdttdc;
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonAlg.h
index e15da23f102e..adaf973d5977 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonAlg.h
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonAlg.h
@@ -134,21 +134,21 @@ class MdtRawDataMonAlg: public AthMonitorAlgorithm {
   //MDTRawDataUtils_cxx
   bool AinB( int A, std::vector<int> & B ) const;
   virtual StatusCode  binMdtGlobal( TH2*, char ecap );
-  virtual StatusCode  binMdtRegional( TH2*, std::string &xAxis );
+  virtual StatusCode  binMdtRegional( TH2*, std::string_view xAxis );
   virtual StatusCode  binMdtGlobal_byLayer( TH2*, TH2*, TH2*);
   virtual StatusCode binMdtOccVsLB(TH2* &h, int region, int layer);
   virtual StatusCode binMdtOccVsLB_Crate(TH2* &h, int region, int crate);
-  void ChamberTubeNumberCorrection(int & tubeNum, const std::string & hardware_name, int tubePos, int numLayers) const;
+  void ChamberTubeNumberCorrection(int & tubeNum, std::string_view hardware_name, int tubePos, int numLayers) const;
   void CorrectTubeMax(const std::string & hardware_name, int & numTubes) const;
   void CorrectLayerMax(const std::string & hardware_name, int & numLayers) const;
   virtual StatusCode  fillMDTMaskedTubes(IdentifierHash, const std::string &, TH1F_LW*& h);//DEV not used at moment, should be revised
   int get_bin_for_LB_hist(int region, int layer, int phi, int eta, bool isBIM) const;
-  int get_bin_for_LB_crate_hist(int region, int layer, int phi, int eta, std::string chamber) const;
+  int get_bin_for_LB_crate_hist(int region, int layer, int phi, int eta, std::string_view chamber) const;
   // private function to initialize the selection of a certain region
   void mdtchamberId();    
   //private function to find mdt mezz cards
   int mezzmdt(Identifier) const;
-  int GetTubeMax(const Identifier & digcoll_id, const std::string & hardware_name);
+  int GetTubeMax(const Identifier & digcoll_id, std::string_view hardware_name);
 
   inline int cachedTubeMax(const Identifier& digcoll_id) const { return m_tubemax_map.at(digcoll_id.get_compact() & s_detectorElementMask); };
   inline int cachedTubeLayerMax(const Identifier& digcoll_id) const { return m_tubelayermax_map.at(digcoll_id.get_compact() & s_detectorElementMask); };
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h
index e7fa452cfbf5..45e31cd92e18 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataMonitoring/MdtRawDataValAlg.h
@@ -133,12 +133,12 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase {
 
   bool AinB( int A, std::vector<int> & B );
   virtual StatusCode  binMdtGlobal( TH2*, char ecap );
-  virtual StatusCode  binMdtRegional( TH2*, std::string &xAxis );
+  virtual StatusCode  binMdtRegional( TH2*, std::string_view xAxis );
   virtual StatusCode  binMdtGlobal_byLayer( TH2*, TH2*, TH2*);
   virtual StatusCode binMdtOccVsLB(TH2* &h, int region, int layer);
   virtual StatusCode binMdtOccVsLB_Crate(TH2* &h, int region, int crate);
-  void TubeID_to_ID_L_ML(int & tubeID, const std::string & hardware_name, int & tube, int & layer, int & ML, int max);
-  void ChamberTubeNumberCorrection(int & tubeNum, const std::string & hardware_name, int tubePos, int numLayers);
+  void TubeID_to_ID_L_ML(int & tubeID, std::string_view hardware_name, int & tube, int & layer, int & ML, int max);
+  void ChamberTubeNumberCorrection(int & tubeNum, std::string_view hardware_name, int tubePos, int numLayers);
   void CorrectTubeMax(const std::string & hardware_name, int & numTubes);
   void CorrectLayerMax(const std::string & hardware_name, int & numLayers);
   virtual StatusCode  bookMDTHisto_overview( TH1*&, TString, TString, TString, int, float, float, MonGroup&);
@@ -150,12 +150,12 @@ class MdtRawDataValAlg: public ManagedMonitorToolBase {
   void putBox(TH2* h, float x1, float y1, float x2, float y2);
   void putLine(TH2* h, float x1, float y1, float x2, float y2, Color_t c=kBlack);
   int get_bin_for_LB_hist(int region, int layer, int phi, int eta, bool isBIM);
-  int get_bin_for_LB_crate_hist(int region, int layer, int phi, int eta, std::string chamber);
+  int get_bin_for_LB_crate_hist(int region, int layer, int phi, int eta, std::string_view chamber);
   // private function to initialize the selection of a certain region
   void mdtchamberId();    
   //private function to find mdt mezz cards
   int mezzmdt(Identifier);
-  int GetTubeMax(const Identifier & digcoll_id, const std::string & hardware_name);
+  int GetTubeMax(const Identifier & digcoll_id,  std::string_view  hardware_name);
   StatusCode StoreTriggerType();
   void StoreTriggerType(int type);
   int GetTriggerType() { return m_trigtype; }
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTChamber.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTChamber.cxx
index 5483c7241f0c..d020e089d3db 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTChamber.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTChamber.cxx
@@ -13,7 +13,7 @@
 #include <cmath>
 #include <iostream>
 
-MDTChamber::MDTChamber(std::string name) :
+MDTChamber::MDTChamber(std::string_view name) :
   mdttdc(0),
   mdttdccut_ML1(0),
   mdttdccut_ML2(0),
@@ -41,7 +41,7 @@ MDTChamber::MDTChamber(std::string name) :
   mdt_DRvsSegD(0),
   mdttubenoise(0),
   mdttdctube(0),
-  m_hardware_name(name),
+  m_hardware_name(std::string(name)),
   m_mdthitsperchamber_InnerMiddleOuterLumi_bin(0),
   m_mdthitsperchamber_InnerMiddleOuterLumi_binx(0),
   m_mdthitsperchamber_InnerMiddleOuterLumi_biny(0),
@@ -93,15 +93,15 @@ MDTChamber::MDTChamber(std::string name) :
     ss.clear();
     
     //set m_station_phi
-    std::string statphi_s(name.substr(5,2));
+    std::string_view statphi_s(name.substr(5,2));
     ss << statphi_s;
     ss >> m_station_phi;
     m_station_phi--;
     ss.clear();
-
+  std::string_view name_v(m_hardware_name);
   //First there were only BMF1,2,3, then BMGs were added which are between the BMFs, so doing the eta-station assignment by hand.
-  if( m_hardware_name.substr(0, 4) == "BMF2") m_station_eta = 3; 
-  if( m_hardware_name.substr(0, 4) == "BMF3") m_station_eta = 5; 
+  if( name_v.substr(0, 4) == "BMF2") m_station_eta = 3; 
+  if( name_v.substr(0, 4) == "BMF3") m_station_eta = 5; 
     
     //station_phi is used as an iterator, and is thus 1 less than its value (since it always starts at 01, not 00).
 
@@ -163,38 +163,45 @@ MDTChamber::~MDTChamber(){}
 void MDTChamber::SetMDTHitsPerChamber_IMO_Bin(TH2F* h){
   //Plots BEE Chambers at the edge BIS plots, and EES/EEL on EIS/EIL plots
   //EIL goes up to EIL5 in hardware name but in reality there are only 4 eta stations!
+  std::string_view name_v(m_hardware_name);
+  std::string_view station_eta_s = name_v.substr(3,1);
+  std::string_view statphi_s = name_v.substr(5,2);
+  if(name_v.substr(0,4)=="BMF2") station_eta_s = "3";
+  if(name_v.substr(0,4)=="BMF3") station_eta_s = "5";
 
-  std::string station_eta_s = m_hardware_name.substr(3,1);
-  std::string statphi_s = m_hardware_name.substr(5,2);
-  if(m_hardware_name.substr(0,4)=="BMF2") station_eta_s = "3";
-  if(m_hardware_name.substr(0,4)=="BMF3") station_eta_s = "5";
+  std::string ecap_layer_IMO = std::string(name_v.substr(0,1));
+  ecap_layer_IMO += name_v.substr(4,1);
+  ecap_layer_IMO += station_eta_s;
 
-  std::string ecap_layer_IMO = m_hardware_name.substr(0,1) + m_hardware_name.substr(4,1) + station_eta_s;
   if( m_station_phi == 12 && (m_station_eta == 4 || m_station_eta == 5) ) {//m_station_phi+1==actual phi station
-    if(m_hardware_name == "BML4A13") ecap_layer_IMO = "BA5";
-    if(m_hardware_name == "BML5A13") ecap_layer_IMO = "BA6";
-    if(m_hardware_name == "BML4C13") ecap_layer_IMO = "BC5";
-    if(m_hardware_name == "BML5C13") ecap_layer_IMO = "BC6";
+    if(name_v == "BML4A13") ecap_layer_IMO = "BA5";
+    if(name_v == "BML5A13") ecap_layer_IMO = "BA6";
+    if(name_v == "BML4C13") ecap_layer_IMO = "BC5";
+    if(name_v == "BML5C13") ecap_layer_IMO = "BC6";
   }
 
-  if(m_hardware_name == "BME1A14" || m_hardware_name == "BME1A13" ){ //protect against future fix in mdt helper
+  if(name_v == "BME1A14" || name_v == "BME1A13" ){ //protect against future fix in mdt helper
 	  ecap_layer_IMO = "BA4";
 	  statphi_s = "13";
   }
-  if(m_hardware_name == "BME1C14" || m_hardware_name == "BME1C13"){
+  if(name_v == "BME1C14" || name_v == "BME1C13"){
 	  ecap_layer_IMO = "BC4";
 	  statphi_s = "13";
   }
   //First there were only BMF1,2,3, then BMGs were added which are between the BMFs, so doing the ecap-layer assignment by hand.
-  if( m_hardware_name.substr(0, 5) == "BMF2A") ecap_layer_IMO  = "BA3";
-  if( m_hardware_name.substr(0, 5) == "BMF3A") ecap_layer_IMO  = "BA5";
-  if( m_hardware_name.substr(0, 5) == "BMF2C") ecap_layer_IMO = "BC3";
-  if( m_hardware_name.substr(0, 5) == "BMF3C") ecap_layer_IMO = "BC5";
-
-  std::string statphi_IMO_s = m_hardware_name.substr(1,1)+","+statphi_s;
+  if( name_v.substr(0, 5) == "BMF2A") ecap_layer_IMO  = "BA3";
+  if( name_v.substr(0, 5) == "BMF3A") ecap_layer_IMO  = "BA5";
+  if( name_v.substr(0, 5) == "BMF2C") ecap_layer_IMO = "BC3";
+  if( name_v.substr(0, 5) == "BMF3C") ecap_layer_IMO = "BC5";
+
+  std::string statphi_IMO_s = std::string(name_v.substr(1,1));
+  statphi_IMO_s+=',';
+  statphi_IMO_s+=statphi_s;
   //Separate pesky BIR/BIM 11,15
-  if(m_hardware_name.substr(0,3)=="BIR" || m_hardware_name.substr(0,3)=="BIM")
-    statphi_IMO_s = statphi_IMO_s+","+m_hardware_name.at(2);  
+  if(name_v.substr(0,3)=="BIR" || name_v.substr(0,3)=="BIM"){
+    statphi_IMO_s += ',';
+    statphi_IMO_s += name_v.at(2);
+  }
 
   int binx = h->GetXaxis()->FindBin( ecap_layer_IMO.c_str() );
   int biny = h->GetYaxis()->FindBin( statphi_IMO_s.c_str() );
@@ -209,7 +216,7 @@ void MDTChamber::SetMDTHitsPerML_byLayer_Bins(TH2F* h_mdthitspermultilayerLumi,
   std::string statphi_s = m_hardware_name.substr(5,2);
 
   if(m_hardware_name == "BME1A14" || m_hardware_name == "BME1C14") statphi_s = "13";
-
+  std::string_view name_v(m_hardware_name);
   std::string statphi_ml1_s = statphi_s+",1";
   std::string statphi_ml2_s = statphi_s+",2";
 
@@ -220,8 +227,8 @@ void MDTChamber::SetMDTHitsPerML_byLayer_Bins(TH2F* h_mdthitspermultilayerLumi,
   }
 
   std::string stateta_s = m_hardware_name.substr(3,1);
-  if(m_hardware_name.substr(0,4)=="BMF2") stateta_s = "3";
-  if(m_hardware_name.substr(0,4)=="BMF3") stateta_s = "5";
+  if(name_v.substr(0,4)=="BMF2") stateta_s = "3";
+  if(name_v.substr(0,4)=="BMF3") stateta_s = "5";
   std::string ecap_layer = m_hardware_name.substr(0,2) + m_hardware_name.at(4) + stateta_s;
   
   if( m_station_phi == 12 && (m_station_eta == 4 || m_station_eta == 5) ) {//m_station_phi+1==actual phi station
@@ -238,10 +245,10 @@ void MDTChamber::SetMDTHitsPerML_byLayer_Bins(TH2F* h_mdthitspermultilayerLumi,
     }
   
   // Setting BMF by hand because of irregular naming convention. BMF and BMG chambers alternate; historical BMF naming is BMF1,2,3 but BMG it is 2,4,6  
-  if( m_hardware_name.substr(0, 5) == "BMF2A") ecap_layer = "BMA3";
-  if( m_hardware_name.substr(0, 5) == "BMF3A") ecap_layer = "BMA5";
-  if( m_hardware_name.substr(0, 5) == "BMF2C") ecap_layer = "BMC3";
-  if( m_hardware_name.substr(0, 5) == "BMF3C") ecap_layer = "BMC5";
+  if( name_v.substr(0, 5) == "BMF2A") ecap_layer = "BMA3";
+  if( name_v.substr(0, 5) == "BMF3A") ecap_layer = "BMA5";
+  if( name_v.substr(0, 5) == "BMF2C") ecap_layer = "BMC3";
+  if( name_v.substr(0, 5) == "BMF3C") ecap_layer = "BMC5";
 
   int binx = h_mdthitspermultilayerLumi->GetXaxis()->FindBin(ecap_layer.c_str());
   int biny_m1 = h_mdthitspermultilayerLumi->GetYaxis()->FindBin(statphi_ml1_s.c_str());
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx
index 3faa6e3c0e0f..01a6acec879b 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtils.cxx
@@ -220,7 +220,7 @@ StatusCode MdtRawDataValAlg::binMdtGlobal( TH2* h, char ecap ) {
   return StatusCode::SUCCESS;
 } 
 
-StatusCode  MdtRawDataValAlg::binMdtRegional( TH2* h, string &xAxis ) {
+StatusCode  MdtRawDataValAlg::binMdtRegional( TH2* h, std::string_view xAxis ) {
   
   ///SET Ghost Entries
   int LowerEta=-0;
@@ -565,7 +565,7 @@ StatusCode  MdtRawDataValAlg::binMdtGlobal_byLayer( TH2* nHits_In, TH2* nHits_Mi
 
 }
 
-void MdtRawDataValAlg::TubeID_to_ID_L_ML(int & tubeID, const std::string & hardware_name, int & derived_tube, int & derived_layer, int & derived_ML, int totalTubes) {
+void MdtRawDataValAlg::TubeID_to_ID_L_ML(int & tubeID, std::string_view hardware_name, int & derived_tube, int & derived_layer, int & derived_ML, int totalTubes) {
   derived_tube = 1;
   derived_layer = 1;
   derived_ML = 1;
@@ -621,7 +621,7 @@ void MdtRawDataValAlg::TubeID_to_ID_L_ML(int & tubeID, const std::string & hardw
 }
 
 //Correct for CutOuts
-void MdtRawDataValAlg::ChamberTubeNumberCorrection(int & tubeNum, const std::string & hardware_name, int tubePos, int numLayers) {
+void MdtRawDataValAlg::ChamberTubeNumberCorrection(int & tubeNum, std::string_view hardware_name, int tubePos, int numLayers) {
   //numLayers should be mdt_layer-1 so numLayers = 0 implies layer 1 ML 1 or mdt_layer==1
   if(hardware_name.substr(0,4)=="BMS4" || hardware_name.substr(0,4)=="BMS6"){//layer 1-4 tubeId 41-48 cut out
     if( numLayers <= 2 ) tubeNum = tubePos + numLayers * 48;
@@ -784,7 +784,7 @@ int MdtRawDataValAlg::mezzmdt(Identifier digcoll_id) { //int mezz_chamber, int m
 // Get the Maximum # of tubes in the chamber
 // the 'if' statements are for chambers with ML1 != ML2
 // except for BIS8 -- mdtIdHelper gets the # layers wrong in this instance
-int MdtRawDataValAlg::GetTubeMax( const Identifier & digcoll_id, const std::string & hardware_name ) {
+int MdtRawDataValAlg::GetTubeMax( const Identifier & digcoll_id, std::string_view hardware_name ) {
   int numtubes = m_idHelperSvc->mdtIdHelper().tubeMax(digcoll_id);
   int numlayers = m_idHelperSvc->mdtIdHelper().tubeLayerMax(digcoll_id);
   int numML = m_idHelperSvc->mdtIdHelper().numberOfMultilayers(digcoll_id);
@@ -811,10 +811,10 @@ int MdtRawDataValAlg::GetTubeMax( const Identifier & digcoll_id, const std::stri
   if( hardware_name.substr(0,3) == "BME")
 	  tubeMax = 546;
   
-  
-  std::map<string,float>::iterator iter_tubesperchamber = m_tubesperchamber_map.find(hardware_name);
+  std::string hardware_namestr(hardware_name);
+  std::map<string,float>::iterator iter_tubesperchamber = m_tubesperchamber_map.find(hardware_namestr);
   if ( iter_tubesperchamber == m_tubesperchamber_map.end() ) { 
-      m_tubesperchamber_map.insert( make_pair( hardware_name, tubeMax ) );
+      m_tubesperchamber_map.insert( make_pair( hardware_namestr, tubeMax ) );
       ATH_MSG_DEBUG("Chamber " << hardware_name << " has " << tubeMax << " tubes.");
   } 
   else {
@@ -1499,7 +1499,7 @@ StatusCode MdtRawDataValAlg::binMdtOccVsLB_Crate(TH2* &h, int region, int crate)
 }
 
 
-int MdtRawDataValAlg::get_bin_for_LB_crate_hist(int region, int crate, int phi, int eta, std::string chamber){
+int MdtRawDataValAlg::get_bin_for_LB_crate_hist(int region, int crate, int phi, int eta, std::string_view chamber){
   int binNum = 999;
 
   if(region == 0 || region == 1){ //Barrel
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtilsRun3.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtilsRun3.cxx
index 17821827d89b..1cc22df57241 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtilsRun3.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MDTRawDataUtilsRun3.cxx
@@ -74,7 +74,7 @@ StatusCode MdtRawDataMonAlg::binMdtGlobal( TH2* h, char ecap ) {
   return StatusCode::SUCCESS;
 } 
 
-StatusCode  MdtRawDataMonAlg::binMdtRegional( TH2* h, string &xAxis ) {
+StatusCode  MdtRawDataMonAlg::binMdtRegional( TH2* h, std::string_view xAxis ) {
   
   ///SET Ghost Entries
   int LowerEta=-0;
@@ -276,7 +276,7 @@ StatusCode  MdtRawDataMonAlg::binMdtGlobal_byLayer( TH2* nHits_In, TH2* nHits_Mi
 
 
 //Correct for CutOuts
-void MdtRawDataMonAlg::ChamberTubeNumberCorrection(int & tubeNum, const std::string & hardware_name, int tubePos, int numLayers) const{
+void MdtRawDataMonAlg::ChamberTubeNumberCorrection(int & tubeNum, std::string_view hardware_name, int tubePos, int numLayers) const{
   //numLayers should be mdt_layer-1 so numLayers = 0 implies layer 1 ML 1 or mdt_layer==1
   if(hardware_name.substr(0,4)=="BMS4" || hardware_name.substr(0,4)=="BMS6"){//layer 1-4 tubeId 41-48 cut out
     if( numLayers <= 2 ) tubeNum = tubePos + numLayers * 48;
@@ -442,7 +442,7 @@ int MdtRawDataMonAlg::mezzmdt(Identifier digcoll_id) const { //int mezz_chamber,
 // Get the Maximum # of tubes in the chamber
 // the 'if' statements are for chambers with ML1 != ML2
 // except for BIS8 -- mdtIdHelper gets the # layers wrong in this instance
-int MdtRawDataMonAlg::GetTubeMax( const Identifier & digcoll_id, const std::string & hardware_name ) {
+int MdtRawDataMonAlg::GetTubeMax( const Identifier & digcoll_id, std::string_view hardware_name ) {
   int tubeMax(0);
   if( hardware_name.substr(0,4) == "BIS8" ) { // Why does mdtIdHelper get this one wrong?
     tubeMax = 16*3;
@@ -1096,7 +1096,7 @@ StatusCode MdtRawDataMonAlg::binMdtOccVsLB_Crate(TH2* &h, int region, int crate)
 }
 
 
-int MdtRawDataMonAlg::get_bin_for_LB_crate_hist(int region, int crate, int phi, int eta, std::string chamber) const{
+int MdtRawDataMonAlg::get_bin_for_LB_crate_hist(int region, int crate, int phi, int eta, std::string_view chamber) const{
   int binNum = 999;
 
   if(region == 0 || region == 1){ //Barrel
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx
index 2e51be20c960..20f45d3f3801 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/src/MdtRawDataValAlg.cxx
@@ -475,7 +475,7 @@ StatusCode MdtRawDataValAlg::fillHistograms()
           nPrd++;
           hardware_name = getChamberName(*mdtCollection);
           float adc = (*mdtCollection)->adc();
-          if(hardware_name.substr(0,3) == "BMG") adc /= 4.;
+          if(hardware_name.compare(0,3,"BMG") == 0) adc /= 4.;
           if( adc > m_ADCCut ) 
           {
             nPrdcut++;
@@ -1519,9 +1519,9 @@ StatusCode MdtRawDataValAlg::fillMDTHistograms( const Muon::MdtPrepData* mdtColl
 
   float tdc = mdtCollection->tdc()*25.0/32.0;
   // Note: the BMG is digitized with 200ps which is not same as other MDT chambers with 25/32=781.25ps
-  if(hardware_name.substr(0,3)=="BMG") tdc = mdtCollection->tdc() * 0.2;
+  if(hardware_name.compare(0,3,"BMG")==0) tdc = mdtCollection->tdc() * 0.2;
   float adc = mdtCollection->adc();
-  if(hardware_name.substr(0,3) == "BMG") adc /= 4.;
+  if(hardware_name.compare(0,3,"BMG") == 0) adc /= 4.;
 
   if (chamber->mdttdc) {
     chamber->mdttdc->Fill(tdc); 
@@ -1576,9 +1576,9 @@ StatusCode MdtRawDataValAlg::fillMDTSummaryHistograms( const Muon::MdtPrepData*
   bool isBIM = (chambername.at(2)=='M');
   float tdc = mdtCollection->tdc()*25.0/32.0;
   // Note: the BMG is digitized with 200ps which is not same as other MDT chambers with 25/32=781.25ps
-  if(chambername.substr(0,3)=="BMG") tdc = mdtCollection->tdc() * 0.2;
+  if(chambername.compare(0,3,"BMG")==0) tdc = mdtCollection->tdc() * 0.2;
   float adc = mdtCollection->adc();
-  if(chambername.substr(0,3) == "BMG") adc /= 4.;
+  if(chambername.compare(0,3,"BMG") == 0) adc /= 4.;
 
   if( m_mdtChamberHits[iregion][ilayer][stationPhi] && adc > m_ADCCut )
     m_mdtChamberHits[iregion][ilayer][stationPhi]->Fill(std::abs(stationEta));
@@ -1630,7 +1630,7 @@ StatusCode MdtRawDataValAlg::fillMDTSummaryHistograms( const Muon::MdtPrepData*
     
     //correct readout crate info for BEE,BIS7/8
     int crate_region = iregion;
-    if(chambername.substr(0,3)=="BEE" || (chambername.substr(0,3) == "BIS" && (stationEta == 7 || stationEta == 8) )){
+    if(chambername.compare(0,3,"BEE")==0 || (chambername.compare(0,3,"BIS") == 0 && (stationEta == 7 || stationEta == 8) )){
       if(iregion==0) crate_region=2;
       if(iregion==1) crate_region=3;
     }
@@ -1671,9 +1671,9 @@ StatusCode MdtRawDataValAlg::fillMDTOverviewHistograms( const Muon::MdtPrepData*
 
   float tdc = mdtCollection->tdc()*25.0/32.0;
   // Note: the BMG is digitized with 200ps which is not same as other MDT chambers with 25/32=781.25ps
-  if(hardware_name.substr(0,3)=="BMG") tdc = mdtCollection->tdc() * 0.2;
+  if(hardware_name.compare(0,3,"BMG")==0) tdc = mdtCollection->tdc() * 0.2;
   float adc = mdtCollection->adc();
-  if(hardware_name.substr(0,3) == "BMG") adc /= 4.;
+  if(hardware_name.compare(0,3,"BMG") ==0 ) adc /= 4.;
 
   //Barrel -->Fill MDT Global RZ and YX
   if( adc>m_ADCCut ) {
@@ -1767,14 +1767,14 @@ StatusCode MdtRawDataValAlg::handleEvent_effCalc(const Trk::SegmentCollection* s
         sc = getChamber(idHash, chamber);
         std::string chambername = chamber->getName();
         float adc = mrot->prepRawData()->adc();
-        if(chambername.substr(0,3)=="BMG") adc /= 4. ;
+        if(chambername.compare(0,3,"BMG")==0) adc /= 4. ;
         if(m_overalladc_segm_Lumi) m_overalladc_segm_Lumi->Fill(adc);
         if( store_ROTs.find(tmpid) == store_ROTs.end() ) { // Let's not double-count hits belonging to multiple segments
           store_ROTs.insert(tmpid);   
 
           double tdc = mrot->prepRawData()->tdc()*25.0/32.0;
           // Note: the BMG is digitized with 200ps which is not same as other MDT chambers with 25/32=781.25ps
-          if(chambername.substr(0,3)=="BMG") tdc = mrot->prepRawData()->tdc() * 0.2;
+          if(chambername.compare(0,3,"BMG")==0) tdc = mrot->prepRawData()->tdc() * 0.2;
               //      double tdc = mrot->driftTime()+500;
               int iregion = chamber->GetRegionEnum();
               int ilayer = chamber->GetLayerEnum();
-- 
GitLab


From 2244e89f739d6120da20041d86d247655a3f0cbb Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 27 Aug 2021 14:18:00 -0400
Subject: [PATCH 195/347] AthAllocators: Allow an arbitrary argument for
 construct().

Allow forwarding an arbitrary argument list through the construct()
methods of the STL-style allocators.
---
 .../AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h    | 5 +++--
 .../AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc  | 7 ++++---
 .../AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h    | 5 +++--
 .../AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc  | 7 ++++---
 .../AthAllocators/ArenaSharedHeapSTLAllocator.h            | 5 +++--
 .../AthAllocators/ArenaSharedHeapSTLAllocator.icc          | 7 ++++---
 6 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h
index 66e8766297cd..bec3954769ff 100644
--- a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h
+++ b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h
@@ -228,9 +228,10 @@ public:
   /**
    * @brief Call the @c T constructor.
    * @param p Location of the memory.
-   * @param val Parameter to pass to the constructor.
+   * @param args Arguments to pass to the constructor.
    */
-  void construct (pointer p, const T& val);
+  template <class... Args>
+  void construct (pointer p, Args&&... args);
 
 
   /**
diff --git a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc
index b9f346b5bcfa..e1271cd79a15 100644
--- a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc
@@ -269,13 +269,14 @@ ArenaHeapSTLAllocator<T, VETO>::max_size() const throw()
 /**
  * @brief Call the @c T constructor.
  * @param p Location of the memory.
- * @param val Parameter to pass to the constructor.
+ * @param args Arguments to pass to the constructor.
  */
 template <class T, class VETO>
+template <class... Args>
 inline
-void ArenaHeapSTLAllocator<T, VETO>::construct (pointer p, const T& val)
+void ArenaHeapSTLAllocator<T, VETO>::construct (pointer p, Args&&... args)
 {
-  new (reinterpret_cast<void*>(p)) T(val);
+  new (reinterpret_cast<void*>(p)) T(std::forward<Args>(args)...);
 }
 
 
diff --git a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h
index 082d34d0046c..0c9a21a9b6c9 100644
--- a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h
+++ b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h
@@ -243,9 +243,10 @@ public:
   /**
    * @brief Call the @c T constructor.
    * @param p Location of the memory.
-   * @param val Parameter to pass to the constructor.
+   * @param args Arguments to pass to the constructor.
    */
-  void construct (pointer p, const T& val);
+  template <class... Args>
+  void construct (pointer p, Args&&... args);
 
 
   /**
diff --git a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc
index 5fb443f98fd3..2e3215521752 100644
--- a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc
@@ -269,13 +269,14 @@ ArenaPoolSTLAllocator<T, VETO>::max_size() const throw()
 /**
  * @brief Call the @c T constructor.
  * @param p Location of the memory.
- * @param val Parameter to pass to the constructor.
+ * @param args Arguments to pass to the constructor.
  */
 template <class T, class VETO>
+template <class... Args>
 inline
-void ArenaPoolSTLAllocator<T, VETO>::construct (pointer p, const T& val)
+void ArenaPoolSTLAllocator<T, VETO>::construct (pointer p, Args&&... args)
 {
-  new (reinterpret_cast<void*>(p)) T(val);
+  new (reinterpret_cast<void*>(p)) T(std::forward<Args>(args)...);
 }
 
 
diff --git a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h
index def334eb7ebe..12a7e096566d 100644
--- a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h
+++ b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h
@@ -345,9 +345,10 @@ public:
   /**
    * @brief Call the @c T constructor.
    * @param p Location of the memory.
-   * @param val Parameter to pass to the constructor.
+   * @param args Arguments to pass to the constructor.
    */
-  void construct (pointer p, const T& val);
+  template <class... Args>
+  void construct (pointer p, Args&&... args);
 
 
   /**
diff --git a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc
index ef78c763db9a..eed3dae4cd73 100644
--- a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc
@@ -340,13 +340,14 @@ ArenaSharedHeapSTLAllocator<T>::max_size() const throw()
 /**
  * @brief Call the @c T constructor.
  * @param p Location of the memory.
- * @param val Parameter to pass to the constructor.
+ * @param args Arguments to pass to the constructor.
  */
 template <class T>
+template <class... Args>
 inline
-void ArenaSharedHeapSTLAllocator<T>::construct (pointer p, const T& val)
+void ArenaSharedHeapSTLAllocator<T>::construct (pointer p, Args&&... args)
 {
-  new (reinterpret_cast<void*>(p)) T(val);
+  new (reinterpret_cast<void*>(p)) T(std::forward<Args>(args)...);
 }
 
 
-- 
GitLab


From df42a435bc7e94cdb1bdc32be8084ae57488964c Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Sep 2021 19:44:16 -0400
Subject: [PATCH 196/347] CrestApi: Enable thread-safety checking.

Fix thread-unsafe use of localtime().
---
 Database/CrestApi/CrestApi/ATLAS_CHECK_THREAD_SAFETY | 1 +
 Database/CrestApi/src/CrestApi.cxx                   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 Database/CrestApi/CrestApi/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Database/CrestApi/CrestApi/ATLAS_CHECK_THREAD_SAFETY b/Database/CrestApi/CrestApi/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..46f6639dac08
--- /dev/null
+++ b/Database/CrestApi/CrestApi/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Database/CrestApi
diff --git a/Database/CrestApi/src/CrestApi.cxx b/Database/CrestApi/src/CrestApi.cxx
index b1e665cc25ab..8c560c8d63df 100644
--- a/Database/CrestApi/src/CrestApi.cxx
+++ b/Database/CrestApi/src/CrestApi.cxx
@@ -2190,7 +2190,7 @@ namespace Crest {
     struct tm tstruct;
     char buf[80];
 
-    tstruct = *localtime(&now);
+    localtime_r(&now, &tstruct);
     strftime(buf, sizeof(buf), "%Y-%m-%d %X", &tstruct);
     return buf;
   }
-- 
GitLab


From bb116dcaeac4f7ee3b08468a3a059b6ff44bd7c0 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Sep 2021 22:36:54 -0400
Subject: [PATCH 197/347] TrigCompositeUtils: Fix clang warnings.

Spurious copies in range-for.
---
 .../TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Trigger/TrigSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx b/Trigger/TrigSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx
index a834f764f3d3..25045cfe651f 100644
--- a/Trigger/TrigSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx
+++ b/Trigger/TrigSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx
@@ -210,7 +210,7 @@ namespace TrigCompositeUtils {
 
     if ( hasLinkToPrevious(start) ) {
       const ElementLinkVector<DecisionContainer> seeds = getLinkToPrevious(start);
-      for (const ElementLink<DecisionContainer>& seedEL : seeds) {
+      for (const ElementLink<DecisionContainer> seedEL : seeds) {
         const Decision* result = find( *seedEL, filter );
         if (result) return result;
       }
@@ -356,7 +356,7 @@ namespace TrigCompositeUtils {
     // Continue to the path(s) by looking at this Decision object's seed(s)
     if ( hasLinkToPrevious(node) ) {
       // Do the recursion
-      for ( const ElementLink<DecisionContainer>& seed : getLinkToPrevious(node)) {
+      for ( const ElementLink<DecisionContainer> seed : getLinkToPrevious(node)) {
         const Decision* seedDecision = *(seed); // Dereference ElementLink
         // Sending true as final parameter for enforceDecisionOnStartNode as we are recursing away from the supplied start node
         recursiveGetDecisionsInternal(seedDecision, node, navGraph, fullyExploredFrom, ids, /*enforceDecisionOnNode*/ true);
@@ -483,7 +483,7 @@ namespace TrigCompositeUtils {
       return true;
     }
     // If not Early Exit, then recurse
-    for (const ElementLink<DecisionContainer>& seed : getLinkToPrevious(start)) {
+    for (const ElementLink<DecisionContainer> seed : getLinkToPrevious(start)) {
 #if TRIGCOMPUTILS_ENABLE_EARLY_EXIT == 1
       if (fullyExploredFrom != nullptr) {
         // We only need to recursively explore back from each node in the graph once.
@@ -735,7 +735,7 @@ namespace TrigCompositeUtils {
     ret += printerFnc( tc );
     if ( hasLinkToPrevious(tc) ) {
       const ElementLinkVector<DecisionContainer> seeds = getLinkToPrevious(tc);
-      for (const ElementLink<DecisionContainer>& seedEL : seeds) {
+      for (const ElementLink<DecisionContainer> seedEL : seeds) {
         ret += " -> " + dump( *seedEL, printerFnc );
       }
     }
-- 
GitLab


From 053d4e58adfa5e3651f8608ce3c5dee7a0e5ce62 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Sep 2021 11:41:27 -0400
Subject: [PATCH 198/347] DetDescrCnvSvc: Work around Gaudi init problem.

DetectorStore was sometimes not being initialized early enough.
See https://gitlab.cern.ch/gaudi/Gaudi/issues/82.
---
 .../DetDescrCnvSvc/src/DetDescrCnvSvc.cxx             | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx b/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx
index c5f9af64e3fa..c0beb1e4b511 100755
--- a/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx
+++ b/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.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 files
@@ -122,6 +122,15 @@ DetDescrCnvSvc::initialize()     {
 	log << MSG::INFO << "Found DetectorStore service" << endmsg;
     }
 
+    // Working around Gaudi Issue https://gitlab.cern.ch/gaudi/Gaudi/issues/82
+    if (m_detStore->FSMState() < Gaudi::StateMachine::INITIALIZED) {
+      log << MSG::INFO << "Explicitly initializing DetDescrCnvSvc" << endmsg;
+      if (m_detStore->sysInitialize().isFailure()) {
+	log << MSG::FATAL << "Error initializing DetectorStore !" << endmsg;
+	return StatusCode::FAILURE;
+      }
+    } 
+
     // fill in the Addresses for Transient Detector Store objects
 
     log << MSG::INFO << " filling proxies for detector managers " <<endmsg ;
-- 
GitLab


From b42470e0af9176c462aeaa61ec9ab883333eecb7 Mon Sep 17 00:00:00 2001
From: Ewelina Maria Lobodzinska <ewelina.maria.lobodzinska@cern.ch>
Date: Fri, 17 Sep 2021 16:23:12 +0200
Subject: [PATCH 199/347] Merge branch '21.6-superchic-jo' into '21.6'

Superchic example job option fix

See merge request atlas/athena!46574

(cherry picked from commit 92d47085a46d429e398576969412adede3fbd2da)

c0820c02 Migrate JO to new SC interface
b2664f37 Merge remote-tracking branch 'upstream/20.6' into 21.6-superchic-common
---
 ...DD_Common.py => Pythia8_DD_surv_Common.py} |  0
 .../share/jobOptions.SuperChic_ALP2.py        |  2 +-
 .../share/jobOptions.Superchic_UPC_yyMuMu.py  | 29 +++++++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)
 rename Generators/Superchic_i/share/common/{Pythia8_DD_Common.py => Pythia8_DD_surv_Common.py} (100%)
 create mode 100644 Generators/Superchic_i/share/jobOptions.Superchic_UPC_yyMuMu.py

diff --git a/Generators/Superchic_i/share/common/Pythia8_DD_Common.py b/Generators/Superchic_i/share/common/Pythia8_DD_surv_Common.py
similarity index 100%
rename from Generators/Superchic_i/share/common/Pythia8_DD_Common.py
rename to Generators/Superchic_i/share/common/Pythia8_DD_surv_Common.py
diff --git a/Generators/Superchic_i/share/jobOptions.SuperChic_ALP2.py b/Generators/Superchic_i/share/jobOptions.SuperChic_ALP2.py
index 9291a6054cdc..1b92a4617a3e 100644
--- a/Generators/Superchic_i/share/jobOptions.SuperChic_ALP2.py
+++ b/Generators/Superchic_i/share/jobOptions.SuperChic_ALP2.py
@@ -32,7 +32,7 @@ scConfig.etabmax   = 2.4           # Maximum eta of outgoing object b
 scConfig.acoabmax  = 100
 
 
-#SuperChicRun(scConfig, genSeq)
+SuperChicRun(scConfig, genSeq)
 
 import Superchic_i.EventFiller as EF
 ef = EF.LheEVNTFiller()
diff --git a/Generators/Superchic_i/share/jobOptions.Superchic_UPC_yyMuMu.py b/Generators/Superchic_i/share/jobOptions.Superchic_UPC_yyMuMu.py
new file mode 100644
index 000000000000..59bb13ea160d
--- /dev/null
+++ b/Generators/Superchic_i/share/jobOptions.Superchic_UPC_yyMuMu.py
@@ -0,0 +1,29 @@
+evgenConfig.description = "Superchic gamma + gamma UPC collisions at 5020 GeV"
+evgenConfig.keywords = ["2photon","2lepton"]
+#evgenConfig.weighting = 0
+evgenConfig.contact = ["prabhakar.palni@cern.ch"]
+evgenConfig.generators += ["Superchic"]
+
+from Superchic_i.SuperChicUtils import SuperChicConfig, SuperChicRun
+
+#class with the superchic initialization parameters.  Please see SuperChicUtils for a complete list of tunable parameters.
+scConfig = SuperChicConfig(runArgs)
+
+scConfig.isurv = 4                  # Model of soft survival (from 1 -> 4, corresponding to arXiv:1306.2149)
+scConfig.PDFname = 'MMHT2014lo68cl' # PDF set name
+scConfig.PDFmember = 0              # PDF member
+scConfig.proc = 59                  # Process number (59 = gg->gg, 56 = gg->ee, 68 = gg->a->gg ); Please consult Superchic Manual https://superchic.hepforge.org/
+scConfig.beam = 'ion'              # Beam type ('prot', 'ion')
+scConfig.sfaci = False             # Include soft survival effects
+scConfig.ncall = 100000            # Number of calls for preconditioning
+scConfig.itmx = 1                 # Number of iterations for preconditioning
+scConfig.prec = 1.0                # precision
+
+SuperChicRun(scConfig, genSeq)
+
+import Superchic_i.EventFiller as EF
+ef = EF.LheEVNTFiller()
+ef.fileName = scConfig.outputLHEFile()
+outputFileName = "outputs/output"+scConfig.outtg+".dat"
+ef.outputFileName = outputFileName
+genSeq += ef
-- 
GitLab


From f2ea7172aa0fc46388b4a080c29a71ccf8194a0f Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Thu, 16 Sep 2021 14:09:44 +0200
Subject: [PATCH 200/347] TGC Digitization: Implementation of signal
 propagation time between the sensor edge and ASD

---
 .../MuonCondAlg/TgcDigitASDposCondAlg.h       |  32 +
 .../MuonCondAlg/src/TgcDigitASDposCondAlg.cxx | 103 +++
 .../src/components/MuonCondAlg_entries.cxx    |   2 +
 .../MuonCondData/TgcDigitASDposData.h         |  46 ++
 .../MuonCondData/src/TgcDigitASDposData.cxx   |   8 +
 .../src/components/MuonCondSvc_entries.cxx    |   1 -
 .../MuonConfig/python/MuonCondAlgConfig.py    |   6 +-
 .../python/TGC_DigitizationConfig.py          |  12 +
 .../TGC_Digitization/CMakeLists.txt           |   2 +-
 .../python/TGC_DigitizationConfig.py          |  19 +
 .../TGC_Digitization_ASDpropTimeOffset.dat    | 236 +++++++
 .../share/TGC_Digitization_StripPosition.dat  | 608 ++++++++++++++++++
 .../TGC_Digitization/src/TgcDigitMaker.cxx    | 487 ++++++++++----
 .../TGC_Digitization/src/TgcDigitMaker.h      |  60 +-
 .../src/TgcDigitizationTool.cxx               |  16 +-
 .../src/TgcDigitizationTool.h                 |   7 +-
 .../python/DigitizationConfigFlags.py         |   2 +
 .../Digitization/python/DigitizationFlags.py  |  10 +-
 .../test/test_MC16a_Digi_tf_configuration.py  |   2 +-
 19 files changed, 1489 insertions(+), 170 deletions(-)
 create mode 100644 MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/MuonCondAlg/TgcDigitASDposCondAlg.h
 create mode 100644 MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/TgcDigitASDposCondAlg.cxx
 create mode 100644 MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/TgcDigitASDposData.h
 create mode 100644 MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/TgcDigitASDposData.cxx
 create mode 100644 MuonSpectrometer/MuonDigitization/TGC_Digitization/share/TGC_Digitization_ASDpropTimeOffset.dat
 create mode 100644 MuonSpectrometer/MuonDigitization/TGC_Digitization/share/TGC_Digitization_StripPosition.dat

diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/MuonCondAlg/TgcDigitASDposCondAlg.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/MuonCondAlg/TgcDigitASDposCondAlg.h
new file mode 100644
index 000000000000..9bcb72c60508
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/MuonCondAlg/TgcDigitASDposCondAlg.h
@@ -0,0 +1,32 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TGCDIGITASDPOSCONDALG_H
+#define TGCDIGITASDPOSCONDALG_H
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "GaudiKernel/ICondSvc.h"
+#include "MuonCondData/TgcDigitASDposData.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/WriteCondHandleKey.h"
+
+class TgcDigitASDposCondAlg : public AthReentrantAlgorithm
+{
+ public:
+  TgcDigitASDposCondAlg (const std::string& name, ISvcLocator* pSvcLocator);
+  virtual ~TgcDigitASDposCondAlg() = default;
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute(const EventContext& ctx) const override;
+
+ private:
+  SG::ReadCondHandleKey<CondAttrListCollection> m_readKey_ASDpos{this, "ReadKeyAsdPos", "/TGC/DIGIT/ASDPOS", "SG key for TGCDIGITASDPOS"};
+  SG::WriteCondHandleKey<TgcDigitASDposData> m_writeKey{this, "WriteKey", "TGCDigitASDposData", "SG Key of TGCDigit AsdPos"};
+
+  ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"};
+};
+
+#endif
+
+
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/TgcDigitASDposCondAlg.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/TgcDigitASDposCondAlg.cxx
new file mode 100644
index 000000000000..7804a61c8954
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/TgcDigitASDposCondAlg.cxx
@@ -0,0 +1,103 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "MuonCondAlg/TgcDigitASDposCondAlg.h"
+#include "MuonCondSvc/MdtStringUtils.h"
+#include "StoreGate/ReadCondHandle.h"
+#include "StoreGate/WriteCondHandle.h"
+#include "CoralBase/Blob.h"
+
+TgcDigitASDposCondAlg::TgcDigitASDposCondAlg(const std::string& name, ISvcLocator* pSvcLocator) :
+  AthReentrantAlgorithm(name, pSvcLocator)
+{}
+
+StatusCode TgcDigitASDposCondAlg::initialize()
+{
+  ATH_MSG_DEBUG("initialize " << name());
+
+  ATH_CHECK(m_condSvc.retrieve());
+  ATH_CHECK(m_readKey_ASDpos.initialize());
+  ATH_CHECK(m_writeKey.initialize());
+
+  if(m_condSvc->regHandle(this, m_writeKey).isFailure()) {
+    ATH_MSG_FATAL("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TgcDigitASDposCondAlg::execute(const EventContext& ctx) const
+{
+  SG::WriteCondHandle<TgcDigitASDposData> writeHandle{m_writeKey, ctx};
+  if (writeHandle.isValid()) {
+    ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
+		  << ". In theory this should not be called, but may happen"
+		  << " if multiple concurrent events are being processed out of order.");
+    return StatusCode::SUCCESS;
+  }
+
+  SG::ReadCondHandle<CondAttrListCollection> readHandle_ASDpos{m_readKey_ASDpos, ctx};
+  if (readHandle_ASDpos.cptr() == nullptr) {
+    ATH_MSG_ERROR("Null pointer to the read conditions object");
+    return StatusCode::FAILURE;
+  }
+
+  ATH_MSG_DEBUG("Size of CondAttrListCollection" << readHandle_ASDpos.fullKey() << " = " << readHandle_ASDpos->size());
+
+  EventIDRange rangeW_ASDpos;
+  if (!readHandle_ASDpos.range(rangeW_ASDpos)) {
+    ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandle_ASDpos.key());
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_DEBUG("Range of input is " << rangeW_ASDpos);
+
+  // write condition object
+  EventIDRange rangeIntersection = EventIDRange::intersect(rangeW_ASDpos);
+  if(rangeIntersection.start()>rangeIntersection.stop()) {
+    ATH_MSG_ERROR("Invalid intersection range: " << rangeIntersection);
+    return StatusCode::FAILURE;
+  }
+
+  // Fill
+  auto outputCdo = std::make_unique<TgcDigitASDposData>();
+  outputCdo->asdPos.assign(TgcDigitASDposData::N_STRIPASDPOS + TgcDigitASDposData::N_WIREASDPOS, std::vector<float>(readHandle_ASDpos->size(), 0));
+  size_t dbLine{};
+
+  std::string delimiter{";"};
+  for(const auto &[channel, attribute] : *readHandle_ASDpos.cptr()) {
+    const coral::Blob& blob = attribute["bASDPos"].data<coral::Blob>();
+    const char *blobCStr = reinterpret_cast<const char *>(blob.startingAddress());
+    std::string blobline(blobCStr);
+    std::vector<std::string> tokens;
+    MuonCalib::MdtStringUtils::tokenize(blobline, tokens, delimiter);
+    auto it = std::begin(tokens);
+    outputCdo->stationNum.push_back(stoi(*it));
+    ++it;
+    outputCdo->stationEta.push_back(stoi(*it));
+    ++it;
+    outputCdo->stationPhi.push_back(stoi(*it));
+
+    for(int i=0;i<TgcDigitASDposData::N_STRIPASDPOS;i++){
+      ++it;
+      outputCdo->asdPos[i][dbLine] = stof(*it);
+    }
+    for(int i=0;i<TgcDigitASDposData::N_WIREASDPOS;i++){
+      ++it;
+      outputCdo->asdPos[i + (int)TgcDigitASDposData::N_STRIPASDPOS][dbLine] = stof(*it);
+    }
+    dbLine += 1;
+  } // end of for(attrmap)
+
+  // Record
+  if (writeHandle.record(rangeIntersection, std::move(outputCdo)).isFailure()) {
+    ATH_MSG_FATAL("Could not record TgcDigitASDposData " << writeHandle.key()
+		  << " with EventRange " << rangeIntersection
+		  << " into Conditions Store");
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_DEBUG("recorded new " << writeHandle.key() << " with range " << rangeIntersection << " into Conditions Store");
+
+  return StatusCode::SUCCESS;
+}
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/components/MuonCondAlg_entries.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/components/MuonCondAlg_entries.cxx
index cd4001d6a5af..c698b1ac83bb 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/components/MuonCondAlg_entries.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/components/MuonCondAlg_entries.cxx
@@ -6,6 +6,7 @@
 #include "MuonCondAlg/MuonAlignmentErrorDbAlg.h"
 #include "MuonCondAlg/RpcCondDbAlg.h"
 #include "MuonCondAlg/TgcCondDbAlg.h"
+#include "MuonCondAlg/TgcDigitASDposCondAlg.h"
 
 DECLARE_COMPONENT(CscCondDbAlg)
 DECLARE_COMPONENT(MdtCondDbAlg)
@@ -15,3 +16,4 @@ DECLARE_COMPONENT(MuonAlignmentErrorDbAlg)
 DECLARE_COMPONENT(MuonAlignmentCondAlg)
 DECLARE_COMPONENT(MdtCalibDbAlg)
 DECLARE_COMPONENT(MdtCalibFormatAlgTest)
+DECLARE_COMPONENT(TgcDigitASDposCondAlg)
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/TgcDigitASDposData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/TgcDigitASDposData.h
new file mode 100644
index 000000000000..8dde82a7cbd1
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/TgcDigitASDposData.h
@@ -0,0 +1,46 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TGCDIGITASDPOSDATA_H
+#define TGCDIGITASDPOSDATA_H
+
+#include "AthenaKernel/BaseInfo.h"
+#include "AthenaKernel/CLASS_DEF.h"
+#include <vector>
+
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *               Contents of TGC_Digitization_AsdPosition.db                   *
+ *  ==================================================================         *
+ *                    |1|2|3|4|5|6|7|8|9|10|11|12|13|                          *
+ *                                                                             *
+ *             1  -- station number(unsigned short) -> 41~48                   *
+ *             2  -- station eta(unsigned short) -> 1~5                        *
+ *             3  -- station phi(short) -> BW is -99, EI is 1~21, FI is 1~24   *
+ *            4~5 -- strip ASD position coordinate(float)                      *
+ *           6~13 -- Wire ASD position coordinate(float)                       *
+  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+class TgcDigitASDposData
+{
+public:
+  TgcDigitASDposData();
+  virtual ~TgcDigitASDposData() = default;
+
+  enum {
+    N_WIREASDPOS=8,
+    N_STRIPASDPOS=2,
+    N_CHANNELINPUT_TOASD=16
+  };
+
+  std::vector<unsigned short> stationNum;
+  std::vector<unsigned short> stationEta;
+  std::vector<short> stationPhi;
+  std::vector<std::vector<float>> asdPos;
+};
+CLASS_DEF(TgcDigitASDposData, 54799429, 1)
+
+#include "AthenaKernel/CondCont.h"
+CLASS_DEF(CondCont<TgcDigitASDposData>, 50515203, 1)
+
+#endif // TGCDIGITASDPOSDATA_H
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/TgcDigitASDposData.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/TgcDigitASDposData.cxx
new file mode 100644
index 000000000000..63d6b1f0ac63
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/TgcDigitASDposData.cxx
@@ -0,0 +1,8 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "MuonCondData/TgcDigitASDposData.h"
+
+TgcDigitASDposData::TgcDigitASDposData()
+{}
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/components/MuonCondSvc_entries.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/components/MuonCondSvc_entries.cxx
index cd29a288f0ab..f0c4aebc19ec 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/components/MuonCondSvc_entries.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/components/MuonCondSvc_entries.cxx
@@ -29,4 +29,3 @@ DECLARE_COMPONENT( RPC_STATUSConditionsSvc )
 DECLARE_COMPONENT( RPC_DCSConditionsSvc )
 DECLARE_COMPONENT( TriggerCoolSvc )
 DECLARE_COMPONENT( TGC_STATUSConditionsSvc )
-
diff --git a/MuonSpectrometer/MuonConfig/python/MuonCondAlgConfig.py b/MuonSpectrometer/MuonConfig/python/MuonCondAlgConfig.py
index 6d5617ba651c..3a8be4504d61 100644
--- a/MuonSpectrometer/MuonConfig/python/MuonCondAlgConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MuonCondAlgConfig.py
@@ -150,4 +150,8 @@ def CscCondDbAlgCfg(flags, **kwargs):
 ###    return result
 
 
-
+def TgcDigitASDposCondAlgCfg(flags):
+    result  = ComponentAccumulator()
+    result.addCondAlgo(CompFactory.TgcDigitASDposCondAlg())
+    result.merge(addFolders(flags, ["/TGC/DIGIT/ASDPOS"] , detDb="TGC_OFL", className="CondAttrListCollection"))
+    return result
diff --git a/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py
index 7227ef7961e3..433242280d07 100644
--- a/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/TGC_DigitizationConfig.py
@@ -46,6 +46,12 @@ def TGC_DigitizationToolCfg(flags, name="TgcDigitizationTool", **kwargs):
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "TGC_SDO")
     else:
         kwargs.setdefault("OutputSDOName", "TGC_SDO")
+
+    if flags.Digitization.UseUpdatedTGCConditions:
+        from MuonConfig.MuonCondAlgConfig import TgcDigitASDposCondAlgCfg
+        acc.merge(TgcDigitASDposCondAlgCfg(flags))
+        kwargs.setdefault("TGCDigitASDposKey", "TGCDigitASDposData")
+
     TgcDigitizationTool = CompFactory.TgcDigitizationTool
     acc.setPrivateTools(TgcDigitizationTool(name, **kwargs))
     return acc
@@ -57,6 +63,12 @@ def TGC_OverlayDigitizationToolCfg(flags, name="Tgc_OverlayDigitizationTool", **
     kwargs.setdefault("OnlyUseContainerName", False)
     kwargs.setdefault("OutputObjectName", flags.Overlay.SigPrefix + "TGC_DIGITS")
     kwargs.setdefault("OutputSDOName", flags.Overlay.SigPrefix + "TGC_SDO")
+
+    if flags.Digitization.UseUpdatedTGCConditions:
+        from MuonConfig.MuonCondAlgConfig import TgcDigitASDposCondAlgCfg
+        acc.merge(TgcDigitASDposCondAlgCfg(flags))
+        kwargs.setdefault("TGCDigitASDposKey", "TGCDigitASDposData")
+
     TgcDigitizationTool = CompFactory.TgcDigitizationTool
     acc.setPrivateTools(TgcDigitizationTool(name, **kwargs))
     return acc
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/CMakeLists.txt b/MuonSpectrometer/MuonDigitization/TGC_Digitization/CMakeLists.txt
index 3e697afa95e5..d85b1b81841b 100755
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/CMakeLists.txt
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/CMakeLists.txt
@@ -15,7 +15,7 @@ atlas_add_component( TGC_Digitization
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib GeoPrimitives Identifier GaudiKernel MuonSimEvent HitManagement xAODEventInfo GeneratorObjects MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonSimData PathResolver RDBAccessSvcLib )
+                     LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel PileUpToolsLib GeoPrimitives Identifier GaudiKernel MuonSimEvent HitManagement xAODEventInfo GeneratorObjects MuonCondData MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonSimData PathResolver RDBAccessSvcLib )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/python/TGC_DigitizationConfig.py b/MuonSpectrometer/MuonDigitization/TGC_Digitization/python/TGC_DigitizationConfig.py
index ae423145cd85..10e8e5d4ec77 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/python/TGC_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/python/TGC_DigitizationConfig.py
@@ -13,6 +13,14 @@ def TGC_FirstXing():
 def TGC_LastXing():
     return 75
 
+def setupTgcDigitASDposCondAlg():
+    from AthenaCommon.AlgSequence import AthSequencer
+    condSequence = AthSequencer("AthCondSeq")
+    if not hasattr(condSequence, "TgcDigitASDposCondAlg"):
+        from IOVDbSvc.CondDB import conddb
+        conddb.addFolder("TGC_OFL", "/TGC/DIGIT/ASDPOS", className='CondAttrListCollection')
+        condSequence += CfgMgr.TgcDigitASDposCondAlg("TgcDigitASDposCondAlg")
+
 def TgcDigitizationTool(name="TgcDigitizationTool", **kwargs):
     if jobproperties.Digitization.doXingByXingPileUp(): # PileUpTool approach
         # This should match the range for the TGC in Simulation/Digitization/share/MuonDigitization.py 
@@ -26,6 +34,11 @@ def TgcDigitizationTool(name="TgcDigitizationTool", **kwargs):
     else:
         kwargs.setdefault("OutputSDOName", "TGC_SDO")
 
+    from Digitization.DigitizationFlags import digitizationFlags
+    if digitizationFlags.UseUpdatedTGCConditions():
+        setupTgcDigitASDposCondAlg()
+        kwargs.setdefault("TGCDigitASDposKey", "TGCDigitASDposData")
+
     return CfgMgr.TgcDigitizationTool(name, **kwargs)
 
 def getTgcRange(name="TgcRange", **kwargs):
@@ -46,6 +59,12 @@ def Tgc_OverlayDigitizationTool(name="Tgc_OverlayDigitizationTool", **kwargs):
         kwargs.setdefault("OutputObjectName",overlayFlags.evtStore()+"+TGC_DIGITS")
         if not overlayFlags.isDataOverlay():
             kwargs.setdefault("OutputSDOName",overlayFlags.evtStore()+"+TGC_SDO")
+
+    from Digitization.DigitizationFlags import digitizationFlags
+    if digitizationFlags.UseUpdatedTGCConditions():
+        setupTgcDigitASDposCondAlg()
+        kwargs.setdefault("TGCDigitASDposKey", "TGCDigitASDposData")    
+
     return TgcDigitizationTool(name,**kwargs)
 
 def getTGC_OverlayDigitizer(name="TGC_OverlayDigitizer", **kwargs):
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/share/TGC_Digitization_ASDpropTimeOffset.dat b/MuonSpectrometer/MuonDigitization/TGC_Digitization/share/TGC_Digitization_ASDpropTimeOffset.dat
new file mode 100644
index 000000000000..d7291067895d
--- /dev/null
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/share/TGC_Digitization_ASDpropTimeOffset.dat
@@ -0,0 +1,236 @@
+41	1	0	1	16	-5
+42	1	0	1	16	-6
+42	2	0	1	16	-4.5
+42	3	0	1	16	-5
+42	4	0	1	16	-8
+43	1	0	1	16	-5
+44	1	0	1	16	-6
+44	2	0	1	16	-6
+44	3	0	1	16	-6
+44	4	0	1	16	-6
+44	5	0	1	16	-6
+45	1	0	1	16	-5
+46	1	0	1	16	-6
+46	2	0	1	16	-6
+46	3	0	1	16	-6
+46	4	0	1	16	-6
+46	5	0	1	16	-6
+47	1	0	1	16	-6
+48	1	0	1	16	-8
+41	-1	0	1	16	-5
+42	-1	0	1	16	-6
+42	-2	0	1	16	-4.5
+42	-3	0	1	16	-6
+42	-4	0	1	16	-8
+43	-1	0	1	16	-5
+44	-1	0	1	16	-6
+44	-2	0	1	16	-6
+44	-3	0	1	16	-6
+44	-4	0	1	16	-6
+44	-5	0	1	16	-6
+45	-1	0	1	16	-5
+46	-1	0	1	16	-6
+46	-2	0	1	16	-6
+46	-3	0	1	16	-6
+46	-4	0	1	16	-6
+46	-5	0	1	16	-6
+47	-1	0	1	16	-6
+48	-1	0	1	16	-8
+41	1	0	2	32	-5
+42	1	0	2	32	-6
+42	2	0	2	32	-4.5
+42	3	0	2	32	-5
+42	4	0	2	32	-8
+43	1	0	2	32	-5
+44	1	0	2	32	-6
+44	2	0	2	32	-6
+44	3	0	2	32	-6
+44	4	0	2	32	-6
+44	5	0	2	32	-6
+45	1	0	2	32	-5
+46	1	0	2	32	-6
+46	2	0	2	32	-6
+46	3	0	2	32	-6
+46	4	0	2	32	-6
+46	5	0	2	32	-6
+47	1	0	2	32	-7
+48	1	0	2	32	-9
+41	-1	0	2	32	-5
+42	-1	0	2	32	-6
+42	-2	0	2	32	-4.5
+42	-3	0	2	32	-5
+42	-4	0	2	32	-8
+43	-1	0	2	32	-5
+44	-1	0	2	32	-6
+44	-2	0	2	32	-6
+44	-3	0	2	32	-6
+44	-4	0	2	32	-6
+44	-5	0	2	32	-6
+45	-1	0	2	32	-5
+46	-1	0	2	32	-6
+46	-2	0	2	32	-6
+46	-3	0	2	32	-6
+46	-4	0	2	32	-6
+46	-5	0	2	32	-6
+47	-1	0	2	32	-7
+48	-1	0	2	32	-9
+41	1	0	3	48	-5
+42	1	0	3	48	-6
+42	2	0	3	48	-4.5
+43	1	0	3	48	-5
+44	1	0	3	48	-6
+44	2	0	3	48	-6
+45	1	0	3	48	-5
+46	1	0	3	48	-6
+46	2	0	3	48	-6
+41	-1	0	3	48	-5
+42	-1	0	3	48	-6
+42	-2	0	3	48	-4.5
+43	-1	0	3	48	-5
+44	-1	0	3	48	-6
+44	-2	0	3	48	-6
+45	-1	0	3	48	-5
+46	-1	0	3	48	-6
+46	-2	0	3	48	-6
+41	1	0	4	64	-5
+42	1	0	4	64	-6
+42	2	0	4	64	-4.5
+43	1	0	4	64	-5
+44	1	0	4	64	-6
+44	2	0	4	64	-6
+45	1	0	4	64	-5
+46	1	0	4	64	-6
+46	2	0	4	64	-6
+41	-1	0	4	64	-5
+42	-1	0	4	64	-6
+42	-2	0	4	64	-4.5
+43	-1	0	4	64	-5
+44	-1	0	4	64	-6
+44	-2	0	4	64	-6
+45	-1	0	4	64	-5
+46	-1	0	4	64	-6
+46	-2	0	4	64	-6
+41	1	0	5	80	-5
+42	1	0	5	80	-6
+43	1	0	5	80	-5
+44	1	0	5	80	-6
+44	2	0	5	80	-6
+45	1	0	5	80	-5
+46	1	0	5	80	-6
+46	2	0	5	80	-6
+41	-1	0	5	80	-5
+42	-1	0	5	80	-6
+43	-1	0	5	80	-5
+44	-1	0	5	80	-6
+44	-2	0	5	80	-6
+45	-1	0	5	80	-5
+46	-1	0	5	80	-6
+46	-2	0	5	80	-6
+41	1	0	6	96	-5
+42	1	0	6	96	-6
+43	1	0	6	96	-5
+44	1	0	6	96	-6
+44	2	0	6	96	-6
+45	1	0	6	96	-5
+46	1	0	6	96	-6
+46	2	0	6	96	-6
+41	-1	0	6	96	-5
+42	-1	0	6	96	-6
+43	-1	0	6	96	-5
+44	-1	0	6	96	-6
+44	-2	0	6	96	-6
+45	-1	0	6	96	-5
+46	-1	0	6	96	-6
+46	-2	0	6	96	-6
+41	1	0	7	112	-5
+43	1	0	7	112	-5
+44	1	0	7	112	-6
+44	2	0	7	112	-6
+45	1	0	7	112	-5
+46	2	0	7	112	-6
+41	-1	0	7	112	-5
+43	-1	0	7	112	-5
+44	-1	0	7	112	-6
+44	-2	0	7	112	-6
+45	-1	0	7	112	-5
+46	-2	0	7	112	-6
+43	1	0	8	128	-5
+45	1	0	8	128	-5
+43	-1	0	8	128	-5
+45	-1	0	8	128	-5
+41	1	1	1	16	-1.5
+42	1	1	1	16	-1.5
+42	2	1	1	16	-1.5
+42	3	1	1	16	-2
+42	4	1	1	16	-2
+43	1	1	1	16	-2
+44	1	1	1	16	-1.5
+44	2	1	1	16	-1.5
+44	3	1	1	16	-2
+44	4	1	1	16	-2
+44	5	1	1	16	-2
+45	1	1	1	16	-2
+46	1	1	1	16	-1.5
+46	2	1	1	16	-1.5
+46	3	1	1	16	-2
+46	4	1	1	16	-2
+46	5	1	1	16	-2
+47	1	1	1	16	-8
+48	1	1	1	16	-7.5
+41	-1	1	1	16	-1.5
+42	-1	1	1	16	-1.5
+42	-2	1	1	16	-1.5
+42	-3	1	1	16	-2
+42	-4	1	1	16	-2
+43	-1	1	1	16	-2
+44	-1	1	1	16	-1.5
+44	-2	1	1	16	-1.5
+44	-3	1	1	16	-2
+44	-4	1	1	16	-2
+44	-5	1	1	16	-2
+45	-1	1	1	16	-2
+46	-1	1	1	16	-1.5
+46	-2	1	1	16	-1.5
+46	-3	1	1	16	-2
+46	-4	1	1	16	-2
+46	-5	1	1	16	-2
+47	-1	1	1	16	-8
+48	-1	1	1	16	-7.5
+41	1	1	2	32	-1.5
+42	1	1	2	32	-1.5
+42	2	1	2	32	-1.5
+42	3	1	2	32	-2
+42	4	1	2	32	-2
+43	1	1	2	32	-2
+44	1	1	2	32	-1.5
+44	2	1	2	32	-1.5
+44	3	1	2	32	-2
+44	4	1	2	32	-2
+44	5	1	2	32	-2
+45	1	1	2	32	-2
+46	1	1	2	32	-1.5
+46	2	1	2	32	-1.5
+46	3	1	2	32	-2
+46	4	1	2	32	-2
+46	5	1	2	32	-2
+47	1	1	2	32	-8
+48	1	1	2	32	-7.5
+41	-1	1	2	32	-1.5
+42	-1	1	2	32	-1.5
+42	-2	1	2	32	-1.5
+42	-3	1	2	32	-2
+42	-4	1	2	32	-2
+43	-1	1	2	32	-2
+44	-1	1	2	32	-1.5
+44	-2	1	2	32	-1.5
+44	-3	1	2	32	-2
+44	-4	1	2	32	-2
+44	-5	1	2	32	-2
+45	-1	1	2	32	-2
+46	-1	1	2	32	-1.5
+46	-2	1	2	32	-1.5
+46	-3	1	2	32	-2
+46	-4	1	2	32	-2
+46	-5	1	2	32	-2
+47	-1	1	2	32	-8
+48	-1	1	2	32	-7.5
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/share/TGC_Digitization_StripPosition.dat b/MuonSpectrometer/MuonDigitization/TGC_Digitization/share/TGC_Digitization_StripPosition.dat
new file mode 100644
index 000000000000..1fc966361e2c
--- /dev/null
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/share/TGC_Digitization_StripPosition.dat
@@ -0,0 +1,608 @@
+41	1	1	-537.92
+41	1	2	-523.07
+41	1	3	-487.23
+41	1	4	-451.48
+41	1	5	-415.8
+41	1	6	-380.18
+41	1	7	-344.63
+41	1	8	-309.13
+41	1	9	-273.68
+41	1	10	-238.28
+41	1	11	-202.91
+41	1	12	-167.57
+41	1	13	-132.27
+41	1	14	-96.98
+41	1	15	-61.71
+41	1	16	-26.44
+41	1	17	8.81
+41	1	18	44.07
+41	1	19	79.34
+41	1	20	114.62
+41	1	21	149.92
+41	1	22	185.24
+41	1	23	220.59
+41	1	24	255.97
+41	1	25	291.4
+41	1	26	326.87
+41	1	27	362.4
+41	1	28	397.98
+41	1	29	433.63
+41	1	30	469.35
+41	1	31	505.14
+41	1	32	541.01
+42	1	1	-438.01
+42	1	2	-404.78
+42	1	3	-377.27
+42	1	4	-349.77
+42	1	5	-322.28
+42	1	6	-294.81
+42	1	7	-267.35
+42	1	8	-239.9
+42	1	9	-212.46
+42	1	10	-185.03
+42	1	11	-157.6
+42	1	12	-130.18
+42	1	13	-102.77
+42	1	14	-75.36
+42	1	15	-47.96
+42	1	16	-20.55
+42	1	17	6.85
+42	1	18	34.25
+42	1	19	61.66
+42	1	20	89.07
+42	1	21	116.48
+42	1	22	143.89
+42	1	23	171.31
+42	1	24	198.74
+42	1	25	226.18
+42	1	26	253.62
+42	1	27	281.08
+42	1	28	308.54
+42	1	29	336.02
+42	1	30	363.51
+42	1	31	391.02
+42	1	32	418.54
+42	2	1	-438.76
+42	2	2	-401.47
+42	2	3	-374.18
+42	2	4	-346.91
+42	2	5	-319.65
+42	2	6	-292.4
+42	2	7	-265.16
+42	2	8	-237.94
+42	2	9	-210.72
+42	2	10	-183.51
+42	2	11	-156.31
+42	2	12	-129.12
+42	2	13	-101.93
+42	2	14	-74.75
+42	2	15	-47.56
+42	2	16	-20.38
+42	2	17	6.79
+42	2	18	33.97
+42	2	19	61.15
+42	2	20	88.34
+42	2	21	115.52
+42	2	22	142.72
+42	2	23	169.91
+42	2	24	197.12
+42	2	25	224.33
+42	2	26	251.55
+42	2	27	278.78
+42	2	28	306.02
+42	2	29	333.28
+42	2	30	360.55
+42	2	31	387.83
+42	2	32	415.13
+42	3	1	-670.3
+42	3	2	-630
+42	3	3	-587.17
+42	3	4	-544.37
+42	3	5	-501.59
+42	3	6	-458.84
+42	3	7	-416.1
+42	3	8	-373.37
+42	3	9	-330.67
+42	3	10	-287.97
+42	3	11	-245.29
+42	3	12	-202.62
+42	3	13	-159.95
+42	3	14	-117.29
+42	3	15	-74.64
+42	3	16	-31.99
+42	3	17	10.66
+42	3	18	53.31
+42	3	19	95.96
+42	3	20	138.62
+42	3	21	181.28
+42	3	22	223.95
+42	3	23	266.63
+42	3	24	309.32
+42	3	25	352.02
+42	3	26	394.73
+42	3	27	437.46
+42	3	28	480.21
+42	3	29	522.98
+42	3	30	565.77
+42	3	31	608.58
+42	3	32	651.42
+42	4	1	-664.93
+42	4	2	-624.57
+42	4	3	-582.12
+42	4	4	-539.69
+42	4	5	-497.28
+42	4	6	-454.89
+42	4	7	-412.52
+42	4	8	-370.16
+42	4	9	-327.82
+42	4	10	-285.49
+42	4	11	-243.18
+42	4	12	-200.87
+42	4	13	-158.57
+42	4	14	-116.28
+42	4	15	-74
+42	4	16	-31.71
+42	4	17	10.57
+42	4	18	52.85
+42	4	19	95.14
+42	4	20	137.43
+42	4	21	179.72
+42	4	22	222.02
+42	4	23	264.33
+42	4	24	306.66
+42	4	25	348.99
+42	4	26	391.34
+42	4	27	433.7
+42	4	28	476.08
+42	4	29	518.48
+42	4	30	560.9
+42	4	31	603.34
+42	4	32	645.81
+43	1	1	-590.15
+43	1	2	-568.82
+43	1	3	-529.85
+43	1	4	-490.97
+43	1	5	-452.17
+43	1	6	-413.44
+43	1	7	-374.77
+43	1	8	-336.17
+43	1	9	-297.62
+43	1	10	-259.12
+43	1	11	-220.66
+43	1	12	-182.23
+43	1	13	-143.83
+43	1	14	-105.46
+43	1	15	-67.1
+43	1	16	-28.76
+43	1	17	9.59
+43	1	18	47.93
+43	1	19	86.28
+43	1	20	124.65
+43	1	21	163.03
+43	1	22	201.44
+43	1	23	239.88
+43	1	24	278.36
+43	1	25	316.89
+43	1	26	355.47
+43	1	27	394.1
+43	1	28	432.79
+43	1	29	471.56
+43	1	30	510.4
+43	1	31	549.32
+43	1	32	590.15
+44	1	1	-438.01
+44	1	2	-404.78
+44	1	3	-377.27
+44	1	4	-349.77
+44	1	5	-322.28
+44	1	6	-294.81
+44	1	7	-267.35
+44	1	8	-239.9
+44	1	9	-212.46
+44	1	10	-185.03
+44	1	11	-157.6
+44	1	12	-130.18
+44	1	13	-102.77
+44	1	14	-75.36
+44	1	15	-47.96
+44	1	16	-20.55
+44	1	17	6.85
+44	1	18	34.25
+44	1	19	61.66
+44	1	20	89.07
+44	1	21	116.48
+44	1	22	143.89
+44	1	23	171.31
+44	1	24	198.74
+44	1	25	226.18
+44	1	26	253.62
+44	1	27	281.08
+44	1	28	308.54
+44	1	29	336.02
+44	1	30	363.51
+44	1	31	391.02
+44	1	32	418.54
+44	2	1	-438.76
+44	2	2	-401.47
+44	2	3	-374.18
+44	2	4	-346.91
+44	2	5	-319.65
+44	2	6	-292.4
+44	2	7	-265.16
+44	2	8	-237.94
+44	2	9	-210.72
+44	2	10	-183.51
+44	2	11	-156.31
+44	2	12	-129.12
+44	2	13	-101.93
+44	2	14	-74.75
+44	2	15	-47.56
+44	2	16	-20.38
+44	2	17	6.79
+44	2	18	33.97
+44	2	19	61.15
+44	2	20	88.34
+44	2	21	115.52
+44	2	22	142.72
+44	2	23	169.91
+44	2	24	197.12
+44	2	25	224.33
+44	2	26	251.55
+44	2	27	278.78
+44	2	28	306.02
+44	2	29	333.28
+44	2	30	360.55
+44	2	31	387.83
+44	2	32	415.13
+44	3	1	-670.3
+44	3	2	-630
+44	3	3	-587.17
+44	3	4	-544.37
+44	3	5	-501.59
+44	3	6	-458.84
+44	3	7	-416.1
+44	3	8	-373.37
+44	3	9	-330.67
+44	3	10	-287.97
+44	3	11	-245.29
+44	3	12	-202.62
+44	3	13	-159.95
+44	3	14	-117.29
+44	3	15	-74.64
+44	3	16	-31.99
+44	3	17	10.66
+44	3	18	53.31
+44	3	19	95.96
+44	3	20	138.62
+44	3	21	181.28
+44	3	22	223.95
+44	3	23	266.63
+44	3	24	309.32
+44	3	25	352.02
+44	3	26	394.73
+44	3	27	437.46
+44	3	28	480.21
+44	3	29	522.98
+44	3	30	565.77
+44	3	31	608.58
+44	3	32	651.42
+44	4	1	-664.93
+44	4	2	-624.57
+44	4	3	-582.12
+44	4	4	-539.69
+44	4	5	-497.28
+44	4	6	-454.89
+44	4	7	-412.52
+44	4	8	-370.16
+44	4	9	-327.82
+44	4	10	-285.49
+44	4	11	-243.18
+44	4	12	-200.87
+44	4	13	-158.57
+44	4	14	-116.28
+44	4	15	-74
+44	4	16	-31.71
+44	4	17	10.57
+44	4	18	52.85
+44	4	19	95.14
+44	4	20	137.43
+44	4	21	179.72
+44	4	22	222.02
+44	4	23	264.33
+44	4	24	306.66
+44	4	25	348.99
+44	4	26	391.34
+44	4	27	433.7
+44	4	28	476.08
+44	4	29	518.48
+44	4	30	560.9
+44	4	31	603.34
+44	4	32	645.81
+44	5	1	-741.67
+44	5	2	-706.03
+44	5	3	-658.03
+44	5	4	-610.07
+44	5	5	-562.13
+44	5	6	-514.21
+44	5	7	-466.31
+44	5	8	-418.43
+44	5	9	-370.57
+44	5	10	-322.73
+44	5	11	-274.89
+44	5	12	-227.07
+44	5	13	-179.25
+44	5	14	-131.45
+44	5	15	-83.65
+44	5	16	-35.85
+44	5	17	11.95
+44	5	18	59.75
+44	5	19	107.55
+44	5	20	155.35
+44	5	21	203.16
+44	5	22	250.98
+44	5	23	298.81
+44	5	24	346.65
+44	5	25	394.5
+44	5	26	442.37
+44	5	27	490.26
+44	5	28	538.17
+44	5	29	586.1
+44	5	30	634.05
+44	5	31	682.03
+44	5	32	730.03
+45	1	1	-590.15
+45	1	2	-579.94
+45	1	3	-540.21
+45	1	4	-500.57
+45	1	5	-461.01
+45	1	6	-421.52
+45	1	7	-382.1
+45	1	8	-342.74
+45	1	9	-303.44
+45	1	10	-264.18
+45	1	11	-224.97
+45	1	12	-185.79
+45	1	13	-146.65
+45	1	14	-107.52
+45	1	15	-68.42
+45	1	16	-29.32
+45	1	17	9.77
+45	1	18	48.87
+45	1	19	87.97
+45	1	20	127.08
+45	1	21	166.22
+45	1	22	205.38
+45	1	23	244.57
+45	1	24	283.81
+45	1	25	323.08
+45	1	26	362.41
+45	1	27	401.8
+45	1	28	441.25
+45	1	29	480.78
+45	1	30	520.38
+45	1	31	560.06
+45	1	32	599.84
+46	1	1	-438.01
+46	1	2	-404.78
+46	1	3	-377.27
+46	1	4	-349.77
+46	1	5	-322.28
+46	1	6	-294.81
+46	1	7	-267.35
+46	1	8	-239.9
+46	1	9	-212.46
+46	1	10	-185.03
+46	1	11	-157.6
+46	1	12	-130.18
+46	1	13	-102.77
+46	1	14	-75.36
+46	1	15	-47.96
+46	1	16	-20.55
+46	1	17	6.85
+46	1	18	34.25
+46	1	19	61.66
+46	1	20	89.07
+46	1	21	116.48
+46	1	22	143.89
+46	1	23	171.31
+46	1	24	198.74
+46	1	25	226.18
+46	1	26	253.62
+46	1	27	281.08
+46	1	28	308.54
+46	1	29	336.02
+46	1	30	363.51
+46	1	31	391.02
+46	1	32	418.54
+46	2	1	-438.76
+46	2	2	-401.47
+46	2	3	-374.18
+46	2	4	-346.91
+46	2	5	-319.65
+46	2	6	-292.4
+46	2	7	-265.16
+46	2	8	-237.94
+46	2	9	-210.72
+46	2	10	-183.51
+46	2	11	-156.31
+46	2	12	-129.12
+46	2	13	-101.93
+46	2	14	-74.75
+46	2	15	-47.56
+46	2	16	-20.38
+46	2	17	6.79
+46	2	18	33.97
+46	2	19	61.15
+46	2	20	88.34
+46	2	21	115.52
+46	2	22	142.72
+46	2	23	169.91
+46	2	24	197.12
+46	2	25	224.33
+46	2	26	251.55
+46	2	27	278.78
+46	2	28	306.02
+46	2	29	333.28
+46	2	30	360.55
+46	2	31	387.83
+46	2	32	415.13
+46	3	1	-670.3
+46	3	2	-630
+46	3	3	-587.17
+46	3	4	-544.37
+46	3	5	-501.59
+46	3	6	-458.84
+46	3	7	-416.1
+46	3	8	-373.37
+46	3	9	-330.67
+46	3	10	-287.97
+46	3	11	-245.29
+46	3	12	-202.62
+46	3	13	-159.95
+46	3	14	-117.29
+46	3	15	-74.64
+46	3	16	-31.99
+46	3	17	10.66
+46	3	18	53.31
+46	3	19	95.96
+46	3	20	138.62
+46	3	21	181.28
+46	3	22	223.95
+46	3	23	266.63
+46	3	24	309.32
+46	3	25	352.02
+46	3	26	394.73
+46	3	27	437.46
+46	3	28	480.21
+46	3	29	522.98
+46	3	30	565.77
+46	3	31	608.58
+46	3	32	651.42
+46	4	1	-664.93
+46	4	2	-624.57
+46	4	3	-582.12
+46	4	4	-539.69
+46	4	5	-497.28
+46	4	6	-454.89
+46	4	7	-412.52
+46	4	8	-370.16
+46	4	9	-327.82
+46	4	10	-285.49
+46	4	11	-243.18
+46	4	12	-200.87
+46	4	13	-158.57
+46	4	14	-116.28
+46	4	15	-74
+46	4	16	-31.71
+46	4	17	10.57
+46	4	18	52.85
+46	4	19	95.14
+46	4	20	137.43
+46	4	21	179.72
+46	4	22	222.02
+46	4	23	264.33
+46	4	24	306.66
+46	4	25	348.99
+46	4	26	391.34
+46	4	27	433.7
+46	4	28	476.08
+46	4	29	518.48
+46	4	30	560.9
+46	4	31	603.34
+46	4	32	645.81
+46	5	1	-741.67
+46	5	2	-706.03
+46	5	3	-658.03
+46	5	4	-610.07
+46	5	5	-562.13
+46	5	6	-514.21
+46	5	7	-466.31
+46	5	8	-418.43
+46	5	9	-370.57
+46	5	10	-322.73
+46	5	11	-274.89
+46	5	12	-227.07
+46	5	13	-179.25
+46	5	14	-131.45
+46	5	15	-83.65
+46	5	16	-35.85
+46	5	17	11.95
+46	5	18	59.75
+46	5	19	107.55
+46	5	20	155.35
+46	5	21	203.16
+46	5	22	250.98
+46	5	23	298.81
+46	5	24	346.65
+46	5	25	394.5
+46	5	26	442.37
+46	5	27	490.26
+46	5	28	538.17
+46	5	29	586.1
+46	5	30	634.05
+46	5	31	682.03
+46	5	32	730.03
+47	1	1	-586.2
+47	1	2	-546.67
+47	1	3	-509.27
+47	1	4	-471.94
+47	1	5	-434.68
+47	1	6	-397.47
+47	1	7	-360.33
+47	1	8	-323.23
+47	1	9	-286.18
+47	1	10	-249.17
+47	1	11	-212.19
+47	1	12	-175.25
+47	1	13	-138.33
+47	1	14	-101.42
+47	1	15	-64.54
+47	1	16	-27.66
+47	1	17	9.22
+47	1	18	46.1
+47	1	19	82.98
+47	1	20	119.87
+47	1	21	156.78
+47	1	22	193.72
+47	1	23	230.68
+47	1	24	267.67
+47	1	25	304.7
+47	1	26	341.77
+47	1	27	378.89
+47	1	28	416.07
+47	1	29	453.3
+47	1	30	490.6
+47	1	31	527.96
+47	1	32	565.4
+48	1	1	-517.54
+48	1	2	-481.84
+48	1	3	-449.05
+48	1	4	-416.29
+48	1	5	-383.55
+48	1	6	-350.84
+48	1	7	-318.14
+48	1	8	-285.46
+48	1	9	-252.8
+48	1	10	-220.15
+48	1	11	-187.51
+48	1	12	-154.89
+48	1	13	-122.27
+48	1	14	-89.66
+48	1	15	-57.05
+48	1	16	-24.45
+48	1	17	8.15
+48	1	18	40.75
+48	1	19	73.36
+48	1	20	105.96
+48	1	21	138.58
+48	1	22	171.2
+48	1	23	203.83
+48	1	24	236.47
+48	1	25	269.13
+48	1	26	301.8
+48	1	27	334.49
+48	1	28	367.19
+48	1	29	399.92
+48	1	30	432.67
+48	1	31	465.44
+48	1	32	498.24
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.cxx b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.cxx
index 0e92fd2117ae..92e7bd9c54bc 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.cxx
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.cxx
@@ -15,6 +15,7 @@
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "MuonReadoutGeometry/TgcReadoutElement.h"
 
+#include "AthenaBaseComps/AthCheckMacros.h"
 #include "GaudiKernel/MsgStream.h"
 #include "PathResolver/PathResolver.h"
 
@@ -30,6 +31,7 @@
 TgcDigitMaker::TgcDigitMaker(TgcHitIdHelper*                    hitIdHelper,
 			     const MuonGM::MuonDetectorManager* mdManager,
 			     unsigned int                       runperiod)
+  : AthMessaging (Athena::getMessageSvc(), "TgcDigitMaker")
 {
   m_hitIdHelper             = hitIdHelper;
   m_mdManager               = mdManager;
@@ -62,24 +64,28 @@ StatusCode TgcDigitMaker::initialize()
   // initialize the TGC identifier helper
   m_idHelper = m_mdManager->tgcIdHelper();
   
-  if (readFileOfTimeJitter().isFailure()) {
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK(readFileOfTimeJitter());
 
   // Read share/TGC_Digitization_energyThreshold.dat file and store values in m_energyThreshold. 
-  readFileOfEnergyThreshold();
+  ATH_CHECK(readFileOfEnergyThreshold());
 
   // Read share/TGC_Digitization_crossTalk.dat file and store values in m_crossTalk.
-  readFileOfCrossTalk();
+  ATH_CHECK(readFileOfCrossTalk());
 
   // Read share/TGC_Digitization_deadChamber.dat file and store values in m_isDeadChamber. 
-  readFileOfDeadChamber();
+  ATH_CHECK(readFileOfDeadChamber());
 
   // Read share/TGC_Digitization_timeWindowOffset.dat file and store values in m_timeWindowOffset. 
-  readFileOfTimeWindowOffset();
+  ATH_CHECK(readFileOfTimeWindowOffset());
 
   // Read share/TGC_Digitization_alignment.dat file and store values in m_alignmentZ, m_alignmentT, m_alignmentS, m_alignmentTHS
-  readFileOfAlignment();
+  ATH_CHECK(readFileOfAlignment());
+
+  // Read share/TGC_Digitization_ASDpropTimeOffset.dat file and store values in m_ASDpropTimeOffset, m_maxch.
+  ATH_CHECK(readFileOfASDpropTimeOffset());
+
+  // Read share/TGC_Digitization_StripPosition.dat file and store values in m_StripPosition.
+  ATH_CHECK(readFileOfStripPosition());
 
   return StatusCode::SUCCESS;
 }
@@ -88,7 +94,8 @@ StatusCode TgcDigitMaker::initialize()
 // Execute Digitization
 //---------------------------------------------------
 TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
-					       const double globalHitTime,
+                                               const double globalHitTime,
+                                               const TgcDigitASDposData* ASDpos,
                                                CLHEP::HepRandomEngine* rndmEngine)
 {
   //////////  convert ID for this digitizer system 
@@ -97,21 +104,20 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
   int         stationEta = m_hitIdHelper->GetStationEta(Id);
   int         stationPhi = m_hitIdHelper->GetStationPhi(Id);
   int         ilyr       = m_hitIdHelper->GetGasGap(Id);
-  if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "executeDigi() Got HIT Id." << endmsg;
+  ATH_MSG_DEBUG("executeDigi() Got HIT Id.");
 
   // Check the chamber is dead or not. 
   if(isDeadChamber(stationName, stationEta, stationPhi, ilyr)) return nullptr;
 
   const Identifier elemId = m_idHelper -> elementID(stationName,stationEta,stationPhi);
-  if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "executeDigi() - element identifier is: " << m_idHelper->show_to_string(elemId) << endmsg;
+  ATH_MSG_DEBUG("executeDigi() - element identifier is: " << m_idHelper->show_to_string(elemId));
 
   const MuonGM::TgcReadoutElement *tgcChamber = m_mdManager->getTgcReadoutElement(elemId);
   if(!tgcChamber) {
-    if(msgLevel(MSG::WARNING)) msg(MSG::WARNING) << "executeDigi() - no ReadoutElement found for " << m_idHelper->show_to_string(elemId) << endmsg;
+    ATH_MSG_WARNING("executeDigi() - no ReadoutElement found for " << m_idHelper->show_to_string(elemId));
     return nullptr;
   }
 
-  
   const Amg::Vector3D centreChamber = tgcChamber->globalPosition();
   float height                   = tgcChamber->getRsize();
   float hmin                     = sqrt(pow(centreChamber.x(),2)+pow(centreChamber.y(),2)) - height/2.;
@@ -119,16 +125,13 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
   float frameZwidth = 17. *CLHEP::mm;
   float frameXwidth = 20. *CLHEP::mm;
   
-
-
   IdContext tgcContext = m_idHelper->module_context();
   IdentifierHash coll_hash;
   if(m_idHelper->get_hash(elemId, coll_hash, &tgcContext)) {
-    if(msgLevel(MSG::WARNING)) msg(MSG::WARNING) << "Unable to get TGC hash id from TGC Digit collection "
+    ATH_MSG_WARNING("Unable to get TGC hash id from TGC Digit collection "
 						 << "context begin_index = " << tgcContext.begin_index()
 						 << " context end_index  = " << tgcContext.end_index()
-						 << " the identifier is "
-						 << endmsg;
+						 << " the identifier is " << elemId);
     elemId.show();
   }
   
@@ -193,15 +196,14 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
 
       // check a hit in the sensitive area
       if(zPosInSensArea < 0. || zPosInSensArea > tgcChamber->getTotalWires(ilyr)*wirePitch) {
-	iWireGroup[iPosition] = 0;
-	posInWireGroup[iPosition] = 0.;
-	if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "executeDigi(): Wire: Hit position located at outside of a sensitive volume, "
+        iWireGroup[iPosition] = 0;
+        posInWireGroup[iPosition] = 0.;
+	      ATH_MSG_DEBUG("executeDigi(): Wire: Hit position located at outside of a sensitive volume, "
 						 << " id: " << stationName << "/" << stationEta << "/" << stationPhi << "/" << ilyr
 						 << " position: " << zPosInSensArea
 						 << " xlocal: " << zLocal 
 						 << " dir cosine: " << direCos[0] << "/" << direCos[1] << "/" << direCos[2]
-						 << " active region: " << height-frameZwidth*2.
-						 << endmsg;
+						 << " active region: " << height-frameZwidth*2.);
       }
       else {
 	int igang      = 1;
@@ -222,7 +224,7 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
     int iWG[2] = {iWireGroup[jWG[0]], iWireGroup[jWG[1]]};
     float posInWG[2] = {posInWireGroup[jWG[0]], posInWireGroup[jWG[1]]};
     if(iWG[0]!=iWG[1]) {
-      if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "executeDigi(): Multihits found in WIRE GROUPs:" << iWG[0] << " " << iWG[1] << endmsg;
+      ATH_MSG_DEBUG("executeDigi(): Multihits found in WIRE GROUPs:" << iWG[0] << " " << iWG[1]);
     }
 
     for(int iwg=iWG[0]; iwg<=iWG[1]; iwg++) {
@@ -234,16 +236,29 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
 	float ySignPhi = (stationPhi%2==1) ? -1. : +1.; 
 	// stationPhi%2==0 : +1. : ASD attached at the smaller phi side of TGC 
 	// stationPhi%2==1 : -1. : ASD attached at the larger phi side of TGC
-	float wDigitTime = bunchTime + jit + wirePropagationTime*(ySignPhi*yLocal + tgcChamber->chamberWidth(zLocal)/2.) + this->timeDiffByCableRadiusOfInner(iStationName, stationPhi, iwg);
+  float wTimeDiffByRadiusOfInner = this->timeDiffByCableRadiusOfInner(iStationName, stationPhi, iwg);
+	float wDigitTime = bunchTime + jit + wirePropagationTime*(ySignPhi*yLocal + tgcChamber->chamberWidth(zLocal)/2.) + wTimeDiffByRadiusOfInner;
+  float wOffset = m_timeWindowOffsetSensor[sensor];
+  float wASDDis{-1000};
+  float wSigPropTimeDelay{-1000};
+  if (ASDpos != nullptr) {
+    wASDDis = this->getDistanceToAsdFromSensor(ASDpos, iStationName, abs(stationEta), stationPhi, sensor, iwg, zLocal);
+    float wCableDis = wASDDis + (ySignPhi*yLocal + tgcChamber->chamberWidth(zLocal)/2.)/1000.;
+    wSigPropTimeDelay = this->getSigPropTimeDelay(wCableDis);
+    wDigitTime += wSigPropTimeDelay + wASDDis * 5;
+    wOffset += getASDpropTimeOffset(elemId, (int)sensor, iwg);
+  }
+
 	TgcStation station = (m_idHelper->stationName(elemId) > 46) ? kINNER : kOUTER;
-        uint16_t bctag = bcTagging(wDigitTime,m_gateTimeWindow[station][sensor],m_timeWindowOffsetSensor[sensor]);
+        uint16_t bctag = bcTagging(wDigitTime,m_gateTimeWindow[station][sensor],wOffset);
 
-        if(bctag == 0x0) {
-	  if(msgLevel(MSG::DEBUG)) {
-	    msg(MSG::DEBUG ) << "WireGroup: digitized time is outside of time window. " << wDigitTime
+    if(bctag == 0x0) {
+	    ATH_MSG_DEBUG("WireGroup: digitized time is outside of time window. " << wDigitTime
 			     << " bunchTime: " << bunchTime << " time jitter: " << jitter 
-			     << " propagation time: " << wirePropagationTime*(ySignPhi*yLocal + height/2. + frameXwidth) << endmsg;
-	  }
+			     << " propagation time: " << wirePropagationTime*(ySignPhi*yLocal + height/2. + frameXwidth)
+			     << " signal delay time: " << wSigPropTimeDelay
+			     << " time difference by cable radius of inner station: " << wTimeDiffByRadiusOfInner
+			     << " propagation time to the ASD from the sensor: " << wASDDis * 5);
 	}
 	else {
 	  Identifier newId = m_idHelper -> channelID(stationName,stationEta,stationPhi,
@@ -254,19 +269,18 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
 	    randomCrossTalk(elemId, ilyr, sensor, iwg, posInWG[0], wDigitTime, rndmEngine, digits.get());
 	  }	 
  
-	  if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "WireGroup: newid breakdown digitTime x/y/z direcos height_gang bctag: "
+	  ATH_MSG_DEBUG("WireGroup: newid breakdown digitTime x/y/z direcos height_gang bctag: "
 						   << newId << " " << stationName << "/" << stationEta << "/" << stationPhi << "/" << ilyr << "/"
 						   << sensor << "/" << iwg << " " 
 						   << wDigitTime << " " << localPos.x() << "/"  << localPos.y() << "/" << localPos.z() << " "
 						   << direCos.x() << "/"  << direCos.y() << "/" << direCos.z() << " "
 						   << height << " " << tgcChamber->getNWires(ilyr,iwg) << " "
-						   << bctag << endmsg;
-	}
+						   << bctag);
+  }
       }
       else {
-	if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "Wire Gang id is out of range. id, x/y/z, height: " << iwg
-						  << " " << localPos.x() << "/"  << localPos.y() << "/" << localPos.z() << " " << height
-						  << endmsg;
+	      ATH_MSG_DEBUG("Wire Gang id is out of range. id, x/y/z, height: " << iwg
+						  << " " << localPos.x() << "/"  << localPos.y() << "/" << localPos.z() << " " << height);
       }
     }
   } // end of wire group calculation
@@ -290,20 +304,18 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
       // check a hit in the sensitive area
       float zPos = zLocal+height/2.-frameZwidth;
       if (zPos < 0.) {
-	iStrip[iPosition] = 0;
-	posInStrip[iPosition] = 0.;
-	if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "Strip: Hit position located at outside of a sensitive volume, id, position, xlocal0/1, dir cosine: "
+        iStrip[iPosition] = 0;
+        posInStrip[iPosition] = 0.;
+        ATH_MSG_DEBUG("Strip: Hit position located at outside of a sensitive volume, id, position, xlocal0/1, dir cosine: "
 						 << stationName << "/" << stationEta << "/" << stationPhi << "/" << ilyr
-						 << zPos << " " << zLocal << " " << direCos[0] << "/" << direCos[1] << "/" << direCos[2]
-						 << endmsg;
+						 << zPos << " " << zLocal << " " << direCos[0] << "/" << direCos[1] << "/" << direCos[2]);
       }
       else if (zPos > height-frameZwidth*2.) {
-	iStrip[iPosition] =  tgcChamber -> getNStrips(ilyr) + 1;
-	posInStrip[iPosition] = 0.;
-	if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "Strip: Hit position located at outside of a sensitive volume, id, position, active region: "
+        iStrip[iPosition] =  tgcChamber -> getNStrips(ilyr) + 1;
+        posInStrip[iPosition] = 0.;
+        ATH_MSG_DEBUG("Strip: Hit position located at outside of a sensitive volume, id, position, active region: "
 						 << stationName << "/" << stationEta << "/" << stationPhi << "/" << ilyr
-						 << zPos << " " << height-frameZwidth*2.
-						 << endmsg;
+						 << zPos << " " << height-frameZwidth*2.);
       }
       else { // sensitive area
 
@@ -321,9 +333,8 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
 	  }
 	  float phiLocal = atan2(yLocal, zLocal+ height/2.+hmin);
 
-	  if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "dphi, phiLocal, yLocal, zLocall+ height/2.+hmin: "
-						   << dphi << " " << phiLocal << " " << yLocal << " " << zLocal+height/2.+hmin
-						   << endmsg;
+	  ATH_MSG_DEBUG("dphi, phiLocal, yLocal, zLocall+ height/2.+hmin: "
+						   << dphi << " " << phiLocal << " " << yLocal << " " << zLocal+height/2.+hmin);
 
 	  int istr = 0;
 	  if ((stationEta > 0 && ilyr == 1) ||
@@ -360,7 +371,7 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
     int iStr[2] = {iStrip[jStr[0]], iStrip[jStr[1]]};
     float posInStr[2] = {posInStrip[jStr[0]], posInStrip[jStr[1]]};
     if(iStr[0]!=iStr[1]) {
-      if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "Multihits found in STRIPs:" << iStr[0] << " " << iStr[1] << endmsg;
+      ATH_MSG_DEBUG("Multihits found in STRIPs:" << iStr[0] << " " << iStr[1]);
     }
 
     for(int istr=iStr[0]; istr<=iStr[1]; istr++) {
@@ -374,18 +385,29 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
 	float zSignEta = (abs(stationEta)%2 == 1 && abs(stationEta) != 5) ? -1. : +1.;
 	// if(abs(stationEta)%2 == 1 && abs(stationEta) != 5) : -1. : ASD attached at the longer base of TGC
 	// else                                               : +1. : ASD attached at the shorter base of TGC   
-	float sDigitTime = bunchTime + jitter + stripPropagationTime*(height/2. + frameZwidth + zSignEta*zLocal) + this->timeDiffByCableRadiusOfInner(iStationName, stationPhi, istr);
+  float sTimeDiffByRadiusOfInner = this->timeDiffByCableRadiusOfInner(iStationName, stationPhi, istr);
+	float sDigitTime = bunchTime + jitter + stripPropagationTime*(height/2. + frameZwidth + zSignEta*zLocal) + sTimeDiffByRadiusOfInner;
+  float sOffset = m_timeWindowOffsetSensor[sensor];
+  float sASDDis{-1000};
+  float sSigPropTimeDelay{-1000};
+  if (ASDpos != nullptr) {
+    sASDDis = this->getDistanceToAsdFromSensor(ASDpos, iStationName, abs(stationEta), stationPhi, sensor, istr, getStripPosition(stationName, abs(stationEta), istr));
+    float sCableDis = sASDDis + (height/2. + frameZwidth + zSignEta*zLocal)/1000.;
+    sSigPropTimeDelay = this->getSigPropTimeDelay(sCableDis);
+    sDigitTime += sSigPropTimeDelay + sASDDis * 5;
+    sOffset += getASDpropTimeOffset(elemId, (int)sensor, istr);
+  }
 
 	TgcStation station = (m_idHelper->stationName(elemId) > 46) ? kINNER : kOUTER;
-	uint16_t bctag = bcTagging(sDigitTime,m_gateTimeWindow[station][sensor],m_timeWindowOffsetSensor[sensor]);
+	uint16_t bctag = bcTagging(sDigitTime,m_gateTimeWindow[station][sensor],sOffset);
 
 	if(bctag == 0x0) {
-	  if(msgLevel(MSG::DEBUG)) {
-	    msg(MSG::DEBUG) << "Strip: Digitized time is outside of time window. " << sDigitTime
+	  ATH_MSG_DEBUG("Strip: Digitized time is outside of time window. " << sDigitTime
 			    << " bunchTime: " << bunchTime << " time jitter: " << jitter 
 			    << " propagation time: " << stripPropagationTime*(height/2. + frameZwidth + zSignEta*zLocal)
-			    << endmsg;
-	  }
+			    << " signal delay time: " << sSigPropTimeDelay
+			    << " time difference by cable radius of inner station: " << sTimeDiffByRadiusOfInner
+			    << " propagation time to the ASD from the sensor: " << sASDDis * 5);
 	}
 	else {
 	  Identifier newId = m_idHelper -> channelID(stationName,stationEta,stationPhi,
@@ -396,17 +418,17 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
 	    randomCrossTalk(elemId, ilyr, sensor, iStr[0], posInStr[0], sDigitTime, rndmEngine, digits.get());
 	  }
 
-	  if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "Strip: newid breakdown digitTime x/y/z direcos r_center bctag: "
+	  ATH_MSG_DEBUG("Strip: newid breakdown digitTime x/y/z direcos r_center bctag: "
 						   << newId << " " << stationName << "/" << stationEta << "/" << stationPhi << "/" << ilyr << "/"
 						   << sensor << "/" << istr << " "
 						   << sDigitTime << " " << localPos.x() << "/" << localPos.y() << "/" << localPos.z() << " " 
 						   << direCos.x() << "/"  << direCos.y() << "/" << direCos.z() << " "
 						   << height/2.+hmin << " "
-						   << bctag << endmsg;
+						   << bctag);
 	}
       }
       else {
-	if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "Strip id is out of range: gap, id: " << ilyr << " " << istr << endmsg;
+	      ATH_MSG_DEBUG("Strip id is out of range: gap, id: " << ilyr << " " << istr);
       }
     }
   } // end of strip number calculation
@@ -414,9 +436,6 @@ TgcDigitCollection* TgcDigitMaker::executeDigi(const TGCSimHit* hit,
   return digits.release();
 }
 
-MsgStream& TgcDigitMaker::msg(const MSG::Level lvl) const { return m_msg << lvl ; }
-bool TgcDigitMaker::msgLevel(const MSG::Level lvl) const { return m_msg.get().level() <= lvl ; }
-void TgcDigitMaker::setMessageLevel(const MSG::Level lvl) const { m_msg.get().setLevel(lvl); return; }
 
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 StatusCode TgcDigitMaker::readFileOfTimeJitter()
@@ -430,12 +449,12 @@ StatusCode TgcDigitMaker::readFileOfTimeJitter()
     ifs.open(fileWithPath.c_str(), std::ios::in);
   }
   else {
-    msg(MSG::FATAL) << "readFileOfTimeJitter(): Could not find file " << fileName << endmsg;
+    ATH_MSG_FATAL("readFileOfTimeJitter(): Could not find file " << fileName);
     return StatusCode::FAILURE;
   }
 
   if(ifs.bad()){
-    msg(MSG::FATAL) << "readFileOfTimeJitter(): Could not open file "<< fileName << endmsg;
+    ATH_MSG_FATAL("readFileOfTimeJitter(): Could not open file "<< fileName);
     return StatusCode::FAILURE;
   }
 
@@ -443,20 +462,20 @@ StatusCode TgcDigitMaker::readFileOfTimeJitter()
   int bins = 0;
   int i = 0;
   float prob = 0.;
+  bool verbose = msgLvl(MSG::VERBOSE);
 
   while(ifs.good()){
     ifs >> angle >> bins;
     if (ifs.eof()) break;
-    if(msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "readFileOfTimeJitter(): Timejitter, angle, Number of bins, prob. dist.: " << angle << " " << bins << " ";
+    ATH_MSG_VERBOSE("readFileOfTimeJitter(): Timejitter, angle, Number of bins, prob. dist.: " << angle << " " << bins << " ");
     m_vecAngle_Time.resize(i + 1);
     for (int j = 0; j < 41/*bins*/; j++) {
       ifs >> prob;
       m_vecAngle_Time[i].push_back(prob);
-      if (j == 0)
-	if(msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << "readFileOfTimeJitter(): ";
-      if(msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << prob << " ";
+      if (j == 0 && verbose) msg(MSG::VERBOSE) << "readFileOfTimeJitter(): ";
+      if(verbose) msg(MSG::VERBOSE) << prob << " ";
     }
-    if(msgLevel(MSG::VERBOSE)) msg(MSG::VERBOSE) << endmsg;
+    if(verbose) msg(MSG::VERBOSE) << endmsg;
     i++;
   }
   ifs.close();
@@ -495,7 +514,7 @@ float TgcDigitMaker::timeJitter(const Amg::Vector3D& direCosLocal, CLHEP::HepRan
 //+++++++++++++++++++++++++++++++++++++++++++++++
 bool TgcDigitMaker::efficiencyCheck(const TgcSensor sensor, CLHEP::HepRandomEngine* rndmEngine) const {
     if(CLHEP::RandFlat::shoot(rndmEngine,0.0,1.0) < m_efficiency[sensor]) return true;
-    if(msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << "efficiencyCheck(): Hit removed for sensor= " << sensor << "(0=WIRE,1=STRIP)" << endmsg;
+    ATH_MSG_DEBUG("efficiencyCheck(): Hit removed for sensor= " << sensor << "(0=WIRE,1=STRIP)");
   return false;
 }
 //+++++++++++++++++++++++++++++++++++++++++++++++
@@ -563,7 +582,7 @@ void TgcDigitMaker::addDigit(const Identifier id, const uint16_t bctag, TgcDigit
   return;
 }
 
-void TgcDigitMaker::readFileOfEnergyThreshold() {
+StatusCode TgcDigitMaker::readFileOfEnergyThreshold() {
   // Indices to be used 
   int iStationName, stationEta, stationPhi, gasGap, isStrip;
 
@@ -583,16 +602,16 @@ void TgcDigitMaker::readFileOfEnergyThreshold() {
   const std::string fileName = "TGC_Digitization_energyThreshold.dat";
   std::string fileWithPath = PathResolver::find_file(fileName.c_str(), "DATAPATH");
   if(fileWithPath.empty()) {
-    msg(MSG::FATAL) << "readFileOfEnergyThreshold(): Could not find file " << fileName.c_str() << endmsg;
-    return;
+    ATH_MSG_FATAL("readFileOfEnergyThreshold(): Could not find file " << fileName);
+    return StatusCode::FAILURE;
   }
 
   // Open the TGC_Digitization_energyThreshold.dat file 
   std::ifstream ifs;
   ifs.open(fileWithPath.c_str(), std::ios::in);
   if(ifs.bad()) {
-    msg(MSG::FATAL) << "readFileOfEnergyThreshold(): Could not open file " << fileName.c_str() << endmsg;
-    return;
+    ATH_MSG_FATAL("readFileOfEnergyThreshold(): Could not open file " << fileName);
+    return StatusCode::FAILURE;
   }
     
   double energyThreshold; 
@@ -600,17 +619,14 @@ void TgcDigitMaker::readFileOfEnergyThreshold() {
   while(ifs.good()) {
     ifs >> iStationName >> stationEta 
       	>> stationPhi 
-	>> gasGap >> isStrip >> energyThreshold;
-    if(msgLevel(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << "TgcDigitMaker::readFileOfEnergyThreshold" 
+        >> gasGap >> isStrip >> energyThreshold;
+    ATH_MSG_DEBUG("readFileOfEnergyThreshold" 
 		      << " stationName= " << iStationName  
 		      << " stationEta= " << stationEta 
 		      << " stationPhi= " << stationPhi
 		      << " gasGap= " << gasGap 
 		      << " isStrip= " << isStrip
-		      << " energyThreshold(MeV)= " << energyThreshold
-		      << endmsg;
-    }
+		      << " energyThreshold(MeV)= " << energyThreshold);
 
     // Subtract offsets to use indices of energyThreshold array
     iStationName -= OFFSET_STATIONNAME;
@@ -634,9 +650,11 @@ void TgcDigitMaker::readFileOfEnergyThreshold() {
 
   // Close the TGC_Digitization_energyThreshold.dat file 
   ifs.close();
+
+  return StatusCode::SUCCESS;
 }
 
-void TgcDigitMaker::readFileOfCrossTalk() {
+StatusCode TgcDigitMaker::readFileOfCrossTalk() {
   // Indices to be used 
   int iStationName = -1;
   int stationEta = -1;
@@ -663,16 +681,16 @@ void TgcDigitMaker::readFileOfCrossTalk() {
   const std::string fileName = "TGC_Digitization_crossTalk.dat";
   std::string fileWithPath = PathResolver::find_file(fileName.c_str(), "DATAPATH");
   if(fileWithPath.empty()) {
-    msg(MSG::FATAL) << "readFileOfCrossTalk(): Could not find file " << fileName.c_str() << endmsg;
-    return;
+    ATH_MSG_FATAL("readFileOfCrossTalk(): Could not find file " << fileName);
+    return StatusCode::FAILURE;
   }
 
   // Open the TGC_Digitization_crossTalk.dat file 
   std::ifstream ifs;
   ifs.open(fileWithPath.c_str(), std::ios::in);
   if(ifs.bad()) {
-    msg(MSG::FATAL) << "readFileOfCrossTalk(): Could not open file " << fileName.c_str() << endmsg;
-    return;
+    ATH_MSG_FATAL("readFileOfCrossTalk(): Could not open file " << fileName);
+    return StatusCode::FAILURE;
   }
     
   double crossTalk_10 = 0.; 
@@ -682,8 +700,7 @@ void TgcDigitMaker::readFileOfCrossTalk() {
   // Read the TGC_Digitization_crossTalk.dat file
   while(ifs.good()) {
     ifs >> iStationName >> stationEta >> /*stationPhi >>*/ gasGap >> isStrip >> crossTalk_10 >> crossTalk_11 >> crossTalk_20 >> crossTalk_21;
-    if(msgLevel(MSG::DEBUG)) {
-      msg(MSG::DEBUG) << "TgcDigitMaker::readFileOfCrossTalk" 
+    ATH_MSG_DEBUG("TgcDigitMaker::readFileOfCrossTalk" 
 		      << " stationName= " << iStationName  
 		      << " stationEta= " << stationEta 
 	//		      << " stationPhi= " << stationPhi
@@ -692,9 +709,7 @@ void TgcDigitMaker::readFileOfCrossTalk() {
 		      << " prob(10) " << crossTalk_10
 		      << " prob(11) " << crossTalk_11
 		      << " prob(20) " << crossTalk_20
-		      << " prob(21) " << crossTalk_21
-		      << endmsg;
-    }
+		      << " prob(21) " << crossTalk_21);
 
     // Subtract offsets to use indices of crossTalk array
     iStationName -= OFFSET_STATIONNAME;
@@ -725,9 +740,11 @@ void TgcDigitMaker::readFileOfCrossTalk() {
 
   // Close the TGC_Digitization_crossTalk.dat file 
   ifs.close();
+
+  return StatusCode::SUCCESS;
 }
 
-void TgcDigitMaker::readFileOfDeadChamber() {
+StatusCode TgcDigitMaker::readFileOfDeadChamber() {
   // Indices to be used 
   int iStationName, stationEta, stationPhi, gasGap;
 
@@ -747,22 +764,21 @@ void TgcDigitMaker::readFileOfDeadChamber() {
   else if(m_runperiod == 2) fileName = "TGC_Digitization_2016deadChamber.dat";
   else if(m_runperiod == 3) fileName = "TGC_Digitization_NOdeadChamber.dat";
   else {
-    msg(MSG::ERROR) << "Run Period " << m_runperiod << " is unexpected in TgcDigitMaker - using NOdeadChamber configuration." << endmsg;
-    fileName = "TGC_Digitization_NOdeadChamber.dat";
-    return;
+    ATH_MSG_ERROR("Run Period " << m_runperiod << " is unexpected in TgcDigitMaker - using NOdeadChamber configuration.");
+    return StatusCode::FAILURE;
   }
   std::string fileWithPath = PathResolver::find_file(fileName.c_str(), "DATAPATH");
   if(fileWithPath.empty()) {
-    msg(MSG::FATAL) << "readFileOfDeadChamber(): Could not find file " << fileName.c_str() << endmsg;
-    return;
+    ATH_MSG_FATAL("readFileOfDeadChamber(): Could not find file " << fileName);
+    return StatusCode::FAILURE;
   }
 
   // Open the TGC_Digitization_deadChamber.dat file 
   std::ifstream ifs;
   ifs.open(fileWithPath.c_str(), std::ios::in);
   if(ifs.bad()) {
-    msg(MSG::FATAL) << "readFileOfDeadChamber(): Could not open file " << fileName.c_str() << endmsg;
-    return;
+    ATH_MSG_FATAL("readFileOfDeadChamber(): Could not open file " << fileName);
+    return StatusCode::FAILURE;
   }
     
   // Read the TGC_Digitization_deadChamber.dat file
@@ -773,15 +789,12 @@ void TgcDigitMaker::readFileOfDeadChamber() {
     bool valid = getline(ifs, comment).good(); 
     if(!valid) break; 
 
-    if(msgLevel(MSG::DEBUG)) { 
-      msg(MSG::DEBUG) << "TgcDigitMaker::readFileOfDeadChamber" 
+    ATH_MSG_DEBUG("TgcDigitMaker::readFileOfDeadChamber" 
 		      << " stationName= " << iStationName  
 		      << " stationEta= " << stationEta 
 		      << " stationPhi= " << stationPhi
 		      << " gasGap= " << gasGap 
-		      << " comment= " << comment
-		      << endmsg;
-    }
+		      << " comment= " << comment);
 
     // Subtract offsets to use indices of isDeadChamber array
     iStationName -= OFFSET_STATIONNAME;
@@ -805,10 +818,12 @@ void TgcDigitMaker::readFileOfDeadChamber() {
   // Close the TGC_Digitization_deadChamber.dat file 
   ifs.close();
 
-  if(msgLevel(MSG::INFO)) msg(MSG::INFO) << "TgcDigitMaker::readFileOfDeadChamber: the number of dead chambers = " << nDeadChambers << endmsg;
+  ATH_MSG_INFO("readFileOfDeadChamber: the number of dead chambers = " << nDeadChambers);
+
+  return StatusCode::SUCCESS;
 }
 
-void TgcDigitMaker::readFileOfTimeWindowOffset() {
+StatusCode TgcDigitMaker::readFileOfTimeWindowOffset() {
   // Indices to be used 
   int iStationName, stationEta, isStrip;
 
@@ -824,30 +839,27 @@ void TgcDigitMaker::readFileOfTimeWindowOffset() {
   const std::string fileName = "TGC_Digitization_timeWindowOffset.dat";
   std::string fileWithPath = PathResolver::find_file(fileName.c_str(), "DATAPATH");
   if(fileWithPath.empty()) {
-    msg(MSG::FATAL) << "readFileOfTimeWindowOffset(): Could not find file " << fileName.c_str() << endmsg;
-    return;
+    ATH_MSG_FATAL("readFileOfTimeWindowOffset(): Could not find file " << fileName);
+    return StatusCode::FAILURE;
   }
 
   // Open the TGC_Digitization_timeWindowOffset.dat file 
   std::ifstream ifs;
   ifs.open(fileWithPath.c_str(), std::ios::in);
   if(ifs.bad()) {
-    msg(MSG::FATAL) << "readFileOfTimeWindowOffset(): Could not open file " << fileName.c_str() << endmsg;
-    return;
+    ATH_MSG_FATAL("readFileOfTimeWindowOffset(): Could not open file " << fileName);
+    return StatusCode::FAILURE;
   }
     
   // Read the TGC_Digitization_timeWindowOffset.dat file
   double timeWindowOffset;
   while(ifs.good()) {
     ifs >> iStationName >> stationEta >> isStrip >> timeWindowOffset;
-    if(msgLevel(MSG::DEBUG)) { 
-      msg(MSG::DEBUG) << "TgcDigitMaker::readFileOfTimeWindowOffset" 
+    ATH_MSG_DEBUG("TgcDigitMaker::readFileOfTimeWindowOffset" 
 		      << " stationName= " << iStationName  
 		      << " stationEta= " << stationEta 
 		      << " isStrip= " << isStrip
-		      << " timeWindowOffset= " << timeWindowOffset
-		      << endmsg;
-    }
+		      << " timeWindowOffset= " << timeWindowOffset);
 
     // Subtract offsets to use indices of isDeadChamber array
     iStationName -= OFFSET_STATIONNAME;
@@ -867,9 +879,11 @@ void TgcDigitMaker::readFileOfTimeWindowOffset() {
 
   // Close the TGC_Digitization_timeWindowOffset.dat file 
   ifs.close();
+
+  return StatusCode::SUCCESS;
 }
 
-void TgcDigitMaker::readFileOfAlignment() {
+StatusCode TgcDigitMaker::readFileOfAlignment() {
   // Indices to be used 
   int iStationName, stationEta, stationPhi;
 
@@ -888,16 +902,16 @@ void TgcDigitMaker::readFileOfAlignment() {
   const std::string fileName = "TGC_Digitization_alignment.dat";
   std::string fileWithPath = PathResolver::find_file(fileName.c_str(), "DATAPATH");
   if(fileWithPath.empty()) {
-    msg(MSG::FATAL) << "readFileOfAlignment(): Could not find file " << fileName.c_str() << endmsg;
-    return;
+    ATH_MSG_FATAL("readFileOfAlignment(): Could not find file " << fileName);
+    return StatusCode::FAILURE;
   }
 
   // Open the TGC_Digitization_alignment.dat file 
   std::ifstream ifs;
   ifs.open(fileWithPath.c_str(), std::ios::in);
   if(ifs.bad()) {
-    msg(MSG::FATAL) << "readFileOfAlignment(): Could not open file " << fileName.c_str() << endmsg;
-    return;
+    ATH_MSG_FATAL("readFileOfAlignment(): Could not open file " << fileName);
+    return StatusCode::FAILURE;
   }
     
   // Read the TGC_Digitization_alignment.dat file
@@ -907,17 +921,14 @@ void TgcDigitMaker::readFileOfAlignment() {
   double tmpTHS;
   while(ifs.good()) {
     ifs >> iStationName >> stationEta >> stationPhi >> tmpZ >> tmpT >> tmpS >> tmpTHS;
-    if(msgLevel(MSG::DEBUG)) { 
-      msg(MSG::DEBUG) << "TgcDigitMaker::readFileOfAlignment" 
+    ATH_MSG_DEBUG("readFileOfAlignment" 
 		      << " stationName= " << iStationName  
 		      << " stationEta= " << stationEta 
 		      << " stationPhi= " << stationPhi 
 		      << " z[mm]= " << tmpZ  
 		      << " t[mm]= " << tmpT  
 		      << " s[mm]= " << tmpS
-		      << " ths[rad]= " << tmpTHS  
-		      << endmsg;
-    }
+		      << " ths[rad]= " << tmpTHS);
 
     // Subtract offsets to use indices of m_alignmentZ, m_alignmentT, m_alignmentTHS arrays
     iStationName -= OFFSET_STATIONNAME;
@@ -940,6 +951,137 @@ void TgcDigitMaker::readFileOfAlignment() {
 
   // Close the TGC_Digitization_timeWindowOffset.dat file 
   ifs.close();
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TgcDigitMaker::readFileOfASDpropTimeOffset() {
+  // Indices to be used  
+  int iStationName = -1;
+  int stationEta = -1;
+  int isStrip = -1;
+  int asdnum = -1;
+
+  for(iStationName=0; iStationName<N_STATIONNAME; iStationName++) {
+    for(stationEta=0; stationEta<N_STATIONETA; stationEta++) {
+      for(isStrip=0; isStrip<N_ISSTRIP; isStrip++) {
+        for(asdnum=0; asdnum<N_ASDNUM; asdnum++) {
+          m_maxch[iStationName][stationEta][isStrip][asdnum] = 0.;
+          m_ASDpropTimeOffset[iStationName][stationEta][isStrip][asdnum] = 0.;
+        }
+      }
+    }
+  }
+
+  // Find path to the TGC_Digitization_ASDpropTimeOffset.dat file                                                                           
+  const std::string fileName = "TGC_Digitization_ASDpropTimeOffset.dat";
+  std::string fileWithPath = PathResolver::find_file(fileName.c_str(), "DATAPATH");
+  if(fileWithPath == "") {
+    ATH_MSG_FATAL("readFileOfASDpropTimeOffset(): Could not find file " << fileName);
+    return StatusCode::FAILURE;
+  }
+
+  // Open the TGC_Digitization_ASDpropTimeOffset.dat file    
+  std::ifstream ifs;
+  ifs.open(fileWithPath.c_str(), std::ios::in);
+  if(ifs.bad()) {
+    ATH_MSG_FATAL("readFileOfASDpropTimeOffset(): Could not open file " << fileName);
+    return StatusCode::FAILURE;
+  }
+
+  double max_ch = 0.;
+  double asd_propTimeOffset = 0.;
+  // Read the TGC_Digitization_ASDpropTimeOffset.dat file   
+  while(ifs.good()) {
+    ifs >> iStationName >> stationEta >> isStrip >> asdnum >> max_ch >> asd_propTimeOffset;
+    ATH_MSG_DEBUG("readFileOfASDpropTimeOffset"
+                      << " stationName= " << iStationName
+                      << " stationEta= " << stationEta
+                      << " isStrip= " << isStrip
+                      << " asdnum= " << asdnum
+                      << " max_ch= " << max_ch
+                      << " asd_propTimeOffset= " << asd_propTimeOffset);
+
+    // Subtract offsets to use indices of ASDpropTimeOffset array
+    iStationName -= OFFSET_STATIONNAME;
+    stationEta   -= OFFSET_STATIONETA;
+    isStrip      -= OFFSET_ISSTRIP;
+    asdnum       -= OFFSET_ASDNUM;
+
+    // Check the indices are valid
+    if(iStationName<0 || iStationName>=N_STATIONNAME) continue;
+    if(stationEta  <0 || stationEta  >=N_STATIONETA ) continue;
+    if(isStrip     <0 || isStrip     >=N_ISSTRIP    ) continue;
+    if(asdnum      <0 || asdnum      >=N_ASDNUM     ) continue;
+
+    m_maxch[iStationName][stationEta][isStrip][asdnum] = max_ch;
+    m_ASDpropTimeOffset[iStationName][stationEta][isStrip][asdnum] = asd_propTimeOffset;
+
+    // If it is the end of the file, get out from while loop.
+    if(ifs.eof()) break;
+  }
+
+  // Close the TGC_Digitization_ASDpropTimeOffset.dat file 
+  ifs.close();
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TgcDigitMaker::readFileOfStripPosition() {
+  //Indices to be used
+  int iStationName, stationEta, channel;
+
+  for(iStationName=0; iStationName<N_STATIONNAME; iStationName++) {
+    for(stationEta=0; stationEta<N_ABSSTATIONETA; stationEta++) {
+      for(channel=0; channel<N_STRIPCHANNEL; channel++) {
+      m_StripPos[iStationName][stationEta][channel] = 0.;
+      }
+    }
+  }
+
+  // Find path to the TGC_Digitization_StripPosition.dat file                                                                         
+  const std::string fileName = "TGC_Digitization_StripPosition.dat";
+  std::string fileWithPath = PathResolver::find_file(fileName.c_str(), "DATAPATH");
+  if(fileWithPath == "") {
+    ATH_MSG_FATAL("readFileOfStripPosition(): Could not find file " << fileName);
+    return StatusCode::FAILURE;
+  }
+
+  // Open the TGC_Digitization_StripPosition.dat file                                
+  std::ifstream ifs;
+  ifs.open(fileWithPath.c_str(), std::ios::in);
+  if(ifs.bad()) {
+    ATH_MSG_FATAL("readFileOfStripPosition(): Could not open file " << fileName);
+    return StatusCode::FAILURE;
+  }
+
+  // Read the TGC_Digitization_StripPosition.dat file                                 
+  double strippos;
+  while(ifs.good()) {
+    ifs >> iStationName >> stationEta >> channel >> strippos;
+    ATH_MSG_DEBUG("readFileOfStripPosition"
+                      << " stationName= " << iStationName
+                      << " stationEta= " << stationEta
+                      << " channel= " << channel
+                      << " StripPosition= " << strippos);
+
+    iStationName -= OFFSET_STATIONNAME;
+    stationEta   -= OFFSET_ABSSTATIONETA;
+    channel      -= OFFSET_STRIPCHANNEL;
+
+    // Check the indices are valid                                                                                                                     
+    if(iStationName<0 || iStationName>=N_STATIONNAME  ) continue;
+    if(stationEta  <0 || stationEta  >=N_ABSSTATIONETA) continue;
+    if(channel     <0 || channel     >=N_STRIPCHANNEL ) continue;
+
+    m_StripPos[iStationName][stationEta][channel] = strippos;
+    // If it is the end of the file, get out from while loop.                                                                           
+    if(ifs.eof()) break;
+  }
+  // Close the TGC_Digitization_StripPosition.dat file                                                                                                            
+  ifs.close();
+
+  return StatusCode::SUCCESS;
 }
 
 double TgcDigitMaker::getEnergyThreshold(const std::string& stationName, int stationEta, int stationPhi, int gasGap, const TgcSensor sensor) const {
@@ -963,16 +1105,13 @@ double TgcDigitMaker::getEnergyThreshold(const std::string& stationName, int sta
   }
 
   // Show the energy threshold value
-  if(msgLevel(MSG::VERBOSE)) {
-    msg(MSG::VERBOSE) << "TgcDigitMaker::getEnergyThreshold" 
+  ATH_MSG_VERBOSE("getEnergyThreshold" 
 		      << " stationName= " << iStationName+OFFSET_STATIONNAME
 		      << " stationEta= " << stationEta+OFFSET_STATIONETA 
 		      << " stationPhi= " << stationPhi+OFFSET_STATIONPHI
 		      << " gasGap= " << gasGap+OFFSET_GASGAP 
 		      << " sensor= " << sensor
-		      << " energyThreshold(MeV)= " << energyThreshold
-		      << endmsg;
-  }
+		      << " energyThreshold(MeV)= " << energyThreshold);
 
   return energyThreshold;
 }
@@ -1068,15 +1207,12 @@ bool TgcDigitMaker::isDeadChamber(const std::string& stationName, int stationEta
   }
 
   // Show the energy threshold value
-  if(msgLevel(MSG::VERBOSE)) {
-    msg(MSG::VERBOSE) << "TgcDigitMaker::getEnergyThreshold" 
+  ATH_MSG_VERBOSE("TgcDigitMaker::getEnergyThreshold" 
 		      << " stationName= " << iStationName+OFFSET_STATIONNAME
 		      << " stationEta= " << stationEta+OFFSET_STATIONETA 
 		      << " stationPhi= " << stationPhi+OFFSET_STATIONPHI
 		      << " gasGap= " << gasGap+OFFSET_GASGAP 
-		      << " isDeadChamber= " << v_isDeadChamber
-		      << endmsg;
-  }
+		      << " isDeadChamber= " << v_isDeadChamber);
 
   return v_isDeadChamber; 
 }
@@ -1146,14 +1282,91 @@ void TgcDigitMaker::adHocPositionShift(const std::string& stationName, int stati
   localPos.z() = localPos.z()+localDisplacementZByX-localDisplacementZ; 
 }
 
+float TgcDigitMaker::getASDpropTimeOffset(const Identifier elemId,
+					   const int isStrip,
+					   const int channel) const
+{
+  int StationName = m_idHelper->stationName(elemId) - OFFSET_STATIONNAME;
+  int stationEta  = m_idHelper->stationEta(elemId)  - OFFSET_STATIONETA;
+  int stationPhi  = m_idHelper->stationPhi(elemId)  - OFFSET_STATIONPHI;
+  int iIsStrip    = isStrip                         - OFFSET_ISSTRIP;
+
+  std::array<double, N_ASDNUM> maxch{};
+  double asdpropTimeOffset = 0.;
+
+  if((StationName>=0 && StationName<N_STATIONNAME) &&
+     (stationEta >=0 && stationEta <N_STATIONETA ) &&
+     (stationPhi >=0 && stationPhi <N_STATIONPHI )) {
+    for(int asdnum=0; asdnum<N_ASDNUM; asdnum++){
+      maxch[asdnum] = m_maxch[StationName][stationEta][iIsStrip][asdnum];
+    }
+    for(int asdnum=0; asdnum<N_ASDNUM; asdnum++){
+      if(maxch[asdnum] == 0) continue;
+      if(asdnum==0 && 1 <= channel && channel <= maxch[0]) asdpropTimeOffset = m_ASDpropTimeOffset[StationName][stationEta][iIsStrip][asdnum];
+      if(asdnum!=0 && maxch[asdnum-1] < channel && channel <= maxch[asdnum]) asdpropTimeOffset = m_ASDpropTimeOffset[StationName][stationEta][iIsStrip][asdnum];
+    }
+  }
+  return asdpropTimeOffset;
+}
+
+float TgcDigitMaker::getStripPosition(const std::string stationName, int stationEta, int channel) const {
+  // Convert std::string stationName to int iStationName from 41 to 48                              
+  int iStationName = getIStationName(stationName);
+
+  // Subtract offsets to use these as the indices of the energyThreshold array                      
+  iStationName -= OFFSET_STATIONNAME;
+  stationEta   -= OFFSET_ABSSTATIONETA;
+  channel      -= OFFSET_STRIPCHANNEL;
+
+  // Check the indices are valid                                                                  
+  if(iStationName<0 || iStationName>=N_STATIONNAME  ) return 0.;
+  if(stationEta  <0 || stationEta  >=N_ABSSTATIONETA) return 0.;
+  if(channel     <0 || channel     >=N_STRIPCHANNEL ) return 0.;
+
+  return m_StripPos[iStationName][stationEta][channel];
+}
+
 float TgcDigitMaker::timeDiffByCableRadiusOfInner(const int iStationName,
 						  const int stationPhi,
 						  const int channel) const {
 
   if(iStationName != 47 && iStationName != 48) return 0.0; // only EIFI station
-  if(channel < 12 || (channel > 16 && channel <27)) {
+  if(channel < 12 || (channel > 16 && channel < 27)) {
     int cablenum = (stationPhi >= 13) ? 25 - stationPhi : stationPhi;
     return 2.3 - 0.06 * cablenum;
   }
   return 0.0;
 }
+
+float TgcDigitMaker::getSigPropTimeDelay(const float cableDistance) const {
+
+  return 0.0049 * std::pow(cableDistance, 2) + 0.0002 * cableDistance;
+}
+
+float TgcDigitMaker::getDistanceToAsdFromSensor(const TgcDigitASDposData* readCdo,
+						const int iStationName,
+						const int stationEta,
+						const int stationPhi,
+						const TgcSensor sensor,
+						const int channel,
+						const float position) const {
+
+  int phiId = (iStationName >= 47) ? stationPhi : -99;
+  int dbNum = -99;
+
+  for(unsigned int i_dbNum=0;i_dbNum<readCdo->stationNum.size();i_dbNum++) {
+    if(iStationName != readCdo->stationNum.at(i_dbNum)) continue;
+    if(stationEta   != readCdo->stationEta.at(i_dbNum)) continue;
+    if(phiId        != readCdo->stationPhi.at(i_dbNum)) continue;
+    dbNum = i_dbNum;
+    break;
+  }
+
+  unsigned int asdNum[TgcSensor::N_SENSOR];
+  asdNum[TgcSensor::kSTRIP] = channel / TgcDigitASDposData::N_CHANNELINPUT_TOASD;
+  asdNum[TgcSensor::kWIRE]  = channel / TgcDigitASDposData::N_CHANNELINPUT_TOASD + TgcDigitASDposData::N_STRIPASDPOS;
+
+  float disToAsd = fabs( position*CLHEP::mm/CLHEP::m - readCdo->asdPos[ asdNum[sensor] ][dbNum] );
+
+  return disToAsd;
+}
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h
index 39755bfb3517..db9e57e0120f 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitMaker.h
@@ -11,15 +11,15 @@
 
 #ifndef TGCDIGITMAKER_H
 #define TGCDIGITMAKER_H
-#include "CxxUtils/checker_macros.h"
+
 #include <vector>
 #include <string>
 
+#include "AthenaBaseComps/AthMessaging.h"
 #include "GaudiKernel/StatusCode.h"
-#include "Identifier/Identifier.h"
-#include "AthenaKernel/MsgStreamMember.h"
-
 #include "GeoPrimitives/GeoPrimitives.h"
+#include "Identifier/Identifier.h"
+#include "MuonCondData/TgcDigitASDposData.h"
 
 namespace CLHEP {
   class HepRandomEngine;
@@ -35,7 +35,7 @@ class TgcIdHelper;
 class TGCSimHit; 
 
 //--- class description
-class TgcDigitMaker {
+class TgcDigitMaker : public AthMessaging {
   //------ for public
  public:
 
@@ -76,15 +76,10 @@ class TgcDigitMaker {
      will be included in future, too.
   */
   TgcDigitCollection* executeDigi(const TGCSimHit* hit,
-				  const double globalHitTime,
+                                  const double globalHitTime,
+                                  const TgcDigitASDposData* ASDpos,
                                   CLHEP::HepRandomEngine* rndmEngine);
 
-  //Declaring the Message method for further use
-  MsgStream& msg(const MSG::Level lvl) const ;
-  //Declaring the Method providing Verbosity Level
-  bool msgLevel(const MSG::Level lvl) const;
-  void setMessageLevel(const MSG::Level lvl) const;
-
   //====== for private
  private:
   enum NumberOfDimensions {
@@ -98,7 +93,13 @@ class TgcDigitMaker {
     OFFSET_GASGAP = 1,
     N_ISSTRIP = 2,
     OFFSET_ISSTRIP = 0, 
-    N_CROSSTALK_PARAMETER = 4
+    N_CROSSTALK_PARAMETER = 4,
+    N_ASDNUM = 8,
+    OFFSET_ASDNUM = 1,
+    N_ABSSTATIONETA = 5,
+    OFFSET_ABSSTATIONETA = 1,
+    N_STRIPCHANNEL = 32,
+    OFFSET_STRIPCHANNEL = 1
   };
   enum TgcStation {
     kOUTER = 0,
@@ -131,15 +132,20 @@ class TgcDigitMaker {
   void addDigit(const Identifier id, const uint16_t bctag, TgcDigitCollection* digits) const;
 
   /** Read share/TGC_Digitization_energyThreshold.dat file */
-  void readFileOfEnergyThreshold();
+  StatusCode readFileOfEnergyThreshold();
   /** Read share/TGC_Digitization_crossTalk.dat file */
-  void readFileOfCrossTalk();
+  StatusCode readFileOfCrossTalk();
   /** Read share/TGC_Digitization_deadChamber.dat file */
-  void readFileOfDeadChamber();
+  StatusCode readFileOfDeadChamber();
   /** Read share/TGC_Digitization_timeWindowOffset.dat file */
-  void readFileOfTimeWindowOffset();
+  StatusCode readFileOfTimeWindowOffset();
   /** Read share/TGC_Digitization_alignment.dat file */
-  void readFileOfAlignment();
+  StatusCode readFileOfAlignment();
+  /** Read share/TGC_Digitization_ASDpropTimeOffset.dat file */
+  StatusCode readFileOfASDpropTimeOffset();
+  /** Read share/TGC_Digitization_StripPosition.dat file */
+  StatusCode readFileOfStripPosition();
+
   /** Get energy threshold value for each chamber */
   double getEnergyThreshold(const std::string& stationName, int stationEta, int stationPhi, int gasGap, const TgcSensor sensor) const;
   void randomCrossTalk(const Identifier elemId, const int gasGap, const TgcSensor sensor, const int channel, const float posInStrip, const double digitTime, CLHEP::HepRandomEngine* rndmEngine, TgcDigitCollection* digits) const;
@@ -152,8 +158,16 @@ class TgcDigitMaker {
   /** Ad hoc implementation of detector position shift */
   void adHocPositionShift(const std::string& stationName, int stationEta, int stationPhi, 
 			  const Amg::Vector3D& direCos, Amg::Vector3D &localPos) const;
+  /** Method to get propagation time offset of the ASD */
+  float getASDpropTimeOffset(const Identifier elemId, const int isStrip, const int channel) const;
+  /** Method to get position of Strip channel */
+  float getStripPosition(const std::string stationName, int stationEta, int channel) const;
+  /** Method to get signal propagation time delay */
+  float getSigPropTimeDelay(const float cableDistance) const;
   /** Method to get time difference by cable radius of inner */
   float timeDiffByCableRadiusOfInner(const int iStationName, const int stationPhi, const int channel) const;
+  /** Method to get propagation time to the ASD from the sensor */
+  float getDistanceToAsdFromSensor(const TgcDigitASDposData* readCdo, const int iStationName, const int stationEta, const int stationPhi, const TgcSensor sensor, const int channel, const float position) const;
 
   /** Energy threshold value for each chamber */
   double m_energyThreshold[N_STATIONNAME][N_STATIONETA][N_STATIONPHI][N_GASGAP][N_ISSTRIP]{};
@@ -173,6 +187,13 @@ class TgcDigitMaker {
   /** Alignment ths constants. Rotation around the global phi direction */ 
   double m_alignmentTHS[N_STATIONNAME][N_STATIONETA][N_STATIONPHI]{};
 
+  /** Position of Strip Channel (Longer base or Shorter base) */
+  float m_StripPos[N_STATIONNAME][N_ABSSTATIONETA][N_STRIPCHANNEL];
+  /** ASD propagation time offset for each chamber */
+  float m_ASDpropTimeOffset[N_STATIONNAME][N_STATIONETA][N_ISSTRIP][N_ASDNUM];
+  /** max channel for ASD */
+  float m_maxch[N_STATIONNAME][N_STATIONETA][N_ISSTRIP][N_ASDNUM];
+
   std::vector<std::vector<float> > m_vecAngle_Time;
 
   TgcHitIdHelper* m_hitIdHelper;
@@ -190,9 +211,6 @@ class TgcDigitMaker {
   double m_timeWindowOffsetSensor[N_SENSOR]{};
   double m_gateTimeWindow[N_STATION][N_SENSOR]{};
   double m_bunchCrossingTime;
-
-  //Declaring private message stream member.
-  mutable Athena::MsgStreamMember m_msg ATLAS_THREAD_SAFE;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx
index bfa40dc8094a..745459f57c12 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx
@@ -65,8 +65,9 @@ StatusCode TgcDigitizationTool::initialize()
   if(m_onlyUseContainerName) m_inputHitCollectionName = m_hitsContainerKey.key();
   ATH_MSG_DEBUG("Input objects in container : '" << m_inputHitCollectionName << "'");
 
-  // Initialize ReadHandleKey
+  // Initialize Read(Cond)HandleKey
   ATH_CHECK(m_hitsContainerKey.initialize(!m_onlyUseContainerName));
+  ATH_CHECK(m_readCondKey_ASDpos.initialize(!m_readCondKey_ASDpos.empty()));
 
   //initialize the output WriteHandleKeys
   ATH_CHECK(m_outputDigitCollectionKey.initialize());
@@ -102,7 +103,7 @@ StatusCode TgcDigitizationTool::initialize()
   m_digitizer = new TgcDigitMaker(m_hitIdHelper,
                                   m_mdManager,
                                   runperiod);
-  m_digitizer->setMessageLevel(static_cast<MSG::Level>(msgLevel()));
+  m_digitizer->setLevel(static_cast<MSG::Level>(msgLevel()));
   ATH_CHECK(m_rndmSvc.retrieve());
 
   ATH_CHECK(m_digitizer->initialize());
@@ -130,7 +131,7 @@ StatusCode TgcDigitizationTool::processBunchXing(int bunchXing,
 
   if (!(m_mergeSvc->retrieveSubSetEvtData(m_inputHitCollectionName, hitCollList, bunchXing,
 					  bSubEvents, eSubEvents).isSuccess()) &&
-        hitCollList.empty()) {
+            hitCollList.empty()) {
     ATH_MSG_ERROR("Could not fill TimedHitCollList");
     return StatusCode::FAILURE;
   } else {
@@ -282,6 +283,13 @@ StatusCode TgcDigitizationTool::digitizeCore(const EventContext& ctx) const {
   // get the iterator pairs for this DetEl
   //iterate over hits and fill id-keyed drift time map
   IdContext tgcContext = m_idHelper->module_context();
+
+  // Read needed conditions data
+  const TgcDigitASDposData *ASDpos{};
+  if (!m_readCondKey_ASDpos.empty()) {
+    SG::ReadCondHandle<TgcDigitASDposData> readHandle_ASDpos{m_readCondKey_ASDpos, ctx};
+    ASDpos = readHandle_ASDpos.cptr();
+  }
   
   TimedHitCollection<TGCSimHit>::const_iterator i, e; 
   while(m_thpcTGC->nextDetectorElement(i, e)) {
@@ -293,7 +301,7 @@ StatusCode TgcDigitizationTool::digitizeCore(const EventContext& ctx) const {
       const TGCSimHit& hit = *phit;
       double globalHitTime = hitTime(phit);
       double tof = phit->globalTime();
-      TgcDigitCollection* digiHits = m_digitizer->executeDigi(&hit, globalHitTime, rndmEngine);
+      TgcDigitCollection* digiHits = m_digitizer->executeDigi(&hit, globalHitTime, ASDpos, rndmEngine);
 
       if(!digiHits) continue;
 
diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.h b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.h
index e6bcba20f431..73b5ded5e4da 100644
--- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.h
+++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.h
@@ -1,7 +1,7 @@
 /* -*- C++ -*- */
 
 /*
-  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 MUONDIGITIZATION_TGC_DIGITIZATIONTOOL_H
@@ -22,6 +22,7 @@
 #include "MuonSimEvent/TGCSimHitCollection.h"
 #include "MuonDigitContainer/TgcDigitContainer.h"
 #include "MuonSimData/MuonSimDataCollection.h"
+#include "MuonCondData/TgcDigitASDposData.h"
 
 class PileUpMergeSvc;
 class TgcDigitMaker;
@@ -89,9 +90,9 @@ private:
   std::list<TGCSimHitCollection*>    m_TGCHitCollList;
 
   Gaudi::Property<bool> m_onlyUseContainerName{this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};
-  SG::ReadHandleKey<TGCSimHitCollection> m_hitsContainerKey{this, "InputObjectName", "TGC_Hits",
-      "name of the input object"};
+  SG::ReadHandleKey<TGCSimHitCollection> m_hitsContainerKey{this, "InputObjectName", "TGC_Hits", "name of the input object"};
   std::string m_inputHitCollectionName{""};
+  SG::ReadCondHandleKey<TgcDigitASDposData> m_readCondKey_ASDpos{this,"TGCDigitASDposKey","","ReadCondHandleKey for TGCDigitASDposData"};
   SG::WriteHandleKey<TgcDigitContainer> m_outputDigitCollectionKey{this,"OutputObjectName","TGC_DIGITS","WriteHandleKey for Output TgcDigitContainer"}; // name of the output digits
   SG::WriteHandleKey<MuonSimDataCollection> m_outputSDO_CollectionKey{this,"OutputSDOName","TGC_SDO","WriteHandleKey for Output MuonSimDataCollection"}; // name of the output SDOs
 
diff --git a/Simulation/Digitization/python/DigitizationConfigFlags.py b/Simulation/Digitization/python/DigitizationConfigFlags.py
index c4ae8e92872b..ade5f68cdd5e 100644
--- a/Simulation/Digitization/python/DigitizationConfigFlags.py
+++ b/Simulation/Digitization/python/DigitizationConfigFlags.py
@@ -88,6 +88,8 @@ def createDigitizationCfgFlags():
     # TRT Range cut used in simulation in mm. Should be 0.05 or 30.
     flags.addFlag("Digitization.TRTRangeCut",
                   lambda prevFlags: float(GetFileMD(prevFlags.Input.Files).get('TRTRangeCut', 0.05)))
+    # Temporary TGC flag
+    flags.addFlag("Digitization.UseUpdatedTGCConditions", False)
     # Write out truth information?
     flags.addFlag("Digitization.TruthOutput", False)
     # Write out calorimeter digits
diff --git a/Simulation/Digitization/python/DigitizationFlags.py b/Simulation/Digitization/python/DigitizationFlags.py
index 96c3491973bb..38b6433bad01 100755
--- a/Simulation/Digitization/python/DigitizationFlags.py
+++ b/Simulation/Digitization/python/DigitizationFlags.py
@@ -735,6 +735,14 @@ class TRTRangeCut(JobProperty):
     allowedValues = [0.05,30.0]
     StoredValue=0.05
 
+#
+class UseUpdatedTGCConditions(JobProperty):
+    """ Temporary flag for TGC conditions
+    """
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=False
+
 #
 class PileUpPresampling(JobProperty):
     """ Run pile-up presampling
@@ -834,7 +842,7 @@ list_jobproperties=[doInDetNoise,doCaloNoise,doMuonNoise,doFwdNoise,doRadiationD
                     bunchSpacing,initialBunchCrossing,finalBunchCrossing,doXingByXingPileUp,\
                     simRunNumber,dataRunNumber,BeamIntensityPattern,FixedT0BunchCrossing,cavernIgnoresBeamInt,\
                     RunAndLumiOverrideList,SignalPatternForSteppingCache,
-                    experimentalDigi,pileupDSID,specialConfiguration,digiSteeringConf,TRTRangeCut,PileUpPresampling,doBeamSpotSizeReweighting,OldBeamSpotZSize]
+                    experimentalDigi,pileupDSID,specialConfiguration,digiSteeringConf,TRTRangeCut,UseUpdatedTGCConditions,PileUpPresampling,doBeamSpotSizeReweighting,OldBeamSpotZSize]
 
 for i in list_jobproperties:
     jobproperties.Digitization.add_JobProperty(i)
diff --git a/Simulation/Digitization/test/test_MC16a_Digi_tf_configuration.py b/Simulation/Digitization/test/test_MC16a_Digi_tf_configuration.py
index 2350ca586f4d..8545c8cf547e 100755
--- a/Simulation/Digitization/test/test_MC16a_Digi_tf_configuration.py
+++ b/Simulation/Digitization/test/test_MC16a_Digi_tf_configuration.py
@@ -338,7 +338,7 @@ class TestDigitizationMC16a(unittest.TestCase):
 
     def test___TgcDigitizationTool_properties(self):
         tested_configurable_name = 'StandardSignalOnlyTruthPileUpToolsAlg.TgcDigitizationTool'
-        expected_property_list = ['DetStore', 'EvtStore', 'ExtraInputs', 'ExtraOutputs', 'FirstXing', 'InputObjectName', 'LastXing', 'OutputObjectName', 'OutputSDOName', 'PileUpMergeSvc', 'RndmSvc']
+        expected_property_list = ['DetStore', 'EvtStore', 'ExtraInputs', 'ExtraOutputs', 'FirstXing', 'InputObjectName', 'LastXing', 'OutputObjectName', 'OutputSDOName', 'PileUpMergeSvc', 'RndmSvc', 'TGCDigitASDposKey']
         expected_nonstring_properties = {'LastXing': '75', 'FirstXing': '-50'}
         expected_string_properties = {} # Not checking any specific property values
         self._detailed_ConfigurablePropertiesCheck(
-- 
GitLab


From 45c95717c27b2f48136f8e6066837aeab3aae0da Mon Sep 17 00:00:00 2001
From: Tomasz Bold <tomasz.bold@gmail.com>
Date: Sat, 18 Sep 2021 15:49:24 +0200
Subject: [PATCH 201/347] Fixed back linking

---
 .../src/Run2ToRun3TrigNavConverter.cxx        | 63 ++++++++++---------
 1 file changed, 32 insertions(+), 31 deletions(-)

diff --git a/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx b/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx
index a786dc21771d..8a939639b693 100644
--- a/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx
+++ b/Trigger/TrigEvent/TrigNavTools/src/Run2ToRun3TrigNavConverter.cxx
@@ -120,7 +120,6 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) cons
   std::uniform_int_distribution<uint32_t> dis;
   */
 
-  std::vector<HLT::TriggerElement*> tes;
   TEDecisionMap mapTEtoHNodes;                          // TE - Decision (xAOD::TrigComposite)
   TEDecisionMap mapTEtoIMNodes;                    // TE Active - Decision (xAOD::TrigComposite)
   std::vector<TrigCompositeUtils::Decision*> decisionLast; // storing "last" decision in a chain
@@ -128,13 +127,13 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) cons
   DecisionObjMap decisionObj;
   DecisionObjStringMap decisionObjFeatureless;
   L1ObjMap l1Obj;
+  std::set<TrigCompositeUtils::Decision*> currentChainDecisions; // to veto decision nodes to be reused for the same chain
 
   std::vector<HLT::TriggerElement::FeatureAccessHelper> featureRoI; // for keeping predecessing TE with RoI
 
   // @@@@@@@@@@@@@@@@@@@@@@@@@@ getDecisionObject @@@@@@@@@@@@@@@@@@@@@@@@@@
   auto getDecisionObject = [&](const HLT::TriggerElement::FeatureAccessHelper& elemFE,
     size_t idx,
-    TrigCompositeUtils::DecisionContainer* dOutput,
     size_t& kIn,
     HLT::TriggerElement* ptrTE = nullptr) {
       // kIn: flag with the information about the decision objects (DO)
@@ -143,18 +142,23 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) cons
       // 2: a new DO pair created (that is: H and IM node)
 
       auto [sgKey, sgCLID, sgName] = getSgKey(run2Navigation, elemFE);
-      auto it = decisionObj.find(sgKey + idx);
-      if (it != decisionObj.end()) {
-        kIn = 0;
-        ATH_MSG_DEBUG("Reusing = " << ptrTE << " IM " << it->second.second->index() << " H " << it->second.first->index());
-        return it->second;
+      auto preExistingDecsionsIt = decisionObj.find(sgKey + idx);
+      if (preExistingDecsionsIt != decisionObj.end() ) {
+        auto [hNode, imNode] = preExistingDecsionsIt->second;
+        if ( currentChainDecisions.count(hNode) == 0  and currentChainDecisions.count(imNode) == 0 ) {
+          kIn = 0;
+          ATH_MSG_DEBUG("Reusing = " << ptrTE << " IM " << imNode->index() << " H " << hNode->index());
+          return preExistingDecsionsIt->second;
+        }
       }
 
       kIn = 2;
       if (idx == elemFE.getIndex().objectsBegin()) {
-        auto imNode = TrigCompositeUtils::newDecisionIn(dOutput); // IM
+        auto imNode = TrigCompositeUtils::newDecisionIn(decisionOutput); // IM
+        currentChainDecisions.insert(imNode);
         imNode->setName(TrigCompositeUtils::inputMakerNodeName());
-        auto hNode = TrigCompositeUtils::newDecisionIn(dOutput); // H
+        auto hNode = TrigCompositeUtils::newDecisionIn(decisionOutput); // H
+        currentChainDecisions.insert(hNode);
         hNode->setName(TrigCompositeUtils::hypoAlgNodeName());
         TrigCompositeUtils::linkToPrevious(hNode, imNode, context); // H low IM up
         ATH_MSG_DEBUG("TE FE link creator H lower IM upper = " << ptrTE << " " << hNode << " " << imNode);
@@ -165,7 +169,8 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) cons
       }
 
       kIn = 1;
-      auto hNode = TrigCompositeUtils::newDecisionIn(dOutput); // H
+      auto hNode = TrigCompositeUtils::newDecisionIn(decisionOutput); // H
+      currentChainDecisions.insert(hNode);
       hNode->setName(TrigCompositeUtils::hypoAlgNodeName());
       auto imNode = (decisionObj.find(sgKey + elemFE.getIndex().objectsBegin())->second).second;
       ATH_MSG_DEBUG("TE FE link creator H lower IM upper = " << ptrTE << " " << hNode << " " << imNode);
@@ -190,6 +195,12 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) cons
     return d1;
   };
 
+  // @@@@@@@@@@@@@@@@@@@@@@@@@@ ordered_sorter @@@@@@@@@@@@@@@@@@@@@@@@@@
+  auto rois_priority_order = [&](const auto& left, const auto& right) {
+    return std::find(cbegin(m_setRoiName), cend(m_setRoiName), left) < std::find(cbegin(m_setRoiName), cend(m_setRoiName), right);
+  };
+
+
   // @@@@@@@@@@@@@@@@@@@@@@@@@@ begin of chain loop @@@@@@@@@@@@@@@@@@@@@@@@@@
   for (auto p : m_configSvc->chains())
   {
@@ -198,51 +209,41 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) cons
       std::string chainName = p->name();
       auto c = p;
       HLT::Identifier chainId = HLT::Identifier(chainName);
-
-      // @@@@@@@@@@@@@@@@@@@@@@@@@@ ordered_sorter @@@@@@@@@@@@@@@@@@@@@@@@@@
-      auto ordered_sorter = [&](const auto& left, const auto& right) {
-        return std::find(cbegin(m_setRoiName), cend(m_setRoiName), left) < std::find(cbegin(m_setRoiName), cend(m_setRoiName), right);
-      };
-      std::map<std::string, HLT::TriggerElement::FeatureAccessHelper, decltype(ordered_sorter)> mp(ordered_sorter);
-      // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+      currentChainDecisions.clear();
 
       ATH_MSG_DEBUG(" CHAIN name " << chainName);
       bool kTErejection{ false };
       for (auto s_iter = c->signatures().begin(), first_s_iter = s_iter; s_iter != c->signatures().end(); ++s_iter)
       {
         if (kTErejection) break;
-        std::vector<TrigCompositeUtils::Decision*> tempDecisionVector;
         for (auto te : (*s_iter)->outputTEs())
         {
-          tes.clear();
+          std::vector<HLT::TriggerElement*> tes;
           run2Navigation.getAllOfType(te->id(), tes, false);
           ATH_MSG_DEBUG(" TE size " << tes.size() << " name " << hash2string[te->id()]);
-          if (tes.size() == 0) {
+          if (tes.empty()) {
             kTErejection = true;
             break;
-          }
-          if (tes.empty() == false) {
+          } else {
             decisionLast.clear();
           }
 
           for (auto teptr : tes)
           {
-
-            tempDecisionVector.clear();
+            std::vector<TrigCompositeUtils::Decision*> hNodesVector;
 
             auto vectorTEfeatures_ptr = getTEfeatures(teptr, run2Navigation);
             auto vectorTEROIfeatures_ptr = getTEROIfeatures(teptr, run2Navigation);
             auto vectorTRACKfeatures_ptr = getTRACKfeatures(teptr);
 
-            mp.clear();
+            std::map<std::string, HLT::TriggerElement::FeatureAccessHelper, decltype(rois_priority_order)> mp(rois_priority_order);
 
             // @@@@@@@@@@@@@@@@@@@@@@@@@@ roiFinder @@@@@@@@@@@@@@@@@@@@@@@@@@
             std::function<void(HLT::TriggerElement*)> roiFinder = [&](HLT::TriggerElement* ptrTE) {
               auto vecTEpred = run2Navigation.getDirectPredecessors(ptrTE);
               if (vecTEpred.empty()) {
                 return nullptr;
-              }
-              else {
+              } else {
                 for (auto pred : vecTEpred) { // vector predecessors TE
                   auto vectorTEROIfeatures_ptr = getTEROIfeatures(pred, run2Navigation);
                   if (vectorTEROIfeatures_ptr.empty() == false) {
@@ -341,7 +342,7 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) cons
               ATH_MSG_DEBUG("JUST AFTER " << "[TE] " << teptr << " [H] " << hNode->index() << " [IM] " << imNode->index() << " dLevel=" << dLevel);
               auto decision = imNode; // IM
 
-              tempDecisionVector.push_back(hNode);
+              hNodesVector.push_back(hNode);
 
               if (teptr->getActiveState()) {
                 TrigCompositeUtils::addDecisionID(chainId, hNode); // H
@@ -414,7 +415,7 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) cons
                 for (size_t objectIndex{ elemFE.getIndex().objectsBegin() }; objectIndex < elemFE.getIndex().objectsEnd(); ++objectIndex)
                 {
                   size_t kInsert{ 0 };
-                  auto [hNode, imNode] = getDecisionObject(elemFE, objectIndex, decisionOutput, kInsert, teptr); // H IM
+                  auto [hNode, imNode] = getDecisionObject(elemFE, objectIndex, kInsert, teptr); // H IM
                   decision = imNode; // IM
 
                   if (mp.empty() == false) {
@@ -430,7 +431,7 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) cons
                   ATH_MSG_DEBUG("REGTEST " << "[TE feature] " << "[IM Index] (" << imNode->index() << ") [Chain ID] " << chainId);
 
 
-                  tempDecisionVector.push_back(hNode);
+                  hNodesVector.push_back(hNode);
 
                   if (kInsert)
                   {
@@ -494,7 +495,7 @@ StatusCode Run2ToRun3TrigNavConverter::execute(const EventContext& context) cons
               }
             } // eof if - TE full
 
-            decisionLast.insert(decisionLast.end(), tempDecisionVector.begin(), tempDecisionVector.end());
+            decisionLast.insert(decisionLast.end(), hNodesVector.begin(), hNodesVector.end());
           }
         }
       }
-- 
GitLab


From bf6f1719b28f956d3725e9ddd322266732915d48 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Mon, 20 Sep 2021 07:58:19 +0200
Subject: [PATCH 202/347] Dropped LArIdManager

This class is being used by handful of clients only for retrieving various ID helpers.
These helpers can be directly retrieved from the Detector Store, hence LArIdManager can
be dropped.

Also dropped the converter for this class.
---
 .../CaloIdentifier/CaloIdManager.h            |  11 +-
 .../src/CaloTriggerTowerService.cxx           |  11 +-
 .../DetDescrCnvSvc/src/DetDescrCnvSvc.cxx     |   2 -
 .../share/LArCellDeadOTXCorr_test.ref         |   1 -
 .../LArIdCnv/LArIdCnv/LArIdMgrDetDescrCnv.h   |  59 -----
 .../LArCnv/LArIdCnv/src/LArIdCnv_entries.cxx  |   4 +-
 .../LArIdCnv/src/LArIdMgrDetDescrCnv.cxx      | 202 ------------------
 .../LArCondUtils/src/LArFecLvTempDcsTool.cxx  |  11 +-
 .../TestLArDetDescr/TestCaloDDE.h             |   4 +-
 .../TestLArDetDescr/src/TestCaloDDE.cxx       |  14 +-
 .../src/TestLArHWID_Algo.cxx                  |  63 +-----
 .../TestLArHardwareID/src/initTTMap_Algo.cxx  |   2 -
 .../TestLArHardwareID/src/testTTMap_Algo.cxx  |   1 -
 .../LArIdentifier/LArIdManager.h              | 113 ----------
 .../LArIdentifier/src/LArIdManager.cxx        | 142 ------------
 LArCalorimeter/LArL1Sim/src/LArSCL1Maker.cxx  |   1 -
 LArCalorimeter/LArL1Sim/src/LArTTL1Maker.cxx  |   1 -
 17 files changed, 19 insertions(+), 623 deletions(-)
 delete mode 100755 LArCalorimeter/LArCnv/LArIdCnv/LArIdCnv/LArIdMgrDetDescrCnv.h
 delete mode 100755 LArCalorimeter/LArCnv/LArIdCnv/src/LArIdMgrDetDescrCnv.cxx
 delete mode 100755 LArCalorimeter/LArIdentifier/LArIdentifier/LArIdManager.h
 delete mode 100755 LArCalorimeter/LArIdentifier/src/LArIdManager.cxx

diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h
index 37fc1fd14cdd..eb5f56fe2d40 100755
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h
@@ -34,11 +34,12 @@ class GTower_ID;
 
 
 /**
-*  @brief This class initializes the Calo (LAr and Tile) offline identifiers.
-*
-*  For subdetector specific functionality (online identifiers and
-*  cabling for example, or Regions), one should use the LArIdManager and TileIdManager
-*
+ *  @brief This class initializes the Calo (LAr and Tile) offline identifiers.
+ *
+ *  For subdetector specific functionality (online identifiers and
+ *  cabling for example, or Regions), one should use TileIdManager (for Tile)
+ *  or retrieve ID helpers from the Detector Store (LAr)
+ *
 */
 class CaloIdManager
 {
diff --git a/Calorimeter/CaloTriggerTool/src/CaloTriggerTowerService.cxx b/Calorimeter/CaloTriggerTool/src/CaloTriggerTowerService.cxx
index d3cfbf470909..d1a6702182f6 100644
--- a/Calorimeter/CaloTriggerTool/src/CaloTriggerTowerService.cxx
+++ b/Calorimeter/CaloTriggerTool/src/CaloTriggerTowerService.cxx
@@ -9,7 +9,6 @@
 #include <iostream>
 
 #include "Gaudi/Property.h"
-#include "LArIdentifier/LArIdManager.h"
 #include "LArIdentifier/LArOnlineID.h"
 #include "LArIdentifier/LArOnlID_Exception.h"
 #include "CaloIdentifier/CaloIdManager.h"
@@ -79,16 +78,8 @@ StatusCode CaloTriggerTowerService::initialize ()
     msg() << MSG::DEBUG << "Successfully accessed CaloLVL1_ID helper" << endmsg;
   }
 
-  const LArIdManager*	larMgr;
-  status = detStore()->retrieve(larMgr);
+  status = detStore()->retrieve(m_onlineHelper, "LArOnlineID");
   if (status.isFailure()) {
-    msg() << MSG::ERROR << "Unable to retrieve LArIdManager from DetectorStore" << endmsg;
-    return StatusCode::FAILURE;
-  } else {
-    msg() << MSG::DEBUG << "Successfully retrieved LArIdManager from DetectorStore" << endmsg;
-  }
-  m_onlineHelper = larMgr->getOnlineID();
-  if (!m_onlineHelper) {
     msg() << MSG::ERROR << "Could not access LArOnlineID helper" << endmsg;
     return StatusCode::FAILURE;
   } else {
diff --git a/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx b/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx
index c5f9af64e3fa..f5c4da6b4da1 100755
--- a/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx
+++ b/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx
@@ -148,8 +148,6 @@ DetDescrCnvSvc::initialize()     {
     if (status != StatusCode::SUCCESS) return status;
     status =  addToDetStore(125856940, "CaloIdManager");
     if (status != StatusCode::SUCCESS) return status;
-    status =  addToDetStore(79554919, "LArIdManager");
-    if (status != StatusCode::SUCCESS) return status;
 
 
     // IdDict:
diff --git a/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref b/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
index 7c9424f1e27d..dbe32ae69856 100644
--- a/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
+++ b/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
@@ -311,7 +311,6 @@ LArIdMgrDetDesc...   INFO Set LArOnlineID helper in LArIdMgr
 LArIdMgrDetDesc...   INFO Set LArHVLineID helper in LArIdMgr 
 LArIdMgrDetDesc...   INFO Set LArElectrodeID helper in LArIdMgr 
 LArIdMgrDetDesc...   INFO Set CaloCell_ID helper in LArIdMgr 
-LArIdMgrDetDesc...   INFO Initializing LArIdMgr from values in LArIdMgrDetDescrCnv 
 ToolSvc.CaloTri...   INFO  ====> ...CaloTriggerTowerService::init() OK 
 ClassIDSvc           INFO  getRegistryEntries: read 60 CLIDRegistry entries for module ALL
 ToolSvc.tool2        INFO Initializing LArCellDeadOTXCorr
diff --git a/LArCalorimeter/LArCnv/LArIdCnv/LArIdCnv/LArIdMgrDetDescrCnv.h b/LArCalorimeter/LArCnv/LArIdCnv/LArIdCnv/LArIdMgrDetDescrCnv.h
deleted file mode 100755
index 9557dd8dfc99..000000000000
--- a/LArCalorimeter/LArCnv/LArIdCnv/LArIdCnv/LArIdMgrDetDescrCnv.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/***************************************************************************
- LAr Identifier converter package
- -----------------------------------------
- ***************************************************************************/
-
-//<doc><file>	$Id: LArIdMgrDetDescrCnv.h,v 1.5 2009-02-11 04:50:25 ssnyder Exp $
-//<version>	$Name: not supported by cvs2svn $
-
-#ifndef LARIDMGRDETDESCRCNV_LARIDMGRDETDESCRCNV_H
-# define LARIDMGRDETDESCRCNV_LARIDMGRDETDESCRCNV_H
-
-//<<<<<< INCLUDES                                                       >>>>>>
-
-#include "DetDescrCnvSvc/DetDescrConverter.h"
-
-//<<<<<< PUBLIC DEFINES                                                 >>>>>>
-//<<<<<< PUBLIC CONSTANTS                                               >>>>>>
-//<<<<<< PUBLIC TYPES                                                   >>>>>>
-//<<<<<< PUBLIC VARIABLES                                               >>>>>>
-//<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
-//<<<<<< CLASS DECLARATIONS                                             >>>>>>
-
-/**
- *  This class is a converter for the LArDetDescrManager which is
- *  stored in the detector store. This class derives from
- *  DetDescrConverter which is a converter of the DetDescrCnvSvc. This
- *  converter creates a manager object and adds descriptors and
- *  detector elements to the manager. This objects are either created
- *  or accessed from the detector store.
- */
-
-class LArIdMgrDetDescrCnv: public DetDescrConverter {
-
-public:
-    virtual long int   repSvcType() const;
-    virtual StatusCode initialize();
-    virtual StatusCode finalize();
-    virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj);
-
-    // Storage type and class ID (used by CnvFactory)
-    static long storageType();
-    static const CLID& classID();
-
-    LArIdMgrDetDescrCnv(ISvcLocator* svcloc);
-
-private:
-
-};
-
-
-
-//<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
-//<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
-
-#endif // LARIDMGRDETDESCRCNV_LARIDMGRDETDESCRCNV_H
diff --git a/LArCalorimeter/LArCnv/LArIdCnv/src/LArIdCnv_entries.cxx b/LArCalorimeter/LArCnv/LArIdCnv/src/LArIdCnv_entries.cxx
index 4619bf110f59..ba7ef79cb119 100644
--- a/LArCalorimeter/LArCnv/LArIdCnv/src/LArIdCnv_entries.cxx
+++ b/LArCalorimeter/LArCnv/LArIdCnv/src/LArIdCnv_entries.cxx
@@ -1,7 +1,6 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-#include "LArIdCnv/LArIdMgrDetDescrCnv.h"
 #include "LArIdCnv/LArOnlineIDDetDescrCnv.h"
 #include "LArIdCnv/LArOnline_SuperCellIDDetDescrCnv.h"
 #include "LArIdCnv/LArHVLineIDDetDescrCnv.h"
@@ -9,7 +8,6 @@
 
 DECLARE_CONVERTER( LArElectrodeIDDetDescrCnv )
 DECLARE_CONVERTER( LArHVLineIDDetDescrCnv )
-DECLARE_CONVERTER( LArIdMgrDetDescrCnv )
 DECLARE_CONVERTER( LArOnlineIDDetDescrCnv )
 DECLARE_CONVERTER( LArOnline_SuperCellIDDetDescrCnv )
 
diff --git a/LArCalorimeter/LArCnv/LArIdCnv/src/LArIdMgrDetDescrCnv.cxx b/LArCalorimeter/LArCnv/LArIdCnv/src/LArIdMgrDetDescrCnv.cxx
deleted file mode 100755
index 62993184fef2..000000000000
--- a/LArCalorimeter/LArCnv/LArIdCnv/src/LArIdMgrDetDescrCnv.cxx
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
-/***************************************************************************
- LAr Identifier converter package
- -----------------------------------------
- ***************************************************************************/
-
-
-#include "LArIdCnv/LArIdMgrDetDescrCnv.h"
-#include "LArIdentifier/LArIdManager.h"
-#include "Identifier/Identifier.h"
-#include "Identifier/IdentifierHash.h"
-#include "Identifier/HWIdentifier.h"
-#include "CaloIdentifier/CaloCell_ID.h"
-
-// infrastructure includes
-#include "DetDescrCnvSvc/DetDescrConverter.h"
-#include "DetDescrCnvSvc/DetDescrAddress.h"
-
-#include "GaudiKernel/Bootstrap.h"
-#include "GaudiKernel/MsgStream.h"
-#include "GaudiKernel/ISvcLocator.h"
-#include "GaudiKernel/IToolSvc.h"
-
-#include "StoreGate/StoreGateSvc.h" 
-
-// Identifier includes
-#include "LArIdentifier/LArOnlineID.h"
-#include "LArIdentifier/LArHVLineID.h"
-#include "LArIdentifier/LArElectrodeID.h"
-
-
-long int
-LArIdMgrDetDescrCnv::repSvcType() const
-{
-  return (storageType());
-}
-
-StatusCode 
-LArIdMgrDetDescrCnv::initialize()
-{
-    // First call parent init
-    StatusCode sc = DetDescrConverter::initialize();
-    MsgStream log(msgSvc(), "LArIdMgrDetDescrCnv");
-    log << MSG::DEBUG << "in initialize" << endmsg;
-
-    if (sc.isFailure()) {
-        log << MSG::ERROR << "DetDescrConverter::initialize failed" << endmsg;
-	return sc;
-    }
-    
-    return StatusCode::SUCCESS; 
-}
-
-//--------------------------------------------------------------------
-
-StatusCode 
-LArIdMgrDetDescrCnv::finalize()
-{
-    MsgStream log(msgSvc(), "LArIdMgrDetDescrCnv");
-    log << MSG::DEBUG << "in finalize" << endmsg;
-
-    return StatusCode::SUCCESS; 
-}
-
-//--------------------------------------------------------------------
-
-StatusCode LArIdMgrDetDescrCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) 
-{
-    MsgStream log(msgSvc(), "LArIdMgrDetDescrCnv");
-    log << MSG::INFO 
-	<< "in createObj: creating a LArDescrManager object in the detector store" 
-	<< endmsg;
-
-    // Create a new LArIdManager
-
-    DetDescrAddress* ddAddr;
-    ddAddr = dynamic_cast<DetDescrAddress*> (pAddr);
-    if(!ddAddr) {
-	log << MSG::FATAL << "Could not cast to DetDescrAddress." << endmsg;
-	return StatusCode::FAILURE;
-    }
-
-    // Get the StoreGate key of this container.
-    std::string mgrKey  = *( ddAddr->par() );
-    if ("" == mgrKey) {
-	log << MSG::DEBUG << "No Manager key " << endmsg;
-    }
-    else {
-	log << MSG::DEBUG << "Manager key is " << mgrKey << endmsg;
-    }
-    
-    // Create the manager
-    LArIdManager* larIdMgr = new LArIdManager(); 
-
-    // Pass a pointer to the container to the Persistency service by reference.
-    pObj = StoreGateSvc::asStorable(larIdMgr);
-
-    // get DetectorStore service
-    StoreGateSvc * detStore;
-    StatusCode status = serviceLocator()->service("DetectorStore", detStore);
-    if (status.isFailure()) {
-	log << MSG::FATAL << "DetectorStore service not found !" << endmsg;
-	return StatusCode::FAILURE;
-    } else {}
- 
-    // Get calo online idhelper from detector store and add to mgr
-    const LArOnlineID* onl_id;
-    status = detStore->retrieve(onl_id, "LArOnlineID");
-    if (status.isFailure()) {
-	log << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg;
-	return StatusCode::FAILURE;
-    } 
-    else {
-	log << MSG::DEBUG << " Found the LArOnlineID helper. " << endmsg;
-    }
-    larIdMgr->set_helper(onl_id);
-    log << MSG::INFO << "Set LArOnlineID helper in LArIdMgr " 
-	<< endmsg;
-
-     // Get calo HVLine idhelper from detector store and add to mgr
-    const LArHVLineID* hv_id;
-    status = detStore->retrieve(hv_id, "LArHVLineID");
-    if (status.isFailure()) {
-	log << MSG::FATAL << "Could not get LArHVLineID helper !" << endmsg;
-	return StatusCode::FAILURE;
-    } 
-    else {
-	log << MSG::DEBUG << " Found the LArHVLineID helper. " << endmsg;
-    }
-    larIdMgr->set_helper(hv_id);
-    log << MSG::INFO << "Set LArHVLineID helper in LArIdMgr " 
-	<< endmsg;
-
-     // Get Electrode idhelper from detector store and add to mgr
-    const LArElectrodeID* elec_id;
-    status = detStore->retrieve(elec_id, "LArElectrodeID");
-    if (status.isFailure()) {
-	log << MSG::FATAL << "Could not get LArElectrodeID helper !" << endmsg;
-	return StatusCode::FAILURE;
-    } 
-    else {
-	log << MSG::DEBUG << " Found the LArElectrodeID helper. " << endmsg;
-    }
-    larIdMgr->set_helper(elec_id);
-    log << MSG::INFO << "Set LArElectrodeID helper in LArIdMgr " 
-	<< endmsg;
- 
-    // Get calo offline idhelper from detector store and add to mgr
-    const CaloCell_ID* cell_id;
-    status = detStore->retrieve(cell_id, "CaloCell_ID");
-    if (status.isFailure()) {
-	log << MSG::FATAL << "Could not get CaloCell_ID helper !" << endmsg;
-	return StatusCode::FAILURE;
-    } 
-    else {
-	log << MSG::DEBUG << " Found the CaloCell_ID helper. " << endmsg;
-    }
-    larIdMgr->set_helper(cell_id);
-    log << MSG::INFO << "Set CaloCell_ID helper in LArIdMgr " 
-	<< endmsg;
-
-    // Initialize the lar mgr
-    //  We protect here in case this has been initialized elsewhere
-    if (!larIdMgr->isInitialized()) {
-
-      log << MSG::INFO << "Initializing LArIdMgr from values in LArIdMgrDetDescrCnv " 
-	  << endmsg;
-      
-      // Initialize the manager ... 
-
-      // in this one, only strictly lar work is done
-      larIdMgr->initialize();
-
-    }
-
-
-    return StatusCode::SUCCESS; 
-
-}
-
-//--------------------------------------------------------------------
-
-long 
-LArIdMgrDetDescrCnv::storageType()
-{
-    return DetDescr_StorageType;
-}
-
-//--------------------------------------------------------------------
-const CLID& 
-LArIdMgrDetDescrCnv::classID() { 
-    return ClassID_traits<LArIdManager>::ID(); 
-}
-
-//--------------------------------------------------------------------
-LArIdMgrDetDescrCnv::LArIdMgrDetDescrCnv(ISvcLocator* svcloc) 
-    :
-    DetDescrConverter(ClassID_traits<LArIdManager>::ID(), svcloc)
-{}
diff --git a/LArCalorimeter/LArCondUtils/src/LArFecLvTempDcsTool.cxx b/LArCalorimeter/LArCondUtils/src/LArFecLvTempDcsTool.cxx
index e3b5b2b9d967..f63dde4c42c0 100755
--- a/LArCalorimeter/LArCondUtils/src/LArFecLvTempDcsTool.cxx
+++ b/LArCalorimeter/LArCondUtils/src/LArFecLvTempDcsTool.cxx
@@ -17,7 +17,6 @@
 //-----------------------------------------------------------------------
 
 #include "LArFecLvTempDcsTool.h" 
-#include "LArIdentifier/LArIdManager.h"
 #include "LArRawConditions/LArFecLvTempDcs.h" 
 
 #include "GaudiKernel/IToolSvc.h"
@@ -47,16 +46,8 @@ LArFecLvTempDcsTool::~LArFecLvTempDcsTool()
 // intialize 
 StatusCode LArFecLvTempDcsTool::initialize()
 {
-  const LArIdManager* larMgr = nullptr;
-  ATH_CHECK( detStore()->retrieve(larMgr) );
-  ATH_MSG_DEBUG ( "Successfully retrieved LArIdManager from DetectorStore" );
-
   // retrieve LArOnlineID
-  m_larOnlineId = larMgr->getOnlineID();
-  if (!m_larOnlineId) {
-    ATH_MSG_ERROR( "Unable to retrieve pointer to LArOnlineID  " );
-    return StatusCode::FAILURE;
-  }
+  ATH_CHECK( detStore()->retrieve(m_larOnlineId, "LArOnlineID") );
   ATH_MSG_DEBUG ( "Retrieved LArOnlineID" );
 
   ATH_CHECK( detStore()->regHandle(m_atrlistcol,m_foldername) );
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloDDE.h b/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloDDE.h
index ecca755faf18..b65c42611a20 100755
--- a/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloDDE.h
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloDDE.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 TESTLARDETDESCR_TESTCALODDE_H
@@ -21,7 +21,6 @@ PURPOSE:  provide example to retreive CaloDetDescr manager and
 #include "AthenaBaseComps/AthAlgorithm.h"
 
 class CaloIdManager;
-class LArIdManager;
 class CaloDetDescrManager;
 #include "CaloIdentifier/CaloCell_ID.h"
 class ICaloRecoMaterialTool;
@@ -60,7 +59,6 @@ class TestCaloDDE : public AthAlgorithm
   
   const CaloIdManager*  m_calo_id_man;
   const CaloDetDescrManager*  m_calo_dd_man;
-  const LArIdManager* m_lar_id_man;
 
   // Simplified geometry :
   ICaloRecoMaterialTool* m_lar_mat;
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.cxx b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.cxx
index 734b198c8a6a..7f52574a3d14 100755
--- a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.cxx
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.cxx
@@ -16,7 +16,6 @@
 // specific :
 #include "CaloIdentifier/LArID.h"
 #include "CaloIdentifier/CaloIdManager.h"
-#include "LArIdentifier/LArIdManager.h"
 
 #include "CaloDetDescr/CaloSubdetNames.h"
 #include "CaloDetDescr/CaloDetDescrManager.h"
@@ -40,7 +39,6 @@ TestCaloDDE::TestCaloDDE(const std::string& name,
   AthAlgorithm(name, pSvcLocator),
   m_calo_id_man(0),
   m_calo_dd_man(0),
-  m_lar_id_man(0),
   m_lar_mat(0),
   m_lar_simplegeom(0)
 {}
@@ -55,9 +53,6 @@ StatusCode TestCaloDDE::initialize()
   ATH_CHECK( detStore()->retrieve(m_calo_id_man) );
   ATH_MSG_DEBUG ( "Successfully retrieved CaloIdManager from DetectorStore" );
   
-  ATH_CHECK( detStore()->retrieve(m_lar_id_man) );
-  ATH_MSG_DEBUG ( "Successfully retrieved LArIdManager from DetectorStore" );
-
   ATH_CHECK( detStore()->retrieve(m_calo_dd_man) );
   ATH_MSG_DEBUG ( "Successfully retrieved CaloDetDescrManager from DetectorStore" );
 
@@ -477,8 +472,7 @@ TestCaloDDE::print_elt_HW(bool em, bool hec, bool fcal)
 		  << "calo-hash=" << (unsigned int) idcalohash 
 		  << " sub-hash=" << i << " region: "
 		  << help_em->sampling(id)<< " " 
-		  << help_em->region(id)<< " "
-		   << " online id " <<  m_lar_id_man->get_HWId(idcalohash)
+		  << help_em->region(id)
 		  << std::endl;
 		  }
       
@@ -508,8 +502,7 @@ TestCaloDDE::print_elt_HW(bool em, bool hec, bool fcal)
 		   << "calo-hash=" << (unsigned int) idcalohash 
 		   << " sub-hash=" << i << " region: "
 		   << help_hec->sampling(id)<< " " 
-		   << help_hec->region(id)<< " "
-		   << " online id " <<  m_lar_id_man->get_HWId(idcalohash)
+		   << help_hec->region(id)
 		   << std::endl;
       }
     }
@@ -537,8 +530,7 @@ TestCaloDDE::print_elt_HW(bool em, bool hec, bool fcal)
      	std::cout  << std::setw(9) << std::setprecision(4) 
 		   << "calo-hash=" << (unsigned int) idcalohash 
 		  << " sub-hash=" << i << " region: "
-		  << help_fcal-> module(id)<< " " 
-		   << " online id " <<  m_lar_id_man->get_HWId(idcalohash)
+		  << help_fcal-> module(id)
 		  << std::endl;
 
       }
diff --git a/LArCalorimeter/LArExample/TestLArHardwareID/src/TestLArHWID_Algo.cxx b/LArCalorimeter/LArExample/TestLArHardwareID/src/TestLArHWID_Algo.cxx
index 36454b8526bc..d86c3888a96b 100644
--- a/LArCalorimeter/LArExample/TestLArHardwareID/src/TestLArHWID_Algo.cxx
+++ b/LArCalorimeter/LArExample/TestLArHardwareID/src/TestLArHWID_Algo.cxx
@@ -17,7 +17,6 @@
 #include "CaloIdentifier/CaloID.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloIdentifier/LArID_Exception.h"
-#include "LArIdentifier/LArIdManager.h"
 #include "LArIdentifier/LArOnlineID.h"
 #include "LArIdentifier/LArHVLineID.h"
 #include "LArIdentifier/LArElectrodeID.h"
@@ -219,70 +218,20 @@ StatusCode TestLArHWID_Algo::initialize(){
   }
 
   // LAr 
-  if(m_Manager == "DIRECT") {
-    ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
-    ATH_MSG_DEBUG ( " Found the LArOnlineID helper. " );
-  }
-  else {
-    // via Mgr
-    const LArIdManager*	larIdMgr = nullptr;
-    ATH_CHECK(  detStore()->retrieve(larIdMgr) );
-    ATH_MSG_INFO ( "Successfully retrieved LArIdManager from DetectorStore" );
-
-    const LArOnlineID* onlineId = larIdMgr->getOnlineID();
-    if (!onlineId) {
-      ATH_MSG_ERROR ( "Could not access lar ONLINE ID helper" );
-      return StatusCode::FAILURE;
-    } else {
-      ATH_MSG_INFO ( "Successfully accessed lar ONLINE ID helper" );
-      m_onlineHelper=onlineId;
-    }
-
-  }
+  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
+  ATH_MSG_DEBUG ( " Found the LArOnlineID helper. " );
 
   // =============================
   // LArHVLine  
   // =============================
-  if(m_Manager == "DIRECT") {
-    ATH_CHECK( detStore()->retrieve(m_hvHelper, "LArHVLineID") );
-    ATH_MSG_DEBUG ( " Found the LArHVLineID helper. " );
-  }
-  else {
-    // via Mgr
-    const LArIdManager*	larIdMgr = nullptr;
-    ATH_CHECK( detStore()->retrieve(larIdMgr) );
-    ATH_MSG_INFO ( "Successfully retrieved LArIdManager from DetectorStore" );
+  ATH_CHECK( detStore()->retrieve(m_hvHelper, "LArHVLineID") );
+  ATH_MSG_DEBUG ( " Found the LArHVLineID helper. " );
 
-    const LArHVLineID* hvId = larIdMgr->getHVLineID();
-    if (!hvId) {
-      ATH_MSG_ERROR ( "Could not access LArHVLineID helper" );
-      return StatusCode::FAILURE;
-    } else {
-      ATH_MSG_INFO ( "Successfully accessed LArHVLineID helper" );
-      m_hvHelper=hvId;
-    }
-  }
   // =============================
   // LArElectrode
   // =============================
-  if(m_Manager == "DIRECT") {
-    ATH_CHECK( detStore()->retrieve(m_electrodeHelper, "LArElectrodeID") );
-    ATH_MSG_DEBUG ( " Found the LArElectrodeID helper. " );
-  }
-  else {
-    // via Mgr
-    const LArIdManager*	larIdMgr = nullptr;
-    ATH_CHECK( detStore()->retrieve(larIdMgr) );
-    ATH_MSG_INFO ( "Successfully retrieved LArIdManager from DetectorStore" );
-    const LArElectrodeID* elecId = larIdMgr->getLArElectrodeID();
-    if (!elecId) {
-      ATH_MSG_ERROR ( "Could not access LArElectrodeID helper" );
-      return StatusCode::FAILURE;
-    } else {
-      ATH_MSG_INFO ( "Successfully accessed LArElectrodeID helper" );
-      m_electrodeHelper=elecId;
-    }
-  }
+  ATH_CHECK( detStore()->retrieve(m_electrodeHelper, "LArElectrodeID") );
+  ATH_MSG_DEBUG ( " Found the LArElectrodeID helper. " );
 
   return StatusCode::SUCCESS;
 }
diff --git a/LArCalorimeter/LArExample/TestLArHardwareID/src/initTTMap_Algo.cxx b/LArCalorimeter/LArExample/TestLArHardwareID/src/initTTMap_Algo.cxx
index 5b6ead354dea..ba220465baf0 100644
--- a/LArCalorimeter/LArExample/TestLArHardwareID/src/initTTMap_Algo.cxx
+++ b/LArCalorimeter/LArExample/TestLArHardwareID/src/initTTMap_Algo.cxx
@@ -19,8 +19,6 @@
 #include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloID.h"
 #include "CaloIdentifier/LArID_Exception.h"
-//#include "LArIdentifier/LArIdManager.h"
-//#include "LArIdentifier/LArOnlineID.h"
 #include "CaloTriggerTool/CaloTriggerTowerService.h"
 #include "CaloTriggerTool/LArTTCell.h"
 #include "CaloTriggerTool/LArTTCellMap.h"
diff --git a/LArCalorimeter/LArExample/TestLArHardwareID/src/testTTMap_Algo.cxx b/LArCalorimeter/LArExample/TestLArHardwareID/src/testTTMap_Algo.cxx
index c7f5e171bafe..c24bcca916de 100755
--- a/LArCalorimeter/LArExample/TestLArHardwareID/src/testTTMap_Algo.cxx
+++ b/LArCalorimeter/LArExample/TestLArHardwareID/src/testTTMap_Algo.cxx
@@ -15,7 +15,6 @@
 
 #include "CaloIdentifier/CaloIdManager.h"
 #include "CaloIdentifier/CaloID.h"
-#include "LArIdentifier/LArIdManager.h"
 #include "CaloTriggerTool/LArTTCell.h"
 #include "CaloTriggerTool/LArTTCell_P.h"
 #include "CaloTriggerTool/LArTTCellMap.h"
diff --git a/LArCalorimeter/LArIdentifier/LArIdentifier/LArIdManager.h b/LArCalorimeter/LArIdentifier/LArIdentifier/LArIdManager.h
deleted file mode 100755
index 9ae61deff763..000000000000
--- a/LArCalorimeter/LArIdentifier/LArIdentifier/LArIdManager.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-/***************************************************************************
- LAr Calorimeter Identifier package
- -----------------------------------------
- ***************************************************************************/
-
-//<doc><file>	$Id: LArIdManager.h,v 1.9 2007-06-14 16:11:51 lucotte Exp $
-//<version>	$Name: not supported by cvs2svn $
-
-#ifndef LARID_LARIDMANAGER_H
-# define LARID_LARIDMANAGER_H
-
-//<<<<<< INCLUDES                                                       >>>>>>
-
-#include "AthenaKernel/CLASS_DEF.h"
-#include "Identifier/HWIdentifier.h"
-#include "Identifier/IdentifierHash.h"
-
-#include <vector>
-#include <map>
-
-//<<<<<< PUBLIC TYPES                                                   >>>>>>
-
-class LArOnlineID;
-class LArHVLineID;
-class LArElectrodeID;
-class CaloCell_ID;
-
-//<<<<<< CLASS DECLARATIONS                                             >>>>>>
-
-/**
-* @brief This class provides the client interface for accessing the
-*  detector description information common to LAr and Tile.
-*
-*  For sub-detector specific functionality (online identifiers and
-*  cabling for example, or Regions), one should use the
-*  LArIdManager and TileIdManager
-*
-*/
-class LArIdManager
-{
-
-public:
-    
-    LArIdManager(void);
-    ~LArIdManager(void);
-
-    ///  Access to IdHelper
-    const LArOnlineID*          getOnlineID      (void) const;
-    const LArHVLineID*          getHVLineID      (void) const;
-    const LArElectrodeID*       getLArElectrodeID(void) const;
-
-    // -------- access online<->offline channel maps -------------
-
-    typedef std::map<HWIdentifier, IdentifierHash > HWtoOffH_map;
-    typedef HWtoOffH_map::const_iterator            HWtoOffH_const_iterator;
-    typedef HWtoOffH_map::size_type                 HWtoOffH_size ;
-
-    HWtoOffH_const_iterator  HWtoOffH_map_begin (void) const;
-    HWtoOffH_const_iterator  HWtoOffH_map_end   (void) const;
-    HWtoOffH_size            HWtoOffH_map_size  (void) const;
-
-    typedef std::map<IdentifierHash, HWIdentifier >  OffHtoHW_map;
-    typedef OffHtoHW_map::const_iterator             OffHtoHW_const_iterator ;
-    typedef OffHtoHW_map::size_type                  OffHtoHW_size ;
-
-    OffHtoHW_const_iterator OffHtoHW__map_begin (void) const;
-    OffHtoHW_const_iterator OffHtoHW__map_end   (void) const;
-    OffHtoHW_size           OffHtoHW__map_size  (void) const;
-
-    HWIdentifier get_HWId (IdentifierHash  idcalohash) const;
-    IdentifierHash get_calohash (HWIdentifier HWid ) const;
-
-    /// these methods are used within Id initialisation, general public
-    /// should ignore them :
-
-    void                        initialize              (void);
-    bool                        isInitialized           (void) const;
-
-    void set_helper (const LArOnlineID* idHelper);
-    void set_helper (const LArHVLineID* idHelper);
-    void set_helper (const LArElectrodeID* idHelper);
-    void set_helper (const CaloCell_ID* idHelper);
-
-    // Ugly, ugly ...
-    // this manager do not have the right to depend on the CablingSvc,
-    // because of a dependency loop between LArIdentifier and LArTools
-    // => maps are filled via the converter
-    void add_to_maps (const IdentifierHash offlh, const HWIdentifier onlid);
-
-private:
-
-    bool                m_isInitialized;
-
-    const LArOnlineID*  m_onl_id;
-    const LArHVLineID*  m_larhv_id;
-    const LArElectrodeID*  m_larelec_id;
-    const CaloCell_ID*  m_cell_id;
-
-    HWtoOffH_map m_HWid_to_calohash;
-    OffHtoHW_map m_calohash_to_HWid;
-
-};
-
-CLASS_DEF( LArIdManager , 79554919 , 1 )
-
-//<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
-//<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
-
-#endif // LARID_LARIDMANAGER_H
diff --git a/LArCalorimeter/LArIdentifier/src/LArIdManager.cxx b/LArCalorimeter/LArIdentifier/src/LArIdManager.cxx
deleted file mode 100755
index 93e5496befc5..000000000000
--- a/LArCalorimeter/LArIdentifier/src/LArIdManager.cxx
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/***************************************************************************
- LArrimeter identifier package
- -----------------------------------------
- ***************************************************************************/
-
-//<doc><file>	$Id: LArIdManager.cxx,v 1.8 2007-03-05 09:14:07 fledroit Exp $
-//<version>	$Name: not supported by cvs2svn $
-
-//<<<<<< INCLUDES                                                       >>>>>>
-
-// LAr includes
-#include "LArIdentifier/LArIdManager.h"
-#include "LArIdentifier/LArOnlineID.h"
-#include "LArIdentifier/LArHVLineID.h"
-#include "LArIdentifier/LArElectrodeID.h"
-#include "CaloIdentifier/CaloCell_ID.h"
-
-// Athena/Gaudi includes
-#include "GaudiKernel/Bootstrap.h"
-#include "GaudiKernel/ISvcLocator.h"
-#include "GaudiKernel/IMessageSvc.h"
-#include "StoreGate/StoreGateSvc.h"
-
-LArIdManager::LArIdManager(void)
-    :
-    m_isInitialized(false),
-    m_onl_id(0),
-    m_larhv_id(0),
-    m_larelec_id(0),
-    m_cell_id(0)
-{
-}
-
-LArIdManager::~LArIdManager(void)
-{
-}
-
-const LArOnlineID*  LArIdManager::getOnlineID(void) const
-{
-    return (m_onl_id);
-}
-const LArHVLineID*  LArIdManager::getHVLineID(void) const
-{
-    return (m_larhv_id);
-}
-const LArElectrodeID*  LArIdManager::getLArElectrodeID(void) const
-{
-    return (m_larelec_id);
-}
-
-
-/// ------ access to online<->offline channel map -------------
-
-LArIdManager::HWtoOffH_const_iterator  			
-LArIdManager::HWtoOffH_map_begin (void) const 
-{
-    return m_HWid_to_calohash.begin();
-}
-
-LArIdManager::HWtoOffH_const_iterator  			
-LArIdManager::HWtoOffH_map_end   (void) const 
-{
-  return m_HWid_to_calohash.end();
-}
-
-LArIdManager::HWtoOffH_size            			
-LArIdManager::HWtoOffH_map_size  (void) const 
-{
-    return m_HWid_to_calohash.size();
-}
-
-LArIdManager::OffHtoHW_const_iterator   			
-LArIdManager::OffHtoHW__map_begin (void) const 
-{
-    return m_calohash_to_HWid.begin();
-}
-
-LArIdManager::OffHtoHW_const_iterator   			
-LArIdManager::OffHtoHW__map_end   (void) const 
-{
-  return m_calohash_to_HWid.end();
-}
-
-LArIdManager::OffHtoHW_size   			
-LArIdManager::OffHtoHW__map_size  (void) const 
-{
-    return m_calohash_to_HWid.size();
-}
-
-HWIdentifier                                 
-LArIdManager::get_HWId (IdentifierHash  idcalohash) const
-{
-    return (*m_calohash_to_HWid.find(idcalohash) ).second;
-}
-
-IdentifierHash                                 
-LArIdManager::get_calohash (HWIdentifier HWid ) const
-{
-    return (*m_HWid_to_calohash.find(HWid) ).second;
-}
-    
-void                                
-LArIdManager::initialize              (void)
-{
-  m_isInitialized = true;
-}
-
-bool                                
-LArIdManager::isInitialized           (void) const
-{
-    return (m_isInitialized);
-}
-
-void LArIdManager::set_helper(const LArOnlineID*     idHelper)
-{
-    m_onl_id = idHelper;
-}
-
-void LArIdManager::set_helper(const CaloCell_ID*     idHelper)
-{
-    m_cell_id = idHelper;
-}
-
-void LArIdManager::set_helper(const LArHVLineID*     idHelper)
-{
-    m_larhv_id = idHelper;
-}
-
-void LArIdManager::set_helper(const LArElectrodeID*     idHelper)
-{
-    m_larelec_id = idHelper;
-}
-
-void LArIdManager::add_to_maps (const IdentifierHash offlh, const HWIdentifier onlid)
-{
-      m_calohash_to_HWid[offlh] = onlid;
-      m_HWid_to_calohash[onlid] = offlh;
-}
diff --git a/LArCalorimeter/LArL1Sim/src/LArSCL1Maker.cxx b/LArCalorimeter/LArL1Sim/src/LArSCL1Maker.cxx
index 0db0ea9054a7..b29453b29605 100755
--- a/LArCalorimeter/LArL1Sim/src/LArSCL1Maker.cxx
+++ b/LArCalorimeter/LArL1Sim/src/LArSCL1Maker.cxx
@@ -31,7 +31,6 @@
 #include "CaloIdentifier/LArID.h"
 #include "CaloIdentifier/CaloID_Exception.h"
 #include "CaloIdentifier/CaloLVL1_ID.h"
-#include "LArIdentifier/LArIdManager.h"
 #include "LArIdentifier/LArOnline_SuperCellID.h"
 #include "CaloIdentifier/CaloCell_SuperCell_ID.h"
 #include "CaloIdentifier/CaloCell_ID.h"
diff --git a/LArCalorimeter/LArL1Sim/src/LArTTL1Maker.cxx b/LArCalorimeter/LArL1Sim/src/LArTTL1Maker.cxx
index 83468b87592a..4c3cb6e3dd65 100755
--- a/LArCalorimeter/LArL1Sim/src/LArTTL1Maker.cxx
+++ b/LArCalorimeter/LArL1Sim/src/LArTTL1Maker.cxx
@@ -34,7 +34,6 @@
 #include "CaloIdentifier/CaloID_Exception.h"
 #include "CaloIdentifier/CaloLVL1_ID.h"
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "LArIdentifier/LArIdManager.h"
 #include "CaloTriggerTool/CaloTriggerTowerService.h"
 //
 // ........ Event Header Files:
-- 
GitLab


From 2be13f70811f875906ea66094376b9eb677d5b3f Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Mon, 20 Sep 2021 08:08:33 +0200
Subject: [PATCH 203/347] Cleaned ref files from references to LArIdManager

---
 .../AthenaPoolTest/share/AthenaPoolTestReadAfterCopy.ref    | 1 -
 .../AthenaPoolTest/share/AthenaPoolTestWrite2.ref           | 1 -
 .../AthenaPoolTest/share/AtlfastPoolWriteOptions.ref        | 1 -
 .../AthenaPoolTest/share/CaloCluster2StepReader.ref         | 1 -
 .../AthenaPoolTest/share/CaloClusterStep1Writer.ref         | 1 -
 .../AthenaPoolTest/share/LArCellContWriteStep1.ref          | 1 -
 .../AthenaPoolTest/share/LArCellContWriteStep2.ref          | 1 -
 .../IOVDbTestAlg/share/IOVDbTestAlgReadCoolAndReg.ref       | 1 -
 .../IOVDbTestAlg/share/IOVDbTestAlgReadCoolNoReg.ref        | 1 -
 .../CaloCnv/CaloAthenaPool/share/CaloTPCnv_14.5.0.ref       | 1 -
 .../CaloCnv/CaloAthenaPool/share/CaloTPCnv_15.1.0.ref       | 1 -
 .../CaloCnv/CaloAthenaPool/share/CaloTPCnv_15.5.0.ref       | 1 -
 .../CaloCnv/CaloAthenaPool/share/CaloTPCnv_18.0.0.ref       | 1 -
 .../CaloCnv/CaloAthenaPool/share/CaloTPCnv_20.1.7.2.ref     | 1 -
 Calorimeter/CaloDetDescr/share/CaloSuperCellIDTool_test.ref | 1 -
 .../CaloRec/share/CaloCellContainerAliasAlg_test.ref        | 1 -
 .../CaloRec/share/CaloThinCellsByClusterAlg_test.ref        | 1 -
 .../CaloRec/share/CaloThinCellsBySamplingAlg_test.ref       | 1 -
 Calorimeter/CaloTools/share/CaloEstimatedGainTool_test.ref  | 1 -
 Calorimeter/CaloUtils/share/CaloTowerStore_test.ref         | 1 -
 .../share/EventBookkeeperTPCnv_16.0.0.ref                   | 1 -
 .../share/EventBookkeeperTPCnv_18.0.0.ref                   | 1 -
 .../share/xAODBTaggingAthenaPool_21.0.79.ref                | 1 -
 .../share/xAODCaloEventAthenaPool_20.1.7.2.ref              | 1 -
 .../share/xAODCaloEventAthenaPool_21.0.79.ref               | 1 -
 .../share/xAODCaloRingsAthenaPool_21.0.79.ref               | 1 -
 .../share/xAODEgammaAthenaPool_20.1.7.2.ref                 | 1 -
 .../share/xAODEgammaAthenaPool_21.0.79.ref                  | 1 -
 .../share/xAODEventInfoAthenaPool_20.0.0.3.ref              | 1 -
 .../share/xAODEventShapeAthenaPool_21.0.79.ref              | 1 -
 .../xAODJetAthenaPool/share/xAODJetAthenaPool_20.7.2.2.ref  | 1 -
 .../xAODJetAthenaPool/share/xAODJetAthenaPool_21.0.79.ref   | 1 -
 .../share/xAODMissingETAthenaPool_20.1.7.2.ref              | 1 -
 .../share/xAODMissingETAthenaPool_21.0.79.ref               | 1 -
 .../share/xAODMuonAthenaPool_20.1.7.2.ref                   | 1 -
 .../share/xAODMuonAthenaPool_20.7.2.2.ref                   | 1 -
 .../share/xAODMuonAthenaPool_20.7.9.9.ref                   | 1 -
 .../xAODMuonAthenaPool/share/xAODMuonAthenaPool_21.0.79.ref | 1 -
 .../share/xAODMuonAthenaPool_master-20190911.ref            | 1 -
 .../share/xAODPFlowAthenaPool_21.0.79.ref                   | 1 -
 .../share/xAODParticleAthenaPool_21.0.79.ref                | 1 -
 .../xAODTauAthenaPool/share/xAODTauAthenaPool_20.1.7.2.ref  | 1 -
 .../xAODTauAthenaPool/share/xAODTauAthenaPool_20.7.2.2.ref  | 1 -
 .../xAODTauAthenaPool/share/xAODTauAthenaPool_21.0.79.ref   | 1 -
 .../share/xAODTrackingAthenaPool_20.1.7.2.ref               | 1 -
 .../share/xAODTrackingAthenaPool_20.7.2.2.ref               | 1 -
 .../share/xAODTrackingAthenaPool_21.0.79.ref                | 1 -
 .../share/xAODTrackingAthenaPool_master-20190911.ref        | 1 -
 .../share/xAODTrigCaloAthenaPool_20.0.0.3.ref               | 1 -
 .../share/xAODTrigCaloAthenaPool_21.0.79.ref                | 1 -
 .../share/xAODTrigEgammaAthenaPool_21.0.79.ref              | 1 -
 .../share/xAODTrigMissingETAthenaPool_21.0.79.ref           | 1 -
 .../share/xAODTrigMuonAthenaPool_20.1.7.2.ref               | 1 -
 .../share/xAODTrigMuonAthenaPool_21.0.79.ref                | 1 -
 .../share/xAODTrigRingerAthenaPool_21.0.79.ref              | 1 -
 .../share/xAODTriggerAthenaPool_20.1.7.2.ref                | 1 -
 .../share/xAODTriggerAthenaPool_master-20190911.ref         | 1 -
 .../share/xAODTruthAthenaPool_21.0.79.ref                   | 1 -
 .../ZdcEventAthenaPool/share/ZdcEventTPCnv_15.6.7.ref       | 1 -
 .../share/InDetBCM_EventAthenaPool_20.1.7.2.ref             | 1 -
 .../share/InDetSimEventTPCnv_HITS.ref                       | 1 -
 .../LArCellRec/share/LArBadFebMaskingTool_test.ref          | 1 -
 LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref | 6 ------
 .../LArCnv/LArAthenaPool/share/LArTPCnv_15.6.7.ref          | 1 -
 .../LArCnv/LArAthenaPool/share/LArTPCnv_20.1.7.2.ref        | 1 -
 .../LArSimEventAthenaPool/share/LArSimEventTPCnv_HITS.ref   | 1 -
 .../LArRecUtils/share/LArFCalTowerBuilderTool.ref           | 1 -
 .../LArTest/LArConditionsTest/share/LArConditionsTest.ref   | 1 -
 .../LArConditionsTest/share/LArConditionsTestReadNoReg.ref  | 1 -
 .../LArConditionsTest/share/LArConditionsTestWriteNoReg.ref | 1 -
 .../MuonEventAthenaPool/share/MuonEventTPCnv_17.0.0.ref     | 1 -
 .../MuonEventAthenaPool/share/MuonEventTPCnv_20.1.7.2.ref   | 1 -
 .../MuonSimEventAthenaPool/share/MuonSimEventTPCnv_HITS.ref | 1 -
 .../Jet/JetEventAthenaPool/share/JetTPCnv_15.9.0.5.ref      | 1 -
 .../Jet/JetEventAthenaPool/share/JetTPCnv_17.0.0.ref        | 1 -
 .../Jet/JetEventAthenaPool/share/JetTPCnv_17.2.8.ref        | 1 -
 .../eflowAthenaPool/share/eflowEventTPCnv_17.5.0.ref        | 1 -
 .../eflowAthenaPool/share/eflowEventTPCnv_18.0.0.ref        | 1 -
 .../FastCaloSim/share/AddNoiseCellBuilderTool_test.ref      | 1 -
 .../FastCaloSim/share/FastShowerCellBuilderTool_test.ref    | 1 -
 .../TileConditions/share/TileDCSComponents_test.ref         | 1 -
 .../TileConditions/share/TileEMScaleComponents_test.ref     | 1 -
 .../TileRecUtils/share/TileCellBuilderFromHit_test.ref      | 1 -
 TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref | 1 -
 TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref | 1 -
 .../TileRecUtils/share/TileDQstatusTool_test.ref            | 1 -
 .../TileRecUtils/share/TileRawChannelBuilder_test.ref       | 1 -
 .../share/TileBeamElemContByteStreamCnv_test.ref            | 2 --
 .../share/TileDigitsContByteStreamCnv_test.ref              | 2 --
 .../TileByteStream/share/TileL2ContByteStreamCnv_test.ref   | 2 --
 .../TileByteStream/share/TileLaserObjByteStreamCnv_test.ref | 2 --
 .../share/TileMuRcvContByteStreamCnv_test.ref               | 2 --
 .../share/TileRawChannelContByteStreamCnv_test.ref          | 2 --
 .../TileSvc/TileEventAthenaPool/share/TileTPCnv_15.6.4.ref  | 1 -
 .../TileEventAthenaPool/share/TileTPCnv_20.1.7.2.ref        | 1 -
 .../TileSimEventAthenaPool/share/TileSimEventTPCnv_HITS.ref | 1 -
 .../TrkVKalVrtFitter/share/TrkVKalVrtFitter_test.ref        | 1 -
 .../share/TrigEventAthenaPool_15.6.1.ref                    | 1 -
 .../share/TrigEventAthenaPool_15.6.13.2.ref                 | 1 -
 .../share/TrigEventAthenaPool_16.0.3.3.ref                  | 1 -
 .../share/TrigEventAthenaPool_17.0.6.ref                    | 1 -
 .../share/TrigEventAthenaPool_20.1.7.2.ref                  | 1 -
 .../share/TrigSteeringEventAthenaPool_15.6.1.ref            | 1 -
 .../share/TrigSteeringEventAthenaPool_18.0.0.ref            | 1 -
 .../share/TrigSteeringEventAthenaPool_20.1.7.2.ref          | 1 -
 .../TrigT1EventAthenaPool/share/TrigT1EventTPCnv_18.0.0.ref | 1 -
 .../share/TrigTruthEventTPCnv_15.8.0.ref                    | 1 -
 .../share/TrigTruthEventTPCnv_18.0.0.ref                    | 1 -
 108 files changed, 119 deletions(-)
 mode change 100755 => 100644 AtlasTest/DatabaseTest/AthenaPoolTest/share/AthenaPoolTestReadAfterCopy.ref
 mode change 100755 => 100644 AtlasTest/DatabaseTest/AthenaPoolTest/share/AthenaPoolTestWrite2.ref
 mode change 100755 => 100644 AtlasTest/DatabaseTest/AthenaPoolTest/share/AtlfastPoolWriteOptions.ref
 mode change 100755 => 100644 AtlasTest/DatabaseTest/AthenaPoolTest/share/CaloCluster2StepReader.ref
 mode change 100755 => 100644 AtlasTest/DatabaseTest/AthenaPoolTest/share/CaloClusterStep1Writer.ref
 mode change 100755 => 100644 AtlasTest/DatabaseTest/AthenaPoolTest/share/LArCellContWriteStep1.ref
 mode change 100755 => 100644 AtlasTest/DatabaseTest/AthenaPoolTest/share/LArCellContWriteStep2.ref

diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/share/AthenaPoolTestReadAfterCopy.ref b/AtlasTest/DatabaseTest/AthenaPoolTest/share/AthenaPoolTestReadAfterCopy.ref
old mode 100755
new mode 100644
index 492db2e094e8..f4b46418e3a7
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/share/AthenaPoolTestReadAfterCopy.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/share/AthenaPoolTestReadAfterCopy.ref
@@ -99,7 +99,6 @@ DetDescrCnvSvc       INFO  filling address for MuonMgr with CLID 4060 and storag
 DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/share/AthenaPoolTestWrite2.ref b/AtlasTest/DatabaseTest/AthenaPoolTest/share/AthenaPoolTestWrite2.ref
old mode 100755
new mode 100644
index 37e5d42d4d8a..8bab6f0153b0
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/share/AthenaPoolTestWrite2.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/share/AthenaPoolTestWrite2.ref
@@ -55,7 +55,6 @@ DetDescrCnvSvc       INFO  filling address for MuonMgr with CLID 4060 and storag
 DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/share/AtlfastPoolWriteOptions.ref b/AtlasTest/DatabaseTest/AthenaPoolTest/share/AtlfastPoolWriteOptions.ref
old mode 100755
new mode 100644
index e9e0951cb611..cdf8e6d34a37
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/share/AtlfastPoolWriteOptions.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/share/AtlfastPoolWriteOptions.ref
@@ -957,7 +957,6 @@ DetDescrCnvSvc       INFO  filling address for MuonMgr with CLID 4060 and storag
 DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for SCT_ID with CLID 2517 and storage type 68 to detector store 
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/share/CaloCluster2StepReader.ref b/AtlasTest/DatabaseTest/AthenaPoolTest/share/CaloCluster2StepReader.ref
old mode 100755
new mode 100644
index 881fb5d908c0..17a15f596c67
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/share/CaloCluster2StepReader.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/share/CaloCluster2StepReader.ref
@@ -249,7 +249,6 @@ DetDescrCnvSvc       INFO  filling address for MuonMgr with CLID 4060 and storag
 DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/share/CaloClusterStep1Writer.ref b/AtlasTest/DatabaseTest/AthenaPoolTest/share/CaloClusterStep1Writer.ref
old mode 100755
new mode 100644
index 2470569f7dad..ed4d4ba42380
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/share/CaloClusterStep1Writer.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/share/CaloClusterStep1Writer.ref
@@ -250,7 +250,6 @@ DetDescrCnvSvc       INFO  filling address for MuonMgr with CLID 4060 and storag
 DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/share/LArCellContWriteStep1.ref b/AtlasTest/DatabaseTest/AthenaPoolTest/share/LArCellContWriteStep1.ref
old mode 100755
new mode 100644
index f48f60465e1d..da827f7ce074
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/share/LArCellContWriteStep1.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/share/LArCellContWriteStep1.ref
@@ -250,7 +250,6 @@ DetDescrCnvSvc       INFO  filling address for MuonMgr with CLID 4060 and storag
 DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/share/LArCellContWriteStep2.ref b/AtlasTest/DatabaseTest/AthenaPoolTest/share/LArCellContWriteStep2.ref
old mode 100755
new mode 100644
index 5efaeb0e33ec..65e1a1ad9092
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/share/LArCellContWriteStep2.ref
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/share/LArCellContWriteStep2.ref
@@ -250,7 +250,6 @@ DetDescrCnvSvc       INFO  filling address for MuonMgr with CLID 4060 and storag
 DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/AtlasTest/DatabaseTest/IOVDbTestAlg/share/IOVDbTestAlgReadCoolAndReg.ref b/AtlasTest/DatabaseTest/IOVDbTestAlg/share/IOVDbTestAlgReadCoolAndReg.ref
index 0d091e0e43e9..f2bbea52c64a 100644
--- a/AtlasTest/DatabaseTest/IOVDbTestAlg/share/IOVDbTestAlgReadCoolAndReg.ref
+++ b/AtlasTest/DatabaseTest/IOVDbTestAlg/share/IOVDbTestAlgReadCoolAndReg.ref
@@ -93,7 +93,6 @@ DetDescrCnvSvc                   INFO  filling address for MuonMgr with CLID 406
 DetDescrCnvSvc                   INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
 DetDescrCnvSvc                   INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                   INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                   INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                   INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                   INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                   INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/AtlasTest/DatabaseTest/IOVDbTestAlg/share/IOVDbTestAlgReadCoolNoReg.ref b/AtlasTest/DatabaseTest/IOVDbTestAlg/share/IOVDbTestAlgReadCoolNoReg.ref
index 2ae91f3a6273..fd35e7d81dcd 100644
--- a/AtlasTest/DatabaseTest/IOVDbTestAlg/share/IOVDbTestAlgReadCoolNoReg.ref
+++ b/AtlasTest/DatabaseTest/IOVDbTestAlg/share/IOVDbTestAlgReadCoolNoReg.ref
@@ -96,7 +96,6 @@ DetDescrCnvSvc                   INFO  filling address for MuonMgr with CLID 406
 DetDescrCnvSvc                   INFO  filling address for CaloTTMgr with CLID 117659265 and storage type 68 to detector store 
 DetDescrCnvSvc                   INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                   INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                   INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                   INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                   INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                   INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_14.5.0.ref b/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_14.5.0.ref
index 848d41359b77..6fd2a2749281 100644
--- a/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_14.5.0.ref
+++ b/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_14.5.0.ref
@@ -15,7 +15,6 @@ DetDescrCnvSvc                                       INFO  filling address for C
 DetDescrCnvSvc                                       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_15.1.0.ref b/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_15.1.0.ref
index b2cf326ea23e..52125e5f2c9d 100644
--- a/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_15.1.0.ref
+++ b/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_15.1.0.ref
@@ -102,7 +102,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_15.5.0.ref b/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_15.5.0.ref
index a6b130e4a266..531e1ef4d373 100644
--- a/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_15.5.0.ref
+++ b/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_15.5.0.ref
@@ -108,7 +108,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_18.0.0.ref b/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_18.0.0.ref
index aeff63d97746..803751c98b0b 100644
--- a/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_18.0.0.ref
+++ b/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_18.0.0.ref
@@ -99,7 +99,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_20.1.7.2.ref b/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_20.1.7.2.ref
index 70c3365e1f00..13e26000bf9a 100644
--- a/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_20.1.7.2.ref
+++ b/Calorimeter/CaloCnv/CaloAthenaPool/share/CaloTPCnv_20.1.7.2.ref
@@ -99,7 +99,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloDetDescr/share/CaloSuperCellIDTool_test.ref b/Calorimeter/CaloDetDescr/share/CaloSuperCellIDTool_test.ref
index 19d3efa47fbe..68776e9bb708 100644
--- a/Calorimeter/CaloDetDescr/share/CaloSuperCellIDTool_test.ref
+++ b/Calorimeter/CaloDetDescr/share/CaloSuperCellIDTool_test.ref
@@ -168,7 +168,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloRec/share/CaloCellContainerAliasAlg_test.ref b/Calorimeter/CaloRec/share/CaloCellContainerAliasAlg_test.ref
index 68602482510f..3619b408dda3 100644
--- a/Calorimeter/CaloRec/share/CaloCellContainerAliasAlg_test.ref
+++ b/Calorimeter/CaloRec/share/CaloCellContainerAliasAlg_test.ref
@@ -53,7 +53,6 @@ DetDescrCnvSvc                                       INFO  filling address for C
 DetDescrCnvSvc                                       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloRec/share/CaloThinCellsByClusterAlg_test.ref b/Calorimeter/CaloRec/share/CaloThinCellsByClusterAlg_test.ref
index c95376f64083..62bace3c07b5 100644
--- a/Calorimeter/CaloRec/share/CaloThinCellsByClusterAlg_test.ref
+++ b/Calorimeter/CaloRec/share/CaloThinCellsByClusterAlg_test.ref
@@ -53,7 +53,6 @@ DetDescrCnvSvc                                       INFO  filling address for C
 DetDescrCnvSvc                                       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloRec/share/CaloThinCellsBySamplingAlg_test.ref b/Calorimeter/CaloRec/share/CaloThinCellsBySamplingAlg_test.ref
index f1ed18071064..a0cbbf85e3b4 100644
--- a/Calorimeter/CaloRec/share/CaloThinCellsBySamplingAlg_test.ref
+++ b/Calorimeter/CaloRec/share/CaloThinCellsBySamplingAlg_test.ref
@@ -53,7 +53,6 @@ DetDescrCnvSvc                                       INFO  filling address for C
 DetDescrCnvSvc                                       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloTools/share/CaloEstimatedGainTool_test.ref b/Calorimeter/CaloTools/share/CaloEstimatedGainTool_test.ref
index ff4efe58efd5..1a1f42bbaec5 100644
--- a/Calorimeter/CaloTools/share/CaloEstimatedGainTool_test.ref
+++ b/Calorimeter/CaloTools/share/CaloEstimatedGainTool_test.ref
@@ -74,7 +74,6 @@ DetDescrCnvSvc                                       INFO  filling address for C
 DetDescrCnvSvc                                       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
index c5739e45e074..324df2d878a8 100644
--- a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
+++ b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
@@ -75,7 +75,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/EventBookkeeperAthenaPool/share/EventBookkeeperTPCnv_16.0.0.ref b/Event/EventBookkeeperAthenaPool/share/EventBookkeeperTPCnv_16.0.0.ref
index ad30e4713d5c..78aa2615dd22 100644
--- a/Event/EventBookkeeperAthenaPool/share/EventBookkeeperTPCnv_16.0.0.ref
+++ b/Event/EventBookkeeperAthenaPool/share/EventBookkeeperTPCnv_16.0.0.ref
@@ -117,7 +117,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/EventBookkeeperAthenaPool/share/EventBookkeeperTPCnv_18.0.0.ref b/Event/EventBookkeeperAthenaPool/share/EventBookkeeperTPCnv_18.0.0.ref
index 384fb0f732ca..655b1caf41f5 100644
--- a/Event/EventBookkeeperAthenaPool/share/EventBookkeeperTPCnv_18.0.0.ref
+++ b/Event/EventBookkeeperAthenaPool/share/EventBookkeeperTPCnv_18.0.0.ref
@@ -111,7 +111,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODBTaggingAthenaPool/share/xAODBTaggingAthenaPool_21.0.79.ref b/Event/xAOD/xAODBTaggingAthenaPool/share/xAODBTaggingAthenaPool_21.0.79.ref
index e3450b73fb7a..5a775259b21b 100644
--- a/Event/xAOD/xAODBTaggingAthenaPool/share/xAODBTaggingAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODBTaggingAthenaPool/share/xAODBTaggingAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODCaloEventAthenaPool/share/xAODCaloEventAthenaPool_20.1.7.2.ref b/Event/xAOD/xAODCaloEventAthenaPool/share/xAODCaloEventAthenaPool_20.1.7.2.ref
index dcba4c580abd..1a36f0ef70a5 100644
--- a/Event/xAOD/xAODCaloEventAthenaPool/share/xAODCaloEventAthenaPool_20.1.7.2.ref
+++ b/Event/xAOD/xAODCaloEventAthenaPool/share/xAODCaloEventAthenaPool_20.1.7.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODCaloEventAthenaPool/share/xAODCaloEventAthenaPool_21.0.79.ref b/Event/xAOD/xAODCaloEventAthenaPool/share/xAODCaloEventAthenaPool_21.0.79.ref
index d888b6de93e4..5d47b2b79d37 100644
--- a/Event/xAOD/xAODCaloEventAthenaPool/share/xAODCaloEventAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODCaloEventAthenaPool/share/xAODCaloEventAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODCaloRingsAthenaPool/share/xAODCaloRingsAthenaPool_21.0.79.ref b/Event/xAOD/xAODCaloRingsAthenaPool/share/xAODCaloRingsAthenaPool_21.0.79.ref
index 7fb18eca6050..6b9f39383350 100644
--- a/Event/xAOD/xAODCaloRingsAthenaPool/share/xAODCaloRingsAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODCaloRingsAthenaPool/share/xAODCaloRingsAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODEgammaAthenaPool/share/xAODEgammaAthenaPool_20.1.7.2.ref b/Event/xAOD/xAODEgammaAthenaPool/share/xAODEgammaAthenaPool_20.1.7.2.ref
index a831c579aab1..f05b1a988019 100644
--- a/Event/xAOD/xAODEgammaAthenaPool/share/xAODEgammaAthenaPool_20.1.7.2.ref
+++ b/Event/xAOD/xAODEgammaAthenaPool/share/xAODEgammaAthenaPool_20.1.7.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODEgammaAthenaPool/share/xAODEgammaAthenaPool_21.0.79.ref b/Event/xAOD/xAODEgammaAthenaPool/share/xAODEgammaAthenaPool_21.0.79.ref
index f06f43e49efb..098534101505 100644
--- a/Event/xAOD/xAODEgammaAthenaPool/share/xAODEgammaAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODEgammaAthenaPool/share/xAODEgammaAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODEventInfoAthenaPool/share/xAODEventInfoAthenaPool_20.0.0.3.ref b/Event/xAOD/xAODEventInfoAthenaPool/share/xAODEventInfoAthenaPool_20.0.0.3.ref
index 697ff3d25a2b..cfdfabc7b536 100644
--- a/Event/xAOD/xAODEventInfoAthenaPool/share/xAODEventInfoAthenaPool_20.0.0.3.ref
+++ b/Event/xAOD/xAODEventInfoAthenaPool/share/xAODEventInfoAthenaPool_20.0.0.3.ref
@@ -107,7 +107,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODEventShapeAthenaPool/share/xAODEventShapeAthenaPool_21.0.79.ref b/Event/xAOD/xAODEventShapeAthenaPool/share/xAODEventShapeAthenaPool_21.0.79.ref
index ed11e6d93583..d6192b4cad2e 100644
--- a/Event/xAOD/xAODEventShapeAthenaPool/share/xAODEventShapeAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODEventShapeAthenaPool/share/xAODEventShapeAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODJetAthenaPool/share/xAODJetAthenaPool_20.7.2.2.ref b/Event/xAOD/xAODJetAthenaPool/share/xAODJetAthenaPool_20.7.2.2.ref
index 1e41c307bfbf..f31fb18fc5f3 100644
--- a/Event/xAOD/xAODJetAthenaPool/share/xAODJetAthenaPool_20.7.2.2.ref
+++ b/Event/xAOD/xAODJetAthenaPool/share/xAODJetAthenaPool_20.7.2.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODJetAthenaPool/share/xAODJetAthenaPool_21.0.79.ref b/Event/xAOD/xAODJetAthenaPool/share/xAODJetAthenaPool_21.0.79.ref
index 9a7df5f2f65b..0b73b227ac6a 100644
--- a/Event/xAOD/xAODJetAthenaPool/share/xAODJetAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODJetAthenaPool/share/xAODJetAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODMissingETAthenaPool/share/xAODMissingETAthenaPool_20.1.7.2.ref b/Event/xAOD/xAODMissingETAthenaPool/share/xAODMissingETAthenaPool_20.1.7.2.ref
index 0282448ffa2e..b322c01ebb47 100644
--- a/Event/xAOD/xAODMissingETAthenaPool/share/xAODMissingETAthenaPool_20.1.7.2.ref
+++ b/Event/xAOD/xAODMissingETAthenaPool/share/xAODMissingETAthenaPool_20.1.7.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODMissingETAthenaPool/share/xAODMissingETAthenaPool_21.0.79.ref b/Event/xAOD/xAODMissingETAthenaPool/share/xAODMissingETAthenaPool_21.0.79.ref
index 7d99122aaffd..e12501e62156 100644
--- a/Event/xAOD/xAODMissingETAthenaPool/share/xAODMissingETAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODMissingETAthenaPool/share/xAODMissingETAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.1.7.2.ref b/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.1.7.2.ref
index 6c02d986a83c..60d24f9e7166 100644
--- a/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.1.7.2.ref
+++ b/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.1.7.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.7.2.2.ref b/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.7.2.2.ref
index 1d471b47081d..90af842e468e 100644
--- a/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.7.2.2.ref
+++ b/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.7.2.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.7.9.9.ref b/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.7.9.9.ref
index 2fe2c878eb65..28cba274fbdc 100644
--- a/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.7.9.9.ref
+++ b/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_20.7.9.9.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_21.0.79.ref b/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_21.0.79.ref
index 8680a7c89ea2..cfb33076dd0d 100644
--- a/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_master-20190911.ref b/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_master-20190911.ref
index a8d8befc087d..bc159f0584cb 100644
--- a/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_master-20190911.ref
+++ b/Event/xAOD/xAODMuonAthenaPool/share/xAODMuonAthenaPool_master-20190911.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODPFlowAthenaPool/share/xAODPFlowAthenaPool_21.0.79.ref b/Event/xAOD/xAODPFlowAthenaPool/share/xAODPFlowAthenaPool_21.0.79.ref
index 518c4e8dbb0d..8fefcbe3bdd7 100644
--- a/Event/xAOD/xAODPFlowAthenaPool/share/xAODPFlowAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODPFlowAthenaPool/share/xAODPFlowAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODParticleEventAthenaPool/share/xAODParticleAthenaPool_21.0.79.ref b/Event/xAOD/xAODParticleEventAthenaPool/share/xAODParticleAthenaPool_21.0.79.ref
index 62f20dcef172..9c620017b800 100644
--- a/Event/xAOD/xAODParticleEventAthenaPool/share/xAODParticleAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODParticleEventAthenaPool/share/xAODParticleAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_20.1.7.2.ref b/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_20.1.7.2.ref
index da1624139a85..0a7ef658f98b 100644
--- a/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_20.1.7.2.ref
+++ b/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_20.1.7.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_20.7.2.2.ref b/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_20.7.2.2.ref
index 597fc312daab..35d992b74e10 100644
--- a/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_20.7.2.2.ref
+++ b/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_20.7.2.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_21.0.79.ref b/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_21.0.79.ref
index 5ebc7ba4e08f..d36d4266825b 100644
--- a/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODTauAthenaPool/share/xAODTauAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_20.1.7.2.ref b/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_20.1.7.2.ref
index d88dd86280b8..30aad8b4d57d 100644
--- a/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_20.1.7.2.ref
+++ b/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_20.1.7.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_20.7.2.2.ref b/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_20.7.2.2.ref
index 0d20b85e1d1f..b8257d93bc6f 100644
--- a/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_20.7.2.2.ref
+++ b/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_20.7.2.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_21.0.79.ref b/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_21.0.79.ref
index b36f62aa6082..9e816ff53c0a 100644
--- a/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_master-20190911.ref b/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_master-20190911.ref
index 0b57015c875d..6806833ca683 100644
--- a/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_master-20190911.ref
+++ b/Event/xAOD/xAODTrackingAthenaPool/share/xAODTrackingAthenaPool_master-20190911.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrigCaloAthenaPool/share/xAODTrigCaloAthenaPool_20.0.0.3.ref b/Event/xAOD/xAODTrigCaloAthenaPool/share/xAODTrigCaloAthenaPool_20.0.0.3.ref
index 952f76563234..9702b6fedb2e 100644
--- a/Event/xAOD/xAODTrigCaloAthenaPool/share/xAODTrigCaloAthenaPool_20.0.0.3.ref
+++ b/Event/xAOD/xAODTrigCaloAthenaPool/share/xAODTrigCaloAthenaPool_20.0.0.3.ref
@@ -93,7 +93,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrigCaloAthenaPool/share/xAODTrigCaloAthenaPool_21.0.79.ref b/Event/xAOD/xAODTrigCaloAthenaPool/share/xAODTrigCaloAthenaPool_21.0.79.ref
index d59d264c9e86..d9b67c9f35d3 100644
--- a/Event/xAOD/xAODTrigCaloAthenaPool/share/xAODTrigCaloAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODTrigCaloAthenaPool/share/xAODTrigCaloAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrigEgammaAthenaPool/share/xAODTrigEgammaAthenaPool_21.0.79.ref b/Event/xAOD/xAODTrigEgammaAthenaPool/share/xAODTrigEgammaAthenaPool_21.0.79.ref
index 288be560f43c..9eea440d395c 100644
--- a/Event/xAOD/xAODTrigEgammaAthenaPool/share/xAODTrigEgammaAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODTrigEgammaAthenaPool/share/xAODTrigEgammaAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrigMissingETAthenaPool/share/xAODTrigMissingETAthenaPool_21.0.79.ref b/Event/xAOD/xAODTrigMissingETAthenaPool/share/xAODTrigMissingETAthenaPool_21.0.79.ref
index 481734e63229..0cf7c913e852 100644
--- a/Event/xAOD/xAODTrigMissingETAthenaPool/share/xAODTrigMissingETAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODTrigMissingETAthenaPool/share/xAODTrigMissingETAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrigMuonAthenaPool/share/xAODTrigMuonAthenaPool_20.1.7.2.ref b/Event/xAOD/xAODTrigMuonAthenaPool/share/xAODTrigMuonAthenaPool_20.1.7.2.ref
index 3bf5388ce408..695d902c781c 100644
--- a/Event/xAOD/xAODTrigMuonAthenaPool/share/xAODTrigMuonAthenaPool_20.1.7.2.ref
+++ b/Event/xAOD/xAODTrigMuonAthenaPool/share/xAODTrigMuonAthenaPool_20.1.7.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrigMuonAthenaPool/share/xAODTrigMuonAthenaPool_21.0.79.ref b/Event/xAOD/xAODTrigMuonAthenaPool/share/xAODTrigMuonAthenaPool_21.0.79.ref
index 86a6c2fd82bd..99d90d184530 100644
--- a/Event/xAOD/xAODTrigMuonAthenaPool/share/xAODTrigMuonAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODTrigMuonAthenaPool/share/xAODTrigMuonAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTrigRingerAthenaPool/share/xAODTrigRingerAthenaPool_21.0.79.ref b/Event/xAOD/xAODTrigRingerAthenaPool/share/xAODTrigRingerAthenaPool_21.0.79.ref
index 455eeafaf5d5..0f6a294ed8b6 100644
--- a/Event/xAOD/xAODTrigRingerAthenaPool/share/xAODTrigRingerAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODTrigRingerAthenaPool/share/xAODTrigRingerAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTriggerAthenaPool/share/xAODTriggerAthenaPool_20.1.7.2.ref b/Event/xAOD/xAODTriggerAthenaPool/share/xAODTriggerAthenaPool_20.1.7.2.ref
index 7a632d05e457..be457156322e 100644
--- a/Event/xAOD/xAODTriggerAthenaPool/share/xAODTriggerAthenaPool_20.1.7.2.ref
+++ b/Event/xAOD/xAODTriggerAthenaPool/share/xAODTriggerAthenaPool_20.1.7.2.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTriggerAthenaPool/share/xAODTriggerAthenaPool_master-20190911.ref b/Event/xAOD/xAODTriggerAthenaPool/share/xAODTriggerAthenaPool_master-20190911.ref
index 1e975ce8dd10..9ac8547af248 100644
--- a/Event/xAOD/xAODTriggerAthenaPool/share/xAODTriggerAthenaPool_master-20190911.ref
+++ b/Event/xAOD/xAODTriggerAthenaPool/share/xAODTriggerAthenaPool_master-20190911.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Event/xAOD/xAODTruthAthenaPool/share/xAODTruthAthenaPool_21.0.79.ref b/Event/xAOD/xAODTruthAthenaPool/share/xAODTruthAthenaPool_21.0.79.ref
index 177e04bef08e..1fd31db2e65a 100644
--- a/Event/xAOD/xAODTruthAthenaPool/share/xAODTruthAthenaPool_21.0.79.ref
+++ b/Event/xAOD/xAODTruthAthenaPool/share/xAODTruthAthenaPool_21.0.79.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/share/ZdcEventTPCnv_15.6.7.ref b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/share/ZdcEventTPCnv_15.6.7.ref
index 361df39f49cf..f35c29a2cedd 100644
--- a/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/share/ZdcEventTPCnv_15.6.7.ref
+++ b/ForwardDetectors/ZDC/ZdcCnv/ZdcEventAthenaPool/share/ZdcEventTPCnv_15.6.7.ref
@@ -125,7 +125,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/InnerDetector/InDetEventCnv/InDetBCM_EventAthenaPool/share/InDetBCM_EventAthenaPool_20.1.7.2.ref b/InnerDetector/InDetEventCnv/InDetBCM_EventAthenaPool/share/InDetBCM_EventAthenaPool_20.1.7.2.ref
index 38bac12a14bd..309bebfddcae 100644
--- a/InnerDetector/InDetEventCnv/InDetBCM_EventAthenaPool/share/InDetBCM_EventAthenaPool_20.1.7.2.ref
+++ b/InnerDetector/InDetEventCnv/InDetBCM_EventAthenaPool/share/InDetBCM_EventAthenaPool_20.1.7.2.ref
@@ -112,7 +112,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/share/InDetSimEventTPCnv_HITS.ref b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/share/InDetSimEventTPCnv_HITS.ref
index c68ed5a643af..4b1651bf901d 100644
--- a/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/share/InDetSimEventTPCnv_HITS.ref
+++ b/InnerDetector/InDetEventCnv/InDetSimEventAthenaPool/share/InDetSimEventTPCnv_HITS.ref
@@ -95,7 +95,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.ref b/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.ref
index 8b17a777d88b..7f35fcb18225 100644
--- a/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.ref
+++ b/LArCalorimeter/LArCellRec/share/LArBadFebMaskingTool_test.ref
@@ -106,7 +106,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref b/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
index dbe32ae69856..20d762754505 100644
--- a/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
+++ b/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
@@ -102,7 +102,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
@@ -306,11 +305,6 @@ ClassIDSvc           INFO  getRegistryEntries: read 1413 CLIDRegistry entries fo
 ToolSvc.tool1        INFO Initializing LArCellDeadOTXCorr
 ToolSvc.tool1        INFO L1Calo database won't be used. Pedestal values will be constant and equal to 32.
 ToolSvc.CaloTri...   INFO  => CaloTriggerTowerService::initialize() 
-LArIdMgrDetDesc...   INFO in createObj: creating a LArDescrManager object in the detector store
-LArIdMgrDetDesc...   INFO Set LArOnlineID helper in LArIdMgr 
-LArIdMgrDetDesc...   INFO Set LArHVLineID helper in LArIdMgr 
-LArIdMgrDetDesc...   INFO Set LArElectrodeID helper in LArIdMgr 
-LArIdMgrDetDesc...   INFO Set CaloCell_ID helper in LArIdMgr 
 ToolSvc.CaloTri...   INFO  ====> ...CaloTriggerTowerService::init() OK 
 ClassIDSvc           INFO  getRegistryEntries: read 60 CLIDRegistry entries for module ALL
 ToolSvc.tool2        INFO Initializing LArCellDeadOTXCorr
diff --git a/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_15.6.7.ref b/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_15.6.7.ref
index 942d315df661..2eab0595c271 100644
--- a/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_15.6.7.ref
+++ b/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_15.6.7.ref
@@ -125,7 +125,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_20.1.7.2.ref b/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_20.1.7.2.ref
index 4969fdf1d374..66b2751cdacf 100644
--- a/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_20.1.7.2.ref
+++ b/LArCalorimeter/LArCnv/LArAthenaPool/share/LArTPCnv_20.1.7.2.ref
@@ -112,7 +112,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/LArCalorimeter/LArCnv/LArSimEventAthenaPool/share/LArSimEventTPCnv_HITS.ref b/LArCalorimeter/LArCnv/LArSimEventAthenaPool/share/LArSimEventTPCnv_HITS.ref
index f9fcdcba1356..28e5ef841800 100644
--- a/LArCalorimeter/LArCnv/LArSimEventAthenaPool/share/LArSimEventTPCnv_HITS.ref
+++ b/LArCalorimeter/LArCnv/LArSimEventAthenaPool/share/LArSimEventTPCnv_HITS.ref
@@ -95,7 +95,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
index 495395ac081e..19062382ec95 100644
--- a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
+++ b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
@@ -75,7 +75,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref
index bc104728d3de..6a42730e8134 100644
--- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref
+++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref
@@ -90,7 +90,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref
index b1069cdf35e0..cca5bbb998e3 100644
--- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref
+++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref
@@ -116,7 +116,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref
index 3e078fa3aa91..10582ca7bbcc 100644
--- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref
+++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref
@@ -91,7 +91,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventTPCnv_17.0.0.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventTPCnv_17.0.0.ref
index f4d80c81ec09..590d2f3e2f76 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventTPCnv_17.0.0.ref
+++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventTPCnv_17.0.0.ref
@@ -102,7 +102,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventTPCnv_20.1.7.2.ref b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventTPCnv_20.1.7.2.ref
index e66d470df45f..a01cb62ffb0a 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventTPCnv_20.1.7.2.ref
+++ b/MuonSpectrometer/MuonCnv/MuonEventAthenaPool/share/MuonEventTPCnv_20.1.7.2.ref
@@ -102,7 +102,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/share/MuonSimEventTPCnv_HITS.ref b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/share/MuonSimEventTPCnv_HITS.ref
index 7580f6393ace..99d288a2d9df 100644
--- a/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/share/MuonSimEventTPCnv_HITS.ref
+++ b/MuonSpectrometer/MuonCnv/MuonSimEventAthenaPool/share/MuonSimEventTPCnv_HITS.ref
@@ -95,7 +95,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_15.9.0.5.ref b/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_15.9.0.5.ref
index 7dd0944580fe..4c0dc6113eb5 100644
--- a/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_15.9.0.5.ref
+++ b/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_15.9.0.5.ref
@@ -166,7 +166,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_17.0.0.ref b/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_17.0.0.ref
index 622831e8b7ce..def92c8f8265 100644
--- a/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_17.0.0.ref
+++ b/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_17.0.0.ref
@@ -163,7 +163,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_17.2.8.ref b/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_17.2.8.ref
index 421399de16d8..59416008a0db 100644
--- a/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_17.2.8.ref
+++ b/Reconstruction/Jet/JetEventAthenaPool/share/JetTPCnv_17.2.8.ref
@@ -161,7 +161,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Reconstruction/eflowAthenaPool/share/eflowEventTPCnv_17.5.0.ref b/Reconstruction/eflowAthenaPool/share/eflowEventTPCnv_17.5.0.ref
index b56c1f2b9c02..f2d7ef558dc0 100644
--- a/Reconstruction/eflowAthenaPool/share/eflowEventTPCnv_17.5.0.ref
+++ b/Reconstruction/eflowAthenaPool/share/eflowEventTPCnv_17.5.0.ref
@@ -112,7 +112,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Reconstruction/eflowAthenaPool/share/eflowEventTPCnv_18.0.0.ref b/Reconstruction/eflowAthenaPool/share/eflowEventTPCnv_18.0.0.ref
index 7830915e8581..7ae41522794c 100644
--- a/Reconstruction/eflowAthenaPool/share/eflowEventTPCnv_18.0.0.ref
+++ b/Reconstruction/eflowAthenaPool/share/eflowEventTPCnv_18.0.0.ref
@@ -111,7 +111,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Simulation/FastShower/FastCaloSim/share/AddNoiseCellBuilderTool_test.ref b/Simulation/FastShower/FastCaloSim/share/AddNoiseCellBuilderTool_test.ref
index cd7e7603b3c9..8e001e4179b4 100644
--- a/Simulation/FastShower/FastCaloSim/share/AddNoiseCellBuilderTool_test.ref
+++ b/Simulation/FastShower/FastCaloSim/share/AddNoiseCellBuilderTool_test.ref
@@ -82,7 +82,6 @@ DetDescrCnvSvc                                       INFO  filling address for C
 DetDescrCnvSvc                                       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Simulation/FastShower/FastCaloSim/share/FastShowerCellBuilderTool_test.ref b/Simulation/FastShower/FastCaloSim/share/FastShowerCellBuilderTool_test.ref
index 330f827e326c..34af33041ae3 100644
--- a/Simulation/FastShower/FastCaloSim/share/FastShowerCellBuilderTool_test.ref
+++ b/Simulation/FastShower/FastCaloSim/share/FastShowerCellBuilderTool_test.ref
@@ -161,7 +161,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileConditions/share/TileDCSComponents_test.ref b/TileCalorimeter/TileConditions/share/TileDCSComponents_test.ref
index 7da753cc374b..51f9cbf6a079 100644
--- a/TileCalorimeter/TileConditions/share/TileDCSComponents_test.ref
+++ b/TileCalorimeter/TileConditions/share/TileDCSComponents_test.ref
@@ -50,7 +50,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileConditions/share/TileEMScaleComponents_test.ref b/TileCalorimeter/TileConditions/share/TileEMScaleComponents_test.ref
index 1cd39ddbc62b..64a632ecfc15 100644
--- a/TileCalorimeter/TileConditions/share/TileEMScaleComponents_test.ref
+++ b/TileCalorimeter/TileConditions/share/TileEMScaleComponents_test.ref
@@ -62,7 +62,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref b/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref
index a2b41d707d74..a5ad105a8e95 100644
--- a/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref
@@ -88,7 +88,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref
index 9accbe378ff3..4cdbe4bdbbac 100644
--- a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref
@@ -88,7 +88,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref b/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref
index 05579ed785f8..78f684fc3a12 100644
--- a/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref
@@ -88,7 +88,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref b/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref
index 338ec1dded62..5c35995271cd 100644
--- a/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref
@@ -88,7 +88,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref b/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref
index e30c1ccfacc9..958c78f4c8dd 100644
--- a/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref
@@ -88,7 +88,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref
index 24bf6d05e253..7f3400f98d79 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref
@@ -94,7 +94,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
@@ -756,7 +755,6 @@ DetDescrCnvSvc                                                    INFO  filling
 DetDescrCnvSvc                                                    INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                                    INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref
index ff3f4d4abe8f..f90a19acaf88 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref
@@ -94,7 +94,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
@@ -758,7 +757,6 @@ DetDescrCnvSvc                                                    INFO  filling
 DetDescrCnvSvc                                                    INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                                    INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref
index 27786a1292f8..69e33589492d 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref
@@ -94,7 +94,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
@@ -757,7 +756,6 @@ DetDescrCnvSvc                                                    INFO  filling
 DetDescrCnvSvc                                                    INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                                    INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref
index 13cf2135a984..3e11d019d361 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref
@@ -93,7 +93,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
@@ -754,7 +753,6 @@ DetDescrCnvSvc                                                    INFO  filling
 DetDescrCnvSvc                                                    INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                                    INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref
index ef97d9259483..801324481b41 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref
@@ -94,7 +94,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
@@ -758,7 +757,6 @@ DetDescrCnvSvc                                                    INFO  filling
 DetDescrCnvSvc                                                    INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                                    INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref
index 53741f3fd622..a4584d006c83 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref
@@ -94,7 +94,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
@@ -758,7 +757,6 @@ DetDescrCnvSvc                                                    INFO  filling
 DetDescrCnvSvc                                                    INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc                                                    INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc                                                    INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_15.6.4.ref b/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_15.6.4.ref
index aa1144903c9f..88c5a4489af9 100644
--- a/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_15.6.4.ref
+++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_15.6.4.ref
@@ -103,7 +103,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_20.1.7.2.ref b/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_20.1.7.2.ref
index 089241cd200a..bf21a752f7c8 100644
--- a/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_20.1.7.2.ref
+++ b/TileCalorimeter/TileSvc/TileEventAthenaPool/share/TileTPCnv_20.1.7.2.ref
@@ -99,7 +99,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/TileCalorimeter/TileSvc/TileSimEventAthenaPool/share/TileSimEventTPCnv_HITS.ref b/TileCalorimeter/TileSvc/TileSimEventAthenaPool/share/TileSimEventTPCnv_HITS.ref
index 34a31abd242d..93cc9f56f03f 100644
--- a/TileCalorimeter/TileSvc/TileSimEventAthenaPool/share/TileSimEventTPCnv_HITS.ref
+++ b/TileCalorimeter/TileSvc/TileSimEventAthenaPool/share/TileSimEventTPCnv_HITS.ref
@@ -95,7 +95,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/share/TrkVKalVrtFitter_test.ref b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/share/TrkVKalVrtFitter_test.ref
index c252c9aa0497..65169fad9383 100644
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/share/TrkVKalVrtFitter_test.ref
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/share/TrkVKalVrtFitter_test.ref
@@ -158,7 +158,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_15.6.1.ref b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_15.6.1.ref
index cf2b0f5a7025..da8e2e088aff 100644
--- a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_15.6.1.ref
+++ b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_15.6.1.ref
@@ -126,7 +126,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_15.6.13.2.ref b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_15.6.13.2.ref
index 848cb3a86034..1ae912e96842 100644
--- a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_15.6.13.2.ref
+++ b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_15.6.13.2.ref
@@ -121,7 +121,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_16.0.3.3.ref b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_16.0.3.3.ref
index 1a62f1c948ca..365306aa8a9b 100644
--- a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_16.0.3.3.ref
+++ b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_16.0.3.3.ref
@@ -109,7 +109,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_17.0.6.ref b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_17.0.6.ref
index 2a4683acb247..514884b19d68 100644
--- a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_17.0.6.ref
+++ b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_17.0.6.ref
@@ -118,7 +118,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_20.1.7.2.ref b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_20.1.7.2.ref
index 680c7f7f5ea1..e7d158f9ccd6 100644
--- a/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_20.1.7.2.ref
+++ b/Trigger/TrigEvent/TrigEventAthenaPool/share/TrigEventAthenaPool_20.1.7.2.ref
@@ -116,7 +116,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_15.6.1.ref b/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_15.6.1.ref
index c85d8858997c..8baf1d2fa24b 100644
--- a/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_15.6.1.ref
+++ b/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_15.6.1.ref
@@ -128,7 +128,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_18.0.0.ref b/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_18.0.0.ref
index d9c2bcb54ab6..f985a178f01a 100644
--- a/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_18.0.0.ref
+++ b/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_18.0.0.ref
@@ -115,7 +115,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_20.1.7.2.ref b/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_20.1.7.2.ref
index 7d9dd67c5007..1494948fa0ff 100644
--- a/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_20.1.7.2.ref
+++ b/Trigger/TrigEvent/TrigSteeringEventAthenaPool/share/TrigSteeringEventAthenaPool_20.1.7.2.ref
@@ -116,7 +116,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigT1/TrigT1EventAthenaPool/share/TrigT1EventTPCnv_18.0.0.ref b/Trigger/TrigT1/TrigT1EventAthenaPool/share/TrigT1EventTPCnv_18.0.0.ref
index e26701fa08e1..02acdc6b9043 100644
--- a/Trigger/TrigT1/TrigT1EventAthenaPool/share/TrigT1EventTPCnv_18.0.0.ref
+++ b/Trigger/TrigT1/TrigT1EventAthenaPool/share/TrigT1EventTPCnv_18.0.0.ref
@@ -116,7 +116,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/share/TrigTruthEventTPCnv_15.8.0.ref b/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/share/TrigTruthEventTPCnv_15.8.0.ref
index 7f99b00740df..707767429264 100644
--- a/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/share/TrigTruthEventTPCnv_15.8.0.ref
+++ b/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/share/TrigTruthEventTPCnv_15.8.0.ref
@@ -117,7 +117,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
diff --git a/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/share/TrigTruthEventTPCnv_18.0.0.ref b/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/share/TrigTruthEventTPCnv_18.0.0.ref
index 1c1ef9c5af6d..90ab17f70a98 100644
--- a/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/share/TrigTruthEventTPCnv_18.0.0.ref
+++ b/Trigger/TrigTruthEvent/TrigTruthEventAthenaPool/share/TrigTruthEventTPCnv_18.0.0.ref
@@ -111,7 +111,6 @@ DetDescrCnvSvc       INFO  filling address for CaloTTMgr with CLID 117659265 and
 DetDescrCnvSvc       INFO  filling address for CaloMgr with CLID 4548337 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloSuperCellMgr with CLID 241807251 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for CaloIdManager with CLID 125856940 and storage type 68 to detector store 
-DetDescrCnvSvc       INFO  filling address for LArIdManager with CLID 79554919 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for IdDict with CLID 2411 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for AtlasID with CLID 164875623 and storage type 68 to detector store 
 DetDescrCnvSvc       INFO  filling address for PixelID with CLID 2516 and storage type 68 to detector store 
-- 
GitLab


From 7de5240cca6d3aa375acd5c9899bc33625db5a98 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 31 Aug 2021 12:49:32 +0200
Subject: [PATCH 204/347] TrigT1Muctpi: delete package

Delete obsolete legacy Run-1&2 Muctpi package.

Closes ATR-23763.
---
 Trigger/TrigT1/TrigT1Muctpi/CMakeLists.txt    |  23 -
 Trigger/TrigT1/TrigT1Muctpi/doc/packagedoc.h  |  36 -
 .../TrigT1Muctpi/python/TrigT1MuctpiConfig.py | 320 -------
 .../TrigT1/TrigT1Muctpi/python/__init__.py    |   8 -
 .../TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx  | 758 -----------------
 .../TrigT1Muctpi/src/Algorithms/L1Muctpi.h    | 176 ----
 .../src/Algorithms/L1MuctpiPatGen.cxx         | 101 ---
 .../src/Algorithms/L1MuctpiPatGen.h           |  40 -
 .../Algorithms/L1MuctpiTestReadResults.cxx    |  68 --
 .../src/Algorithms/L1MuctpiTestReadResults.h  |  42 -
 .../src/Algorithms/L1MuctpiTool.cxx           | 790 ------------------
 .../src/Algorithms/L1MuctpiTool.h             | 119 ---
 .../TrigT1/TrigT1Muctpi/src/Common/BitOp.cxx  |  75 --
 .../TrigT1/TrigT1Muctpi/src/Common/BitOp.h    | 117 ---
 .../TrigT1Muctpi/src/Common/Configuration.h   |  73 --
 .../TrigT1Muctpi/src/Common/Converter.cxx     | 592 -------------
 .../TrigT1Muctpi/src/Common/Converter.h       | 183 ----
 .../TrigT1/TrigT1Muctpi/src/Common/Detector.h |  47 --
 .../TrigT1Muctpi/src/Common/EventID.cxx       | 139 ---
 .../TrigT1/TrigT1Muctpi/src/Common/EventID.h  | 109 ---
 .../src/Common/EventIDSingleton.cxx           |  41 -
 .../src/Common/EventIDSingleton.h             | 117 ---
 .../src/Common/GenTestPattern.cxx             | 405 ---------
 .../TrigT1Muctpi/src/Common/GenTestPattern.h  | 180 ----
 .../src/Common/MioctL1TopoConverter.cxx       | 135 ---
 .../src/Common/MioctL1TopoConverter.h         |  50 --
 .../TrigT1Muctpi/src/Common/MuctpiBitMasks.h  | 173 ----
 .../TrigT1Muctpi/src/Common/MuctpiSim.cxx     | 318 -------
 .../TrigT1Muctpi/src/Common/MuctpiSim.h       | 205 -----
 .../src/Common/MultiplicityCalcType.h         |  23 -
 .../TrigT1Muctpi/src/Common/MuonCandidate.cxx |  50 --
 .../TrigT1Muctpi/src/Common/MuonCandidate.h   | 112 ---
 .../src/Common/PtMultiplicitySet.cxx          | 126 ---
 .../src/Common/PtMultiplicitySet.h            |  96 ---
 .../src/Common/RandomCandidateRange.cxx       |  38 -
 .../src/Common/RandomCandidateRange.h         | 181 ----
 .../TrigT1Muctpi/src/Common/SectorConstants.h |  35 -
 .../TrigT1Muctpi/src/Common/Verifyer.cxx      | 193 -----
 .../TrigT1/TrigT1Muctpi/src/Common/Verifyer.h | 133 ---
 .../TrigT1Muctpi/src/Logging/MsgLogger.cxx    | 147 ----
 .../TrigT1Muctpi/src/Logging/MsgLogger.h      | 210 -----
 .../TrigT1/TrigT1Muctpi/src/Logging/MsgType.h |  18 -
 .../TrigT1Muctpi/src/Logging/MsgWriter.cxx    | 113 ---
 .../TrigT1Muctpi/src/Logging/MsgWriter.h      |  83 --
 .../TrigT1Muctpi/src/Mibak/Lvl1Mibak.cxx      | 340 --------
 .../TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.h | 201 -----
 .../src/Mibak/MibakStreamEvent.cxx            | 357 --------
 .../TrigT1Muctpi/src/Mibak/MibakStreamEvent.h | 130 ---
 .../TrigT1Muctpi/src/Mictp/MictpData.cxx      |  28 -
 .../TrigT1/TrigT1Muctpi/src/Mictp/MictpData.h |  85 --
 .../TrigT1Muctpi/src/Mictp/MictpModule.cxx    |  94 ---
 .../TrigT1Muctpi/src/Mictp/MictpModule.h      |  93 ---
 .../TrigT1Muctpi/src/Mioct/BarrelSector.cxx   | 129 ---
 .../TrigT1Muctpi/src/Mioct/BarrelSector.h     | 112 ---
 .../TrigT1Muctpi/src/Mioct/EndcapSector.cxx   | 123 ---
 .../TrigT1Muctpi/src/Mioct/EndcapSector.h     |  98 ---
 .../TrigT1Muctpi/src/Mioct/EventReader.cxx    |  22 -
 .../TrigT1Muctpi/src/Mioct/EventReader.h      | 108 ---
 .../src/Mioct/EventReaderFactory.cxx          |  22 -
 .../src/Mioct/EventReaderFactory.h            |  64 --
 .../TrigT1Muctpi/src/Mioct/EventSource.h      |  53 --
 .../src/Mioct/ExclusiveMultStrategy.cxx       |  45 -
 .../src/Mioct/ExclusiveMultStrategy.h         |  53 --
 .../TrigT1Muctpi/src/Mioct/ForwardSector.cxx  | 111 ---
 .../TrigT1Muctpi/src/Mioct/ForwardSector.h    |  86 --
 .../src/Mioct/InclusiveMultStrategy.cxx       |  52 --
 .../src/Mioct/InclusiveMultStrategy.h         |  50 --
 .../src/Mioct/LUTBBOverlapCalculator.cxx      | 276 ------
 .../src/Mioct/LUTBBOverlapCalculator.h        |  58 --
 .../src/Mioct/LUTBEOverlapCalculator.cxx      | 265 ------
 .../src/Mioct/LUTBEOverlapCalculator.h        |  59 --
 .../src/Mioct/LUTEEOverlapCalculator.cxx      | 252 ------
 .../src/Mioct/LUTEEOverlapCalculator.h        |  58 --
 .../src/Mioct/LUTEFOverlapCalculator.cxx      | 255 ------
 .../src/Mioct/LUTEFOverlapCalculator.h        |  59 --
 .../src/Mioct/LUTFFOverlapCalculator.cxx      | 249 ------
 .../src/Mioct/LUTFFOverlapCalculator.h        |  58 --
 .../src/Mioct/LUTMultiplicityCalculator.cxx   | 319 -------
 .../src/Mioct/LUTMultiplicityCalculator.h     |  93 ---
 .../src/Mioct/LUTOverlapCalculatorBase.cxx    |  35 -
 .../src/Mioct/LUTOverlapCalculatorBase.h      |  98 ---
 .../TrigT1Muctpi/src/Mioct/LUTStrategy.cxx    | 252 ------
 .../TrigT1Muctpi/src/Mioct/LUTStrategy.h      |  70 --
 .../TrigT1Muctpi/src/Mioct/MioctData.cxx      | 182 ----
 .../TrigT1/TrigT1Muctpi/src/Mioct/MioctData.h | 115 ---
 .../TrigT1/TrigT1Muctpi/src/Mioct/MioctID.cxx | 126 ---
 .../TrigT1/TrigT1Muctpi/src/Mioct/MioctID.h   | 108 ---
 .../TrigT1Muctpi/src/Mioct/MioctModule.cxx    | 245 ------
 .../TrigT1Muctpi/src/Mioct/MioctModule.h      | 131 ---
 .../TrigT1Muctpi/src/Mioct/MioctSectorSet.cxx | 165 ----
 .../TrigT1Muctpi/src/Mioct/MioctSectorSet.h   | 108 ---
 .../src/Mioct/MultiplicityLogic.cxx           | 113 ---
 .../src/Mioct/MultiplicityLogic.h             |  71 --
 .../src/Mioct/MultiplicityStrategy.h          |  87 --
 .../TrigT1Muctpi/src/Mioct/NullStrategy.cxx   | 130 ---
 .../TrigT1Muctpi/src/Mioct/NullStrategy.h     |  65 --
 .../TrigT1Muctpi/src/Mioct/OverlapLogic.cxx   |  95 ---
 .../TrigT1Muctpi/src/Mioct/OverlapLogic.h     | 110 ---
 .../src/Mioct/OverlapStrategy.cxx             |  32 -
 .../TrigT1Muctpi/src/Mioct/OverlapStrategy.h  |  91 --
 .../TrigT1/TrigT1Muctpi/src/Mioct/Sector.cxx  |  82 --
 .../TrigT1/TrigT1Muctpi/src/Mioct/Sector.h    | 169 ----
 .../TrigT1Muctpi/src/Mioct/SectorID.cxx       | 179 ----
 .../TrigT1/TrigT1Muctpi/src/Mioct/SectorID.h  | 168 ----
 .../src/Mioct/SectorLogicReader.cxx           | 158 ----
 .../src/Mioct/SectorLogicReader.h             | 153 ----
 .../src/Mioct/SectorLogicSource.cxx           |  69 --
 .../src/Mioct/SectorLogicSource.h             |  84 --
 .../TrigT1Muctpi/src/Mioct/StrategyName.h     |  17 -
 .../src/Mioct/XMLMultCalculator.cxx           | 156 ----
 .../src/Mioct/XMLMultCalculator.h             |  51 --
 .../src/Mioct/XMLMultStrategy.cxx             | 276 ------
 .../TrigT1Muctpi/src/Mioct/XMLMultStrategy.h  |  56 --
 .../src/Mirod/MirodDaqProcessor.cxx           | 351 --------
 .../src/Mirod/MirodDaqProcessor.h             | 106 ---
 .../src/Mirod/MirodEventReader.cxx            | 259 ------
 .../TrigT1Muctpi/src/Mirod/MirodEventReader.h |  94 ---
 .../TrigT1Muctpi/src/Mirod/MirodExtractor.cxx | 423 ----------
 .../TrigT1Muctpi/src/Mirod/MirodExtractor.h   | 143 ----
 .../src/Mirod/MirodFiFoContent.cxx            |  63 --
 .../TrigT1Muctpi/src/Mirod/MirodFiFoContent.h |  82 --
 .../src/Mirod/MirodLvl2Processor.cxx          | 447 ----------
 .../src/Mirod/MirodLvl2Processor.h            | 125 ---
 .../TrigT1Muctpi/src/Mirod/MirodModule.cxx    |  58 --
 .../TrigT1Muctpi/src/Mirod/MirodModule.h      | 123 ---
 .../TrigT1Muctpi/src/Mirod/MirodTestRamIn.cxx |  22 -
 .../TrigT1Muctpi/src/Mirod/MirodTestRamIn.h   |  65 --
 .../src/components/TrigT1Muctpi_entries.cxx   |  11 -
 128 files changed, 17874 deletions(-)
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/CMakeLists.txt
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/doc/packagedoc.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/python/__init__.py
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/Configuration.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/Detector.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiBitMasks.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/MultiplicityCalcType.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/SectorConstants.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgType.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventSource.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityStrategy.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/StrategyName.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.cxx
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.h
 delete mode 100644 Trigger/TrigT1/TrigT1Muctpi/src/components/TrigT1Muctpi_entries.cxx

diff --git a/Trigger/TrigT1/TrigT1Muctpi/CMakeLists.txt b/Trigger/TrigT1/TrigT1Muctpi/CMakeLists.txt
deleted file mode 100644
index 7d0f2f783504..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/CMakeLists.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-# Declare the package name:
-atlas_subdir( TrigT1Muctpi )
-
-# External dependencies:
-find_package( XercesC )
-
-# Component(s) in the package:
-atlas_add_component( TrigT1Muctpi
-                     src/Algorithms/*.cxx
-                     src/Common/*.cxx
-                     src/Logging/*.cxx
-                     src/Mibak/*.cxx
-                     src/Mictp/*.cxx
-                     src/Mioct/*.cxx
-                     src/Mirod/*.cxx
-                     src/components/*.cxx
-                     INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${XERCESC_LIBRARIES} AnalysisTriggerEvent AthenaBaseComps AthenaKernel CxxUtils GaudiKernel PathResolver StoreGateLib TrigConfInterfaces TrigConfL1Data TrigConfMuctpi TrigT1Interfaces TrigT1Result )
-
-# Install files from the package:
-atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Trigger/TrigT1/TrigT1Muctpi/doc/packagedoc.h b/Trigger/TrigT1/TrigT1Muctpi/doc/packagedoc.h
deleted file mode 100644
index ffc167cfba34..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/doc/packagedoc.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
-@page TrigT1Muctpi_page TrigT1Muctpi Package
-
-  @author Attila Kraznahorkay Jr. <Attila.Krasznahorkay@cern.ch>
-  @author Thorsten Wengler <Thorsten.Wengler@cern.ch>
-
-@section TrigT1Muctpi_TrigT1MuctpiIntro Introduction
-
-  This package holds the simulation code of the Muon to CTP Interface (MuCTPI).
-  This hardware is responsible for collecting the muon candidates reconstructed by
-  the RPC and TGC sector logics, count their multiplicity in 6 different thresholds
-  considering overlaps between the trigger sectors, and send the multiplicity
-  result to the CTP. It also supplies information on the LVL1 muon candidates
-  to the RoI Builder and the DAQ system.
-
-@section TrigT1Muctpi_TrigT1MuctpiOverview Class Overview
-
-  The package contains the following algorithms:
-
-   - LVL1MUCTPI::L1Muctpi : The main MuCTPI simulation algorithm.
-   - CBNTAA_ReadMuCTPI_RDO : Algorithm that saves MuCTPI variables in a CBNTAA ntuple.
-   - CBNTAA_ReadMuCTPI_RIO : Algorithm that saves "extended" MuCTPI variables in a CBNTAA ntuple.
-   - CBNTAA_MuctpiRoI : Algorithm saving eta-phi coordinates for muon RoIs to CBNTAA ntuple.
-   - LVL1MUCTPI::L1MuctpiPatGen : Algorithm generating random input for the MuCTPI simulation. For testing only.
-   - LVL1MUCTPI::L1MuctpiTestReadResults : Algorithm "testing" the output of the MuCTPI simulation.
-
-   The actual hardware simulation uses a lot of classes. Those can all be found in the "Classes" tab.
-
- */
diff --git a/Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py b/Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py
deleted file mode 100644
index 28fb8b0c06e1..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py
+++ /dev/null
@@ -1,320 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-
-# Local (generated) configurable(s):
-from TrigT1Muctpi.TrigT1MuctpiConf import LVL1MUCTPI__L1Muctpi
-from TrigT1Muctpi.TrigT1MuctpiConf import LVL1MUCTPI__L1MuctpiTool
-
-class DefaultL1Muctpi( LVL1MUCTPI__L1Muctpi ):
-
-  """
-    Base configurable module for the L1Muctpi algorithm configurations
-  """
-
-  def __init__( self, name = "L1Muctpi" ):
-
-    LVL1MUCTPI__L1Muctpi.__init__( self, name )
-
-    # Create a logger:
-    from AthenaCommon.Logging import logging
-    logger = logging.getLogger( "L1Muctpi" )
-
-    # Set properties of the LUT overlap handling:
-    self.OverlapStrategyName = "LUT"
-    self.DumpLUT = False
-    self.LUTXMLFile = "UNDEFINED"
-    self.RunPeriod = "UNDEFINED"
-    self.FlaggingMode = False
-    self.MultiplicityStrategyName = "INCLUSIVE"
-
-    # Decide which LUT to use, based on which run we are simulating:
-    from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags
-    from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags
-    if ( commonGeoFlags.Run() == "RUN1" ) or ( ( commonGeoFlags.Run() == "UNDEFINED" ) and
-                                               ( geoFlags.isIBL() is False ) ):
-      self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml"
-      self.RunPeriod = "RUN1"
-      logger.info( "Configuring MuCTPI simulation with Run 1 configuration file:" )
-      logger.info( "  TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml" )
-      logger.info( "  with a RunPeriod=RUN1" )
-    elif ( commonGeoFlags.Run() == "RUN2" ) or ( ( commonGeoFlags.Run() == "UNDEFINED" ) and
-                                                 ( geoFlags.isIBL() is True ) ):
-      self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml"
-      self.RunPeriod = "RUN2"
-      logger.info( "Configuring MuCTPI simulation with Run 2 configuration file:" )
-      logger.info( "  TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" )
-      logger.info( "  with a RunPeriod=RUN2" )
-    else:
-      self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml"
-      self.RunPeriod = "RUN2"
-      logger.warning( "Couldn't determine which run to simulate, using Run 2 configuration file:" )
-      logger.warning( "  TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" )
-      logger.warning( "  with a RunPeriod=RUN2" )
-
-      pass
-
-    # Set properties for NIM outputs ot L1Topo conversion from RoI to eta/phi
-    self.GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml"
-
-    # Turn on the NIM output creation by default:
-    self.DoNIMOutput = True
-    # The bit settings were extracted from here:
-    #   https://savannah.cern.ch/bugs/?90300#comment14
-    self.NIMBarrelBit = 29
-    self.NIMEndcapBit = 30
-
-    ### this should not be done at all, since it instantiates a config svc without proper configuration!!
-    ### instead rely on the TriggerConfigGetter being setup in the top job properties
-    # Ensure that the LVL1ConfigSvc is loaded:
-    #from AthenaCommon.AppMgr import ServiceMgr # Has to be imported here for some reason...
-    #if not hasattr( ServiceMgr, "LVL1ConfigSvc" ):  
-    #  from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc
-    #  lvl1ConfigSvc = LVL1ConfigSvc("LVL1ConfigSvc")
-#   #   lvl1ConfigSvc.XMLFile = "LVL1config13.0.20.xml"
-    #  ServiceMgr += lvl1ConfigSvc
-    #  self.LVL1ConfigSvc = lvl1ConfigSvc
-
-class L1Muctpi( DefaultL1Muctpi ):
-
-  """
-    Module configuring the default MuCTPI simulation to be used as
-    part of the LVL1 simulation.
-  """
-
-  def __init__( self, name = "L1Muctpi" ):
-
-    DefaultL1Muctpi.__init__( self, name )
-
-    self.InputSource = "DIGITIZATION"
-
-class L1Muctpi_on_RDO( DefaultL1Muctpi ):
-
-  """
-    Module configuring the MuCTPI simulation to be re-run on an RDO file
-    (that already has a result from a previous MuCTPI simulation running)
-  """
-
-  def __init__( self, name = "L1Muctpi_on_RDO" ):
-
-    DefaultL1Muctpi.__init__( self, name )
-
-    self.InputSource = "RDO"
-    self.RDOLocID = "MUCTPI_RDO"
-    self.RDOOutputLocID = "MUCTPI_RDO+"
-    self.RoIOutputLocID = "not_used_1"
-    self.CTPOutputLocID = "not_used_2"
-
-class L1Muctpi_on_Data( DefaultL1Muctpi ):
-
-  """
-    Module configuring the MuCTPI simulation to be re-run on data BS file
-    (that already has a result from a previous MuCTPI simulation running)
-  """
-
-  def __init__( self, name = "L1Muctpi_on_Data" ):
-
-    DefaultL1Muctpi.__init__( self, name )
-
-    self.InputSource = "RDO"
-    self.RDOLocID = "MUCTPI_RDO"
-    self.RDOOutputLocID = "MUCTPI_RDO+"
-    self.RoIOutputLocID = "not_used_1"
-    self.OverlapStrategyName = "LUT"
-    self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB_crc_3385316356.xml"
-    self.IsData=1
-    self.FlaggingMode = False
-
-class L1Muctpi_on_AOD( DefaultL1Muctpi ):
-
-  """
-    Module configuring the MuCTPI simulation to be re-run on an AOD file
-    (that contains the LVL1_ROI object)
-  """
-
-  def __init__( self, name = "L1Muctpi_on_AOD" ):
-
-    DefaultL1Muctpi.__init__( self, name )
-
-    self.InputSource = "AOD"
-    self.AODLocID = "LVL1_ROI"
-    self.RDOOutputLocID = "MUCTPI_RDO+"
-    self.RoIOutputLocID = "not_used_1"
-    self.CTPOutputLocID = "not_used_2"
-
-
-# for now just duplicate the configuration for the L1MuctpiTool, to be consolidated
-# ------------------------------------------------------------------------------------------------------
-
-
-
-class DefaultL1MuctpiTool( LVL1MUCTPI__L1MuctpiTool ):
-
-  """
-    Base configurable module for the L1MuctpiTool algorithm configurations
-  """
-
-  def __init__( self, name = "L1MuctpiTool" ):
-
-    LVL1MUCTPI__L1MuctpiTool.__init__( self, name )
-
-    # Create a logger:
-    from AthenaCommon.Logging import logging
-    logger = logging.getLogger( "L1MuctpiTool" )
-
-    # Set properties of the LUT overlap handling:
-    self.OverlapStrategyName = "LUT"
-    self.DumpLUT = False
-    self.LUTXMLFile = "UNDEFINED"
-    self.RunPeriod = "UNDEFINED"
-    self.FlaggingMode = False
-    self.MultiplicityStrategyName = "INCLUSIVE"
-
-    # Decide which LUT to use, based on which run we are simulating:
-    from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags
-    from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags
-    if ( commonGeoFlags.Run() == "RUN1" ) or ( ( commonGeoFlags.Run() == "UNDEFINED" ) and
-                                               ( geoFlags.isIBL() is False ) ):
-      self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml"
-      self.RunPeriod = "RUN1"
-      logger.info( "Configuring MuCTPI simulation with Run 1 configuration file:" )
-      logger.info( "  TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002.xml" )
-      logger.info( "  with a RunPeriod=RUN1" )
-    elif ( commonGeoFlags.Run() == "RUN2" ) or ( ( commonGeoFlags.Run() == "UNDEFINED" ) and
-                                                 ( geoFlags.isIBL() is True ) ):
-      self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml"
-      self.RunPeriod = "RUN2"
-      logger.info( "Configuring MuCTPI simulation with Run 2 configuration file:" )
-      logger.info( "  TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" )
-      logger.info( "  with a RunPeriod=RUN2" )
-    else:
-      self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml"
-      self.RunPeriod = "RUN2"
-      logger.warning( "Couldn't determine which run to simulate, using Run 2 configuration file:" )
-      logger.warning( "  TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml" )
-      logger.warning( "  with a RunPeriod=RUN2" )
-
-      pass
-
-    # Set properties for NIM outputs ot L1Topo conversion from RoI to eta/phi
-    self.GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml"
-
-    # Turn on the NIM output creation by default:
-    self.DoNIMOutput = True
-    # The bit settings were extracted from here:
-    #   https://savannah.cern.ch/bugs/?90300#comment14
-    self.NIMBarrelBit = 29
-    self.NIMEndcapBit = 30
-
-    ### this should not be done at all, since it instantiates a config svc without proper configuration!!
-    ### instead rely on the TriggerConfigGetter being setup in the top job properties
-    # Ensure that the LVL1ConfigSvc is loaded:
-    #from AthenaCommon.AppMgr import ServiceMgr # Has to be imported here for some reason...
-    #if not hasattr( ServiceMgr, "LVL1ConfigSvc" ):  
-    #  from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc
-    #  lvl1ConfigSvc = LVL1ConfigSvc("LVL1ConfigSvc")
-#   #   lvl1ConfigSvc.XMLFile = "LVL1config13.0.20.xml"
-    #  ServiceMgr += lvl1ConfigSvc
-    #  self.LVL1ConfigSvc = lvl1ConfigSvc
-
-class L1MuctpiTool( DefaultL1MuctpiTool ):
-
-  """
-    Module configuring the default MuCTPI simulation to be used as
-    part of the LVL1 simulation.
-  """
-
-  def __init__( self, name = "L1MuctpiTool" ):
-
-    DefaultL1MuctpiTool.__init__( self, name )
-
-    self.InputSource = "DIGITIZATION"
-
-class L1MuctpiTool_on_RDO( DefaultL1MuctpiTool ):
-
-  """
-    Module configuring the MuCTPI simulation to be re-run on an RDO file
-    (that already has a result from a previous MuCTPI simulation running)
-  """
-
-  def __init__( self, name = "L1MuctpiTool_on_RDO" ):
-
-    DefaultL1MuctpiTool.__init__( self, name )
-
-    self.InputSource = "RDO"
-    self.RDOLocID = "MUCTPI_RDO"
-    self.RDOOutputLocID = "MUCTPI_RDO+"
-    self.RoIOutputLocID = "not_used_1"
-    self.CTPOutputLocID = "not_used_2"
-
-class L1MuctpiTool_on_Data( DefaultL1MuctpiTool ):
-
-  """
-    Module configuring the MuCTPI simulation to be re-run on data BS file
-    (that already has a result from a previous MuCTPI simulation running)
-  """
-
-  def __init__( self, name = "L1MuctpiTool_on_Data" ):
-
-    DefaultL1MuctpiTool.__init__( self, name )
-
-    self.InputSource = "RDO"
-    self.RDOLocID = "MUCTPI_RDO"
-    self.RDOOutputLocID = "MUCTPI_RDO+"
-    self.RoIOutputLocID = "not_used_1"
-    self.OverlapStrategyName = "LUT"
-    self.LUTXMLFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB_crc_3385316356.xml"
-    self.IsData=1
-    self.FlaggingMode = False
-
-class L1MuctpiTool_on_AOD( DefaultL1MuctpiTool ):
-
-  """
-    Module configuring the MuCTPI simulation to be re-run on an AOD file
-    (that contains the LVL1_ROI object)
-  """
-
-  def __init__( self, name = "L1MuctpiTool_on_AOD" ):
-
-    DefaultL1MuctpiTool.__init__( self, name )
-
-    self.InputSource = "AOD"
-    self.AODLocID = "LVL1_ROI"
-    self.RDOOutputLocID = "MUCTPI_RDO+"
-    self.RoIOutputLocID = "not_used_1"
-    self.CTPOutputLocID = "not_used_2"
-
-
-def L1MuctpiToolRDOCfg(flags, name = "L1Muctpi"):
-  """ 
-  Configures L1MuctpiTool for running on MC
-  """
-  lutFile = None
-  period = None
-  # TODO clarify IBL dependence
-  if flags.GeoModel.Run == "RUN2"  or flags.GeoModel.Run == "UNDEFINED":
-    lutFile = "TrigConfMuctpi/data10_7TeV.periodI.physics_Muons.MuCTPI_LUT.NoBEOverlaps_composedEF.v002_modifiedBB.xml"
-    period = "RUN2"
-  from AthenaConfiguration.ComponentFactory import CompFactory
-  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-  acc = ComponentAccumulator()
-  from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
-  acc.merge(L1ConfigSvcCfg(flags))
-  tool = CompFactory.LVL1MUCTPI.L1MuctpiTool(name, 
-                                            LVL1ConfigSvc=acc.getService("LVL1ConfigSvc"),
-                                            OverlapStrategyName = "LUT",
-                                            DumpLUT = False,
-                                            LUTXMLFile = lutFile,
-                                            RunPeriod = period,
-                                            FlaggingMode = False,
-                                            MultiplicityStrategyName = "INCLUSIVE", 
-                                            InputSource = "RDO",
-                                            RDOLocID = "MUCTPI_RDO",
-                                            GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml",
-                                            DoNIMOutput = True,
-                                            # The bit settings were extracted from here:
-                                            #   https://savannah.cern.ch/bugs/?90300#comment14
-                                            NIMBarrelBit = 29,
-                                            NIMEndcapBit = 30,
-                                            )
-  acc.addPublicTool(tool, primary=True)
-  return acc
diff --git a/Trigger/TrigT1/TrigT1Muctpi/python/__init__.py b/Trigger/TrigT1/TrigT1Muctpi/python/__init__.py
deleted file mode 100644
index 670f0c6952ed..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/python/__init__.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-
-# File: TrigT1Muctpi/__init__.py
-# Author: berge@cern.ch
-  
-__version__ = '1.0.0'
-__author__  = 'berge@cern.ch,Attila.Krasznahorkay@cern.ch'
-__all__ = [ 'TrigT1MuctpiAlgorithmConfig', 'TrigT1MuctpiConfig' ]
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx
deleted file mode 100644
index bb6480994ec3..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx
+++ /dev/null
@@ -1,758 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: L1Muctpi.cxx 794528 2017-01-30 12:36:33Z fwinkl $
-
-// STL include(s):
-#include <iostream>
-#include <sstream>
-
-// Gaudi/Athena include(s):
-#include "PathResolver/PathResolver.h"
-#include "AthenaKernel/errorcheck.h"
-
-// The AOD object that we may want to read as input
-#include "AnalysisTriggerEvent/LVL1_ROI.h"
-
-// The new trigger configuration
-#include "TrigConfInterfaces/ILVL1ConfigSvc.h"
-#include "TrigConfL1Data/Muctpi.h"
-#include "TrigConfL1Data/ThresholdConfig.h"
-#include "TrigConfL1Data/TriggerThreshold.h"
-
-// Interfaces used by the simulation
-#include "TrigT1Interfaces/MuCTPICTP.h"
-#include "TrigT1Interfaces/MuCTPIToRoIBSLink.h"
-#include "TrigT1Interfaces/TrigT1StoreGateKeys.h"
-
-
-// Inlcudes for the MuCTPI simulation
-#include "L1Muctpi.h"
-#include "../Common/MuctpiSim.h"
-#include "../Common/Configuration.h"
-#include "../Logging/MsgWriter.h"
-#include "../Mioct/StrategyName.h"
-#include "../Common/Converter.h"
-
-// Set the default StoreGate locations of input and output objects:
-const std::string LVL1MUCTPI::L1Muctpi::m_DEFAULT_L1MuctpiStoreLocationRPC = "L1MuctpiStoreRPC";
-const std::string LVL1MUCTPI::L1Muctpi::m_DEFAULT_L1MuctpiStoreLocationTGC = "L1MuctpiStoreTGC";
-const std::string LVL1MUCTPI::L1Muctpi::m_DEFAULT_AODLocID                 = "LVL1_ROI";
-const std::string LVL1MUCTPI::L1Muctpi::m_DEFAULT_RDOLocID                 = "MUCTPI_RDO";
-
-//--------------
-// Constructor
-//--------------
-LVL1MUCTPI::L1Muctpi::L1Muctpi( const std::string& name, ISvcLocator* pSvcLocator )
-   : base_class( name, pSvcLocator ),
-     m_configSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name ),
-     m_theMuctpi( 0 ), m_executeFunction(nullptr)  
-{   
-   // Declare the service handles as properties:
-   declareProperty( "LVL1ConfigSvc", m_configSvc, "LVL1 Config Service" );
-
-   // Declare the properties of the overlap treatment:
-   declareProperty( "OverlapStrategyName", m_overlapStrategyName = "NULL" );
-   declareProperty( "LUTXMLFile", m_lutXMLFile = "" );
-   declareProperty( "RunPeriod", m_runPeriod = "RUN1" );
-   declareProperty( "FlaggingMode", m_flagMode = false );
-
-   // Declare the properties of the output generation for L1Topo:
-   declareProperty( "GeometryXMLFile", m_geometryXMLFile = "" );
-       
-   // Declare the properties for the multiplicity summation:
-   declareProperty( "MultiplicityStrategyName", m_multiplicityStrategyName = "INCLUSIVE" );
-   declareProperty( "MultiplicityXMLFile", m_multiplicityXMLFile = "" );
-
-   // Declare the properties of the input selection:
-   declareProperty( "InputSource", m_inputSource = "DIGITIZATION" );
-   declareProperty( "AODLocID", m_aodLocId = m_DEFAULT_AODLocID );
-   declareProperty( "RDOLocID", m_rdoLocId = m_DEFAULT_RDOLocID );
-
-   // The LUTs can be huge, so the default is to turn their printing off:
-   declareProperty( "DumpLUT", m_dumpLut = false );
-   
-   // Allow rerunning of simulation on data
-   declareProperty( "IsData", m_IsData = false, "Rerun simulation on data" );  
- 
-   // Declare the properties of the NIM output creation:
-   declareProperty( "DoNIMOutput", m_doNimOutput = false );
-   declareProperty( "NIMBarrelBit", m_nimBarrelBit = 0,
-                    "Bit on the NIM input of the CTP, showing that there was at least "
-                    "one barrel candidate in the event" );
-   declareProperty( "NIMEndcapBit", m_nimEndcapBit = 1,
-                    "Bit on the NIM input of the CTP, showing that there was at least "
-                    "one endcap candidate in the event" );
-
-}
-
-
-//--------------
-// Destructor
-//--------------
-LVL1MUCTPI::L1Muctpi::~L1Muctpi() {   
-   ATH_MSG_DEBUG( "L1Muctpi destructor called" );
-   if( m_theMuctpi ) delete m_theMuctpi;
-}
-
-/**
- * Initialisation of the algorithm. This is where the MuCTPI simulation object gets created,
- * the look up table is loaded for overlap handling between the muon sectors and the MuCTPI
- * configuration is read from LVL1ConfigSvc. Also m_executeFunction gets set up to point to
- * the execute function we have selected in the jobOptions.
- */
-StatusCode
-LVL1MUCTPI::L1Muctpi::initialize()
-{
-   // Init message
-   ATH_MSG_INFO( "initialize()"  );
-
-   ServiceHandle<IIncidentSvc> incidentSvc("IncidentSvc", "L1Muctpi");
-   CHECK(incidentSvc.retrieve());
-   incidentSvc->addListener(this,"BeginRun", 100);
-   incidentSvc.release().ignore();
-
-   // initialize input handle keys
-   ATH_CHECK( m_rpcInputKey.initialize( SG::AllowEmpty ) );
-   ATH_CHECK( m_tgcInputKey.initialize( SG::AllowEmpty ) );
-
-   // initialize output handle keys
-   ATH_CHECK( m_rdoOutputLocId.initialize( SG::AllowEmpty ) );
-   ATH_CHECK( m_muctpi2CtpKey.initialize( SG::AllowEmpty ) );
-   ATH_CHECK( m_muctpi2RoibKey.initialize( SG::AllowEmpty ) );
-   ATH_CHECK( m_nimctpKey.initialize( SG::AllowEmpty ) );
-   ATH_CHECK( m_topoOutputLocId.initialize( SG::AllowEmpty ) );
-   ATH_CHECK( m_topoOutputOffsetLocId.initialize( SG::AllowEmpty ) );
-
-
-   // Now this is a tricky part. We have to force the message logging of the
-   // MuCTPI simulation to display messages of the same level as this MsgStream.
-   MsgWriter::instance()->setMinType( msg().level() );
-   MsgWriter::instance()->setSource( name() );
-
-   // Create the MuCTPI simulation:
-   m_theMuctpi = new MuctpiSim();
-
-   //
-   // Set up the overlap handling of the simulation:
-   //
-   if( m_overlapStrategyName == "NULL" ) {
-
-      ATH_MSG_DEBUG( "Setting overlap strategy: \"NULL\"" );
-      m_theMuctpi->setOverlapStrategy( NO_OVERLAP );
-
-   } else if( m_overlapStrategyName == "LUT" ) {
-
-      ATH_MSG_DEBUG( "Setting overlap strategy: \"LUT\"" );
-      m_theMuctpi->setOverlapStrategy( LUT_OVERLAP );
-
-      if( m_flagMode ) {
-         ATH_MSG_INFO( "Using 'flagging mode' in the overlap handling" );
-      }
-
-      ATH_MSG_INFO( "XML LUT file defined in jobO: " << m_lutXMLFile << " with a RunPeriod=" << m_runPeriod );
-      const std::string fullFileName = PathResolverFindCalibFile( m_lutXMLFile );
-      ATH_MSG_DEBUG( "Full path to XML LUT file: " << fullFileName );
-      CHECK( m_theMuctpi->initializeLUTOverlapStrategy( fullFileName, m_flagMode,
-                                                        m_dumpLut, m_runPeriod ) );
-
-   } else {
-
-      REPORT_ERROR( StatusCode::FAILURE )
-         << "Wrong overlap strategy name specified: \""
-         << m_overlapStrategyName << "\"";
-      return StatusCode::FAILURE;
-
-   }
-
-   //
-   // Set up the handling of the outputs for L1Topo
-   //
-      
-   ATH_MSG_INFO( "Geometry XML file defined in jobO: " << m_geometryXMLFile );
-   const std::string fullGeometryFileName = PathResolverFindCalibFile( m_geometryXMLFile );
-   ATH_MSG_INFO( "Full path to Geometry XML file: " << fullGeometryFileName );
-
-   m_theMuctpi->setupL1TopoConverter(fullGeometryFileName);
-
-   //
-   // Set the multiplicity summation style of the simulation:
-   //
-   if( m_multiplicityStrategyName == "INCLUSIVE" ) {
-
-      ATH_MSG_DEBUG( "Setting INCLUSIVE multiplicity summation" );
-      m_theMuctpi->setMultiplicityStrategy( INCLUSIVE );
-
-   } else if( m_multiplicityStrategyName == "EXCLUSIVE" ) {
-
-      ATH_MSG_DEBUG( "Setting EXCLUSIVE multiplicity summation" );
-      m_theMuctpi->setMultiplicityStrategy( EXCLUSIVE );
-
-   } else if( m_multiplicityStrategyName == "XML" ) {
-
-      ATH_MSG_DEBUG( "Setting XML multiplicity summation" );
-      m_theMuctpi->setMultiplicityStrategy( XML );
-
-      ATH_MSG_INFO( "XML multiplicity file defined in jobO: "
-                    << m_multiplicityXMLFile );
-      const std::string packagePrefix = "TrigT1Muctpi/";
-      const std::string fullFileName = PathResolverFindCalibFile( packagePrefix +
-                                                                  m_multiplicityXMLFile );
-      ATH_MSG_DEBUG( " Full path to XML file: " << fullFileName );
-      m_theMuctpi->initializeXMLMultStrategy( fullFileName );
-
-   } else {
-
-      REPORT_ERROR( StatusCode::FAILURE )
-         << "Wring multiplicity summation type specified: \""
-         << m_multiplicityStrategyName << "\"";
-      return StatusCode::FAILURE;
-
-   }
-
-   //
-   // Set up the input source, and running conditions:
-   //
-   if( m_inputSource == "DIGITIZATION" ) {
-
-      ATH_MSG_INFO( "Setting input source to digitization" );
-      m_executeFunction = &L1Muctpi::executeFromDigi;
-
-   } else if( m_inputSource == "AOD" ) {
-
-      ATH_MSG_INFO( "Setting input source to AOD" );
-      m_executeFunction = &L1Muctpi::executeFromAOD;
-
-   } else if( m_inputSource == "RDO" ) {
-
-      ATH_MSG_INFO( "Setting input source to RDO" );
-      m_executeFunction = &L1Muctpi::executeFromRDO;
-
-   } else {
-
-      REPORT_ERROR( StatusCode::FAILURE )
-         << "Wrong input source specified: \"" << m_inputSource
-         << "\"";
-      return StatusCode::FAILURE;
-
-   }
-
-   //
-   // Give feedback about the NIM output creation:
-   //
-   if( m_doNimOutput ) {
-      ATH_MSG_INFO( "NIM output for CTP will be created" );
-      ATH_MSG_DEBUG( "SG key for the NIM object will be: "
-                     << m_nimctpKey.key() );
-      // A small sanity check:
-      if( m_nimBarrelBit == m_nimEndcapBit ) {
-         REPORT_ERROR( StatusCode::FAILURE )
-            << "The barrel and endcap NIM output bits are set to end up on the "
-            << "same bit (" << m_nimBarrelBit << ")";
-         return StatusCode::FAILURE;
-      }
-      ATH_MSG_DEBUG( "Position for the barrel NIM bit: " << m_nimBarrelBit );
-      ATH_MSG_DEBUG( "Position for the endcap NIM bit: " << m_nimEndcapBit );
-   } else {
-      ATH_MSG_INFO( "NIM output for CTP will *not* be created" );
-   }
-
-   ATH_MSG_INFO( "Retrieving trigger config service" << m_configSvc );
-   CHECK(m_configSvc.retrieve());
-
-   return StatusCode::SUCCESS;
-}
-
-
-void
-LVL1MUCTPI::L1Muctpi::handle(const Incident& incident)
-{
-   if (incident.type()!="BeginRun") return;
-   ATH_MSG_DEBUG( "In L1Muctpi BeginRun incident");
-    
-   StatusCode sc = loadFixedConditions();
-   if( sc.isFailure() ) {
-      ATH_MSG_ERROR( "ERROR in MuCTPI configuration");
-   }
-}
-
-
-StatusCode
-LVL1MUCTPI::L1Muctpi::loadFixedConditions( )
-{
-   Configuration muctpiConfiguration;
-   // Connect to the LVL1 configuration service (create it if it doesn't exist):
-   if(!m_IsData){
-      // convert MuCTPI config to Configuration
-      muctpiConfiguration.setThreshold1Candidate( m_configSvc->muctpiConfig()->lowptThreshold() );
-      muctpiConfiguration.setThreshold2Candidate( m_configSvc->muctpiConfig()->highptThreshold() );
-      muctpiConfiguration.setMaxCandSendToRoib( m_configSvc->muctpiConfig()->maxCand() );
-   }
-      
-   //if running on data, hard code muctpi configuration
-   else{
-      muctpiConfiguration.setThreshold1Candidate( 1 );
-      muctpiConfiguration.setThreshold2Candidate( 1 );
-      muctpiConfiguration.setMaxCandSendToRoib( 64 );
-   }
-
-   // set Configuration
-   m_theMuctpi->setConfiguration( muctpiConfiguration );
-
-   ATH_MSG_INFO( "The Muctpi has been configured ->"
-                 << " 1stThr:" << muctpiConfiguration.getThreshold1Candidate()
-                 << " 2ndThr:" << muctpiConfiguration.getThreshold2Candidate()
-                 << " MaximalCandCount:" << muctpiConfiguration.getMaxCandSendToRoib() );
-
-   StatusCode sc = validate( m_configSvc->thresholdConfig()->getThresholdVector(TrigConf::L1DataDef::MUON) );
-
-   if( sc.isFailure() ) {
-      REPORT_ERROR( StatusCode::FAILURE )
-         << "LVL1 muon configuration failed sanity check";
-      REPORT_ERROR( StatusCode::FAILURE )
-         << "See previous messages for more information";
-      REPORT_ERROR( StatusCode::FAILURE )
-         << "The muon trigger results will not be reliable";
-      return sc;
-   } else {
-      ATH_MSG_DEBUG( "LVL1 muon configuration passed sanity check" );
-   }
-
-   return StatusCode::SUCCESS;
-}
-
-//---------------------------------
-// finalize()
-//---------------------------------
-StatusCode
-LVL1MUCTPI::L1Muctpi::finalize()
-{
-   // Now this is a tricky part. We have to force the message logging of the
-   // MuCTPI simulation to display messages of the same level as this MsgStream.
-   MsgWriter::instance()->setMinType( msg().level() );
-   MsgWriter::instance()->setSource( name() );
-
-   ATH_MSG_INFO( "===============================" );
-   ATH_MSG_INFO( "Finalizing L1Muctpi algorithm." );
-   ATH_MSG_INFO( "===============================" );
-
-   delete m_theMuctpi;
-   m_theMuctpi = 0;
-
-   return StatusCode::SUCCESS;
-}
-
-
-//----------------------------------------------
-// execute() method called once per event
-//----------------------------------------------
-StatusCode
-LVL1MUCTPI::L1Muctpi::execute()
-{
-   // Now this is a tricky part. We have to force the message logging of the
-   // MuCTPI simulation to display messages of the same level as this MsgStream.
-   MsgWriter::instance()->setMinType( msg().level() );
-   MsgWriter::instance()->setSource( name() );
-
-   ATH_MSG_DEBUG( "===============================" );
-   ATH_MSG_DEBUG( "Executing L1Muctpi algorithm." );
-   ATH_MSG_DEBUG( "===============================" );
-
-   // Now this is a trictky one. I only had to make the decision of which function to call
-   // at execute once in initialize(). Now I can call the right function like this:
-   return ( this->*m_executeFunction )();
-}
-
-/**
- * This is the default execute() function. It reads inputs from the RPC and TGC sector logics,
- * and runs the MuCTPI simulation with their inputs.
- */
-StatusCode
-LVL1MUCTPI::L1Muctpi::executeFromDigi()
-{
-   ATH_MSG_DEBUG( "in executeFromDigi()" );
-
-   // Get the two inputs and merge them
-   LVL1MUONIF::Lvl1MuCTPIInput mergedInput;
-
-   // First the RPC input
-   auto rpcInputHandle = SG::makeHandle(m_rpcInputKey);
-   if( rpcInputHandle.isValid() ) {
-      ATH_MSG_DEBUG( "Retrieved L1MuCTPI input from RPC" );
-      mergedInput.merge( *rpcInputHandle );
-   } else {
-      ATH_MSG_WARNING( "Cannot retrieve L1Muctpi input from RPC" );
-   }
-
-   
-   if( auto rh = SG::makeHandle(m_tgcInputKey); rh.isValid() ) {
-      ATH_MSG_DEBUG( "Retrieved L1MuCTPI input from TGC" );
-      mergedInput.merge( *rh );
-   } else {
-      ATH_MSG_WARNING( "Cannot retrieve L1Muctpi input from TGC" );
-   }
-
-
-   // bool gotRPCInput( false );
-   // const LVL1MUONIF::Lvl1MuCTPIInput* dHandleRPC = 0;
-   // if( evtStore()->retrieve( dHandleRPC, m_rpcLocId ).isFailure() ) {
-   //    ATH_MSG_WARNING( "Cannot retrieve RPC L1Muctpi object from StoreGate!" );
-   // } else {
-   //    ATH_MSG_DEBUG( "Retrieved RPC Lvl1MuCTPIInput object from StoreGate" );
-   //    gotRPCInput = true;
-   // }
-
-   //
-   // Get the TGC MUCTPI-input object from StoreGate.
-   //
-   // bool gotTGCInput( false );
-   // const LVL1MUONIF::Lvl1MuCTPIInput* dHandleTGC = 0;
-   // if( evtStore()->retrieve( dHandleTGC, m_tgcLocId ).isFailure() ) {
-   //    ATH_MSG_WARNING( "Cannot retrieve TGC L1Muctpi object from StoreGate!" );
-   // } else {
-   //    ATH_MSG_DEBUG( "Retrieved TGC Lvl1MuCTPIInput object from StoreGate" );
-   //    gotTGCInput = true;
-   // }
-
-   // if( gotRPCInput ) mergedInput.merge( *dHandleRPC );
-   // if( gotTGCInput ) mergedInput.merge( *dHandleTGC );
-
-   // if( ! ( gotRPCInput || gotTGCInput ) ) {    // this should be an "&&" in final ver.
-   //    ATH_MSG_WARNING( "No input received from the RPC or TGC sector logic simulation" );
-   //    return StatusCode::SUCCESS;
-   // }
-
-   /// Need to check here if there are several BC slices in the input object, and run
-   /// the simulation for each one
-
-
-   //// TESTING ONLY  /////
-   /// mergedInput.duplicateToOtherBC(-1);
-
-   //always process the central slice, which defaults to bcidOffset = 0
-   // process the input in the MUCTPI simulation
-   m_theMuctpi->processData( &mergedInput );      
-   // Save the output of the simulation
-   CHECK( saveOutput() );
-
-   uint32_t can;
-   std::vector< uint32_t > dataWord;
-   CHECK( updateMuCTPI_RDO(can, dataWord) );
-
-   // check the other 4 possible BC offset values in case the input objects tells us there are
-   // out of time candidates
-
-
-   if (mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem()) ||
-       mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem()) || 
-       mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem()) ){
-      
-      for (std::vector<int>::iterator it = m_bcidOffsetList.begin(); it != m_bcidOffsetList.end(); ++it){
-         if (! mergedInput.isEmptyAll( (*it) ) ){
-            // process the input in the MUCTPI simulation
-            m_theMuctpi->processData( &mergedInput, (*it));      
-            // Save the output of the simulation
-            CHECK( saveOutput( (*it) ) );	    
-            uint32_t tmp_can; // this isn't used for anything!
-            CHECK( updateMuCTPI_RDO(tmp_can, dataWord) );
-         }
-      }
-   }    
-   CHECK( saveOutput_MuCTPI_RDO(can, std::move(dataWord)) );
-
-   return StatusCode::SUCCESS;
-}
-
-
-/**
- * This is a new execute() function. It reads the LVL1_ROI object from an AOD file, it converts
- * the muon RoIs back into the input format of the MuCTPI, then runs the MuCTPI information
- * with this transformed input.
- */
-StatusCode
-LVL1MUCTPI::L1Muctpi::executeFromAOD()
-{
-
-   ATH_MSG_DEBUG( "in executeFromAOD()" );
-
-   // Retrieve the LVL1_ROI object from the AOD:
-   const LVL1_ROI* lvl1RoI = 0;
-   CHECK( evtStore()->retrieve( lvl1RoI, m_aodLocId ) );
-   ATH_MSG_DEBUG( "Retrieved LVL1_ROI object from StoreGate" );
-
-   // Extract the RoIs into a vector:
-   std::vector< unsigned int > convertableRoIs;
-   LVL1_ROI::muons_type::const_iterator muonRoI_itr = lvl1RoI->getMuonROIs().begin();
-   LVL1_ROI::muons_type::const_iterator muonRoI_end = lvl1RoI->getMuonROIs().end();
-   for( ; muonRoI_itr != muonRoI_end; ++muonRoI_itr ) {
-      convertableRoIs.push_back( muonRoI_itr->getROIWord() );
-   }
-
-   // Create the input to the MuCTPI:
-   LVL1MUONIF::Lvl1MuCTPIInput convertedInput;
-   CHECK( Converter::convertRoIs( convertableRoIs, &convertedInput ) );
-
-   // process the input with the MuCTPI simulation
-   m_theMuctpi->processData( &convertedInput );
-
-   // Save the output of the simulation
-   CHECK( saveOutput() );
-
-   uint32_t can;
-   std::vector< uint32_t > dataWord;
-   CHECK( updateMuCTPI_RDO(can, dataWord) );
-   CHECK( saveOutput_MuCTPI_RDO(can, std::move(dataWord)) );
-
-   return StatusCode::SUCCESS;
-}
-
-/**
- * This is a new execute() function. It reads the MuCTPI_RDO object from an RDO file, it
- * converts the muon data words back into the input format of the MuCTPI, then runs the
- * MuCTPI information with this transformed input.
- */
-StatusCode
-LVL1MUCTPI::L1Muctpi::executeFromRDO()
-{
-   ATH_MSG_DEBUG( "in executeFromRDO()" );
-
-   // Retrieve the MuCTPI_RDO object from the digitized file:
-   const MuCTPI_RDO* old_RDO = 0;
-   CHECK( evtStore()->retrieve( old_RDO, m_rdoLocId ) );
-   ATH_MSG_DEBUG( "Retrieved MuCTPI_RDO object from StoreGate" );
-
-   // Get the BCID of the collision:
-   const unsigned int bcid = ( ( old_RDO->candidateMultiplicity() >> 18 ) & 0x7 );
-
-   // Create the input to the MuCTPI:
-   LVL1MUONIF::Lvl1MuCTPIInput convertedInput;
-   CHECK( Converter::convertRDO( old_RDO->dataWord(), bcid, &convertedInput ) );
-
-   // process the input with the MuCTPI simulation
-   m_theMuctpi->processData( &convertedInput );
-
-   // Save the output of the simulation
-   CHECK( saveOutput() );
-
-   uint32_t can;
-   std::vector< uint32_t > dataWord;
-   CHECK( updateMuCTPI_RDO(can, dataWord) );
-   CHECK( saveOutput_MuCTPI_RDO(can, std::move(dataWord)) );
-
-   return StatusCode::SUCCESS;
-}
-
-
-StatusCode
-LVL1MUCTPI::L1Muctpi::validate( const std::vector< TrigConf::TriggerThreshold* > &
-                                thresholds ) const
-{
-   //
-   // Check that it's not a null-pointer:
-   //
-   //       if( ! thresholds ) {
-   //          REPORT_ERROR( StatusCode::FAILURE )
-   //             << "No muon threshold vector given for validation!";
-   //          return StatusCode::FAILURE;
-   //       }
-
-   //
-   // Check that there are 6 thresholds:
-   //
-   if( thresholds.size() != 6 ) {
-      REPORT_ERROR( StatusCode::FAILURE )
-         << thresholds.size() << " muon thresholds defined";
-      REPORT_ERROR( StatusCode::FAILURE )
-         << "There have to be exactly 6 threshold defined!";
-      return StatusCode::FAILURE;
-   }
-
-   //
-   // Check that they are all muon thresholds:
-   //
-   for( TrigConf::TriggerThreshold* thr : thresholds ) {
-      if( ( thr->cableName() != "MU" && thr->cableName() != "MUCTPI" ) || ( thr->type() != "MUON" ) ) {
-         REPORT_ERROR( StatusCode::FAILURE )
-            << "There is a non-muon threshold in the LVL1 muon configuration!";
-         return StatusCode::FAILURE;
-      }
-   }
-
-   //
-   // Check that they're all on the same cable:
-   //
-   const std::string ctpin     = thresholds.at( 0 )->cableCtpin();
-   const std::string connector = thresholds.at( 0 )->cableConnector();
-   for( const TrigConf::TriggerThreshold * thr : thresholds ) {
-      if( ( thr->cableCtpin() != ctpin ) || ( thr->cableConnector() != connector ) ) {
-         REPORT_ERROR( StatusCode::FAILURE )
-            << "The muon thresholds are not all configured on the same cable!";
-         return StatusCode::FAILURE;
-      }
-   }
-
-   //
-   // Check that they are configured on the correct wires:
-   //
-   unsigned int mask = 0;
-   for( TrigConf::TriggerThreshold* thr : thresholds ) {
-      if( ( thr->cableEnd() - thr->cableStart() ) != 2 ) {
-         REPORT_ERROR( StatusCode::FAILURE )
-            << "A muon threshold is not 3 bit wide in the configuration!";
-         return StatusCode::FAILURE;
-      }
-      mask |= ( static_cast< unsigned int >( pow( 2, thr->cableEnd() - thr->cableStart() + 1 ) - 1 ) << thr->cableStart() );
-   }
-   if( mask != 0x7fffe ) {
-      REPORT_ERROR( StatusCode::FAILURE )
-         << "The muon thresholds don't cover the correct bits on the cable";
-      return StatusCode::FAILURE;
-   }
-
-   return StatusCode::SUCCESS;
-}
-
-/**
- * In order to handle multiple BCID per event, the RDO object needs to be saved only after
- * all BCID offsets have been processed. This function will update the data word that will
- * go to the RDO, but won't save the RDO to storegate yet.
- */
-StatusCode
-LVL1MUCTPI::L1Muctpi::updateMuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord)
-{
-   const std::list< unsigned int >& daqData = m_theMuctpi->getDAQData();
-    
-   const int HEADER_SIZE = 9;
-   const int STATUSandTAILER_SIZE = 2 + 3;
-    
-   // size check
-   // payload should contain at least 1 data (Candidate Multiplicity)
-   int payloadSize = daqData.size() - HEADER_SIZE - STATUSandTAILER_SIZE;
-   if( payloadSize < 1 ) {
-      REPORT_ERROR( StatusCode::FAILURE )
-         << "MIROD didn't provide correct DAQ data";
-      return StatusCode::FAILURE;
-   }
-    
-   // skip header part
-   std::list< unsigned int >::const_iterator itDAQ = daqData.begin();
-   for( int iHead = 0; iHead < HEADER_SIZE; ++iHead ) {
-      ++itDAQ;
-   }
-    
-   // candidate multiplicity
-   can = *itDAQ;
-   ++itDAQ;
-    
-   // data word
-   //std::vector< uint32_t > dataWord;
-   for( int iData = 1; iData < payloadSize; ++iData, ++itDAQ ) {
-      dataWord.push_back( *itDAQ );
-   }
-
-   return StatusCode::SUCCESS;
-}
-
-
-/**
- * Here we save the actual RDO, after all BCID offsets have been processed
- */
-StatusCode
-LVL1MUCTPI::L1Muctpi::saveOutput_MuCTPI_RDO(uint32_t& can, std::vector< uint32_t >&& dataWord)
-{
-   if(!m_rdoOutputLocId.empty()){
-      MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, std::move(dataWord) );
-      auto rdoHandle = SG::makeHandle(m_rdoOutputLocId);
-      ATH_CHECK(rdoHandle.record(std::unique_ptr<MuCTPI_RDO>(muCTPI_RDO)));
-      ATH_MSG_DEBUG( "MuCTPI_RDO object recorded with key: "
-                     << m_rdoOutputLocId.key() );
-   }
-   return StatusCode::SUCCESS;
-}
-
-
-/**
- * This function is used by all the different execute functions to save the output
- * of the MuCTPI simulation into various objects in StoreGate.
- */
-StatusCode
-LVL1MUCTPI::L1Muctpi::saveOutput(int bcidOffset)
-{     
-   /// the standart processing is done for the central slice, with no Bcid offset
-   if (bcidOffset == 0 ) {
-
-      // write the CTP result in interface object and put to StoreGate
-      auto obj = std::make_unique<LVL1::MuCTPICTP>( m_theMuctpi->getCTPData() );
-      ATH_CHECK( SG::makeHandle( m_muctpi2CtpKey ).record( std::move(obj) ) );
-      ATH_MSG_DEBUG( "CTP word recorded " << m_muctpi2CtpKey );
-
-
-      // store RoIB result in interface object and put to StoreGate
-      std::list< unsigned int > resultForRoIB = m_theMuctpi->getRoIBData();
-      std::vector< unsigned int > roibResultVector;
-
-      std::list< unsigned int >::iterator roib_itr = resultForRoIB.begin();
-      std::list< unsigned int >::iterator roib_end = resultForRoIB.end();
-      for( ; roib_itr != roib_end; ++roib_itr ) {
-         roibResultVector.push_back( *roib_itr );
-      }
-
-      // L1MUINT::MuCTPIToRoIBSLink* theRoIBResult =
-      //   new L1MUINT::MuCTPIToRoIBSLink( roibResultVector );
-
-      auto roibWriteHandle = SG::makeHandle( m_muctpi2RoibKey );
-      ATH_CHECK( roibWriteHandle.record( std::make_unique<L1MUINT::MuCTPIToRoIBSLink>( roibResultVector ) ) );
-
-      // CHECK( evtStore()->record( theRoIBResult, m_roiOutputLocId ) );
-      //ATH_MSG_DEBUG( "RoIB result recorded to StoreGate with key: "
-      //               << m_muctpi2RoibKey );
-
-      //construct muctpi nim words (for MUE and MUB items)
-      unsigned int cw1=0;
-      if( m_doNimOutput ) {
-         if(m_theMuctpi->hasBarrelCandidate()){
-            unsigned int nimBarrelBitMask = 1<<m_nimBarrelBit;
-            cw1|=nimBarrelBitMask;
-         }
-         if(m_theMuctpi->hasEndcapCandidate()){
-            unsigned int nimEndcapBitMask = 1<<m_nimEndcapBit;
-            cw1|=nimEndcapBitMask;
-         }
-
-         // Construct and save NimCTP object
-         auto nim = SG::makeHandle(m_nimctpKey);
-         CHECK(nim.record(std::make_unique<LVL1::NimCTP>(0, cw1, 0)));
-      }
-
-      // get outputs for L1Topo and store into Storegate
-      ATH_MSG_DEBUG("Getting the output for L1Topo");
-      LVL1::MuCTPIL1Topo l1topoCandidates = m_theMuctpi->getL1TopoData();
-      auto l1topo = SG::makeHandle(m_topoOutputLocId);
-      CHECK(l1topo.record(std::make_unique<LVL1::MuCTPIL1Topo>(l1topoCandidates.getCandidates())));
-      //      std::cout << "TW: ALG central slice: offset: " <<  bcidOffset << "  location: " << m_l1topoOutputLocId << std::endl;
-      //      l1topo->print();
-   }
-
-   /// if we have a bcid offset, then just get the topo output and put it on storegate
-   if (bcidOffset  != 0) {
-      auto getHandleKey = [this](const int bcidOffset) -> SG::WriteHandleKey<LVL1::MuCTPIL1Topo>* {
-         for (SG::VarHandleKey* key : m_topoOutputOffsetLocId.keys()) {
-            if (key->key() == m_topoOutputLocId.key()+std::to_string(bcidOffset)) {
-               return dynamic_cast<SG::WriteHandleKey<LVL1::MuCTPIL1Topo>*>(key);
-            }
-         }
-         return nullptr;
-      };
-      ATH_MSG_DEBUG("Getting the output for L1Topo for BCID slice");
-      LVL1::MuCTPIL1Topo l1topoCandidatesBC = m_theMuctpi->getL1TopoData();
-      auto l1topoBC = SG::makeHandle(*getHandleKey(bcidOffset));
-      CHECK(l1topoBC.record(std::make_unique<LVL1::MuCTPIL1Topo>(l1topoCandidatesBC.getCandidates())));
-      l1topoBC->setBcidOffset(bcidOffset);
-      // std::cout << "TW: slice: offset: " <<  bcidOffset << "  location: " 
-      //		<< m_l1topoOutputLocId+std::to_string(bcidOffset) << std::endl;
-      // l1topoBC->print();
-   }
-   return StatusCode::SUCCESS;
-}
-
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h
deleted file mode 100644
index ac432a79f5e6..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h
+++ /dev/null
@@ -1,176 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: L1Muctpi.h 681356 2015-07-08 12:17:52Z wengler $
-#ifndef TRIGT1MUCTPI_L1MUCTPI_H
-#define TRIGT1MUCTPI_L1MUCTPI_H
-
-// STL include(s):
-#include <string>
-
-// Athena/Gaudi include(s):
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/IIncidentListener.h"
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "TrigT1Interfaces/MuCTPICTP.h"
-#include "TrigT1Interfaces/TrigT1StoreGateKeys.h"
-#include "TrigT1Interfaces/MuCTPIToRoIBSLink.h"
-#include "StoreGate/ReadHandleKey.h"
-#include "StoreGate/WriteHandleKey.h"
-#include "TrigT1Result/MuCTPI_RDO.h"
-#include "TrigT1Interfaces/Lvl1MuCTPIInput.h"
-#include "TrigT1Interfaces/MuCTPIL1Topo.h"
-#include "TrigT1Interfaces/NimCTP.h"
-
-// Forward declaration(s):
-namespace TrigConf {
-   class ILVL1ConfigSvc;
-   class TriggerThreshold;
-}
-
-/// Namespace for the MuCTPI simulation
-/**
-* This namespace should contain all classes, functions, enumerations, ... which are
-* used in the MuCTPI simulation.
-*/
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class MuctpiSim;
-
-   /**
-    *   $Date: 2015-07-08 14:17:52 +0200 (Wed, 08 Jul 2015) $
-    *
-    *   @short Main Athena algorithm of the MuCTPI simulation
-    *
-    *          The algorithm reads the MuCTPI's configuration from the DetectorStore
-    *          put there by TrigT1Config, and configures the MuCTPI simulation with it.
-    *          For each event it reads the output of the RPC and TGC detector simulations,
-    *          and uses them as an input to the MuCTPI simulation. It produces a readout
-    *          object (MuCTPI_RDO), an RoI object (ROIB::MuCTPIResult) and the object
-    *          sent to the CTP (LVL1::MuCTPICTP).
-    *
-    *     @see MuctpiSim
-    *     @see LVL1MUONIF::Lvl1MuCTPIInput
-    *     @see MuCTPI_RDO
-    *     @see ROIB::MuCTPIResult
-    *     @see LVL1::MuCTPICTP
-    *
-    *  @author $Author: krasznaa $
-    * @version $Revision: 681356 $
-    *
-    */
-  class L1Muctpi : public extends<AthAlgorithm, IIncidentListener> {
-
-   public:
-      /// Regular Gaudi algorithm constructor
-      L1Muctpi( const std::string& name, ISvcLocator* pSvcLocator );
-      /// A destructor for actually cleaning up
-      virtual ~L1Muctpi();
-
-      /// Regular Gaudi algorithm initialization function
-      virtual StatusCode initialize() override;
-      /// Regular Gaudi algorithm finalization function
-      virtual StatusCode finalize() override;
-      /// Regular Gaudi algorithm execute function
-      virtual StatusCode execute() override;
-      virtual void handle(const Incident&) override;
-
-   private:
-      /// handles beginRun
-      StatusCode loadFixedConditions();  
-      /// Event loop method for running as part of digitization
-      StatusCode executeFromDigi();
-      /// Event loop method for running on an AOD file
-      StatusCode executeFromAOD();
-      /// Event loop method for running on an RDO file
-      StatusCode executeFromRDO();
-      /// Validate the muon threshold configuration
-      StatusCode validate( const std::vector< TrigConf::TriggerThreshold* >& thresholds ) const;
-      /// Update the data word for the RDO object
-      StatusCode updateMuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord);
-      /// Save the MuCTPI RDO object
-      StatusCode saveOutput_MuCTPI_RDO(uint32_t& can, std::vector< uint32_t >&& dataWord);
-      /// Save the outputs of the simulation into StoreGate
-      StatusCode saveOutput(int bcidOffset = 0);
-
-      /// The LVL1 configuration service
-      ServiceHandle< TrigConf::ILVL1ConfigSvc > m_configSvc;
-
-      /// The simulation top level object
-      MuctpiSim* m_theMuctpi;
-
-      /// The BCID slices to be checked in addition to the central one in the input objects from Digi
-      std::vector<int> m_bcidOffsetList = {-2,-1,1,2};
-
-      // Locations of the inputs and outputs of the simulation in StoreGate:
-      static const std::string m_DEFAULT_L1MuctpiStoreLocationRPC;
-      static const std::string m_DEFAULT_L1MuctpiStoreLocationTGC;
-      static const std::string m_DEFAULT_AODLocID;
-      static const std::string m_DEFAULT_RDOLocID;
-
-
-      SG::ReadHandleKey<LVL1MUONIF::Lvl1MuCTPIInput>  m_rpcInputKey{ this, "RPCLocID", "L1MuctpiStoreRPC", "Input from RPC" };
-      SG::ReadHandleKey<LVL1MUONIF::Lvl1MuCTPIInput>  m_tgcInputKey{ this, "TGCLocID", "L1MuctpiStoreTGC", "Input from TGC" };
-      
-     SG::WriteHandleKey<LVL1::MuCTPICTP> m_muctpi2CtpKey { this, "CTPOutputLocID", LVL1MUCTPI::DEFAULT_MuonCTPLocation, "Output to CTPO" };
-     SG::WriteHandleKey<MuCTPI_RDO> m_rdoOutputLocId{this, "RDOOutputLocID", "MUCTPI_RDO", "Location of MUCTPI RDOs"};
-     SG::WriteHandleKey<L1MUINT::MuCTPIToRoIBSLink> m_muctpi2RoibKey { this, "MuCTPISLinkLocation", LVL1MUCTPI::DEFAULT_MuonRoIBLocation, "StoreGate location for outpput to RoIBuilder" };
-     SG::WriteHandleKey<LVL1::NimCTP> m_nimctpKey { this, "NIMOutputLocID", LVL1::DEFAULT_NimCTPLocation, "StoreGate location for output LVL1::NimCTP" };
-     SG::WriteHandleKey<LVL1::MuCTPIL1Topo> m_topoOutputLocId{this, "L1TopoOutputLocID", LVL1MUCTPI::DEFAULT_MuonL1TopoLocation, "Output to L1Topo"};
-     SG::WriteHandleKeyArray<LVL1::MuCTPIL1Topo> m_topoOutputOffsetLocId{this, "L1TopoOutputOffsetLocID",
-        {  // Corresponds to m_bcidOffsetList
-           LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"-2",
-           LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"-1",
-           LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"1",
-           LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"2"
-        },
-        "Output to L1Topo for offset BCIDs"};
-
-
-      // These properties control the way the overlap handling functions:
-      std::string m_overlapStrategyName;
-      std::string m_lutXMLFile;
-      std::string m_runPeriod;
-      bool m_flagMode;
-
-     // These properties control the way the outputs for the L1Topo are generated
-     std::string m_geometryXMLFile;
-
-      // These properties control how the multiplicity summation happens:
-      std::string m_multiplicityStrategyName;
-      std::string m_multiplicityXMLFile;
-
-      // Property for the input selection, and the locations of the various
-      // input and output objects:
-      std::string m_inputSource;
-      std::string m_aodLocId;
-      std::string m_rdoLocId;
-      // std::string m_roiOutputLocId;
-      // std::string m_tgcLocId;
-      // std::string m_rpcLocId;
-
-
-
-      /// Property telling if the LUTs should be printed:
-      bool m_dumpLut;
-
-      /// Property telling if input file is data or simulation 
-      bool m_IsData;           
-
-      // Properties controlling the NIM outputs provided by the simulation
-      bool m_doNimOutput;
-      unsigned int m_nimBarrelBit;
-      unsigned int m_nimEndcapBit;
-      
-      /// Function pointer to the execute function we want to use:
-      StatusCode ( LVL1MUCTPI::L1Muctpi::*m_executeFunction )( void );
-
-   }; // class L1Muctpi
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_L1MUCTPI_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.cxx
deleted file mode 100644
index 55d8bc366663..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.cxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: L1MuctpiPatGen.cxx 441850 2011-06-06 14:50:52Z krasznaa $
-
-// Gaudi/Athena include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// TrigT1 include(s):
-#include "TrigT1Interfaces/Lvl1MuCTPIInput.h"
-
-// Local include(s):
-#include "L1MuctpiPatGen.h"
-#include "../Common/GenTestPattern.h"
-
-namespace LVL1MUCTPI {
-
-   static const std::string DEFAULT_L1MuctpiStoreLocationRPC = "L1MuctpiStoreRPC";
-   static const std::string DEFAULT_L1MuctpiStoreLocationTGC = "L1MuctpiStoreTGC";
-
-   //--------------
-   // Constructor
-   //--------------
-   L1MuctpiPatGen::L1MuctpiPatGen( const std::string& name, ISvcLocator* pSvcLocator )
-      : AthAlgorithm( name, pSvcLocator ) {
-
-   }
-
-   //----------------------------------------------
-   // execute() method called once per event
-   //----------------------------------------------
-   StatusCode L1MuctpiPatGen::execute( ) {
-
-      ATH_MSG_DEBUG( "===================================" );
-      ATH_MSG_DEBUG( "Executing L1MuctpiPatGen algorithm." );
-      ATH_MSG_DEBUG( "===================================" );
-
-      // Instantiate the Lvl1MuCTPIInput object which will serve
-      // as the event source
-      LVL1MUONIF::Lvl1MuCTPIInput* ctpiInRPC = new LVL1MUONIF::Lvl1MuCTPIInput;
-      LVL1MUONIF::Lvl1MuCTPIInput* ctpiInTGC = new LVL1MUONIF::Lvl1MuCTPIInput;
-
-      // make 2 GenTestPattern objects (RPC and TGC), and pass a
-      // Lvl1MuCTPIInput object to their constructors and re-seed the
-      // generator to get different events
-
-
-      ctpiInRPC->setSectorLogicData( 0x01d80104, LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(),
-                                     LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), 0 );
-      ctpiInRPC->setSectorLogicData( 0x01d00104, LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(),
-                                     LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), 1 );
-
-      /*
-      ctpiInTGC->setSectorLogicData( 0x01d00006, LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(),
-                                     LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), 47 );
-      ctpiInTGC->setSectorLogicData( 0x01d80006, LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(),
-                                     LVL1MUONIF::Lvl1MuCTPIInput::idSideC(), 0 );
-
-      ctpiInTGC->setSectorLogicData( 0x01d00008, LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(),
-                                     LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), 6 );
-      ctpiInTGC->setSectorLogicData( 0x01d80008, LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(),
-                                     LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), 7 );
-
-      ctpiInRPC->setSectorLogicData( 0x01d0002e, LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(),
-                                     LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), 30 );
-      ctpiInTGC->setSectorLogicData( 0x01c80000, LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(),
-                                     LVL1MUONIF::Lvl1MuCTPIInput::idSideA(), 47 );
-      */
-
-      /*
-      GenTestPattern genPatRPC( ctpiInRPC );
-      GenTestPattern genPatTGC( ctpiInTGC );
-      //  seed = seed + 7;
-      // genPat.reSeedRandomNumbers(seed);
-
-      // restrict generation to RPCs and TGCs respectively
-      genPatRPC.rndRange().allowSystems( 1 );
-      genPatTGC.rndRange().allowSystems( 6 );
-
-      // fill the input objects from the test pattern generator
-      genPatRPC.generateEvent( 10, 20 );
-      genPatRPC.printRandomEvent();
-
-      genPatTGC.generateEvent( 10, 20 );
-      genPatTGC.printRandomEvent();
-      */
-
-      // This puts the objects into StoreGate - need to give a pointer here
-      // the string is the tag to find it back in StoreGate - must be
-      // unique
-      CHECK( evtStore()->record( ctpiInRPC, DEFAULT_L1MuctpiStoreLocationRPC ) );
-      ATH_MSG_DEBUG( "put RPC Lvl1MuCTPIInput into SG" );
-
-      CHECK( evtStore()->record( ctpiInTGC, DEFAULT_L1MuctpiStoreLocationTGC ) );
-      ATH_MSG_DEBUG( "put TGC Lvl1MuCTPIInput into SG" );
-
-      return StatusCode::SUCCESS;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.h
deleted file mode 100644
index 2ed6821a02a8..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiPatGen.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: L1MuctpiPatGen.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_L1MUCTPIPATGEN_H
-#define TRIGT1MUCTPI_L1MUCTPIPATGEN_H
-
-// Athena/Gaudi include(s):
-#include "AthenaBaseComps/AthAlgorithm.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    *   $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-    *
-    *   @short Pattern generator for the MuCTPI simulation
-    *
-    *          This algorithm can be used to test the functioning of the MuCTPI simulation in
-    *          a stand-alone mode. (By stand-alone I mean inside Athena of course.)
-    *
-    *  @author $Author: krasznaa $
-    * @version $Revision: 362102 $
-    */
-   class L1MuctpiPatGen : public AthAlgorithm {
-
-   public:
-      /// Regular Gaudi algorithm constructor
-      L1MuctpiPatGen( const std::string& name, ISvcLocator* pSvcLocator );
-
-      /// Regular Gaudi execute function
-      virtual StatusCode execute();
-
-   }; // class L1MuctpiPatGen
-
-} // namespace LVL1MUCTPI
-
-#endif // end of TRIGT1MUCTPI_L1MUCTPIPATGEN_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.cxx
deleted file mode 100644
index 14563d6919f0..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: L1MuctpiTestReadResults.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// STL include(s):
-#include <iomanip>
-
-// Gaudi/Athena include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// TrigT1 include(s):
-#include "TrigT1Interfaces/MuCTPICTP.h"
-#include "TrigT1Interfaces/MuCTPIToRoIBSLink.h"
-
-// Local include(s):
-#include "L1MuctpiTestReadResults.h"
-
-namespace LVL1MUCTPI {
-
-  //--------------
-  // Constructor
-  //--------------
-   L1MuctpiTestReadResults::L1MuctpiTestReadResults( const std::string& name,
-                                                     ISvcLocator* pSvcLocator )
-      : AthAlgorithm( name, pSvcLocator ) {
-
-   }
-
-
-   //----------------------------------------------
-   // execute() method called once per event
-   //----------------------------------------------
-   StatusCode L1MuctpiTestReadResults::execute() {
-
-      ATH_MSG_DEBUG( "============================================" );
-      ATH_MSG_DEBUG( "Executing L1MuctpiTestReadResults algorithm." );
-      ATH_MSG_DEBUG( "============================================" );
-
-      // Get the CTP object from storegate and print
-      const LVL1::MuCTPICTP* dHandleCTPresult = 0;
-      CHECK( evtStore()->retrieve( dHandleCTPresult ) );
-      ATH_MSG_DEBUG( "got CTP result Ptr from SG" );
-
-      ATH_MSG_INFO( "The CTP word is: " << std::ios::hex
-                    << dHandleCTPresult->muCTPIWord() );
-
-      // Get the RoIB object from storegate and print
-      const L1MUINT::MuCTPIToRoIBSLink* dHandleRoIBresult = 0;
-      CHECK( evtStore()->retrieve( dHandleRoIBresult ) );
-      ATH_MSG_DEBUG( "got RoIB result Ptr from SG" );
-
-      std::vector< unsigned int >::const_iterator roibRes_itr =
-         dHandleRoIBresult->getMuCTPIToRoIBWords().begin();
-      std::vector< unsigned int >::const_iterator roibRes_end =
-         dHandleRoIBresult->getMuCTPIToRoIBWords().end();
-      for( ; roibRes_itr != roibRes_end; ++roibRes_itr ) {
-
-         ATH_MSG_INFO( "The RoIB result: " << std::ios::hex
-                       << ( *roibRes_itr ) );
-
-      }
-
-      return StatusCode::SUCCESS;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.h
deleted file mode 100644
index 61e852a4d178..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTestReadResults.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: L1MuctpiTestReadResults.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_L1MUCTPITESTREADRESULTS_H
-#define TRIGT1MUCTPI_L1MUCTPITESTREADRESULTS_H
-
-// Gaudi/Athena include(s):
-#include "AthenaBaseComps/AthAlgorithm.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    *   $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-    *
-    *   @short Tester for the MuCTPI simulation's output
-    *
-    *          This algorithm has little importance now. It reads back the objects
-    *          produced by the MuCTPI simulation from StoreGate, and confirms that
-    *          they are in fact there.
-    *
-    *  @author $Author: krasznaa $
-    * @version $Revision: 362102 $
-    */
-   class L1MuctpiTestReadResults : public AthAlgorithm {
-
-   public:
-      /// Regular Gaudi algorithm constructor
-      L1MuctpiTestReadResults( const std::string& name,
-                               ISvcLocator* pSvcLocator );
-
-      /// Regular Gaudi execute function
-      virtual StatusCode execute();
-
-   }; // class L1MuctpiTestReadResults
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_L1MUCTPITESTREADRESULTS_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx
deleted file mode 100644
index 2a6daa57d5cc..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx
+++ /dev/null
@@ -1,790 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-// STL include(s):
-#include <iostream>
-#include <sstream>
-
-// Gaudi/Athena include(s):
-#include "PathResolver/PathResolver.h"
-#include "AthenaKernel/errorcheck.h"
-
-// The AOD object that we may want to read as input
-#include "AnalysisTriggerEvent/LVL1_ROI.h"
-
-// The new trigger configuration
-#include "TrigConfInterfaces/ILVL1ConfigSvc.h"
-#include "TrigConfL1Data/Muctpi.h"
-#include "TrigConfL1Data/ThresholdConfig.h"
-#include "TrigConfL1Data/TriggerThreshold.h"
-
-// Interfaces used by the simulation
-#include "TrigT1Interfaces/Lvl1MuCTPIInput.h"
-#include "TrigT1Interfaces/MuCTPICTP.h"
-#include "TrigT1Interfaces/MuCTPIToRoIBSLink.h"
-#include "TrigT1Interfaces/TrigT1StoreGateKeys.h"
-#include "TrigT1Interfaces/NimCTP.h"
-
-// The output object of the simulation
-#include "TrigT1Result/MuCTPI_RDO.h"
-#include "TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h"
-#include "TrigT1Result/MuCTPI_DataWord_Decoder.h"
-
-// Inlcudes for the MuCTPI simulation
-#include "../Algorithms/L1MuctpiTool.h"
-#include "../Common/MuctpiSim.h"
-#include "../Common/Configuration.h"
-#include "../Logging/MsgWriter.h"
-#include "../Mioct/StrategyName.h"
-#include "../Common/Converter.h"
-
-
-#include "TrigT1Result/MuCTPIRoI.h"
-#include "TrigT1Result/RoIBResult.h"
-#include "TrigT1Result/Header.h"
-#include "TrigT1Result/Trailer.h"
-
-
-namespace LVL1MUCTPI {
-
-  // Set the default StoreGate locations of input and output objects:
-  const std::string L1MuctpiTool::m_DEFAULT_L1MuctpiStoreLocationRPC = "L1MuctpiStoreRPC";
-  const std::string L1MuctpiTool::m_DEFAULT_L1MuctpiStoreLocationTGC = "L1MuctpiStoreTGC";
-  const std::string L1MuctpiTool::m_DEFAULT_AODLocID                 = "LVL1_ROI";
-  const std::string L1MuctpiTool::m_DEFAULT_RDOLocID                 = "MUCTPI_RDO";
-
-  //--------------
-  // Constructor
-  //--------------
-  L1MuctpiTool::L1MuctpiTool(const std::string& type, const std::string& name, 
-			 const IInterface* parent ):
-    base_class(type, name, parent),
-      m_configSvc( "TrigConf::TrigConfigSvc/TrigConfigSvc", name ),
-      m_theMuctpi( 0 ), m_executeFunction(nullptr)  {
-
-
-    // Init message
-    ATH_MSG_INFO( "=======================================" );
-    ATH_MSG_INFO( "Constructor for L1MuctpiTool."  );
-    ATH_MSG_INFO( "=======================================" );
-
-    // Declare the service handles as properties:
-    declareProperty( "LVL1ConfigSvc", m_configSvc, "LVL1 Config Service" );
-
-    // Declare the properties of the overlap treatment:
-    declareProperty( "OverlapStrategyName", m_overlapStrategyName = "NULL" );
-    declareProperty( "LUTXMLFile", m_lutXMLFile = "" );
-    declareProperty( "RunPeriod", m_runPeriod = "RUN1" );
-    declareProperty( "FlaggingMode", m_flagMode = false );
-
-    // Declare the properties of the output generation for L1Topo:
-    declareProperty( "GeometryXMLFile", m_geometryXMLFile = "" );
-       
-    // Declare the properties for the multiplicity summation:
-    declareProperty( "MultiplicityStrategyName", m_multiplicityStrategyName = "INCLUSIVE" );
-    declareProperty( "MultiplicityXMLFile", m_multiplicityXMLFile = "" );
-
-    // Declare the properties of the input selection:
-    declareProperty( "InputSource", m_inputSource = "DIGITIZATION" );
-    declareProperty( "AODLocID", m_aodLocId = m_DEFAULT_AODLocID );
-    declareProperty( "RDOLocID", m_rdoLocId = m_DEFAULT_RDOLocID );
-    //    declareProperty( "RDOOutputLocID", m_rdoOutputLocId = m_DEFAULT_RDOLocID );
-    //    declareProperty( "RoIOutputLocID", m_roiOutputLocId = m_DEFAULT_locationMuCTPItoRoIB );
-    // declareProperty( "CTPOutputLocID", m_ctpOutputLocId = m_DEFAULT_locationMuCTPItoCTP );
-    // declareProperty( "L1TopoOutputLocID", m_l1topoOutputLocId = m_DEFAULT_locationMuCTPItoL1Topo );
-    // These are just here for flexibility, normally they should not be changed:
-    declareProperty( "TGCLocID", m_tgcLocId = m_DEFAULT_L1MuctpiStoreLocationTGC );
-    declareProperty( "RPCLocID", m_rpcLocId = m_DEFAULT_L1MuctpiStoreLocationRPC );
-    // The LUTs can be huge, so the default is to turn their printing off:
-    declareProperty( "DumpLUT", m_dumpLut = false );
-   
-    // Allow rerunning of simulation on data
-    declareProperty( "IsData", m_IsData = false, "Rerun simulation on data" );  
- 
-    // Declare the properties of the NIM output creation:
-    declareProperty( "DoNIMOutput", m_doNimOutput = false );
-    declareProperty( "NIMOutputLocID", m_nimOutputLocId = LVL1::DEFAULT_NimCTPLocation );
-    declareProperty( "NIMBarrelBit", m_nimBarrelBit = 0,
-		     "Bit on the NIM input of the CTP, showing that there was at least "
-		     "one barrel candidate in the event" );
-    declareProperty( "NIMEndcapBit", m_nimEndcapBit = 1,
-		     "Bit on the NIM input of the CTP, showing that there was at least "
-		     "one endcap candidate in the event" );
-
-    declareProperty( "ROIBResultLocation", m_roibLocation=ROIB::DEFAULT_RoIBRDOLocation, "Storegate key for the reading the ROIBResult" );
- 
-  }
-
-  //--------------
-  // Destructor
-  //--------------
-  L1MuctpiTool::~L1MuctpiTool() {
-
-    ATH_MSG_DEBUG( "L1Muctpi destructor called" );
-    if( m_theMuctpi ) delete m_theMuctpi;
-  }
-
-  /**
-   * Initialisation of the algorithm. This is where the MuCTPI simulation object gets created,
-   * the look up table is loaded for overlap handling between the muon sectors and the MuCTPI
-   * configuration is read from LVL1ConfigSvc. Also m_executeFunction gets set up to point to
-   * the execute function we have selected in the jobOptions.
-   */
-  StatusCode L1MuctpiTool::initialize() {
-
-    // Now this is a tricky part. We have to force the message logging of the
-    // MuCTPI simulation to display messages of the same level as this MsgStream.
-    MsgWriter::instance()->setMinType( msg().level() );
-    MsgWriter::instance()->setSource( name() );
-
-    // Create the MuCTPI simulation:
-    m_theMuctpi = new MuctpiSim();
-
-    //
-    // Set up the overlap handling of the simulation:
-    //
-    if( m_overlapStrategyName == "NULL" ) {
-
-      ATH_MSG_DEBUG( "Setting overlap strategy: \"NULL\"" );
-      m_theMuctpi->setOverlapStrategy( NO_OVERLAP );
-
-    } else if( m_overlapStrategyName == "LUT" ) {
-
-      ATH_MSG_DEBUG( "Setting overlap strategy: \"LUT\"" );
-      m_theMuctpi->setOverlapStrategy( LUT_OVERLAP );
-
-      if( m_flagMode ) {
-	ATH_MSG_INFO( "Using 'flagging mode' in the overlap handling" );
-      }
-
-      ATH_MSG_INFO( "XML LUT file defined in jobO: " << m_lutXMLFile << " with a RunPeriod=" << m_runPeriod );
-      const std::string fullFileName = PathResolverFindCalibFile( m_lutXMLFile );
-      ATH_MSG_DEBUG( "Full path to XML LUT file: " << fullFileName );
-      CHECK( m_theMuctpi->initializeLUTOverlapStrategy( fullFileName, m_flagMode,
-							m_dumpLut, m_runPeriod ) );
-
-    } else {
-
-      REPORT_ERROR( StatusCode::FAILURE )
-	<< "Wrong overlap strategy name specified: \""
-	<< m_overlapStrategyName << "\"";
-      return StatusCode::FAILURE;
-
-    }
-
-    //
-    // Set up the handling of the outputs for L1Topo
-    //
-      
-    ATH_MSG_INFO( "Geometry XML file defined in jobO: " << m_geometryXMLFile );
-    const std::string fullGeometryFileName = PathResolverFindCalibFile( m_geometryXMLFile );
-    ATH_MSG_INFO( "Full path to Geometry XML file: " << fullGeometryFileName );
-
-    m_theMuctpi->setupL1TopoConverter(fullGeometryFileName);
-
-    //
-    // Set the multiplicity summation style of the simulation:
-    //
-    if( m_multiplicityStrategyName == "INCLUSIVE" ) {
-
-      ATH_MSG_DEBUG( "Setting INCLUSIVE multiplicity summation" );
-      m_theMuctpi->setMultiplicityStrategy( INCLUSIVE );
-
-    } else if( m_multiplicityStrategyName == "EXCLUSIVE" ) {
-
-      ATH_MSG_DEBUG( "Setting EXCLUSIVE multiplicity summation" );
-      m_theMuctpi->setMultiplicityStrategy( EXCLUSIVE );
-
-    } else if( m_multiplicityStrategyName == "XML" ) {
-
-      ATH_MSG_DEBUG( "Setting XML multiplicity summation" );
-      m_theMuctpi->setMultiplicityStrategy( XML );
-
-      ATH_MSG_INFO( "XML multiplicity file defined in jobO: "
-                    << m_multiplicityXMLFile );
-      const std::string packagePrefix = "TrigT1Muctpi/";
-      const std::string fullFileName = PathResolverFindCalibFile( packagePrefix +
-                                                                  m_multiplicityXMLFile );
-      ATH_MSG_DEBUG( " Full path to XML file: " << fullFileName );
-      m_theMuctpi->initializeXMLMultStrategy( fullFileName );
-
-    } else {
-
-      REPORT_ERROR( StatusCode::FAILURE )
-	<< "Wring multiplicity summation type specified: \""
-	<< m_multiplicityStrategyName << "\"";
-      return StatusCode::FAILURE;
-
-    }
-
-    //
-    // Set up the input source, and running conditions:
-    //
-    if( m_inputSource == "DIGITIZATION" ) {
-
-      ATH_MSG_INFO( "Setting input source to digitization" );
-      m_executeFunction = &L1MuctpiTool::executeFromDigi;
-
-    } else if( m_inputSource == "AOD" ) {
-
-      ATH_MSG_INFO( "Setting input source to AOD" );
-      m_executeFunction = &L1MuctpiTool::executeFromAOD;
-
-    } else if( m_inputSource == "RDO" ) {
-
-      ATH_MSG_INFO( "Setting input source to RDO" );
-      m_executeFunction = &L1MuctpiTool::executeFromRDO;
-
-    } else {
-
-      REPORT_ERROR( StatusCode::FAILURE )
-	<< "Wrong input source specified: \"" << m_inputSource
-	<< "\"";
-      return StatusCode::FAILURE;
-
-    }
-
-    //
-    // Give feedback about the NIM output creation:
-    //
-    if( m_doNimOutput ) {
-      ATH_MSG_INFO( "NIM output for CTP will be created" );
-      ATH_MSG_DEBUG( "SG key for the NIM object will be: "
-		     << m_nimOutputLocId );
-      // A small sanity check:
-      if( m_nimBarrelBit == m_nimEndcapBit ) {
-	REPORT_ERROR( StatusCode::FAILURE )
-	  << "The barrel and endcap NIM output bits are set to end up on the "
-	  << "same bit (" << m_nimBarrelBit << ")";
-	return StatusCode::FAILURE;
-      }
-      ATH_MSG_DEBUG( "Position for the barrel NIM bit: " << m_nimBarrelBit );
-      ATH_MSG_DEBUG( "Position for the endcap NIM bit: " << m_nimEndcapBit );
-    } else {
-      ATH_MSG_INFO( "NIM output for CTP will *not* be created" );
-    }
-
-    ATH_MSG_INFO( "Retrieving trigger config service" << m_configSvc );
-    CHECK(m_configSvc.retrieve());
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode L1MuctpiTool::start( ) {
-
-    // Init message
-    ATH_MSG_INFO( "=======================================" );
-    ATH_MSG_INFO( "Start for L1MuctpiTool."  );
-    ATH_MSG_INFO( "=======================================" );
-
-    Configuration muctpiConfiguration;
-    // Connect to the LVL1 configuration service (create it if it doesn't exist):
-    if(!m_IsData){
-      // convert MuCTPI config to Configuration
-      muctpiConfiguration.setThreshold1Candidate( m_configSvc->muctpiConfig()->lowptThreshold() );
-      muctpiConfiguration.setThreshold2Candidate( m_configSvc->muctpiConfig()->highptThreshold() );
-      muctpiConfiguration.setMaxCandSendToRoib( m_configSvc->muctpiConfig()->maxCand() );
-    }
-      
-    //if running on data, hard code muctpi configuration
-    else{
-      muctpiConfiguration.setThreshold1Candidate( 1 );
-      muctpiConfiguration.setThreshold2Candidate( 1 );
-      muctpiConfiguration.setMaxCandSendToRoib( 64 );
-    }
-
-    // set Configuration
-    m_theMuctpi->setConfiguration( muctpiConfiguration );
-
-    ATH_MSG_INFO( "The Muctpi has been configured ->"
-		  << " 1stThr:" << muctpiConfiguration.getThreshold1Candidate()
-		  << " 2ndThr:" << muctpiConfiguration.getThreshold2Candidate()
-		  << " MaximalCandCount:" << muctpiConfiguration.getMaxCandSendToRoib() );
-
-    StatusCode sc = validate( m_configSvc->thresholdConfig()->getThresholdVector(TrigConf::L1DataDef::MUON) );
-
-    if( sc.isFailure() ) {
-      REPORT_ERROR( StatusCode::FAILURE )
-	<< "LVL1 muon configuration failed sanity check";
-      REPORT_ERROR( StatusCode::FAILURE )
-	<< "See previous messages for more information";
-      REPORT_ERROR( StatusCode::FAILURE )
-	<< "The muon trigger results will not be reliable";
-      return sc;
-    } else {
-      ATH_MSG_DEBUG( "LVL1 muon configuration passed sanity check" );
-    }
-
-    return StatusCode::SUCCESS;
-  }
-
-
-  //---------------------------------
-  // finalize()
-  //---------------------------------
-  StatusCode L1MuctpiTool::finalize() {
-
-    // Now this is a tricky part. We have to force the message logging of the
-    // MuCTPI simulation to display messages of the same level as this MsgStream.
-    MsgWriter::instance()->setMinType( msg().level() );
-    MsgWriter::instance()->setSource( name() );
-
-    ATH_MSG_INFO( "===============================" );
-    ATH_MSG_INFO( "Finalizing L1Muctpi algorithm." );
-    ATH_MSG_INFO( "===============================" );
-
-    delete m_theMuctpi;
-    m_theMuctpi = 0;
-
-    return StatusCode::SUCCESS;
-  }
-
-
-  // this is the main execute function for the tool, it just picks form the original 
-  // algorithm code what to execute. This is essetnially the execute from RDO variant
-  // below without the saveOutput call, since we only want part of that routine.
-
-  StatusCode L1MuctpiTool::fillMuCTPIL1Topo(LVL1::MuCTPIL1Topo& l1topoCandidates, int bcidOffset) const {
-    ATH_MSG_DEBUG( "in fillMuCTPIL1Topo()" );
-    
-    // Retrieve the MuCTPIToRoIBSLink or RoIBResult object from storegate:
-    const ROIB::RoIBResult* roibResult {nullptr};
-    const L1MUINT::MuCTPIToRoIBSLink* muctpi_slink {nullptr};
-    const MuCTPI_RDO* muctpiRDO = {nullptr};
-    
-    if(bcidOffset==0) {      
-      if( evtStore()->contains<L1MUINT::MuCTPIToRoIBSLink>( m_roiOutputLocId) ) {
-	CHECK( evtStore()->retrieve( muctpi_slink,  m_roiOutputLocId) );
-      } else if( evtStore()->contains<ROIB::RoIBResult>(m_roibLocation) ) {
-	CHECK( evtStore()->retrieve(roibResult, m_roibLocation) );
-      } else {
-	ATH_MSG_WARNING("Neither a MuCTPIToRoIBSLink with SG key '/Run/L1MuCTPItoRoIBLocation' nor a an RoIBResult were found in the event.");
-	return StatusCode::RECOVERABLE;
-      }
-    }else{
-      CHECK( evtStore()->retrieve( muctpiRDO, m_rdoLocId ) );
-      ATH_MSG_DEBUG( "Retrieved MuCTPI_RDO object from StoreGate" );
-    }
-    
-    // Convert output of MUCTPi to input
-    LVL1MUONIF::Lvl1MuCTPIInput convertedInput;
-
-    // if reading from ROS data
-    if(muctpiRDO) {
-      
-      //std::cout << "DataWord Decoding" << std::endl;
-      //for(auto dW : muctpiRDO->dataWord()) 
-      //MuCTPI_DataWord_Decoder(dW).dumpData(msg());
-      
-      // Get the BCID of the collision:
-      unsigned int bcid_next = ( ( muctpiRDO->candidateMultiplicity() >> 18 ) & 0x7 ) + bcidOffset;
-      if(bcid_next==8) bcid_next=0;
-      ATH_MSG_DEBUG("Filling the input event from MUCTPI_RDO for bcid = " << bcid_next);
-      
-      // Create the input to the MuCTPI for the +1 BC
-      CHECK( Converter::convertRDO( muctpiRDO->dataWord(), bcid_next, &convertedInput ) );
-      ATH_MSG_DEBUG("Input converted");
-     
-    }
-    // or from RoIB data
-    else{
-      
-      // Extract the RoIs into a vector:
-      std::vector< unsigned int > convertableRoIs;
-      
-      if( roibResult ) {
-	
-	const std::vector< ROIB::MuCTPIRoI >& rois = roibResult->muCTPIResult().roIVec();
-	ATH_MSG_DEBUG("Filling the input event from RoIBResult. Number of Muon ROIs: " << rois.size() );
-	for( const ROIB::MuCTPIRoI & muonRoI : rois ) {
-	  convertableRoIs.push_back(  muonRoI.roIWord() );
-	}
-      } else if( muctpi_slink ) {
-	
-	ATH_MSG_DEBUG("Filling the input event. Number of Muon ROIs: " << muctpi_slink->getMuCTPIToRoIBWords().size() - ROIB::Header::wordsPerHeader - ROIB::Trailer::wordsPerTrailer - 1);
-	unsigned int icnt = 0;
-	for ( unsigned int roiword : muctpi_slink->getMuCTPIToRoIBWords() ) {
-	  
-	  ++icnt;
-	  // skip header
-	  if ( icnt <= ROIB::Header::wordsPerHeader + 1 )
-	    continue;
-	  
-	  // skip trailer
-	  if ( icnt > ( muctpi_slink->getMuCTPIToRoIBWords().size() - ROIB::Trailer::wordsPerTrailer ) )
-	    continue;
-	  
-	  // fill RoI into vector
-	  convertableRoIs.push_back(roiword);
-	}
-      }
-      
-      // Create the input to the MuCTPI:
-      CHECK( Converter::convertRoIs( convertableRoIs, &convertedInput ) );     
-    }
-    
-    // process the input with the MuCTPI simulation
-    ATH_MSG_DEBUG("MUCTPI data processing...");
-    m_theMuctpi->processData( &convertedInput );
-    
-    // get outputs for L1Topo 
-    ATH_MSG_DEBUG("Getting the output for L1Topo");
-    l1topoCandidates = m_theMuctpi->getL1TopoData();
-    
-    return StatusCode::SUCCESS;
-  }
-
-
-  //----------------------------------------------
-  // execute() method called once per event
-  //----------------------------------------------
-  StatusCode L1MuctpiTool::execute( ) const {
-
-    // Now this is a tricky part. We have to force the message logging of the
-    // MuCTPI simulation to display messages of the same level as this MsgStream.
-    MsgWriter::instance()->setMinType( msg().level() );
-    MsgWriter::instance()->setSource( name() );
-
-    ATH_MSG_DEBUG( "===============================" );
-    ATH_MSG_DEBUG( "Executing L1Muctpi algorithm." );
-    ATH_MSG_DEBUG( "===============================" );
-
-    // Now this is a trictky one. I only had to make the decision of which function to call
-    // at execute once in initialize(). Now I can call the right function like this:
-    return ( this->*m_executeFunction )();
-  }
-
-  /**
-   * This is the default execute() function. It reads inputs from the RPC and TGC sector logics,
-   * and runs the MuCTPI simulation with their inputs.
-   */
-  StatusCode L1MuctpiTool::executeFromDigi() const {
-
-    ATH_MSG_DEBUG( "in executeFromDigi()" );
-
-    //
-    // Get the RPC MUCTPI-input object from StoreGate.
-    //
-    bool gotRPCInput( false );
-    const LVL1MUONIF::Lvl1MuCTPIInput* dHandleRPC = 0;
-    if( evtStore()->retrieve( dHandleRPC, m_rpcLocId ).isFailure() ) {
-      ATH_MSG_WARNING( "Cannot retrieve RPC L1Muctpi object from StoreGate!" );
-    } else {
-      ATH_MSG_DEBUG( "Retrieved RPC Lvl1MuCTPIInput object from StoreGate" );
-      gotRPCInput = true;
-    }
-
-    //
-    // Get the TGC MUCTPI-input object from StoreGate.
-    //
-    bool gotTGCInput( false );
-    const LVL1MUONIF::Lvl1MuCTPIInput* dHandleTGC = 0;
-    if( evtStore()->retrieve( dHandleTGC, m_tgcLocId ).isFailure() ) {
-      ATH_MSG_WARNING( "Cannot retrieve TGC L1Muctpi object from StoreGate!" );
-    } else {
-      ATH_MSG_DEBUG( "Retrieved TGC Lvl1MuCTPIInput object from StoreGate" );
-      gotTGCInput = true;
-    }
-
-    // Merge the two inputs:
-    LVL1MUONIF::Lvl1MuCTPIInput mergedInput;
-    if( gotRPCInput ) mergedInput.merge( *dHandleRPC );
-    if( gotTGCInput ) mergedInput.merge( *dHandleTGC );
-
-    if( ! ( gotRPCInput || gotTGCInput ) ) {    // this should be an "&&" in final ver.
-      ATH_MSG_WARNING( "No input received from the RPC or TGC sector logic simulation" );
-      return StatusCode::SUCCESS;
-    }
-
-    /// Need to check here if there are several BC slices in the input object, and run
-    /// the simulation for each one
-
-
-    //// TESTING ONLY  /////
-    /// mergedInput.duplicateToOtherBC(-1);
-
-    //always process the central slice, which defaults to bcidOffset = 0
-    // process the input in the MUCTPI simulation
-    m_theMuctpi->processData( &mergedInput );      
-    // Save the output of the simulation
-    CHECK( saveOutput() );
-      
-    // check the other 4 possible BC offset values in case the input objects tells us there are
-    // out of time candidates
-
-
-    if (mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem()) ||
-	mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem()) || 
-	mergedInput.hasOutOfTimeCandidates(LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem()) ){
-      
-      for (std::vector<int>::const_iterator it = m_bcidOffsetList.begin(); it != m_bcidOffsetList.end(); ++it){
-	if (! mergedInput.isEmptyAll( (*it) ) ){
-	  // process the input in the MUCTPI simulation
-	  m_theMuctpi->processData( &mergedInput, (*it));      
-	  // Save the output of the simulation
-	  CHECK( saveOutput( (*it) ) );	    
-	}
-      }
-    }    
-
-    return StatusCode::SUCCESS;
-  }
-
-  /**
-   * This is a new execute() function. It reads the LVL1_ROI object from an AOD file, it converts
-   * the muon RoIs back into the input format of the MuCTPI, then runs the MuCTPI information
-   * with this transformed input.
-   */
-  StatusCode L1MuctpiTool::executeFromAOD() const {
-
-    ATH_MSG_DEBUG( "in executeFromAOD()" );
-
-    // Retrieve the LVL1_ROI object from the AOD:
-    const LVL1_ROI* lvl1RoI = 0;
-    CHECK( evtStore()->retrieve( lvl1RoI, m_aodLocId ) );
-    ATH_MSG_DEBUG( "Retrieved LVL1_ROI object from StoreGate" );
-
-    // Extract the RoIs into a vector:
-    std::vector< unsigned int > convertableRoIs;
-    LVL1_ROI::muons_type::const_iterator muonRoI_itr = lvl1RoI->getMuonROIs().begin();
-    LVL1_ROI::muons_type::const_iterator muonRoI_end = lvl1RoI->getMuonROIs().end();
-    for( ; muonRoI_itr != muonRoI_end; ++muonRoI_itr ) {
-      convertableRoIs.push_back( muonRoI_itr->getROIWord() );
-    }
-
-    // Create the input to the MuCTPI:
-    LVL1MUONIF::Lvl1MuCTPIInput convertedInput;
-    CHECK( Converter::convertRoIs( convertableRoIs, &convertedInput ) );
-
-    // process the input with the MuCTPI simulation
-    m_theMuctpi->processData( &convertedInput );
-
-    // store CTP result in interface object and put to StoreGate
-    LVL1::MuCTPICTP* theCTPResult = new LVL1::MuCTPICTP( m_theMuctpi->getCTPData() );
-    CHECK( evtStore()->record( theCTPResult, m_ctpOutputLocId ) );
-    ATH_MSG_DEBUG( "CTP word recorded to StoreGate with key: "
-		   << m_ctpOutputLocId );
-
-    // Save the output of the simulation
-    CHECK( saveOutput() );
-
-    return StatusCode::SUCCESS;
-  }
-
-  /**
-   * This is a new execute() function. It reads the MuCTPI_RDO object from an RDO file, it
-   * converts the muon data words back into the input format of the MuCTPI, then runs the
-   * MuCTPI information with this transformed input.
-   */
-  StatusCode L1MuctpiTool::executeFromRDO() const {
-
-    ATH_MSG_DEBUG( "in executeFromRDO()" );
-
-    // Retrieve the MuCTPI_RDO object from the digitized file:
-    const MuCTPI_RDO* old_RDO = 0;
-    CHECK( evtStore()->retrieve( old_RDO, m_rdoLocId ) );
-    ATH_MSG_DEBUG( "Retrieved MuCTPI_RDO object from StoreGate" );
-
-    // Get the BCID of the collision:
-    const unsigned int bcid = ( ( old_RDO->candidateMultiplicity() >> 18 ) & 0x7 );
-
-    // Create the input to the MuCTPI:
-    LVL1MUONIF::Lvl1MuCTPIInput convertedInput;
-    CHECK( Converter::convertRDO( old_RDO->dataWord(), bcid, &convertedInput ) );
-
-    // process the input with the MuCTPI simulation
-    m_theMuctpi->processData( &convertedInput );
-
-    // Save the output of the simulation
-    CHECK( saveOutput() );
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode L1MuctpiTool::validate( const std::vector< TrigConf::TriggerThreshold* > &
-				 thresholds ) const {
-
-    //
-    // Check that it's not a null-pointer:
-    //
-    //       if( ! thresholds ) {
-    //          REPORT_ERROR( StatusCode::FAILURE )
-    //             << "No muon threshold vector given for validation!";
-    //          return StatusCode::FAILURE;
-    //       }
-
-    //
-    // Check that there are 6 thresholds:
-    //
-    if( thresholds.size() != 6 ) {
-      REPORT_ERROR( StatusCode::FAILURE )
-	<< thresholds.size() << " muon thresholds defined";
-      REPORT_ERROR( StatusCode::FAILURE )
-	<< "There have to be exactly 6 threshold defined!";
-      return StatusCode::FAILURE;
-    }
-
-    //
-    // Check that they are all muon thresholds:
-    //
-    for( TrigConf::TriggerThreshold* thr : thresholds ) {
-      if( ( thr->cableName() != "MU" && thr->cableName() != "MUCTPI" ) || ( thr->type() != "MUON" ) ) {
-	REPORT_ERROR( StatusCode::FAILURE )
-	  << "There is a non-muon threshold in the LVL1 muon configuration!";
-	return StatusCode::FAILURE;
-      }
-    }
-
-    //
-    // Check that they're all on the same cable:
-    //
-    const std::string ctpin     = thresholds.at( 0 )->cableCtpin();
-    const std::string connector = thresholds.at( 0 )->cableConnector();
-    for( const TrigConf::TriggerThreshold * thr : thresholds ) {
-      if( ( thr->cableCtpin() != ctpin ) || ( thr->cableConnector() != connector ) ) {
-	REPORT_ERROR( StatusCode::FAILURE )
-	  << "The muon thresholds are not all configured on the same cable!";
-	return StatusCode::FAILURE;
-      }
-    }
-
-    //
-    // Check that they are configured on the correct wires:
-    //
-    unsigned int mask = 0;
-    for( TrigConf::TriggerThreshold* thr : thresholds ) {
-      if( ( thr->cableEnd() - thr->cableStart() ) != 2 ) {
-	REPORT_ERROR( StatusCode::FAILURE )
-	  << "A muon threshold is not 3 bit wide in the configuration!";
-	return StatusCode::FAILURE;
-      }
-      mask |= ( static_cast< unsigned int >( pow( 2, thr->cableEnd() - thr->cableStart() + 1 ) - 1 ) << thr->cableStart() );
-    }
-    if( mask != 0x7fffe ) {
-      REPORT_ERROR( StatusCode::FAILURE )
-	<< "The muon thresholds don't cover the correct bits on the cable";
-      return StatusCode::FAILURE;
-    }
-
-    return StatusCode::SUCCESS;
-  }
-
-  /**
-   * This function is used by all the different execute functions to save the output
-   * of the MuCTPI simulation into various objects in StoreGate.
-   */
-  StatusCode L1MuctpiTool::saveOutput(int bcidOffset) const {
-     
-    /// the standart processing is done for the central slice, with no Bcid offset
-    if (bcidOffset == 0 ) {
-      // store CTP result in interface object and put to StoreGate
-      LVL1::MuCTPICTP* theCTPResult = new LVL1::MuCTPICTP( m_theMuctpi->getCTPData() );
-      CHECK( evtStore()->record( theCTPResult, m_ctpOutputLocId ) );
-      ATH_MSG_DEBUG( "CTP word recorded to StoreGate with key: "
-                     << m_ctpOutputLocId );
-
-      // create MuCTPI RDO
-      const std::list< unsigned int >& daqData = m_theMuctpi->getDAQData();
-
-      const int HEADER_SIZE = 9;
-      const int STATUSandTAILER_SIZE = 2 + 3;
-
-      // size check
-      // payload should contain at least 1 data (Candidate Multiplicity)
-      int payloadSize = daqData.size() - HEADER_SIZE - STATUSandTAILER_SIZE;
-      if( payloadSize < 1 ) {
-	REPORT_ERROR( StatusCode::FAILURE )
-	  << "MIROD didn't provide correct DAQ data";
-	return StatusCode::FAILURE;
-      }
-
-      // skip header part
-      std::list< unsigned int >::const_iterator itDAQ = daqData.begin();
-      for( int iHead = 0; iHead < HEADER_SIZE; ++iHead ) {
-	++itDAQ;
-      }
-
-      // candidate multiplicity
-      const uint32_t can = *itDAQ;
-      ++itDAQ;
-
-      // data word
-      std::vector< uint32_t > dataWord;
-      for( int iData = 1; iData < payloadSize; ++iData, ++itDAQ ) {
-	dataWord.push_back( *itDAQ );
-      }
-
-      // create MuCTPI RDO
-      MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, std::move(dataWord) );
-      CHECK( evtStore()->record( muCTPI_RDO, m_rdoOutputLocId ) );
-      ATH_MSG_DEBUG( "MuCTPI_RDO object recorded to StoreGate with key: "
-                     << m_rdoOutputLocId );
-
-      // store RoIB result in interface object and put to StoreGate
-      std::list< unsigned int > resultForRoIB = m_theMuctpi->getRoIBData();
-      std::vector< unsigned int > roibResultVector;
-
-      std::list< unsigned int >::iterator roib_itr = resultForRoIB.begin();
-      std::list< unsigned int >::iterator roib_end = resultForRoIB.end();
-      for( ; roib_itr != roib_end; ++roib_itr ) {
-	roibResultVector.push_back( *roib_itr );
-      }
-
-      L1MUINT::MuCTPIToRoIBSLink* theRoIBResult =
-	new L1MUINT::MuCTPIToRoIBSLink( roibResultVector );
-
-      CHECK( evtStore()->record( theRoIBResult, m_roiOutputLocId ) );
-      ATH_MSG_DEBUG( "RoIB result recorded to StoreGate with key: "
-                     << m_roiOutputLocId );
-
-      //construct muctpi nim words (for MUE and MUB items)
-      unsigned int cw1=0;
-      if( m_doNimOutput ) {
-	if(m_theMuctpi->hasBarrelCandidate()){
-	  unsigned int nimBarrelBitMask = 1<<m_nimBarrelBit;
-	  cw1|=nimBarrelBitMask;
-	}
-	if(m_theMuctpi->hasEndcapCandidate()){
-	  unsigned int nimEndcapBitMask = 1<<m_nimEndcapBit;
-	  cw1|=nimEndcapBitMask;
-	}
-
-	//constructing NimCTP object 
-	LVL1::NimCTP* nim = new LVL1::NimCTP( 0, cw1, 0 );
-
-	// Save it into StoreGate:
-	if( evtStore()->contains< LVL1::NimCTP >( m_nimOutputLocId ) ) {
-	  ATH_MSG_ERROR("NimCTP object already in store gate. This should not happen!");
-	  return StatusCode::FAILURE;
-	}
-	CHECK( evtStore()->record( nim, m_nimOutputLocId ) );
-      }
-
-      // get outputs for L1Topo and store into Storegate
-      ATH_MSG_DEBUG("Getting the output for L1Topo");
-      LVL1::MuCTPIL1Topo l1topoCandidates = m_theMuctpi->getL1TopoData();
-      LVL1::MuCTPIL1Topo* l1topo = new LVL1::MuCTPIL1Topo(l1topoCandidates.getCandidates());
-      CHECK( evtStore()->record( l1topo, m_l1topoOutputLocId ) );
-      //      std::cout << "TW: central slice: offset: " <<  bcidOffset << "  location: " << m_l1topoOutputLocId << std::endl;
-      //l1topo->print();
-    }
-
-    /// if we have a bcid offset, then just get the topo output and put it on storegate
-    if (bcidOffset  != 0) {
-      ATH_MSG_DEBUG("Getting the output for L1Topo for BCID slice");
-      LVL1::MuCTPIL1Topo l1topoCandidatesBC = m_theMuctpi->getL1TopoData();
-      LVL1::MuCTPIL1Topo* l1topoBC = new LVL1::MuCTPIL1Topo(l1topoCandidatesBC.getCandidates());
-      l1topoBC->setBcidOffset(bcidOffset);
-      CHECK( evtStore()->record( l1topoBC, m_l1topoOutputLocId+std::to_string(bcidOffset) ) );
-      // std::cout << "TW: slice: offset: " <<  bcidOffset << "  location: " 
-      //		<< m_l1topoOutputLocId+std::to_string(bcidOffset) << std::endl;
-      // l1topoBC->print();
-    }
-
-
-    return StatusCode::SUCCESS;
-  }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h
deleted file mode 100644
index 5f8533ee62b0..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGT1MUCTPI_L1MUCTPITOOL_H
-#define TRIGT1MUCTPI_L1MUCTPITOOL_H
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "TrigT1Interfaces/IMuctpiSimTool.h"
-#include <vector>
-#include <string>
-
-#include "GaudiKernel/ToolHandle.h"
-
-namespace TrigConf {
-   class ILVL1ConfigSvc;
-   class TriggerThreshold;
-}
-
-
-namespace LVL1MUCTPI {
-
-  // Forward declaration(s):
-  class MuctpiSim;
-
-  class L1MuctpiTool : public extends<AthAlgTool, IMuctpiSimTool> {
-   public:
-      L1MuctpiTool(const std::string& type, const std::string& name, 
-                         const IInterface* parent);
-      
-      virtual ~L1MuctpiTool();
-
-      virtual StatusCode initialize() override;
-
-      virtual StatusCode fillMuCTPIL1Topo(LVL1::MuCTPIL1Topo&, int bcidOffset=0) const override;
-
-      // left over from ALgorithm implementation ... can I just leave them in here
-      // and use them as normal funcitons?
-      /// Regular Gaudi algorithm finalization function
-      virtual StatusCode finalize() override;
-      /// Regular Gaudi algorithm execute function
-      virtual StatusCode execute() const override;
-      /// Regular Gaudi algorithm beginRun function
-      virtual StatusCode start() override;
-
-
-   private:
-
-      /// Event loop method for running as part of digitization
-      StatusCode executeFromDigi() const;
-      /// Event loop method for running on an AOD file
-      StatusCode executeFromAOD() const;
-      /// Event loop method for running on an RDO file
-      StatusCode executeFromRDO() const;
-      /// Validate the muon threshold configuration
-      StatusCode validate( const std::vector< TrigConf::TriggerThreshold* >& thresholds ) const;
-      /// Save the outputs of the simulation into StoreGate
-      StatusCode saveOutput(int bcidOffset = 0) const;
-
-      /// The LVL1 configuration service
-      ServiceHandle< TrigConf::ILVL1ConfigSvc > m_configSvc;
-
-      /// The simulation top level object
-      MuctpiSim* m_theMuctpi;
-
-      /// The BCID slices to be checked in addition to the central one in the input objects from Digi
-      std::vector<int> m_bcidOffsetList = {-2,-1,1,2};
-
-      // Locations of the inputs and outputs of the simulation in StoreGate:
-      static const std::string m_DEFAULT_L1MuctpiStoreLocationRPC;
-      static const std::string m_DEFAULT_L1MuctpiStoreLocationTGC;
-      static const std::string m_DEFAULT_AODLocID;
-      static const std::string m_DEFAULT_RDOLocID;
-
-      // These properties control the way the overlap handling functions:
-      std::string m_overlapStrategyName;
-      std::string m_lutXMLFile;
-      std::string m_runPeriod;
-      bool m_flagMode;
-
-     // These properties control the way the outputs for the L1Topo are generated
-     std::string m_geometryXMLFile;
-
-      // These properties control how the multiplicity summation happens:
-      std::string m_multiplicityStrategyName;
-      std::string m_multiplicityXMLFile;
-
-      // Property for the input selection, and the locations of the various
-      // input and output objects:
-      std::string m_inputSource;
-      std::string m_aodLocId;
-      std::string m_rdoLocId;
-      std::string m_rdoOutputLocId;
-      std::string m_roiOutputLocId;
-      std::string m_ctpOutputLocId;
-      std::string m_l1topoOutputLocId;
-      std::string m_tgcLocId;
-      std::string m_rpcLocId;
-      std::string m_roibLocation;
-
-      /// Property telling if the LUTs should be printed:
-      bool m_dumpLut;
-
-      /// Property telling if input file is data or simulation 
-      bool m_IsData;           
-
-      // Properties controlling the NIM outputs provided by the simulation
-      bool m_doNimOutput;
-      std::string m_nimOutputLocId;
-      unsigned int m_nimBarrelBit;
-      unsigned int m_nimEndcapBit;
-      
-      /// Function pointer to the execute function we want to use:
-      StatusCode ( LVL1MUCTPI::L1MuctpiTool::*m_executeFunction )( void ) const;
-
-   };
-}
-
-#endif
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.cxx
deleted file mode 100644
index db2159ba5c68..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: BitOp.cxx 796872 2017-02-13 15:03:25Z fwinkl $
-
-// STL include(s):
-#include <iostream>
-
-// Local include(s):
-#include "BitOp.h"
-
-namespace LVL1MUCTPI {
-
-  BitOp::BitOp() {
-
-  }
-
-  BitOp::~BitOp() {
-
-  }
-
-  void BitOp::printBinN( unsigned int uintValue, int nbits ) {
-
-    for( int i = nbits; i >= 0; --i ) {
-      if( uintValue & ( 1 << i ) ) {
-        std::cout << "1";
-      } else {
-        std::cout << "0";
-      }
-      if( (i % 4) == 0 ) std::cout << " ";
-    }
-
-  }
-
-  void BitOp::printBinN( int intValue, int nbits ) {
-
-    for( int i = nbits; i >= 0; --i ) {
-      if( intValue & ( 1 << i ) ) {
-        std::cout << "1";
-      } else {
-        std::cout << "0";
-      }
-      if( (i % 4) == 0 ) std::cout << " ";
-    }
-
-  }
-
-  void BitOp::printBinN( unsigned int uintValue, int nbits, std::string& destination ) {
-
-    for( int i = nbits; i >= 0; --i ) {
-      if( uintValue & ( 1 << i ) ) {
-        destination += "1";
-      } else {
-        destination += "0";
-      }
-      if( (i % 4) == 0 ) destination += " ";
-    }
-
-  }
-
-  void BitOp::printBinN( int intValue, int nbits, std::string& destination ) {
-
-    for( int i = nbits; i >= 0; --i ) {
-      if( intValue & ( 1 << i ) ) {
-        destination += "1";
-      } else {
-        destination += "0";
-      }
-      if( (i % 4) == 0 ) destination += " ";
-    }
-
-  }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.h
deleted file mode 100644
index dfbd3cad8cee..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/BitOp.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: BitOp.h 796872 2017-02-13 15:03:25Z fwinkl $
-#ifndef TRIGT1MUCTPI_BITOP_H
-#define TRIGT1MUCTPI_BITOP_H
-
-#include <string>
-#include "CxxUtils/bitscan.h"
-
-namespace LVL1MUCTPI {
-
-  /**
-   *******************************************************************
-   *
-   *    $Date: 2017-02-13 16:03:25 +0100 (Mon, 13 Feb 2017) $
-   *
-   *    @short Utility class for integer bit operations
-   *
-   *           This is a utility class for integer bit operations
-   *           Operations that set or unset bits are done using
-   *           Pointers and are inline, as they need to be fast.
-   *           The print methods are not time-critical.
-   *
-   *      @see
-   *   @author  Author: Thorsten Wengler
-   *  @version $Revision: 796872 $
-   *
-   *******************************************************************
-   */
-  class BitOp {
-
-  public:
-    BitOp();
-    ~BitOp();
-
-    /**
-     * Utitlity function to print out the binary
-     * representation of an input int or unsigned int
-     * value. Does not need to be fast.
-     */
-    static void printBin( unsigned int uintValue ) { printBinN( uintValue, 31 ); }
-    static void printBin( int intValue ) { printBinN( intValue, 31 ); }
-    static void printBin( unsigned int uintValue, std::string& destination ) { printBinN( uintValue, 31, destination ); }
-    static void printBin( int intValue, std::string& destination ) { printBinN( intValue, 31, destination ); }
-    static void printBinN( unsigned int uintValue, int nbits );
-    static void printBinN( int intValue, int nbits );
-    static void printBinN( unsigned int uintValue, int nbits, std::string& destination );
-    static void printBinN( int intValue, int nbits, std::string& destination );
-
-    /**
-     * Check if a the given bit in the given unsigned int or
-     * int value is set. True if yes. Uses pointer to the obejct
-     * and is inline. Does not change the initial value given to
-     * the function.
-     */
-    static inline bool isSet(const unsigned int *uintValue, int bit)
-      { return ( *uintValue == ( *uintValue | ( 1 << bit ) ) ); }
-
-    static inline bool isSet(const int *intValue, int bit)
-      { return ( *intValue == ( *intValue | ( 1 << bit ) ) ); }
-
-    /**
-     * Set the given bit in the given unsigned int
-     * or int value. Uses pointer to the object and is inline.
-     */
-    static inline void setBit(unsigned int *uintValue, int bit)
-      { *uintValue |= ( 1 << bit ); }
-
-    static inline void setBit(int *intValue, int bit)
-      { *intValue |= ( 1 << bit ); }
-
-    /**
-     * Clear the given bit in the given integer. Uses pointer
-     * to the object and is inline.
-     */
-    static inline void clearBit(unsigned int *uintValue, int bit)
-      { *uintValue |= ( 1 << bit ); *uintValue ^=  ( 1 << bit ); }
-
-    static inline void clearBit(int *intValue, int bit)
-      { *intValue |= ( 1 << bit ); *intValue ^=  ( 1 << bit ); }
-
-    /**
-     * Superimpose the given integer wrd starting at bit stbit
-     * onto integer or unsigned interger value.
-     * Uses pointer to the object and is inline.
-     * !! Bits already set in value are not reset !!
-     */
-    static inline void sImposeNBits(unsigned int *uintValue, int stbit, int wrd)
-      { *uintValue |= ( wrd << stbit ); }
-
-    static inline void sImposeNBits(int *intValue, int stbit, int wrd)
-      { *intValue |= ( wrd << stbit ); }
-
-    static inline void sImposeNBits(unsigned int *uintValue, int stbit, unsigned int wrd)
-      { *uintValue |= ( wrd << stbit ); }
-
-    static inline void sImposeNBits(int *intValue, int stbit, unsigned int wrd)
-      { *intValue |= ( wrd << stbit ); }
-
-    /**
-     * get the value in the input word represented by a bit pattern
-     * given as a bitmask
-     */
-    static inline unsigned int getValue(const unsigned int* uintValue, const unsigned int mask)
-    {
-      return (*uintValue & mask) >> CxxUtils::count_trailing_zeros(mask);
-    }
-
-  }; // class BitOp
-
-} // namespace LVL1MUCTPI
-
-#endif  // TRIGT1MUCTPI_BITOP_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Configuration.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Configuration.h
deleted file mode 100644
index f999a1fda99b..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Configuration.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Configuration.h 515239 2012-08-28 11:39:45Z krasznaa $
-#ifndef TRIGT1MUCTPI_CONFIGURATION_H
-#define TRIGT1MUCTPI_CONFIGURATION_H
-
-namespace LVL1MUCTPI {
-
-   /**
-    *  @short Header files holding configuration items for the MUCTPI
-    *
-    *         This header file groups all information describing
-    *         the configuration of the MUCTPI. Eventually this should
-    *         come out of a configuration data base.
-    *
-    * @author Thorsten Wengler
-    *
-    * $Revision: 515239 $
-    * $Date: 2012-08-28 13:39:45 +0200 (Tue, 28 Aug 2012) $
-    */
-   class Configuration {
-
-   public:
-      Configuration()
-         : m_doZeroSuppression( true ),
-           m_threshold1Candidate( 1 ),
-           m_threshold2Candidate( 1 ),
-           m_suppressionMode( 0 ),
-           m_maxCandPerPtvalue( 64 ),
-           m_maxCandSendToRoib( 14 ),
-           m_candBcidOffset( 0 )
-      {}
-
-      // Configuration items for the MIOCTS
-      void setDoZeroSuppression( bool flag )  { m_doZeroSuppression = flag; }
-      bool getDoZeroSuppression() const { return m_doZeroSuppression; }
-
-      // Configuration Items for the MIROD Extractor
-      // pt-thresholds for the first and second candidate
-      void setThreshold1Candidate( unsigned int thr ) { m_threshold1Candidate = thr; }
-      unsigned int getThreshold1Candidate() const { return m_threshold1Candidate; }
-      void setThreshold2Candidate( unsigned int thr ) { m_threshold2Candidate = thr; }
-      unsigned int getThreshold2Candidate() const { return m_threshold2Candidate; }
-
-      // Extractor suppression mode flag
-      void setSuppressionMode( int flag ) { m_suppressionMode = flag; }
-      int  getSuppressionMode() const { return m_suppressionMode; }
-
-      // Lvl2 processor configuration
-      unsigned int getMaxCandPerPtvalue() const { return m_maxCandPerPtvalue; } //nonprogrammable
-      void setMaxCandSendToRoib( unsigned int count ) { m_maxCandSendToRoib = count; }
-      unsigned int getMaxCandSendToRoib() const { return m_maxCandSendToRoib; }
-      void setCandBcidOffset( unsigned int count ) { m_candBcidOffset = count; }
-      unsigned int getCandBcidOffset() const { return m_candBcidOffset; }
-
-   private:
-      bool m_doZeroSuppression;
-      unsigned int m_threshold1Candidate;
-      unsigned int m_threshold2Candidate;
-      int m_suppressionMode;
-      unsigned int m_maxCandPerPtvalue;
-      unsigned int m_maxCandSendToRoib;
-      unsigned int m_candBcidOffset;
-
-   }; // class Configuration
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_CONFIGURATION_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.cxx
deleted file mode 100644
index 0b61e6ffb5a8..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.cxx
+++ /dev/null
@@ -1,592 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Converter.cxx 707664 2015-11-13 05:36:00Z ssnyder $
-
-// STL include(s):
-#include <map>
-#include <iomanip>
-#include <sstream>
-
-// TrigT1 include(s):
-#include "TrigT1Interfaces/Lvl1MuCTPIInput.h"
-
-// Local include(s):
-#include "Converter.h"
-#include "BitOp.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // Declaration of the constants:
-   const unsigned int Converter::RoIandOverlapMask     = 0x000007fc;
-   const unsigned int Converter::PtMask                = 0x00003800;
-   const unsigned int Converter::RoI_SectorAddressMask = 0x003fc000;
-   const unsigned int Converter::RDO_SectorAddressMask = 0x01fe0000;
-   const unsigned int Converter::RoI_FirstCandMask     = 0x00400000;
-   const unsigned int Converter::RDO_FirstCandMask     = 0x02000000;
-   const unsigned int Converter::MoreCandInRoI         = 0x00000002;
-   const unsigned int Converter::MoreCandInSec         = 0x00000001;
-   const unsigned int Converter::Cand1InverseMask      = 0xfdc7fc00;
-   const unsigned int Converter::Cand2InverseMask      = 0xfa3803fe;
-
-   StatusCode Converter::convertRoIs( const std::vector< unsigned int >& roi_vector,
-                                      LVL1MUONIF::Lvl1MuCTPIInput* muctpi_input ) {
-
-      MsgLogger logger( "Converter::convertRoIs()" );
-
-      // Maps needed for the translation:
-      std::map< unsigned int, HelperRoIBarrelSector >  barrel_map;
-      std::map< unsigned int, HelperRoIEndcapSector >  endcap_map;
-      std::map< unsigned int, HelperRoIForwardSector > forward_map;
-
-      ////////////////////////////////////////////////////////////////////////////////
-      //                                                                            //
-      //  Iterate through all the RoI words, and fill the maps with data extracted  //
-      //  from them.                                                                //
-      //                                                                            //
-      ////////////////////////////////////////////////////////////////////////////////
-
-      std::vector< unsigned int >::const_iterator it_roi_vector  = roi_vector.begin();
-      std::vector< unsigned int >::const_iterator end_roi_vector = roi_vector.end();
-      for( ; it_roi_vector != end_roi_vector; ++it_roi_vector ) {
-
-         SectorType type = getSectorType( getRoISectorAddress( *it_roi_vector ) );
-
-         if( type == Barrel ) {
-            REPORT_VERBOSE_MSG2( "Barrel sector candidate found : 0x" << std::hex
-                                 << std::setw( 8 ) << std::setfill( '0' )
-                                 << *it_roi_vector,
-                                 logger);
-
-            if( isRoIFirstCand( *it_roi_vector ) ) {
-               barrel_map[ getRoISectorAddress( *it_roi_vector ) ].addFirst( *it_roi_vector );
-            } else {
-               barrel_map[ getRoISectorAddress( *it_roi_vector ) ].addSecond( *it_roi_vector );
-            }
-
-         } else if( type == Endcap ) {
-
-            REPORT_VERBOSE_MSG2( "Endcap sector candidate found : 0x" << std::hex
-                                 << std::setw( 8 ) << std::setfill( '0' )
-                                 << *it_roi_vector,
-                                 logger);
-
-            if( isRoIFirstCand( *it_roi_vector ) ) {
-               endcap_map[ getRoISectorAddress( *it_roi_vector ) ].addFirst( *it_roi_vector );
-            } else {
-               endcap_map[ getRoISectorAddress( *it_roi_vector ) ].addSecond( *it_roi_vector );
-            }
-
-         } else if( type == Forward ) {
-
-            REPORT_VERBOSE_MSG2( "Forward sector candidate found : 0x" << std::hex
-                                 << std::setw( 8 ) << std::setfill( '0' )
-                                 << *it_roi_vector,
-                                 logger);
-
-            if( isRoIFirstCand( *it_roi_vector ) ) {
-               forward_map[ getRoISectorAddress( *it_roi_vector ) ].addFirst( *it_roi_vector );
-            } else {
-               forward_map[ getRoISectorAddress( *it_roi_vector ) ].addSecond( *it_roi_vector );
-            }
-
-         } else {
-
-            REPORT_FATAL_MSG2( "Coding error found. System of candidate not recognized.",
-                               logger);
-            return StatusCode::FAILURE;
-         }
-      }
-
-      ////////////////////////////////////////////////////////////////////////////////
-      //                                                                            //
-      //     Now iterate through the maps and fill the MuCTPI input object.         //
-      //                                                                            //
-      ////////////////////////////////////////////////////////////////////////////////
-
-      std::map< unsigned int, HelperRoIBarrelSector >::const_iterator it_barrel_map =
-         barrel_map.begin();
-      std::map< unsigned int, HelperRoIBarrelSector >::const_iterator end_barrel_map =
-         barrel_map.end();
-      for( ; it_barrel_map != end_barrel_map; ++it_barrel_map ) {
-
-          REPORT_MSG2(DEBUG, "Adding sector logic word:"  << std::endl << it_barrel_map->second.toString(), logger);
-
-         if( it_barrel_map->second.subSystem() == HelperRoISector::A_side ) {
-
-            muctpi_input->setSectorLogicData( it_barrel_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideA(),
-                                              it_barrel_map->second.sectorID() );
-
-         } else if( it_barrel_map->second.subSystem() == HelperRoISector::C_side ) {
-
-            muctpi_input->setSectorLogicData( it_barrel_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideC(),
-                                              it_barrel_map->second.sectorID() );
-
-         } else {
-
-            REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger );
-            return StatusCode::FAILURE;
-         }
-      }
-
-      std::map< unsigned int, HelperRoIEndcapSector >::const_iterator it_endcap_map =
-         endcap_map.begin();
-      std::map< unsigned int, HelperRoIEndcapSector >::const_iterator end_endcap_map =
-         endcap_map.end();
-      for( ; it_endcap_map != end_endcap_map; ++it_endcap_map ) {
-
-          REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_endcap_map->second.toString(), logger);
-
-         if( it_endcap_map->second.subSystem() == HelperRoISector::A_side ) {
-
-            muctpi_input->setSectorLogicData( it_endcap_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideA(),
-                                              it_endcap_map->second.sectorID() );
-
-         } else if( it_endcap_map->second.subSystem() == HelperRoISector::C_side ) {
-
-            muctpi_input->setSectorLogicData( it_endcap_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideC(),
-                                              it_endcap_map->second.sectorID() );
-
-         } else {
-
-            REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger );
-            return StatusCode::FAILURE;
-         }
-      }
-
-      std::map< unsigned int, HelperRoIForwardSector >::const_iterator it_forward_map =
-         forward_map.begin();
-      std::map< unsigned int, HelperRoIForwardSector >::const_iterator end_forward_map =
-         forward_map.end();
-      for( ; it_forward_map != end_forward_map; ++it_forward_map ) {
-
-          REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_forward_map->second.toString(), logger);
-
-         if( it_forward_map->second.subSystem() == HelperRoISector::A_side ) {
-
-            muctpi_input->setSectorLogicData( it_forward_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideA(),
-                                              it_forward_map->second.sectorID() );
-
-         } else if( it_forward_map->second.subSystem() == HelperRoISector::C_side ) {
-
-            muctpi_input->setSectorLogicData( it_forward_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideC(),
-                                              it_forward_map->second.sectorID() );
-
-         } else {
-
-            REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger );
-            return StatusCode::FAILURE;
-         }
-      }
-
-      return StatusCode::SUCCESS;
-   }
-
-   StatusCode Converter::convertRDO( const std::vector< unsigned int >& rdo_vector,
-                                     unsigned int bcid,
-                                     LVL1MUONIF::Lvl1MuCTPIInput* muctpi_input ) {
-
-      MsgLogger logger( "Converter::convertRDO()" );
-
-      // Maps needed for the translation:
-      std::map< unsigned int, HelperRDOBarrelSector >  barrel_map;
-      std::map< unsigned int, HelperRDOEndcapSector >  endcap_map;
-      std::map< unsigned int, HelperRDOForwardSector > forward_map;
-
-      ////////////////////////////////////////////////////////////////////////////////
-      //                                                                            //
-      //  Iterate through all the RDO words, and fill the maps with data extracted  //
-      //  from them.                                                                //
-      //                                                                            //
-      ////////////////////////////////////////////////////////////////////////////////
-
-      std::vector< unsigned int >::const_iterator it_rdo_vector  = rdo_vector.begin();
-      std::vector< unsigned int >::const_iterator end_rdo_vector = rdo_vector.end();
-      for( ; it_rdo_vector != end_rdo_vector; ++it_rdo_vector ) {
-
-         // Only consider the candidates with the correct BCID:
-         if( getRDOBCID( *it_rdo_vector ) != bcid ) {
-            REPORT_VERBOSE_MSG2( "Discarding candidate with wrong BCID", logger );
-            continue;
-         }
-
-         SectorType type = getSectorType( getRDOSectorAddress( *it_rdo_vector ) );
-
-         if( type == Barrel ) {
-
-            REPORT_VERBOSE_MSG2( "Barrel sector candidate found : 0x" << std::hex
-                                 << std::setw( 8 ) << std::setfill( '0' )
-                                 << *it_rdo_vector,
-                                 logger);
-
-            if( isRDOFirstCand( *it_rdo_vector ) ) {
-               barrel_map[ getRDOSectorAddress( *it_rdo_vector ) ].addFirst( *it_rdo_vector );
-            } else {
-               barrel_map[ getRDOSectorAddress( *it_rdo_vector ) ].addSecond( *it_rdo_vector );
-            }
-
-         } else if( type == Endcap ) {
-
-            REPORT_VERBOSE_MSG2( "Endcap sector candidate found : 0x" << std::hex
-                                 << std::setw( 8 ) << std::setfill( '0' )
-                                 << *it_rdo_vector,
-                                 logger);
-
-            if( isRDOFirstCand( *it_rdo_vector ) ) {
-               endcap_map[ getRDOSectorAddress( *it_rdo_vector ) ].addFirst( *it_rdo_vector );
-            } else {
-               endcap_map[ getRDOSectorAddress( *it_rdo_vector ) ].addSecond( *it_rdo_vector );
-            }
-
-         } else if( type == Forward ) {
-
-            REPORT_VERBOSE_MSG2( "Forward sector candidate found : 0x" << std::hex
-                                 << std::setw( 8 ) << std::setfill( '0' )
-                                 << *it_rdo_vector,
-                                 logger);
-
-            if( isRDOFirstCand( *it_rdo_vector ) ) {
-               forward_map[ getRDOSectorAddress( *it_rdo_vector ) ].addFirst( *it_rdo_vector );
-            } else {
-               forward_map[ getRDOSectorAddress( *it_rdo_vector ) ].addSecond( *it_rdo_vector );
-            }
-
-         } else {
-
-            REPORT_FATAL_MSG2( "Coding error found. System of candidate not recognized.", logger);
-            return StatusCode::FAILURE;
-         }
-      }
-
-      ////////////////////////////////////////////////////////////////////////////////
-      //                                                                            //
-      //     Now iterate through the maps and fill the MuCTPI input object.         //
-      //                                                                            //
-      ////////////////////////////////////////////////////////////////////////////////
-
-      std::map< unsigned int, HelperRDOBarrelSector >::const_iterator it_barrel_map =
-         barrel_map.begin();
-      std::map< unsigned int, HelperRDOBarrelSector >::const_iterator end_barrel_map =
-         barrel_map.end();
-      for( ; it_barrel_map != end_barrel_map; ++it_barrel_map ) {
-
-         REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_barrel_map->second.toString(), logger);
-
-         if( it_barrel_map->second.subSystem() == HelperRDOSector::A_side ) {
-
-            muctpi_input->setSectorLogicData( it_barrel_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideA(),
-                                              it_barrel_map->second.sectorID() );
-
-         } else if( it_barrel_map->second.subSystem() == HelperRDOSector::C_side ) {
-
-            muctpi_input->setSectorLogicData( it_barrel_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideC(),
-                                              it_barrel_map->second.sectorID() );
-
-         } else {
-
-            REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger );
-            return StatusCode::FAILURE;
-         }
-      }
-
-      std::map< unsigned int, HelperRDOEndcapSector >::const_iterator it_endcap_map =
-         endcap_map.begin();
-      std::map< unsigned int, HelperRDOEndcapSector >::const_iterator end_endcap_map =
-         endcap_map.end();
-      for( ; it_endcap_map != end_endcap_map; ++it_endcap_map ) {
-
-         REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_endcap_map->second.toString(), logger);
-
-         if( it_endcap_map->second.subSystem() == HelperRDOSector::A_side ) {
-
-            muctpi_input->setSectorLogicData( it_endcap_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideA(),
-                                              it_endcap_map->second.sectorID() );
-
-         } else if( it_endcap_map->second.subSystem() == HelperRDOSector::C_side ) {
-
-            muctpi_input->setSectorLogicData( it_endcap_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideC(),
-                                              it_endcap_map->second.sectorID() );
-
-         } else {
-
-            REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger );
-            return StatusCode::FAILURE;
-         }
-      }
-
-      std::map< unsigned int, HelperRDOForwardSector >::const_iterator it_forward_map =
-         forward_map.begin();
-      std::map< unsigned int, HelperRDOForwardSector >::const_iterator end_forward_map =
-         forward_map.end();
-      for( ; it_forward_map != end_forward_map; ++it_forward_map ) {
-
-         REPORT_MSG2(DEBUG, "Adding sector logic word:" << std::endl << it_forward_map->second.toString(), logger);
-
-         if( it_forward_map->second.subSystem() == HelperRDOSector::A_side ) {
-
-            muctpi_input->setSectorLogicData( it_forward_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideA(),
-                                              it_forward_map->second.sectorID() );
-
-         } else if( it_forward_map->second.subSystem() == HelperRDOSector::C_side ) {
-
-            muctpi_input->setSectorLogicData( it_forward_map->second.sectorWord(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem(),
-                                              LVL1MUONIF::Lvl1MuCTPIInput::idSideC(),
-                                              it_forward_map->second.sectorID() );
-
-         } else {
-
-            REPORT_FATAL_MSG2( "Code error detected in Converter. --> Aborting conversion!", logger );
-            return StatusCode::FAILURE;
-         }
-      }
-
-      return StatusCode::SUCCESS;
-   }
-
-   Converter::SectorType Converter::getSectorType( unsigned int sector_address ) {
-
-      if( sector_address & 0x80 ) {
-         return Endcap;
-      } else if( sector_address & 0x40 ) {
-         return Forward;
-      } else {
-         return Barrel;
-      }
-   }
-
-   unsigned int Converter::getRoISectorAddress( unsigned int roi_word ) {
-
-      return BitOp::getValue( &roi_word, RoI_SectorAddressMask );
-   }
-
-   bool Converter::isRoIFirstCand( unsigned int roi_word ) {
-
-      return ( roi_word & RoI_FirstCandMask );
-   }
-
-   unsigned int Converter::getRDOSectorAddress( unsigned int rdo_word ) {
-
-      return BitOp::getValue( &rdo_word, RDO_SectorAddressMask );
-   }
-
-   unsigned int Converter::getRDOBCID( unsigned int rdo_word ) {
-
-      return ( ( rdo_word >> 14 ) & 0x7 );
-   }
-
-   bool Converter::isRDOFirstCand( unsigned int rdo_word ) {
-
-      return ( rdo_word & RDO_FirstCandMask );
-   }
-
-   ////////////////////////////////////////////////////////////////////////////////
-   //                                                                            //
-   //   Functions of the Converter::HelperSector class                           //
-   //                                                                            //
-   ////////////////////////////////////////////////////////////////////////////////
-
-   Converter::HelperSector&
-   Converter::HelperSector::operator= ( const Converter::HelperSector& right ) {
-
-     if (this != &right) {
-
-       this->m_word   = right.m_word;
-       this->m_sector = right.m_sector;
-     }
-     return ( *this );
-   }
-
-   Converter::HelperSector::MuonSubSystem Converter::HelperSector::subSystem() const {
-
-      if( BitOp::isSet( &m_sector, 0 ) ) return A_side;
-      else return C_side;
-   }
-
-   ////////////////////////////////////////////////////////////////////////////////
-   //                                                                            //
-   //   Functions of the Converter::HelperRoISector class                        //
-   //                                                                            //
-   ////////////////////////////////////////////////////////////////////////////////
-
-   void Converter::HelperRoISector::addFirst( unsigned int roi_word ) {
-
-      m_word &= Cand1InverseMask; // Zero out all quantities of the first candidate
-
-      BitOp::sImposeNBits( &m_word, 1, BitOp::getValue( &roi_word, Converter::RoIandOverlapMask ) ); // RoI and overlap bits
-      BitOp::sImposeNBits( &m_word, 19, BitOp::getValue( &roi_word, Converter::PtMask ) );           // Pt
-      if( roi_word & Converter::MoreCandInSec ) BitOp::setBit( &m_word, 0 );                         // More than two cand. in sec.
-      if( roi_word & Converter::MoreCandInRoI ) BitOp::setBit( &m_word, 25 );                        // More than two cand. in RoI
-
-      BitOp::sImposeNBits( &m_sector, 0, BitOp::getValue( &roi_word, Converter::RoI_SectorAddressMask ) );
-
-      return;
-   }
-
-   void Converter::HelperRoISector::addSecond( unsigned int roi_word ) {
-
-      m_word &= Cand2InverseMask; // Zero out all quantities of the second candidate
-
-      BitOp::sImposeNBits( &m_word, 10, BitOp::getValue( &roi_word, Converter::RoIandOverlapMask ) ); // RoI and overlap bits
-      BitOp::sImposeNBits( &m_word, 22, BitOp::getValue( &roi_word, Converter::PtMask ) );            // Pt
-      if( roi_word & Converter::MoreCandInSec ) BitOp::setBit( &m_word, 0 );                          // More than two cand. in sec.
-      if( roi_word & Converter::MoreCandInRoI ) BitOp::setBit( &m_word, 26 );                         // More than two cand. in RoI
-
-      BitOp::sImposeNBits( &m_sector, 0, BitOp::getValue( &roi_word, Converter::RoI_SectorAddressMask ) );
-
-      return;
-   }
-
-   ////////////////////////////////////////////////////////////////////////////////
-   //                                                                            //
-   //   Functions of the Converter::HelperRoIBarrelSector class                  //
-   //                                                                            //
-   ////////////////////////////////////////////////////////////////////////////////
-
-   unsigned int Converter::HelperRoIBarrelSector::sectorID() const {
-
-      return BitOp::getValue( &m_sector, 0x3e );
-   }
-
-   ////////////////////////////////////////////////////////////////////////////////
-   //                                                                            //
-   //   Functions of the Converter::HelperRoIEndcapSector class                  //
-   //                                                                            //
-   ////////////////////////////////////////////////////////////////////////////////
-
-   unsigned int Converter::HelperRoIEndcapSector::sectorID() const {
-
-      return BitOp::getValue( &m_sector, 0x7e );
-   }
-
-   ////////////////////////////////////////////////////////////////////////////////
-   //                                                                            //
-   //   Functions of the Converter::HelperRoIForwardSector class                 //
-   //                                                                            //
-   ////////////////////////////////////////////////////////////////////////////////
-
-   unsigned int Converter::HelperRoIForwardSector::sectorID() const {
-
-      return BitOp::getValue( &m_sector, 0x3e );
-   }
-
-   ////////////////////////////////////////////////////////////////////////////////
-   //                                                                            //
-   //   Functions of the Converter::HelperRDOSector class                        //
-   //                                                                            //
-   ////////////////////////////////////////////////////////////////////////////////
-
-   void Converter::HelperRDOSector::addFirst( unsigned int rdo_word ) {
-
-      m_word &= Cand1InverseMask; // Zero out all quantities of the first candidate
-
-      BitOp::sImposeNBits( &m_word, 1, BitOp::getValue( &rdo_word, Converter::RoIandOverlapMask ) ); // RoI and overlap bits
-      BitOp::sImposeNBits( &m_word, 19, BitOp::getValue( &rdo_word, Converter::PtMask ) );           // Pt
-      if( rdo_word & Converter::MoreCandInSec ) BitOp::setBit( &m_word, 0 );                         // More than two cand. in sec.
-      if( rdo_word & Converter::MoreCandInRoI ) BitOp::setBit( &m_word, 25 );                        // More than two cand. in RoI
-
-      BitOp::sImposeNBits( &m_sector, 0, BitOp::getValue( &rdo_word, Converter::RDO_SectorAddressMask ) );
-
-      return;
-   }
-
-   void Converter::HelperRDOSector::addSecond( unsigned int rdo_word ) {
-
-      m_word &= Cand2InverseMask; // Zero out all quantities of the second candidate
-
-      BitOp::sImposeNBits( &m_word, 10, BitOp::getValue( &rdo_word, Converter::RoIandOverlapMask ) ); // RoI and overlap bits
-      BitOp::sImposeNBits( &m_word, 22, BitOp::getValue( &rdo_word, Converter::PtMask ) );            // Pt
-      if( rdo_word & Converter::MoreCandInSec ) BitOp::setBit( &m_word, 0 );                          // More than two cand. in sec.
-      if( rdo_word & Converter::MoreCandInRoI ) BitOp::setBit( &m_word, 26 );                         // More than two cand. in RoI
-
-      BitOp::sImposeNBits( &m_sector, 0, BitOp::getValue( &rdo_word, Converter::RDO_SectorAddressMask ) );
-
-      return;
-   }
-
-   ////////////////////////////////////////////////////////////////////////////////
-   //                                                                            //
-   //   Functions of the Converter::HelperRDOBarrelSector class                  //
-   //                                                                            //
-   ////////////////////////////////////////////////////////////////////////////////
-
-   unsigned int Converter::HelperRDOBarrelSector::sectorID() const {
-
-      return BitOp::getValue( &m_sector, 0x3e );
-   }
-
-   ////////////////////////////////////////////////////////////////////////////////
-   //                                                                            //
-   //   Functions of the Converter::HelperRDOEndcapSector class                  //
-   //                                                                            //
-   ////////////////////////////////////////////////////////////////////////////////
-
-   unsigned int Converter::HelperRDOEndcapSector::sectorID() const {
-
-      return BitOp::getValue( &m_sector, 0x7e );
-   }
-
-   ////////////////////////////////////////////////////////////////////////////////
-   //                                                                            //
-   //   Functions of the Converter::HelperRDOForwardSector class                 //
-   //                                                                            //
-   ////////////////////////////////////////////////////////////////////////////////
-
-   unsigned int Converter::HelperRDOForwardSector::sectorID() const {
-
-      return BitOp::getValue( &m_sector, 0x3e );
-   }
-
-   ////////////////////////////////////////////////////////////////////////////////
-   //                                                                            //
-   //   Output operator for helper classes                                       //
-   //                                                                            //
-   ////////////////////////////////////////////////////////////////////////////////
-
-std::string
-Converter::HelperSector::toString() const {
-
-      std::ostringstream output;
-      output << " ------ sector word ------" << std::endl;
-      output << "  system     = " << system() << std::endl;
-      output << "  m_word     = 0x" << std::hex << std::setw(8) << std::setfill('0')
-             << m_word << std::endl;
-      output << "  m_sector   = 0x" << std::hex << std::setw(2) << std::setfill('0')
-             << m_sector << std::endl;
-      output << "  sectorID   = " << std::dec << sectorID() << std::endl;
-      output << "  sub-system = ";
-      if( subSystem() == Converter::HelperRoISector::A_side ) {
-         output << "A side" << std::endl;
-      } else if( subSystem() == Converter::HelperRoISector::C_side ) {
-         output << "C side" << std::endl;
-      }
-      output << " -------------------------";
-
-      return output.str();
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.h
deleted file mode 100644
index 3083a78b63eb..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Converter.h
+++ /dev/null
@@ -1,183 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Converter.h 707664 2015-11-13 05:36:00Z ssnyder $
-#ifndef TRIGT1MUCTPI_CONVERTER_H
-#define TRIGT1MUCTPI_CONVERTER_H
-
-// STL include(s):
-#include <vector>
-#include <iostream>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/StatusCode.h"
-
-// Forward declaration(s):
-namespace LVL1MUONIF {
-  class Lvl1MuCTPIInput;
-}
-
-namespace LVL1MUCTPI {
-
-   /**
-    *  @short Class that can be used to convert a Muon_ROI and MuCTPI_RDO objects into Lvl1MuCTPIInput
-    *
-    *         When converting RoIs:
-    *         First the muon RoIs should be extracted from the LVL1_ROI object into
-    *         a vector of 'unsigned int'-s. The Converter::convertRoIs() function is
-    *         then able to fill a Lvl1MuCTPIInput object with the data extracted from
-    *         the RoIs.
-    *
-    *         When converting the data words from MuCTPI_RDO:
-    *         The data words can be passed to the Converter::converRDO() function
-    *         difectly with MuCTPI_RDO::dataWord().
-    *
-    *         I've tried making it as light-weight as possible, so that it wouldn't
-    *         depend on the rest of the actual MuCTPI simulation.
-    *
-    *    @see LVL1MUONIF::Lvl1MuCTPIInput
-    *    @see MuCTPI_RDO
-    *    @see LVL1_ROI
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 707664 $
-    * $Date: 2015-11-13 06:36:00 +0100 (Fri, 13 Nov 2015) $
-    */
-   class Converter {
-
-   public:
-      /// This function converts the RoIs in the RoIBResult back to the input format
-      static StatusCode convertRoIs( const std::vector< unsigned int >& roi_vector,
-                                     LVL1MUONIF::Lvl1MuCTPIInput* muctpi_input );
-      /// This function converts the data words in the RDO back to the input format
-      static StatusCode convertRDO( const std::vector< unsigned int >& rdo_vector,
-                                    unsigned int bcid,
-                                    LVL1MUONIF::Lvl1MuCTPIInput* muctpi_input );
-
-   private:
-      enum SectorType { Barrel, Endcap, Forward };
-      static SectorType getSectorType( unsigned int sector_address );
-      static unsigned int getRoISectorAddress( unsigned int roi_word );
-      static bool isRoIFirstCand( unsigned int roi_word );
-
-      static unsigned int getRDOSectorAddress( unsigned int rdo_word );
-      static unsigned int getRDOBCID( unsigned int rdo_word );
-      static bool isRDOFirstCand( unsigned int rdo_word );
-
-      //
-      // The following are private, helper classes to ease the conversion:
-      //
-
-      class HelperSector {
-
-      public:
-         HelperSector() { m_word = 0xc7ffffff; m_sector = 0; }
-         HelperSector& operator= ( const HelperSector& right );
-         virtual ~HelperSector() { }
-
-         virtual void addFirst( unsigned int roi_word ) = 0;
-         virtual void addSecond( unsigned int roi_word ) = 0;
-         unsigned int sectorWord() const { return m_word; }
-         unsigned int sectorAddress() const { return m_sector; }
-         enum MuonSubSystem { A_side = 1, C_side = 0 };
-         MuonSubSystem subSystem() const;
-
-         virtual unsigned int sectorID() const = 0;
-         virtual std::string system() const = 0;
-
-         std::string toString() const;
-
-      protected:
-         unsigned int m_word;
-         unsigned int m_sector;
-
-      }; // class HelperSector
-
-      class HelperRoISector : public HelperSector {
-
-      public:
-         virtual void addFirst( unsigned int roi_word );
-         virtual void addSecond( unsigned int roi_word );
-
-      }; // class HelperRoISector
-
-      class HelperRoIBarrelSector : public HelperRoISector {
-
-      public:
-         virtual unsigned int sectorID() const;
-         virtual std::string system() const { return "Barrel"; }
-
-      }; // class HelperRoIBarrelSector
-
-      class HelperRoIEndcapSector : public HelperRoISector {
-
-      public:
-         virtual unsigned int sectorID() const;
-         virtual std::string system() const { return "Endcap"; }
-
-      }; // class HelperRoIEndcapSector
-
-      class HelperRoIForwardSector : public HelperRoISector {
-
-      public:
-         virtual unsigned int sectorID() const;
-         virtual std::string system() const { return "Forward"; }
-
-      }; // class HelperRoIForwardSector
-
-      class HelperRDOSector : public HelperSector {
-
-      public:
-         virtual void addFirst( unsigned int roi_word );
-         virtual void addSecond( unsigned int roi_word );
-
-      }; // class HelperRDOSector
-
-      class HelperRDOBarrelSector : public HelperRDOSector {
-
-      public:
-         virtual unsigned int sectorID() const;
-         virtual std::string system() const { return "Barrel"; }
-
-      }; // class HelperRDOBarrelSector
-
-      class HelperRDOEndcapSector : public HelperRDOSector {
-
-      public:
-         virtual unsigned int sectorID() const;
-         virtual std::string system() const { return "Endcap"; }
-
-      }; // class HelperRDOEndcapSector
-
-      class HelperRDOForwardSector : public HelperRDOSector {
-
-      public:
-         virtual unsigned int sectorID() const;
-         virtual std::string system() const { return "Forward"; }
-
-      }; // class HelperRDOForwardSector
-
-
-      //
-      // Constants:
-      //
-      static const unsigned int RoIandOverlapMask;
-      static const unsigned int PtMask;
-      static const unsigned int RoI_SectorAddressMask;
-      static const unsigned int RDO_SectorAddressMask;
-      static const unsigned int RoI_FirstCandMask;
-      static const unsigned int RDO_FirstCandMask;
-      static const unsigned int MoreCandInRoI;
-      static const unsigned int MoreCandInSec;
-      static const unsigned int Cand1InverseMask;
-      static const unsigned int Cand2InverseMask;
-
-   }; // class Converter
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_CONVERTER_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Detector.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Detector.h
deleted file mode 100644
index a5db3ded440a..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Detector.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Detector.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_DETECTOR_H
-#define TRIGT1MUCTPI_DETECTOR_H
-
-namespace LVL1MUCTPI {
-
-  /**
-  *******************************************************************
-  *
-  *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-  *
-  *    @short Definition of the detector types and Hemispheres
-  *
-  *           This Header file defines the different detetcor types
-  *           and Hemispheres which exists in the Muon Trigger system
-  *           of ATLAS
-  *
-  *   @author  Author: Thorsten Wengler
-  *  @version $Revision: 362102 $
-  *
-  *******************************************************************
-  */
-
-  /// Detector type enumeration
-  /**
-  * This enumeration is used to identify the detector type of a given muon
-  * candidate. The ATLAS muon system is divided into 3 parts: barrel,
-  * endcap and forward.
-  */
-  enum Detector { BARREL = 0, ENDCAP = 1, FORWARD = 2 };
-  /// Detector hemisphere enumeration
-  /**
-  * This enumeration is used to identify which half of the detector a given
-  * muon candidate is coming from. The values POSITIVE and NEGATIVE state
-  * the sign of eta in the given part of the detector.
-  */
-  enum Hemisphere { POSITIVE = 1, NEGATIVE = 0 };
-
-}
-
-#endif // TRIGT1MUCTPI_DETECTOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.cxx
deleted file mode 100644
index 1054f11d4ff7..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.cxx
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EventID.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// STL include(s):
-#include <cassert>
-#include <iostream>
-
-// Local include(s):
-#include "EventID.h"
-#include "EventIDSingleton.h"
-
-/*******************************************************************
- * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
- *
- * Implementation of class EventID
- * @author   Author: Thorsten Wengler
- * @version $Revision: 362102 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-  EventID::EventID() {
-
-    // get the pointer to the EventID Singleton
-    m_eventIDKeeper = EventIDSingleton::instance();
-    if( !m_eventIDKeeper ) {
-      std::cout << "EventIDSingleton.Instance did not return a pointer" << std::endl;
-      assert( 0 ) ;
-    }
-
-  }
-
-  EventID::~EventID() {
-
-  }
-
-  void EventID::resetBCID() {
-
-    m_eventIDKeeper->resetBCID();
-    return;
-
-  }
-
-  void EventID::BCID( unsigned int newBCID ) {
-
-    m_eventIDKeeper->BCID( newBCID );
-    return;
-
-  }
-
-  unsigned int EventID::BCID() {
-
-    return m_eventIDKeeper->BCID();
-
-  }
-
-  void EventID::resetEvID() {
-
-    m_eventIDKeeper->resetEvID();
-    return;
-
-  }
-
-  void EventID::setEvID( unsigned int newID ) {
-
-    m_eventIDKeeper->setEvID( newID );
-    return;
-
-  }
-
-  void EventID::incrementEvID() {
-
-    m_eventIDKeeper->incrementEvID();
-    return;
-
-  }
-
-  unsigned int EventID::getEvID() {
-
-    return m_eventIDKeeper->getEvID();
-
-  }
-
-  unsigned int EventID::getTriggerType() {
-
-    return m_eventIDKeeper->getTriggerType();
-
-  }
-
-  void EventID::setTriggerType( unsigned int theType ) {
-
-    m_eventIDKeeper->setTriggerType( theType );
-    return;
-
-  }
-
-  bool EventID::getMonitorEvent() {
-
-    return m_eventIDKeeper->getMonitorEvent();
-
-  }
-
-  void EventID::setMonitorEvent( bool doMonitor ) {
-
-    m_eventIDKeeper->setMonitorEvent( doMonitor );
-    return;
-
-  }
-
-  unsigned int EventID::getRunNumber() {
-
-    return m_eventIDKeeper->getRunNumber();
-
-  }
-
-  void EventID::setRunNumber( unsigned int runNumber ) {
-
-    m_eventIDKeeper->setRunNumber( runNumber );
-    return;
-
-  }
-
-  unsigned int EventID::getECRC() {
-
-    return m_eventIDKeeper->getECRC();
-
-  }
-
-  void EventID::setECRC( unsigned int ECRC ) {
-
-    m_eventIDKeeper->setECRC( ECRC );
-    return;
-
-  }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.h
deleted file mode 100644
index 8cda8df3548b..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventID.h
+++ /dev/null
@@ -1,109 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EventID.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_EVENTID_H
-#define TRIGT1MUCTPI_EVENTID_H
-
-namespace LVL1MUCTPI {
-
-  class EventIDSingleton;
-
-  /**
-   ************************************************************************
-   *
-   *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ 
-   *
-   *    @short A class which handels the EventID
-   *
-   *           The EventID class can be instantiated in any object that 
-   *           needs access to the EventID. The actual EventID is kept
-   *           in the EventIDSingleton, as their should be only one
-   *
-   *      @see EventIDSingleton
-   *   @author Thorsten Wengler
-   *  @version $Revision: 362102 $
-   *
-   ************************************************************************
-   */
-  class EventID {
-
-  public:
-    /**
-     * The constructor 
-     */
-    EventID();
-    /**
-     * The destructor 
-     */
-    ~EventID();
-    /**
-     * reset the BCID to ZERO
-     */
-    void resetBCID();
-    /**
-     * set the BCID to newBCID
-     * @param newBCID the new BCID
-     */
-    void BCID( unsigned int newBCID );
-    /**
-     * get the BCID
-     * @return the BCID
-     */
-    unsigned int BCID();
-    /**
-     * reset the EventID to ZERO
-     */
-    void resetEvID();
-    /**
-     * set the EventID to newID
-     * @param newID the new Event ID
-     */
-    void setEvID( unsigned int newID );
-    /**
-     * Increment the EventID by one
-     */
-    void incrementEvID();
-    /**
-     * Get the current EventID
-     * @return the current EventID
-     */
-    unsigned int getEvID();
-    /**
-     * Get the trigger Type word
-     * @return the trigger type word
-     */
-    unsigned int getTriggerType();
-    /**
-     * Set the trigger Type word
-     * @param theType the new trigger type word
-     */
-    void setTriggerType( unsigned int theType );
-    /**
-     * Get the monitor Event bit
-     * @return if true event will be monitored, if false not
-     */
-    bool getMonitorEvent();
-    /**
-     * Set the monitor Event bit
-     * @param doMonitor if true event will be monitored, if false not
-     */
-    void setMonitorEvent( bool doMonitor );
-
-    unsigned int getRunNumber();
-    void setRunNumber( unsigned int runNumber );
-
-    unsigned int getECRC();
-    void setECRC( unsigned int ECRC );
-
-  private:
-    EventIDSingleton* m_eventIDKeeper;
-
-  }; // class EventID
-
-} // namespace LVL1MUCTPI
-
-#endif  // TRIGT1MUCTPI_EVENTID_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.cxx
deleted file mode 100644
index 9f9755d1e1ed..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.cxx
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EventIDSingleton.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// Local include(s):
-#include "EventIDSingleton.h"
-
-/*******************************************************************
- * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
- *
- * Implementation of class EventIDSingleton
- * @author   Author: Thorsten Wengler
- * @version $Revision: 362102 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-  EventIDSingleton* EventIDSingleton::m_theOnlyEventID = 0;
-
-  EventIDSingleton::EventIDSingleton()
-    : m_eventID( 0 ), m_ECRC( 0 ), m_triggerType( 0 ), m_BCID( 0 ),
-      m_runNumber( 0 ), m_monitorEventBit( false ) {
-
-  }
-
-  EventIDSingleton::~EventIDSingleton() {
-
-  }
-
-  EventIDSingleton* EventIDSingleton::instance() {
-
-    if ( m_theOnlyEventID == 0 ) {
-      m_theOnlyEventID = new EventIDSingleton();
-    }
-    return m_theOnlyEventID;
-
-  }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.h
deleted file mode 100644
index a6c0b783aa4c..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/EventIDSingleton.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EventIDSingleton.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_EVENTIDSINGLETON_H
-#define TRIGT1MUCTPI_EVENTIDSINGLETON_H
-
-namespace LVL1MUCTPI {
-
-  /**
-   ************************************************************************
-   *
-   *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ 
-   *
-   *    @short Keeps track of the EventID
-   *
-   *           The EventIDSingleton keeps track of the EventID. It is 
-   *           implemented as a singleton, as the EventID is used in
-   *           several places, but should only exist once.
-   *
-   *      @see EventID
-   *   @author  Author: Thorsten Wengler $
-   *  @version $Revision: 362102 $
-   *
-   *
-   ************************************************************************
-   */
-  class EventIDSingleton {
-
-  public:
-    /**
-     * This is the static memember function of the Singleton, which 
-     * instantiates the only object of EventIDSingleton. 
-     * @return Pointer to the only instantiation of the EventIDSingleton.
-     */
-    static EventIDSingleton* instance();
-    ~EventIDSingleton();
-    /**
-     * reset the BCID to ZERO
-     */
-    void resetBCID() { m_BCID = 0; }
-    /**
-     * set the EventID to newBCID
-     * @param newBCID the new Event ID
-     */
-    void BCID( unsigned int newBCID ) { m_BCID = newBCID; }
-    /**
-     * get the EventID to newBCID
-     * @return the new Event ID
-     */
-    unsigned int BCID() { return m_BCID; }
-    /**
-     * reset the EventID to ZERO
-     */
-    void resetEvID() { m_eventID = 0; }
-    /**
-     * set the EventID to newID
-     * @param newID the new Event ID
-     */
-    void setEvID( unsigned int newID ) { m_eventID = newID; }
-    /**
-     * Increment the EventID by one
-     */
-    void incrementEvID() { ++m_eventID; }
-    /**
-     * Get the current EventID
-     * @return the current EventID
-     */
-    unsigned int getEvID() { return m_eventID; }
-    /**
-     * Get the trigger Type word
-     * @return the trigger type word
-     */
-    unsigned int getTriggerType() { return m_triggerType; }
-    /**
-     * Set the trigger Type word
-     * @param theType the new trigger type word
-     */
-    void setTriggerType( unsigned int theType ) { m_triggerType = theType; }
-    /**
-     * Get the monitor Event bit
-     * @return if true event will be monitored, if false not
-     */
-    bool getMonitorEvent() { return m_monitorEventBit; }
-    /**
-     * Set the monitor Event bit
-     * @param doMonitor if true event will be monitored, if false not
-     */
-    void setMonitorEvent( bool doMonitor ) { m_monitorEventBit = doMonitor; }
-
-    unsigned int getRunNumber() { return m_runNumber; }
-    void setRunNumber( unsigned int runNumber ) { m_runNumber = runNumber; }
-
-    unsigned int getECRC() { return m_ECRC; }
-    void setECRC( unsigned int ECRC ) { m_ECRC = ECRC; }
-
-  private:
-
-    static EventIDSingleton  *m_theOnlyEventID;
-
-    /// it's a Singleton: so the constructor is private
-    EventIDSingleton();
-    unsigned int m_eventID;        // the actual EventID
-    unsigned int m_ECRC;           // the event counter reset counter
-    unsigned int m_triggerType;    // the trigger type word
-    unsigned int m_BCID;           // the BCID
-    unsigned int m_runNumber;      // the run number
-    bool m_monitorEventBit;        // the Monitor selector
-
-  }; // class EventIDSingleton
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_EVENTIDSINGLETON_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.cxx
deleted file mode 100644
index 1a0a0e6d0434..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.cxx
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: GenTestPattern.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// STL include(s):
-#include <cstdlib>
-#include <ctime>
-#include <iostream>
-#include <fstream>
-
-// TrigT1 include(s):
-#include "TrigT1Interfaces/Lvl1MuCTPIInput.h"
-
-// Local include(s):
-#include "GenTestPattern.h"
-#include "../Mioct/SectorID.h"
-#include "MuonCandidate.h"
-#include "EventID.h"
-
-/*******************************************************************
- * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ 
- *
- * Implementation of class GenTestPattern
- * @author   Author: Thorsten Wengler
- * @version $Revision: 362102 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-  // Constructor of the GenTestPattern class
-  GenTestPattern::GenTestPattern( LVL1MUONIF::Lvl1MuCTPIInput* theLvl1Input ) {
-
-    m_input = theLvl1Input;
-    //  initialize random number generator
-    srand( static_cast< unsigned int >( time( 0 ) ) );
-
-  }
-
-  // method to directly fill sectors
-  void GenTestPattern::fillSectorDirect( const MuonCandidate& muonCand ) {
-
-    // just call the fill function with all the separat arguments
-    this->fillSectorDirect( muonCand.secID(), muonCand.bcid(), muonCand.roi1(), muonCand.roi2(),
-                            muonCand.ovl1(), muonCand.ovl2(), muonCand.pt1(), muonCand.pt2(),
-                            muonCand.twoCand1(), muonCand.twoCand2(), muonCand.gtTwoCandInSec() );
-    return;
-
-  }
-
-
-  // method to directly fill sectors with candidates read from a file
-  void GenTestPattern::fillEventFromFile( std::string fileName ) {
-
-    std::ifstream fileStream( fileName.c_str() );
-    if ( ! fileStream ) {
-      std::cout << "Could not open : " << fileName << std::endl;
-      std::cout << "==> no candidates ! " << std::endl;
-      exit( -1 );
-    }
-
-    unsigned int sysID; 
-    unsigned int subSysID; 
-    unsigned int SectorNo; 
-    SectorID id;  
-    unsigned int bcid; 
-    unsigned int roi1; 
-    unsigned int roi2; 
-    unsigned int ovl1; 
-    unsigned int ovl2; 
-    unsigned int pt1; 
-    unsigned int pt2; 
-    bool twoCand1; 
-    bool twoCand2; 
-    bool twoCandinSector;
-
-    while ( ! fileStream.eof() ) {
-
-      fileStream >> sysID;
-      fileStream >> subSysID >> SectorNo >> bcid >> roi1 >> roi2 >> ovl1 >> ovl2
-                 >> pt1  >> pt2 >> twoCand1 >> twoCand2 >> twoCandinSector;
-
-      if( fileStream.eof() ) break;
-      this->fillSectorDirect( id.ret( sysID, subSysID, SectorNo), bcid, roi1, roi2,
-                              ovl1, ovl2, pt1, pt2, twoCand1, twoCand2, twoCandinSector );
-
-      std::cout << sysID << " " << subSysID << " " << SectorNo << " "
-                << bcid << " " << roi1 << " " << roi2 << " "
-                << ovl1 << " " << ovl2 << " " << pt1 << " " << pt2 << " "
-                << twoCand1 << " " << twoCand2 << " " << twoCandinSector << std::endl;
-
-    }
-
-    return;
-
-  }
-
-  // method to directly fill sectors
-  void GenTestPattern::fillSectorDirect( SectorID theSectorID, unsigned int bcid, unsigned int roi1, unsigned int roi2,
-                                         unsigned int ovl1, unsigned int ovl2, unsigned int pt1, unsigned int pt2,
-                                         bool twoCand1, bool twoCand2, bool twoCandInSec ) {
-
-    unsigned int systemAddress = theSectorID.getDetectorType();
-    unsigned int subSystemAddress = theSectorID.getRapidityRegion();
-    unsigned int id = theSectorID.getSectorNumber();
-
-    LVL1MUONIF::Lvl1MuSectorLogicData *secIn = 0;
-    if( systemAddress == 0 ) {
-      secIn = new LVL1MUONIF::Lvl1MuBarrelSectorLogicData();
-    } else if( systemAddress == 1 ) {
-      secIn = new LVL1MUONIF::Lvl1MuEndcapSectorLogicData();
-    } else if( systemAddress == 2 ) {
-      secIn = new LVL1MUONIF::Lvl1MuForwardSectorLogicData();
-    } else {
-      std::cerr << "\"systemAddress\" is in non-defined state." << std::endl;
-      std::cerr << "There is very serious error with the code." << std::endl;
-      exit( -1 );
-    }
-
-    secIn->bcid( bcid );
-    secIn->roi( 0, roi1 );
-    secIn->roi( 1, roi2 );
-    secIn->ovl( 0, ovl1 );
-    secIn->ovl( 1, ovl2 );
-    secIn->pt( 0, pt1 );
-    secIn->pt( 1, pt2 );
-
-    if( twoCand1 ) secIn->set2candidates( 0 );
-    else secIn->clear2candidates( 0 );
-
-    if( twoCand2 ) secIn->set2candidates( 1 );
-    else secIn->clear2candidates( 1 );
-
-    if( twoCandInSec ) secIn->set2candidatesInSector();
-    else secIn->clear2candidatesInSector();
-
-    m_input->setSectorLogicData( *secIn, systemAddress, subSystemAddress, id );
-
-    delete secIn;
-    return;
-
-  }
-
-  // Generate a random number
-  unsigned int GenTestPattern::randomNumber( unsigned int lower, unsigned int upper ) {
-
-    if( lower > upper ) std::swap( lower, upper );
-    double range = upper - lower + 1;
-
-    // I already had a lot of trouble with this peace of code,
-    // so now I write out everything explicitly.
-    return ( lower + static_cast< unsigned int >( static_cast< double >( range * rand() ) / static_cast< double >( RAND_MAX + 1.0 ) ) );
-
-  }
-
-  // Generate candidates randomly
-  MuonCandidate GenTestPattern::randomCandidate() {
-
-    MuonCandidate rndCandidate;
-
-    // first figure out which of Barrel, Endcap, Forward is allowed,
-    // choose one randomly
-    unsigned int systemID = 0;
-    unsigned int sysAllowed = this->rndRange().allowSystems();
-    if( ( sysAllowed > 7 ) || ( sysAllowed < 1 ) ) sysAllowed = 7;
-    if( sysAllowed >= 7 ) {     // all three subsystems allowed
-      systemID = this->randomNumber( 0, 2 );
-    } else if ( ( sysAllowed > 2 ) && ( sysAllowed != 4 ) ) { // 2 out of three
-      systemID = this->randomNumber( 0, 1 );           // Barrel or Endcap
-      if( sysAllowed == 5 ) systemID = systemID * 2;   // Barrel or Forward
-      if( sysAllowed == 6 ) ++systemID;                // Endcap or Forward
-    } else { // only one Subsystem
-      if( sysAllowed == 1 ) systemID = 0; // Barrel
-      if( sysAllowed == 2 ) systemID = 1; // Endcap
-      if( sysAllowed == 4 ) systemID = 2; // Forward
-    }
-
-    // Now choose the Hemisphere
-    unsigned int theHem;
-    unsigned int hemAllowed = this->rndRange().allowHemispheres();
-    if( ( hemAllowed < 1 ) || ( hemAllowed > 3 ) ) hemAllowed = 3;
-    if( hemAllowed == 3 ) {
-      theHem = this->randomNumber( 0, 1 ); // both Hemispheres
-    } else {
-      theHem = hemAllowed - 1;
-    }
-
-    // Now we can make all choices that depend on the system
-    unsigned int minRoI = 0;
-    unsigned int maxRoI = 0;
-    unsigned int minSecNumber = 0;
-    unsigned int maxSecNumber = 0;
-    if( systemID == 0 ) {
-      minSecNumber = this->rndRange().minBarrelSectorID();
-      maxSecNumber = this->rndRange().maxBarrelSectorID();
-      minRoI = this->rndRange().minBarrelRoI();
-      maxRoI = this->rndRange().maxBarrelRoI();
-    } else if( systemID == 1 ) {
-      minSecNumber = this->rndRange().minEndcapSectorID();
-      maxSecNumber = this->rndRange().maxEndcapSectorID();
-      minRoI = this->rndRange().minEndcapRoI();
-      maxRoI = this->rndRange().maxEndcapRoI();
-    } else if( systemID == 2 ) {
-      minSecNumber = this->rndRange().minForwardSectorID();
-      maxSecNumber = this->rndRange().maxForwardSectorID();
-      minRoI = this->rndRange().minForwardRoI();
-      maxRoI = this->rndRange().maxForwardRoI();
-    }
-
-
-    // Dial the sector number
-    unsigned int theSecNumber = 0;
-    theSecNumber = this->randomNumber( minSecNumber, maxSecNumber );
-
-    // now set the ID in the Muon candidate
-    SectorID id;
-    rndCandidate.secID( id.ret( systemID,theHem,theSecNumber ) );
-
-    // Choose Pt for both candidates (need to order them)
-    unsigned int firstPt  = this->randomNumber( this->rndRange().minPt(), this->rndRange().maxPt() );
-    unsigned int secondPt = this->randomNumber( this->rndRange().minPt(), this->rndRange().maxPt() );
-    // order candidates - first is >= second
-    if( firstPt < secondPt ) std::swap( firstPt, secondPt );
-
-    // The first candidate -----------------------------------
-    rndCandidate.pt1( firstPt );                           //Pt value
-    unsigned int firstRoI = this->randomNumber( minRoI, maxRoI );
-    rndCandidate.roi1( firstRoI );                       // RoI value
-    // The Overlap flag
-    unsigned int firstOvl = 0;
-    if( systemID == 0 ) {                                          // Barrel
-      // the Barrel-Barrel Overlap and Barrel-Endcap Overlap
-      if( firstRoI <= 2 || ( firstRoI % 2 != theSecNumber % 2 ) ) firstOvl |= 1;
-      if( firstRoI >= 20 ) firstOvl |= 2;
-    } else if( systemID == 1 ) {                                   // Endcap
-      if( firstRoI <= 7 ) firstOvl |= 1; // Barrel-Endcap Overlap
-    } else if( systemID == 2 ) {                                   // Forward
-      // no overlap in forward sectors possible
-    }
-    rndCandidate.ovl1( firstOvl );
-    // is it allowed to pretend that there were > 1 candiates in one pad?
-    bool twoInPad1 = false;
-    if( this->rndRange().allowForceGT1InPad1Flag() == 1 ) { // random
-      if( this->randomNumber( 0, 1 ) == 1 ) twoInPad1 = true;
-    } else if( this->rndRange().allowForceGT1InPad1Flag() == 2 ) { // always set
-      twoInPad1 = true;
-    }
-    rndCandidate.twoCand1( twoInPad1 );
-    // end choosing first candidate
-
-    // Now decide if there will be a second candidate
-    bool iWantTwo = false;
-    if( this->rndRange().allowForce2Cand() == 1 ) { // one or two randomly
-      if( this->randomNumber(0,1) == 1 ) iWantTwo = true;
-    } else if( this->rndRange().allowForce2Cand() == 2 ) { // always 2
-      iWantTwo = true;
-    }
-
-    if( iWantTwo ) {
-
-      // The second candidate -----------------------------------
-      rndCandidate.pt2( secondPt );                           //Pt value
-      unsigned int secondRoI;   // second RoI (should be diff. from first)
-      while( ( secondRoI = this->randomNumber( minRoI, maxRoI ) ) == firstRoI )
-        ;
-      rndCandidate.roi2( secondRoI );                       // RoI value
-      // The Overlap flag
-      unsigned int secondOvl = 0;
-      if( systemID == 0 ) {                                          // Barrel
-	// the Barrel-Barrel Overlap and Barrel-Endcap Overlap
-	if( secondRoI <= 2 || ( secondRoI % 2 != theSecNumber % 2 ) ) secondOvl |= 1;
-	if( secondRoI >= 20 ) secondOvl |= 2;
-      } else if( systemID == 1 ) {                                   // Endcap
-	if( secondRoI <= 7 ) secondOvl |= 1; // Barrel-Endcap Overlap
-      } else if( systemID == 2 ) {                                  // Forward
-	// no overlap in forward sectors possible
-      }
-      rndCandidate.ovl2( secondOvl );
-      // is it allowed to pretend that there were > 1 candiates in one pad?
-      bool twoInPad2 = false;
-      if( this->rndRange().allowForceGT1InPad2Flag() == 1 ) { // random
-	if( this->randomNumber( 0, 1 ) == 1) twoInPad2 = true ;
-      } else if( this->rndRange().allowForceGT1InPad2Flag() == 2 ) { // always
-	twoInPad2 = true;
-      }
-      rndCandidate.twoCand2( twoInPad2 );
-
-      // since we have two candidates, we can decide if we want to pretend
-      // there were more than 2 in this sector
-      bool gtTwoInSec = false;
-      if( this->rndRange().allowForceGT2InSecFlag() == 1 ) { // random
-	if( this->randomNumber( 0, 1 ) == 1 ) gtTwoInSec = true;
-      } else if( this->rndRange().allowForceGT2InSecFlag() == 2 ) { // always
-	gtTwoInSec = true;
-      }
-      rndCandidate.gtTwoCandInSec( gtTwoInSec );
-
-    }  // end second candidate
-
-    // set the BCID
-    EventID theEventID;            //  get access to the EventID singleton
-    rndCandidate.bcid( theEventID.BCID() );
-
-    return rndCandidate;
-
-  }
-
-  // check if a generated candidate already exists in the list
-  bool GenTestPattern::notUniqueCandidate( MuonCandidate& muonCand ) {
-
-    bool isNotUnique = false;
-
-    // iterate over the list and check the sector ID's
-    if( ! m_candidateList.empty() ){              // is the list still empty?
-      std::list< MuonCandidate >::const_iterator it;
-      for( it = m_candidateList.begin(); it != m_candidateList.end(); ++it ) {
-        if( it->secID() == muonCand.secID() ) isNotUnique = true;
-      }
-    }
-
-    return isNotUnique;
-
-  }
-
-  // Generate a random event
-  void GenTestPattern::randomEvent( unsigned int lowCand, unsigned int highCand ) {
-
-    // get access to the EventID singleton
-    EventID theEventID;
-
-    // reset the event holders
-    this->clearEvent();
-
-    // get the BCID for this event
-    theEventID.BCID( this->randomNumber( this->rndRange().minBCID(), this->rndRange().maxBCID() ) );
-
-    unsigned int numberOfCand = this->randomNumber( lowCand, highCand );
-
-    for( unsigned int i = 0; i < numberOfCand; ++i ) {
-      MuonCandidate muonCand;
-      do {               // need to check that cand. is unique in this event
-        muonCand = this->randomCandidate();
-      } while( this->notUniqueCandidate( muonCand ) );
-      m_candidateList.push_back( muonCand );
-    }
-
-    return;
-
-  }
-
-  // Generate one complete event and fill it into the input class(es)
-  void GenTestPattern::generateEvent( unsigned int lowCand, unsigned int highCand ) {
-
-    // generate the Event
-    this->randomEvent( lowCand, highCand );
-
-    // fill the event into the Sector logic input class
-    if( m_candidateList.empty() ) {              // is the list still empty?
-      std::cout << " --- TRIED TO FILL EMPTY EVENT --- " << std::endl;
-    } else {
-      std::list< MuonCandidate >::iterator it ;
-      for( it = m_candidateList.begin(); it != m_candidateList.end(); ++it ) {
-        this->fillSectorDirect( (*it) ) ;
-      }
-    }
-
-    return;
-
-  }
-
-  // print the random event
-  void GenTestPattern::printRandomEvent() {
-
-    // iterate over the list and check the sector ID's
-    if( m_candidateList.empty() ){              // is the list still empty?
-      std::cout << " --- TRIED TO PRINT EMPTY EVENT --- GENERATE ONE FIRST --- " << std::endl;
-    } else {
-      std::list< MuonCandidate >::const_iterator it;
-      for( it = m_candidateList.begin(); it != m_candidateList.end(); ++it ) {
-        std::cout << ( *it );
-      }
-    }
-
-    return;
-
-  }
-
-  // Clear the list of sectors
-  void GenTestPattern::clearEvent() {
-
-    m_input->clearAll();
-    m_candidateList.clear();
-
-    return;
-
-  }
-
-
-  // Destructor of the GenTestPattern class - nothing to destruct
-  GenTestPattern::~GenTestPattern() {
-
-  }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.h
deleted file mode 100644
index aa8ed7bff744..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/GenTestPattern.h
+++ /dev/null
@@ -1,180 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: GenTestPattern.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_GENTESTPATTERN_H
-#define TRIGT1MUCTPI_GENTESTPATTERN_H
-
-// STL include(s):
-#include <string>
-#include <list>
-
-// Local include(s):
-#include "MuonCandidate.h"
-#include "RandomCandidateRange.h"
-
-// Forward declaration(s):
-namespace LVL1MUONIF {
-  class Lvl1MuCTPIInput;
-}
-
-namespace LVL1MUCTPI {
-
-  // Forward declaration(s):
-  class SectorID;
-
-  /**
-   *******************************************************************
-   *
-   *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ 
-   *
-   *    @short Generate Sector Logic test input
-   *
-   *           This class is used to generate test input data using 
-   *           the Lvl1MuCTPIInput interface class from the 
-   *           Sector Logic simulation. The constructor receives
-   *           a reference to a Lvl1MuCTPIInput object, which is
-   *           then filled using the Lvl1MuCTPIInput member 
-   *           functions.
-   *
-   *      @see Lvl1MuCTPIInput
-   *   @author  Author: Thorsten Wengler
-   *  @version $Revision: 362102 $
-   *
-   *******************************************************************
-   */
-  class GenTestPattern {
-
-  public:
-    /**
-     * The only constructor of the GenTestPattern class takes a 
-     * reference to an Lvl1MuCTPIInput object, which is to be filled
-     * by the test pattern
-     * @param theLvl1Input The Sector Logic input object to be filled with a test pattern
-     * @see Lvl1MuCTPIInput
-     */
-    GenTestPattern( LVL1MUONIF::Lvl1MuCTPIInput* theLvl1Input );
-    /**
-     * Set the sector by hand. The internal sector list is not used here
-     * but the sector is written to the Lvl1MuCTPIInput directly. There
-     * is no need to call putEvent after this.
-     * 
-     * @param theSectorID  The ID of the sector to be filled
-     * @param bcid         The BC ID
-     * @param roi1         Id of RoI candidate 1
-     * @param roi2         Id of RoI candidate 1
-     * @param ovl11        Overlay candidate 1
-     * @param ovl12        Overlay candidate 2
-     * @param pt1          momentum candidate 1
-     * @param pt2          momentum candidate 2
-     * @param twoCand1     more than one cand in pad candidate 1
-     * @param twoCand2     more than one cand in pad candidate 2
-     * @param twoCandInSec more than two candiates in sector
-     *
-     * @see GenTestPattern::putEvent()
-     */
-    void fillSectorDirect( SectorID theSectorID,
-			   unsigned int bcid,
-			   unsigned int roi1,
-			   unsigned int roi2,
-			   unsigned int ovl11,
-			   unsigned int ovl12,
-			   unsigned int pt1,
-			   unsigned int pt2,
-			   bool twoCand1,
-			   bool twoCand2,
-			   bool twoCandInSec );
-    /**
-     * Set the event by reading a list of single muon candidates from a
-     * file. This is usefule for tests which require frequent changes in
-     * candidate settings, as one does not need to recompile. The
-     * internal sector list is not used here but the sector is written
-     * to the Lvl1MuCTPIInput directly. There is no need to call
-     * putEvent after this. The file has the following format for each
-     * candidate (one line per candidate):
-     * sys-ID subSys-ID Sector-No bcid roi1 roi2 ovl1 ovl2 pt1 pt2
-     *   twoCand1 twoCand2 twoCandinSector
-     *
-     * @param fileName name of the file holding the candidates
-     */
-    void fillEventFromFile( std::string fileName );
-    /**
-     * second version of direct filler with a MuonCandidate Object
-     * as input
-     * @param muonCand the input candidate
-     */
-    void fillSectorDirect( const MuonCandidate& muonCand );
-    /**
-     * method to return the object holding the Range definitions
-     * for the random generation of muon candidates
-     * @return m_RandomMuonCandidateRange;
-     */
-    RandomCandidateRange& rndRange() { return m_RandomMuonCandidateRange; }
-    /**
-     * Reinitialize the random number generator with a new seed
-     * @param newSeed The new random number seed
-     */
-    static void reSeedRandomNumbers( unsigned int newSeed ){ srand( newSeed ); }
-    /**
-     * method to randomly generate a muon candidate. 
-     */
-    MuonCandidate randomCandidate();
-    /**
-     * Check if a given Muon candidate already exists in the list 
-     * of candidates data memeber
-     * @param muonCand the candidate to be checked
-     * @return true if the candidate already exists
-     */
-    bool notUniqueCandidate( MuonCandidate & muonCand );
-    /**
-     * Generate one random Event and fill it into the candidate list
-     * data memeber
-     * @param lowCand at least this many candidates
-     * @param highCand at most this many candidates
-     */
-    void randomEvent( unsigned int lowCand, unsigned int highCand );
-    /**
-     * this is the main event generation method
-     */
-    void generateEvent( unsigned int lowCand, unsigned int highCand );
-    /**
-     * print the event generated by randomEvent
-     */
-    void printRandomEvent();
-    /**
-     * Clear the input object of the sector logic of all
-     * entries
-     */
-    void clearEvent();
-    /**
-     * The destructor of the GenTestPattern class -
-     * nothing to destruct
-     */
-    ~GenTestPattern();
-
-  protected:
-
-    /**
-     * method to generate a random integer number between the lower and
-     * the upper bound
-     * @param lower Lower bound of Random number range
-     * @param upper Upper bound of Random number range
-     * @return random number
-     */
-    static unsigned int randomNumber( unsigned int lower, unsigned int upper );
-
-  private:
-
-    LVL1MUONIF::Lvl1MuCTPIInput* m_input;
-    std::list< MuonCandidate > m_candidateList;
-
-    RandomCandidateRange m_RandomMuonCandidateRange;
-
-  }; // class GenTestPattern
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_GENTESTPATTERN_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.cxx
deleted file mode 100644
index ccf0b3abd720..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.cxx
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-#include "MioctL1TopoConverter.h"
-
-namespace LVL1MUCTPI {
-
-  MioctL1TopoConverter::MioctL1TopoConverter( ): m_logger( "MioctL1TopoConverter" ){
-
-  }
-
-  MioctL1TopoConverter::~MioctL1TopoConverter() {
-
-  }
-
-  
-  
-  void MioctL1TopoConverter::setupParser(const std::string & inputfile) {
-    m_xmlParser.readConfiguration(inputfile);
-    m_xmlParser.parseConfiguration();
-  }
-
-  LVL1::MuCTPIL1TopoCandidate MioctL1TopoConverter::convertToL1Topo(const MioctID& mioctModuleID, const Sector& sector, bool isFirstCandidate) {
-    LVL1::MuCTPIL1TopoCandidate l1topoCand;
-
-    //check variable to make sure a match was found, otherwise issue warning
-    bool foundRoiMatch = false;
-    
-    // check varialble to make sure the TopoCell info is found for the RoI
-    bool foundTopoCellMatch = false;
-
-
-    // get access to the MuCTPI geometry and Pt encoding from Parser
-    MuCTPiGeometry muctpiGeo = m_xmlParser.getMuCTPiGeometry(); 
-    L1MuonPtEncoding  ptEnc = muctpiGeo.ptEncoding();
-
-    //Note in MioctModule terms we have: neg hemisphere / mod ID 0-7 and pos hemisphere / mod ID 0-7
-    //While from the parser we have mod ID 0-15, with 0-7 in neg hemisphere, and 8-15 in pos hemisphere
-    unsigned int mioctModNumber=0;
-
-    if (mioctModuleID.getRapidityRegion() == NEGATIVE){
-      mioctModNumber = mioctModuleID.getNumber();
-    } else if (mioctModuleID.getRapidityRegion() == POSITIVE){
-      mioctModNumber = mioctModuleID.getNumber() + 8;
-    } else {
-      REPORT_ERROR_MSG("Unknown Hemisphere description");
-    }
-
-    //Loop over Miocts to get the right one
-    std::vector<MioctGeometry> mioctVec = muctpiGeo.octants();
-    MioctGeometry thisMioctGeo;
-
-    for ( std::vector<MioctGeometry>::iterator it = mioctVec.begin(); it != mioctVec.end(); ++it){
-      if (it->mioctId() == mioctModNumber){
-	thisMioctGeo=(*it);
-	break;
-      }
-    }
-    
-    // Loop over the sectors in this Mioct to get the right one
-    std::vector<MioctSectorGeometry> mioctSecVec = thisMioctGeo.sectors();
-    std::vector<MioctTopoCellGeometry> topCellVec = thisMioctGeo.topoCells();
-    MioctSectorGeometry thisMioctSecGeo;
-
-    for (std::vector<MioctSectorGeometry>::iterator it = mioctSecVec.begin(); it != mioctSecVec.end(); ++it){
-      if (it->name() == sector.getIDString()) {
-	thisMioctSecGeo = (*it);
-	break;
-      }
-    }
-
-    // pick candidate one or two from input sector 
-    unsigned int inputPt;
-    unsigned int inputRoi;
-    if (isFirstCandidate) {
-      inputPt  = sector.getPtCand1();
-      inputRoi = sector.getROI1();
-    } else {
-      inputPt  = sector.getPtCand2();
-      inputRoi = sector.getROI2();
-    }
-    // Find the right ROI in the Geometry
-    std::vector<MioctROIGeometry> mioctRoiGeo = thisMioctSecGeo.ROIs();
-    MioctROIGeometry thisRoi;
-    // Loop over the RoIs in this sector to find the right one and get the equivalent eta/phi etc
-    for (  std::vector<MioctROIGeometry>::iterator it = mioctRoiGeo.begin(); it != mioctRoiGeo.end(); ++it) {
-      if (it->roiid() == inputRoi){
-	foundRoiMatch =true;
-	thisRoi = (*it);
-	break;
-      }
-    }
-
-    int thisieta = 0;
-    int thisiphi = 0;
-
-    if (!foundRoiMatch) {
-      REPORT_MSG(LVL1MUCTPI::WARNING,"No RoI match found for Sector: " << sector.getIDString() << "  RoI: " << inputRoi <<  " in MioctL1TopoConverter, returning 0 for eta/phi" << std::endl)
-	}
-    else {
-      // now loop over the topocell info and find the ieta and iphi values for this RoI
-      
-      for (  std::vector<MioctTopoCellGeometry>::iterator it = topCellVec.begin(); it != topCellVec.end(); ++it) {
-	if (it->etacode() == thisRoi.etacode() && it->phicode() == thisRoi.phicode()  ){
-	  thisieta = it->ieta();
-	  thisiphi = it->iphi();
-	  foundTopoCellMatch = true;
-	  break;
-	}
-      }
-    }
-    
-    if (!foundTopoCellMatch) {
-      REPORT_MSG(LVL1MUCTPI::WARNING,"No TopoCell match found for Sector: " << sector.getIDString() << "  RoI: " << inputRoi <<  " in MioctL1TopoConverter, returning 0 for ieta/iphi" << std::endl)
-	}
-
-
-    // get the Pt encoding
-    unsigned int ptCode = 0;
-    unsigned int thresholdValue = 0;
-    ptEnc.getCodingInfo( inputPt-1, ptCode, thresholdValue );
-
-    // Now fill all the information into the output object
-    l1topoCand.setCandidateData(sector.getIDString(), inputRoi, sector.getBCID(), inputPt, ptCode, thresholdValue,
-				thisRoi.eta(), thisRoi.phi(), thisRoi.etacode(), thisRoi.phicode(),
-				thisRoi.etamin(), thisRoi.etamax(), thisRoi.phimin(), thisRoi.phimax(), mioctModNumber, 
-				thisieta, thisiphi );
-				
-    return l1topoCand;
-  }
-  
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.h
deleted file mode 100644
index 216888744e61..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MioctL1TopoConverter.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGT1MUCTPI_MIOCTL1TOPOCONVERTER_H
-#define TRIGT1MUCTPI_MIOCTL1TOPOCONVERTER_H
-
-
-// Local include(s):
-#include "../Mioct/Sector.h"
-#include "../Mioct/MioctID.h"
-#include "../Logging/MsgLogger.h"
-#include "TrigT1Interfaces/MuCTPIL1TopoCandidate.h"
-#include "TrigConfMuctpi/MuctpiXMLParser.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    *  @short Convert candidates of a Mioct to L1Topo output via NIM
-    *
-    *         This is a converter class that takes the candidates within
-    *         a Mioct and creates the outputs plus decoding for L1Topo
-    *
-    * $author Thorsten Wengler 
-    *
-    */
-   class MioctL1TopoConverter {
-
-   public:
-     //constructor 
-      MioctL1TopoConverter();
-      ~MioctL1TopoConverter();
-
-     void setupParser(const std::string & inputfile);
-
-     //Aquire the muon candidates of this mioct after overlap handling and vetos
-     LVL1::MuCTPIL1TopoCandidate convertToL1Topo(const MioctID& mioctModuleID, const Sector& sector, bool isFirstCandidate);
-     
-
-   private:
-     mutable MsgLogger   m_logger;
-     MuctpiXMLParser m_xmlParser;
-
-   }; // class MioctL1TopoConverter
-
-} // namespace LVL1MUCTPI
-
- #endif // TRIGT1MUCTPI_MIOCTL1TOPOCONVERTER_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiBitMasks.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiBitMasks.h
deleted file mode 100644
index 165cd397ad17..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiBitMasks.h
+++ /dev/null
@@ -1,173 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MuctpiBitMasks.h 700318 2015-10-13 14:13:15Z wengler $
-#ifndef TRIGT1MUCTPI_MUCTPISECTORBITMASKS_H
-#define TRIGT1MUCTPI_MUCTPISECTORBITMASKS_H
-
-namespace LVL1MUCTPI {
-
-  enum BitMask {
-    // masks equal for all input data words
-    SectorOverflowMask       = 0x00000001,
-    Pt1Mask                  = 0x00380000, 
-    Pt2Mask                  = 0x01c00000, 
-    Pt1and2Mask              = 0x01f80000, 
-    ROI1OverflowMask         = 0x02000000, 
-    ROI2OverflowMask         = 0x04000000, 
-    BCIDMask                 = 0x38000000,
-    Candidate1Sign           = 0x40000000,
-    Candidate2Sign           = 0x80000000,
-    // Barrel specific constants
-    BarrelROI1Mask           = 0x0000003e,
-    BarrelBarrelOverlap1Mask = 0x00000100, 
-    BarrelEndcapOverlap1Mask = 0x00000200, 
-    BarrelROI2Mask           = 0x00007c00, 
-    BarrelBarrelOverlap2Mask = 0x00020000, 
-    BarrelEndcapOverlap2Mask = 0x00040000,
-    BarrelReservedMask       = 0xC00180C0,
-    // Endcap specific masks
-    EndcapROI1Mask           = 0x000001fe,
-    EndcapBarrelOverlap1Mask = 0x00000200,
-    EndcapROI2Mask           = 0x0003fc00,
-    EndcapBarrelOverlap2Mask = 0x00040000,
-    EndcapReservedMask       = 0x06000000,
-    // Forward specific masks
-    ForwardROI1Mask          = 0x0000007e,
-    ForwardROI2Mask          = 0x0000fc00,
-    ForwardReservedMask      = 0x06070380,
-    // MIOCT ---------------------------------------------------------
-    // Data flow marker on the MIBAK
-    MioctStartMask           = 0x0000000e,
-    MioctEndMask             = 0x0000000f,
-    // MICTP ---------------------------------------------------------
-    // The ID of the MICTP
-    MictpIDMask              = 0x0000000f,
-    MictpIDPositionMask      = 0xf0000000,
-    // The position of the event ID in the MICTP start word
-    MictpEvIDMask            = 0x00ffffff,
-    // The position of the bunch ID, trigger type, monitr bit 
-    // in the MICTP second word
-    MictpECRCMask            = 0x000ff000,
-    MictpBcIDMask            = 0x00000fff,
-    MictpECRCBcIDMask        = 0x000fffff,
-    MictpTrTypeMask          = 0x0ff00000,
-    MictpMonitorMask         = 0x10000000,
-    // position of values in the MICTP data word
-    MictpSum1Mask            = 0x00000007,
-    MictpSum2Mask            = 0x00000038,
-    MictpSum3Mask            = 0x000001c0,
-    MictpSum4Mask            = 0x00000e00,
-    MictpSum5Mask            = 0x00007000,
-    MictpSum6Mask            = 0x00038000,
-    MictpTrailerSum1Mask     = 0x00001c00,
-    MictpTrailerSum2Mask     = 0x0000e000,
-    MictpTrailerSum3Mask     = 0x00070000,
-    MictpTrailerSum4Mask     = 0x00380000,
-    MictpTrailerSum5Mask     = 0x01c00000,
-    MictpTrailerSum6Mask     = 0x0e000000,
-    MictpTrailerFlagsMask    = 0x00000380,
-    MictpTrailerWordsMask    = 0x0000007f,
-    // The position of module number, eventID, BCID in MIOCT start word
-    MioctMNBRMask            = 0xf0000000,
-    MioctEvIDMask            = 0x0ffff000,
-    MioctBcIDMask            = 0x00000fff,
-    // The Event Reader -----------------------------------------------
-    // position of values in EventFifo
-    EvReEvIDMask             = 0x00ffffff,
-    EvReBcIDMask             = 0x00000fff,
-    EvReNoWordsMask          = 0x00ffe000,
-    EvReMonitorMask          = 0x00001000,
-    EvReTrTypeMask           = 0x00000ff0,
-    EvReStatusMask           = 0x0000000f,
-    // Sector Address coding in EventReader Format
-    EvReSecAddressSystemMask = 0x000000c0,
-    EvReSecAddressSubSysMask = 0x00000001,
-    EvReSecNumberBarrelMask  = 0x0000003e,
-    EvReSecNumberEndcapMask  = 0x0000007e,
-    EvReSecNumberForwardMask = 0x0000003e,
-    // RoI and Overlap coding in Barrel, Endcap and Forward
-    EvReBarrelRoIMask        = 0x0000001f,
-    EvReBarrelOvlMask        = 0x00000180,
-    EvReEndcapRoIMask        = 0x000000ff,
-    EvReEndcapOvlMask        = 0x00000100,
-    EvReForwardRoIMask       = 0x0000003f,
-    // The Extractor --------------------------------------------------
-    // position of values in the Extractor header
-    ExtrHeaderEvID           = 0x00ffffff,
-    ExtrHeaderBcID           = 0x00000fff,
-    ExtrHeaderECRC           = 0x000ff000,
-    ExtrMonitorMask          = 0x00001000,
-    ExtrTrTypeMask           = 0x00000ff0,
-    ExtrStatusMask           = 0x0000000f,
-    // position of values in MICTP word in Extractor format
-    ExtrSum1Mask             = 0x00000007,
-    ExtrSum2Mask             = 0x00000038,
-    ExtrSum3Mask             = 0x000001c0,
-    ExtrSum4Mask             = 0x00000e00,
-    ExtrSum5Mask             = 0x00007000,
-    ExtrSum6Mask             = 0x00038000,
-    ExtrMictpBCIDMask        = 0x001c0000,
-    // position of values in Extrotor Trailer word
-    ExtrCandCountMask        = 0x000ffe00,
-    ExtrThresh1Mask          = 0x000001c0,
-    ExtrThresh2Mask          = 0x00000038,
-    Extr1stCandSupprMask     = 0x00000004,
-    Extr2ndCandSupprMask     = 0x00000002,
-    ExtrEitherCandSupprMask  = 0x00000001,
-    // position of all the single values in the Extractor data format
-    ExtrPassedMask           = 0x04000000,
-    ExtrFirstCandMask        = 0x02000000,
-    ExtrSectorAddressMask    = 0x01fe0000,
-    ExtrBCIDMask             = 0x0001c000,
-    ExtrPtValueMask          = 0x00003800,
-    ExtrRoIOvlMask           = 0x000007fc,
-    ExtrPadOverflowMask      = 0x00000002,
-    ExtrSectorOverflowMask   = 0x00000001,
-    // position of RoI + Overlap candidate 1 and 2
-    RoIOvl1Mask              = 0x000003fe,
-    RoIOvl2Mask              = 0x0007fc00,
-    // position of thresholds, reject bits in trailer of Extractor
-    ExtrThresholdOneMask     = 0x000001c0,
-    ExtrThresholdSecondMask  = 0x00000038,
-    ExtrSuppressedFirstMask  = 0x00000004,
-    ExtrSuppressedSecondMask = 0x00000002,
-    ExtrSuppressedEitherMask = 0x00000001,
-    // Charge:
-    ExtrCandidateSign        = 0x08000000,
-    // MirodDaqProcessor ---------------------------------------------
-    DaqHeaderStartMask       = 0xee1234ee,
-    DaqHeaderSizeMask        = 0x00000009,
-    DaqHeaderFormatMask      = 0x03000000,
-    DaqHeaderDetIDMask       = 0x00760000,
-    DaqHeaderLvl1IDMask      = 0x00ffffff,
-    DaqHeaderBcIDMask        = 0x00000fff,
-    DaqHeaderTrTypeMask      = 0x000000ff,
-    DaqTrailerCandMask       = 0x0000000f,
-    // MirodLvl2Processor --------------------------------------------
-    Lvl2HeaderStartMask      = 0xee1234ee,
-    Lvl2HeaderSizeMask       = 0x00000009,
-    Lvl2HeaderFormatMask     = 0x03000000,
-    Lvl2HeaderDetIDMask      = 0x00760001,
-    Lvl2FirstCandMask        = 0x00400000,
-    Lvl2SectorAddressMask    = 0x003fc000,
-    Lvl2PtValueMask          = 0x00003800,
-    Lvl2RoIOvlMask           = 0x000007fc, 
-    Lvl2PadOverflowMask      = 0x00000002,
-    Lvl2SectorOverflowMask   = 0x00000001,
-    Lvl2SecAddressStartBit   = 14,
-    Lvl2BarrelRoIMask        = 0x0000001f,
-    Lvl2BarrelOvlMask        = 0x00000180,
-    Lvl2EndcapRoIMask        = 0x000000ff,
-    Lvl2EndcapOvlMask        = 0x00000100,
-    Lvl2ForwardRoIMask       = 0x0000003f,
-    Lvl2CandidateSign        = 0x00800000
-
-  }; // enum BitMask
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MUCTPISECTORBITMASKS_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.cxx
deleted file mode 100644
index 966f410bb0fe..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.cxx
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MuctpiSim.cxx 726107 2016-02-25 11:04:42Z wengler $
-
-// STL include(s):
-#include <cassert>
-#include <iomanip>
-#include <sstream>
-#include <ostream>
-
-// Gaudi/Athena include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// TrigT1 include(s):
-#include "TrigT1Interfaces/Lvl1MuCTPIInput.h"
-
-// Local include(s):
-#include "MuctpiSim.h"
-#include "Configuration.h"
-#include "BitOp.h"
-#include "../Mioct/EventReader.h"
-#include "../Mioct/EventReaderFactory.h"
-#include "../Mioct/SectorLogicSource.h"
-#include "../Mioct/SectorLogicReader.h"
-#include "MuctpiBitMasks.h"
-
-/*******************************************************************
- * $Date: 2016-02-25 12:04:42 +0100 (Thu, 25 Feb 2016) $
- *
- * Implementation of class MuctpiSim
- * @author  $Author: krasznaa $
- * @version $Revision: 726107 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   // constructor of class MuctpiSim
-   MuctpiSim::MuctpiSim()
-      : m_logger( "MuctpiSim" ) {
-
-      // make a dummy input object used to initialise
-      m_muctpiInput = new LVL1MUONIF::Lvl1MuCTPIInput();
-
-      // install the SectorLogic Reader as EventReader (it is the
-      // default one - otherwise controlled via environment variable
-      m_theReader = EventReaderFactory::getEventReader();
-      if( ! m_theReader ) {
-         REPORT_FATAL_MSG( "no valid Reader -> can't continue" );
-         assert( 0 );
-      }
-
-      // Now take take the Lvl1MuCTPIInput object and declare it to
-      // be the EventSource
-      m_theSource = new SectorLogicSource();
-      m_theSource->setSectorLogicSource( m_muctpiInput );
-
-      // Now give this source to the Event Reader, so it knows where to
-      // read the events from
-      m_theReader->setEventSource( *m_theSource );
-      REPORT_MSG(DEBUG, m_theReader->getInfoString() );
-      // now create the Lvl1Mibak object, which in turn will create
-      // the Octant modules and sectors, which will register themselves
-      // with the Reader
-      m_mibak = new Lvl1Mibak( m_theReader );
-      m_mibak->setZeroSuppression( true );
-      REPORT_MSG(DEBUG, m_theReader->getInfoString() );
-   }
-
-   // process method of class MuctpiSim
-  void MuctpiSim::processData( const LVL1MUONIF::Lvl1MuCTPIInput* currentInput, int bcidOffset ) {
-
-      // Print the input to the simulation:
-      REPORT_VERBOSE_MSG( "Start processing event with input from sector logics:\n" );
-      REPORT_VERBOSE_MSG( *currentInput );
-
-      // set the input source to the current input object passed
-      // as an argument - first get the EventSource, then change
-      // what it is pointing to
-      SectorLogicReader* sl_Reader = dynamic_cast< SectorLogicReader* >( m_theReader );
-      if( ! sl_Reader ) {
-         REPORT_FATAL_MSG( "The EventReader is apparently not a SectorLogicReader. How come?" );
-         assert( 0 );
-      }
-      sl_Reader->getSource().setSectorLogicSource( currentInput );
-      sl_Reader->getSource().setBcidOffset( bcidOffset );
-
-      // read the event currently held in the input object
-      m_theReader->putNextEvent();
-
-      // set the MICTP data - has to be done first
-      m_mibak->setMictpData();
-
-      // do the processing in the Mirod
-      m_mibak->mirodProcessData();
-
-      return;
-   }
-
-
-  LVL1::MuCTPIL1Topo  MuctpiSim::getL1TopoData() { 
-    
-    // get the L1Topo candidates
-    LVL1::MuCTPIL1Topo l1topo = m_mibak->getL1TopoCandidates(m_L1TopoConv); 
-    std::vector<LVL1::MuCTPIL1TopoCandidate> l1topoCandVec = l1topo.getCandidates();
-
-    // now get the output formatted for LVL2
-    std::list<unsigned int> lvl2OutCand = getRoIBCandidates();
-
-    // loop and match
-    for (std::list< unsigned int >::iterator it_l2Cand = lvl2OutCand.begin(); 
-	 it_l2Cand != lvl2OutCand.end(); ++it_l2Cand) {
-
-	
-      std::string system;
-      std::string hemisphere = "-";
-      unsigned int sectorNumber = 0;
-      unsigned int regionOfInterest = 0;
-      //offset for differnt counting scheme in MuCTPI geometry file for L1Topo
-      unsigned int offset =0;
-      unsigned int sectorWord = ( * it_l2Cand);
-      
-      // get the address values out of the bit mask
-      const unsigned int sectorAddress =
-	BitOp::getValue( &sectorWord, Lvl2SectorAddressMask );
-      const unsigned int sectorRoIOvl = BitOp::getValue( &sectorWord, Lvl2RoIOvlMask );
-      
-      // get the Hemisphere
-      if ( BitOp::getValue( &sectorAddress, EvReSecAddressSubSysMask ) == 1 ) {
-	hemisphere = "+";
-      }
-      
-      
-      // sector address and RoI and Overlap must be taken apart agin
-      // to extract the readable information
-      // first find out if this is Barrel, endcap, forward, get sector
-      // number, RoI and Overlap information
-      if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) == 0 ) {
-	system = "B"; // Barrel
-	if (hemisphere == "+") {
-	  offset = 32;
-	}
-	sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberBarrelMask );
-	regionOfInterest = BitOp::getValue( &sectorRoIOvl, Lvl2BarrelRoIMask );
-      } else if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) == 1 ) {
-	if (hemisphere == "+") {
-	  system = "FA";
-	} else  {
-	  system = "FC";
-	}
-	sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberForwardMask );
-	regionOfInterest = BitOp::getValue( &sectorRoIOvl, Lvl2ForwardRoIMask );
-      } else if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) > 1 ) {
-	if (hemisphere == "+") {
-	  system = "EA";
-	} else {
-	  system = "EC";
-	}
-	sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberEndcapMask );
-	regionOfInterest = BitOp::getValue( &sectorRoIOvl, Lvl2EndcapRoIMask );
-      }
-      
-      std::string secNumString = "";
-      if (sectorNumber+offset < 10) {
-	secNumString = "0" + std::to_string(sectorNumber + offset);
-      } else {
-	secNumString = std::to_string(sectorNumber + offset);
-      }
-      
-      system = system + secNumString ;
-      
-      for (std::vector<LVL1::MuCTPIL1TopoCandidate>::iterator it_topoCand =  l1topoCandVec.begin(); 
-	   it_topoCand != l1topoCandVec.end(); ++it_topoCand) {      
-	
-	
-	//	std::cout << "TW:" << system << " | " << it_topoCand->getSectorName() << " | " << regionOfInterest << " | " << it_topoCand->getRoiID() << std::endl;
-	
-	if (system == it_topoCand->getSectorName() && regionOfInterest == it_topoCand->getRoiID() ) {
-	  // match has been made, fill the roiWord into the candidate object
-	  it_topoCand->setRoiWord(sectorWord);
-	  // std::cout << "TW match:  Addr: " << system << " : " << hemisphere << system << " "
-	  // 	    << std::setw( 2 ) << std::dec << sectorNumber
-	  // 	    << " Pt/RoI: " << ptValue
-	  // 	    << " " << std::setw( 2 ) << regionOfInterest
-	  // 	    << " Ovl: " << overlap
-	  // 	    << " pad/secOF: " << std::setw( 2 ) << padOverflow
-	  // 	    << std::setw( 2 ) << sectorOverflow
-	  // 	    << " First: " << candFirst
-	  // 	    << " veto: " << veto << std::endl;
-	  
-	  // it_topoCand->print();
-	  break;
-	}
-	
-      }
-    }
-
-    l1topo.setCandidates(l1topoCandVec);
-    return l1topo; 
-    
-}
-
-
-   /**
-    * The call is just forwarded to the MIBAK object, even though that's not the
-    * hardware that implements this logic in real life...
-    *
-    * @returns <code>true</code> if any of the octant boards saw a barrel candidate,
-    *          <code>false</code> otherwise
-    */
-   bool MuctpiSim::hasBarrelCandidate() const {
-
-      return m_mibak->hasBarrelCandidate();
-   }
-
-   /**
-    * The call is just forwarded to the MIBAK object, even though that's not the
-    * hardware that implements this logic in real life...
-    *
-    * @returns <code>true</code> if any of the octant boards saw an endcap candidate,
-    *          <code>false</code> otherwise
-    */
-   bool MuctpiSim::hasEndcapCandidate() const {
-
-      return m_mibak->hasEndcapCandidate();
-   }
-
-   // print method for the CTP output word
-   void MuctpiSim::printCTPOut( std::string format ) {
-
-      unsigned int CTPword = this->getCTPData();
-      std::ostringstream message;
-
-      if( format == "hex" ) {
-         message << std::hex << std::setw( 8 ) << CTPword;
-      } else if ( format == "bin" ) {
-         std::string ctpWordString;
-         BitOp::printBin( CTPword, ctpWordString );
-         message << ctpWordString;
-      } else if ( format == "human" ) {
-         message << " =============================== CTP word ========="
-                 << "=========================" << std::endl;
-         message << "   PtSum6: " << BitOp::getValue( &CTPword, MictpSum6Mask )
-                 << "   PtSum5: " << BitOp::getValue( &CTPword, MictpSum5Mask )
-                 << "   PtSum4: " << BitOp::getValue( &CTPword, MictpSum4Mask )
-                 << "   PtSum3: " << BitOp::getValue( &CTPword, MictpSum3Mask )
-                 << "   PtSum2: " << BitOp::getValue( &CTPword, MictpSum2Mask )
-                 << "   PtSum1: " << BitOp::getValue( &CTPword, MictpSum1Mask )
-                 << std::endl;
-         message << " =================================================="
-                 << "=========================";
-      }
-
-      REPORT_MSG(DEBUG, message.str() );
-
-      return;
-   }
-
-   // print method for the Lvl2 Output list
-   void MuctpiSim::printLvl2Out( std::string format ) {
-
-      MirodLvl2Processor serviceLvl2( this->getRoIBData() );
-      serviceLvl2.printEvent( format );
-      return;
-   }
-
-   // print method for the DAQ output list
-   void MuctpiSim::printDAQOut( std::string format ) {
-
-      MirodDaqProcessor serviceDaq( this->getDAQData() );
-      serviceDaq.printEvent( format );
-      return;
-   }
-
-   //get the content of the MirodFiFos as an object
-   MirodFiFoContent MuctpiSim::getMirodFiFoContent() {
-
-      MirodFiFoContent mirodFiFos;
-
-      mirodFiFos.monFiFo( *( this->getMirodModule()->getMirodExtractor()->getExtractorData() ) );
-      mirodFiFos.lvl2FiFo( this->getRoIBData() );
-      mirodFiFos.daqFiFo( this->getDAQData() );
-
-      return mirodFiFos;
-   }
-
-   // set Configuration
-   void MuctpiSim::setConfiguration ( const Configuration &conf ) {
-
-      // set MIROD via MIBAK
-      m_mibak->setConfiguration( conf );
-      return;
-   }
-
-   StatusCode MuctpiSim::initializeLUTOverlapStrategy( const std::string& lutXMLFile,
-                                                       bool flagMode, bool dumpLut,
-						       const std::string& runPeriod ) {
-
-      CHECK( m_mibak->initializeLUTOverlapStrategy( lutXMLFile, flagMode,
-                                                    dumpLut, runPeriod ) );
-      return StatusCode::SUCCESS;
-   }
-
-   //destructor of class MuctpiSim
-   MuctpiSim::~MuctpiSim() {
-
-      // the order of destruction matters, as the sectors destructing
-      // themselves as part of the Lvl1Mibak destructor contact the
-      // EventReader to unregister themselves first - for this the
-      // EventReader must still be present
-      delete m_mibak;
-      delete m_theSource;
-      delete m_theReader;
-      delete m_muctpiInput;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.h
deleted file mode 100644
index 88e16ec110c7..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuctpiSim.h
+++ /dev/null
@@ -1,205 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MuctpiSim.h 726107 2016-02-25 11:04:42Z wengler $
-#ifndef TRIGT1MUCTPI_MUCTPISIM_H
-#define TRIGT1MUCTPI_MUCTPISIM_H
-
-// STL include(s):
-#include <list>
-#include <string>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/StatusCode.h"
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-#include "../Mibak/Lvl1Mibak.h"
-#include "../Mirod/MirodFiFoContent.h"
-#include "../Mirod/MirodModule.h"
-#include "../Mirod/MirodTestRamIn.h"
-#include "../Mioct/StrategyName.h"
-#include "../Mioct/MioctID.h"
-#include "../Mictp/MictpModule.h"
-#include "../Common/MioctL1TopoConverter.h"
-
-namespace LVL1MUONIF {
-  class Lvl1MuCTPIInput;
-}
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class Configuration;
-   class EventReader;
-   class SectorLogicSource;
-
-   /*********************************************************************
-    *
-    *    $Date: 2016-02-25 12:04:42 +0100 (Thu, 25 Feb 2016) $
-    *
-    *    @short Top level class of the MUCTPI simulation
-    *
-    *           Top level class: The constructor sets up the simulation
-    *           and defines the input source and output destination
-    *           depending on its argument(s). The processData method
-    *           performs the actual simulation in reading the input
-    *           data, simulation the result and providing the output.
-    *           Additional debugging and diagnostics interfaces
-    *           provide access to all the modules of the MUCTPI
-    *
-    *      @see MirodModule
-    *      @see MioctModule
-    *      @see MictpModule
-    *      @see Lvl1Mibak
-    *      @see MibakStreamEvent
-    *      @see MirodModule
-    *   @author $Author: ssnyder $
-    *  @version $Revision: 726107 $
-    *
-    *******************************************************************
-    */
-   class MuctpiSim {
-
-   public:
-
-      // Constructor
-      /**
-       * The constructor of MuctpiSim
-       */
-      MuctpiSim();
-
-      // disable copy/assignment operator as not used/implemented
-      MuctpiSim( const MuctpiSim & ) = delete;
-      MuctpiSim & operator = ( const MuctpiSim & ) = delete;
-     
-
-      /// sets Configuration
-      void setConfiguration( const Configuration& conf );
-
-      /**
-       * The processData method does the data processing in the Muctpi
-       * It needs to be called before any of the output data is accessed,
-       * which otherwise will be empty or still hold the last event.
-       */
-     void processData( const LVL1MUONIF::Lvl1MuCTPIInput* currentInput, int bcidOffset = 0 );
-      /**
-       * method to access the data send to the CTP.
-       */
-      unsigned int getCTPData()
-      { return this->getMictpModule()->getMictpCTPWord(); }
-      /**
-       * method to access the candidates sent to the RoIB (Level 2 Trigger)
-       * without the header or trailer words.
-       */
-      const std::list<unsigned int>& getRoIBCandidates()
-      { return this->getMirodModule()->getLvl2Candidates(); }
-      /**
-       * method to access the data send to the RoIB (Level 2 Trigger).
-       */
-      const std::list<unsigned int>& getRoIBData()
-      { return this->getMirodModule()->getLvl2Output(); }
-      /**
-       * method to access the data send to the DAQ system.
-       */
-      const std::list<unsigned int>& getDAQData()
-      { return this->getMirodModule()->getDaqOutput(); }
-      /**
-       * setup the Muon to L1Topo converter
-       */
-      void setupL1TopoConverter(const std::string & inputfile){
-	m_L1TopoConv.setupParser(inputfile);
-      }
-      /**
-       * access the output for the L1Topo, and add the LVL2 style 32 bit word to it.
-       */
-      LVL1::MuCTPIL1Topo getL1TopoData();
-      
-
-      /// Is there at least one barrel candidate in the event?
-      bool hasBarrelCandidate() const;
-      /// Is there at least one endcap candidate in the event?
-      bool hasEndcapCandidate() const;
-
-      /**
-       * method to access a MioctModule specified by its ID
-       */
-      const MioctModule* getMioct( MioctID id ) const
-      { return m_mibak->getMioctModule( id ); }
-      /**
-       * method to access the MirodModule
-       */
-      const MirodModule* getMirodModule() { return m_mibak->getMirod(); }
-      /**
-       * method to access the MictpModule
-       */
-      const MictpModule* getMictpModule() { return m_mibak->getMictp(); }
-      /**
-       * method to access the data stream on the Mibak to the Mirod
-       */
-      const MibakStreamEvent* getMibakStreamData()
-      { return m_mibak->getMibakStreamEvent(); }
-      /**
-       * get the input needed to load the MirodTestRam
-       * @return object holding the input to the testram
-       */
-      MirodTestRamIn getMirodTestRamInput()
-      { return this->getMibakStreamData()->getMirodTestRamInput(); }
-      /**
-       * method to get the content of the MirodFiFos as an object for
-       * comparisons to the hardware
-       */
-      MirodFiFoContent getMirodFiFoContent();
-      /**
-       * print methods for the output of the MUCTPI. The parameter determines
-       * if the output is in "bin"-binary, "hex"-hexadecimal, or
-       * "human"-interpreted format
-       * @param format - determines the output format (bin,hex,human)
-       */
-      void printCTPOut( std::string format );
-      void printLvl2Out( std::string format );
-      void printDAQOut( std::string format );
-
-      /**
-       * These methods are used to set up the simulation's overlap handling scheme.
-       * Currently 2 strategies are supported: NO_OVERLAP and LUT_OVERLAP
-       */
-      void setOverlapStrategy( StrategyName strategy ) {
-         m_mibak->setOverlapStrategy( strategy );
-      }
-      StatusCode initializeLUTOverlapStrategy( const std::string& lutXMLFile,
-                                               bool flagMode, bool dumpLut,
-					       const std::string& runPeriod = "RUN1" );
-
-      /**
-       * These methods are used to set up the simulation's multiplicity calculation
-       * scheme. Currently 3 strategies are supported: INCLUSIVE, EXCLUSIVE, XML
-       */
-      void setMultiplicityStrategy( MultiplicityCalcType type ) {
-         m_mibak->setMultiplicityStrategy( type );
-      }
-      void initializeXMLMultStrategy( const std::string& xmlFile ) {
-         m_mibak->initializeXMLMultStrategy( xmlFile );
-      }
-
-      /**
-       * The destructor of MuctpiSim
-       */
-      ~MuctpiSim();
-
-   private:
-      MsgLogger                    m_logger;
-      EventID                      m_theEventID;
-      EventReader*                 m_theReader;
-      SectorLogicSource*           m_theSource;
-      Lvl1Mibak*                   m_mibak;
-      LVL1MUONIF::Lvl1MuCTPIInput* m_muctpiInput;
-      MioctL1TopoConverter         m_L1TopoConv;
-
-   }; // class MuctpiSim
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MUCTPISIM_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MultiplicityCalcType.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MultiplicityCalcType.h
deleted file mode 100644
index ffd3e5b1ba28..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MultiplicityCalcType.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MultiplicityCalcType.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_COMMON_MULTIPLICITYCALCTYPE_H
-#define TRIGT1MUCTPI_COMMON_MULTIPLICITYCALCTYPE_H
-
-namespace LVL1MUCTPI {
-
-   enum MultiplicityCalcType {
-
-      INCLUSIVE,
-      EXCLUSIVE,
-      XML
-
-   }; // enum MultiplicityCalcType
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_COMMON_MULTIPLICITYCALCTYPE_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.cxx
deleted file mode 100644
index f15f5269e497..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.cxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MuonCandidate.cxx 364083 2011-05-06 09:09:55Z krasznaa $
-
-// STL include(s):
-#include <iostream>
-
-// Local include(s):
-#include "MuonCandidate.h"
-
-/*******************************************************************
- * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
- *
- * Implementation of class MuonCandidate
- * @author   Author: Thorsten Wengler
- * @version $Revision: 364083 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   // constructor of class MuonCandidate
-   MuonCandidate::MuonCandidate()
-      : m_bcid( 1 ), m_roi1( 0 ), m_roi2( 0 ), m_ovl1( 0 ), m_ovl2( 0 ), m_pt1( 7 ),
-        m_pt2( 7 ), m_twoCand1( false ), m_twoCand2( false ), m_gtTwoCandInSec( false ) {
-
-   }
-
-   // overload for <<
-   std::ostream& operator<<( std::ostream& out, const MuonCandidate& right ) {
-
-      out << right.m_theSectorID;
-      out << " Pt1: "  << right.m_pt1;
-      out << " RoI1: "  << right.m_roi1;
-      out << " Ovl1: "  << right.m_ovl1;
-      out << " More1inPad1: " << right.m_twoCand1 << std::endl;
-      if( right.m_pt2 < 7 ) {
-         out << " Pt2: "  << right.m_pt2;
-         out << " RoI2: "  << right.m_roi2;
-         out << " Ovl2: "  << right.m_ovl2;
-         out << " More1InPad2: "  << right.m_twoCand2 << std::endl;
-      }
-      out << " BCID: " << right.m_bcid;
-      out << " More2inSec: " << right.m_gtTwoCandInSec << std::endl;
-
-      return out;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.h
deleted file mode 100644
index b0bdad703711..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/MuonCandidate.h
+++ /dev/null
@@ -1,112 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MuonCandidate.h 364083 2011-05-06 09:09:55Z krasznaa $
-#ifndef TRIGT1MUCTPI_MUONCANDIDATE_H
-#define TRIGT1MUCTPI_MUONCANDIDATE_H
-
-// Local include(s):
-#include "../Mioct/SectorID.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    *  @short Information for one sector logic muon candidate word
-    *
-    *         This class combines the information to form one word
-    *         as delivered by the muon sector logic. It may
-    *         contain 2 actual muon candidates
-    *
-    *  @author Thorsten Wengler
-    *
-    * $Revision: 364083 $
-    * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
-    */
-   class MuonCandidate {
-
-   public:
-      /**
-       * The constructor of MuonCandidate
-       */
-      MuonCandidate();
-      /**
-       * set or get the SectorID
-       */
-      SectorID secID() const { return m_theSectorID; }
-      void secID( SectorID theID ) { m_theSectorID = theID; }
-      /**
-       * set or get the BCID
-       */
-      unsigned int bcid() const { return m_bcid; }
-      void bcid( unsigned int theBCID ) { m_bcid = theBCID; }
-      /**
-       * set or get RoI for candidate 1
-       */
-      unsigned int roi1() const { return m_roi1; }
-      void roi1( unsigned int theRoI1 ) { m_roi1 = theRoI1; }
-      /**
-       * set or get RoI for candidate 2
-       */
-      unsigned int roi2() const { return m_roi2; }
-      void roi2( unsigned int theRoI2 ) { m_roi2 = theRoI2; }
-      /**
-       * set or get Overlap for candidate 1
-       */
-      unsigned int ovl1() const { return m_ovl1; }
-      void ovl1( unsigned int theOvl1 ) { m_ovl1 = theOvl1; }
-      /**
-       * set or get Overlap for candidate 2
-       */
-      unsigned int ovl2() const { return m_ovl2; }
-      void ovl2( unsigned int theOvl2 ) { m_ovl2 = theOvl2; }
-      /**
-       * set or get pt for candidate 1
-       */
-      unsigned int pt1() const { return m_pt1; }
-      void pt1( unsigned int thePt1 ) { m_pt1 = thePt1; }
-      /**
-       * set or get pt for candidate 2
-       */
-      unsigned int pt2() const { return m_pt2; }
-      void pt2( unsigned int thePt2 ) { m_pt2 = thePt2; }
-      /**
-       * set or get two cand. in pad flag candidate 1
-       */
-      bool twoCand1() const { return m_twoCand1; }
-      void twoCand1( bool theTwoCand1 ) { m_twoCand1 = theTwoCand1; }
-      /**
-       * set or get two cand. in pad flag candidate 2
-       */
-      bool twoCand2() const { return m_twoCand2; }
-      void twoCand2( bool theTwoCand2 ) { m_twoCand2 = theTwoCand2; }
-      /**
-       * set or get two cand. in sector flag
-       */
-      bool gtTwoCandInSec() const { return m_gtTwoCandInSec; }
-      void gtTwoCandInSec( bool theGtTwoCandInSec ) { m_gtTwoCandInSec = theGtTwoCandInSec; }
-      /**
-       * overload the << operator to have easy printout
-       */
-      friend std::ostream& operator<<( std::ostream&, const MuonCandidate& );
-
-   private:
-      SectorID m_theSectorID;
-      unsigned int m_bcid;
-      unsigned int m_roi1;
-      unsigned int m_roi2;
-      unsigned int m_ovl1;
-      unsigned int m_ovl2;
-      unsigned int m_pt1;
-      unsigned int m_pt2;
-      bool m_twoCand1;
-      bool m_twoCand2;
-      bool m_gtTwoCandInSec;
-
-   }; // class MuonCandidate
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MUONCANDIDATE_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.cxx
deleted file mode 100644
index 0b703b130433..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.cxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: PtMultiplicitySet.cxx 700318 2015-10-13 14:13:15Z wengler $
-
-// STL include(s):
-#include <iostream>
-#include <sstream>
-#include <cassert>
-
-// Local include(s):
-#include "PtMultiplicitySet.h"
-
-//***********************************************************************
-//
-//       Version : $Revision: 700318 $
-//
-//   Description :
-//
-//        Author : $Author: krasznaa $
-//          Date : $Date: 2015-10-13 16:13:15 +0200 (Tue, 13 Oct 2015) $
-//
-//
-//
-//***********************************************************************
-
-namespace LVL1MUCTPI {
-
-   PtMultiplicitySet::PtMultiplicitySet( unsigned int ptarr[ MAX_NUMBER_OF_THRESHOLDS ] ) {
-
-      //
-      // Initialise the internal array to zero:
-      //
-      for( unsigned int ix = 0; ix < MAX_NUMBER_OF_THRESHOLDS; ++ix ) {
-         m_multiplicity_pt[ ix ] = 0;
-      }
-
-      //
-      // If an array was given in the constructor, copy its contents:
-      //
-      if( ptarr ) {
-         for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) {
-            m_multiplicity_pt[ i ] = ptarr[ i ];
-         }
-      }
-
-   }
-
-   PtMultiplicitySet& PtMultiplicitySet::operator+=( const PtMultiplicitySet& a) {
-
-      // No check is performed for the "correctness" of the input PtMultiplicitySet,
-      // since there should be no way in which it can be created in an "incorrect"
-      // way...
-      for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) {
-         m_multiplicity_pt[ i ] += a.m_multiplicity_pt[ i ];
-         // the multiplicities are clipped at MAX_MULTIPLICITY
-         if( m_multiplicity_pt[ i ] > MAX_MULTIPLICITY ) {
-            m_multiplicity_pt[ i ] = MAX_MULTIPLICITY;
-         }
-      }
-      return *this;
-
-   }
-
-   // the definition of the + operator is based on that of the += operator
-   // the multiplicities are clipped at MAX_MULTIPLICITY
-
-   PtMultiplicitySet PtMultiplicitySet::operator+( const PtMultiplicitySet& a ) {
-
-      PtMultiplicitySet result = *this;
-      result += a;
-      return result;
-
-   }
-
-   // Access to multiplicity of a particluar threshold
-   int PtMultiplicitySet::getMultiplicity( const unsigned int threshold ) const {
-
-      // check if threshold argument is valid
-      if( threshold > MAX_NUMBER_OF_THRESHOLDS || threshold < 1 ) {
-         std::cerr << "Invalid Threshold given" << std::endl;
-         assert( 0 );
-	 return( 0 );  // added to silence the coverty complaints
-      }
-      return m_multiplicity_pt[ threshold - 1 ];
-
-   }
-
-   void PtMultiplicitySet::clear() {
-
-      for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) {
-         m_multiplicity_pt[ i ] = 0;
-      }
-
-      return;
-   }
-
-   void PtMultiplicitySet::print( std::string& result ) const {
-
-      std::ostringstream outStream;
-      outStream << "\n Multiplicity Set : \n" << "--------------------\n\n";
-      for( unsigned int ix = 0; ix < MAX_NUMBER_OF_THRESHOLDS; ++ix ) {
-         outStream << "       " << ix + 1 << "   " << m_multiplicity_pt[ ix ] << "\n";
-      }
-      result = outStream.str();
-
-      return;
-
-   }
-
-   void PtMultiplicitySet::addMuon( const unsigned int pt ) {
-
-      // a muon is added if it is in the correct pt range and if the
-      // maximal multiplicity for the correspnding pt thresholds has not been
-      // reached yet.
-      if( pt >= 1 && pt <= MAX_NUMBER_OF_THRESHOLDS ) {
-         if( m_multiplicity_pt[ pt - 1 ] < MAX_MULTIPLICITY ) {
-            m_multiplicity_pt[ pt - 1 ]++;
-         }
-      }
-      return;
-
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.h
deleted file mode 100644
index aafeb84d0200..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/PtMultiplicitySet.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: PtMultiplicitySet.h 364083 2011-05-06 09:09:55Z krasznaa $
-#ifndef TRIGT1MUCTPI_PTMULTIPLICITYSET_H
-#define TRIGT1MUCTPI_PTMULTIPLICITYSET_H
-
-// STL include(s):
-#include <string>
-
-// Local include(s):
-#include "SectorConstants.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class InclusiveMultStrategy;
-   class ExclusiveMultStrategy;
-   class XMLMultCalculator;
-
-   /**
-    *  @short A set of pt-multiplicities corresponding to the six different pt-thresholds
-    *
-    *         This   class contains a    set of  6 muon   multiplicities
-    *         corresponding  to the  six  different pt-thresholds in the
-    *         system.  The multiplicities  saturate at a  count of seven
-    *         like it is implemented in the hardware (3 bits). Operators
-    *         for adding multiplicities are defined.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 364083 $
-    * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
-    */
-   class PtMultiplicitySet {
-
-      // All the concrete multiplicity strategies have to be listed as friends,
-      // because only they should be allowed to freely modify such objects.
-      // I really don't like having to do it like this, but unfortunately
-      // friendship is not inherited. Even though it would be elegant to just
-      // write "friend class MultiplicityStrategy;"...
-      friend class InclusiveMultStrategy;
-      friend class ExclusiveMultStrategy;
-      friend class XMLMultCalculator;
-
-   public:
-      /**
-       * The constructor without any argument creates an empty multiplicty
-       * set (all multiplicities set to 0). It might take an array with
-       * initial values as an argument. Currently no check is performed if
-       * the inital values do not exceed the maximal number of seven!!)
-       */
-      PtMultiplicitySet( unsigned int ptarr[ MAX_NUMBER_OF_THRESHOLDS ] = 0 );
-      /**
-       * Method to access the multiplicity of a particular threshold
-       * @param threshold for which multiplicity is requested
-       * @return multiplicity for requested threshold
-       */
-      int getMultiplicity( const unsigned int threshold ) const;
-
-      /// This operator clips the multiplicities at a count of sevenn
-      PtMultiplicitySet& operator+=( const PtMultiplicitySet& );
-      /// This operator clips the multiplicities at a count of seven.
-      PtMultiplicitySet operator+( const PtMultiplicitySet& );
-
-      /// Reset the object to 0 multiplicity
-      void clear();
-
-      /**
-       * For debugging and to look at results.
-       * @param result is a reference on a string which after the call
-       *               to the function contains the formatted result (six multiplicities for
-       *               the six different pt-thresholds).
-       */
-      void print( std::string& result ) const;
-
-   private:
-      /**
-       * With this member function a multiplicity of a specified threshold
-       * can be incremented by one.
-       * @param pt This is the threshold which is incremented. It must be
-       *           a number between one and six. If this condition is not met, nothing
-       *           will be done.
-       */
-      void addMuon( const unsigned int pt );
-
-      unsigned int m_multiplicity_pt[ MAX_NUMBER_OF_THRESHOLDS ];
-
-  }; // class PtMultiplicitySet
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_PTMULTIPLICITYSET_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.cxx
deleted file mode 100644
index 242600bd9c05..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.cxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: RandomCandidateRange.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// Local include(s):
-#include "RandomCandidateRange.h"
-#include "SectorConstants.h"
-
-/*******************************************************************
- * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
- *
- * Implementation of class RandomCandidateRange
- * @author   Author: Thorsten Wengler
- * @version $Revision: 362102 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-  // constructor of class RandomCandidateRange
-  RandomCandidateRange::RandomCandidateRange()
-    : m_allowSystems( 7 ), m_allowHemispheres( 3 ), m_minBarrelSectorID( MIN_BARREL_SECTOR ), m_maxBarrelSectorID( MAX_BARREL_SECTOR ),
-      m_minEndcapSectorID( MIN_ENDCAP_SECTOR ), m_maxEndcapSectorID( MAX_ENDCAP_SECTOR ), m_minForwardSectorID( MIN_FORWARD_SECTOR ),
-      m_maxForwardSectorID( MAX_FORWARD_SECTOR ), m_allowForce2Cand( 1 ), m_minBCID( 0 ), m_maxBCID( 0 ),
-      m_minBarrelRoI( MIN_BARREL_ROI ), m_maxBarrelRoI( MAX_BARREL_ROI ), m_minEndcapRoI( MIN_ENDCAP_ROI ), m_maxEndcapRoI( MAX_ENDCAP_ROI ),
-      m_minForwardRoI( MIN_FORWARD_ROI ), m_maxForwardRoI( MAX_FORWARD_ROI ),
-      m_minPt( 1 ), m_maxPt( MAX_NUMBER_OF_THRESHOLDS ), m_allowForceGT1InPad1Flag( 1 ), m_allowForceGT1InPad2Flag( 1 ),
-      m_allowForceGT2InSecFlag( 1 ) {
-
-  }
-
-  //destructor of class RandomCandidateRange
-  RandomCandidateRange::~RandomCandidateRange(){
-
-  }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.h
deleted file mode 100644
index ccd80838cecb..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/RandomCandidateRange.h
+++ /dev/null
@@ -1,181 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: RandomCandidateRange.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_RANDOMCANDIDATERANGE_H
-#define TRIGT1MUCTPI_RANDOMCANDIDATERANGE_H
-
-namespace LVL1MUCTPI {
-
-  /**
-   *******************************************************************
-   *
-   *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ 
-   *
-   *    @short Short description of RandomCandidateRange
-   *
-   *           Long description of RandomCandidateRange
-   *
-   *      @see 
-   *   @author  Author: Thorsten Wengler
-   *  @version $Revision: 362102 $
-   *
-   *******************************************************************
-   */
-  class RandomCandidateRange {
-
-  public:
-    /**
-     * The constructor of RandomCandidateRange
-     */
-    RandomCandidateRange();
-    /**
-     * methods to get/set m_allowSubsystems Barrel (bin 001),
-     * Endcap (bin 010), Forward (bin 100), or any combination
-     */
-    unsigned int allowSystems(){ return m_allowSystems; }
-    void allowSystems( unsigned int allowSys ){ m_allowSystems = allowSys; }
-    /**
-     * methods to get/set m_allowHemispheres: Pos (bin 01), Neg (bin 10)
-     * or both
-     */
-    unsigned int allowHemispheres(){ return m_allowHemispheres; }
-    void allowHemispheres( unsigned int allowHem ){ m_allowHemispheres = allowHem; }
-    /**
-     * methods to get/set m_minBarrelSectorID
-     */
-    unsigned int minBarrelSectorID(){ return m_minBarrelSectorID; }
-    void minBarrelSectorID( unsigned int minBarrelID ){ m_minBarrelSectorID = minBarrelID; }
-    /**
-     * methods to get/set m_maxBarrelSectorID
-     */
-    unsigned int maxBarrelSectorID(){ return m_maxBarrelSectorID; }
-    void maxBarrelSectorID( unsigned int maxBarrelID ){ m_maxBarrelSectorID = maxBarrelID; }
-    /**
-     * methods to get/set m_minEndcapSectorID
-     */
-    unsigned int minEndcapSectorID(){ return m_minEndcapSectorID; }
-    void minEndcapSectorID( unsigned int minEndcapID ){ m_minEndcapSectorID = minEndcapID; }
-    /**
-     * methods to get/set m_maxEndcapSectorID
-     */
-    unsigned int maxEndcapSectorID(){ return m_maxEndcapSectorID; }
-    void maxEndcapSectorID( unsigned int maxEndcapID ){ m_maxEndcapSectorID = maxEndcapID; }
-    /**
-     * methods to get/set m_minForwardSectorID
-     */
-    unsigned int minForwardSectorID(){ return m_minForwardSectorID; }
-    void minForwardSectorID( unsigned int minForwardID ){ m_minForwardSectorID = minForwardID; }
-    /**
-     * methods to get/set m_maxForwardSectorID
-     */
-    unsigned int maxForwardSectorID(){ return m_maxForwardSectorID; }
-    void maxForwardSectorID( unsigned int maxForwardID ){ m_maxForwardSectorID = maxForwardID; }
-    /**
-     * method to get/set m_allow2Candidates
-     */
-    unsigned int allowForce2Cand(){ return m_allowForce2Cand; }
-    void allowForce2Cand( unsigned int allowFor2Cand ){ m_allowForce2Cand = allowFor2Cand; }
-    /**
-     * methods to get/set m_minBCID
-     */
-    unsigned int minBCID(){ return m_minBCID; }
-    void minBCID( unsigned int theMinBCID ){ m_minBCID = theMinBCID; }
-    /**
-     * methods to get/set m_maxBCID
-     */
-    unsigned int maxBCID(){ return m_maxBCID; }
-    void maxBCID( unsigned int theMaxBCID ){ m_maxBCID = theMaxBCID; }
-    /**
-     * methods to get/set m_minBarrelRoI
-     */
-    unsigned int minBarrelRoI(){ return m_minBarrelRoI; }
-    void minBarrelRoI( unsigned int theMinBarrelRoI ){ m_minBarrelRoI = theMinBarrelRoI; }
-    /**
-     * methods to get/set m_maxBarrelRoI
-     */
-    unsigned int maxBarrelRoI(){ return m_maxBarrelRoI; }
-    void maxBarrelRoI( unsigned int theMaxBarrelRoI ){ m_maxBarrelRoI = theMaxBarrelRoI; }
-    /**
-     * methods to get/set m_minEndcapRoI
-     */
-    unsigned int minEndcapRoI(){ return m_minEndcapRoI; }
-    void minEndcapRoI( unsigned int theMinEndcapRoI ){ m_minEndcapRoI = theMinEndcapRoI; }
-    /**
-     * methods to get/set m_maxEndcapRoI
-     */
-    unsigned int maxEndcapRoI(){ return m_maxEndcapRoI; }
-    void maxEndcapRoI( unsigned int theMaxEndcapRoI ){ m_maxEndcapRoI = theMaxEndcapRoI; }
-    /**
-     * methods to get/set m_minForwardRoI
-     */
-    unsigned int minForwardRoI(){ return m_minForwardRoI; }
-    void minForwardRoI( unsigned int theMinForwardRoI ){ m_minForwardRoI = theMinForwardRoI; }
-    /**
-     * methods to get/set m_maxForwardRoI
-     */
-    unsigned int maxForwardRoI(){ return m_maxForwardRoI; }
-    void maxForwardRoI( unsigned int theMaxForwardRoI ){ m_maxForwardRoI = theMaxForwardRoI; }
-    /**
-     * methods to get/set m_minPt
-     */
-    unsigned int minPt(){ return m_minPt; }
-    void minPt( unsigned int theMinPt ){ m_minPt = theMinPt; }
-    /**
-     * methods to get/set m_maxPt
-     */
-    unsigned int maxPt(){ return m_maxPt; }
-    void maxPt( unsigned int theMaxPt ){ m_maxPt = theMaxPt; }
-    /**
-     * methods to get/set m_allowForceGT1InPad1Flag
-     */
-    unsigned int allowForceGT1InPad1Flag(){ return m_allowForceGT1InPad1Flag; }
-    void allowForceGT1InPad1Flag( unsigned int allowForceGT1Pad1 ){ m_allowForceGT1InPad1Flag = allowForceGT1Pad1; }
-    /**
-     * methods to get/set m_allowForceGT1InPad2Flag
-     */
-    unsigned int allowForceGT1InPad2Flag(){ return m_allowForceGT1InPad2Flag; }
-    void allowForceGT1InPad2Flag( unsigned int allowForceGT1Pad2 ){ m_allowForceGT1InPad2Flag = allowForceGT1Pad2; }
-    /**
-     * methods to get/set m_allowForce2CandidatesInSec
-     */
-    unsigned int allowForceGT2InSecFlag(){ return m_allowForceGT2InSecFlag; }
-    void allowForceGT2InSecFlag( unsigned int allowForceGT2Sec ){ m_allowForceGT2InSecFlag = allowForceGT2Sec; }
-    /**
-     * The destructor of RandomCandidateRange
-     */
-    ~RandomCandidateRange();
-
-  private:
-
-    unsigned int m_allowSystems;
-    unsigned int m_allowHemispheres;
-    unsigned int m_minBarrelSectorID;
-    unsigned int m_maxBarrelSectorID;
-    unsigned int m_minEndcapSectorID;
-    unsigned int m_maxEndcapSectorID;
-    unsigned int m_minForwardSectorID;
-    unsigned int m_maxForwardSectorID;
-    unsigned int m_allowForce2Cand;
-    unsigned int m_minBCID;
-    unsigned int m_maxBCID;
-    unsigned int m_minBarrelRoI;
-    unsigned int m_maxBarrelRoI;
-    unsigned int m_minEndcapRoI;
-    unsigned int m_maxEndcapRoI;
-    unsigned int m_minForwardRoI;
-    unsigned int m_maxForwardRoI;
-    unsigned int m_minPt;
-    unsigned int m_maxPt;
-    unsigned int m_allowForceGT1InPad1Flag;
-    unsigned int m_allowForceGT1InPad2Flag;
-    unsigned int m_allowForceGT2InSecFlag;
-
-  }; // class RandomCandidateRange
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_RANDOMCANDIDATERANGE_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/SectorConstants.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/SectorConstants.h
deleted file mode 100644
index 69ad93a2861f..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/SectorConstants.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: SectorConstants.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_SECTORCONSTANTS_H
-#define TRIGT1MUCTPI_SECTORCONSTANTS_H
-
-namespace LVL1MUCTPI {
-
-  static const unsigned int MIN_BARREL_SECTOR = 0;
-  static const unsigned int MAX_BARREL_SECTOR = 31;
-  static const unsigned int MIN_BARREL_ROI = 1;
-  static const unsigned int MAX_BARREL_ROI = 26;
-
-  static const unsigned int MIN_ENDCAP_SECTOR = 0;
-  static const unsigned int MAX_ENDCAP_SECTOR = 47;
-  static const unsigned int MIN_ENDCAP_ROI = 0;
-  static const unsigned int MAX_ENDCAP_ROI = 147;
-
-  static const unsigned int MIN_FORWARD_SECTOR = 0;
-  static const unsigned int MAX_FORWARD_SECTOR = 23;
-  static const unsigned int MIN_FORWARD_ROI = 0;
-  static const unsigned int MAX_FORWARD_ROI = 63;
-
-  static const unsigned int MAX_NUMBER_OF_THRESHOLDS = 6;
-  static const unsigned int MAX_MULTIPLICITY = 7;
-
-  static const unsigned int SECTORS_IN_MIOCT = 13;
-
-}
-
-#endif // TRIGT1MUCTPI_SECTORCONSTANTS_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.cxx
deleted file mode 100644
index bfa2f91f9f51..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.cxx
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Verifyer.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// STL include(s):
-#include <iostream>
-
-// Local include(s):
-#include "Verifyer.h"
-
-/*
- *******************************************************************
- * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
- *
- * Implementation of class Verifyer
- * @author   Author: Thorsten Wengler
- * @version $Revision: 362102 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-  // constructor of class Verifyer
-  Verifyer::Verifyer()
-    : m_lvl2CandidateMask( 0 ), m_daqMictpMask( 0 ), m_daqCandidateMask( 0 ) {
-
-    for( int i = 0 ; i < 8 ; ++i ) {
-      m_lvl2HeaderMask.push_back( 0 );
-      m_daqHeaderMask.push_back( 0 );
-      if ( i < 5 ) {
-        m_lvl2TrailerMask.push_back( 0 );
-        m_daqTrailerMask.push_back( 0 );
-      }
-    }
-
-  }
-
-  // Compare Daq Out simulation/hardware
-  unsigned int Verifyer::daqOutIsEqual( const std::list< unsigned int >& simOut, const std::list< unsigned int >& hardwareOut,
-                                        bool printToScreen ) const {
-
-    unsigned int areEqual = 0;
-
-    // bit 0 of return code = same buffer length
-    if( simOut.size() != hardwareOut.size() ) areEqual |= 1;
-    unsigned int bufferSize = simOut.size();
-
-    // iterate over the list and check the sector ID's
-    std::list<unsigned int>::const_iterator it_sim;
-    std::list<unsigned int>::const_iterator it_hard;
-    it_hard = hardwareOut.begin();
-
-    unsigned int wordCount = 0 ;
-    unsigned int headerCount = 0 ;
-    unsigned int trailerCount = 0 ;
-    unsigned int candidateCount = 0 ;
-    for( it_sim = simOut.begin(); it_sim != simOut.end(); ++it_sim ) {
-
-      ++wordCount;
-
-      if( headerCount < 8 ) {
-        ++headerCount;
-        // bit number 2-9: differences in the header words
-        unsigned int bitTest = 0;
-        if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) {
-          if ( ( bitTest & ( bitTest ^ this->daqHeaderMask( headerCount - 1 ) ) ) != 0 ) {
-            areEqual |= ( 1 << ( headerCount ) );
-          }
-        }
-      } else if ( wordCount == 9 ) {
-        // bit number 19: differences in the MICTP word
-        unsigned int bitTest = 0;
-        if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) {
-          if ( ( bitTest & ( bitTest ^ this->daqMictpMask() ) ) != 0 ) {
-            areEqual |= ( 1 << ( 19 ) );
-          }
-        }
-      } else if ( wordCount >= ( bufferSize - 4 ) ) {
-        trailerCount++;
-        // bit number 10-14: differences in the trailer words
-        unsigned int bitTest = 0;
-        if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) {
-          if ( ( bitTest & ( bitTest ^
-                             this->daqTrailerMask( trailerCount - 1 ) ) ) != 0 ) {
-            areEqual |= ( 1 << ( trailerCount ) );
-          }
-        }
-      } else {
-        candidateCount++;
-        // bit number 15: differences in a candidate word
-        unsigned int bitTest = 0;
-        if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) {
-          if ( ( bitTest & ( bitTest ^ this->daqCandidateMask() ) ) != 0 ) {
-            areEqual |= ( 1 << ( 20 ) );
-          }
-        }
-      }
-      if ( printToScreen ) {
-        std::cout << std::hex << ( *it_sim ) << std::endl;
-        std::cout << std::hex << ( *it_hard ) << std::endl << std::endl;
-      }
-
-      ++it_hard;
-    }
-
-    return areEqual;
-
-  }
-
-  // Compare Lvl2 Out simulation/hardware
-  unsigned int Verifyer::lvl2OutIsEqual( const std::list< unsigned int >& simOut, const std::list< unsigned int >& hardwareOut,
-                                         bool printToScreen ) const {
-
-    unsigned int areEqual = 0;
-
-    // bit 0 of return code = same buffer length
-    if( simOut.size() != hardwareOut.size() ) areEqual |= 1;
-    unsigned int bufferSize = simOut.size();
-
-    // iterate over the list and check the sector ID's
-    std::list< unsigned int >::const_iterator it_sim;
-    std::list< unsigned int >::const_iterator it_hard;
-    it_hard = hardwareOut.begin();
-
-    unsigned int wordCount = 0;
-    unsigned int headerCount = 0;
-    unsigned int trailerCount = 0;
-    unsigned int candidateCount = 0;
-    for ( it_sim = simOut.begin(); it_sim != simOut.end(); ++it_sim ) {
-
-      ++wordCount;
-
-      if( headerCount < 8 ) {
-        ++headerCount;
-        // bit number 2-9: differences in the header words
-        unsigned int bitTest = 0;
-        if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) {
-          if ( ( bitTest & ( bitTest ^
-                             this->lvl2HeaderMask( headerCount - 1 ) ) ) != 0 ) {
-            areEqual |= ( 1 << ( headerCount ) );
-          }
-        }
-      } else if ( wordCount >= ( bufferSize - 4 ) ) {
-        trailerCount++;
-        // bit number 10-14: differences in the trailer words
-        unsigned int bitTest = 0;
-        if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) {
-          if ( ( bitTest & ( bitTest ^
-                             this->lvl2TrailerMask( trailerCount - 1 ) ) ) != 0 ) {
-            areEqual |= ( 1 << ( trailerCount ) );
-          }
-        }
-      } else {
-        candidateCount++;
-        // bit number 15: differences in a candidate word
-        unsigned int bitTest = 0;
-        if ( ( bitTest = ( ( *it_sim ) ^ ( *it_hard ) ) ) != 0 ) {
-          if ( ( bitTest & ( bitTest ^ this->lvl2CandidateMask() ) ) != 0 ) {
-            areEqual |= ( 1 << ( 20 ) );
-          }
-        }
-      }
-      if ( printToScreen ) {
-        std::cout << std::hex << ( *it_sim ) << std::endl;
-        std::cout << std::hex << ( *it_hard ) << std::endl << std::endl;
-      }
-
-      ++it_hard;
-    }
-
-    return areEqual;
-
-  }
-
-  // compare the MirodFiFos
-  bool Verifyer::mirodFiFosAreEqual( MirodFiFoContent & mirodFiFos, MirodFiFoContent & simMirodFiFos ) const {
-
-    if( lvl2OutIsEqual( simMirodFiFos.lvl2FiFo(), mirodFiFos.lvl2FiFo(), false ) == 0 &&
-        daqOutIsEqual( simMirodFiFos.daqFiFo(), mirodFiFos.daqFiFo(), false ) == 0 ) {
-      return true;
-    }
-
-    return false;
-  }
-
-
-  //destructor of class Verifyer
-  Verifyer::~Verifyer() {
-
-  }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.h b/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.h
deleted file mode 100644
index bdee2657b0da..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Common/Verifyer.h
+++ /dev/null
@@ -1,133 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Verifyer.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_VERIFYER_H
-#define TRIGT1MUCTPI_VERIFYER_H
-
-// STL include(s):
-#include <list>
-#include <vector>
-
-// Local include(s):
-#include "../Mirod/MirodFiFoContent.h"
-
-namespace LVL1MUCTPI {
-
-  /**
-  *******************************************************************
-  *
-  *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-  *
-  *    @short Utility class to verify simulation/hardware results
-  *
-  *           This class offers methods to compare the output of
-  *           of hardware and simulation
-  *
-  *      @see
-  *   @author  Author: Thorsten Wengler
-  *  @version $Revision: 362102 $
-  *
-  *******************************************************************
-  */
-  class Verifyer {
-
-  public:
-    /**
-     * The constructor of Verifyer
-     */
-    Verifyer();
-    /**
-     * The destructor of Verifyer
-     */
-    ~Verifyer();
-
-    /**
-     * Compare the output intended for the RoI Builder as produced
-     * by the simulation and the hardware
-     * @param simOut Output of the simulation
-     * @param hardwareOut Output of the hardware
-     * @param printToScreen if true does printout line by line
-     */
-    unsigned int lvl2OutIsEqual( const std::list<unsigned int> & simOut,
-                                 const std::list<unsigned int> & hardwareOut,
-                                 bool printToScreen ) const;
-    /**
-     * set/get lvl2Header masks
-     * @param headerWord  which of the 0 ... 7 header words
-     * @param maskValue   value to which the mask is set
-     */
-    void lvl2HeaderMask( unsigned int headerWord, unsigned int maskValue ) { m_lvl2HeaderMask[ headerWord ] = maskValue; }
-    unsigned int lvl2HeaderMask( unsigned int headerWord ) const { return m_lvl2HeaderMask[ headerWord ]; }
-    /**
-     * set/get lvl2Trailo masks
-     * @param trailerWord  which of the 0 ... 4 trailor words
-     * @param maskValue   value to which the mask is set
-     */
-    void lvl2TrailerMask( unsigned int trailerWord, unsigned int maskValue ) { m_lvl2TrailerMask[ trailerWord ] = maskValue; }
-    unsigned int lvl2TrailerMask( unsigned int trailerWord ) const { return m_lvl2TrailerMask[ trailerWord ]; }
-    /**
-     * set/get lvl2Candidate mask
-     * @param maskValue   value to which the mask is set
-     */
-    void lvl2CandidateMask( unsigned int maskValue ) { m_lvl2CandidateMask = maskValue; }
-    unsigned int lvl2CandidateMask() const { return m_lvl2CandidateMask; }
-    /**
-     * set/get lvl2Header masks
-     * @param headerWord  which of the 0 ... 7 header words
-     * @param maskValue   value to which the mask is set
-     */
-    void daqHeaderMask( unsigned int headerWord, unsigned int maskValue ) { m_daqHeaderMask[ headerWord ] = maskValue; }
-    unsigned int daqHeaderMask( unsigned int headerWord ) const { return m_daqHeaderMask[ headerWord ]; }
-    /**
-     * set/get daqTrailo masks
-     * @param trailerWord  which of the 0 ... 4 trailor words
-     * @param maskValue   value to which the mask is set
-     */
-    void daqTrailerMask( unsigned int trailerWord, unsigned int maskValue ) { m_daqTrailerMask[ trailerWord ] = maskValue; }
-    unsigned int daqTrailerMask( unsigned int trailerWord ) const { return m_daqTrailerMask[ trailerWord ]; }
-    /**
-     * set/get daqMictp mask
-     * @param maskValue   value to which the mask is set
-     */
-    void daqMictpMask( unsigned int maskValue ) { m_daqMictpMask = maskValue; }
-    unsigned int daqMictpMask() const { return m_daqMictpMask; }
-    /**
-     * set/get daqCandidate mask
-     * @param maskValue   value to which the mask is set
-     */
-    void daqCandidateMask( unsigned int maskValue ) { m_daqCandidateMask = maskValue; }
-    unsigned int daqCandidateMask() const { return m_daqCandidateMask; }
-
-    /**
-     * Compare the output intended for the DAQ as produced
-     * by the simulation and the hardware
-     * @param simOut Output of the simulation
-     * @param hardwareOut Output of the hardware
-     * @param printToScreen if true does printout line by line
-     */
-    unsigned int daqOutIsEqual( const std::list<unsigned int> & simOut,
-                                const std::list<unsigned int> & hardwareOut,
-                                bool printToScreen ) const;
-
-    bool mirodFiFosAreEqual( MirodFiFoContent & mirodFiFos,
-                             MirodFiFoContent & simMirodFiFos ) const;
-
-  private:
-    std::vector< unsigned int >	m_lvl2HeaderMask;
-    unsigned int	m_lvl2CandidateMask;
-    std::vector< unsigned int >	m_lvl2TrailerMask;
-
-    std::vector< unsigned int >	m_daqHeaderMask;
-    unsigned int	m_daqMictpMask;
-    unsigned int	m_daqCandidateMask;
-    std::vector< unsigned int >	m_daqTrailerMask;
-
-  }; // class Verifyer
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_VERIFYER_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.cxx
deleted file mode 100644
index 470acc9c9308..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.cxx
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MsgLogger.cxx 706709 2015-11-09 12:10:23Z wengler $
-
-// STL include(s):
-#include <iomanip>
-#include <cstdlib>
-
-// Local include(s):
-#include "MsgLogger.h"
-#include "MsgWriter.h"
-
-//***********************************************************************
-//
-//       Version : $Revision: 706709 $
-//
-//   Description : Implementation of the MsgLogger class
-//
-//        Author : $Author: krasznaa $
-//          Date : $Date: 2015-11-09 13:10:23 +0100 (Mon, 09 Nov 2015) $
-//
-//***********************************************************************
-
-namespace LVL1MUCTPI {
-
-   //
-   // This is the hard-coded maximum length of the source names:
-   //
-   static const std::string::size_type MAXIMUM_SOURCE_NAME_LENGTH = 20;
-
-   MsgLogger::MsgLogger( const std::string& source )
-      : m_source( source ), m_activeType( INFO ) {
-
-      m_msgWriter = MsgWriter::instance();
-   }
-
-   MsgLogger::MsgLogger( const MsgLogger& parent )
-      : std::basic_ios< MsgLogger::char_type, MsgLogger::traits_type >(),
-        std::ostringstream(),m_msgWriter(nullptr) {
-
-      *this = parent;
-   }
-
-   MsgLogger& MsgLogger::operator= ( const MsgLogger& parent ) {
-
-     if (this != &parent){
-       m_source = parent.m_source;
-       m_msgWriter = MsgWriter::instance();
-       m_activeType = parent.m_activeType;
-     }
-     return *this;
-   }
-
-   MsgLogger& MsgLogger::endmsg( MsgLogger& logger ) {
-
-      logger.send();
-      return logger;
-   }
-
-   std::string MsgLogger::getFormattedSource() const {
-
-      // make sure the source name is no longer than fMaxSourceSize:
-      std::string source_name = m_source;
-      if( source_name.size() > MAXIMUM_SOURCE_NAME_LENGTH ) {
-         source_name = source_name.substr( 0, MAXIMUM_SOURCE_NAME_LENGTH - 3 );
-         source_name += "...";
-      }
-   
-      return source_name;
-   }
-
-   std::string MsgLogger::getPrintedSource() const {
-
-      // the full logger prefix
-      std::string source_name = getFormattedSource();
-      if( source_name.size() < MAXIMUM_SOURCE_NAME_LENGTH ) {
-         for( std::string::size_type i = source_name.size();
-              i < MAXIMUM_SOURCE_NAME_LENGTH; ++i ) {
-            source_name.push_back( ' ' );
-         }
-      }
-
-      return source_name + " : "; 
-   }
-
-   /**
-    * This is the function that actually writes to the output, using MsgWriterSingleton.
-    * You can even give multi-line strings to it, it will nicely give each line
-    * the appropriate header.
-    */
-   void MsgLogger::send( MsgType type, const std::string& message ) const {
-
-      std::string::size_type previous_pos = 0, current_pos = 0;
-
-      //
-      // Make sure the source name is no longer than MAXIMUM_SOURCE_NAME_LENGTH:
-      //
-      std::string source_name = getFormattedSource();
-
-      //
-      // Slice the recieved message into lines:
-      //
-      for( ; ; ) {
-
-         current_pos = message.find( '\n', previous_pos );
-         std::string line = message.substr( previous_pos, current_pos - previous_pos );
-
-         std::ostringstream message_to_send;
-         // I have to call the modifiers like this, otherwise g++ get's confused
-         // with the operators...
-         message_to_send.setf( std::ios::adjustfield, std::ios::left );
-         message_to_send.width( MAXIMUM_SOURCE_NAME_LENGTH );
-         message_to_send << source_name << " : " << line;
-         m_msgWriter->write( type, message_to_send.str() );
-
-         if( current_pos == message.npos ) break;
-         previous_pos = current_pos + 1;
-
-      }
-
-      return;
-   }
-
-   void MsgLogger::send() {
-
-      this->send( m_activeType, this->str() );
-
-      //
-      // Reset the stream buffer:
-      //
-      this->str( "" );
-
-      return;
-   }
-
-   bool MsgLogger::msgLvl( MsgType type ) const {
-      return m_msgWriter->msgLvl((unsigned int)type);
-   }
-#ifndef STANDALONE
-   bool MsgLogger::msgLvl( MSG::Level type ) const {
-      return m_msgWriter->msgLvl((unsigned int) type);
-   }
-#endif
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.h b/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.h
deleted file mode 100644
index 14f5926ef88d..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgLogger.h
+++ /dev/null
@@ -1,210 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MsgLogger.h 472835 2011-12-06 21:05:16Z stelzer $
-#ifndef TRIGT1MUCTPI_MSGLOGGER_H
-#define TRIGT1MUCTPI_MSGLOGGER_H
-
-// STL include(s):
-#include <string>
-#include <sstream>
-
-#ifndef STANDALONE
-// Gaudi/Athena include(s):
-#include "GaudiKernel/IMessageSvc.h"
-#endif
-
-// Local include(s):
-#include "MsgType.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class MsgWriter;
-
-   /**
-    * @short  This class should be used to do all printouts in the simulation.
-    *
-    *         One shouldn't use the standard output in the simulation,
-    *         altough it's still used in some places. Instead this class
-    *         should be used, as it will automatically redirect the
-    *         messages to the correct output.
-    *
-    * @see    MsgWriter
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 472835 $
-    * $Date: 2011-12-06 22:05:16 +0100 (Tue, 06 Dec 2011) $
-    */
-   class MsgLogger : public std::ostringstream {
-
-   public:
-      /// Constructor with the message source defined by 'source'.
-      MsgLogger( const std::string& source );
-      /// Copy constructor
-      MsgLogger( const MsgLogger& parent );
-
-      MsgLogger& operator= ( const MsgLogger& parent );
-
-      /// The message source truncated to the maximum length
-      std::string getFormattedSource() const;
-      /// The message source in the format that it is printed
-      std::string getPrintedSource() const;
-
-      // Stream modifier(s):
-      static MsgLogger& endmsg( MsgLogger& logger );
-
-      // Accept stream modifiers:
-      MsgLogger& operator<< ( MsgLogger& ( *_f )( MsgLogger& ) );
-      MsgLogger& operator<< ( std::ostream& ( *_f )( std::ostream& ) );
-      MsgLogger& operator<< ( std::ios& ( *_f )( std::ios& ) );
-
-      // Accept message type specification:
-      MsgLogger& operator<< ( MsgType type );
-
-      // For all the "conventional" inputs:
-      template < class T > MsgLogger& operator<< ( T arg ) {
-         ( * ( std::ostringstream* ) this ) << arg;
-         return *this;
-      }
-
-      /// Send a message of type 'type' to the output.
-      void send( MsgType type, const std::string& message ) const;
-
-      bool msgLvl( MsgType type ) const;
-#ifndef STANDALONE
-      bool msgLvl( MSG::Level type ) const;
-#endif
-
-   private:
-      void send();
-
-      std::string m_source;
-      MsgWriter*  m_msgWriter;
-      MsgType     m_activeType;
-
-   }; // class MsgLogger
-
-   //////////////////////////////////////////////////////////////////////
-   //                                                                  //
-   //   To speed up the code a bit, the following operators are        //
-   //   declared 'inline'.                                             //
-   //                                                                  //
-   //////////////////////////////////////////////////////////////////////
-
-   inline MsgLogger& MsgLogger::operator<< ( MsgLogger& ( *f )( MsgLogger& ) ) {
-
-      return ( f )( *this );
-   }
-
-   inline MsgLogger& MsgLogger::operator<< ( std::ostream& ( *f )( std::ostream& ) ) {
-
-      ( f )( *this );
-      return *this;
-   }
-
-   inline MsgLogger& MsgLogger::operator<< ( std::ios& ( *f )( std::ios& ) ) {
-
-      ( f )( *this );
-      return *this;
-   }
-
-   inline MsgLogger& MsgLogger::operator<< ( MsgType type ) {
-
-      m_activeType = type;
-      return *this;
-   }
-
-} // namespace LVL1MUCTPI
-
-// This is a GCC extension for getting the name of the current function.
-#if defined( __GNUC__ )
-#   define MSGLOGGER_FNAME __PRETTY_FUNCTION__
-#else
-#   define MSGLOGGER_FNAME ""
-#endif
-
-/// Common prefix for the non-usual messages
-/**
- * The idea is that a regular user usually only wants to see DEBUG, INFO
- * and some WARNING messages. So those should be reasonably short. On the other
- * hand serious warnings (ERROR, FATAL) or VERBOSE messages should be as precise
- * as possible.
- *
- * So I stole the idea from Athena (what a surprise...) to have a few macros which
- * produce messages with a common formatting. This macro provides the prefix for
- * all the messages.
- */
-#define MSGLOGGER_REPORT_PREFIX                                   \
-   __FILE__ << ":" << __LINE__ << " (" << MSGLOGGER_FNAME << "): "
-
-/// Generic macro for reporting messages in the code
-/**
- * This macro can be used to conveniently print messages with information on
- * where the message is coming from in the code. The rest of the macros use this
- * macro internally. But you can also use it directly like this:
- *
- * <code>
- *   REPORT_MSG( LVL1MUCTPI::INFO, "Some information message" );
- * </code>
- */
-#define REPORT_MSG2( LEVEL, MESSAGE, LOGGER )                   \
-   if( LOGGER.msgLvl(LEVEL) ) {                                 \
-        LOGGER << LEVEL << MSGLOGGER_REPORT_PREFIX << MESSAGE   \
-               << LVL1MUCTPI::MsgLogger::endmsg;                \
-   }
-#define REPORT_MSG( LEVEL, MESSAGE ) REPORT_MSG2(LEVEL, MESSAGE, m_logger)
-
-/// Convenience macro for reporting VERBOSE messages in the code
-/**
- * This macro is very similar to the REPORT_MESSAGE macros of Athena. It prints
- * a nicely formatted output that specifies both the exact function name where
- * the message was printed, and also the filename:line combination. It can be used
- * like a regular function inside cycles:
- *
- * <code>
- *   REPORT_VERBOSE_MSG( "This is a verbose message with a number: " << number );
- * </code>
- */
-#define REPORT_VERBOSE_MSG2( MESSAGE, LOGGER )                          \
-   if( LOGGER.msgLvl(LVL1MUCTPI::VERBOSE) ) {                         \
-      LOGGER << LVL1MUCTPI::VERBOSE << MESSAGE << LVL1MUCTPI::MsgLogger::endmsg; \
-   }
-#define REPORT_VERBOSE_MSG(MESSAGE ) REPORT_VERBOSE_MSG2(MESSAGE, m_logger)
-
-/// Convenience macro for reporting ERROR messages in the code
-/**
- * This macro is very similar to the REPORT_MESSAGE macros of Athena. It prints
- * a nicely formatted output that specifies both the exact function name where
- * the message was printed, and also the filename:line combination. It can be used
- * like a regular function inside cycles:
- *
- * <code>
- *   REPORT_ERROR_MSG( "A serious error message" );
- * </code>
- */
-#define REPORT_ERROR_MSG2( MESSAGE, LOGGER )           \
-   REPORT_MSG2( LVL1MUCTPI::ERROR, MESSAGE, LOGGER )
-#define REPORT_ERROR_MSG( MESSAGE ) \
-   REPORT_MSG( LVL1MUCTPI::ERROR, MESSAGE )
-
-/// Convenience macro for reporting FATAL messages in the code
-/**
- * This macro is very similar to the REPORT_MESSAGE macros of Athena. It prints
- * a nicely formatted output that specifies both the exact function name where
- * the message was printed, and also the filename:line combination. It can be used
- * like a regular function inside cycles:
- *
- * <code>
- *   REPORT_FATAL_MSG( "A very serious error message" );
- * </code>
- */
-#define REPORT_FATAL_MSG( MESSAGE ) \
-   REPORT_MSG( LVL1MUCTPI::FATAL, MESSAGE )
-#define REPORT_FATAL_MSG2( MESSAGE, LOGGER )           \
-   REPORT_MSG2( LVL1MUCTPI::FATAL, MESSAGE, LOGGER )
-
-#endif // TRIGT1MUCTPI_MSGLOGGER_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgType.h b/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgType.h
deleted file mode 100644
index 35d0d8944884..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgType.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MsgType.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_MSGTYPE_H
-#define TRIGT1MUCTPI_MSGTYPE_H
-
-namespace LVL1MUCTPI {
-
-  enum MsgType { VERBOSE = 1, DEBUG = 2, INFO = 3, WARNING = 4,
-                 ERROR = 5, FATAL = 6, ALWAYS = 7 };
-
-}
-
-#endif // TRIGT1MUCTPI_MSGTYPE_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.cxx
deleted file mode 100644
index 0827d4359aa9..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.cxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MsgWriter.cxx 796122 2017-02-08 03:23:15Z ssnyder $
-
-#ifdef STANDALONE
-#include <iostream>
-#else
-#include "AthenaKernel/getMessageSvc.h"
-#endif // STANDALONE
-
-// Local include(s):
-#include "MsgWriter.h"
-
-//***********************************************************************
-//
-//       Version : $Revision: 796122 $
-//
-//   Description : Implementation of the MsgWriterSingleton class
-//
-//        Author : $Author: krasznaa $
-//          Date : $Date: 2017-02-08 04:23:15 +0100 (Wed, 08 Feb 2017) $
-//
-//***********************************************************************
-
-namespace LVL1MUCTPI {
-
-  MsgWriter* MsgWriter::m_instance = 0;
-
-  MsgWriter* MsgWriter::instance() {
-
-    if( ! m_instance ) {
-
-      m_instance = new MsgWriter();
-
-    }
-
-    return m_instance;
-
-  }
-
-  MsgWriter::~MsgWriter() {
-
-#ifndef STANDALONE
-    delete m_stream;
-#endif // STANDALONE
-
-  }
-
-  void MsgWriter::write( MsgType type, std::string line ) {
-
-#ifdef STANDALONE
-    if( type < m_min_type ) return;
-    std::cout << "  (" << m_type_map[ type ] << ")  " << line << std::endl;
-#else
-    *m_stream << m_type_map[ type ] << line << endmsg;
-#endif // STANDALONE
-
-  }
-
-#ifdef STANDALONE
-  void MsgWriter::setMinType( MsgType type ) {
-    m_min_type = type;
-  }
-  bool MsgWriter::msgLvl(MsgType type) const {
-    return type >= m_min_type;
-  }
-  bool MsgWriter::msgLvl( unsigned int type ) const {
-    return msgLvl(MsgType(type));
-  }
-#else
-  void MsgWriter::setMinType( MSG::Level type ) {
-    m_stream->setLevel( type );
-  }
-  bool MsgWriter::msgLvl( MSG::Level type ) const {
-    return type >= m_stream->level();
-  }
-  bool MsgWriter::msgLvl( unsigned int type ) const {
-    return msgLvl(MSG::Level(type));
-  }
-  void MsgWriter::setSource( const std::string& source ) {
-    delete m_stream;
-    m_stream = new MsgStream( Athena::getMessageSvc(), source );
-  }
-#endif // STANDALONE
-
-  MsgWriter::MsgWriter() {
-
-#ifdef STANDALONE
-    m_type_map[ VERBOSE ] = "VERBOSE";
-    m_type_map[ DEBUG ]   = " DEBUG ";
-    m_type_map[ INFO ]    = " INFO  ";
-    m_type_map[ WARNING ] = "WARNING";
-    m_type_map[ ERROR ]   = " ERROR ";
-    m_type_map[ FATAL ]   = " FATAL ";
-    m_type_map[ ALWAYS ]  = "ALWAYS ";
-
-    m_min_type = INFO;
-#else
-    m_stream = new MsgStream( Athena::getMessageSvc(), "L1Muctpi" );
-    m_type_map[ VERBOSE ] = MSG::VERBOSE;
-    m_type_map[ DEBUG ]   = MSG::DEBUG;
-    m_type_map[ INFO ]    = MSG::INFO;
-    m_type_map[ WARNING ] = MSG::WARNING;
-    m_type_map[ ERROR ]   = MSG::ERROR;
-    m_type_map[ FATAL ]   = MSG::FATAL;
-    m_type_map[ ALWAYS ]  = MSG::ALWAYS;
-#endif // STANDALONE
-
-  }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.h b/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.h
deleted file mode 100644
index 85633c10bd5c..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Logging/MsgWriter.h
+++ /dev/null
@@ -1,83 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MsgWriter.h 472835 2011-12-06 21:05:16Z stelzer $
-#ifndef TRIGT1MUCTPI_MSGWRITER_H
-#define TRIGT1MUCTPI_MSGWRITER_H
-
-// STL include(s):
-#include <string>
-#include <map>
-
-#ifndef STANDALONE
-// Gaudi/Athena include(s):
-#include "GaudiKernel/MsgStream.h"
-#endif // STANDALONE
-
-// Local include(s):
-#include "MsgType.h"
-
-namespace LVL1MUCTPI {
-
-  /**
-   * @short   Singleton class responsible for showing messages
-   *
-   *          The MuCTPI simulation has to work in two environments at
-   *          this time. As part of the ATLAS digitization in Athena,
-   *          and in a stand-alone mode in the MuCTPI DVS tests. In
-   *          Athena all message logging should be done via the MsgStream
-   *          class, while in the tests the standard output is used.
-   *
-   *          This class is used to make sure the output is redirected to
-   *          the correct place.
-   *
-   * @see     MsgLogger
-   * @author  $Author: krasznaa $
-   * @version $Revision: 472835 $
-   */
-  class MsgWriter {
-
-  public:
-    /// Singleton method for requesting the one and only object.
-    static MsgWriter* instance();
-    ~MsgWriter();
-
-    /// Write the message given in 'line' having a priority defined by 'type'.
-    void write( MsgType type, std::string line );
-
-    /// Set the minimal type of the messages to display.
-#ifdef STANDALONE
-    void setMinType( MsgType type );
-    bool msgLvl(MsgType type) const;
-#else
-    void setMinType( MSG::Level type );
-    void setSource( const std::string& source );
-    bool msgLvl( MSG::Level type ) const;
-#endif // STANDALONE
-
-    bool msgLvl( unsigned int type ) const;
-
-  protected:
-    /// Singleton design, the constructor is protected.
-    MsgWriter();
-
-  private:
-    /// The pointer to the only instance of the object.
-    static MsgWriter* m_instance;
-    // The two different environments need different variables:
-#ifdef STANDALONE
-    std::map< MsgType, std::string > m_type_map;
-    MsgType m_min_type;
-#else
-    MsgStream* m_stream;
-    std::map< MsgType, MSG::Level > m_type_map;
-#endif // STANDALONE
-
-  }; // class MsgWriter
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MSGWRITERSINGLETON_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.cxx
deleted file mode 100644
index c2059c03865d..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.cxx
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Lvl1Mibak.cxx 700318 2015-10-13 14:13:15Z wengler $
-
-// STL include(s):
-#include <cassert>
-#include <sstream>
-
-// Gaudi/Athena include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// Local include(s):
-#include "Lvl1Mibak.h"
-#include "../Mioct/MioctModule.h"
-#include "../Mictp/MictpModule.h"
-#include "../Mirod/MirodModule.h"
-#include "../Common/Configuration.h"
-#include "../Common/PtMultiplicitySet.h"
-#include "../Mioct/EventReader.h"
-#include "../Mioct/EventReaderFactory.h"
-#include "../Mioct/OverlapLogic.h"
-#include "../Mioct/MultiplicityLogic.h"
-
-
-namespace LVL1MUCTPI {
-
-   Lvl1Mibak::Lvl1Mibak( EventReader* reader )
-      : m_logger( "Lvl1Mibak" ), m_lvl1MioctList(), m_lvl1OverlapLogic( 0 ),
-        m_multiplicityLogic( 0 ), m_eventReader( reader ) {
-
-      // Create the "logic objects". Note that the overlap logic uses the multiplicity
-      // logic itself.
-      m_multiplicityLogic = new MultiplicityLogic();
-      m_lvl1OverlapLogic = new OverlapLogic( m_multiplicityLogic );
-
-      // create a list of 16 MIOCT modules
-      MioctModule* newMioct;
-      REPORT_VERBOSE_MSG( "Constructor called" );
-
-      for( unsigned int id = 0; id <= 7; ++id ) {
-         // id mioct module for the negative rapidiy region...
-         MioctID newID( id, Hemisphere( NEGATIVE ) );
-         newMioct = new MioctModule( newID, m_lvl1OverlapLogic, m_eventReader );
-         m_lvl1MioctList.push_back( newMioct );
-         REPORT_VERBOSE_MSG( "MIOCT module with id " << id
-                             << " in the NEGATIVE rapidity region created" );
-      }
-      for( unsigned int id = 0; id <= 7; ++id ) {
-         // one mioct module for the positive rapidiy region...
-         MioctID newID( id, Hemisphere( POSITIVE ) );
-         newMioct = new MioctModule( newID, m_lvl1OverlapLogic, m_eventReader );
-         m_lvl1MioctList.push_back( newMioct );
-         REPORT_VERBOSE_MSG( "MIOCT module with id " << id
-                             << " in the POSITIVE rapidity region created" );
-      }
-
-      // create the MICTP Module
-      m_mictpModule = new MictpModule();
-      REPORT_VERBOSE_MSG( "MICTP module created" );
-
-      // create the MIROD Module
-      m_mirodModule = new MirodModule();
-      REPORT_VERBOSE_MSG( "MIROD module created" );
-
-      // check if a valid Event reader is installed, If not, exit
-      // with a fatal error here.
-      if( ! m_eventReader->isValid() ) {
-         REPORT_FATAL_MSG( "No valid EventReader installed!" );
-         REPORT_FATAL_MSG( "The reason is : " << reader->getInfoString() );
-         assert( 0 );
-      }
-
-      //initialise the zero suppression flag to true, which is the more common - will be set from the configuration
-      m_doZeroSuppression = true;
-
-   }
-
-   Lvl1Mibak::~Lvl1Mibak() {
-
-      REPORT_VERBOSE_MSG( "Destructor called" );
-      std::list< MioctModule* >::iterator it;
-      for( it = m_lvl1MioctList.begin(); it != m_lvl1MioctList.end(); it++ ) {
-         delete *it;
-      }
-      delete m_mictpModule;
-      delete m_mirodModule;
-      delete m_lvl1OverlapLogic;
-      delete m_multiplicityLogic;
-   }
-
-   MioctModule* Lvl1Mibak::getMioctModule( MioctID findId ) const {
-
-      std::list< MioctModule* >::const_iterator it;
-      for( it = m_lvl1MioctList.begin(); it != m_lvl1MioctList.end(); ++it ) {
-         MioctID mioctID = (*it)->getMioctID();
-         if( mioctID.getNumber() == findId.getNumber() &&
-             mioctID.getRapidityRegion() == findId.getRapidityRegion() ) {
-            return *it;
-         }
-      }
-
-      m_logger << WARNING << "MioctID " << findId << " not known!"
-               << MsgLogger::endmsg;
-      return 0;
-   }
-
-   PtMultiplicitySet Lvl1Mibak::getPtMultiplicity() const {
-
-      std::string preliminaryResult;
-      std::list< MioctModule* >::const_iterator it;
-      PtMultiplicitySet result;
-      REPORT_VERBOSE_MSG( "getPtMultiplicity() called" );
-
-      for( it = m_lvl1MioctList.begin(); it != m_lvl1MioctList.end(); ++it ) {
-         result += ( ( *it )->calculateMultiplicity() );
-         result.print( preliminaryResult );
-         REPORT_VERBOSE_MSG( "Preliminary result : \n" << preliminaryResult );
-      }
-
-      return result;
-   }
-
-   void Lvl1Mibak::setMictpData() {
-
-      // get access to the EventID singleton
-      EventID eventID;
-      // get the BCID and ECRC from the EventID singleton
-      unsigned int BCID = eventID.BCID();
-      unsigned int ECRC = eventID.getECRC();
-      // get the PtSums
-      PtMultiplicitySet ptSet = this->getPtMultiplicity();
-
-      // fill the summed Pt information and the BCID into the MICTP
-      m_mictpModule->setPtSums( &ptSet, BCID, ECRC );
-
-      return;
-   }
-
-   LVL1::MuCTPIL1Topo Lvl1Mibak::getL1TopoCandidates(MioctL1TopoConverter & l1TopoConv) const {
-
-      std::list< MioctModule* >::const_iterator it;
-      LVL1::MuCTPIL1Topo result;
-      REPORT_VERBOSE_MSG( "getL1TopoCandidates() called" );
-
-      for( it = m_lvl1MioctList.begin(); it != m_lvl1MioctList.end(); ++it ) {
-	result += ( ( *it )->getL1TopoCandidates(l1TopoConv) );
-      }
-
-      return result;
-   }
-
-
-
-   void Lvl1Mibak::mirodProcessData() {
-
-      const MibakStreamEvent* theStream = this->getMibakData();
-      m_mirodModule->processData( theStream );
-
-      return;
-   }
-
-
-   const MibakStreamEvent* Lvl1Mibak::getMibakData() {
-
-      // make sure the cointainers of the StreamEvent are empty --------
-      m_mibakStream.highBits.clear();
-      m_mibakStream.dataWords.clear();
-
-      // fill in the MICTP data
-      const MictpData* mictpData = m_mictpModule->getMictpOnMibak();
-      const std::list<unsigned int>* mictpHighBits  = mictpData->getHighBits();
-      const std::list<unsigned int>* mictpDataWords = mictpData->getDataWords();
-      std::list<unsigned int>::const_iterator it_mictpHighBits  = mictpHighBits->begin();
-      std::list<unsigned int>::const_iterator it_mictpDataWords = mictpDataWords->begin();
-      for( ; it_mictpHighBits != mictpHighBits->end(); ++it_mictpHighBits ) {
-
-         m_mibakStream.highBits.push_back( *it_mictpHighBits );
-         m_mibakStream.dataWords.push_back( *it_mictpDataWords );
-
-         ++it_mictpDataWords; // increase also the data word iterator
-      }
-
-      // Loop over the MIOCT Modules ------------------------------------
-      std::list<MioctModule*>::const_iterator it_mioctModule;
-      for( it_mioctModule = m_lvl1MioctList.begin();
-           it_mioctModule != m_lvl1MioctList.end(); ++it_mioctModule ) {
-
-         // get pointer to the data of this MIOCT
-         MioctData* mioctData = ( (*it_mioctModule)->getMioctOnMibak() );
-
-         // the Header of this MIOCT
-         m_mibakStream.highBits.push_back( mioctData->getStartMarker() );
-         m_mibakStream.dataWords.push_back( mioctData->getHeader() );
-
-         // loop over the sectors of this MIOCT and do zero
-         // suppression if requested
-         const std::vector< unsigned int >* mioctSectorWords = mioctData->getSectorWords();
-         const std::vector< unsigned int >* mioctSectorHighBits =
-            mioctData->getSectorHighBits();
-         if( mioctSectorWords->size() > SECTORS_IN_MIOCT ) {
-            REPORT_FATAL_MSG( "Too many sectors transmitted by MIOCT!!!" );
-            assert( 0 );
-         }
-         if( mioctSectorWords->size() != mioctSectorHighBits->size() ) {
-            REPORT_FATAL_MSG( "Size of vectors in MioctData differ!!!" );
-            assert( 0 );
-         }
-         std::vector< unsigned int >::const_iterator it_sectorWords =
-            mioctSectorWords->begin();
-         std::vector< unsigned int >::const_iterator it_sectorHighBits =
-            mioctSectorHighBits->begin();
-         unsigned int secCount = 0; // sector counter reset
-         for( ; it_sectorWords != mioctSectorWords->end(); ++it_sectorWords ) {
-            // The bit sequence 111 signalls that there is no candidate.
-            // This variable is ony true, if at least one candidate's pt
-            // value is different from 111
-            bool notEmpty = ( ( *it_sectorWords ) & Pt1and2Mask ) ^ Pt1and2Mask;
-
-            if ( notEmpty || !m_doZeroSuppression ) {
-               ++secCount;
-               m_mibakStream.highBits.push_back( *it_sectorHighBits );
-               m_mibakStream.dataWords.push_back( *it_sectorWords );
-            }
-
-            ++it_sectorHighBits;
-         } // end of sector loop
-
-         // the Trailer of this MIOCT
-         m_mibakStream.highBits.push_back( mioctData->getEndMarker() );
-         // First fill the word count into the trailer word if zero
-         // suppression was applied, than get the trailer pointer
-         if ( m_doZeroSuppression ) {
-            mioctData->setTrailerWordCount( secCount + 2 );
-         }
-         m_mibakStream.dataWords.push_back( mioctData->getTrailer() );
-
-      } // end of MIOCT loop -------------------------------------------
-
-      return &m_mibakStream;
-   }
-
-   void Lvl1Mibak::setOverlapStrategy( StrategyName newStrategy ) {
-
-      REPORT_VERBOSE_MSG( "setOverlapStrategy() called" );
-      m_lvl1OverlapLogic->changeStrategy( newStrategy );
-      return;
-   }
-
-   std::string Lvl1Mibak::getOverlapStrategyName() const {
-
-      REPORT_VERBOSE_MSG( "getOverlapStrategy() called" );
-      return m_lvl1OverlapLogic->getCurrentStrategyName();
-   }
-
-   void Lvl1Mibak::setConfiguration( const Configuration &conf ) {
-
-      // Zero Suppression Flag
-      m_doZeroSuppression = conf.getDoZeroSuppression();
-
-      // configure MIROD
-      m_mirodModule->setConfiguration(conf);
-      return;
-   }
-
-   StatusCode Lvl1Mibak::initializeLUTOverlapStrategy( const std::string& lutXMLFile,
-                                                       bool flagMode, bool dumpLut,
-						       const std::string& runPeriod ) {
-
-     CHECK( m_lvl1OverlapLogic->initializeLUT( lutXMLFile, flagMode, dumpLut, runPeriod ) );
-      return StatusCode::SUCCESS;
-   }
-
-   void Lvl1Mibak::setMultiplicityStrategy( MultiplicityCalcType type ) {
-
-      REPORT_VERBOSE_MSG( "setMultiplicityStrategy() called" );
-      m_multiplicityLogic->changeStrategy( type );
-      return;
-   }
-
-   void Lvl1Mibak::initializeXMLMultStrategy( const std::string& xmlFile ) {
-
-      m_multiplicityLogic->initializeXML( xmlFile );
-      return;
-   }
-
-   /**
-    * This function should actually not be here. Teh logic implemented here is
-    * not happening in the MIBAK in the real hardware, but in a simple NIM logic.
-    * However programatically it was much easier to put this code here...
-    *
-    * The function just checks if any of the octant boards received a barrel
-    * candidate.
-    *
-    * @returns <code>true</code> if any of the octant boards saw a barrel candidate,
-    *          <code>false</code> otherwise
-    */
-   bool Lvl1Mibak::hasBarrelCandidate() const {
-
-      // Return true if any of the boards saw such a candidate:
-      std::list< MioctModule* >::const_iterator itr = m_lvl1MioctList.begin();
-      std::list< MioctModule* >::const_iterator end = m_lvl1MioctList.end();
-      for( ; itr != end; ++itr ) {
-         if( ( *itr )->hasBarrelCandidate() ) {
-            return true;
-         }
-      }
-
-      // If no board saw such a candidate, return false:
-      return false;
-   }
-
-   /**
-    * This function should actually not be here. Teh logic implemented here is
-    * not happening in the MIBAK in the real hardware, but in a simple NIM logic.
-    * However programatically it was much easier to put this code here...
-    *
-    * The function just checks if any of the octant boards received an endcap
-    * candidate.
-    *
-    * @returns <code>true</code> if any of the octant boards saw an endcap candidate,
-    *          <code>false</code> otherwise
-    */
-   bool Lvl1Mibak::hasEndcapCandidate() const {
-
-      // Return true if any of the boards saw such a candidate:
-      std::list< MioctModule* >::const_iterator itr = m_lvl1MioctList.begin();
-      std::list< MioctModule* >::const_iterator end = m_lvl1MioctList.end();
-      for( ; itr != end; ++itr ) {
-         if( ( *itr )->hasEndcapCandidate() ) {
-            return true;
-         }
-      }
-
-      // If no board saw such a candidate, return false:
-      return false;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.h
deleted file mode 100644
index 1d6d4e5956ae..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/Lvl1Mibak.h
+++ /dev/null
@@ -1,201 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Lvl1Mibak.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_LVL1MIBAK_H
-#define TRIGT1MUCTPI_LVL1MIBAK_H
-
-// STL include(s):
-#include <list>
-#include <string>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/StatusCode.h"
-
-// Local include(s):
-#include "../Common/SectorConstants.h"
-#include "../Common/MultiplicityCalcType.h"
-#include "../Logging/MsgLogger.h"
-#include "../Common/EventID.h"
-#include "../Common/MioctL1TopoConverter.h"
-#include "MibakStreamEvent.h"
-#include "../Mioct/StrategyName.h"
-
-// include  interface class to L1Topo
-#include "TrigT1Interfaces/MuCTPIL1Topo.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class Configuration;
-   class MioctModule;
-   class MioctID;
-   class PtMultiplicitySet;
-   class MictpModule;
-   class MirodModule;
-   class OverlapLogic;
-   class MultiplicityLogic;
-   class EventReader;
-
-   /**
-    *  @short This class represents the MIBAK backplane of the MUCTPI Interface.
-    *
-    *         This class  is  a model of the    Lvl1 part of   the MIBAK
-    *         backplane.  It  contains  the 16 MIOCT modules  which have
-    *         corresponding    representations   in      software    and
-    *         hardware. Differently  from the hardware implementation it
-    *         is the Lvl1Mibak  which contains the  OverlapLogic used by
-    *         all MioctBoards  in  order to resolve the  overlap between
-    *         neighbouring  sectors. This choice  has  been made because
-    *         there is no need to instantiate an overlap Logic for every
-    *         octant board since all octant boards use the same strategy
-    *         to  resolve   overlapping   muon    candidates.  Different
-    *         Strategies can be   chosen   via a member   function.  The
-    *         possible strategies are listed in StrategyName.h
-    *
-    *    @see MioctModule
-    *    @see OverlapLogic
-    *    @see OverlapStrategy
-    *    @see StrategyName.h
-    *    @see PtMultiplicitySet
-    *
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class Lvl1Mibak {
-
-   public:
-      /**
-       * In the constructor the NullStrategy (no consideration of Overlap)
-       * will be installed as a default for the OverlapLogic. The user has
-       * to change the Strategy via a call to setOverlapStrategy() if he 
-       * wants differnt strategies to be applied.
-       * @see OverlapLogic
-       * @see OverlapStrategy
-       * @see NullStrategy
-       * @see StrategyName.h
-       */
-      Lvl1Mibak( EventReader* reader );
-
-      // disable copy/assignment operator as not used/implemented
-      Lvl1Mibak( const Lvl1Mibak & ) = delete;
-      Lvl1Mibak & operator = ( const Lvl1Mibak & ) = delete;
-
-      ~Lvl1Mibak();
-
-      /// set Configuration
-      void setConfiguration( const Configuration &conf );
-
-      /**
-       * Read back a point to MioctModule specified by MioctID in the
-       * Argument
-       * @see MioctModule
-       * @see MioctID
-       */
-      MioctModule* getMioctModule( MioctID id ) const;
-      /**
-       * This function determines the Pt multiplicity of the muon candidates
-       * for each pt-threshold independently. Like in the hardware the
-       * multiplicities satureate at a count of 7.
-       * @return PtMultiplicitySet The pt-multiplicities for six different
-       * pt-thresholds calculated over all muon trigger chambers.
-       * @see PtMultiplicitySet
-       * @see OverlapLogic
-       * @see OverlapStrategy
-       */
-      PtMultiplicitySet  getPtMultiplicity() const;
-      /**
-       * This method fills the information obtained from the MIOCT Modules into
-       * the MICTP
-       */
-      void setMictpData();
-      /**
-       * Get access to the MictpModule
-       * @return Pointer to the MictpModule
-       */
-      MictpModule* getMictp() { return m_mictpModule; }
-      /**
-       * Get access to the MirodModule
-       * @return Pointer to the MirodModule
-       */
-      MirodModule* getMirod() { return m_mirodModule; }
-      /**
-       * This method fills the information obtained from the MIOCT
-       * the MICTP boards into the MIROD
-       */
-      void mirodProcessData();
-      /**
-       * This function return a pointer to an object allowing access to
-       * the data of this event in Mibak format.
-       * @return Pointer to MibakData object allowing access
-       *         to the data of this event in Mibak format
-       */
-      const MibakStreamEvent* getMibakData();
-      /**
-       * This method just returns the pointer to the MibakStreamEvent, without
-       * doing any processing
-       * @return Pointer to MibakStreamEvent
-       */
-      const MibakStreamEvent* getMibakStreamEvent() { return &m_mibakStream; }
-
-      LVL1::MuCTPIL1Topo getL1TopoCandidates(MioctL1TopoConverter & l1TopoConv ) const;
-
-      /**
-       * This function changes the current OverlapStrategy for the
-       * OverlapLogic of the Lvl1Mibak.
-       * @param newStrategy As listed in StrategyName.h
-       * @see OverlapLogic
-       * @see OverlapStrategy
-       * @see StrategyName.h
-       */
-      void setOverlapStrategy( StrategyName newStrategy );
-      /**
-       * Return the name of the currently selected OverlapStrategy in
-       * the Overlap Logic.
-       * @see OverlapLogic
-       * @see OverlapStrategy
-       */
-      std::string getOverlapStrategyName() const;
-      /**
-       * Initialize the LUT strategy from the given file.
-       * @see LUTStrategy
-       * @see LUTStructure
-       */
-      StatusCode initializeLUTOverlapStrategy( const std::string& lutXMLFile,
-                                               bool flagMode, bool dumpLut,
-					       const std::string& runPeriod );
-
-      void setMultiplicityStrategy( MultiplicityCalcType type );
-      void initializeXMLMultStrategy( const std::string& xmlFile );
-
-      bool getZeroSuppression() const { return m_doZeroSuppression; }
-      void setZeroSuppression( bool value ) { m_doZeroSuppression = value; }
-
-      /// Is there at least one barrel candidate in the event?
-      bool hasBarrelCandidate() const;
-      /// Is there at least one endcap candidate in the event?
-      bool hasEndcapCandidate() const;
-
-   private:
-      mutable MsgLogger         m_logger;
-      std::list<MioctModule*>   m_lvl1MioctList;
-      MictpModule*              m_mictpModule;
-      MirodModule*              m_mirodModule;
-      OverlapLogic*             m_lvl1OverlapLogic;
-      MultiplicityLogic*        m_multiplicityLogic;
-      EventID                   m_eventID;
-      MibakStreamEvent          m_mibakStream;
-      bool                      m_doZeroSuppression;
-      EventReader*              m_eventReader;
-
-   }; // class Lvl1Mibak
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_LVL1MIBAK_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.cxx
deleted file mode 100644
index 20b03642433d..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.cxx
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MibakStreamEvent.cxx 364083 2011-05-06 09:09:55Z krasznaa $
-
-// STL include(s):
-#include <cassert>
-#include <iomanip>
-#include <fstream>
-#include <sstream>
-
-// Local include(s):
-#include "MibakStreamEvent.h"
-#include "../Mirod/MirodExtractor.h"
-#include "../Common/BitOp.h"
-#include "../Common/MuctpiBitMasks.h"
-#include "../Mirod/MirodTestRamIn.h"
-
-/*******************************************************************
- * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
- *
- * Implementation of class MibakStreamEvent
- * @author   Author: Thorsten Wengler
- * @version $Revision: 364083 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   // the constructor
-   MibakStreamEvent::MibakStreamEvent()
-      : m_logger( "MibakStreamEvent" ) {
-
-   }
-
-   // method to print the event
-   void MibakStreamEvent::printEvent( const std::string& format ) const {
-
-      unsigned int wordCount = 0;
-      unsigned int moduleCount = 0;
-      std::list< unsigned int >::const_iterator it_high = highBits.begin();
-      std::list< unsigned int >::const_iterator it_data = dataWords.begin();
-      for( ; it_data != dataWords.end(); ++it_data ) {
-
-         std::ostringstream message;
-
-         if( format == "hex" ) {
-            message << std::hex << ( *it_high ) << std::setw( 8 ) << ( *it_data );
-         } else if( format == "bin" ) {
-
-            std::string printout;
-            BitOp::printBinN( ( *it_high ), 3, printout );
-            BitOp::printBin( ( *it_data ), printout ) ;
-            message << printout;
-
-         } else if( format == "human" ) {
-
-            if( ( *it_high ) == MioctStartMask ) {     // Module start
-
-               ++moduleCount;
-               wordCount = 0;
-               if( moduleCount == 1 ) {           // MICTP header
-                  message << " =================================================="
-                          << "=========================" << std::endl;
-                  message << " MiBaK | MICTP Header -> ID: "
-                          << BitOp::getValue( &( *it_data ), MictpIDPositionMask );
-                  message << "  EvID: " << std::dec << std::setw( 8 )
-                          << BitOp::getValue( &( *it_data ), MictpEvIDMask );
-               } else {                            // MIOCT header
-                  message << " --------------------------------------------------"
-                          << "-------------------------" << std::endl;
-                  message << "  MIOCT Header -> MNBR: " << std::setw( 2 )
-                          << BitOp::getValue( &( *it_data ), MioctMNBRMask );
-                  message << "    EvID: " << std::dec << std::setw( 8 )
-                          << BitOp::getValue( &( *it_data ), MioctEvIDMask );
-                  message << "    BcID: " << std::dec << std::setw( 4 )
-                          << BitOp::getValue( &( *it_data ), MioctBcIDMask );
-                  message << std::endl;
-               }
-
-            } else if( ( *it_high ) == MioctEndMask ) { // Module End
-
-               if( moduleCount == 1 ) {           // MICTP trailer
-                  message << "  MICTP Trailer -> ";
-                  message << "  Sum6: " << BitOp::getValue( &( *it_data ), MictpTrailerSum6Mask );
-                  message << "  Sum5: " << BitOp::getValue( &( *it_data ), MictpTrailerSum5Mask );
-                  message << "  Sum4: " << BitOp::getValue( &( *it_data ), MictpTrailerSum4Mask );
-                  message << "  Sum3: " << BitOp::getValue( &( *it_data ), MictpTrailerSum3Mask );
-                  message << "  Sum2: " << BitOp::getValue( &( *it_data ), MictpTrailerSum2Mask );
-                  message << "  Sum1: " << BitOp::getValue( &( *it_data ), MictpTrailerSum1Mask );
-                  message << std::endl;
-                  message << "  MICTP Trailer -> Status: ";
-                  std::string messageString;
-                  BitOp::printBinN( BitOp::getValue( &( *it_data ), MictpTrailerFlagsMask ), 3, messageString );
-                  message << messageString;
-                  message << "  WordCount: " << BitOp::getValue( &( *it_data ), MictpTrailerWordsMask );
-                  message << std::endl;
-               } else {                            // MIOCT trailer
-                  message << "  MIOCT Trailer -> ";
-                  message << "  Sum6: " << BitOp::getValue( &( *it_data ), MictpTrailerSum6Mask );
-                  message << "  Sum5: " << BitOp::getValue( &( *it_data ), MictpTrailerSum5Mask );
-                  message << "  Sum4: " << BitOp::getValue( &( *it_data ), MictpTrailerSum4Mask );
-                  message << "  Sum3: " << BitOp::getValue( &( *it_data ), MictpTrailerSum3Mask );
-                  message << "  Sum2: " << BitOp::getValue( &( *it_data ), MictpTrailerSum2Mask );
-                  message << "  Sum1: " << BitOp::getValue( &( *it_data ), MictpTrailerSum1Mask );
-                  message << std::endl;
-                  message << "  MIOCT Trailer -> Status: ";
-                  std::string messageString;
-                  BitOp::printBinN( BitOp::getValue( &( *it_data ), MictpTrailerFlagsMask ), 3, messageString );
-                  message << messageString;
-                  message << "  WordCount: " << BitOp::getValue( &( *it_data ), MictpTrailerWordsMask );
-                  message << std::endl;
-               }
-
-            } else {                              // Module data
-
-               ++wordCount;
-               if( moduleCount == 1 ) {           // MICTP data
-
-                  if( wordCount == 1 ) {            // second MICTP header word
-
-                     message << "  BcID: " << std::dec << std::setw( 4 )
-                             << BitOp::getValue( &( *it_data ), MictpBcIDMask );
-                     message << "  ECRC: " << std::dec << std::setw( 4 )
-                             << BitOp::getValue( &( *it_data ), MictpECRCMask );
-                     message << "  Mon: " << std::dec << std::setw( 1 )
-                             << BitOp::getValue( &( *it_data ), MictpMonitorMask );
-                     message << "  TrTy: " << std::dec << std::setw( 1 )
-                             << BitOp::getValue( &( *it_data ), MictpTrTypeMask );
-                     message << std::endl;
-
-                  } else {                          // MICTP data word
-
-                     message << "  MICTP ->  BcID: " << BitOp::getValue( &( *it_data ), BCIDMask );
-                     message << "  Sum6: " << BitOp::getValue( &( *it_data ), MictpSum6Mask );
-                     message << "  Sum5: " << BitOp::getValue( &( *it_data ), MictpSum5Mask );
-                     message << "  Sum4: " << BitOp::getValue( &( *it_data ), MictpSum4Mask );
-                     message << "  Sum3: " << BitOp::getValue( &( *it_data ), MictpSum3Mask );
-                     message << "  Sum2: " << BitOp::getValue( &( *it_data ), MictpSum2Mask );
-                     message << "  Sum1: " << BitOp::getValue( &( *it_data ), MictpSum1Mask );
-                     message << std::endl;
-
-                  }
-
-               } else {                            // MIOCT data
-
-                  message << "    SNBR: " << std::dec << ( *it_high ) << "  data: ";
-                  std::string messageString;
-                  BitOp::printBin( *it_data, messageString );
-                  message << messageString << std::endl;
-
-               }
-
-               REPORT_VERBOSE_MSG( message.str() );
-
-            }
-
-         } else {
-            REPORT_FATAL_MSG( "Non-existent print method choosen" );
-            assert( 0 );
-         }
-         ++it_high; // also increase counter for highBits list
-      }
-      if ( format == "human" ) {
-         REPORT_VERBOSE_MSG( " ===========================================================================" );
-      }
-
-      return;
-   }
-
-   void MibakStreamEvent::setEvent( const std::list< unsigned int >& inputHighBits,
-                                    const std::list< unsigned int >& inputDataWords ) {
-
-      highBits.clear();
-      dataWords.clear();
-
-      highBits = inputHighBits;
-      dataWords = inputDataWords;
-
-      prepareMirodTestRamInput();
-
-      return;
-   }
-
-   void MibakStreamEvent::readFromFile( const std::string& fileName ) {
-
-      unsigned int long long inputWord = 0;
-      unsigned int dataWordLow;
-      unsigned int dataWordHigh;
-      std::ifstream inFile( fileName.c_str() );
-
-      // clear the lists holding the event information
-      //    m_internalDataWords.clear();
-      highBits.clear();
-      dataWords.clear();
-
-      // read the file and fill the lists
-      inFile >> std::hex >> inputWord;
-      while( ! inFile.eof() ) {
-
-         dataWordLow = inputWord & 0xffffffff;
-         dataWordHigh = ( inputWord >> 32 ) & 0x0000000f;
-
-         //      m_internalDataWords.push_back( dataWordLow );
-         highBits.push_back( dataWordHigh );
-         dataWords.push_back( dataWordLow );
-         inFile >> std::hex >> inputWord;
-      }
-
-      /*
-        list<unsigned int>::const_iterator it_intDaWo ;
-        for ( it_intDaWo = m_internalDataWords.begin();
-           it_intDaWo != m_internalDataWords.end();
-           ++it_intDaWo ) {
-      dataWords.push_back( &( *it_intDaWo ) ) ;
-    }
-    */
-
-      return;
-   }
-
-   // get the input for the Mirod test ram
-   MirodTestRamIn MibakStreamEvent::getMirodTestRamInput() const {
-
-      MirodTestRamIn testRamInput;
-      this->prepareMirodTestRamInput();
-      testRamInput.dataLow( m_mirodTestDataLow );
-      testRamInput.dataHigh( m_mirodTestDataHigh );
-      testRamInput.dataControl( m_mirodTestControl );
-
-      return testRamInput;
-   }
-
-   // method to print lists that can be used as input for the MIROD testram
-   void MibakStreamEvent::printMirodTestRamInput( const std::string& fileName ) {
-
-      std::list< unsigned int >::const_iterator it_TeDaHi;
-      std::list< unsigned int >::const_iterator it_TeDaLo;
-      std::list< unsigned int >::const_iterator it_TeCtrl;
-
-      if( fileName == "screen" ) {
-
-         it_TeDaHi = m_mirodTestDataHigh.begin();
-         it_TeCtrl = m_mirodTestControl.begin();
-         for( it_TeDaLo = m_mirodTestDataLow.begin(); it_TeDaLo != m_mirodTestDataLow.end(); ++it_TeDaLo ) {
-
-            m_logger << INFO << std::hex << std::setw( 3 ) << ( *it_TeDaHi ) << " "
-                     << std::setw( 6 ) << ( *it_TeDaLo )
-                     << " " << ( *it_TeCtrl ) << MsgLogger::endmsg;
-
-            ++it_TeDaHi;
-            ++it_TeCtrl;
-
-         }
-
-      } else {
-
-         const std::string dataFile = fileName + "_data.dat";
-         const std::string ctrlFile = fileName + "_ctrl.dat";
-         std::ofstream outDataFile( dataFile.c_str() );
-         std::ofstream outCtrlFile( ctrlFile.c_str() );
-
-         if( outDataFile.fail() || outCtrlFile.fail() ) {
-            REPORT_FATAL_MSG( "Could not open files for MIROD testram" );
-            assert( 0 );
-         }
-         it_TeDaHi = m_mirodTestDataHigh.begin();
-         it_TeCtrl = m_mirodTestControl.begin();
-         for( it_TeDaLo = m_mirodTestDataLow.begin(); it_TeDaLo != m_mirodTestDataLow.end(); ++it_TeDaLo ) {
-
-            outDataFile << std::hex << std::setw( 3 ) << ( *it_TeDaHi ) << std::setw( 6 )
-                        << ( *it_TeDaLo ) << std::endl;
-            outCtrlFile << std::hex << std::setw( 2 ) << ( *it_TeCtrl ) << std::endl;
-            ++it_TeDaHi;
-            ++it_TeCtrl;
-         }
-      }
-
-      return;
-   }
-
-   // method to prepare lists that can be used as input for the MIROD testram
-   void MibakStreamEvent::prepareMirodTestRamInput() const {
-
-      m_mirodTestDataLow.clear();
-      m_mirodTestDataHigh.clear();
-      m_mirodTestControl.clear();
-
-      unsigned int inputDataLow = 0;
-      unsigned int inputDataHigh = 0;
-      unsigned int controlWord = 0;
-      unsigned int wordCount = 0;
-      // fill the testData lists from the Mibak Event lists
-      // first an empty data word and XDTRDY on
-      controlWord = 0x0000000e;                    // enable XDTRDY
-      m_mirodTestDataLow.push_back( 0x00000000 );
-      m_mirodTestDataHigh.push_back( 0x00000000 );
-      m_mirodTestControl.push_back( controlWord );
-
-      // now loop over data words and fill lists
-      std::list< unsigned int >::const_iterator it_HiBi = highBits.begin();
-      std::list< unsigned int >::const_iterator it_DaWo = dataWords.begin();
-      for ( ; it_DaWo != dataWords.end(); ++it_DaWo ) {
-
-         ++wordCount;
-         // inputDataHigh consits of bits 0-3 from highBits shifted to
-         // 8-11, and 24-31 from dataWords shifted to 0-7
-         inputDataHigh = 0;
-         inputDataHigh = ( ( *it_HiBi ) << 8 );
-         inputDataHigh |= ( ( ( *it_DaWo ) & 0xff000000 ) >> 24 );
-         m_mirodTestDataHigh.push_back( inputDataHigh );
-
-         // inputDataLow are bits 0-23 from the dataWords list
-         inputDataLow = 0;
-         inputDataLow = ( ( *it_DaWo ) & 0x00ffffff );
-         m_mirodTestDataLow.push_back( inputDataLow );
-
-         // handle the control word
-         // begin module - enable data valid
-         if ( ( *it_HiBi ) == 0x0000000e ) {
-            BitOp::clearBit( &controlWord, 2 );
-         }
-
-         // at third word XDTRDY is disabled
-         if( wordCount == 3 ) {
-            BitOp::clearBit( &controlWord, 1 );
-         }
-
-         // for last word token back must be enabled and disabled again
-         if( ( ( *it_HiBi ) == 0x0000000f ) && ( it_DaWo == --( dataWords.end() ) ) ) {
-            BitOp::setBit( &controlWord, 0 );         // enable token back
-         }
-
-         m_mirodTestControl.push_back( controlWord );
-
-         // end module - add additional empty word with data valid disabled
-         if( ( *it_HiBi ) == 0x0000000f ) {
-            m_mirodTestDataLow.push_back( 0x00000000 );
-            m_mirodTestDataHigh.push_back( 0x00000000 );
-            BitOp::clearBit( &controlWord, 0 );               // disable token back
-            BitOp::setBit( &controlWord, 2 );
-            m_mirodTestControl.push_back( controlWord );
-         }
-
-         ++it_HiBi; // also increase iterator for high bits
-      }
-
-      // add one more empty word in the end
-      controlWord = 0x0000000c;                    // data valid off
-      m_mirodTestDataLow.push_back( 0x00000000 );
-      m_mirodTestDataHigh.push_back( 0x00000000 );
-      m_mirodTestControl.push_back( controlWord );
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.h
deleted file mode 100644
index 123a57d2ad96..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mibak/MibakStreamEvent.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MibakStreamEvent.h 364083 2011-05-06 09:09:55Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIBAKSTREAMEVENT_H
-#define TRIGT1MUCTPI_MIBAKSTREAMEVENT_H
-
-// STL include(s):
-#include <list>
-#include <string>
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-
-// Forward declaration(s):
-class MirodTestRamIn;
-
-namespace LVL1MUCTPI {
-
-   /**
-    *  @short Class containing one event in MIBAK format
-    *
-    *         This class constitutes the interface in the software
-    *         to the MIORD read out driver. It contains all
-    *         information of the event in the format found on the
-    *         the MIBAK. It is filled by method getMibakData() in
-    *         class Lvl1Mibak, which takes as an argument whether
-    *         or not there should be zero suppression.
-    *
-    *    @see Lvl1Mibak
-    * @author Thorsten Wengler
-    *
-    * $Revision: 364083 $
-    * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
-    */
-   class MibakStreamEvent {
-
-   public:
-      /**
-       * since this is just a data container the data members of this
-       * class are exceptionally public
-       */
-      std::list< unsigned int > highBits;
-      std::list< unsigned int > dataWords;
-      /**
-       * The constructor of MibakStreamEvent
-       */
-      MibakStreamEvent();
-      /**
-       * This method prints the event to the screen. The parameter
-       * determines if the printout will be in binary, hexadecimal
-       * or human readable format. Consequently the choices are
-       * "hex", "bin" or "human"
-       * @param format Determines if the printout will be in
-       *        binary or hexadecimal format. Choices are "hex", "bin", "human"
-       */
-      void printEvent( const std::string& format ) const;
-      /**
-       * Service which allows to set the data in this class directly, i.e.
-       * feed the datastream into the system at this point. Since in normal
-       * operation part of the data consists of pointers to previous
-       * processing, another list is needed to store the data words in this
-       * case.
-       * @param inputHighBits list of the data words
-       * @param inputDataWords list of the data words
-       */
-      void setEvent( const std::list< unsigned int >& inputHighBits,
-                     const std::list< unsigned int >& inputDataWords );
-      /**
-       * method to read event from file. The format of the file is identical
-       * to the one expected by the MIROD testram controller, since the
-       * main use of this function is to read such files
-       * @param fileName name of the file to read
-       */
-      void readFromFile( const std::string& fileName );
-      /**
-       * Get the test ram input for the Mirod in object format for
-       * easier handling - some data copying out of lazyness, but
-       * speed is unimportant for this use case.
-       */
-      MirodTestRamIn getMirodTestRamInput() const;
-      /**
-       * This method returns a pointer to the list MirodTestDataLow
-       */
-      const std::list< unsigned int >* getMirodTestDataLow() const { return &m_mirodTestDataLow; }
-      /**
-       * This method returns a pointer to the list MirodTestDataLow
-       */
-      const std::list< unsigned int >* getMirodTestDataHigh() const { return &m_mirodTestDataHigh; }
-      /**
-       * This method returns a pointer to the list MirodTestDataLow
-       */
-      const std::list< unsigned int >* getMirodTestControl() const { return &m_mirodTestControl; }
-      /**
-       * this method prints the data prepared in the prepareMiordTestRamInput
-       * method to either the screen or two files
-       * @param fileName either "screen" for terminal output or filename root,
-       *                 which is used to for the two files root_data.dat and root_ctrl.dat
-       */
-      void printMirodTestRamInput( const std::string& fileName );
-
-   private:
-      mutable MsgLogger                  m_logger;
-      //
-      // The mirod test memory data members are declared mutable, as it should be allowed to
-      // synchronize them to the "highBits" and "dataWords" data members even when only having
-      // a constant reference to the object.
-      //
-      mutable std::list< unsigned int >  m_mirodTestDataLow;
-      mutable std::list< unsigned int >  m_mirodTestDataHigh;
-      mutable std::list< unsigned int >  m_mirodTestControl;
-
-      /**
-       * This method fills two lists in a format suitable for loading the
-       * event into the MIROD testram. The hardware test library expects
-       * the lower bits to be 0-23 , and the higher bits above that , so
-       * the lists are constructed accordingly. Another list holds the
-       * corresponding control words emulating the MIBAK controls in the
-       * the testram
-       */
-      void prepareMirodTestRamInput() const;
-
-   }; // class MibakStreamEvent
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIBAKSTREAMEVENT_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.cxx
deleted file mode 100644
index 3b0ea7e07a69..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.cxx
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MictpData.cxx 700318 2015-10-13 14:13:15Z wengler $
-
-// Local include(s):
-#include "MictpData.h"
-
-/*******************************************************************
- * $Date: 2015-10-13 16:13:15 +0200 (Tue, 13 Oct 2015) $
- *
- * Implementation of class MictpData
- * @author   Author: Thorsten Wengler
- * @version $Revision: 700318 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-  MictpData::MictpData(): m_highBits(nullptr),m_dataWords(nullptr) {
-
-  }
-
-  MictpData::~MictpData() {
-
-  }
-
-}
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.h
deleted file mode 100644
index 33226b261796..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpData.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MictpData.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_MICTPDATA_H
-#define TRIGT1MUCTPI_MICTPDATA_H
-
-// STL include(s):
-#include <list>
-
-namespace LVL1MUCTPI {
-
-  /**
-   *******************************************************************
-   *
-   *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ 
-   *
-   *    @short Helper class for access of MICTP data in MIBAK format
-   *
-   *           MictpData is a helper class to provide easy access 
-   *           of the data of the MICTP module in the format as seen
-   *           on the MIBAK backplane by the Read Out Driver MIROD.
-   *
-   *      @see MictpModule
-   *   @author Thorsten Wengler
-   *  @version $Revision: 362102 $
-   *
-   *******************************************************************
-   */
-  class MictpData {
-
-  public:
-    /**
-     * The constructor of MictpData
-     */
-    MictpData();
-    /**
-     * This method sets the pointer to the highBits list in the
-     * MictpModule
-     * @see MictpModule
-     * @param thehighBits Pointer to the list of highBits
-     *                    in the MictpModule
-     */
-    void setHighBits( const std::list< unsigned int >* thehighBits ) { m_highBits = thehighBits; }
-    /**
-     * This method sets the pointer to the dataWords list in the
-     * MictpModule
-     * @see MictpModule
-     * @param theDataWords Pointer to the list of dataWords
-     *                     in the MictpModule
-     */
-    void setDataWords( const std::list< unsigned int >* theDataWords ) { m_dataWords = theDataWords; }
-    /**
-     * This method gets the pointer to the highBits list in the
-     * MictpModule
-     * @see MictpModule
-     * @return Pointer to the list of highBits
-     *         in the MictpModule
-     */
-    const std::list< unsigned int >* getHighBits() const { return m_highBits; }
-    /**
-     * This method gets the pointer to the dataWords list in the
-     * MictpModule
-     * @see MictpModule
-     * @return Pointer to the list of dataWords
-     *         in the MictpModule
-     */
-    const std::list< unsigned int >* getDataWords() const { return m_dataWords; }
-    /**
-     * The destructor of MictpData
-     */
-    ~MictpData();
-
-  private:
-    const std::list< unsigned int >* m_highBits;
-    const std::list< unsigned int >* m_dataWords;
-
-  }; // class MictpData
-
-} // namespace LVL1MUCTPI
-
-#endif  // TRIGT1MUCTPI_MICTPDATA_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.cxx
deleted file mode 100644
index 72e02e14c35e..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.cxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MictpModule.cxx 700318 2015-10-13 14:13:15Z wengler $
-
-// Local include(s):
-#include "MictpModule.h"
-#include "../Common/BitOp.h"
-#include "../Common/PtMultiplicitySet.h"
-#include "../Common/MuctpiBitMasks.h"
-
-/*******************************************************************
- * $Date: 2015-10-13 16:13:15 +0200 (Tue, 13 Oct 2015) $ 
- *
- * Implementation of class MictpModule
- * @author   Author: Thorsten Wengler
- * @version $Revision: 700318 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   // constructor of class MictpModule
-   MictpModule::MictpModule()
-     :  m_CTPDataWord(0), m_logger("MictpModule")  {
-
-      REPORT_VERBOSE_MSG( "Constructor called" );
-
-      m_mictpData.setHighBits( &m_highBits );
-      m_mictpData.setDataWords( &m_dataWords );
-   }
-
-   void MictpModule::setPtSums( PtMultiplicitySet* ptSums, unsigned int BCID, unsigned int ECRC ) {
-
-      unsigned int inputWord = 0;
-
-      // clear the data
-      m_highBits.clear();
-      m_dataWords.clear();
-
-      // the first header word: MICTP ID and EventID and add to list
-      BitOp::sImposeNBits( &inputWord, 28, MictpIDMask );
-      BitOp::sImposeNBits( &inputWord, 0, m_eventID.getEvID() );
-      m_highBits.push_back( MioctStartMask );
-      m_dataWords.push_back( inputWord );
-      inputWord = 0;
-
-      // the second headerword; monitor bit, trigger type and BCID
-      BitOp::sImposeNBits( &inputWord, 28, m_eventID.getMonitorEvent() );
-      BitOp::sImposeNBits( &inputWord, 20, m_eventID.getTriggerType() );
-      BitOp::sImposeNBits( &inputWord, 12, ( ECRC & 0xff ) );
-      BitOp::sImposeNBits( &inputWord, 0, ( BCID & 0xfff ) );
-      m_highBits.push_back( 0x0 );
-      m_dataWords.push_back( inputWord );
-      inputWord = 0;
-
-      // the data word: BCID and Ptsums
-      BitOp::sImposeNBits( &inputWord, 0, ptSums->getMultiplicity( 1 ) );
-      BitOp::sImposeNBits( &inputWord, 3, ptSums->getMultiplicity( 2 ) );
-      BitOp::sImposeNBits( &inputWord, 6, ptSums->getMultiplicity( 3 ) );
-      BitOp::sImposeNBits( &inputWord, 9, ptSums->getMultiplicity( 4 ) );
-      BitOp::sImposeNBits( &inputWord, 12, ptSums->getMultiplicity( 5 ) );
-      BitOp::sImposeNBits( &inputWord, 15, ptSums->getMultiplicity( 6 ) );
-
-      // this is the word sent to the CTP (no BCID)
-      // It's important to observe that the first bit in the word is not used.
-      // This is just how the hardware works...
-      m_CTPDataWord = inputWord;
-      m_CTPDataWord <<= 1;
-
-      BitOp::sImposeNBits( &inputWord, 27, ( BCID & 0x7 ) ); // only 3 lowest bits
-      m_highBits.push_back( 0x0 );
-      m_dataWords.push_back( inputWord );
-      inputWord = 0;
-
-      // The trailer word: Ptsums, flags (dummy so far), word count
-      BitOp::sImposeNBits( &inputWord, 10, ptSums->getMultiplicity( 1 ) );
-      BitOp::sImposeNBits( &inputWord, 13, ptSums->getMultiplicity( 2 ) );
-      BitOp::sImposeNBits( &inputWord, 16, ptSums->getMultiplicity( 3 ) );
-      BitOp::sImposeNBits( &inputWord, 19, ptSums->getMultiplicity( 4 ) );
-      BitOp::sImposeNBits( &inputWord, 22, ptSums->getMultiplicity( 5 ) );
-      BitOp::sImposeNBits( &inputWord, 25, ptSums->getMultiplicity( 6 ) );
-      unsigned int flags = 0;
-      BitOp::sImposeNBits( &inputWord, 7, flags );
-      unsigned int wordCount = m_dataWords.size() + 1;
-      BitOp::sImposeNBits( &inputWord, 0, wordCount );
-      m_highBits.push_back( MioctEndMask );
-      m_dataWords.push_back( inputWord );
-      inputWord = 0;
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.h
deleted file mode 100644
index 714c15541163..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mictp/MictpModule.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MictpModule.h 364083 2011-05-06 09:09:55Z krasznaa $
-#ifndef TRIGT1MUCTPI_MICTPMODULE_H
-#define TRIGT1MUCTPI_MICTPMODULE_H
-
-// STL include(s):
-#include <list>
-
-// Local include(s):
-#include "MictpData.h"
-#include "../Common/EventID.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class PtMultiplicitySet;
-
-   /**
-    *  @short Contains all relevant entities of the MICTP board
-    *
-    *         The MictpModule class groups together all relevant
-    *         entities for the interface board MICTP of the MUCTPI
-    *         to the Central Trigger Processor. It provides service
-    *         to extract the data delivered to the CTP and to the
-    *         Read Out Driver board MIROD. The MICTP gets its
-    *         information from the MioctModule objects, via the
-    *         MIBAK. Also in the software the MictpModule class is
-    *         filled by a call to the method getPtMultiplicity in
-    *         class Lvl1Mibak. There is only one MICTP board in the
-    *         system.
-    *
-    *    @see MiordModule
-    *    @see MioctModule
-    *    @see Lvl1Mibak
-    *
-    * @author Thorsten Wengler
-    *
-    * $Revision: 364083 $
-    * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
-    */
-   class MictpModule {
-
-   public:
-      /**
-       * The constructor of MictpModule
-       */
-      MictpModule();
-      /**
-       * This method sets the Pt sums for all thresholds in the data
-       * and the BCID that goes with it. The trailor word will hold
-       * the Pt sums of the middle word, as the BCIDs to be read
-       * out are opend up in symmetrical steps of 1 on either side
-       * @param thePtSums Pointer to the total sum of pt
-       *                  candidates per threshold calculated
-       *                  from all MIOCTS
-       * @param BCID      corresponding Bunch Id
-       * @param ECRC      corresponding to Event Counter
-       *                  Reset Counter
-       */
-      void setPtSums( PtMultiplicitySet* thePtSums, unsigned int BCID, unsigned int ECRC );
-      /**
-       * method to get the word sent by the Mictp to the CTP
-       * @return CTP Data Word
-       */
-      unsigned int getMictpCTPWord() const { return m_CTPDataWord; }
-      /**
-       * This method return the data stored in the MictpModule as a
-       * MictpData object, which groups the data for easy access in the
-       * format found on the MIBAK backplane
-       * @return data stored in the MICTP for easy access in
-       *         MIBAK format
-       */
-      const MictpData* getMictpOnMibak() { return &m_mictpData; }
-
-   private:
-      std::list< unsigned int >   m_highBits;
-      std::list< unsigned int >   m_dataWords;
-      MictpData                   m_mictpData;
-      unsigned int                m_CTPDataWord;
-      EventID                     m_eventID;
-      mutable MsgLogger           m_logger;
-
-   }; // class MictpModule
-
-} // namespace LVL1MUCTPI
-
-#endif  // TRIGT1MUCTPI_MICTPMODULE_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.cxx
deleted file mode 100644
index bd768d4f021f..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.cxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: BarrelSector.cxx 700318 2015-10-13 14:13:15Z wengler $
-
-// STL include(s):
-#include <iomanip>
-#include <sstream>
-
-// Local include(s):
-#include "BarrelSector.h"
-#include "../Common/SectorConstants.h"
-#include "EventReader.h"
-
-namespace LVL1MUCTPI {
-
-   const unsigned int BarrelSector::MIN_SECTOR = MIN_BARREL_SECTOR;
-   const unsigned int BarrelSector::MAX_SECTOR = MAX_BARREL_SECTOR;
-
-   BarrelSector::BarrelSector( Hemisphere hemisphere, unsigned int sectorNumber,
-                               EventReader* reader )
-      : Sector( hemisphere, sectorNumber, reader ), m_logger( "BarrelSector" ) {
-
-      if( m_sectorNumber > BarrelSector::MAX_SECTOR ) {
-         m_sectorNumber = (sectorNumber % BarrelSector::MAX_SECTOR) - 1;
-      }
-      m_reader->registerSector( this );
-      m_registered = true;
-   }
-
-   BarrelSector::BarrelSector( const BarrelSector& sector )
-      : Sector( sector.m_rapidityRegion, sector.m_sectorNumber, sector.m_reader ),
-        m_logger( "BarrelSector" ) {
-
-    m_bitField = sector.m_bitField;
-    m_registered = false;
-  }
-
-   BarrelSector::~BarrelSector() {
-
-      if( m_registered ) m_reader->unregisterSector( this );
-   }
-
-   void BarrelSector::set( const unsigned int bitfield ) {
-
-      // check if any of the reservered bits is set. This should not
-      // be the case. If so, give a warning but set the bitfield anyway.
-      // these bits are not always respected by the simulation inputs, so skip this 
-      //      if( ( BarrelReservedMask & bitfield ) != 0 ) {
-      //   m_logger << WARNING << "illegal bitfield : " << std::hex << bitfield
-      //            << " (hex) --> Bitfield set anyway" << MsgLogger::endmsg;
-      // }
-
-      m_bitField = bitfield;
-      return;
-
-   }
-
-   void BarrelSector::print( std::string& result ) const {
-
-      int SecOf, ROI1Of, ROI2Of;
-
-      SecOf  = this->getValue( SectorOverflowMask );
-      ROI1Of = this->getValue( ROI1OverflowMask );
-      ROI2Of = this->getValue( ROI2OverflowMask );
-
-      std::string myId;
-      this->printID( myId );
-
-      std::ostringstream outStream;
-      outStream << " \n\n  BARREL SECTOR DATA $Revision: 700318 $" << std::endl;
-      outStream << "==============================================" << std::endl;
-      outStream << myId << std::endl;
-      outStream << "BCID :            " << getBCID() << std::endl;
-      outStream << "Sector Overflow : " << SecOf << std::endl;
-      outStream << std::endl;
-      outStream << "          Candidate 1       Candidate 2 " << std::endl;
-      outStream << "  ROI        " << getROI1()
-                << "                  " << getROI2() << std::endl;
-      outStream << "  Pt         " << getPtCand1()
-                << "                  " << getPtCand2() << std::endl;
-      outStream << "  ROIOF      " << ROI1Of
-                << "                  " << ROI2Of << std::endl;
-      outStream << " Barrel Ov   " << isCand1BarrelOverlap()
-                << "                  " << isCand2BarrelOverlap() << std::endl;
-      outStream << " Endcap Ov   " << isCand1EndcapOverlap()
-                << "                  " << isCand2EndcapOverlap() << std::endl;
-      outStream << std::endl;
-
-      result = outStream.str();
-
-      return;
-   }
-
-   ///////////////////////////////////////////////////////////////////////////
-   // functions needed only to determine the overlap. They are
-   // only called by other Barrel Sectors. May be worth declaring
-   // friends...
-   ///////////////////////////////////////////////////////////////////////////
-
-   bool BarrelSector::isCand1BarrelOverlap() const {
-      return static_cast< bool >( this->getValue( BarrelBarrelOverlap1Mask ) );
-   }
-
-   bool BarrelSector::isCand2BarrelOverlap() const {
-      return static_cast< bool >( this->getValue( BarrelBarrelOverlap2Mask ) );
-   }
-
-   bool BarrelSector::isCand1EndcapOverlap() const {
-      return static_cast< bool >( this->getValue( BarrelEndcapOverlap1Mask ) );
-   }
-
-   bool BarrelSector::isCand2EndcapOverlap() const {
-      return static_cast< bool >( this->getValue( BarrelEndcapOverlap2Mask ) );
-   }
-
-   unsigned int BarrelSector::getROI1() const {
-      return this->getValue( BarrelROI1Mask );
-   }
-   unsigned int BarrelSector::getROI2() const {
-      return this->getValue( BarrelROI2Mask );
-   }
-  
-   SectorID BarrelSector::getSectorID() const {
-      return SectorID( BARREL, m_rapidityRegion, m_sectorNumber );
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.h
deleted file mode 100644
index 0c4cc483361f..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/BarrelSector.h
+++ /dev/null
@@ -1,112 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: BarrelSector.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_BARRELSECTOR_H
-#define TRIGT1MUCTPI_BARRELSECTOR_H
-
-// STL include(s):
-#include <string>
-
-// Local include(s):
-#include "../Common/Detector.h"
-#include "Sector.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    *  @short This class handles an 32-bit Input word from the Barrel Front-End-Electronics.
-    *
-    *         This  class  complies to the Sector   Interface class.  It
-    *         specializes  the  base class with some  decoding functions
-    *         which are  special for the  Barrel Sector  data-format. It
-    *         provides a  print  facility to  view  the contents  of the
-    *         data-word in readable format.
-    *
-    *    @see Sector
-    * @author Thirsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class BarrelSector : public Sector {
-
-   public:
-      /**
-       * The only constructor of a Barrel sector, identified by its
-       * sector number and hemisphere
-       * @param hemisphere   The Hemisphere the sector is in
-       * @param sectorNumber The sector number
-       */
-      BarrelSector( Hemisphere hemisphere, unsigned int sectorNumber,
-                    EventReader* reader );
-      BarrelSector( const BarrelSector& sector );
-      BarrelSector & operator = ( const BarrelSector & ) = delete;
-      ~BarrelSector();
-
-      /**
-       * Implementation of the corresponding abstract method in the
-       * baseclass Sector.
-       * @see Sector#set
-       * @param bitField This is the value to which the
-       *                 Barrel Sector 32-bit bitfield is set.
-       *                 It is checked that none of the reserved bits are set.
-       */
-      void set( const unsigned int bitField );
-      /**
-       * This access funtion retrieves the ROI-number of the first candidate.
-       */
-      unsigned int getROI1() const;
-      /**
-       * This access funtion retrieves the ROI-number of the second candidate.
-       */
-      unsigned int getROI2() const;
-      /**
-       * Acces function to the bit indicating overlap of the
-       * first candidate with the neigbouring Barrel Sector.
-       * @return boolean value of the flag
-       */
-      bool isCand1BarrelOverlap() const;
-      /**
-       * Access function to the bit indicating overlap of the
-       * second candidate with the neigbouring Barrel Sector.
-       * @return boolean value of the flag
-       */
-      bool isCand2BarrelOverlap() const;
-      /**
-       * Access function to the bit indicating overlap of the
-       * first candidate with a neigbouring Endcap Sector.
-       * @return boolean value of the flag
-       */
-      bool isCand1EndcapOverlap() const;
-      /**
-       * Access function to the bit indicating overlap of the
-       * second candidate with a neigbouring Endcap Sector.
-       * @return boolean value of the flag
-       */
-      bool isCand2EndcapOverlap() const;
-
-      void print( std::string& barrelDescription ) const;
-      std::string getDetectorString() const { return "Barrel"; }
-      virtual SectorID getSectorID() const;
-
-   private:
-      mutable MsgLogger m_logger;
-
-      /**
-       * some constants important for checking the validity of
-       * the SectorID
-       */
-      static const unsigned int MIN_SECTOR;
-      static const unsigned int MAX_SECTOR;
-
-   }; // class BarrelSector
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_BARRELSECTOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.cxx
deleted file mode 100644
index 67a213fbc70e..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.cxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EndcapSector.cxx 700318 2015-10-13 14:13:15Z wengler $
-
-// STL include(s):
-#include <iomanip>
-#include <sstream>
-
-// Local include(s):
-#include "EndcapSector.h"
-#include "EventReader.h"
-#include "../Common/MuctpiBitMasks.h"
-#include "../Common/SectorConstants.h"
-
-namespace LVL1MUCTPI {
-
-   const unsigned int EndcapSector::MIN_SECTOR = MIN_ENDCAP_SECTOR;
-   const unsigned int EndcapSector::MAX_SECTOR = MAX_ENDCAP_SECTOR;
-
-   EndcapSector::EndcapSector( Hemisphere hemisphere, unsigned int sectorNumber,
-                               EventReader* reader )
-      : Sector( hemisphere, sectorNumber, reader ), m_logger( "EndcapSector" ) {
-
-      if ( m_sectorNumber > EndcapSector::MAX_SECTOR ) {
-         m_sectorNumber = ( sectorNumber % EndcapSector::MAX_SECTOR ) - 1;
-      }
-
-      m_reader->registerSector( this );
-      m_registered = true;
-   }
-
-   EndcapSector::EndcapSector( const EndcapSector& sector )
-      : Sector( sector.m_rapidityRegion, sector.m_sectorNumber, sector.m_reader ),
-        m_logger( "EndcapSector" ) {
-
-      m_bitField = sector.m_bitField;
-      m_registered = false;
-   }
-
-   EndcapSector::~EndcapSector() {
-
-      if( m_registered ) m_reader->unregisterSector( this );
-   }
-
-   void EndcapSector::set( const unsigned int bitfield ) {
-
-      // check if any of the reservered bits is set. This should not
-      // be the case. If so, give a warning but set the bitfield anyway.
-      // these fields are not respected by input simluations, skip
-      //      if( ( EndcapReservedMask & bitfield ) != 0 ) {
-      //  m_logger << WARNING << "illegal bitfield : " << std::hex << bitfield
-      //           << " (hex) --> Bitfield set anyway" << MsgLogger::endmsg;
-      //}
-
-      m_bitField = bitfield;
-      return;
-   }
-
-   bool EndcapSector::isCand1BarrelOverlap() const {
-      return static_cast< bool >( getValue( EndcapBarrelOverlap1Mask ) );
-   }
-
-   bool EndcapSector::isCand2BarrelOverlap() const {
-      return static_cast< bool >( getValue( EndcapBarrelOverlap2Mask ) );
-   }
-
-   unsigned int EndcapSector::getROI1() const {
-      return getValue( EndcapROI1Mask );
-   }
-   unsigned int EndcapSector::getROI2() const {
-      return getValue( EndcapROI2Mask );
-   }
-
-   void EndcapSector::print( std::string& result ) const {
-
-      int BCID, SecOf, ROI1, ROI2, Pt1, Pt2, ROI1Of, ROI2Of, Ba1Ov, Ba2Ov;
-
-      std::string myId;
-      this->printID( myId );
-
-      BCID   = this->getValue( BCIDMask );
-      SecOf  = this->getValue( SectorOverflowMask );
-      ROI1   = this->getROI1();
-      ROI2   = this->getROI2();
-      Pt1    = this->getValue( Pt1Mask );
-      Pt2    = this->getValue( Pt2Mask );
-      ROI1Of = this->getValue( ROI1OverflowMask );
-      ROI2Of = this->getValue( ROI2OverflowMask );
-      Ba1Ov  = this->isCand1BarrelOverlap();
-      Ba2Ov  = this->isCand2BarrelOverlap();
-
-      std::ostringstream outStream;
-      outStream << " \n\n  ENDCAP SECTOR DATA $Revision: 700318 $" << std::endl;
-      outStream << "==============================================" << std::endl;
-      outStream << myId << std::endl;
-      outStream << "BCID :            " << BCID  << std::endl;
-      outStream << "Sector Overflow : " << SecOf << std::endl;
-      outStream << std::endl;
-      outStream << "          Candidate 1       Candidate 2 " << std::endl;
-      outStream << "  ROI        " << ROI1
-                << "                  " << ROI2 << std::endl;
-      outStream << "  Pt         " << Pt1
-                << "                  " << Pt2 << std::endl;
-      outStream << "  ROIOF      " << ROI1Of
-                << "                  " << ROI2Of << std::endl;
-      outStream << " Barrel Ov   " << Ba1Ov
-                << "                  " << Ba2Ov << std::endl;
-      outStream << std::endl;
-
-      result = outStream.str();
-      return;
-
-   }
-  
-   SectorID EndcapSector::getSectorID() const {
-
-      return SectorID( ENDCAP, m_rapidityRegion, m_sectorNumber );
-
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.h
deleted file mode 100644
index ab132a812f9a..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EndcapSector.h
+++ /dev/null
@@ -1,98 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EndcapSector.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_ENDCAPSECTOR_H
-#define TRIGT1MUCTPI_ENDCAPSECTOR_H
-
-// STL include(s):
-#include <string>
-
-// Local include(s):
-#include "Sector.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    *  @short This class handles an 32-bit Input word from the Endcap Front-End-Electronics.
-    *
-    *         This  class  complies to the Sector   Interface class.  It
-    *         specializes  the  base class with some  decoding functions
-    *         which are  special for the  Endcap Sector  data-format. It
-    *         provides a  print  facility to  view  the contents  of the
-    *         data-word in readable format.
-    *
-    *    @see Sector
-    *    @see SectorID
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class EndcapSector : public Sector {
-
-   public:
-      /**
-       * The only constructor of an Endcap sector, identified by its
-       * sector number and hemisphere
-       * @param hemisphere The Hemisphere the sector is in
-       * @param sectorNumber The sector number
-       */
-      EndcapSector( Hemisphere hemisphere, unsigned int sectorNumber,
-                    EventReader* reader );
-      EndcapSector( const EndcapSector& sector );
-      EndcapSector & operator = ( const EndcapSector & ) = delete;
-      ~EndcapSector();
-      /**
-       * Implementation of the corresponding abstract method in the
-       * baseclass Sector.
-       * @see Sector::set()
-       * @param bitfield This is the value to which the
-       *                 Endcap Sector 32-bit bitfield is set.
-       *                 It is checked that none of the reserved bits are set.
-       */
-      void set( const unsigned int bitfield );
-      /**
-       * This access funtion retrieves the ROI-number of the first candidate.
-       */
-      unsigned int getROI1() const;
-      /**
-       * This access funtion retrieves the ROI-number of the second candidate.
-       */
-      unsigned int getROI2() const;
-      /**
-       * Acces function to the bit indicating overlap of the
-       * first candidate with the neigbouring Barrel Sector.
-       * @return boolean value of the flag
-       */
-      bool isCand1BarrelOverlap() const;
-      /**
-       * Access function to the bit indicating overlap of the
-       * second candidate with the neigbouring Barrel Sector.
-       * @return boolean value of the flag
-       */
-      bool isCand2BarrelOverlap() const;
-      void print( std::string& EndcapDescription ) const;
-      std::string getDetectorString() const { return "Endcap"; }
-      virtual SectorID getSectorID() const;
-
-   private:
-      mutable MsgLogger m_logger;
-
-      /**
-       * some constants important for checking the validity of
-       * the SectorID
-       */
-      static const unsigned int MIN_SECTOR;
-      static const unsigned int MAX_SECTOR;
-
-   }; // class EndcapSector
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_ENDCAPSECTOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.cxx
deleted file mode 100644
index e1150cae32b8..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.cxx
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EventReader.cxx 364083 2011-05-06 09:09:55Z krasznaa $
-
-// Local include(s):
-#include "EventReader.h"
-
-namespace LVL1MUCTPI {
-
-   EventReader::EventReader()
-      : m_logger( "EventReader" ),
-        m_infoString( "member function isValid() not yet called" ) {
-
-   }
-
-   EventReader::~EventReader() {
-
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.h
deleted file mode 100644
index d658c26cda75..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReader.h
+++ /dev/null
@@ -1,108 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EventReader.h 364083 2011-05-06 09:09:55Z krasznaa $
-#ifndef TRIGT1MUCTPI_EVENTREADER_H
-#define TRIGT1MUCTPI_EVENTREADER_H
-
-// STL include(s):
-#include <string>
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class Sector;
-   class EventSource;
-
-   /**
-    *  @short Interface for classes reading in event data and passing it to the Sectors.
-    *
-    *         The EventReader is a purely abstract class defining the
-    *         interface for a concrete Event Reader. In addition to its
-    *         two abstract mamber functions it contains a static pointer
-    *         to itself since Event Readers are Singletons.
-    *
-    *    @see EventReaderFactory
-    *    @see MifFileReader
-    *    @see SimMessageLogger
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 364083 $
-    * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
-    */
-   class EventReader {
-
-   public:
-      /**
-       * This routine checks if the installation of the EventReader
-       * has been successfull. If it does not return "true" the result
-       * of putNextEvent() might be useless. In case the method returns
-       * false getInfoString() can be called in order to find the reason.
-       * @return true if the EventReader has been correctly installed
-       *         and can be used.
-       * @see EventReader::getInfoString()
-       */
-      virtual bool isValid() const = 0;
-      /**
-       * After a call to isValid() this routine gives back a string which
-       * contains the reason why the EventReader is not valid.
-       * @return string contains some text indicating the reason why
-       *         the EventReader is not vaild.
-       * @see EventReader::isValid()
-       */
-      virtual std::string getInfoString() const = 0;
-      /**
-       * If a sector got a pointer to the concrete EventReader it has to
-       * register with this function so that the concrete EventReader can
-       * can update the data field of the sector after having read a new
-       * event.
-       * @see Sector::set()
-       */
-      virtual void registerSector( Sector* ) = 0;
-      /**
-       * If a sector is destroyed it has to notify the EventReader about
-       * the fact that its existence is about to cease. Therefore a unregister
-       * method is needed. (The EventReader might live longer than a Sector)
-       */
-      virtual void unregisterSector( Sector* ) = 0;
-      /**
-       * This function reads in the data of the next events and stores them
-       * in the correponding Sectors.
-       * @return false if the end of the input data is reached (after the
-       *         last successfull event read)
-       * @see Sector::set()
-       */
-      virtual bool putNextEvent() = 0;
-      /**
-       * This method is intended for EventReaders which read events from
-       * a sequential media. The default implementation does nothing. It
-       * has been decided to put this method in the EventReader interface
-       * in order to allow for polymorphism (i.e. in order to allow to
-       * invoke the method from an EventReader.). This might not be the
-       * best solution. Anyway, at the moment the method has only been
-       * implemented in order to play around with the CORBA MUCTPI
-       * implementation via a demo java application. In the real life
-       * this method is not expected to be of any use.
-       */
-      virtual void rewind() { }
-      virtual void setEventSource( EventSource & ) = 0;
-
-      EventReader();
-      virtual ~EventReader();
-
-   protected:
-      mutable MsgLogger m_logger;
-      std::string m_infoString;
-
-   }; // class EventReader
-
-} // namespace LVL1MUCTPI
-
-#endif // LVL1MUCTPITEST_EVENTREADER_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.cxx
deleted file mode 100644
index 266bfc1602b0..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.cxx
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EventReaderFactory.cxx 472835 2011-12-06 21:05:16Z stelzer $
-
-// Local include(s):
-#include "EventReaderFactory.h"
-#include "EventReader.h"
-#include "SectorLogicReader.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   EventReader* EventReaderFactory::getEventReader() {
-
-      MsgLogger logger( "EventReaderFactory" );
-      REPORT_MSG2(DEBUG, "Using a SectorLogicReader", logger);
-      return new SectorLogicReader();
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.h
deleted file mode 100644
index 3d3ee2c3f4e9..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventReaderFactory.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EventReaderFactory.h 364083 2011-05-06 09:09:55Z krasznaa $
-#ifndef TRIGT1MUCTPI_EVENTREADERFACTORY_H
-#define TRIGT1MUCTPI_EVENTREADERFACTORY_H
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class EventReader;
-
-   /**
-    *  @short Generates the Event Reader depending on Environment Variable MUCTPI_EVENT_READER.
-    *
-    *         The EventReaderFactory  is  responsible for  instantiating
-    *         the Event  Reader  depending on  the Environment  Variable
-    *         MUCTPI_EVENT_READER. The  only allowed  value is currently
-    *         MIF_FILE_READER   because there  is  no   other   concrete
-    *         EventReader implemented at the moment.  If the Variable is
-    *         not set, a default Event Reader is instantiated (currently
-    *         the MIF_FILE_READER).
-    *
-    *         The  EventReaderFactory is implemented  as a Singleton. It
-    *         is a   concrete class but might be  changed to an abstract
-    *         class in future resleases. In that case it will correspond
-    *         to  the design pattern of  an abstract factory of E.Gamma,
-    *         R.Helm,     R.Johnson,   J.Vlissides "Design     Patterns"
-    *         (Addison-Wesley).
-    *
-    *    @see muon_devil
-    *    @see muon_cooker
-    *    @see EventReader
-    *    @see MifFileReader
-    *
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 364083 $
-    * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
-    */
-   class EventReaderFactory {
-
-   public:
-      /**
-       * The Event Reader Factory is implemented as a Singleton. This 
-       * static member funtion instantiates the Factory in case it has
-       * not yet been instantiated. In addition it instantiates a 
-       * concrete Event Reader depending on the value of the Environment
-       * Variable MUCTPI_EVENT_READER in case it has not been yet 
-       * instantiated.
-       * 
-       * @return A pointer to the instantiated concrete Event Reader. 
-       */
-      static EventReader* getEventReader();
-
-   }; // class EventReaderFactory
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_EVENTREADERFACTORY_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventSource.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventSource.h
deleted file mode 100644
index 2af522611177..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/EventSource.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: EventSource.h 364083 2011-05-06 09:09:55Z krasznaa $
-#ifndef TRIGT1MUCTPI_EVENTSOURCE_H
-#define TRIGT1MUCTPI_EVENTSOURCE_H
-
-namespace LVL1MUCTPI {
-
-   /**
-    *  @short Parent class of all EventSources
-    *            
-    *         This class only exists in order to be able to use 
-    *         polmorphy with EventSources. The EventReader has an 
-    *         abstract method setEventSource which needs an argument
-    *         which is of a type EventSource. The idea is that the user
-    *         only deals with abstract EventReaders. He does not need to
-    *         know what concrete type of the EventReader which has been 
-    *         instantiated. This was once done by the EventReaderFactory.
-    *         But he needs to give to the EventReader the correct type
-    *         of EventSource of course. In the concrete EventReaders 
-    *         the EventSource is dynamic_casted to the concrete EventSource
-    *         for the concrete EventReader. If the cast fails a error
-    *         message is issued. Since dynamic_cast requires at least
-    *         one abstract method in the base class, a dummy method has
-    *         been introduced. 
-    *            
-    *         The design is questionable in the sense that at the 
-    *         point when the user has to set the EventSource he also 
-    *         needs to know which concrete EventReader has been 
-    *         chosen.
-    *            
-    *    @see EventReader
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 364083 $
-    * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
-    */
-   class EventSource {
-
-   public:
-      virtual ~EventSource() = default;
-      virtual const char* printSource() const = 0;
-
-   }; // class EventSource
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_EVENTSOURCE_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.cxx
deleted file mode 100644
index 59c06a3ac6f7..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: ExclusiveMultStrategy.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// Local include(s):
-#include "ExclusiveMultStrategy.h"
-
-namespace LVL1MUCTPI {
-
-   ExclusiveMultStrategy::ExclusiveMultStrategy()
-      : MultiplicityStrategy( "Exclusive-Multiplicity-Strategy" ) {
-
-   }
-
-   ExclusiveMultStrategy::~ExclusiveMultStrategy() {
-
-   }
-
-   /**
-    * This function takes care of creating the multiplicity word from a
-    * muon candidate in an exclusive way.
-    *
-    * @param pt The p<sub>T</sub> threshold of the candidate
-    * @param id The sector that produced the muon candidate (ignored)
-    * @returns The multiplicity word from one muon candidate
-    */
-   PtMultiplicitySet
-   ExclusiveMultStrategy::calculateMultiplicity( unsigned int pt,
-                                                 const SectorID&,
-                                                 bool ) const {
-
-      PtMultiplicitySet result;
-
-      //
-      // Increment only this one threshold:
-      //
-      result.addMuon( pt );
-
-      return result;
-
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.h
deleted file mode 100644
index 0e4121cc6774..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ExclusiveMultStrategy.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: ExclusiveMultStrategy.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIOCT_EXCLUSIVEMULTSTRATEGY_H
-#define TRIGT1MUCTPI_MIOCT_EXCLUSIVEMULTSTRATEGY_H
-
-// Local include(s):
-#include "MultiplicityStrategy.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    *    @date $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-    *
-    *   @short Exclusive multiplicity handling strategy
-    *
-    *          This strategy creates the multiplicity words by only incrementing
-    *          the multiplicity of the highest passed threshold. So for a candidate
-    *          passing threshold "3", it would create the multiplicity word:
-    *
-    *          <verbatim>
-    *          000 000 000 001 000 000
-    *          </verbatim>
-    *
-    *          It's mostly used when the muon thresholds are in no direct relation
-    *          with each other. For instance threshold "1" could be an RPC-only
-    *          threshold, while threshold "2" is TGC-only.
-    *
-    *  @author $Author: krasznaa $
-    * @version $Revision: 362102 $
-    */
-   class ExclusiveMultStrategy : public MultiplicityStrategy {
-
-   public:
-      /// Constructor
-      ExclusiveMultStrategy();
-      /// Destructor
-      ~ExclusiveMultStrategy();
-
-      /// Multiplicity handling function
-      virtual PtMultiplicitySet calculateMultiplicity( unsigned int pt,
-                                                       const SectorID& id,
-                                                       bool firstCandidate ) const;
-
-   }; // class ExclusiveMultStrategy
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIOCT_EXCLUSIVEMULTSTRATEGY_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.cxx
deleted file mode 100644
index 46212e6d72b7..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.cxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: ForwardSector.cxx 700318 2015-10-13 14:13:15Z wengler $
-
-// STL include(s):
-#include <iomanip>
-#include <sstream>
-
-// Local include(s):
-#include "ForwardSector.h"
-#include "EventReader.h"
-#include "../Common/SectorConstants.h"
-
-namespace LVL1MUCTPI {
-
-   const unsigned int ForwardSector::MIN_SECTOR = MIN_FORWARD_SECTOR;
-   const unsigned int ForwardSector::MAX_SECTOR = MAX_FORWARD_SECTOR;
-
-   ForwardSector::ForwardSector( Hemisphere hemisphere, unsigned int sectorNumber,
-                                 EventReader* reader )
-      : Sector( hemisphere, sectorNumber, reader ), m_logger( "ForwardSector" ) {
-
-      if( m_sectorNumber > ForwardSector::MAX_SECTOR ) {
-         m_sectorNumber = ( sectorNumber % ForwardSector::MAX_SECTOR ) - 1;
-      }
-
-      m_reader->registerSector( this );
-      m_registered = true;
-   }
-
-   ForwardSector::ForwardSector( const ForwardSector& sector )
-      : Sector( sector.m_rapidityRegion, sector.m_sectorNumber, sector.m_reader ),
-        m_logger( "ForwardSector" ) {
-
-      m_bitField = sector.m_bitField;
-      m_registered = false;
-   }
-
-   ForwardSector::~ForwardSector() {
-
-      if( m_registered ) m_reader->unregisterSector( this );
-   }
-
-   void ForwardSector::set( const unsigned int bitfield ) {
-
-      // check if any of the reservered bits is set. This should not
-      // be the case. If so, give a warning but set the bitfield anyway.
-      // these fields are not respected by input simultion - skip
-      // if( ( ForwardReservedMask & bitfield ) != 0 ) {
-      //   m_logger << WARNING << "illegal bitfield : " << std::hex << bitfield
-      //            << " (hex) --> Bitfield set anyway" << MsgLogger::endmsg;
-      //}
-
-      m_bitField = bitfield;
-      return;
-   }
-
-   unsigned int ForwardSector::getROI1() const {
-
-      return getValue( ForwardROI1Mask );
-   }
-
-   unsigned int ForwardSector::getROI2() const {
-
-      return getValue( ForwardROI2Mask );
-   }
-
-   void ForwardSector::print( std::string& result ) const {
-
-      int BCID, SecOf, ROI1, ROI2, Pt1, Pt2, ROI1Of, ROI2Of;
-
-      std::string myId;
-      this->printID( myId );
-
-      BCID   = this->getValue( BCIDMask );
-      SecOf  = this->getValue( SectorOverflowMask );
-      ROI1   = this->getROI1();
-      ROI2   = this->getROI2();
-      Pt1    = this->getValue( Pt1Mask );
-      Pt2    = this->getValue( Pt2Mask );
-      ROI1Of = this->getValue( ROI1OverflowMask );
-      ROI2Of = this->getValue( ROI2OverflowMask );
-
-      std::ostringstream outStream;
-      outStream << " \n\n  FORWARD SECTOR DATA $Revision: 700318 $" << std::endl;
-      outStream << "==============================================" << std::endl;
-      outStream << myId << std::endl;
-      outStream << "BCID :            " << BCID  << std::endl;
-      outStream << "Sector Overflow : " << SecOf << std::endl;
-      outStream << std::endl;
-      outStream << "          Candidate 1       Candidate 2 " << std::endl;
-      outStream << "  ROI        " << ROI1
-                << "                  " << ROI2 << std::endl;
-      outStream << "  Pt         " << Pt1
-                << "                  " << Pt2 << std::endl;
-      outStream << "  ROIOF      " << ROI1Of
-                << "                  " << ROI2Of << std::endl;
-      outStream << std::endl;
-
-      result = outStream.str();
-      return;
-   }
-
-   SectorID ForwardSector::getSectorID() const {
-
-      return SectorID( FORWARD, m_rapidityRegion, m_sectorNumber );
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.h
deleted file mode 100644
index 9b207807a667..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/ForwardSector.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: ForwardSector.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_FORWARDSECTOR_H
-#define TRIGT1MUCTPI_FORWARDSECTOR_H
-
-// STL include(s):
-#include <string>
-
-// Local include(s):
-#include "Sector.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    *  @short This class handles an 32-bit Input word from the Forward Front-End-Electronics. 
-    *
-    *         This  class  complies to the Sector   Interface class.  It
-    *         specializes  the  base class with some  decoding functions
-    *         which are  special for the  Forward Sector data-format. It
-    *         provides a  print  facility to  view  the contents  of the
-    *         data-word in readable format.
-    *
-    *    @see Sector
-    *    @see SectorID
-    * @author $Author: krasznaa $
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class ForwardSector : public Sector {
-
-   public:
-      /**
-       * The only constructor of a Forward sector, identified by its
-       * sector number and hemisphere
-       * @param hemisphere The Hemisphere the sector is in
-       * @param sectorNumber The sector number
-       */
-      ForwardSector( Hemisphere hemisphere, unsigned int sectorNumber,
-                     EventReader* reader );
-      ForwardSector( const ForwardSector& sector );
-      ForwardSector & operator = ( const ForwardSector & ) = delete;
-
-      ~ForwardSector();
-      /**
-       * Implementation of the corresponding abstract method in the
-       * baseclass Sector.
-       * @see Sector::set()
-       * @param bitfield This is the value to which the
-       *                 Forward Sector 32-bit bitfield is set.
-       *                 It is checked that none of the reserved bits are set.
-       */
-      void set( const unsigned int bitfield );
-      /**
-       * This access funtion retrieves the ROI-number of the first candidate.
-       */
-      unsigned int getROI1() const;
-      /**
-       * This access funtion retrieves the ROI-number of the second candidate.
-       */
-      unsigned int getROI2() const;
-      void print( std::string& ForwardDescription ) const;
-      std::string getDetectorString() const { return "Forward"; }
-      virtual SectorID getSectorID() const;
-
-   private:
-      mutable MsgLogger m_logger;
-
-      /**
-       * some constants important for checking the validity of
-       * the SectorID
-       */
-      static const unsigned int MIN_SECTOR;
-      static const unsigned int MAX_SECTOR;
-
-   }; // class ForwardSector
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_FORWARDSECTOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.cxx
deleted file mode 100644
index 7ec0237d80d6..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.cxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: InclusiveMultStrategy.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// Local include(s):
-#include "InclusiveMultStrategy.h"
-#include "../Common/SectorConstants.h"
-
-namespace LVL1MUCTPI {
-
-   InclusiveMultStrategy::InclusiveMultStrategy()
-      : MultiplicityStrategy( "Inclusive-Multiplicity-Strategy" ) {
-
-   }
-
-   InclusiveMultStrategy::~InclusiveMultStrategy() {
-
-   }
-
-   /**
-    * This function takes care of creating the multiplicity word from a
-    * muon candidate in an inclusive way.
-    *
-    * @param pt The p<sub>T</sub> threshold of the candidate
-    * @param id The sector that produced the muon candidate (ignored)
-    * @returns The multiplicity word from one muon candidate
-    */
-   PtMultiplicitySet
-   InclusiveMultStrategy::calculateMultiplicity( unsigned int pt,
-                                                 const SectorID&,
-                                                 bool ) const {
-
-      PtMultiplicitySet result;
-
-      //
-      // If a candidate is not created, that's signalled by giving it the pt threshold 7.
-      // So the multiplicity should only be changed if the given threshold is in the
-      // correct range.
-      //
-      if( ( pt >= 1 ) && ( pt <= MAX_NUMBER_OF_THRESHOLDS ) ) {
-         for( unsigned int i = 1; i <= pt; ++i ) {
-            result.addMuon( i );
-         }
-      }
-
-      return result;
-
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.h
deleted file mode 100644
index 03af50641a59..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/InclusiveMultStrategy.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: InclusiveMultStrategy.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIOCT_INCLUSIVEMULTSTRATEGY_H
-#define TRIGT1MUCTPI_MIOCT_INCLUSIVEMULTSTRATEGY_H
-
-// Local include(s):
-#include "MultiplicityStrategy.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    *    @date $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-    *
-    *   @short Inclusive multiplicity handling strategy
-    *
-    *          This strategy creates the multiplicity words by incrementing the
-    *          multiplicity of the passed threshold, and those of the thresholds
-    *          "below" the passed threshold. So for a candidate passing threshold
-    *          "3", it would create a multiplicity word:
-    *
-    *          <verbatim>
-    *          000 000 000 001 001 001
-    *          </verbatim>
-    *
-    *  @author $Author: krasznaa $
-    * @version $Revision: 362102 $
-    */
-   class InclusiveMultStrategy : public MultiplicityStrategy {
-
-   public:
-      /// Constructor
-      InclusiveMultStrategy();
-      /// Destructor
-      ~InclusiveMultStrategy();
-
-      /// Multiplicity handling function
-      virtual PtMultiplicitySet calculateMultiplicity( unsigned int pt,
-                                                       const SectorID& id,
-                                                       bool firstCandidate ) const;
-
-   }; // class InclusiveMultStrategy
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIOCT_INCLUSIVEMULTSTRATEGY_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.cxx
deleted file mode 100644
index 842763a65db7..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.cxx
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTBBOverlapCalculator.cxx 650693 2015-03-01 16:53:48Z masato $
-
-// STL include(s):
-#include <string>
-#include <iomanip>
-
-// XercesC include(s):
-#include <xercesc/dom/DOMElement.hpp>
-#include <xercesc/dom/DOMNodeList.hpp>
-#include <xercesc/util/XMLString.hpp>
-
-// Local include(s):
-#include "LUTBBOverlapCalculator.h"
-#include "BarrelSector.h"
-#include "../Common/PtMultiplicitySet.h"
-
-namespace LVL1MUCTPI {
-
-   LUTBBOverlapCalculator::LUTBBOverlapCalculator()
-      : LUTOverlapCalculatorBase( "LUTBBOverlapCalculator" ) {
-
-   }
-
-   LUTBBOverlapCalculator::LUTBBOverlapCalculator( const LUTBBOverlapCalculator& calc )
-      : LUTOverlapCalculatorBase( calc ) {
-
-   }
-
-   /**
-    * @param node One of the BB nodes of the XML file
-    * @param dumpLut Print the LUT while reading it
-    */
-  StatusCode LUTBBOverlapCalculator::initialize( const xercesc::DOMNode* bbnode, bool dumpLut,const std::string& runPeriod ) {
-
-     if( runPeriod == "RUN2" ){
-       setMaximumThreshold( 6 );
-       REPORT_VERBOSE_MSG( "RunPeriod=" << runPeriod << " setMaximumThreshold to 6" );
-     }
-
-      // Clear the internal LUT:
-      m_lut.clear();
-
-      //
-      // Check if the received node is of the right type:
-      //
-      if( bbnode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) {
-         REPORT_ERROR_MSG( "Received node is not a DOMElement" );
-         return StatusCode::RECOVERABLE;
-      }
-
-      REPORT_VERBOSE_MSG( "Looping over \"BBElement\"-s:" );
-
-      const xercesc::DOMNodeList* lut_def_list = bbnode->getChildNodes();
-      for( XMLSize_t i = 0; i < lut_def_list->getLength(); ++i ) {
-
-         const xercesc::DOMNode* lut_node = lut_def_list->item( i );
-         char* cname = xercesc::XMLString::transcode( lut_node->getNodeName() );
-         std::string sname( cname );
-         xercesc::XMLString::release( &cname );
-
-         if( sname != "BBElement" ) continue;
-
-         const xercesc::DOMElement* lut_element =
-            dynamic_cast< const xercesc::DOMElement* >( lut_node );
-         if( ! lut_element ) {
-            REPORT_ERROR_MSG( "Unable to cast LUT node into DOMElement" );
-            return StatusCode::RECOVERABLE;
-         }
-
-         XMLCh* roi1_name  = xercesc::XMLString::transcode( "RoI1" );
-         XMLCh* roi2_name  = xercesc::XMLString::transcode( "RoI2" );
-         XMLCh* ovlp1_name = xercesc::XMLString::transcode( "Ovlp1" );
-         XMLCh* ovlp2_name = xercesc::XMLString::transcode( "Ovlp2" );
-
-         const XMLCh* roi1  = lut_element->getAttribute( roi1_name );
-         const XMLCh* roi2  = lut_element->getAttribute( roi2_name );
-         const XMLCh* ovlp1 = lut_element->getAttribute( ovlp1_name );
-         const XMLCh* ovlp2 = lut_element->getAttribute( ovlp2_name );
-
-         xercesc::XMLString::release( &roi1_name );
-         xercesc::XMLString::release( &roi2_name );
-         xercesc::XMLString::release( &ovlp1_name );
-         xercesc::XMLString::release( &ovlp2_name );
-
-         const int roi1_n   = xercesc::XMLString::parseInt( roi1 );
-         const int roi2_n   = xercesc::XMLString::parseInt( roi2 );
-         const bool ovlp1_b = xercesc::XMLString::parseInt( ovlp1 );
-         const bool ovlp2_b = xercesc::XMLString::parseInt( ovlp2 );
-
-         //
-         // Create the word to be put into the LUT:
-         //
-         const unsigned int element = ( roi1_n & 0x1f ) | ( ovlp1_b ? 0x20 : 0x0 ) |
-            ( ( roi2_n & 0x1f ) << 6 ) | ( ovlp2_b ? 0x800 : 0x0 );
-
-         m_lut[ element ] = true;
-
-         if( dumpLut ) {
-            REPORT_VERBOSE_MSG( "  --> RoI1: " << roi1_n << " RoI2: " << roi2_n << " Ovlp1: "
-                                << ovlp1_b << " Ovlp2: " << ovlp2_b << " Element: 0x"
-                                << std::hex << std::setw( 3 ) << std::setfill( '0' ) << element << std::dec );
-         }
-      }
-
-      REPORT_VERBOSE_MSG( "Number of LUT elements: " << m_lut.size() );
-
-      return StatusCode::SUCCESS;
-   }
-
-   void LUTBBOverlapCalculator::calculate( const BarrelSector& sector1,
-                                           const BarrelSector& sector2 ) const {
-
-      //
-      // Calculate some helper quantities:
-      //
-      bool sec1cand1present = false, sec1cand2present = false;
-      bool sec2cand1present = false, sec2cand2present = false;
-      int sec1cand1pt = -1, sec1cand2pt = -1;
-      int sec2cand1pt = -1, sec2cand2pt = -1;
-      if( sector1.getPtCand1() != 7 ) {
-         sec1cand1present = true;
-         sec1cand1pt = sector1.getPtCand1();
-      }
-      if( sector1.getPtCand2() != 7 ) {
-         sec1cand2present = true;
-         sec1cand2pt = sector1.getPtCand2();
-      }
-      if( sector2.getPtCand1() != 7 ) {
-         sec2cand1present = true;
-         sec2cand1pt = sector2.getPtCand1();
-      }
-      if( sector2.getPtCand2() != 7 ) {
-         sec2cand2present = true;
-         sec2cand2pt = sector2.getPtCand2();
-      }
-
-      //
-      // Find if a rule exists for sec1 cand1 and sec2 cand1:
-      //
-      unsigned int element = ( sector1.getROI1() & 0x1f ) |
-         ( sector1.isCand1BarrelOverlap() ? 0x20 : 0x0 ) |
-         ( ( sector2.getROI1() & 0x1f ) << 6 ) |
-         ( sector2.isCand1BarrelOverlap() ? 0x800 : 0x0 );
-      if( sec1cand1present && sec2cand1present &&
-          ( sec1cand1pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand1pt < sec2cand1pt ) {
-                  sector1.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector "
-                                      << sector1.getSectorNumber() << " in the "
-                                      << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector "
-                                      << sector2.getSectorNumber() << " in the "
-                                      << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for sec1 cand2 and sec2 cand1:
-      //
-      element = ( sector1.getROI2() & 0x1f ) |
-         ( sector1.isCand2BarrelOverlap() ? 0x20 : 0x0 ) |
-         ( ( sector2.getROI1() & 0x1f ) << 6 ) |
-         ( sector2.isCand1BarrelOverlap() ? 0x800 : 0x0 );
-      if( sec1cand2present && sec2cand1present &&
-          ( sec1cand2pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand2pt < sec2cand1pt ) {
-                  sector1.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector "
-                                      << sector1.getSectorNumber() << " in the "
-                                      << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector "
-                                      << sector2.getSectorNumber() << " in the "
-                                      << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for sec1 cand1 and sec2 cand2:
-      //
-      element = ( sector1.getROI1() & 0x1f ) |
-         ( sector1.isCand1BarrelOverlap() ? 0x20 : 0x0 ) |
-         ( ( sector2.getROI2() & 0x1f ) << 6 ) |
-         ( sector2.isCand2BarrelOverlap() ? 0x800 : 0x0 );
-      if( sec1cand1present && sec2cand2present &&
-          ( sec1cand1pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand1pt < sec2cand2pt ) {
-                  sector1.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector "
-                                      << sector1.getSectorNumber() << " in the "
-                                      << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector "
-                                      << sector2.getSectorNumber() << " in the "
-                                      << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for sec1 cand2 and sec2 cand2:
-      //
-      element = ( sector1.getROI2() & 0x1f ) |
-         ( sector1.isCand2BarrelOverlap() ? 0x20 : 0x0 ) |
-         ( ( sector2.getROI2() & 0x1f ) << 6 ) |
-         ( sector2.isCand2BarrelOverlap() ? 0x800 : 0x0 );
-      if( sec1cand2present && sec2cand2present &&
-          ( sec1cand2pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand2pt < sec2cand2pt ) {
-                  sector1.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector "
-                                      << sector1.getSectorNumber() << " in the "
-                                      << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector "
-                                      << sector2.getSectorNumber() << " in the "
-                                      << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.h
deleted file mode 100644
index 3e715c5c890f..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBBOverlapCalculator.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTBBOverlapCalculator.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_LUTBBOVERLAPCALCULATOR_H
-#define TRIGT1MUCTPI_LUTBBOVERLAPCALCULATOR_H
-
-// Local include(s):
-#include "LUTOverlapCalculatorBase.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class BarrelSector;
-
-   /**
-    *  @short Class flagging barrel candidates for barrel-barrel overlaps
-    *
-    *         This is one of the end-classes of the new LUT overlap handling. It can be
-    *         initialized by passing the correct DOMNode to it in it's initialize method.
-    *         When two barrel candidates are given to it, it can flag one of them to be
-    *         supressed in the multiplicity count.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class LUTBBOverlapCalculator : public LUTOverlapCalculatorBase {
-
-   public:
-      /// Default constructor
-      LUTBBOverlapCalculator();
-      /// Copy constructor
-      LUTBBOverlapCalculator( const LUTBBOverlapCalculator& calc );
-      LUTBBOverlapCalculator  & operator = ( const LUTBBOverlapCalculator  & ) = delete;
-
-      /// Function initializing the calculator object
-     virtual StatusCode initialize( const xercesc::DOMNode* bbnode, bool dumpLut, const std::string& runPeriod );
-
-      /// Calculate the overlap flags for two barrel sectors
-      void calculate( const BarrelSector& sector1, const BarrelSector& sector2 ) const;
-
-   private:
-      //
-      // The LUT words take the form:
-      //
-      // variable  |Ovl2|          RoI2          |Ovl1|          RoI1          |
-      //      bit  | 12 | 11 | 10 |  9 |  8 |  7 |  6 |  5 |  4 |  3 |  2 |  1 |
-
-   }; // class LUTBBOverlapCalculator
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_LUTBBOVERLAPCALCULATOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.cxx
deleted file mode 100644
index be79f6bd3a88..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.cxx
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTBEOverlapCalculator.cxx 650693 2015-03-01 16:53:48Z masato $
-
-// STL include(s):
-#include <sstream>
-#include <iomanip>
-
-// XercesC include(s):
-#include <xercesc/dom/DOMElement.hpp>
-#include <xercesc/dom/DOMNodeList.hpp>
-#include <xercesc/util/XMLString.hpp>
-
-// Local include(s):
-#include "LUTBEOverlapCalculator.h"
-#include "BarrelSector.h"
-#include "EndcapSector.h"
-#include "../Common/PtMultiplicitySet.h"
-
-namespace LVL1MUCTPI {
-
-   LUTBEOverlapCalculator::LUTBEOverlapCalculator()
-      : LUTOverlapCalculatorBase( "LUTBEOverlapCalculator" ) {
-
-   }
-
-   LUTBEOverlapCalculator::LUTBEOverlapCalculator( const LUTBEOverlapCalculator& calc )
-      : LUTOverlapCalculatorBase( calc ) {
-
-   }
-
-  StatusCode LUTBEOverlapCalculator::initialize( const xercesc::DOMNode* benode, bool dumpLut, const std::string& runPeriod ) {
-
-     if( runPeriod == "RUN2" ){
-       setMaximumThreshold( 3 );
-       REPORT_VERBOSE_MSG( "RunPeriod=" << runPeriod << " setMaximumThreshold to 3" );
-     }
-
-      // Clear the internal LUT:
-      m_lut.clear();
-
-      //
-      // Check if the received node is of the right type:
-      //
-      if( benode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) {
-         REPORT_ERROR_MSG( "Received node is not a DOMElement" );
-         return StatusCode::RECOVERABLE;
-      }
-
-      REPORT_VERBOSE_MSG( "Looping over \"BEElement\"-s:" );
-
-      //
-      // Initialize the B-E LUT:
-      //
-      const xercesc::DOMNodeList* lut_lines = benode->getChildNodes();
-      for( XMLSize_t i = 0; i < lut_lines->getLength(); ++i ) {
-
-         const xercesc::DOMNode* lut_line = lut_lines->item( i );
-         char* cname = xercesc::XMLString::transcode( lut_line->getNodeName() );
-         std::string sname( cname );
-         xercesc::XMLString::release( &cname );
-
-         if( sname != "BEElement" ) continue;
-
-         const xercesc::DOMElement* lut_element =
-            dynamic_cast< const xercesc::DOMElement* >( lut_line );
-         if( ! lut_element ) {
-            REPORT_ERROR_MSG( "Unable to cast LUT node into DOMElement" );
-            return StatusCode::RECOVERABLE;
-         }
-
-         XMLCh* broi_name = xercesc::XMLString::transcode( "BRoI" );
-         XMLCh* bpt_name  = xercesc::XMLString::transcode( "BPt" );
-         XMLCh* eroi_name = xercesc::XMLString::transcode( "ERoI" );
-         XMLCh* q_name    = xercesc::XMLString::transcode( "EChrg" );
-
-         const XMLCh* broi = lut_element->getAttribute( broi_name );
-         const XMLCh* bpt  = lut_element->getAttribute( bpt_name );
-         const XMLCh* eroi = lut_element->getAttribute( eroi_name );
-         const XMLCh* q    = lut_element->getAttribute( q_name );
-
-         xercesc::XMLString::release( &broi_name );
-         xercesc::XMLString::release( &bpt_name );
-         xercesc::XMLString::release( &eroi_name );
-         xercesc::XMLString::release( &q_name );
-
-         const unsigned int broi_n = xercesc::XMLString::parseInt( broi );
-         const unsigned int bpt_n  = xercesc::XMLString::parseInt( bpt );
-         const unsigned int eroi_n = xercesc::XMLString::parseInt( eroi );
-         const unsigned int q_n    = xercesc::XMLString::parseInt( q );
-
-         //
-         // Create the word to be put into the LUT:
-         //
-         const unsigned int element = ( broi_n & 0x1f ) | ( ( bpt_n & 0x7 ) << 5 ) |
-            ( ( eroi_n & 0xff ) << 8 ) | ( ( q_n & 0x1 ) << 16 );
-
-         m_lut[ element ] = true;
-
-         if( dumpLut ) {
-            REPORT_VERBOSE_MSG( "  --> BRoI: " << broi_n << " BPt: " << bpt_n
-                                << " ERoI: " << eroi_n << " EChrg: " << q_n << " Element: 0x"
-                                << std::hex << std::setw( 5 ) << std::setfill( '0' ) << element
-                                << std::dec );
-         }
-      }
-
-      REPORT_VERBOSE_MSG( "Number of LUT elements: " << m_lut.size() );
-
-      return StatusCode::SUCCESS;
-   }
-
-   void LUTBEOverlapCalculator::calculate( const BarrelSector& bsector,
-                                           const EndcapSector& esector ) const {
-
-      //
-      // Calculate some helper quantities:
-      //
-      bool bseccand1present = false, bseccand2present = false;
-      bool eseccand1present = false, eseccand2present = false;
-      int bseccand1pt = -1, bseccand2pt = -1;
-      int eseccand1pt = -1, eseccand2pt = -1;
-      if( bsector.getPtCand1() != 7 ) {
-         bseccand1present = true;
-         bseccand1pt = bsector.getPtCand1();
-      }
-      if( bsector.getPtCand2() != 7 ) {
-         bseccand2present = true;
-         bseccand2pt = bsector.getPtCand2();
-      }
-      if( esector.getPtCand1() != 7 ) {
-         eseccand1present = true;
-         eseccand1pt = esector.getPtCand1();
-      }
-      if( esector.getPtCand2() != 7 ) {
-         eseccand2present = true;
-         eseccand2pt = esector.getPtCand2();
-      }
-
-      //
-      // Find if a rule exists for bsec cand1 and esec cand1:
-      //
-      unsigned int element1 = ( bsector.getROI1() & 0x1f ) | ( ( bsector.getPtCand1() & 0x7 ) << 5 ) |
-         ( ( esector.getROI1() & 0xff ) << 8 ) | 0x10000;
-      unsigned int element2 = ( bsector.getROI1() & 0x1f ) | ( ( bsector.getPtCand1() & 0x7 ) << 5 ) |
-         ( ( esector.getROI1() & 0xff ) << 8 );
-      if( bseccand1present && eseccand1present &&
-          ( bseccand1pt <= m_thr ) && ( eseccand1pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it1, it2;
-         if( ( ( ( it1 = m_lut.find( element1 ) ) != m_lut.end() ) && ( it1->second ) ) ||
-             ( ( ( it2 = m_lut.find( element2 ) ) != m_lut.end() ) && ( it2->second ) ) ) {
-            if( bseccand1pt < eseccand1pt ) {
-               bsector.setCand1Supressed( true );
-#ifndef NDEBUG
-               REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector " << bsector.getSectorNumber()
-                                   << " in the " << bsector.getRapidityString()
-                                   << " rapidity region supressed" );
-#endif // NDEBUG
-            } else {
-               esector.setCand1Supressed( true );
-#ifndef NDEBUG
-               REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << esector.getSectorNumber()
-                                   << " in the " << esector.getRapidityString()
-                                   << " rapidity region supressed" );
-#endif // NDEBUG
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for bsec cand2 and esec cand1:
-      //
-      element1 = ( bsector.getROI2() & 0x1f ) | ( ( bsector.getPtCand2() & 0x7 ) << 5 ) |
-         ( ( esector.getROI1() & 0xff ) << 8 ) | 0x10000;
-      element2 = ( bsector.getROI2() & 0x1f ) | ( ( bsector.getPtCand2() & 0x7 ) << 5 ) |
-         ( ( esector.getROI1() & 0xff ) << 8 );
-      if( bseccand2present && eseccand1present &&
-          ( bseccand2pt <= m_thr ) && ( eseccand1pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it1, it2;
-         if( ( ( ( it1 = m_lut.find( element1 ) ) != m_lut.end() ) && ( it1->second ) ) ||
-             ( ( ( it2 = m_lut.find( element2 ) ) != m_lut.end() ) && ( it2->second ) ) ) {
-            if( bseccand2pt < eseccand1pt ) {
-               bsector.setCand2Supressed( true );
-#ifndef NDEBUG
-               REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector " << bsector.getSectorNumber()
-                                   << " in the " << bsector.getRapidityString()
-                                   << " rapidity region supressed" );
-#endif // NDEBUG
-            } else {
-               esector.setCand1Supressed( true );
-#ifndef NDEBUG
-               REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << esector.getSectorNumber()
-                                   << " in the " << esector.getRapidityString()
-                                   << " rapidity region supressed" );
-#endif // NDEBUG
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for bsec cand1 and esec cand2:
-      //
-      element1 = ( bsector.getROI1() & 0x1f ) | ( ( bsector.getPtCand1() & 0x7 ) << 5 ) |
-         ( ( esector.getROI2() & 0xff ) << 8 ) | 0x10000;
-      element2 = ( bsector.getROI1() & 0x1f ) | ( ( bsector.getPtCand1() & 0x7 ) << 5 ) |
-         ( ( esector.getROI2() & 0xff ) << 8 );
-      if( bseccand1present && eseccand2present &&
-          ( bseccand1pt <= m_thr ) && ( eseccand2pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it1, it2;
-         if( ( ( ( it1 = m_lut.find( element1 ) ) != m_lut.end() ) && ( it1->second ) ) ||
-             ( ( ( it2 = m_lut.find( element2 ) ) != m_lut.end() ) && ( it2->second ) ) ) {
-            if( bseccand1pt < eseccand2pt ) {
-               bsector.setCand1Supressed( true );
-#ifndef NDEBUG
-               REPORT_VERBOSE_MSG( "Candidate 1 in Barrel sector " << bsector.getSectorNumber()
-                                   << " in the " << bsector.getRapidityString()
-                                   << " rapidity region supressed" );
-#endif // NDEBUG
-            } else {
-               esector.setCand2Supressed( true );
-#ifndef NDEBUG
-               REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << esector.getSectorNumber()
-                                   << " in the " << esector.getRapidityString()
-                                   << " rapidity region supressed" );
-#endif // NDEBUG
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for bsec cand2 and esec cand2:
-      //
-      element1 = ( bsector.getROI2() & 0x1f ) | ( ( bsector.getPtCand2() & 0x7 ) << 5 ) |
-         ( ( esector.getROI2() & 0xff ) << 8 ) | 0x10000;
-      element2 = ( bsector.getROI2() & 0x1f ) | ( ( bsector.getPtCand2() & 0x7 ) << 5 ) |
-         ( ( esector.getROI2() & 0xff ) << 8 );
-      if( bseccand2present && eseccand2present &&
-          ( bseccand2pt <= m_thr ) && ( eseccand2pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it1, it2;
-         if( ( ( ( it1 = m_lut.find( element1 ) ) != m_lut.end() ) && ( it1->second ) ) ||
-             ( ( ( it2 = m_lut.find( element2 ) ) != m_lut.end() ) && ( it2->second ) ) ) {
-            if( bseccand2pt < eseccand2pt ) {
-               bsector.setCand2Supressed( true );
-#ifndef NDEBUG
-               REPORT_VERBOSE_MSG( "Candidate 2 in Barrel sector " << bsector.getSectorNumber()
-                                   << " in the " << bsector.getRapidityString()
-                                   << " rapidity region supressed" );
-#endif // NDEBUG
-            } else {
-               esector.setCand2Supressed( true );
-#ifndef NDEBUG
-               REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << esector.getSectorNumber()
-                                   << " in the " << esector.getRapidityString()
-                                   << " rapidity region supressed" );
-#endif // NDEBUG
-            }
-         }
-      }
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.h
deleted file mode 100644
index bbdabbf29c03..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTBEOverlapCalculator.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTBEOverlapCalculator.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_LUTBEOVERLAPCALCULATOR_H
-#define TRIGT1MUCTPI_LUTBEOVERLAPCALCULATOR_H
-
-// Local include(s):
-#include "LUTOverlapCalculatorBase.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class BarrelSector;
-   class EndcapSector;
-
-   /**
-    *  @short Class flagging barrel or endcap muon candidates for fake double-counts
-    *
-    *         This class can be used to flag the one of the muon candidates in
-    *         an overlapping barrel-endcap sector pair if they are believed
-    *         to be coming from the same muon. The muon with the higher
-    *         p<sub>T</sub> is left un-flagged.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class LUTBEOverlapCalculator : public LUTOverlapCalculatorBase {
-
-   public:
-      /// Default constructor
-      LUTBEOverlapCalculator();
-      /// Copy constructor
-      LUTBEOverlapCalculator( const LUTBEOverlapCalculator& calc );
-      LUTBEOverlapCalculator  & operator = ( const LUTBEOverlapCalculator  & ) = delete;
-
-      /// Function initializing the calculator object
-     virtual StatusCode initialize( const xercesc::DOMNode* benode, bool dumpLut,const std::string& runPeriod );
-
-      /// Calculate the overlap flags for two barrel sectors
-      void calculate( const BarrelSector& bsector, const EndcapSector& esector ) const;
-
-   private:
-      //
-      // The LUT words take the form:
-      //
-      // variable  | EQ |                 ERoI                  |      BPt     |          BRoI          |
-      //      bit  | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 |  9 |  8 |  7 |  6 |  5 |  4 |  3 |  2 |  1 |
-
-   }; // class LUTBEOverlapCalculator
-
-} // namespac LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_LUTBEOVERLAPCALCULATOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.cxx
deleted file mode 100644
index 812c668ee60a..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.cxx
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTEEOverlapCalculator.cxx 650693 2015-03-01 16:53:48Z masato $
-
-// STL include(s):
-#include <sstream>
-#include <iomanip>
-
-// XercesC include(s):
-#include <xercesc/dom/DOMElement.hpp>
-#include <xercesc/dom/DOMNodeList.hpp>
-#include <xercesc/util/XMLString.hpp>
-
-// Local include(s):
-#include "LUTEEOverlapCalculator.h"
-#include "EndcapSector.h"
-#include "../Common/PtMultiplicitySet.h"
-
-namespace LVL1MUCTPI {
-
-   LUTEEOverlapCalculator::LUTEEOverlapCalculator()
-      : LUTOverlapCalculatorBase( "LUTEEOverlapCalculator" ) {
-
-   }
-
-   LUTEEOverlapCalculator::LUTEEOverlapCalculator( const LUTEEOverlapCalculator& calc )
-      : LUTOverlapCalculatorBase( calc ) {
-
-   }
-
-   StatusCode LUTEEOverlapCalculator::initialize( const xercesc::DOMNode* eenode,
-                                                  bool dumpLut, const std::string& runPeriod ) {
-
-     if( runPeriod == "RUN2" ){
-       setMaximumThreshold( 6 );
-       REPORT_VERBOSE_MSG( "RunPeriod=" << runPeriod << " setMaximumThreshold to 6" );
-     }
-
-      // Clear the internal LUT:
-      m_lut.clear();
-
-      //
-      // Check if the received node is of the right type:
-      //
-      if( eenode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) {
-         REPORT_ERROR_MSG( "Received node is not a DOMElement" );
-         return StatusCode::RECOVERABLE;
-      }
-
-      REPORT_VERBOSE_MSG( "Looping over \"EEElement\"-s:" );
-
-      //
-      // Initialize the E-E LUT:
-      //
-      const xercesc::DOMNodeList* lut_lines = eenode->getChildNodes();
-      for( XMLSize_t i = 0; i < lut_lines->getLength(); ++i ) {
-
-         const xercesc::DOMNode* lut_line = lut_lines->item( i );
-
-         char* cname = xercesc::XMLString::transcode( lut_line->getNodeName() );
-         std::string sname( cname );
-         xercesc::XMLString::release( &cname );
-
-         if( sname != "EEElement" ) continue;
-
-         const xercesc::DOMElement* lut_element =
-            dynamic_cast< const xercesc::DOMElement* >( lut_line );
-         if( ! lut_element ) {
-            REPORT_ERROR_MSG( "Unable to cast LUT node into DOMElement" );
-            return StatusCode::RECOVERABLE;
-         }
-
-         XMLCh* roi1_name = xercesc::XMLString::transcode( "RoI1" );
-         XMLCh* roi2_name = xercesc::XMLString::transcode( "RoI2" );
-
-         const XMLCh* roi1 = lut_element->getAttribute( roi1_name );
-         const XMLCh* roi2 = lut_element->getAttribute( roi2_name );
-
-         xercesc::XMLString::release( &roi1_name );
-         xercesc::XMLString::release( &roi2_name );
-
-         const unsigned int roi1_n = xercesc::XMLString::parseInt( roi1 );
-         const unsigned int roi2_n = xercesc::XMLString::parseInt( roi2 );
-
-         //
-         // Create the word to be put into the LUT:
-         //
-         const unsigned int element = ( roi1_n & 0xff ) | ( ( roi2_n & 0xff ) << 8 );
-
-         m_lut[ element ] = true;
-
-         if( dumpLut ) {
-            REPORT_VERBOSE_MSG( "  --> RoI1: " << roi1_n << " RoI2: " << roi2_n
-                                << " Element: 0x" << std::hex << std::setw( 4 )
-                                << std::setfill( '0' ) << element << std::dec );
-         }
-      }
-
-      REPORT_VERBOSE_MSG( "Number of LUT elements: " << m_lut.size() );
-
-      return StatusCode::SUCCESS;
-   }
-
-   void LUTEEOverlapCalculator::calculate( const EndcapSector& sector1,
-                                           const EndcapSector& sector2 ) const {
-
-      //
-      // Calculate some helper quantities:
-      //
-      bool sec1cand1present = false, sec1cand2present = false;
-      bool sec2cand1present = false, sec2cand2present = false;
-      int sec1cand1pt = -1, sec1cand2pt = -1;
-      int sec2cand1pt = -1, sec2cand2pt = -1;
-      if( sector1.getPtCand1() != 7 ) {
-         sec1cand1present = true;
-         sec1cand1pt = sector1.getPtCand1();
-      }
-      if( sector1.getPtCand2() != 7 ) {
-         sec1cand2present = true;
-         sec1cand2pt = sector1.getPtCand2();
-      }
-      if( sector2.getPtCand1() != 7 ) {
-         sec2cand1present = true;
-         sec2cand1pt = sector2.getPtCand1();
-      }
-      if( sector2.getPtCand2() != 7 ) {
-         sec2cand2present = true;
-         sec2cand2pt = sector2.getPtCand2();
-      }
-
-      //
-      // Find if a rule exists for sec1 cand1 and sec2 cand1:
-      //
-      unsigned int element = ( sector1.getROI1() & 0xff ) |
-         ( ( sector2.getROI1() & 0xff ) << 8 );
-      if( sec1cand1present && sec2cand1present &&
-          ( sec1cand1pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand1pt < sec2cand1pt ) {
-                  sector1.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << sector1.getSectorNumber()
-                                      << " in the " << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << sector2.getSectorNumber()
-                                      << " in the " << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for sec1 cand2 and sec2 cand1:
-      //
-      element = ( sector1.getROI2() & 0xff ) |
-         ( ( sector2.getROI1() & 0xff ) << 8 );
-      if( sec1cand2present && sec2cand1present &&
-          ( sec1cand2pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand2pt < sec2cand1pt ) {
-                  sector1.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << sector1.getSectorNumber()
-                                      << " in the " << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << sector2.getSectorNumber()
-                                      << " in the " << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for sec1 cand1 and sec2 cand2:
-      //
-      element = ( sector1.getROI1() & 0xff ) |
-         ( ( sector2.getROI2() & 0xff ) << 8 );
-      if( sec1cand1present && sec2cand2present &&
-          ( sec1cand1pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand1pt < sec2cand2pt ) {
-                  sector1.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector " << sector1.getSectorNumber()
-                                      << " in the " << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << sector2.getSectorNumber()
-                                      << " in the " << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for sec1 cand2 and sec2 cand2:
-      //
-      element = ( sector1.getROI2() & 0xff ) |
-         ( ( sector2.getROI2() & 0xff ) << 8 );
-      if( sec1cand2present && sec2cand2present &&
-          ( sec1cand2pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand2pt < sec2cand2pt ) {
-                  sector1.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << sector1.getSectorNumber()
-                                      << " in the " << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector " << sector2.getSectorNumber()
-                                      << " in the " << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.h
deleted file mode 100644
index 246c7dc79618..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEEOverlapCalculator.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTEEOverlapCalculator.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_LUTEEOVERLAPCALCULATOR_H
-#define TRIGT1MUCTPI_LUTEEOVERLAPCALCULATOR_H
-
-// Local include(s):
-#include "LUTOverlapCalculatorBase.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class EndcapSector;
-
-   /**
-    *  @short Class flagging endcap muon candidates for fake double-counts
-    *
-    *         This class can be used to flag the one of the muon candidates in
-    *         an overlapping endcap sector pair if they are believed to be coming
-    *         from the same muon. The muon with the higher p<sub>T</sub> is left
-    *         un-flagged.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class LUTEEOverlapCalculator : public LUTOverlapCalculatorBase {
-
-   public:
-      /// Default constructor
-      LUTEEOverlapCalculator();
-      /// Copy constructor
-      LUTEEOverlapCalculator( const LUTEEOverlapCalculator& calc );
-      LUTEEOverlapCalculator  & operator = ( const LUTEEOverlapCalculator  & ) = delete;
-
-      /// Function initializing the calculator object
-     virtual StatusCode initialize( const xercesc::DOMNode* eenode, bool dumpLut,const std::string& runPeriod );
-
-      /// Calculate the overlap flags for two endcap sectors
-      void calculate( const EndcapSector& sector1, const EndcapSector& sector2 ) const;
-
-   private:
-      //
-      // The LUT words take the form:
-      //
-      // variable  |                  RoI2                 |                  RoI1                 |
-      //      bit  | 16 | 15 | 14 | 13 | 12 | 11 | 10 |  9 |  8 |  7 |  6 |  5 |  4 |  3 |  2 |  1 |
-
-   }; // class LUTEEOverlapCalculator
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_LUTEEOVERLAPCALCULATOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.cxx
deleted file mode 100644
index 66a40c20b4d1..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.cxx
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTEFOverlapCalculator.cxx 650693 2015-03-01 16:53:48Z masato $
-
-// STL include(s):
-#include <string>
-#include <iomanip>
-
-// XercesC include(s):
-#include <xercesc/dom/DOMElement.hpp>
-#include <xercesc/dom/DOMNodeList.hpp>
-#include <xercesc/util/XMLString.hpp>
-
-// Local include(s):
-#include "LUTEFOverlapCalculator.h"
-#include "EndcapSector.h"
-#include "ForwardSector.h"
-
-namespace LVL1MUCTPI {
-
-   LUTEFOverlapCalculator::LUTEFOverlapCalculator()
-      : LUTOverlapCalculatorBase( "LUTEFOverlapCalculator" ) {
-
-   }
-
-   LUTEFOverlapCalculator::LUTEFOverlapCalculator( const LUTEFOverlapCalculator& calc )
-      : LUTOverlapCalculatorBase( calc ) {
-
-   }
-
-   /**
-    * @param node One of the EF nodes of the XML file
-    * @param dumpLut Print the LUT while reading it
-    */
-  StatusCode LUTEFOverlapCalculator::initialize( const xercesc::DOMNode* bbnode, bool dumpLut, const std::string& runPeriod ) {
-
-     if( runPeriod == "RUN2" ){
-       setMaximumThreshold( 6 );
-       REPORT_VERBOSE_MSG( "RunPeriod=" << runPeriod << " setMaximumThreshold to 6" );
-     }
-
-      // Clear the internal LUT:
-      m_lut.clear();
-
-      //
-      // Check if the received node is of the right type:
-      //
-      if( bbnode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) {
-         REPORT_ERROR_MSG( "Received node is not a DOMElement" );
-         return StatusCode::RECOVERABLE;
-      }
-
-      REPORT_VERBOSE_MSG( "Looping over \"EFElement\"-s:" );
-
-      const xercesc::DOMNodeList* lut_def_list = bbnode->getChildNodes();
-      for( XMLSize_t i = 0; i < lut_def_list->getLength(); ++i ) {
-
-         const xercesc::DOMNode* lut_node = lut_def_list->item( i );
-         char* cname = xercesc::XMLString::transcode( lut_node->getNodeName() );
-         std::string sname( cname );
-         xercesc::XMLString::release( &cname );
-
-         if( sname != "EFElement" ) continue;
-
-         const xercesc::DOMElement* lut_element =
-            dynamic_cast< const xercesc::DOMElement* >( lut_node );
-         if( ! lut_element ) {
-            REPORT_ERROR_MSG( "Unable to cast LUT node into DOMElement" );
-            return StatusCode::RECOVERABLE;
-         }
-
-         XMLCh* eroi_name  = xercesc::XMLString::transcode( "ERoI" );
-         XMLCh* froi_name  = xercesc::XMLString::transcode( "FRoI" );
-
-         const XMLCh* eroi  = lut_element->getAttribute( eroi_name );
-         const XMLCh* froi  = lut_element->getAttribute( froi_name );
-
-         xercesc::XMLString::release( &eroi_name );
-         xercesc::XMLString::release( &froi_name );
-
-         const int eroi_n   = xercesc::XMLString::parseInt( eroi );
-         const int froi_n   = xercesc::XMLString::parseInt( froi );
-
-         //
-         // Create the word to be put into the LUT:
-         //
-         const unsigned int element = ( eroi_n & 0xff ) | ( ( froi_n & 0x3f ) << 8 );
-
-         m_lut[ element ] = true;
-
-         if( dumpLut ) {
-            REPORT_VERBOSE_MSG( "  --> ERoI: " << eroi_n << " FRoI: " << froi_n
-                                << " Element: 0x" << std::hex << std::setw( 4 )
-                                << std::setfill( '0' ) << element << std::dec );
-         }
-      }
-
-      REPORT_VERBOSE_MSG( "Number of LUT elements: " << m_lut.size() );
-
-      return StatusCode::SUCCESS;
-   }
-
-   void LUTEFOverlapCalculator::calculate( const EndcapSector& esec,
-                                           const ForwardSector& fsec ) const {
-
-      //
-      // Calculate some helper quantities:
-      //
-      bool eseccand1present = false, eseccand2present = false;
-      bool fseccand1present = false, fseccand2present = false;
-      int eseccand1pt = -1, eseccand2pt = -1;
-      int fseccand1pt = -1, fseccand2pt = -1;
-      if( esec.getPtCand1() != 7 ) {
-         eseccand1present = true;
-         eseccand1pt = esec.getPtCand1();
-      }
-      if( esec.getPtCand2() != 7 ) {
-         eseccand2present = true;
-         eseccand2pt = esec.getPtCand2();
-      }
-      if( fsec.getPtCand1() != 7 ) {
-         fseccand1present = true;
-         fseccand1pt = fsec.getPtCand1();
-      }
-      if( fsec.getPtCand2() != 7 ) {
-         fseccand2present = true;
-         fseccand2pt = fsec.getPtCand2();
-      }
-
-      //
-      // Find if a rule exists for esec cand1 and fsec cand1:
-      //
-      unsigned int element = ( esec.getROI1() & 0xff ) | ( ( fsec.getROI1() & 0x3f ) << 8 );
-      if( eseccand1present && fseccand1present &&
-          ( eseccand1pt <= m_thr ) && ( fseccand1pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( eseccand1pt < fseccand1pt ) {
-                  esec.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector "
-                                      << esec.getSectorNumber() << " in the "
-                                      << esec.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  fsec.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector "
-                                      << fsec.getSectorNumber() << " in the "
-                                      << fsec.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for esec cand2 and fsec cand1:
-      //
-      element = ( esec.getROI2() & 0xff ) | ( ( fsec.getROI1() & 0x3f ) << 8 );
-      if( eseccand2present && fseccand1present &&
-          ( eseccand2pt <= m_thr ) && ( fseccand1pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( eseccand2pt < fseccand1pt ) {
-                  esec.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector "
-                                      << esec.getSectorNumber() << " in the "
-                                      << esec.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  fsec.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector "
-                                      << fsec.getSectorNumber() << " in the "
-                                      << fsec.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for esec cand1 and fsec cand2:
-      //
-      element = ( esec.getROI1() & 0xff ) | ( ( fsec.getROI2() & 0x3f ) << 8 );
-      if( eseccand1present && fseccand2present &&
-          ( eseccand1pt <= m_thr ) && ( fseccand2pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( eseccand1pt < fseccand2pt ) {
-                  esec.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Endcap sector "
-                                      << esec.getSectorNumber() << " in the "
-                                      << esec.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  fsec.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector "
-                                      << fsec.getSectorNumber() << " in the "
-                                      << fsec.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for esec cand2 and fsec cand2:
-      //
-      element = ( esec.getROI2() & 0xff ) | ( ( fsec.getROI2() & 0x3f ) << 8 );
-      if( eseccand2present && fseccand2present &&
-          ( eseccand2pt <= m_thr ) && ( fseccand2pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( eseccand2pt < fseccand2pt ) {
-                  esec.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Endcap sector "
-                                      << esec.getSectorNumber() << " in the "
-                                      << esec.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  fsec.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector "
-                                      << fsec.getSectorNumber() << " in the "
-                                      << fsec.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.h
deleted file mode 100644
index 20fee67d5864..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTEFOverlapCalculator.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTEFOverlapCalculator.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_LUTEFOVERLAPCALCULATOR_H
-#define TRIGT1MUCTPI_LUTEFOVERLAPCALCULATOR_H
-
-// Local include(s):
-#include "LUTOverlapCalculatorBase.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class EndcapSector;
-   class ForwardSector;
-
-   /**
-    *  @short Class flagging candidates for endcap-forward overlaps
-    *
-    *         This is one of the end-classes of the new LUT overlap handling. It can be
-    *         initialized by passing the correct DOMNode to it in it's initialize method.
-    *         When two candidates are given to it, it can flag one of them to be
-    *         supressed in the multiplicity count.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class LUTEFOverlapCalculator : public LUTOverlapCalculatorBase {
-
-   public:
-      /// Default constructor
-      LUTEFOverlapCalculator();
-      /// Copy constructor
-      LUTEFOverlapCalculator( const LUTEFOverlapCalculator& calc );
-      LUTEFOverlapCalculator  & operator = ( const LUTEFOverlapCalculator  & ) = delete;
-
-      /// Function initializing the calculator object
-     virtual StatusCode initialize( const xercesc::DOMNode* bbnode, bool dumpLut,const std::string& runPeriod );
-
-      /// Calculate the overlap flags for two barrel sectors
-      void calculate( const EndcapSector& esec, const ForwardSector& fsec ) const;
-
-   private:
-      //
-      // The LUT words take the form:
-      //
-      // variable  |            FRoI             |                  ERoI                 |
-      //      bit  | 14 | 13 | 12 | 11 | 10 |  9 |  8 |  7 |  6 |  5 |  4 |  3 |  2 |  1 |
-
-   }; // class LUTEFOverlapCalculator
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_LUTEFOVERLAPCALCULATOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.cxx
deleted file mode 100644
index 049f710c0f42..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.cxx
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTFFOverlapCalculator.cxx 650693 2015-03-01 16:53:48Z masato $
-
-// STL include(s):
-#include <sstream>
-#include <string>
-#include <iomanip>
-
-// XercesC include(s):
-#include <xercesc/dom/DOMElement.hpp>
-#include <xercesc/dom/DOMNodeList.hpp>
-#include <xercesc/util/XMLString.hpp>
-
-// Local include(s):
-#include "LUTFFOverlapCalculator.h"
-#include "ForwardSector.h"
-#include "../Common/PtMultiplicitySet.h"
-
-namespace LVL1MUCTPI {
-
-   LUTFFOverlapCalculator::LUTFFOverlapCalculator()
-      : LUTOverlapCalculatorBase( "LUTFFOverlapCalculator" ) {
-
-   }
-
-   LUTFFOverlapCalculator::LUTFFOverlapCalculator( const LUTFFOverlapCalculator& calc )
-      : LUTOverlapCalculatorBase( calc ) {
-
-   }
-
-  StatusCode LUTFFOverlapCalculator::initialize( const xercesc::DOMNode* ffnode, bool dumpLut, const std::string& runPeriod ) {
-
-     if( runPeriod == "RUN2" ){
-       setMaximumThreshold( 6 );
-       REPORT_VERBOSE_MSG( "RunPeriod=" << runPeriod << " setMaximumThreshold to 6" );
-     }
-
-      // Clear the internal LUT:
-      m_lut.clear();
-
-      //
-      // Check if the received node is of the right type:
-      //
-      if( ffnode->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) {
-         REPORT_ERROR_MSG( "Received node is not a DOMElement" );
-         return StatusCode::RECOVERABLE;
-      }
-
-      REPORT_VERBOSE_MSG( "Looping over \"FFElement\"-s:" );
-
-      //
-      // Initialize the F-F LUT:
-      //
-      const xercesc::DOMNodeList* element_list = ffnode->getChildNodes();
-      for( XMLSize_t i = 0; i < element_list->getLength(); ++i ) {
-
-         const xercesc::DOMNode* lut_node = element_list->item( i );
-         char* cname = xercesc::XMLString::transcode( lut_node->getNodeName() );
-         std::string sname( cname );
-         xercesc::XMLString::release( &cname );
-
-         if( sname != "FFElement" ) continue;
-
-         const xercesc::DOMElement* lut_element =
-            dynamic_cast< const xercesc::DOMElement* >( lut_node );
-         if( ! lut_element ) {
-            REPORT_ERROR_MSG( "Unable to cast FFElement node into DOMElement" );
-            return StatusCode::RECOVERABLE;
-         }
-
-         XMLCh* roi1_name = xercesc::XMLString::transcode( "RoI1" );
-         XMLCh* roi2_name = xercesc::XMLString::transcode( "RoI2" );
-
-         const XMLCh* roi1 = lut_element->getAttribute( roi1_name );
-         const XMLCh* roi2 = lut_element->getAttribute( roi2_name );
-
-         xercesc::XMLString::release( &roi1_name );
-         xercesc::XMLString::release( &roi2_name );
-
-         const int roi1_n = xercesc::XMLString::parseInt( roi1 );
-         const int roi2_n = xercesc::XMLString::parseInt( roi2 );
-
-         //
-         // Create the word to be put into the LUT:
-         //
-         const unsigned int element = ( roi1_n & 0x3f ) | ( ( roi2_n & 0x3f ) << 6 );
-
-         m_lut[ element ] = true;
-
-         if( dumpLut ) {
-            REPORT_VERBOSE_MSG( "  --> RoI1: " << roi1_n << " RoI2: " << roi2_n
-                                << " Element: 0x" << std::hex << std::setw( 3 )
-                                << std::setfill( '0' ) << element << std::dec );
-         }
-
-      }
-
-      REPORT_VERBOSE_MSG( "Number of LUT elements: " << m_lut.size() );
-
-      return StatusCode::SUCCESS;
-   }
-
-   void LUTFFOverlapCalculator::calculate( const ForwardSector& sector1,
-                                           const ForwardSector& sector2 ) const {
-
-      //
-      // Calculate some helper quantities:
-      //
-      bool sec1cand1present = false, sec1cand2present = false;
-      bool sec2cand1present = false, sec2cand2present = false;
-      int sec1cand1pt = -1, sec1cand2pt = -1;
-      int sec2cand1pt = -1, sec2cand2pt = -1;
-      if( sector1.getPtCand1() != 7 ) {
-         sec1cand1present = true;
-         sec1cand1pt = sector1.getPtCand1();
-      }
-      if( sector1.getPtCand2() != 7 ) {
-         sec1cand2present = true;
-         sec1cand2pt = sector1.getPtCand2();
-      }
-      if( sector2.getPtCand1() != 7 ) {
-         sec2cand1present = true;
-         sec2cand1pt = sector2.getPtCand1();
-      }
-      if( sector2.getPtCand2() != 7 ) {
-         sec2cand2present = true;
-         sec2cand2pt = sector2.getPtCand2();
-      }
-
-      //
-      // Find if a rule exists for sec1 cand1 and sec2 cand1:
-      //
-      unsigned int element = ( sector1.getROI1() & 0x3f ) |
-         ( ( sector2.getROI1() & 0x3f ) << 6 );
-      if( sec1cand1present && sec2cand1present &&
-          ( sec1cand1pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand1pt < sec2cand1pt ) {
-                  sector1.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector " << sector1.getSectorNumber()
-                                      << " in the " << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector " << sector2.getSectorNumber()
-                                      << " in the " << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for sec1 cand2 and sec2 cand1:
-      //
-      element = ( sector1.getROI2() & 0x3f ) | ( ( sector2.getROI1() & 0x3f ) << 6 );
-      if( sec1cand2present && sec2cand1present &&
-          ( sec1cand2pt <= m_thr ) && ( sec2cand1pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand2pt < sec2cand1pt ) {
-                  sector1.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector " << sector1.getSectorNumber()
-                                      << " in the " << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector " << sector2.getSectorNumber()
-                                      << " in the " << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for sec1 cand1 and sec2 cand2:
-      //
-      element = ( sector1.getROI1() & 0x3f ) | ( ( sector2.getROI2() & 0x3f ) << 6 );
-      if( sec1cand1present && sec2cand2present &&
-          ( sec1cand1pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand1pt < sec2cand2pt ) {
-                  sector1.setCand1Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 1 in Forward sector " << sector1.getSectorNumber()
-                                      << " in the " << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector " << sector2.getSectorNumber()
-                                      << " in the " << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      //
-      // Find if a rule exists for sec1 cand2 and sec2 cand2:
-      //
-      element = ( sector1.getROI2() & 0x3f ) | ( ( sector2.getROI2() & 0x3f ) << 6 );
-      if( sec1cand2present && sec2cand2present &&
-          ( sec1cand2pt <= m_thr ) && ( sec2cand2pt <= m_thr ) ) {
-         std::map< unsigned int, bool >::const_iterator it;
-         if( ( it = m_lut.find( element ) ) != m_lut.end() ) {
-            if( it->second ) {
-               if( sec1cand2pt < sec2cand2pt ) {
-                  sector1.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector " << sector1.getSectorNumber()
-                                      << " in the " << sector1.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               } else {
-                  sector2.setCand2Supressed( true );
-#ifndef NDEBUG
-                  REPORT_VERBOSE_MSG( "Candidate 2 in Forward sector " << sector2.getSectorNumber()
-                                      << " in the " << sector2.getRapidityString()
-                                      << " rapidity region supressed" );
-#endif // NDEBUG
-               }
-            }
-         }
-      }
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.h
deleted file mode 100644
index e7a4f4730a5b..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTFFOverlapCalculator.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTFFOverlapCalculator.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_LUTFFOVERLAPCALCULATOR_H
-#define TRIGT1MUCTPI_LUTFFOVERLAPCALCULATOR_H
-
-// Local include(s):
-#include "LUTOverlapCalculatorBase.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class ForwardSector;
-
-   /**
-    *  @short Class flagging forward muon candidates for fake double-counts
-    *
-    *         This class can be used to flag the one of the muon candidates in
-    *         an overlapping forward sector pair if they are believed to be coming
-    *         from the same muon. The muon with the higher p<sub>T</sub> is left
-    *         un-flagged.
-    *
-    * @author Attila Krasznahorkay Jr.
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class LUTFFOverlapCalculator : public LUTOverlapCalculatorBase {
-
-   public:
-      /// Default constructor
-      LUTFFOverlapCalculator();
-      /// Copy constructor
-      LUTFFOverlapCalculator( const LUTFFOverlapCalculator& calc );
-      LUTFFOverlapCalculator  & operator = ( const LUTFFOverlapCalculator  & ) = delete;
-
-      /// Function initializing the calculator object
-     virtual StatusCode initialize( const xercesc::DOMNode* ffnode, bool dumpLut,const std::string& runPeriod );
-
-      /// Calculate the overlap flags for two barrel sectors
-      void calculate( const ForwardSector& sector1, const ForwardSector& sector2 ) const;
-
-   private:
-      //
-      // The LUT words take the form:
-      //
-      // variable  |             RoI2            |             RoI1            |
-      //      bit  | 12 | 11 | 10 |  9 |  8 |  7 |  6 |  5 |  4 |  3 |  2 |  1 |
-
-   }; // class LUTFFOverlapCalculator
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_LUTFFOVERLAPCALCULATOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.cxx
deleted file mode 100644
index 52ea42ae88dc..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.cxx
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTMultiplicityCalculator.cxx 650693 2015-03-01 16:53:48Z masato $
-
-// STL include(s):
-#include <sstream>
-
-// XercesC include(s):
-#include <xercesc/dom/DOMElement.hpp>
-#include <xercesc/dom/DOMNodeList.hpp>
-#include <xercesc/util/XMLString.hpp>
-
-// Gaudi/Athena include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// Local include(s):
-#include "LUTMultiplicityCalculator.h"
-#include "MioctSectorSet.h"
-#include "MultiplicityLogic.h"
-
-namespace LVL1MUCTPI {
-
-   LUTMultiplicityCalculator::LUTMultiplicityCalculator( const MultiplicityLogic* logic )
-      : m_logger( "LUTMultiplicityCalculator" ), m_multiplicityLogic( logic ),
-        m_flagMode( false ) {
-
-   }
-
-   LUTMultiplicityCalculator::LUTMultiplicityCalculator( const LUTMultiplicityCalculator& calc )
-      : m_logger( calc.m_logger ),
-        m_multiplicityLogic( calc.m_multiplicityLogic ), m_flagMode( calc.m_flagMode ),
-        m_bb_calc_1( calc.m_bb_calc_1 ),
-        m_bb_calc_2( calc.m_bb_calc_2 ), m_ee_calc_1( calc.m_ee_calc_1 ),
-        m_ee_calc_2( calc.m_ee_calc_2 ), m_ee_calc_3( calc.m_ee_calc_3 ),
-        m_ee_calc_4( calc.m_ee_calc_4 ), m_ee_calc_5( calc.m_ee_calc_5 ),
-        m_ff_calc_1( calc.m_ff_calc_1 ), m_ff_calc_2( calc.m_ff_calc_2 ),
-        m_be_calc_11( calc.m_be_calc_11 ), m_be_calc_12( calc.m_be_calc_12 ),
-        m_be_calc_22( calc.m_be_calc_22 ), m_be_calc_23( calc.m_be_calc_23 ),
-        m_be_calc_34( calc.m_be_calc_34 ), m_be_calc_35( calc.m_be_calc_35 ),
-        m_be_calc_45( calc.m_be_calc_45 ), m_be_calc_46( calc.m_be_calc_46 ),
-        m_ef_calc_21( calc.m_ef_calc_21 ), m_ef_calc_31( calc.m_ef_calc_31 ),
-        m_ef_calc_42( calc.m_ef_calc_42 ), m_ef_calc_52( calc.m_ef_calc_52 ),
-        m_ef_calc_63( calc.m_ef_calc_63 ) {
-
-   }
-
-   StatusCode LUTMultiplicityCalculator::initialize( const xercesc::DOMNode* node, bool flagMode,
-                                                     bool dumpLut,const std::string& runPeriod ) {
-
-      //
-      // Remember which mode was requested:
-      //
-      m_flagMode = flagMode;
-
-      //
-      // Check if the received node "makes sense":
-      //
-      if( node->getNodeType() != xercesc::DOMNode::ELEMENT_NODE ) {
-         REPORT_ERROR_MSG( "Received node is not a DOMElement" );
-         return StatusCode::RECOVERABLE;
-      }
-
-      //
-      // Loop over all the nodes in this XML node:
-      //
-      const xercesc::DOMNodeList* lut_node_list = node->getChildNodes();
-      for( XMLSize_t i = 0; i < lut_node_list->getLength(); ++i ) {
-
-         const xercesc::DOMNode* lut_node = lut_node_list->item( i );
-         char* cname = xercesc::XMLString::transcode( lut_node->getNodeName() );
-         std::string sname( cname );
-         xercesc::XMLString::release( &cname );
-
-         if     ( sname == "BB1LUT" )  CHECK( m_bb_calc_1.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "BB2LUT" )  CHECK( m_bb_calc_2.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "EE1LUT" )  CHECK( m_ee_calc_1.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "EE2LUT" )  CHECK( m_ee_calc_2.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "EE3LUT" )  CHECK( m_ee_calc_3.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "EE4LUT" )  CHECK( m_ee_calc_4.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "EE5LUT" )  CHECK( m_ee_calc_5.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "FF1LUT" )  CHECK( m_ff_calc_1.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "FF2LUT" )  CHECK( m_ff_calc_2.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "BE11LUT" ) CHECK( m_be_calc_11.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "BE12LUT" ) CHECK( m_be_calc_12.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "BE22LUT" ) CHECK( m_be_calc_22.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "BE23LUT" ) CHECK( m_be_calc_23.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "BE34LUT" ) CHECK( m_be_calc_34.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "BE35LUT" ) CHECK( m_be_calc_35.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "BE45LUT" ) CHECK( m_be_calc_45.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "BE46LUT" ) CHECK( m_be_calc_46.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "EF21LUT" ) CHECK( m_ef_calc_21.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "EF31LUT" ) CHECK( m_ef_calc_31.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "EF42LUT" ) CHECK( m_ef_calc_42.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "EF52LUT" ) CHECK( m_ef_calc_52.initialize( lut_node, dumpLut, runPeriod ) );
-         else if( sname == "EF63LUT" ) CHECK( m_ef_calc_63.initialize( lut_node, dumpLut, runPeriod ) );
-
-      }
-
-      return StatusCode::SUCCESS;
-   }
-
-   PtMultiplicitySet
-   LUTMultiplicityCalculator::calculateMultiplicity( const MioctSectorSet& data ) const {
-
-      //
-      // Let's make sure that all the suppression flags are off as a start:
-      //
-      data.Barrel1.setCand1Supressed( false ); data.Barrel1.setCand2Supressed( false );
-      data.Barrel2.setCand1Supressed( false ); data.Barrel2.setCand2Supressed( false );
-      data.Barrel3.setCand1Supressed( false ); data.Barrel3.setCand2Supressed( false );
-      data.Barrel4.setCand1Supressed( false ); data.Barrel4.setCand2Supressed( false );
-      data.Endcap1.setCand1Supressed( false ); data.Endcap1.setCand2Supressed( false );
-      data.Endcap2.setCand1Supressed( false ); data.Endcap2.setCand2Supressed( false );
-      data.Endcap3.setCand1Supressed( false ); data.Endcap3.setCand2Supressed( false );
-      data.Endcap4.setCand1Supressed( false ); data.Endcap4.setCand2Supressed( false );
-      data.Endcap5.setCand1Supressed( false ); data.Endcap5.setCand2Supressed( false );
-      data.Endcap6.setCand1Supressed( false ); data.Endcap6.setCand2Supressed( false );
-      data.Forward1.setCand1Supressed( false ); data.Forward1.setCand2Supressed( false );
-      data.Forward2.setCand1Supressed( false ); data.Forward2.setCand2Supressed( false );
-      data.Forward3.setCand1Supressed( false ); data.Forward3.setCand2Supressed( false );
-
-      PtMultiplicitySet result;
-
-      //////////////////////////////////////////////////////////////////////////////////////////
-      //                                                                                      //
-      //       Flag the candidates which should be suppressed in the multiplicity count       //
-      //                                                                                      //
-      //////////////////////////////////////////////////////////////////////////////////////////
-
-      //
-      // Flag barrel-barrel overlaps:
-      //
-      m_bb_calc_1.calculate( data.Barrel1, data.Barrel2 );
-      m_bb_calc_2.calculate( data.Barrel3, data.Barrel4 );
-
-      //
-      // Flag endcap-endcap overlaps:
-      //
-      m_ee_calc_1.calculate( data.Endcap1, data.Endcap2 );
-      m_ee_calc_2.calculate( data.Endcap2, data.Endcap3 );
-      m_ee_calc_3.calculate( data.Endcap3, data.Endcap4 );
-      m_ee_calc_4.calculate( data.Endcap4, data.Endcap5 );
-      m_ee_calc_5.calculate( data.Endcap5, data.Endcap6 );
-
-      //
-      // Flag forward-forward overlaps:
-      //
-      m_ff_calc_1.calculate( data.Forward1, data.Forward2 );
-      m_ff_calc_2.calculate( data.Forward2, data.Forward3 );
-
-      //
-      // Flag barrel-endcap overlaps:
-      //
-      m_be_calc_11.calculate( data.Barrel1, data.Endcap1 );
-      m_be_calc_12.calculate( data.Barrel1, data.Endcap2 );
-      m_be_calc_22.calculate( data.Barrel2, data.Endcap2 );
-      m_be_calc_23.calculate( data.Barrel2, data.Endcap3 );
-      m_be_calc_34.calculate( data.Barrel3, data.Endcap4 );
-      m_be_calc_35.calculate( data.Barrel3, data.Endcap5 );
-      m_be_calc_45.calculate( data.Barrel4, data.Endcap5 );
-      m_be_calc_46.calculate( data.Barrel4, data.Endcap6 );
-
-      //
-      // Flag endcap-forward overlaps:
-      //
-      m_ef_calc_21.calculate( data.Endcap2, data.Forward1 );
-      m_ef_calc_31.calculate( data.Endcap3, data.Forward1 );
-      m_ef_calc_42.calculate( data.Endcap4, data.Forward2 );
-      m_ef_calc_52.calculate( data.Endcap5, data.Forward2 );
-      m_ef_calc_63.calculate( data.Endcap6, data.Forward3 );
-
-      //////////////////////////////////////////////////////////////////////////////////////////
-      //                                                                                      //
-      //               Calculate candidate multiplicity after overlap removal                 //
-      //                                                                                      //
-      //////////////////////////////////////////////////////////////////////////////////////////
-
-      //
-      // Add the unsupressed barrel candidates:
-      //
-      if( ( ! data.Barrel1.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Barrel1.getPtCand1(),
-                                                               data.Barrel1.getSectorID(),
-                                                               true );
-      if( ( ! data.Barrel1.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Barrel1.getPtCand2(),
-                                                               data.Barrel1.getSectorID(),
-                                                               false );
-      if( ( ! data.Barrel2.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Barrel2.getPtCand1(),
-                                                               data.Barrel2.getSectorID(),
-                                                               true );
-      if( ( ! data.Barrel2.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Barrel2.getPtCand2(),
-                                                               data.Barrel2.getSectorID(),
-                                                               false );
-      if( ( ! data.Barrel3.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Barrel3.getPtCand1(),
-                                                               data.Barrel3.getSectorID(),
-                                                               true );
-      if( ( ! data.Barrel3.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Barrel3.getPtCand2(),
-                                                               data.Barrel3.getSectorID(),
-                                                               false );
-      if( ( ! data.Barrel4.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Barrel4.getPtCand1(),
-                                                               data.Barrel4.getSectorID(),
-                                                               true );
-      if( ( ! data.Barrel4.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Barrel4.getPtCand2(),
-                                                               data.Barrel4.getSectorID(),
-                                                               false );
-
-      //
-      // Add the unsupressed endcap candidates:
-      //
-      if( ( ! data.Endcap1.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap1.getPtCand1(),
-                                                               data.Endcap1.getSectorID(),
-                                                               true );
-      if( ( ! data.Endcap1.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap1.getPtCand2(),
-                                                               data.Endcap1.getSectorID(),
-                                                               false );
-      if( ( ! data.Endcap2.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap2.getPtCand1(),
-                                                               data.Endcap2.getSectorID(),
-                                                               true );
-      if( ( ! data.Endcap2.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap2.getPtCand2(),
-                                                               data.Endcap2.getSectorID(),
-                                                               false );
-      if( ( ! data.Endcap3.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap3.getPtCand1(),
-                                                               data.Endcap3.getSectorID(),
-                                                               true );
-      if( ( ! data.Endcap3.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap3.getPtCand2(),
-                                                               data.Endcap3.getSectorID(),
-                                                               false );
-      if( ( ! data.Endcap4.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap4.getPtCand1(),
-                                                               data.Endcap4.getSectorID(),
-                                                               true );
-      if( ( ! data.Endcap4.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap4.getPtCand2(),
-                                                               data.Endcap4.getSectorID(),
-                                                               false );
-      if( ( ! data.Endcap5.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap5.getPtCand1(),
-                                                               data.Endcap5.getSectorID(),
-                                                               true );
-      if( ( ! data.Endcap5.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap5.getPtCand2(),
-                                                               data.Endcap5.getSectorID(),
-                                                               false );
-      if( ( ! data.Endcap6.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap6.getPtCand1(),
-                                                               data.Endcap6.getSectorID(),
-                                                               true );
-      if( ( ! data.Endcap6.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Endcap6.getPtCand2(),
-                                                               data.Endcap6.getSectorID(),
-                                                               false );
-
-      //
-      // Add the unsupressed forward candidates:
-      //
-      if( ( ! data.Forward1.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Forward1.getPtCand1(),
-                                                               data.Forward1.getSectorID(),
-                                                               true );
-      if( ( ! data.Forward1.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Forward1.getPtCand2(),
-                                                               data.Forward1.getSectorID(),
-                                                               false );
-      if( ( ! data.Forward2.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Forward2.getPtCand1(),
-                                                               data.Forward2.getSectorID(),
-                                                               true );
-      if( ( ! data.Forward2.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Forward2.getPtCand2(),
-                                                               data.Forward2.getSectorID(),
-                                                               false );
-      if( ( ! data.Forward3.getCand1Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Forward3.getPtCand1(),
-                                                               data.Forward3.getSectorID(),
-                                                               true );
-      if( ( ! data.Forward3.getCand2Supressed() ) || m_flagMode )
-         result += m_multiplicityLogic->calculateMultiplicity( data.Forward3.getPtCand2(),
-                                                               data.Forward3.getSectorID(),
-                                                               false );
-
-      return result;
-   }
-
-   bool operator== ( const LUTMultiplicityCalculator& calc1,
-                     const LUTMultiplicityCalculator& calc2 ) {
-
-      if( ( calc1.m_bb_calc_1 == calc2.m_bb_calc_1 ) &&
-          ( calc1.m_bb_calc_2 == calc2.m_bb_calc_2 ) &&
-          ( calc1.m_ee_calc_1 == calc2.m_ee_calc_1 ) &&
-          ( calc1.m_ee_calc_2 == calc2.m_ee_calc_2 ) &&
-          ( calc1.m_ee_calc_3 == calc2.m_ee_calc_3 ) &&
-          ( calc1.m_ee_calc_4 == calc2.m_ee_calc_4 ) &&
-          ( calc1.m_ee_calc_5 == calc2.m_ee_calc_5 ) &&
-          ( calc1.m_ff_calc_1 == calc2.m_ff_calc_1 ) &&
-          ( calc1.m_ff_calc_2 == calc2.m_ff_calc_2 ) ) {
-
-         return true;
-      } else {
-
-         return false;
-      }
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.h
deleted file mode 100644
index 7a2b6cb84aa9..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTMultiplicityCalculator.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTMultiplicityCalculator.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_LUTMULTIPLICITYCALCULATOR_H
-#define TRIGT1MUCTPI_LUTMULTIPLICITYCALCULATOR_H
-
-// XercesC include(s):
-#include <xercesc/dom/DOMNode.hpp>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/StatusCode.h"
-
-// Local include(s):
-#include "LUTBBOverlapCalculator.h"
-#include "LUTEEOverlapCalculator.h"
-#include "LUTFFOverlapCalculator.h"
-#include "LUTBEOverlapCalculator.h"
-#include "LUTEFOverlapCalculator.h"
-#include "../Common/PtMultiplicitySet.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class MioctSectorSet;
-   class LUTMultiplicityCalculator;
-   class MultiplicityLogic;
-
-   bool operator== ( const LUTMultiplicityCalculator& calc1,
-                     const LUTMultiplicityCalculator& calc2 );
-
-   /**
-    *  @short Class capable of calculating the multiplicity in one MIOCT
-    *
-    *         Each MIOCT can calculate its multiplicity using such an object.
-    *         It is handled separately from the MIOCTs, as multiple MIOCTs can
-    *         possibly share the same configuration. (Although in real life they
-    *         don't really because of the RPC pad numbering scheme...)
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class LUTMultiplicityCalculator {
-
-   public:
-      /// Constructor only taking a multiplicity logic
-      LUTMultiplicityCalculator( const MultiplicityLogic* logic );
-      /// Copy constructor
-      LUTMultiplicityCalculator( const LUTMultiplicityCalculator& calculator );
-      LUTMultiplicityCalculator  & operator = ( const LUTMultiplicityCalculator  & ) = delete;
-
-      /// Function initializing the object from an XML file
-      StatusCode initialize( const xercesc::DOMNode* node, bool flagMode,
-                             bool dumpLut, const std::string& runPeriod );
-
-      /// Function calculating the multiplicity for one MIOCT
-      PtMultiplicitySet calculateMultiplicity( const MioctSectorSet& sectorData ) const;
-
-  private:
-      /// The message logger object
-      mutable MsgLogger m_logger;
-
-      /// Pointer to the multiplicity logic of this MIOCT
-      const MultiplicityLogic* m_multiplicityLogic;
-
-      /// When set to true, the multiplicity calculation is in flagging mode
-      bool m_flagMode;
-
-      //
-      // The different overlap calculator/flagger objects:
-      //
-      LUTBBOverlapCalculator m_bb_calc_1, m_bb_calc_2;
-      LUTEEOverlapCalculator m_ee_calc_1, m_ee_calc_2, m_ee_calc_3, m_ee_calc_4, m_ee_calc_5;
-      LUTFFOverlapCalculator m_ff_calc_1, m_ff_calc_2;
-      LUTBEOverlapCalculator m_be_calc_11, m_be_calc_12, m_be_calc_22, m_be_calc_23;
-      LUTBEOverlapCalculator m_be_calc_34, m_be_calc_35, m_be_calc_45, m_be_calc_46;
-      LUTEFOverlapCalculator m_ef_calc_21, m_ef_calc_31, m_ef_calc_42;
-      LUTEFOverlapCalculator m_ef_calc_52, m_ef_calc_63;
-
-      friend bool LVL1MUCTPI::operator== ( const LUTMultiplicityCalculator& calc1,
-                                           const LUTMultiplicityCalculator& calc2 );
-
-   }; // class LUTMultiplicityCalculator
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_LUTMULTIPLICITYCALCULATOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.cxx
deleted file mode 100644
index a5bdad7bf840..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.cxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTOverlapCalculatorBase.cxx 448474 2011-07-13 09:01:48Z krasznaa $
-
-// Local include(s):
-#include "LUTOverlapCalculatorBase.h"
-
-namespace LVL1MUCTPI {
-
-   LUTOverlapCalculatorBase::LUTOverlapCalculatorBase( const std::string& name )
-      : m_logger( name ), m_lut(), m_thr( 3 ) {
-
-   }
-
-   LUTOverlapCalculatorBase::LUTOverlapCalculatorBase( const LUTOverlapCalculatorBase& calc )
-      : m_logger( calc.m_logger ), m_lut( calc.m_lut ), m_thr( calc.m_thr ) {
-
-   }
-
-   void LUTOverlapCalculatorBase::setMaximumThreshold( int thr ) {
-
-      m_thr = thr;
-      return;
-   }
-
-   bool operator== ( const LUTOverlapCalculatorBase& calc1,
-                     const LUTOverlapCalculatorBase& calc2 ) {
-
-      if( calc1.m_lut == calc2.m_lut ) return true;
-      else return false;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.h
deleted file mode 100644
index 79b659be4733..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTOverlapCalculatorBase.h
+++ /dev/null
@@ -1,98 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTOverlapCalculatorBase.h 707664 2015-11-13 05:36:00Z ssnyder $
-#ifndef TRIGT1MUCTPI_LUTOVERLAPCALCULATORBASE_H
-#define TRIGT1MUCTPI_LUTOVERLAPCALCULATORBASE_H
-
-// STL include(s):
-#include <map>
-#include <string>
-
-// XercesC include(s):
-#include <xercesc/dom/DOMNode.hpp>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/StatusCode.h"
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   class LUTOverlapCalculatorBase;
-   bool operator== ( const LUTOverlapCalculatorBase& calc1,
-                     const LUTOverlapCalculatorBase& calc2 );
-
-   /**
-    *  @short Base class for the LUT overlap calculators
-    *
-    *         All overlap calculators share some common properties. This class
-    *         tries to group them, to minimize code duplication.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 707664 $
-    * $Date: 2015-11-13 06:36:00 +0100 (Fri, 13 Nov 2015) $
-    */
-   class LUTOverlapCalculatorBase {
-
-   public:
-      /// "Regular" constructor
-      LUTOverlapCalculatorBase( const std::string& name );
-      /// Copy constructor
-      LUTOverlapCalculatorBase( const LUTOverlapCalculatorBase& calc );
-      LUTOverlapCalculatorBase  & operator = ( const LUTOverlapCalculatorBase  & ) = delete;
- 
-      /// Virtual destructor to make vtable happy
-      virtual ~LUTOverlapCalculatorBase() {}
-
-      /// Common initialization function for all kinds of calculator types
-      /**
-       * Calculators are always initialized from XML files. The owner of the
-       * calculator object is responsible for giving the calculator the
-       * XML node that describes the configuration for the object.
-       *
-       * @param node The XML node that holds the configuration for the object
-       * @param dumpLut When set to <code>true</code> the calculator will print
-       *                the contents of the read LUT. For debugging only.
-       */
-     virtual StatusCode initialize( const xercesc::DOMNode* node, bool dumpLut, const std::string& runPeriod ) = 0;
-
-      /// Set the maximal threshold for overlap removal
-      /**
-       * The hardware uses a small LUT that defines which threshold combinations
-       * can be taken into account when evaluating a fake double count. However in
-       * practice we always only use a very simple configuration. We take the lowest
-       * N thresholds into account and ignore the higher threshold candidates. This
-       * function defined the maximal threshold that should still be taken into
-       * account.
-       */
-      void setMaximumThreshold( int thr );
-
-   protected:
-      /// For printing messages
-      mutable MsgLogger m_logger;
-
-      /// Each overlap calculator should work with such a "look up table"
-      std::map< unsigned int, bool > m_lut;
-
-      /// Maximal threshold to be taken into account in overlap removal
-      int m_thr;
-
-      /// This operator helps to compare all "simple" overlap calculators
-      friend bool LVL1MUCTPI::operator== ( const LUTOverlapCalculatorBase& calc1,
-                                           const LUTOverlapCalculatorBase& calc2 );
-
-   }; // class LUTOverlapCalculatorBase
-
-   /// Operator comparing overlap calculator objects
-   bool operator== ( const LUTOverlapCalculatorBase& calc1,
-                     const LUTOverlapCalculatorBase& calc2 );
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_LUTOVERLAPCALCULATORBASE_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.cxx
deleted file mode 100644
index d46b6b9d1d8b..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.cxx
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTStrategy.cxx 650693 2015-03-01 16:53:48Z masato $
-
-// STL include(s):
-#include <sstream>
-#include <algorithm>
-#include <vector>
-
-// XercesC include(s):
-#include <xercesc/util/PlatformUtils.hpp>
-#include <xercesc/util/XMLString.hpp>
-#include <xercesc/parsers/XercesDOMParser.hpp>
-#include <xercesc/dom/DOMException.hpp>
-#include <xercesc/dom/DOMDocument.hpp>
-#include <xercesc/dom/DOMNodeList.hpp>
-#include <xercesc/dom/DOMElement.hpp>
-
-// Gaudi/Athena include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// Trigger include(s):
-#include "TrigConfMuctpi/EntityResolver.h"
-#include "TrigConfMuctpi/ErrorHandler.h"
-
-// Local include(s):
-#include "LUTStrategy.h"
-
-namespace LVL1MUCTPI {
-
-   LUTStrategy::LUTStrategy( const MultiplicityLogic* logic )
-      : OverlapStrategy( "LUT-Based-Overlap-Strategy" ), m_logger( "LUTStrategy" ),
-        m_multiplicityLogic( logic ) {
-
-      //
-      // Create a valid, but empty configuration as a start:
-      //
-      LUTMultiplicityCalculator calc( m_multiplicityLogic );
-      m_calculator_list.push_back( calc );
-
-      for( unsigned int i = 0; i < 8; ++i ) {
-         MioctID id( i, NEGATIVE );
-         m_calculator_map[ id ] = &m_calculator_list.back();
-      }
-      for( unsigned int i = 0; i < 8; ++i ) {
-         MioctID id( i, POSITIVE );
-         m_calculator_map[ id ] = &m_calculator_list.back();
-      }
-   }
-
-   LUTStrategy::LUTStrategy( const LUTStrategy& strategy )
-      : OverlapStrategy( "LUT-Based-Overlap-Strategy" ), m_logger( "LUTStrategy" ),
-        m_multiplicityLogic( strategy.m_multiplicityLogic ) {
-
-      // Replicate the list:
-      for( std::list< LUTMultiplicityCalculator >::const_iterator it =
-              strategy.m_calculator_list.begin(); it != strategy.m_calculator_list.end();
-           ++it ) {
-         m_calculator_list.push_back( *it );
-      }
-
-      // Replicate the map:
-      for( std::map< MioctID, const LUTMultiplicityCalculator* >::const_iterator it =
-              strategy.m_calculator_map.begin(); it != strategy.m_calculator_map.end();
-           ++it ) {
-
-         for( std::list< LUTMultiplicityCalculator >::const_iterator calc =
-                 m_calculator_list.begin(); calc != m_calculator_list.end(); ++calc ) {
-            if( ( *it->second ) == ( *calc ) ) {
-               m_calculator_map[ it->first ] = &( *calc );
-               break;
-            }
-         }
-      }
-   }
-
-   StatusCode LUTStrategy::initialize( const std::string& lutXMLFile, bool flagMode,
-                                       bool dumpLut, const std::string& runPeriod ) {
-
-      m_calculator_list.clear();
-      m_calculator_map.clear();
-
-      REPORT_MSG(DEBUG, "Initializing LUTStrategy from file: " << lutXMLFile << " with a RunPeriod setting " << runPeriod );
-
-      //
-      // Initialize XercesC:
-      //
-      try {
-
-         xercesc::XMLPlatformUtils::Initialize();
-
-      } catch( const xercesc::XMLException& ex ) {
-         char* error_message = xercesc::XMLString::transcode( ex.getMessage() );
-         REPORT_ERROR_MSG( "Failed to initialize XercesC because: " << error_message );
-         xercesc::XMLString::release( &error_message );
-         return StatusCode::RECOVERABLE;
-      }
-
-      //
-      // Parse the LUT XML file:
-      //
-      xercesc::XercesDOMParser* lutParser = new xercesc::XercesDOMParser();
-
-      try {
-
-         Muctpi::EntityResolver resolver;
-         lutParser->setEntityResolver( &resolver );
-         Muctpi::ErrorHandler handler;
-         lutParser->setErrorHandler( &handler );
-
-         lutParser->parse( lutXMLFile.c_str() );
-
-      } catch( const xercesc::XMLException& ex ) {
-         char* error_message = xercesc::XMLString::transcode( ex.getMessage() );
-         REPORT_ERROR_MSG( "XMLException received while parsing the LUT XML file." );
-         REPORT_ERROR_MSG( "Message: " << error_message );
-         xercesc::XMLString::release( &error_message );
-         return StatusCode::RECOVERABLE;
-      } catch( const xercesc::DOMException& ex ) {
-         char* error_message = xercesc::XMLString::transcode( ex.getMessage() );
-         REPORT_ERROR_MSG( "DOMException received while parsing the LUT XML file." );
-         REPORT_ERROR_MSG( "Message: " << error_message );
-         xercesc::XMLString::release( &error_message );
-         return StatusCode::RECOVERABLE;
-      } catch(...) {
-         REPORT_ERROR_MSG( "LUT XML file parsing failed with unknown exception" );
-         return StatusCode::RECOVERABLE;
-      }
-
-      const xercesc::DOMDocument* lutDocument = lutParser->getDocument();
-      const xercesc::DOMNodeList* lutNodes = lutDocument->getChildNodes();
-      REPORT_VERBOSE_MSG( "Number of nodes in the LUT XML file: "
-                          << lutNodes->getLength() );
-
-      const xercesc::DOMNode* lutNode = 0;
-      for( XMLSize_t i = 0; i < lutNodes->getLength(); ++i ) {
-         const xercesc::DOMNode* node = lutNodes->item( i );
-         char* cnode_name = xercesc::XMLString::transcode( node->getNodeName() );
-         std::string snode_name( cnode_name );
-         xercesc::XMLString::release( &cnode_name );
-         REPORT_VERBOSE_MSG( "Investigating node with name: " << snode_name );
-         if( ( snode_name == "MUCTPI_LUT" ) &&
-             ( node->getNodeType() == xercesc::DOMNode::ELEMENT_NODE ) ) {
-            lutNode = node;
-            break;
-         }
-      }
-      if( ! lutNode ) {
-         REPORT_ERROR_MSG( "Couldn't find 'MUCTPI_LUT' node in the LUT XML!" );
-         return StatusCode::RECOVERABLE;
-      }
-
-      const xercesc::DOMNodeList* mioctNodes = lutNode->getChildNodes();
-      for( XMLSize_t i = 0; i < mioctNodes->getLength(); ++i ) {
-
-         const xercesc::DOMNode* mioctNode = mioctNodes->item( i );
-         char* cname = xercesc::XMLString::transcode( mioctNode->getNodeName() );
-         std::string sname( cname );
-         xercesc::XMLString::release( &cname );
-
-         if( sname != "Mioct" ) continue;
-
-         const xercesc::DOMElement* mioctElement =
-            dynamic_cast< const xercesc::DOMElement* >( mioctNode );
-         if( ! mioctElement ) {
-            REPORT_ERROR_MSG( "Unable to cast Mioct node into DOMElement" );
-            return StatusCode::RECOVERABLE;
-         }
-
-         REPORT_VERBOSE_MSG( ">>>>>>>>>>>>>>>> Starting to initialize calculator <<<<<<<<<<<<<<<<" );
-         LUTMultiplicityCalculator calc( m_multiplicityLogic );
-         CHECK( calc.initialize( mioctNode, flagMode, dumpLut, runPeriod ) );
-         REPORT_VERBOSE_MSG( ">>>>>>>>>>>>>>>> Calculator initialization finished <<<<<<<<<<<<<<<<" );
-
-         // Check if this calculator is not defined yet:
-         std::list< LUTMultiplicityCalculator >::const_iterator it;
-         if( ( it = std::find( m_calculator_list.begin(), m_calculator_list.end(), calc ) ) ==
-             m_calculator_list.end() ) {
-            m_calculator_list.push_back( calc );
-            it = std::find( m_calculator_list.begin(), m_calculator_list.end(), calc );
-            REPORT_VERBOSE_MSG( "This is a new calculator definition" );
-         } else {
-            REPORT_VERBOSE_MSG( "This calculator definition already exists" );
-         }
-
-         //
-         // Extract the Mioct IDs that this calculator represents:
-         //
-         XMLCh* mioct_ids_name = xercesc::XMLString::transcode( "IDs" );
-         const XMLCh* mioct_ids = mioctElement->getAttribute( mioct_ids_name );
-         xercesc::XMLString::release( &mioct_ids_name );
-
-         char* cids = xercesc::XMLString::transcode( mioct_ids );
-         std::string sids( cids );
-         xercesc::XMLString::release( &cids );
-
-         std::vector< unsigned int > ids;
-         std::istringstream stream_ids( sids );
-         while( ! stream_ids.eof() ) {
-            unsigned int id;
-            stream_ids >> id;
-            ids.push_back( id );
-         }
-
-         //
-         // Assign the correct Miocts to this calculator:
-         //
-         REPORT_VERBOSE_MSG( "This calculator represents Miocts:" );
-         for( std::vector< unsigned int >::const_iterator id = ids.begin(); id != ids.end();
-              ++id ) {
-            if( ( *id ) < 8 ) {
-               MioctID mid( ( *id ), NEGATIVE );
-               m_calculator_map[ mid ] = &*it;
-               REPORT_VERBOSE_MSG( "  --> Mioct " << ( *id )
-                                   << " in the NEGATIVE rapidity region" );
-            } else {
-               MioctID mid( ( *id ) - 8, POSITIVE );
-               m_calculator_map[ mid ] = &*it;
-               REPORT_VERBOSE_MSG( "  --> Mioct " << ( ( *id ) - 8 )
-                                   << " in the POSITIVE rapidity region" );
-            }
-         }
-      }
-
-      REPORT_VERBOSE_MSG( "Number of different calculators created: "
-                          << m_calculator_list.size() );
-
-      delete lutParser;
-
-      //
-      // Terminate XercesC:
-      //
-      xercesc::XMLPlatformUtils::Terminate();
-
-      return StatusCode::SUCCESS;
-   }
-
-   PtMultiplicitySet LUTStrategy::calculateMultiplicity( const MioctSectorSet& sectorData,
-                                                         const MioctID& mioct ) const {
-
-      if( m_calculator_map.find( mioct ) != m_calculator_map.end() ) {
-         return m_calculator_map.find( mioct )->second->calculateMultiplicity( sectorData );
-      }
-
-      REPORT_ERROR_MSG( "Multiplicity calculation asked for unknown Mioct!" );
-      PtMultiplicitySet result;
-      return result;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.h
deleted file mode 100644
index fa7a79800e0b..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/LUTStrategy.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: LUTStrategy.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_LUTSTRATEGY_H
-#define TRIGT1MUCTPI_LUTSTRATEGY_H
-
-// STL include(s):
-#include <map>
-#include <list>
-#include <string>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/StatusCode.h"
-
-// Local include(s):
-#include "OverlapStrategy.h"
-#include "MioctID.h"
-#include "LUTMultiplicityCalculator.h"
-#include "../Common/PtMultiplicitySet.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class MultiplicityLogic;
-
-   /**
-    * @brief Overlap strategy for the hardware's LUT based overlap removal
-    *
-    *         This overlap strategy simulates the final hardware's overlap
-    *         removal logic. It is initialized with the same XML files as the
-    *         hardware is.
-    *
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 701446 $
-    * $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    */
-   class LUTStrategy : public OverlapStrategy {
-
-   public:
-      /// Standard constructor, specifying a multiplicity logic
-      LUTStrategy( const MultiplicityLogic* logic );
-      /// Copy constructor
-      LUTStrategy( const LUTStrategy& strategy );
-      LUTStrategy  & operator = ( const LUTStrategy  & ) = delete;
-
-      /// Function initializing the strategy object
-      StatusCode initialize( const std::string& lutXMLFile, bool flagMode,
-                             bool dumpLut, const std::string& runPeriod );
-
-      /// Function calculating the multiplicity for one MIOCT
-      virtual PtMultiplicitySet calculateMultiplicity( const MioctSectorSet& data,
-                                                       const MioctID& mioct ) const;
-
-   private:
-      mutable MsgLogger m_logger;
-      const MultiplicityLogic* m_multiplicityLogic;
-      std::map< MioctID, const LUTMultiplicityCalculator* > m_calculator_map;
-      std::list< LUTMultiplicityCalculator > m_calculator_list;
-
-   }; // LUTStrategy
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_LUTSTRATEGY_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.cxx
deleted file mode 100644
index 9cc79f67890b..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.cxx
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MioctData.cxx 439423 2011-05-25 21:22:40Z krasznaa $
-
-// Local include(s):
-#include "MioctData.h"
-#include "MioctSectorSet.h"
-#include "OverlapLogic.h"
-#include "MioctID.h"
-#include "../Common/BitOp.h"
-#include "../Common/PtMultiplicitySet.h"
-#include "../Common/MuctpiBitMasks.h"
-#include "../Logging/MsgLogger.h"
-
-
-/*******************************************************************
- * $Date: 2011-05-25 23:22:40 +0200 (Wed, 25 May 2011) $
- *
- * Implementation of class MioctData
- * @author   Author: Thorsten Wengler
- * @version $Revision: 439423 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   const unsigned int MioctData::m_startMioct = MioctStartMask;
-   const unsigned int MioctData::m_endMioct   = MioctEndMask;
-   const unsigned int MioctData::m_sectorNumberMap[ SECTORS_IN_MIOCT ] = {
-      0xa, 0xb, 0xc, 0x7, 0x8, 0x9, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6
-   };
-
-   // constructor
-   MioctData::MioctData()
-      : m_headerWord( 0 ), m_trailerWord( 0 ), m_flags( 0 ),
-        m_sectorWords(), m_sectorHighBits(), m_eventID() {
-
-   }
-
-   void MioctData::assignData( const MioctID& ID, const MioctSectorSet& mioctSectors,
-                               const OverlapLogic* lvl1OverlapLogic ) {
-
-      // Start with calculating the multiplicity. This flags the candidates that
-      // were suppressed in the multiplicity calculation.
-      PtMultiplicitySet ptSums = lvl1OverlapLogic->calculateMultiplicity( mioctSectors, ID );
-
-      // get the information needed for the Header word and fill it
-      m_headerWord = 0;
-      unsigned int MNBR = ID.getNumber();             // module number
-      Hemisphere theHem = ID.getRapidityRegion();     // Rapidity region
-      if( theHem == POSITIVE ) MNBR += 8;
-      unsigned int EVID = m_eventID.getEvID();        // Event ID
-      unsigned int BCID = m_eventID.BCID();           // Bunch ID
-      BitOp::sImposeNBits( &m_headerWord, 28, MNBR ); // impose Module Number
-      BitOp::sImposeNBits( &m_headerWord, 12, EVID ); // impose EVID
-      BitOp::sImposeNBits( &m_headerWord,  0, BCID ); // impose BCID
-
-      // get the list of sector words from the set of sectors belonging to this MIOCT
-      m_sectorWords.clear();
-      m_sectorHighBits.clear();
-      for( unsigned int i = 0; i < mioctSectors.getBitFieldSet()->size(); ++i ) {
-         m_sectorWords.push_back( *mioctSectors.getBitFieldSet()->at( i ) );
-         // Bit 36 is the suppression bit for the first candidate, and bit 37 is the
-         // suppression bit for the second candidate.
-         m_sectorHighBits.push_back( m_sectorNumberMap[ i ] );
-         switch( i ) {
-         case 0:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Forward1.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Forward1.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 1:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Forward2.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Forward2.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 2:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Forward3.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Forward3.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 3:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap4.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap4.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 4:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap5.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap5.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 5:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap6.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap6.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 6:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Barrel1.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Barrel1.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 7:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Barrel2.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Barrel2.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 8:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Barrel3.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Barrel3.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 9:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Barrel4.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Barrel4.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 10:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap1.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap1.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 11:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap2.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap2.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         case 12:
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap3.getCand1Supressed() ?
-                                       0x10 : 0x0 );
-            m_sectorHighBits[ i ] |= ( mioctSectors.Endcap3.getCand2Supressed() ?
-                                       0x20 : 0x0 );
-            break;
-         default:
-            MsgLogger logger( "MioctData" );
-            REPORT_ERROR_MSG2( "There's a coding mistake in the MIOCT simulation!", logger );
-            break;
-         }
-      }
-
-      // Fill the trailer word:
-      m_trailerWord = 0;
-      // Pt sums
-      BitOp::sImposeNBits( &m_trailerWord, 10, ptSums.getMultiplicity( 1 ) );
-      BitOp::sImposeNBits( &m_trailerWord, 13, ptSums.getMultiplicity( 2 ) );
-      BitOp::sImposeNBits( &m_trailerWord, 16, ptSums.getMultiplicity( 3 ) );
-      BitOp::sImposeNBits( &m_trailerWord, 19, ptSums.getMultiplicity( 4 ) );
-      BitOp::sImposeNBits( &m_trailerWord, 22, ptSums.getMultiplicity( 5 ) );
-      BitOp::sImposeNBits( &m_trailerWord, 25, ptSums.getMultiplicity( 6 ) );
-      // flags: nothing set for now
-      m_flags = 0;
-      BitOp::sImposeNBits( &m_trailerWord, 7, m_flags );
-      // word count: number of sector words plus header and trailer
-      // overwritten later by method setTrailorWordCount in case
-      // zero suppression is switched on
-      BitOp::sImposeNBits( &m_trailerWord, 0,
-                           static_cast< unsigned int >( m_sectorWords.size() + 2 ) );
-
-      return;
-   }
-
-   void MioctData::setTrailerWordCount( unsigned int theWordCount ){
-
-      for( int i = 0; i < 7; ++i ) { BitOp::clearBit( &m_trailerWord, i ); }
-      BitOp::sImposeNBits( &m_trailerWord, 0, theWordCount );
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.h
deleted file mode 100644
index d015b7f930ce..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctData.h
+++ /dev/null
@@ -1,115 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MioctData.h 439303 2011-05-25 15:20:17Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIOCTDATA_H
-#define TRIGT1MUCTPI_MIOCTDATA_H
-
-// STL include(s):
-#include <vector>
-
-// Local include(s):
-#include "../Common/EventID.h"
-#include "../Common/SectorConstants.h"
-
-namespace LVL1MUCTPI {
-
-  // Forward declaration(s):
-  class MioctID;
-  class MioctSectorSet;
-  class OverlapLogic;
-
-  /**
-   *******************************************************************
-   *
-   *    $Date: 2011-05-25 17:20:17 +0200 (Wed, 25 May 2011) $ 
-   *
-   *    @short Helper class for access of MIOCT data in MIBAK format
-   *
-   *           MioctData is a helper class to provide easy access 
-   *           of the data of one MIOCT module in the format as seen
-   *           on the MIBAK backplane by the Read Out Driver MIROD.
-   *
-   *      @see MioctModule
-   *   @author  Author: Thorsten Wengler
-   *  @version $Revision: 439303 $
-   *
-   *******************************************************************
-   */
-  class MioctData {
-
-  public:
-    /**
-     * The constructor of MioctData
-     */
-    MioctData();
-
-    /**
-     * This method fills the pointer list and additional words
-     * with the necessary data from its MIOCT module
-     */
-    void assignData( const MioctID&, const MioctSectorSet&, const OverlapLogic* );
-    /**
-     * This method sets the word count in the trailor word -
-     * needs to be an extra method as this has to be set
-     * at a later stage ( not in assignData), when the number
-     * of sector words after zero suppression has been determined
-     * @param theWordCount word count for this MIOCT, including
-     *                     header and trailor word
-     * @see MioctData::assignData()
-     */
-    void setTrailerWordCount( unsigned int theWordCount );
-    /**
-     * This method returns the start marker, which on the MIBAK
-     * is contained in bit 32 - 35, and marks the beginning of
-     * a MIOCT module in the data stream
-     * @return the MIOCT start marker
-     */
-    unsigned int getStartMarker () const { return m_startMioct; }
-    /**
-     * This method returns the end marker, which on the MIBAK
-     * is contained in bit 32 - 35, and marks the end of
-     * a MIOCT module in the data stream
-     * @return the MIOCT end marker
-     */
-    unsigned int getEndMarker () const { return m_endMioct; }
-    /**
-     * This method returns the header word
-     * @return the header word with module number,
-     *         event ID and BCID
-     */
-    unsigned int getHeader () const { return m_headerWord; }
-    /**
-     * This method returns the trailor word
-     * @return the trailer word with Pt sums,
-     *         flags and word count
-     */
-    unsigned int getTrailer () const { return m_trailerWord; }
-    /**
-     * This method returns a reference to the list of sector
-     * data words of this MIOCT. Each sector gets a word, even
-     * if empty, such that the position is equal to the sector
-     * number
-     */
-    const std::vector< unsigned int >* getSectorWords() const { return &m_sectorWords; }
-    const std::vector< unsigned int >* getSectorHighBits() const { return &m_sectorHighBits; }
-
-  private:
-    unsigned int                m_headerWord;
-    static const unsigned int   m_startMioct;
-    unsigned int                m_trailerWord;
-    static const unsigned int   m_endMioct;
-    unsigned int                m_flags;
-    std::vector< unsigned int > m_sectorWords;
-    std::vector< unsigned int > m_sectorHighBits;
-    EventID                     m_eventID;
-    static const unsigned int   m_sectorNumberMap[ SECTORS_IN_MIOCT ];
-
-  }; // class MioctData
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIOCTDATA_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.cxx
deleted file mode 100644
index cef6e357d802..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.cxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MioctID.cxx 364083 2011-05-06 09:09:55Z krasznaa $
-
-// Local include(s):
-#include "MioctID.h"
-#include "../Common/SectorConstants.h"
-#include "../Common/BitOp.h"
-
-//***********************************************************************
-//
-//       Version : $Revision: 364083 $
-//
-//   Description : creates the Sectors because the Sector IDs are
-//                 uniquely determined by the MioctID.
-//
-//        Author : $Author: krasznaa $
-//          Date : $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
-//
-//
-//
-//***********************************************************************
-
-namespace LVL1MUCTPI {
-
-   MioctID::MioctID( const unsigned int aNumber, const Hemisphere aHemisphere )
-      : m_rapidityRegion( aHemisphere ), m_number( aNumber ) {
-
-   }
-
-   // first MIOCT receives data from sectors 30,31,0,1, second
-   // from 2,3,4,5, third from 6,7,8,9, ... and so on
-   unsigned int MioctID::getFirstBarrelID() const {
-
-      unsigned int result;
-      if( m_number == 0 ) {
-         result = 30;
-      } else {
-         result = m_number*4 - 2;
-      }
-      return result;
-   }
-
-   // First MIOCT receives data from sectors 47,0,1,2,3,4 second from
-   // 5,6,7,8,9,10, ... and so on
-   unsigned int MioctID::getFirstEndcapID() const {
-
-      unsigned int result;
-      if( m_number == 0 ) {
-         result = 47;
-      } else {
-         result = m_number*6 - 1;
-      }
-      return result ;
-   }
-
-   // First MIOCT receives data from Sectors 0,1,2, second
-   // from 3,4,5 ... and so on
-   unsigned int MioctID::getFirstForwardID() const {
-
-      return m_number*3;
-   }
-
-   unsigned int MioctID::getMirodSecAddress(unsigned int mioctSectorID) {
-
-      unsigned int sectorAddress = 0;
-      unsigned int sectorID = 0;
-
-      // Determine if this is BARREL, ENDCAP, or FORWARD, and
-      // translate the mioctSectorID into the subsystem sectorID
-      // -> finally set the address word according to the MIORD
-      // Eventreader standart
-      if (mioctSectorID <= 3) {                                 // Barrel
-         sectorID = mioctSectorID + (this)->getFirstBarrelID();
-         if( sectorID > MAX_BARREL_SECTOR )
-            sectorID = ( sectorID % MAX_BARREL_SECTOR ) - 1;
-         if(m_rapidityRegion == POSITIVE) BitOp::setBit( &sectorAddress, 0 );
-         BitOp::sImposeNBits( &sectorAddress, 1, sectorID );
-      }
-      else if (mioctSectorID > 3 && mioctSectorID <= 9) {     // Endcap
-         sectorID = (mioctSectorID - 4) + (this)->getFirstEndcapID();
-         if( sectorID > MAX_ENDCAP_SECTOR )
-            sectorID = ( sectorID % MAX_ENDCAP_SECTOR ) - 1;
-         BitOp::setBit( &sectorAddress, 7 );
-         if( m_rapidityRegion == POSITIVE ) BitOp::setBit( &sectorAddress, 0 );
-         BitOp::sImposeNBits( &sectorAddress, 1, sectorID );
-      }
-      else if (mioctSectorID > 9) {                             // Forward
-         sectorID = ( mioctSectorID - 10 ) + (this)->getFirstForwardID();
-         if( sectorID > MAX_FORWARD_SECTOR)
-            sectorID = ( sectorID % MAX_FORWARD_SECTOR ) - 1;
-         BitOp::setBit( &sectorAddress, 6 );
-         if( m_rapidityRegion == POSITIVE ) BitOp::setBit( &sectorAddress, 0 );
-         BitOp::sImposeNBits( &sectorAddress, 1, sectorID );
-      }
-
-      return sectorAddress;
-   }
-
-   bool operator< ( const MioctID& id1, const MioctID& id2 ) {
-
-      if( id1.m_number != id2.m_number ) return ( id1.m_number < id2.m_number );
-      else {
-         if( id1.m_rapidityRegion != id2.m_rapidityRegion ) {
-            if( id1.m_rapidityRegion == POSITIVE ) return false;
-            else return true;
-         } else {
-            return false;
-         }
-      }
-
-      return true;
-   }
-
-   MsgLogger& operator<<( MsgLogger& out, const MioctID& id ) {
-
-      out << "MIOCT " << id.getNumber() << ", "
-          << ( id.getRapidityRegion() == POSITIVE ? "POSITIVE" : "NEGATIVE" )
-          << " Hemisphere";
-
-      return out;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.h
deleted file mode 100644
index 59352fb23fcc..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctID.h
+++ /dev/null
@@ -1,108 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MioctID.h 364083 2011-05-06 09:09:55Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIOCTID_H
-#define TRIGT1MUCTPI_MIOCTID_H
-
-// Local include(s):
-#include "../Common/Detector.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // I forward declare the MioctID class to be able to declare the comparison
-   // operator already...
-   class MioctID;
-
-   /// The ability to compare Mioct IDs comes in handy, when MioctID objects are
-   /// used in std::map-s
-   bool operator< ( const MioctID& id1, const MioctID& id2 );
-
-   /// Printer operator
-   MsgLogger& operator<<( MsgLogger& out, const MioctID& id );
-
-  /**
-   ************************************************************************
-   *
-   *    $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $ 
-   *
-   *    @short Contains all data to define a MioctModule
-   *
-   *           This class contains the identification of an Octant board
-   *           and serves to generate the right Sectors for this board 
-   *           by providing a set of functions which return the lowest 
-   *           sector number for the Barrel-, Endcap-, and Forward 
-   *           sectors of the module.
-   *
-   *      @see MioctSectorSet
-   *      @see Detector.h
-   *   @author $Author: krasznaa $
-   *  @version $Revision: 364083 $
-   *
-   *
-   ************************************************************************
-   */
-  class MioctID {
-
-  public:
-    /**
-     * An ID is defined by two parameters.
-     * @param aNumber the number of the octant board (1..8).
-     * @param aHemisphere can be POSITIVE or NEGATIVE
-     * @see Detector.h
-     */
-    MioctID( const unsigned int aNumber, const Hemisphere aHemisphere );
-    /**
-     * Access function to the MioctNumber of the MioctID.
-     * @return The Number of the octant board.
-     */
-    unsigned int getNumber() const { return m_number; }
-    /**
-     * Access function to the Rapidity Region of the MioctID.
-     * @return The Hemisphere of the octant board. (POSITIVE
-     *         or NEGATIVE as defined in Detector.h)
-     * @see Detector.h
-     */
-    Hemisphere getRapidityRegion() const { return m_rapidityRegion; }
-    /**
-     * This method returns the sector ID as build by the MIROD from
-     * the MioctModuleID, the Hemisphere, and the sector ID in the 
-     * MIOCT
-     * @see MirodModule
-     * @see MirodEventReader
-     * @param sectorID The ID of the sector in the MIOCT
-     * @return sector Address in MIROD Eventreader format
-     */
-    unsigned int getMirodSecAddress( unsigned int sectorID );
-    /**
-     * Get the first (lowest) Barrel-Sector number for the octant board.
-     * @return The Sector ID number (0-31)
-     */
-    unsigned int getFirstBarrelID() const;
-    /**
-     * Get the first (lowest) Endcap-Sector number for the octant board.
-     * @return The Sector ID number (0-47)
-     */
-    unsigned int getFirstEndcapID() const;
-    /**
-     * Get the first (lowest) Forward-Sector number for the octant board.
-     * @return The Sector ID number (0-23)
-     */
-    unsigned int getFirstForwardID() const;
-
-  private:
-
-    Hemisphere      m_rapidityRegion;
-    unsigned int    m_number;
-
-    friend bool LVL1MUCTPI::operator< ( const MioctID& id1, const MioctID& id2 );
-
-  }; // class MioctID
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIOCTID_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx
deleted file mode 100644
index 5d3590dd0dfe..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MioctModule.cxx 795106 2017-02-02 11:21:27Z wengler $
-
-// STL include(s):
-#include <sstream>
-#include <iostream>
-#include<string>
-
-// Local include(s):
-#include "MioctModule.h"
-#include "OverlapLogic.h"
-#include "EventReader.h"
-
-//***********************************************************************
-//
-//       Version : $Revision: 795106 $
-//
-//   Description :
-//
-//        Author : $Author: krasznaa $
-//          Date : $Date: 2017-02-02 12:21:27 +0100 (Thu, 02 Feb 2017) $
-//
-//
-//
-//***********************************************************************
-
-namespace LVL1MUCTPI {
-
-   MioctModule::MioctModule( const MioctID& theID, const OverlapLogic* theOverlapLogic,
-                             EventReader* reader )
-      : m_logger( "MioctModule" ), m_ID( theID ),
-        m_mioctSectors( theID, reader ), m_lvl1OverlapLogic( theOverlapLogic ) {
-
-      if( theID.getRapidityRegion() == POSITIVE ) {
-         REPORT_VERBOSE_MSG( "Printing sector information for MIOCT with number "
-                             << theID.getNumber()
-                             << " in the POSITIVE rapidity region" );
-      } else {
-         REPORT_VERBOSE_MSG( "Printing sector information for MIOCT with number "
-                             << theID.getNumber()
-                             << " in the NEGATIVE rapidity region" );
-      }
-
-      m_mioctSectors.report();
-   }
-
-   PtMultiplicitySet MioctModule::calculateMultiplicity() const {
-
-      if( m_logger.msgLvl(LVL1MUCTPI::VERBOSE) ) {
-        m_mioctSectors.print();
-      }
-
-      return m_lvl1OverlapLogic->calculateMultiplicity( m_mioctSectors, m_ID ) ;
-   }
-
-   LVL1::MuCTPIL1Topo MioctModule::getL1TopoCandidates(MioctL1TopoConverter & l1TopoConv) const{
-     LVL1::MuCTPIL1Topo result;
-     std::vector<LVL1::MuCTPIL1TopoCandidate> candList;
-     
-     // Add the unsupressed barrel candidates in the same order as in the hardware - 
-     // this is important as the last ones added are taken after sorting if 
-     // there are more than two candidates per Mioct
-     // BA31, BA32, BA01, BA02, EC47, EC00, EC01, EC02, EC03, EC04, FW00, FW01, FW02
-     // equivalent to Barrel1-4, Endcap1-6, Forward1-3
-
-     if(  ! m_mioctSectors.Barrel1.getCand1Supressed() &&  m_mioctSectors.Barrel1.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel1, true ));
-
-     if(  ! m_mioctSectors.Barrel1.getCand2Supressed() &&  m_mioctSectors.Barrel1.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel1, false ));
-
-     if(  ! m_mioctSectors.Barrel2.getCand1Supressed() &&  m_mioctSectors.Barrel2.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel2, true ));
-
-     if(  ! m_mioctSectors.Barrel2.getCand2Supressed() &&  m_mioctSectors.Barrel2.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel2, false ));
-
-     if(  ! m_mioctSectors.Barrel3.getCand1Supressed() &&  m_mioctSectors.Barrel3.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel3, true ));
-
-     if(  ! m_mioctSectors.Barrel3.getCand2Supressed() &&  m_mioctSectors.Barrel3.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel3, false ));
-
-     if(  ! m_mioctSectors.Barrel4.getCand1Supressed() &&  m_mioctSectors.Barrel4.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel4, true ));
-
-     if(  ! m_mioctSectors.Barrel4.getCand2Supressed() &&  m_mioctSectors.Barrel4.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Barrel4, false ));
-
- 
-     if(  ! m_mioctSectors.Endcap1.getCand1Supressed() &&  m_mioctSectors.Endcap1.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap1, true ));
-
-     if(  ! m_mioctSectors.Endcap1.getCand2Supressed() &&  m_mioctSectors.Endcap1.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap1, false ));
-
-     if(  ! m_mioctSectors.Endcap2.getCand1Supressed() &&  m_mioctSectors.Endcap2.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap2, true ));
-
-     if(  ! m_mioctSectors.Endcap2.getCand2Supressed() &&  m_mioctSectors.Endcap2.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap2, false ));
-
-     if(  ! m_mioctSectors.Endcap3.getCand1Supressed() &&  m_mioctSectors.Endcap3.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap3, true ));
-
-     if(  ! m_mioctSectors.Endcap3.getCand2Supressed() &&  m_mioctSectors.Endcap3.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap3, false ));
-
-     if(  ! m_mioctSectors.Endcap4.getCand1Supressed() &&  m_mioctSectors.Endcap4.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap4, true ));
-
-     if(  ! m_mioctSectors.Endcap4.getCand2Supressed() &&  m_mioctSectors.Endcap4.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap4, false ));
-
-     if(  ! m_mioctSectors.Endcap5.getCand1Supressed() &&  m_mioctSectors.Endcap5.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap5, true ));
-
-     if(  ! m_mioctSectors.Endcap5.getCand2Supressed() &&  m_mioctSectors.Endcap5.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap5, false ));
-
-     if(  ! m_mioctSectors.Endcap6.getCand1Supressed() &&  m_mioctSectors.Endcap6.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap6, true ));
-
-     if(  ! m_mioctSectors.Endcap6.getCand2Supressed() &&  m_mioctSectors.Endcap6.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Endcap6, false ));
-
-     if(  ! m_mioctSectors.Forward1.getCand1Supressed() && m_mioctSectors.Forward1.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward1, true ));
-
-     if(  ! m_mioctSectors.Forward1.getCand2Supressed() && m_mioctSectors.Forward1.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward1, false ));
-
-     if(  ! m_mioctSectors.Forward2.getCand1Supressed() && m_mioctSectors.Forward2.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward2, true ));
-
-     if(  ! m_mioctSectors.Forward2.getCand2Supressed() && m_mioctSectors.Forward2.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward2, false ));
-
-     if(  ! m_mioctSectors.Forward3.getCand1Supressed() && m_mioctSectors.Forward3.getPtCand1() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward3, true ));
-
-     if(  ! m_mioctSectors.Forward3.getCand2Supressed() && m_mioctSectors.Forward3.getPtCand2() !=7 ) 
-       candList.push_back(l1TopoConv.convertToL1Topo(m_ID, m_mioctSectors.Forward3, false ));
-
-
-     // stable_sort on pt threshold ID (1-6) keeping the input order 
-     std::stable_sort(candList.begin(), candList.end(), 
-      		      [](const LVL1::MuCTPIL1TopoCandidate & cand1,  const LVL1::MuCTPIL1TopoCandidate & cand2)
-      		      {
-      			return cand1.getptThresholdID() < cand2.getptThresholdID();
-      		      });
-
-
-     // limit to 2 candidates per MIOCT as in the hardware
-     if (candList.size() > 2) {
-       candList.erase(candList.begin(), candList.end()-2);
-       // set second candidate pt to 3 (i.e. 11) to indicate overflow - note sorting is in ascending order, 
-       // so last element in vector is highest pt, i.e. first element in vector of two after cutoff is 
-       // second candidate
-       candList.at(0).setptL1TopoCodeToOvFl();
-     } 
-    
-
-     result.setCandidates(candList);
-     return result;
-   
-   }
-  
-   // implementation of method to get the data of this MIOCT as an
-   // object MioctData, which allows easy access to the data in
-   // MIBAK format
-   MioctData* MioctModule::getMioctOnMibak() {
-
-      m_mioctData.assignData( m_ID, m_mioctSectors, m_lvl1OverlapLogic );
-      return &m_mioctData;
-   }
-
-   /**
-    * This function simulates the behavior of one of the NIM outputs on the front
-    * of the MIOCT module, which can be programmed to tell us whether a barrel
-    * candidate was seen in the octant.
-    *
-    * @returns <code>true</code> if there was a barrel candidate in the octant,
-    *          <code>false</code> if there was none
-    */
-   bool MioctModule::hasBarrelCandidate() const {
-
-      if( ( m_mioctSectors.Barrel1.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Barrel1.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Barrel2.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Barrel2.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Barrel3.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Barrel3.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Barrel4.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Barrel4.getPtCand2() != 7 ) ) {
-
-         return true;
-
-      } else {
-
-         return false;
-      }
-   }
-
-   /**
-    * This function simulates the behavior of one of the NIM outputs on the front
-    * of the MIOCT module, which can be programmed to tell us whether an endcap
-    * candidate was seen in the octant.
-    *
-    * @returns <code>true</code> if there was an endcap candidate in the octant,
-    *          <code>false</code> if there was none
-    */
-   bool MioctModule::hasEndcapCandidate() const {
-
-      if( ( m_mioctSectors.Endcap1.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Endcap1.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Endcap2.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Endcap2.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Endcap3.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Endcap3.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Endcap4.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Endcap4.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Endcap5.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Endcap5.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Endcap6.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Endcap6.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Forward1.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Forward1.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Forward2.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Forward2.getPtCand2() != 7 ) ||
-          ( m_mioctSectors.Forward3.getPtCand1() != 7 ) ||
-          ( m_mioctSectors.Forward3.getPtCand2() != 7 ) ) {
-
-         return true;
-
-      } else {
-
-         return false;
-      }
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.h
deleted file mode 100644
index ae5eb2f4de4a..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.h
+++ /dev/null
@@ -1,131 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MioctModule.h 678659 2015-06-26 14:54:31Z wengler $
-#ifndef TRIGT1MUCTPI_MIOCTMODULE_H
-#define TRIGT1MUCTPI_MIOCTMODULE_H
-
-// Local include(s):
-#include "../Common/PtMultiplicitySet.h"
-#include "MioctID.h"
-#include "MioctData.h"
-#include "MioctSectorSet.h"
-#include "../Logging/MsgLogger.h"
-#include "../Common/MioctL1TopoConverter.h"
-
-// include  interface class to L1Topo
-#include "TrigT1Interfaces/MuCTPIL1Topo.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class OverlapLogic;
-   class EventReader;
-
-   /**
-    *  @short Contains all relevant entities of an octant board MIOCT.
-    *
-    *         The MioctModule groups  together all entities relevant for
-    *         an onctant board MIOCT. It's  only service is to calculate
-    *         the Pt-Multiplicity for the data which is currently stored
-    *         in the Sectors of the MioctModule.
-    *
-    *    @see MiocID
-    *    @see OverlapLogic
-    *    @see OverlapStrategy
-    *    @see PtMultiplicitySet
-    *    @see Detector.h
-    *
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 678659 $
-    * $Date: 2015-06-26 16:54:31 +0200 (Fri, 26 Jun 2015) $
-    */
-   class MioctModule {
-
-   public:
-      /**
-       * The constructor instantiates all entities relevant for an
-       * octant board. There is one major difference to the real
-       * world: There is only one Instantiation of the OverlapLogic
-       * in the Lvl1Mibak class. The octant boards only contain a
-       * pointer to that logic. This has been chosen because it does
-       * not make sense to simulate the system with different overlap
-       * logics implemented in different octant boards at the same
-       * time. There is of course still the possibility to use different
-       * strategies to resolve the overlap in the OverlapLogic.
-       * @param theID Identfieer of the Mioctodule
-       * @param theOverlapLogic Pointer to the OverlapLogic which is used
-       *                        to resolve overlapping muon candidates during forming the
-       *                        Pt-multiplicity over the octant board.
-       * @param reader The event reader isntance for this simulation
-       * @see MioctID
-       * @see OverlapLogic
-       * @see OverlapStrategy
-       */
-      MioctModule( const MioctID& theID, const OverlapLogic* theOverlapLogic,
-                   EventReader* reader );
-      /**
-       * Return the MioctSectorSet object of this MioctModule
-       * @return The MioctSectorSet object of this octant board.
-       * @see MioctSectorSet
-       */
-      const MioctSectorSet* getMioctSectorSet() const { return &m_mioctSectors; }
-      /**
-       * Return the MioctID object of this MioctModule
-       * @return The MioctID object of this octant board.
-       * @see MioctID
-       */
-      MioctID getMioctID() const { return m_ID; }
-      /**
-       * This service determines the actual pt-multiplicity of the
-       * data contained in the Sectors of the MioctModule. It uses the
-       * OverlapLogic given to the constructor to resolve the overlap
-       * between neighbouring sectors.
-       * @return For the six different Pt-thresholds
-       *         the multiplicity of muon candidates is returned.
-       * @see PtMultiplicitySet
-       */
-      PtMultiplicitySet calculateMultiplicity() const;
-      /**
-       * Return the L1Topo outputs for this MIOCT 
-       * This must be called after calculateMultiplicity() to make sure the
-       * flags are properly set in sector data
-       */
-      LVL1::MuCTPIL1Topo getL1TopoCandidates(MioctL1TopoConverter & l1TopoConv) const;
-      /**
-       * This method returns a pointer to the SectorSet conatained
-       * in this MIOCT
-       * @return Pointer to the set of Sectors belonging to this MIOCT
-       */
-      const MioctSectorSet* getSectorSet() const { return &m_mioctSectors; }
-      /**
-       * This service groups the data stored in this MIOCT into an object
-       * which allows easy access to the data in the format found on the
-       * MIBAK backplane.
-       * @return data of this MIOCT module with access
-       *         function to retrive the data in MIBAK format
-       */
-      MioctData* getMioctOnMibak();
-
-      /// Is there at least one barrel candidate in the octant?
-      bool hasBarrelCandidate() const;
-      /// Is there at least one endcap candidate in the octant?
-      bool hasEndcapCandidate() const;
-
-   private:
-      mutable MsgLogger   m_logger;
-      MioctID             m_ID;
-      MioctSectorSet      m_mioctSectors;
-      const OverlapLogic* m_lvl1OverlapLogic;
-      MioctData           m_mioctData;
-
-   }; // class MioctModule
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIOCTMODULE_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.cxx
deleted file mode 100644
index cbb00ae5840c..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.cxx
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MioctSectorSet.cxx 472835 2011-12-06 21:05:16Z stelzer $
-
-// STL include(s):
-#include <string>
-
-// Local include(s):
-#include "MioctSectorSet.h"
-#include "EventReader.h"
-
-//******************************************************************
-//
-//       Version : $Revision: 472835 $
-//
-//   Description : This is a helper class which groups the different
-//                 Sectors of one Mioct  Module.  It only serves  to
-//                 guarantee that the Sectors in the Set have the
-//                 right IDs so that they overlap. The class has
-//                 been formed in order  to give the Sectors  in a
-//                 compact  form to the various OverlapStrategies.
-//
-//        Author : $Author: krasznaa $
-//          Date : $Date: 2011-12-06 22:05:16 +0100 (Tue, 06 Dec 2011) $
-//
-//
-//
-//******************************************************************
-
-namespace LVL1MUCTPI {
-
-   MioctSectorSet::MioctSectorSet( const MioctID& theID, EventReader* reader )
-      : Barrel1( theID.getRapidityRegion(), theID.getFirstBarrelID() + 0, reader ),
-        Barrel2( theID.getRapidityRegion(), theID.getFirstBarrelID() + 1, reader ),
-        Barrel3( theID.getRapidityRegion(), theID.getFirstBarrelID() + 2, reader ),
-        Barrel4( theID.getRapidityRegion(), theID.getFirstBarrelID() + 3, reader ),
-        Endcap1( theID.getRapidityRegion(), theID.getFirstEndcapID() + 0, reader ),
-        Endcap2( theID.getRapidityRegion(), theID.getFirstEndcapID() + 1, reader ),
-        Endcap3( theID.getRapidityRegion(), theID.getFirstEndcapID() + 2, reader ),
-        Endcap4( theID.getRapidityRegion(), theID.getFirstEndcapID() + 3, reader ),
-        Endcap5( theID.getRapidityRegion(), theID.getFirstEndcapID() + 4, reader ),
-        Endcap6( theID.getRapidityRegion(), theID.getFirstEndcapID() + 5, reader ),
-        Forward1( theID.getRapidityRegion(), theID.getFirstForwardID() + 0, reader ),
-        Forward2( theID.getRapidityRegion(), theID.getFirstForwardID() + 1, reader ),
-        Forward3( theID.getRapidityRegion(), theID.getFirstForwardID() + 2, reader ),
-        m_logger( "MioctSectorSet" ), m_id( theID ) {
-
-      m_bitFieldList.push_back( Forward1.getBitFieldPtr() );
-      m_bitFieldList.push_back( Forward2.getBitFieldPtr() );
-      m_bitFieldList.push_back( Forward3.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap4.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap5.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap6.getBitFieldPtr() );
-      m_bitFieldList.push_back( Barrel1.getBitFieldPtr() );
-      m_bitFieldList.push_back( Barrel2.getBitFieldPtr() );
-      m_bitFieldList.push_back( Barrel3.getBitFieldPtr() );
-      m_bitFieldList.push_back( Barrel4.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap1.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap2.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap3.getBitFieldPtr() );
-   }
-
-   MioctSectorSet::MioctSectorSet( const MioctSectorSet& set )
-      : Barrel1( set.Barrel1 ), Barrel2( set.Barrel2 ), Barrel3( set.Barrel3 ),
-        Barrel4( set.Barrel4 ),
-        Endcap1( set.Endcap1 ), Endcap2( set.Endcap2 ), Endcap3( set.Endcap3 ),
-        Endcap4( set.Endcap4 ),
-        Endcap5( set.Endcap5 ), Endcap6( set.Endcap6 ), Forward1( set.Forward1 ),
-        Forward2( set.Forward2 ), Forward3( set.Forward3 ),
-        m_logger( "MioctSectorSet" ), m_id( set.m_id ) {
-
-      m_bitFieldList.push_back( Forward1.getBitFieldPtr() );
-      m_bitFieldList.push_back( Forward2.getBitFieldPtr() );
-      m_bitFieldList.push_back( Forward3.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap4.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap5.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap6.getBitFieldPtr() );
-      m_bitFieldList.push_back( Barrel1.getBitFieldPtr() );
-      m_bitFieldList.push_back( Barrel2.getBitFieldPtr() );
-      m_bitFieldList.push_back( Barrel3.getBitFieldPtr() );
-      m_bitFieldList.push_back( Barrel4.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap1.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap2.getBitFieldPtr() );
-      m_bitFieldList.push_back( Endcap3.getBitFieldPtr() );
-   }
-
-   void MioctSectorSet::report() const {
-
-      std::string sector_desc;
-
-      REPORT_VERBOSE_MSG( "Printing sectors in MioctSectorSet:" );
-
-      Barrel1.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Barrel1: " + sector_desc );
-      Barrel2.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Barrel2: " + sector_desc );
-      Barrel3.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Barrel3: " + sector_desc );
-      Barrel4.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Barrel4: " + sector_desc );
-
-      Endcap1.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Endcap1: " + sector_desc );
-      Endcap2.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Endcap2: " + sector_desc );
-      Endcap3.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Endcap3: " + sector_desc );
-      Endcap4.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Endcap4: " + sector_desc );
-      Endcap5.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Endcap5: " + sector_desc );
-      Endcap6.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Endcap6: " + sector_desc );
-
-      Forward1.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Forward1: " + sector_desc );
-      Forward2.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Forward2: " + sector_desc );
-      Forward3.printID( sector_desc );
-      REPORT_VERBOSE_MSG( "  Forward3: " + sector_desc );
-
-      return;
-   }
-
-   void MioctSectorSet::print() const {
-
-      std::string sector_data;
-
-      REPORT_VERBOSE_MSG( "Sector contents for " << m_id );
-
-      Barrel1.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Barrel1 --" << sector_data );
-      Barrel2.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Barrel2 --" << sector_data );
-      Barrel3.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Barrel3 --" << sector_data );
-      Barrel4.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Barrel4 --" << sector_data );
-
-      Endcap1.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Endcap1 --" << sector_data );
-      Endcap2.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Endcap2 --" << sector_data );
-      Endcap3.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Endcap3 --" << sector_data );
-      Endcap4.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Endcap4 --" << sector_data );
-      Endcap5.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Endcap5 --" << sector_data );
-      Endcap6.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Endcap6 --" << sector_data );
-
-      Forward1.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Forward1 --" << sector_data );
-      Forward2.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Forward2 --" << sector_data );
-      Forward3.print( sector_data );
-      REPORT_VERBOSE_MSG( "  -- Forward3 --" << sector_data );
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.h
deleted file mode 100644
index 023b9863d7be..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctSectorSet.h
+++ /dev/null
@@ -1,108 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MioctSectorSet.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_MIOCTSECTORSET_H
-#define TRIGT1MUCTPI_MIOCTSECTORSET_H
-
-// STL include(s):
-#include <vector>
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-#include "BarrelSector.h"
-#include "EndcapSector.h"
-#include "ForwardSector.h"
-#include "MioctID.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class EventReader;
-
-   /**
-    ************************************************************************
-    *
-    *    $Date: 2015-10-19 17:19:09 +0200 (Mon, 19 Oct 2015) $
-    *
-    *    @short Helper class creating and containing the Sectors of one MIOCT module.
-    *
-    *           The only function of this class is to create and to group
-    *           together the Sectors belonging to one MIOCT board.
-    *           Exceptionally all data members of this class are public!
-    *
-    *      @see MioctID
-    *      @see Sector
-    *      @see BarrelSector
-    *      @see EndcapSector
-    *      @see ForwardSector
-    *   @author $Author: krasznaa $
-    *  @version $Revision: 701446 $
-    *
-    *
-    ************************************************************************
-    */
-   class MioctSectorSet {
-
-   public:
-      /**
-       * The Constructor creates a set of Sectors which belong to one
-       * octant board MIOCT.
-       * @param id describes the Octant board for which the Sectors
-       *           have to be created.
-       */
-      MioctSectorSet( const MioctID& id, EventReader* reader );
-      MioctSectorSet( const MioctSectorSet& set );
-      MioctSectorSet  & operator = ( const MioctSectorSet  & ) = delete;
-      /**
-       * The four Barrel Sectors of the MIOCT module.
-       */
-      BarrelSector Barrel1, Barrel2, Barrel3, Barrel4;
-      /**
-       * The six Endcap Sectors of the MIOCT module.
-       */
-      EndcapSector Endcap1, Endcap2, Endcap3, Endcap4, Endcap5, Endcap6;
-      /**
-       * The three Forward Sectors of the MIOCT module.
-       */
-      ForwardSector Forward1, Forward2, Forward3;
-
-      /**
-       * method to get the number of Barrel Sectors
-       */
-      static unsigned int numberOfBarrelSectors() { return 4; }
-      /**
-       * method to get the number of Endcap Sectors
-       */
-      static unsigned int numberOfEndcapSectors() { return 6; }
-      /**
-       * method to get the number of Forward Sectors
-       */
-      static unsigned int numberOfForwardSectors() { return 3; }
-      /**
-       * This method returns a list of references to the bitfields
-       * of all the sectors belonging to this set
-       * @return List of references to the bitfields
-       *         of all sector in this set
-       */
-      const std::vector< unsigned int* >* getBitFieldSet() const { return &m_bitFieldList; }
-
-      /// Print which sectors belong to this set
-      void report() const;
-
-      /// Print the contents of the sectors
-      void print() const;
-
-   private:
-      std::vector< unsigned int* > m_bitFieldList;
-      mutable MsgLogger m_logger;
-      const MioctID m_id;
-
-   }; // class MioctSectorSet
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIOCTSECTORSET_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.cxx
deleted file mode 100644
index a1a752f6a445..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.cxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MultiplicityLogic.cxx 472835 2011-12-06 21:05:16Z stelzer $
-
-// Local include(s):
-#include "MultiplicityLogic.h"
-#include "SectorID.h"
-#include "MultiplicityStrategy.h"
-#include "InclusiveMultStrategy.h"
-#include "ExclusiveMultStrategy.h"
-#include "XMLMultStrategy.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    * The constructor creates all the possible multiplicity handling
-    * strategies, and puts them in its central "catalogue". By default
-    * it assigns the INCLUSIVE strategy as active.
-    */
-   MultiplicityLogic::MultiplicityLogic()
-      : m_logger( "MultiplicityLogic" ), m_currentStrategy( 0 ),
-        m_strategyMap() {
-
-      // Create the strategies:
-      m_strategyMap[ INCLUSIVE ] = new InclusiveMultStrategy();
-      m_strategyMap[ EXCLUSIVE ] = new ExclusiveMultStrategy();
-      m_strategyMap[ XML ]       = new XMLMultStrategy();
-
-      // "Activate" the inclusive strategy:
-      m_currentStrategy = m_strategyMap[ INCLUSIVE ];
-      std::string infoString ;
-      infoString = "Multiplicity Logic with default strategy " +
-         m_currentStrategy->getName() + " installed.";
-      REPORT_MSG(DEBUG, infoString); 
-   }
-
-   /**
-    * The destructor has to be careful to delete all the strategies that were
-    * created in the constructor.
-    */
-   MultiplicityLogic::~MultiplicityLogic() {
-
-      for( std::map< MultiplicityCalcType, MultiplicityStrategy* >::iterator it =
-              m_strategyMap.begin(); it != m_strategyMap.end(); ++it ) {
-         delete it->second;
-      }
-      m_strategyMap.clear();
-
-   }
-
-   /**
-    * The strategy can be any one of the strategies defined in the
-    * MultiplicityCalcType enumerator.
-    *
-    * @param type Type of the strategy that should be used
-    */
-   void MultiplicityLogic::changeStrategy( MultiplicityCalcType type ) {
-
-      m_currentStrategy = m_strategyMap[ type ];
-      std::string infoString = "Current Strategy changed to " +
-         m_currentStrategy->getName();
-      m_logger.send( INFO, infoString );
-
-      return;
-
-   }
-
-   void MultiplicityLogic::initializeXML( const std::string& xmlFile ) {
-
-      XMLMultStrategy* xmlstrat =
-         dynamic_cast< XMLMultStrategy* >( m_strategyMap[ XML ] );
-      if( ! xmlstrat ) {
-         m_logger.send( FATAL, "Couldn't cast XMLMultStrategy in initializeXML()!" );
-         return;
-      }
-
-      xmlstrat->initialize( xmlFile );
-      return;
-
-   }
-
-   /**
-    * This function should be called by all parts of the simulation when
-    * creating a PtMultiplicitySet object.
-    *
-    * @param pt The p<sub>T</sub> threshold of the candidate
-    * @param id The sector that produced the muon candidate
-    * @param firstCandidate <code>true</code> if the candidate is the first one in
-    *                       the sector, <code>false</code> otherwise
-    * @returns The multiplicity word from one muon candidate
-    */
-   PtMultiplicitySet
-   MultiplicityLogic::calculateMultiplicity( unsigned int pt,
-                                             const SectorID& id,
-                                             bool firstCandidate ) const {
-
-      //
-      // Use the active strategy to create the multiplicity object:
-      //
-      PtMultiplicitySet result;
-      if ( m_currentStrategy ){
-         result = m_currentStrategy->calculateMultiplicity( pt, id, firstCandidate );
-      } else {
-         m_logger.send( ERROR,
-                        "No overlap strategy set, cannot calculate multiplicity!" );
-      }
-
-      return result;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.h
deleted file mode 100644
index a24172b8ca78..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityLogic.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MultiplicityLogic.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIOCT_MULTIPLICITYLOGIC_H
-#define TRIGT1MUCTPI_MIOCT_MULTIPLICITYLOGIC_H
-
-// STL include(s):
-#include <map>
-
-// Local include(s):
-#include "../Common/MultiplicityCalcType.h"
-#include "../Common/PtMultiplicitySet.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class SectorID;
-   class MultiplicityStrategy;
-
-   /**
-    *    @date $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-    *
-    *   @short Top level class handling the multiplicity summation
-    *
-    *          All the parts of the simulation that need to create
-    *          PtMultiplicitySet objects, should create them using a
-    *          correctly configured instance of such an object. It can
-    *          be configured to use a variety of multiplicity handling
-    *          strategies, so all the other parts of the code don't need
-    *          to know how the multiplicities are handled at any given
-    *          time.
-    *
-    *  @author $Author: krasznaa $
-    * @version $Revision: 362102 $
-    */
-   class MultiplicityLogic {
-
-   public:
-      /// Constructor
-      MultiplicityLogic();
-      /// Destructor
-      ~MultiplicityLogic();
-
-      /// Change the multiplicity strategy
-      void changeStrategy( MultiplicityCalcType type );
-      /// Initialise the XML multiplicity strategy
-      void initializeXML( const std::string& xmlFile );
-
-      /// Create the multiplicity with the active strategy
-      PtMultiplicitySet calculateMultiplicity( unsigned int pt,
-                                               const SectorID& id,
-                                               bool firstCandidate ) const;
-
-   private:
-      /// Message logging object
-      MsgLogger                                               m_logger;
-      /// Pointer to the currently active multiplicity strategy
-      MultiplicityStrategy*                                   m_currentStrategy;
-      /// A map holding all the available multiplicity strategies
-      std::map< MultiplicityCalcType, MultiplicityStrategy* > m_strategyMap;
-
-   }; // class MultiplicityLogic
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIOCT_MULTIPLICITYLOGIC_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityStrategy.h
deleted file mode 100644
index 47156b1fff56..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MultiplicityStrategy.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MultiplicityStrategy.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIOCT_MULTIPLICITYSTRATEGY_H
-#define TRIGT1MUCTPI_MIOCT_MULTIPLICITYSTRATEGY_H
-
-// STL include(s):
-#include <string>
-
-// Local include(s):
-#include "../Common/PtMultiplicitySet.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class SectorID;
-
-   /**
-    *    @date $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-    *
-    *   @short Base class for handling different kinds of multiplicity treatments
-    *
-    *          The MIOCT boards calculate the multiplicities of muons in an
-    *          octant of the detector. The resulting multiplicities are represented
-    *          by a 6x3 bit multiplicity word. This multiplicity word can be
-    *          incremented in a number of ways. If the MIOCT sees a muon candidate
-    *          passing threshold "3", it can either just increment the corresponding
-    *          multiplicity in the multiplicity word, it can increment the
-    *          multiplicities corresponding to threshold "1", "2" and "3", or it can
-    *          basically increment any of the multiplicities.
-    *
-    *          This interface is used in the simulation to determine how the
-    *          multiplicity words should be created.
-    *
-    *  @author $Author: krasznaa $
-    * @version $Revision: 362102 $
-    */
-   class MultiplicityStrategy {
-
-   public:
-      /// Constructor specifying a strategy name
-      /**
-       * @param name The name of the derived strategy. Printed by the simulation code.
-       */
-      MultiplicityStrategy( const std::string& name ) : m_name( name ) {}
-      /// Destructor
-      virtual ~MultiplicityStrategy() {}
-
-      /// Multiplicity handling function
-      /**
-       * This function creates a PtMultiplicitySet object from one muon candidate
-       * coming from the specified sector. The MIOCTs are able to calculate the
-       * multiplicities from each sector differently. (For instance they can mask
-       * noisy sectors.)
-       *
-       * @param pt The p<sub>T</sub> threshold of the candidate
-       * @param id The sector that produced the muon candidate
-       * @param firstCandidate <code>true</code> if the candidate is the first one in
-       *                       the sector, <code>false</code> otherwise
-       * @returns The multiplicity word from one muon candidate
-       */
-      virtual PtMultiplicitySet calculateMultiplicity( unsigned int pt,
-                                                       const SectorID& id,
-                                                       bool firstCandidate ) const = 0;
-
-      /// Get the name of the strategy
-      /**
-       * The simulation uses this function to print what kind of strategy
-       * is being used to treat the muon multiplicities.
-       *
-       * @returns The name of the multiplicity strategy
-       */
-      const std::string& getName() const { return m_name; }
-
-   private:
-      /// Name of the multiplicity strategy
-      std::string m_name;
-
-   }; // class MultiplicityStrategy
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIOCT_MULTIPLICITYSTRATEGY_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.cxx
deleted file mode 100644
index ada773cdcb3d..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.cxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: NullStrategy.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// Local include(s):
-#include "NullStrategy.h"
-#include "MioctSectorSet.h"
-#include "MultiplicityLogic.h"
-
-//***********************************************************************
-//
-//       Version : $Revision: 362102 $
-//
-//   Description :
-//
-//        Author : $Author: krasznaa $
-//          Date : $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-//
-//
-//
-//***********************************************************************
-
-namespace LVL1MUCTPI {
-
-   NullStrategy::NullStrategy( const MultiplicityLogic* logic )
-      : OverlapStrategy( "No-Overlap-Consideration" ),
-        m_errorLogger("NullStrategy"), m_multiplicityLogic( logic ) {
-
-   }
-
-   NullStrategy::~NullStrategy() {
-
-   }
-
-   PtMultiplicitySet
-   NullStrategy::calculateMultiplicity( const MioctSectorSet& sectorData,
-                                        const MioctID& ) const {
-
-      //
-      // Blindly add the multiplicity of each candidate to the total multiplicity
-      // of this octant:
-      //
-      PtMultiplicitySet result;
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel1.getPtCand1(),
-                                                            sectorData.Barrel1.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel1.getPtCand2(),
-                                                            sectorData.Barrel1.getSectorID(),
-                                                            false );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel2.getPtCand1(),
-                                                            sectorData.Barrel2.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel2.getPtCand2(),
-                                                            sectorData.Barrel2.getSectorID(),
-                                                            false );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel3.getPtCand1(),
-                                                            sectorData.Barrel3.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel3.getPtCand2(),
-                                                            sectorData.Barrel3.getSectorID(),
-                                                            false );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel4.getPtCand1(),
-                                                            sectorData.Barrel4.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Barrel4.getPtCand2(),
-                                                            sectorData.Barrel4.getSectorID(),
-                                                            false );
-
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap1.getPtCand1(),
-                                                            sectorData.Endcap1.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap1.getPtCand2(),
-                                                            sectorData.Endcap1.getSectorID(),
-                                                            false );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap2.getPtCand1(),
-                                                            sectorData.Endcap2.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap2.getPtCand2(),
-                                                            sectorData.Endcap2.getSectorID(),
-                                                            false );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap3.getPtCand1(),
-                                                            sectorData.Endcap3.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap3.getPtCand2(),
-                                                            sectorData.Endcap3.getSectorID(),
-                                                            false );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap4.getPtCand1(),
-                                                            sectorData.Endcap4.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap4.getPtCand2(),
-                                                            sectorData.Endcap4.getSectorID(),
-                                                            false );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap5.getPtCand1(),
-                                                            sectorData.Endcap5.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap5.getPtCand2(),
-                                                            sectorData.Endcap5.getSectorID(),
-                                                            false );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap6.getPtCand1(),
-                                                            sectorData.Endcap6.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Endcap6.getPtCand2(),
-                                                            sectorData.Endcap6.getSectorID(),
-                                                            false );
-
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward1.getPtCand1(),
-                                                            sectorData.Forward1.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward1.getPtCand2(),
-                                                            sectorData.Forward1.getSectorID(),
-                                                            false );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward2.getPtCand1(),
-                                                            sectorData.Forward2.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward2.getPtCand2(),
-                                                            sectorData.Forward2.getSectorID(),
-                                                            false );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward3.getPtCand1(),
-                                                            sectorData.Forward3.getSectorID(),
-                                                            true );
-      result += m_multiplicityLogic->calculateMultiplicity( sectorData.Forward3.getPtCand2(),
-                                                            sectorData.Forward3.getSectorID(),
-                                                            false );
-
-      return result;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.h
deleted file mode 100644
index d65dc42492dd..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/NullStrategy.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: NullStrategy.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_NULLSTRATEGY_H
-#define TRIGT1MUCTPI_NULLSTRATEGY_H
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-#include "../Common/PtMultiplicitySet.h"
-#include "OverlapStrategy.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class MultiplicityLogic;
-
-   /**************************************************************************
-    *
-    *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-    *
-    *    @short No Overlap is considered while forming muon multiplicities for octanat boards.
-    *
-    *           When forming pt-multiplicies for octant boards with this
-    *           strategy active, all muon candidates of all sectors are
-    *           considered irrespectively wether or not they are in
-    *           overlapping regions.
-    *
-    *      @see OverlapStrategy
-    *      @see PtMultiplicitySet
-    *      @see MioctSectorSet
-    *   @author $Author: krasznaa $
-    *  @version $Revision: 362102 $
-    *
-    *
-    ************************************************************************
-    */
-   class NullStrategy : public OverlapStrategy {
-
-   public:
-      NullStrategy( const MultiplicityLogic* logic );
-      ~NullStrategy();
-      /**
-       * The implentation of the function to calculate the muon
-       * multiplicities without consideration of overlapping muon
-       * candidates.
-       * @return PtMultipliciySet is the result of the calculation.
-       * @param sectorData references to the Sectors of one MioctModule.
-       * @param id         Not used in this implementation of OverlapStrategy
-       */
-      virtual PtMultiplicitySet calculateMultiplicity ( const MioctSectorSet& sectorData,
-                                                        const MioctID& id ) const;
-
-   private:
-      MsgLogger m_errorLogger;
-      const MultiplicityLogic* m_multiplicityLogic;
-
-   }; // class NullStrategy
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_NULLSTRATEGY_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.cxx
deleted file mode 100644
index 883915efe795..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.cxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: OverlapLogic.cxx 650693 2015-03-01 16:53:48Z masato $
-
-// Gaudi/Athena include(s):
-#include "AthenaKernel/errorcheck.h"
-
-// Local include(s):
-#include "OverlapLogic.h"
-#include "NullStrategy.h"
-#include "LUTStrategy.h"
-#include "../Common/PtMultiplicitySet.h"
-#include "MioctSectorSet.h"
-#include "MultiplicityLogic.h"
-
-//***********************************************************************
-//
-//       Version : $Revision: 650693 $
-//
-//   Description :
-//
-//        Author : $Author: krasznaa $
-//          Date : $Date: 2015-03-01 17:53:48 +0100 (Sun, 01 Mar 2015) $
-//
-//
-//
-//***********************************************************************
-
-namespace LVL1MUCTPI {
-
-   OverlapLogic::OverlapLogic( MultiplicityLogic* logic )
-      : m_logger( "OverlapLogic" ), m_multiplicityLogic( logic ),
-        m_overlapStrategyMap() {
-
-      m_overlapStrategyMap[ NO_OVERLAP ] =
-         new NullStrategy( m_multiplicityLogic );
-      m_overlapStrategyMap[ LUT_OVERLAP ] =
-         new LUTStrategy( m_multiplicityLogic );
-
-      // set a default Strategy: no overlap consideration
-      m_currentStrategy = m_overlapStrategyMap[ NO_OVERLAP ];
-      REPORT_MSG(DEBUG, "Overlap Logic with default strategy " << m_currentStrategy->getName() << " installed.");
-   }
-
-   OverlapLogic::~OverlapLogic() {
-
-      std::map< StrategyName, OverlapStrategy* >::iterator itr =
-         m_overlapStrategyMap.begin();
-      std::map< StrategyName, OverlapStrategy* >::iterator end =
-         m_overlapStrategyMap.end();
-      for( ; itr != end; ++itr ) {
-         delete itr->second;
-      }
-      m_overlapStrategyMap.clear();
-   }
-
-   PtMultiplicitySet OverlapLogic::calculateMultiplicity( const MioctSectorSet& mioctData,
-                                                          const MioctID& mioct ) const {
-
-      PtMultiplicitySet result;
-      if ( m_currentStrategy ){
-         result = m_currentStrategy->calculateMultiplicity( mioctData, mioct );
-      } else {
-         REPORT_ERROR_MSG( "No overlap strategy set, cannot calculate multiplicity!" );
-      }
-
-      return result;
-   }
-
-   void OverlapLogic::changeStrategy( StrategyName newStrategy ) {
-
-      m_currentStrategy = m_overlapStrategyMap[ newStrategy ];
-      m_logger << INFO << "Current Strategy changed to " << m_currentStrategy->getName()
-               << MsgLogger::endmsg;
-
-      return;
-   }
-
-   StatusCode OverlapLogic::initializeLUT( const std::string& lutXMLFile, bool flagMode,
-                                           bool dumpLut,const std::string& runPeriod ) {
-
-      LUTStrategy* strat =
-         dynamic_cast< LUTStrategy* >( m_overlapStrategyMap[ LUT_OVERLAP ] );
-      if( ! strat ) {
-         REPORT_FATAL_MSG( "Couldn't cast strategy to LUTStrategy. Coding error!" );
-         return StatusCode::FAILURE;
-      }
-
-      CHECK( strat->initialize( lutXMLFile, flagMode, dumpLut, runPeriod ) );
-      return StatusCode::SUCCESS;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.h
deleted file mode 100644
index a3dbdb4649d6..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapLogic.h
+++ /dev/null
@@ -1,110 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: OverlapLogic.h 650693 2015-03-01 16:53:48Z masato $
-#ifndef TRIGT1MUCTPI_OVERLAPLOGIC_H
-#define TRIGT1MUCTPI_OVERLAPLOGIC_H
-
-// STL include(s):
-#include <map>
-#include <string>
-
-// Gaudi/Athena include(s):
-#include "GaudiKernel/StatusCode.h"
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-#include "StrategyName.h"
-#include "OverlapStrategy.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class MioctSectorSet;
-   class PtMultiplicitySet;
-   class MultiplicityLogic;
-
-   /**
-    *  @short Contains the logic to resolve overlapping muon candidates during multiplicity formation.
-    *
-    *         The  OverlapLogic  is  responsible for installing  various
-    *         strategies to  resolve the  overlap of different  sectors.
-    *         It contains a map which associates all possible strategies
-    *         to a StrategyName like it is defined in StrategyName.h.
-    *
-    *    @see OverlapStrategy
-    *    @see NullStrategy
-    *    @see MioctSectorSet
-    *    @see PtMultiplicitySet
-    *
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 650693 $
-    * $Date: 2015-03-01 17:53:48 +0100 (Sun, 01 Mar 2015) $
-    */
-   class OverlapLogic {
-
-   public:
-      /**
-       * The construcor builds up a map containing an instance of all
-       * possible overlap strategies mapped to their corresponding names.
-       * The constructor by defaults sets the current strategy to the
-       * NullStrategy.
-       * @see OverlapStrategy
-       * @see NullStrategy
-       * @see StrategyName.h
-       */
-      OverlapLogic( MultiplicityLogic* logic );
-      /**
-       * Simple destructor.
-       */
-      ~OverlapLogic();
-      /**
-       * This function lets the user change the Overlap Strategy used to
-       * resolve overlapping muon candidates.
-       * @param newStrategy is a StrategyName as defined in StrategyName.h
-       * @see StrategyName.h
-       */
-      void changeStrategy( StrategyName newStrategy );
-      /**
-       * This functions returns the name of the currently selected
-       * strategy to resolve overlap.
-       */
-      std::string getCurrentStrategyName() const { return m_currentStrategy->getName(); }
-      /**
-       * This member function calculates the pt multiplicity of an octant board
-       * under consideration of the current OverlapStrategy.
-       * @param mioctData is a reference to a set of Sectors belonging
-       *                  to one MIOCT board.
-       * @param mioct     Defines which MIOCT the data is coming from
-       * @see MioctSectorSet
-       */
-      PtMultiplicitySet calculateMultiplicity( const MioctSectorSet& mioctData,
-                                               const MioctID& mioct ) const;
-      /**
-       * This function breaks the model a bit in that it provides a direct connection
-       * between one of the OverlapStrategy implementations and the user.
-       *
-       * @param lutXMLFile Full path name to the XML file to load
-       * @param flagMode Controls the flagging mode of the LUT strategy
-       * @param dumpLut When set to true, detailed information is printed about the
-       *                loaded LUT
-       */
-      StatusCode initializeLUT( const std::string& lutXMLFile, bool flagMode,
-                                bool dumpLut, const std::string& runPeriod );
-
-   private:
-      mutable MsgLogger                          m_logger;
-      MultiplicityLogic*                         m_multiplicityLogic;
-      OverlapStrategy*                           m_currentStrategy;
-      std::map< StrategyName, OverlapStrategy* > m_overlapStrategyMap;
-
-   }; // class OverlapLogic
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_OVERLAPLOGIC_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.cxx
deleted file mode 100644
index 8004f54e887b..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: OverlapStrategy.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// Local include(s):
-#include "OverlapStrategy.h"
-
-//***********************************************************************
-//
-//       Version : $Revision: 362102 $
-//
-//   Description :
-//
-//        Author : $Author: krasznaa $
-//          Date : $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-//
-//***********************************************************************
-
-namespace LVL1MUCTPI {
-
-  OverlapStrategy::OverlapStrategy( std::string theName )
-    : m_name( theName ) {
-
-  }
-
-  OverlapStrategy::~OverlapStrategy() {
-
-  }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.h
deleted file mode 100644
index f446acce491f..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/OverlapStrategy.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: OverlapStrategy.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_OVERLAPSTRATEGY_H
-#define TRIGT1MUCTPI_OVERLAPSTRATEGY_H
-
-// STL include(s):
-#include <string>
-
-namespace LVL1MUCTPI {
-
-  // Forward declaration(s):
-  class MioctSectorSet;
-  class PtMultiplicitySet;
-  class MioctID;
-
-  /**
-   ************************************************************************
-   *
-   *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ 
-   *
-   *    @short Interface for a strategy to resolve overlap between muon candidates.
-   *
-   *           The   interface to   the  various   strategies  to resolve
-   *           overlapping  muon  candidates is  very simple  because the
-   *           strategies just  have to calculate  the pt-multiplicities.
-   *           Anyway the abstract class  is usefull in order  to support
-   *           polymorphism for the strategies.
-   *
-   *           The OverlapStrategy  class follows the Strategy-Pattern in
-   *           E.Gamma, R.Helm, R.Johnson, J.Vlissides "Design Patterns".
-   *           (It is very simple though, I admit...)
-   *
-   *      @see OverlapLogic
-   *      @see MioctModule
-   *      @see MioctSectorSet
-   *      @see PtMultiplicitySet
-   *   @author $Author: krasznaa $
-   *  @version $Revision: 362102 $
-   *
-   *
-   ************************************************************************
-   */
-  class OverlapStrategy {
-
-  public:
-    /**
-     * The constructor of a Strategy takes a string argument which is 
-     * the name of the strategy. Since standard strings have a copy
-     * constructor and this name string is the only data member of a
-     * strategy, all strategies automatically have a copy constructor.
-     * (Of course, if in a derived class more data members are needed, 
-     * for those also a copy constructor must exist, in order to have 
-     * one for the whole strategy.) This fact is important because in
-     * the OverlapLogic the strategies are put into a STL map for which
-     * a copy constructor is needed.
-     * @see OverlapLogic
-     */
-    OverlapStrategy( std::string theName );
-    virtual ~OverlapStrategy();
-    /**
-     * Here the calculcation of the multiplicity for the six different
-     * pt thresholds is performed. 
-     * @see MioctSectorSet
-     * @see PtMultiplicitySet
-     * @see MioctModule
-     * @param data  is the words corresponding to the sectors of a MioctModule.
-     * @param mioct defines which MIOCT the data is coming from
-     * @return PtMultiplicitySet is the result of the calculation. 
-     */
-    virtual PtMultiplicitySet calculateMultiplicity( const MioctSectorSet& data, const MioctID& mioct ) const = 0;
-    /**
-     * The OverlapLogic needs to acces the name of the strategy.
-     * @see OverlapLogic
-     * @return the name of the strategy. 
-     */
-    std::string getName() const { return m_name; }
-
-  private:
-
-    std::string m_name;
-
-  }; // class OverlapStrategy
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_OVERLAPSTRATEGY_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.cxx
deleted file mode 100644
index 83faf51fbf07..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.cxx
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Sector.cxx 796872 2017-02-13 15:03:25Z fwinkl $
-
-// STL include(s):
-#include <sstream>
-
-// Local include(s):
-#include "Sector.h"
-#include "../Common/PtMultiplicitySet.h"
-#include "../Common/SectorConstants.h"
-
-namespace LVL1MUCTPI {
-
-   Sector::Sector( const Hemisphere theHemisphere, const unsigned int theSectorNumber,
-                   EventReader* reader )
-      : m_bitField(0), m_registered( false ), m_rapidityRegion( theHemisphere ),
-        m_sectorNumber( theSectorNumber ), m_reader( reader ),
-        m_cand1Supressed( false ), m_cand2Supressed( false ) {
-
-   }
-
-   Sector::~Sector() {
-   }
-
-   std::string Sector::getRapidityString() const {
-
-      std::string result;
-      if( m_rapidityRegion == POSITIVE ) result = "+";
-      if( m_rapidityRegion == NEGATIVE ) result = "-";
-      return result;
-
-   }
-  std::string Sector::getIDString() const {
-    std::string result = "";
-    //offset for differnt counting scheme in MuCTPI geometry file for L1Topo
-    unsigned int offset =0;
-
-    if (this->getDetectorString() == "Barrel") {
-      result = "B";
-      if (this->getRapidityString() == "+") {
-	offset = 32;
-      }
-    } else if (this->getDetectorString() == "Endcap") {
-      if (this->getRapidityString() == "+") {
-	result = "EA";
-      }else if (this->getRapidityString() == "-") {
-	result = "EC";
-      }
-    } else if (this->getDetectorString() == "Forward") {
-      if (this->getRapidityString() == "+") {
-	result = "FA";
-      }else if (this->getRapidityString() == "-") {
-	result = "FC";
-      }
-    }
-    std::string secNumString = "";
-    if (m_sectorNumber+offset < 10) {
-      secNumString = "0" + std::to_string(m_sectorNumber + offset);
-    } else {
-      secNumString = std::to_string(m_sectorNumber + offset);
-    }
-
-    result = result + secNumString ;
-
-    return result;
-  }
-
-   void Sector::printID( std::string& IDString ) const {
-
-      std::ostringstream outStream ;
-      outStream << "Sector : " << m_sectorNumber
-                << "  Detector : " << this->getDetectorString()
-                << "  Rapidity region : " << this->getRapidityString();
-      IDString = outStream.str();
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.h
deleted file mode 100644
index abd95b4c0abf..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/Sector.h
+++ /dev/null
@@ -1,169 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: Sector.h 796872 2017-02-13 15:03:25Z fwinkl $
-#ifndef TRIGT1MUCTPI_SECTOR_H
-#define TRIGT1MUCTPI_SECTOR_H
-
-#include <string>
-#include "CxxUtils/bitscan.h"
-
-// Local include(s):
-#include "../Common/Detector.h"
-#include "../Common/MuctpiBitMasks.h"
-#include "SectorID.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class PtMultiplicitySet;
-   class EventReader;
-
-   /************************************************************************
-    *
-    *    $Date: 2017-02-13 16:03:25 +0100 (Mon, 13 Feb 2017) $ 
-    *
-    *    @short Base class for a Sector of the Muon Trigger chambers.
-    *
-    *           This is the abstract base class for a sector in the 
-    *           MUCTPI system. It contains the acutal data of the sector 
-    *           and an identifier. For the information which can be 
-    *           retrieved equally for all kinds of Sectors, access 
-    *           functions are provided.
-    *
-    *      @see SectorID
-    *      @see PtMultiplicitySet
-    *      @see BarrelSector
-    *      @see EndcapSector
-    *      @see ForwardSector
-    *      @see MuctpiBitMasks.h
-    *      @see SectorConstants.h
-    *      @see Detector.h
-    *   @author $Author: krasznaa $
-    *  @version $Revision: 796872 $
-    *
-    **//////////////////////////////////////////////////////////////////////
-   class Sector {
-
-   public:
-      /**
-       * The only constructor of a Sector, identified by its
-       * sector number and hemisphere
-       * @param theHemisphere   The Hemisphere the sector is in
-       * @param theSectorNumber The sector number
-       * @param reader          Helper class for reading the MuCTPI input
-       */
-      Sector( const Hemisphere   theHemisphere, 
-              const unsigned int theSectorNumber,
-              EventReader*       reader );
-      virtual ~Sector();
-      /**
-       * This function is abstract because when setting the bitfield
-       * a check is performed that none of the reserved bits is set. 
-       * Since these bits are at different positions in the different
-       * sector species, the implementation of this function has to 
-       * be done in the corresponding subclasses.
-       */
-      virtual void set( const unsigned int bitfield ) = 0;
-      /**
-       * The get function returns a const reference to the bitfield - 
-       * dont want to copy it for performance reasons 
-       * @return Reference to the BitFIeld
-       */
-      unsigned int* getBitFieldPtr() { return &m_bitField; }
-      /**
-       * Extract the threshold of Candidate 1.
-       */
-      unsigned int getPtCand1() const { return getValue(Pt1Mask); }
-      /**
-       * Extract the threshold of Candidate 2.
-       */
-      unsigned int getPtCand2() const { return getValue(Pt2Mask); }
-      virtual unsigned int getROI1() const = 0;
-      virtual unsigned int getROI2() const = 0; 
-      /**
-       * Determined if candidate 1 of the Sector overlaps with a barrel 
-       * sector. The default implementation returns false so that there
-       * is no implementation needed for the forward sector which is not
-       * overlapping.
-       * @return true if there is overlap.
-       */
-      virtual bool isCand1BarrelOverlap() const { return false; }
-      /**
-       * Determined if candidate 2 of the Sector overlaps with a barrel 
-       * sector. The default implementation returns false so that there
-       * is no implementation needed for the forward sector which is not
-       * overlapping.
-       * @return true if there is overlap.
-       */
-      virtual bool isCand2BarrelOverlap() const { return false; }
-      /**
-       * Determined if candidate 1 of the Sector overlaps with an endcap 
-       * sector. The default implementation returns false so that there
-       * is no implementation needed for the forward sector which is not
-       * overlapping.
-       * @return true if there is overlap.
-       */
-      virtual bool isCand1EndcapOverlap() const { return false; }
-      /**
-       * Determined if candidate 2 of the Sector overlaps with an endcap 
-       * sector. The default implementation returns false so that there
-       * is no implementation needed for the forward sector which is not
-       * overlapping.
-       * @return true if there is overlap.
-       */
-      virtual bool isCand2EndcapOverlap() const { return false; }
-      /**
-       * This function prints the identification of the Sector into
-       * the string it returns.
-       * @return string which contains the identification of the Sector.
-       */
-      void printID( std::string& IDString ) const;
-     /**
-      * get the ID of the sector as a string of type B30, FA12 ...
-      */
-      std::string getIDString() const;
-      virtual void print( std::string& TextDescription ) const = 0;
-      virtual std::string getDetectorString() const = 0;
-      std::string getRapidityString() const;
-      unsigned int getSectorNumber() const { return m_sectorNumber; }
-      unsigned int getBCID() const { return getValue( BCIDMask ); }
-      virtual SectorID getSectorID() const = 0;
-
-      void setCand1Supressed( bool flag ) const { m_cand1Supressed = flag; }
-      bool getCand1Supressed() const { return m_cand1Supressed; }
-      void setCand2Supressed( bool flag ) const  { m_cand2Supressed = flag; }
-      bool getCand2Supressed() const { return m_cand2Supressed; }
-
-   protected:
-      /**
-       * Contains the data of the current event.
-       */
-      unsigned int m_bitField;
-      bool m_registered;
-      /**
-       * This function retrieves information from the bitfield of a sector.
-       *
-       * @param mask the bitmask as defined in MuctpiBitMasks.h.
-       * @return the value of the bitfield defined by the mask.
-       * @see MuctpiBitMasks.h
-       */
-      unsigned int getValue( const BitMask mask ) const {
-        return (m_bitField & mask) >> CxxUtils::count_trailing_zeros(mask);
-      }
-
-      Hemisphere   m_rapidityRegion;
-      unsigned int m_sectorNumber;
-      EventReader* m_reader;
-
-      mutable bool m_cand1Supressed;
-      mutable bool m_cand2Supressed;
-
-   }; // class Sector
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_SECTOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.cxx
deleted file mode 100644
index 1b6c4d5ac538..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.cxx
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: SectorID.cxx 700318 2015-10-13 14:13:15Z wengler $
-
-// STL include(s):
-#include "SectorID.h"
-#include "../Common/SectorConstants.h"
-
-/*******************************************************************
- * $Date: 2015-10-13 16:13:15 +0200 (Tue, 13 Oct 2015) $
- *
- * Implementation of class SectorID
- * @author   Author: Thorsten Wengler
- * @version $Revision: 700318 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   /**
-    * This comparison operator should implement a monotone ordering
-    * between the SectorID objects.
-    *
-    * @param id1 First SectorID object
-    * @param id2 Second SectorID object
-    * @returns <code>true</code> if id1 is "smaller" than id2,
-    *          <code>false</code> otherwise
-    */
-   bool operator< ( const SectorID& id1, const SectorID& id2 ) {
-
-      if( id1.m_detectorType != id2.m_detectorType ) {
-         return ( id1.m_detectorType < id2.m_detectorType );
-      } else if( id1.m_rapidityRegion != id2.m_rapidityRegion  ) {
-         return ( id1.m_rapidityRegion < id2.m_rapidityRegion );
-      } else {
-         return ( id1.m_sectorNumber < id2.m_sectorNumber );
-      }
-
-   }
-
-   // constructor of class SectorID with no initialisation
-   SectorID::SectorID()
-      : m_detectorType( BARREL ), m_rapidityRegion( NEGATIVE ),
-        m_sectorNumber( 0 ) {
-
-   }
-
-   SectorID::SectorID( int code ) {
-
-      const int rapidity_border = ( MAX_BARREL_SECTOR + 1 ) +
-         ( MAX_ENDCAP_SECTOR + 1 ) + ( MAX_FORWARD_SECTOR + 1 );
-
-      if( code >= rapidity_border ) {
-         code -= rapidity_border;
-         m_rapidityRegion = POSITIVE;
-      } else {
-         m_rapidityRegion = NEGATIVE;
-      }
-
-      const int forward_border = ( MAX_BARREL_SECTOR + 1 ) +
-         ( MAX_ENDCAP_SECTOR + 1 );
-      const int endcap_border = MAX_BARREL_SECTOR + 1;
-
-      if( code >= forward_border ) {
-         code -= forward_border;
-         m_detectorType = FORWARD;
-      } else if( code >= endcap_border ) {
-         code -= endcap_border;
-         m_detectorType = ENDCAP;
-      } else {
-         m_detectorType = BARREL;
-      }
-
-      m_sectorNumber = code;
-
-   }
-
-   // constructor of class SectorID
-   SectorID::SectorID( Detector theDetector, Hemisphere theRegion,
-                       unsigned int theNumber )
-      : m_detectorType( theDetector ), m_rapidityRegion( theRegion ),
-        m_sectorNumber( theNumber ) {
-
-   }
-
-   // constructor of class SectorID taking numerical input values 
-   // as used in Lvl1MuCTPIInput
-   SectorID::SectorID( unsigned int theDetector, unsigned int theRegion,
-                       unsigned int theNumber ) {
-
-      this->setVal( theDetector, theRegion, theNumber );
-   }
-
-   // set method taking numerical input values
-   // as used in Lvl1MuCTPIInput
-   void SectorID::setVal( unsigned int theDetector, unsigned int theRegion,
-                          unsigned int theNumber ) {
-
-      if( theDetector == 0 ) m_detectorType = BARREL;
-      if( theDetector == 1 ) m_detectorType = ENDCAP;
-      if( theDetector == 2 ) m_detectorType = FORWARD;
-
-      if( theRegion == 0 ) m_rapidityRegion = NEGATIVE;
-      if( theRegion == 1 ) m_rapidityRegion = POSITIVE;
-
-      m_sectorNumber = theNumber;
-      return;
-
-   }
-
-   // set method taking numerical input values
-   // as used in Lvl1MuCTPIInput
-   SectorID SectorID::ret( unsigned int theDetector, unsigned int theRegion,
-                           unsigned int theNumber ){
-
-      this->setVal( theDetector, theRegion, theNumber );
-      return *this;
-
-   }
-
-   // implementation of method getDetectorType
-   unsigned int SectorID::getDetectorType() const {
-
-      if( m_detectorType == BARREL )  return 0;
-      if( m_detectorType == ENDCAP )  return 1;
-      if( m_detectorType == FORWARD ) return 2;
-
-      return 0;
-   }
-
-   // implementation of method getRapidityRegion
-   unsigned int SectorID::getRapidityRegion() const {
-
-      if( m_rapidityRegion == NEGATIVE ) return 0;
-      if( m_rapidityRegion == POSITIVE ) return 1;
-
-      return 0;
-   }
-
-   // comparison operator
-   bool SectorID::operator==( const SectorID& original ) const {
-
-      if ( ( this->m_detectorType == original.m_detectorType ) &&
-           ( this->m_rapidityRegion == original.m_rapidityRegion ) &&
-           ( this->m_sectorNumber == original.m_sectorNumber ) ) {
-         return true;
-      }
-      return false;
-
-   }
-
-   SectorID::operator int() const {
-
-      int retval = 0;
-
-      if( m_rapidityRegion == POSITIVE ) retval += ( MAX_BARREL_SECTOR + 1 ) +
-                                            ( MAX_ENDCAP_SECTOR + 1 ) +
-                                            ( MAX_FORWARD_SECTOR + 1 );
-
-      if( m_detectorType == ENDCAP ) retval += MAX_BARREL_SECTOR + 1;
-      else if( m_detectorType == FORWARD ) retval += ( MAX_BARREL_SECTOR + 1 ) +
-                                              ( MAX_ENDCAP_SECTOR + 1 );
-
-      retval += m_sectorNumber;
-
-      return retval;
-
-   }
-
-   // overload for <<
-   std::ostream & operator<<( std::ostream& out, const SectorID& right ) {
-
-      return out << "System: " << right.m_detectorType << " Hemisphere: "
-                 << right.m_rapidityRegion << " SectorNo: " << right.m_sectorNumber;
-
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.h
deleted file mode 100644
index 0e7b1e3cd5f6..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorID.h
+++ /dev/null
@@ -1,168 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: SectorID.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_SECTORID_H
-#define TRIGT1MUCTPI_SECTORID_H
-
-// STL include(s):
-#include <iostream>
-
-// Local include(s):
-#include "../Common/Detector.h"
-
-namespace LVL1MUCTPI {
-
-   //
-   // Declare a comparison operator. This is needed to be able to index
-   // an std::map with SectorID objects...
-   //
-   class SectorID;
-   bool operator< ( const SectorID& id1, const SectorID& id2 );
-
-   /**********************************************************************
-    *
-    *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ 
-    *
-    *    @short The Identifier of a Sector.
-    *
-    *           The SectorID contains all data to unambigously  identify 
-    *           a sector.  This data  contains the  detector  Type,  the 
-    *           sector  number, and the  rapidity region. Several access
-    *           functions allow to  read back these  data. SectorIDs can  
-    *           be set  only in  their constructor. Two constructors are   
-    *           available.  The  first   takes   values  as  defined  in   
-    *           Detector.h, the secondtakes  numerical  values  as  used  
-    *           in the  Lvl1MuCTPIInput class.  It  is not  possible  to   
-    *           change  the values after construction.
-    *
-    *      @see Detector.h
-    *      @see SectorConstants.h
-    *      @see Lvl1MuCTPIInput
-    *   @author $Author: krasznaa $
-    *  @version $Revision: 362102 $
-    *
-    ********************************************************************
-    */
-   class SectorID {
-
-      // Declare the comparison operator as a friend of the class:
-      friend bool operator< ( const SectorID&, const SectorID& );
-
-   public: 
-      /**
-       * The default constructor - no values are set - they are expected
-       * to be set by the set method instead
-       * @see SectorID::set()
-       */
-      SectorID();
-      /**
-       * This constructor should only be used by the XML multiplicity calculator.
-       * The sectors are identified by a single integer number in the XML files
-       * with the following encoding:
-       *
-       *   0 --  31 :  BARREL sectors, NEGATIVE side
-       *  32 --  79 :  ENDCAP sectors, NEGAVIVE side
-       *  80 -- 103 : FORWARD sectors, NEGATIVE side
-       * 104 -- 135 :  BARREL sectors, POSITIVE side
-       * 136 -- 183 :  ENDCAP sectors, POSITIVE side
-       * 184 -- 207 : FORWARD sectors, POSITIVE side
-       */
-      SectorID( int code );
-      /**
-       * This constructor takes the information to initialize the 
-       * SectorID from three different arguments
-       * @param theDetector as defined in Detector.h
-       * @param theRegion   as defined in Detector.h
-       * @param theNumber   the sector number. Valid ranges depend
-       *                    on the Detector Type and are defined in SectorConstants.h
-       */
-      SectorID( Detector theDetector, Hemisphere theRegion, unsigned int theNumber );
-      /**
-       * This constructor takes the information to initialize the 
-       * SectorID from three different numerical arguments
-       * @param theDetector  system ID as used in Lvl1MuCTPIInput
-       * @param theRegion    subsystem ID as used in Lvl1MuCTPIInput
-       * @param theNumber    is the sector number. Valid ranges depend
-       *                     on the Detector Type and are defined in SectorConstants.h
-       * @see Lvl1MuCTPIInput
-       */
-      SectorID( unsigned int theDetector, unsigned int theRegion,
-                unsigned int theNumber );
-      /**
-       * This method takes the information to initialize the 
-       * SectorID from three different numerical arguments
-       * and sets the data members
-       * @param theDetector  system ID as used in Lvl1MuCTPIInput
-       * @param theRegion    subsystem ID as used in Lvl1MuCTPIInput
-       * @param theNumber    is the sector number. Valid ranges depend
-       *                     on the Detector Type and are defined in SectorConstants.h
-       * @see Lvl1MuCTPIInput
-       */
-      void setVal( unsigned int theDetector, unsigned int theRegion,
-                   unsigned int theNumber );
-      /**
-       * This method takes the information to initialize the 
-       * SectorID from three different numerical arguments
-       * and returns this object by value, e.g. for use as an
-       * argument in fuction calls
-       * @param theDetector  system ID as used in Lvl1MuCTPIInput
-       * @param theRegion    subsystem ID as used in Lvl1MuCTPIInput
-       * @param theNumber    is the sector number. Valid ranges depend
-       *                     on the Detector Type and are defined in SectorConstants.h
-       * @return this SectorID object by value
-       * @see Lvl1MuCTPIInput
-       */
-      SectorID ret( unsigned int theDetector, unsigned int theRegion,
-                    unsigned int theNumber );
-      /**
-       * This method returns the Detector type as a number, as used by
-       * the Lvl1MuCTPIInput class
-       * @return the detector type
-       * @see Lvl1MuCTPIInput
-       */
-      unsigned int getDetectorType() const;
-      /**
-       * This method returns the Rapidity region as a number, as used by 
-       * the Lvl1MuCTPIInput class
-       * @return the rapiduty region
-       * @see Lvl1MuCTPIInput
-       */
-      unsigned int getRapidityRegion() const;
-      /**
-       * This method returns the Sector number
-       * @return the sector number
-       */
-      unsigned int getSectorNumber() const { return m_sectorNumber; }
-      /**
-       * Provide a comparison operator
-       */
-      bool operator== ( const SectorID& ) const;
-      /**
-       * This operator is used when the sector ID has to be stored as a single
-       * integer number. (When reading the multiplicity handling from an XML
-       * file.) Compare this with the constructor accepting a single integer.
-       */
-      operator int() const;
-      /**
-       * overload the << operator to have easy printout
-       */
-      friend std::ostream& operator<< ( std::ostream&, const SectorID& );
-      /**
-       * The destructor of class SectorID - nothing to destruct
-       */
-      ~SectorID() = default;
-
-   private:
-      Detector      m_detectorType;
-      Hemisphere    m_rapidityRegion;
-      unsigned int  m_sectorNumber;
-
-   }; // class SectorID
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_SECTORID_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.cxx
deleted file mode 100644
index 333d333786c5..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.cxx
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: SectorLogicReader.cxx 364083 2011-05-06 09:09:55Z krasznaa $
-
-// STL include(s):
-#include <cassert>
-#include <stdexcept>
-#include <typeinfo>
-#include <algorithm>
-
-// TrigT1 include(s):
-#include "TrigT1Interfaces/Lvl1MuSectorLogicData.h"
-
-// Local include(s):
-#include "SectorLogicReader.h"
-#include "Sector.h"
-
-namespace LVL1MUCTPI {
-
-   // constructor of the SectorLogicReader
-   SectorLogicReader::SectorLogicReader() : EventReader() {
-
-      m_validReader = false;
-      m_eventSourceFlag = false;
-      m_registerFlag = false;
-      m_infoString = "No Source set yet; no Sectors registered yet." ;
-      m_logger.send( INFO, "SectorLogicReader installed as Event Reader" );
-   }
-
-   SectorLogicSource& SectorLogicReader::getSource() {
-
-      return m_source;
-   }
-
-   void SectorLogicReader::setEventSource( EventSource& source ) {
-
-      try {
-
-         SectorLogicSource& theSectorLogicSource =
-            dynamic_cast< SectorLogicSource& >( source );
-
-         if( ! m_eventSourceFlag ) {
-
-            m_source = theSectorLogicSource;
-            m_eventSourceFlag = true;
-
-            if( m_registerFlag ) {
-               m_infoString = "valid Sector Logic Reader installed";
-               m_validReader = true;
-            } else {
-               m_infoString = "no Sectors registered yet";
-            }
-
-         } else {
-            REPORT_ERROR_MSG( "changing the EventSource of SectorLogicReader is "
-                              "not supported" );
-            m_logger << INFO << "continuing with previously installed "
-                     << "EventSource"  << MsgLogger::endmsg;
-         }
-
-      } catch ( const std::bad_cast& ) {
-         REPORT_ERROR_MSG( "The SectorLogicReader needs a SectorLogicSource as "
-                           "EventSource !" );
-         return;
-      }
-
-      return;
-   }
-
-   void SectorLogicReader::registerSector( Sector* newSector ) {
-
-      InputSector* newInputSector = new InputSector( newSector, m_source );
-      m_inputSectorList.push_back( newInputSector );
-      m_registerFlag = true;
-      if( m_eventSourceFlag ) {
-         m_infoString = "valid SectorLogicReader installed";
-         m_validReader = true;
-      } else {
-         m_infoString = "No Source set yet";
-      }
-      return;
-  }
-
-   void SectorLogicReader::unregisterSector( Sector* obsoleteSector ) {
-
-      std::list< SectorLogicReader::InputSector* >::iterator it;
-      it = std::find_if( m_inputSectorList.begin(), m_inputSectorList.end(),
-                         SectorLogicReader::InputSector::Sector_eq( obsoleteSector ) );
-      if( it != m_inputSectorList.end() ) {
-         delete *it;
-         m_inputSectorList.erase( it );
-      } else {
-         m_logger.send( WARNING,
-                        "Trying to unregister a non-existent Sector. \n"
-                        "Continue without having done anything...");
-      }
-      return;
-   }
-
-   bool SectorLogicReader::putNextEvent() {
-
-      std::list< SectorLogicReader::InputSector* >::iterator it;
-      for( it =  m_inputSectorList.begin(); it != m_inputSectorList.end(); ++it ) {
-
-         // I have to cope with getting a new object each event here from
-         // StoreGate - so need to re-get the address of the SectorLogicWord
-         ( *it )->getDataSource();
-
-         // put the event data
-         ( *it )->putEventData();
-      }
-
-      // increase the Event ID by one
-      m_eventID.incrementEvID();
-
-      // there is no reason why this could go wrong --> return always true
-      return true;
-   }
-
-   SectorLogicReader::~SectorLogicReader() {
-
-      std::list< SectorLogicReader::InputSector* >::iterator it;
-      for( it =  m_inputSectorList.begin(); it != m_inputSectorList.end(); ++it ) {
-         delete ( *it );
-      }
-   }
-
-   // contructor of the input sector helper class
-   SectorLogicReader::InputSector::InputSector( Sector* theSector,
-                                                SectorLogicSource& theSource ) {
-
-      m_sectorPointer = theSector;
-      m_rememberTheSource = &theSource;
-      m_sectorLogicPointer = &theSource.getSectorLogicAddress(theSector);
-   }
-
-   // re-get data source since there might be a new object each event
-   void SectorLogicReader::InputSector::getDataSource() {
-
-      m_sectorLogicPointer = &m_rememberTheSource->getSectorLogicAddress( m_sectorPointer );
-      return;
-   }
-
-   // get new data word for this sector from the input
-   void SectorLogicReader::InputSector::putEventData() {
-
-      m_sectorPointer->set( m_sectorLogicPointer->getWordFormat() );
-      return;
-   }
-
-   // destructor of the input sector helper class
-   SectorLogicReader::InputSector::~InputSector() {
-
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.h
deleted file mode 100644
index 99bc5f3d8bd8..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicReader.h
+++ /dev/null
@@ -1,153 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: SectorLogicReader.h 364083 2011-05-06 09:09:55Z krasznaa $
-#ifndef TRIGT1MUCTPI_SECTORLOGICREADER_H
-#define TRIGT1MUCTPI_SECTORLOGICREADER_H
-
-// STL include(s):
-#include <list>
-#include <string>
-
-// Local include(s):
-#include "EventReader.h"
-#include "../Common/EventID.h"
-#include "SectorLogicSource.h"
-
-namespace LVL1MUCTPI {
-
-   /**
-    *  @short EventReader to read from the Sector Logic interface.
-    *
-    *         The SectorLogicReader Singleton tries to read an input 
-    *         word for each registered sector from the interface class
-    *         of the Muon Sector Logic simulation. If no input word is 
-    *         found for a sector, the program terminates with a fatal
-    *         error, as all inputs should always be present.
-    *           
-    *    @see EventReaderFactory
-    *    @see EventReader
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 364083 $
-    * $Date: 2011-05-06 11:09:55 +0200 (Fri, 06 May 2011) $
-    */
-   class SectorLogicReader : public EventReader {
-
-   public:
-      SectorLogicReader();
-      virtual ~SectorLogicReader();
-      /**
-       * This routine returns true if all registered sectors are available
-       * as input from the SectorLogic interface
-       * @return true if the SectorLogicReader has been correctly installed
-       *         and can be used.
-       */
-      virtual bool isValid() const { return m_validReader; }
-      /**
-       * After a call to isValid() this routine gives back a string which
-       * contains the reason why the MifFileReader is not valid.
-       * This can be for example the case if a sector has been registered
-       * for which no corresponding input could be found.
-       * @return string contains some text indicating the reason why
-       *         the EventReader is not vaild.
-       * @see EventReader::isValid()
-       */
-      virtual std::string getInfoString() const { return m_infoString; }
-      void setEventSource ( EventSource & source );
-      SectorLogicSource& getSource();
-      /**
-       * This functions stores the pointer to the sector which it needs to
-       * update the sectors data field after an event-read.
-       * @param newSector Pointer to a Sector which wants to be updated after
-       *                  a new event has been read in.
-       */
-      virtual void registerSector( Sector* newSector );
-      /**
-       * This function is called in order to erase the pointer to a Sector
-       * which is hold in the list of currently available sectors.
-       * @param obsoleteSector is the pointer to the Sector to be erased from the
-       *                       sector-list
-       */
-      virtual void unregisterSector( Sector* obsoleteSector );
-      /**
-       * The next event is read in for all Sectors.
-       * @return If the read process fails to read data for a sector which
-       *         is registered, false is returned.
-       */
-      virtual bool putNextEvent();
-
-   private:
-      /// a helper class for internal Sector administration
-      class InputSector {
-
-      public:
-         /**
-          * This functon is used by the unregister method of the sectors.
-          * It is the predicate used to find an InputSector if the corresponding
-          * pointer to the Sector is given.
-          */
- 	 class Sector_eq {
-
-         public:
-            Sector_eq( Sector* sectorToSearch) : 
-               m_searchSector( sectorToSearch ) {}
-            bool operator () ( const SectorLogicReader::InputSector* argumentSector ) {
-               return ( argumentSector->getSectorPointer() == m_searchSector );
-            }
-
-         private:
-            Sector* m_searchSector;
-         }; // class Sector_eq
-
-         /**
-          * This inline function returns the Sector* pointer of this
-          * InputSector
-          */
-         inline Sector* getSectorPointer() const { return m_sectorPointer; }
-         /**
-          * The constructor of the InputSector helper class gets the 
-          * Sector pointer of the Sector in question and a pointer
-          * to the event source. This information is used to resolve
-          * where in the EventSource data for this Sector should be read
-          */
-         InputSector( Sector* theSector, SectorLogicSource & theSource );
-         /**
-          * method to refresh the data source for this sector in case
-          * there is a new input object in each event
-          */
-         void getDataSource();
-         /** 
-          * method to get the data for this sector from the event source
-          */
-         void putEventData();
-         /** 
-          * destructor of the InputSector Helper class
-          */
-         ~InputSector();
-
-      private:
-         // private data members of the InputSector helper class
-         Sector*                                  m_sectorPointer;
-         const LVL1MUONIF::Lvl1MuSectorLogicData* m_sectorLogicPointer;
-         SectorLogicSource *                      m_rememberTheSource;
-
-      }; // class InputSector
-
-      // private data members of the SectorLogicReader
-      EventID                   m_eventID;
-      bool                      m_validReader;
-      bool                      m_registerFlag;
-      bool                      m_eventSourceFlag;
-      std::list< InputSector* > m_inputSectorList;
-      SectorLogicSource         m_source;
-
-   }; // class SectorLogicReader
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_SECTORLOGICREADER_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.cxx
deleted file mode 100644
index 239159444577..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.cxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: SectorLogicSource.cxx 700318 2015-10-13 14:13:15Z wengler $
-
-// TrigT1 include(s):
-#include "TrigT1Interfaces/Lvl1MuCTPIInput.h"
-
-// Local include(s):
-#include "SectorLogicSource.h"
-#include "Sector.h"
-
-namespace LVL1MUCTPI {
-
-   // constructor of SectorLogicSource
-  SectorLogicSource::SectorLogicSource(): m_lvl1MuCTPIInput(nullptr),m_bcidOffset(0) {
-
-   }
-
-   // implementation of method to set the pointer to the Lvl1MuCTPIInput
-   // object holding the input data
-   void SectorLogicSource::
-   setSectorLogicSource( const LVL1MUONIF::Lvl1MuCTPIInput* theInput ) {
-
-      m_lvl1MuCTPIInput  = theInput;
-      return;
-   }
-
-   // implementation of method to get the pointer to the Lvl1MuCTPIInput
-   // object holding the input data
-   const LVL1MUONIF::Lvl1MuCTPIInput*
-   SectorLogicSource::getSectorLogicSource() const {
-
-      return m_lvl1MuCTPIInput;
-   }
-
-   const LVL1MUONIF::Lvl1MuSectorLogicData&
-   SectorLogicSource::getSectorLogicAddress( const Sector* theSector ) {
-
-      unsigned int systemAddress = 0;
-      unsigned int subSystemAddress = 0;
-      unsigned int sectorAddress = 0;
-
-      if( theSector->getDetectorString() == "Barrel" ) {
-         systemAddress = m_lvl1MuCTPIInput->idBarrelSystem();
-         sectorAddress = (theSector->getSectorNumber());
-      }
-      if( theSector->getDetectorString() == "Endcap" ) {
-         systemAddress = m_lvl1MuCTPIInput->idEndcapSystem();
-         sectorAddress = theSector->getSectorNumber();
-      }
-      if( theSector->getDetectorString() == "Forward" ) {
-         systemAddress = m_lvl1MuCTPIInput->idForwardSystem();
-         sectorAddress = theSector->getSectorNumber();
-      }
-      if( theSector->getRapidityString() == "+" )
-         subSystemAddress = m_lvl1MuCTPIInput->idSideA();
-      if( theSector->getRapidityString() == "-" )
-         subSystemAddress = m_lvl1MuCTPIInput->idSideC();
-
-      const LVL1MUONIF::Lvl1MuSectorLogicData& dataOut =
-         m_lvl1MuCTPIInput->getSectorLogicData( systemAddress, subSystemAddress,
-                                                sectorAddress, m_bcidOffset );
-
-      return dataOut;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.h
deleted file mode 100644
index dc471a399a05..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/SectorLogicSource.h
+++ /dev/null
@@ -1,84 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: SectorLogicSource.h 681356 2015-07-08 12:17:52Z wengler $
-#ifndef TRIGT1MUCTPI_SECTORLOGICSOURCE_H
-#define TRIGT1MUCTPI_SECTORLOGICSOURCE_H
-
-// STL include(s):
-#include <string>
-
-// Local include(s):
-#include "EventSource.h"
-
-// Forward declaration(s):
-namespace LVL1MUONIF {
-  class Lvl1MuCTPIInput;
-  class Lvl1MuSectorLogicData;
-}
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class Sector;
-
-   /**
-    *  @short The EventSource for the SectorLogicReader
-    *
-    *         This EventSource consists of an Lvl1MuCTPIInput object
-    *         as provided by the simulation of the Muon Trigger
-    *         system simulation. The pointer to the input object is
-    *         set with the setSectorLogicSource method. A pointer
-    *         to the sector in the input object which hold the data
-    *         word for the sector to be filled is retrieved using the
-    *         getSectorLogicPointer method.
-    *
-    *    @see SectorLogicReader
-    *    @see Lvl1MuCTPIInput
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 681356 $
-    * $Date: 2015-07-08 14:17:52 +0200 (Wed, 08 Jul 2015) $
-    */
-   class SectorLogicSource : public EventSource {
-
-   public:
-      SectorLogicSource();
-      /**
-       * Sets the pointers to the Lvl1MuCTPIInput which holds the input
-       * data from the Sector Logic
-       */
-      void setBcidOffset( int bcidOffset) { m_bcidOffset= bcidOffset; }
-      int getBcidOffset() { return m_bcidOffset; }
-      void setSectorLogicSource( const LVL1MUONIF::Lvl1MuCTPIInput* );
-      /**
-       * Gets the pointer to the Lvl1MuCTPIInput which holds the input
-       * data from the
-       */
-      const LVL1MUONIF::Lvl1MuCTPIInput* getSectorLogicSource() const;
-      /**
-       * Retrieves the pointer of the Lvl1MuSectorLogicData object in
-       * which the dataword of the argument Sector can be found.
-       */
-      const LVL1MUONIF::Lvl1MuSectorLogicData& getSectorLogicAddress( const Sector* Sector );
-      /**
-       * This function is dummy. It only exists in order to be able
-       * to use the dynamic_cast for the EventSource objects. (At least
-       * one abstract method needs to be defined in the base class in
-       * order to be able to use the dynamic_cast).
-       */
-      virtual const char* printSource() const { return "printSource is a dummy"; }
-
-   private:
-      const LVL1MUONIF::Lvl1MuCTPIInput* m_lvl1MuCTPIInput;
-      int m_bcidOffset;
-
-   }; // class SectorLogicSource
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_SECTORLOGICSOURCE_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/StrategyName.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/StrategyName.h
deleted file mode 100644
index 1ed3d56804a9..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/StrategyName.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: StrategyName.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_STRATEGYNAME_H
-#define TRIGT1MUCTPI_STRATEGYNAME_H
-
-namespace LVL1MUCTPI {
-
-  enum StrategyName { NO_OVERLAP, DEMONSTRATOR_OVERLAP, LEGACY_LUT_OVERLAP, LUT_OVERLAP };
-
-}
-
-#endif // TRIGT1MUCTPI_STRATEGYNAME_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.cxx
deleted file mode 100644
index d44416c69527..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.cxx
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: XMLMultCalculator.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// STL include(s):
-#include <string>
-#include <sstream>
-
-// XercesC include(s):
-#include <xercesc/dom/DOMElement.hpp>
-#include <xercesc/dom/DOMNodeList.hpp>
-#include <xercesc/util/XMLString.hpp>
-
-// Local include(s):
-#include "XMLMultCalculator.h"
-#include "../Common/SectorConstants.h"
-
-using namespace std;
-using namespace xercesc;
-
-namespace LVL1MUCTPI {
-
-   bool operator== ( const XMLMultCalculator& calc1,
-                     const XMLMultCalculator& calc2 ) {
-
-      return ( calc1.m_lut == calc2.m_lut );
-
-   }
-
-   XMLMultCalculator::XMLMultCalculator( const xercesc::DOMNode* node )
-      : m_lut( MAX_NUMBER_OF_THRESHOLDS,
-               vector< bool >( MAX_NUMBER_OF_THRESHOLDS, false ) ),
-        m_logger( "XMLMultCalculator" ) {
-
-      if( node ) initialize( node );
-
-   }
-
-   XMLMultCalculator::XMLMultCalculator( const XMLMultCalculator& parent )
-      : m_lut( parent.m_lut ), m_logger( "XMLMultCalculator" ) {
-
-   }
-
-   XMLMultCalculator::~XMLMultCalculator() {
-
-   }
-
-   void XMLMultCalculator::initialize( const xercesc::DOMNode* node ) {
-
-      //
-      // Re-initialise the LUT:
-      //
-      m_lut.clear();
-      m_lut.insert( m_lut.begin(), MAX_NUMBER_OF_THRESHOLDS,
-                    vector< bool >( MAX_NUMBER_OF_THRESHOLDS, false ) );
-
-      if( node->getNodeType() != DOMNode::ELEMENT_NODE ) {
-         m_logger.send( ERROR, "initialize() : Received node is not a DOMElement" );
-         return;
-      }
-
-      const DOMElement* top_element = dynamic_cast< const DOMElement* >( node );
-      if( ! top_element ) {
-         m_logger.send( ERROR, "initialize() : dynamic cast to DOMElement failed" );
-         return;
-      }
-
-      const DOMNodeList* lut_list = top_element->getChildNodes();
-
-      m_logger.send( VERBOSE, "initialize() : Looping over thresholds" );
-
-      for( XMLSize_t i = 0; i < lut_list->getLength(); ++i ) {
-
-         const DOMNode* lut_node = lut_list->item( i );
-         char* cname = XMLString::transcode( lut_node->getNodeName() );
-         string sname( cname );
-         XMLString::release( &cname );
-
-         if( sname != "Threshold" ) continue;
-
-         const DOMElement* lut_element = dynamic_cast< const DOMElement* >( lut_node );
-         if( ! lut_element ) {
-            m_logger.send( ERROR, "initialize() : Unable to cast LUT node into DOMElement" );
-            return;
-         }
-
-         XMLCh*   id_name = XMLString::transcode( "ID" );
-         XMLCh* thr1_name = XMLString::transcode( "thr1" );
-         XMLCh* thr2_name = XMLString::transcode( "thr2" );
-         XMLCh* thr3_name = XMLString::transcode( "thr3" );
-         XMLCh* thr4_name = XMLString::transcode( "thr4" );
-         XMLCh* thr5_name = XMLString::transcode( "thr5" );
-         XMLCh* thr6_name = XMLString::transcode( "thr6" );
-
-         const XMLCh* id   = lut_element->getAttribute( id_name );
-         const XMLCh* thr1 = lut_element->getAttribute( thr1_name );
-         const XMLCh* thr2 = lut_element->getAttribute( thr2_name );
-         const XMLCh* thr3 = lut_element->getAttribute( thr3_name );
-         const XMLCh* thr4 = lut_element->getAttribute( thr4_name );
-         const XMLCh* thr5 = lut_element->getAttribute( thr5_name );
-         const XMLCh* thr6 = lut_element->getAttribute( thr6_name );
-
-         XMLString::release( &id_name );
-         XMLString::release( &thr1_name );
-         XMLString::release( &thr2_name );
-         XMLString::release( &thr3_name );
-         XMLString::release( &thr4_name );
-         XMLString::release( &thr5_name );
-         XMLString::release( &thr6_name );
-
-         const int   id_n = XMLString::parseInt( id );
-         const int thr1_n = XMLString::parseInt( thr1 );
-         const int thr2_n = XMLString::parseInt( thr2 );
-         const int thr3_n = XMLString::parseInt( thr3 );
-         const int thr4_n = XMLString::parseInt( thr4 );
-         const int thr5_n = XMLString::parseInt( thr5 );
-         const int thr6_n = XMLString::parseInt( thr6 );
-
-         m_lut[ id_n - 1 ][ 0 ] = ( thr1_n != 0 ) ? true : false;
-         m_lut[ id_n - 1 ][ 1 ] = ( thr2_n != 0 ) ? true : false;
-         m_lut[ id_n - 1 ][ 2 ] = ( thr3_n != 0 ) ? true : false;
-         m_lut[ id_n - 1 ][ 3 ] = ( thr4_n != 0 ) ? true : false;
-         m_lut[ id_n - 1 ][ 4 ] = ( thr5_n != 0 ) ? true : false;
-         m_lut[ id_n - 1 ][ 5 ] = ( thr6_n != 0 ) ? true : false;
-
-         ostringstream message;
-         message << "  threshold " << id_n << ": th1=" << m_lut[ id_n - 1 ][ 0 ]
-                 << "; th2=" << m_lut[ id_n - 1 ][ 1 ] << "; th3=" << m_lut[ id_n - 1 ][ 2 ]
-                 << "; th4=" << m_lut[ id_n - 1 ][ 3 ] << "; th5=" << m_lut[ id_n - 1 ][ 4 ]
-                 << "; th6=" << m_lut[ id_n - 1 ][ 5 ];
-         m_logger.send( VERBOSE, message.str() );
-
-      }
-
-      return;
-
-   }
-
-   PtMultiplicitySet
-   XMLMultCalculator::calculateMultiplicity( unsigned int pt ) const {
-
-      PtMultiplicitySet result;
-
-      if( ( pt >= 1 ) && ( pt <= MAX_NUMBER_OF_THRESHOLDS ) ) {
-         for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) {
-            if( m_lut[ pt - 1 ][ i ] ) result.addMuon( i + 1 );
-         }
-      }
-
-      return result;
-
-   }
-
-} // LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.h
deleted file mode 100644
index 4ee974ae1430..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultCalculator.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: XMLMultCalculator.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_MIOCT_XMLMULTCALCULATOR_H
-#define TRIGT1MUCTPI_MIOCT_XMLMULTCALCULATOR_H
-
-// STL include(s):
-#include <vector>
-
-// XercesC include(s):
-#include <xercesc/dom/DOMNode.hpp>
-
-// Local include(s):
-#include "../Common/PtMultiplicitySet.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   class XMLMultCalculator;
-   bool operator== ( const XMLMultCalculator& calc1,
-                     const XMLMultCalculator& calc2 );
-
-   class XMLMultCalculator {
-
-      friend bool operator== ( const XMLMultCalculator& calc1,
-                               const XMLMultCalculator& calc2 );
-
-   public:
-      XMLMultCalculator( const xercesc::DOMNode* node = 0 );
-      XMLMultCalculator( const XMLMultCalculator& parent );
-      XMLMultCalculator  & operator = ( const XMLMultCalculator  & ) = delete;
-      ~XMLMultCalculator();
-
-      void initialize( const xercesc::DOMNode* node );
-
-      PtMultiplicitySet calculateMultiplicity( unsigned int pt ) const;
-
-   private:
-      std::vector< std::vector< bool > > m_lut;
-
-      MsgLogger m_logger;
-
-   }; // class XMLMultCalculator
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIOCT_XMLMULTCALCULATOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.cxx
deleted file mode 100644
index c2f614c3f338..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.cxx
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: XMLMultStrategy.cxx 472835 2011-12-06 21:05:16Z stelzer $
-
-// STL include(s):
-#include <sstream>
-#include <algorithm>
-#include <vector>
-
-// XercesC include(s):
-#include <xercesc/util/PlatformUtils.hpp>
-#include <xercesc/util/XMLString.hpp>
-#include <xercesc/parsers/XercesDOMParser.hpp>
-#include <xercesc/dom/DOMException.hpp>
-#include <xercesc/dom/DOMDocument.hpp>
-#include <xercesc/dom/DOMNodeList.hpp>
-#include <xercesc/dom/DOMElement.hpp>
-
-// Local include(s):
-#include "XMLMultStrategy.h"
-
-using namespace std;
-using namespace xercesc;
-
-namespace LVL1MUCTPI {
-
-   bool operator< ( const std::pair< SectorID, bool >& id1,
-                    const std::pair< SectorID, bool >& id2 ) {
-
-      if( id1.second != id2.second ) {
-         return ( id1.second < id2.second );
-      } else {
-         return ( id1.first < id2.first );
-      }
-
-   }
-
-   XMLMultStrategy::XMLMultStrategy()
-      : MultiplicityStrategy( "XML-Based-Multiplicity-Strategy" ),
-        m_exStrategy(), m_calculatorMap(), m_calculatorList(),
-        m_logger( "XMLMultStrategy" ) {
-
-   }
-
-   XMLMultStrategy::XMLMultStrategy( const std::string& xmlMultFile )
-      : MultiplicityStrategy( "XML-Based-Multiplicity-Strategy" ),
-        m_exStrategy(), m_calculatorMap(), m_calculatorList(),
-        m_logger( "XMLMultStrategy" ) {
-
-      initialize( xmlMultFile );
-
-   }
-
-   XMLMultStrategy::XMLMultStrategy( const XMLMultStrategy& strategy )
-      : MultiplicityStrategy( "XML-Based-Multiplicity-Strategy" ),
-        m_logger( "XMLMultStrategy" ) {
-
-      // Replicate the list:
-      for( std::list< XMLMultCalculator >::const_iterator it =
-              strategy.m_calculatorList.begin();
-           it != strategy.m_calculatorList.end(); ++it ) {
-         m_calculatorList.push_back( *it );
-      }
-
-      // Replicate the map:
-      for( std::map< std::pair< SectorID, bool >,
-              const XMLMultCalculator* >::const_iterator it =
-              strategy.m_calculatorMap.begin();
-           it != strategy.m_calculatorMap.end(); ++it ) {
-
-         for( std::list< XMLMultCalculator >::const_iterator calc =
-                 m_calculatorList.begin();
-              calc != m_calculatorList.end(); ++calc ) {
-            if( ( *it->second ) == ( *calc ) ) {
-               m_calculatorMap[ it->first ] = &( *calc );
-               break;
-            }
-         }
-
-      }
-
-   }
-
-   XMLMultStrategy::~XMLMultStrategy() {
-
-   }
-
-   void XMLMultStrategy::initialize( const std::string& xmlMultFile ) {
-
-      //
-      // Reset the object:
-      //
-      m_calculatorList.clear();
-      m_calculatorMap.clear();
-
-      REPORT_MSG(DEBUG, "initialize() : Reading configuration from file: " << xmlMultFile );
-      //
-      // Initialize XercesC:
-      //
-      try {
-
-         XMLPlatformUtils::Initialize();
-
-      } catch( const XMLException& ex ) {
-
-         ostringstream message;
-         char* error_message = XMLString::transcode( ex.getMessage() );
-         message << "initialize() : Failed to initialize XercesC because: "
-                 << error_message;
-         XMLString::release( &error_message );
-         m_logger.send( ERROR, message.str() );
-         return;
-
-      }
-
-      //
-      // Parse the LUT XML file:
-      //
-      XercesDOMParser* xmlParser = new XercesDOMParser();
-
-      try {
-
-         xmlParser->parse( xmlMultFile.c_str() );
-
-      } catch( const XMLException& ex ) {
-
-         ostringstream message;
-         message << "initialize() : XMLException received while parsing the XML file."
-                 << endl;
-         message << "initialize() : Message: " << XMLString::transcode( ex.getMessage() );
-         m_logger.send( ERROR, message.str() );
-         return;
-
-      } catch( const DOMException& ex ) {
-
-         ostringstream message;
-         message << "initialize() : DOMException received while parsing the XML file."
-                 << endl;
-         message << "initialize() : Message: " << XMLString::transcode( ex.getMessage() );
-         m_logger.send( ERROR, message.str() );
-         return;
-
-      } catch(...) {
-
-         m_logger.send( ERROR,
-                        "initialize() : XML file parsing failed with unknown exception" );
-         return;
-
-      }
-
-      const DOMDocument* xmlDocument = xmlParser->getDocument();
-
-      {
-         ostringstream message;
-         message << "initialize() : Document has "
-                 << xmlDocument->getChildNodes()->getLength() << " child nodes" << endl;
-         message << "initialize() : Their names are:";
-         m_logger.send( VERBOSE, message.str() );
-         for( XMLSize_t i = 0; i < xmlDocument->getChildNodes()->getLength(); ++i ) {
-            const XMLCh* name = xmlDocument->getChildNodes()->item( i )->getNodeName();
-            char* cname = XMLString::transcode( name );
-            ostringstream message;
-            message << "initialize() :   --> " << cname;
-            m_logger.send( VERBOSE, message.str() );
-            XMLString::release( &cname );
-         }
-      }
-
-      const DOMNode* sectorsNode = xmlDocument->getFirstChild();
-      const DOMNodeList* sectorNodes = sectorsNode->getChildNodes();
-
-      for( XMLSize_t i = 0; i < sectorNodes->getLength(); ++i ) {
-
-         const DOMNode* sectorNode = sectorNodes->item( i );
-
-         char* cname = XMLString::transcode( sectorNode->getNodeName() );
-         string sname( cname );
-         XMLString::release( &cname );
-
-         if( sname != "Sector" ) continue;
-
-         const DOMElement* sectorElement = dynamic_cast< const DOMElement* >( sectorNode );
-         if( ! sectorElement ) {
-            m_logger.send( ERROR,
-                           "initialize() : Unable to cast Sector node into DOMElement" );
-            return;
-         }
-
-         m_logger.send( VERBOSE,
-                        ">>>>>>>>>>>>>> Starting to initialize calculator <<<<<<<<<<<<<<" );
-         XMLMultCalculator calc( sectorNode );
-         m_logger.send( VERBOSE,
-                        ">>>>>>>>>>>>>> Calculator initialization finished <<<<<<<<<<<<<<" );
-
-         // Check if this calculator is not defined yet:
-         list< XMLMultCalculator >::const_iterator calc_it;
-         if( ( calc_it = find( m_calculatorList.begin(), m_calculatorList.end(),
-                               calc ) ) == m_calculatorList.end() ) {
-            m_calculatorList.push_back( calc );
-            calc_it = find( m_calculatorList.begin(), m_calculatorList.end(), calc );
-            m_logger.send( VERBOSE, "initialize() : This is a new calculator definition" );
-         } else {
-            m_logger.send( VERBOSE,
-                           "initialize() : This calculator definition already exists" );
-         }
-
-         //
-         // Extract the Sector IDs that this calculator represents:
-         //
-         XMLCh* sector_ids_name = XMLString::transcode( "IDs" );
-         const XMLCh* sector_ids = sectorElement->getAttribute( sector_ids_name );
-         XMLString::release( &sector_ids_name );
-
-         char* cids = XMLString::transcode( sector_ids );
-         string sids( cids );
-         XMLString::release( &cids );
-
-         vector< int > ids;
-         istringstream stream_ids( sids );
-         while( ! stream_ids.eof() ) {
-            int id;
-            stream_ids >> id;
-            ids.push_back( id );
-         }
-
-         //
-         // Assing the correct sectors to this calculator:
-         //
-         const int candidate_border = ( ( MAX_BARREL_SECTOR + 1 ) +
-                                        ( MAX_ENDCAP_SECTOR + 1 ) +
-                                        ( MAX_FORWARD_SECTOR + 1 ) ) * 2;
-         m_logger.send( VERBOSE, "initialize() : This calculator represents sectors:" );
-         for( vector< int >::const_iterator id = ids.begin(); id != ids.end(); ++id ) {
-            bool firstCand = ( *id >= candidate_border ) ? false : true;
-            int lid = ( *id >= candidate_border ) ? ( *id - candidate_border ) : ( *id );
-            SectorID sid( lid );
-            m_calculatorMap[ std::make_pair( sid, firstCand ) ] = &*calc_it;
-
-            ostringstream message;
-            message << "initialize() :  --> " << sid << ( firstCand ? " fist candidate" :
-                                                          " second candidate" );
-            m_logger.send( VERBOSE, message.str() );
-         }
-
-      }
-
-      ostringstream message;
-      message << "Number of different calculators created: " << m_calculatorList.size();
-      m_logger.send( VERBOSE, message.str() );
-
-      return;
-
-   }
-
-   PtMultiplicitySet
-   XMLMultStrategy::calculateMultiplicity( unsigned int pt,
-                                           const SectorID& id,
-                                           bool firstCandidate ) const {
-
-      PtMultiplicitySet result;
-
-      if( m_calculatorMap.find( std::make_pair( id, firstCandidate ) ) !=
-          m_calculatorMap.end() ) {
-         result = m_calculatorMap.find( std::make_pair( id, firstCandidate ) )->second->calculateMultiplicity( pt );
-      } else {
-         m_logger.send( ERROR, "Multiplicity calculation asked for unknown sector!" );
-         result = m_exStrategy.calculateMultiplicity( pt, id, firstCandidate );
-      }
-
-      return result;
-
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.h
deleted file mode 100644
index 1284cfbd411e..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/XMLMultStrategy.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: XMLMultStrategy.h 701446 2015-10-19 15:19:09Z wengler $
-#ifndef TRIGT1MUCTPI_MIOCT_XMLMULTSTRATEGY_H
-#define TRIGT1MUCTPI_MIOCT_XMLMULTSTRATEGY_H
-
-// STL include(s):
-#include <string>
-#include <map>
-#include <list>
-
-// Local include(s):
-#include "MultiplicityStrategy.h"
-#include "ExclusiveMultStrategy.h"
-#include "SectorID.h"
-#include "XMLMultCalculator.h"
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   bool operator< ( const std::pair< SectorID, bool >& id1,
-                    const std::pair< SectorID, bool >& id2 );
-
-   class XMLMultStrategy : public MultiplicityStrategy {
-
-   public:
-      /// Constructor
-      XMLMultStrategy();
-      XMLMultStrategy( const std::string& xmlMultFile );
-      XMLMultStrategy( const XMLMultStrategy& strategy );
-      XMLMultStrategy  & operator = ( const XMLMultStrategy  & ) = delete;
-      /// Destructor
-      ~XMLMultStrategy();
-
-      void initialize( const std::string& xmlMultFile );
-
-      /// Multiplicity handling function
-      virtual PtMultiplicitySet calculateMultiplicity( unsigned int pt,
-                                                       const SectorID& id,
-                                                       bool firstCandidate ) const;
-
-   private:
-      ExclusiveMultStrategy                          m_exStrategy;
-      std::map< std::pair< SectorID, bool>, const XMLMultCalculator* > m_calculatorMap;
-      std::list< XMLMultCalculator >                 m_calculatorList;
-      MsgLogger                                      m_logger;
-
-   }; // class XMLMultStrategy
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIOCT_XMLMULTSTRATEGY_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.cxx
deleted file mode 100644
index 6df2a9920e23..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.cxx
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodDaqProcessor.cxx 624535 2014-10-28 10:02:49Z stelzer $
-
-// STL include(s):
-#include <iomanip>
-#include <sstream>
-#include <cassert>
-#include <string>
-
-// Local include(s):
-#include "MirodDaqProcessor.h"
-#include "MirodExtractor.h"
-#include "../Common/BitOp.h"
-#include "../Common/MuctpiBitMasks.h"
-#include "../Common/EventID.h"
-
-/*******************************************************************
- * $Date: 2014-10-28 11:02:49 +0100 (Tue, 28 Oct 2014) $
- *
- * Implementation of class MirodDaqProcessor
- * @author   Author: Thorsten Wengler
- * @version $Revision: 624535 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   // constructor of class MirodDaqProcessor
-   MirodDaqProcessor::MirodDaqProcessor()
-      : m_logger( "MirodDaqProcessor" ) {
-
-      REPORT_VERBOSE_MSG( "constructor called" );
-   }
-
-   // constructor of class MirodDaqProcessor with unsigned int list
-   // as argument used to set the TheDaqOutputData data member
-   MirodDaqProcessor::MirodDaqProcessor( std::list<unsigned int> daqOut )
-      : m_logger( "MirodDaqProcessor" ) {
-
-      m_daqOutputData = std::move(daqOut);
-   }
-
-   // implementation of main action method
-   void MirodDaqProcessor::processData( const MirodExtractor* theExtractorData ) {
-
-      REPORT_VERBOSE_MSG( "reading event from Extractor" );
-
-      unsigned int inputWord = 0;
-      unsigned int extractorStatus = 0;
-      unsigned int monitorFlag = 0;
-//       unsigned int thresholdFirst = 0;
-//       unsigned int thresholdSecond = 0;
-      unsigned int suppressedFirst = 0;
-      unsigned int suppressedSecond = 0;
-//       unsigned int suppressedEither = 0;
-      unsigned int headerBCID = 0;
-      m_daqOutputData.clear();
-
-      // Get the run number:
-      EventID eventID;
-      unsigned int runNumber = eventID.getRunNumber();
-
-      //get pointer to Extractor data
-      const std::list<unsigned int>* extractorData = theExtractorData->getExtractorData();
-
-      // the fixed parts of the header to be send to the ROB
-      m_daqOutputData.push_back( DaqHeaderStartMask );  // Header marker
-      m_daqOutputData.push_back( DaqHeaderSizeMask );   // Header size bytes
-      m_daqOutputData.push_back( DaqHeaderFormatMask ); // format version
-      m_daqOutputData.push_back( DaqHeaderDetIDMask );  // Det. ID
-      m_daqOutputData.push_back( runNumber );           // Run number
-
-      // now loop over the Extractor data, except last word
-      std::list<unsigned int>::const_iterator it_Extr;
-
-      // I now handle the first 3 data words (coming originally from
-      // the event FIFO) separately. This is mainly because of the
-      // use of the Extended L1A ID.
-      it_Extr = extractorData->begin();
-
-      // The first word is the "plain" L1A (aka. EVID):
-      unsigned int l1a = ( *it_Extr );
-      BitOp::clearBit( &l1a, 31 );
-      ++it_Extr;
-
-      // this is the reference BCID - the candidates have to have
-      // the same or a BCID at a fixed offset
-      headerBCID = ( ( *it_Extr ) & ExtrHeaderBcID );
-      unsigned int ECRC = ( ( ( *it_Extr ) & ExtrHeaderECRC ) >> 12 );
-      ++it_Extr;
-
-      inputWord = ( *it_Extr );
-      monitorFlag = BitOp::getValue( &inputWord, ExtrMonitorMask ) ;
-      extractorStatus = BitOp::getValue( &inputWord, ExtrStatusMask ) ;
-      //    BitOp::clearBit(&inputWord,12) ;
-      //    BitOp::clearBit(&inputWord,31);
-      unsigned int trType = ( ( inputWord & ExtrTrTypeMask ) >> 4 ) ;
-      ++it_Extr;
-
-      // Now add the acumulated information to the Lvl2 output:
-      unsigned int extendedL1A = ECRC;
-      extendedL1A = extendedL1A << 24;
-      extendedL1A |= l1a;
-      m_daqOutputData.push_back( extendedL1A );
-      m_daqOutputData.push_back( headerBCID );
-      m_daqOutputData.push_back( trType );
-      m_daqOutputData.push_back( 0x0 ); // this is the event type
-
-      for( ; it_Extr != ( --extractorData->end() ) ; ++it_Extr ) {
-
-         inputWord = 0;
-         inputWord = ( *it_Extr );
-
-         // put it to data stream
-         m_daqOutputData.push_back( inputWord );
-      } // end of loop over Extractor data
-
-      // retrieve information from last word in extractor data
-      inputWord = 0 ;
-      inputWord = extractorData->back() ;
-//       thresholdFirst = BitOp::getValue( &inputWord, ExtrThresholdOneMask );
-//       thresholdSecond = BitOp::getValue( &inputWord, ExtrThresholdSecondMask );
-      suppressedFirst = BitOp::getValue( &inputWord, ExtrSuppressedFirstMask );
-      suppressedSecond = BitOp::getValue( &inputWord, ExtrSuppressedSecondMask );
-//       suppressedEither = BitOp::getValue( &inputWord, ExtrSuppressedEitherMask );
-
-      // build up error status word and add to data stream
-      inputWord = 0 ;
-      if ( BitOp::isSet( &extractorStatus, 0 ) ) {
-         BitOp::setBit( &inputWord, 1 ); // EvIDMM
-      }
-      if ( BitOp::isSet( &extractorStatus, 1 ) ) {
-         BitOp::setBit( &inputWord, 0 ); // BcIDMM
-      }
-      m_daqOutputData.push_back( inputWord );
-
-      // build up status word and add to data stream
-      inputWord = 0 ;
-      if ( monitorFlag != 0 ) {BitOp::setBit( &inputWord, 20 );}
-      if ( suppressedFirst != 0 ) {BitOp::setBit( &inputWord, 16 );}
-      if ( suppressedSecond != 0 ) {BitOp::setBit( &inputWord, 17 );}
-      m_daqOutputData.push_back( inputWord );
-
-      // add number of status elements
-      m_daqOutputData.push_back( 0x00000002 );
-
-      // fill in number of data words
-      inputWord = 0 ;
-      inputWord = m_daqOutputData.size() - 12; // 12 comes from the 9 header words
-                                               // and the 3 status words already added
-                                               // to the list.
-      m_daqOutputData.push_back( inputWord );
-
-      // fill in status block position
-      m_daqOutputData.push_back( 0x00000001 );
-
-      return;
-   }
-
-   // method to print the event
-   void MirodDaqProcessor::printEvent( std::string format ) const {
-
-      REPORT_VERBOSE_MSG( "printing output of DaqProcessor" );
-
-      bool mioctWord = false ;
-      bool trailerWord = false ;
-      unsigned int wordCount = 0 ;
-      unsigned int trailerWordCount = 0 ;
-      std::list<unsigned int>::const_iterator it_DaqPr = m_daqOutputData.begin();
-      std::list<unsigned int>::const_iterator it_DaqPrMioctStart = m_daqOutputData.begin();
-      std::list<unsigned int>::const_iterator it_DaqPrMioctEnd = m_daqOutputData.end();
-      for( int i = 0; i < 10; ++i ) {
-         ++it_DaqPrMioctStart;
-      }
-      for( int i = 0; i < 5; ++i ) {
-         --it_DaqPrMioctEnd;
-      }
-
-      for( ; it_DaqPr != m_daqOutputData.end(); ++it_DaqPr ) {
-
-         std::ostringstream message;
-
-         if ( format == "hex" ) {
-            message << std::hex << std::setw( 8 ) << ( *it_DaqPr );
-         } else if ( format == "bin" ) {
-            std::string binaryString;
-            BitOp::printBin( ( *it_DaqPr ), binaryString );
-            message << binaryString;
-         } else if ( format == "human" ) {
-            wordCount++;
-            if ( wordCount == 1 ) {                                // Header 1
-               message << " =================================================="
-                       << "=========================" << std::endl;
-               message << "  DaqOut: 0x" << std::hex << ( *it_DaqPr );
-            }
-            if ( wordCount == 2 ) {                                // Header 2
-               message << "  HeaderBytes: " << ( *it_DaqPr );
-            }
-            if ( wordCount == 3 ) {                                // Header 3
-               message << "  Format: 0x" << std::hex << ( *it_DaqPr );
-            }
-            if ( wordCount == 4 ) {                                // Header 4
-               message << "  DetID: 0x" << std::hex << ( *it_DaqPr );
-            }
-            if ( wordCount == 5 ) {                                // Header 5
-               message << "  Run Number: " << ( *it_DaqPr );
-            }
-            if ( wordCount == 6 ) {                                // Header 6
-               message << "  EvID: " << ( *it_DaqPr );
-        }
-            if ( wordCount == 7 ) {                                // Header 7
-               message << "  BcID: " << ( ( *it_DaqPr ) & DaqHeaderBcIDMask );
-            }
-            if ( wordCount == 8 ) {                                // Header 8
-               message << "  TrType: " << ( ( *it_DaqPr ) & DaqHeaderTrTypeMask );
-            }
-            if ( wordCount == 9 ) {                                // Header 9
-               message << "  EvType: " << ( *it_DaqPr ) << std::endl ;
-               message << " --------------------------------------------------"
-                       << "-------------------------";
-            }
-            if ( wordCount == 10 ) {                                // MICTP word
-               message << "  MICTP -> BcID: " << BitOp::getValue( &( *it_DaqPr ),
-                                                                  ExtrMictpBCIDMask );
-               message << "  Sum6: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum6Mask );
-               message << "  Sum5: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum5Mask );
-               message << "  Sum4: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum4Mask );
-               message << "  Sum3: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum3Mask );
-               message << "  Sum2: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum2Mask );
-               message << "  Sum1: " << BitOp::getValue( &( *it_DaqPr ), ExtrSum1Mask );
-               message << std::endl;
-               message << " --------------------------------------------------"
-                       << "-------------------------";
-            }
-            if ( ( it_DaqPr  == it_DaqPrMioctStart ) || mioctWord ) { // MIOCT's
-               mioctWord = true;
-               if ( it_DaqPr  == it_DaqPrMioctEnd ) {
-                  mioctWord = false;
-                  trailerWord = true;
-               } else {
-                  message << this->printSector( *it_DaqPr );
-               }
-            }
-            if ( trailerWord ) {                                 //Trailer
-               trailerWordCount++;
-               if ( trailerWordCount == 1 ) {
-                  message << " --------------------------------------------------"
-                          << "-------------------------" << std::endl;
-                  message << "  Errors: ";
-                  std::string errorString;
-                  BitOp::printBin( ( *it_DaqPr ), errorString );
-                  message << errorString;
-               }
-               if ( trailerWordCount == 2 ) {
-                  message << "  Status: ";
-                  std::string statusString;
-                  BitOp::printBin( ( *it_DaqPr ), statusString );
-                  message << statusString;
-               }
-               if ( trailerWordCount == 3 ) {
-                  message << "  Status Elements: " << ( *it_DaqPr );
-               }
-               if ( trailerWordCount == 4 ) {
-                  message << "  Data Elements: " << ( ( *it_DaqPr ) & DaqTrailerCandMask );
-               }
-               if ( trailerWordCount == 5 ) {
-                  message << "  StatusBlockPos: " << ( *it_DaqPr ) << std::endl;
-                  message << " =================================================="
-                          << "=========================";
-               }
-            }
-         } else {
-            REPORT_FATAL_MSG( "Non-existent print method choosen" );
-            assert( 0 );
-         }
-
-         REPORT_VERBOSE_MSG( message.str() );
-
-      }
-
-      return;
-   }
-
-   // method to print one sector in human readable format
-   std::string MirodDaqProcessor::printSector( const unsigned int & sectorWord ) const {
-
-      std::ostringstream outStream;
-      std::string system;
-      std::string hemisphere = "-";
-      unsigned int sectorNumber = 0;
-      unsigned int regionOfInterest = 0;
-      unsigned int overlap = 0;
-
-      // get the values out of the bit mask
-      const unsigned int candPassed = BitOp::getValue( &sectorWord, ExtrPassedMask );
-      const unsigned int candFirst = BitOp::getValue( &sectorWord, ExtrFirstCandMask );
-      const unsigned int sectorAddress =
-         BitOp::getValue( &sectorWord, ExtrSectorAddressMask );
-      const unsigned int sectorBCID = BitOp::getValue( &sectorWord, ExtrBCIDMask );
-      const unsigned int ptValue = BitOp::getValue( &sectorWord, ExtrPtValueMask );
-      const unsigned int sectorRoIOvl = BitOp::getValue( &sectorWord, ExtrRoIOvlMask );
-      const unsigned int padOverflow =
-         BitOp::getValue( &sectorWord, ExtrPadOverflowMask );
-      const unsigned int sectorOverflow =
-         BitOp::getValue( &sectorWord, ExtrSectorOverflowMask );
-      const bool veto = sectorWord & 0x10000000;
-
-      // sector address and RoI and Overlap must be taken apart agin
-      // to extract the readable information
-      // first find out if this is Barrel, endcap, forward, get sector
-      // number, RoI and Overlap information
-      if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) == 0 ) {
-         system = "B"; // Barrel
-         sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberBarrelMask );
-         regionOfInterest = BitOp::getValue( &sectorRoIOvl, EvReBarrelRoIMask );
-         overlap = BitOp::getValue( &sectorRoIOvl, EvReBarrelOvlMask );
-      } else if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) == 1 ) {
-         system = "F"; // Forward
-         sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberForwardMask );
-         regionOfInterest = BitOp::getValue( &sectorRoIOvl, EvReForwardRoIMask );
-         overlap = 0;
-      } else if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) > 1 ) {
-         system = "E"; // Endcap
-         sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberEndcapMask );
-         regionOfInterest = BitOp::getValue( &sectorRoIOvl, EvReEndcapRoIMask );
-         overlap = BitOp::getValue( &sectorRoIOvl, EvReEndcapOvlMask );
-      }
-      // get the Hemisphere
-      if ( BitOp::getValue( &sectorAddress, EvReSecAddressSubSysMask ) == 1 ) {
-         hemisphere = "+";
-      }
-
-      outStream << "  Addr: " << hemisphere << system << " "
-                << std::setw( 2 ) << std::dec << sectorNumber
-                << " Pt/RoI: " << ptValue
-                << " " << std::setw( 2 ) << regionOfInterest
-                << " BcID: " << std::dec << std::setw( 4 )
-                << std::dec << sectorBCID
-                << " Ovl: " << overlap
-                << " pad/secOF: " << std::setw( 2 ) << padOverflow
-                << std::setw( 2 ) << sectorOverflow
-                << " pass: " << candPassed
-                << " First: " << candFirst
-                << " veto: " << veto;
-
-      return outStream.str();
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.h
deleted file mode 100644
index f37a76da1f7a..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodDaqProcessor.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodDaqProcessor.h 439423 2011-05-25 21:22:40Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIRODDAQPROCESSOR_H
-#define TRIGT1MUCTPI_MIRODDAQPROCESSOR_H
-
-// STL include(s):
-#include <list>
-#include <string>
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class MirodExtractor;
-
-   /**
-    *  @short funtionality of the MIROD DAQ Processor
-    *
-    *         Class MirodDaqProcessor implements the functionality
-    *         of the MIROD DAQ Processor, which reads the data
-    *         provided by the Extractor and formats them to the
-    *         format used for driving out data to the Read Out
-    *         system. This is the final step of the processing in
-    *         the MIROD for the DAQ branch of the data flow. The
-    *         data is provided as pointer to a list of 0-31 bit wide
-    *         unsigned int. The SLINK control bits are of course not
-    *         necessary here (would by bit 32). Otherwise the data
-    *         format is exactly as for the hardware SLINK
-    *
-    *    @see MirodModule
-    *    @see MirodLvl2Processor
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 439423 $
-    * $Date: 2011-05-25 23:22:40 +0200 (Wed, 25 May 2011) $
-    */
-   class MirodDaqProcessor {
-
-   public:
-      /**
-       * The constructor of MirodDaqProcessor
-       */
-      MirodDaqProcessor();
-      /**
-       * Alternative constructor of MirodDaqProcessor which has
-       * the purpose of creating an object with setting the Daq
-       * out data to an existing list of unsigned ints - e.g.
-       * using the output of the hardware - to then utilize the
-       * analysis methods of this class
-       */
-      MirodDaqProcessor( std::list< unsigned int > daqOut );
-      /**
-       * access to the output result
-       * return The Daq Output Data Output to the ROS
-       */
-      const std::list< unsigned int >& getDaqOutputData() const { return m_daqOutputData; }
-      /**
-       * This is the main action interface of the MirodDaqProcessor,
-       * gets a link to the data output of the MirodExtractor. Calling
-       * this method fills the STL list which holds the output of the
-       * DaqProcessor in the format used in the hardware, e.g. a stream
-       * of 32-bit words
-       * @see MirodModule
-       * @see MirodExtractor
-       * @see MirodLvl2Processor
-       * @param theExtractor Poniter to the data output of the
-       *                     Mirod Extractor
-       */
-      void processData( const MirodExtractor* theExtractor );
-      /**
-       * This method prints the Event in DaqOutput format to the
-       * screen. The parameter determines if the printout will be in
-       * binary, hexadecimal or human readable format. Consequently
-       * the choices are "hex", "bin" or "human"
-       * @param format Determines if the printout will be in
-       *               binary or hexadecimal format. Choices are "hex", "bin", "human"
-       */
-      void printEvent( std::string format ) const;
-      /**
-       * function to return a string representing the information
-       * contained in one sector word of the Extractor format
-       * in human readable form
-       * @param sectorWord reference to a sector word represented by
-       *                   32 - bit Extractor format
-       * @return A string to be used for output the information of
-       *         this sector
-       */
-      std::string printSector( const unsigned int& sectorWord ) const;
-
-   private:
-      mutable MsgLogger         m_logger;
-      std::list< unsigned int > m_daqOutputData;
-
-   }; // class MirodDaqProcessor
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIRODDAQPROCESSOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.cxx
deleted file mode 100644
index 6763f5c3a9e9..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.cxx
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodEventReader.cxx 441850 2011-06-06 14:50:52Z krasznaa $
-
-// STL include(s):
-#include <cassert>
-#include <string>
-#include <sstream>
-#include <iomanip>
-
-// Local include(s):
-#include "MirodEventReader.h"
-#include "MirodExtractor.h"
-#include "../Mibak/MibakStreamEvent.h"
-#include "../Common/BitOp.h"
-#include "../Mioct/MioctID.h"
-#include "../Common/MuctpiBitMasks.h"
-
-/*******************************************************************
- * implementation of class MirodEventReader
- * @author   Author: Thorsten Wengler
- * @version $Revision: 441850 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   // constructor
-   MirodEventReader::MirodEventReader()
-      : m_logger( "MirodEventReader" ) {
-
-      REPORT_VERBOSE_MSG( "constructor called" );
-   }
-
-   void MirodEventReader::readData( const MibakStreamEvent* theStream ) {
-
-      REPORT_VERBOSE_MSG( "reading event from MIBAK" );
-
-      unsigned int theMioctMNBRMask = 0;
-      Hemisphere theMioctHem = NEGATIVE;
-      unsigned int eventID = 0;
-      unsigned int bunchID = 0;
-      unsigned int bunchIDandECRC = 0;
-      bool eventIDmismatch = false;
-      bool bunchIDmismatch = false;
-      unsigned int triggerType = 0;
-      unsigned int monitorBit = 0;
-      bool isMictp = false;
-      unsigned int moduleCounter = 0;
-      unsigned int sectorAddress = 0;
-
-      // make sure the FiFo's are empty
-      m_eventFiFo.clear();
-      m_candidateFiFo.clear();
-      m_candidateFiFoHighBits.clear();
-
-      std::list<unsigned int>::const_iterator it_high = theStream->highBits.begin();
-      std::list<unsigned int>::const_iterator it_data = theStream->dataWords.begin();
-      // start loop over input data stream
-      bool mictpFirstDataWord = true;
-      for( ; it_high != theStream->highBits.end(); ++it_high ) {
-
-         // -----------------------------------------------------------
-         if ( ( *it_high & 0xf ) == 0x0000000e ) {            // module start word
-
-            if ( moduleCounter == 0 ) {       //MICTP is first
-               isMictp = true;
-               eventID = BitOp::getValue( &( *it_data ), MictpEvIDMask );
-            } else {                         //the others are the MIOCTs
-               isMictp = false;
-               if ( BitOp::getValue( &( *it_data ), MioctEvIDMask ) != eventID ) {
-                  eventIDmismatch = true;
-               }
-               if ( BitOp::getValue( &( *it_data ), MioctBcIDMask ) != bunchID ) {
-                  bunchIDmismatch = true;
-               }
-               theMioctMNBRMask = BitOp::getValue( &( *it_data ), MioctMNBRMask );
-               theMioctHem = NEGATIVE;
-               if ( theMioctMNBRMask > 7 ) {
-                  theMioctMNBRMask = theMioctMNBRMask - 8;
-                  theMioctHem = POSITIVE;
-               }
-            }
-            ++moduleCounter;               // increase module counter
-         } // ---------------------------------------------------------
-         else if ( ( *it_high & 0xf ) == 0x0000000f ) {      // module end word
-
-         } // ---------------------------------------------------------
-         else {                                    // data words
-
-            if ( isMictp ) {                  // MICTP
-               if ( mictpFirstDataWord ) {     // MICTP first data word
-                  mictpFirstDataWord = false;
-                  bunchID = BitOp::getValue( &( *it_data ), MictpBcIDMask );
-                  bunchIDandECRC = BitOp::getValue( &( *it_data ), MictpECRCBcIDMask );
-                  triggerType = BitOp::getValue( &( *it_data ), MictpTrTypeMask );
-                  monitorBit = BitOp::getValue( &( *it_data ), MictpMonitorMask );
-               } else {                      // MICTP further data words
-                  m_candidateFiFo.push_back( *it_data );
-                  sectorAddress = 0x00000100;
-                  m_candidateFiFoHighBits.push_back( sectorAddress );
-               }
-            } else {                       // The MIOCT data words
-               m_candidateFiFo.push_back( *it_data );
-               MioctID theMioctID( theMioctMNBRMask, theMioctHem );
-               sectorAddress = theMioctID.getMirodSecAddress( *it_high & 0xf );
-               // The candidate suppressions bits are now sitting on bits 41 and 42:
-               m_candidateFiFoHighBits.push_back( sectorAddress |
-                                                  ( ( *it_high & 0x30 ) << 5 ) );
-            }
-
-         } // -----------------------------------------------------------
-
-         ++it_data; // increase also the data word iterator
-      } // end loop over input data stream
-
-      // Now fill the EventFifo with the information obtained from the
-      // MICTP, the internally determined status flag and the word count
-
-      m_eventFiFo.push_back( eventID - 1 ); // The EventReader is the one that
-                                            // decreases the EvID (L1A) by one,
-                                            // as the official counting starts
-                                            // with 0.
-      m_eventFiFo.push_back( bunchIDandECRC );
-
-      unsigned int thirdWord = 0 ;
-      BitOp::sImposeNBits( &thirdWord, 13,
-                           static_cast< unsigned int >( m_candidateFiFoHighBits.size() ) ) ;
-      if ( monitorBit != 0 ) { BitOp::setBit( &thirdWord, 12 ); }
-      BitOp::sImposeNBits( &thirdWord, 4, triggerType ) ;
-      if ( bunchIDmismatch ) { BitOp::setBit( &thirdWord, 1 ); }
-      if ( eventIDmismatch ) { BitOp::setBit( &thirdWord, 0 ); }
-
-      m_eventFiFo.push_back( thirdWord );
-
-      return;
-   }
-
-   // method to print the event
-   void MirodEventReader::printEvent( std::string format ) const {
-
-      MirodExtractor serviceExtractor; // not the real Extractor, just here
-                                       // to use some of its services
-      unsigned int wordCount = 0;
-
-      // first print the Event Fifo
-      std::list<unsigned int>::const_iterator it_EvFifo = m_eventFiFo.begin();
-      for( ; it_EvFifo != m_eventFiFo.end(); ++it_EvFifo ) {
-
-         std::ostringstream message;
-
-         if ( format == "hex" ) {
-            message << std::hex << std::setw( 6 ) << ( *it_EvFifo );
-         } else if ( format == "bin" ) {
-            std::string binaryString;
-            BitOp::printBinN( ( *it_EvFifo ), 23, binaryString );
-            message << binaryString;
-         } else if ( format == "human" ) {
-            wordCount++;
-            if ( wordCount == 1 ) {   // EvID
-               message << " =================================================="
-                       << "=========================" << std::endl;
-               message << "  EvCaFiFo   EvID: " << std::dec << std::setw( 8 )
-                       << ( ( *it_EvFifo ) & EvReEvIDMask );
-            }
-            if ( wordCount == 2 ) {   // BcID
-               message << "             BcID: " << std::setw( 4 )
-                       << ( ( *it_EvFifo ) & EvReBcIDMask );
-            }
-            if ( wordCount == 3 ) {
-               message << "             NoWords: " << std::setw( 4 )  // #data words
-                       << BitOp::getValue( &( *it_EvFifo ), EvReNoWordsMask );
-               message << "   Monitor: "                    // Monitor bit
-                       << BitOp::getValue( &( *it_EvFifo ), EvReMonitorMask );
-               message << "   TrType: "                    // Trigger Type
-                       << BitOp::getValue( &( *it_EvFifo ), EvReTrTypeMask );
-               message << "   Status: ";                   // Status bits
-               std::string statusString;
-               BitOp::printBinN( ( *it_EvFifo ), 3, statusString );
-               message << statusString << std::endl;
-               message << " --------------------------------------------------"
-                       << "-------------------------";
-            }
-         } else {
-            REPORT_FATAL_MSG( "Non-existent print method choosen" );
-            assert( 0 );
-         }
-
-         REPORT_VERBOSE_MSG( message.str() );
-
-      }
-
-      // and now the candidate FiFo
-      std::list<unsigned int>::const_iterator it_Canhigh = m_candidateFiFoHighBits.begin();
-      std::list<unsigned int>::const_iterator it_CanData = m_candidateFiFo.begin();
-      for( ; it_CanData != m_candidateFiFo.end(); ++it_CanData ) {
-
-         std::ostringstream message;
-
-         if ( format == "hex" ) {
-            message << std::hex << std::setw( 3 ) << ( *it_Canhigh );
-            message << std::hex << std::setw( 8 ) << ( *it_CanData );
-         } else if ( format == "bin" ) {
-            std::string binaryString;
-            BitOp::printBinN( ( *it_Canhigh ), 8, binaryString ) ;
-            message << binaryString << " -- ";
-            binaryString = "";
-            BitOp::printBin( ( *it_CanData ), binaryString ) ;
-            message << binaryString;
-         } else if ( format == "human" ) {
-            if ( ( ( *it_Canhigh ) & 0x00000100 ) != 0 ) {         // MICTP word
-               message << "  MICTP -> BcID: " << BitOp::getValue( &( *it_CanData ), BCIDMask );
-               message << "  Sum6: " << BitOp::getValue( &( *it_CanData ), ExtrSum6Mask );
-               message << "  Sum5: " << BitOp::getValue( &( *it_CanData ), ExtrSum5Mask );
-               message << "  Sum4: " << BitOp::getValue( &( *it_CanData ), ExtrSum4Mask );
-               message << "  Sum3: " << BitOp::getValue( &( *it_CanData ), ExtrSum3Mask );
-               message << "  Sum2: " << BitOp::getValue( &( *it_CanData ), ExtrSum2Mask );
-               message << "  Sum1: " << BitOp::getValue( &( *it_CanData ), ExtrSum1Mask );
-               message << std::endl;
-               message << " --------------------------------------------------"
-                       << "-------------------------";
-            } else {                                             // MIOCT word
-               message << "  0x" << std::hex << std::setw( 3 ) << std::setfill( '0' )
-                       << *it_Canhigh << std::hex << std::setw( 8 ) << std::setfill( '0' )
-                       << *it_CanData;
-               unsigned int firstCand  = serviceExtractor.extractFirstCandidate( ( *it_CanData ),
-                                                                                 ( *it_Canhigh ) );
-               unsigned int secondCand = serviceExtractor.extractSecondCandidate( ( *it_CanData ),
-                                                                                  ( *it_Canhigh ) );
-               if ( firstCand != 0 ) {
-                  message << MirodExtractor::printSector( firstCand );
-               } else {
-                  message << " ... no first candidate ... ";
-               }
-               if ( secondCand != 0 ) {
-                  message << MirodExtractor::printSector( secondCand );
-               } else {
-                  message << " ... no second candidate ...";
-               }
-            }
-         } else {
-            REPORT_FATAL_MSG( "Non-existent print method choosen" );
-            assert( 0 );
-         }
-
-         REPORT_VERBOSE_MSG( message.str() );
-
-         ++it_Canhigh ; // also increase counter for highBits list
-      }
-      if ( format == "human" ) {
-         REPORT_VERBOSE_MSG( " ===================================================="
-                             "=======================" );
-      }
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.h
deleted file mode 100644
index 660ba10410f8..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodEventReader.h
+++ /dev/null
@@ -1,94 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodEventReader.h 439423 2011-05-25 21:22:40Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIRODEVENTREADER_H
-#define TRIGT1MUCTPI_MIRODEVENTREADER_H
-
-// STL include(s):
-#include <list>
-#include <string>
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class MibakStreamEvent;
-
-   /**
-    *  @short This class implements the MIROD Event Reader
-    *
-    *         This class implements the functionality of the
-    *         Event Reader of the MIROD Readout Driver. The data
-    *         arrives in form of a pointer to a MibakStreamEvent
-    *         and is checked and separated into candidate and
-    *         event stream as on the actual board.
-    *
-    *    @see MirodModule
-    *    @see MibakStreamEvent
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 439423 $
-    * $Date: 2011-05-25 23:22:40 +0200 (Wed, 25 May 2011) $
-    */
-   class MirodEventReader {
-
-   public:
-      /**
-       * constructor of MirodEventReader
-       */
-      MirodEventReader();
-      /**
-       * This method returns a pointer to the EventFiFo list.
-       * @return Pointer to the list representing the
-       *         EventFifo
-       */
-      const std::list< unsigned int >* getEventFifo() const { return &m_eventFiFo; }
-      /**
-       * This method returns a pointer to the CandidateFiFo lower bits.
-       * @return Pointer to the list representing the
-       *         Candidate Fifo's lower 32 bits
-       */
-      const std::list< unsigned int >* getCandidateFifo() const { return &m_candidateFiFo; }
-      /**
-       * This method returns a pointer to the CandidateFiFo higher bits.
-       * @return Pointer to the list representing the
-       *         Candidate Fifo's higher 9 bits
-       */
-      const std::list< unsigned int >* getCandidateFifoHighBits() const {
-         return &m_candidateFiFoHighBits;
-      }
-      /**
-       * This method reads the data from the input MibakDataStream and
-       * splits it into an Event and a Candidate Stream in the format
-       * used by the EventReader FPGA on the MIROD Board.
-       */
-      void readData( const MibakStreamEvent* theStream );
-      /**
-       * This method prints the EventFiFo and the Candidate FiFo to the
-       * screen. The parameter determines if the printout will be in
-       * binary, hexadecimal or human radable format. Consequently the
-       * choices are "hex", "bin" or "human"
-       * @param format Determines if the printout will be in
-       *               binary or hexadecimal format. Choices are "hex", "bin", "human"
-       */
-      void printEvent( std::string format ) const;
-
-   private:
-      mutable MsgLogger m_logger;
-
-      std::list< unsigned int > m_eventFiFo;
-      std::list< unsigned int > m_candidateFiFo;
-      std::list< unsigned int > m_candidateFiFoHighBits;
-
-   }; // class MirodEventReader
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIRODEVENTREADER_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.cxx
deleted file mode 100644
index 674765d4575a..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.cxx
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodExtractor.cxx 441850 2011-06-06 14:50:52Z krasznaa $
-
-// STL include(s):
-#include <cassert>
-#include <sstream>
-#include <iostream>
-#include <iomanip>
-
-// Local include(s):
-#include "MirodExtractor.h"
-#include "MirodEventReader.h"
-#include "../Common/MuctpiBitMasks.h"
-#include "../Common/SectorConstants.h"
-#include "../Common/Configuration.h"
-#include "../Common/BitOp.h"
-
-/*******************************************************************
- * $Date: 2011-06-06 16:50:52 +0200 (Mon, 06 Jun 2011) $
- *
- * Implementation of class MirodExtractor
- * @author   Author: Thorsten Wengler
- * @version $Revision: 441850 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   // constructor of class MirodExtractor
-   MirodExtractor::MirodExtractor()
-      : m_logger( "MirodExtractor" ),
-        m_threshold1Candidate( 0 ),  m_threshold2Candidate( 0 ), m_suppressionMode( 0 ) {
-
-   }
-
-   // alternative constructor of class MirodExtractor with setting
-   // the output by hand - to use analysis methods
-   MirodExtractor::MirodExtractor( std::list< unsigned int > extractorOut )
-      : m_logger( "MirodExtractor" ), m_extractorData( std::move(extractorOut) ),
-        m_threshold1Candidate( 0 ),  m_threshold2Candidate( 0 ), m_suppressionMode( 0 ) {
-
-   }
-
-   // set Configuration
-   void MirodExtractor::setConfiguration( const Configuration &conf ) {
-
-      m_threshold1Candidate = conf.getThreshold1Candidate();
-      m_threshold2Candidate = conf.getThreshold2Candidate();
-      m_suppressionMode = conf.getSuppressionMode();
-
-      return;
-   }
-
-   void MirodExtractor::processData( const MirodEventReader* theReader ) {
-
-      REPORT_VERBOSE_MSG( "reading event from EventReader" );
-
-      unsigned int inputWord = 0;
-      m_extractorData.clear();
-      bool thresholdFirstFailed = false;
-      bool thresholdSecondFailed = false;
-      unsigned int candidateCount = 0;
-
-      // get Pointer to the MirodEventReader output data
-      const std::list<unsigned int>* theEventFiFo =
-         theReader->getEventFifo();
-      const std::list<unsigned int>* theCandidateHighBits =
-         theReader->getCandidateFifoHighBits();
-      const std::list<unsigned int>* theCandidateFiFo =
-         theReader->getCandidateFifo();
-
-      // first three words of the extractor format are filled from the
-      // EventFiFo
-      if ( theEventFiFo->size() != 3 ) {
-         REPORT_FATAL_MSG( " <> 3 words in EventFiFo" );
-         assert( 0 );
-      }
-      std::list<unsigned int>::const_iterator it_EvFiFo ;
-      it_EvFiFo = theEventFiFo->begin();
-
-      inputWord = ( *it_EvFiFo );                // first word from EventFiFo
-      BitOp::setBit( &inputWord, 31 );
-      m_extractorData.push_back( inputWord );
-
-      ++it_EvFiFo;
-      inputWord = 0;
-      inputWord = ( *it_EvFiFo );                // second word from EventFiFo
-      BitOp::setBit( &inputWord, 31 );
-      m_extractorData.push_back( inputWord );
-
-      ++it_EvFiFo;
-      inputWord = 0;
-      inputWord = ( *it_EvFiFo );                // third word from EventFiFo
-      BitOp::setBit( &inputWord, 31 );
-      for( int i = 13;i <= 23;++i ) { BitOp::clearBit( &inputWord, i ); }
-      m_extractorData.push_back( inputWord );
-
-      // Now loop over the Candidate Fifo and process the data words
-      std::list<unsigned int>::const_iterator it_CaFiFo     = theCandidateFiFo->begin();
-      std::list<unsigned int>::const_iterator it_CaFiFoHiBi = theCandidateHighBits->begin();
-      for( ; it_CaFiFo != theCandidateFiFo->end(); ++it_CaFiFo ) {
-
-         inputWord = 0 ;
-         if ( ( *it_CaFiFoHiBi ) == 0x00000100 ) {    // this is a MICTP word
-
-            inputWord = ( *it_CaFiFo );
-            unsigned int tmpBits = ( inputWord & BCIDMask ) >> 9; //shift BCID
-            for ( int i = 27; i <= 29; ++i ) { BitOp::clearBit( &inputWord, i ); }
-            inputWord |= tmpBits;
-            BitOp::setBit( &inputWord, 29 );
-            m_extractorData.push_back( inputWord );
-
-         } else {   //  MIOCT word
-
-            //second candidate
-            inputWord = 0 ;
-            inputWord = ( this )->extractSecondCandidate( ( *it_CaFiFo ), ( *it_CaFiFoHiBi ) );
-            if ( inputWord != 0 ) {
-               candidateCount++;
-               m_extractorData.push_back( inputWord );
-               // ...  if the candidate failed its threshold, set the
-               //      corresponding global bit
-               if ( !( BitOp::isSet( &inputWord, 26 ) ) ) {
-                  thresholdSecondFailed = true;
-               }
-            }
-            // first candidate
-            inputWord = ( this )->extractFirstCandidate( ( *it_CaFiFo ), ( *it_CaFiFoHiBi ) );
-            if ( inputWord != 0 ) {
-               candidateCount++;
-               m_extractorData.push_back( inputWord );
-               // ...  if the candidate failed its threshold, set the
-               //      corresponding global bit
-               if ( !( BitOp::isSet( &inputWord, 26 ) ) ) {
-                  thresholdFirstFailed = true;
-               }
-            }
-         }
-
-         ++it_CaFiFoHiBi;   // also increment the HighBits list
-      }
-
-      // Finally construct the trailer word of the Extractor format
-      inputWord = 0 ;
-      if ( ( m_suppressionMode == 0 ) &&
-           ( thresholdFirstFailed || thresholdSecondFailed ) ) {
-         BitOp::setBit( &inputWord, 0 ) ;
-      } else if ( ( m_suppressionMode != 0 ) && thresholdFirstFailed ) {
-         BitOp::setBit( &inputWord, 0 ) ;
-      }
-      if ( thresholdFirstFailed ) { BitOp::setBit( &inputWord, 2 ) ; }
-      if ( thresholdSecondFailed ) { BitOp::setBit( &inputWord, 1 ) ; }
-
-      BitOp::sImposeNBits( &inputWord, 3, m_threshold1Candidate );
-      BitOp::sImposeNBits( &inputWord, 6, m_threshold2Candidate );
-      BitOp::sImposeNBits( &inputWord, 9, candidateCount );
-      BitOp::setBit( &inputWord, 30 );
-
-      m_extractorData.push_back( inputWord );
-
-      return;
-   }
-
-   // implementation of method to extract first candidate from sector word
-   unsigned int
-   MirodExtractor::extractFirstCandidate( const unsigned int candidateFiFo,
-                                          const unsigned int candidateFiFoHighBits ) {
-
-      unsigned int result = 0;
-      unsigned int ptValue = 0;
-
-      // first get the candiates Pt value and jump out if it is 0 or 7
-      // e.g. no candidate
-      ptValue = ( BitOp::getValue( &candidateFiFo, Pt1Mask ) );
-      if ( ( ptValue < 1 ) || ( ptValue > MAX_NUMBER_OF_THRESHOLDS ) ) { return result; }
-
-      // check and set the bit telling if there where more than 2
-      // candidates in the sector
-      if ( ( candidateFiFo & SectorOverflowMask ) != 0 ) { BitOp::setBit( &result, 0 ); }
-
-      // check and set the bit telling if the candiate is from
-      // a pad with more than 1 candidates in pad
-      if ( ( candidateFiFo & ROI1OverflowMask ) != 0 ) { BitOp::setBit( &result, 1 ); }
-
-      // get RoI and Overlap in one go and superimpose it, as it is
-      // not otherwise used in this context
-      result |= ( ( BitOp::getValue( &candidateFiFo, RoIOvl1Mask ) ) << 2 );
-
-      // now superimpose the Pt value
-      BitOp::sImposeNBits( &result, 11, ptValue );
-
-      // superimpose the BCID
-      result |= ( ( candidateFiFo & BCIDMask ) >> 13 ) ;
-
-      // superimpose the sector address - bit 8 in the address is always
-      // zero for a word from the MIOCT - so I can just stick it on
-      BitOp::sImposeNBits( &result, 17, candidateFiFoHighBits ) ;
-
-      // this is the first (most energetic) candidate in this sector - so
-      // set the corresponding bit
-      BitOp::setBit( &result, 25 );
-
-      // Set the sign of the candidate:
-      if( candidateFiFo & Candidate1Sign ) result |= ExtrCandidateSign;
-
-      // Set the suppression flag of the candidate on bit 28:
-      if( candidateFiFoHighBits & 0x200 ) BitOp::setBit( &result, 28 );
-
-      // finally compare the ptValue to the threshold for the highest
-      // candidate in the sector and set the pass bit
-      if ( ptValue >= m_threshold1Candidate ) {
-         BitOp::setBit( &result, 26 );
-      }
-
-      return result;
-   }
-
-   // implementation of method to extract second candidate from sector word
-   unsigned int
-   MirodExtractor::extractSecondCandidate( const unsigned int candidateFiFo,
-                                           const unsigned int candidateFiFoHighBits ) {
-
-      unsigned int result = 0;
-      unsigned int ptValue = 0;
-
-      // first get the candiates Pt value and jump out if it is 0 or 7
-      // e.g. no candidate
-      ptValue = ( BitOp::getValue( &candidateFiFo, Pt2Mask ) );
-      if ( ( ptValue < 1 ) || ( ptValue > MAX_NUMBER_OF_THRESHOLDS ) ) { return result; }
-
-      // check and set the bit telling if there where more than 2
-      // candidates in the sector
-      if ( ( candidateFiFo & SectorOverflowMask ) != 0 ) { BitOp::setBit( &result, 0 ); }
-
-      // check and set the bit telling if the candiate is from
-      // a pad with more than 1 candidates in pad
-      if ( ( candidateFiFo & ROI2OverflowMask ) != 0 ) { BitOp::setBit( &result, 1 ); }
-
-      // get RoI and Overlap in one go and superimpose it, as it is
-      // not otherwise used in this context
-      result |= ( ( BitOp::getValue( &candidateFiFo, RoIOvl2Mask ) ) << 2 );
-
-      // now superimpose the Pt value
-      BitOp::sImposeNBits( &result, 11, ptValue );
-
-      // superimpose the BCID
-      result |= ( ( candidateFiFo & BCIDMask ) >> 13 );
-
-      // superimpose the sector address - bit 8 in the address is always
-      // zero for a word from the MIOCT - so I can just stick it on
-      BitOp::sImposeNBits( &result, 17, candidateFiFoHighBits );
-
-      // this is the second (second energetic) candidate in this sector
-      // - so make sure the corresponding bit is not set
-      BitOp::clearBit( &result, 25 );
-
-      // Set the sign of the candidate:
-      if( candidateFiFo & Candidate2Sign ) result |= ExtrCandidateSign;
-
-      // Set the suppression flag of the candidate on bit 28:
-      if( candidateFiFoHighBits & 0x400 ) BitOp::setBit( &result, 28 );
-
-      // finally compare the ptValue to the threshold for the second
-      // candidate in the sector and set the pass bit
-      if ( ptValue >= m_threshold2Candidate ) {
-         BitOp::setBit( &result, 26 );
-      }
-
-      return result;
-   }
-
-   // method to print the event
-   void MirodExtractor::printEvent( std::string format ) const {
-
-      unsigned int wordCount = 0;
-      std::list<unsigned int>::const_iterator it_Extr = m_extractorData.begin();
-      for( ; it_Extr != m_extractorData.end(); ++it_Extr ) {
-
-         std::ostringstream message;
-
-         if ( format == "hex" ) {
-            message << std::hex << std::setw( 8 ) << ( *it_Extr );
-         } else if ( format == "bin" ) {
-            std::string binaryString;
-            BitOp::printBin( ( *it_Extr ), binaryString );
-            message << binaryString;
-         } else if ( format == "human" ) {
-            wordCount++;
-            if ( wordCount == 1 ) {
-               message << " =================================================="
-                       << "=========================" << std::endl;
-               message << "  Extr EvID: " << std::dec << std::setw( 8 )
-                       << ( ( *it_Extr ) & ExtrHeaderEvID );
-            }
-            if ( wordCount == 2 ) {
-               message << "  BcID: " << std::setw( 4 ) << ( ( *it_Extr ) & ExtrHeaderBcID );
-            }
-            if ( wordCount == 3 ) {
-               message << "  Monitor: " << BitOp::getValue( &( *it_Extr ), ExtrMonitorMask );
-               message << "  Trigger_Type: " << BitOp::getValue( &( *it_Extr ), ExtrTrTypeMask );
-               message << "  Status: ";
-               std::string statusString;
-               BitOp::printBinN( ( *it_Extr ), 3, statusString );
-               message << statusString << std::endl;
-               message << " --------------------------------------------------"
-                       << "-------------------------";
-            }
-            if ( ( *it_Extr ) & 0x20000000 ) {   // Mictp
-               message << "  MICTP -> BcID: " << BitOp::getValue( &( *it_Extr ),
-                                                                  ExtrMictpBCIDMask );
-               message << "  Sum6: " << BitOp::getValue( &( *it_Extr ), ExtrSum6Mask );
-               message << "  Sum5: " << BitOp::getValue( &( *it_Extr ), ExtrSum5Mask );
-               message << "  Sum4: " << BitOp::getValue( &( *it_Extr ), ExtrSum4Mask );
-               message << "  Sum3: " << BitOp::getValue( &( *it_Extr ), ExtrSum3Mask );
-               message << "  Sum2: " << BitOp::getValue( &( *it_Extr ), ExtrSum2Mask );
-               message << "  Sum1: " << BitOp::getValue( &( *it_Extr ), ExtrSum1Mask );
-               message << std::endl;
-               message << " --------------------------------------------------"
-                       << "-------------------------";
-            }
-            if ( ( ( *it_Extr ) & 0xe0000000 ) == 0 ) {
-               message << printSector( *it_Extr ); }  // print Sector info
-            if ( ( *it_Extr ) & 0x40000000 ) {   // Trailer
-               message << " --------------------------------------------------"
-                       << "-------------------------" << std::endl;
-               message << "  CandCount: " << BitOp::getValue( &( *it_Extr ),
-                                                              ExtrCandCountMask );
-               message << "    Thresh_1: " << BitOp::getValue( &( *it_Extr ),
-                                                               ExtrThresh1Mask );
-               message << "    Thresh_2: " << BitOp::getValue( &( *it_Extr ),
-                                                               ExtrThresh2Mask );
-               message << "    S1: " << BitOp::getValue( &( *it_Extr ),
-                                                         Extr1stCandSupprMask );
-               message << "    S2: " << BitOp::getValue( &( *it_Extr ),
-                                                         Extr2ndCandSupprMask );
-               message << "    S: " << BitOp::getValue( &( *it_Extr ),
-                                                        ExtrEitherCandSupprMask );
-               message << std::endl;
-               message << " =================================================="
-                       << "=========================";
-            }
-         } else {
-            REPORT_FATAL_MSG( "Non-existent print method choosen" );
-            assert( 0 );
-         }
-
-         REPORT_VERBOSE_MSG( message.str() );
-
-      }
-
-      return;
-   }
-
-   // method to print one sector in human readable format
-   std::string MirodExtractor::printSector( const unsigned int & sectorWord ) {
-
-      std::string sectorString = "";
-      std::ostringstream outStream;
-      std::string system;
-      std::string hemisphere = "-";
-      unsigned int sectorNumber = 0;
-      unsigned int regionOfInterest = 0;
-      unsigned int overlap = 0;
-
-      // get the values out of the bit mask
-      const unsigned int candPassed = BitOp::getValue( &sectorWord, ExtrPassedMask );
-      const unsigned int candFirst = BitOp::getValue( &sectorWord, ExtrFirstCandMask );
-      const unsigned int sectorAddress =
-         BitOp::getValue( &sectorWord, ExtrSectorAddressMask );
-      const unsigned int sectorBCID = BitOp::getValue( &sectorWord, ExtrBCIDMask );
-      const unsigned int ptValue = BitOp::getValue( &sectorWord, ExtrPtValueMask );
-      const unsigned int sectorRoIOvl = BitOp::getValue( &sectorWord, ExtrRoIOvlMask );
-      const unsigned int padOverflow =
-         BitOp::getValue( &sectorWord, ExtrPadOverflowMask );
-      const unsigned int sectorOverflow =
-         BitOp::getValue( &sectorWord, ExtrSectorOverflowMask );
-      const bool veto = sectorWord & 0x10000000;
-
-      // sector address and RoI and Overlap must be taken apart agin
-      // to extract the readable information
-      // first find out if this is Barrel, endcap, forward, get sector
-      // number, RoI and Overlap information
-      if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) == 0 ) {
-         system = "B"; // Barrel
-         sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberBarrelMask );
-         regionOfInterest = BitOp::getValue( &sectorRoIOvl, EvReBarrelRoIMask );
-         overlap = BitOp::getValue( &sectorRoIOvl, EvReBarrelOvlMask );
-      } else if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) == 1 ) {
-         system = "F"; // Forward
-         sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberForwardMask );
-         regionOfInterest = BitOp::getValue( &sectorRoIOvl, EvReForwardRoIMask );
-         overlap = 0;
-      } else if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) > 1 ) {
-         system = "E"; // Endcap
-         sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberEndcapMask );
-         regionOfInterest = BitOp::getValue( &sectorRoIOvl, EvReEndcapRoIMask );
-         overlap = BitOp::getValue( &sectorRoIOvl, EvReEndcapOvlMask );
-      }
-      // get the Hemisphere
-      if ( BitOp::getValue( &sectorAddress, EvReSecAddressSubSysMask ) == 1 ) {
-         hemisphere = "+"; }
-
-      outStream << "  Addr: " << hemisphere << system << " "
-                << std::setw( 2 ) << std::dec << sectorNumber
-                << " Pt/RoI: " << ptValue
-                << " " << std::setw( 2 ) << regionOfInterest
-                << " BcID: " << std::dec << std::setw( 4 )
-                << std::dec << sectorBCID
-                << " Ovl: " << overlap
-                << " pad/secOF: " << std::setw( 2 ) << padOverflow
-                << std::setw( 2 ) << sectorOverflow
-                << " pass: " << candPassed
-                << " First: " << candFirst
-                << " veto: " << veto;
-
-      sectorString = outStream.str();
-
-      return sectorString;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.h
deleted file mode 100644
index c41c42685275..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodExtractor.h
+++ /dev/null
@@ -1,143 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodExtractor.h 439423 2011-05-25 21:22:40Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIRODEXTRACTOR_H
-#define TRIGT1MUCTPI_MIRODEXTRACTOR_H
-
-// STL include(s):
-#include <list>
-#include <string>
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class Configuration;
-   class MirodEventReader;
-
-   /**
-    *  @short This class implements the Mirod Extractor
-    *
-    *         This class implements the fuunctionality of the MIROD
-    *         Extractor. Its receives the data from the MIROD
-    *         Event Reader, which in turn has read them from the
-    *         Lvl1 Mibak backplane. The data are handed over in form
-    *         of pointers to the Event and Candidate Fifo's, which
-    *         are implemented as STL lists. The result of the
-    *         processing done in the Extractor is stored again in
-    *         an STL list of unsigned int words, which in format
-    *         corrspond to the Extractor format of the actual MIROD.
-    *
-    *         The Extractor compares each Muon candidates to
-    *         programmable thresholds.
-    *
-    *    @see MiordModule
-    *    @see MirodEventReader
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 439423 $
-    * $Date: 2011-05-25 23:22:40 +0200 (Wed, 25 May 2011) $
-    */
-   class MirodExtractor {
-
-   public:
-      /**
-       * The constructor of MirodExtractor
-       */
-      MirodExtractor();
-      /**
-       * Alternative constructor of MirodExtractor which has
-       * the purpose of creating an object with setting the Extractor
-       * out data to an existing list of unsigned ints - e.g.
-       * using the output of the hardware - to then utilize the
-       * analysis methods of this class
-       */
-      MirodExtractor( std::list<unsigned int> extractorOut );
-
-      // set Configuration
-      void setConfiguration( const Configuration &conf );
-
-      /**
-       * This is the main action interface of the MirodExtractor, which
-       * gets links from the MirodEventReader and processes the data
-       * the Extractor format which is used on the actual board and
-       * is expected by the Lvl2Processor and the DaqProcessor. The
-       * result is again stored in an STL list
-       * @see MirodEventReader
-       * @see MirodLvl2Processor
-       * @see MirodDaqProcessor
-       */
-      void processData( const MirodEventReader* theReader );
-      /**
-       * This method takes one input word from the candidate buffer
-       * (data word and high bits holding the sector ID) and
-       * extracts the first candidate if any. The return is a candiate
-       * word in Extractor format
-       * @return First candidate in Extractor format
-       * @param candidateFiFo candidate word bit 0-31
-       * @param candidateFiFoHighBits candidate word high bits 32-40
-       */
-      unsigned int extractFirstCandidate( const unsigned int candidateFiFo,
-                                          const unsigned int candidateFiFoHighBits );
-      /**
-       * This method takes one input word from the candidate buffer
-       * (data word and high bits holding the sector ID) and
-       * extracts the second candidate if any. The return is a candiate
-       * word in Extractor format
-       * @return Second candidate in Extractor format
-       * @param candidateFiFo candidate word bit 0-31
-       * @param candidateFiFoHighBits candidate word high bits 32-40
-       */
-      unsigned int extractSecondCandidate( const unsigned int candidateFiFo,
-                                           const unsigned int candidateFiFoHighBits );
-      /**
-       * This method hands back a Pointer to the list holding the
-       * output data of the Extractor
-       * @return Pointer to the list of output data
-       *         in Mirod Extractor format
-       */
-      const std::list< unsigned int >* getExtractorData() const { return & m_extractorData; }
-      /**
-       * This method prints the Event in Extractor format to the
-       * screen. The parameter determines if the printout will be in
-       * binary, hexadecimal or human readable format.
-       * Consequently the choices are "hex", "bin" or "human"
-       * @param format Determines if the printout will be in
-       *               binary or hexadecimal format. Choices are "hex", "bin", "human"
-       */
-      void printEvent( std::string format ) const;
-      /**
-       * function to return a string representing the information
-       * contained in one sector word of the Extractor format
-       * in human readable form
-       * @param sectorWord reference to a sector word represented by
-       *                   32 - bit Extractor format
-       * @return A string to be used for output the information of
-       *         this sector
-       */
-      static std::string printSector( const unsigned int & sectorWord );
-
-   private:
-      mutable MsgLogger m_logger;
-
-      std::list< unsigned int > m_extractorData;
-
-      // threshold parameters
-      unsigned int m_threshold1Candidate;
-      unsigned int m_threshold2Candidate;
-
-      /// suppression mode
-      int m_suppressionMode;
-
-   }; // class MirodExtractor
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIRODEXTRACTOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.cxx
deleted file mode 100644
index a877e760ea6e..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.cxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodFiFoContent.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// Local include(s):
-#include "MirodFiFoContent.h"
-#include "MirodExtractor.h"
-#include "MirodLvl2Processor.h"
-#include "MirodDaqProcessor.h"
-
-/*******************************************************************
- * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $ 
- *
- * Implementation of class MirodFiFoContent
- * @author   Author: Thorsten Wengler
- * @version $Revision: 362102 $
- ******************************************************************/
-
-// constructor of class MirodFiFoContent
-MirodFiFoContent::MirodFiFoContent() {
-
-}
-
-// print content of Monitoring Fifo in "human" , "hex" or "bin"
-void MirodFiFoContent::printMonFiFo( std::string format ) {
-
-  LVL1MUCTPI::MirodExtractor hardwareExtrOut( m_monFiFo );
-
-  if( format == "human" ) hardwareExtrOut.printEvent( "human" );
-  else if( format == "hex" ) hardwareExtrOut.printEvent( "hex" );
-  else if( format == "bin" ) hardwareExtrOut.printEvent("bin");
-
-  return;
-
-}
-
-// print content of Lvl2 Fifo in "human" , "hex" or "bin"
-void MirodFiFoContent::printLvl2FiFo( std::string format ) {
-
-  LVL1MUCTPI::MirodLvl2Processor hardwareLvl2Output( m_lvl2FiFo );
-
-  if( format == "human" ) hardwareLvl2Output.printEvent( "human" );
-  else if( format == "hex" ) hardwareLvl2Output.printEvent( "hex" );
-  else if( format == "bin" ) hardwareLvl2Output.printEvent( "bin" );
-
-  return;
-
-}
-
-// print content of Daq Fifo in "human" , "hex" or "bin"
-void MirodFiFoContent::printDaqFiFo(std::string format) {
-
-  LVL1MUCTPI::MirodDaqProcessor hardwareDaqOutput( m_daqFiFo );
-
-  if( format == "human" ) hardwareDaqOutput.printEvent( "human" );
-  else if( format == "hex" ) hardwareDaqOutput.printEvent( "hex" );
-  else if( format == "bin" ) hardwareDaqOutput.printEvent( "bin" );
-
-  return;
-
-}
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.h
deleted file mode 100644
index 7d80383a3d2e..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodFiFoContent.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodFiFoContent.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIRODFIFOCONTENT_H
-#define TRIGT1MUCTPI_MIRODFIFOCONTENT_H
-
-// STL include(s):
-#include <list>
-#include <string>
-
-/**
-*******************************************************************
-*
-*    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
-*
-*    @short Helper class to hold the output of the Mirod FiFo readout
-*
-*           This is a helper class to group the output from reading
-*           out the Mirod FiFos.
-*
-*   @author Thorsten Wengler
-*  @version $Revision: 362102 $
-*
-*******************************************************************
-*/
-class MirodFiFoContent {
-
- public:
-  /**
-   * The constructor of MirodFiFoContent
-   */
-  MirodFiFoContent();
-  /**
-   * set and get the DaqFiFo content
-   */
-  void daqFiFo( std::list< unsigned int > daqFiFoContent ) { m_daqFiFo = daqFiFoContent; }
-  const std::list< unsigned int >& daqFiFo() { return m_daqFiFo; }
-  /**
-   * set and get the Lvl2FiFo content
-   */
-  void lvl2FiFo( std::list< unsigned int > lvl2FiFoContent ) { m_lvl2FiFo = lvl2FiFoContent; }
-  const std::list< unsigned int >& lvl2FiFo() { return m_lvl2FiFo; }
-  /**
-   * set and get the MonFiFo content
-   */
-  void monFiFo( std::list< unsigned int > monFiFoContent ) { m_monFiFo = monFiFoContent; }
-  const std::list< unsigned int >& monFiFo() { return m_monFiFo; }
-
-  /**
-   * print content of Monitoring Fifo in "human" , "hex" or "bin"
-   * format depending on the format string
-   */
-  void printMonFiFo( std::string format );
-  /**
-   * print content of Lvl2 Fifo in "human" , "hex" or "bin"
-   * format depending on the format string
-   */
-  void printLvl2FiFo( std::string fromat );
-  /**
-   * print content of Daq Fifo in "human" , "hex" or "bin"
-   * format depending on the format string
-   */
-  void printDaqFiFo( std::string format );
-
-  /**
-   * The destructor of MirodFiFoContent 
-   */
-  ~MirodFiFoContent() = default;
-
- private:
-
-  std::list< unsigned int > m_daqFiFo;
-  std::list< unsigned int > m_lvl2FiFo;
-  std::list< unsigned int > m_monFiFo;
-
-}; // class MirodFiFoContent
-
-#endif // TRIGT1MUCTPI_MIRODFIFOCONTENT_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.cxx
deleted file mode 100644
index 83c10c92ea5c..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.cxx
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodLvl2Processor.cxx 726107 2016-02-25 11:04:42Z wengler $
-
-// STL include(s):
-#include <cassert>
-#include <iomanip>
-#include <iostream>
-#include <sstream>
-#include <algorithm>
-
-// Local include(s):
-#include "MirodLvl2Processor.h"
-#include "MirodExtractor.h"
-#include "../Common/Configuration.h"
-#include "../Common/BitOp.h"
-#include "../Common/MuctpiBitMasks.h"
-#include "../Common/EventID.h"
-#include "../Common/SectorConstants.h"
-
-/*******************************************************************
- * $Date: 2016-02-25 12:04:42 +0100 (Thu, 25 Feb 2016) $
- *
- * Implementation of class MirodLvl2Processor
- * @author   Author: Thorsten Wengler
- * @version $Revision: 726107 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   // default constructor of class MirodLvl2Processor
-   MirodLvl2Processor::MirodLvl2Processor()
-      : m_logger( "MirodLvl2Processor" ),
-        m_ptSorterBuckets( MAX_NUMBER_OF_THRESHOLDS ), 
-	m_maxCandPerPtvalue(0),  m_maxCandSendToRoib(0), m_candBcidOffset(0)  {
-
-      REPORT_VERBOSE_MSG( "constructor called" );
-   }
-
-   // constructor of class MirodLvl2Processor with unsigned int list
-   // as argument used to set the TheLvl2OutputData data member
-   MirodLvl2Processor::MirodLvl2Processor( std::list<unsigned int> lvl2Out )
-      : m_logger( "MirodLvl2Processor" ),
-        m_ptSorterBuckets( MAX_NUMBER_OF_THRESHOLDS ), 
-	m_maxCandPerPtvalue(0), m_maxCandSendToRoib(0), m_candBcidOffset(0)  {
-
-      REPORT_VERBOSE_MSG( "in constructor" );
-      m_lvl2OutputData = lvl2Out;
-   }
-
-   // set Configuration
-   void MirodLvl2Processor::setConfiguration( const Configuration& conf ) {
-
-      m_maxCandPerPtvalue = conf.getMaxCandPerPtvalue();
-      m_maxCandSendToRoib = conf.getMaxCandSendToRoib();
-      m_candBcidOffset = conf.getCandBcidOffset();
-      for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) {
-         m_ptSorterBuckets[ i ].reserve( m_maxCandPerPtvalue );
-      }
-
-      return;
-   }
-
-   // implementation of main action method
-   void MirodLvl2Processor::processData( const MirodExtractor* theExtractorData ) {
-
-      REPORT_VERBOSE_MSG( "reading event from Extractor" );
-
-      unsigned int inputWord = 0;
-      unsigned int extractorStatus = 0;
-      unsigned int monitorFlag = 0;
-//       unsigned int thresholdFirst = 0;
-//       unsigned int thresholdSecond = 0;
-      unsigned int suppressedFirst = 0;
-      unsigned int suppressedSecond = 0;
-      unsigned int suppressedEither = 0;
-      unsigned int candidateCounterOverflow = 0;
-      unsigned int candidateSorterOverflow = 0;
-
-      unsigned int headerBCID = 0;
-
-      // Get the run number:
-      EventID eventID;
-      unsigned int runNumber = eventID.getRunNumber();
-
-      m_lvl2OutputData.clear();
-      for( unsigned int i = 0; i < MAX_NUMBER_OF_THRESHOLDS; ++i ) {
-         m_ptSorterBuckets[ i ].clear();
-      }
-      m_ptCombinedFiFo.clear();
-
-      //get pointer to Extractor data
-      const std::list< unsigned int >* extractorData = theExtractorData->getExtractorData();
-
-      // the fixed parts of the header to be send to the ROB
-      m_lvl2OutputData.push_back( Lvl2HeaderStartMask );  // Header marker
-      m_lvl2OutputData.push_back( Lvl2HeaderSizeMask );   // Header size bytes
-      m_lvl2OutputData.push_back( Lvl2HeaderFormatMask ); // format version
-      m_lvl2OutputData.push_back( Lvl2HeaderDetIDMask );  // Det. ID
-      m_lvl2OutputData.push_back( runNumber );            // Run number
-
-      // now loop over the Extractor data, except last word
-      std::list< unsigned int >::const_iterator it_Extr;
-
-      // I now handle the first 3 data words (coming originally from
-      // the event FIFO) separately. This is mainly because of the
-      // use of the Extended L1A ID.
-      it_Extr = extractorData->begin();
-
-      // The first word is the "plain" L1A (aka. EVID):
-      unsigned int l1a = ( *it_Extr );
-      BitOp::clearBit( &l1a, 31 );
-      ++it_Extr;
-
-      // this is the reference BCID - the candidates have to have
-      // the same or a BCID at a fixed offset
-      headerBCID = ( ( *it_Extr ) & ExtrHeaderBcID );
-      unsigned int ECRC = ( ( ( *it_Extr ) & ExtrHeaderECRC ) >> 12 );
-      ++it_Extr;
-
-      inputWord = ( *it_Extr );
-      monitorFlag = BitOp::getValue( &inputWord, ExtrMonitorMask ) ;
-      extractorStatus = BitOp::getValue( &inputWord, ExtrStatusMask ) ;
-      //    BitOp::clearBit(&inputWord,12) ;
-      //    BitOp::clearBit(&inputWord,31);
-      unsigned int trType = ( ( inputWord & ExtrTrTypeMask ) >> 4 ) ;
-      ++it_Extr;
-
-      // Now add the acumulated information to the Lvl2 output:
-      unsigned int extendedL1A = ECRC;
-      extendedL1A <<= 24;
-      extendedL1A |= l1a;
-      m_lvl2OutputData.push_back( extendedL1A );
-      m_lvl2OutputData.push_back( headerBCID );
-      m_lvl2OutputData.push_back( trType );
-      m_lvl2OutputData.push_back( 0x0 ); // this is the event type
-
-      for ( ; it_Extr != ( --extractorData->end() ) ; ++it_Extr ) {
-         inputWord = 0 ;
-         inputWord = ( *it_Extr ) ;
-
-         // now here the rest of the data is not just copied to the
-         // output stream as in the DaqProcessor, but the MICTP word
-         // is not used at all, and the sector candidates are only
-         // taken if they passed the threshold in the Extractor , checked
-         // to see if the have the expected BCID and
-         // are sorted for their pt values
-         if ( ( !BitOp::isSet( &inputWord, 29 ) ) &&         // not the MICTP word
-              ( ( inputWord & ExtrPassedMask ) != 0 ) &&    // passed Thresh.?
-              ( BitOp::getValue( &inputWord, ExtrBCIDMask ) ==
-                ( ( headerBCID + m_candBcidOffset ) & 0x7 ) ) ) {  // cand. w/ correct BCID ?
-            // for the Level 2 output, the BCID is not part anymore of the
-            // sector word, and also the bit saying that it passed the
-            // threshold is gone (it would not be here otherwise)
-            // so the sector address gets shifted by three bits and the pass
-            // bit is reset
-
-            const bool candSign = inputWord & ExtrCandidateSign;
-
-            const unsigned int tmpSectAddFirst =
-               BitOp::getValue( &inputWord,
-                                ( ExtrFirstCandMask |      // get first cand
-                                  ExtrSectorAddressMask ) ); // get sector address
-            const unsigned int clearombMask = ( ExtrPassedMask |
-                                                ExtrFirstCandMask |
-                                                ExtrSectorAddressMask |
-                                                ExtrBCIDMask );
-            ( inputWord |= clearombMask ) ^= clearombMask;
-
-            BitOp::sImposeNBits( &inputWord, Lvl2SecAddressStartBit, tmpSectAddFirst );
-
-            if( candSign ) inputWord |= Lvl2CandidateSign;
-
-            const unsigned int ptValue = BitOp::getValue( &inputWord, Lvl2PtValueMask );
-            if( ( ptValue < 1 ) || ( ptValue > 6 ) ) {
-               REPORT_ERROR_MSG( "Unknown pT value (" << ptValue << ") for candidate: 0x"
-                                 << std::hex << inputWord );
-               continue;
-            }
-            // Add the candidate to one of the sorter buckets:
-            if( m_ptSorterBuckets[ ptValue - 1 ].size() >= m_maxCandPerPtvalue ) {
-               candidateSorterOverflow = 1;
-               // Overwrite the first candidate: (make sure it exisits - it might not if there was 
-	       // a configurtion error
-	       if ( m_ptSorterBuckets[ ptValue - 1 ].size() >= 1 ) {
-		 m_ptSorterBuckets[ ptValue - 1 ][ 0 ] = inputWord;
-	       } else {
-		 REPORT_ERROR_MSG( "Sorter bucket size 0 - config error?" );
-	       }
-            } else {
-               m_ptSorterBuckets[ ptValue - 1 ].push_back( inputWord );
-            }
-         }
-      } // end of loop over Extractor data
-
-      // retrieve information from last word in extractor data
-      inputWord = 0 ;
-      inputWord = extractorData->back() ;
-//       thresholdFirst = BitOp::getValue( &inputWord, ExtrThresholdOneMask );
-//       thresholdSecond = BitOp::getValue( &inputWord, ExtrThresholdSecondMask );
-      suppressedFirst = BitOp::getValue( &inputWord, ExtrSuppressedFirstMask );
-      suppressedSecond = BitOp::getValue( &inputWord, ExtrSuppressedSecondMask );
-      suppressedEither = BitOp::getValue( &inputWord, ExtrSuppressedEitherMask );
-
-      // Create a "master list" of all the candidates, with the right sorting:
-      std::vector< std::vector< unsigned int > >::const_reverse_iterator pt_itr =
-         m_ptSorterBuckets.rbegin();
-      std::vector< std::vector< unsigned int > >::const_reverse_iterator pt_end =
-         m_ptSorterBuckets.rend();
-      for( ; pt_itr != pt_end; ++pt_itr ) {
-         std::vector< unsigned int >::const_reverse_iterator itr =
-            pt_itr->rbegin();
-         std::vector< unsigned int >::const_reverse_iterator end =
-            pt_itr->rend();
-         for( ; itr != end; ++itr ) {
-            m_ptCombinedFiFo.push_back( *itr );
-         }
-      }
-
-      // add the selected and sorted candidates to the data stream
-      // up to a maximum number of candidates
-      unsigned int candidates = 0;
-      std::list< unsigned int >::const_iterator itr = m_ptCombinedFiFo.begin();
-      std::list< unsigned int >::const_iterator end = m_ptCombinedFiFo.end();
-      for( ; itr != end; ++itr, ++candidates ) {
-         // Make sure that we're not adding too many candidates to the output:
-         if( candidates >= m_maxCandSendToRoib ) {
-            candidateCounterOverflow = 1;
-            break;
-         }
-         m_lvl2OutputData.push_back( *itr );
-      }
-
-      // build up error status word and add to data stream
-      inputWord = 0 ;
-      if ( BitOp::isSet( &extractorStatus, 0 ) ) {
-         BitOp::setBit( &inputWord, 1 ); // EvIDMM
-      }
-      if ( BitOp::isSet( &extractorStatus, 1 ) ) {
-         BitOp::setBit( &inputWord, 0 ); // BcIDMM
-      }
-      m_lvl2OutputData.push_back( inputWord );
-
-      // build up status word and add to data stream
-      inputWord = 0 ;
-      if ( monitorFlag != 0 ) {BitOp::setBit( &inputWord, 20 );}
-      if ( suppressedFirst != 0 ) {BitOp::setBit( &inputWord, 16 );}
-      if ( suppressedSecond != 0 ) {BitOp::setBit( &inputWord, 17 );}
-      if ( candidateCounterOverflow != 0 ) {BitOp::setBit( &inputWord, 18 );}
-      if ( candidateSorterOverflow != 0 ) {BitOp::setBit( &inputWord, 19 );}
-      if ( suppressedEither != 0 ||
-           candidateCounterOverflow != 0 ||
-           candidateSorterOverflow != 0 ) {BitOp::setBit( &inputWord, 1 );}
-      m_lvl2OutputData.push_back( inputWord );
-
-      // add number of status elements
-      m_lvl2OutputData.push_back( 0x00000002 );
-
-      // fill in number of data words
-      inputWord = 0 ;
-      inputWord = m_lvl2OutputData.size() - 12; // 12 comes from the 9 header words
-      // and the 3 status words already added
-      // to the list.
-      m_lvl2OutputData.push_back( inputWord );
-
-      // fill in status block position
-      m_lvl2OutputData.push_back( 0x00000001 );
-
-      return;
-   }
-
-   // method to print the event
-   void MirodLvl2Processor::printEvent( std::string format ) const {
-
-      REPORT_VERBOSE_MSG( "printing output of Lvl2Processor" );
-
-      bool mioctWord = false;
-      bool trailerWord = false;
-      unsigned int wordCount = 0;
-      unsigned int trailerWordCount = 0;
-      std::list<unsigned int>::const_iterator it_Lvl2Pr = m_lvl2OutputData.begin();
-      std::list<unsigned int>::const_iterator it_Lvl2PrMioctStart = m_lvl2OutputData.begin();
-      std::list<unsigned int>::const_iterator it_Lvl2PrMioctEnd = m_lvl2OutputData.end();
-      for( int i = 0; i < 9; ++i ) {
-         ++it_Lvl2PrMioctStart;
-      }
-      for( int i = 0; i < 5; ++i ) {
-         --it_Lvl2PrMioctEnd;
-      }
-
-      for( ; it_Lvl2Pr != m_lvl2OutputData.end(); ++it_Lvl2Pr ) {
-
-         std::ostringstream message;
-
-         if ( format == "hex" ) {
-            message << std::hex << std::setw( 8 ) << ( *it_Lvl2Pr );
-         } else if ( format == "bin" ) {
-            std::string binaryString;
-            BitOp::printBin( ( *it_Lvl2Pr ), binaryString );
-            message << binaryString;
-         } else if ( format == "human" ) {
-
-            wordCount++;
-            if ( wordCount == 1 ) {                                // Header 1
-               message << " =================================================="
-                       << "=========================" << std::endl;
-               message << "  Lvl2Out: 0x" << std::hex << ( *it_Lvl2Pr );
-            }
-            if ( wordCount == 2 ) {                                // Header 2
-               message << "  HeaderBytes: " << ( *it_Lvl2Pr );
-            }
-            if ( wordCount == 3 ) {                                // Header 3
-               message << "  Format: 0x" << std::hex << ( *it_Lvl2Pr );
-            }
-            if ( wordCount == 4 ) {                                // Header 4
-               message << "  DetID: 0x" << std::hex << ( *it_Lvl2Pr );
-            }
-            if ( wordCount == 5 ) {                                // Header 5
-               message << "  Run Number: " << ( *it_Lvl2Pr );
-            }
-            if ( wordCount == 6 ) {                                // Header 6
-               message << "  EvID: " << ( *it_Lvl2Pr );
-            }
-            if ( wordCount == 7 ) {                                // Header 7
-               message << "  BcID: " << ( ( *it_Lvl2Pr ) & DaqHeaderBcIDMask );
-            }
-            if ( wordCount == 8 ) {                                // Header 8
-               message << "  TrType: " << ( ( *it_Lvl2Pr ) & DaqHeaderTrTypeMask );
-            }
-            if ( wordCount == 9 ) {                                // Header 9
-               message << "  EvType: " << ( *it_Lvl2Pr ) << std::endl;
-               message << " --------------------------------------------------"
-                       << "-------------------------";
-            }
-            if ( ( it_Lvl2Pr == it_Lvl2PrMioctStart ) || mioctWord ) { // MIOCT's
-               mioctWord = true;
-               if ( ( it_Lvl2Pr ) == it_Lvl2PrMioctEnd ) {
-                  mioctWord = false;
-                  trailerWord = true;
-               } else {
-                  message << printSector( *it_Lvl2Pr );
-               }
-            }
-            if ( trailerWord ) {                                 //Trailer
-               trailerWordCount++;
-               if ( trailerWordCount == 1 ) {
-                  message << " --------------------------------------------------"
-                          << "-------------------------" << std::endl;
-                  message << "  Errors: ";
-                  std::string errorString;
-                  BitOp::printBin( ( *it_Lvl2Pr ), errorString );
-                  message << errorString;
-               }
-               if ( trailerWordCount == 2 ) {
-                  message << "  Status: ";
-                  std::string statusString;
-                  BitOp::printBin( ( *it_Lvl2Pr ), statusString );
-                  message << statusString;
-               }
-               if ( trailerWordCount == 3 ) {
-                  message << "  Status Elements: " << ( *it_Lvl2Pr );
-               }
-               if ( trailerWordCount == 4 ) {
-                  message << "  Data Elements: "
-                          << ( ( *it_Lvl2Pr ) & DaqTrailerCandMask );
-               }
-               if ( trailerWordCount == 5 ) {
-                  message << "  StatusBlockPos: " << ( *it_Lvl2Pr ) << std::endl;
-                  message << " =================================================="
-                          << "=========================";
-               }
-            }
-         } else {
-            REPORT_FATAL_MSG( "Non-existent print method choosen" );
-            assert( 0 );
-         }
-
-         REPORT_VERBOSE_MSG( message.str() );
-
-      }
-
-      return;
-   }
-
-   // method to print one sector in human readable format
-   std::string MirodLvl2Processor::printSector( const unsigned int & sectorWord ) const {
-
-      std::ostringstream outStream;
-      std::string system;
-      std::string hemisphere = "-";
-      unsigned int sectorNumber = 0;
-      unsigned int regionOfInterest = 0;
-      unsigned int overlap = 0;
-
-      // get the values out of the bit mask
-      const unsigned int candFirst = BitOp::getValue( &sectorWord, Lvl2FirstCandMask );
-      const unsigned int sectorAddress =
-         BitOp::getValue( &sectorWord, Lvl2SectorAddressMask );
-      const unsigned int ptValue = BitOp::getValue( &sectorWord, Lvl2PtValueMask );
-      const unsigned int sectorRoIOvl = BitOp::getValue( &sectorWord, Lvl2RoIOvlMask );
-      const unsigned int padOverflow =
-         BitOp::getValue( &sectorWord, Lvl2PadOverflowMask );
-      const unsigned int sectorOverflow =
-         BitOp::getValue( &sectorWord, Lvl2SectorOverflowMask );
-      const bool veto = sectorWord & 0x10000000;
-
-      // sector address and RoI and Overlap must be taken apart agin
-      // to extract the readable information
-      // first find out if this is Barrel, endcap, forward, get sector
-      // number, RoI and Overlap information
-      if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) == 0 ) {
-         system = "B"; // Barrel
-         sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberBarrelMask );
-         regionOfInterest = BitOp::getValue( &sectorRoIOvl, Lvl2BarrelRoIMask );
-         overlap = BitOp::getValue( &sectorRoIOvl, Lvl2BarrelOvlMask );
-      } else if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) == 1 ) {
-         system = "F"; // Forward
-         sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberForwardMask );
-         regionOfInterest = BitOp::getValue( &sectorRoIOvl, Lvl2ForwardRoIMask );
-         overlap = 0;
-      } else if ( BitOp::getValue( &sectorAddress, EvReSecAddressSystemMask ) > 1 ) {
-         system = "E"; // Endcap
-         sectorNumber = BitOp::getValue( &sectorAddress, EvReSecNumberEndcapMask );
-         regionOfInterest = BitOp::getValue( &sectorRoIOvl, Lvl2EndcapRoIMask );
-         overlap = BitOp::getValue( &sectorRoIOvl, Lvl2EndcapOvlMask );
-      }
-      // get the Hemisphere
-      if ( BitOp::getValue( &sectorAddress, EvReSecAddressSubSysMask ) == 1 ) {
-         hemisphere = "+";
-      }
-
-      outStream << "  Addr: " << hemisphere << system << " "
-                << std::setw( 2 ) << std::dec << sectorNumber
-                << " Pt/RoI: " << ptValue
-                << " " << std::setw( 2 ) << regionOfInterest
-                << " Ovl: " << overlap
-                << " pad/secOF: " << std::setw( 2 ) << padOverflow
-                << std::setw( 2 ) << sectorOverflow
-                << " First: " << candFirst
-                << " veto: " << veto;
-
-      return outStream.str();
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.h
deleted file mode 100644
index b1ac367d6b2e..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodLvl2Processor.h
+++ /dev/null
@@ -1,125 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodLvl2Processor.h 726107 2016-02-25 11:04:42Z wengler $
-#ifndef TRIGT1MUCTPI_MIRODLVL2PROCESSOR_H
-#define TRIGT1MUCTPI_MIRODLVL2PROCESSOR_H
-
-// STL include(s):
-#include <string>
-#include <list>
-#include <vector>
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class MirodExtractor;
-   class Configuration;
-
-   /**
-    *  @short implements the MIROD Lvl2 processor
-    *
-    *         This class implements the functionality of the MIROD
-    *         Lvl2 processor. It receives its data from the
-    *         MIROD extractor and chooses the ones that have passed
-    *         the programmable thresholds for candiates in the
-    *         Extractor. The candidates or sorted and the total
-    *         number of candidates and the number of candidates per
-    *         pt value is limited
-    *
-    *    @see MirodModule
-    *    @see MirodDaqProcessor
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 726107 $
-    * $Date: 2016-02-25 12:04:42 +0100 (Thu, 25 Feb 2016) $
-    */
-   class MirodLvl2Processor {
-
-   public:
-      /**
-       * The default constructor of MirodLvl2Processor
-       */
-      MirodLvl2Processor();
-      /**
-       * Alternative constructor of MirodLvl2Processor which has
-       * the purpose of creating an object with setting the Lvl2
-       * out data to an existing std::list of unsigned ints - e.g.
-       * using the output of the hardware - to then utilize the
-       * analysis methods of this class
-       */
-      MirodLvl2Processor( std::list< unsigned int > lvl2Out );
-
-      // set Configuration
-      void setConfiguration( const Configuration& conf );
-
-      /**
-       * access to the output result - candidates only
-       * without the header or trailer words
-       */
-      const std::list< unsigned int >& getLvl2OutputCandidates() const { return m_ptCombinedFiFo; }
-      /**
-       * access to the output result
-       * return The Lvl2 Output Data to the RoIB
-       */
-      const std::list< unsigned int >& getLvl2OutputData() const { return m_lvl2OutputData; }
-      /**
-       * This is the main action interface of the MirodLvl2Processor,
-       * gets a link to the data output of the MirodExtractor. Calling
-       * this method fills the STL list which holds the output of the
-       * Lvl2Processor in the format used in the hardware, e.g. a
-       * stream of 32-bit words
-       * @see MirodModule
-       * @see MirodExtractor
-       * @see MirodLvl2Processor
-       * @param theExtractorData Pointer to the data output of the
-       *                         Mirod Extractor
-       */
-      void processData( const MirodExtractor* theExtractorData );
-      /**
-       * This method prints the Event in DaqOutput format to the
-       * screen. The parameter determines if the printout will be in
-       * binary, hexadecimal or human readable format. Consequently the
-       * choices are "hex", "bin", or "human"
-       * @param format Determines if the printout will be in
-       *               binary or hexadecimal format. Choices are "hex", "bin", "human"
-       */
-      void printEvent( std::string format ) const;
-      /**
-       * function to return a string representing the information
-       * contained in one sector word of the Extractor format
-       * in human readable form
-       * @param sectorWord reference to a sector word represented by
-       *                   32 - bit Extractor format
-       * @return A string to be used for output the information of
-       *         this sector
-       */
-      std::string printSector( const unsigned int& sectorWord ) const;
-
-   private:
-      mutable MsgLogger m_logger;
-
-      std::list< unsigned int >  m_lvl2OutputData;
-
-      /// Buckets used for sorting the candidates by pT
-      std::vector< std::vector< unsigned int > > m_ptSorterBuckets;
-
-      std::list< unsigned int >  m_ptCombinedFiFo;
-
-      // configuration parameters
-      unsigned int m_maxCandPerPtvalue;
-      unsigned int m_maxCandSendToRoib;
-      unsigned int m_candBcidOffset;
-
-   }; // class MirodLvl2Processor
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIRODLVL2PROCESSOR_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.cxx
deleted file mode 100644
index d057a81aeb22..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.cxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodModule.cxx 439303 2011-05-25 15:20:17Z krasznaa $
-
-// Local include(s):
-#include "MirodModule.h"
-#include "../Mibak/MibakStreamEvent.h"
-#include "../Common/Configuration.h"
-
-/*******************************************************************
- * $Date: 2011-05-25 17:20:17 +0200 (Wed, 25 May 2011) $
- *
- * Implementation of class MirodModule
- * @author  $Author: krasznaa $
- * @version $Revision: 439303 $
- ******************************************************************/
-
-namespace LVL1MUCTPI {
-
-   // constructor
-   MirodModule::MirodModule()
-      : m_logger( "MirodModule" ) {
-
-      REPORT_VERBOSE_MSG( "constuctor called" );
-   }
-
-   void MirodModule::processData( const MibakStreamEvent* theStream ) {
-
-      REPORT_VERBOSE_MSG( "Mirod module processing data" );
-
-      m_mirodReader.readData( theStream );
-      m_mirodReader.printEvent( "human" );
-      m_mirodExtractor.processData( this->getMirodEventReader() );
-      m_mirodExtractor.printEvent( "human" );
-      m_mirodDaqProcessor.processData( this->getMirodExtractor() );
-      m_mirodDaqProcessor.printEvent( "human" );
-      m_mirodLvl2Processor.processData( this->getMirodExtractor() );
-      m_mirodLvl2Processor.printEvent( "human" );
-
-      return;
-   }
-
-   void MirodModule::setConfiguration( const Configuration& conf ) {
-
-      REPORT_VERBOSE_MSG( "Configuring Extractor and LVL2 processor" );
-
-      // configure Extractor
-      m_mirodExtractor.setConfiguration( conf );
-
-      // configure L2Processor
-      m_mirodLvl2Processor.setConfiguration( conf );
-
-      return;
-   }
-
-} // namespace LVL1MUCTPI
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.h
deleted file mode 100644
index 7c236c202222..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodModule.h
+++ /dev/null
@@ -1,123 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodModule.h 726107 2016-02-25 11:04:42Z wengler $
-#ifndef TRIGT1MUCTPI_MIRODMODULE_H
-#define TRIGT1MUCTPI_MIRODMODULE_H
-
-// STL include(s):
-#include <list>
-
-// Local include(s):
-#include "../Logging/MsgLogger.h"
-#include "MirodEventReader.h"
-#include "MirodExtractor.h"
-#include "MirodDaqProcessor.h"
-#include "MirodLvl2Processor.h"
-
-namespace LVL1MUCTPI {
-
-   // Forward declaration(s):
-   class Configuration;
-   class MibakStreamEvent;
-
-   /**
-    *  @short Contains all relevant entities of the MIROD board
-    *
-    *         The MirodModule class groups together all relevant
-    *         entities for the Read Out Driver board of the
-    *         MUCTPI (MIROD). It provides services to extract data
-    *         at several stages of the processing in the board,
-    *         corresponding to equivalent access point on the
-    *         the actual hardware. Only one board exists in the
-    *         system. As for the MioctModules, this Module is
-    *         instantiated in the constructor of the Lvl1Mibak
-    *         class
-    *
-    *    @see Lvl1Mibak
-    *    @see MioctModule
-    *    @see MictpModule
-    *
-    * @author Thorsten Wengler
-    * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
-    *
-    * $Revision: 726107 $
-    * $Date: 2016-02-25 12:04:42 +0100 (Thu, 25 Feb 2016) $
-    */
-   class MirodModule {
-
-   public:
-      /**
-       * The constructor of MirodModule
-       */
-      MirodModule();
-
-      /// set Configuration
-      void setConfiguration( const Configuration &conf );
-
-      /**
-       * Method to set the source of data for the input stream coming
-       * from the MIBAK
-       * @see MibakStreamEvent
-       * @param theStream Pointer to the input data stream
-       *                  object holding the data to be read by the MIROD
-       */
-      void processData( const MibakStreamEvent* theStream );
-      /**
-       * This method returns a pointer to the MirodEventReader
-       * @return Pointer to the MirodEventReader
-       *         which is part of the MirodModule
-       */
-      const MirodEventReader* getMirodEventReader() const { return &m_mirodReader; }
-      /**
-       * This method returns a pointer to the MirodExtractor
-       * @return Pointer to the MirodExtractor
-       *         which is part of the MirodModule
-       */
-      const MirodExtractor* getMirodExtractor() const { return &m_mirodExtractor; }
-      /**
-       * This method returns a pointer to the MirodLvl2Processor
-       * @return Pointer to the MirodLvl2Processor
-       *         which is part of the MirodModule
-       */
-      const MirodLvl2Processor* getMirodLvl2Processor() const { return &m_mirodLvl2Processor; }
-      /**
-       * This method returns a reference to the list of unsigned ints holding
-       * the output of the Mirod to the RoIB (Level2), candidates only, wihtout header or trailer words
-       * @return The LVL2 output candidates
-       */
-      const std::list< unsigned int >& getLvl2Candidates() const { return m_mirodLvl2Processor.getLvl2OutputCandidates(); }
-      /**
-       * This method returns a reference to the list of unsigned ints holding
-       * the output of the Mirod to the RoIB (Level2)
-       * @return The LVL2 output
-       */
-      const std::list< unsigned int >& getLvl2Output() const { return m_mirodLvl2Processor.getLvl2OutputData(); }
-      /**
-       * This method returns a pointer to the MirodDaqProcessor
-       * @return Pointer to the MirodDaqProcessor
-       *         which is part of the MirodModule
-       */
-      const MirodDaqProcessor* getMirodDaqProcessor() const { return &m_mirodDaqProcessor; }
-      /**
-       * This method reyrn a reference to the list of unsigned ints holding
-       * the output of the Mirod to the ROB (DAQ)
-       * @return The DAQ output
-       */
-      const std::list< unsigned int >& getDaqOutput() const { return m_mirodDaqProcessor.getDaqOutputData(); }
-
-   private:
-      mutable MsgLogger  m_logger;
-      MirodEventReader   m_mirodReader;
-      MirodExtractor     m_mirodExtractor;
-      MirodDaqProcessor  m_mirodDaqProcessor;
-      MirodLvl2Processor m_mirodLvl2Processor;
-
-   }; // class MirodModule
-
-} // namespace LVL1MUCTPI
-
-#endif // TRIGT1MUCTPI_MIRODMODULE_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.cxx
deleted file mode 100644
index d3a6c952bf5a..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.cxx
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodTestRamIn.cxx 362102 2011-04-28 13:17:28Z krasznaa $
-
-// Local include(s):
-#include "MirodTestRamIn.h"
-
-/*******************************************************************
- * $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
- *
- * Implementation of class MirodTestRamIn
- * @author   Author: Thorsten Wengler
- * @version $Revision: 362102 $
- ******************************************************************/
-
-// constructor of class MirodTestRamIn
-MirodTestRamIn::MirodTestRamIn() {
-
-}
-
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.h b/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.h
deleted file mode 100644
index d0750a2fb299..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/Mirod/MirodTestRamIn.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Dear emacs, this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-// $Id: MirodTestRamIn.h 362102 2011-04-28 13:17:28Z krasznaa $
-#ifndef TRIGT1MUCTPI_MIRODTESTRAMIN_H
-#define TRIGT1MUCTPI_MIRODTESTRAMIN_H
-
-// STL include(s):
-#include <list>
-
-/**
- *******************************************************************
- *
- *    $Date: 2011-04-28 15:17:28 +0200 (Thu, 28 Apr 2011) $
- *
- *    @short Input for the Mirod Test Ram
- *
- *           MirodTestRamIn is a helper class holding the
- *           needed to load the Mirod test ram
- *
- *   @author Thorsten Wengler
- *  @version $Revision: 362102 $
- *
- *******************************************************************
- */
-class MirodTestRamIn {
-
- public:
-  /**
-   * The constructor of MirodTestRamIn
-   */
-  MirodTestRamIn();
-  /**
-   * get or set the DataLow list
-   */
-  void dataLow( std::list< unsigned int > dataLow ) { m_mirodTestDataLow = dataLow; }
-  const std::list< unsigned int >& dataLow() { return m_mirodTestDataLow; }
-  /**
-   * get or set the DataHigh list
-   */
-  void dataHigh( std::list< unsigned int > dataHigh ) { m_mirodTestDataHigh = dataHigh; }
-  const std::list< unsigned int >& dataHigh() { return m_mirodTestDataHigh; }
-  /**
-   * get or set the DataControl list
-   */
-  void dataControl (std::list< unsigned int > dataControl ) { m_mirodTestControl = dataControl; }
-  const std::list< unsigned int >& dataControl() { return m_mirodTestControl; }
-
-  /**
-   * The destructor of MirodTestRamIn
-   */
-  ~MirodTestRamIn() = default;
-
- private:
-
-  std::list< unsigned int > m_mirodTestDataLow;
-  std::list< unsigned int > m_mirodTestDataHigh;
-  std::list< unsigned int > m_mirodTestControl;
-
-}; // class MirodTestRamIn
-
-#endif // TRIGT1MUCTPI_MIRODTESTRAMIN_H
diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/components/TrigT1Muctpi_entries.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/components/TrigT1Muctpi_entries.cxx
deleted file mode 100644
index 2b2ef2081792..000000000000
--- a/Trigger/TrigT1/TrigT1Muctpi/src/components/TrigT1Muctpi_entries.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "../Algorithms/L1Muctpi.h"
-#include "../Algorithms/L1MuctpiPatGen.h"
-#include "../Algorithms/L1MuctpiTestReadResults.h"
-#include "../Algorithms/L1MuctpiTool.h"
-
-DECLARE_COMPONENT( LVL1MUCTPI::L1Muctpi )
-DECLARE_COMPONENT( LVL1MUCTPI::L1MuctpiPatGen )
-DECLARE_COMPONENT( LVL1MUCTPI::L1MuctpiTestReadResults )
-
-DECLARE_COMPONENT( LVL1MUCTPI::L1MuctpiTool )
-
-- 
GitLab


From 9d3baae8b1c61f629c8f93b36b3b7ad56c8dac50 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 20 Sep 2021 11:55:45 +0200
Subject: [PATCH 205/347] L1TopoSimulation: delete obsolete
 MuonInputProviderLegacy

MuonInputProviderLegacy is no longer required now that we only support
the Phase-I MuCtpi.
---
 .../python/L1TopoSimulationConfig.py          |  13 +-
 .../src/MuonInputProviderLegacy.cxx           | 300 ------------------
 .../src/MuonInputProviderLegacy.h             |  88 -----
 .../components/L1TopoSimulation_entries.cxx   |   2 -
 4 files changed, 1 insertion(+), 402 deletions(-)
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProviderLegacy.cxx
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProviderLegacy.h

diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py b/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py
index 3c57e1132d3c..e9e01bbf5f64 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py
@@ -1,6 +1,6 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
-from L1TopoSimulation.L1TopoSimulationConf import LVL1__L1TopoSimulation, LVL1__RoiB2TopoInputDataCnv, LVL1__MuonInputProviderLegacy
+from L1TopoSimulation.L1TopoSimulationConf import LVL1__L1TopoSimulation, LVL1__RoiB2TopoInputDataCnv
 
 class L1TopoSimulation ( LVL1__L1TopoSimulation ):
 
@@ -19,11 +19,6 @@ class RoiB2TopoInputDataCnv ( LVL1__RoiB2TopoInputDataCnv ):
     def __init__( self, name = "RoiB2TopoInputDataCnv" ):
         super( RoiB2TopoInputDataCnv, self ).__init__( name )
 
-class MuonInputProviderLegacy ( LVL1__MuonInputProviderLegacy ):
-
-    def __init__( self, name = "MuonInputProviderLegacy" ):
-        super( MuonInputProviderLegacy, self ).__init__( name )
-
 def L1LegacyTopoSimulationCfg(flags):
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     from AthenaConfiguration.ComponentFactory import CompFactory
@@ -107,7 +102,6 @@ def L1TopoSimulationCfg(flags):
     return acc
 
 def L1TopoSimulationOldStyleCfg(flags, isLegacy):
-    from AthenaCommon.AppMgr import ToolSvc
     from L1TopoSimulation.L1TopoSimulationConfig import L1TopoSimulation
     key = 'Legacy' if isLegacy else 'Phase1'
     topoSimSeq = L1TopoSimulation('L1'+key+'TopoSimulation')
@@ -123,14 +117,9 @@ def L1TopoSimulationOldStyleCfg(flags, isLegacy):
         # Need further test from inputs.
         topoSimSeq.JetInputProvider = 'LVL1::JetInputProviderFEX/JetInputProviderFEX'
 
-    # Muon inputs
-    from L1TopoSimulation.L1TopoSimulationConfig import MuonInputProviderLegacy
-    ToolSvc += MuonInputProviderLegacy('MuonInputProviderLegacy')
-
     if flags.Trigger.doLVL1:
         # TODO: the legacy simulation should not need to deal with muon inputs
         topoSimSeq.MuonInputProvider.ROIBResultLocation = "" #disable input from RoIBResult
-        ToolSvc.MuonInputProviderLegacy.ROIBResultLocation = "" #disable input from RoIBResult
 
     if flags.Trigger.enableL1MuonPhase1: 
         from TrigT1MuonRecRoiTool.TrigT1MuonRecRoiToolConfig import getRun3RPCRecRoiTool, getRun3TGCRecRoiTool
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProviderLegacy.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProviderLegacy.cxx
deleted file mode 100644
index d4eee4cd904a..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProviderLegacy.cxx
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
-   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "MuonInputProviderLegacy.h"
-
-#include <math.h>
-
-#include "GaudiKernel/ITHistSvc.h"
-
-#include "L1TopoEvent/TopoInputEvent.h"
-#include "TrigT1Interfaces/RecMuonRoI.h"
-#include "TrigT1Interfaces/MuCTPIL1Topo.h"
-#include "TrigT1Interfaces/MuCTPIL1TopoCandidate.h"
-
-#include "TrigT1Result/MuCTPIRoI.h"
-#include "TrigT1Result/Header.h"
-#include "TrigT1Result/Trailer.h"
-
-#include "TrigConfData/L1Menu.h"
-
-using namespace std;
-using namespace LVL1;
-
-MuonInputProviderLegacy::MuonInputProviderLegacy( const std::string& type, const std::string& name, 
-                                      const IInterface* parent) :
-   base_class(type, name, parent),
-   m_histSvc("THistSvc", name)
-{
-   declareInterface<LVL1::IInputTOBConverter>( this );
-}
-
-StatusCode
-MuonInputProviderLegacy::initialize() {
-
-   // Get the RPC and TGC RecRoI tool
-   ATH_CHECK( m_recRPCRoiTool.retrieve() );
-   ATH_CHECK( m_recTGCRoiTool.retrieve() );
-
-   CHECK(m_histSvc.retrieve());
-
-   ServiceHandle<IIncidentSvc> incidentSvc("IncidentSvc", "MuonInputProviderLegacy");
-   CHECK(incidentSvc.retrieve());
-   incidentSvc->addListener(this,"BeginRun", 100);
-   incidentSvc.release().ignore();
-
-   // get MuctpiTool handle
-   ATH_MSG_DEBUG("Retrieving MuctpiToolHandle " << m_MuctpiSimTool);
-   CHECK( m_MuctpiSimTool.retrieve() );
-
-
-   //This is a bit ugly but I've done it so the job options can be used to determine 
-   //use of storegate
-   CHECK(m_MuCTPItoL1TopoLocation.initialize(!m_MuCTPItoL1TopoLocation.key().empty()));
-   
-   if(!m_MuCTPItoL1TopoLocationPlusOne.key().empty())
-      m_MuCTPItoL1TopoLocationPlusOne = m_MuCTPItoL1TopoLocation.key()+std::to_string(1);
-   
-   CHECK(m_MuCTPItoL1TopoLocationPlusOne.initialize(!m_MuCTPItoL1TopoLocationPlusOne.key().empty()));
-
-   CHECK(m_muonROILocation.initialize(!m_muonROILocation.key().empty()));
-   CHECK(m_roibLocation.initialize(!m_roibLocation.key().empty()));
-
-   return StatusCode::SUCCESS;
-}
-
-void
-MuonInputProviderLegacy::handle(const Incident& incident) {
-   if (incident.type()!="BeginRun") return;
-   ATH_MSG_DEBUG( "In BeginRun incident");
-
-   string histPath = "/EXPERT/" + name() + "/";
-   replace( histPath.begin(), histPath.end(), '.', '/'); 
-
-   auto hPt = std::make_unique<TH1I>("MuonTOBPt", "Muon TOB Pt", 40, 0, 40);
-   hPt->SetXTitle("p_{T}");
-
-   auto hEtaPhi = std::make_unique<TH2I>("MuonTOBPhiEta", "Muon TOB Location", 25, -50, 50, 32, -32, 32);
-   hEtaPhi->SetXTitle("#eta");
-   hEtaPhi->SetYTitle("#phi");
-
-   if (m_histSvc->regShared( histPath + "TOBPt", std::move(hPt), m_hPt ).isSuccess()){
-      ATH_MSG_DEBUG("TOBPt histogram has been registered successfully for MuonProvider.");
-   }
-   else{
-      ATH_MSG_WARNING("Could not register TOBPt histogram for MuonProvider");
-   }
-   if (m_histSvc->regShared( histPath + "TOBPhiEta", std::move(hEtaPhi), m_hEtaPhi ).isSuccess()){
-      ATH_MSG_DEBUG("TOBPhiEta histogram has been registered successfully for MuonProvider.");
-   }
-   else{
-      ATH_MSG_WARNING("Could not register TOBPhiEta histogram for MuonProvider");
-   }
-}
-
-TCS::MuonTOB
-MuonInputProviderLegacy::createMuonTOB(uint32_t roiword, const TrigConf::L1Menu * l1menu) const {
-
-   LVL1::RecMuonRoI roi( roiword, m_recRPCRoiTool.get(), m_recTGCRoiTool.operator->(), l1menu );
-
-   ATH_MSG_DEBUG("Muon ROI: thrvalue = " << roi.getThresholdValue() << " eta = " << roi.eta() << " phi = " << roi.phi() << ", w   = " << MSG::hex << std::setw( 8 ) << roi.roiWord() << MSG::dec);
-         
-   TCS::MuonTOB muon( roi.getThresholdValue(), 0, int(10*roi.eta()), int(10*roi.phi()), roi.roiWord() );
-   muon.setEtaDouble( roi.eta() );
-   muon.setPhiDouble( roi.phi() );
-
-   m_hPt->Fill(muon.Et());
-   m_hEtaPhi->Fill(muon.eta(),muon.phi());
-   
-   return muon;
-}
-
-TCS::MuonTOB
-MuonInputProviderLegacy::createMuonTOB(const MuCTPIL1TopoCandidate & roi) const {
-   ATH_MSG_DEBUG("Muon ROI (MuCTPiToTopo): thr ID = " << roi.getptThresholdID() << " eta = " << roi.geteta() << " phi = " << roi.getphi()  
-                  << ", w   = " << MSG::hex << std::setw( 8 ) << roi.getRoiID() << MSG::dec );
-   ATH_MSG_DEBUG("                            Oct = " << roi.getMioctID() << " etacode=" <<  roi.getetacode() << " phicode= " <<  
-                  roi.getphicode()<< ", Sector="<< roi.getSectorName() );
-
-   // The L1 topo hardware works with phi in [0,2pi]. The MuCTPi give muons in [0,2pi].
-   // However, L1 topo simulation works with [-pi, pi] and otherwise it crashes. Thus we have to convert here
-   int etaTopo = roi.getieta();
-   int phiTopo = roi.getiphi();
-   if( phiTopo >= 32 ) phiTopo -= 64;
-
-   TCS::MuonTOB muon(roi.getRoiID());
-
-   // legacy bit setting
-   muon.setBitsEt(8);
-   muon.setBitsEta(6);
-   muon.setBitsPhi(6);
-
-   muon.setEt(roi.getptValue());
-   muon.setIsolation(0);
-   muon.setEta(etaTopo);
-   muon.setPhi(phiTopo);
-   muon.setEtDouble(static_cast<double>(roi.getptValue()));
-   muon.setEtaDouble(static_cast<double>(etaTopo/10.));
-   muon.setEtaDouble(static_cast<double>(phiTopo/10.));
-
-   m_hPt->Fill(muon.Et());
-   m_hEtaPhi->Fill(muon.eta(),muon.phi());
-
-   return muon;
-}
-
-TCS::LateMuonTOB
-MuonInputProviderLegacy::createLateMuonTOB(const MuCTPIL1TopoCandidate & roi) const {
-
-   float phi = roi.getphi();
-   if(phi<-M_PI) phi+=2.0*M_PI;
-   if(phi> M_PI) phi-=2.0*M_PI;
-
-   ATH_MSG_DEBUG("Late Muon ROI (MuCTPiToTopo):bcid=1 thr pt = " << roi.getptThresholdID() << " eta = " << roi.geteta() << " phi = " << phi << ", w   = " << MSG::hex << std::setw( 8 ) << roi.getRoiID() << MSG::dec);
-
-   TCS::LateMuonTOB muon( roi.getptValue(), 0, int(10*roi.geteta()), int(10*phi), roi.getRoiID() );
-
-   muon.setEtaDouble( roi.geteta() );
-   muon.setPhiDouble( phi );
-
-   m_hPt->Fill(muon.Et());
-   m_hEtaPhi->Fill(muon.eta(),muon.phi());
-
-   ATH_MSG_DEBUG("LateMuon created");
-   return muon;
-}
-
-StatusCode
-MuonInputProviderLegacy::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const {
-
-   if( m_MuonEncoding == 0 ) {
-
-      ATH_MSG_DEBUG("Filling the muon input from MuCTPIToRoIBSLink produced by L1Muctpi.cxx.");
-
-      const ROIB::RoIBResult* roibResult {nullptr};
-
-      const L1MUINT::MuCTPIToRoIBSLink* muctpi_slink {nullptr};
-
-
-      if(m_muonROILocation.key().empty()==false){
-         SG::ReadHandle<L1MUINT::MuCTPIToRoIBSLink> MuCTPIHandle(m_muonROILocation);//LVL1MUCTPI::DEFAULT_MuonRoIBLocation)
-         if( MuCTPIHandle.isValid() ){
-            muctpi_slink = MuCTPIHandle.cptr();
-         }
-      }
-
-      if(muctpi_slink == nullptr && not m_roibLocation.key().empty()){
-         SG::ReadHandle<ROIB::RoIBResult> roib (m_roibLocation);
-         if( roib.isValid() ){
-            roibResult = roib.cptr(); 
-         }
-      }
-
-      if(!muctpi_slink && !roibResult) {
-         ATH_MSG_WARNING("Neither a MuCTPIToRoIBSLink with SG key " << m_muonROILocation.key() << " nor an RoIBResult were found in the event. No muon input for the L1Topo simulation.");
-         return StatusCode::RECOVERABLE;
-      }
-
-
-      if( roibResult ) {
-
-         const TrigConf::L1Menu * l1menu = nullptr;
-         ATH_CHECK( detStore()->retrieve(l1menu) );
-
-         const std::vector< ROIB::MuCTPIRoI >& rois = roibResult->muCTPIResult().roIVec();
-
-         ATH_MSG_DEBUG("Filling the input event from RoIBResult. Number of Muon ROIs: " << rois.size() );
-
-         for( const ROIB::MuCTPIRoI & muonRoI : rois ) {
-
-            if( !( muonRoI.roIWord() & LVL1::CandidateVetoMask  ) ) {
-               inputEvent.addMuon( MuonInputProviderLegacy::createMuonTOB( muonRoI.roIWord(), l1menu ) );
-            } else {
-            // overflow implemented only for reduced granularity encoding (see below)
-               ATH_MSG_DEBUG(" Ignore Vetoed L1 Mu RoI " <<  muonRoI.roIWord() );
-            }
-         }
-
-      } else if( muctpi_slink ) {
-
-         const TrigConf::L1Menu * l1menu = nullptr;
-         ATH_CHECK( detStore()->retrieve(l1menu) );
-
-         ATH_MSG_DEBUG("Filling the input event. Number of Muon ROIs: " << muctpi_slink->getMuCTPIToRoIBWords().size() - ROIB::Header::wordsPerHeader - ROIB::Trailer::wordsPerTrailer - 1);
-      
-         unsigned int icnt = 0;
-         for ( unsigned int roiword : muctpi_slink->getMuCTPIToRoIBWords() ) {
-               
-            ++icnt;
-            // skip header
-            if ( icnt <= ROIB::Header::wordsPerHeader + 1 ) {
-               continue;
-            }
-            // skip trailer
-            if ( icnt > ( muctpi_slink->getMuCTPIToRoIBWords().size() - ROIB::Trailer::wordsPerTrailer ) ) {
-               continue;
-            }
-            if( !(roiword & LVL1::CandidateVetoMask) ) {
-               inputEvent.addMuon( MuonInputProviderLegacy::createMuonTOB( roiword, l1menu ) );
-            } else {
-               ATH_MSG_DEBUG(" Ignore Vetoed L1 Mu RoI " << roiword );
-            }
-         }
-      
-      }
-   } else {  // reduced granularity encoding
-      ATH_MSG_DEBUG("Use MuCTPiToTopo granularity Muon ROIs.");
-
-      // first see if L1Muctpi simulation already ran and object is in storegate, if not
-      // call tool version of the L1MuctpiSimulation and create it on the fly
-
-      const LVL1::MuCTPIL1Topo* l1topo  {nullptr};
-
-      if(m_MuCTPItoL1TopoLocation.key().empty()==false){
-         SG::ReadHandle<LVL1::MuCTPIL1Topo> l1topoh(m_MuCTPItoL1TopoLocation);
-         if( l1topoh.isValid() ) l1topo = l1topoh.cptr();
-      }
-
-      if( l1topo ) {
-         ATH_MSG_DEBUG("Use MuCTPiToTopo granularity Muon ROIs: retrieve from SG");
-
-         const std::vector<MuCTPIL1TopoCandidate> & candList = l1topo->getCandidates();
-         for( const MuCTPIL1TopoCandidate & muCand : candList) {
-            inputEvent.addMuon( MuonInputProviderLegacy::createMuonTOB( muCand ) );
-            if(muCand.moreThan2CandidatesOverflow()){
-               inputEvent.setOverflowFromMuonInput(true);
-               ATH_MSG_DEBUG("setOverflowFromMuonInput : true (MuCTPIL1TopoCandidate from SG)");
-            }
-         }
-      } else {
-         ATH_MSG_DEBUG("Use MuCTPiToTopo granularity Muon ROIs: calculate from ROIs sent to RoIB");
-         LVL1::MuCTPIL1Topo l1topo;
-         CHECK(m_MuctpiSimTool->fillMuCTPIL1Topo(l1topo));
-         for( const MuCTPIL1TopoCandidate & cand : l1topo.getCandidates() ) {
-            inputEvent.addMuon( MuonInputProviderLegacy::createMuonTOB( cand ) );
-            if(cand.moreThan2CandidatesOverflow()){
-               inputEvent.setOverflowFromMuonInput(true);
-               ATH_MSG_DEBUG("setOverflowFromMuonInput : true (MuCTPIL1TopoCandidate from MuctpiSimTool)");
-            }
-         }
-      }
-
-      //BC+1 ... this can only come from simulation, in data taking this is collected by the L1Topo at its input
-      // so no need to do anything else here
-      if(m_MuCTPItoL1TopoLocationPlusOne.key().empty()==false) {
-         SG::ReadHandle<LVL1::MuCTPIL1Topo> l1topoBC1(m_MuCTPItoL1TopoLocationPlusOne);
-         if( l1topoBC1.isValid() ) {
-            ATH_MSG_DEBUG( "Contains L1Topo LateMuons L1Muctpi object from StoreGate!" );
-            const std::vector<MuCTPIL1TopoCandidate> & candList = l1topoBC1->getCandidates();
-            for( const MuCTPIL1TopoCandidate& muCand : candList)
-            {
-               ATH_MSG_DEBUG("MuonInputProviderLegacy addLateMuon ");
-               inputEvent.addLateMuon( MuonInputProviderLegacy::createLateMuonTOB( muCand ) );	   
-            }
-         }
-      }
-   }
-   return StatusCode::SUCCESS;
-}
-
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProviderLegacy.h b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProviderLegacy.h
deleted file mode 100644
index cba64f3b7a4c..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/MuonInputProviderLegacy.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef L1TopoSimulation_MuonInputProviderLegacy
-#define L1TopoSimulation_MuonInputProviderLegacy
-
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "L1TopoSimulation/IInputTOBConverter.h"
-#include "GaudiKernel/IIncidentListener.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/LockedHandle.h"
-#include "TrigT1Interfaces/MuCTPIL1Topo.h"
-#include "TrigT1Result/RoIBResult.h"
-#include "TrigT1Interfaces/MuCTPIToRoIBSLink.h"
-#include "TrigT1Interfaces/TrigT1StoreGateKeys.h"
-#include "TrigT1Interfaces/ITrigT1MuonRecRoiTool.h"
-#include "TrigT1Interfaces/IMuctpiSimTool.h"
-
-#include "TH1.h"
-#include "TH2.h"
-
-#include <vector>
-
-class ITHistSvc;
-
-namespace TrigConf
-{
-   class L1Menu;
-} // namespace TrigConf
-
-namespace TCS {
-   class MuonTOB;
-   class LateMuonTOB;
-}
-
-namespace LVL1 {
-
-   class MuCTPIL1TopoCandidate;
-
-   class MuonInputProviderLegacy : public extends2<AthAlgTool, IInputTOBConverter, IIncidentListener> {
-   public:
-      MuonInputProviderLegacy(const std::string& type, const std::string& name, 
-                         const IInterface* parent);
-      
-      virtual StatusCode initialize() override;
-
-      virtual StatusCode fillTopoInputEvent(TCS::TopoInputEvent& ) const override;
-
-      virtual void handle(const Incident&) override;
-
-   private:
-      TCS::MuonTOB createMuonTOB(uint32_t roiword, const TrigConf::L1Menu *l1menu) const;
-      TCS::MuonTOB createMuonTOB(const MuCTPIL1TopoCandidate & roi) const;
-      TCS::LateMuonTOB createLateMuonTOB(const MuCTPIL1TopoCandidate & roi) const;
-      /*
-         @brief convert the 2-bit value from MuCTPIL1TopoCandidate::getptL1TopoCode() to an actual pt
-
-         The muon TOB encodes pt values in 2 bits.
-         A MuCTPIL1TopoCandidate provides the encoded 2-bit value with
-         the function getptL1TopoCode().
-         This function uses the information from the l1 trigger menu
-         configuration to convert the threshold to an actual pt value.
-         For more details, see ATR-16781.
-      */
-      unsigned int topoMuonPtThreshold(const MuCTPIL1TopoCandidate &mctpiCand) const;
-
-
-      ServiceHandle<ITHistSvc> m_histSvc;
-
-      ToolHandle<LVL1::ITrigT1MuonRecRoiTool> m_recRPCRoiTool{this, "RecRpcRoiTool", "LVL1::TrigT1RPCRecRoiTool/TrigT1RPCRecRoiTool", "RPC RoI reconstruction tool"};
-      ToolHandle<LVL1::ITrigT1MuonRecRoiTool> m_recTGCRoiTool{this, "RecTgcRoiTool", "LVL1::TrigT1TGCRecRoiTool/TrigT1TGCRecRoiTool", "TGC RoI reconstruction tool"};
-
-      ToolHandle<LVL1MUCTPI::IMuctpiSimTool> m_MuctpiSimTool{this, "MuctpiSimTool", "LVL1MUCTPI::L1MuctpiTool/LVL1MUCTPI__L1MuctpiTool", "Tool for MUCTPIsimulation"};
-
-      SG::ReadHandleKey<L1MUINT::MuCTPIToRoIBSLink> m_muonROILocation { this, "MuonROILocation", LVL1MUCTPI::DEFAULT_MuonRoIBLocation, "Storegate key for the Muon ROIs" };
-      SG::ReadHandleKey<ROIB::RoIBResult> m_roibLocation{ this, "ROIBResultLocation", ROIB::DEFAULT_RoIBRDOLocation, "Storegate key for the reading the ROIBResult" };
-      SG::ReadHandleKey<LVL1::MuCTPIL1Topo> m_MuCTPItoL1TopoLocation { this, "locationMuCTPItoL1Topo", LVL1MUCTPI::DEFAULT_MuonL1TopoLocation, "Storegate key for MuCTPItoL1Topo "};
-      SG::ReadHandleKey<LVL1::MuCTPIL1Topo> m_MuCTPItoL1TopoLocationPlusOne { this, "BCPlusOneLocation", "", "Storegate key for MuCTPItoL1TopoPlusOne"};
-      Gaudi::Property<uint16_t> m_MuonEncoding {this, "MuonEncoding", 0, "0=full granularity Mu ROIs, 1=MuCTPiToTopo granularity"};
-
-      mutable LockedHandle<TH1> m_hPt ATLAS_THREAD_SAFE;
-      mutable LockedHandle<TH2> m_hEtaPhi ATLAS_THREAD_SAFE;
-   };
-}
-
-#endif
-
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/components/L1TopoSimulation_entries.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/components/L1TopoSimulation_entries.cxx
index 6ba3924aa9bb..5cd0a35d09be 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/components/L1TopoSimulation_entries.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/components/L1TopoSimulation_entries.cxx
@@ -6,7 +6,6 @@
 #include "../JetInputProviderFEX.h"
 #include "../EnergyInputProvider.h"
 #include "../MuonInputProvider.h"
-#include "../MuonInputProviderLegacy.h"
 #include "../RoiB2TopoInputDataCnv.h"
 
 DECLARE_COMPONENT( LVL1::L1TopoSimulation )
@@ -18,4 +17,3 @@ DECLARE_COMPONENT( LVL1::JetInputProvider )
 DECLARE_COMPONENT( LVL1::JetInputProviderFEX )
 DECLARE_COMPONENT( LVL1::EnergyInputProvider )
 DECLARE_COMPONENT( LVL1::MuonInputProvider )
-DECLARE_COMPONENT( LVL1::MuonInputProviderLegacy )
-- 
GitLab


From ba80c556a3c669e2941ca6edf652940a8b0c5d1c Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 20 Sep 2021 14:50:16 +0200
Subject: [PATCH 206/347] Fix SimKernel name for OutputStream AcceptAlgs

---
 .../SimuJobTransforms/python/CommonSimulationSteering.py     | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py b/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
index f4ecb2cffe02..b655edbd971f 100644
--- a/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
+++ b/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
@@ -53,10 +53,7 @@ def CommonSimulationCfg(ConfigFlags, log):
     # add the ISF_MainConfig
         from ISF_Config.ISF_MainConfigNew import ISF_KernelCfg
         cfg.merge(ISF_KernelCfg(ConfigFlags))
-        if 'MT' in  ConfigFlags.Sim.ISF.Simulator:
-            AcceptAlgName = 'SimKernelMT'
-        else:
-            AcceptAlgName = 'SimKernel'
+        AcceptAlgName = 'ISF_Kernel_' + ConfigFlags.Sim.ISF.Simulator
     else:
         AcceptAlgName = 'G4AtlasAlg'
         #add the G4AtlasAlg
-- 
GitLab


From f72f21bcc506333fa57b6427d2094ded22e74210 Mon Sep 17 00:00:00 2001
From: Peter Berta <peter.berta@cern.ch>
Date: Mon, 20 Sep 2021 15:21:48 +0200
Subject: [PATCH 207/347] Merge branch '22.0-mc20-update-job-skeletons' into
 '22.0-mc20'

RecJobTransforms+SimuJobTransforms: Update the job skeleton logic that overwrites the file compression settings

See merge request atlas/athena!46580

(cherry picked from commit 8723d9fdbc2c5e19b44cbe58e00f71e2e3a6f1fe)

088fde70 Update the job skeleton logic that overwrites the file compression settings
---
 .../share/skeleton.ESDtoAOD_tf.py                 |  7 ++++---
 .../share/skeleton.RAWtoALL_tf.py                 | 15 ++++++++-------
 .../share/skeleton.RAWtoESD_tf.py                 |  2 +-
 .../SimuJobTransforms/share/skeleton.HITtoRDO.py  |  2 +-
 4 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/Reconstruction/RecJobTransforms/share/skeleton.ESDtoAOD_tf.py b/Reconstruction/RecJobTransforms/share/skeleton.ESDtoAOD_tf.py
index cf970032d376..f95373f2acca 100644
--- a/Reconstruction/RecJobTransforms/share/skeleton.ESDtoAOD_tf.py
+++ b/Reconstruction/RecJobTransforms/share/skeleton.ESDtoAOD_tf.py
@@ -126,9 +126,10 @@ if hasattr(runArgs,"outputDESDM_BEAMSPOTFile"):
 #==========================================================
 # Use ZLIB for compression of all temporary outputs
 #==========================================================
-if hasattr(runArgs, "outputAODFile") and ('_000' in runArgs.outputAODFile or 'tmp.' in runArgs.outputAODFile):
-    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" +  athenaCommonFlags.PoolAODOutput()+ "'; COMPRESSION_ALGORITHM = '1'" ]
-    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" +  athenaCommonFlags.PoolAODOutput()+ "'; COMPRESSION_LEVEL = '1'" ]
+from AthenaPoolCnvSvc import PoolAttributeHelper as pah
+if hasattr(runArgs, "outputAODFile") and (runArgs.outputAODFile.endswith('_000') or runArgs.outputAODFile.startswith('tmp.')):
+    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setFileCompAlg( athenaCommonFlags.PoolAODOutput(), 1 ) ]
+    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setFileCompLvl( athenaCommonFlags.PoolAODOutput(), 1 ) ]
 
 ## Post-include
 if hasattr(runArgs,"postInclude"): 
diff --git a/Reconstruction/RecJobTransforms/share/skeleton.RAWtoALL_tf.py b/Reconstruction/RecJobTransforms/share/skeleton.RAWtoALL_tf.py
index 9d1af346ff9d..4af6590b2cb2 100644
--- a/Reconstruction/RecJobTransforms/share/skeleton.RAWtoALL_tf.py
+++ b/Reconstruction/RecJobTransforms/share/skeleton.RAWtoALL_tf.py
@@ -197,13 +197,14 @@ if hasattr(runArgs,"inputRDO_TRIGFile") and rec.doFileMetaData():
 #==========================================================
 # Use ZLIB for compression of all temporary outputs
 #==========================================================
-if hasattr(runArgs, "outputESDFile") and ('_000' in runArgs.outputESDFile or 'tmp.' in runArgs.outputESDFile):
-    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" +  athenaCommonFlags.PoolESDOutput()+ "'; COMPRESSION_ALGORITHM = '1'" ]
-    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" +  athenaCommonFlags.PoolESDOutput()+ "'; COMPRESSION_LEVEL = '1'" ]
-
-if hasattr(runArgs, "outputAODFile") and ('_000' in runArgs.outputAODFile or 'tmp.' in runArgs.outputAODFile):
-    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" +  athenaCommonFlags.PoolAODOutput()+ "'; COMPRESSION_ALGORITHM = '1'" ]
-    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" +  athenaCommonFlags.PoolAODOutput()+ "'; COMPRESSION_LEVEL = '1'" ]
+from AthenaPoolCnvSvc import PoolAttributeHelper as pah
+if hasattr(runArgs, "outputESDFile") and (runArgs.outputESDFile.endswith('_000') or runArgs.outputESDFile.startswith('tmp.')):
+    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setFileCompAlg( athenaCommonFlags.PoolESDOutput(), 1 ) ]
+    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setFileCompLvl( athenaCommonFlags.PoolESDOutput(), 1 ) ]
+
+if hasattr(runArgs, "outputAODFile") and (runArgs.outputAODFile.endswith('_000') or runArgs.outputAODFile.startswith('tmp.')):
+    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setFileCompAlg( athenaCommonFlags.PoolAODOutput(), 1 ) ]
+    ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setFileCompLvl( athenaCommonFlags.PoolAODOutput(), 1 ) ]
 
 ## Post-include
 if hasattr(runArgs,"postInclude"): 
diff --git a/Reconstruction/RecJobTransforms/share/skeleton.RAWtoESD_tf.py b/Reconstruction/RecJobTransforms/share/skeleton.RAWtoESD_tf.py
index 2f932061d638..5c7d28eb124b 100644
--- a/Reconstruction/RecJobTransforms/share/skeleton.RAWtoESD_tf.py
+++ b/Reconstruction/RecJobTransforms/share/skeleton.RAWtoESD_tf.py
@@ -196,7 +196,7 @@ if hasattr(runArgs,"inputRDO_TRIGFile") and rec.doFileMetaData():
 #==========================================================
 # Use ZLIB for compression of all temporary outputs
 #==========================================================
-if hasattr(runArgs, "outputESDFile") and ('_000' in runArgs.outputESDFile or 'tmp.' in runArgs.outputESDFile):
+if hasattr(runArgs, "outputESDFile") and (runArgs.outputESDFile.endswith('_000') or runArgs.outputESDFile.startswith('tmp.')):
     ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" +  athenaCommonFlags.PoolESDOutput()+ "'; COMPRESSION_ALGORITHM = '1'" ]
     ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DatabaseName = '" +  athenaCommonFlags.PoolESDOutput()+ "'; COMPRESSION_LEVEL = '1'" ]
 
diff --git a/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py b/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py
index e1fa1d1312b9..69a79312892b 100644
--- a/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py
+++ b/Simulation/SimuJobTransforms/share/skeleton.HITtoRDO.py
@@ -439,7 +439,7 @@ from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 import AthenaPoolCnvSvc.AthenaPool  # noqa: F401
 from AthenaPoolCnvSvc import PoolAttributeHelper as pah
 Out = athenaCommonFlags.PoolRDOOutput()
-if hasattr(runArgs, "outputRDOFile") and ('_000' in runArgs.outputRDOFile or 'tmp.' in runArgs.outputRDOFile): # noqa: F821
+if hasattr(runArgs, "outputRDOFile") and (runArgs.outputRDOFile.endswith('_000') or runArgs.outputRDOFile.startswith('tmp.')): # noqa: F821
     svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setFileCompAlg( Out, 1 ) ]
     svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setFileCompLvl( Out, 1 ) ]
 
-- 
GitLab


From 4762b6af810622c8376f1de597a6bf72d3e1fef7 Mon Sep 17 00:00:00 2001
From: Antonio De Maria <antonio.de.maria@cern.ch>
Date: Mon, 20 Sep 2021 16:24:52 +0200
Subject: [PATCH 208/347] Update base tau trigger configuration

---
 .../python/HLTMenuConfig/Menu/SignatureDicts.py           | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 3eb170474bdd..8382e5e8931f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -386,8 +386,8 @@ TauChainParts = {
     'L1threshold'   : '',
     'chainPartName' : '',
     'threshold'     : '',
-    'preselection'  : ['tracktwo', 'tracktwoEF', 'tracktwoMVA', 'tracktwoMVATest', 'tracktwoMVABDT', 'tracktwoLLP', 'ptonly', ],
-    'selection'     : ['medium1', 'verylooseRNN', 'looseRNN', 'mediumRNN', 'tightRNN', 'perf', 'idperf',
+    'preselection'  : ['tracktwo', 'tracktwoMVA', 'tracktwoMVATest', 'tracktwoMVABDT', 'tracktwoLLP', 'ptonly', ],
+    'selection'     : ['medium1', 'looseRNN', 'mediumRNN', 'tightRNN', 'perf', 'idperf',
                        'kaonpi1', 'kaonpi2', 'dipion1', 'dipion2', 'dipion3', 'dipion4', 'dikaonmass', 'singlepion'],
     'multiplicity'  : '',
     'trigType'      : ['tau'],
@@ -407,8 +407,8 @@ TauChainParts_Default = {
     'L1threshold'   : '',
     'chainPartName' : '',
     'threshold'     : '20',
-    'preselection'  : 'tracktwo',
-    'selection'     : 'medium1',
+    'preselection'  : 'tracktwoMVA',
+    'selection'     : 'mediumRNN',
     'multiplicity'  :  '',
     'trigType'      : ['tau'],
     'trkInfo'       : [],
-- 
GitLab


From 6be9fbd147b17cef076c58d31bd1c1c95a34bd78 Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Mon, 20 Sep 2021 17:59:55 +0200
Subject: [PATCH 209/347] Sweeping changes for ReSimulation Workflow to master

---
 .../G4AtlasApps/python/SimConfigFlags.py      |   3 +-
 .../ISF_Config/python/ISF_jobProperties.py    |   7 +-
 .../ISF_Config/share/ISF_ConfigJobInclude.py  |   7 +-
 .../ISF_Config/share/jobOptions_ConfGetter.py |   2 +
 .../python/ISF_AlgorithmsConfig.py            |  18 +-
 .../ISF/ISF_Example/python/ISF_Output.py      |  25 +-
 .../python/SimTransformUtils.py               |  23 +-
 .../SimuJobTransforms/python/simTrfArgs.py    |  25 +-
 .../SimuJobTransforms/scripts/ReSim_tf.py     |  68 ++++
 .../SimuJobTransforms/scripts/TestBeam_tf.py  |   3 +-
 .../SimuJobTransforms/share/skeleton.ReSim.py | 319 ++++++++++++++++++
 .../ISF_Validation/test/test_ReSimulation.sh  |  60 ++++
 Tools/PyJobTransforms/python/trfValidation.py |   2 +-
 13 files changed, 535 insertions(+), 27 deletions(-)
 create mode 100755 Simulation/SimuJobTransforms/scripts/ReSim_tf.py
 create mode 100644 Simulation/SimuJobTransforms/share/skeleton.ReSim.py
 create mode 100755 Simulation/Tests/ISF_Validation/test/test_ReSimulation.sh

diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
index 81f00a399991..b65b45fef5d4 100644
--- a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
+++ b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
@@ -94,7 +94,8 @@ def createSimConfigFlags():
     scf.addFlag("Sim.ISF.DoTimeMonitoring", True) # bool: run time monitoring
     scf.addFlag("Sim.ISF.DoMemoryMonitoring", True) # bool: run time monitoring
     scf.addFlag("Sim.ISF.ValidationMode", False) # bool: run ISF internal validation checks
-    
+    scf.addFlag("Sim.ISF.ReSimulation", False) # Using ReSimulation workflow
+
     def decideHITSMerging(prevFlags):
         simstr = prevFlags.Sim.ISF.Simulator
         if simstr.endswith("MT"):
diff --git a/Simulation/ISF/ISF_Config/python/ISF_jobProperties.py b/Simulation/ISF/ISF_Config/python/ISF_jobProperties.py
index 5878594eb542..563ddca857ae 100644
--- a/Simulation/ISF/ISF_Config/python/ISF_jobProperties.py
+++ b/Simulation/ISF/ISF_Config/python/ISF_jobProperties.py
@@ -172,6 +172,11 @@ class GeoIDService(JobProperty):
     allowedTypes = ['str']
     StoredValue  = 'NONE'
 
+class ReSimulation(JobProperty):
+    """Using ReSimulation workflow"""
+    statusOn     = False
+    allowedTypes = ['bool']
+    StoredValue  = False
 ##-----------------------------------------------------------------------------
 ## 2nd step
 ## Definition of the InDet flag container
@@ -211,7 +216,7 @@ jobproperties.ISF_jobProperties.add_JobProperty(RoutingChainID)
 jobproperties.ISF_jobProperties.add_JobProperty(RoutingChainCalo)
 jobproperties.ISF_jobProperties.add_JobProperty(RoutingChainMS)
 jobproperties.ISF_jobProperties.add_JobProperty(RoutingChainCavern)
-
+jobproperties.ISF_jobProperties.add_JobProperty(ReSimulation)
 ##-----------------------------------------------------------------------------
 ## 5th step
 ## short-cut for lazy people
diff --git a/Simulation/ISF/ISF_Config/share/ISF_ConfigJobInclude.py b/Simulation/ISF/ISF_Config/share/ISF_ConfigJobInclude.py
index 0b837f79f207..95bd344b885b 100644
--- a/Simulation/ISF/ISF_Config/share/ISF_ConfigJobInclude.py
+++ b/Simulation/ISF/ISF_Config/share/ISF_ConfigJobInclude.py
@@ -15,8 +15,6 @@ from AthenaCommon import AthenaCommonFlags
 from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
 from AthenaCommon.AppMgr import theApp
 from AthenaCommon.AppMgr import ServiceMgr
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
 
 # TODO: ELLI: remove this once the envelopes are stored in the DDDB
 #             -> currently a fallback python definition is used
@@ -139,8 +137,9 @@ if nThreads > 0:
         svcMgr+=ThreadPoolSvc("ThreadPoolSvc")
     svcMgr.ThreadPoolSvc.ThreadInitTools+=["G4ThreadInitTool"]
 
-from AthenaCommon.CfgGetter import getAlgorithm
-topSeq += getAlgorithm("BeamEffectsAlg")
+if not ISF_Flags.ReSimulation():
+    from AthenaCommon.CfgGetter import getAlgorithm
+    topSeq += getAlgorithm("BeamEffectsAlg")
 
 #--------------------------------------------------------------
 # ISF kernel configuration
diff --git a/Simulation/ISF/ISF_Config/share/jobOptions_ConfGetter.py b/Simulation/ISF/ISF_Config/share/jobOptions_ConfGetter.py
index 70963a2f58b7..7cc79dcec0f2 100644
--- a/Simulation/ISF/ISF_Config/share/jobOptions_ConfGetter.py
+++ b/Simulation/ISF/ISF_Config/share/jobOptions_ConfGetter.py
@@ -118,6 +118,8 @@ else:
     simFlags.TruthStrategy    = 'MC12'
     simFlags.SimBarcodeOffset  = 200000 #MC12 setting
 
+from AthenaCommon.AlgSequence import AlgSequence
+topSeq = AlgSequence()
 include('ISF_Config/ISF_ConfigJobInclude.py')
 
 
diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py
index 54a0154f93eb..81d0db26e1f9 100644
--- a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py
+++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/ISF_AlgorithmsConfig.py
@@ -54,10 +54,7 @@ def getSimEventFilter(name="ISF_SimEventFilter", **kwargs):
     kwargs.setdefault( "GenParticleCommonFilters", ['ISF_ParticlePositionFilterDynamic','ISF_EtaPhiFilter','ISF_GenParticleInteractingFilter'] )
     kwargs.setdefault( "GenParticleOldFilters", ['ISF_ParticleFinalStateFilter'] )
     kwargs.setdefault( "GenParticleNewFilters", ['ISF_ParticleSimWhiteList_ExtraParticles'] )
-
-    from ISF_Algorithms.ISF_AlgorithmsConf import ISF__SimEventFilter
-    simEventFilter = ISF__SimEventFilter(name, **kwargs)
-    return simEventFilter
+    return CfgMgr.ISF__SimEventFilter(name, **kwargs)
 
 def getInvertedSimEventFilter(name="ISF_InvertedSimEventFilter", **kwargs):
     kwargs.setdefault("FilterKey", "ISF_InvertedSimEventFilter")
@@ -80,7 +77,7 @@ def getRenameHitCollections(name="RenameHitCollections", **kwargs):
         kwargs.setdefault( "InputBLMHits",              "BLMHitsOLD" )
         kwargs.setdefault( "OutputBCMHits",             "BCMHits"             )
         kwargs.setdefault( "OutputBLMHits",             "BLMHits"             )
-    if DetFlags.simulate.Pixel_on():
+    if DetFlags.simulate.pixel_on():
         kwargs.setdefault( "InputPixelHits",            "PixelHitsOLD" )
         kwargs.setdefault( "OutputPixelHits",           "PixelHits"           )
     if DetFlags.simulate.SCT_on():
@@ -117,11 +114,11 @@ def getRenameHitCollections(name="RenameHitCollections", **kwargs):
         kwargs.setdefault( "OutputTileActiveCalibHits", "TileCalibHitActiveCell")
         kwargs.setdefault( "OutputTileInactiveCalibHits", "TileCalibHitInactiveCell")
         kwargs.setdefault( "OutputTileDeadCalibHits", "TileCalibHitDeadMaterial")
-    if DetFlags.simulate.Tile_on() and not DetFlags.simulate.HGTD_on():
         kwargs.setdefault( "InputMBTSHits",             "MBTSHitsOLD" )
         kwargs.setdefault( "OutputMBTSHits",            "MBTSHits"            )
 
-    if DetFlags.simulate.CSC_on():
+    from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
+    if MuonGeometryFlags.hasCSC() and DetFlags.simulate.CSC_on():
         kwargs.setdefault( "InputCSCHits",              "CSC_HitsOLD" )
         kwargs.setdefault( "OutputCSCHits",             "CSC_Hits"            )
     if DetFlags.simulate.MDT_on():
@@ -133,12 +130,11 @@ def getRenameHitCollections(name="RenameHitCollections", **kwargs):
     if DetFlags.simulate.TGC_on():
         kwargs.setdefault( "InputTGCHits",              "TGC_HitsOLD" )
         kwargs.setdefault( "OutputTGCHits",             "TGC_Hits"            )
-    if DetFlags.simulate.Micromegas_on():
+    if MuonGeometryFlags.hasMM() and DetFlags.simulate.Micromegas_on():
         kwargs.setdefault( "InputMMHits",              "MicromegasSensitiveDetectorOLD" )
         kwargs.setdefault( "OutputMMHits",              "MicromegasSensitiveDetector"  )
-    if DetFlags.simulate.sTGC_on():
+    if MuonGeometryFlags.hasSTGC() and DetFlags.simulate.sTGC_on():
         kwargs.setdefault( "InputsTGCHits",              "sTGCSensitiveDetectorOLD" )
         kwargs.setdefault( "OutputsTGCHits",           "sTGCSensitiveDetector"           )
 
-    from ISF_Algorithms.ISF_AlgorithmsConf import ISF__RenameHitCollectionsAlg
-    return ISF__RenameHitCollectionsAlg(name, **kwargs)
+    return CfgMgr.ISF__RenameHitCollectionsAlg(name, **kwargs)
diff --git a/Simulation/ISF/ISF_Example/python/ISF_Output.py b/Simulation/ISF/ISF_Example/python/ISF_Output.py
index 0891f27afb99..ed6430fd385f 100644
--- a/Simulation/ISF/ISF_Example/python/ISF_Output.py
+++ b/Simulation/ISF/ISF_Example/python/ISF_Output.py
@@ -36,10 +36,28 @@ def getHITSStreamItemList():
     ## Calo
     if DetFlags.Calo_on():
         hitsItemList += ["CaloCalibrationHitContainer#*",
-                         "LArHitContainer#*",
-                         "TileHitVector#*",
+                         "LArHitContainer#LArHitEMB",
+                         "LArHitContainer#LArHitEMEC",
+                         "LArHitContainer#LArHitHEC",
+                         "LArHitContainer#LArHitFCAL",
+                         "LArHitContainer#LArHitMiniFCAL",
+                         "TileHitVector#TileHitVec",
+                         "TileHitVector#MBTSHits",
                          #"SimpleScintillatorHitCollection#*",
                          "TrackRecordCollection#MuonEntryLayer"]
+        from ISF_Config.ISF_jobProperties import ISF_Flags
+        if ISF_Flags.HITSMergingRequired.get_Value().get('CALO', False):
+            hitsItemList += ["LArHitContainer#LArHitEMB_G4",
+                             "LArHitContainer#LArHitEMEC_G4",
+                             "LArHitContainer#LArHitHEC_G4",
+                             "LArHitContainer#LArHitFCAL_G4",
+                             "LArHitContainer#LArHitEMB_FastCaloSim",
+                             "LArHitContainer#LArHitEMEC_FastCaloSim",
+                             "LArHitContainer#LArHitHEC_FastCaloSim",
+                             "LArHitContainer#LArHitFCAL_FastCaloSim",
+                             "TileHitVector#MBTSHits_G4",
+                             "TileHitVector#TileHitVec_G4",
+                             "TileHitVector#TileHitVec_FastCaloSim"]
     ## Muon
     if DetFlags.Muon_on():
         hitsItemList += ["RPCSimHitCollection#*",
@@ -158,6 +176,9 @@ class ISF_HITSStream:
             stream1.ItemList = getHITSStreamItemList()
             ## Make stream aware of aborted events
             stream1.AcceptAlgs = [ISF_Flags.Simulator.KernelName()]
+            if ISF_Flags.ReSimulation:
+                stream1.AcceptAlgs += ['RenameHitCollections']
+                stream1.TakeItemsFromInput=False
             
         ## xAOD Stream if ParametricSimulation
         # TODO: name of the AOD file cannot be changed via Sim_tf because it
diff --git a/Simulation/SimuJobTransforms/python/SimTransformUtils.py b/Simulation/SimuJobTransforms/python/SimTransformUtils.py
index db6bdd85856d..3042ecdaafb8 100644
--- a/Simulation/SimuJobTransforms/python/SimTransformUtils.py
+++ b/Simulation/SimuJobTransforms/python/SimTransformUtils.py
@@ -108,7 +108,8 @@ def addCommonSimDigArguments(parser):
     addForwardDetTrfArgs(parser)
 
 def addCommonSimulationArguments(parser):
-    from SimuJobTransforms.simTrfArgs import addCommonSimTrfArgs, addCosmicsTrfArgs, addTrackRecordArgs
+    from SimuJobTransforms.simTrfArgs import addCommonSimTrfArgs, addSimIOTrfArgs, addCosmicsTrfArgs, addTrackRecordArgs
+    addSimIOTrfArgs(parser)
     addCommonSimTrfArgs(parser)
     addCosmicsTrfArgs(parser)
     addTrackRecordArgs(parser)
@@ -123,6 +124,15 @@ def addPureDigitizationArguments(parser):
     addBasicDigiArgs(parser)
     addPileUpTrfArgs(parser)
 
+def addReSimulationArguments(parser):
+    from SimuJobTransforms.simTrfArgs import addCommonSimTrfArgs, addCosmicsTrfArgs, addTrackRecordArgs, addSim_tfArgs, addReSimulationArgs
+    addCommonSimTrfArgs(parser)
+    addCosmicsTrfArgs(parser)
+    addTrackRecordArgs(parser)
+    addCommonSimDigArguments(parser)
+    addSim_tfArgs(parser)
+    addReSimulationArgs(parser)
+
 def addSimulationArguments(parser):
     addCommonSimDigArguments(parser)
     addPureSimulationArguments(parser)
@@ -171,6 +181,17 @@ def addSimulationSubstep(executorSet, overlayTransform = False):
         SimExe.inputDataTypeCountCheck = ['EVNT']
     executorSet.add(SimExe)
 
+def addReSimulationSubstep(executorSet):
+    SimExe = athenaExecutor(name = 'ReSim',
+                            skeletonFile = 'SimuJobTransforms/skeleton.ReSim.py',
+                            substep = 'rsm',
+                            tryDropAndReload = False,
+                            perfMonFile = 'ntuple.pmon.gz',
+                            inData=['HITS'],
+                            outData=['HITS_RSM'],
+                            inputDataTypeCountCheck = ['HITS'] )
+    executorSet.add(SimExe)
+
 def addAtlasG4Substep(executorSet):
     executorSet.add(athenaExecutor(name = 'AtlasG4TfTRIn', skeletonFile = 'SimuJobTransforms/skeleton.EVGENtoHIT_MC12.py',
                                    skeletonCA = 'SimuJobTransforms.G4AtlasAlg_Skeleton',
diff --git a/Simulation/SimuJobTransforms/python/simTrfArgs.py b/Simulation/SimuJobTransforms/python/simTrfArgs.py
index 8274cc9f9bab..52514eff937d 100644
--- a/Simulation/SimuJobTransforms/python/simTrfArgs.py
+++ b/Simulation/SimuJobTransforms/python/simTrfArgs.py
@@ -166,16 +166,20 @@ def addTestBeamArgs(parser):
                         help='Z coordinate is the distance from ATLAS center to the desired impact point. Sensitive part starts at Z=2300, ends at Z=2300+3*100+3*130+3*150+2*190=3820', group='TestBeam')
 
 ## Add common Simulation transform arguments to an argparse ArgumentParser
-def addCommonSimTrfArgs(parser):
-    parser.defineArgGroup('CommonSim', 'Common Simulation Options')
+def addSimIOTrfArgs(parser):
+    parser.defineArgGroup('SimIO', 'Simulation I/O Options')
     parser.add_argument('--inputEVNTFile', '--inputEvgenFile', nargs='+',
                         type=argFactory(argPOOLFile, io='input'),
-                        help='Input evgen file', group='CommonSim')
+                        help='Input evgen file', group='SimIO')
     parser.add_argument('--outputHITSFile', '--outputHitsFile', nargs='+',
                         type=argFactory(argHITSFile, io='output'),
-                        help='Output HITS file', group='CommonSim')
+                        help='Output HITS file', group='SimIO')
     parser.add_argument('--firstEvent', metavar='FIRSTEVENT',
-                        type=argFactory(argInt), help='The event number to use for the first Event', group='CommonSim')
+                        type=argFactory(argInt), help='The event number to use for the first Event', group='SimIO')
+
+## Add common Simulation transform arguments to an argparse ArgumentParser
+def addCommonSimTrfArgs(parser):
+    parser.defineArgGroup('CommonSim', 'Common Simulation Options')
     parser.add_argument('--physicsList', metavar='PHYSICSLIST',
                         type=argFactory(argString), help='Physics List to be used within Geant4', group='CommonSim')
     parser.add_argument('--useISF',
@@ -214,6 +218,17 @@ def addHITSMergeArgs(parser):
                         type=argFactory(argFile, io='input', runarg=True, type='log'),
                         help='Input Log files', group='HITSMerge_tf') ## FIXME need to add code to do the log file merging.
 
+## Add Re-simulation transform arguments
+def addReSimulationArgs(parser):
+    # Use arggroup to get these arguments in their own sub-section (of --help)
+    parser.defineArgGroup('ReSimulation', 'ReSimulation specific options')
+    parser.add_argument('--inputHITSFile', '--inputHitsFile', nargs='+',
+                        type=argFactory(argPOOLFile, io='input', runarg=True, type='hits'),
+                        help='Input HITS files', group='ReSimulation')
+    parser.add_argument('--outputHITS_RSMFile', nargs='+',
+                        type=argFactory(argHITSFile, io='output', runarg=True, type='hits'),
+                        help='Output HITS file', group='ReSimulation')
+
 ## Add HITS validation transform arguments
 def addHITSValidArgs(parser):
     parser.defineArgGroup('SimValid_tf', 'SimValid_tf specific options')
diff --git a/Simulation/SimuJobTransforms/scripts/ReSim_tf.py b/Simulation/SimuJobTransforms/scripts/ReSim_tf.py
new file mode 100755
index 000000000000..07b9e26f17ab
--- /dev/null
+++ b/Simulation/SimuJobTransforms/scripts/ReSim_tf.py
@@ -0,0 +1,68 @@
+#! /usr/bin/env python
+
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+"""
+Run ISF simulation on generated events and produce a HITS file.
+"""
+
+import os.path
+import sys
+import time
+
+import logging
+
+# Setup core logging here
+from PyJobTransforms.trfLogger import msg
+msg.info('logging set in %s' % sys.argv[0])
+
+from PyJobTransforms.transform import transform
+from PyJobTransforms.trfExe import athenaExecutor
+from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments
+from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
+from SimuJobTransforms.simTrfArgs import addForwardDetTrfArgs, addCommonSimTrfArgs, addCommonSimDigTrfArgs, addSim_tfArgs, addHITSMergeArgs
+
+import PyJobTransforms.trfArgClasses as trfArgClasses
+
+# Prodsys hack...
+ListOfDefaultPositionalKeys=['--AFPOn', '--ALFAOn', '--AMIConfig', '--AMITag', '--CosmicFilterVolume', '--CosmicFilterVolume2', '--CosmicPtSlice', '--DBRelease', '--DataRunNumber', '--FwdRegionOn', '--HGTDOn', '--LucidOn', '--ZDCOn', '--argJSON', '--asetup', '--athena', '--athenaMPEventsBeforeFork', '--athenaMPMergeTargetSize', '--athenaMPStrategy', '--athenaMPUseEventOrders', '--athenaopts', '--attempt', '--beamType', '--checkEventCount', '--command', '--conditionsTag', '--dumpJSON', '--dumpPickle', '--enableLooperKiller', '--env', '--eventAcceptanceEfficiency', '--eventService', '--execOnly', '--fileValidation', '--geometryVersion', '--ignoreErrors', '--ignoreFiles', '--ignorePatterns', '--imf', '--inputEVNT_TRFile', '--inputFileValidation', '--inputHITSFile', '--inputLogsFile', '--jobNumber', '--jobid', '--maxEvents', '--outputEVNT_TRFile', '--outputFileValidation', '--outputHITS_MRGFile', '--outputHITS_RSMFile', '--parallelFileValidation', '--physicsList', '--postExec', '--postInclude', '--preExec', '--preInclude', '--randomSeed', '--reportName', '--reportType', '--runNumber', '--sharedWriter', '--showGraph', '--showPath', '--showSteps', '--simulator', '--skipEvents', '--steering', '--taskid', '--tcmalloc', '--trackRecordType', '--truthStrategy', '--useISF', '--valgrind', '--valgrindDefaultOpts', '--valgrindExtraOpts']
+
+@stdTrfExceptionHandler
+@sigUsrStackTrace
+def main():
+
+    msg.info('This is %s' % sys.argv[0])
+
+    trf = getTransform()
+    trf.parseCmdLineArgs(sys.argv[1:])
+    trf.execute()
+    if 'outputFileValidation' in  trf._argdict and  trf._argdict['outputFileValidation'].value is False:
+        msg.info('Skipping report generation')
+    else:
+        trf.generateReport()
+
+    msg.info("%s stopped at %s, trf exit code %d" % (sys.argv[0], time.asctime(), trf.exitCode))
+    sys.exit(trf.exitCode)
+
+def getTransform():
+    executorSet = set()
+    from SimuJobTransforms.SimTransformUtils import addReSimulationSubstep, addReSimulationArguments
+    addReSimulationSubstep(executorSet)
+    trf = transform(executor = executorSet, description = 'ATLAS Simulation transform. Inputs must be HITS. Outputs must be HITS_RSM')
+    addAthenaArguments(trf.parser)
+    addDetectorArguments(trf.parser)
+    addReSimulationArguments(trf.parser)
+    return trf
+
+## FIXME - not sure what the equivalent of the method below is in the new framework?
+
+##     def doPreRunActions(self):
+##         JobTransform.doPreRunActions(self)
+##         if hasattr(self,'_maxEventsStrategy'):
+##             self._maxEventsStrategy = 'ABORT'
+##         else:
+##             print "WARNING EVGENtoHITJobTransform has no attribute \'_maxEventsStrategy\'."
+
+
+if __name__ == '__main__':
+    main()
diff --git a/Simulation/SimuJobTransforms/scripts/TestBeam_tf.py b/Simulation/SimuJobTransforms/scripts/TestBeam_tf.py
index 9814cf1caca0..8029b9a84408 100755
--- a/Simulation/SimuJobTransforms/scripts/TestBeam_tf.py
+++ b/Simulation/SimuJobTransforms/scripts/TestBeam_tf.py
@@ -20,7 +20,7 @@ from PyJobTransforms.transform import transform
 from PyJobTransforms.trfExe import athenaExecutor
 from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments
 from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
-from SimuJobTransforms.simTrfArgs import addCommonSimTrfArgs, addCommonSimDigTrfArgs, addTestBeamArgs
+from SimuJobTransforms.simTrfArgs import addSimIOTrfArgs,addCommonSimTrfArgs, addCommonSimDigTrfArgs, addTestBeamArgs
 
 
 import PyJobTransforms.trfArgClasses as trfArgClasses
@@ -50,6 +50,7 @@ def getTransform():
                                               substep = 'TBsim', tryDropAndReload = False, perfMonFile = 'ntuple.pmon.gz', inData=['NULL','Evgen'], outData=['HITS','NULL'] )) #may have to add evgen to outData if cosmics/cavern background jobs don't work.
     addAthenaArguments(trf.parser)
     addDetectorArguments(trf.parser)
+    addSimIOTrfArgs(trf.parser)
     addCommonSimTrfArgs(trf.parser)
     addCommonSimDigTrfArgs(trf.parser)
     addTestBeamArgs(trf.parser)
diff --git a/Simulation/SimuJobTransforms/share/skeleton.ReSim.py b/Simulation/SimuJobTransforms/share/skeleton.ReSim.py
new file mode 100644
index 000000000000..7e2d85426634
--- /dev/null
+++ b/Simulation/SimuJobTransforms/share/skeleton.ReSim.py
@@ -0,0 +1,319 @@
+
+## Get the logger
+from AthenaCommon.Logging import *
+atlasG4log = logging.getLogger('ReSim')
+atlasG4log.info('****************** STARTING ISF ******************')
+
+## Include common skeleton
+include("SimuJobTransforms/skeleton.EVGENtoHIT.py")
+
+if hasattr(runArgs, 'useISF') and not runArgs.useISF:
+    raise RuntimeError("Unsupported configuration! If you want to run with useISF=False, please use AtlasG4_tf.py!")
+
+## Simulation flags need to be imported first
+from G4AtlasApps.SimFlags import simFlags
+simFlags.load_atlas_flags()
+simFlags.ISFRun=True
+from ISF_Config.ISF_jobProperties import ISF_Flags
+
+## Set simulation geometry tag
+if hasattr(runArgs, 'geometryVersion'):
+    simFlags.SimLayout.set_Value_and_Lock(runArgs.geometryVersion)
+    globalflags.DetDescrVersion = simFlags.SimLayout.get_Value()
+    atlasG4log.debug('SimLayout set to %s' % simFlags.SimLayout)
+else:
+    raise RuntimeError("No geometryVersion provided.")
+
+## AthenaCommon flags
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+# Jobs should stop if an include fails.
+if hasattr(runArgs, "IgnoreConfigError"):
+    athenaCommonFlags.AllowIgnoreConfigError = runArgs.IgnoreConfigError
+else:
+    athenaCommonFlags.AllowIgnoreConfigError = False
+
+from AthenaCommon.BeamFlags import jobproperties
+
+## Input Files
+if hasattr(runArgs, "inputHITSFile"):
+    from AthenaCommon.GlobalFlags import globalflags
+    globalflags.InputFormat.set_Value_and_Lock('pool')
+    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+    athenaCommonFlags.PoolEvgenInput.set_Value_and_Lock( runArgs.inputHITSFile )
+    athenaCommonFlags.FilesInput.set_Value_and_Lock( runArgs.inputHITSFile )
+    ISF_Flags.ReSimulation = True
+else:
+    atlasG4log.error('No inputHITSFile provided. Please check whether you intended to run ReSim_tf.py or Sim_tf.py')
+    raise RuntimeError("No outputHITSFile provided.")
+
+## Output hits file config
+if hasattr(runArgs, "outputHITS_RSMFile"):
+    athenaCommonFlags.PoolHitsOutput.set_Value_and_Lock( runArgs.outputHITS_RSMFile )
+else:
+    atlasG4log.info('No outputHITSFile provided. This re-simulation job will not write out a HITS_RSM file.')
+    athenaCommonFlags.PoolHitsOutput = ""
+    athenaCommonFlags.PoolHitsOutput.statusOn = False
+
+## Write out runArgs configuration
+atlasG4log.info( '**** Transformation run arguments' )
+atlasG4log.info( str(runArgs) )
+
+#==============================================================
+# Job Configuration parameters:
+#==============================================================
+## Pre-exec
+if hasattr(runArgs, "preExec"):
+    atlasG4log.info("transform pre-exec")
+    for cmd in runArgs.preExec:
+        atlasG4log.info(cmd)
+        exec(cmd)
+
+## Pre-include
+if hasattr(runArgs, "preInclude"):
+    for fragment in runArgs.preInclude:
+        include(fragment)
+
+if hasattr(runArgs, 'simulator'):
+    ISF_Flags.Simulator.set_Value_and_Lock(runArgs.simulator)
+else:
+    ISF_Flags.Simulator.set_Value_and_Lock('FullG4')
+
+try:
+    from ISF_Config import FlagSetters
+    FlagSetters.configureFlagsBase()
+## Check for any simulator-specific configuration
+    configureFlags = getattr(FlagSetters, ISF_Flags.Simulator.configFlagsMethodName(), None)
+    if configureFlags is not None:
+        configureFlags()
+except:
+    ## Select detectors
+    if 'DetFlags' not in dir():
+        ## If you configure one det flag, you're responsible for configuring them all!
+        from AthenaCommon.DetFlags import DetFlags
+        DetFlags.all_setOn()
+    DetFlags.LVL1_setOff() # LVL1 is not part of G4 sim
+    DetFlags.Truth_setOn()
+    DetFlags.Forward_setOff() # Forward dets are off by default
+    checkHGTDOff = getattr(DetFlags, 'HGTD_setOff', None)
+    if checkHGTDOff is not None:
+        checkHGTDOff() #Default for now
+
+## Configure Forward Detector DetFlags based on command-line options
+from AthenaCommon.DetFlags import DetFlags
+if hasattr(runArgs, "AFPOn"):
+    if runArgs.AFPOn:
+        DetFlags.AFP_setOn()
+if hasattr(runArgs, "ALFAOn"):
+    if runArgs.ALFAOn:
+        DetFlags.ALFA_setOn()
+if hasattr(runArgs, "FwdRegionOn"):
+    if runArgs.FwdRegionOn:
+        DetFlags.FwdRegion_setOn()
+if hasattr(runArgs, "LucidOn"):
+    if runArgs.LucidOn:
+        DetFlags.Lucid_setOn()
+if hasattr(runArgs, "ZDCOn"):
+    if runArgs.ZDCOn:
+        DetFlags.ZDC_setOn()
+if hasattr(runArgs, "HGTDOn"):
+    if runArgs.HGTDOn:
+        checkHGTDOn = getattr(DetFlags, 'HGTD_setOn', None)
+        if checkHGTDOn is not None:
+            checkHGTDOn()
+        else:
+            atlasG4log.warning('The HGTD DetFlag is not supported in this release')
+
+DetFlags.Print()
+
+if DetFlags.Forward_on():
+    if DetFlags.FwdRegion_on() or DetFlags.ZDC_on() or DetFlags.ALFA_on() or DetFlags.AFP_on():
+        ## Do not filter high eta particles
+        if simFlags.EventFilter.statusOn:
+            simFlags.EventFilter.get_Value()['EtaPhiFilters'] = False
+        ## ForwardTransport is applied to particles hitting BeamPipe::SectionF46
+        DetFlags.bpipe_setOn()
+
+    if DetFlags.FwdRegion_on():
+        # Do full simulation rather than beam transport
+        simFlags.ForwardDetectors = 1
+        atlasG4log.info( 'FwdRegion switched on, so will run Full Simulation of the Forward Region rather than Forward Transport.' )
+    elif DetFlags.ZDC_on() or DetFlags.ALFA_on() or DetFlags.AFP_on():
+        ## Use the ForwardTransport package to do the beam transport
+        atlasG4log.info( 'FwdRegion switched off, so will run Full Simulation of the Forward Region rather than Forward Transport.' )
+        simFlags.ForwardDetectors = 2
+
+## Set the PhysicsList
+if hasattr(runArgs, 'physicsList'):
+    simFlags.PhysicsList = runArgs.physicsList
+
+
+## Random seed
+if hasattr(runArgs, "randomSeed"):
+    simFlags.RandomSeedOffset = int(runArgs.randomSeed)
+else:
+    atlasG4log.warning('randomSeed not set')
+## Don't use the SeedsG4 override
+simFlags.SeedsG4.set_Off()
+
+
+## Set the Run Number (if required)
+if hasattr(runArgs,"DataRunNumber"):
+    if runArgs.DataRunNumber>0:
+        atlasG4log.info( 'Overriding run number to be: %s ' % runArgs.DataRunNumber )
+        simFlags.RunNumber=runArgs.DataRunNumber
+elif hasattr(runArgs,'jobNumber'):
+    if runArgs.jobNumber>=0:
+        atlasG4log.info( 'Using job number '+str(runArgs.jobNumber)+' to derive run number.' )
+        simFlags.RunNumber = simFlags.RunDict.GetRunNumber( runArgs.jobNumber )
+        atlasG4log.info( 'Set run number based on dictionary to '+str(simFlags.RunNumber) )
+
+## The looper killer is on by default. Disable it if this is requested.
+if hasattr(runArgs, "enableLooperKiller") and not runArgs.enableLooperKiller:
+    simFlags.OptionalUserActionList.removeAction('G4UA::LooperKillerTool')
+    atlasG4log.warning("The looper killer will NOT be run in this job.")
+
+## Set up the top sequence
+from AthenaCommon.AlgSequence import AlgSequence
+athAlgSeq = AlgSequence()
+
+if not hasattr( athAlgSeq, "xAODMaker::EventInfoCnvAlg" ):
+    athAlgSeq += CfgMgr.xAODMaker__EventInfoCnvAlg(AODKey="McEventInfo")
+
+from McEventCollectionFilter.McEventCollectionFilterConf import TruthResetAlg
+athAlgSeq += TruthResetAlg("TruthResetAlg",InputMcEventCollection="TruthEventOLD", OutputMcEventCollection="BeamTruthEvent")
+
+# Here we are going to run conditional re-simulation
+simSequence = AlgSequence('SimSequence')
+topSeq = simSequence
+athAlgSeq += simSequence
+copyHitSequence = AlgSequence('CopyHitSequence')
+athAlgSeq += copyHitSequence
+
+# Set Overall per-Algorithm time-limit on the AlgSequence
+topSeq.TimeOut = 43200 * Units.s
+
+from AthenaCommon.CfgGetter import getAlgorithm
+topSeq += getAlgorithm("ISF_SimEventFilter")
+
+## try:
+##     from RecAlgs.RecAlgsConf import TimingAlg
+##     topSeq+=TimingAlg("SimTimerBegin", TimingObjOutputName = "EVNTtoHITS_timings")
+## except:
+##     atlasG4log.warning('Could not add TimingAlg, no timing info will be written out.')
+
+copyHitSequence += getAlgorithm("ISF_InvertedSimEventFilter")
+copyHitSequence += getAlgorithm('RenameHitCollections')
+
+#### *********** import ISF_Example code here **************** ####
+include("ISF_Config/ISF_ConfigJobInclude.py")
+
+#Configure AddressRemappingSvc here
+from SGComps import AddressRemappingSvc
+AddressRemappingSvc.addInputRename("McEventCollection","TruthEvent","TruthEventOLD")
+AddressRemappingSvc.addInputRename("RecoTimingObj", "EVNTtoHITS_timings", "EVNTtoHITS_timingsOLD")
+## Inner Detector
+if DetFlags.ID_on():
+    if DetFlags.BCM_on():
+        AddressRemappingSvc.addInputRename("SiHitCollection", "BCMHits", "BCMHitsOLD")
+        AddressRemappingSvc.addInputRename("SiHitCollection", "BLMHits", "BLMHitsOLD")
+    if DetFlags.pixel_on():
+        AddressRemappingSvc.addInputRename("SiHitCollection", "PixelHits", "PixelHitsOLD")
+    if DetFlags.SCT_on():
+        AddressRemappingSvc.addInputRename("SiHitCollection", "SCT_Hits", "SCT_HitsOLD")
+    if DetFlags.TRT_on():
+        AddressRemappingSvc.addInputRename("TRTUncompressedHitCollection", "TRTUncompressedHits", "TRTUncompressedHitsOLD")
+    AddressRemappingSvc.addInputRename("TrackRecordCollection", "CaloEntryLayer", "CaloEntryLayerOLD")
+
+## Calo
+if DetFlags.Calo_on():
+    if DetFlags.LAr_on():
+        AddressRemappingSvc.addInputRename("LArHitContainer", "LArHitEMB", "LArHitEMBOLD")
+        AddressRemappingSvc.addInputRename("LArHitContainer", "LArHitEMEC", "LArHitEMECOLD")
+        AddressRemappingSvc.addInputRename("LArHitContainer", "LArHitFCAL", "LArHitFCALOLD")
+        AddressRemappingSvc.addInputRename("LArHitContainer", "LArHitHEC", "LArHitHECOLD")
+        AddressRemappingSvc.addInputRename("LArHitContainer", "LArHitMiniFCAL", "LArHitMiniFCALOLD") # Obsolete
+        AddressRemappingSvc.addInputRename("CaloCalibrationHitContainer", "LArCalibrationHitActive", "LArCalibrationHitActiveOLD")
+        AddressRemappingSvc.addInputRename("CaloCalibrationHitContainer", "LArCalibrationHitDeadMaterial", "LArCalibrationHitDeadMaterialOLD")
+        AddressRemappingSvc.addInputRename("CaloCalibrationHitContainer", "LArCalibrationHitInactive", "LArCalibrationHitInactiveOLD")
+    if DetFlags.Tile_on():
+        AddressRemappingSvc.addInputRename("TileHitVector", "MBTSHits", "MBTSHitsOLD")
+        AddressRemappingSvc.addInputRename("TileHitVector", "TileHitVec", "TileHitVecOLD")
+        AddressRemappingSvc.addInputRename("CaloCalibrationHitContainer", "TileCalibHitActiveCell", "TileCalibHitActiveCellOLD")
+        AddressRemappingSvc.addInputRename("CaloCalibrationHitContainer", "TileCalibHitInactiveCell", "TileCalibHitInactiveCellOLD")
+        AddressRemappingSvc.addInputRename("CaloCalibrationHitContainer", "TileCalibHitDeadMaterial", "TileCalibHitDeadMaterialOLD")
+    AddressRemappingSvc.addInputRename("TrackRecordCollection", "MuonEntryLayer", "MuonEntryLayerOLD")
+
+## Muon
+if DetFlags.Muon_on():
+    from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
+    if MuonGeometryFlags.hasCSC() and DetFlags.CSC_on():
+        AddressRemappingSvc.addInputRename("CSCSimHitCollection", "CSC_Hits", "CSC_HitsOLD")
+    if DetFlags.MDT_on():
+        AddressRemappingSvc.addInputRename("MDTSimHitCollection", "MDT_Hits", "MDT_HitsOLD")
+    if DetFlags.RPC_on():
+        AddressRemappingSvc.addInputRename("RPCSimHitCollection", "RPC_Hits", "RPC_HitsOLD")
+    if DetFlags.TGC_on():
+        AddressRemappingSvc.addInputRename("TGCSimHitCollection", "TGC_Hits", "TGC_HitsOLD")
+    if MuonGeometryFlags.hasMM() and DetFlags.Micromegas_on():
+        AddressRemappingSvc.addInputRename("MMSimHitCollection", "MicromegasSensitiveDetector", "MicromegasSensitiveDetectorOLD")
+    if MuonGeometryFlags.hasSTGC() and DetFlags.sTGC_on():
+        AddressRemappingSvc.addInputRename("sTGCSimHitCollection", "sTGCSensitiveDetector", "sTGCSensitiveDetectorOLD")
+    AddressRemappingSvc.addInputRename("TrackRecordCollection", "MuonExitLayer", "MuonExitLayerOLD")
+
+#FIXME Add Renaming for Fwd Detector sim hits
+## FwdRegion
+if DetFlags.FwdRegion_on():
+    #AddressRemappingSvc.addInputRename("SimulationHitCollection",)
+    pass
+
+## Lucid
+if DetFlags.Lucid_on():
+    #AddressRemappingSvc.addInputRename("LUCID_SimHitCollection",)
+    pass
+
+## ZDC
+if DetFlags.ZDC_on():
+    #AddressRemappingSvc.addInputRename("ZDC_SimPixelHit_Collection",)
+    #AddressRemappingSvc.addInputRename("ZDC_SimStripHit_Collection",)
+    pass
+
+## ALFA
+if DetFlags.ALFA_on():
+    #AddressRemappingSvc.addInputRename("ALFA_HitCollection",)
+    #AddressRemappingSvc.addInputRename("ALFA_ODHitCollection",)
+    pass
+
+## AFP
+if DetFlags.AFP_on():
+    #AddressRemappingSvc.addInputRename("AFP_TDSimHitCollection")
+    #AddressRemappingSvc.addInputRename("AFP_SIDSimHitCollection")
+    pass
+
+svcMgr.StoreGateSvc.Dump = True #FIXME remove this line
+
+## Add AMITag MetaData to TagInfoMgr
+if hasattr(runArgs, 'AMITag'):
+    if runArgs.AMITag != "NONE":
+        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
+        svcMgr.TagInfoMgr.ExtraTagValuePairs.update({"AMITag": runArgs.AMITag})
+
+# Set AutoFlush to 10 as per ATLASSIM-4274
+# These outputs are meant to be read sequentially
+if athenaCommonFlags.PoolHitsOutput():
+    from AthenaPoolCnvSvc import PoolAttributeHelper as pah
+    Out = athenaCommonFlags.PoolHitsOutput()
+    svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setTreeAutoFlush( Out, "CollectionTree", 10 ) ]
+    svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setTreeAutoFlush( Out, "POOLContainer", 10 ) ]
+    svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ pah.setTreeAutoFlush( Out, "POOLContainerForm", 10 ) ]
+
+## Post-include
+if hasattr(runArgs, "postInclude"):
+    for fragment in runArgs.postInclude:
+        include(fragment)
+
+## Post-exec
+if hasattr(runArgs, "postExec"):
+    atlasG4log.info("transform post-exec")
+    for cmd in runArgs.postExec:
+        atlasG4log.info(cmd)
+        exec(cmd)
diff --git a/Simulation/Tests/ISF_Validation/test/test_ReSimulation.sh b/Simulation/Tests/ISF_Validation/test/test_ReSimulation.sh
new file mode 100755
index 000000000000..d484ff736c40
--- /dev/null
+++ b/Simulation/Tests/ISF_Validation/test/test_ReSimulation.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# art-description: Reading single particle gen events, checking that the SkipEvents argument works, using 2015 geometry and conditions
+# art-include: 21.0/Athena
+# art-include: 21.0/AthSimulation
+# art-include: 21.3/Athena
+# art-include: 21.9/Athena
+# art-include: master/Athena
+# art-include: master/AthSimulation
+# art-type: grid
+# art-output: log.*
+# art-output: original.HITS.pool.root
+# art-output: renamed.HITS.pool.root
+# art-output: retest.HITS.pool.root
+# art-output: test.HITS.pool.root
+
+INPUTEVNTFILE="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1"
+#INPUTEVNTFILE='/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ISF_Validation/pi_E50_eta0-60.evgen.pool.root'
+MAXEVENTS=10
+
+Sim_tf.py \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--simulator 'FullG4' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+--preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile $INPUTEVNTFILE \
+--outputHITSFile "original.HITS.pool.root" \
+--maxEvents $MAXEVENTS \
+--imf False
+
+echo "art-result: $? initial-sim"
+cp log.EVNTtoHITS log.EVNTtoHITS.initial
+
+ReSim_tf.py \
+--conditionsTag 'ReSim:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--simulator 'FullG4_LongLived' \
+--postInclude 'ReSim:PyJobTransforms/UseFrontier.py' \
+--preInclude 'ReSim:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py,SimulationJobOptions/preInclude.ExtraParticles.py,SimulationJobOptions/preInclude.G4ExtraProcesses.py' \
+--preExec 'ReSim:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'ReSim:ATLAS-R2-2016-01-00-01' \
+--inputHITSFile "original.HITS.pool.root" \
+--outputHITS_RSMFile "retest.HITS.pool.root" \
+--maxEvents $MAXEVENTS \
+--imf False
+
+echo "art-result: $? re-sim"
+
+ArtPackage=$1
+ArtJobName=$2
+art.py compare grid --entries 10 ${ArtPackage} ${ArtJobName} --diff-root --mode=semi-detailed --ignore-leave RecoTimingObj_p1_EVNTtoHITS_timingsOLD
+
+echo  "art-result: $? regression"
diff --git a/Tools/PyJobTransforms/python/trfValidation.py b/Tools/PyJobTransforms/python/trfValidation.py
index 238507b896ec..ac15c285943b 100644
--- a/Tools/PyJobTransforms/python/trfValidation.py
+++ b/Tools/PyJobTransforms/python/trfValidation.py
@@ -913,7 +913,7 @@ class eventMatch(object):
         self._eventCountConf = {}
         self._eventCountConf['EVNT'] = {'EVNT_MRG':"match", "HITS": simEventEff, "EVNT_TR": "filter", "DAOD_TRUTH*" : "match"}
         self._eventCountConf['EVNT_TR'] = {'HITS': simEventEff}
-        self._eventCountConf['HITS'] = {'RDO':"match", "HITS_MRG":"match", 'HITS_FILT': simEventEff, "RDO_FILT": "filter", "DAOD_TRUTH*" : "match"}
+        self._eventCountConf['HITS'] = {'RDO':"match", 'HITS_RSM': simEventEff, "HITS_MRG":"match", 'HITS_FILT': simEventEff, "RDO_FILT": "filter", "DAOD_TRUTH*" : "match"}
         self._eventCountConf['BS'] = {'ESD': "match", 'DRAW_*':"filter", 'NTUP_*':"filter", "BS_MRG":"match", 'DESD*': "filter", 'AOD':"match", 'DAOD*':"filter"}
         self._eventCountConf['RDO*'] = {'ESD': "match", 'DRAW_*':"filter", 'NTUP_*':"filter", "RDO_MRG":"match", "RDO_TRIG":"match", 'AOD':"match", 'DAOD*':"filter"}
         self._eventCountConf['ESD'] = {'ESD_MRG': "match", 'AOD':"match", 'DESD*':"filter", 'DAOD_*':"filter", 'NTUP_*':"filter"}
-- 
GitLab


From adaeb0caf0b726a5eb5b69c7fe599acf52f6f964 Mon Sep 17 00:00:00 2001
From: Kacper Wojciech Topolnicki <kacper.wojciech.topolnicki@cern.ch>
Date: Mon, 20 Sep 2021 18:01:57 +0200
Subject: [PATCH 210/347] Added -AccumulatorCache- decorator in muon chains
 configuration

---
 .../python/HLTMenuConfig/Muon/generateMuon.py | 49 ++++++++++++++++---
 1 file changed, 42 insertions(+), 7 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
index 19c3e76abd9b..f9835e11fa70 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuon.py
@@ -32,7 +32,7 @@ from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCombinedInDe
 from TrigMuonEF.TrigMuonEFConfig_newJO import TrigMuonEFTrackIsolationAlgCfg, MuonFilterAlgCfg, MergeEFMuonsAlgCfg
 from AthenaCommon.CFElements import seqAND, parOR, seqOR
 
-
+from AthenaConfiguration.AccumulatorCache import AccumulatorCache
 
 import pprint
 from AthenaCommon.Logging import logging
@@ -42,6 +42,7 @@ def fakeHypoAlgCfg(flags, name="FakeHypoForMuon"):
     HLTTest__TestHypoAlg=CompFactory.HLTTest.TestHypoAlg
     return HLTTest__TestHypoAlg( name, Input="" )
 
+@AccumulatorCache
 def EFMuonCBViewDataVerifierCfg(flags, name):
     EFMuonCBViewDataVerifier =  CompFactory.AthViews.ViewDataVerifier("VDVEFCBMuon_"+name)
     EFMuonCBViewDataVerifier.DataObjects = [( 'Muon::MdtPrepDataContainer' , 'StoreGateSvc+MDT_DriftCircles' ),  
@@ -186,6 +187,7 @@ def MuonTrackParticleCnvCfg(flags, name = "MuonTrackParticleCnvAlg",**kwargs):
     result.addEventAlgo( trackcnv, primary=True )
     return result
 
+@AccumulatorCache
 def decodeCfg(flags, RoIs):
     acc = ComponentAccumulator()
 
@@ -275,7 +277,8 @@ def efMuIsoHypoCfg(flags, name="UNSPECIFIED", inputMuons="UNSPECIFIED"):
     efHypo.EFMuonsName = inputMuons
     return efHypo
 
-def muFastStep(flags, chainDict):
+@AccumulatorCache
+def _muFastStepSeq(flags):
     # Step 1 (L2MuonSA)
     selAcc = SelectionCA("L2MuFastReco")
     # Set EventViews for L2MuonSA step
@@ -302,9 +305,16 @@ def muFastStep(flags, chainDict):
     l2muFastSequence = MenuSequenceCA(selAcc, 
                                       HypoToolGen = TrigMufastHypoToolFromDict )
 
+    return (selAcc , l2muFastSequence)
+
+def muFastStep(flags, chainDict):
+
+    selAcc , l2muFastSequence = _muFastStepSeq(flags)
+
     return ChainStep( name=selAcc.name, Sequences=[l2muFastSequence], chainDicts=[chainDict] )
 
-def muCombStep(flags, chainDict):
+@AccumulatorCache
+def _muCombStepSeq(flags):
     ### Set muon step2 - L2muComb ###
     selAccL2CB = SelectionCA("L2MuonCB")
 
@@ -327,9 +337,16 @@ def muCombStep(flags, chainDict):
     l2muCombSequence = MenuSequenceCA(selAccL2CB,
                                       HypoToolGen = TrigmuCombHypoToolFromDict)
 
+    return (selAccL2CB , l2muCombSequence)
+
+def muCombStep(flags, chainDict):
+
+    selAccL2CB , l2muCombSequence = _muCombStepSeq(flags)
+
     return ChainStep( name=selAccL2CB.name, Sequences=[l2muCombSequence], chainDicts=[chainDict] )
 
-def muEFSAStep(flags, chainDict, name='RoI'):
+@AccumulatorCache
+def _muEFSAStepSeq(flags, name='RoI'):
     #EF MS only
     selAccMS = SelectionCA('EFMuMSReco_'+name)
     
@@ -387,9 +404,16 @@ def muEFSAStep(flags, chainDict, name='RoI'):
     efmuMSSequence = MenuSequenceCA(selAccMS,
                                     HypoToolGen = TrigMuonEFMSonlyHypoToolFromDict)
 
+    return (selAccMS , efmuMSSequence)
+
+def muEFSAStep(flags, chainDict, name='RoI'):
+
+    selAccMS , efmuMSSequence = _muEFSAStepSeq(flags, name)
+
     return ChainStep( name=selAccMS.name, Sequences=[efmuMSSequence], chainDicts=[chainDict] )
 
-def muEFCBStep(flags, chainDict, name='RoI'):
+@AccumulatorCache
+def _muEFCBStepSeq(flags, name='RoI'):
     #EF combined muons
     selAccEFCB = SelectionCA("EFCBMuon_"+name)
 
@@ -469,10 +493,17 @@ def muEFCBStep(flags, chainDict, name='RoI'):
 
     efmuCBSequence = MenuSequenceCA(selAccEFCB,
                                     HypoToolGen = TrigMuonEFCombinerHypoToolFromDict)
+   
+    return (selAccEFCB , efmuCBSequence)
+
+def muEFCBStep(flags, chainDict, name='RoI'):
+
+    selAccEFCB , efmuCBSequence = _muEFCBStepSeq(flags, name)
     
     return ChainStep( name=selAccEFCB.name, Sequences=[efmuCBSequence], chainDicts=[chainDict] )
 
-def muEFIsoStep(flags, chainDict):
+@AccumulatorCache
+def _muEFIsoStepSeq(flags):
     #Track isolation
     selAccEFIso = SelectionCA("EFIsoMuon")
 
@@ -508,8 +539,12 @@ def muEFIsoStep(flags, chainDict):
     efmuIsoSequence = MenuSequenceCA(selAccEFIso,
                                      HypoToolGen = TrigMuonEFTrackIsolationHypoToolFromDict)
     
-    return ChainStep( name=selAccEFIso.name, Sequences=[efmuIsoSequence], chainDicts=[chainDict] )
+    return (selAccEFIso , efmuIsoSequence)
 
+def muEFIsoStep(flags, chainDict):
+    selAccEFIso , efmuIsoSequence = _muEFIsoStepSeq(flags)
+    
+    return ChainStep( name=selAccEFIso.name, Sequences=[efmuIsoSequence], chainDicts=[chainDict] )
 
 def generateChains( flags, chainDict ):
     chainDict = splitChainDict(chainDict)[0]
-- 
GitLab


From dde0f374557bc96521e3ae975aa89bf0be7489db Mon Sep 17 00:00:00 2001
From: Joerg Stelzer <joerg.stelzer@cern.ch>
Date: Mon, 20 Sep 2021 18:02:45 +0200
Subject: [PATCH 211/347] CTP and MUCTPI firmware loader and holder

---
 .../TrigConfData/TrigConfData/DataStructure.h |   9 +
 .../TrigConfData/TrigConfData/L1CTPFiles.h    | 200 ++++++++
 .../TrigConfData/src/DataStructure.cxx        |  27 +-
 .../TrigConfData/src/L1CTPFiles.cxx           | 352 ++++++++++++++
 .../TrigConfIO/TrigDBCTPFilesLoader.h         |  76 +++
 .../TrigConfIO/src/TrigDBCTPFilesLoader.cxx   | 439 ++++++++++++++++++
 .../TrigConfIO/utils/TriggerMenuRW.cxx        |  54 ++-
 7 files changed, 1131 insertions(+), 26 deletions(-)
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1CTPFiles.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfData/src/L1CTPFiles.cxx
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBCTPFilesLoader.h
 create mode 100644 Trigger/TrigConfiguration/TrigConfIO/src/TrigDBCTPFilesLoader.cxx

diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h
index 4d8827ce7e5f..2944dc2efc09 100644
--- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h
@@ -120,6 +120,15 @@ namespace TrigConf {
        */
       bool hasAttribute(const std::string & key) const;
 
+      /** Check if an attribute is null
+       * @param key The path to the attribute name, relative to the current one in form "path.to.child"
+       * @return true if path @c key exists and is null
+       * 
+       * If the attribute doesn't exist, the function returns false. To check if an attribute exists and 
+       * is null, use it together with @c hasAttribute.
+       */
+      bool isNull(const std::string & key) const;
+
       /** Check if child exists
        * @param path The path to the child, relative to the current one in form "path.to.child"
        * @return true if path exists
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1CTPFiles.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1CTPFiles.h
new file mode 100644
index 000000000000..4738a4c646d1
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1CTPFiles.h
@@ -0,0 +1,200 @@
+/*
+   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGCONFDATA_L1CTPFiles_H
+#define TRIGCONFDATA_L1CTPFiles_H
+
+#include "TrigConfData/ConstIter.h"
+#include "TrigConfData/DataStructure.h"
+#include "TrigConfData/L1Item.h"
+#include "TrigConfData/L1Connector.h"
+#include "TrigConfData/L1Board.h"
+#include "TrigConfData/L1TopoAlgorithm.h"
+#include "TrigConfData/L1Threshold.h"
+#include "TrigConfData/L1ThrExtraInfo.h"
+#include "TrigConfData/L1CTP.h"
+
+#include <vector>
+#include <map>
+
+namespace TrigConf {
+
+   /** 
+    * @brief L1 menu configuration
+    *
+    * Provides access to menu name and ctpVersion and to the L1 items and thresholds
+    */
+   class L1CTPFiles final {
+   public:
+
+      static const size_t CTPCORE_LUT_SIZE {725248};
+      static const size_t CTPCORE_CAM_SIZE {55296};
+      
+      static const size_t CTPIN_MONSEL_SIZE {124};
+      static const size_t CTPIN_MONDEC_SIZE {4096};
+
+      static const size_t CTPMON_MUX_OUTPUT_NUMBER {9};
+      static const size_t CTPMON_ADDRESS_SELECTOR_NUMBER {24};
+      static const size_t CTPMON_SELECTOR_SIZE = CTPMON_MUX_OUTPUT_NUMBER * CTPMON_ADDRESS_SELECTOR_NUMBER;
+      static const size_t CTPMON_DECODER_SIZE {6656};
+      static const size_t CTPMON_DMX_SIZE {160};
+
+      enum MuctpiAccess { RoiMaskA, RoiMaskC, PtLutBarrel, PtLutEndcap };
+      static const std::map<MuctpiAccess, std::string> s_keyMap;
+
+      class CTPCoreInput {
+      public:
+         CTPCoreInput(size_t inputNumber, std::string name, size_t bit, size_t phase) :
+            m_inputNumber(inputNumber), m_name(name), m_bit(bit), m_phase(phase) {}
+         size_t      inputNumber() const { return m_inputNumber; }
+         std::string name() const { return m_name; }
+         size_t      bit() const { return m_bit; }
+         size_t      phase() const { return m_phase; }
+      private:
+         size_t      m_inputNumber;
+         std::string m_name;
+         size_t      m_bit;
+         size_t      m_phase;
+      };
+
+      /** Constructor */
+      L1CTPFiles();
+
+      /** Destructor */
+      virtual ~L1CTPFiles();
+
+      /** 
+       * Accessors to the various CTP data
+       **/
+      bool hasCompleteCtpData() const;
+      bool hasCompleteSmxData() const;
+      bool hasCompleteMuctpiData() const;
+      bool hasCompleteTmcData() const;
+
+      const std::vector<uint32_t> & ctpcore_LUT() const;
+      const std::vector<uint32_t> & ctpcore_CAM() const;
+
+      const std::vector<uint32_t> & ctpin_MonSelector_Slot7() const;
+      const std::vector<uint32_t> & ctpin_MonSelector_Slot8() const;
+      const std::vector<uint32_t> & ctpin_MonSelector_Slot9() const;
+      const std::vector<uint32_t> & ctpin_MonDecoder_Slot7() const;
+      const std::vector<uint32_t> & ctpin_MonDecoder_Slot8() const;
+      const std::vector<uint32_t> & ctpin_MonDecoder_Slot9() const;
+
+      const std::vector<uint32_t> & ctpmon_MonSelector() const;
+      const std::vector<uint32_t> & ctpmon_MonDecoder() const;
+      const std::vector<uint32_t> & ctpmon_DMX() const;
+
+      const std::string & smx_Output() const;
+      const std::string & smx_Vhdl_Slot7() const;
+      const std::string & smx_Vhdl_Slot8() const;
+      const std::string & smx_Vhdl_Slot9() const;
+      const std::string & smx_Svfi_Slot7() const;
+      const std::string & smx_Svfi_Slot8() const;
+      const std::string & smx_Svfi_Slot9() const;
+
+      const std::vector<uint32_t> & muctpiRoi(MuctpiAccess key) const;
+      const std::vector<uint32_t> & muctpi_Extra_Ptlut(const std::string & sector) const;
+      const std::vector<uint32_t> & muctpi_Nbits() const;
+
+      const std::vector<TrigConf::L1CTPFiles::CTPCoreInput> & tmc_CtpcoreInputs() const;
+      const std::map<std::string, size_t> & tmc_CtpinCounters() const;
+      const std::map<std::string, size_t> & tmc_CtpmonCounters() const;
+
+      /**
+       * Setters of the various CTP data
+       */
+
+      void set_HasCompleteCtpData(bool flag);
+      void set_HasCompleteSmxData(bool flag);
+      void set_HasCompleteMuctpiData(bool flag);
+      void set_HasCompleteTmcData(bool flag);
+
+      void set_Ctpcore_LUT(std::vector<uint32_t> data);
+      void set_Ctpcore_CAM(std::vector<uint32_t> data);
+
+      void set_Ctpin_MonSelector_Slot7(std::vector<uint32_t> data);
+      void set_Ctpin_MonSelector_Slot8(std::vector<uint32_t> data);
+      void set_Ctpin_MonSelector_Slot9(std::vector<uint32_t> data);
+      void set_Ctpin_MonDecoder_Slot7(std::vector<uint32_t> data);
+      void set_Ctpin_MonDecoder_Slot8(std::vector<uint32_t> data);
+      void set_Ctpin_MonDecoder_Slot9(std::vector<uint32_t> data);
+
+      void set_Ctpmon_MonSelector(std::vector<uint32_t> data);
+      void set_Ctpmon_MonDecoder(std::vector<uint32_t> data);
+      void set_Ctpmon_DMX(std::vector<uint32_t> data);
+
+      void set_Smx_Output(const std::string & data);
+      void set_Smx_Vhdl_Slot7(const std::string & data);
+      void set_Smx_Vhdl_Slot8(const std::string & data);
+      void set_Smx_Vhdl_Slot9(const std::string & data);
+      void set_Smx_Svfi_Slot7(const std::string & data);
+      void set_Smx_Svfi_Slot8(const std::string & data);
+      void set_Smx_Svfi_Slot9(const std::string & data);
+
+      void set_Muctpi(MuctpiAccess key, std::vector<uint32_t> data);
+      void set_Muctpi_Extra_Ptlut(const std::string & key, std::vector<uint32_t> data);
+      void set_Muctpi_Nbits(std::vector<uint32_t> data);
+
+      void set_Tmc_CtpcoreInputs(std::vector<TrigConf::L1CTPFiles::CTPCoreInput> data);
+      void set_Tmc_CtpinCounters(std::map<std::string, size_t> data);
+      void set_Tmc_CtpmonCounters(std::map<std::string, size_t> data);
+
+      void print() const;
+
+   private:
+
+      bool m_hasCompleteCtpData {false};
+      bool m_hasCompleteSmxData {false};
+      bool m_hasCompleteMuctpiData {false};
+      bool m_hasCompleteTmcData {false};
+
+
+      /**
+       * L1_CTP_FILES
+       */
+      std::vector<uint32_t> m_Ctpcore_LUT;
+      std::vector<uint32_t> m_Ctpcore_CAM;
+
+      std::vector<uint32_t> m_Ctpin_MonSelector_Slot7;
+      std::vector<uint32_t> m_Ctpin_MonSelector_Slot8;
+      std::vector<uint32_t> m_Ctpin_MonSelector_Slot9;
+      std::vector<uint32_t> m_Ctpin_MonDecoder_Slot7;
+      std::vector<uint32_t> m_Ctpin_MonDecoder_Slot8;
+      std::vector<uint32_t> m_Ctpin_MonDecoder_Slot9;
+
+      std::vector<uint32_t> m_Ctpmon_MonSelector;
+      std::vector<uint32_t> m_Ctpmon_MonDecoder;
+      std::vector<uint32_t> m_Ctpmon_DMX;
+
+      /**
+       * L1_SMX files
+       */
+      std::string m_Smx_Output {};
+      std::string m_Smx_Vhdl_Slot7 {};
+      std::string m_Smx_Vhdl_Slot8 {};
+      std::string m_Smx_Vhdl_Slot9 {};
+      std::string m_Smx_Svfi_Slot7 {};
+      std::string m_Smx_Svfi_Slot8 {};
+      std::string m_Smx_Svfi_Slot9 {};
+
+      /**
+       * L1 Muon files
+       */
+      std::map<std::string, std::vector<uint32_t>> m_muctpi;
+      std::map<std::string, std::vector<uint32_t>> m_muctpi_Extra_Ptlut;
+      std::vector<uint32_t> m_muctpi_Nbits;
+
+
+      /**
+       * L1 TMC output informaion
+       */
+      std::vector<TrigConf::L1CTPFiles::CTPCoreInput> m_Tmc_CtpcoreInputs;
+      std::map<std::string, size_t> m_Tmc_CtpinCounters;
+      std::map<std::string, size_t> m_Tmc_CtpmonCounters;
+
+   };
+}
+
+#endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx b/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx
index 14235454fc1c..6696fdd7e3b0 100644
--- a/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx
+++ b/Trigger/TrigConfiguration/TrigConfData/src/DataStructure.cxx
@@ -24,9 +24,16 @@ TrigConf::DataStructure::DataStructure(const std::string & name, const ptree & d
 
 
 TrigConf::DataStructure::DataStructure(ptree && data) :
+   m_initialized(true),
    m_dataSPtr(std::make_shared<ptree>(move(data)))
 {}
 
+TrigConf::DataStructure::DataStructure(const std::string & name, ptree && data) :
+   m_initialized(true),
+   m_dataSPtr(std::make_shared<ptree>(move(data))),
+   m_name(name)
+{}
+
 
 TrigConf::DataStructure::~DataStructure()
 {}
@@ -54,7 +61,7 @@ TrigConf::DataStructure::setData(ptree&& data)
 }
 
 void TrigConf::DataStructure::setName(const std::string& n) {
-  m_name = n;
+   m_name = n;
 }
 
 
@@ -87,6 +94,16 @@ TrigConf::DataStructure::hasAttribute(const std::string & key) const {
    return child.get().empty(); // if empty then it is an attribute, otherwise a child note
 }
 
+bool
+TrigConf::DataStructure::isNull(const std::string & key) const {
+   auto child = data().get_child_optional( key );
+   if( ! child ) {
+      return false;
+   }
+   return child->get_value<std::string>() == "null";
+}
+
+
 std::string
 TrigConf::DataStructure::className() const {
    return "DataStructure";
@@ -201,10 +218,12 @@ TrigConf::DataStructure::getObject(const std::string & pathToChild, bool ignoreI
          throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' does not exist.");
       }
    }
-   // check if the pathToChild points to an object
-   if ( obj.get().empty() ) {
+   // check if the pathToChild is an attribute
+   if( obj.get().get_value<std::string>() != "" ) {
       throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not an object {} but a simple attribute, it needs to be accessed via [\"" + pathToChild + "\"] -> string");
-   } else if ( obj.get().front().first.empty() ) {
+   }
+   // check if the pathToChild points to a list
+   if ( obj.get().front().first.empty() ) {
       throw std::runtime_error(className() + "#" + name() + ": structure '" + pathToChild + "' is not an object {} but a list [], it needs to be accessed via getList(\"" + pathToChild + "\") -> vector<DataStructure>");
    }
    return { obj.get() };
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1CTPFiles.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1CTPFiles.cxx
new file mode 100644
index 000000000000..da1c52970df7
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1CTPFiles.cxx
@@ -0,0 +1,352 @@
+/*
+   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TrigConfData/L1CTPFiles.h"
+
+const std::map<TrigConf::L1CTPFiles::MuctpiAccess, std::string> TrigConf::L1CTPFiles::s_keyMap = {
+   { RoiMaskA, "roimasking_lut_A" },
+   { RoiMaskC, "roimasking_lut_C" },
+   { PtLutBarrel, "pt_lut_BA" },
+   { PtLutEndcap, "pt_lut_EF" }
+};
+
+TrigConf::L1CTPFiles::L1CTPFiles() {
+   for(auto x : s_keyMap) {
+      m_muctpi[x.second];
+   }
+   m_muctpi[s_keyMap.at(RoiMaskA)];
+   m_muctpi[s_keyMap.at(RoiMaskC)];
+   m_muctpi[s_keyMap.at(PtLutBarrel)];
+   m_muctpi[s_keyMap.at(PtLutEndcap)];
+}
+
+TrigConf::L1CTPFiles::~L1CTPFiles() = default;
+
+void
+TrigConf::L1CTPFiles::print() const
+{
+   std::cout << "CTP Files (" << (m_hasCompleteCtpData? "complete" : "incomplete") << ")" << std::endl;
+   std::cout << "   LUT: " << m_Ctpcore_LUT.size() << std::endl;
+   std::cout << "   CAM: " << m_Ctpcore_CAM.size() << std::endl;
+   std::cout << "   CTPIN Mon Sel 7: " << m_Ctpin_MonSelector_Slot7.size() << std::endl;
+   std::cout << "   CTPIN Mon Sel 8: " << m_Ctpin_MonSelector_Slot8.size() << std::endl;
+   std::cout << "   CTPIN Mon Sel 9: " << m_Ctpin_MonSelector_Slot9.size() << std::endl;
+   std::cout << "   CTPIN Mon Dec 7: " << m_Ctpin_MonDecoder_Slot7.size() << std::endl;
+   std::cout << "   CTPIN Mon Dec 8: " << m_Ctpin_MonDecoder_Slot8.size() << std::endl;
+   std::cout << "   CTPIN Mon Dec 9: " << m_Ctpin_MonDecoder_Slot9.size() << std::endl;
+   std::cout << "   CTPMON Mon Sel: " << m_Ctpmon_MonSelector.size() << std::endl;
+   std::cout << "   CTPMON Mon Dec: " << m_Ctpmon_MonDecoder.size() << std::endl;
+   std::cout << "   CTPMON DMX: " << m_Ctpmon_DMX.size() << std::endl;
+   std::cout << "CTP SMX (" << (m_hasCompleteSmxData? "complete" : "incomplete") << ")" << std::endl;
+   std::cout << "   Output: " << m_Smx_Output.size() << std::endl;
+   std::cout << "   VHDL 7: " << m_Smx_Vhdl_Slot7.size() << std::endl;
+   std::cout << "   VHDL 8: " << m_Smx_Vhdl_Slot8.size() << std::endl;
+   std::cout << "   VHDL 9: " << m_Smx_Vhdl_Slot9.size() << std::endl;
+   std::cout << "   SVFI 7: " << m_Smx_Svfi_Slot7.size() << std::endl;
+   std::cout << "   SVFI 8: " << m_Smx_Svfi_Slot8.size() << std::endl;
+   std::cout << "   SVFI 9: " << m_Smx_Svfi_Slot9.size() << std::endl;
+   std::cout << "MUCTPI Files (" << (m_hasCompleteMuctpiData? "complete" : "incomplete") << ")" << std::endl;
+   std::cout << "   required:" << std::endl;
+   std::cout << "      RoiMask A: " << m_muctpi.at("roimasking_lut_A").size() << std::endl;
+   std::cout << "      RoiMask C: " << m_muctpi.at("roimasking_lut_C").size() << std::endl;
+   std::cout << "      pt Barrel: " << m_muctpi.at("pt_lut_BA").size() << std::endl;
+   std::cout << "      pt EC/FW : " << m_muctpi.at("pt_lut_EF").size() << std::endl;
+   std::cout << "   extra pt lut:" << std::endl;
+   for(auto x: m_muctpi_Extra_Ptlut) {
+      std::cout << "     " << x.first << ": " << x.second.size() << std::endl;
+   }
+   std::cout << "   nbits: " << m_muctpi_Nbits.size() << std::endl;
+   std::cout << "TMC information (" << (m_hasCompleteTmcData? "complete" : "incomplete") << ")" << std::endl;
+   std::cout << "   CTPCore inputs    : " << m_Tmc_CtpcoreInputs.size() << std::endl;
+   std::cout << "   CTPIN map entries : " << m_Tmc_CtpinCounters.size() << std::endl;
+   std::cout << "   CTPMON map entries: " << m_Tmc_CtpmonCounters.size() << std::endl;
+}
+
+/**
+ * Accessors
+ **/
+bool
+TrigConf::L1CTPFiles::hasCompleteCtpData() const { 
+   return m_hasCompleteCtpData;
+}
+
+bool
+TrigConf::L1CTPFiles::hasCompleteSmxData() const { 
+   return m_hasCompleteSmxData;
+}
+
+bool
+TrigConf::L1CTPFiles::hasCompleteMuctpiData() const { 
+   return m_hasCompleteMuctpiData;
+}
+
+bool
+TrigConf::L1CTPFiles::hasCompleteTmcData() const { 
+   return m_hasCompleteTmcData;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpcore_LUT() const {
+   return m_Ctpcore_LUT;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpcore_CAM() const {
+   return m_Ctpcore_CAM;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpin_MonSelector_Slot7() const {
+   return m_Ctpin_MonSelector_Slot7;
+
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpin_MonSelector_Slot8() const {
+   return m_Ctpin_MonSelector_Slot8;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpin_MonSelector_Slot9() const {
+   return m_Ctpin_MonSelector_Slot9;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpin_MonDecoder_Slot7() const {
+   return m_Ctpin_MonDecoder_Slot7;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpin_MonDecoder_Slot8() const {
+   return m_Ctpin_MonDecoder_Slot8;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpin_MonDecoder_Slot9() const {
+   return m_Ctpin_MonDecoder_Slot9;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpmon_MonSelector() const {
+   return m_Ctpmon_MonSelector;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpmon_MonDecoder() const {
+   return m_Ctpmon_MonDecoder;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::ctpmon_DMX() const {
+   return m_Ctpmon_DMX;
+}
+
+const std::string &
+TrigConf::L1CTPFiles::smx_Output() const {
+   return m_Smx_Output;
+}
+
+const std::string &
+TrigConf::L1CTPFiles::smx_Vhdl_Slot7() const {
+   return m_Smx_Vhdl_Slot7;
+}
+
+const std::string &
+TrigConf::L1CTPFiles::smx_Vhdl_Slot8() const {
+   return m_Smx_Vhdl_Slot8;
+}
+
+const std::string &
+TrigConf::L1CTPFiles::smx_Vhdl_Slot9() const {
+   return m_Smx_Vhdl_Slot9;
+}
+
+const std::string &
+TrigConf::L1CTPFiles::smx_Svfi_Slot7() const {
+   return m_Smx_Svfi_Slot7;
+}
+
+const std::string &
+TrigConf::L1CTPFiles::smx_Svfi_Slot8() const {
+   return m_Smx_Svfi_Slot8;
+}
+
+const std::string &
+TrigConf::L1CTPFiles::smx_Svfi_Slot9() const {
+   return m_Smx_Svfi_Slot9;
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::muctpiRoi(MuctpiAccess key) const {
+   return m_muctpi.at(s_keyMap.at(key));
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::muctpi_Extra_Ptlut(const std::string & sector) const {
+   return m_muctpi_Extra_Ptlut.at(sector);
+}
+
+const std::vector<uint32_t> &
+TrigConf::L1CTPFiles::muctpi_Nbits() const {
+   return m_muctpi_Nbits;
+}
+
+const std::vector<TrigConf::L1CTPFiles::CTPCoreInput> &
+TrigConf::L1CTPFiles::tmc_CtpcoreInputs() const {
+   return m_Tmc_CtpcoreInputs;
+}
+
+const std::map<std::string, size_t> &
+TrigConf::L1CTPFiles::tmc_CtpinCounters() const {
+   return m_Tmc_CtpinCounters;
+}
+
+const std::map<std::string, size_t> &
+TrigConf::L1CTPFiles::tmc_CtpmonCounters() const {
+   return m_Tmc_CtpmonCounters;
+}
+
+
+/**
+ * Setters
+ **/
+void
+TrigConf::L1CTPFiles::set_HasCompleteCtpData(bool flag) {
+   m_hasCompleteCtpData = flag;
+}
+
+void
+TrigConf::L1CTPFiles::set_HasCompleteSmxData(bool flag) {
+   m_hasCompleteSmxData = flag;
+}
+
+void
+TrigConf::L1CTPFiles::set_HasCompleteMuctpiData(bool flag) {
+   m_hasCompleteMuctpiData = flag;
+}
+
+void
+TrigConf::L1CTPFiles::set_HasCompleteTmcData(bool flag) {
+   m_hasCompleteTmcData = flag;
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpcore_LUT(std::vector<uint32_t> data) {
+   m_Ctpcore_LUT = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpcore_CAM(std::vector<uint32_t> data) {
+   m_Ctpcore_CAM = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpin_MonSelector_Slot7(std::vector<uint32_t> data) {
+   m_Ctpin_MonSelector_Slot7 = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpin_MonSelector_Slot8(std::vector<uint32_t> data) {
+   m_Ctpin_MonSelector_Slot8 = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpin_MonSelector_Slot9(std::vector<uint32_t> data) {
+   m_Ctpin_MonSelector_Slot9 = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpin_MonDecoder_Slot7(std::vector<uint32_t> data) {
+   m_Ctpin_MonDecoder_Slot7 = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpin_MonDecoder_Slot8(std::vector<uint32_t> data) {
+   m_Ctpin_MonDecoder_Slot8 = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpin_MonDecoder_Slot9(std::vector<uint32_t> data) {
+   m_Ctpin_MonDecoder_Slot9 = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpmon_MonSelector(std::vector<uint32_t> data) {
+   m_Ctpmon_MonSelector = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpmon_MonDecoder(std::vector<uint32_t> data) {
+   m_Ctpmon_MonDecoder = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Ctpmon_DMX(std::vector<uint32_t> data) {
+   m_Ctpmon_DMX = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Smx_Output(const std::string & data) { 
+   m_Smx_Output = data;
+}
+
+void
+TrigConf::L1CTPFiles::set_Smx_Vhdl_Slot7(const std::string & data) { 
+   m_Smx_Vhdl_Slot7 = data;
+}
+
+void
+TrigConf::L1CTPFiles::set_Smx_Vhdl_Slot8(const std::string & data) { 
+   m_Smx_Vhdl_Slot8 = data;
+}
+
+void
+TrigConf::L1CTPFiles::set_Smx_Vhdl_Slot9(const std::string & data) { 
+   m_Smx_Vhdl_Slot9 = data;
+}
+
+void
+TrigConf::L1CTPFiles::set_Smx_Svfi_Slot7(const std::string & data) { 
+   m_Smx_Svfi_Slot7 = data;
+}
+
+void
+TrigConf::L1CTPFiles::set_Smx_Svfi_Slot8(const std::string & data) { 
+   m_Smx_Svfi_Slot8 = data;
+}
+
+void
+TrigConf::L1CTPFiles::set_Smx_Svfi_Slot9(const std::string & data) { 
+   m_Smx_Svfi_Slot9 = data;
+}
+
+void
+TrigConf::L1CTPFiles::set_Muctpi(MuctpiAccess key, std::vector<uint32_t> data) {
+   m_muctpi[s_keyMap.at(key)] = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Muctpi_Extra_Ptlut(const std::string & key, std::vector<uint32_t> data) {
+   m_muctpi_Extra_Ptlut[key] = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Muctpi_Nbits(std::vector<uint32_t> data) {
+   m_muctpi_Nbits = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Tmc_CtpcoreInputs(std::vector<TrigConf::L1CTPFiles::CTPCoreInput> data) {
+   m_Tmc_CtpcoreInputs = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Tmc_CtpinCounters(std::map<std::string, size_t> data) {
+   m_Tmc_CtpinCounters = std::move(data);
+}
+
+void
+TrigConf::L1CTPFiles::set_Tmc_CtpmonCounters(std::map<std::string, size_t> data) {
+   m_Tmc_CtpmonCounters = std::move(data);
+}
diff --git a/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBCTPFilesLoader.h b/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBCTPFilesLoader.h
new file mode 100644
index 000000000000..17a6136be6c7
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/TrigDBCTPFilesLoader.h
@@ -0,0 +1,76 @@
+/*
+   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+/**
+ * @file TrigConfIO/TrigDBCTPFilesLoader.h
+ * @brief Loader class for Trigger configuration (L1 hardware files) from the Trigger DB
+ */
+
+#ifndef TRIGCONFIO_TrigDBCTPFilesLoader_H
+#define TRIGCONFIO_TrigDBCTPFilesLoader_H
+
+#include "TrigConfData/L1CTPFiles.h"
+
+#include "TrigConfIO/TrigDBLoader.h"
+
+#include <map>
+#include <vector>
+
+namespace coral {
+   class IQuery;
+   class AttributeList;
+}
+
+namespace TrigConf {
+
+   /**
+    * @brief Loader of trigger configurations from Json files
+    */
+   class TrigDBCTPFilesLoader : public TrigDBLoader {
+   public:
+
+      /** Constructor */
+      TrigDBCTPFilesLoader(const std::string & connection);
+
+      /** Destructor */
+      virtual ~TrigDBCTPFilesLoader();
+
+      /**
+       * @brief Load content from the Trigger DB into an L1CTPFiles object for a given super master key (SMK)
+       * @param smk [in] the SMK that should be loaded
+       * @param ctpfiles [out] the loaded L1CTPFiles
+       * @param loadMask [in] bit mask which specifies which content should be loaded (default is 0x0F which loads all content)
+       *   0x01 - CTPFiles, 0x02 - SMX files, 0x04 - TMC, 0x08 - MUCTPI
+       * @param outFileName [in] if set, an outputfile with the raw data blob is written
+       */
+      bool loadHardwareFiles( unsigned int smk,
+                              L1CTPFiles & ctpfiles,
+                              uint8_t loadMask = 0x0F,
+                              const std::string & outFileName = "") const;
+                              
+   private:
+
+      void loadCTPFiles(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query) const;
+
+      void loadCTPSMX(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query) const;
+
+      void loadTMC(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query) const;
+
+      void loadMUCTPI(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query) const;
+
+      std::vector<uint32_t> loadDBFieldIntoVector(const coral::AttributeList& row, const std::string& field, size_t size) const;
+
+      std::string loadDBFieldIntoString(const coral::AttributeList &row, const std::string &field) const;
+
+      std::map<size_t, QueryDefinition> m_link_queries;
+      std::map<size_t, QueryDefinition> m_ctpfiles_queries;
+      std::map<size_t, QueryDefinition> m_ctpsmx_queries;
+      std::map<size_t, QueryDefinition> m_muctpi_queries;
+      std::map<size_t, QueryDefinition> m_tmcsig_queries;
+   };
+
+}
+
+#endif
+
diff --git a/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBCTPFilesLoader.cxx b/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBCTPFilesLoader.cxx
new file mode 100644
index 000000000000..ebe559049739
--- /dev/null
+++ b/Trigger/TrigConfiguration/TrigConfIO/src/TrigDBCTPFilesLoader.cxx
@@ -0,0 +1,439 @@
+// Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+#include "./TrigDBHelper.h"
+#include "TrigConfIO/TrigDBCTPFilesLoader.h"
+#include "TrigConfData/DataStructure.h"
+#include <iterator>
+
+TrigConf::TrigDBCTPFilesLoader::TrigDBCTPFilesLoader(const std::string & connection) : 
+   TrigDBLoader("TrigDBCTPFilesLoader", connection)
+{
+   // CTP and MUCTPI hardware files only exist for schema versions >= 3
+
+   { // links to file tables
+      auto & q = m_link_queries[3];
+      // tables
+      q.addToTableList ( "SUPER_MASTER_TABLE", "SMT" );
+      q.addToTableList ( "L1_MENU", "L1TM" );
+      // bind vars
+      q.extendBinding<unsigned int>("smk");
+      // conditions
+      q.extendCondition("SMT.SMT_ID = :smk AND SMT.SMT_L1_MENU_ID = L1TM.L1TM_ID");
+      // attributes
+      q.extendOutput<unsigned int>( "L1TM.L1TM_CTP_FILES_ID");
+      q.extendOutput<unsigned int>( "L1TM.L1TM_CTP_SMX_ID");
+      q.extendOutput<unsigned int>( "L1TM.L1TM_MUCTPI_FILES_ID");
+      q.extendOutput<unsigned int>( "L1TM.L1TM_TMC_SIGNALS_ID");
+   }
+
+   { // ctp files
+      auto & q = m_ctpfiles_queries[3];
+      // tables
+      q.addToTableList ( "L1_CTP_FILES" );
+      // bind vars
+      q.extendBinding<unsigned int>("id");
+      // conditions
+      q.extendCondition("L1CF_ID = :id");
+      // attributes
+      q.extendOutput<coral::Blob>( "L1CF_LUT" );
+      q.extendOutput<coral::Blob>( "L1CF_CAM" );
+      q.extendOutput<coral::Blob>( "L1CF_MON_SEL_SLOT7" );
+      q.extendOutput<coral::Blob>( "L1CF_MON_SEL_SLOT8" );
+      q.extendOutput<coral::Blob>( "L1CF_MON_SEL_SLOT9" );
+      q.extendOutput<coral::Blob>( "L1CF_MON_SEL_CTPMON" );
+      q.extendOutput<coral::Blob>( "L1CF_MON_DEC_SLOT7" );
+      q.extendOutput<coral::Blob>( "L1CF_MON_DEC_SLOT8" );
+      q.extendOutput<coral::Blob>( "L1CF_MON_DEC_SLOT9" );
+      q.extendOutput<coral::Blob>( "L1CF_MON_DEC_CTPMON" );
+      q.extendOutput<coral::Blob>( "L1CF_MON_DMX" );
+   }
+
+   { // ctp smx
+      auto & q = m_ctpsmx_queries[3];
+      // tables
+      q.addToTableList ( "L1_CTP_SMX" );
+      // bind vars
+      q.extendBinding<unsigned int>("id");
+      // conditions
+      q.extendCondition("L1SMX_ID = :id");
+      // attributes
+      q.extendOutput<coral::Blob>( "L1SMX_OUTPUT" );
+      q.extendOutput<coral::Blob>( "L1SMX_VHDL_SLOT7" );
+      q.extendOutput<coral::Blob>( "L1SMX_VHDL_SLOT8" );
+      q.extendOutput<coral::Blob>( "L1SMX_VHDL_SLOT9" );
+      q.extendOutput<coral::Blob>( "L1SMX_SVFI_SLOT7" );
+      q.extendOutput<coral::Blob>( "L1SMX_SVFI_SLOT8" );
+      q.extendOutput<coral::Blob>( "L1SMX_SVFI_SLOT9" );
+   }
+
+   { // muctpi
+      auto & q = m_muctpi_queries[3];
+      // tables
+      q.addToTableList ( "L1_MUCTPI_FILES" );
+      // bind vars
+      q.extendBinding<unsigned int>("id");
+      // conditions
+      q.extendCondition("L1MF_ID = :id");
+      // attributes
+      q.extendOutput<coral::Blob>( "L1MF_DATA" );
+   }
+
+   { // tmc
+      auto & q = m_tmcsig_queries[3];
+      // tables
+      q.addToTableList ( "L1_TMC_SIGNALS" );
+      // bind vars
+      q.extendBinding<unsigned int>("id");
+      // conditions
+      q.extendCondition("L1TMC_ID = :id");
+      // attributes
+      q.extendOutput<coral::Blob>( "L1TMC_DATA" );
+   }
+}
+
+TrigConf::TrigDBCTPFilesLoader::~TrigDBCTPFilesLoader() = default;
+
+bool
+TrigConf::TrigDBCTPFilesLoader::loadHardwareFiles (unsigned int smk,
+                                                   TrigConf::L1CTPFiles & ctpfiles,
+                                                   uint8_t loadMask,
+                                                   const std::string & /*outFileName*/ ) const
+{
+   unsigned int ctpFilesID{0};
+   unsigned int ctpSmxID{0};
+   unsigned int muctpiID{0};
+   unsigned int tmcSignalsID{0};
+
+   auto session = createDBSession();
+   session->transaction().start( /*bool readonly=*/ true);
+   const size_t sv = schemaVersion(session.get());
+   try {
+      QueryDefinition qdef = getQueryDefinition(sv, m_link_queries);
+      qdef.setBoundValue<unsigned int>("smk", smk);
+      auto q = qdef.createQuery( session.get() );
+      auto & cursor = q->execute();
+      if ( ! cursor.next() ) {
+         TRG_MSG_ERROR("Tried reading L1 CTPFiles, but super master key " << smk << " is not available" );
+         throw TrigConf::NoSMKException("TrigDBCTPFilesLoader: super master key " + std::to_string(smk) + " not available");
+      }
+      const coral::AttributeList& row = cursor.currentRow();
+      try {
+         ctpFilesID = row["L1TM.L1TM_CTP_FILES_ID"].data<unsigned int>();
+      }
+      catch(const coral::AttributeException & e) // NULL content
+      {}
+      try {
+         ctpSmxID = row["L1TM.L1TM_CTP_FILES_ID"].data<unsigned int>();
+      }
+      catch(const coral::AttributeException & e) // NULL content
+      {}
+      try {
+         muctpiID = row["L1TM.L1TM_CTP_FILES_ID"].data<unsigned int>();
+      }
+      catch(const coral::AttributeException & e) // NULL content
+      {}
+      try {
+         tmcSignalsID = row["L1TM.L1TM_CTP_FILES_ID"].data<unsigned int>();
+      }
+      catch(const coral::AttributeException & e) // NULL content
+      {}
+
+      TRG_MSG_INFO("ID of table L1_CTP_FILES    : " <<  ctpFilesID);
+      TRG_MSG_INFO("ID of table L1_CTP_SMX      : " <<  ctpSmxID);
+      TRG_MSG_INFO("ID of table L1_MUCTPI_FILES : " <<  muctpiID);
+      TRG_MSG_INFO("ID of table L1_TMC_SIGNALS  : " <<  tmcSignalsID);
+   }
+   catch(coral::QueryException & ex) {
+      TRG_MSG_ERROR("When reading the files table links for super master key " << smk << " a coral::QueryException was caught ( " << ex.what() <<" )" );
+      throw TrigConf::QueryException("TrigDBCTPFilesLoader: " + std::string(ex.what()));
+   }
+
+   if(ctpFilesID>0 && (loadMask & 0x01)!=0 ) {
+      QueryDefinition qdef = getQueryDefinition(sv, m_ctpfiles_queries);
+      qdef.setBoundValue<unsigned int>("id", ctpFilesID);
+      loadCTPFiles(ctpfiles, qdef.createQuery( session.get() ) );
+   }
+
+   if(ctpSmxID>0 && (loadMask & 0x02)!=0) {
+      QueryDefinition qdef = getQueryDefinition(sv, m_ctpsmx_queries);
+      qdef.setBoundValue<unsigned int>("id", ctpSmxID);
+      loadCTPSMX(ctpfiles, qdef.createQuery( session.get() ) );
+   }
+   
+   if(tmcSignalsID>0 && (loadMask & 0x04)!=0) {
+      QueryDefinition qdef = getQueryDefinition(sv, m_tmcsig_queries);
+      qdef.setBoundValue<unsigned int>("id", tmcSignalsID);
+      loadTMC(ctpfiles, qdef.createQuery( session.get() ) );
+   }
+   
+   if(muctpiID>0 && (loadMask & 0x08)!=0) {
+      QueryDefinition qdef = getQueryDefinition(sv, m_muctpi_queries);
+      qdef.setBoundValue<unsigned int>("id", muctpiID);
+      loadMUCTPI(ctpfiles, qdef.createQuery( session.get() ) );
+   }   
+   return true;
+}
+
+
+void
+TrigConf::TrigDBCTPFilesLoader::loadCTPFiles(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query) const
+{
+   TRG_MSG_INFO("Loading data from table L1_CTP_FILES");
+   try
+   {
+      auto & cursor = query->execute();
+      cursor.next();
+      const coral::AttributeList& row = cursor.currentRow();
+      {
+         ctpfiles.set_Ctpcore_LUT(
+            loadDBFieldIntoVector(row, "L1CF_LUT", L1CTPFiles::CTPCORE_LUT_SIZE)
+         );
+      }
+      {
+         ctpfiles.set_Ctpcore_CAM(
+            loadDBFieldIntoVector(row, "L1CF_CAM", L1CTPFiles::CTPCORE_CAM_SIZE)
+         );
+      }
+      {
+         ctpfiles.set_Ctpin_MonSelector_Slot7(
+            loadDBFieldIntoVector(row, "L1CF_MON_SEL_SLOT7", L1CTPFiles::CTPIN_MONSEL_SIZE)
+         );
+      }
+      {
+         ctpfiles.set_Ctpin_MonSelector_Slot8(
+            loadDBFieldIntoVector(row, "L1CF_MON_SEL_SLOT8", L1CTPFiles::CTPIN_MONSEL_SIZE)
+         );
+      }
+      {
+         ctpfiles.set_Ctpin_MonSelector_Slot9(
+            loadDBFieldIntoVector(row, "L1CF_MON_SEL_SLOT9", L1CTPFiles::CTPIN_MONSEL_SIZE)
+         );
+      }
+      {
+         ctpfiles.set_Ctpin_MonDecoder_Slot7(
+            loadDBFieldIntoVector(row, "L1CF_MON_DEC_SLOT7", L1CTPFiles::CTPIN_MONDEC_SIZE)
+         );
+      }
+      {
+         ctpfiles.set_Ctpin_MonDecoder_Slot8(
+            loadDBFieldIntoVector(row, "L1CF_MON_DEC_SLOT8", L1CTPFiles::CTPIN_MONDEC_SIZE)
+         );
+      }
+      {
+         ctpfiles.set_Ctpin_MonDecoder_Slot9(
+            loadDBFieldIntoVector(row, "L1CF_MON_DEC_SLOT9", L1CTPFiles::CTPIN_MONDEC_SIZE)
+         );
+      }
+      {
+         ctpfiles.set_Ctpmon_MonSelector(
+            loadDBFieldIntoVector(row, "L1CF_MON_SEL_CTPMON", L1CTPFiles::CTPMON_SELECTOR_SIZE)
+         );
+      }
+      {
+         ctpfiles.set_Ctpmon_MonDecoder(
+            loadDBFieldIntoVector(row, "L1CF_MON_DEC_CTPMON", L1CTPFiles::CTPMON_DECODER_SIZE)
+         );
+      }
+      {
+         ctpfiles.set_Ctpmon_DMX(
+            loadDBFieldIntoVector(row, "L1CF_MON_DMX", L1CTPFiles::CTPMON_DMX_SIZE)
+         );
+      }
+      ctpfiles.set_HasCompleteCtpData(true);
+   }
+   catch(coral::QueryException & ex) {
+      TRG_MSG_ERROR("When reading the L1CTPFiles a coral::QueryException was caught ( " << ex.what() <<" )" );
+      throw TrigConf::QueryException("TrigDBCTPFilesLoader: " + std::string(ex.what()));
+   }
+}
+
+void
+TrigConf::TrigDBCTPFilesLoader::loadCTPSMX(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query) const {
+   TRG_MSG_INFO("Loading data from table L1_CTP_SMX");
+   try
+   {
+      auto & cursor = query->execute();
+      cursor.next();
+      const coral::AttributeList& row = cursor.currentRow();
+      
+      ctpfiles.set_Smx_Output( loadDBFieldIntoString(row, "L1SMX_OUTPUT") );
+      ctpfiles.set_Smx_Vhdl_Slot7( loadDBFieldIntoString(row, "L1SMX_VHDL_SLOT7") );
+      ctpfiles.set_Smx_Vhdl_Slot8( loadDBFieldIntoString(row, "L1SMX_VHDL_SLOT8") );
+      ctpfiles.set_Smx_Vhdl_Slot9( loadDBFieldIntoString(row, "L1SMX_VHDL_SLOT9") );
+      ctpfiles.set_Smx_Svfi_Slot7( loadDBFieldIntoString(row, "L1SMX_SVFI_SLOT7") );
+      ctpfiles.set_Smx_Svfi_Slot8( loadDBFieldIntoString(row, "L1SMX_SVFI_SLOT8") );
+      ctpfiles.set_Smx_Svfi_Slot9( loadDBFieldIntoString(row, "L1SMX_SVFI_SLOT9") );
+      ctpfiles.set_HasCompleteSmxData(true);      
+   }
+   catch(coral::QueryException & ex) {
+      TRG_MSG_ERROR("When reading the L1CTPFiles a coral::QueryException was caught ( " << ex.what() <<" )" );
+      throw TrigConf::QueryException("TrigDBCTPFilesLoader: " + std::string(ex.what()));
+   }
+}
+
+void
+TrigConf::TrigDBCTPFilesLoader::loadMUCTPI(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query) const {
+   TRG_MSG_INFO("Loading data from table L1_MUCTPI_FILES");
+
+   bool incomplete = false;
+   boost::property_tree::ptree pt;
+   try
+   {
+      auto & cursor = query->execute();
+      cursor.next();
+      const coral::AttributeList& row = cursor.currentRow();
+      const coral::Blob & blob = row["L1MF_DATA"].data<coral::Blob>();
+      blobToPtree(blob, pt);
+   }
+   catch(coral::QueryException & ex) {
+      TRG_MSG_ERROR("When reading the L1CTPFiles a coral::QueryException was caught ( " << ex.what() <<" )" );
+      throw TrigConf::QueryException("TrigDBCTPFilesLoader: " + std::string(ex.what()));
+   }
+   DataStructure ds("L1_MUCTPI_FILES", std::move(pt));
+   std::vector<std::string> keys = ds.getKeys();
+   for(auto k : {L1CTPFiles::RoiMaskA, L1CTPFiles::RoiMaskC, L1CTPFiles::PtLutBarrel, L1CTPFiles::PtLutEndcap}) {
+      if( auto dv = ds.getList_optional(L1CTPFiles::s_keyMap.at(k)) ) {
+         keys.erase( std::find(keys.begin(), keys.end(), L1CTPFiles::s_keyMap.at(k)) );
+         std::vector<uint32_t> v;
+         v.reserve(200);
+         for( auto x : *dv ) {
+            v.push_back(std::stoul(x.getValue<std::string>(), nullptr, 0));
+         }
+         ctpfiles.set_Muctpi(k, std::move(v));
+      } else {
+         incomplete = true;
+      }
+   }
+   for(const std::string & k : keys) {
+      if(ds.isNull(k)) {
+         TRG_MSG_INFO("Attribute " << k << " has null-content");
+         incomplete = true;
+         continue;
+      }
+      auto sopt = ds.getAttribute_optional<std::string>(k);
+      if(k.compare(0, 6, "pt_lut") == 0) {
+         auto dv = ds.getList(k);
+         std::vector<uint32_t> v;
+         v.reserve(200);
+         for( auto x : dv ) {
+            v.push_back(std::stoul(x.getValue<std::string>(), nullptr, 0));
+         }
+         ctpfiles.set_Muctpi_Extra_Ptlut(k, std::move(v));
+      } else if(k=="multiplicities_nbits") {
+         auto dv = ds.getList(k);
+         std::vector<uint32_t> v;
+         for( auto x : dv ) {
+            v.push_back(std::stoul(x.getValue<std::string>(), nullptr, 0));
+         }
+         ctpfiles.set_Muctpi_Nbits(std::move(v));
+      }
+   }
+   ctpfiles.set_HasCompleteMuctpiData(!incomplete);
+}
+
+void
+TrigConf::TrigDBCTPFilesLoader::loadTMC(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query) const {
+   TRG_MSG_INFO("Loading data from table L1_TMC_SIGNALS");
+   boost::property_tree::ptree pt;
+   try
+   {
+      auto & cursor = query->execute();
+      cursor.next();
+      const coral::AttributeList& row = cursor.currentRow();
+      const coral::Blob & blob = row["L1TMC_DATA"].data<coral::Blob>();
+      blobToPtree(blob, pt);
+   }
+   catch(coral::QueryException & ex) {
+      TRG_MSG_ERROR("When reading the L1CTPFiles a coral::QueryException was caught ( " << ex.what() <<" )" );
+      throw TrigConf::QueryException("TrigDBCTPFilesLoader: " + std::string(ex.what()));
+   }
+
+   DataStructure ds("L1_TMC", std::move(pt));
+
+   // should always be the correct type
+   if( auto ft = ds.getAttribute<std::string>("fileType"); ft != "inputMapping" ) {
+      throw TrigConf::ParsingException("TrigDBCTPFilesLoader::loadTMC: json structure of unexpected file type found. Expected 'inputMapping', but found " + ft);
+   }
+
+   // read the ctpcore inputs
+   if( auto dv = ds.getList_optional("ctpCoreInputs") ) {
+      std::vector<TrigConf::L1CTPFiles::CTPCoreInput> ctpcoreInputs;
+      for(const TrigConf::DataStructure & inp : *dv) {
+         ctpcoreInputs.push_back(
+            TrigConf::L1CTPFiles::CTPCoreInput(inp.getAttribute<size_t>("inputNumber"), inp.getAttribute<std::string>("name"), inp.getAttribute<size_t>("bit"), inp.getAttribute<size_t>("phase"))
+         );
+      }
+      TRG_MSG_INFO("Loading ctpcore inputs " << ctpcoreInputs.size());
+      ctpfiles.set_Tmc_CtpcoreInputs(std::move(ctpcoreInputs));
+   }
+
+   // read the ctpin map
+   if( auto dv = ds.getObject_optional("ctpinMap") ) {
+      std::map<std::string, size_t> ctpin;
+      for(const std::string & k : dv->getKeys()) {
+         ctpin[k] = dv->getAttribute<size_t>(k);
+      }
+      TRG_MSG_INFO("Loading ctpin counters " << ctpin.size());
+      ctpfiles.set_Tmc_CtpinCounters(std::move(ctpin));
+   }
+
+   // read the ctpmon map
+   if( auto dv = ds.getObject_optional("ctpmonMap") ) {
+      std::map<std::string, size_t> ctpmon;
+      for(const std::string & k : dv->getKeys()) {
+         ctpmon[k] = dv->getAttribute<size_t>(k);
+      }
+      ctpfiles.set_Tmc_CtpmonCounters(std::move(ctpmon));
+      TRG_MSG_INFO("Loading ctp mon counters " << ctpmon.size());
+   }
+
+   ctpfiles.set_HasCompleteTmcData(true);
+}
+
+std::vector<uint32_t>
+TrigConf::TrigDBCTPFilesLoader::loadDBFieldIntoVector(const coral::AttributeList& row, const std::string& field, size_t size) const {
+   std::vector<uint32_t> vec;
+   vec.reserve(size);
+   try {
+      TRG_MSG_INFO("Loading " << field << " of size (#words) " << size);
+      const coral::Blob& blob = row[field].data<coral::Blob>();
+      boost::iostreams::stream<boost::iostreams::array_source> stream(
+         static_cast<const char*> (blob.startingAddress()), 
+         blob.size()
+      );
+      std::string word{""};
+      while(stream >> word) {
+         vec.push_back(std::stoul(word,nullptr, 0));
+      }
+   }
+   catch(const coral::AttributeException & e) {} // NULL content
+   if(size != vec.size()) {
+      TRG_MSG_ERROR("File content from DB of size " << vec.size() << ", but expect " << size);
+      throw std::runtime_error( "CTPFilesLoader: file of unexpected size" );
+   }
+
+   return vec;
+}
+
+std::string
+TrigConf::TrigDBCTPFilesLoader::loadDBFieldIntoString(const coral::AttributeList& row, const std::string& field) const {
+   std::string result;
+   try {
+      const coral::Blob& blob = row[field].data<coral::Blob>();
+      boost::iostreams::stream<boost::iostreams::array_source> stream(
+         static_cast<const char*> (blob.startingAddress()), 
+         blob.size()
+      );
+      result = std::string (
+         std::istreambuf_iterator<char>(stream.rdbuf()),
+         std::istreambuf_iterator<char>()
+      );
+      TRG_MSG_INFO("Loading " << field << " of size " << result.size());
+   }
+   catch(const coral::AttributeException & e) {} // NULL content
+   if(result.empty()) {
+      TRG_MSG_ERROR("Field " << field << " in DB is empty");
+      throw std::runtime_error( "CTPFilesLoader: field " + field + " in DB is empty" );
+   }
+   return result;
+}
diff --git a/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx b/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx
index 2189df1e4345..bb72cfef8a5b 100644
--- a/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx
+++ b/Trigger/TrigConfiguration/TrigConfIO/utils/TriggerMenuRW.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+   Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <cstdlib>
@@ -13,6 +13,7 @@
 #include "TrigConfIO/TrigDBL1PrescalesSetLoader.h"
 #include "TrigConfIO/TrigDBHLTPrescalesSetLoader.h"
 #include "TrigConfIO/TrigDBL1BunchGroupSetLoader.h"
+#include "TrigConfIO/TrigDBCTPFilesLoader.h"
 #include "TrigConfData/HLTMenu.h"
 #include "TrigConfData/L1Menu.h"
 #include "TrigConfData/L1PrescalesSet.h"
@@ -26,7 +27,7 @@ public:
    ~Config(){}
    Config(){}
 
-   std::vector<std::string> knownParameters { "file", "f", "smk", "l1psk", "hltpsk", "bgsk", "db", "write", "w", "Write", "W", "help", "h", "detail", "d" };
+   std::vector<std::string> knownParameters { "file", "f", "smk", "l1psk", "hltpsk", "bgsk", "db", "write", "w", "Write", "W", "help", "h", "detail", "d", "ctp", "c" };
 
    // parameters
    // input
@@ -36,6 +37,7 @@ public:
    unsigned int hltpsk { 0 };
    unsigned int bgsk { 0 };
    std::string  dbalias { "TRIGGERDBDEV1" };
+   bool doCtp { false }; // flag to read CTP files
 
    // output
    bool         write { false }; // flag to enable writing
@@ -59,25 +61,26 @@ public:
 
 void Config::usage() {
 
-  cout << "The program needs to be run with the following specifications:\n\n";
-  cout << "TriggerMenuRW <options>\n";
-  cout << "\n";
-  cout << "[Input options]\n";
-  cout << "  -f|--file             file1 [file2 [file3 ...]]     ... one or multiple json files\n";
-  cout << "  --smk                 smk                           ... smk \n";
-  cout << "  --l1psk               l1psk                         ... the L1 prescale key \n";
-  cout << "  --hltpsk              hltpsk                        ... the HLT prescale key \n";
-  cout << "  --bgsk                bgsk                          ... the bunchgroup key \n";
-  cout << "  --db                  dbalias                       ... dbalias (default " << dbalias << ") \n";
-  cout << "[Output options]\n";
-  cout << "  -w|--write            [base]                        ... to write out json files, e.g. L1menu[_<base>].json. base is optional.\n";
-  cout << "  -W|--Write            [base]                        ... to write out json files from the internal structure (only for L1Menu), e.g. L1menu[_<base>].json. base is optional.\n";
-  cout << "[Other options]\n";
-  cout << "  -h|--help                                           ... this help\n";
-  cout << "  -d|--detail                                         ... prints detailed job options\n";
-  cout << "\n\n";
-  cout << "Examples\n";
-  cout << "  --file L1menu.json HLTMenu.json                     ... read L1Menu.json and HLTMenu.json and show some basic statistics\n";
+   cout << "The program needs to be run with the following specifications:\n\n";
+   cout << "TriggerMenuRW <options>\n";
+   cout << "\n";
+   cout << "[Input options]\n";
+   cout << "  -f|--file             file1 [file2 [file3 ...]]     ... one or multiple json files\n";
+   cout << "  --smk                 smk                           ... smk \n";
+   cout << "  --l1psk               l1psk                         ... the L1 prescale key \n";
+   cout << "  --hltpsk              hltpsk                        ... the HLT prescale key \n";
+   cout << "  --bgsk                bgsk                          ... the bunchgroup key \n";
+   cout << "  --db                  dbalias                       ... dbalias (default " << dbalias << ") \n";
+   cout << "  -c|--ctp                                            ... if provided together with the SMK and DB then will read only CTP files from the DB and not the rest of the menu\n";
+   cout << "[Output options]\n";
+   cout << "  -w|--write            [base]                        ... to write out json files, e.g. L1menu[_<base>].json. base is optional.\n";
+   cout << "  -W|--Write            [base]                        ... to write out json files from the internal structure (only for L1Menu), e.g. L1menu[_<base>].json. base is optional.\n";
+   cout << "[Other options]\n";
+   cout << "  -h|--help                                           ... this help\n";
+   cout << "  -d|--detail                                         ... prints detailed job options\n";
+   cout << "\n\n";
+   cout << "Examples\n";
+   cout << "  --file L1menu.json HLTMenu.json                     ... read L1Menu.json and HLTMenu.json and show some basic statistics\n";
 
 }
 
@@ -109,6 +112,7 @@ Config::parseProgramOptions(int argc, char* argv[]) {
          if(paramName == "d" || paramName == "detail" ) { detail = true; continue; }
          if(paramName == "w" || paramName == "write" ) { write = true; }
          if(paramName == "W" || paramName == "Write" ) { writeFromDataStructure = true; }
+         if(paramName == "c" || paramName == "ctp" ) { doCtp = true; }
          currentParameter = paramName;
          continue;
       }
@@ -273,7 +277,7 @@ int main(int argc, char** argv) {
       }
    }
 
-   if( cfg.smk != 0 ) {
+   if( cfg.smk != 0 && !cfg.doCtp ) {
       // load config from DB
 
       // db menu loader
@@ -333,6 +337,12 @@ int main(int argc, char** argv) {
       }
    }
 
+   if( cfg.smk != 0 && cfg.doCtp ) {
+      TrigConf::TrigDBCTPFilesLoader dbloader(cfg.dbalias);
+      TrigConf::L1CTPFiles ctpfiles;
+      dbloader.loadHardwareFiles(cfg.smk, ctpfiles, 0x0F, outputFileName("CTPFiles", cfg));
+      ctpfiles.print();
+   }
 
    if( cfg.l1psk != 0 ) {
       // load L1 prescales set from DB
-- 
GitLab


From fdb574f1a6984ec9bfb96ad892828b1c63b3e1ab Mon Sep 17 00:00:00 2001
From: Alberto Prades Ibanez <alberto.prades.ibanez@cern.ch>
Date: Mon, 20 Sep 2021 18:06:43 +0200
Subject: [PATCH 212/347] Oliver Majersky asked me to update the changes
 approved in the 21.2 version of the FFJetSmearingTool into Athena R22

---
 .../JetUncertainties/FFJetSmearingTool.h      |  20 +-
 .../Root/FFJetSmearingTool.cxx                | 189 +++++++++++-------
 2 files changed, 130 insertions(+), 79 deletions(-)

diff --git a/Reconstruction/Jet/JetUncertainties/JetUncertainties/FFJetSmearingTool.h b/Reconstruction/Jet/JetUncertainties/JetUncertainties/FFJetSmearingTool.h
index cb081082f2de..db43fe0cbecb 100644
--- a/Reconstruction/Jet/JetUncertainties/JetUncertainties/FFJetSmearingTool.h
+++ b/Reconstruction/Jet/JetUncertainties/JetUncertainties/FFJetSmearingTool.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
 */
 
 
@@ -61,7 +61,7 @@ namespace JetTools{
         TA,       ///Track Assisted
         Comb,     ///Combined
     };
-    StatusCode stringToEnum(const TString& name, FFJetAllowedMassDefEnum& result)
+    inline StatusCode stringToEnum(const TString& name, FFJetAllowedMassDefEnum& result)
     {
         if (name.EqualTo("Calo",TString::kIgnoreCase)){
             result = FFJetAllowedMassDefEnum::Calo;
@@ -77,7 +77,7 @@ namespace JetTools{
         }
         return StatusCode::FAILURE;
     }
-    TString enumToString(const FFJetAllowedMassDefEnum type)
+    inline TString enumToString(const FFJetAllowedMassDefEnum type)
     {
         switch (type)
         {
@@ -142,7 +142,7 @@ namespace CP {
             StatusCode getJetTopology( xAOD::Jet& jet_reco, std::string& jetTopology) const;
 
             double Read3DHistogram(const TH3* histo, double x, double y, double z) const;
-
+            double Interpolate2D(const TH2* histo, double x, double y) const;
 
 
             // Private members
@@ -159,11 +159,11 @@ namespace CP {
             JetTools::FFJetAllowedMassDefEnum m_MassDef;
             std::string m_configFile;
             std::string m_path;
-            std::string  m_HistogramsFilePath;
+            std::string m_HistogramsFilePath;
 
             //Response matrix
-            std::unique_ptr<TH2D> m_CALO_ResponseMap;
-            std::unique_ptr<TH2D> m_TA_ResponseMap;
+            std::unique_ptr<TH2> m_CALO_ResponseMap;
+            std::unique_ptr<TH2> m_TA_ResponseMap;
 
             //Two histograms to extract the Calo and TA weights in the Combined mass of the jet
             std::unique_ptr<TH3F> m_caloMassWeight;
@@ -174,10 +174,12 @@ namespace CP {
             CP::SystematicSet  m_SysList;
 
             //Maps that relates the systematic name with some of its caracteristics
-            std::map<std::string,std::string> m_Syst_HistPath_map;
             std::map<std::string,std::string> m_Syst_MassDefAffected_map;
             std::map<std::string,std::string> m_Syst_TopologyAffected_map;
-            std::map<std::string,std::unique_ptr<TH2D>> m_Syst_Hist_map;
+            std::map<std::string,std::string> m_Syst_HistPath_map;
+            std::map<std::string,std::unique_ptr<TH2>> m_Syst_Hist_map;
+            std::map<std::string,std::string> m_Syst_HistTAPath_map;
+            std::map<std::string,std::unique_ptr<TH2>> m_Syst_HistTA_map;
             std::map<std::string,std::string> m_Syst_Affects_JMSorJMR;
 
             //The current systematic configuration
diff --git a/Reconstruction/Jet/JetUncertainties/Root/FFJetSmearingTool.cxx b/Reconstruction/Jet/JetUncertainties/Root/FFJetSmearingTool.cxx
index 6a8caa1a58df..7c9f1e461d96 100644
--- a/Reconstruction/Jet/JetUncertainties/Root/FFJetSmearingTool.cxx
+++ b/Reconstruction/Jet/JetUncertainties/Root/FFJetSmearingTool.cxx
@@ -188,7 +188,32 @@ CP::SystematicSet FFJetSmearingTool::affectingSystematics() const
 //-----------------------------------------------------------------------------
 CP::SystematicSet FFJetSmearingTool::recommendedSystematics() const
 {
-    return m_SysList;
+    
+  CP::SystematicSet filteredSysts;
+  if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::Calo){//take only Calo-like syst
+    for (auto ci = m_SysList.begin(); ci != m_SysList.end(); ci++) {
+      if ((*ci).basename().find("CALO_")!=std::string::npos)
+	filteredSysts.insert(*ci);
+    }
+    return filteredSysts;    
+  }
+  if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::TA){//take only TA-like syst 
+    for (auto ci = m_SysList.begin(); ci != m_SysList.end(); ci++) {
+      if ((*ci).basename().find("TA_") !=std::string::npos)
+	filteredSysts.insert(*ci);
+    }
+    return filteredSysts;    
+  }
+  if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::Comb){//take only TA-like syst 
+    for (auto ci = m_SysList.begin(); ci != m_SysList.end(); ci++) {
+      if ((*ci).basename().find("COMB_")!=std::string::npos){
+	filteredSysts.insert(*ci);
+      }
+    }
+    return filteredSysts;    
+  }
+  
+  return m_SysList;
 }
 
 //-----------------------------------------------------------------------------
@@ -202,10 +227,8 @@ StatusCode FFJetSmearingTool::applySystematicVariation
     // Look for it in our sysData map.
     auto iter = m_sysData.find (systematics);
 
-
     // If this is a new input set, we need to filter it.
     if(iter == m_sysData.end()){
-
         // Filter the input systematics with my affecting systematics.
         const CP::SystematicSet affectingSysts = affectingSystematics();
         CP::SystematicSet filteredSysts;
@@ -227,8 +250,6 @@ StatusCode FFJetSmearingTool::applySystematicVariation
             return StatusCode::FAILURE;
         }
 
-
-
         // Insert the new systematic data onto our map
         SysData myData;
 
@@ -262,19 +283,19 @@ StatusCode FFJetSmearingTool::readFFJetSmearingToolSimplifiedData(TEnv& settings
 
 
 
-
-    TString CaloResponseMap_path = settings.GetValue("CaloResponseMap","");
-
-    if(CaloResponseMap_path.IsNull())
-    {
-        ATH_MSG_ERROR("Cannot find the CaloResponseMap in the config file");
-        return StatusCode::FAILURE;
+    if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::Comb || m_MassDef==JetTools::FFJetAllowedMassDefEnum::Calo){
+      TString CaloResponseMap_path = settings.GetValue("CaloResponseMap","");
+      
+      if(CaloResponseMap_path.IsNull())
+	{
+	  ATH_MSG_ERROR("Cannot find the CaloResponseMap in the config file");
+	  return StatusCode::FAILURE;
+	}
+      
+      m_CALO_ResponseMap  = std::unique_ptr<TH2>(dynamic_cast<TH2*>(data_file->Get( CaloResponseMap_path )));
+      m_CALO_ResponseMap->SetDirectory(0);
     }
 
-    m_CALO_ResponseMap  = std::make_unique<TH2D>(*dynamic_cast<TH2D*>(data_file->Get( CaloResponseMap_path )));
-    m_CALO_ResponseMap->SetDirectory(0);
-
-
     if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::Comb || m_MassDef==JetTools::FFJetAllowedMassDefEnum::TA){
         TString TAResponseMap_path = settings.GetValue("TAResponseMap","");
 
@@ -284,7 +305,7 @@ StatusCode FFJetSmearingTool::readFFJetSmearingToolSimplifiedData(TEnv& settings
             return StatusCode::FAILURE;
         }
 
-        m_TA_ResponseMap  = std::make_unique<TH2D>(*dynamic_cast<TH2D*>(data_file->Get( TAResponseMap_path )));
+        m_TA_ResponseMap  = std::unique_ptr<TH2>(dynamic_cast<TH2*>(data_file->Get( TAResponseMap_path )));
         m_TA_ResponseMap->SetDirectory(0);//To keep it open when we close the .root file
     }
 
@@ -300,16 +321,20 @@ StatusCode FFJetSmearingTool::readFFJetSmearingToolSimplifiedData(TEnv& settings
         if( !Syst_Name.empty()){
             m_SysList.insert( CP::SystematicVariation(Syst_Name, 1) );
             m_SysList.insert( CP::SystematicVariation(Syst_Name, -1) );
-
-            m_Syst_HistPath_map[Syst_Name] = settings.GetValue(prefix+"Hist","");
             m_Syst_MassDefAffected_map[Syst_Name] = settings.GetValue(prefix+"MassDef","");
             m_Syst_TopologyAffected_map[Syst_Name] = settings.GetValue(prefix+"Topology","");
             m_Syst_Affects_JMSorJMR[Syst_Name] = "JMS";
-
-            m_Syst_Hist_map[Syst_Name] = std::make_unique<TH2D>(*dynamic_cast<TH2D*>(data_file->Get(m_Syst_HistPath_map[Syst_Name].c_str())));
+            m_Syst_HistPath_map[Syst_Name] = settings.GetValue(prefix+"Hist","");
+            m_Syst_Hist_map[Syst_Name] = std::unique_ptr<TH2>(dynamic_cast<TH2*>(data_file->Get(m_Syst_HistPath_map[Syst_Name].c_str())));
             m_Syst_Hist_map[Syst_Name]->SetDirectory(0);
-
-        }
+	    if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::Comb){//for comb mass we need to read two histograms
+	      m_Syst_HistTAPath_map[Syst_Name] = settings.GetValue(prefix+"HistTA","");
+	      if(m_Syst_HistTAPath_map[Syst_Name]!=""){
+	      m_Syst_HistTA_map[Syst_Name] = std::unique_ptr<TH2>(dynamic_cast<TH2*>(data_file->Get(m_Syst_HistTAPath_map[Syst_Name].c_str())));
+	      m_Syst_HistTA_map[Syst_Name]->SetDirectory(0);
+	      }
+	    }
+	}
     }
     //JMR Systematics
     for (size_t iComp = 0; iComp < 999; ++iComp)
@@ -318,20 +343,23 @@ StatusCode FFJetSmearingTool::readFFJetSmearingToolSimplifiedData(TEnv& settings
 
         std::string Syst_Name = settings.GetValue(prefix+"Name","");
 
-
         if( !Syst_Name.empty()){
             m_SysList.insert( CP::SystematicVariation(Syst_Name, 1) );
             m_SysList.insert( CP::SystematicVariation(Syst_Name, -1) );
-
-            m_Syst_HistPath_map[Syst_Name] = settings.GetValue(prefix+"Hist","");
             m_Syst_MassDefAffected_map[Syst_Name] = settings.GetValue(prefix+"MassDef","");
             m_Syst_TopologyAffected_map[Syst_Name] = settings.GetValue(prefix+"Topology","");
             m_Syst_Affects_JMSorJMR[Syst_Name] = "JMR";
-
-            m_Syst_Hist_map[Syst_Name] = std::make_unique<TH2D>(*dynamic_cast<TH2D*>(data_file->Get(m_Syst_HistPath_map[Syst_Name].c_str())));
+            m_Syst_HistPath_map[Syst_Name] = settings.GetValue(prefix+"Hist","");
+            m_Syst_Hist_map[Syst_Name] = std::unique_ptr<TH2>(dynamic_cast<TH2*>(data_file->Get(m_Syst_HistPath_map[Syst_Name].c_str())));
             m_Syst_Hist_map[Syst_Name]->SetDirectory(0);
-
-        }
+	    if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::Comb){//for comb mass we need to read two histograms
+	      m_Syst_HistTAPath_map[Syst_Name] = settings.GetValue(prefix+"HistTA","");
+	      if(m_Syst_HistTAPath_map[Syst_Name]!=""){
+		m_Syst_HistTA_map[Syst_Name] = std::unique_ptr<TH2>(dynamic_cast<TH2*>(data_file->Get(m_Syst_HistTAPath_map[Syst_Name].c_str())));
+		m_Syst_HistTA_map[Syst_Name]->SetDirectory(0);
+	      }
+	    }      
+	}
     }
 
     data_file->Close();
@@ -374,8 +402,8 @@ StatusCode FFJetSmearingTool::readFFJetSmearingToolSimplifiedData(TEnv& settings
         return StatusCode::FAILURE;
     }
 
-    m_caloMassWeight = std::make_unique<TH3F>(*dynamic_cast<TH3F*>(Calo_TA_weight_file->Get(Calo_weight_hist_name)));
-    m_TAMassWeight = std::make_unique<TH3F>(*dynamic_cast<TH3F*>(Calo_TA_weight_file->Get(TA_weight_hist_name)));
+    m_caloMassWeight = std::unique_ptr<TH3F>(dynamic_cast<TH3F*>(Calo_TA_weight_file->Get(Calo_weight_hist_name)));
+    m_TAMassWeight = std::unique_ptr<TH3F>(dynamic_cast<TH3F*>(Calo_TA_weight_file->Get(TA_weight_hist_name)));
 
     m_caloMassWeight->SetDirectory(0);
     m_TAMassWeight->SetDirectory(0);//To keep it open when we close the .root file
@@ -407,7 +435,7 @@ StatusCode FFJetSmearingTool::getMatchedTruthJet(xAOD::Jet& jet_reco, xAOD::Jet&
 
     //Loop over the truth jets in the event to match
     const xAOD::Jet* close_jet = nullptr;
-    for (const auto jet_truth : *jets_truth) {
+    for (const auto& jet_truth : *jets_truth) {
         float dR_Test = jet_reco.p4().DeltaR(jet_truth->p4());
         if ( dR_Test < dRmax_truthJet){
             if(dR_Test < dRmin){
@@ -479,20 +507,22 @@ LargeRJetTruthLabel::TypeEnum jetTruthLabel = LargeRJetTruthLabel::intToEnum(acc
 //-----------------------------------------------------------------------------
 // The function "getJMSJMR" read the JMS and JMR uncertainties associated with the systematic 
 //-----------------------------------------------------------------------------
-
 StatusCode FFJetSmearingTool::getJMSJMR( xAOD::Jet& jet_reco, double jet_mass_value, JetTools::FFJetAllowedMassDefEnum MassDef_of_syst, std::string jetTopology, double& JMS_err,  double& JMR_err) const{
 
     //JMS/JMR systematic variations
     JMS_err=0;
     JMR_err=0;
 
-    if(m_Syst_MassDefAffected_map.at(m_currentSysData->SysBaseName) ==  JetTools::enumToString(MassDef_of_syst)){
-        ATH_MSG_VERBOSE("This uncertainty affects to the " << JetTools::enumToString(MassDef_of_syst) << " mass");
+    //Some variables to simplify the logic in the "if" structure found below
+    auto calo = JetTools::FFJetAllowedMassDefEnum::Calo;
+    auto ta = JetTools::FFJetAllowedMassDefEnum::TA;
+    auto massAffectedSys = m_Syst_MassDefAffected_map.at(m_currentSysData->SysBaseName);
+
+    if(m_Syst_MassDefAffected_map.at(m_currentSysData->SysBaseName) ==  JetTools::enumToString(MassDef_of_syst) || massAffectedSys ==  JetTools::enumToString(JetTools::FFJetAllowedMassDefEnum::Comb) ){
+      ATH_MSG_VERBOSE("This uncertainty affects to the " << JetTools::enumToString(MassDef_of_syst) << " mass");
     } //Only apply the systematic to the proper mass definition
     else{return StatusCode::SUCCESS;}
 
-
-
     if(m_Syst_TopologyAffected_map.at(m_currentSysData->SysBaseName) != "All" && m_Syst_TopologyAffected_map.at(m_currentSysData->SysBaseName) != jetTopology){
         ATH_MSG_VERBOSE("The systematic do not affects to this jet topology");
         return StatusCode::SUCCESS;
@@ -502,24 +532,44 @@ StatusCode FFJetSmearingTool::getJMSJMR( xAOD::Jet& jet_reco, double jet_mass_va
     float jet_mass = jet_mass_value*m_MeVtoGeV;//jet_reco->m()*m_MeVtoGeV; The TA mass can not be extracted this way
     float jet_pT = jet_reco.pt()*m_MeVtoGeV;
 
-
     if(m_Syst_Affects_JMSorJMR.at(m_currentSysData->SysBaseName) == "JMS"){
-
-        JMS_err=m_Syst_Hist_map.at(m_currentSysData->SysBaseName)->GetBinContent(m_Syst_Hist_map.at(m_currentSysData->SysBaseName)->GetXaxis()->FindBin(jet_pT),m_Syst_Hist_map.at(m_currentSysData->SysBaseName)->GetYaxis()->FindBin(jet_mass)) * m_currentSysData->SysParameter;
-
         JMR_err= 0;
-    }
 
-    if(m_Syst_Affects_JMSorJMR.at(m_currentSysData->SysBaseName) == "JMR"){
+        const TH2* hist = nullptr; //This variable will contain the pointer to the proper histogram to use in the interpolation
 
-        JMS_err=0;
-        JMR_err= m_Syst_Hist_map.at(m_currentSysData->SysBaseName)->GetBinContent(m_Syst_Hist_map.at(m_currentSysData->SysBaseName)->GetXaxis()->FindBin(jet_pT),m_Syst_Hist_map.at(m_currentSysData->SysBaseName)->GetYaxis()->FindBin(jet_mass)) * m_currentSysData->SysParameter;
+        if(m_Syst_MassDefAffected_map.at(m_currentSysData->SysBaseName)== JetTools::enumToString(calo) || massAffectedSys== JetTools::enumToString(ta) ){//TA and Calo mass defs take values from one hisogram only
+
+            hist = m_Syst_Hist_map.at(m_currentSysData->SysBaseName).get();
+        }
+        else if(m_Syst_MassDefAffected_map.at(m_currentSysData->SysBaseName)==JetTools::enumToString(JetTools::FFJetAllowedMassDefEnum::Comb) ){//Comb mass defs can take values from two histograms, depending ifits Calo- or TA- part is affected
+            if(MassDef_of_syst==calo)
+                hist = m_Syst_Hist_map.at(m_currentSysData->SysBaseName).get();
+            else if(MassDef_of_syst==ta)
+                hist = m_Syst_HistTA_map.at(m_currentSysData->SysBaseName).get();
+        }
+        JMS_err = FFJetSmearingTool::Interpolate2D(hist, jet_pT, jet_mass) * m_currentSysData->SysParameter;
     }
 
+    else if(m_Syst_Affects_JMSorJMR.at(m_currentSysData->SysBaseName) == "JMR"){           
+	JMS_err=0;
 
+        const TH2* hist = nullptr;
 
+	if(m_Syst_MassDefAffected_map.at(m_currentSysData->SysBaseName)== JetTools::enumToString(calo) || massAffectedSys== JetTools::enumToString(ta) ){//TA and Calo mass defs take values from one hisogram only
 
+            hist = m_Syst_Hist_map.at(m_currentSysData->SysBaseName).get();
+        }
+
+        else if(m_Syst_MassDefAffected_map.at(m_currentSysData->SysBaseName)==JetTools::enumToString(JetTools::FFJetAllowedMassDefEnum::Comb) ){//Comb mass defs can take values from two histograms, depending ifits Calo- or TA- part is affected
+	    if(MassDef_of_syst==calo)
+                hist = m_Syst_Hist_map.at(m_currentSysData->SysBaseName).get();
+	    else if(MassDef_of_syst==ta)
+                hist = m_Syst_HistTA_map.at(m_currentSysData->SysBaseName).get();
+        }
+        JMR_err = FFJetSmearingTool::Interpolate2D(hist, jet_pT, jet_mass) * m_currentSysData->SysParameter; 
+    }
 
+    
     ATH_MSG_DEBUG("Systematic applied: " << m_currentSysData->SysBaseName);
 
     ATH_MSG_VERBOSE("JMS_err: " << JMS_err);
@@ -599,7 +649,6 @@ CP::CorrectionCode FFJetSmearingTool::applyCorrection( xAOD::Jet& jet_reco) cons
 
         jet_mass_CALO = jet_reco_CALO.mass();
         jet_mass_TA = jet_reco_TA.mass();
-
         jet_reco.getAttribute<float>("JetTrackAssistedMassCalibrated", JetTrackAssistedMassCalibrated_from_JetCalibTools);
     }
     if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::Calo){
@@ -608,6 +657,7 @@ CP::CorrectionCode FFJetSmearingTool::applyCorrection( xAOD::Jet& jet_reco) cons
     }
     else if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::TA){
         jet_mass_TA = jet_reco.m();
+	jet_reco.getAttribute<float>("JetTrackAssistedMassCalibrated", JetTrackAssistedMassCalibrated_from_JetCalibTools);
         calo_mass_weight = 0;
     }
 
@@ -621,23 +671,14 @@ CP::CorrectionCode FFJetSmearingTool::applyCorrection( xAOD::Jet& jet_reco) cons
 
     if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::Comb || m_MassDef==JetTools::FFJetAllowedMassDefEnum::Calo){
 
-        if(m_CALO_ResponseMap->GetBinContent(m_CALO_ResponseMap->GetXaxis()->FindBin(jet_reco.pt()*m_MeVtoGeV),m_CALO_ResponseMap->GetYaxis()->FindBin(jet_truth_matched.m()*m_MeVtoGeV)) == 0){//If we look outside the Th2 histogram, we would obtain a 0 so we apply the nominal response (1)
-        avg_response_CALO=1;
-        }
-        else{
-            avg_response_CALO = m_CALO_ResponseMap->GetBinContent(m_CALO_ResponseMap->GetXaxis()->FindBin(jet_reco.pt()*m_MeVtoGeV),m_CALO_ResponseMap->GetYaxis()->FindBin(jet_truth_matched.m()*m_MeVtoGeV));
-        }
+        avg_response_CALO = FFJetSmearingTool::Interpolate2D(m_CALO_ResponseMap.get(), jet_reco.pt()*m_MeVtoGeV, jet_truth_matched.m()*m_MeVtoGeV);
+        if(avg_response_CALO==0) avg_response_CALO=1;//If we look outside the Th2 histogram, we would obtain a 0 so we apply the nominal response (1)
     }
 
     if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::Comb || m_MassDef==JetTools::FFJetAllowedMassDefEnum::TA){
 
-        if(m_TA_ResponseMap->GetBinContent(m_TA_ResponseMap->GetXaxis()->FindBin(jet_reco.pt()*m_MeVtoGeV),m_TA_ResponseMap->GetYaxis()->FindBin(jet_truth_matched.m()*m_MeVtoGeV))==0){
-
-            avg_response_TA=1;
-        }
-        else{           
-            avg_response_TA = m_TA_ResponseMap->GetBinContent(m_TA_ResponseMap->GetXaxis()->FindBin(jet_reco.pt()*m_MeVtoGeV),m_TA_ResponseMap->GetYaxis()->FindBin(jet_truth_matched.m()*m_MeVtoGeV));
-        }
+        avg_response_TA = FFJetSmearingTool::Interpolate2D(m_TA_ResponseMap.get(), jet_reco.pt()*m_MeVtoGeV, jet_truth_matched.m()*m_MeVtoGeV);
+        if(avg_response_TA==0) avg_response_TA = 1;
     }
 
 
@@ -657,7 +698,7 @@ CP::CorrectionCode FFJetSmearingTool::applyCorrection( xAOD::Jet& jet_reco) cons
 
         if(!(getJMSJMR( jet_reco, jet_mass_CALO, JetTools::FFJetAllowedMassDefEnum::Calo,jetTopology, JMS_err, JMR_err)).isSuccess()){
             return CP::CorrectionCode::Ok;
-        }	
+        }
 
         scale = JMS + JMS_err;
         resolution = JMR + JMR_err;
@@ -703,7 +744,6 @@ CP::CorrectionCode FFJetSmearingTool::applyCorrection( xAOD::Jet& jet_reco) cons
 
 
     //Recalculate the weights after the smearing
-
     if(m_MassDef==JetTools::FFJetAllowedMassDefEnum::Comb && JetTrackAssistedMassCalibrated_from_JetCalibTools != 0 && jet_mass_CALO != 0){
                                         //we check that JetTrackAssistedMassCalibrated_from_JetCalibTools != 0 instead of jet_mass_TA != 0 becuase
                                         //there is a problem in the conversion between the mass itself and the four-vector representation (due to a
@@ -733,7 +773,7 @@ CP::CorrectionCode FFJetSmearingTool::applyCorrection( xAOD::Jet& jet_reco) cons
 
         TARes=FFJetSmearingTool::Read3DHistogram(m_TAMassWeight.get() ,jet_reco_TA.e()*m_MeVtoGeV,TMath::Log(jet_reco_TA.M()/jet_reco_TA.e()),std::abs(jet_reco_TA.eta()));
 
-        //The histograms with the weights that we are reading was deffined with the code "e_LOGmOe_eta" what means that each axis correspond to:
+        //The histograms with the weights that we are reading were defined with the code "e_LOGmOe_eta" which means that each axis correspond to:
         //-X: Jet Energy
         //-Y: Log(Jet_Energy/Jet_mass)
         //-Z:Eta
@@ -750,13 +790,12 @@ CP::CorrectionCode FFJetSmearingTool::applyCorrection( xAOD::Jet& jet_reco) cons
             TAFactor   = 1./(TARes*TARes);
         }
 
-
         calo_mass_weight = caloFactor /(caloFactor + TAFactor);
 
         ATH_MSG_VERBOSE(" Map Calo weight = " << calo_mass_weight  );
         ATH_MSG_VERBOSE(" Map TA weight = " << 1 - calo_mass_weight  );
     }
-    else if( JetTrackAssistedMassCalibrated_from_JetCalibTools == 0){calo_mass_weight = 1;}
+    else if(JetTrackAssistedMassCalibrated_from_JetCalibTools == 0){calo_mass_weight = 1;}
     else if(jet_mass_CALO == 0){calo_mass_weight = 0;}
 
     double smeared_mass = calo_mass_weight*smeared_CALO_mass + (1 - calo_mass_weight)*smeared_TA_mass;
@@ -766,15 +805,11 @@ CP::CorrectionCode FFJetSmearingTool::applyCorrection( xAOD::Jet& jet_reco) cons
 
     xAOD::JetFourMom_t p4 = jet_reco.jetP4();
 
-
     p4 = xAOD::JetFourMom_t(jet_reco.pt(),jet_reco.eta(),jet_reco.phi(),smeared_mass);
     jet_reco.setJetP4(p4);
 
 
-    ATH_MSG_VERBOSE("Smeared Reco Jet: pt = " << jet_reco.pt() << ", mass = " << jet_reco.m() << ", eta = " << jet_reco.eta());
-	
-
-
+    ATH_MSG_VERBOSE("Smeared Reco Jet: pt = " << jet_reco.pt() << ", mass = " << jet_reco.m() << ", eta = " << jet_reco.eta());	
 
     ATH_MSG_VERBOSE("//---------------------------------------------------------------//");
 
@@ -851,4 +886,18 @@ double FFJetSmearingTool::Read3DHistogram(const TH3* histo, double x, double y,
   return weight;
 }
 
+double FFJetSmearingTool::Interpolate2D(const TH2* histo, double x, double y) const //The function in JetHelpers can not be used because it needs a TH1 and we use TH2 histograms. We define our own function.
+{
+    Int_t bin_x = histo->GetXaxis()->FindFixBin(x);
+    Int_t bin_y = histo->GetYaxis()->FindFixBin(y);
+    if(bin_x<1 || bin_x>histo->GetNbinsX() || bin_y<1 || bin_y>histo->GetNbinsY()) {
+       ATH_MSG_VERBOSE("The point is outside the histogram domain.");
+       return 0;
+    }
+    
+    double interpolated_value = JetHelpers::Interpolate(histo, x, y);
+    return interpolated_value;
+}
+
+
 } // namespace CP
-- 
GitLab


From 7f90a171350924d41dee8e12d1ca0f6df834d649 Mon Sep 17 00:00:00 2001
From: Johannes Josef Junggeburth <johannes.josef.junggeburth@cern.ch>
Date: Mon, 20 Sep 2021 18:07:19 +0200
Subject: [PATCH 213/347] MuonCombinedAlgs - Make the MuonCreator alg reentrant

---
 .../MuonCombinedAlgs/src/MuonCreatorAlg.cxx   |  83 +++++----
 .../MuonCombinedAlgs/src/MuonCreatorAlg.h     |   8 +-
 .../src/MuonCreatorTool.cxx                   | 169 ++++++++----------
 .../src/MuonCreatorTool.h                     |  28 +--
 .../IMuonCreatorTool.h                        |  61 +++----
 5 files changed, 174 insertions(+), 175 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCreatorAlg.cxx b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCreatorAlg.cxx
index 904cd5d0492d..81366ee81e1d 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCreatorAlg.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCreatorAlg.cxx
@@ -24,7 +24,7 @@ namespace {
     constexpr const double MeVtoGeV = 1 / Gaudi::Units::GeV;
 }
 
-MuonCreatorAlg::MuonCreatorAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator) {}
+MuonCreatorAlg::MuonCreatorAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator) {}
 
 StatusCode MuonCreatorAlg::initialize() {
     ATH_CHECK(m_muonCreatorTool.retrieve());
@@ -72,117 +72,124 @@ StatusCode MuonCreatorAlg::initialize() {
     return StatusCode::SUCCESS;
 }
 
-StatusCode MuonCreatorAlg::execute() {
+StatusCode MuonCreatorAlg::execute(const EventContext& ctx) const {
     const InDetCandidateCollection* indetCandidateCollection = nullptr;
     std::vector<const MuonCombined::InDetCandidateToTagMap*> tagMaps;
     if (!m_doSA) {
-        SG::ReadHandle<InDetCandidateCollection> indetRH(m_indetCandidateCollectionName);
+        SG::ReadHandle<InDetCandidateCollection> indetRH(m_indetCandidateCollectionName, ctx);
         if (!indetRH.isValid()) {
             ATH_MSG_ERROR("Could not read " << m_indetCandidateCollectionName);
             return StatusCode::FAILURE;
         } else {
             indetCandidateCollection = indetRH.cptr();
         }
-        std::vector<SG::ReadHandle<MuonCombined::InDetCandidateToTagMap> > mapHandles = m_tagMaps.makeHandles();
+        std::vector<SG::ReadHandle<MuonCombined::InDetCandidateToTagMap> > mapHandles = m_tagMaps.makeHandles(ctx);
         for (auto& h : mapHandles) tagMaps.push_back(h.cptr());
     }
 
     // Create the xAOD container and its auxiliary store:
-    SG::WriteHandle<xAOD::MuonContainer> wh_muons(m_muonCollectionName);
+    SG::WriteHandle<xAOD::MuonContainer> wh_muons(m_muonCollectionName, ctx);
     ATH_CHECK(wh_muons.record(std::make_unique<xAOD::MuonContainer>(), std::make_unique<xAOD::MuonAuxContainer>()));
     ATH_MSG_DEBUG("Recorded Muons with key: " << m_muonCollectionName.key());
     MuonCombined::IMuonCreatorTool::OutputData output(*(wh_muons.ptr()));
 
     // Create and record track particles:
     // combined tracks
-    SG::WriteHandle<xAOD::TrackParticleContainer> wh_combtp(m_combinedCollectionName);
-    SG::WriteHandle<TrackCollection> wh_combtrk(m_combinedTrkCollectionName);
+    SG::WriteHandle<xAOD::TrackParticleContainer> wh_combtp(m_combinedCollectionName, ctx);
+    SG::WriteHandle<TrackCollection> wh_combtrk(m_combinedTrkCollectionName, ctx);
     ATH_CHECK(wh_combtp.record(std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>()));
     ATH_CHECK(wh_combtrk.record(std::make_unique<TrackCollection>()));
     output.combinedTrackParticleContainer = wh_combtp.ptr();
     output.combinedTrackCollection = wh_combtrk.ptr();
 
     // extrapolated tracks
-    SG::WriteHandle<xAOD::TrackParticleContainer> wh_extrtp(m_extrapolatedCollectionName);
-    SG::WriteHandle<TrackCollection> wh_extrtrk(m_extrapolatedTrkCollectionName);
+    SG::WriteHandle<xAOD::TrackParticleContainer> wh_extrtp(m_extrapolatedCollectionName, ctx);
+    SG::WriteHandle<TrackCollection> wh_extrtrk(m_extrapolatedTrkCollectionName, ctx);
     ATH_CHECK(wh_extrtp.record(std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>()));
     ATH_CHECK(wh_extrtrk.record(std::make_unique<TrackCollection>()));
     output.extrapolatedTrackParticleContainer = wh_extrtp.ptr();
     output.extrapolatedTrackCollection = wh_extrtrk.ptr();
 
     // msonly tracks
-    SG::WriteHandle<xAOD::TrackParticleContainer> wh_msextrtp(m_msOnlyExtrapolatedCollectionName);
-    SG::WriteHandle<TrackCollection> wh_msextrtrk(m_msOnlyExtrapolatedTrkCollectionName);
+    SG::WriteHandle<xAOD::TrackParticleContainer> wh_msextrtp(m_msOnlyExtrapolatedCollectionName, ctx);
+    SG::WriteHandle<TrackCollection> wh_msextrtrk(m_msOnlyExtrapolatedTrkCollectionName, ctx);
     ATH_CHECK(wh_msextrtp.record(std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>()));
     ATH_CHECK(wh_msextrtrk.record(std::make_unique<TrackCollection>()));
     output.msOnlyExtrapolatedTrackParticleContainer = wh_msextrtp.ptr();
     output.msOnlyExtrapolatedTrackCollection = wh_msextrtrk.ptr();
 
     // segments
-    SG::WriteHandle<xAOD::MuonSegmentContainer> wh_segment(m_segContainerName);
+    SG::WriteHandle<xAOD::MuonSegmentContainer> wh_segment(m_segContainerName, ctx);
     ATH_CHECK(wh_segment.record(std::make_unique<xAOD::MuonSegmentContainer>(), std::make_unique<xAOD::MuonSegmentAuxContainer>()));
     output.xaodSegmentContainer = wh_segment.ptr();
-    SG::WriteHandle<Trk::SegmentCollection> wh_segmentTrk(m_segTrkContainerName);
+    SG::WriteHandle<Trk::SegmentCollection> wh_segmentTrk(m_segTrkContainerName, ctx);
     ATH_CHECK(wh_segmentTrk.record(std::make_unique<Trk::SegmentCollection>()));
     output.muonSegmentCollection = wh_segmentTrk.ptr();
     if (m_copySegs) {
         // now copy the input segments to the final container
-        SG::ReadHandle<Trk::SegmentCollection> inputSegs(m_inputSegContainerName);
+        SG::ReadHandle<Trk::SegmentCollection> inputSegs(m_inputSegContainerName, ctx);
         if (inputSegs.isValid()) {
-            for (auto it = inputSegs->begin(); it != inputSegs->end(); ++it) {
+            for (const Trk::Segment* seg : *inputSegs) {
                 // have to cast because the collection stores Trk::Segments
-                const Muon::MuonSegment* muonSegment = dynamic_cast<const Muon::MuonSegment*>(&(**it));
+                const Muon::MuonSegment* muonSegment = dynamic_cast<const Muon::MuonSegment*>(seg);
                 if (muonSegment) wh_segmentTrk->push_back(new Muon::MuonSegment(*muonSegment));
             }
         }
         // now convert
         unsigned int index = 0;
-        for (auto it = wh_segmentTrk->begin(); it != wh_segmentTrk->end(); ++it, ++index) {
+        for (const Trk::Segment* seg: *wh_segmentTrk) {
             // have to cast because the collection stores Trk::Segments
-            const Muon::MuonSegment* muonSegment = dynamic_cast<const Muon::MuonSegment*>(&(**it));
-            if (!muonSegment) continue;
+            const Muon::MuonSegment* muonSegment = dynamic_cast<const Muon::MuonSegment*>(seg);
+            if (!muonSegment) {
+                ++index;
+                continue;
+            }
             ElementLink<Trk::SegmentCollection> link(*wh_segmentTrk, index);
+            ++index;
             m_muonSegmentConverterTool->convert(link, wh_segment.ptr());
         }
     }
 
     // calo clusters
-    SG::WriteHandle<xAOD::CaloClusterContainer> wh_clusters;
-    SG::WriteHandle<CaloClusterCellLinkContainer> wh_clusterslink;
+    std::unique_ptr<xAOD::CaloClusterContainer> caloclusters{nullptr}; 
+    std::unique_ptr<xAOD::CaloClusterAuxContainer> caloclustersaux{nullptr};
+        
     if (m_makeClusters) {
-        xAOD::CaloClusterContainer* caloclusters = new xAOD::CaloClusterContainer();
-        xAOD::CaloClusterAuxContainer* caloclustersaux = new xAOD::CaloClusterAuxContainer();
-        caloclusters->setStore(caloclustersaux);
-        wh_clusters = SG::WriteHandle<xAOD::CaloClusterContainer>(m_clusterContainerName);
-        wh_clusterslink = SG::WriteHandle<CaloClusterCellLinkContainer>(m_clusterContainerLinkName);
-        ATH_CHECK(wh_clusters.record(std::unique_ptr<xAOD::CaloClusterContainer>(caloclusters),
-                                     std::unique_ptr<xAOD::CaloClusterAuxContainer>(caloclustersaux)));
-        output.clusterContainer = wh_clusters.ptr();
+        caloclusters = std::make_unique< xAOD::CaloClusterContainer>();
+        caloclustersaux = std::make_unique<xAOD::CaloClusterAuxContainer>();
+        caloclusters->setStore(caloclustersaux.get());        
+        output.clusterContainer = caloclusters.get();
     }
 
     const MuonCandidateCollection* muonCandidateCollection = nullptr;
 
     SG::WriteHandle<xAOD::SlowMuonContainer> wh_slowmuon;
     if (m_buildSlowMuon) {
-        wh_slowmuon = SG::WriteHandle<xAOD::SlowMuonContainer>(m_slowMuonCollectionName);
-        ATH_CHECK(wh_slowmuon.record(std::make_unique<xAOD::SlowMuonContainer>(), std::make_unique<xAOD::SlowMuonAuxContainer>()));
+        wh_slowmuon = SG::WriteHandle<xAOD::SlowMuonContainer>(m_slowMuonCollectionName,ctx);
+        ATH_CHECK(wh_slowmuon.record(std::make_unique<xAOD::SlowMuonContainer>(), std::make_unique<xAOD::SlowMuonAuxContainer>() ));
         output.slowMuonContainer = wh_slowmuon.ptr();
     } else {
-        SG::ReadHandle<MuonCandidateCollection> muonCandidateRH(m_muonCandidateCollectionName);
+        SG::ReadHandle<MuonCandidateCollection> muonCandidateRH(m_muonCandidateCollectionName,ctx);
         if (!muonCandidateRH.isValid()) {
             ATH_MSG_ERROR("Could not read " << m_muonCandidateCollectionName);
             return StatusCode::FAILURE;
         }
         muonCandidateCollection = muonCandidateRH.cptr();
     }
-
-    m_muonCreatorTool->create(muonCandidateCollection, indetCandidateCollection, tagMaps, output);
-
+    m_muonCreatorTool->create(ctx, muonCandidateCollection, indetCandidateCollection, tagMaps, output);
+    
+    
     if (m_makeClusters) {
-        CaloClusterCellLinkContainer* clusterlinks = new CaloClusterCellLinkContainer();
+        SG::WriteHandle<CaloClusterCellLinkContainer> wh_clusterslink {m_clusterContainerLinkName,ctx};
+        SG::WriteHandle<xAOD::CaloClusterContainer> wh_clusters {m_clusterContainerName, ctx};
+        std::unique_ptr<CaloClusterCellLinkContainer> clusterlinks = std::make_unique<CaloClusterCellLinkContainer>();
         auto *sg = wh_clusters.storeHandle().get();
-        for (xAOD::CaloCluster* cl : *(wh_clusters.ptr())) { cl->setLink(clusterlinks, sg); }
-        ATH_CHECK(wh_clusterslink.record(std::unique_ptr<CaloClusterCellLinkContainer>(clusterlinks)));
+        for (xAOD::CaloCluster* cl : *output.clusterContainer) { 
+            cl->setLink(clusterlinks.get(), sg);
+        }
+        ATH_CHECK(wh_clusterslink.record(std::move(clusterlinks)));
+        ATH_CHECK(wh_clusters.record(std::move(caloclusters),
+                                     std::move(caloclustersaux)));
     }
 
     //---------------------------------------------------------------------------------------------------------------------//
diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCreatorAlg.h b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCreatorAlg.h
index 99c4e56be6c2..ae81b68e5410 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCreatorAlg.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCreatorAlg.h
@@ -7,6 +7,7 @@
 
 #include <string>
 
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "AthenaMonitoringKernel/GenericMonitoringTool.h"
 #include "AthenaMonitoringKernel/Monitored.h"
@@ -25,14 +26,15 @@
 #include "xAODMuonCnv/IMuonSegmentConverterTool.h"
 #include "xAODTracking/TrackParticleContainer.h"
 
-class MuonCreatorAlg : public AthAlgorithm {
+class MuonCreatorAlg : public AthReentrantAlgorithm {
 public:
     MuonCreatorAlg(const std::string& name, ISvcLocator* pSvcLocator);
 
     ~MuonCreatorAlg() = default;
 
-    StatusCode initialize();
-    StatusCode execute();
+    virtual StatusCode initialize() override;
+    virtual StatusCode execute(const EventContext& ctx) const override;
+    
 
 private:
     ToolHandle<MuonCombined::IMuonCreatorTool> m_muonCreatorTool{this, "MuonCreatorTool", "MuonCombined::MuonCreatorTool/MuonCreatorTool",
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx
index eb48d296be0b..af426db5323b 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx
@@ -126,7 +126,8 @@ namespace MuonCombined {
         return StatusCode::SUCCESS;
     }
 
-    void MuonCreatorTool::create(const MuonCandidateCollection* muonCandidates, const InDetCandidateCollection* inDetCandidates,
+    void MuonCreatorTool::create(const EventContext& ctx, 
+                                const MuonCandidateCollection* muonCandidates, const InDetCandidateCollection* inDetCandidates,
                                  std::vector<const InDetCandidateToTagMap*> tagMaps, OutputData& outputData) const {
         unsigned int numIdCan = inDetCandidates ? inDetCandidates->size() : 0;
         unsigned int numMuCan = muonCandidates ? muonCandidates->size() : 0;
@@ -139,7 +140,7 @@ namespace MuonCombined {
 
         // Resolve Overlap
         if (!m_buildStauContainer)
-            resolveOverlaps(inDetCandidates, muonCandidates, tagMaps, resolvedInDetCandidates, resolvedMuonCandidates);
+            resolveOverlaps(ctx, inDetCandidates, muonCandidates, tagMaps, resolvedInDetCandidates, resolvedMuonCandidates);
         else
             selectStaus(inDetCandidates, resolvedInDetCandidates, tagMaps);
 
@@ -151,9 +152,9 @@ namespace MuonCombined {
                                                                << " out");
 
         // Create a container for resolved candidates (always of type VIEW_ELEMENTS)
-        for (InDetCandidateTags can : resolvedInDetCandidates) {
+        for (InDetCandidateTags& can : resolvedInDetCandidates) {
             ATH_MSG_DEBUG("New InDetCandidate");
-            xAOD::Muon* muon = create(can, outputData);
+            xAOD::Muon* muon = create(ctx, can, outputData);
             if (!muon) {
                 ATH_MSG_DEBUG("no muon found");
             } else {
@@ -168,7 +169,7 @@ namespace MuonCombined {
         if (!m_requireIDTracks) {  // only build SA muons if ID tracks are not required
             for (const auto* can : resolvedMuonCandidates) {
                 ATH_MSG_DEBUG("New MuonCandidate");
-                create(*can, outputData);
+                create(ctx, *can, outputData);
                 ATH_MSG_DEBUG("Creation of Muon from MuonCandidates done");
             }
         }
@@ -179,7 +180,7 @@ namespace MuonCombined {
             if (outputData.extrapolatedTrackParticleContainer) addAlignmentEffectsOnTrack(outputData.extrapolatedTrackParticleContainer);
             if (outputData.msOnlyExtrapolatedTrackParticleContainer)
                 addAlignmentEffectsOnTrack(outputData.msOnlyExtrapolatedTrackParticleContainer);
-            for (auto mu : *outputData.muonContainer) {
+            for (xAOD::Muon* mu : *outputData.muonContainer) {
                 if (mu->primaryTrackParticle() == mu->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)) continue;  // no CT or ST muons
                 if (mu->primaryTrackParticle() == mu->trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle))
                     continue;  // no SA muons w/o ME tracks
@@ -315,8 +316,8 @@ namespace MuonCombined {
         }
     }
 
-    xAOD::Muon* MuonCreatorTool::create(const MuonCandidate& candidate, OutputData& outputData) const {
-        const EventContext& ctx = Gaudi::Hive::currentContext();
+    xAOD::Muon* MuonCreatorTool::create(const EventContext& ctx,        
+                                        const MuonCandidate& candidate, OutputData& outputData) const {
         // skip all muons without extrapolated track
         if (!candidate.extrapolatedTrack()) {
             ATH_MSG_DEBUG(
@@ -328,14 +329,14 @@ namespace MuonCombined {
         // Create the xAOD object:
         xAOD::Muon* muon = new xAOD::Muon();
         outputData.muonContainer->push_back(muon);
-        decorateDummyValues(*muon, outputData);
+        decorateDummyValues(ctx, *muon, outputData);
 
         muon->setAuthor(xAOD::Muon::MuidSA);
         muon->setMuonType(xAOD::Muon::MuonStandAlone);
         muon->addAllAuthor(xAOD::Muon::MuidSA);
 
         // create candidate from SA muon only
-        addMuonCandidate(candidate, *muon, outputData);
+        addMuonCandidate(ctx, candidate, *muon, outputData);
 
         if (!muon->extrapolatedMuonSpectrometerTrackParticleLink().isValid()) {
             ATH_MSG_DEBUG("Creation of track particle for SA muon failed, removing it");
@@ -370,16 +371,16 @@ namespace MuonCombined {
 
         // check if there is a cluster container, if yes collect the cells around the
         // muon and fill Etcore variables for muon
-        if (m_useCaloCells) collectCells(*muon, outputData.clusterContainer, caloExtension.get());
+        if (m_useCaloCells) collectCells(ctx, *muon, outputData.clusterContainer, caloExtension.get());
 
         return muon;
     }
 
-    void MuonCreatorTool::decorateDummyValues(xAOD::Muon& muon, OutputData& outputData) const {
+    void MuonCreatorTool::decorateDummyValues(const EventContext& ctx, xAOD::Muon& muon, OutputData& outputData) const {
         // Set variables to zero by calling the functions with null pointers.
         addCaloTag(muon, nullptr);
-        addCombinedFit(muon, nullptr, outputData);
-        addStatisticalCombination(muon, nullptr, nullptr, outputData);
+        addCombinedFit(ctx, muon, nullptr, outputData);
+        addStatisticalCombination(ctx, muon, nullptr, nullptr, outputData);
         addMuGirl(muon, nullptr, outputData);
         addSegmentTag(muon, nullptr, outputData);
 
@@ -405,7 +406,7 @@ namespace MuonCombined {
 
         fillEnergyLossFromTrack(muon, nullptr);
     }
-    xAOD::Muon* MuonCreatorTool::create(InDetCandidateTags& candidate, OutputData& outputData) const {
+    xAOD::Muon* MuonCreatorTool::create(const EventContext& ctx, InDetCandidateTags& candidate, OutputData& outputData) const {
         // no tags, no muon
         if (candidate.second.empty()) {
             ATH_MSG_DEBUG(
@@ -421,7 +422,7 @@ namespace MuonCombined {
             return nullptr;
         }
 
-        std::vector<const TagBase*> tags = candidate.second;
+        std::vector<const TagBase*>& tags = candidate.second;
         if (tags.size() == 1 && !m_buildStauContainer) {
             const MuGirlLowBetaTag* muGirlLowBetaTag = dynamic_cast<const MuGirlLowBetaTag*>(tags[0]);
             if (muGirlLowBetaTag) {
@@ -449,7 +450,7 @@ namespace MuonCombined {
         ATH_MSG_DEBUG("creating Muon with " << tags.size() << " tags ");
         // loop over the tags
 
-        decorateDummyValues(*muon, outputData);
+        decorateDummyValues(ctx, *muon, outputData);
         bool first = true;
         for (const MuonCombined::TagBase* tag : tags) {
             ATH_MSG_DEBUG("Handling tag: type " << tag->type());
@@ -509,9 +510,9 @@ namespace MuonCombined {
                     const StacoTag* stacoTag = dynamic_cast<const StacoTag*>(tag);
                     const MuGirlTag* muGirlTag = dynamic_cast<const MuGirlTag*>(tag);
 
-                    addCombinedFit(*muon, cbFitTag, outputData);
+                    addCombinedFit(ctx, *muon, cbFitTag, outputData);
                     addMuGirl(*muon, muGirlTag, outputData);
-                    addStatisticalCombination(*muon, candidate.first, stacoTag, outputData);
+                    addStatisticalCombination(ctx, *muon, candidate.first, stacoTag, outputData);
                     if (!(cbFitTag || stacoTag || muGirlTag)) { ATH_MSG_WARNING("Unknown combined tag "); }
 
                 } else if (type == xAOD::Muon::SegmentTagged) {
@@ -544,23 +545,22 @@ namespace MuonCombined {
         float eLoss = -1;
         bool haveEloss = muon->parameter(eLoss, xAOD::Muon::EnergyLoss);
         if (!haveEloss || eLoss == 0) {
-            ATH_MSG_DEBUG("Adding Energy Loss to muon");
+            ATH_MSG_DEBUG("Adding Energy Loss to muon"<<std::endl<<m_muonPrinter->print(*muon));
             addEnergyLossToMuon(*muon);
-            // ATH_MSG_DEBUG(m_muonPrinter->print(*muon));
         }
 
         // check if there is a cluster container, if yes collect the cells around the
         // muon and fill Etcore variables for muon
-        if (m_useCaloCells) collectCells(*muon, outputData.clusterContainer);
+        if (m_useCaloCells) collectCells(ctx, *muon, outputData.clusterContainer);
 
         ATH_MSG_DEBUG("Done creating muon with " << acc_nUnspoiledCscHits(*muon) << " unspoiled csc hits");
 
         return muon;
     }
 
-    void MuonCreatorTool::addStatisticalCombination(xAOD::Muon& muon, const InDetCandidate* candidate, const StacoTag* tag,
+    void MuonCreatorTool::addStatisticalCombination(const EventContext& ctx, 
+                                                    xAOD::Muon& muon, const InDetCandidate* candidate, const StacoTag* tag,
                                                     OutputData& outputData) const {
-        const EventContext& ctx = Gaudi::Hive::currentContext();
         static const SG::AuxElement::Accessor<float> acc_d0("d0_staco");
         static const SG::AuxElement::Accessor<float> acc_z0("z0_staco");
         static const SG::AuxElement::Accessor<float> acc_phi0("phi0_staco");
@@ -629,7 +629,7 @@ namespace MuonCombined {
             }  // endif outputData.combinedTrackParticleContainer
         }
         // add muon candidate
-        addMuonCandidate(tag->muonCandidate(), muon, outputData);
+        addMuonCandidate(ctx, tag->muonCandidate(), muon, outputData);
 
         // Add inner match chi^2
         muon.setParameter(5, xAOD::Muon::msInnerMatchDOF);
@@ -646,7 +646,7 @@ namespace MuonCombined {
         ATH_MSG_DEBUG("Done adding Staco Muon  " << tag->author() << " type " << tag->type());
     }
 
-    void MuonCreatorTool::addCombinedFit(xAOD::Muon& muon, const CombinedFitTag* tag, OutputData& outputData) const {
+    void MuonCreatorTool::addCombinedFit(const EventContext& ctx, xAOD::Muon& muon, const CombinedFitTag* tag, OutputData& outputData) const {
         if (!tag) {
             // init variables if necessary.
             return;
@@ -670,11 +670,12 @@ namespace MuonCombined {
         }
 
         // add muon candidate
-        addMuonCandidate(tag->muonCandidate(), muon, outputData, tag->updatedExtrapolatedTrackLink());
+        addMuonCandidate(ctx, tag->muonCandidate(), muon, outputData, tag->updatedExtrapolatedTrackLink());
 
         // Add inner match chi^2
-        muon.setParameter(static_cast<int>(tag->matchDoF()), xAOD::Muon::msInnerMatchDOF);
-        muon.setParameter(static_cast<float>(tag->matchChi2()), xAOD::Muon::msInnerMatchChi2);
+        const float inner_chi2  = tag->matchChi2(); 
+        muon.setParameter(tag->matchDoF(), xAOD::Muon::msInnerMatchDOF);
+        muon.setParameter(inner_chi2, xAOD::Muon::msInnerMatchChi2);
 
         ATH_MSG_DEBUG("Done adding Combined Fit Muon  " << tag->author() << " type " << tag->type());
     }
@@ -683,7 +684,6 @@ namespace MuonCombined {
                                            OutputData& outputData) const {
         if (!tag) {
             // init variables if necessary.
-
             return;
         }
 
@@ -830,9 +830,9 @@ namespace MuonCombined {
     void MuonCreatorTool::addSegmentTag(xAOD::Muon& muon, const SegmentTag* tag, OutputData& outputData) const {
         if (!tag) {
             // init variables if necessary.
-            muon.setParameter(static_cast<float>(-1.0), xAOD::Muon::segmentDeltaEta);
-            muon.setParameter(static_cast<float>(-1.0), xAOD::Muon::segmentDeltaPhi);
-            muon.setParameter(static_cast<float>(-1.0), xAOD::Muon::segmentChi2OverDoF);
+            muon.setParameter(-1.f, xAOD::Muon::segmentDeltaEta);
+            muon.setParameter(-1.f, xAOD::Muon::segmentDeltaPhi);
+            muon.setParameter(-1.f, xAOD::Muon::segmentChi2OverDoF);
             return;
         }
 
@@ -873,8 +873,8 @@ namespace MuonCombined {
         if (!tag) {
             // init variables if necessary.
 
-            mu.setParameter(static_cast<float>(0.0), xAOD::Muon::CaloLRLikelihood);
-            mu.setParameter(static_cast<float>(0.0), xAOD::Muon::CaloMuonScore);
+            mu.setParameter(0.f, xAOD::Muon::CaloLRLikelihood);
+            mu.setParameter(0.f, xAOD::Muon::CaloMuonScore);
             mu.setParameter(static_cast<int>(0xFF), xAOD::Muon::CaloMuonIDTag);
             if (m_fillExtraELossInfo) {
                 // Here we can make sure that we store the extra calotag information -
@@ -960,11 +960,11 @@ namespace MuonCombined {
         return ElementLink<xAOD::MuonSegmentContainer>();
     }
 
-    void MuonCreatorTool::addMuonCandidate(const MuonCandidate& candidate, xAOD::Muon& muon, OutputData& outputData,
+    void MuonCreatorTool::addMuonCandidate(const EventContext& ctx,
+                                           const MuonCandidate& candidate, xAOD::Muon& muon, OutputData& outputData,
                                            const ElementLink<TrackCollection>& meLink) const {
         // only set once
         if (muon.muonSpectrometerTrackParticleLink().isValid()) { return; }
-        const EventContext& ctx = Gaudi::Hive::currentContext();
         // case where we have a MuGirl muon that is also reconstructed by STACO: don't
         // want to add this track as it is misleading however, we will still keep the
         // MS-only extrapolated track (see below) for debugging purposes
@@ -1115,7 +1115,9 @@ namespace MuonCombined {
         }
     }
 
-    void MuonCreatorTool::resolveOverlaps(const InDetCandidateCollection* inDetCandidates, const MuonCandidateCollection* muonCandidates,
+    void MuonCreatorTool::resolveOverlaps(const EventContext& ctx ,
+                                          const InDetCandidateCollection* inDetCandidates, 
+                                          const MuonCandidateCollection* muonCandidates,
                                           const std::vector<const InDetCandidateToTagMap*>& tagMaps,
                                           InDetCandidateTagsMap& resolvedInDetCandidates,
                                           std::vector<const MuonCombined::MuonCandidate*>& resolvedMuonCandidates) const {
@@ -1152,7 +1154,7 @@ namespace MuonCombined {
                                         continue;
                                     }
                                     std::unique_ptr<Trk::CaloExtension> caloExtension =
-                                        m_caloExtTool->caloExtension(Gaudi::Hive::currentContext(), *combtp);
+                                        m_caloExtTool->caloExtension(ctx, *combtp);
                                     if (!caloExtension) {
                                         ATH_MSG_WARNING(
                                             "failed to get a calo extension for "
@@ -1183,7 +1185,7 @@ namespace MuonCombined {
                                         continue;
                                     }
                                     std::unique_ptr<Trk::CaloExtension> caloExtension =
-                                        m_caloExtTool->caloExtension(Gaudi::Hive::currentContext(), *combtp);
+                                        m_caloExtTool->caloExtension(ctx, *combtp);
                                     if (!caloExtension) {
                                         ATH_MSG_WARNING(
                                             "failed to get a calo extension for "
@@ -1262,7 +1264,7 @@ namespace MuonCombined {
                     std::vector<const Muon::MuonSegment*> segments = primaryTag->associatedSegments();
                     if (!segments.empty() && candidate.first->indetTrackParticle().trackLink().isValid()) {
                         muonTracks.push_back(
-                            createDummyTrack(primaryTag->associatedSegments(), *(candidate.first->indetTrackParticle().track())));
+                            createDummyTrack(ctx, primaryTag->associatedSegments(), *(candidate.first->indetTrackParticle().track())));
                         trackInDetCandLinks[muonTracks.back()] = candidate;
                     }
                 }
@@ -1347,9 +1349,9 @@ namespace MuonCombined {
         }
     }
 
-    Trk::Track* MuonCreatorTool::createDummyTrack(const std::vector<const Muon::MuonSegment*>& segments,
+    Trk::Track* MuonCreatorTool::createDummyTrack(const EventContext& ctx,
+                                                  const std::vector<const Muon::MuonSegment*>& segments,
                                                   const Trk::Track& indetTrack) const {
-        const EventContext& ctx = Gaudi::Hive::currentContext();
         ATH_MSG_VERBOSE("Creating dummy tracks from segments...");
 
         Trk::TrackStates trackStateOnSurfaces{};
@@ -1587,53 +1589,42 @@ namespace MuonCombined {
     void MuonCreatorTool::fillEnergyLossFromTrack(xAOD::Muon& muon, const std::vector<const Trk::TrackStateOnSurface*>* tsosVector) const {
         // Ensure these are set for every muon
         if (!tsosVector) {
-            muon.setParameter(static_cast<float>(0.0), xAOD::Muon::EnergyLoss);
-            muon.setParameter(static_cast<float>(0.0), xAOD::Muon::ParamEnergyLoss);
-            muon.setParameter(static_cast<float>(0.0), xAOD::Muon::MeasEnergyLoss);
-            muon.setParameter(static_cast<float>(0.0), xAOD::Muon::EnergyLossSigma);
-            muon.setParameter(static_cast<float>(0.0), xAOD::Muon::MeasEnergyLossSigma);
-            muon.setParameter(static_cast<float>(0.0), xAOD::Muon::ParamEnergyLossSigmaPlus);
-            muon.setParameter(static_cast<float>(0.0), xAOD::Muon::ParamEnergyLossSigmaMinus);
+            muon.setParameter(0.f, xAOD::Muon::EnergyLoss);
+            muon.setParameter(0.f, xAOD::Muon::ParamEnergyLoss);
+            muon.setParameter(0.f, xAOD::Muon::MeasEnergyLoss);
+            muon.setParameter(0.f, xAOD::Muon::EnergyLossSigma);
+            muon.setParameter(0.f, xAOD::Muon::MeasEnergyLossSigma);
+            muon.setParameter(0.f, xAOD::Muon::ParamEnergyLossSigmaPlus);
+            muon.setParameter(0.f, xAOD::Muon::ParamEnergyLossSigmaMinus);
 
             muon.setEnergyLossType(xAOD::Muon::Parametrized);  // Not so nice! Add 'unknown' type?
-            muon.setParameter(static_cast<float>(0.0), xAOD::Muon::FSR_CandidateEnergy);
+            muon.setParameter(0.f, xAOD::Muon::FSR_CandidateEnergy);
             if (m_fillExtraELossInfo) acc_numEnergyLossPerTrack(muon) = 0;
 
             return;
         }
 
-        float energyloss = 0.0;
         unsigned int numEnergyLossPerTrack = 0;
         bool problem = false;
         for (const auto* tsos : *tsosVector) {
             const Trk::MaterialEffectsOnTrack* meot = dynamic_cast<const Trk::MaterialEffectsOnTrack*>(tsos->materialEffectsOnTrack());
-            if (meot) {
-                const Trk::EnergyLoss* el = meot->energyLoss();
-                if (false) {
-                    numEnergyLossPerTrack++;
-                    energyloss += el->deltaE();  // FIXME - should we be summing these?
-                    if (el->deltaE() < 0) {
-                        ATH_MSG_WARNING("Found negative energy loss (i.e. energy gain!) for this object: " << (*el));
-                        problem = true;
-                    }
-                }
-
-                const CaloEnergy* caloEnergy = dynamic_cast<const CaloEnergy*>(el);
-                if (caloEnergy) {
-                    numEnergyLossPerTrack++;
-
-                    muon.setParameter(static_cast<float>(caloEnergy->deltaE()), xAOD::Muon::EnergyLoss);
-                    muon.setParameter(static_cast<float>(caloEnergy->deltaEParam()), xAOD::Muon::ParamEnergyLoss);
-                    muon.setParameter(static_cast<float>(caloEnergy->deltaEMeas()), xAOD::Muon::MeasEnergyLoss);
-                    muon.setParameter(static_cast<float>(caloEnergy->sigmaDeltaE()), xAOD::Muon::EnergyLossSigma);
-                    muon.setParameter(static_cast<float>(caloEnergy->sigmaDeltaEMeas()), xAOD::Muon::MeasEnergyLossSigma);
-                    muon.setParameter(static_cast<float>(caloEnergy->sigmaPlusDeltaEParam()), xAOD::Muon::ParamEnergyLossSigmaPlus);
-                    muon.setParameter(static_cast<float>(caloEnergy->sigmaMinusDeltaEParam()), xAOD::Muon::ParamEnergyLossSigmaMinus);
-
-                    muon.setEnergyLossType(static_cast<xAOD::Muon::EnergyLossType>(caloEnergy->energyLossType()));
-                    muon.setParameter(static_cast<float>(caloEnergy->fsrCandidateEnergy()), xAOD::Muon::FSR_CandidateEnergy);
-                }
-            }
+            if (!meot) continue;
+            const Trk::EnergyLoss* el = meot->energyLoss();
+            const CaloEnergy* caloEnergy = dynamic_cast<const CaloEnergy*>(el);
+            if (!caloEnergy) continue;
+            ++numEnergyLossPerTrack;
+
+            muon.setParameter(static_cast<float>(caloEnergy->deltaE()), xAOD::Muon::EnergyLoss);
+            muon.setParameter(static_cast<float>(caloEnergy->deltaEParam()), xAOD::Muon::ParamEnergyLoss);
+            muon.setParameter(static_cast<float>(caloEnergy->deltaEMeas()), xAOD::Muon::MeasEnergyLoss);
+            muon.setParameter(static_cast<float>(caloEnergy->sigmaDeltaE()), xAOD::Muon::EnergyLossSigma);
+            muon.setParameter(static_cast<float>(caloEnergy->sigmaDeltaEMeas()), xAOD::Muon::MeasEnergyLossSigma);
+            muon.setParameter(static_cast<float>(caloEnergy->sigmaPlusDeltaEParam()), xAOD::Muon::ParamEnergyLossSigmaPlus);
+            muon.setParameter(static_cast<float>(caloEnergy->sigmaMinusDeltaEParam()), xAOD::Muon::ParamEnergyLossSigmaMinus);
+
+            muon.setEnergyLossType(static_cast<xAOD::Muon::EnergyLossType>(caloEnergy->energyLossType()));
+            muon.setParameter(static_cast<float>(caloEnergy->fsrCandidateEnergy()), xAOD::Muon::FSR_CandidateEnergy);                
+            
         }
         if (numEnergyLossPerTrack > 1) {
             ATH_MSG_VERBOSE("More than one e loss per track... ");
@@ -1643,10 +1634,10 @@ namespace MuonCombined {
         if (problem) ATH_MSG_VERBOSE("Dumping problematic muon: " << m_muonPrinter->print(muon));
     }
 
-    void MuonCreatorTool::collectCells(xAOD::Muon& muon, xAOD::CaloClusterContainer* clusterContainer,
+    void MuonCreatorTool::collectCells(const EventContext& ctx,
+                                       xAOD::Muon& muon, xAOD::CaloClusterContainer* clusterContainer,
                                        Trk::CaloExtension* inputCaloExt) const {
-        const EventContext& ctx = Gaudi::Hive::currentContext();
-
+    
         const xAOD::TrackParticle* tp = muon.primaryTrackParticle();
         if (!tp || !clusterContainer) {
             if (!tp) ATH_MSG_WARNING("Can not get primary track.");
@@ -1657,8 +1648,8 @@ namespace MuonCombined {
         ATH_MSG_DEBUG(" Selected track: pt " << tp->pt() << " eta " << tp->eta() << " phi " << tp->phi());
 
         xAOD::CaloCluster* cluster = nullptr;
-        SG::ReadHandle<CaloCellContainer> container(m_cellContainerName);
-
+        SG::ReadHandle<CaloCellContainer> container(m_cellContainerName, ctx);
+      
         if (!inputCaloExt) {  // need to make one
             // for some reason, ID tracks need to be extrapolated from the ID exit, and
             // combined from the perigee
@@ -1688,23 +1679,21 @@ namespace MuonCombined {
         }
 
         // create element links
-        ElementLink<xAOD::CaloClusterContainer> clusterLink(*clusterContainer, clusterContainer->size() - 1);
+        ElementLink<xAOD::CaloClusterContainer> clusterLink(*clusterContainer, cluster->index(), ctx);
         muon.setClusterLink(clusterLink);
-
         const CaloNoise* caloNoise = nullptr;
         if (!m_caloNoiseKey.empty()) {
-            SG::ReadCondHandle<CaloNoise> noiseH(m_caloNoiseKey);
+            SG::ReadCondHandle<CaloNoise> noiseH(m_caloNoiseKey, ctx);
             caloNoise = noiseH.cptr();
         }
-
         // collect the core energy
-        std::vector<float> etcore(4, 0);
+        std::vector<float> etcore(4,0);
         m_cellCollector.collectEtCore(*cluster, etcore, caloNoise, m_sigmaCaloNoiseCut);
+        
         acc_ET_Core(muon) = etcore[Rec::CaloCellCollector::ET_Core];
         acc_ET_EMCore(muon) = etcore[Rec::CaloCellCollector::ET_EMCore];
         acc_ET_TileCore(muon) = etcore[Rec::CaloCellCollector::ET_TileCore];
         acc_ET_HECCore(muon) = etcore[Rec::CaloCellCollector::ET_HECCore];
-
         if (m_caloNoiseKey.empty())
             ATH_MSG_DEBUG("NO Tool for calo noise,sigma: " << m_sigmaCaloNoiseCut);
         else
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.h b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.h
index f07c77b18fdc..9a813b16321b 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.h
@@ -57,33 +57,37 @@ namespace MuonCombined {
     class SegmentTag;
     class CaloTag;
 
-    typedef std::vector<InDetCandidateTags> InDetCandidateTagsMap;
 
     class MuonCreatorTool : public AthAlgTool, virtual public IMuonCreatorTool {
     public:
+
+        using InDetCandidateTagsMap = std::vector<InDetCandidateTags>;
+
+
         MuonCreatorTool(const std::string& type, const std::string& name, const IInterface* parent);
         ~MuonCreatorTool() = default;
 
         virtual StatusCode initialize() override final;
 
         /** IMuonCreatorTool interface: build muons from ID and MS candidates */
-        virtual void create(const MuonCandidateCollection* muonCandidates, const InDetCandidateCollection* inDetCandidates,
+        virtual void create(const EventContext& ctx, const MuonCandidateCollection* muonCandidates, const InDetCandidateCollection* inDetCandidates,
                             std::vector<const InDetCandidateToTagMap*> tagMaps, OutputData& outputData) const override final;
 
         /** IMuonCreatorTool interface: create a muon from a muon candidate */
-        virtual xAOD::Muon* create(const MuonCandidate& candidate, OutputData& outputData) const override final;
+        virtual xAOD::Muon* create(const EventContext& ctx,
+                                   const MuonCandidate& candidate, OutputData& outputData) const override final;
 
         /** IMuonCreatorTool interface: create a muon from a muon candidate */
-        virtual xAOD::Muon* create(InDetCandidateTags& candidate, OutputData& outputData) const override final;
+        virtual xAOD::Muon* create(const EventContext& ctx, InDetCandidateTags& candidate, OutputData& outputData) const override final;
 
     private:
         /// Decorated a bunch of dummy values to the muon to ensure data consistency in the xAOD
-        void decorateDummyValues(xAOD::Muon& muon, OutputData& outputData) const;
+        void decorateDummyValues(const EventContext& ctx, xAOD::Muon& muon, OutputData& outputData) const;
 
-        void addStatisticalCombination(xAOD::Muon& muon, const InDetCandidate* candidate, const StacoTag* tag,
+        void addStatisticalCombination(const EventContext& ctx, xAOD::Muon& muon, const InDetCandidate* candidate, const StacoTag* tag,
                                        OutputData& outputData) const;
 
-        void addCombinedFit(xAOD::Muon& muon, const CombinedFitTag* tag, OutputData& outputData) const;
+        void addCombinedFit(const EventContext& ctx, xAOD::Muon& muon, const CombinedFitTag* tag, OutputData& outputData) const;
 
         void addMuGirl(xAOD::Muon& muon, const MuGirlTag* tag, OutputData& outputData) const;
 
@@ -98,7 +102,8 @@ namespace MuonCombined {
            extrapolatedTrack of the MuonCandidate will be release during the
            operation.
          */
-        void addMuonCandidate(const MuonCandidate& candidate, xAOD::Muon& muon, OutputData& outputData,
+        void addMuonCandidate(const EventContext& ctx, 
+                              const MuonCandidate& candidate, xAOD::Muon& muon, OutputData& outputData,
                               const ElementLink<TrackCollection>& meLink = ElementLink<TrackCollection>()) const;
 
         /// function creates an element link to a track particle from the track and
@@ -113,7 +118,7 @@ namespace MuonCombined {
                                                                              Trk::SegmentCollection* muonSegmentCollection = 0) const;
 
     private:
-        void resolveOverlaps(const InDetCandidateCollection* inDetCandidates, const MuonCandidateCollection* muonCandidates,
+        void resolveOverlaps(const EventContext& ctx, const InDetCandidateCollection* inDetCandidates, const MuonCandidateCollection* muonCandidates,
                              const std::vector<const InDetCandidateToTagMap*>& tagMaps, InDetCandidateTagsMap& resolvedInDetCandidates,
                              std::vector<const MuonCombined::MuonCandidate*>& resolvedMuonCandidates) const;
 
@@ -124,7 +129,7 @@ namespace MuonCombined {
         void selectStaus(const InDetCandidateCollection* inDetCandidates,
                          std::vector<const MuonCombined::InDetCandidate*>& resolvedInDetCandidates) const;
 
-        Trk::Track* createDummyTrack(const std::vector<const Muon::MuonSegment*>& segments, const Trk::Track& indetTrack) const;
+        Trk::Track* createDummyTrack(const EventContext& ctx, const std::vector<const Muon::MuonSegment*>& segments, const Trk::Track& indetTrack) const;
         void setMuonHitCounts(xAOD::Muon& muon) const;
 
         bool dressMuon(xAOD::Muon& muon, const xAOD::MuonSegmentContainer* segments) const;
@@ -135,7 +140,8 @@ namespace MuonCombined {
 
         void setP4(xAOD::Muon& muon, const xAOD::TrackParticle& tp) const;
 
-        void collectCells(xAOD::Muon& muon, xAOD::CaloClusterContainer* clusterContainer, Trk::CaloExtension* inputCaloExt = nullptr) const;
+        void collectCells(const EventContext& ctx, 
+                          xAOD::Muon& muon, xAOD::CaloClusterContainer* clusterContainer, Trk::CaloExtension* inputCaloExt = nullptr) const;
 
         void getRpcTiming(const xAOD::TrackParticle& tp, std::vector<unsigned int>& rpcHitIdentifier, std::vector<float>& rpcHitPositionX,
                           std::vector<float>& rpcHitPositionY, std::vector<float>& rpcHitPositionZ, std::vector<float>& rpcHitTime) const;
diff --git a/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonCreatorTool.h b/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonCreatorTool.h
index f0e5bdd0527c..9976ba73c735 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonCreatorTool.h
+++ b/Reconstruction/MuonIdentification/MuonCombinedToolInterfaces/MuonCombinedToolInterfaces/IMuonCreatorTool.h
@@ -23,10 +23,8 @@
 
 namespace MuonCombined {
 
-    typedef std::pair<const InDetCandidate*, std::vector<const TagBase*> > InDetCandidateTags;
-
-    static const InterfaceID IID_IMuonCreatorTool("MuonCombined::IMuonCreatorTool", 1, 0);
-
+ 
+ 
     /** @class IMuonCreatorTool
         @brief interface for tools building combined muons from ID and Muon candidates
 
@@ -35,74 +33,71 @@ namespace MuonCombined {
         If the pointer to a certain type is non-zero, the container is filled.
         The MuonContainer is mandatory, all other output types are optional.
 
-        @author Niels van Eldik
      */
 
     class IMuonCreatorTool : virtual public IAlgTool {
     public:
+      
+        using InDetCandidateTags = std::pair<const InDetCandidate*, std::vector<const TagBase*> > ;
+
         struct OutputData {
             OutputData(xAOD::MuonContainer& container) :
-                muonContainer(&container),
-                combinedTrackParticleContainer(0),
-                extrapolatedTrackParticleContainer(0),
-                msOnlyExtrapolatedTrackParticleContainer(0),
-                combinedTrackCollection(0),
-                extrapolatedTrackCollection(0),
-                msOnlyExtrapolatedTrackCollection(0),
-                xaodSegmentContainer(0),
-                muonSegmentCollection(0),
-                slowMuonContainer(0),
-                clusterContainer(0) {}
+                muonContainer(&container){}
             /** MuonContainer to be filled with the Muon objects */
-            xAOD::MuonContainer* muonContainer;
+            xAOD::MuonContainer* muonContainer{nullptr};
 
             /** container for the combined track particles */
-            xAOD::TrackParticleContainer* combinedTrackParticleContainer;
+            xAOD::TrackParticleContainer* combinedTrackParticleContainer{nullptr};
 
             /** container for the extrapolated track particles */
-            xAOD::TrackParticleContainer* extrapolatedTrackParticleContainer;
+            xAOD::TrackParticleContainer* extrapolatedTrackParticleContainer{nullptr};
 
             /** container for the extrapolated track particles */
-            xAOD::TrackParticleContainer* msOnlyExtrapolatedTrackParticleContainer;
+            xAOD::TrackParticleContainer* msOnlyExtrapolatedTrackParticleContainer{nullptr};
 
             /** container for the combined tracks */
-            TrackCollection* combinedTrackCollection;
+            TrackCollection* combinedTrackCollection{nullptr};
 
             /** container for the extrapolated tracks */
-            TrackCollection* extrapolatedTrackCollection;
+            TrackCollection* extrapolatedTrackCollection{nullptr};
 
             /** container for the extrapolated tracks */
-            TrackCollection* msOnlyExtrapolatedTrackCollection;
+            TrackCollection* msOnlyExtrapolatedTrackCollection{nullptr};
 
             /** container for the xAOD segments from MuGirl */
-            xAOD::MuonSegmentContainer* xaodSegmentContainer;
+            xAOD::MuonSegmentContainer* xaodSegmentContainer{nullptr};
 
             /** collection for the segments from MuGirl */
-            Trk::SegmentCollection* muonSegmentCollection;
+            Trk::SegmentCollection* muonSegmentCollection{nullptr};
 
             /** container for the Slow muon content */
-            xAOD::SlowMuonContainer* slowMuonContainer;
+            xAOD::SlowMuonContainer* slowMuonContainer{nullptr};
 
             /** container for the clusters associated with muons */
-            xAOD::CaloClusterContainer* clusterContainer;
+            xAOD::CaloClusterContainer* clusterContainer{nullptr};
         };
 
-        static const InterfaceID& interfaceID();
+        static const InterfaceID& interfaceID(){
+               static const InterfaceID IID_IMuonCreatorTool("MuonCombined::IMuonCreatorTool", 1, 0);
+                return IID_IMuonCreatorTool;
+        }
+
 
         /**IMuonCreatorTool interface: build muons from ID and MS candidates */
 
-        virtual void create(const MuonCandidateCollection* muonCandidates, const InDetCandidateCollection* inDetCandidates,
+        virtual void create(const EventContext& ctx, const MuonCandidateCollection* muonCandidates, const InDetCandidateCollection* inDetCandidates,
                             std::vector<const InDetCandidateToTagMap*> tagMaps, OutputData& outputData) const = 0;
 
         /** create a muon from a muon candidate */
-        virtual xAOD::Muon* create(const MuonCandidate& candidate, OutputData& outputData) const = 0;
+        virtual xAOD::Muon* create(const EventContext& ctx, const MuonCandidate& candidate, OutputData& outputData) const = 0;
 
         /** create a muon from an ID candidate */
-        virtual xAOD::Muon* create(InDetCandidateTags& candidate, OutputData& outputData) const = 0;
+        virtual xAOD::Muon* create(const EventContext& ctx, InDetCandidateTags& candidate, OutputData& outputData) const = 0;
+        /** default virtual destructor */
+        virtual ~IMuonCreatorTool() = default;
     };
 
-    inline const InterfaceID& IMuonCreatorTool::interfaceID() { return IID_IMuonCreatorTool; }
-
+ 
 }  // namespace MuonCombined
 
 #endif
-- 
GitLab


From 5cb73353c398dd150ee564a78605289da33e34e0 Mon Sep 17 00:00:00 2001
From: Carlos Moreno Martinez <carlos.moreno.martinez@cern.ch>
Date: Mon, 20 Sep 2021 18:10:34 +0200
Subject: [PATCH 214/347] Add new multiplicity algorithms to L1Topo simulation

---
 .../{EMMultiplicity.h => eEmMultiplicity.h}   |  10 +-
 .../L1TopoAlgorithms/eTauMultiplicity.h       |  44 ++++++++
 .../L1TopoAlgorithms/jJetMultiplicity.h       |  44 ++++++++
 ...EMMultiplicity.cxx => eEmMultiplicity.cxx} |  20 ++--
 .../Root/eTauMultiplicity.cxx                 | 103 +++++++++++++++++
 .../Root/jJetMultiplicity.cxx                 | 105 ++++++++++++++++++
 .../TrigT1/L1Topo/L1TopoCommon/Root/Types.cxx |   4 +-
 .../Root/TopoSteeringStructure.cxx            |  60 +++++-----
 .../TriggerMenuMT/python/L1/Base/TopoAlgos.py |   4 +-
 .../L1/Config/TopoAlgoDefMultiplicity.py      |  10 +-
 10 files changed, 350 insertions(+), 54 deletions(-)
 rename Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/{EMMultiplicity.h => eEmMultiplicity.h} (77%)
 create mode 100644 Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/eTauMultiplicity.h
 create mode 100644 Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/jJetMultiplicity.h
 rename Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/{EMMultiplicity.cxx => eEmMultiplicity.cxx} (80%)
 create mode 100644 Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/eTauMultiplicity.cxx
 create mode 100644 Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/jJetMultiplicity.cxx

diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/EMMultiplicity.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/eEmMultiplicity.h
similarity index 77%
rename from Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/EMMultiplicity.h
rename to Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/eEmMultiplicity.h
index a72e0379318d..f41cc5b0a12f 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/EMMultiplicity.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/eEmMultiplicity.h
@@ -5,8 +5,8 @@
 //  TopoCore
 //  Created by Carlos Moreno on 05/05/20.
 
-#ifndef __TopoCore__EMMultiplicity__
-#define __TopoCore__EMMultiplicity__
+#ifndef __TopoCore__eEmMultiplicity__
+#define __TopoCore__eEmMultiplicity__
 
 #include <iostream>
 #include <vector>
@@ -19,10 +19,10 @@ class TH2;
 
 namespace TCS { 
   
-   class EMMultiplicity : public CountingAlg {
+   class eEmMultiplicity : public CountingAlg {
    public:
-      EMMultiplicity(const std::string & name);
-      virtual ~EMMultiplicity();
+      eEmMultiplicity(const std::string & name);
+      virtual ~eEmMultiplicity();
 
       virtual StatusCode initialize() override;
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/eTauMultiplicity.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/eTauMultiplicity.h
new file mode 100644
index 000000000000..4c0d3d596d2d
--- /dev/null
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/eTauMultiplicity.h
@@ -0,0 +1,44 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+//  EmMultiplicity.h
+//  TopoCore
+//  Created by Carlos Moreno on 17/09/21.
+
+#ifndef __TopoCore__eTauMultiplicity__
+#define __TopoCore__eTauMultiplicity__
+
+#include <iostream>
+#include <vector>
+#include "L1TopoInterfaces/CountingAlg.h"
+#include "L1TopoEvent/TOBArray.h"
+
+#include "TrigConfData/L1Threshold.h"
+
+class TH2;
+
+namespace TCS { 
+  
+   class eTauMultiplicity : public CountingAlg {
+   public:
+      eTauMultiplicity(const std::string & name);
+      virtual ~eTauMultiplicity();
+
+      virtual StatusCode initialize() override;
+
+      virtual StatusCode processBitCorrect( const TCS::InputTOBArray & input,
+					    Count & count ) override final ;
+
+      virtual StatusCode process( const TCS::InputTOBArray & input,
+				  Count & count ) override final ;
+
+
+
+   private:
+     
+      TrigConf::L1Threshold const * m_threshold{nullptr};
+   };
+
+}
+
+#endif
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/jJetMultiplicity.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/jJetMultiplicity.h
new file mode 100644
index 000000000000..b530637765a9
--- /dev/null
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/jJetMultiplicity.h
@@ -0,0 +1,44 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+//  EmMultiplicity.h
+//  TopoCore
+//  Created by Carlos Moreno on 17/09/21.
+
+#ifndef __TopoCore__jJetMultiplicity__
+#define __TopoCore__jJetMultiplicity__
+
+#include <iostream>
+#include <vector>
+#include "L1TopoInterfaces/CountingAlg.h"
+#include "L1TopoEvent/TOBArray.h"
+
+#include "TrigConfData/L1Threshold.h"
+
+class TH2;
+
+namespace TCS { 
+  
+   class jJetMultiplicity : public CountingAlg {
+   public:
+      jJetMultiplicity(const std::string & name);
+      virtual ~jJetMultiplicity();
+
+      virtual StatusCode initialize() override;
+
+      virtual StatusCode processBitCorrect( const TCS::InputTOBArray & input,
+					    Count & count ) override final ;
+
+      virtual StatusCode process( const TCS::InputTOBArray & input,
+				  Count & count ) override final ;
+
+
+
+   private:
+     
+      TrigConf::L1Threshold const * m_threshold{nullptr};
+   };
+
+}
+
+#endif
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EMMultiplicity.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/eEmMultiplicity.cxx
similarity index 80%
rename from Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EMMultiplicity.cxx
rename to Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/eEmMultiplicity.cxx
index ce650253d646..72e15338f058 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/EMMultiplicity.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/eEmMultiplicity.cxx
@@ -2,7 +2,7 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 /*********************************
- * EMMultiplicity.cpp
+ * eEmMultiplicity.cpp
  * Created by Carlos Moreno on 05/06/20.
  *
  * @brief algorithm that computes the multiplicity for a specified list and ET threshold
@@ -14,7 +14,7 @@
 
 #include <cmath>
 
-#include "L1TopoAlgorithms/EMMultiplicity.h"
+#include "L1TopoAlgorithms/eEmMultiplicity.h"
 #include "L1TopoCommon/Exception.h"
 #include "L1TopoInterfaces/Count.h"
 
@@ -22,12 +22,12 @@
 #include "L1TopoEvent/eEmTOBArray.h"
 #include "L1TopoEvent/GenericTOB.h"
 
-REGISTER_ALG_TCS(EMMultiplicity)
+REGISTER_ALG_TCS(eEmMultiplicity)
 
 using namespace std;
 
 
-TCS::EMMultiplicity::EMMultiplicity(const std::string & name) : CountingAlg(name)
+TCS::eEmMultiplicity::eEmMultiplicity(const std::string & name) : CountingAlg(name)
 {
    
    
@@ -35,19 +35,19 @@ TCS::EMMultiplicity::EMMultiplicity(const std::string & name) : CountingAlg(name
 
 }
 
-TCS::EMMultiplicity::~EMMultiplicity(){}
+TCS::eEmMultiplicity::~eEmMultiplicity(){}
 
 
 TCS::StatusCode
-TCS::EMMultiplicity::initialize() { 
+TCS::eEmMultiplicity::initialize() { 
 
   m_threshold = getThreshold();
 
   // book histograms
-  std::string hname_accept = "hEMMultiplicity_accept_"+m_threshold->name();
+  std::string hname_accept = "heEmMultiplicity_accept_"+m_threshold->name();
   bookHist(m_histAccept, hname_accept, "eta vs pT", 150, -100, 100, 30, 0., 20.);
 
-  hname_accept = "hEMMultiplicity_accept_counts_"+m_threshold->name();
+  hname_accept = "heEmMultiplicity_accept_counts_"+m_threshold->name();
   bookHist(m_histAccept, hname_accept, "Counts", 15, 0., 10. );
 
   return StatusCode::SUCCESS;
@@ -56,7 +56,7 @@ TCS::EMMultiplicity::initialize() {
 
 
 TCS::StatusCode
-TCS::EMMultiplicity::processBitCorrect( const TCS::InputTOBArray & input,
+TCS::eEmMultiplicity::processBitCorrect( const TCS::InputTOBArray & input,
 					 Count & count)
 
 {
@@ -64,7 +64,7 @@ TCS::EMMultiplicity::processBitCorrect( const TCS::InputTOBArray & input,
 }
 
 TCS::StatusCode
-TCS::EMMultiplicity::process( const TCS::InputTOBArray & input,
+TCS::eEmMultiplicity::process( const TCS::InputTOBArray & input,
 			       Count & count )
 {
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/eTauMultiplicity.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/eTauMultiplicity.cxx
new file mode 100644
index 000000000000..d93e6df2189c
--- /dev/null
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/eTauMultiplicity.cxx
@@ -0,0 +1,103 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+/*********************************
+ * eTauMultiplicity.cpp
+ * Created by Carlos Moreno on 05/06/20.
+ *
+ * @brief algorithm that computes the multiplicity for a specified list and ET threshold
+ * line 1: 0 or 1, line 1 and 2 : 2 or more, uses 2 bits
+ *
+ * @param NumberLeading MinET
+
+**********************************/
+
+#include <cmath>
+
+#include "L1TopoAlgorithms/eTauMultiplicity.h"
+#include "L1TopoCommon/Exception.h"
+#include "L1TopoInterfaces/Count.h"
+
+#include "L1TopoEvent/TOBArray.h"
+#include "L1TopoEvent/eTauTOBArray.h"
+#include "L1TopoEvent/GenericTOB.h"
+
+REGISTER_ALG_TCS(eTauMultiplicity)
+
+using namespace std;
+
+
+TCS::eTauMultiplicity::eTauMultiplicity(const std::string & name) : CountingAlg(name)
+{
+   
+   
+   setNumberOutputBits(12); //To-Do: Make this flexible to addapt to the menu. Each counting requires more than one bit
+
+}
+
+TCS::eTauMultiplicity::~eTauMultiplicity(){}
+
+
+TCS::StatusCode
+TCS::eTauMultiplicity::initialize() { 
+
+  m_threshold = getThreshold();
+
+  // book histograms
+  std::string hname_accept = "heTauMultiplicity_accept_"+m_threshold->name();
+  bookHist(m_histAccept, hname_accept, "eta vs pT", 150, -100, 100, 30, 0., 20.);
+
+  hname_accept = "heTauMultiplicity_accept_counts_"+m_threshold->name();
+  bookHist(m_histAccept, hname_accept, "Counts", 15, 0., 10. );
+
+  return StatusCode::SUCCESS;
+     
+}
+
+
+TCS::StatusCode
+TCS::eTauMultiplicity::processBitCorrect( const TCS::InputTOBArray & input,
+					 Count & count)
+
+{
+   return process(input, count);
+}
+
+TCS::StatusCode
+TCS::eTauMultiplicity::process( const TCS::InputTOBArray & input,
+			       Count & count )
+{
+
+  // Grab the threshold and cast it into the right type
+  auto eTAUThr = dynamic_cast<const TrigConf::L1Threshold_eTAU &>(*m_threshold);
+
+  // Grab inputs
+  const eTauTOBArray & etaus = dynamic_cast<const eTauTOBArray&>(input);
+
+  int counting = 0; 
+  
+  // loop over input TOBs
+  for(eTauTOBArray::const_iterator etau = etaus.begin();
+      etau != etaus.end();
+      ++etau ) {
+    
+    const GenericTOB gtob(**etau);
+
+    // Dividing by 4 standing for converting eta from 0.025 to 0.1 granularity as it is defined in the menu as 0.1 gran.
+    bool passed = gtob.Et() >= eTAUThr.thrValueCounts(gtob.eta()/4);
+
+    if (passed) {
+      counting++; 
+      fillHist2D( m_histAccept[0], gtob.eta(), gtob.EtDouble() );
+    }
+
+  }
+
+  fillHist1D( m_histAccept[1], counting);
+  
+  // Pass counting to TCS::Count object - output bits are composed there
+  count.setSizeCount(counting);
+  
+  return TCS::StatusCode::SUCCESS;
+
+}
diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/jJetMultiplicity.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/jJetMultiplicity.cxx
new file mode 100644
index 000000000000..55ebb9df116f
--- /dev/null
+++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/jJetMultiplicity.cxx
@@ -0,0 +1,105 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+/*********************************
+ * jJetMultiplicity.cpp
+ * Created by Carlos Moreno on 17/09/21.
+ *
+ * @brief algorithm that computes the multiplicity for a specified list and ET threshold
+ * line 1: 0 or 1, line 1 and 2 : 2 or more, uses 2 bits
+ *
+ * @param NumberLeading MinET
+
+**********************************/
+
+#include <cmath>
+
+#include "L1TopoAlgorithms/jJetMultiplicity.h"
+#include "L1TopoCommon/Exception.h"
+#include "L1TopoInterfaces/Count.h"
+
+#include "L1TopoEvent/TOBArray.h"
+#include "L1TopoEvent/jJetTOBArray.h"
+#include "L1TopoEvent/GenericTOB.h"
+
+REGISTER_ALG_TCS(jJetMultiplicity)
+
+using namespace std;
+
+
+TCS::jJetMultiplicity::jJetMultiplicity(const std::string & name) : CountingAlg(name)
+{
+   
+   
+   setNumberOutputBits(12); //To-Do: Make this flexible to addapt to the menu. Each counting requires more than one bit
+
+}
+
+TCS::jJetMultiplicity::~jJetMultiplicity(){}
+
+
+TCS::StatusCode
+TCS::jJetMultiplicity::initialize() { 
+
+  m_threshold = getThreshold();
+
+  // book histograms
+  std::string hname_accept = "hjJetMultiplicity_accept_"+m_threshold->name();
+  bookHist(m_histAccept, hname_accept, "eta vs pT", 150, -100, 100, 30, 0., 20.);
+
+  hname_accept = "hjJetMultiplicity_accept_counts_"+m_threshold->name();
+  bookHist(m_histAccept, hname_accept, "Counts", 15, 0., 10. );
+
+  return StatusCode::SUCCESS;
+     
+}
+
+
+TCS::StatusCode
+TCS::jJetMultiplicity::processBitCorrect( const TCS::InputTOBArray & input,
+					 Count & count)
+
+{
+   return process(input, count);
+}
+
+TCS::StatusCode
+TCS::jJetMultiplicity::process( const TCS::InputTOBArray & input,
+			       Count & count )
+{
+
+  cout << "CARLOS: processing threshold " << m_threshold->name() << endl;
+
+  // Grab the threshold and cast it into the right type
+  auto jJThr = dynamic_cast<const TrigConf::L1Threshold_jJ &>(*m_threshold);
+
+  // Grab inputs
+  const jJetTOBArray & jjets = dynamic_cast<const jJetTOBArray&>(input);
+
+  int counting = 0; 
+  
+  // loop over input TOBs
+  for(jJetTOBArray::const_iterator jjet = jjets.begin();
+      jjet != jjets.end();
+      ++jjet ) {
+    
+    const GenericTOB gtob(**jjet);
+
+    // Dividing by 4 standing for converting eta from 0.025 to 0.1 granularity as it is defined in the menu as 0.1 gran.
+    bool passed = gtob.Et() >= jJThr.thrValueCounts(gtob.eta()/4);
+
+    if (passed) {
+      counting++; 
+      fillHist2D( m_histAccept[0], gtob.eta(), gtob.EtDouble() );
+    }
+
+  }
+
+  fillHist1D( m_histAccept[1], counting);
+  
+  // Pass counting to TCS::Count object - output bits are composed there
+  count.setSizeCount(counting);
+  
+  return TCS::StatusCode::SUCCESS;
+
+}
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCommon/Root/Types.cxx b/Trigger/TrigT1/L1Topo/L1TopoCommon/Root/Types.cxx
index 8cabbd47f645..c608f107b957 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoCommon/Root/Types.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoCommon/Root/Types.cxx
@@ -35,7 +35,7 @@ TCS::inputType(const std::string& input) {
    if ( input == "jEM" || input == "jEMTobArray" || input == "jEmTobs" )
       return TCS::CLUSTER;
 
-   if ( input == "eTau" || input == "eTauTobArray" || input == "eTauTobs" )
+   if ( input == "eTAU" || input == "eTauTobArray" || input == "eTauTobs" )
       return TCS::ETAU;
 
    if ( input == "jTau" || input == "jTauTobArray" || input == "jTauTobs" )
@@ -44,7 +44,7 @@ TCS::inputType(const std::string& input) {
    if ( input == "Jets" || input == "JetTobArray" )
       return TCS::JET;
 
-   if ( input == "jJet" || input == "jJetTobArray" || input == "jJetTobs" )
+   if ( input == "jJ" || input == "jJetTobArray" || input == "jJetTobs" )
       return TCS::JJET;
 
    if ( input == "jLargeRJet" || input == "jLargeRJetTobArray" || input == "jLargeRJetTobs" )
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteeringStructure.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteeringStructure.cxx
index 3bba2d51cf30..3f8db8856074 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteeringStructure.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteeringStructure.cxx
@@ -222,37 +222,37 @@ TCS::TopoSteeringStructure::setupFromMenu(const TrigConf::L1Menu& l1menu, bool l
 
             for( auto & tl : l1conn.triggerLines(0, 0) ) {
 
-               const string & tlName = tl.name();
-	            auto & algo = l1menu.algorithmFromTriggerline(tlName);
+	      const string & tlName = tl.name();
+	      auto & algo = l1menu.algorithmFromTriggerline(tlName);
 
-               if (algo.klass() != "EMMultiplicity") continue; // Only multiplicity for EMs are defined in the menu
+	      if ( (algo.klass() != "eEmMultiplicity") && (algo.klass() != "eTauMultiplicity") ) continue; // Only available multiplicity algorithms so far
             
-               auto it = find(storedConn.begin(), storedConn.end(), algo.name());
-               if (it == storedConn.end()) { // Algorithm/Connector does not exist: create and store it
-
-                  storedConn.push_back(algo.name());
-                  if(debug)
-                     cout << "L1TopoSteering: Multiplicity algo( " << algo.name() << " ) has as input " << algo.inputs().at(0) << endl;
-
-                  CountingConnector * conn = new CountingConnector(algo.name(), algo.inputs().at(0), algo.klass()+"/"+algo.name(), algo.outputs().at(0));
-	               conn->m_count.setNBits( tl.nbits() );
-	               conn->m_count.setFirstBit( tl.startbit() );
-
-                  if(tl.name() != "UNDEF")
-		               conn->m_triggers.push_back(tl);
-
-                  if(debug)
-                     cout << "Adding count connector " << "[" << *conn << "]" << endl;
-                  addCountingConnector( conn );
-                  confMultAlgorithms.push_back( algo.name() );
-               }
-
-            } // Trigger Line
-
-         } // Optical connectors - multiplicities
-       
-      } // Connector in l1board
-
+	      auto it = find(storedConn.begin(), storedConn.end(), algo.name());
+	      if (it == storedConn.end()) { // Algorithm/Connector does not exist: create and store it
+
+		storedConn.push_back(algo.name());
+		if(debug)
+		  cout << "L1TopoSteering: Multiplicity algo( " << algo.name() << " ) has as input " << algo.inputs().at(0) << endl;
+		     
+		CountingConnector * conn = new CountingConnector(algo.name(), algo.inputs().at(0), algo.klass()+"/"+algo.name(), algo.outputs().at(0));
+		conn->m_count.setNBits( tl.nbits() );
+		conn->m_count.setFirstBit( tl.startbit() );
+		
+		if(tl.name() != "UNDEF")
+		  conn->m_triggers.push_back(tl);
+		
+		if(debug)
+		  cout << "Adding count connector " << "[" << *conn << "]" << endl;
+		addCountingConnector( conn );
+		confMultAlgorithms.push_back( algo.name() );
+	      }
+	      
+	    } // Trigger Line
+	    
+	 } // Optical connectors - multiplicities
+	 
+     } // Connector in l1board
+     
    } // Board in l1menu
 
   
@@ -357,7 +357,7 @@ TCS::TopoSteeringStructure::setupFromMenu(const TrigConf::L1Menu& l1menu, bool l
 
       auto & l1algo = l1menu.algorithm(multAlgo, "MULTTOPO");
 
-      if (l1algo.klass() != "EMMultiplicity") continue; // Look at eEM multiplicities for now, missing inputs in the menu for the other types of thresholds
+      if ( (l1algo.klass() != "eEmMultiplicity") && (l1algo.klass() != "eTauMultiplicity") ) continue; // Only available multiplicities for now
 
       ConfigurableAlg * alg = AlgFactory::instance().algorithm(l1algo.name());
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py
index 38d6e3bcfee5..13c63733253f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py
@@ -284,9 +284,9 @@ class MultiplicityAlgo(TopoAlgo):
         return confObj
 
 
-class EMMultiplicityAlgo(MultiplicityAlgo):
+class eEmMultiplicityAlgo(MultiplicityAlgo):
     def __init__(self, name, algoId, threshold, nbits, classtype ):
-        super(EMMultiplicityAlgo, self).__init__(classtype=classtype, name=name, 
+        super(eEmMultiplicityAlgo, self).__init__(classtype=classtype, name=name, 
                                                  algoId=algoId, 
                                                  threshold = threshold, 
                                                  input=None, output="%s" % threshold,
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py
index adf3abd213b7..7c3bf9ac0b00 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py
@@ -3,7 +3,7 @@
 from AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
 
-from ..Base.TopoAlgos import EMMultiplicityAlgo, TauMultiplicityAlgo, JetMultiplicityAlgo, XEMultiplicityAlgo
+from ..Base.TopoAlgos import eEmMultiplicityAlgo, TauMultiplicityAlgo, JetMultiplicityAlgo, XEMultiplicityAlgo
 
 class TopoAlgoDefMultiplicity(object):
     """
@@ -23,16 +23,16 @@ class TopoAlgoDefMultiplicity(object):
         ]
 
         for em in emThresholds_3bits:
-            alg = EMMultiplicityAlgo( name = em,
+            alg = eEmMultiplicityAlgo( name = em,
                                       algoId = currentAlgoId,
                                       threshold = em,
-                                      nbits = 3, classtype='EMMultiplicity')
+                                      nbits = 3, classtype='eEmMultiplicity')
             tm.registerTopoAlgo(alg)
         for em in emThresholds_2bits:
-            alg = EMMultiplicityAlgo( name = em,
+            alg = eEmMultiplicityAlgo( name = em,
                                       algoId = currentAlgoId,
                                       threshold = em,
-                                      nbits = 2, classtype='EMMultiplicity')
+                                      nbits = 2, classtype='eEmMultiplicity')
             tm.registerTopoAlgo(alg)
                 
         etauThresholds_3bits = [ 'eTAU8', 'eTAU12', ]
-- 
GitLab


From b6e83706164c0609e937e7cfe0575c50e24240ed Mon Sep 17 00:00:00 2001
From: Thomas Strebler <thomas.strebler@cern.ch>
Date: Mon, 20 Sep 2021 18:12:28 +0200
Subject: [PATCH 215/347] SLHC cleaning

---
 .../xAODTracking/TrackingPrimitives.h         |   4 +-
 .../python/ITkTrackingSiPatternConfig.py      |   2 +-
 .../RobustTrackingGeometryBuilder.h           |   4 +-
 .../RobustTrackingGeometryBuilderCond.h       |   4 +-
 ...iguredSLHC_InDetTrackingGeometryBuilder.py | 260 ------------------
 .../src/RobustTrackingGeometryBuilder.cxx     |   4 +-
 .../src/RobustTrackingGeometryBuilderCond.cxx |   4 +-
 .../python/InDetDxAODUtils.py                 |   3 +-
 .../share/InDetDxAOD.py                       |   3 -
 .../InDetPrepRawDataToxAOD/share/PixelxAOD.py |   2 -
 .../python/ConfiguredNewTrackingCuts.py       |  73 +----
 .../python/InDetJobProperties.py              |  76 -----
 .../InDetRecExample/python/InDetKeys.py       |  45 +--
 .../InDetRecExample/python/TrackingCommon.py  |  28 +-
 .../share/ConfiguredNewTrackingSiPattern.py   |  39 +--
 .../share/InDetRecConditionsAccess.py         |   4 -
 .../share/InDetRecLoadTools.py                |   2 +-
 .../share/InDetRecPreProcessingSilicon.py     |  13 +-
 .../share/InDetRec_jobOptions.py              |  92 +------
 .../InDetRecExample/share/InDetxAODCreator.py |   2 +-
 .../InDetRecExample/share/WriteInDetAOD.py    |   5 +-
 .../InDetRecExample/share/WriteInDetESD.py    |   5 +-
 .../share/SiSPSeededTracksStandalone.py       |  24 +-
 .../SiSPSeededTracksStandaloneFromESD.py      |  26 +-
 .../src/SiTrackMaker_xk.cxx                   |   4 +-
 .../run/PhysValITk_jobOptions.py              | 236 ----------------
 .../PrimaryDPDMaker/share/DAOD_IDNCB.py       |   5 -
 .../python/EMBremCollectionBuilder.py         |   3 +-
 .../python/FatrasTrackingGeometrySvc.py       |  30 +-
 .../python/ISF_FatrasServicesConfig.py        |  14 +-
 .../python/AtlasTrackingGeometrySvc.py        |  13 +-
 .../TrkEvent/TrkTrack/TrkTrack/TrackInfo.h    |   4 +-
 Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx  |   4 +-
 .../Electron/TrigEMBremCollectionBuilder.py   |   3 +-
 34 files changed, 67 insertions(+), 973 deletions(-)
 delete mode 100644 InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredSLHC_InDetTrackingGeometryBuilder.py
 delete mode 100644 InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py

diff --git a/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h b/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h
index b58d2d1b94ba..00df71dd3bf1 100644
--- a/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h
+++ b/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h
@@ -181,8 +181,8 @@ namespace xAOD {
     SiSPSeededFinderSimple                 = 48,
     // Large d0 for displaced vertex searches
     SiSpacePointsSeedMaker_LargeD0         = 49,
-    // SLHCConversion Track flag
-    SiSpacePointsSeedMaker_SLHCConversionTracks = 50,
+    // ITkConversion Track flag
+    SiSpacePointsSeedMaker_ITkConversionTracks = 50,
     // Pseudotracking
     Pseudotracking			   = 51,
      ///maximum number of enums
diff --git a/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py b/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py
index 5475bf5e3133..361e63aa31b7 100644
--- a/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py
+++ b/InnerDetector/InDetConfig/python/ITkTrackingSiPatternConfig.py
@@ -212,7 +212,7 @@ def ITkSiTrackMaker_xkCfg(flags, name="ITkSiTrackMaker", InputCollections = None
         kwargs.setdefault("TrackPatternRecoInfo", 'SiSpacePointsSeedMaker_HeavyIon')
 
     elif flags.ITk.Tracking.extension == "ConversionFinding":
-        kwargs.setdefault("TrackPatternRecoInfo", 'SiSpacePointsSeedMaker_SLHCConversionTracks')
+        kwargs.setdefault("TrackPatternRecoInfo", 'SiSpacePointsSeedMaker_ITkConversionTracks')
 
     elif flags.ITk.Tracking.extension == "LargeD0":
         kwargs.setdefault("TrackPatternRecoInfo", 'SiSpacePointsSeedMaker_LargeD0')
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
index 260234bbb4ce..194a8ddf50a1 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilder.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -137,7 +137,7 @@ namespace InDet {
       std::string                                    m_namespace;                //!< identificaton namespace 
       // ID container                                                            
       std::string                                    m_exitVolume;                //!< the final ID container             
-      bool                                           m_isSLHC;                   //!< changes volume boundary calculation for SLHC layouts      
+      bool                                           m_isITk;                   //!< changes volume boundary calculation for ITk layouts
   };
 
 } // end of namespace
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
index c2602090ff75..bde769b0f7bb 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/RobustTrackingGeometryBuilderCond.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -139,7 +139,7 @@ namespace InDet {
       std::string                                    m_namespace;                //!< identificaton namespace 
       // ID container                                                            
       std::string                                    m_exitVolume;                //!< the final ID container             
-      bool                                           m_isSLHC;                   //!< changes volume boundary calculation for SLHC layouts      
+      bool                                           m_isITk;                   //!< changes volume boundary calculation for ITk layouts
   };
 
 } // end of namespace
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredSLHC_InDetTrackingGeometryBuilder.py b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredSLHC_InDetTrackingGeometryBuilder.py
deleted file mode 100644
index 97c4b3bfd066..000000000000
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredSLHC_InDetTrackingGeometryBuilder.py
+++ /dev/null
@@ -1,260 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-######################################################
-# ConfiguredSLHC_InDetTrackingGeometry module
-#
-# it inherits from StagedTrackingGeometryBuilderConf and performs 
-# standard configuration
-#
-######################################################
-
-# import the Extrapolator configurable
-from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__StagedTrackingGeometryBuilder
-
-# define the class
-class ConfiguredSLHC_InDetTrackingGeometryBuilder( InDet__StagedTrackingGeometryBuilder ):
-    # constructor
-    def __init__(self,name = 'InDetTrackingGeometryBuilder',
-                      namePrefix = '',
-                      setLayerAssociation = True):
-
-        # get the ToolSvc
-        from AthenaCommon.AppMgr import ToolSvc, ServiceMgr           
-        from AthenaCommon.DetFlags import DetFlags
-       
-        # the Detector flags to be imported
-        from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
-        
-        # beampipe        
-        from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__BeamPipeBuilder
-        BeamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix+'BeamPipeBuilder')
-        BeamPipeBuilder.BeamPipeRadius 	        = TrkDetFlags.BeamPipeRadius()
-        BeamPipeBuilder.BeamPipeThickness       = TrkDetFlags.BeamPipeThickness() 
-        BeamPipeBuilder.BeamPipeMaterialBinsZ   = TrkDetFlags.BeamPipeLayerMaterialBinsZ()
-        BeamPipeBuilder.OutputLevel             = TrkDetFlags.InDetBuildingOutputLevel()
-        # the binning type of the layers   
-        BeamPipeBinning = 2
-        # where to build it from
-        BeamPipeBuilder.BeamPipeFromGeoModel    = TrkDetFlags.BeamPipeFromGeoModel()
-        BeamPipeBuilder.BeamPipeEnvelope        = TrkDetFlags.BeamPipeEnvelope()
-        if not TrkDetFlags.BeamPipeFromGeoModel():
-            BeamPipeBuilder.BeamPipeOffsetX	        = TrkDetFlags.BeamPipeOffsetX()
-            BeamPipeBuilder.BeamPipeOffsetY	        = TrkDetFlags.BeamPipeOffsetY()
-            BeamPipeBuilder.BeamPipeRadius 	        = TrkDetFlags.BeamPipeRadius()
-
-        ToolSvc += BeamPipeBuilder
-
-        # the layer providers
-        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerProvider
-        BeamPipeProvider = Trk__LayerProvider(name=namePrefix+'BeamPipeProvider')
-        BeamPipeProvider.LayerBuilder = BeamPipeBuilder
-        ToolSvc += BeamPipeProvider
-                
-        # the layer builders
-        layerProviders   = [ BeamPipeProvider ]
-        binningsCenter  = [ BeamPipeBinning ]
-        binningsEndcap  = [ BeamPipeBinning ]
-        colors          = [ 2 ]
-                                
-        # PIXEL building
-        from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilder
-        PixelLayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilder')
-        PixelLayerBuilder.PixelCase 	       = True
-        PixelLayerBuilder.Identification       = 'Pixel1'
-        PixelLayerBuilder.SiDetManagerLocation = 'Pixel'
-        # The pixel split mode
-        PixelLayerBuilder.SplitMode            = TrkDetFlags.PixelSplitMode()
-        # Pixel barrel specifications
-        PixelLayerBuilder.BarrelLayerBinsZ     = TrkDetFlags.PixelBarrelLayerMaterialBinsZ()
-        PixelLayerBuilder.BarrelLayerBinsPhi   = TrkDetFlags.PixelBarrelLayerMaterialBinsPhi()
-        PixelLayerBuilder.EndcapLayerBinsR     = TrkDetFlags.PixelEndcapLayerMaterialBinsR()
-        PixelLayerBuilder.EndcapLayerBinsPhi   = TrkDetFlags.PixelEndcapLayerMaterialBinsPhi()
-        # set the layer association
-        PixelLayerBuilder.SetLayerAssociation  = setLayerAssociation
-        # output level
-        PixelLayerBuilder.OutputLevel         = TrkDetFlags.PixelBuildingOutputLevel()
-        # the binning type of the layers   
-        PixelLayerBinning = 2
-        # add it to tool service
-        ToolSvc += PixelLayerBuilder
-        # put them to the caches
-        PixelLayerProvider = Trk__LayerProvider(name=namePrefix+'PixelLayerProvider')
-        PixelLayerProvider.LayerBuilder = PixelLayerBuilder
-        ToolSvc += PixelLayerProvider
-        layerProviders  += [ PixelLayerProvider ]
-        binningsCenter += [ PixelLayerBinning ]
-        binningsEndcap += [ PixelLayerBinning ]
-        colors         += [ 3 ]
-        # check if the pixel split mode is one
-        if TrkDetFlags.PixelSplitMode() != 0:
-            # set split mode to pixel layer builder 
-            print ("[SLHC_GeometryBuilder] Building Pixel layers in split mode")
-            # change the identificaiton of the first one
-            PixelLayerBuilder.Identification       = 'Pixel1'
-            # and now configure the second one
-            PixelLayerBuilder2 = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilder2')
-            PixelLayerBuilder2.PixelCase 	        = True
-            PixelLayerBuilder2.SplitMode            = TrkDetFlags.PixelSplitMode()
-            PixelLayerBuilder2.Identification       = 'Pixel2'
-            PixelLayerBuilder2.SiDetManagerLocation = 'Pixel'
-            # Pixel barrel specifications
-            PixelLayerBuilder2.BarrelLayerBinsZ     = TrkDetFlags.PixelBarrelLayerMaterialBinsZ()
-            PixelLayerBuilder2.BarrelLayerBinsPhi   = TrkDetFlags.PixelBarrelLayerMaterialBinsPhi()
-            PixelLayerBuilder2.EndcapLayerBinsR     = TrkDetFlags.PixelEndcapLayerMaterialBinsR()
-            PixelLayerBuilder2.EndcapLayerBinsPhi   = TrkDetFlags.PixelEndcapLayerMaterialBinsPhi()
-            # set the layer association
-            PixelLayerBuilder2.SetLayerAssociation  = setLayerAssociation
-            # output level
-            PixelLayerBuilder2.OutputLevel         = TrkDetFlags.PixelBuildingOutputLevel()
-            # add it to tool service
-            ToolSvc += PixelLayerBuilder2
-
-            # the layer providers
-            PixelLayerProvider2 = Trk__LayerProvider(name=namePrefix+'PixelLayerProvider2')
-            PixelLayerProvider2.LayerBuilder = PixelLayerBuilder2
-            ToolSvc += PixelLayerProvider2
-            # put them to the caches
-            layerProviders  += [ PixelLayerProvider2 ]
-            binningsCenter += [ PixelLayerBinning ]
-            binningsEndcap += [ PixelLayerBinning ]
-            colors         += [ 3 ]
-             
-        
-        if DetFlags.SCT_on() :
-            # SCT building
-            SCT_LayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder')
-            SCT_LayerBuilder.PixelCase                       = False
-            SCT_LayerBuilder.Identification                  = 'SCT1'
-            SCT_LayerBuilder.SiDetManagerLocation            = 'SCT'
-            # general steering
-            SCT_LayerBuilder.SplitMode                       = TrkDetFlags.SCT_SplitMode()
-            # SCT barrel specifications
-            SCT_LayerBuilder.BarrelLayerBinsZ                = TrkDetFlags.SCT_BarrelLayerMaterialBinsZ()
-            SCT_LayerBuilder.BarrelLayerBinsPhi              = TrkDetFlags.SCT_BarrelLayerMaterialBinsPhi()
-            # SCT endcap specifications                          
-            SCT_LayerBuilder.EndcapLayerBinsR                = TrkDetFlags.SCT_EndcapLayerMaterialBinsR()
-            SCT_LayerBuilder.EndcapLayerBinsPhi              = TrkDetFlags.SCT_EndcapLayerMaterialBinsPhi()
-            # SCT_LayerBuilder.EndcapComplexRingBinning        = TrkDetFlags.SCT_EndcapLayerDynamicRings()
-            # set the layer association                   
-            SCT_LayerBuilder.SetLayerAssociation             = setLayerAssociation        
-            # output level                                 
-            SCT_LayerBuilder.OutputLevel                     = TrkDetFlags.SCT_BuildingOutputLevel()
-            # the binning type of the layer     
-            SCT_LayerBinning = 2
-            # SCT -> ToolSvc                             
-            ToolSvc += SCT_LayerBuilder                       
-            # the layer providers
-            SCT_LayerProvider = Trk__LayerProvider(name=namePrefix+'SCT_LayerProvider')
-            SCT_LayerProvider.LayerBuilder = SCT_LayerBuilder
-            ToolSvc += SCT_LayerProvider
-
-            # put them to the caches
-            layerProviders  += [ SCT_LayerProvider ]
-            binningsCenter += [ SCT_LayerBinning ]
-            binningsEndcap += [ SCT_LayerBinning ]
-            colors         += [ 4 ]
-                                                              
-            # the split and the second SCT layer builder is needed if the SCT outer barrel
-            # spans over the full width      
-            if TrkDetFlags.SCT_SplitMode() != 0 :
-              print ("[SLHC_GeometryBuilder] Building SCT layers in split mode")
-              from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilder
-              SCT_LayerBuilder2 = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder2')
-            
-              # switch of the pixel case
-              SCT_LayerBuilder2.PixelCase                = False
-              SCT_LayerBuilder2.SiDetManagerLocation     = 'SCT'
-              # set the general parameters
-              SCT_LayerBuilder2.OutputLevel              = 2
-              SCT_LayerBuilder2.SplitMode                = TrkDetFlags.SCT_SplitMode()
-              SCT_LayerBuilder2.Identification           = "SCT2"
-              # SCT barrel specifications
-              SCT_LayerBuilder2.BarrelLayerBinsZ         = TrkDetFlags.SCT_BarrelLayerMaterialBinsZ()
-              SCT_LayerBuilder2.BarrelLayerBinsPhi       = TrkDetFlags.SCT_BarrelLayerMaterialBinsPhi()
-              # SCT endcap specifications                     
-              SCT_LayerBuilder2.EndcapLayerBinsR         = TrkDetFlags.SCT_EndcapLayerMaterialBinsR()
-              SCT_LayerBuilder2.EndcapLayerBinsPhi       = TrkDetFlags.SCT_EndcapLayerMaterialBinsPhi()
-              # set the layer association
-              SCT_LayerBuilder2.SetLayerAssociation = setLayerAssociation        
-              # output level
-              SCT_LayerBuilder2.OutputLevel         = TrkDetFlags.SCT_BuildingOutputLevel()
-              ToolSvc += SCT_LayerBuilder2
-              # the layer providers
-              SCT_LayerProvider2 = Trk__LayerProvider(name=namePrefix+'SCT_LayerProvider2')
-              SCT_LayerProvider2.LayerBuilder = SCT_LayerBuilder2
-              ToolSvc += SCT_LayerProvider2
-              # put them to the caches
-              layerProviders  += [ SCT_LayerProvider2 ] 
-              binningsCenter += [ SCT_LayerBinning ]
-              binningsEndcap += [ SCT_LayerBinning ]
-              colors         += [ 5 ]
-
-        
-        # helpers for the InDetTrackingGeometry Builder : layer array creator
-        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerArrayCreator
-        InDetLayerArrayCreator = Trk__LayerArrayCreator(name = 'InDetLayerArrayCreator')
-        InDetLayerArrayCreator.EmptyLayerMode           = 2 # deletes empty material layers from arrays
-        InDetLayerArrayCreator.OutputLevel              = TrkDetFlags.InDetBuildingOutputLevel()
-        # add to ToolSvc
-        ToolSvc += InDetLayerArrayCreator
-
-        # helpers for the InDetTrackingGeometry Builder : volume array creator
-        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeArrayCreator
-        InDetTrackingVolumeArrayCreator                       = Trk__TrackingVolumeArrayCreator(name = 'InDetTrackingVolumeArrayCreator')
-        InDetTrackingVolumeArrayCreator.OutputLevel           = TrkDetFlags.InDetBuildingOutputLevel()
-        # add to ToolSvc
-        ToolSvc += InDetTrackingVolumeArrayCreator
-        
-        # helpers for the InDetTrackingGeometry Builder : tracking voluem helper for glueing
-        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper
-        InDetTrackingVolumeHelper                             = Trk__TrackingVolumeHelper(name ='InDetTrackingVolumeHelper')
-        InDetTrackingVolumeHelper.OutputLevel                 = TrkDetFlags.InDetBuildingOutputLevel()
-        # the material bins 
-        InDetTrackingVolumeHelper.BarrelLayerBinsZ            = TrkDetFlags.InDetPassiveLayerMaterialBinsRz()
-        InDetTrackingVolumeHelper.BarrelLayerBinsPhi          = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi() 
-        InDetTrackingVolumeHelper.EndcapLayerBinsR            = TrkDetFlags.InDetPassiveLayerMaterialBinsRz()
-        InDetTrackingVolumeHelper.EndcapLayerBinsPhi          = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi() 
-        # add to ToolSvc
-        ToolSvc += InDetTrackingVolumeHelper
-        
-        # helpers for the InDetTrackingGeometry Builder : cylinder volume creator
-        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator
-        InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = 'InDetCylinderVolumeCreator')
-        # give him the layer array creator
-        InDetCylinderVolumeCreator.LayerArrayCreator          = InDetLayerArrayCreator
-        InDetCylinderVolumeCreator.TrackingVolumeArrayCreator = InDetTrackingVolumeArrayCreator
-        InDetCylinderVolumeCreator.TrackingVolumeHelper       = InDetTrackingVolumeHelper
-        # specifiy the binning, passive layers, entry layers
-        InDetCylinderVolumeCreator.PassiveLayerThickness      = TrkDetFlags.InDetPassiveLayerThickness()  
-        InDetCylinderVolumeCreator.PassiveLayerBinsPhi        = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi()  
-        InDetCylinderVolumeCreator.PassiveLayerBinsRZ         = TrkDetFlags.InDetPassiveLayerMaterialBinsRz()  
-        # output level                                       
-        InDetCylinderVolumeCreator.OutputLevel                = TrkDetFlags.InDetBuildingOutputLevel()        
-        # add to ToolSvc
-        ToolSvc += InDetCylinderVolumeCreator        
-        
-        # the envelope definition service
-        from SubDetectorEnvelopes.SubDetectorEnvelopesConf import DetDescrDBEnvelopeSvc
-        AtlasEnvelopeSvc = DetDescrDBEnvelopeSvc('AtlasEnvelopeSvcDefinitionSvc')
-        # set the output level for the Envelope service
-        AtlasEnvelopeSvc.OutputLevel      = TrkDetFlags.InDetBuildingOutputLevel()  
-        # add to SvcMgr
-        ServiceMgr += AtlasEnvelopeSvc
-        
-        # the tracking geometry builder
-        InDet__StagedTrackingGeometryBuilder.__init__(self,namePrefix+name,\
-                                                      BeamPipeBuilder           = BeamPipeBuilder,\
-                                                      LayerBuilders             = layerProviders,
-                                                      LayerBinningTypeCenter    = binningsCenter,
-                                                      LayerBinningTypeEndcap    = binningsEndcap,
-                                                      ColorCodes                = colors,
-                                                      EnvelopeDefinitionSvc     = AtlasEnvelopeSvc,
-                                                      # VolumeEnclosureDiscPositions = [ 3000., 3450. ],
-                                                      TrackingVolumeCreator     = InDetCylinderVolumeCreator,
-                                                      LayerArrayCreator         = InDetLayerArrayCreator,
-                                                      BuildBoundaryLayers       = True,
-                                                      # ReplaceAllJointBoundaries = TrkDetFlags.InDetBuildMaterialBoundaries(),
-                                                      OutputLevel               = TrkDetFlags.InDetBuildingOutputLevel(),
-                                                      ExitVolumeName            = TrkDetFlags.InDetContainerName(),
-                                                      MagneticFieldMode         = TrkDetFlags.MagneticFieldMode(),
-                                                      isSLHC = True)
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
index 2bd6f588ca39..1a2deca5a234 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilder.cxx
@@ -71,7 +71,7 @@ InDet::RobustTrackingGeometryBuilder::RobustTrackingGeometryBuilder(const std::s
   // volume namespace & contaienr name
   declareProperty("VolumeNamespace",                  m_namespace); 
   declareProperty("ExitVolumeName",                   m_exitVolume);
-  declareProperty("isSLHC",                           m_isSLHC=false);
+  declareProperty("isITk",                            m_isITk=false);
 }
 
 // destructor
@@ -389,7 +389,7 @@ const Trk::TrackingGeometry* InDet::RobustTrackingGeometryBuilder::trackingGeome
        double currentCentralOuterR  = 0.;
        double currentEndcapOuterR   = 0.;
        
-       if (m_isSLHC){
+       if (m_isITk){
 	       double NextInnerRadii = ((ilb!=cylinderOuterRadii.size()-1) && cylinderInnerRadii[ilb+1]<discInnerRadii[ilb+1]) ? cylinderInnerRadii[ilb+1] : discInnerRadii[ilb+1]; 
 	       currentCentralOuterR = (ilb!=cylinderOuterRadii.size()-1) ? 0.5*(NextInnerRadii+cylinderOuterRadii[ilb]) : overallRmax;
 	       currentEndcapOuterR = (ilb!=discOuterRadii.size()-1) ? 0.5*(NextInnerRadii+discOuterRadii[ilb]) : overallRmax;
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
index ae02b8208c18..0f7948a3b6d8 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/RobustTrackingGeometryBuilderCond.cxx
@@ -72,7 +72,7 @@ InDet::RobustTrackingGeometryBuilderCond::RobustTrackingGeometryBuilderCond(cons
   // volume namespace & contaienr name
   declareProperty("VolumeNamespace",                  m_namespace); 
   declareProperty("ExitVolumeName",                   m_exitVolume);
-  declareProperty("isSLHC",                           m_isSLHC=false);
+  declareProperty("isITk",                            m_isITk=false);
 }
 
 // destructor
@@ -401,7 +401,7 @@ std::pair<EventIDRange, const Trk::TrackingGeometry*> InDet::RobustTrackingGeome
        double currentCentralOuterR  = 0.;
        double currentEndcapOuterR   = 0.;
        
-       if (m_isSLHC){
+       if (m_isITk){
 	       double NextInnerRadii = ((ilb!=cylinderOuterRadii.size()-1) && cylinderInnerRadii[ilb+1]<discInnerRadii[ilb+1]) ? cylinderInnerRadii[ilb+1] : discInnerRadii[ilb+1]; 
 	       currentCentralOuterR = (ilb!=cylinderOuterRadii.size()-1) ? 0.5*(NextInnerRadii+cylinderOuterRadii[ilb]) : overallRmax;
 	       currentEndcapOuterR = (ilb!=discOuterRadii.size()-1) ? 0.5*(NextInnerRadii+discOuterRadii[ilb]) : overallRmax;
diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/python/InDetDxAODUtils.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/python/InDetDxAODUtils.py
index 40086cc2934a..06ee5df4e4ea 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/python/InDetDxAODUtils.py
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/python/InDetDxAODUtils.py
@@ -1,7 +1,6 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 from InDetPrepRawDataToxAOD.InDetDxAODJobProperties import InDetDxAODFlags
 from InDetRecExample.TrackingCommon  import setDefaults
-from InDetRecExample.InDetJobProperties import InDetFlags
 import InDetRecExample.TrackingCommon as TrackingCommon
 from AthenaCommon.GlobalFlags import globalflags
 from PrimaryDPDMaker.PrimaryDPDFlags import jobproperties
@@ -50,7 +49,7 @@ def getPixelPrepDataToxAOD(name='xAOD_PixelPrepDataToxAOD', **kwargs) :
                                                OutputLevel         = INFO,
                                                UseTruthInfo        = (add_IDTIDE_content and isIdTrkDxAODSimulation),
                                                WriteRDOinformation = InDetDxAODFlags.DumpPixelRdoInfo() or add_IDTIDE_content,
-                                               WriteNNinformation  = (InDetDxAODFlags.DumpPixelNNInfo() or add_IDTIDE_content) and not InDetFlags.doSLHC(),
+                                               WriteNNinformation  = InDetDxAODFlags.DumpPixelNNInfo() or add_IDTIDE_content,
                                                # ,WriteSDOs            = True
                                                # ,WriteSiHits          = True # if available
                                               ) )
diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
index 8cfb63cd7582..4b8576c8cf94 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py
@@ -72,9 +72,6 @@ pixelClusterThinningExpression = InDetDxAODFlags.PixelClusterThinningExpression(
 if ( 'dumpTruthInfo' in dir() ):
     dumpTruthInfo = dumpTruthInfo and isIdTrkDxAODSimulation
 
-if InDetFlags.doSLHC():
-    dumpTrtInfo=False
-
 if isIdTrkDxAODSimulation:
     # should only be used for data
     TrtZSel=False
diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/PixelxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/PixelxAOD.py
index d842bd5408ea..420b3821065c 100644
--- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/PixelxAOD.py
+++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/PixelxAOD.py
@@ -96,8 +96,6 @@ xAOD_PixelPrepDataToxAOD.WriteRDOinformation  = True
 xAOD_PixelPrepDataToxAOD.WriteNNinformation   = InDetDxAODFlags.DumpPixelNNInfo()
 #xAOD_PixelPrepDataToxAOD.WriteSDOs            = True
 #xAOD_PixelPrepDataToxAOD.WriteSiHits          = True # if available
-if InDetFlags.doSLHC():
-    xAOD_PixelPrepDataToxAOD.WriteNNinformation=False
 
 IDDerivationSequence += xAOD_PixelPrepDataToxAOD
 if (printIdTrkDxAODConf):
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py
index c3df29b70e63..54d98ec3358a 100755
--- a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.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
 
 #########################################################################
 # ConfiguredNewtrackingCuts class
@@ -272,22 +272,6 @@ class ConfiguredNewTrackingCuts :
       self.__minSiNotShared   = 5
       self.__rejectShortExtensions = False
 
-
-    # --- SLHC setup
-    if mode == "SLHC":
-      self.__extension               = "SLHC"
-      # --- higher pt cut and impact parameter cut
-      self.__minPT                   = 0.9 * Units.GeV
-      self.__maxPrimaryImpact        = 2.0 * Units.mm # highlumi
-      self.__maxZImpact              = 250.0 * Units.mm
-
-      # --- cluster cuts
-      self.__minClusters             = 9
-      self.__minSiNotShared          = 8
-
-      # --- also tighten pattern cuts
-      self.__radMax                  = 1000. * Units.mm
-
     # --- IBL setup
     if mode == "IBL" :
       self.__extension               = "IBL"
@@ -421,23 +405,6 @@ class ConfiguredNewTrackingCuts :
         self.__maxPT            = 1000000 * Units.GeV # Won't accept None *NEEDS FIXING*
         self.__maxPrimaryImpact = 100.0 * Units.mm
 
-    if mode == "SLHCConversionFinding":
-      self.__extension        = "SLHCConversionFinding" # this runs parallel to NewTracking
-      self.__minPT                   = 0.9 * Units.GeV
-      self.__maxPrimaryImpact        = 10.0 * Units.mm
-      self.__maxZImpact              = 150.0 * Units.mm
-      self.__minClusters             = 6
-      self.__minSiNotShared          = 4
-      self.__maxHoles                = 0
-
-      # --- also tighten pattern cuts
-      self.__radMax                  = 1000. * Units.mm
-      self.__radMin                  = 0. * Units.mm # not turn on this cut for now
-
-      # --- turn on Z Boundary seeding
-      self.__doZBoundary              = False #
-
-
     # --- change defaults for very low pt tracking
     if mode == "VeryLowPt":
       self.__extension        = "VeryLowPt" # this runs parallel to NewTracking
@@ -478,44 +445,6 @@ class ConfiguredNewTrackingCuts :
 
       self.__useTRT           = False # no TRT for forward tracks
 
-
-    if mode == "ForwardSLHCTracks":
-      self.__extension        = "ForwardSLHCTracks" # this runs parallel to NewTracking
-      self.__minEta           = 2.4 # restrict to minimal eta
-      self.__maxEta           = 3.0
-      self.__minPT            = 0.9 * Units.GeV
-      self.__minClusters      = 5
-      self.__minSiNotShared   = 3
-      self.__maxShared        = 1
-      self.__minPixel         = 3
-      self.__maxHoles         = 1
-      self.__maxPixelHoles    = 1
-      self.__maxSctHoles      = 1
-      self.__maxDoubleHoles   = 0
-      self.__nHolesMax        = self.__maxHoles
-      self.__nHolesGapMax     = self.__maxHoles
-      self.__radMax           = 600. * Units.mm
-
-      self.__useTRT           = False # no TRT for forward tracks
-
-    if mode == "VeryForwardSLHCTracks":
-      self.__extension        = "VeryForwardSLHCTracks" # this runs parallel to NewTracking
-      self.__minEta           = 2.4 # restrict to minimal eta
-      self.__maxEta           = 4.0
-      self.__minPT            = 0.9 * Units.GeV
-      self.__minClusters      = 5
-      self.__minSiNotShared   = 3
-      self.__maxShared        = 1
-      self.__minPixel         = 3
-      self.__maxHoles         = 1
-      self.__maxPixelHoles    = 1
-      self.__maxSctHoles      = 0
-      self.__maxDoubleHoles   = 0
-      self.__nHolesMax        = self.__maxHoles
-      self.__nHolesGapMax     = self.__maxHoles
-      self.__radMax           = 600. * Units.mm
-      self.__useTRT           = False # no TRT for forward tracks
-
     # --- change defauls for beam gas tracking
     if mode == "BeamGas":
       self.__extension        = "BeamGas" # this runs parallel to NewTracking
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
index 678727dceac2..0393f3b56c4f 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
@@ -177,12 +177,6 @@ class doRefit(InDetFlagsJobProperty):
     allowedTypes = ['bool']
     StoredValue  = False
 
-class doSLHC(InDetFlagsJobProperty):
-    """Turn running of SLHC reconstruction on and off"""
-    statusOn     = True
-    allowedTypes = ['bool']
-    StoredValue  = False
-
 class doIBL(InDetFlagsJobProperty):
     """Turn running of IBL reconstruction on and off"""
     statusOn     = True
@@ -256,12 +250,6 @@ class doVeryLowPt(InDetFlagsJobProperty):
     allowedTypes = ['bool']
     StoredValue  = False
 
-class doSLHCConversionFinding(InDetFlagsJobProperty):
-    """Turn running of doSLHCConversionFinding second pass on and off"""
-    statusOn     = True
-    allowedTypes = ['bool']
-    StoredValue  = False
-
 class doForwardTracks(InDetFlagsJobProperty):
     """Turn running of doForwardTracks pass on and off"""
     statusOn     = True
@@ -1114,12 +1102,6 @@ class doTrackSegmentsDisappearing(InDetFlagsJobProperty):
     allowedTypes = ['bool']
     StoredValue  = True
 
-class doSLHCVeryForward(InDetFlagsJobProperty): 
-  """Turn running of SLHC reconstruction for Very Forward extension on and off""" 
-  statusOn     = True 
-  allowedTypes = ['bool']
-  StoredValue  = False 
-
 class doTRTGlobalOccupancy(InDetFlagsJobProperty): 
   """Turn running of Event Info TRT Occupancy Filling Alg on and off (also whether it is used in TRT PID calculation)""" 
   statusOn     = True 
@@ -1253,16 +1235,11 @@ class InDetJobProperties(JobPropertyContainer):
     if self.doHIP300 :
        self.checkThenSet(self.doRejectInvalidCov      ,True)
 
-    if self.doSLHCVeryForward():
-       self.checkThenSet(self.doSLHC            , True)
-       self.checkThenSet(self.doForwardTracks   , True)
-
     if (jobproperties.Beam.beamType()=="singlebeam"):
        self.checkThenSet(self.useHVForSctDCS         , True)    
        self.checkThenSet(self.doNewTracking          , False)
        self.checkThenSet(self.doLowPt                , False)
        self.checkThenSet(self.doVeryLowPt            , False)
-       self.checkThenSet(self.doSLHCConversionFinding, False)
        self.checkThenSet(self.doBeamGas              , True )
        self.checkThenSet(self.doBeamHalo             , True )
        self.checkThenSet(self.doParticleCreation     , True )
@@ -1285,7 +1262,6 @@ class InDetJobProperties(JobPropertyContainer):
        self.checkThenSet(self.doNewTracking          , True )
        self.checkThenSet(self.doLowPt                , False)
        self.checkThenSet(self.doVeryLowPt            , False)
-       self.checkThenSet(self.doSLHCConversionFinding, False)
        self.checkThenSet(self.doBeamGas              , False)
        self.checkThenSet(self.doBeamHalo             , False)
        self.checkThenSet(self.doBackTracking         , False)
@@ -1318,7 +1294,6 @@ class InDetJobProperties(JobPropertyContainer):
        self.checkThenSet(self.useZvertexTool         , True )
        self.checkThenSet(self.doLowPt                , False)
        self.checkThenSet(self.doVeryLowPt            , False)
-       self.checkThenSet(self.doSLHCConversionFinding, False)
        self.checkThenSet(self.doBackTracking         , False)
        self.checkThenSet(self.doTRTStandalone        , False)
        self.checkThenSet(self.doTrackSegmentsPixel   , False)
@@ -1346,38 +1321,6 @@ class InDetJobProperties(JobPropertyContainer):
        self.checkThenSet(self.perigeeExpression      , 'Vertex')
        #self.checkThenSet(self.doRefitInvalidCov      ,True) temporarily commenting out due to ATLASRECTS-4691
 
-    # --- special case SLHC
-    elif (self.doSLHC()):
-       print("----> InDetJobProperties for SLHC")
-       self.checkThenSet(self.doNewTracking          , True )
-       self.checkThenSet(self.doLowPt                , False)
-       self.checkThenSet(self.doVeryLowPt            , False)
-       self.checkThenSet(self.doSLHCConversionFinding, True )
-       self.checkThenSet(self.doBeamGas              , False)
-       self.checkThenSet(self.doBeamHalo             , False)
-       self.checkThenSet(self.doBackTracking         , False)
-       self.checkThenSet(self.doTRTStandalone        , False)
-       self.checkThenSet(self.doForwardTracks        , False)
-       self.checkThenSet(self.doR3LargeD0            , False)
-       self.checkThenSet(self.doVertexFinding        , True)
-       self.checkThenSet(self.primaryVertexSetup     , "IterativeFinding")
-       self.checkThenSet(self.primaryVertexCutSetup  , "SLHC")
-       self.checkThenSet(self.secondaryVertexCutSetup, "PileUp") 
-       self.checkThenSet(self.vertexSeedFinder       , "SlidingWindowMultiSeedFinder")
-       self.checkThenSet(self.doV0Finder             , False)
-       self.checkThenSet(self.doSimpleV0Finder       , False)
-       self.checkThenSet(self.doConversions          , False)
-       self.checkThenSet(self.doStatistics           , False)
-       self.checkThenSet(self.doTrackSegmentsPixel   , False)
-       self.checkThenSet(self.doTrackSegmentsSCT     , False)
-       self.checkThenSet(self.doTrackSegmentsTRT     , False)
-       self.checkThenSet(self.doSlimming             , False)
-       self.checkThenSet(self.doSGDeletion           , True )
-       # TEMPORARY FIX TO STOP SEG FAULT
-       self.checkThenSet(self.doPixelClusterSplitting, False)
-       self.checkThenSet(self.doTIDE_Ambi, False)
-       self.checkThenSet(self.doTrackSegmentsDisappearing, False)
-
     elif (self.doIBL()):
        print("----> InDetJobProperties for IBL")
        print("----> DEPRECATED! This should now be the default settings")
@@ -1409,7 +1352,6 @@ class InDetJobProperties(JobPropertyContainer):
        self.checkThenSet(self.doNewTracking          , True )
        self.checkThenSet(self.doLowPt                , False)
        self.checkThenSet(self.doVeryLowPt            , False)
-       self.checkThenSet(self.doSLHCConversionFinding, False)
        self.checkThenSet(self.doBeamGas              , False)
        self.checkThenSet(self.doBeamHalo             , False)
        self.checkThenSet(self.doBackTracking         , False)
@@ -1437,7 +1379,6 @@ class InDetJobProperties(JobPropertyContainer):
        self.checkThenSet(self.doNewTracking          , True )
        self.checkThenSet(self.doLowPt                , False)
        self.checkThenSet(self.doVeryLowPt            , False)
-       self.checkThenSet(self.doSLHCConversionFinding, False)
        self.checkThenSet(self.doBeamGas              , False)
        self.checkThenSet(self.doBeamHalo             , False)
        self.checkThenSet(self.doBackTracking         , False)
@@ -1477,7 +1418,6 @@ class InDetJobProperties(JobPropertyContainer):
        self.checkThenSet(self.doNewTracking          , True )
        self.checkThenSet(self.doLowPt                , False)
        self.checkThenSet(self.doVeryLowPt            , False)
-       self.checkThenSet(self.doSLHCConversionFinding, False)
        self.checkThenSet(self.doBeamGas              , False)
        self.checkThenSet(self.doBeamHalo             , False)
        self.checkThenSet(self.doBackTracking         , False)
@@ -1516,7 +1456,6 @@ class InDetJobProperties(JobPropertyContainer):
        self.checkThenSet(self.doNewTracking          , False )
        self.checkThenSet(self.doLowPt                , False )
        self.checkThenSet(self.doVeryLowPt            , False )
-       self.checkThenSet(self.doSLHCConversionFinding, False)
        self.checkThenSet(self.doForwardTracks        , False )
        self.checkThenSet(self.doR3LargeD0            , False )
        self.checkThenSet(self.doBeamGas              , False )
@@ -1760,8 +1699,6 @@ class InDetJobProperties(JobPropertyContainer):
       self.doLowPt       = self.doLowPt() and self.doNewTracking() and ( DetFlags.haveRIO.pixel_on() or DetFlags.haveRIO.SCT_on() ) and not self.doCosmics()
       # no low pt tracking if no new tracking before or if pixels are off (since low-pt tracking is pixel seeded)!      
       self.doVeryLowPt   = self.doVeryLowPt() and self.doLowPt()
-      #
-      self.doSLHCConversionFinding = self.doSLHCConversionFinding() and self.doSLHC() and self.doNewTracking() and ( DetFlags.haveRIO.pixel_on() and DetFlags.haveRIO.SCT_on() ) and not self.doCosmics()
       # new forward tracklets
       self.doForwardTracks = self.doForwardTracks() and self.doNewTracking()
       #
@@ -2168,12 +2105,6 @@ class InDetJobProperties(JobPropertyContainer):
        print('*')
        print('* --------------------> write AOD classes for all trackers!')
        print('*')
-    if self.doSLHC() :
-       print('*')
-       print('* --------------------> Special reconstruction for SLHC !')
-       if self.doSLHCVeryForward():
-          print('* --------------------> Including Very Forward Extension !')
-       print('*')
     if self.doIBL() :
        print('*')
        print('* --------------------> Special reconstruction for IBL !')
@@ -2354,10 +2285,6 @@ class InDetJobProperties(JobPropertyContainer):
        if self.doVeryLowPt() :
           print('* and VeryLowPtTracking is ON')
     # -----------------------------------------
-    if self.doSLHCConversionFinding() :
-       print('*')
-       print('* SLHCConversionFinding is ON')
-    # -----------------------------------------
     if self.doForwardTracks():
        print('*')
        print('* Forward Tracklets are ON')
@@ -2647,7 +2574,6 @@ _list_InDetJobProperties = [Enabled,
                             doTRT_PRDFormation,
                             doSpacePointFormation,
                             doRefit,
-                            doSLHC,
                             doIBL,
                             doHighPileup,
                             doMinimalReco,
@@ -2658,7 +2584,6 @@ _list_InDetJobProperties = [Enabled,
                             doBackTracking,
                             doLowPt,
                             doVeryLowPt,
-                            doSLHCConversionFinding,
                             doForwardTracks,
                             doLowPtLargeD0,
                             doLargeD0,
@@ -2798,7 +2723,6 @@ _list_InDetJobProperties = [Enabled,
                             ForceCoraCool,
                             ForceCoolVectorPayload,
                             doTrackSegmentsDisappearing,
-                            doSLHCVeryForward,
                             doTRTGlobalOccupancy,
                             doNNToTCalibration,
                             useNNTTrainedNetworks,
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py
index 9fe123b801b0..dd0178ec3cb3 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.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
 
 ##
 ## @file InDetRecExample/python/InDetKeys.py
@@ -404,12 +404,6 @@ class ExtendedTracksMapPhase(JobProperty):
     allowedTypes = ['str']
     StoredValue  = 'ExtendedTracksMapPhase'
 
-class ExtendedTracksMapSLHC(JobProperty):
-    """ Storegate key for new-tracking SLHC extended tracks map"""
-    statusOn     = True
-    allowedTypes = ['str']
-    StoredValue  = 'ExtendedTracksMapSLHC'
-
 class ExtendedTracksMapLowPt(JobProperty):
     """ Storegate key for new-tracking low Pt extended tracks map"""
     statusOn     = True
@@ -440,12 +434,6 @@ class ExtendedTracksPhase(JobProperty):
     allowedTypes = ['str']
     StoredValue  = 'ExtendedTracksPhase'
 
-class ExtendedSLHCTracks(JobProperty):
-    """ Storegate key for new-tracking extended SLHC tracks"""
-    statusOn     = True
-    allowedTypes = ['str']
-    StoredValue  = 'ExtendedSLHCTracks'
-
 class ExtendedLowPtTracks(JobProperty):
     """ Storegate key for new-tracking extended low Pt tracks"""
     statusOn     = True
@@ -628,13 +616,6 @@ class SiSPSeedSegments(JobProperty):
     allowedTypes = ['str']
     StoredValue  = 'SiSPSeedSegments'
 
-
-class SiSpSeededSLHCTracks(JobProperty):
-    """ Storegate key for new-tracking SP seeded SLHC tracks"""
-    statusOn     = True
-    allowedTypes = ['str']
-    StoredValue  = 'SiSPSeededSLHCTracks'
-
 class SiSpSeededLowPtTracks(JobProperty):
     """ Storegate key for new-tracking SP seeded low Pt tracks"""
     statusOn     = True
@@ -653,12 +634,6 @@ class SiSpSeededForwardTracks(JobProperty):
     allowedTypes = ['str']
     StoredValue  = 'SiSpSeededForwardTracks'
 
-class SiSpSeededSLHCConversionFindingTracks(JobProperty):
-    """ Storegate key for new-tracking SP seeded SLHC conversion finding tracks"""
-    statusOn     = True
-    allowedTypes = ['str']
-    StoredValue  = 'SiSpSeededSLHCConversionFindingTracks'
-
 class SiSpSeededBeamGasTracks(JobProperty):
     """ Storegate key for new-tracking SP seeded beam gas tracks"""
     statusOn     = True
@@ -677,12 +652,6 @@ class ResolvedTracks(JobProperty):
     allowedTypes = ['str']
     StoredValue  = 'ResolvedTracks'
 
-class ResolvedSLHCTracks(JobProperty):
-    """ Storegate key for new-tracking resolved SLHC tracks"""
-    statusOn     = True
-    allowedTypes = ['str']
-    StoredValue  = 'ResolvedSLHCTracks'
-
 class ResolvedLowPtTracks(JobProperty):
     """ Storegate key for new-tracking resolved low Pt tracks"""
     statusOn     = True
@@ -695,12 +664,6 @@ class ResolvedForwardTracks(JobProperty):
     allowedTypes = ['str']
     StoredValue  = 'ResolvedForwardTracks'
 
-class ResolvedSLHCConversionFindingTracks(JobProperty):
-    """ Storegate key for new-tracking resolved SLHC Conversion tracks"""
-    statusOn     = True
-    allowedTypes = ['str']
-    StoredValue  = 'ResolvedSLHCConversionFindingTracks'
-
 class ResolvedForwardTracksTruth(JobProperty):
     """ Storegate key for new-tracking resolved very forward tracks truth"""
     statusOn     = True
@@ -1088,13 +1051,11 @@ jobproperties.InDetContainerKeys.add_JobProperty(DetailedTracksTruth)
 jobproperties.InDetContainerKeys.add_JobProperty(TracksTruth)
 jobproperties.InDetContainerKeys.add_JobProperty(ExtendedTracksMap)
 jobproperties.InDetContainerKeys.add_JobProperty(ExtendedTracksMapPhase)
-jobproperties.InDetContainerKeys.add_JobProperty(ExtendedTracksMapSLHC)
 jobproperties.InDetContainerKeys.add_JobProperty(ExtendedTracksMapLowPt)
 jobproperties.InDetContainerKeys.add_JobProperty(ExtendedTracksMapBeamGas)
 jobproperties.InDetContainerKeys.add_JobProperty(ExtendedTracksMapLargeD0)
 jobproperties.InDetContainerKeys.add_JobProperty(ExtendedTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ExtendedTracksPhase)
-jobproperties.InDetContainerKeys.add_JobProperty(ExtendedSLHCTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ExtendedLowPtTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ExtendedBeamGasTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ExtendedLargeD0Tracks)
@@ -1128,21 +1089,17 @@ jobproperties.InDetContainerKeys.add_JobProperty(TRTTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(TRTTracks_NewT)
 jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(SiSPSeedSegments)
-jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededSLHCTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededLowPtTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededVeryLowPtTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededForwardTracks)
-jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededSLHCConversionFindingTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededBeamGasTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededLargeD0Tracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ResolvedTracks)
-jobproperties.InDetContainerKeys.add_JobProperty(ResolvedSLHCTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ResolvedLowPtTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ResolvedVeryLowPtTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ResolvedForwardTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ResolvedForwardTracksTruth)
 jobproperties.InDetContainerKeys.add_JobProperty(ResolvedForwardTrackParticles)
-jobproperties.InDetContainerKeys.add_JobProperty(ResolvedSLHCConversionFindingTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ResolvedForwardTrackParticlesTruth)
 jobproperties.InDetContainerKeys.add_JobProperty(ResolvedBeamGasTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(ResolvedLargeD0Tracks)
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
index 5e6cba4a78fe..bedfef9a2743 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
@@ -121,8 +121,6 @@ def getInDetNewTrackingCuts() :
         InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("Cosmics")
     elif InDetFlags.doHeavyIon():
         InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("HeavyIon")
-    elif InDetFlags.doSLHC():
-        InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("SLHC")
     elif InDetFlags.doIBL():
         InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("IBL")
     elif InDetFlags.doHighPileup():
@@ -386,9 +384,9 @@ def getInDetPixelClusterOnTrackToolBase(name, **kwargs) :
     kwargs = setDefaults(kwargs,
                          DisableDistortions       = (InDetFlags.doFatras() or InDetFlags.doDBMstandalone()),
                          applyNNcorrection        = ( InDetFlags.doPixelClusterSplitting() and
-                                                      InDetFlags.pixelClusterSplittingType() == 'NeuralNet' and not InDetFlags.doSLHC()),
+                                                      InDetFlags.pixelClusterSplittingType() == 'NeuralNet'),
                          NNIBLcorrection          = ( InDetFlags.doPixelClusterSplitting() and
-                                                      InDetFlags.pixelClusterSplittingType() == 'NeuralNet' and not InDetFlags.doSLHC()),
+                                                      InDetFlags.pixelClusterSplittingType() == 'NeuralNet'),
                          SplitClusterAmbiguityMap = InDetKeys.SplitClusterAmbiguityMap() + split_cluster_map_extension,
                          RunningTIDE_Ambi         = InDetFlags.doTIDE_Ambi() )
 
@@ -1015,7 +1013,7 @@ def getInDetTRT_dEdxTool(name = "InDetTRT_dEdxTool", **kwargs) :
     the_name = makeName( name, kwargs)
     from AthenaCommon.DetFlags import DetFlags
     from InDetRecExample.InDetJobProperties import InDetFlags
-    if not DetFlags.haveRIO.TRT_on() or InDetFlags.doSLHC() or InDetFlags.doHighPileup() \
+    if not DetFlags.haveRIO.TRT_on() or InDetFlags.doHighPileup() \
             or  InDetFlags.useExistingTracksAsInput(): # TRT_RDOs (used by the TRT_LocalOccupancy tool) are not present in ESD
         return None
 
@@ -1032,7 +1030,7 @@ def getInDetTRT_ElectronPidTool(name = "InDetTRT_ElectronPidTool", **kwargs) :
     the_name = makeName( name, kwargs)
     from AthenaCommon.DetFlags import DetFlags
     from InDetRecExample.InDetJobProperties import InDetFlags
-    if not DetFlags.haveRIO.TRT_on() or  InDetFlags.doSLHC() or  InDetFlags.doHighPileup() \
+    if not DetFlags.haveRIO.TRT_on() or  InDetFlags.doHighPileup() \
             or  InDetFlags.useExistingTracksAsInput(): # TRT_RDOs (used by the TRT_LocalOccupancy tool) are not present in ESD
         return None
 
@@ -1570,8 +1568,6 @@ def combinedClusterSplitProbName() :
         InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("Cosmics")
       elif InDetFlags.doHeavyIon():
         InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("HeavyIon")
-      elif InDetFlags.doSLHC():
-        InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("SLHC")
       elif InDetFlags.doIBL():
         InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("IBL")
       elif InDetFlags.doHighPileup():
@@ -1626,22 +1622,6 @@ def combinedClusterSplitProbName() :
       CombinedInDetClusterSplitProbContainer = ClusterSplitProbContainer
     if InDetFlags.doTRTStandalone():
       CombinedInDetClusterSplitProbContainer = ClusterSplitProbContainer
-    if InDetFlags.doForwardTracks() and InDetFlags.doSLHC():
-      if InDetFlags.doSLHCVeryForward():
-       if ('InDetNewTrackingCutsForwardTracks' not in dir()):
-         InDetNewTrackingCutsForwardTracks = ConfiguredNewTrackingCuts("VeryForwardSLHCTracks")
-         ClusterSplitProbContainer = 'InDetAmbiguityProcessorSplitProb'+InDetNewTrackingCutsForwardTracks.extension()
-         CombinedInDetClusterSplitProbContainer = ClusterSplitProbContainer
-      else:
-       if ('InDetNewTrackingCutsForwardTracks' not in dir()):
-        InDetNewTrackingCutsForwardTracks = ConfiguredNewTrackingCuts("ForwardSLHCTracks")
-        ClusterSplitProbContainer = 'InDetAmbiguityProcessorSplitProb'+InDetNewTrackingCutsForwardTracks.extension()
-        CombinedInDetClusterSplitProbContainer = ClusterSplitProbContainer
-    if InDetFlags.doSLHCConversionFinding() and InDetFlags.doSLHC():
-      if ('InDetNewTrackingCutsSLHCConversionFinding' not in dir()):
-        InDetNewTrackingCutsSLHCConversionFinding = ConfiguredNewTrackingCuts("SLHCConversionFinding")
-      ClusterSplitProbContainer = 'InDetAmbiguityProcessorSplitProb'+InDetNewTrackingCutsSLHCConversionFinding.extension()
-      CombinedInDetClusterSplitProbContainer = ClusterSplitProbContainer
     if InDetFlags.doBeamGas():
       if ('InDetNewTrackingCutsBeamGas' not in dir()):
         InDetNewTrackingCutsBeamGas = ConfiguredNewTrackingCuts("BeamGas")
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
index 9fe0a8baa9f1..98d1dac28a45 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
@@ -33,7 +33,7 @@ class  ConfiguredNewTrackingSiPattern:
       #
       # --- decide if use the association tool
       #
-      if (len(InputCollections) > 0) and (NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode() == "VeryLowPt" or NewTrackingCuts.mode() == "LargeD0" or NewTrackingCuts.mode() == "R3LargeD0" or NewTrackingCuts.mode() == "LowPtLargeD0" or NewTrackingCuts.mode() == "BeamGas" or NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "ForwardSLHCTracks"  or NewTrackingCuts.mode() == "Disappearing" or NewTrackingCuts.mode() == "VeryForwardSLHCTracks" or NewTrackingCuts.mode() == "SLHCConversionFinding"):
+      if (len(InputCollections) > 0) and (NewTrackingCuts.mode() == "LowPt" or NewTrackingCuts.mode() == "VeryLowPt" or NewTrackingCuts.mode() == "LargeD0" or NewTrackingCuts.mode() == "R3LargeD0" or NewTrackingCuts.mode() == "LowPtLargeD0" or NewTrackingCuts.mode() == "BeamGas" or NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "Disappearing"):
          usePrdAssociationTool = True
       else:
          usePrdAssociationTool = False
@@ -78,8 +78,6 @@ class  ConfiguredNewTrackingSiPattern:
             from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_LowMomentum as SiSpacePointsSeedMaker
          elif NewTrackingCuts.mode() == "BeamGas":
             from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_BeamGas as SiSpacePointsSeedMaker
-         elif NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode() == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "VeryForwardSLHCTracks" :
-            from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ITK as SiSpacePointsSeedMaker
          else:
             from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ATLxk as SiSpacePointsSeedMaker
 
@@ -150,14 +148,7 @@ class  ConfiguredNewTrackingSiPattern:
             except:
                pass 
             InDetSiSpacePointsSeedMaker.mindRadius         = 4.0
-         if NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode() == "SLHCConversionFinding":
-            InDetSiSpacePointsSeedMaker.minRadius1         = 0
-            InDetSiSpacePointsSeedMaker.minRadius2         = 0
-            InDetSiSpacePointsSeedMaker.minRadius3         = 0
-            InDetSiSpacePointsSeedMaker.maxRadius1         =1000.*Units.mm
-            InDetSiSpacePointsSeedMaker.maxRadius2         =1000.*Units.mm
-            InDetSiSpacePointsSeedMaker.maxRadius3         =1000.*Units.mm
-         if NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "VeryForwardSLHCTracks":
+         if NewTrackingCuts.mode() == "ForwardTracks":
             InDetSiSpacePointsSeedMaker.checkEta           = True
             InDetSiSpacePointsSeedMaker.etaMin             = NewTrackingCuts.minEta()
             InDetSiSpacePointsSeedMaker.etaMax             = NewTrackingCuts.maxEta()
@@ -265,7 +256,7 @@ class  ConfiguredNewTrackingSiPattern:
 
          ToolSvc += track_finder
 
-         useBremMode = NewTrackingCuts.mode() == "Offline" or NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode() == "DBM"
+         useBremMode = NewTrackingCuts.mode() == "Offline" or NewTrackingCuts.mode() == "DBM"
          from SiTrackMakerTool_xk.SiTrackMakerTool_xkConf import InDet__SiTrackMaker_xk as SiTrackMaker
          InDetSiTrackMaker = SiTrackMaker(name                      = 'InDetSiTrackMaker'+NewTrackingCuts.extension(),
                                           useSCT                    = NewTrackingCuts.useSCT(),
@@ -295,9 +286,6 @@ class  ConfiguredNewTrackingSiPattern:
                                           InputHadClusterContainerName = InDetKeys.HadCaloClusterROIContainer(), # "InDetCaloClusterROIs" 
                                           UseAssociationTool        = usePrdAssociationTool)
 
-         if NewTrackingCuts.mode() == "SLHC" or NewTrackingCuts.mode() == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "VeryForwardSLHCTracks" :
-            InDetSiTrackMaker.ITKGeometry = True
-
          if NewTrackingCuts.mode() == "DBM":
             InDetSiTrackMaker.MagneticFieldMode = "NoField"
             InDetSiTrackMaker.useBremModel = False
@@ -327,15 +315,6 @@ class  ConfiguredNewTrackingSiPattern:
          elif NewTrackingCuts.mode() == "ForwardTracks":
            InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_ForwardTracks'
 
-         elif NewTrackingCuts.mode() == "ForwardSLHCTracks":
-           InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_ForwardSLHCTracks'
-
-         elif NewTrackingCuts.mode() == "VeryForwardSLHCTracks": 
-           InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_VeryForwardSLHCTracks' 
-
-         elif NewTrackingCuts.mode() == "SLHCConversionFinding":
-           InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_SLHCConversionTracks'
-
          elif NewTrackingCuts.mode() == "LargeD0" or NewTrackingCuts.mode() == "R3LargeD0" or NewTrackingCuts.mode() == "LowPtLargeD0":
            InDetSiTrackMaker.TrackPatternRecoInfo = 'SiSpacePointsSeedMaker_LargeD0'
         
@@ -363,7 +342,7 @@ class  ConfiguredNewTrackingSiPattern:
 
          from SiSPSeededTrackFinder.SiSPSeededTrackFinderConf import InDet__SiSPSeededTrackFinder
 
-         if NewTrackingCuts.mode() == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "ForwardTracks":
+         if NewTrackingCuts.mode() == "ForwardTracks":
 
           InDetSiSPSeededTrackFinder = InDet__SiSPSeededTrackFinder(name             = 'InDetSiSpTrackFinder'+NewTrackingCuts.extension(),
                                                                     TrackTool        = InDetSiTrackMaker,
@@ -445,7 +424,7 @@ class  ConfiguredNewTrackingSiPattern:
 
          drift_circle_cut_tool = TrackingCommon.getInDetTRTDriftCircleCutForPatternReco() if use_parameterization else ''
 
-         if InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "DBM"):
+         if InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "DBM"):
            from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetDenseEnvAmbiTrackSelectionTool as AmbiTrackSelectionTool
          else:
            from InDetAmbiTrackSelectionTool.InDetAmbiTrackSelectionToolConf import InDet__InDetAmbiTrackSelectionTool as AmbiTrackSelectionTool
@@ -460,7 +439,7 @@ class  ConfiguredNewTrackingSiPattern:
                                                               UseParameterization = use_parameterization,
                                                               Cosmics             = InDetFlags.doCosmics(),
                                                               doPixelSplitting    = InDetFlags.doPixelClusterSplitting() and NewTrackingCuts.mode != "DBM")
-         if InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "DBM"):
+         if InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "DBM"):
            InDetAmbiTrackSelectionTool.sharedProbCut             = prob1
            InDetAmbiTrackSelectionTool.sharedProbCut2            = prob2
            InDetAmbiTrackSelectionTool.minSiHitsToAllowSplitting = nhitsToAllowSplitting
@@ -514,13 +493,13 @@ class  ConfiguredNewTrackingSiPattern:
          #
          # --- load Ambiguity Processor
          #
-         useBremMode = NewTrackingCuts.mode() == "Offline" or NewTrackingCuts.mode() == "SLHC"
+         useBremMode = NewTrackingCuts.mode() == "Offline"
 
          # @TODO is the cluster split probability container needed here ?
          ambi_track_summary_tool = TrackingCommon.getInDetTrackSummaryTool(namePrefix                 = 'InDetAmbiguityProcessorSplitProb',
                                                                            nameSuffix                 = NewTrackingCuts.extension(),
                                                                            ClusterSplitProbabilityName= 'InDetAmbiguityProcessorSplitProb'+NewTrackingCuts.extension())
-         if InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "DBM"):
+         if InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "DBM"):
            # DenseEnvironmentsAmbiguityScoreProcessorTool
            from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__DenseEnvironmentsAmbiguityScoreProcessorTool as ScoreProcessorTool
            InDetAmbiguityScoreProcessor = ScoreProcessorTool(name               = 'InDetAmbiguityScoreProcessor'+NewTrackingCuts.extension(),
@@ -595,7 +574,7 @@ class  ConfiguredNewTrackingSiPattern:
                                                  RefitPrds          = True)
            InDetAmbiguityScoreProcessor = None
 
-         if InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardSLHCTracks" or NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "DBM") and 'NnPixelClusterSplitProbTool' in globals() :
+         if InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardTracks" or NewTrackingCuts.mode() == "DBM") and 'NnPixelClusterSplitProbTool' in globals() :
            if InDetAmbiguityScoreProcessor is not None :
               InDetAmbiguityScoreProcessor.sharedProbCut             = prob1
               InDetAmbiguityScoreProcessor.sharedProbCut2            = prob2
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
index 4066006a93b0..ab234e905c1b 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
@@ -329,10 +329,6 @@ if DetFlags.haveRIO.SCT_on():
 
         if InDetFlags.useSctDCS():
             InDetSCT_ConditionsSummaryTool.ConditionsTools += [ InDetSCT_DCSConditionsTool ]
-       
-    # switch conditions off for SLHC usage
-    elif InDetFlags.doSLHC():
-        InDetSCT_ConditionsSummaryTool.ConditionsTools= []
       
     else :
         InDetSCT_ConditionsSummaryTool.ConditionsTools= [ InDetSCT_ConfigurationConditionsTool,
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
index cfe1ba96f253..61d4f9a187a5 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
@@ -19,7 +19,7 @@ if use_broad_cluster_sct is None :
 use_broad_cluster_any = use_broad_cluster_pix or use_broad_cluster_sct
 
 # load common NN tools for clustering and ROT creation
-if InDetFlags.doPixelClusterSplitting() and not InDetFlags.doSLHC():
+if InDetFlags.doPixelClusterSplitting():
 
     #
     # --- Neutral Network version ?
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py
index a7eb63b0b315..66915fc6d78c 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py
@@ -69,10 +69,7 @@ if InDetFlags.doPRDFormation():
             
             # --- new NN prob tool
             MultiplicityContent = [1 , 1 , 1]
-            if InDetFlags.doSLHC():
-                from SiClusterizationTool.SiClusterizationToolConf import InDet__TruthPixelClusterSplitProbTool as PixelClusterSplitProbTool
-            else:
-                from SiClusterizationTool.SiClusterizationToolConf import InDet__NnPixelClusterSplitProbTool as PixelClusterSplitProbTool
+            from SiClusterizationTool.SiClusterizationToolConf import InDet__NnPixelClusterSplitProbTool as PixelClusterSplitProbTool
             NnPixelClusterSplitProbTool=PixelClusterSplitProbTool(name                     = "NnPixelClusterSplitProbTool",
                                                                            PriorMultiplicityContent = MultiplicityContent,
                                                                            NnClusterizationFactory  = NnClusterizationFactory,
@@ -85,10 +82,7 @@ if InDetFlags.doPRDFormation():
             clusterSplitProbTool = NnPixelClusterSplitProbTool
             
             # --- new NN splitter
-            if InDetFlags.doSLHC():
-                from SiClusterizationTool.SiClusterizationToolConf import InDet__TruthPixelClusterSplitter as PixelClusterSplitter
-            else:
-                from SiClusterizationTool.SiClusterizationToolConf import InDet__NnPixelClusterSplitter as PixelClusterSplitter
+            from SiClusterizationTool.SiClusterizationToolConf import InDet__NnPixelClusterSplitter as PixelClusterSplitter
             NnPixelClusterSplitter=PixelClusterSplitter(name                                = "NnPixelClusterSplitter",
                                                                  NnClusterizationFactory             = NnClusterizationFactory,
                                                                  ThresholdSplittingIntoTwoClusters   = 0.5, # temp.
@@ -246,9 +240,6 @@ if InDetFlags.doSpacePointFormation():
    from SiSpacePointTool.SiSpacePointToolConf import InDet__SiSpacePointMakerTool
    InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool(name = "InDetSiSpacePointMakerTool")
 
-   if InDetFlags.doSLHC():
-      InDetSiSpacePointMakerTool.SCTGapParameter = 0.0015
-
    if InDetFlags.doCosmics() or InDetFlags.doBeamHalo():
       InDetSiSpacePointMakerTool.StripLengthTolerance       = 0.05
       InDetSiSpacePointMakerTool.UsePerpendicularProjection = True
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
index 72e2211468e9..5b118c7a7f12 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
@@ -80,8 +80,6 @@ else:
         InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("Cosmics")
       elif InDetFlags.doHeavyIon():
         InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("HeavyIon")
-      elif InDetFlags.doSLHC():
-        InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("SLHC")
       elif InDetFlags.doIBL():
         InDetNewTrackingCuts      = ConfiguredNewTrackingCuts("IBL")
       elif InDetFlags.doHighPileup():
@@ -118,12 +116,6 @@ else:
       InDetSpSeededTracksKey    = InDetKeys.SiSpSeededDBMTracks()
       InDetResolvedTracksKey    = InDetKeys.DBMTracks()
 
-    if InDetFlags.doSLHC():
-      InDetSpSeededTracksKey    = InDetKeys.SiSpSeededSLHCTracks()
-      InDetResolvedTracksKey    = InDetKeys.ResolvedSLHCTracks()
-      InDetExtendedTracksKey    = InDetKeys.ExtendedSLHCTracks()
-      InDetExtendedTracksMapKey = InDetKeys.ExtendedTracksMapSLHC()
-
     if globalflags.InputFormat() == 'bytestream':
       ServiceMgr.ByteStreamCnvSvc.IsSimulation = (globalflags.DataSource() == 'geant4')
 
@@ -637,56 +629,6 @@ else:
         ClusterSplitProbContainer = ClusterSplitProbContainerLargeD0
         InputForwardInDetTracks +=[ InDetLargeD0TRTExtension.ForwardTrackCollection()]
 
-    if InDetFlags.doForwardTracks() and InDetFlags.doSLHC():
-      if InDetFlags.doSLHCVeryForward():
-       if ('InDetNewTrackingCutsForwardTracks' not in dir()):
-         printfunc ("InDetRec_jobOptions: InDetNewTrackingCutsForwardTracks not set before - import them now"       )
-         from InDetRecExample.ConfiguredNewTrackingCuts import ConfiguredNewTrackingCuts 
-         InDetNewTrackingCutsForwardTracks = ConfiguredNewTrackingCuts("VeryForwardSLHCTracks") 
-         InDetNewTrackingCutsForwardTracks.printInfo() 
-         # 
-         # --- now run Si pattern for Low Pt 
-         # 
-         include ("InDetRecExample/ConfiguredNewTrackingSiPattern.py") 
-         InDetForwardTracksSiPattern = ConfiguredNewTrackingSiPattern(InputForwardInDetTracks,
- 		                                                      InDetKeys.ResolvedForwardTracks(), 
- 		                                                      InDetKeys.SiSpSeededForwardTracks(), 
- 		                                                      InDetNewTrackingCutsForwardTracks, 
- 		                                                      TrackCollectionKeys,
- 		                                                      TrackCollectionTruthKeys,
- 		                                                      ClusterSplitProbContainer)
-         ClusterSplitProbContainer = 'InDetAmbiguityProcessorSplitProb'+InDetNewTrackingCutsForwardTracks.extension()
-         # for ITK, forward tracks get added to the combined collection
-         CombinedInDetClusterSplitProbContainer = ClusterSplitProbContainer
-         InputCombinedInDetTracks += [ InDetForwardTracksSiPattern.SiTrackCollection() ] 
-
-
-      else:
-       if ('InDetNewTrackingCutsForwardTracks' not in dir()):
-        printfunc ("InDetRec_jobOptions: InDetNewTrackingCutsForwardTracks not set before - import them now"      )
-        from InDetRecExample.ConfiguredNewTrackingCuts import ConfiguredNewTrackingCuts
-        InDetNewTrackingCutsForwardTracks = ConfiguredNewTrackingCuts("ForwardSLHCTracks")
-        InDetNewTrackingCutsForwardTracks.printInfo()
-        #
-        # --- now run Si pattern for Low Pt
-        #
-        include ("InDetRecExample/ConfiguredNewTrackingSiPattern.py")
-        InDetForwardTracksSiPattern = ConfiguredNewTrackingSiPattern(InputForwardInDetTracks,
-                                                                   InDetKeys.ResolvedForwardTracks(),
-                                                                   InDetKeys.SiSpSeededForwardTracks(),
-                                                                   InDetNewTrackingCutsForwardTracks,
-                                                                   TrackCollectionKeys,
-                                                                   TrackCollectionTruthKeys,
-                                                                   ClusterSplitProbContainer)
-        ClusterSplitProbContainer = 'InDetAmbiguityProcessorSplitProb'+InDetNewTrackingCutsForwardTracks.extension()
-        # for ITK, forward tracks get added to the combined collection
-        CombinedInDetClusterSplitProbContainer = ClusterSplitProbContainer
-        InputCombinedInDetTracks += [ InDetForwardTracksSiPattern.SiTrackCollection() ]
-
-
-
-
-    elif InDetFlags.doForwardTracks():
       #
       # --- configure cuts for forward tracklets
       #
@@ -711,31 +653,6 @@ else:
       # CombinedInDetClusterSplitProbContainer = ClusterSplitProbContainer
       # InputCombinedInDetTracks += [ InDetForwardTracksSiPattern.SiTrackCollection() ]
 
-    if InDetFlags.doSLHCConversionFinding() and InDetFlags.doSLHC():
-      #
-      # --- configure cuts for Low Pt tracking
-      #
-      if ('InDetNewTrackingCutsSLHCConversionFinding' not in dir()):
-        printfunc ("InDetRec_jobOptions: InDetNewTrackingCutsSLHCConversionFinding not set before - import them now")
-        from InDetRecExample.ConfiguredNewTrackingCuts import ConfiguredNewTrackingCuts
-        InDetNewTrackingCutsSLHCConversionFinding = ConfiguredNewTrackingCuts("SLHCConversionFinding")
-      InDetNewTrackingCutsSLHCConversionFinding.printInfo()
-      #
-      #
-      include ("InDetRecExample/ConfiguredNewTrackingSiPattern.py")
-      InDetSLHCConversionFindingSiPattern = ConfiguredNewTrackingSiPattern(InputCombinedInDetTracks,
-                                                           InDetKeys.ResolvedSLHCConversionFindingTracks(),
-                                                           InDetKeys.SiSpSeededSLHCConversionFindingTracks(),
-                                                           InDetNewTrackingCutsSLHCConversionFinding,
-                                                           TrackCollectionKeys,
-                                                           TrackCollectionTruthKeys,
-                                                           ClusterSplitProbContainer)
-      ClusterSplitProbContainer = 'InDetAmbiguityProcessorSplitProb'+InDetNewTrackingCutsSLHCConversionFinding.extension()
-
-      CombinedInDetClusterSplitProbContainer = ClusterSplitProbContainer
-      InputCombinedInDetTracks += [ InDetKeys.ResolvedSLHCConversionFindingTracks() ]
-
-
     # ------------------------------------------------------------
     #
     # --- Pixel Tracklets on unassociated PRDs (after standard reconstruction + forward tracking)
@@ -941,9 +858,6 @@ else:
                                                         MinDegreesOfFreedom = 1,
                                                         MatEffects          =  InDetFlags.materialInteractionsType(),
                                                         MinSiHits           =  InDetNewTrackingCuts.minClusters() )
-        if InDetFlags.doForwardTracks() and InDetFlags.doSLHC():
-            InDetTruthTrackBuilder.MinSiHitsForward = InDetNewTrackingCutsForwardTracks.minClusters()
-            InDetTruthTrackBuilder.ForwardBoundary  = InDetNewTrackingCutsForwardTracks.minEta()
 #        InDetTruthTrackBuilder.OutputLevel = VERBOSE
         ToolSvc += InDetTruthTrackBuilder
 
@@ -965,7 +879,7 @@ else:
                                          InDetPRD_Provider               = InDetPRD_Provider,
                                          MinimumPt                       =  InDetNewTrackingCuts.minPT(),
                                          PRD_TruthTrajectoryManipulators = [ InDetTruthTrajectorySorter ])
-        if not InDetFlags.doSLHC() and not InDetFlags.doIdealPseudoTracking():
+        if not InDetFlags.doIdealPseudoTracking():
          # --- the trajectory manipulator
             from InDetTruthTools.InDetTruthToolsConf import InDet__PRD_TruthTrajectoryManipulatorID
             InDetTruthTrajectoryManipulator = InDet__PRD_TruthTrajectoryManipulatorID(name='InDetTruthTrajectoryManipulator')
@@ -983,7 +897,7 @@ else:
 
         # --- the (1st) trajectory selector
         PRD_TruthTrajectorySelector = []
-        if not InDetFlags.doSLHC() and not InDetFlags.doSplitReco() :
+        if not InDetFlags.doSplitReco() :
           from InDetTruthTools.InDetTruthToolsConf import InDet__PRD_TruthTrajectorySelectorID
           InDetTruthTrajectorySelector = InDet__PRD_TruthTrajectorySelectorID(name='InDetTruthTrajectorySelector')
           ToolSvc += InDetTruthTrajectorySelector
@@ -1358,8 +1272,6 @@ else:
         cuts = InDetNewTrackingCutsVeryLowPt
       elif InDetFlags.doLowPt():
         cuts = InDetNewTrackingCutsLowPt
-      elif InDetFlags.doSLHCConversionFinding():
-        cuts = InDetNewTrackingCutsSLHCConversionFinding
       else:
         cuts = InDetNewTrackingCuts
       include("InDetRecExample/ConfiguredInDetValidation.py")
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
index abdbf0ec4ba8..0f353bc5aa48 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
@@ -204,7 +204,7 @@ if not InDetFlags.doVertexFinding():
             topSequence += xAODVertexCnvAlgDBM
 
 #For forward tracks, no separate collection for ITK, since they are already merged
-if (InDetFlags.doForwardTracks() and InDetFlags.doParticleCreation() and not InDetFlags.doSLHC()) or doConversion:
+if (InDetFlags.doForwardTracks() and InDetFlags.doParticleCreation()) or doConversion:
     if doCreation :
         createTrackParticles(InDetKeys.ResolvedForwardTracks(), InDetKeys.ResolvedForwardTracksTruth(), InDetKeys.xAODForwardTrackParticleContainer(),topSequence)
     if doConversion :
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
index 81c00fe125d8..1b2b2cf3da5d 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
@@ -38,9 +38,8 @@ if InDetFlags.doxAOD():
     prefix=extractCollectionPrefix(col)
     InDetAODList+=['xAOD::TrackParticleContainer#'+prefix+'TrackParticles']
     InDetAODList+=['xAOD::TrackParticleAuxContainer#'+prefix+'TrackParticlesAux.' + excludedAuxData]
-  if not InDetFlags.doSLHC():
-   InDetAODList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODForwardTrackParticleContainer()]
-   InDetAODList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODForwardTrackParticleContainer()+'Aux.' + excludedAuxData]
+  InDetAODList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODForwardTrackParticleContainer()]
+  InDetAODList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODForwardTrackParticleContainer()+'Aux.' + excludedAuxData]
   InDetAODList+=['xAOD::VertexContainer#'+InDetKeys.xAODVertexContainer()]
   InDetAODList+=['xAOD::VertexAuxContainer#'+InDetKeys.xAODVertexContainer()+'Aux.' + excludedVertexAuxData]
   InDetAODList+=['xAOD::VertexContainer#'+InDetKeys.xAODV0VertexContainer()]
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
index 193050b56964..8bea0665f005 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
@@ -160,9 +160,8 @@ if InDetFlags.doxAOD():
      InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.SiSPSeedSegments()+"TrackParticle"]
      InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.SiSPSeedSegments()+"TrackParticle"+'Aux.' + excludedAuxData]
 
-  if not InDetFlags.doSLHC():
-     InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODForwardTrackParticleContainer()]
-     InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODForwardTrackParticleContainer()+'Aux.' + excludedAuxData ]
+  InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODForwardTrackParticleContainer()]
+  InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODForwardTrackParticleContainer()+'Aux.' + excludedAuxData ]
   InDetESDList+=['xAOD::VertexContainer#'+InDetKeys.xAODVertexContainer()]
   InDetESDList+=['xAOD::VertexAuxContainer#'+InDetKeys.xAODVertexContainer()+'Aux.' + excludedVertexAuxData]
 
diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py
index b2067d50e3c9..16742c41b779 100644
--- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py
+++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py
@@ -192,18 +192,7 @@ if doPixel:
 
         IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat"
         if (globalflags.DataSource()=='geant4'):
-            # ITk:
-            if geoFlags.isSLHC():
-                IdMappingDat = "ITk_Atlas_IdMapping.dat"
-                if "BrlIncl4.0_ref" == commonGeoFlags.GeoType():
-                    IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat"
-                elif "IBrlExt4.0ref" == commonGeoFlags.GeoType():
-                    IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat"
-                elif "BrlExt4.0_ref" == commonGeoFlags.GeoType():
-                    IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat"
-                elif "BrlExt3.2_ref" == commonGeoFlags.GeoType():
-                    IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat"
-            elif (geoFlags.isIBL() == False):
+            if (geoFlags.isIBL() == False):
                 IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping.dat"
             else:
                 # Planar IBL
@@ -560,10 +549,7 @@ if (NewTrackingCuts.mode() == "LowPt" or
     NewTrackingCuts.mode() == "LowPtLargeD0" or
     NewTrackingCuts.mode() == "BeamGas" or
     NewTrackingCuts.mode() == "ForwardTracks" or
-    NewTrackingCuts.mode() == "ForwardSLHCTracks" or
-    NewTrackingCuts.mode() == "Disappearing" or
-    NewTrackingCuts.mode() == "VeryForwardSLHCTracks" or
-    NewTrackingCuts.mode() == "SLHCConversionFinding"):
+    NewTrackingCuts.mode() == "Disappearing"):
 
     usePrdAssociationTool = True
 
@@ -646,9 +632,9 @@ if doPixel:
                                                              LorentzAngleTool   = ToolSvc.PixelLorentzAngleTool,
                                                              DisableDistortions = (InDetFlags.doFatras() or InDetFlags.doDBMstandalone()),
                                                              applyNNcorrection = ( InDetFlags.doPixelClusterSplitting() and
-                                                                                   InDetFlags.pixelClusterSplittingType() == "NeuralNet" and not InDetFlags.doSLHC()),
+                                                                                   InDetFlags.pixelClusterSplittingType() == "NeuralNet"),
                                                              NNIBLcorrection = ( InDetFlags.doPixelClusterSplitting() and
-                                                                                 InDetFlags.pixelClusterSplittingType() == "NeuralNet" and not InDetFlags.doSLHC()),
+                                                                                 InDetFlags.pixelClusterSplittingType() == "NeuralNet"),
                                                              SplitClusterAmbiguityMap = InDetKeys.SplitClusterAmbiguityMap(),
                                                              RunningTIDE_Ambi = InDetFlags.doTIDE_Ambi())
     PixelClusterOnTrackTool.NnClusterizationFactory  = NnClusterizationFactory
@@ -691,7 +677,7 @@ InDetSiComTrackFinder = InDet__SiCombinatorialTrackFinder_xk(name
 
 # Set up SiTrackMaker_xk (private)
 # Taken from InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
-# useBremMode = NewTrackingCuts.mode() == "Offline" or NewTrackingCuts.mode() == "SLHC"
+# useBremMode = NewTrackingCuts.mode() == "Offline"
 useBremMode = False ###
 InDetFlags.doCaloSeededBrem.set_Value_and_Lock(False) ###
 InDetFlags.doHadCaloSeededSSS.set_Value_and_Lock(False) ###
diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py
index af051fe63300..ef7fefe5587d 100644
--- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.py
+++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandaloneFromESD.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
 
 ###############################################################
 #
@@ -183,18 +183,7 @@ if doPixel:
 
         IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat"
         if (globalflags.DataSource()=='geant4'):
-            # ITk:
-            if geoFlags.isSLHC():
-                IdMappingDat = "ITk_Atlas_IdMapping.dat"
-                if "BrlIncl4.0_ref" == commonGeoFlags.GeoType():
-                    IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat"
-                elif "IBrlExt4.0ref" == commonGeoFlags.GeoType():
-                    IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat"
-                elif "BrlExt4.0_ref" == commonGeoFlags.GeoType():
-                    IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat"
-                elif "BrlExt3.2_ref" == commonGeoFlags.GeoType():
-                    IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat"
-            elif (geoFlags.isIBL() == False):
+            if (geoFlags.isIBL() == False):
                 IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping.dat"
             else:
                 # Planar IBL
@@ -454,10 +443,7 @@ if (NewTrackingCuts.mode() == "LowPt" or
     NewTrackingCuts.mode() == "LowPtLargeD0" or
     NewTrackingCuts.mode() == "BeamGas" or
     NewTrackingCuts.mode() == "ForwardTracks" or
-    NewTrackingCuts.mode() == "ForwardSLHCTracks" or
-    NewTrackingCuts.mode() == "Disappearing" or
-    NewTrackingCuts.mode() == "VeryForwardSLHCTracks" or
-    NewTrackingCuts.mode() == "SLHCConversionFinding"):
+    NewTrackingCuts.mode() == "Disappearing"):
 
     usePrdAssociationTool = True
 
@@ -540,9 +526,9 @@ if doPixel:
                                                              LorentzAngleTool   = ToolSvc.PixelLorentzAngleTool,
                                                              DisableDistortions = (InDetFlags.doFatras() or InDetFlags.doDBMstandalone()),
                                                              applyNNcorrection = ( InDetFlags.doPixelClusterSplitting() and
-                                                                                   InDetFlags.pixelClusterSplittingType() == "NeuralNet" and not InDetFlags.doSLHC()),
+                                                                                   InDetFlags.pixelClusterSplittingType() == "NeuralNet"),
                                                              NNIBLcorrection = ( InDetFlags.doPixelClusterSplitting() and
-                                                                                 InDetFlags.pixelClusterSplittingType() == "NeuralNet" and not InDetFlags.doSLHC()),
+                                                                                 InDetFlags.pixelClusterSplittingType() == "NeuralNet"),
                                                              SplitClusterAmbiguityMap = InDetKeys.SplitClusterAmbiguityMap(),
                                                              RunningTIDE_Ambi = InDetFlags.doTIDE_Ambi())
     PixelClusterOnTrackTool.NnClusterizationFactory  = NnClusterizationFactory
@@ -583,7 +569,7 @@ InDetSiComTrackFinder = InDet__SiCombinatorialTrackFinder_xk(name
 
 # Set up SiTrackMaker_xk (private)
 # Taken from InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
-# useBremMode = NewTrackingCuts.mode() == "Offline" or NewTrackingCuts.mode() == "SLHC"
+# useBremMode = NewTrackingCuts.mode() == "Offline"
 useBremMode = False ###
 InDetFlags.doCaloSeededBrem.set_Value_and_Lock(False) ###
 InDetFlags.doHadCaloSeededSSS.set_Value_and_Lock(False) ###
diff --git a/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx b/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx
index 8872f94f2bee..848c09e9c028 100644
--- a/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx
+++ b/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx
@@ -101,8 +101,8 @@ StatusCode InDet::SiTrackMaker_xk::initialize()
     m_trackinfo.setPatternRecognitionInfo(Trk::TrackInfo::SiSpacePointsSeedMaker_ForwardTracks);
   } else if (m_patternName == "SiSpacePointsSeedMaker_LargeD0"    )  {
     m_trackinfo.setPatternRecognitionInfo(Trk::TrackInfo::SiSpacePointsSeedMaker_LargeD0    );
-  } else if (m_patternName == "SiSpacePointsSeedMaker_SLHCConversionTracks")  {
-    m_trackinfo.setPatternRecognitionInfo(Trk::TrackInfo::SiSpacePointsSeedMaker_SLHCConversionTracks);
+  } else if (m_patternName == "SiSpacePointsSeedMaker_ITkConversionTracks")  {
+    m_trackinfo.setPatternRecognitionInfo(Trk::TrackInfo::SiSpacePointsSeedMaker_ITkConversionTracks);
   } else {
     m_trackinfo.setPatternRecognitionInfo(Trk::TrackInfo::SiSPSeededFinder                  );
   }
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py
deleted file mode 100644
index 9879c95e338f..000000000000
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py
+++ /dev/null
@@ -1,236 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# $Id: PhysVal_jobOptions.py 714189 2015-12-11 17:33:02Z sroe $
-
-#-----------------------------------------------------------------------
-# set up the input file:
-# set up for reading pool.root format files (AOD,ESD,IDTRKVALDAOD)
-import AthenaPoolCnvSvc.ReadAthenaPool
-
-# read single file: warious options
-#.......................................................................
-# FNAME=[ "AOD.pool.root" ]
-# runDAOD = False # set to False for AOD/ESD and True for IDTRKVALDAOD
-#.......................................................................
-# FNAME=[ "ESD.pool.root" ]
-# runDAOD = False # set to False for AOD/ESD and True for IDTRKVALDAOD
-#.......................................................................
-# FNAME=[ "IDTRKVALDAOD.pool.root" ]
-# runDAOD = True # set to False for AOD/ESD and True for IDTRKVALDAOD
-#.......................................................................
-# uncomment this for testing: step 1.7, mu=0 single muon with pt=1GeV samples:
-FNAME=[ "root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_14TeV/33/e7/DAOD_IDTRKVALID.10847851._000001.pool.root.1",
-        "root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_14TeV/51/39/DAOD_IDTRKVALID.10847851._000002.pool.root.1" ]
-runDAOD = True # these are DAOD-s
-#.......................................................................
-# uncomment to read multiple files:
-#import glob
-#FNAME=glob.glob('indir/*pool.root*')
-#runDAOD = True # set to False for AOD/ESD and True for IDTRKVALDAODs
-#.......................................................................
-# uncomment this to process samples as in ascii (1 sample / line):
-# with open('samples.txt','r') as inSamp:
-#   FNAME = [line.rstrip('\n') for line in inSamp]
-# runDAOD = True # set to False for AOD/ESD and True for IDTRKVALDAODs
-#.......................................................................
-#-----------------------------------------------------------------------
-
-# make AthenaCommonFlags aware of which file we are using
-# AthenaCommonFlags are used run-time configuration (MetaReader)
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-svcMgr.EventSelector.InputCollections = FNAME
-athenaCommonFlags.FilesInput = svcMgr.EventSelector.InputCollections
-
-#-----------------------------------------------------------------------
-# pre- and post- includes files needed to read input files
-from AthenaCommon.GlobalFlags import globalflags
-#globalflags.DetGeo = 'atlas'
-
-from PyUtils.MetaReaderPeeker import metadata
-globalflags.DataSource = 'data' if metadata['eventTypes'][0] == "IS_DATA" else 'geant4'
-globalflags.DetDescrVersion = metadata['GeoAtlas']
-
-# if you are running with a geometry not yet included in xmlTags:
-# add your Geometry and Layout below.
-# than x-check with:
-# GetTfCommand.py --AMI your-recodigi-tag 
-# that pre- and post- includes we schedule are the right ones
-xmlTags = [ ["ATLAS-P2-SFCAL-01-05-01","ExtBrl_32"],
-            ["ATLAS-P2-SFCAL-01-06-01","ExtBrl_4"],
-            ["ATLAS-P2-SFCAL-01-07-01","IExtBrl_4"],
-            ["ATLAS-P2-SFCAL-01-08-01","InclBrl_4"],
-            ["ATLAS-P2-ITK-10-00-00","InclBrl_4"],
-            ["ATLAS-P2-ITK-09-00-00","ExtBrl_4"],
-            ["ATLAS-P2-ITK-10-00-01","InclBrl_4"],
-            ["ATLAS-P2-ITK-09-00-01","ExtBrl_4"],
-            ["ATLAS-P2-ITK-11-00-01","ExtBrl_4_33mm"],
-            ["ATLAS-P2-ITK-12-00-01","IExtBrl_4"],
-            # step 1.6 with BCL
-            ["ATLAS-P2-ITK-10-04-01","InclBrl_4"],
-            # step 1.6 with all long strips 
-            ["ATLAS-P2-ITK-10-03-01","InclBrl_4"],
-            # step 1.7
-            ["ATLAS-P2-ITK-09-00-03","ExtBrl_4"],
-            ["ATLAS-P2-ITK-10-00-03","InclBrl_4"],
-            # step 1.8
-            ["ATLAS-P2-ITK-13-00-00","InclBrl_4_OptRing"] ]
-
-for geoTag, layoutDescr in xmlTags:
-   if (globalflags.DetDescrVersion().startswith(geoTag)):
-      print "preIncludes for ",layoutDescr, " layout"
-      from InDetRecExample.InDetJobProperties import InDetFlags
-      include('InDetSLHC_Example/preInclude.SLHC.SiliconOnly.Reco.py')
-      include('InDetSLHC_Example/preInclude.SLHC_Setup_'+layoutDescr+'.py')
-      include('InDetSLHC_Example/preInclude.SLHC_Setup_Strip_GMX.py')
-      if geoTag=="ATLAS-P2-ITK-10-00-00" or geoTag=="ATLAS-P2-ITK-09-00-00" :
-         include('InDetSLHC_Example/SLHC_Setup_Reco_TrackingGeometry.py')
-      else:
-         include('InDetSLHC_Example/SLHC_Setup_Reco_TrackingGeometry_GMX.py')      
-      break
-   
-# Just turn on the detector components we need
-from AthenaCommon.DetFlags import DetFlags
-DetFlags.detdescr.all_setOff() 
-DetFlags.detdescr.SCT_setOn() 
-DetFlags.detdescr.BField_setOn() 
-DetFlags.detdescr.pixel_setOn() 
-
-# Set up geometry and BField 
-include("RecExCond/AllDet_detDescr.py")
-
-from InDetSLHC_Example.SLHC_JobProperties import SLHC_Flags
-SLHC_Flags.SLHC_Version = ''
-
-         
-from AthenaCommon.GlobalFlags import jobproperties
-DetDescrVersion = jobproperties.Global.DetDescrVersion()
-
-for geoTag, layoutDescr in xmlTags:
-   if (globalflags.DetDescrVersion().startswith(geoTag)):
-      print "postInclude for ",layoutDescr, " layout"
-      include('InDetSLHC_Example/postInclude.SLHC_Setup_'+layoutDescr+'.py')
-      break
-
-#-----------------------------------------------------------------------
-
-# Access the algorithm sequence:
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-
-# include xml file with histogram definitions 
-from InDetPhysValMonitoring.InDetPhysValMonitoringConf import HistogramDefinitionSvc
-ToolSvc = ServiceMgr.ToolSvc
-ServiceMgr+=HistogramDefinitionSvc()
-ServiceMgr.HistogramDefinitionSvc.DefinitionSource="../share/InDetPVMPlotDefITK.xml"
-ServiceMgr.HistogramDefinitionSvc.DefinitionFormat="text/xml"
-
-# this fills some extra histograms when not running over DAOD
-# when running over DAOD, decorators should be off to prevent crashes
-if not runDAOD :
-   import InDetPhysValMonitoring.InDetPhysValDecoration
-   for decorator in InDetPhysValMonitoring.InDetPhysValDecoration.getDecorators() :
-      topSequence += decorator
-
-from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
-monMan = AthenaMonManager( "PhysValMonManager" )
-monMan.ManualDataTypeSetup = True
-monMan.DataType            = "monteCarlo"
-monMan.Environment         = "altprod"
-monMan.ManualRunLBSetup    = True
-monMan.Run                 = 1
-monMan.LumiBlock           = 1
-monMan.FileKey = "MyPhysVal"
-topSequence += monMan
-
-#-------------------------------------------------------------
-# Set up track selection tool
-#-------------------------------------------------------------
-from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool
-InDetTrackSelectorTool = InDet__InDetTrackSelectionTool("InDetTrackSelectorTool")
-##### DO NOT USE THESE !!!!! !!!! !!! ################
-##### DO NOT COMMENT THEM OUT !!!!! ##################
-InDetTrackSelectorTool.minPt            = 400           # Mev
-InDetTrackSelectorTool.maxD0            = 2              # mm
-InDetTrackSelectorTool.maxZ0            = 250          # mm
-InDetTrackSelectorTool.minNSiHits       = 6            # Pixel + SCT
-InDetTrackSelectorTool.maxNPixelHoles   = 2             # Pixel only
-InDetTrackSelectorTool.OutputLevel = INFO
-#eta dependant hit cut below
-#InDetTrackSelectorTool.vecEtaCutoffsForSiHitsCut = [0,1.0,1.2,1.8,2.2]
-#InDetTrackSelectorTool.vecMinNSiHitsAboveEta = [11,11,11,13,10]
-
-##### Temporary cuts - Will be fixed in 20.20.8.X ######
-############################################ USE THESE ONES!!!! #################################
-######### IF THE CUT YOU NEED IS NOT DEFINED BELOW, ADD IT TO InDetTrackSelectorTool. ABOVE #####
-from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetTrackCutSvc
-InDetTrackCutSvcIDPVM = InDet__InDetTrackCutSvc("InDetTrackCutSvcIDPVM")
-InDetTrackCutSvcIDPVM.MaxD0 = 2. #mm
-InDetTrackCutSvcIDPVM.MaxZ0 = 250. #mm
-InDetTrackCutSvcIDPVM.MaxEta = 4.0
-InDetTrackCutSvcIDPVM.MinSiHits = 6 # Pixel + SCT
-#InDetTrackCutSvcIDPVM.MinPixelHits = 0 
-#InDetTrackCutSvcIDPVM.MinSCTHits = 0
-
-
-svcMgr += InDetTrackCutSvcIDPVM
-InDetTrackSelectorTool.TrackSelectionSvc = InDetTrackCutSvcIDPVM
-
-ToolSvc += InDetTrackSelectorTool
-##### Temporary cuts - Will be fixed in 20.20.8.X ######
-
-print "Set Up InDetTrackSelectorTool"
-
-#-------------------------------------------------------------
-# Set up truth selection tool
-#-------------------------------------------------------------
-from InDetPhysValMonitoring.InDetPhysValMonitoringConf import AthTruthSelectionTool
-TrackTruthSelectionTool = AthTruthSelectionTool()
-# todo: manually adapt this acc. to the fiducial acceptance of your detector
-# ie in case of eta range 3.2, that's where you want your maxEta cut to be 
-TrackTruthSelectionTool.maxEta     = 4.0
-TrackTruthSelectionTool.maxPt      = -1
-TrackTruthSelectionTool.minPt      = 900 # default 400 MeV
-TrackTruthSelectionTool.maxBarcode = int(200e3)
-TrackTruthSelectionTool.pdgId      = -1
-TrackTruthSelectionTool.requireCharged = True
-TrackTruthSelectionTool.requireStatus1 = True
-TrackTruthSelectionTool.maxProdVertRadius = 260. #max prod. vertex radius of secondaries [mm]
-# to select particle within BCL acceptance
-#TrackTruthSelectionTool.radiusCylinder = 857 #BCL approximate radius
-#TrackTruthSelectionTool.minZCylinder = 1167 #BCL min z
-#TrackTruthSelectionTool.maxZCylinder = 1361 #BCL min z
-TrackTruthSelectionTool.OutputLevel = INFO
-ToolSvc += TrackTruthSelectionTool
-
-#-------------------------------------------------------------
-# Set up InDetPhysValMonitoring tool
-#-------------------------------------------------------------
-from InDetPhysValMonitoring.InDetPhysValMonitoringConf import InDetPhysValMonitoringTool
-InDetPhysValMonitoringTool = InDetPhysValMonitoringTool("InDetPhysValMonitoringTool")
-InDetPhysValMonitoringTool.useTrackSelection = True
-InDetPhysValMonitoringTool.TrackSelectionTool = InDetTrackSelectorTool
-#InDetPhysValMonitoringTool.TruthSelectionTool = TrackTruthSelectionTool
-InDetPhysValMonitoringTool.TruthParticleContainerName = "TruthParticles"
-# this will run over hardscatter tracks only: 
-#InDetPhysValMonitoringTool.PileupSwitch = "HardScatter"
-InDetPhysValMonitoringTool.OutputLevel = INFO
-#ToolSvc += InDetPhysValMonitoringTool
-
-monMan.AthenaMonTools += [InDetPhysValMonitoringTool]
-
-# set up output file 
-from GaudiSvc.GaudiSvcConf import THistSvc
-ServiceMgr += THistSvc()
-svcMgr.THistSvc.Output += ["MyPhysVal DATAFILE='MyPhysVal.root' OPT='RECREATE'"]
-
-# set out message verbosity 
-from AthenaCommon.AppMgr import theApp
-ServiceMgr.MessageSvc.OutputLevel = WARNING
-ServiceMgr.MessageSvc.defaultLimit = 10000
-
-# max. number of events to process
-theApp.EvtMax = -1
-
-# dump configuration
-from AthenaCommon.ConfigurationShelve import saveToAscii
-saveToAscii("config.txt")
diff --git a/PhysicsAnalysis/PrimaryDPDMaker/share/DAOD_IDNCB.py b/PhysicsAnalysis/PrimaryDPDMaker/share/DAOD_IDNCB.py
index 3495b8aad707..d53907ff9e47 100644
--- a/PhysicsAnalysis/PrimaryDPDMaker/share/DAOD_IDNCB.py
+++ b/PhysicsAnalysis/PrimaryDPDMaker/share/DAOD_IDNCB.py
@@ -45,9 +45,6 @@ if (globalflags.DataSource == 'geant4'):
 if ( 'dumpTruthInfo' in dir() ):
     dumpTruthInfo = dumpTruthInfo and isIdTrkDxAODSimulation
 
-if InDetFlags.doSLHC():
-    dumpTrtInfo=False
-
 ## Other settings
 # Prefix for decoration, if any
 prefixName = ""
@@ -138,8 +135,6 @@ if dumpPixInfo:
     xAOD_PixelPrepDataToxAOD.WriteNNinformation   = False
     #xAOD_PixelPrepDataToxAOD.WriteSDOs            = True
     #xAOD_PixelPrepDataToxAOD.WriteSiHits          = True # if available
-    if InDetFlags.doSLHC():
-        xAOD_PixelPrepDataToxAOD.WriteNNinformation=False
 
     topSequence += xAOD_PixelPrepDataToxAOD
     if (printIdTrkDxAODConf):
diff --git a/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py b/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py
index 47161cdaf1be..b13d9565e10f 100644
--- a/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py
+++ b/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py
@@ -72,8 +72,7 @@ class egammaBremCollectionBuilder (egammaAlgsConf.EMBremCollectionBuilder):
         #  TRT_ElectronPidTool
         #
         GSFBuildTRT_ElectronPidTool = None
-        if DetFlags.haveRIO.TRT_on() and not InDetFlags.doSLHC(
-        ) and not InDetFlags.doHighPileup():
+        if DetFlags.haveRIO.TRT_on() and not InDetFlags.doHighPileup():
             GSFBuildTRT_ElectronPidTool = (
                 TrackingCommon.getInDetTRT_ElectronPidTool(
                     name="GSFBuildTRT_ElectronPidTool",
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/FatrasTrackingGeometrySvc.py b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/FatrasTrackingGeometrySvc.py
index 65d3478be3c0..eb9b551d2108 100755
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/FatrasTrackingGeometrySvc.py
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/FatrasTrackingGeometrySvc.py
@@ -56,13 +56,7 @@ class FatrasTrackingGeometryCondAlg:
                 print ('[ TrackingGeometrySvc ] Using Local Database: '+DataBaseConnection        )
             # make sure that the pool files are in the catalog
             #from PoolSvc.PoolSvcConf import PoolSvc
-            #PoolSvc.ReadCatalog += [ DataBasePath+'PoolFileCatalog.xml' ]                
-        elif TrkDetFlags.SLHC_Geometry() :
-            # set the folder to the SLHC location
-            CoolDataBaseFolder = '/GLOBAL/TrackingGeo/SLHC_LayerMaterial'
-            ctag = AtlasMaterialTag+TrkDetFlags.MaterialMagicTag()
-            cfoldertag = CoolDataBaseFolder+' <tag>'+ctag+'</tag>'
-            conddb.addFolderSplitMC('GLOBAL',cfoldertag,cfoldertag)
+            #PoolSvc.ReadCatalog += [ DataBasePath+'PoolFileCatalog.xml' ]
         else :
             # load the right folders (preparation for calo inclusion)
             cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>'
@@ -88,21 +82,13 @@ class FatrasTrackingGeometryCondAlg:
     # (ID) 
     if DetFlags.ID_on() :
       # get hand on the ID Tracking Geometry Builder
-      if not TrkDetFlags.SLHC_Geometry() :
-        from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder
-      else :
-        from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder
-      if not TrkDetFlags.SLHC_Geometry() :   
-        self.__InDetTrackingGeometryBuilder__ = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder',
-                                                         namePrefix = 'Fatras',
-                                                         setLayerAssociation = False,
-                                                         buildTrtStrawLayers = True)
-        self.__InDetTrackingGeometryBuilder__.VolumeEnclosureOuterR = 1148.
-      else :   
-        self.__InDetTrackingGeometryBuilder__ = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder',
-                                                         namePrefix = 'Fatras',
-                                                         setLayerAssociation = False)
-        self.__InDetTrackingGeometryBuilder__.VolumeEnclosureOuterR = 1148.
+      from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder
+
+      self.__InDetTrackingGeometryBuilder__ = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder',
+                                                                namePrefix = 'Fatras',
+                                                                setLayerAssociation = False,
+                                                                buildTrtStrawLayers = True)
+      self.__InDetTrackingGeometryBuilder__.VolumeEnclosureOuterR = 1148.
 
       # make a public tool out of it
       ToolSvc += self.__InDetTrackingGeometryBuilder__
diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py
index 27f151a5cf05..27014a6a1d4f 100644
--- a/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py
+++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasServices/python/ISF_FatrasServicesConfig.py
@@ -57,13 +57,6 @@ def initialiseCoolDataBaseFolder():
             # make sure that the pool files are in the catalog
             #from PoolSvc.PoolSvcConf import PoolSvc
             #PoolSvc.ReadCatalog += [ DataBasePath+'PoolFileCatalog.xml' ]
-        elif TrkDetFlags.SLHC_Geometry() :
-            # set the folder to the SLHC location
-            CoolDataBaseFolder = '/GLOBAL/TrackingGeo/SLHC_LayerMaterial'
-            ctag = AtlasMaterialTag+TrkDetFlags.MaterialMagicTag()
-            cfoldertag = CoolDataBaseFolder+' <tag>'+ctag+'</tag>'
-            conddb.addFolderSplitMC('GLOBAL',cfoldertag,cfoldertag,
-                                    className = 'Trk::LayerMaterialMap')
         else :
             # load the right folders (preparation for calo inclusion)
             cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>'
@@ -93,11 +86,8 @@ def getInDetTrackingGeometryBuilder(name="ISF_InDetTrackingGeometryBuilder", **k
     kwargs.setdefault("namePrefix"              , 'Fatras')
     kwargs.setdefault("setLayerAssociation"     , False)
     #kwargs.setdefault("VolumeEnclosureOuterR"   , 1148.) ### HACK: Cannot set via imput arguments. Is this right?? -kg
-    if not TrkDetFlags.SLHC_Geometry() :
-        kwargs.setdefault("buildTrtStrawLayers" , True)
-        from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder
-    else :
-        from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder
+    kwargs.setdefault("buildTrtStrawLayers" , True)
+    from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder
     t = IDGeometryBuilder(name, **kwargs )
     t.VolumeEnclosureOuterR = 1148.
     #t.EnvelopeDefinitionSvc = 'ISF_EnvelopeDefSvc'
diff --git a/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py b/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py
index 6a91eb6f2ba7..a06e0744fb20 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py
+++ b/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py
@@ -69,12 +69,7 @@ class ConfiguredTrackingGeometrySvc( Trk__TrackingGeometrySvc ) :
               if hasattr(ToolSvc, TrkDetFlags.InDetTrackingGeometryBuilderName()):
                   InDetTrackingGeometryBuilder = getattr(ToolSvc, TrkDetFlags.InDetTrackingGeometryBuilderName())
           else:
-              if not TrkDetFlags.SLHC_Geometry() and not TrkDetFlags.InDetStagedGeometryBuilder():
-                  from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder
-              elif not TrkDetFlags.SLHC_Geometry() :   
-                  from InDetTrackingGeometry.ConfiguredStagedTrackingGeometryBuilder import ConfiguredStagedTrackingGeometryBuilder as IDGeometryBuilder
-              else :
-                  from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder
+              from InDetTrackingGeometry.ConfiguredStagedTrackingGeometryBuilder import ConfiguredStagedTrackingGeometryBuilder as IDGeometryBuilder
               InDetTrackingGeometryBuilder = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder')
                 
           InDetTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
@@ -140,12 +135,6 @@ class ConfiguredTrackingGeometrySvc( Trk__TrackingGeometrySvc ) :
                 if TrkDetFlags.ConfigurationOutputLevel() < 3 :
                     print ('[ TrackingGeometrySvc ] Using Local Database: '+DataBaseConnection        )
                 # make sure that the pool files are in the catalog
-            elif TrkDetFlags.SLHC_Geometry() :
-                # set the folder to the SLHC location        
-                CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialITK'
-                ctag = AtlasMaterialTag+TrkDetFlags.MaterialMagicTag()
-                cfoldertag = CoolDataBaseFolder+' <tag>'+ctag+'</tag>'
-                conddb.addFolderSplitMC('GLOBAL',cfoldertag,cfoldertag)
             else :
                 print ('[ TrackingGeometrySvc ]     base material tag : ', AtlasMaterialTag)
                 cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>'
diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h
index 3c778d8d7fc0..c041b3cf8ae8 100755
--- a/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h
+++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h
@@ -258,8 +258,8 @@ public:
     /**  Large d0 for displaced vertex searches */
     SiSpacePointsSeedMaker_LargeD0 = 49,
 
-    /** SLHCConversion Track flag */
-    SiSpacePointsSeedMaker_SLHCConversionTracks = 50,
+    /** ITkConversion Track flag */
+    SiSpacePointsSeedMaker_ITkConversionTracks = 50,
 
     /** Pseudo-tracking flag */
     Pseudotracking = 51,
diff --git a/Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx b/Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx
index a05b1373dafe..0954850fee85 100644
--- a/Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx
+++ b/Tracking/TrkEvent/TrkTrack/src/TrackInfo.cxx
@@ -190,8 +190,8 @@ Trk::TrackInfo::dumpInfo() const
                      ? "SiSpacePointsSeedMaker_VeryLowMomentum; "
                      : "");
     authorInfo << (m_patternRecognition.test(
-                     Trk::TrackInfo::SiSpacePointsSeedMaker_SLHCConversionTracks)
-                     ? "SiSpacePointsSeedMaker_SLHCConversionTracks; "
+                     Trk::TrackInfo::SiSpacePointsSeedMaker_ITkConversionTracks)
+                     ? "SiSpacePointsSeedMaker_ITkConversionTracks; "
                      : "");
     authorInfo << (m_patternRecognition.test(Trk::TrackInfo::SiSpacePointsSeedMaker_LargeD0)
                      ? "SiSpacePointsSeedMaker_LargeD0; "
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigEMBremCollectionBuilder.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigEMBremCollectionBuilder.py
index 96977bf0e898..90afce496758 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigEMBremCollectionBuilder.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigEMBremCollectionBuilder.py
@@ -68,8 +68,7 @@ class TrigEgammaBremCollectionBuilder (egammaAlgsConf.EMBremCollectionBuilder):
         #  TRT_ElectronPidTool (private =True)
         #
         GSFBuildTRT_ElectronPidTool = None
-        if DetFlags.haveRIO.TRT_on() and not InDetFlags.doSLHC(
-        ) and not InDetFlags.doHighPileup():
+        if DetFlags.haveRIO.TRT_on() and not InDetFlags.doHighPileup():
 
             from TrigInDetConfig.InDetTrigCollectionKeys import TrigTRTKeys
             from AthenaCommon.GlobalFlags import globalflags
-- 
GitLab


From 4b26645bb1e5f9f5eaeaf2eaefc6d57035a5b929 Mon Sep 17 00:00:00 2001
From: Siarhei Harkusha <siarhei.harkusha@cern.ch>
Date: Mon, 20 Sep 2021 18:15:37 +0200
Subject: [PATCH 216/347] TileMonitoring: Add Tile MBTS triger aware monitoring
 histograms for Run 3

---
 .../python/RunTileMonitoring.py               |  25 ++-
 .../python/TileMBTSMonitorAlgorithm.py        | 191 ++++++++++++++++-
 .../src/TileMBTSMonitorAlgorithm.cxx          | 200 ++++++++++++++++++
 .../src/TileMBTSMonitorAlgorithm.h            |  38 +++-
 4 files changed, 434 insertions(+), 20 deletions(-)

diff --git a/TileCalorimeter/TileMonitoring/python/RunTileMonitoring.py b/TileCalorimeter/TileMonitoring/python/RunTileMonitoring.py
index de4aa0ccfbfa..f2a54861f70f 100755
--- a/TileCalorimeter/TileMonitoring/python/RunTileMonitoring.py
+++ b/TileCalorimeter/TileMonitoring/python/RunTileMonitoring.py
@@ -7,7 +7,7 @@
 '''
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
-def ByteStreamEmonReadCfg( inputFlags, typeNames=[]):
+def ByteStreamEmonReadCfg( inputFlags, type_names=[]):
     """
     Creates accumulator for BS Emon reading
     """
@@ -39,7 +39,7 @@ def ByteStreamEmonReadCfg( inputFlags, typeNames=[]):
     acc.addService( robDPSvc )
 
     ByteStreamAddressProviderSvc = CompFactory.ByteStreamAddressProviderSvc
-    bsAddressProviderSvc = ByteStreamAddressProviderSvc(TypeNames=typeNames)
+    bsAddressProviderSvc = ByteStreamAddressProviderSvc(TypeNames=type_names)
     acc.addService( bsAddressProviderSvc )
 
     ProxyProviderSvc = CompFactory.ProxyProviderSvc
@@ -134,6 +134,7 @@ if __name__=='__main__':
     _addBoolArgument(parser, 'online', help='Online environment running')
 
     parser.add_argument('--stateless', action="store_true", help='Run Online Tile monitoring in partition')
+    parser.add_argument('--use-mbts-trigger', action="store_true", dest='useMbtsTrigger', help='Use L1 MBTS triggers')
     parser.add_argument('--partition', default="", help='EMON, Partition name, default taken from $TDAQ_PARTITION if not set')
     parser.add_argument('--key', type=str, default="",
                         help='EMON, Selection key, e.g.: SFI, default: dcm (ATLAS), CompleteEvent (TileMon), ReadoutApplication (Tile)')
@@ -187,7 +188,8 @@ if __name__=='__main__':
             parser.set_defaults(streamType='physics', streamNames=['CosmicCalo'], streamLogic='And', include=publishInclude,
                                 triggerType=0x82, frequency=300, updatePeriod=0, keyCount=1000, groupName='TileNoiseMon')
         elif args.mbts:
-            parser.set_defaults(lvl1Logic='Or', lvl1Origin='TAV', lvl1Items=[164], streamNames=[], streamLogic='Ignore', groupName='TileMBTSMon')
+            parser.set_defaults(lvl1Logic='Or', lvl1Origin='TAV', lvl1Items=[164], streamNames=[], streamLogic='Ignore',
+                                groupName='TileMBTSMon', useMbtsTrigger = True)
 
     args, _ = parser.parse_known_args()
 
@@ -215,6 +217,9 @@ if __name__=='__main__':
         _configFlagsFromPartition(ConfigFlags, args.partition, log)
         ConfigFlags.Input.isMC = False
         ConfigFlags.Input.Format = 'BS'
+        if args.mbts and args.useMbtsTrigger:
+            from AthenaConfiguration.AutoConfigOnlineRecoFlags import autoConfigOnlineRecoFlags
+            autoConfigOnlineRecoFlags(ConfigFlags, args.partition)
     else:
         if args.filesInput:
             ConfigFlags.Input.Files = args.filesInput.split(",")
@@ -269,14 +274,16 @@ if __name__=='__main__':
     from AthenaConfiguration.MainServicesConfig import MainServicesCfg
     cfg = MainServicesCfg(ConfigFlags)
 
-    tileTypeNames = ['TileRawChannelContainer/TileRawChannelCnt', 'TileDigitsContainer/TileDigitsCnt']
+    typeNames = ['TileRawChannelContainer/TileRawChannelCnt', 'TileDigitsContainer/TileDigitsCnt']
     if any([args.tmdbDigits, args.tmdb]):
-        tileTypeNames += ['TileDigitsContainer/MuRcvDigitsCnt']
+        typeNames += ['TileDigitsContainer/MuRcvDigitsCnt']
     if any([args.tmdbRawChannels, args.tmdb]):
-        tileTypeNames += ['TileRawChannelContainer/MuRcvRawChCnt']
+        typeNames += ['TileRawChannelContainer/MuRcvRawChCnt']
+    if args.mbts:
+        typeNames += ['CTP_RDO/CTP_RDO']
 
     if args.stateless:
-        cfg.merge( ByteStreamEmonReadCfg(ConfigFlags, typeNames=tileTypeNames) )
+        cfg.merge( ByteStreamEmonReadCfg(ConfigFlags, type_names=typeNames) )
         bsEmonInputSvc = cfg.getService( "ByteStreamInputSvc" )
         bsEmonInputSvc.Partition = args.partition
         bsEmonInputSvc.Key = args.key
@@ -296,7 +303,7 @@ if __name__=='__main__':
         bsEmonInputSvc.GroupName = args.groupName
     else:
         from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
-        cfg.merge( ByteStreamReadCfg(ConfigFlags, type_names = tileTypeNames) )
+        cfg.merge( ByteStreamReadCfg(ConfigFlags, type_names = typeNames) )
 
     cfg.addPublicTool( CompFactory.TileROD_Decoder(fullTileMode = runNumber) )
 
@@ -347,7 +354,7 @@ if __name__=='__main__':
 
     if args.mbts:
         from TileMonitoring.TileMBTSMonitorAlgorithm import TileMBTSMonitoringConfig
-        cfg.merge(TileMBTSMonitoringConfig(ConfigFlags, FillHistogramsPerMBTS = True))
+        cfg.merge(TileMBTSMonitoringConfig(ConfigFlags, FillHistogramsPerMBTS = True, useTrigger = args.useMbtsTrigger))
 
     if args.muid:
         from TileMuId.TileMuIdConfig import TileLookForMuAlgCfg
diff --git a/TileCalorimeter/TileMonitoring/python/TileMBTSMonitorAlgorithm.py b/TileCalorimeter/TileMonitoring/python/TileMBTSMonitorAlgorithm.py
index ecdbd75f305b..0de6b3e22a38 100644
--- a/TileCalorimeter/TileMonitoring/python/TileMBTSMonitorAlgorithm.py
+++ b/TileCalorimeter/TileMonitoring/python/TileMBTSMonitorAlgorithm.py
@@ -1,7 +1,6 @@
 #
 #  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 #
-
 '''
 @file TileMBTSMonitorAlgorithm.py
 @brief Python configuration of TileMBTSMonitorAlgorithm algorithm for the Run III
@@ -12,6 +11,8 @@ def TileMBTSMonitoringConfig(flags, **kwargs):
 
     ''' Function to configure TileMBTSMonitorAlgorithm algorithm in the monitoring system.'''
 
+    kwargs.setdefault('useTrigger', False)
+
     # Define one top-level monitoring algorithm. The new configuration
     # framework uses a component accumulator.
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
@@ -29,6 +30,10 @@ def TileMBTSMonitoringConfig(flags, **kwargs):
     from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
     result.merge( TileCablingSvcCfg(flags) )
 
+    if kwargs['useTrigger']:
+        from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
+        result.merge( L1ConfigSvcCfg(flags) )
+
     if flags.Input.Format.lower() == 'pool':
         kwargs.setdefault('TileDigitsContainer', 'TileDigitsFlt')
 
@@ -38,9 +43,10 @@ def TileMBTSMonitoringConfig(flags, **kwargs):
     helper = AthMonitorCfgHelper(flags, 'TileMBTSMonAlgCfg')
 
     runNumber = flags.Input.RunNumber[0]
+    isCosmics = flags.Beam.Type == 'cosmics'
     from AthenaConfiguration.ComponentFactory import CompFactory
     _TileMBTSMonitoringConfigCore(helper, CompFactory.TileMBTSMonitorAlgorithm,
-                                runNumber, **kwargs)
+                                  runNumber, isCosmics, **kwargs)
 
     accumalator = helper.result()
     result.merge(accumalator)
@@ -54,6 +60,8 @@ def TileMBTSMonitoringConfigOld(flags, **kwargs):
     from AthenaMonitoring import AthMonitorCfgHelperOld
     from AthenaCommon.GlobalFlags import globalflags
 
+    kwargs.setdefault('useTrigger', False)
+
     if globalflags.InputFormat().lower() == 'pool':
         kwargs.setdefault('TileDigitsContainer', 'TileDigitsFlt')
 
@@ -62,13 +70,16 @@ def TileMBTSMonitoringConfigOld(flags, **kwargs):
     from RecExConfig.AutoConfiguration import GetRunNumber
     runNumber = GetRunNumber()
 
+    from AthenaCommon.BeamFlags import jobproperties
+    isCosmics = jobproperties.Beam.beamType() == 'cosmics'
+
     from TileMonitoring.TileMonitoringConf import TileMBTSMonitorAlgorithm
-    _TileMBTSMonitoringConfigCore(helper, TileMBTSMonitorAlgorithm, runNumber, **kwargs)
+    _TileMBTSMonitoringConfigCore(helper, TileMBTSMonitorAlgorithm, runNumber, isCosmics, **kwargs)
 
     return helper.result()
 
 
-def _TileMBTSMonitoringConfigCore(helper, algConfObj, runNumber, **kwargs):
+def _TileMBTSMonitoringConfigCore(helper, algConfObj, runNumber, isCosmics, **kwargs):
 
     ''' Function to configure TileMBTSMonitorAlgorithm algorithm in the monitoring system.'''
 
@@ -93,6 +104,7 @@ def _TileMBTSMonitoringConfigCore(helper, algConfObj, runNumber, **kwargs):
     else: #Run1/2 config
         fillHistogramPerMBTS = tileMBTSMonAlg.getDefaultProperty('FillHistogramsPerMBTS')
 
+    useTrigger = kwargs['useTrigger']
 
     # 1) Configure histogram with TileMBTSMonAlg algorithm execution time
     executeTimeGroup = helper.addGroup(tileMBTSMonAlg, 'TileMBTSMonExecuteTime', 'Tile/')
@@ -100,9 +112,9 @@ def _TileMBTSMonitoringConfigCore(helper, algConfObj, runNumber, **kwargs):
                                      title = 'Time for execute TileMBTSMonAlg algorithm;time [#mus]',
                                      xbins = 100, xmin = 0, xmax = 1000)
 
-
-    labelsMBTS  =  ['MBTSA' + ('0' if x < 10 else '') + str(x) for x in range(0, numberOfMBTS // 2)]
-    labelsMBTS +=  ['MBTSC' + ('0' if x < 10 else '') + str(x) for x in range(0, numberOfMBTS // 2)]
+    nMBTSPerSide = numberOfMBTS // 2
+    labelsMBTS  =  ['MBTSA' + ('0' if x < 10 else '') + str(x) for x in range(0, nMBTSPerSide)]
+    labelsMBTS +=  ['MBTSC' + ('0' if x < 10 else '') + str(x) for x in range(0, nMBTSPerSide)]
 
 
     # 2) Configure MBTS occupancy histogram
@@ -158,7 +170,6 @@ def _TileMBTSMonitoringConfigCore(helper, algConfObj, runNumber, **kwargs):
                                         ybins = numberOfMBTS, ymin = 0, ymax = numberOfMBTS)
 
 
-
     # 10) Configure histogram with Tile readout errors for MBTS counters
     errorLabels = ['General', 'Global CRC', 'ROD CRC', 'Frontend CRC', 'BCID', 'Header Format',
                    'Header Parity', 'Sample Format', 'Sample Parity', 'Memory Parity']
@@ -171,9 +182,11 @@ def _TileMBTSMonitoringConfigCore(helper, algConfObj, runNumber, **kwargs):
                                 ybins = numberOfErrors, ymin = 0, ymax = numberOfErrors)
 
 
-
     if fillHistogramPerMBTS:
 
+        nEnergyBins = 550 if isCosmics else 400
+        maxEnergy = 5 if isCosmics else 80
+
         # 11) Configure histogram with MBTS counter energy
         energyArray = helper.addArray([numberOfMBTS], tileMBTSMonAlg, 'TileEnergyMBTS', topPath = 'Tile/MBTS')
         for postfix, tool in energyArray.Tools.items():
@@ -182,7 +195,7 @@ def _TileMBTSMonitoringConfigCore(helper, algConfObj, runNumber, **kwargs):
             title = 'Run ' + run + ': Energy of ' + mbtsName + ';Energy [pC]'
             name = 'Energy;Energy_' + mbtsName
             tool.defineHistogram(name, title = title, type = 'TH1F', path = 'Cell',
-                                 xbins = 400, xmin = -0.5, xmax = 80)
+                                 xbins = nEnergyBins, xmin = -0.5, xmax = maxEnergy)
 
         # 12) Configure histogram with MBTS counter energy vs luminosity block
         energyLBArray = helper.addArray([numberOfMBTS], tileMBTSMonAlg, 'TileEnergyLBMBTS', topPath = 'Tile/MBTS')
@@ -236,6 +249,162 @@ def _TileMBTSMonitoringConfigCore(helper, algConfObj, runNumber, **kwargs):
                                  xbins = 7, xmin = -0.5, xmax = 6.5)
 
 
+    if useTrigger:
+
+        tileMBTSMonAlg.CTP_ID = [-1] # Auto configuration
+
+        # 17) Configure MBTS occupancy histogram with TBP fired
+        occupancyTrigGroup = helper.addGroup(tileMBTSMonAlg, 'TileTriggerOccupancyMBTS', 'Tile')
+        occupancyTrigGroup.defineHistogram('HitCounter;Occupancy_wTBP', path = 'MBTS/Cell', type='TH1F',
+                                           xlabels = labelsMBTS, title = f'Run {run}: MBTS Occupancy with TBP fired',
+                                           xbins = numberOfMBTS, xmin = 0, xmax = numberOfMBTS)
+
+        # 18) Configure summary energy histogram for MBTS with TBP fired
+        energySummaryTrigGroup = helper.addGroup(tileMBTSMonAlg, 'TileTriggerEnergySummaryMBTS', 'Tile')
+        energySummaryTrigGroup.defineHistogram('HitCounter,SummaryEnergy;SummaryEnergy_TBP', path = 'MBTS/Cell', type='TProfile',
+                                               title = f'Run {run}: Average MBTS Energy with TBP fired;;Average Energy [pC]',
+                                               xlabels = labelsMBTS, xbins = numberOfMBTS, xmin = 0, xmax = numberOfMBTS)
+
+        # 19) Configure histogram with average MBTS time with TBP fired
+        timeSummaryTrigGroup = helper.addGroup(tileMBTSMonAlg, 'TileTriggerTimeSummaryMBTS', 'Tile')
+        timeSummaryTrigGroup.defineHistogram('HitCounter,SummaryTime;SummaryTime_TBP', path = 'MBTS/Cell', type='TProfile',
+                                             title = f'Run {run}: Average MBTS Time with TBP fired;;Average Time [ns]',
+                                             xlabels = labelsMBTS, xbins = numberOfMBTS, xmin = 0, xmax = numberOfMBTS)
+
+        # 20) Configure histogram with average MBTS triggers multiplicities per side with TBP fired
+        sides = ['A', 'C']
+        for side in sides:
+            multiplicityGroup = helper.addGroup(tileMBTSMonAlg, 'TileTriggerMultiplicityMBTS' + side, 'Tile')
+            multiplicityTitle = f'Run {run}: Average number of MBTS triggers on {side} side;BCID;Average # of Triggers'
+            multiplicityGroup.defineHistogram(f'bcid,multiplicity{side};MBTS{side}TriggersVsBCID', path = 'MBTS/Trigger',
+                                              type='TProfile', title = multiplicityTitle, xbins = 3565, xmin = -0.5, xmax = 3564.5)
+
+        # 21) Configure histogram with MBTS triggers multiplicities per side with TBP fired
+        multiplicityPerSideGroup = helper.addGroup(tileMBTSMonAlg, 'TileTriggerMultiplicityPerSideMBTS', 'Tile')
+        multiplicityPerSideTitle = f'Run {run}: Number of MBTS triggers per side with TBP fired'
+        multiplicityPerSideTitle += ';# of Triggers on A side; # of Triggers on C side'
+        multiplicityPerSideGroup.defineHistogram('multiplicityA,multiplicityC;MBTSTriggersPerSide',
+                                                 path = 'MBTS/Trigger', type='TH2F', title = multiplicityPerSideTitle,
+                                                 xbins = nMBTSPerSide, xmin = -0.5, xmax = nMBTSPerSide - 0.5,
+                                                 ybins = nMBTSPerSide, ymin = -0.5, ymax = nMBTSPerSide - 0.5)
+
+        # 22) Configure histogram with coincident Hits (energy) between two MBTS counters
+        triggerNames = ['TBP', 'TAP', 'TAV']
+        triggerDescriptions = ['before prescale', 'after prescale', 'after veto']
+        triggersArray = helper.addArray([len(triggerNames)], tileMBTSMonAlg, 'MBTS_Triggers', topPath = 'Tile/MBTS')
+        for postfix, tool in triggersArray.Tools.items():
+            triggerIdx = int( postfix.split('_').pop() )
+            trigger = triggerNames[triggerIdx]
+            description = triggerDescriptions[triggerIdx]
+            tool.defineHistogram(f'TriggerCounter;MBTS_Triggers_{trigger}', path = 'Trigger', type='TH1F',
+                                 xlabels = labelsMBTS, title = f'Run {run}: MBTS triggers {description} ({trigger})',
+                                 xbins = numberOfMBTS, xmin = 0, xmax = numberOfMBTS)
+
+        # 23) Configure histogram with coincident Hits (energy) between two MBTS counters in CTP window
+        triggersInWinArray = helper.addArray([len(triggerNames)], tileMBTSMonAlg, 'MBTS_TriggersInWindow', topPath = 'Tile/MBTS')
+        for postfix, tool in triggersInWinArray.Tools.items():
+            triggerIdx = int( postfix.split('_').pop() )
+            trigger = triggerNames[triggerIdx]
+            description = triggerDescriptions[triggerIdx]
+            tool.defineHistogram(f'TriggerCounter;MBTS_TriggersInWindow_{trigger}', path = 'Trigger', type='TH1F',
+                                 xlabels = labelsMBTS, title = f'Run {run}: MBTS triggers {description} ({trigger}) in CTP window',
+                                 xbins = numberOfMBTS, xmin = 0, xmax = numberOfMBTS)
+
+        # 24) Configure histogram with sum of MBTS triggers
+        triggersSumLables = ['A-Inner', 'A-Outer', 'A-Total', 'C-Inner', 'C-Outer', 'C-Total']
+        triggersSumArray = helper.addArray([len(triggerNames)], tileMBTSMonAlg, 'MBTS_TriggersSum', topPath = 'Tile/MBTS')
+        for postfix, tool in triggersSumArray.Tools.items():
+            triggerIdx = int( postfix.split('_').pop() )
+            trigger = triggerNames[triggerIdx]
+            description = triggerDescriptions[triggerIdx]
+            tool.defineHistogram(f'TriggerType;MBTS_TriggersSum_{trigger}', path = 'Trigger', type='TH1F',
+                                 xlabels = triggersSumLables, title = f'Run {run}: Sum of MBTS triggers {description} ({trigger})',
+                                 xbins = len(triggersSumLables), xmin = 0, xmax = len(triggersSumLables))
+
+        # 25) Configure histogram with coincident Hits (energy) between two MBTS counters
+        coinTrigArray = helper.addArray([len(triggerNames)], tileMBTSMonAlg, 'MBTS_CoincidentTriggers', topPath = 'Tile/MBTS')
+        for postfix, tool in coinTrigArray.Tools.items():
+            triggerIdx = int( postfix.split('_').pop() )
+            trigger = triggerNames[triggerIdx]
+            tool.defineHistogram(f'CoincidentTrigger1,CoincidentTrigger2;MBTS_CoincidentTriggers_{trigger}',
+                                 path = 'Trigger', type='TH2F', xlabels = labelsMBTS, ylabels = labelsMBTS,
+                                 title = f'Run {run}: Coincident {trigger}s fired between two MBTS counters',
+                                 xbins = numberOfMBTS, xmin = 0, xmax = numberOfMBTS,
+                                 ybins = numberOfMBTS, ymin = 0, ymax = numberOfMBTS)
+
+        # 26) Configure histogram with BCID difference between trigger and Event BCID
+        deltaBCIDSummaryArray = helper.addArray([len(triggerNames)], tileMBTSMonAlg, 'MBTS_DeltaBCID_Summary', topPath = 'Tile/MBTS')
+        for postfix, tool in deltaBCIDSummaryArray.Tools.items():
+            triggerIdx = int( postfix.split('_').pop() )
+            trigger = triggerNames[triggerIdx]
+            tool.defineHistogram(f'TriggerCounter,DeltaBCID;MBTS_DeltaBCID_Summary_{trigger}', path = 'Trigger', type='TProfile',
+                                 title = f'Run {run}: BCID difference of {trigger} from Event BCID;;Average BCID delta',
+                                 xlabels = labelsMBTS, xbins = numberOfMBTS, xmin = 0, xmax = numberOfMBTS)
+
+        # 27) Configure histogram with BCID difference between TBP fire and L1Accept
+        deltaBCIDArray = helper.addArray([len(triggerNames), numberOfMBTS], tileMBTSMonAlg, 'MBTS_DeltaBCID', topPath = 'Tile/MBTS')
+        for postfix, tool in deltaBCIDArray.Tools.items():
+            elements = postfix.split('_')
+            mbtsCounter = int( elements.pop() )
+            triggerIdx = int( elements.pop() )
+            mbtsName = labelsMBTS[mbtsCounter]
+            trigger = triggerNames[triggerIdx]
+            deltaBCIDTitle = f'Run {run}: {mbtsName} BCID difference of {trigger} signal'
+            deltaBCIDTitle += f';Bunch crossing between {trigger} fire and L1Accept'
+            tool.defineHistogram(f'DeltaBCID;MBTS_DeltaBCID_{trigger}_{mbtsName}', path = 'Trigger', type='TH1F',
+                                 title = deltaBCIDTitle, xbins = 19, xmin = -9.5, xmax = 9.5)
+
+        # 28) Configure histogram with MBTS counter energy with TBP fired
+        energyTrigArray = helper.addArray([numberOfMBTS], tileMBTSMonAlg, 'TileEnergyTrigMBTS', topPath = 'Tile/MBTS')
+        for postfix, tool in energyTrigArray.Tools.items():
+            mbtsCounter = int( postfix.split('_')[1] )
+            mbtsName = labelsMBTS[mbtsCounter]
+            title = f'Run {run}: Energy with TBP fired of {mbtsName};Energy [pC]'
+            name = f'Energy;Energy_TBP_{mbtsName}'
+            tool.defineHistogram(name, title = title, type = 'TH1F', path = 'Cell',
+                                 xbins = 550, xmin = -0.5, xmax = 5)
+
+        # 29) Configure histogram with MBTS counter energy vs luminosity block with TBP fired
+        energyTrigLBArray = helper.addArray([numberOfMBTS], tileMBTSMonAlg, 'TileEnergyTrigLBMBTS', topPath = 'Tile/MBTS')
+        for postfix, tool in energyTrigLBArray.Tools.items():
+            mbtsCounter = int( postfix.split('_')[1] )
+            mbtsName = labelsMBTS[mbtsCounter]
+            title = f'Run {run}: Energy with TBP fired of {mbtsName} per lumiblock;Lumiblocks;Energy [pC]'
+            name = f'lumiBlock,Energy;EnergyLB_TBP_{mbtsName}'
+            tool.defineHistogram(name, title = title, type = 'TProfile', path = 'Cell',
+                                 xbins = 1000, xmin = -0.5, xmax = 999.5, opt = 'kAddBinsDynamically')
+
+        # 30) Configure histogram with MBTS counter time with TBP
+        timeTrigArray = helper.addArray([numberOfMBTS], tileMBTSMonAlg, 'TileTimeTrigMBTS', topPath = 'Tile/MBTS')
+        for postfix, tool in timeTrigArray.Tools.items():
+            mbtsCounter = int( postfix.split('_')[1] )
+            mbtsName = labelsMBTS[mbtsCounter]
+            title = f'Run {run}: Time with TBP fired of {mbtsName};Time [ns]'
+            name = f'Time;Time_TBP_{mbtsName}'
+            tool.defineHistogram(name, title = title, type = 'TH1F', path = 'Cell',
+                                 xbins = 151, xmin = -75.5, xmax = 75.5)
+
+        # 31) Configure histogram with efficiency of MBTS counter with TBP
+        efficiencyTrigArray = helper.addArray([numberOfMBTS], tileMBTSMonAlg, 'TileEfficiencyTrigMBTS', topPath = 'Tile/MBTS')
+        for postfix, tool in efficiencyTrigArray.Tools.items():
+            mbtsCounter = int( postfix.split('_')[1] )
+            mbtsName = labelsMBTS[mbtsCounter]
+            title = f'Run {run}: Efficiency of LVL1 vs readout {mbtsName}'
+            title += ';Energy [pc];Fraction of events with TBP'
+            name = f'Energy,Efficiency;Efficiency_TBP_{mbtsName}'
+            tool.defineHistogram(name, title = title, type = 'TProfile', path = 'Cell',
+                                 xbins = 100, xmin = -0.55, xmax = 9.55)
+
+        # 32) Configure histogram with average pulse shape of MBTS counter with TBP
+        averageTrigPulseArray = helper.addArray([numberOfMBTS], tileMBTSMonAlg, 'TileAveragePulseTrigMBTS', topPath = 'Tile/MBTS')
+        for postfix, tool in averageTrigPulseArray.Tools.items():
+            mbtsCounter = int( postfix.split('_')[1] )
+            mbtsName = labelsMBTS[mbtsCounter]
+            title = f'Run {run}: Average Pulse with TBP fired for digitized signals of {mbtsName}'
+            title += ';TileCal Digital Sample;Average number of ADC counts'
+            name = f'SampleNumbers,Samples;AveragePulse_TBP_{mbtsName}'
+            tool.defineHistogram(name, title = title, type = 'TProfile', path = 'Digit',
+                                 xbins = 7, xmin = -0.5, xmax = 6.5)
 
 if __name__=='__main__':
 
@@ -256,6 +425,8 @@ if __name__=='__main__':
     ConfigFlags.Output.HISTFileName = 'TileMBTSMonitorOutput.root'
     ConfigFlags.DQ.useTrigger = False
     ConfigFlags.DQ.enableLumiAccess = False
+    ConfigFlags.Exec.MaxEvents = 3
+    ConfigFlags.fillFromArgs()
     ConfigFlags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
diff --git a/TileCalorimeter/TileMonitoring/src/TileMBTSMonitorAlgorithm.cxx b/TileCalorimeter/TileMonitoring/src/TileMBTSMonitorAlgorithm.cxx
index c0b77e793755..9d0ba7ccebb6 100644
--- a/TileCalorimeter/TileMonitoring/src/TileMBTSMonitorAlgorithm.cxx
+++ b/TileCalorimeter/TileMonitoring/src/TileMBTSMonitorAlgorithm.cxx
@@ -11,6 +11,7 @@
 
 #include "StoreGate/ReadHandle.h"
 
+#include "TrigT1Result/CTP_Decoder.h"
 
 StatusCode TileMBTSMonitorAlgorithm::initialize() {
 
@@ -68,9 +69,63 @@ StatusCode TileMBTSMonitorAlgorithm::initialize() {
     m_pulseGroups = Monitored::buildToolMap<int>(m_tools, "TileAveragePulseMBTS", MAX_MBTS_COUNTER);
   }
 
+  if (m_useTrigger && (m_ctpID.size() != MAX_MBTS_COUNTER)) {
+    if (m_l1Triggers.size() != MAX_MBTS_COUNTER) {
+      int numberOfCounters{MAX_MBTS_COUNTER};
+      ATH_MSG_WARNING("Names are not provided for all ("
+                      << numberOfCounters << ") L1 MBTS triggers. Provided only "
+                      << m_l1Triggers.size() << " L1 MBTS");
+
+      ATH_MSG_WARNING("Autoconfiguration of CTP ID to L1 MBTS mapping is not possible: force useTrigger=false");
+      m_useTrigger = false;
+    } else {
+      ATH_CHECK( m_L1MenuKey.initialize() );
+    }
+  }
+
+  ATH_CHECK( m_ctpRdoKey.initialize(m_useTrigger) );
+  if (m_useTrigger) {
+    m_energyTrigGroups = Monitored::buildToolMap<int>(m_tools, "TileEnergyTrigMBTS", MAX_MBTS_COUNTER);
+    m_energyTrigLBGroups = Monitored::buildToolMap<int>(m_tools, "TileEnergyTrigLBMBTS", MAX_MBTS_COUNTER);
+    m_timeTrigGroups = Monitored::buildToolMap<int>(m_tools, "TileTimeTrigMBTS", MAX_MBTS_COUNTER);
+    m_pulseTrigGroups = Monitored::buildToolMap<int>(m_tools, "TileAveragePulseTrigMBTS", MAX_MBTS_COUNTER);
+    m_effTrigGroups = Monitored::buildToolMap<int>(m_tools, "TileEfficiencyTrigMBTS", MAX_MBTS_COUNTER);
+
+    int nTriggers = 3;
+    m_trigGroups = Monitored::buildToolMap<int>(m_tools, "MBTS_Triggers", nTriggers);
+    m_trigInWinGroups = Monitored::buildToolMap<int>(m_tools, "MBTS_TriggersInWindow", nTriggers);
+    m_trigSumGroups = Monitored::buildToolMap<int>(m_tools, "MBTS_TriggersSum", nTriggers);
+    m_coinTrigGroups = Monitored::buildToolMap<int>(m_tools, "MBTS_CoincidentTriggers", nTriggers);
+    m_deltaBCIDSumGroups = Monitored::buildToolMap<int>(m_tools, "MBTS_DeltaBCID_Summary", nTriggers);
+    m_deltaBCIDGroups = Monitored::buildToolMap<std::vector<int>>(m_tools, "MBTS_DeltaBCID", nTriggers, MAX_MBTS_COUNTER);
+  }
+
   return StatusCode::SUCCESS;
 }
 
+StatusCode TileMBTSMonitorAlgorithm::start() {
+
+  if (m_useTrigger && (m_ctpID.size() != MAX_MBTS_COUNTER)) {
+    m_ctpID.value().resize(MAX_MBTS_COUNTER, -1);
+    ATH_MSG_INFO("Try to autoconfigure CTP ID to L1 MBTS trigger mapping from L1 menu");
+    SG::ReadHandle<TrigConf::L1Menu>  l1MenuHandle = SG::makeHandle( m_L1MenuKey );
+    if( l1MenuHandle.isValid() ) {
+      for (const TrigConf::L1Item& item: *l1MenuHandle) {
+        auto it = std::find(m_l1Triggers.begin(), m_l1Triggers.end(), item.name());
+        if (it != m_l1Triggers.end()) {
+          unsigned int counter = std::distance(m_l1Triggers.begin(), it);
+          m_ctpID[counter] = item.ctpId();
+          ATH_MSG_DEBUG("Found in L1 Menu: " << item.name() << ", CTP ID: " << item.ctpId() << ", counter: " << counter);
+        }
+      }
+    } else {
+      ATH_MSG_WARNING("L1 menu is not available: force useTrigger=false");
+      m_useTrigger = false;
+    }
+  }
+
+  return StatusCode::SUCCESS;
+}
 
 StatusCode TileMBTSMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const {
 
@@ -96,6 +151,119 @@ StatusCode TileMBTSMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
   double timeA(0.0);
   double timeC(0.0);
 
+  //  unsigned int l1aBCID(0);
+  std::vector<bool> hasTBP(MAX_MBTS_COUNTER, false);
+
+  if (m_useTrigger) {
+    SG::ReadHandle<CTP_RDO> ctpRdoContainer(m_ctpRdoKey, ctx);
+    ATH_CHECK( ctpRdoContainer.isValid() );
+
+    uint32_t nBunches(0);
+    CTP_Decoder ctpDecoder;
+
+    ctpDecoder.setRDO(ctpRdoContainer.get());
+    nBunches = ctpRdoContainer->getNumberOfBunches();
+
+    if (nBunches > 0) {
+      short l1aBunch = ctpRdoContainer->getL1AcceptBunchPosition();
+      const std::vector<CTP_BC>& ctpBunchCrossings = ctpDecoder.getBunchCrossings();
+      const CTP_BC & bunch = ctpBunchCrossings[l1aBunch];
+      auto  l1aBCID = Monitored::Scalar<unsigned int>("bcid", bunch.getBCID());
+      unsigned int bcid;
+      auto triggerMultiplicityA = Monitored::Scalar<int>("multiplicityA", 0);
+      auto triggerMultiplicityC = Monitored::Scalar<int>("multiplicityC", 0);
+
+      const std::bitset<512> currentTBP(bunch.getTBP());
+      for (size_t counter = 0; counter < m_ctpID.size(); ++counter) {
+        if (m_ctpID[counter] < 0) continue;
+        if (currentTBP.test(m_ctpID[counter])) {
+          hasTBP[counter] = true;
+          if (counter < 16) {
+            ++triggerMultiplicityA;
+          } else {
+            ++triggerMultiplicityC;
+          }
+        }
+      }
+
+      fill("TileTriggerMultiplicityMBTSA", l1aBCID, triggerMultiplicityA);
+      fill("TileTriggerMultiplicityMBTSC", l1aBCID, triggerMultiplicityC);
+      fill("TileTriggerMultiplicityPerSideMBTS", triggerMultiplicityA, triggerMultiplicityC);
+
+      std::vector<int> triggerTypes; // A-Inner, A-Outer, A-Total, C-Inner, C-Outer, C-Total
+      std::vector<int> triggerCounters;
+      std::vector<int> triggerInWindowCounters;
+      std::vector<int> deltaBCIDs;
+
+      //int deltaBCID;
+      // Loop over bunch crossings in CTP window
+      for (const CTP_BC& ctpBunchCrossing : ctpBunchCrossings) {
+        bcid = ctpBunchCrossing.getBCID();
+        int deltaBCID = l1aBCID - bcid;
+
+        std::vector<std::reference_wrapper<const std::bitset<512>>> triggers;
+        triggers.push_back(ctpBunchCrossing.getTBP());
+        triggers.push_back(ctpBunchCrossing.getTAP());
+        triggers.push_back(ctpBunchCrossing.getTAV());
+
+        int triggerIdx = 0;
+        for (const std::bitset<512>& currentTrigger : triggers) {
+          triggerTypes.clear();
+          triggerCounters.clear();
+          triggerInWindowCounters.clear();
+          deltaBCIDs.clear();
+
+          for (size_t counter = 0; counter < m_ctpID.size(); ++counter) {
+            if (m_ctpID[counter] < 0) continue;
+            if (currentTrigger.test(m_ctpID[counter])) {
+              triggerInWindowCounters.push_back(counter);
+              deltaBCIDs.push_back(deltaBCID);
+              auto monDeltaBCID = Monitored::Scalar<float>("DeltaBCID", deltaBCID);
+              fill(m_tools[m_deltaBCIDGroups[triggerIdx][counter]], monDeltaBCID);
+              if (bcid == l1aBCID) {
+                triggerCounters.push_back(counter);
+                int mbtsType = counter / 8; // A-Inner, A-Outer, C-Inner, C-Outer
+                if (counter > 15) {
+                  mbtsType += 1; // Shift C-Side to allow A-Total
+                }
+                triggerTypes.push_back(mbtsType);
+                triggerTypes.push_back(counter < 16 ? 2 : 5); // A-Total, C-Total
+              }
+            }
+          }
+
+          auto monTriggerInWindowCounter = Monitored::Collection("TriggerCounter", triggerInWindowCounters);
+          fill(m_tools[m_trigInWinGroups[triggerIdx]], monTriggerInWindowCounter);
+
+          auto monDeltaBCID = Monitored::Collection("DeltaBCID", deltaBCIDs);
+          fill(m_tools[m_deltaBCIDSumGroups[triggerIdx]], monTriggerInWindowCounter, monDeltaBCID);
+
+          if (bcid == l1aBCID) {
+            auto monTriggerType = Monitored::Collection("TriggerType", triggerTypes);
+            fill(m_tools[m_trigSumGroups[triggerIdx]], monTriggerType);
+
+            auto monTriggerCounter = Monitored::Collection("TriggerCounter", triggerCounters);
+            fill(m_tools[m_trigGroups[triggerIdx]], monTriggerCounter);
+
+            std::vector<int> coincidentTriggers1;
+            std::vector<int> coincidentTriggers2;
+            for (int counter1 : triggerCounters) {
+              for (int counter2 : triggerCounters) {
+                coincidentTriggers1.push_back(counter1);
+                coincidentTriggers2.push_back(counter2);
+              }
+            }
+            auto monCoincidentTrigger1 = Monitored::Collection("CoincidentTrigger1", coincidentTriggers1);
+            auto monCoincidentTrigger2 = Monitored::Collection("CoincidentTrigger2", coincidentTriggers2);
+            fill(m_tools[m_coinTrigGroups[triggerIdx]], monCoincidentTrigger1, monCoincidentTrigger2);
+          }
+          ++triggerIdx;
+        }
+      }
+
+    }
+  }
+
   auto monEnergy = Monitored::Scalar<float>("Energy", 0.0F);
   auto monTime = Monitored::Scalar<float>("Time", 0.0F);
 
@@ -113,7 +281,14 @@ StatusCode TileMBTSMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
   std::vector<float> times;
   auto monSummaryTime = Monitored::Collection("SummaryTime", times);
 
+  std::vector<float> triggerEnergies;
+  auto monTriggerSummaryEnergy = Monitored::Collection("SummaryEnergy", triggerEnergies);
+
+  std::vector<float> triggerTimes;
+  auto monTriggerSummaryTime = Monitored::Collection("SummaryTime", triggerTimes);
+
   std::vector<int> energyHitCounters;
+  std::vector<int> triggerHitCounters;
 
   SG::ReadHandle<TileCellContainer> mbtsContainer(m_mbtsCellContainerKey, ctx);
   ATH_CHECK( mbtsContainer.isValid() );
@@ -152,6 +327,21 @@ StatusCode TileMBTSMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
       fill(m_tools[m_energyLBGroups[counter]], lumiBlock, monEnergy);
     }
 
+    if (m_useTrigger) {
+      auto monEfficiency = Monitored::Scalar<float>("Efficiency", 0.0F);
+      if (hasTBP[counter]) {
+        monEfficiency = 1.0F;
+        triggerHitCounters.push_back(counter);
+        triggerEnergies.push_back(energy);
+        triggerTimes.push_back(time);
+
+        fill(m_tools[m_energyTrigGroups[counter]], monEnergy);
+        fill(m_tools[m_energyTrigLBGroups[counter]], lumiBlock, monEnergy);
+        fill(m_tools[m_timeTrigGroups[counter]], monTime);
+      }
+      fill(m_tools[m_effTrigGroups[counter]], monEnergy, monEfficiency);
+    }
+
     if (energy > m_energyCut[counter]) {
 
       timeCounters.push_back(counter);
@@ -182,6 +372,13 @@ StatusCode TileMBTSMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
 
   fill("TileTimeSummaryMBTS", monTimeCounter, monSummaryTime);
 
+  if (m_useTrigger) {
+    auto monTriggerHitCounter = Monitored::Collection("HitCounter", triggerHitCounters);
+    fill("TileTriggerOccupancyMBTS", monTriggerHitCounter);
+    fill("TileTriggerEnergySummaryMBTS", monTriggerHitCounter, monTriggerSummaryEnergy);
+    fill("TileTriggerTimeSummaryMBTS", monTriggerHitCounter, monTriggerSummaryTime);
+  }
+
   if (nHitsA > 0) {
     timeA /= nHitsA;
     auto monTimeA = Monitored::Scalar<float>("TimeA", timeA);
@@ -321,6 +518,9 @@ StatusCode TileMBTSMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
                   auto monSampleNumbers = Monitored::Collection("SampleNumbers", sampleNumbers);
 
                   fill(m_tools[m_pulseGroups[counter]], monSampleNumbers, monSamples);
+                  if (hasTBP[counter]) {
+                    fill(m_tools[m_pulseTrigGroups[counter]], monSampleNumbers, monSamples);
+                  }
                 }
 
                 sampleMean /= nSamples;
diff --git a/TileCalorimeter/TileMonitoring/src/TileMBTSMonitorAlgorithm.h b/TileCalorimeter/TileMonitoring/src/TileMBTSMonitorAlgorithm.h
index 87ef912b3625..100cf7ce4ec3 100644
--- a/TileCalorimeter/TileMonitoring/src/TileMBTSMonitorAlgorithm.h
+++ b/TileCalorimeter/TileMonitoring/src/TileMBTSMonitorAlgorithm.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 TILEMONITORING_TILEMBTSMONITORALGORITHM_H
@@ -17,6 +17,8 @@
 #include "StoreGate/ReadHandleKey.h"
 #include "GaudiKernel/ServiceHandle.h"
 
+#include "TrigConfData/L1Menu.h"
+#include "TrigT1Result/CTP_RDO.h"
 
 class TileTBID;
 class TileHWID;
@@ -35,6 +37,7 @@ class TileMBTSMonitorAlgorithm : public AthMonitorAlgorithm {
     virtual ~TileMBTSMonitorAlgorithm() = default;
     virtual StatusCode initialize() override;
     virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
+    virtual StatusCode start() override;
 
   private:
 
@@ -50,6 +53,9 @@ class TileMBTSMonitorAlgorithm : public AthMonitorAlgorithm {
     Gaudi::Property<bool> m_fillHistogramsPerMBTS{this,
         "FillHistogramsPerMBTS", false, "Switch for using per MBTS histograms"};
 
+    Gaudi::Property<bool> m_useTrigger{this,
+        "useTrigger", false, "Switch for using trigger information"};
+
     Gaudi::Property<std::vector<float>> m_energyCut{this,
         "EnergyCuts",
          {//MBTSA00   MBTSA01   MBTSA02   MBTSA03   MBTSA04   MBTSA05   MBTSA06   MBTSA07
@@ -71,6 +77,24 @@ class TileMBTSMonitorAlgorithm : public AthMonitorAlgorithm {
     SG::ReadHandleKey<TileCellContainer> m_mbtsCellContainerKey{this,
         "MBTSContainer", "MBTSContainer", "Tile MBTS container" };
 
+    SG::ReadHandleKey<CTP_RDO> m_ctpRdoKey{this,
+        "CTP_RDO", "CTP_RDO", "Trigger CTP RDO name" };
+
+    Gaudi::Property<std::vector<int>> m_ctpID{this,
+        "CTP_ID", {-1}, "Force CTP IDs for 32 MBTS counters (MBTSA00, .., MBTSC15)"};
+
+    Gaudi::Property<std::vector<std::string>> m_l1Triggers{this,
+        "L1_MBTS",
+        {
+         "L1_MBTSA0", "L1_MBTSA1", "L1_MBTSA2",  "L1_MBTSA3",  "L1_MBTSA4",  "L1_MBTSA5",  "L1_MBTSA6",  "L1_MBTSA7",
+         "L1_MBTSA8", "L1_MBTSA9", "L1_MBTSA10", "L1_MBTSA11", "L1_MBTSA12", "L1_MBTSA13", "L1_MBTSA14", "L1_MBTSA15",
+         "L1_MBTSC0", "L1_MBTSC1", "L1_MBTSC2",  "L1_MBTSC3",  "L1_MBTSC4",  "L1_MBTSC5",  "L1_MBTSC6",  "L1_MBTSC7",
+         "L1_MBTSC8", "L1_MBTSC9", "L1_MBTSC10", "L1_MBTSC11", "L1_MBTSC12", "L1_MBTSC13", "L1_MBTSC14", "L1_MBTSC15",
+        }, "Names of 32 L1 MBTS triggers (e.g.: L1_MBTSA0, .., L1_MBTSC15)"};
+
+    SG::ReadHandleKey<TrigConf::L1Menu> m_L1MenuKey{this,
+        "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "L1 Menu"};
+
     /**
      * @brief Name of Tile cabling service
      */
@@ -81,14 +105,26 @@ class TileMBTSMonitorAlgorithm : public AthMonitorAlgorithm {
 
     std::vector<int> m_energyGroups;
     std::vector<int> m_energyLBGroups;
+    std::vector<int> m_energyTrigGroups;
+    std::vector<int> m_energyTrigLBGroups;
 
     std::vector<int> m_timeGroups;
+    std::vector<int> m_timeTrigGroups;
 
     std::vector<int> m_hfnGroups;
     std::vector<int> m_pedestalGroups;
 
     std::vector<int> m_pulseGroups;
+    std::vector<int> m_pulseTrigGroups;
+
+    std::vector<int> m_effTrigGroups;
 
+    std::vector<int> m_trigGroups;
+    std::vector<int> m_trigInWinGroups;
+    std::vector<int> m_trigSumGroups;
+    std::vector<int> m_coinTrigGroups;
+    std::vector<int> m_deltaBCIDSumGroups;
+    std::vector<std::vector<int>> m_deltaBCIDGroups;
 
     const TileTBID* m_tileTBID{nullptr};
     const TileHWID* m_tileHWID{nullptr};
-- 
GitLab


From b19c0446616dd54378d6609ecf7806c48d9f7c6c Mon Sep 17 00:00:00 2001
From: James Richard Catmore <james.catmore@cern.ch>
Date: Mon, 20 Sep 2021 20:41:38 +0200
Subject: [PATCH 217/347] Adding some new variables to DAOD_PHYS and PHYSLITE

Adding the following variables to PHYSLITE to support MET-based analysis: AnalysisJets.JetAccessorMap.EMFrac
Adding the following AOD-level containers to PHYS to support pile-up studies: TruthPileupParticles, InTimeAntiKt4TruthJets, OutOfTimeAntiKt4TruthJets
---
 .../DerivationFramework/DerivationFrameworkPhys/share/PHYS.py   | 2 +-
 .../DerivationFrameworkPhys/share/PHYSLITE.py                   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py
index f5d86b3d93e3..e00c6d8a194a 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYS.py
@@ -204,7 +204,7 @@ if DerivationFrameworkIsMonteCarlo:
 
    from DerivationFrameworkMCTruth.MCTruthCommon import addTruth3ContentToSlimmerTool
    addTruth3ContentToSlimmerTool(PHYSSlimmingHelper)
-   PHYSSlimmingHelper.AllVariables += ['TruthHFWithDecayParticles','TruthHFWithDecayVertices','TruthCharm']
+   PHYSSlimmingHelper.AllVariables += ['TruthHFWithDecayParticles','TruthHFWithDecayVertices','TruthCharm','TruthPileupParticles','InTimeAntiKt4TruthJets','OutOfTimeAntiKt4TruthJets']
 
 PHYSSlimmingHelper.ExtraVariables += ["AntiKt10TruthTrimmedPtFrac5SmallR20Jets.Tau1_wta.Tau2_wta.Tau3_wta.D2.GhostBHadronsFinalCount",
                                       "Electrons.TruthLink",
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYSLITE.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYSLITE.py
index 80cd084b7e1b..e73babeec668 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYSLITE.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/share/PHYSLITE.py
@@ -340,7 +340,7 @@ PHYSLITESlimmingHelper.ExtraVariables = [
   "ExtrapolatedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.truthOrigin.truthType.qOverP.theta.phi",
   "MuonSpectrometerTrackParticles.phi.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.vertexLink.theta.qOverP.truthParticleLink",
   "AnalysisTauJets.pt.eta.phi.m.tauTrackLinks.jetLink.charge.isTauFlags.ptFinalCalib.etaFinalCalib.phiFinalCalib.mFinalCalib.ptCombined.etaCombined.phiCombined.mCombined.PanTau_DecayMode.RNNJetScore.RNNJetScoreSigTrans.RNNEleScore.RNNEleScoreSigTrans.IsTruthMatched.truthOrigin.truthType.truthParticleLink.truthJetLink",
-  "AnalysisJets.pt.eta.phi.m.JetConstitScaleMomentum_pt.JetConstitScaleMomentum_eta.JetConstitScaleMomentum_phi.JetConstitScaleMomentum_m.NumTrkPt500.SumPtTrkPt500.DetectorEta.Jvt.JVFCorr.JvtRpt.NumTrkPt1000.TrackWidthPt1000.GhostMuonSegmentCount.PartonTruthLabelID.ConeTruthLabelID.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID.TrueFlavor.DFCommonJets_jetClean_LooseBad.DFCommonJets_jetClean_TightBad.Timing.btagging.btaggingLink.GhostTrack.DFCommonJets_fJvt.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PSFrac",
+  "AnalysisJets.pt.eta.phi.m.JetConstitScaleMomentum_pt.JetConstitScaleMomentum_eta.JetConstitScaleMomentum_phi.JetConstitScaleMomentum_m.NumTrkPt500.SumPtTrkPt500.DetectorEta.Jvt.JVFCorr.JvtRpt.NumTrkPt1000.TrackWidthPt1000.GhostMuonSegmentCount.PartonTruthLabelID.ConeTruthLabelID.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID.TrueFlavor.DFCommonJets_jetClean_LooseBad.DFCommonJets_jetClean_TightBad.Timing.btagging.btaggingLink.GhostTrack.DFCommonJets_fJvt.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PSFrac.JetAccessorMap.EMFrac",
   "BTagging_AntiKt4EMPFlow_201903.DL1r_pu.DL1rmu_pu.DL1r_pb.DL1rmu_pb.DL1r_pc.DL1rmu_pc",
   "TruthPrimaryVertices.t.x.y.z",
   "MET_Core_AnalysisMET.name.mpx.mpy.sumet.source",
-- 
GitLab


From 19451b3c29890690dfdc494a4c0eedf4953f362c Mon Sep 17 00:00:00 2001
From: Peter Berta <peter.berta@cern.ch>
Date: Mon, 20 Sep 2021 19:46:24 +0200
Subject: [PATCH 218/347] Merge branch 'tgc-enable' into '22.0-mc20'

Enable updated TGC conditions for MC20

See merge request atlas/athena!46603

(cherry picked from commit ae63a1918274b3065702ddc064f817966081f7b2)

f254de69 Enable updated TGC conditions for MC20
4c58b52d Update digi and overlay tests with latest MC20 conditions tag
---
 .../scripts/Digi_tf_mc20a_presampling_maketest.sh         | 2 +-
 .../scripts/Digi_tf_mc20d_presampling_maketest.sh         | 2 +-
 .../scripts/Digi_tf_mc20e_presampling_maketest.sh         | 2 +-
 .../DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG.sh | 6 +++---
 .../test/test_Digi_tf_mc20a_CA_vs_CG_no_minbias.sh        | 6 +++---
 .../test/test_Digi_tf_mc20a_CA_vs_CG_presampling.sh       | 6 +++---
 .../test/test_Digi_tf_mc20a_presampling.sh                | 2 +-
 .../DigitizationTests/test/test_Digi_tf_mc20d_CA_vs_CG.sh | 6 +++---
 .../test/test_Digi_tf_mc20d_CA_vs_CG_presampling.sh       | 6 +++---
 .../test/test_Digi_tf_mc20d_presampling.sh                | 2 +-
 .../DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG.sh | 6 +++---
 .../test/test_Digi_tf_mc20e_CA_vs_CG_no_minbias.sh        | 6 +++---
 .../test/test_Digi_tf_mc20e_CA_vs_CG_presampling.sh       | 6 +++---
 .../test_Digi_tf_mc20e_CA_vs_CG_presampling_custom.sh     | 6 +++---
 .../test/test_Digi_tf_mc20e_presampling.sh                | 2 +-
 .../test/test_Digi_tf_mc20_ttbar_no_pileup_MT.sh          | 2 +-
 .../test/test_Digi_tf_mc20_ttbar_no_pileup_MT_1thread.sh  | 2 +-
 .../test_Digi_tf_mc20e_MP_presampling_reproducibility.sh  | 6 +++---
 .../test/test_Digi_tf_mc20e_MP_reproducibility.sh         | 6 +++---
 .../OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh  | 6 +++---
 .../test/test_MCOverlay_ConfigTest_ttbar_BCM.sh           | 6 +++---
 .../test/test_MCOverlay_ConfigTest_ttbar_LAr.sh           | 6 +++---
 .../test/test_MCOverlay_ConfigTest_ttbar_Muon.sh          | 6 +++---
 .../test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh         | 6 +++---
 .../test/test_MCOverlay_ConfigTest_ttbar_SCT.sh           | 6 +++---
 .../test/test_MCOverlay_ConfigTest_ttbar_TRT.sh           | 6 +++---
 .../test/test_MCOverlay_ConfigTest_ttbar_Tile.sh          | 6 +++---
 .../test/test_MCOverlay_ConfigTest_ttbar_Truth.sh         | 6 +++---
 .../test/test_MCOverlay_ConfigTest_ttbar_sequential.sh    | 2 +-
 .../Tests/OverlayTests/test/test_MCOverlay_MC20a_ttbar.sh | 2 +-
 .../test/test_MCOverlay_MC20a_ttbar_fullchain.sh          | 2 +-
 .../Tests/OverlayTests/test/test_MCOverlay_MC20d_ttbar.sh | 2 +-
 .../test/test_MCOverlay_MC20d_ttbar_fullchain.sh          | 2 +-
 .../Tests/OverlayTests/test/test_MCOverlay_MC20e_ttbar.sh | 2 +-
 .../test/test_MCOverlay_MC20e_ttbar_fullchain.sh          | 2 +-
 Tools/Campaigns/python/MC20.py                            | 8 ++++++++
 Tools/Campaigns/share/MC20NoPileUp.py                     | 1 +
 Tools/Campaigns/share/MC20a.py                            | 1 +
 Tools/Campaigns/share/MC20d.py                            | 1 +
 Tools/Campaigns/share/MC20e.py                            | 1 +
 40 files changed, 87 insertions(+), 75 deletions(-)

diff --git a/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20a_presampling_maketest.sh b/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20a_presampling_maketest.sh
index 08acdeb07b69..5ea2a1d2ed32 100755
--- a/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20a_presampling_maketest.sh
+++ b/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20a_presampling_maketest.sh
@@ -10,7 +10,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 # full run
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20d_presampling_maketest.sh b/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20d_presampling_maketest.sh
index edb01fe0196c..8d5de8c9ffef 100755
--- a/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20d_presampling_maketest.sh
+++ b/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20d_presampling_maketest.sh
@@ -10,7 +10,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 # full run
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20e_presampling_maketest.sh b/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20e_presampling_maketest.sh
index f7b1eb299495..464f39dd5287 100755
--- a/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20e_presampling_maketest.sh
+++ b/Simulation/Tests/DigitizationTests/scripts/Digi_tf_mc20e_presampling_maketest.sh
@@ -10,7 +10,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 # full run
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG.sh
index 58522330bd4b..4abf7a5107ec 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG.sh
@@ -18,7 +18,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 
 # config only
 Digi_tf.py \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -35,7 +35,7 @@ Digi_tf.py \
 
 # full run
 Digi_tf.py \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -61,7 +61,7 @@ if [ $rc -eq 0 ]
 then
     Digi_tf.py \
     --CA \
-    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
     --digiSeedOffset1 170 --digiSeedOffset2 170 \
     --digiSteeringConf "StandardSignalOnlyTruth" \
     --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG_no_minbias.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG_no_minbias.sh
index e20089eb4d2f..4aa8581ff96b 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG_no_minbias.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG_no_minbias.sh
@@ -16,7 +16,7 @@ HSHitsFile="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/va
 
 # config only
 Digi_tf.py \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -31,7 +31,7 @@ Digi_tf.py \
 
 # full run
 Digi_tf.py \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -55,7 +55,7 @@ if [ $rc -eq 0 ]
 then
     Digi_tf.py \
     --CA \
-    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
     --digiSeedOffset1 170 --digiSeedOffset2 170 \
     --digiSteeringConf "StandardSignalOnlyTruth" \
     --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG_presampling.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG_presampling.sh
index 987a09d3de2d..5fee799731cd 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG_presampling.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_CA_vs_CG_presampling.sh
@@ -19,7 +19,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 # config only
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -37,7 +37,7 @@ Digi_tf.py \
 # full run
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -64,7 +64,7 @@ then
     Digi_tf.py \
     --CA \
     --PileUpPresampling True \
-    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
     --digiSeedOffset1 170 --digiSeedOffset2 170 \
     --digiSteeringConf "StandardSignalOnlyTruth" \
     --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_presampling.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_presampling.sh
index c1b66d89c50b..afcf18b6e45e 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_presampling.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20a_presampling.sh
@@ -15,7 +15,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_CA_vs_CG.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_CA_vs_CG.sh
index d1755e1426b1..cc9a6d2bf9ed 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_CA_vs_CG.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_CA_vs_CG.sh
@@ -18,7 +18,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 
 # config only
 Digi_tf.py \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -35,7 +35,7 @@ Digi_tf.py \
 
 # full run
 Digi_tf.py \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -61,7 +61,7 @@ if [ $rc -eq 0 ]
 then
     Digi_tf.py \
     --CA \
-    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
     --digiSeedOffset1 170 --digiSeedOffset2 170 \
     --digiSteeringConf "StandardSignalOnlyTruth" \
     --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_CA_vs_CG_presampling.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_CA_vs_CG_presampling.sh
index 304e182dd3e0..3aa21535f9b3 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_CA_vs_CG_presampling.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_CA_vs_CG_presampling.sh
@@ -19,7 +19,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 # config only
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -37,7 +37,7 @@ Digi_tf.py \
 # full run
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -64,7 +64,7 @@ then
     Digi_tf.py \
     --CA \
     --PileUpPresampling True \
-    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
     --digiSeedOffset1 170 --digiSeedOffset2 170 \
     --digiSteeringConf "StandardSignalOnlyTruth" \
     --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_presampling.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_presampling.sh
index 4c40d3a6af14..024682912834 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_presampling.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20d_presampling.sh
@@ -15,7 +15,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG.sh
index 561e3db73391..bd35a469493f 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG.sh
@@ -18,7 +18,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 
 # config only
 Digi_tf.py \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -35,7 +35,7 @@ Digi_tf.py \
 
 # full run
 Digi_tf.py \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -61,7 +61,7 @@ if [ $rc -eq 0 ]
 then
     Digi_tf.py \
     --CA \
-    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
     --digiSeedOffset1 170 --digiSeedOffset2 170 \
     --digiSteeringConf "StandardSignalOnlyTruth" \
     --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_no_minbias.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_no_minbias.sh
index 32551076397c..f5163e574d72 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_no_minbias.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_no_minbias.sh
@@ -16,7 +16,7 @@ HSHitsFile="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/va
 
 # config only
 Digi_tf.py \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -31,7 +31,7 @@ Digi_tf.py \
 
 # full run
 Digi_tf.py \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -55,7 +55,7 @@ if [ $rc -eq 0 ]
 then
     Digi_tf.py \
     --CA \
-    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
     --digiSeedOffset1 170 --digiSeedOffset2 170 \
     --digiSteeringConf "StandardSignalOnlyTruth" \
     --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_presampling.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_presampling.sh
index 762ef1d99178..b7df7318e5df 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_presampling.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_presampling.sh
@@ -19,7 +19,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 # config only
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -37,7 +37,7 @@ Digi_tf.py \
 # full run
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -64,7 +64,7 @@ then
     Digi_tf.py \
     --CA \
     --PileUpPresampling True \
-    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
     --digiSeedOffset1 170 --digiSeedOffset2 170 \
     --digiSteeringConf "StandardSignalOnlyTruth" \
     --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_presampling_custom.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_presampling_custom.sh
index b473f192d59b..f3a1f72273d2 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_presampling_custom.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_CA_vs_CG_presampling_custom.sh
@@ -19,7 +19,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 # config only
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -38,7 +38,7 @@ Digi_tf.py \
 # full run
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
@@ -66,7 +66,7 @@ then
     Digi_tf.py \
     --CA \
     --PileUpPresampling True \
-    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+    --conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
     --digiSeedOffset1 170 --digiSeedOffset2 170 \
     --digiSteeringConf "StandardSignalOnlyTruth" \
     --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_presampling.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_presampling.sh
index d2febbcef6b4..77c7e64d65f2 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_presampling.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_mc20e_presampling.sh
@@ -15,7 +15,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 
 Digi_tf.py \
 --PileUpPresampling True \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20_ttbar_no_pileup_MT.sh b/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20_ttbar_no_pileup_MT.sh
index 718c20297359..b2cc28f670ec 100755
--- a/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20_ttbar_no_pileup_MT.sh
+++ b/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20_ttbar_no_pileup_MT.sh
@@ -13,7 +13,7 @@ export ATHENA_CORE_NUMBER=8
 Digi_tf.py \
 --multithreaded \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 \
 --digiSeedOffset2 170 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20_ttbar_no_pileup_MT_1thread.sh b/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20_ttbar_no_pileup_MT_1thread.sh
index fbe37aacf55d..8e14966d65c1 100755
--- a/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20_ttbar_no_pileup_MT_1thread.sh
+++ b/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20_ttbar_no_pileup_MT_1thread.sh
@@ -13,7 +13,7 @@ export ATHENA_CORE_NUMBER=1
 Digi_tf.py \
 --multithreaded \
 --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/HITS.10504490._000425.pool.root.1 \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 \
 --digiSeedOffset2 170 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
diff --git a/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20e_MP_presampling_reproducibility.sh b/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20e_MP_presampling_reproducibility.sh
index fa27a0135da9..649aebc5f982 100755
--- a/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20e_MP_presampling_reproducibility.sh
+++ b/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20e_MP_presampling_reproducibility.sh
@@ -22,7 +22,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 Digi_tf.py \
 --PileUpPresampling True \
 --inputHITSFile ${InputHitsFile} \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
@@ -44,7 +44,7 @@ Digi_tf.py \
 --multiprocess --athenaMPEventsBeforeFork 0 \
 --PileUpPresampling True \
 --inputHITSFile ${InputHitsFile} \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
@@ -68,7 +68,7 @@ Digi_tf.py \
 --multiprocess --athenaMPEventsBeforeFork 1 \
 --PileUpPresampling True \
 --inputHITSFile ${InputHitsFile} \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
diff --git a/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20e_MP_reproducibility.sh b/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20e_MP_reproducibility.sh
index 16b487a3e2cf..1aeae2386897 100755
--- a/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20e_MP_reproducibility.sh
+++ b/Simulation/Tests/DigitizationTestsMT/test/test_Digi_tf_mc20e_MP_reproducibility.sh
@@ -21,7 +21,7 @@ LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0Ch
 
 Digi_tf.py \
 --inputHITSFile ${InputHitsFile} \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
@@ -42,7 +42,7 @@ echo "art-result: $rc Digi_tf.py SP"
 Digi_tf.py \
 --multiprocess --athenaMPEventsBeforeFork 0 \
 --inputHITSFile ${InputHitsFile} \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
@@ -65,7 +65,7 @@ echo "art-result: $rc2 Digi_tf.py MP fork after 0"
 Digi_tf.py \
 --multiprocess --athenaMPEventsBeforeFork 1 \
 --inputHITSFile ${InputHitsFile} \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --digiSeedOffset1 170 --digiSeedOffset2 170 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
index 5fa5a2f0af38..56780848c8d1 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar.sh
@@ -25,7 +25,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --imf False \
@@ -36,7 +36,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
@@ -56,7 +56,7 @@ then
     --inputRDO_BKGFile ${RDO_BKG_File} \
     --outputRDOFile mcOverlayRDO.pool.root \
     --maxEvents $events \
-    --conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+    --conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
     --preInclude 'all:Campaigns.MC20e' \
     --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
index 99a3e0e5afc1..e5f05549dfd1 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_BCM.sh
@@ -26,7 +26,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --imf False \
@@ -38,7 +38,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
@@ -59,7 +59,7 @@ then
     --inputRDO_BKGFile ${RDO_BKG_File} \
     --outputRDOFile mcOverlayRDO.pool.root \
     --maxEvents $events \
-    --conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+    --conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
     --preInclude 'all:Campaigns.MC20e' \
     --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
index ef55863354e7..8cd6d36928f3 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_LAr.sh
@@ -26,7 +26,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --imf False \
@@ -38,7 +38,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
@@ -59,7 +59,7 @@ then
     --inputRDO_BKGFile ${RDO_BKG_File} \
     --outputRDOFile mcOverlayRDO.pool.root \
     --maxEvents $events \
-    --conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+    --conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
     --preInclude 'all:Campaigns.MC20e' \
     --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
index 50cc7bd9b221..4ed70166191c 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Muon.sh
@@ -26,7 +26,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --imf False \
@@ -38,7 +38,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
@@ -59,7 +59,7 @@ then
     --inputRDO_BKGFile ${RDO_BKG_File} \
     --outputRDOFile mcOverlayRDO.pool.root \
     --maxEvents $events \
-    --conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+    --conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
     --preInclude 'all:Campaigns.MC20e' \
     --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
index 57608dce1c0a..8f5c9248d866 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Pixel.sh
@@ -26,7 +26,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --imf False \
@@ -38,7 +38,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
@@ -59,7 +59,7 @@ then
     --inputRDO_BKGFile ${RDO_BKG_File} \
     --outputRDOFile mcOverlayRDO.pool.root \
     --maxEvents $events \
-    --conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+    --conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
     --preInclude 'all:Campaigns.MC20e' \
     --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
index 485cd5166abd..306709c97f02 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_SCT.sh
@@ -26,7 +26,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --imf False \
@@ -38,7 +38,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
@@ -59,7 +59,7 @@ then
     --inputRDO_BKGFile ${RDO_BKG_File} \
     --outputRDOFile mcOverlayRDO.pool.root \
     --maxEvents $events \
-    --conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+    --conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
     --preInclude 'all:Campaigns.MC20e' \
     --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
index 2a2bf2b212cf..f101e95a4a1e 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_TRT.sh
@@ -26,7 +26,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --imf False \
@@ -38,7 +38,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
@@ -59,7 +59,7 @@ then
     --inputRDO_BKGFile ${RDO_BKG_File} \
     --outputRDOFile mcOverlayRDO.pool.root \
     --maxEvents $events \
-    --conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+    --conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
     --preInclude 'all:Campaigns.MC20e' \
     --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
index 3a6a246d6de8..46122a5599f5 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Tile.sh
@@ -26,7 +26,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --imf False \
@@ -38,7 +38,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
@@ -59,7 +59,7 @@ then
     --inputRDO_BKGFile ${RDO_BKG_File} \
     --outputRDOFile mcOverlayRDO.pool.root \
     --maxEvents $events \
-    --conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+    --conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
     --preInclude 'all:Campaigns.MC20e' \
     --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
index b8b0828df75b..17a6fecd522f 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_Truth.sh
@@ -26,7 +26,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --imf False \
@@ -38,7 +38,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile legacyMcOverlayRDO.pool.root \
 --maxEvents $events \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --postExec 'job+=CfgMgr.JobOptsDumperAlg(FileName="OverlayLegacyConfig.txt");' \
@@ -59,7 +59,7 @@ then
     --inputRDO_BKGFile ${RDO_BKG_File} \
     --outputRDOFile mcOverlayRDO.pool.root \
     --maxEvents $events \
-    --conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+    --conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
     --geometryVersion ATLAS-R2-2016-01-00-01 \
     --preInclude 'all:Campaigns.MC20e' \
     --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
index 367ecdc82f4e..ae09171e46c3 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_ConfigTest_ttbar_sequential.sh
@@ -23,7 +23,7 @@ Overlay_tf.py \
 --inputRDO_BKGFile ${RDO_BKG_File} \
 --outputRDOFile mcOverlayRDO.pool.root \
 --maxEvents ${events} \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns.MC20e' \
 --postInclude 'OverlayConfiguration.OverlayTestHelpers.OverlayJobOptsDumperCfg' \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20a_ttbar.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20a_ttbar.sh
index dfba234160b4..5baa8f6753f2 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20a_ttbar.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20a_ttbar.sh
@@ -20,7 +20,7 @@ Overlay_tf.py \
 --outputRDOFile MC_plus_MC.RDO.pool.root \
 --maxEvents ${events} \
 --skipEvents 10 --digiSeedOffset1 511 --digiSeedOffset2 727 \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20a.py' \
 --imf False
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20a_ttbar_fullchain.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20a_ttbar_fullchain.sh
index c4fe680aab7d..f7e7421fd822 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20a_ttbar_fullchain.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20a_ttbar_fullchain.sh
@@ -17,7 +17,7 @@ Reco_tf.py \
 --autoConfiguration everything \
 --inputHITSFile ${HITS_File} \
 --inputRDO_BKGFile ${RDO_BKG_File} \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --maxEvents ${events} --skipEvents 10 --digiSeedOffset1 511 --digiSeedOffset2 727 \
 --preInclude "all:Campaigns/MC20a.py" \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20d_ttbar.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20d_ttbar.sh
index 9fda233a95d1..a854d6d2d425 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20d_ttbar.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20d_ttbar.sh
@@ -20,7 +20,7 @@ Overlay_tf.py \
 --outputRDOFile MC_plus_MC.RDO.pool.root \
 --maxEvents ${events} \
 --skipEvents 10 --digiSeedOffset1 511 --digiSeedOffset2 727 \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20d.py' \
 --imf False
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20d_ttbar_fullchain.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20d_ttbar_fullchain.sh
index bf3892dec86e..9ed446b02944 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20d_ttbar_fullchain.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20d_ttbar_fullchain.sh
@@ -17,7 +17,7 @@ Reco_tf.py \
 --autoConfiguration everything \
 --inputHITSFile ${HITS_File} \
 --inputRDO_BKGFile ${RDO_BKG_File} \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --maxEvents ${events} --skipEvents 10 --digiSeedOffset1 511 --digiSeedOffset2 727 \
 --preInclude "all:Campaigns/MC20d.py" \
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20e_ttbar.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20e_ttbar.sh
index b940844b19ac..6cdae25eada6 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20e_ttbar.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20e_ttbar.sh
@@ -20,7 +20,7 @@ Overlay_tf.py \
 --outputRDOFile MC_plus_MC.RDO.pool.root \
 --maxEvents ${events} \
 --skipEvents 10 --digiSeedOffset1 511 --digiSeedOffset2 727 \
---conditionsTag OFLCOND-MC16-SDR-RUN2-08  \
+--conditionsTag OFLCOND-MC16-SDR-RUN2-09  \
 --geometryVersion ATLAS-R2-2016-01-00-01 \
 --preInclude 'all:Campaigns/MC20e.py' \
 --imf False
diff --git a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20e_ttbar_fullchain.sh b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20e_ttbar_fullchain.sh
index 34c304d7fea7..a851378e90f4 100755
--- a/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20e_ttbar_fullchain.sh
+++ b/Simulation/Tests/OverlayTests/test/test_MCOverlay_MC20e_ttbar_fullchain.sh
@@ -17,7 +17,7 @@ Reco_tf.py \
 --autoConfiguration everything \
 --inputHITSFile ${HITS_File} \
 --inputRDO_BKGFile ${RDO_BKG_File} \
---conditionsTag default:OFLCOND-MC16-SDR-RUN2-08 \
+--conditionsTag default:OFLCOND-MC16-SDR-RUN2-09 \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --maxEvents ${events} --skipEvents 10 --digiSeedOffset1 511 --digiSeedOffset2 727 \
 --preInclude "all:Campaigns/MC20e.py" \
diff --git a/Tools/Campaigns/python/MC20.py b/Tools/Campaigns/python/MC20.py
index fd56abb5f594..d84fd6e0adae 100644
--- a/Tools/Campaigns/python/MC20.py
+++ b/Tools/Campaigns/python/MC20.py
@@ -9,6 +9,8 @@ def MC20a(flags):
     flags.Beam.NumberOfCollisions = 20.
     flags.Digitization.InputBeamSigmaZ = 42
 
+    flags.Digitization.UseUpdatedTGCConditions = True
+
     LArConfigRun2PileUp(flags)
     flags.Digitization.HighGainEMECIW = True
 
@@ -36,6 +38,8 @@ def MC20d(flags):
     flags.Beam.NumberOfCollisions = 20.
     flags.Digitization.InputBeamSigmaZ = 42
 
+    flags.Digitization.UseUpdatedTGCConditions = True
+
     LArConfigRun2PileUp(flags)
 
     flags.Tile.BestPhaseFromCOOL = False
@@ -62,6 +66,8 @@ def MC20e(flags):
     flags.Beam.NumberOfCollisions = 20.
     flags.Digitization.InputBeamSigmaZ = 42
 
+    flags.Digitization.UseUpdatedTGCConditions = True
+
     LArConfigRun2PileUp(flags)
 
     flags.Tile.BestPhaseFromCOOL = False
@@ -88,6 +94,8 @@ def MC20NoPileUp(flags):
     flags.Beam.NumberOfCollisions = 0
     flags.Digitization.InputBeamSigmaZ = 42
 
+    flags.Digitization.UseUpdatedTGCConditions = True
+
     LArConfigRun2NoPileUp(flags)
 
     flags.Tile.BestPhaseFromCOOL = False
diff --git a/Tools/Campaigns/share/MC20NoPileUp.py b/Tools/Campaigns/share/MC20NoPileUp.py
index d4f1582b4b49..7b5959034ab5 100644
--- a/Tools/Campaigns/share/MC20NoPileUp.py
+++ b/Tools/Campaigns/share/MC20NoPileUp.py
@@ -5,6 +5,7 @@ bf.Beam.numberOfCollisions.set_Value_and_Lock(0)
 
 from Digitization.DigitizationFlags import digitizationFlags
 digitizationFlags.OldBeamSpotZSize = 42
+digitizationFlags.UseUpdatedTGCConditions = True
 
 from AthenaCommon.Resilience import protectedInclude
 protectedInclude('LArConfiguration/LArConfigRun2Old_NoPileup.py')
diff --git a/Tools/Campaigns/share/MC20a.py b/Tools/Campaigns/share/MC20a.py
index fb095ec84d28..829ee9589fcf 100644
--- a/Tools/Campaigns/share/MC20a.py
+++ b/Tools/Campaigns/share/MC20a.py
@@ -5,6 +5,7 @@ bf.Beam.numberOfCollisions.set_Value_and_Lock(20.0)
 
 from Digitization.DigitizationFlags import digitizationFlags
 digitizationFlags.OldBeamSpotZSize = 42
+digitizationFlags.UseUpdatedTGCConditions = True
 
 from LArDigitization.LArDigitizationFlags import jobproperties as lar
 lar.LArDigitizationFlags.useEmecIwHighGain.set_Value_and_Lock(True)
diff --git a/Tools/Campaigns/share/MC20d.py b/Tools/Campaigns/share/MC20d.py
index ba3b82c7ebde..9ce673b5a1bc 100644
--- a/Tools/Campaigns/share/MC20d.py
+++ b/Tools/Campaigns/share/MC20d.py
@@ -5,6 +5,7 @@ bf.Beam.numberOfCollisions.set_Value_and_Lock(20.0)
 
 from Digitization.DigitizationFlags import digitizationFlags
 digitizationFlags.OldBeamSpotZSize = 42
+digitizationFlags.UseUpdatedTGCConditions = True
 
 from AthenaCommon.Resilience import protectedInclude
 protectedInclude('LArConfiguration/LArConfigRun2Old.py')
diff --git a/Tools/Campaigns/share/MC20e.py b/Tools/Campaigns/share/MC20e.py
index ba3b82c7ebde..9ce673b5a1bc 100644
--- a/Tools/Campaigns/share/MC20e.py
+++ b/Tools/Campaigns/share/MC20e.py
@@ -5,6 +5,7 @@ bf.Beam.numberOfCollisions.set_Value_and_Lock(20.0)
 
 from Digitization.DigitizationFlags import digitizationFlags
 digitizationFlags.OldBeamSpotZSize = 42
+digitizationFlags.UseUpdatedTGCConditions = True
 
 from AthenaCommon.Resilience import protectedInclude
 protectedInclude('LArConfiguration/LArConfigRun2Old.py')
-- 
GitLab


From baceb3953d2eff9808665e1b356baa9fb2f746fe Mon Sep 17 00:00:00 2001
From: Rachid Mazini <rachid.mazini@cern.ch>
Date: Mon, 20 Sep 2021 16:55:48 +0200
Subject: [PATCH 219/347] Merge branch 'MergeTruthJetsToolFix_22.0-mc20' into
 '22.0-mc20'

Fix bug in MergeTruthJetsTool where only the first event from each bunch-crossing was checked.

See merge request atlas/athena!46600

(cherry picked from commit 15e37f31863a5b97a9553fc9baa168c48364f6fc)

c35ffb35 Fix bug in MergeTruthJetsTool where only the first event from each bunch-crossing was checked.
---
 .../G4Utilities/MCTruthSimAlgs/src/MergeTruthJetsTool.cxx       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeTruthJetsTool.cxx b/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeTruthJetsTool.cxx
index 686b05b6c227..b8d4acf88d10 100644
--- a/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeTruthJetsTool.cxx
+++ b/Simulation/G4Utilities/MCTruthSimAlgs/src/MergeTruthJetsTool.cxx
@@ -48,7 +48,7 @@ StatusCode MergeTruthJetsTool::processBunchXing(int bunchXing,
   while (iEvt != eSubEvents) {
     const xAOD::JetContainer* inputJetContainer(nullptr);
     if (m_pMergeSvc->retrieveSingleSubEvtData(m_inputJetCollKey, inputJetContainer,
-                                              bunchXing, bSubEvents).isSuccess()) {
+                                              bunchXing, iEvt).isSuccess()) {
       ATH_MSG_VERBOSE("Found an xAOD::JetContainer in storeGate.");
       if ( !inputJetContainer ) {
         ATH_MSG_ERROR("Unable to retrieve input jet container: " << m_inputJetCollKey);
-- 
GitLab


From b62eb2e74f1c3141d5f67af105316f2194c0e4c7 Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Mon, 20 Sep 2021 22:48:30 +0200
Subject: [PATCH 220/347] Fix histogram paths

---
 .../data/postprocessing/SCTmon.yaml           |  8 +++---
 .../data/postprocessing/TRTmon.yaml           | 28 +++++++++----------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/DataQuality/DataQualityUtils/data/postprocessing/SCTmon.yaml b/DataQuality/DataQualityUtils/data/postprocessing/SCTmon.yaml
index 1bceb455310a..8cdeb4d7835b 100644
--- a/DataQuality/DataQualityUtils/data/postprocessing/SCTmon.yaml
+++ b/DataQuality/DataQualityUtils/data/postprocessing/SCTmon.yaml
@@ -6,17 +6,17 @@
 Input: [ 
          #Commented plots are not ready as input
          #'(?P<dir>run_\d*)/SCT/SCT(?P<sec>[A-E]*)/Noise/noiseoccupancymaptrigger(?P<sec2>[ECm,ECp]*)_(?P<L>\d)_(?P<S>\d)',
-         '(?P<dir>run_\d*)/SCT/SCT(?P<sec>[A-E]*)/eff/ineff.*_(?P<L>\d)_(?P<S>\d)',
+         'SCT/SCT(?P<sec>[A-E]*)/eff/ineff.*_(?P<L>\d)_(?P<S>\d)',
          #'(?P<dir>run_\d*)/SCT/SCT(?P<sec>[A-E]*)/errors/Errors/SCT_NumberOfErrors(?P=sec)_(?P<L>\d)_(?P<S>\d)',
          #'(?P<dir>run_\d*)/SCT/GENERAL/errors/Masked\ Links',
          #'GENERAL/errors/Flagged\ Links', #Location of this hist yet to be defined
 ]
-Output: [ '{dir}/SCT/GENERAL/Conf/SCTConfNew' ]
+Output: [ 'SCT/GENERAL/Conf/SCTConfNew' ]
 Function: SCT_Monitoring.SCTPostProcessing.conf
 Parameters: { label: ['Noisy','Inefficieny','Errors','Masked Links','Flagged Links'], thr: [150,0.1,0.7] }
 Description: SCTCONF
 ---
-Input: [ '(?P<dir>run_\d*)/SCT/SCT(?P<sec>[EC,B,EA]*)/eff/[m_,p_]*eff_(?P<L>\d)_(?P<S>\d)$' ]
-Output: [ '{dir}/SCT/GENERAL/eff/SctEfficiencyDistribution' ]
+Input: [ 'SCT/SCT(?P<sec>[EC,B,EA]*)/eff/[m_,p_]*eff_(?P<L>\d)_(?P<S>\d)$' ]
+Output: [ 'SCT/GENERAL/eff/SctEfficiencyDistribution' ]
 Function: SCT_Monitoring.SCTPostProcessing.effcomb
 Description: Combining
diff --git a/DataQuality/DataQualityUtils/data/postprocessing/TRTmon.yaml b/DataQuality/DataQualityUtils/data/postprocessing/TRTmon.yaml
index aa5eba911458..01481b3a6b0c 100644
--- a/DataQuality/DataQualityUtils/data/postprocessing/TRTmon.yaml
+++ b/DataQuality/DataQualityUtils/data/postprocessing/TRTmon.yaml
@@ -3,37 +3,37 @@
 # Separate blocks with ---
 #
 ---
-Input:  [ 'run_(?P<n>\d.....)/TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/hHitAMap(?P<element>S|C)' ]
-Output: [ 'run_{n}/TRT/{region}/hOccupancy{element}' ]
+Input:  [ 'TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/hHitAMap(?P<element>S|C)' ]
+Output: [ 'TRT/{region}/hOccupancy{element}' ]
 Function: TRTMonitoringRun3.TRTPostProcessing.hOccupancy
 Description: TRTOCCUPANCY
 ---
-Input:  [ 'run_(?P<n>\d.....)/TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitHWonTMap|hEfficiency)(?P<element>S|C)' ]
-Output: [ 'run_{n}/TRT/{region}/hHitHWonTMap{element}' ]
+Input:  [ 'TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitHWonTMap|hEfficiency)(?P<element>S|C)' ]
+Output: [ 'TRT/{region}/hHitHWonTMap{element}' ]
 Function: TRTMonitoringRun3.TRTPostProcessing.hHitXonTMap
 Description: TRTHITHWONTMAP
 ---
-Input:  [ 'run_(?P<n>\d.....)/TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitWonTMap|hEfficiency)(?P<element>S|C)' ]
-Output: [ 'run_{n}/TRT/{region}/hHitWonTMap{element}' ]
+Input:  [ 'TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitWonTMap|hEfficiency)(?P<element>S|C)' ]
+Output: [ 'TRT/{region}/hHitWonTMap{element}' ]
 Function: TRTMonitoringRun3.TRTPostProcessing.hHitXonTMap
 Description: TRTHITWONTMAP
 ---
-Input:  [ 'run_(?P<n>\d.....)/TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitAonTMap|hEfficiency)(?P<element>S|C)' ]
-Output: [ 'run_{n}/TRT/{region}/hHitAonTMap{element}' ]
+Input:  [ 'TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitAonTMap|hEfficiency)(?P<element>S|C)' ]
+Output: [ 'TRT/{region}/hHitAonTMap{element}' ]
 Function: TRTMonitoringRun3.TRTPostProcessing.hHitXonTMap
 Description: TRTHITAONTMAP
 ---
-Input:  [ 'run_(?P<n>\d.....)/TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitAWonTMap|hEfficiency)(?P<element>S|C)' ]
-Output: [ 'run_{n}/TRT/{region}/hHitAWonTMap{element}' ]
+Input:  [ 'TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitAWonTMap|hEfficiency)(?P<element>S|C)' ]
+Output: [ 'TRT/{region}/hHitAWonTMap{element}' ]
 Function: TRTMonitoringRun3.TRTPostProcessing.hHitXonTMap
 Description: TRTHITAWONTMAP
 ---
-Input:  [ 'run_(?P<n>\d.....)/TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitHonTMap|hEfficiency)(?P<element>S|C)' ]
-Output: [ 'run_{n}/TRT/{region}/hHitHonTMap{element}' ]
+Input:  [ 'TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitHonTMap|hEfficiency)(?P<element>S|C)' ]
+Output: [ 'TRT/{region}/hHitHonTMap{element}' ]
 Function: TRTMonitoringRun3.TRTPostProcessing.hHitXonTMap
 Description: TRTHITHONTMAP
 ---
-Input:  [ 'run_(?P<n>\d.....)/TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitAonTMap|hHitAMap|unscaled_hHitAMap)(?P<element>S|C)' ]
-Output: [ 'run_{n}/TRT/{region}/hHitOnTrackVsAll{element}' ]
+Input:  [ 'TRT/(?P<region>Barrel/Stack\d.[A,C]*|[EndcapA|EndcapC]*/Sector\d.)/(?P<histogram>unscaled_hHitAonTMap|hHitAMap|unscaled_hHitAMap)(?P<element>S|C)' ]
+Output: [ 'TRT/{region}/hHitOnTrackVsAll{element}' ]
 Function: TRTMonitoringRun3.TRTPostProcessing.hHitOnTrackVsAll
 Description: TRTHITONTRACKVSALL
-- 
GitLab


From 556eca83acc82593a62789d72d2e50f8fdfe12d1 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 31 Aug 2021 20:53:34 -0400
Subject: [PATCH 221/347] MuonGMdbObjects: Fix cppcheck warnings.

Fix cppcheck warnings.
---
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Acut.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Alin.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Almn.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Aptp.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Asmp.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Aszt.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Atln.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Atyp.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Awln.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Dbam.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00IAcsc.cxx | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wchv.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcmi.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcro.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcsc.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wded.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wlbi.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wmdt.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wrpc.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wspa.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wsup.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wtgc.cxx  | 4 ++--
 MuonSpectrometer/MuonGMdbObjects/src/DblQ00Xtomo.cxx | 2 +-
 23 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Acut.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Acut.cxx
index ecb03bc47321..0856c07ab2e4 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Acut.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Acut.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
 */
 
 /***************************************************************************
@@ -65,7 +65,7 @@ DblQ00Acut::DblQ00Acut(AmdcDb* acut) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Alin.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Alin.cxx
index c4361ead9677..284ee4afb60d 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Alin.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Alin.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
 */
 
 /***************************************************************************
@@ -87,7 +87,7 @@ DblQ00Alin::DblQ00Alin(AmdcDb* alin) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Almn.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Almn.cxx
index 4ab2802195a6..dd119c66c084 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Almn.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Almn.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
 */
 
 /***************************************************************************
@@ -103,7 +103,7 @@ DblQ00Almn::DblQ00Almn(AmdcDb* almn) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Aptp.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Aptp.cxx
index 2603209828af..339cc828a3b3 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Aptp.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Aptp.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
 */
 
 /***************************************************************************
@@ -94,7 +94,7 @@ DblQ00Aptp::DblQ00Aptp(AmdcDb* aptp) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Asmp.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Asmp.cxx
index 539c6a22d9e8..074c685b8525 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Asmp.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Asmp.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
 */
 
 /***************************************************************************
@@ -64,7 +64,7 @@ DblQ00Asmp::DblQ00Asmp(AmdcDb* asmp) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Aszt.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Aszt.cxx
index d61d998a0e1f..ed898a448b4a 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Aszt.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Aszt.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
 */
 
 /***************************************************************************
@@ -81,7 +81,7 @@ DblQ00Aszt::DblQ00Aszt(AmdcDb* aszt) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Atln.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Atln.cxx
index 572eac28e306..f84dad58d88a 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Atln.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Atln.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
 */
 
 /***************************************************************************
@@ -76,7 +76,7 @@ DblQ00Atln::DblQ00Atln(AmdcDb* atln) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Atyp.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Atyp.cxx
index 11e2a56f337f..667ec4b6384e 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Atyp.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Atyp.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
 */
 
 /***************************************************************************
@@ -65,7 +65,7 @@ DblQ00Atyp::DblQ00Atyp(AmdcDb* atyp) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Awln.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Awln.cxx
index 17904fd4aaeb..3be91fe943e2 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Awln.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Awln.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
 */
 
 /***************************************************************************
@@ -73,7 +73,7 @@ DblQ00Awln::DblQ00Awln(AmdcDb* awln) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Dbam.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Dbam.cxx
index 986d08a704bc..ef4452ed24d2 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Dbam.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Dbam.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
 */
 
 /***************************************************************************
@@ -89,7 +89,7 @@ DblQ00Dbam::DblQ00Dbam(AmdcDb* dbam) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00IAcsc.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00IAcsc.cxx
index cfe09283070b..16689de78003 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00IAcsc.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00IAcsc.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
 */
 
 /***************************************************************************
@@ -83,7 +83,7 @@ DblQ00IAcsc::DblQ00IAcsc(AmdcDb* iacsc) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wchv.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wchv.cxx
index f056dc6fa539..668da4aa2538 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wchv.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wchv.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
 */
 
 /***************************************************************************
@@ -67,7 +67,7 @@ DblQ00Wchv::DblQ00Wchv(AmdcDb* wchv) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcmi.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcmi.cxx
index bf3edef510f1..a29085ea4088 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcmi.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcmi.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
 */
 
 /***************************************************************************
@@ -67,7 +67,7 @@ DblQ00Wcmi::DblQ00Wcmi(AmdcDb* wcmi) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcro.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcro.cxx
index 3e4a1a9fd3e5..42a90a071bf5 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcro.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcro.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
 */
 
 /***************************************************************************
@@ -67,7 +67,7 @@ DblQ00Wcro::DblQ00Wcro(AmdcDb* wcro) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcsc.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcsc.cxx
index ee8cce4eb5b0..dca44fefd719 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcsc.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wcsc.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
 */
 
 /***************************************************************************
@@ -98,7 +98,7 @@ DblQ00Wcsc::DblQ00Wcsc(AmdcDb* wcsc) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wded.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wded.cxx
index 3b9ca39deb17..449dca3d56e4 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wded.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wded.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
 */
 
 /***************************************************************************
@@ -67,7 +67,7 @@ DblQ00Wded::DblQ00Wded(AmdcDb* wded) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wlbi.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wlbi.cxx
index 473192c3ba51..7bc3036f4829 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wlbi.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wlbi.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
 */
 
 /***************************************************************************
@@ -79,7 +79,7 @@ DblQ00Wlbi::DblQ00Wlbi(AmdcDb* wlbi) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wmdt.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wmdt.cxx
index bd4ca08af3fa..3be93254fed7 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wmdt.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wmdt.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
 */
 
 /***************************************************************************
@@ -81,7 +81,7 @@ DblQ00Wmdt::DblQ00Wmdt(AmdcDb* wmdt) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wrpc.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wrpc.cxx
index d2dfd39d10b8..9c14c5b80cf7 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wrpc.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wrpc.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
 */
 
 /***************************************************************************
@@ -81,7 +81,7 @@ DblQ00Wrpc::DblQ00Wrpc(AmdcDb* wrpc) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wspa.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wspa.cxx
index 0840a0d251f9..b55b65d3269d 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wspa.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wspa.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
 */
 
 /***************************************************************************
@@ -66,7 +66,7 @@ DblQ00Wspa::DblQ00Wspa(AmdcDb* wspa) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wsup.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wsup.cxx
index 9640257f6375..6b472d173974 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wsup.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wsup.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
 */
 
 /***************************************************************************
@@ -76,7 +76,7 @@ DblQ00Wsup::DblQ00Wsup(AmdcDb* wsup) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wtgc.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wtgc.cxx
index e09c3075e6f9..ae5b4c16aa1d 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wtgc.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Wtgc.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
 */
 
 /***************************************************************************
@@ -83,7 +83,7 @@ DblQ00Wtgc::DblQ00Wtgc(AmdcDb* wtgc) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
diff --git a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Xtomo.cxx b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Xtomo.cxx
index 50a0a2a8beda..25464d482f38 100644
--- a/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Xtomo.cxx
+++ b/MuonSpectrometer/MuonGMdbObjects/src/DblQ00Xtomo.cxx
@@ -110,7 +110,7 @@ DblQ00Xtomo::DblQ00Xtomo(AmdcDb* xtomo) :
 
   int i = -1;
   it = pIRDBRecordset->begin();
-  for( ; it<pIRDBRecordset->end(); it++){
+  for( ; it<pIRDBRecordset->end(); ++it){
      pAmdcDbRecord = dynamic_cast<const AmdcDbRecord*>((*it));
      if(pAmdcDbRecord == 0){
        std::cerr << "No way to cast in AmdcDbRecord for " << getObjName() << std::endl;
-- 
GitLab


From 8b67dadd307a5564c20cf4582a8b7b54fd3798bd Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Sep 2021 18:13:32 -0400
Subject: [PATCH 222/347] LArGeoEndcap: Remove EndcapPresamplerGeometryHelper.

Remove unused (and thread-unsafe) class EndcapPresamplerGeometryHelper.
---
 .../EndcapPresamplerGeometryHelper.h          | 59 -------------
 .../src/EndcapPresamplerGeometryHelper.cxx    | 85 -------------------
 2 files changed, 144 deletions(-)
 delete mode 100755 LArCalorimeter/LArGeoModel/LArGeoEndcap/LArGeoEndcap/EndcapPresamplerGeometryHelper.h
 delete mode 100755 LArCalorimeter/LArGeoModel/LArGeoEndcap/src/EndcapPresamplerGeometryHelper.cxx

diff --git a/LArCalorimeter/LArGeoModel/LArGeoEndcap/LArGeoEndcap/EndcapPresamplerGeometryHelper.h b/LArCalorimeter/LArGeoModel/LArGeoEndcap/LArGeoEndcap/EndcapPresamplerGeometryHelper.h
deleted file mode 100755
index 3031eb28baec..000000000000
--- a/LArCalorimeter/LArGeoModel/LArGeoEndcap/LArGeoEndcap/EndcapPresamplerGeometryHelper.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// EndcapPresamplerGeometryHelper.h
-// Prepared 16-Jul-2003 Bill Seligman
-
-// This is a separate geometry helper class for the endcap presampler.
-// It provides any separate calculations or constants for the endcap
-// presampler geometry.
-
-#ifndef LARGEOENDCAP_ENDCAPPRESAMPLERGEOMETRYHELPER_H
-#define LARGEOENDCAP_ENDCAPPRESAMPLERGEOMETRYHELPER_H
-
-namespace LArGeo {
-
-  // Forward declarations.
-  class VDetectorParameters;
-
-  class EndcapPresamplerGeometryHelper 
-  {
-  public:
-
-    // Accessor for pointer to the singleton.
-    static EndcapPresamplerGeometryHelper* GetInstance();
-
-    // "zShift" is the z-distance (cm) that the EM endcap is shifted
-    // (due to cabling, etc.)
-    float zShift() const { return m_zShift; }
-
-    // 15-Jan-2002 WGS: A "lookup" functions for detector measurements,
-    // sizes, and other values.
-    enum kValue {
-      rMinEndcapPresampler,
-      rMaxEndcapPresampler,
-      zEndcapPresamplerFrontFace,
-      zEndcapPresamplerBackFace,
-      EndcapPresamplerHalfThickness,
-      EndcapPresamplerZpositionInMother
-    };
-    double GetValue(const kValue);
-
-  protected:
-    // The constructor is protected according to the singleton design
-    // pattern.
-    EndcapPresamplerGeometryHelper();
-
-  private:
-    
-    // Pointer to source of detector parameters.
-    VDetectorParameters* m_parameters;
-    
-    // Store the endcap offset from the description:
-    float m_zShift;
-  };
-
-} // namespace LArGeo
-
-#endif // __EndcapPresamplerGeometryHelper_H__
diff --git a/LArCalorimeter/LArGeoModel/LArGeoEndcap/src/EndcapPresamplerGeometryHelper.cxx b/LArCalorimeter/LArGeoModel/LArGeoEndcap/src/EndcapPresamplerGeometryHelper.cxx
deleted file mode 100755
index f10e0d28d8b3..000000000000
--- a/LArCalorimeter/LArGeoModel/LArGeoEndcap/src/EndcapPresamplerGeometryHelper.cxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// EndcapPresamplerGeometryHelper
-// 27-Dec-2002 Bill Seligman
-
-// This singleton class provides detector-description information and
-// calculations for the Geant4 simulation. 
-
-// 2-July-2003 Mikhail Leltchouk: local coordinates for determination
-// of etaBin, phiBin at any Endcap Presamplerposition. 
-
-#include "GaudiKernel/SystemOfUnits.h"
-#include "LArGeoEndcap/EndcapPresamplerGeometryHelper.h"
-#include "LArGeoCode/VDetectorParameters.h"
-
-#include <cmath>
-#include <string>
-#include <iostream>
-
-
-// Standard implementation of a singleton pattern.
-
-LArGeo::EndcapPresamplerGeometryHelper* LArGeo::EndcapPresamplerGeometryHelper::GetInstance()
-{
-  static EndcapPresamplerGeometryHelper instance;
-  return &instance;
-}
-
-
-LArGeo::EndcapPresamplerGeometryHelper::EndcapPresamplerGeometryHelper()
-{
-  // Constructor initializes the geometry helper information.
-
-  // Access source of detector parameters.
-  m_parameters = VDetectorParameters::GetInstance();
-
-  // Get the endcap shift and out-of-time cut from the detector
-  // parameters routine.
-  m_zShift = m_parameters->GetValue("LArEMECZshift");
-}
-
-
-double LArGeo::EndcapPresamplerGeometryHelper::GetValue(const kValue a_valueType)
-{
-  // Look up a value based on name.
-  switch (a_valueType)
-    {
-    case rMinEndcapPresampler:
-      //return 1231.74 * mm;
-      return  m_parameters->GetValue("LArEMECPreMinRadius");
-      break;
-    case rMaxEndcapPresampler:
-      //return 1701.98 * mm;
-      return  m_parameters->GetValue("LArEMECPreMaxRadius");
-      break;
-      // At nominal (zShift=0) endcap position absolute z-coordinates: 
-      // of the faces of the EndcapPresampler
-    case zEndcapPresamplerFrontFace:
-      //return 3622. * mm;
-      return (m_parameters->GetValue("LArEMECPreNomPos")
-	      - GetValue(EndcapPresamplerHalfThickness));
-      break;
-    case zEndcapPresamplerBackFace:
-      //return 3626. * mm;
-      return (m_parameters->GetValue("LArEMECPreNomPos")
-	      + GetValue(EndcapPresamplerHalfThickness)); 
-      break;
-    case EndcapPresamplerHalfThickness:
-      //return ( GetValue(zEndcapPresamplerBackFace) - GetValue(zEndcapPresamplerFrontFace) ) / 2.;
-      return  (m_parameters->GetValue("LArEMECPreThickness")/2.);
-      break;
-    case EndcapPresamplerZpositionInMother:
-      // between cold wall center and presampler center which is at
-      // 3624 Gaudi::Units::mm nominal (zShift=0) absolute position
-      return 30.5 * Gaudi::Units::mm;
-      break;
-    default:
-      std::cerr << "EndcapPresamplerGeometryHelper::GetValue -- type '"
-		<< a_valueType
-		<< "' not recognized; using zero" << std::endl;
-      return 0.;
-    }
-}
-- 
GitLab


From 858439736e6838af4abce1932f7762be55e87c8a Mon Sep 17 00:00:00 2001
From: Aleksandra Poreba <aleksandra.poreba@cern.ch>
Date: Tue, 21 Sep 2021 09:57:52 +0200
Subject: [PATCH 223/347] Increase RunTrigCostAnalysis verbosity

---
 .../share/RunTrigCostAnalysis.py                | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py b/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py
index d72669b366b2..b397a8f00f61 100755
--- a/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py
+++ b/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py
@@ -80,10 +80,10 @@ def readHashes(joFileName="", smk=0, dbAlias=""):
       from TrigConfIO.HLTTriggerConfigAccess import HLTJobOptionsAccess
       joData = HLTJobOptionsAccess(dbalias = dbAlias, smkey = smk)
     else:
-      log.debug("Additional names not available")
+      log.debug("Additional collection's names from HLTJobOptions file are not available")
       return list()
   except Exception as err:
-    log.warning("Retrieving additional names failed: {0}".format(err))
+    log.warning("Retrieving additional names fron HLTJO failed: {0}".format(err))
     return list()
 
   namesList = set()
@@ -135,13 +135,15 @@ def hltConfigSvcCfg(flags, smk, dbAlias):
     hltConfigSvc.InputType = "file"
     hltConfigSvc.XMLMenuFile = "None"
     hltConfigSvc.JsonFileName = menuFile
-  else:
+  elif smk and dbAlias:
     log.debug("Reading HLTMenu from database {0} {1}".format(smk, dbAlias))
 
     hltConfigSvc.InputType = "DB"
     hltConfigSvc.JsonFileName = ""
     hltConfigSvc.TriggerDB = dbAlias
     hltConfigSvc.SMK = smk
+  else:
+    log.error("Cannot read the HLTMenu! Provide file or relevant keys.")
 
   acc.addService(hltConfigSvc, False, True)
 
@@ -155,6 +157,7 @@ def readConfigFromCool(smk, dbAlias):
   runNumber = GetFileMD(ConfigFlags.Input.Files)['runNumbers'][0]
   configKeys = TriggerCoolUtil.getHLTConfigKeys(dbconn, [[runNumber, runNumber]])
 
+  log.debug("Getting keys from COOL for run {0}".format(runNumber))
   if configKeys and runNumber in configKeys.keys():
     if not smk:
       smk = configKeys[runNumber]['SMK']
@@ -166,12 +169,14 @@ def readConfigFromCool(smk, dbAlias):
     log.debug("Config keys are SMK: {0} DB alias: {1}".format(smk, dbAlias))
 
   else:
-    log.error("Configuration keys not found!")
+    log.debug("Configuration keys for run {0} not found!".format(runNumber))
+    dbAlias = None if not dbAlias else dbAlias
+    smk = None if not smk else smk
 
   return (smk, dbAlias)
 
 
-# Get HLT Menu from json file or from DB
+# Get HLT Menu from json file
 def getHltMenu():
   # Try to find local menu file
   menuFileName = 'HLTMenu_.*json'
@@ -207,7 +212,7 @@ if __name__=='__main__':
 
   parser.add_argument('--maxEvents', type=int, help='Maximum number of events to process')
   parser.add_argument('--skipEvents',type=int, help='Number of events to skip')
-  parser.add_argument('--loglevel', type=int, default=3, help='Verbosity level')
+  parser.add_argument('--loglevel', type=int, default=3, help='Verbosity level: 1 - VERBOSE, 2 - DEBUG, 3 - INFO')
   parser.add_argument('flags', nargs='*', help='Config flag overrides')  
   args = parser.parse_args()
 
-- 
GitLab


From 006a4b85f4229ec3b2d4d596a9020e36be3d9951 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 21 Sep 2021 10:04:55 +0200
Subject: [PATCH 224/347] Remove legacy L1Muon sim configuration

We only support the Phase-1 L1Muon simulation in master. The existing
`Trigger.enableL1MuonPhase1` flag now only drives the configuration of the
data decoding on Run-1&2 data. Remove the usage of this flag for the
purposes of the L1 simulation configuration.
---
 .../Digitization/share/LVL1Digitization.py    |  8 +-
 .../python/L1TopoSimulationConfig.py          | 84 +++++--------------
 ...MonitoringJobOptions_forRecExCommission.py |  8 +-
 .../TrigT1CTP/python/CTPSimulationConfig.py   |  4 +-
 .../Lvl1MuonSimulationConfigOldStyle.py       | 77 ++++++-----------
 .../python/Lvl1SimulationConfig.py            | 13 +--
 .../python/TriggerConfigFlags.py              |  2 +-
 7 files changed, 60 insertions(+), 136 deletions(-)

diff --git a/Simulation/Digitization/share/LVL1Digitization.py b/Simulation/Digitization/share/LVL1Digitization.py
index d2339a0f595b..c68965920a42 100755
--- a/Simulation/Digitization/share/LVL1Digitization.py
+++ b/Simulation/Digitization/share/LVL1Digitization.py
@@ -114,12 +114,8 @@ if DetFlags.digitize.LVL1_on():
     #--------------------------------------------------------------
     if DetFlags.simulateLVL1.RPC_on() or DetFlags.simulateLVL1.TGC_on():
         from AthenaConfiguration.AllConfigFlags import ConfigFlags
-        if ConfigFlags.Trigger.enableL1MuonPhase1:
-            from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import L1MuctpiPhase1
-            topSequence += L1MuctpiPhase1()
-        else:
-            from TrigT1Muctpi.TrigT1MuctpiConfig import L1Muctpi
-            topSequence += L1Muctpi()
+        from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import L1MuctpiPhase1
+        topSequence += L1MuctpiPhase1()
 
     #-------------------------------------------------------
     # TrigT1CaloSim Algos
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py b/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py
index e9e01bbf5f64..6ab4dd5e9486 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/python/L1TopoSimulationConfig.py
@@ -26,32 +26,20 @@ def L1LegacyTopoSimulationCfg(flags):
     acc = ComponentAccumulator()
     
     #Grab the MUCTPI tool
-    if flags.Trigger.enableL1MuonPhase1:
-        from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import MUCTPI_AthToolCfg
-        muctpiTool = MUCTPI_AthToolCfg("MUCTPI_AthTool")
-        acc.addPublicTool(muctpiTool, primary=True)
-    else:
-        from TrigT1Muctpi.TrigT1MuctpiConfig import L1MuctpiToolRDOCfg
-        muctpiToolAcc = L1MuctpiToolRDOCfg(flags)
-        muctpiTool = muctpiToolAcc.getPrimary()
-        acc.merge(muctpiToolAcc)
+    from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import MUCTPI_AthToolCfg
+    muctpiTool = MUCTPI_AthToolCfg("MUCTPI_AthTool")
+    acc.addPublicTool(muctpiTool, primary=True)
 
     #Configure the MuonInputProvider
-    if flags.Trigger.enableL1MuonPhase1:
-        muProvider = CompFactory.LVL1.MuonInputProvider("MuonInputProvider", 
-                                                        ROIBResultLocation = "", #disable input from RoIBResult
-                                                        MuonROILocation = "",
-                                                        MuonEncoding = 1)
-    else:
-        muProvider = CompFactory.LVL1.MuonInputProviderLegacy("MuonInputProviderLegacy", 
-                                                              ROIBResultLocation = "", #disable input from RoIBResult
-                                                              MuctpiSimTool = muctpiTool,
-                                                              MuonEncoding = 1 if flags.Input.isMC else 0)
+    muProvider = CompFactory.LVL1.MuonInputProvider("MuonInputProvider",
+                                                    ROIBResultLocation = "", #disable input from RoIBResult
+                                                    MuonROILocation = "",
+                                                    MuonEncoding = 1)
 
     #Configure the MuonRoiTools for the MIP
     from TrigT1MuonRecRoiTool.TrigT1MuonRecRoiToolConfig import getRun3RPCRecRoiTool, getRun3TGCRecRoiTool
-    muProvider.RecRpcRoiTool = getRun3RPCRecRoiTool("RPCRecRoiTool", useRun3Config = flags.Trigger.enableL1MuonPhase1)
-    muProvider.RecTgcRoiTool = getRun3TGCRecRoiTool("TGCRecRoiTool", useRun3Config = flags.Trigger.enableL1MuonPhase1)
+    muProvider.RecRpcRoiTool = getRun3RPCRecRoiTool("RPCRecRoiTool", useRun3Config = True)
+    muProvider.RecTgcRoiTool = getRun3TGCRecRoiTool("TGCRecRoiTool", useRun3Config = True)
 
     emtauProvider = CompFactory.LVL1.EMTauInputProvider("EMTauInputProvider")
 
@@ -70,27 +58,15 @@ def L1TopoSimulationCfg(flags):
     acc = ComponentAccumulator()
 
     #Configure the MuonInputProvider
-    if flags.Trigger.enableL1MuonPhase1:
-        muProvider = CompFactory.LVL1.MuonInputProvider("MuonInputProvider", 
-                                                        ROIBResultLocation = "", #disable input from RoIBResult
-                                                        MuonROILocation = "",
-                                                        MuonEncoding = 1)
-    else:
-        #Grab the MUCTPI tool
-        from TrigT1Muctpi.TrigT1MuctpiConfig import L1MuctpiToolRDOCfg
-        muctpiToolAcc = L1MuctpiToolRDOCfg(flags)
-        muctpiTool = muctpiToolAcc.getPrimary()
-        acc.merge(muctpiToolAcc)
-
-        muProvider = CompFactory.LVL1.MuonInputProviderLegacy("MuonInputProviderLegacy", 
-                                                              ROIBResultLocation = "", #disable input from RoIBResult
-                                                              MuctpiSimTool = muctpiTool,
-                                                              MuonEncoding = 1 if flags.Input.isMC else 0)
+    muProvider = CompFactory.LVL1.MuonInputProvider("MuonInputProvider",
+                                                    ROIBResultLocation = "", #disable input from RoIBResult
+                                                    MuonROILocation = "",
+                                                    MuonEncoding = 1)
 
     #Configure the MuonRoiTools for the MIP
     from TrigT1MuonRecRoiTool.TrigT1MuonRecRoiToolConfig import getRun3RPCRecRoiTool, getRun3TGCRecRoiTool
-    muProvider.RecRpcRoiTool = getRun3RPCRecRoiTool("RPCRecRoiTool", useRun3Config = flags.Trigger.enableL1MuonPhase1)
-    muProvider.RecTgcRoiTool = getRun3TGCRecRoiTool("TGCRecRoiTool", useRun3Config = flags.Trigger.enableL1MuonPhase1)
+    muProvider.RecRpcRoiTool = getRun3RPCRecRoiTool("RPCRecRoiTool", useRun3Config = True)
+    muProvider.RecTgcRoiTool = getRun3TGCRecRoiTool("TGCRecRoiTool", useRun3Config = True)
 
     emtauProvider = CompFactory.LVL1.EMTauInputProviderFEX("EMTauInputProviderFEX")
 
@@ -121,30 +97,10 @@ def L1TopoSimulationOldStyleCfg(flags, isLegacy):
         # TODO: the legacy simulation should not need to deal with muon inputs
         topoSimSeq.MuonInputProvider.ROIBResultLocation = "" #disable input from RoIBResult
 
-    if flags.Trigger.enableL1MuonPhase1: 
-        from TrigT1MuonRecRoiTool.TrigT1MuonRecRoiToolConfig import getRun3RPCRecRoiTool, getRun3TGCRecRoiTool
-        topoSimSeq.MuonInputProvider.RecRpcRoiTool = getRun3RPCRecRoiTool(useRun3Config=True)
-        topoSimSeq.MuonInputProvider.RecTgcRoiTool = getRun3TGCRecRoiTool(useRun3Config=True)
-        topoSimSeq.MuonInputProvider.MuonROILocation = ""
-        topoSimSeq.MuonInputProvider.MuonEncoding = 1
-    else:
-        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-        from TrigT1Muctpi.TrigT1MuctpiConfig import L1MuctpiTool
-        ToolSvc += L1MuctpiTool("L1MuctpiTool")
-        ToolSvc.L1MuctpiTool.LVL1ConfigSvc = svcMgr.LVL1ConfigSvc
-        ToolSvc.MuonInputProviderLegacy.MuctpiSimTool = ToolSvc.L1MuctpiTool
-        ToolSvc.MuonInputProviderLegacy.locationMuCTPItoL1Topo = ""
-        if not flags.Trigger.doLVL1:
-            ToolSvc.MuonInputProviderLegacy.MuonROILocation = ""
-        # enable the reduced (coarse) granularity topo simulation
-        # currently only for MC
-        # apparently not needed for phase1
-        if not flags.Input.isMC:
-            ToolSvc.MuonInputProviderLegacy.MuonEncoding = 1
-        else:
-            ToolSvc.MuonInputProviderLegacy.MuonEncoding = 0
-
-    if not flags.Trigger.enableL1MuonPhase1:
-        topoSimSeq.MuonInputProvider = ToolSvc.MuonInputProviderLegacy
+    from TrigT1MuonRecRoiTool.TrigT1MuonRecRoiToolConfig import getRun3RPCRecRoiTool, getRun3TGCRecRoiTool
+    topoSimSeq.MuonInputProvider.RecRpcRoiTool = getRun3RPCRecRoiTool(useRun3Config=True)
+    topoSimSeq.MuonInputProvider.RecTgcRoiTool = getRun3TGCRecRoiTool(useRun3Config=True)
+    topoSimSeq.MuonInputProvider.MuonROILocation = ""
+    topoSimSeq.MuonInputProvider.MuonEncoding = 1
 
     return topoSimSeq
diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py
index d7a2a47c02f0..bae11c6e370a 100644
--- a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py
+++ b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py
@@ -188,12 +188,8 @@ else:
         from AthenaCommon.AlgSequence import AthSequencer
         CTPMonSeq=CfgMgr.AthSequencer('CTPMonSeq')
 
-        if ConfigFlags.Trigger.enableL1MuonPhase1:
-            from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import L1MuctpiPhase1_on_Data
-            CTPMonSeq += L1MuctpiPhase1_on_Data()
-        else:
-            from TrigT1Muctpi.TrigT1MuctpiConfig import L1Muctpi_on_Data
-            CTPMonSeq += L1Muctpi_on_Data()
+        from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import L1MuctpiPhase1_on_Data
+        CTPMonSeq += L1MuctpiPhase1_on_Data()
 
         from TrigT1CTMonitoring.TrigT1CTMonitoringConf import TrigT1CTMonitoring__DeriveSimulationInputs as DeriveSimulationInputs
         CTPMonSeq += DeriveSimulationInputs(do_MuCTPI_input=True,
diff --git a/Trigger/TrigT1/TrigT1CTP/python/CTPSimulationConfig.py b/Trigger/TrigT1/TrigT1CTP/python/CTPSimulationConfig.py
index 52c58bed1e25..8292367ce9ce 100644
--- a/Trigger/TrigT1/TrigT1CTP/python/CTPSimulationConfig.py
+++ b/Trigger/TrigT1/TrigT1CTP/python/CTPSimulationConfig.py
@@ -22,10 +22,10 @@ def CTPSimulationCfg(flags):
                                                         LegacyTopoInput = "L1TopoLegacyToCTPLocation"
                                                         ))
     log.info("Not all part of CTP simulation are enabled yet")
-    if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1MuonPhase1:
+    if flags.Trigger.enableL1CaloLegacy:
         roib = CompFactory.ROIB.RoIBuilder("RoIBuilder",
                                             DoCalo = flags.Trigger.enableL1CaloLegacy,
-                                            DoMuon = not flags.Trigger.enableL1MuonPhase1)
+                                            DoMuon = False)   # not needed for L1MuonPhase1
         acc.addEventAlgo(roib)
 
 
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1MuonSimulationConfigOldStyle.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1MuonSimulationConfigOldStyle.py
index 704f02f6d00a..b3a5478c365b 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1MuonSimulationConfigOldStyle.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1MuonSimulationConfigOldStyle.py
@@ -171,35 +171,19 @@ def TGCTriggerConfig(flags):
     tgc = CompFactory.LVL1TGCTrigger__LVL1TGCTrigger("LVL1TGCTrigger",
                                                      InputData_perEvent  = "TGC_DIGITS_L1",
                                                      MaskFileName12      = "" if MuonGeometryFlags.hasSTGC() or MuonGeometryFlags.hasMM() else "TrigT1TGCMaskedChannel._12.db",
-                                                     useRun3Config = flags.Trigger.enableL1MuonPhase1,
+                                                     useRun3Config = True,
                                                      TileMuRcv_Input = tmdbInput )
     from IOVDbSvc.CondDB import conddb
     from AthenaCommon.AlgSequence import AthSequencer
     condSeq = AthSequencer("AthCondSeq")
-    if flags.Trigger.enableL1MuonPhase1:
-        if flags.Trigger.L1MuonSim.EmulateNSWA or flags.Trigger.L1MuonSim.EmulateNSWC:
-            tgc.MuctpiPhase1LocationTGC = "L1MuctpiStoreTGCint"
-        tgc.TILEMU = True
-        condSeq += CompFactory.TGCTriggerCondAlg()
-        from PathResolver import PathResolver
-        bwCW_Run3_filePath=PathResolver.FindCalibFile("TrigT1TGC_CW/BW/CW_BW_Run3.v01.db")
-        conddb.blockFolder("/TGC/TRIGGER/CW_BW_RUN3")
-        conddb.addFolder(bwCW_Run3_filePath,"/TGC/TRIGGER/CW_BW_RUN3 <tag>TgcTriggerCwBwRun3-01</tag>",forceMC=True,force=True, className='CondAttrListCollection')
-    else:
-        condSeq += CompFactory.TGCTriggerDbAlg()
-        if not flags.Input.isMC:
-            conddbNameOffline = flags.Trigger.L1MuonSim.CondDBOffline if flags.Trigger.L1MuonSim.CondDBOffline != '' else "OFLCOND-MC16-SDR-RUN2-04"
-            conddb._SetAcc('TGC_OFL','COOLOFL_TGC')
-            conddb.blockFolder("/TGC/TRIGGER/CW_EIFI")
-            conddb.blockFolder("/TGC/TRIGGER/CW_BW")
-            conddb.blockFolder("/TGC/TRIGGER/CW_TILE")
-            conddb.addFolderWithTag("TGC_OFL","/TGC/TRIGGER/CW_EIFI",conddbNameOffline,forceMC=True,force=True,className="CondAttrListCollection")
-            conddb.addFolderWithTag("TGC_OFL","/TGC/TRIGGER/CW_BW",conddbNameOffline,forceMC=True,force=True,className="CondAttrListCollection")
-            conddb.addFolderWithTag("TGC_OFL","/TGC/TRIGGER/CW_TILE",conddbNameOffline,forceMC=True,force=True,className="CondAttrListCollection")
-        else:
-            conddb.addFolder("TGC_OFL", "/TGC/TRIGGER/CW_EIFI", className="CondAttrListCollection")
-            conddb.addFolder("TGC_OFL", "/TGC/TRIGGER/CW_BW", className="CondAttrListCollection")
-            conddb.addFolder("TGC_OFL", "/TGC/TRIGGER/CW_TILE", className="CondAttrListCollection")
+    if flags.Trigger.L1MuonSim.EmulateNSWA or flags.Trigger.L1MuonSim.EmulateNSWC:
+        tgc.MuctpiPhase1LocationTGC = "L1MuctpiStoreTGCint"
+    tgc.TILEMU = True
+    condSeq += CompFactory.TGCTriggerCondAlg()
+    from PathResolver import PathResolver
+    bwCW_Run3_filePath=PathResolver.FindCalibFile("TrigT1TGC_CW/BW/CW_BW_Run3.v01.db")
+    conddb.blockFolder("/TGC/TRIGGER/CW_BW_RUN3")
+    conddb.addFolder(bwCW_Run3_filePath,"/TGC/TRIGGER/CW_BW_RUN3 <tag>TgcTriggerCwBwRun3-01</tag>",forceMC=True,force=True, className='CondAttrListCollection')
 
     return tgc
 
@@ -218,7 +202,7 @@ def Lvl1EndcapMuonSequence(flags):
     tmdb = TMDBSimulationSequence(flags)
     tgc = TGCTriggerConfig(flags)
     from AthenaCommon.CFElements import seqAND
-    if flags.Trigger.enableL1MuonPhase1 and ( flags.Trigger.L1MuonSim.EmulateNSWA or flags.Trigger.L1MuonSim.EmulateNSWC ):
+    if flags.Trigger.L1MuonSim.EmulateNSWA or flags.Trigger.L1MuonSim.EmulateNSWC:
         rdo2prd = MuonRdo2PrdSequence(flags)
         recoSegment = RecoMuonSegmentSequence(flags)
         tgcmod = TGCModifierConfig(flags)
@@ -234,7 +218,7 @@ def Lvl1BarrelMuonSequence(flags):
                                 RPCbytestream     = False,
                                 RPCbytestreamFile = "",
                                 RPCDigitContainer = "RPC_DIGITS_L1",
-                                useRun3Config = flags.Trigger.enableL1MuonPhase1 )
+                                useRun3Config = True )
 
     # trigger roads setting is configured in either MuonCnvExample.MuonCablingConfig or MuonConfig.MuonCablingConfig
 
@@ -243,30 +227,21 @@ def Lvl1BarrelMuonSequence(flags):
     return l1MuBarrelSim
 
 def Lvl1MuctpiConfig(flags):
-    if flags.Trigger.enableL1MuonPhase1:
-        rpcRecRoiTool = CompFactory.LVL1__TrigT1RPCRecRoiTool("TrigT1RPCRecRoiTool", UseRun3Config=True)
-        tgcRecRoiTool = CompFactory.LVL1__TrigT1TGCRecRoiTool("TrigT1TGCRecRoiTool", UseRun3Config=True)
-        muctpiTool = CompFactory.LVL1MUCTPIPHASE1__MUCTPI_AthTool(name="MUCTPI_AthTool")
-        muctpiTool.MuCTPICTPLocation = 'L1MuCTPItoCTPLocation'
-        muctpiTool.OverlapStrategyName = 'LUT'
-        muctpiTool.LUTXMLFile = 'TrigConfMuctpi/overlapRun3_20201214.xml'
-        muctpiTool.InputSource = 'DIGITIZATION'
-        muctpiTool.RPCRecRoiTool = rpcRecRoiTool
-        muctpiTool.TGCRecRoiTool = tgcRecRoiTool
-        muctpiTool.TrigThresholdDecisionTool = CompFactory.LVL1__TrigThresholdDecisionTool(name="TrigThresholdDecisionTool")
-        muctpiTool.TrigThresholdDecisionTool.RPCRecRoiTool = rpcRecRoiTool
-        muctpiTool.TrigThresholdDecisionTool.TGCRecRoiTool = tgcRecRoiTool
-        muctpi = CompFactory.LVL1MUCTPIPHASE1__MUCTPI_AthAlg(name="MUCTPI_AthAlg",
-                                                             MUCTPI_AthTool = muctpiTool)
-        return muctpi
-    else:
-        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-        from TrigT1Muctpi.TrigT1MuctpiConfig import L1Muctpi
-        muctpi = L1Muctpi()
-        muctpi.LVL1ConfigSvc = svcMgr.LVL1ConfigSvc
-        if not flags.Input.isMC:
-            muctpi.RDOOutputLocID = 'rerunMUCTPI_RDO'
-        return muctpi
+    rpcRecRoiTool = CompFactory.LVL1__TrigT1RPCRecRoiTool("TrigT1RPCRecRoiTool", UseRun3Config=True)
+    tgcRecRoiTool = CompFactory.LVL1__TrigT1TGCRecRoiTool("TrigT1TGCRecRoiTool", UseRun3Config=True)
+    muctpiTool = CompFactory.LVL1MUCTPIPHASE1__MUCTPI_AthTool(name="MUCTPI_AthTool")
+    muctpiTool.MuCTPICTPLocation = 'L1MuCTPItoCTPLocation'
+    muctpiTool.OverlapStrategyName = 'LUT'
+    muctpiTool.LUTXMLFile = 'TrigConfMuctpi/overlapRun3_20201214.xml'
+    muctpiTool.InputSource = 'DIGITIZATION'
+    muctpiTool.RPCRecRoiTool = rpcRecRoiTool
+    muctpiTool.TGCRecRoiTool = tgcRecRoiTool
+    muctpiTool.TrigThresholdDecisionTool = CompFactory.LVL1__TrigThresholdDecisionTool(name="TrigThresholdDecisionTool")
+    muctpiTool.TrigThresholdDecisionTool.RPCRecRoiTool = rpcRecRoiTool
+    muctpiTool.TrigThresholdDecisionTool.TGCRecRoiTool = tgcRecRoiTool
+    muctpi = CompFactory.LVL1MUCTPIPHASE1__MUCTPI_AthAlg(name="MUCTPI_AthAlg",
+                                                         MUCTPI_AthTool = muctpiTool)
+    return muctpi
 
 def Lvl1MuonSimulationSequence(flags):
     rdo2digit = Lvl1MuRdo2Digit(flags)
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py
index 749107c862d7..27715cb562cb 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Lvl1SimulationConfig.py
@@ -16,6 +16,10 @@ def Lvl1SimulationSequence( ConfigFlags ):
 
     log = logging.getLogger('TriggerJobOpts.Lvl1SimulationConfig')
 
+    if ConfigFlags.Trigger.L1.doMuon and not ConfigFlags.Trigger.enableL1MuonPhase1:
+        raise RuntimeError('The Run-1&2 L1Muon simulation is only supported in release<=21. '
+                           'Please set Trigger.enableL1MuonPhase1=True.')
+
     if not ConfigFlags.Input.isMC:
         from AthenaCommon.DetFlags import DetFlags
         DetFlags.detdescr.ALFA_setOff()
@@ -140,8 +144,6 @@ def Lvl1SimulationSequence( ConfigFlags ):
         if ConfigFlags.Trigger.enableL1CaloLegacy:
             isL1TopoLegacyOutputProvided = True
         isL1TopoOutputProvided = True
-        if ConfigFlags.Trigger.enableL1MuonPhase1 or ConfigFlags.Trigger.enableL1CaloPhase1:
-            isL1TopoOutputProvided = True
 
     if ConfigFlags.Trigger.L1.doCTP:
         from TrigT1CTP.TrigT1CTPConfig import CTPSimulationInReco
@@ -161,8 +163,7 @@ def Lvl1SimulationSequence( ConfigFlags ):
             ctp.LegacyTopoInput = ""
         if not isL1TopoOutputProvided:
             ctp.TopoInput = ""
-        if not ConfigFlags.Trigger.enableL1MuonPhase1: # Run 2 simulation of MUCTPI sends a slightly different format to the CTP
-            ctp.MuonMultiplicityRun2Format = True
+
         ctp.jFexJetInput = ""
         ctp.jFexLJetInput = ""
         ctp.gFexJetInput = ""
@@ -173,11 +174,11 @@ def Lvl1SimulationSequence( ConfigFlags ):
         ctp.eFexTauInput = ""
         ctpSimSeq = seqAND("CTPSimSeq", [ctp])
 
-        if ConfigFlags.Trigger.enableL1CaloLegacy or not ConfigFlags.Trigger.enableL1MuonPhase1:
+        if ConfigFlags.Trigger.enableL1CaloLegacy:
             from TrigT1RoIB.TrigT1RoIBConfig import RoIBuilder
             roib = RoIBuilder("RoIBuilder")
             roib.DoCalo = ConfigFlags.Trigger.enableL1CaloLegacy
-            roib.DoMuon = not ConfigFlags.Trigger.enableL1MuonPhase1
+            roib.DoMuon = False    # not needed for L1MuonPhase1
             ctpSimSeq += [roib]
 
     ##################################################
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
index 62f9d7e2bb06..d7aa39bbe2d0 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
@@ -25,7 +25,7 @@ def createTriggerFlags():
     # changes decoding of L1 so that allways all configured chains are enabled, testing mode
     flags.addFlag("Trigger.HLTSeeding.forceEnableAllChains", False)
 
-    # Enable Run-3 LVL1 muon simulation and/or decoding
+    # Enable Run-3 LVL1 muon decoding
     flags.addFlag('Trigger.enableL1MuonPhase1', False)
 
     # Enable Run-3 LVL1 calo simulation and/or decoding
-- 
GitLab


From b50cfa2cd785e4fada773f72de989c3f5f6e1012 Mon Sep 17 00:00:00 2001
From: Alaettin Serhan Mete <alaettin.serhan.mete@cern.ch>
Date: Tue, 21 Sep 2021 11:07:16 +0200
Subject: [PATCH 225/347] Add a flag to configure the JSON output in the
 CA-based configuration

---
 .../PerfMonComps/python/PerfMonCompsConfig.py                    | 1 +
 .../PerfMonComps/python/PerfMonConfigFlags.py                    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonCompsConfig.py b/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonCompsConfig.py
index 8f41afd32b22..774e7de5faf1 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonCompsConfig.py
+++ b/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonCompsConfig.py
@@ -34,6 +34,7 @@ def PerfMonMTSvcCfg(flags, **kwargs):
                       max(1,flags.Concurrency.NumConcurrentEvents))
     kwargs.setdefault("doComponentLevelMonitoring",
                       flags.PerfMon.doFullMonMT)
+    kwargs.setdefault("jsonFileName", flags.PerfMon.OutputJSON)
 
     # Get CA and add the service 
     acc = ComponentAccumulator()
diff --git a/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonConfigFlags.py b/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonConfigFlags.py
index 353af4479999..3f0a9dde6ab4 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonConfigFlags.py
+++ b/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonConfigFlags.py
@@ -8,5 +8,6 @@ def createPerfMonConfigFlags():
     # Two basic flags for PerfMonMT
     pcf.addFlag('PerfMon.doFastMonMT', False)
     pcf.addFlag('PerfMon.doFullMonMT', False)
+    pcf.addFlag('PerfMon.OutputJSON', 'perfmonmt.json')
     
     return pcf
-- 
GitLab


From f1e0b73b6a30bc80e0e9778cb6d8b5070392bedf Mon Sep 17 00:00:00 2001
From: Antonio Manuel Mendes Jacques Da Costa
 <antonio.manuel.mendes.jacques.da.costa@cern.ch>
Date: Tue, 21 Sep 2021 14:05:59 +0200
Subject: [PATCH 226/347] Updating setting of working points for isolation
 variables due to use of firmware thresholds

---
 .../L1CaloFEXSim/L1CaloFEXSim/eFEXFPGA.h      |  2 +-
 .../L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx   | 27 ++++++++++------
 .../L1CaloFEX/L1CaloFEXSim/src/eFEXegAlgo.cxx |  6 ++--
 .../L1CaloFEXToolInterfaces/IeFEXFPGA.h       |  2 +-
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 32 ++++++++++++-------
 .../share/ref_v1Dev_decodeBS_build.ref        | 10 +++---
 6 files changed, 49 insertions(+), 30 deletions(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXFPGA.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXFPGA.h
index 05e8c3eb8d86..a767f4102ada 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXFPGA.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXFPGA.h
@@ -52,7 +52,7 @@ namespace LVL1 {
     virtual int getID() override {return m_id;}
 
     virtual void SetTowersAndCells_SG( int [][6] ) override ;
-    virtual void SetIsoWP(std::vector<unsigned int> &, std::vector<unsigned int> &, unsigned int &) override ;
+    virtual void SetIsoWP(std::vector<unsigned int> &, std::vector<unsigned int> &, unsigned int &, unsigned int &) override ;
 
     virtual std::vector <uint32_t> getEmTOBs() override ;
     virtual std::vector <uint32_t> getTauTOBs() override ;
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
index 6fcd651df0e0..192414cfef5d 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
@@ -29,7 +29,7 @@
 #include "StoreGate/ReadHandle.h"
 #include "SGTools/TestStore.h"
 #include "TrigConfData/L1Menu.h"
-
+#include <unordered_map>
 
 #include <iostream>
 #include <fstream>
@@ -165,9 +165,15 @@ StatusCode eFEXFPGA::execute(eFEXOutputCollection* inputOutputCollection){
       unsigned int RetaWP = 0;
       unsigned int RhadWP = 0;
       unsigned int WstotWP = 0;
-      SetIsoWP(RetaCoreEnv,threshReta,RetaWP);
-      SetIsoWP(RhadCoreEnv,threshRhad,RhadWP);
-      SetIsoWP(WstotCoreEnv,threshWstot,WstotWP);
+      
+      // bitshifts for the different iso vars
+      unsigned int RetaBitS = 3;
+      unsigned int RhadBitS = 3;
+      unsigned int WstotBitS = 5;
+      
+      SetIsoWP(RetaCoreEnv,threshReta,RetaWP,RetaBitS);
+      SetIsoWP(RhadCoreEnv,threshRhad,RhadWP,RhadBitS);
+      SetIsoWP(WstotCoreEnv,threshWstot,WstotWP,WstotBitS);
       int eta_ind = ieta; // No need to offset eta index with new 0-5 convention
       int phi_ind = iphi - 1;
 
@@ -340,7 +346,8 @@ void eFEXFPGA::SetTowersAndCells_SG(int tmp_eTowersIDs_subset[][6]){
 }
 
 
-void eFEXFPGA::SetIsoWP(std::vector<unsigned int> & CoreEnv, std::vector<unsigned int> & thresholds, unsigned int & workingPoint) {
+void eFEXFPGA::SetIsoWP(std::vector<unsigned int> & CoreEnv, std::vector<unsigned int> & thresholds, unsigned int & workingPoint, unsigned int & bitshift) {
+  // Working point evaluted by Core * 2^bitshift > Threshold * Environment conditions
 
   bool CoreOverflow = false;
   bool EnvOverflow = false;
@@ -348,7 +355,9 @@ void eFEXFPGA::SetIsoWP(std::vector<unsigned int> & CoreEnv, std::vector<unsigne
   bool ThrEnvOverflowM = false;
   bool ThrEnvOverflowT = false;
 
-  if (CoreEnv[0] > 0xffff) CoreOverflow = true;
+  std::unordered_map<unsigned int, unsigned int> bsmap { {3, 8}, {5, 32}};
+
+  if (CoreEnv[0]*bsmap[bitshift] > 0xffff) CoreOverflow = true;
   if (CoreEnv[1] > 0xffff) EnvOverflow = true;
   if (CoreEnv[1]*thresholds[0] > 0xffff) ThrEnvOverflowL = true;
   if (CoreEnv[1]*thresholds[1] > 0xffff) ThrEnvOverflowM = true;
@@ -356,13 +365,13 @@ void eFEXFPGA::SetIsoWP(std::vector<unsigned int> & CoreEnv, std::vector<unsigne
 
   if (CoreOverflow == false) {
     if (EnvOverflow == false) {
-      if ( (CoreEnv[0] > (thresholds[0]*CoreEnv[1])) && ThrEnvOverflowL == false ) {
+      if ( (CoreEnv[0]*bsmap[bitshift] > (thresholds[0]*CoreEnv[1])) && ThrEnvOverflowL == false ) {
 	workingPoint = 1;
       } 
-      else if ( (CoreEnv[0] > (thresholds[1]*CoreEnv[1])) && ThrEnvOverflowM == false ) {
+      else if ( (CoreEnv[0]*bsmap[bitshift] > (thresholds[1]*CoreEnv[1])) && ThrEnvOverflowM == false ) {
 	workingPoint = 2;
       } 
-      else if ( (CoreEnv[0] > (thresholds[2]*CoreEnv[1])) && ThrEnvOverflowT == false ) {
+      else if ( (CoreEnv[0]*bsmap[bitshift] > (thresholds[2]*CoreEnv[1])) && ThrEnvOverflowT == false ) {
 	workingPoint = 3;
       }
       else { 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXegAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXegAlgo.cxx
index ca3280d2656d..06c2a51a6bd9 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXegAlgo.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXegAlgo.cxx
@@ -202,8 +202,8 @@ void LVL1::eFEXegAlgo::getWstot(std::vector<unsigned int> & output){
     }
   }
 
-  output.push_back(numer);
   output.push_back(den);
+  output.push_back(numer);
 
 }
 
@@ -239,8 +239,8 @@ std::unique_ptr<eFEXegTOB> LVL1::eFEXegAlgo::geteFEXegTOB() {
   std::vector<unsigned int> temvector;
   getWstot(temvector);
 
-  out->setWstotNum(temvector[0]);
-  out->setWstotDen(temvector[1]);
+  out->setWstotNum(temvector[1]);
+  out->setWstotDen(temvector[0]);
   getRhad(temvector);
   out->setRhadNum(temvector[1]);
   out->setRhadDen(temvector[0] + temvector[1]);
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IeFEXFPGA.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IeFEXFPGA.h
index e22a29464c46..cca69deb7e57 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IeFEXFPGA.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IeFEXFPGA.h
@@ -39,7 +39,7 @@ Interface definition for eFEXFPGA
 
     virtual void SetTowersAndCells_SG(int [][6]) = 0;
     
-    virtual void SetIsoWP(std::vector<unsigned int> &, std::vector<unsigned int> &, unsigned int &) = 0;
+    virtual void SetIsoWP(std::vector<unsigned int> &, std::vector<unsigned int> &, unsigned int &, unsigned int &) = 0;
 
     virtual std::vector<uint32_t> getEmTOBs() = 0; 
 
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 59d441b65546..9cdccab16e73 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -3335,7 +3335,17 @@ HLT_e300_etcut_L1EM22VHI:
     2: 1
     3: 1
 HLT_e300_etcut_L1eEM22M:
-  eventCount: 0
+  eventCount: 1
+  stepCounts:
+    0: 1
+    1: 1
+    2: 1
+    3: 1
+  stepFeatures:
+    0: 1
+    1: 13
+    2: 1
+    3: 1
 HLT_e30_lhvloose_L1EM22VHI:
   eventCount: 5
   stepCounts:
@@ -9684,27 +9694,27 @@ HLT_noalg_L1cTAU20M:
 HLT_noalg_L1cTAU25M:
   eventCount: 0
 HLT_noalg_L1eEM10L:
-  eventCount: 0
+  eventCount: 7
 HLT_noalg_L1eEM15:
   eventCount: 16
 HLT_noalg_L1eEM15L:
-  eventCount: 0
+  eventCount: 6
 HLT_noalg_L1eEM15M:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eEM20:
   eventCount: 14
 HLT_noalg_L1eEM20L:
-  eventCount: 0
+  eventCount: 6
 HLT_noalg_L1eEM20M:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eEM22:
   eventCount: 14
 HLT_noalg_L1eEM22L:
-  eventCount: 0
+  eventCount: 5
 HLT_noalg_L1eEM22M:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eEM22T:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eEM3:
   eventCount: 20
 HLT_noalg_L1eEM5:
@@ -9712,9 +9722,9 @@ HLT_noalg_L1eEM5:
 HLT_noalg_L1eEM8:
   eventCount: 18
 HLT_noalg_L1eEM8L:
-  eventCount: 0
+  eventCount: 7
 HLT_noalg_L1eEM8M:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eTAU100:
   eventCount: 0
 HLT_noalg_L1eTAU12:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 08f501b6807f..679805d1ced4 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -3862,23 +3862,23 @@ HLT_noalg_L1cTAU20M:
 HLT_noalg_L1cTAU25M:
   eventCount: 0
 HLT_noalg_L1eEM10L:
-  eventCount: 0
+  eventCount: 2
 HLT_noalg_L1eEM15:
   eventCount: 11
 HLT_noalg_L1eEM15L:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eEM15M:
   eventCount: 0
 HLT_noalg_L1eEM20:
   eventCount: 7
 HLT_noalg_L1eEM20L:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eEM20M:
   eventCount: 0
 HLT_noalg_L1eEM22:
   eventCount: 7
 HLT_noalg_L1eEM22L:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eEM22M:
   eventCount: 0
 HLT_noalg_L1eEM22T:
@@ -3890,7 +3890,7 @@ HLT_noalg_L1eEM5:
 HLT_noalg_L1eEM8:
   eventCount: 23
 HLT_noalg_L1eEM8L:
-  eventCount: 0
+  eventCount: 3
 HLT_noalg_L1eEM8M:
   eventCount: 0
 HLT_noalg_L1eTAU100:
-- 
GitLab


From b6128d50e75ccbb3fd1c7b21a8ee7c3c05faef8e Mon Sep 17 00:00:00 2001
From: Noemi Calace <noemi.calace@cern.ch>
Date: Tue, 21 Sep 2021 14:11:13 +0200
Subject: [PATCH 227/347] Updating ITk flags to handle tracking geometry
 information

---
 .../InDetConfig/python/ITkConfigFlags.py      |  21 ++++
 .../src/StagedTrackingGeometryBuilder.cxx     | 107 +++++++++++-------
 .../python/AtlasTrackingGeometrySvcConfig.py  |  87 ++++++++------
 3 files changed, 136 insertions(+), 79 deletions(-)

diff --git a/InnerDetector/InDetConfig/python/ITkConfigFlags.py b/InnerDetector/InDetConfig/python/ITkConfigFlags.py
index af8482c2c198..be54f3ce9a53 100644
--- a/InnerDetector/InDetConfig/python/ITkConfigFlags.py
+++ b/InnerDetector/InDetConfig/python/ITkConfigFlags.py
@@ -65,6 +65,27 @@ def createITkConfigFlags():
   itkcf.addFlag("ITk.doMinBias", False) # Switch for running MinBias settings 
   itkcf.addFlag("ITk.doRobustReco", False) # Switch for running Robust settings
   itkcf.addFlag("ITk.useNewSiSPSeededTF", False ) # Switch for using new SiSPSeededTrackFinder strategy
+  
+  # config flags for tracking geometry configuration
+  itkcf.addFlag("ITk.trackingGeometry.beampipeMatZbins", 35) # Number of Z bins to be used for beampipe material layer
+  itkcf.addFlag("ITk.trackingGeometry.pixelBarrelMatZbins", 100) # Number of z bins to be used for pixel barrel material layer
+  itkcf.addFlag("ITk.trackingGeometry.pixelBarrelMatPhiBins", 50) # Number of phi bins to be used for pixel barrel material layer
+  itkcf.addFlag("ITk.trackingGeometry.pixelEndcapMatRbins", 50) # Number of r bins to be used for pixel endcap material layer
+  itkcf.addFlag("ITk.trackingGeometry.pixelEndcapMatPhiBins", 50) # Number of phi bins to be used for pixel endcap material layer
+  itkcf.addFlag("ITk.trackingGeometry.stripBarrelMatZbins", 100) # Number of z bins to be used for strip barrel material layer
+  itkcf.addFlag("ITk.trackingGeometry.stripBarrelMatPhiBins", 50) # Number of phi bins to be used for strip barrel material layer
+  itkcf.addFlag("ITk.trackingGeometry.stripEndcapMatRbins", 50) # Number of r bins to be used for strip endcap material layer
+  itkcf.addFlag("ITk.trackingGeometry.stripEndcapMatPhiBins", 50) # Number of phi bins to be used for strip endcap material layer
+  itkcf.addFlag("ITk.trackingGeometry.passiveBarrelMatZbins", 100) # Number of z bins to be used for passive material layers
+  itkcf.addFlag("ITk.trackingGeometry.passiveBarrelMatPhiBins", 50) # Number of phi bins to be used for passive material layers
+  itkcf.addFlag("ITk.trackingGeometry.passiveEndcapMatRbins", 50) # Number of r bins to be used for passive material layers
+  itkcf.addFlag("ITk.trackingGeometry.passiveEndcapMatPhiBins", 50) # Number of phi bins to be used for passive material layers
+  itkcf.addFlag("ITk.trackingGeometry.minimalRadialGapForVolumeSplit", 10.) # Radial gap to enable disc splitting
+  itkcf.addFlag("ITk.trackingGeometry.loadLocalDbForMaterialMaps", False) # Enable reading of local database
+  itkcf.addFlag("ITk.trackingGeometry.localDatabaseName", "AtlasLayerMaterial.db") # EDatabase geometry name
+  itkcf.addFlag("ITk.trackingGeometry.materialTag", "AtlasLayerMat_v") # Material tag
+  itkcf.addFlag("ITk.trackingGeometry.version", "22") # material version
+  
 
   from InDetConfig.TrackingCutsFlags import createITkTrackingFlags, createITkLargeD0TrackingFlags, createITkConversionFindingTrackingFlags, createITkFastTrackingFlags, createITkLargeD0FastTrackingFlags
 
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
index 6a2f4bead130..bc2ed51c7b30 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilder.cxx
@@ -623,11 +623,14 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::createTrackingV
       ATH_MSG_INFO("      -> adjusting the outer radius to the last ring at " << outerRadius );
       ATH_MSG_INFO("      -> created " << ringVolumes.size() << " ring volumes for Volume '" << volumeName << "'.");
       // create the tiple container
-      return m_trackingVolumeCreator->createContainerTrackingVolume(ringVolumes,
-                                                                    *m_materialProperties,
-                                                                    volumeName,
-                                                                    m_buildBoundaryLayers,
-                                                                    m_replaceJointBoundaries);
+      if (ringVolumes.size()==1)
+        return ringVolumes.at(0);
+      else 
+        return m_trackingVolumeCreator->createContainerTrackingVolume(ringVolumes,
+                                                                      *m_materialProperties,
+                                                                      volumeName,
+                                                                      m_buildBoundaryLayers,
+                                                                      m_replaceJointBoundaries);
     } else 
         return m_trackingVolumeCreator->createTrackingVolume(layers,
                                                              *m_materialProperties,
@@ -780,49 +783,62 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilder::packVolumeTripl
 
 std::vector<const Trk::Layer*> InDet::StagedTrackingGeometryBuilder::checkZoverlap(std::vector<const Trk::Layer*>& lays) const 
 {
-    // check disc layer overlaps in z, merge if appropriate
-    std::vector<const Trk::Layer*> mergedDiscLayers;
-    std::vector<const Trk::Layer*> toMerge;
-    double zlast = 0.; bool overlaps = false;
-    for (auto lay : lays) {
-        float zpos= lay->surfaceRepresentation().center().z();
-        float thick = 0.5*lay->thickness();
-        if (lay==lays.front()) toMerge.push_back(lay);
-        else { 
-          if ( zpos - thick<zlast) {
-            toMerge.push_back(lay);
-            overlaps = true;   
-          } else {
-            if ( toMerge.size()==1 ) mergedDiscLayers.push_back(toMerge[0]);
-            else if (toMerge.size()>1) {
-              const Trk::Layer* nd = mergeDiscLayers(toMerge);
-              if (nd) mergedDiscLayers.push_back(nd); 
-              else {
-                ATH_MSG_DEBUG("radial merge of rings failed, return the input layer set");
-                return lays;
-              }
-            }
-            toMerge.clear(); toMerge.push_back(lay);
-          }
-        }
-        zlast = zpos+thick;
+  // look for layers to merge if they overlap in z
+  
+  // caching the layers with locations in z
+  std::map < float , std::vector<const Trk::Layer*> > locationAndLayers;
+  
+  // loop on the layers and save the location:
+  // if one layer location is compatible with 
+  // another one (considering the layer thickness)
+  // then the two layers have to be merged
+  for (auto lay : lays) {
+    float zpos= lay->surfaceRepresentation().center().z();
+    float thick = 0.5*lay->thickness(); 
+    
+    bool foundZoverlap = false;
+    for (auto& singlePosLayer : locationAndLayers) {
+      if (abs(zpos - singlePosLayer.first) < thick) {
+        singlePosLayer.second.push_back(lay);
+        foundZoverlap = true;
+        break;
+      }
     }
-    if (toMerge.size()==1) mergedDiscLayers.push_back(toMerge[0]);
-    else if (toMerge.size()>1) {
-      const Trk::Layer* nd = mergeDiscLayers(toMerge);
+    
+    // if no overlap is found, a new location (with corresponding layer)
+    // has to be added to the map
+    if (not foundZoverlap) {
+      locationAndLayers[zpos] = std::vector<const Trk::Layer*>();
+      locationAndLayers[zpos].push_back(lay);
+    }       
+  }
+  
+  // If the number of final layers decreases, 
+  // merging is detected and discs need to be merged.
+  // The new merged layers are returned instead of the initial ones.
+  if (lays.size()>locationAndLayers.size()) {
+    std::vector<const Trk::Layer*> mergedDiscLayers;
+    for (auto& singlePosLayer : locationAndLayers) {      
+      const Trk::Layer* nd = mergeDiscLayers(singlePosLayer.second);
       if (nd) mergedDiscLayers.push_back(nd); 
       else {
-        ATH_MSG_DEBUG("radial merge of rings failed, return the input layer set");
+        ATH_MSG_WARNING("radial merge of rings failed, return the input layer set");
         return lays;
       }
     }
-
-    if (overlaps) return mergedDiscLayers;
-
-    return lays;
+    return mergedDiscLayers;
+  } 
+  
+  return lays;
+  
 }
 
 const Trk::Layer* InDet::StagedTrackingGeometryBuilder::mergeDiscLayers (std::vector<const Trk::Layer*>& inputDiscs) const {
+
+  // if a single layer is input, no need for merging.
+  // Returning the layer
+  if (inputDiscs.size()==1)
+    return inputDiscs.at(0);
  
   // on the input, disc layers overlapping in thickness : merge to a new DiscLayer
   std::pair<float,float> zb(1.e5,-1.e5);
@@ -868,6 +884,7 @@ const Trk::Layer* InDet::StagedTrackingGeometryBuilder::mergeDiscLayers (std::ve
       if (id+1<discOrder.size()) rsteps.push_back( 0.5*(rbounds[id].second+rbounds[id+1].first));
       const std::vector<const Trk::Surface*> ringSurf =surfArray->arrayObjects();
       surfs.insert(surfs.end(),ringSurf.begin(),ringSurf.end());
+            
     }  
   }
   rsteps.push_back(rbounds.back().second);
@@ -880,12 +897,15 @@ const Trk::Layer* InDet::StagedTrackingGeometryBuilder::mergeDiscLayers (std::ve
   }
 
   // create merged binned array
+  // a two-dimensional BinnedArray is needed ; takes possession of binUtils and
+  // will delete it on destruction.
   Trk::BinnedArray<Trk::Surface>* mergeBA = new Trk::BinnedArray1D1D<Trk::Surface>(surfaces,new Trk::BinUtility(rsteps,Trk::open,Trk::binR),binUtils);
 
-  // prepare the overlap descriptor       
-  std::vector<Trk::BinUtility*> clonedBinUtils = std::vector<Trk::BinUtility*>();
-  for (auto bu : *binUtils) clonedBinUtils.push_back(bu->clone());
-  Trk::OverlapDescriptor* olDescriptor = new InDet::DiscOverlapDescriptor(mergeBA,&clonedBinUtils,true);
+  //DiscOverlapDescriptor takes possession of clonedBinUtils, will delete it on destruction.
+  // but *does not* manage mergeBA.      
+  std::vector<Trk::BinUtility*>* clonedBinUtils = new std::vector<Trk::BinUtility*>();
+  for (auto bu : *binUtils) clonedBinUtils->push_back(bu->clone());
+  Trk::OverlapDescriptor* olDescriptor = new InDet::DiscOverlapDescriptor(mergeBA,clonedBinUtils,true);
     
   // position & bounds of the disc layer
   double disc_thickness = std::fabs(zb.second-zb.first);
@@ -898,6 +918,7 @@ const Trk::Layer* InDet::StagedTrackingGeometryBuilder::mergeDiscLayers (std::ve
   const Trk::LayerMaterialProperties* disc_material = inputDiscs[0]->layerMaterialProperties()->clone();
 
   // create disc layer
+  // layer creation; deletes mergeBA in baseclass 'Layer' upon destruction
   const Trk::DiscLayer* layer = new Trk::DiscLayer(transf,
                                                    new Trk::DiscBounds(rsteps.front(),rsteps.back()),
                                                    mergeBA,
diff --git a/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py b/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py
index 95a939792c79..39d77143c6cf 100644
--- a/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py
+++ b/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py
@@ -6,7 +6,6 @@ Trk__TrackingGeometrySvc=CompFactory.Trk.TrackingGeometrySvc
 Trk__GeometryBuilder=CompFactory.Trk.GeometryBuilder
 from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
 from SubDetectorEnvelopes.SubDetectorEnvelopesConfigNew import EnvelopeDefSvcCfg 
-from AthenaCommon.Constants import VERBOSE
 
 from GaudiKernel.GaudiHandles import PrivateToolHandleArray
 
@@ -18,18 +17,29 @@ def _setupCondDB(flags, CoolDataBaseFolder, quiet=True):
     
     # the tag names
     materialTagBase = 'AtlasLayerMat_v'
-    version = 21
+    version = 21 
     sub_version = ''
     
     AtlasMaterialTag = materialTagBase+str(version)+sub_version+'_'
+    if flags.Detector.GeometryITk:
+      AtlasMaterialTag = flags.ITk.trackingGeometry.materialTag+str(flags.ITk.trackingGeometry.version)+'_'
     cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>'
-
+    
+    
+    if flags.Detector.GeometryITk and flags.ITk.trackingGeometry.loadLocalDbForMaterialMaps:
+        DataBaseName=flags.ITk.trackingGeometry.localDatabaseName
+        
+        from IOVDbSvc.IOVDbSvcConfig import addFolders
+        result.merge(addFolders(flags,"/GLOBAL/TrackingGeo/LayerMaterialITK",detDb=DataBaseName, tag=AtlasMaterialTag))
+        cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'</tag>'
+    
     # if not quiet:
     #   print('[ TrackingGeometrySvc ]     base material tag : ' + AtlasMaterialTag)
     #   print('[ TrackingGeometrySvc ]     translated to COOL: ' + cfolder)
 
     # load the right folders
     result.merge( addFoldersSplitOnline(flags,'GLOBAL',[cfolder],[cfolder],splitMC=True) )
+    
     return result
     
 def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, namePrefix='', setLayerAssociation = True, buildTrtStrawLayers = False):
@@ -189,14 +199,14 @@ def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, na
   # beampipe        
   InDet__BeamPipeBuilder=CompFactory.InDet.BeamPipeBuilder
   beamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix+'BeamPipeBuilder')
-  beamPipeBuilder.OutputLevel=VERBOSE
+  beamPipeBuilder.BeamPipeMaterialBinsZ              = flags.ITk.trackingGeometry.beampipeMatZbins
+
   result.addPublicTool(beamPipeBuilder)
   BeamPipeBinning = 2  
   
   Trk__LayerProvider=CompFactory.Trk.LayerProvider
   beamPipeProvider = Trk__LayerProvider(name=namePrefix+'BeamPipeProvider')
   beamPipeProvider.LayerBuilder = beamPipeBuilder
-  beamPipeProvider.OutputLevel=VERBOSE
   result.addPublicTool(beamPipeProvider)  
   
   layerProviders = [beamPipeProvider]
@@ -213,13 +223,12 @@ def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, na
     PixelLayerBuilderInner.SiDetManagerLocation = 'ITkPixel'
     PixelLayerBuilderInner.LayerIndicesBarrel   = [0,1]
     PixelLayerBuilderInner.LayerIndicesEndcap   = [0,1,2]
-    PixelLayerBuilderInner.UseRingLayout=True
+    PixelLayerBuilderInner.UseRingLayout        = True
     # Pixel barrel specifications
-    PixelLayerBuilderInner.BarrelLayerBinsZ     = 1 #TODO Update with meaningful bins
-    PixelLayerBuilderInner.BarrelLayerBinsPhi   = 1 #TODO Update with meaningful bins
-    PixelLayerBuilderInner.EndcapLayerBinsR     = 1 #TODO Update with meaningful bins
-    PixelLayerBuilderInner.EndcapLayerBinsPhi   = 1 #TODO Update with meaningful bins
-    #PixelLayerBuilderInner.OutputLevel=VERBOSE
+    PixelLayerBuilderInner.BarrelLayerBinsZ     = flags.ITk.trackingGeometry.pixelBarrelMatZbins
+    PixelLayerBuilderInner.BarrelLayerBinsPhi   = flags.ITk.trackingGeometry.pixelBarrelMatPhiBins
+    PixelLayerBuilderInner.EndcapLayerBinsR     = flags.ITk.trackingGeometry.pixelEndcapMatRbins
+    PixelLayerBuilderInner.EndcapLayerBinsPhi   = flags.ITk.trackingGeometry.pixelEndcapMatPhiBins
     
     # set the layer association
     PixelLayerBuilderInner.SetLayerAssociation  = setLayerAssociation
@@ -231,7 +240,6 @@ def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, na
     
     pixelProviderInner = Trk__LayerProvider(name=namePrefix+'PixelProviderInner')
     pixelProviderInner.LayerBuilder = PixelLayerBuilderInner
-    #pixelProviderInner.OutputLevel=VERBOSE
     result.addPublicTool(pixelProviderInner)
     # put them to the caches
     layerProviders  += [pixelProviderInner]
@@ -246,12 +254,10 @@ def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, na
     PixelLayerBuilderOuter.LayerIndicesBarrel   = [2,3,4]
     PixelLayerBuilderOuter.LayerIndicesEndcap   = [3,4,5,6,7,8]
     PixelLayerBuilderOuter.UseRingLayout=True
-    # Pixel barrel specifications
-    PixelLayerBuilderOuter.BarrelLayerBinsZ     = 1 #TODO Update with meaningful bins
-    PixelLayerBuilderOuter.BarrelLayerBinsPhi   = 1 #TODO Update with meaningful bins
-    PixelLayerBuilderOuter.EndcapLayerBinsR     = 1 #TODO Update with meaningful bins
-    PixelLayerBuilderOuter.EndcapLayerBinsPhi   = 1 #TODO Update with meaningful bins
-    PixelLayerBuilderOuter.OutputLevel=VERBOSE
+    PixelLayerBuilderOuter.BarrelLayerBinsZ     = flags.ITk.trackingGeometry.pixelBarrelMatZbins
+    PixelLayerBuilderOuter.BarrelLayerBinsPhi   = flags.ITk.trackingGeometry.pixelBarrelMatPhiBins
+    PixelLayerBuilderOuter.EndcapLayerBinsR     = flags.ITk.trackingGeometry.pixelEndcapMatRbins
+    PixelLayerBuilderOuter.EndcapLayerBinsPhi   = flags.ITk.trackingGeometry.pixelEndcapMatPhiBins
     
     # set the layer association
     PixelLayerBuilderOuter.SetLayerAssociation  = setLayerAssociation
@@ -263,7 +269,6 @@ def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, na
     
     pixelProviderOuter = Trk__LayerProvider(name=namePrefix+'PixelProviderOuter')
     pixelProviderOuter.LayerBuilder = PixelLayerBuilderOuter
-    pixelProviderOuter.OutputLevel=VERBOSE
     result.addPublicTool(pixelProviderOuter)
     # put them to the caches
     layerProviders  += [pixelProviderOuter]
@@ -279,12 +284,10 @@ def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, na
     SCT_LayerBuilder.Identification                  = 'ITkStrip'
     SCT_LayerBuilder.SiDetManagerLocation            = 'ITkStrip'
     SCT_LayerBuilder.AddMoreSurfaces                 = True
-    # additionall layers - handle with care !
-    SCT_LayerBuilder.BarrelLayerBinsZ                = 1 #TODO Update with meaningful bins
-    SCT_LayerBuilder.BarrelLayerBinsPhi              = 1 #TODO Update with meaningful bins
-    # SCT endcap specifications                          
-    SCT_LayerBuilder.EndcapLayerBinsR                = 1 #TODO Update with meaningful bins
-    SCT_LayerBuilder.EndcapLayerBinsPhi              = 1 #TODO Update with meaningful bins
+    SCT_LayerBuilder.BarrelLayerBinsZ                = flags.ITk.trackingGeometry.stripBarrelMatZbins
+    SCT_LayerBuilder.BarrelLayerBinsPhi              = flags.ITk.trackingGeometry.stripBarrelMatPhiBins
+    SCT_LayerBuilder.EndcapLayerBinsR                = flags.ITk.trackingGeometry.stripEndcapMatRbins
+    SCT_LayerBuilder.EndcapLayerBinsPhi              = flags.ITk.trackingGeometry.stripEndcapMatPhiBins
     # set the layer association                   
     SCT_LayerBuilder.SetLayerAssociation             = setLayerAssociation        
     # the binning type of the layer     
@@ -318,6 +321,11 @@ def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, na
   # helpers for the InDetTrackingGeometry Builder : tracking volume helper for gluing
   Trk__TrackingVolumeHelper=CompFactory.Trk.TrackingVolumeHelper
   InDetTrackingVolumeHelper                             = Trk__TrackingVolumeHelper(name ='InDetTrackingVolumeHelper')
+  InDetTrackingVolumeHelper.BarrelLayerBinsZ   = flags.ITk.trackingGeometry.passiveBarrelMatZbins
+  InDetTrackingVolumeHelper.BarrelLayerBinsPhi = flags.ITk.trackingGeometry.passiveBarrelMatPhiBins
+  InDetTrackingVolumeHelper.EndcapLayerBinsR   = flags.ITk.trackingGeometry.passiveEndcapMatRbins
+  InDetTrackingVolumeHelper.EndcapLayerBinsPhi = flags.ITk.trackingGeometry.passiveEndcapMatPhiBins
+  
   # the material bins - assume defaults
   # add to ToolSvc
   result.addPublicTool(InDetTrackingVolumeHelper)  
@@ -329,6 +337,9 @@ def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, na
   InDetCylinderVolumeCreator.LayerArrayCreator = InDetLayerArrayCreator
   InDetCylinderVolumeCreator.TrackingVolumeArrayCreator = InDetTrackingVolumeArrayCreator
   InDetCylinderVolumeCreator.TrackingVolumeHelper       = InDetTrackingVolumeHelper
+  InDetCylinderVolumeCreator.PassiveLayerThickness      = 1. ## mm
+  InDetCylinderVolumeCreator.PassiveLayerBinsRZ   = flags.ITk.trackingGeometry.passiveBarrelMatZbins
+  InDetCylinderVolumeCreator.PassiveLayerBinsPhi  = flags.ITk.trackingGeometry.passiveBarrelMatPhiBins
         
   # specifiy the binning, passive layers, entry layers - assume defaults
   # add to ToolSvc
@@ -345,11 +356,10 @@ def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, na
                                               TrackingVolumeCreator     = InDetCylinderVolumeCreator,
                                               LayerArrayCreator         = InDetLayerArrayCreator,
                                               CheckForRingLayout        = True,
-                                              MinimalRadialGapForVolumeSplit = 2.,
+                                              MinimalRadialGapForVolumeSplit = flags.ITk.trackingGeometry.minimalRadialGapForVolumeSplit,
                                               ReplaceAllJointBoundaries = True,
                                               BuildBoundaryLayers=True,
-                                              ExitVolumeName='InDet::Containers::InnerDetector',
-                                              OutputLevel=VERBOSE)
+                                              ExitVolumeName='InDet::Containers::InnerDetector')
   
 # Replaces https://gitlab.cern.ch/atlas/athena/blob/master/Calorimeter/CaloTrackingGeometry/python/ConfiguredCaloTrackingGeometryBuilder.py
 def _getCaloTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, trackingVolumeHelper, namePrefix=''):
@@ -448,14 +458,19 @@ def TrackingGeometrySvcCfg( flags , name = 'AtlasTrackingGeometrySvc', doMateria
     atlas_geometry_processors=[]
     
     if flags.TrackingGeometry.MaterialSource == 'COOL':
-       CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialV2' # Was from TrkDetFlags.MaterialStoreGateKey()
-       # the material provider
-       Trk__LayerMaterialProvider=CompFactory.Trk.LayerMaterialProvider
-       atlasMaterialProvider = Trk__LayerMaterialProvider('AtlasMaterialProvider', LayerMaterialMapName=CoolDataBaseFolder, LayerMaterialMapKey='')
-       atlas_geometry_processors += [ atlasMaterialProvider ]
-
-       # Setup DBs
-       result.merge(_setupCondDB(flags, CoolDataBaseFolder))
+      
+      CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialV2'
+      if flags.Detector.GeometryITk:
+        CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialITK'
+      
+      # the material provider
+      Trk__LayerMaterialProvider=CompFactory.Trk.LayerMaterialProvider
+      atlasMaterialProvider = Trk__LayerMaterialProvider('AtlasMaterialProvider', LayerMaterialMapName=CoolDataBaseFolder, LayerMaterialMapKey='')
+      atlas_geometry_processors += [ atlasMaterialProvider ]
+        
+      # Setup DBs
+      result.merge(_setupCondDB(flags, CoolDataBaseFolder))
+       
     elif  flags.TrackingGeometry.MaterialSource == 'Input':
       Trk__InputLayerMaterialProvider=CompFactory.Trk.InputLayerMaterialProvider
       atlasMaterialProvider = Trk__InputLayerMaterialProvider('AtlasMaterialProvider')
-- 
GitLab


From 0bb974ad6428b93074ecdff845799895b0714994 Mon Sep 17 00:00:00 2001
From: Vladimir Lyubushkin <vladimir.lyubushkin@cern.ch>
Date: Tue, 21 Sep 2021 14:13:50 +0200
Subject: [PATCH 228/347] B-physics trigger: fix Tag-and-Probe chains from
 BphysPEB stream (ATR-23615)

---
 .../python/TrigMultiTrkComboHypoConfig.py     | 44 ++++++++----
 .../src/TrigMultiTrkComboHypo.cxx             | 72 ++++++++++++++++++-
 .../TrigBphysHypo/src/TrigMultiTrkComboHypo.h |  8 +++
 .../src/TrigMultiTrkComboHypoTool.cxx         |  8 +--
 .../src/TrigMultiTrkComboHypoTool.h           |  1 +
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    |  8 +++
 .../share/ref_v1Dev_decodeBS_build.ref        |  8 +++
 .../TrigEDMConfig/python/TriggerEDMRun3.py    |  3 +
 .../Bphysics/BphysicsChainConfiguration.py    | 29 ++++----
 .../python/HLTMenuConfig/Menu/LS2_v1.py       | 10 +--
 .../HLTMenuConfig/Menu/SignatureDicts.py      |  2 +-
 11 files changed, 158 insertions(+), 35 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py
index 23cf2612c8b1..2d9e01ea32a3 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py
@@ -7,18 +7,18 @@ from AthenaCommon.Logging import logging
 log = logging.getLogger('TrigMultiTrkComboHypoConfig')
 
 trigMultiTrkComboHypoToolDict = {
-    'bJpsimumu'     : { 'massRange' : (2500.,  4300.), 'chi2' : 20. },
-    'bJpsi'         : { 'massRange' : (2500.,  4300.), 'chi2' : 20. },
-    'bJpsimumul2io' : { 'massRange' : (2500.,  4300.), 'chi2' : 20. },
-    'bUpsimumu'     : { 'massRange' : (8000., 12000.), 'chi2' : 20. },
-    'bUpsi'         : { 'massRange' : (8000., 12000.), 'chi2' : 20. },
-    'bDimu'         : { 'massRange' : (1500., 14000.), 'chi2' : 20. },
-    'bDimu2700'     : { 'massRange' : ( 100.,  2700.), 'chi2' : 20. },
-    'bDimu6000'     : { 'massRange' : ( 100.,  6000.), 'chi2' : 20. },
-    'bBmumu'        : { 'massRange' : (4000.,  8500.), 'chi2' : 20. },
-    'bPhi'          : { 'massRange' : ( 940.,  1100.), 'chi2' : 10. },
-    'bTau'          : { 'massRange' : (   0.,  2700.), 'chi2' : 50. },
-    'bBeeM6000'     : { 'massRange' : ( 100.,  6000.), 'chi2' : 20. },
+    'bJpsimumu'  : { 'massRange' : (2500.,  4300.), 'chi2' : 20. },
+    'bJpsi'      : { 'massRange' : (2500.,  4300.), 'chi2' : 20. },
+    'bJpsimutrk' : { 'massRange' : (2600.,  3600.), 'chi2' : 20. },
+    'bUpsimumu'  : { 'massRange' : (8000., 12000.), 'chi2' : 20. },
+    'bUpsi'      : { 'massRange' : (8000., 12000.), 'chi2' : 20. },
+    'bDimu'      : { 'massRange' : (1500., 14000.), 'chi2' : 20. },
+    'bDimu2700'  : { 'massRange' : ( 100.,  2700.), 'chi2' : 20. },
+    'bDimu6000'  : { 'massRange' : ( 100.,  6000.), 'chi2' : 20. },
+    'bBmumu'     : { 'massRange' : (4000.,  8500.), 'chi2' : 20. },
+    'bPhi'       : { 'massRange' : ( 940.,  1100.), 'chi2' : 10. },
+    'bTau'       : { 'massRange' : (   0.,  2700.), 'chi2' : 50. },
+    'bBeeM6000'  : { 'massRange' : ( 100.,  6000.), 'chi2' : 20. },
 }
 
 
@@ -114,6 +114,22 @@ def NoMuonDiElecPrecisionComboHypoCfg(name):
         outputTrigBphysCollection = 'HLT_NoMuonDiElecPrecision')
     return hypo
 
+def BmutrkComboHypoCfg(name):
+    log.debug('BmutrkComboHypoCfg.name = %s ', name)
+
+    config = TrigMultiTrkComboHypoConfig()
+    hypo = config.ConfigurationComboHypo(
+        isStreamer = False,
+        trigSequenceName = 'Bmutrk',
+        trigLevel = 'EF',
+        trackCollection='HLT_IDTrack_Bmumux_IDTrig',
+        outputTrigBphysCollection = 'HLT_Bmutrk')
+    hypo.isMuTrkMode = True
+    hypo.chi2 = 20.
+    hypo.massRange = [ (2500., 4400.) ]
+    hypo.trackPtThresholds = [ [ 10000., 3000. ] ]
+    return hypo
+
 def TrigMultiTrkComboHypoToolFromDict(chainDict):
     config = TrigMultiTrkComboHypoConfig()
     tool = config.ConfigurationComboHypoTool(chainDict)
@@ -204,6 +220,10 @@ class TrigMultiTrkComboHypoConfig(object):
         if 'BPH-0DR3-EM7J15' in chainDict['L1item']:
             tool.isMergedElectronChain = True
 
+        if 'bJpsimutrk' in chainDict['topo']:
+            tool.isMuonTrkPEB = True
+            tool.totalCharge = -100
+
         signatures = chainDict['signatures']
         tool.isCombinedChain = (signatures.count(signatures[0]) != len(signatures))
         tool.legMultiplicities = chainDict['chainMultiplicities']
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
index 424520c51d6c..9293fe9c9e5d 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.cxx
@@ -114,7 +114,7 @@ StatusCode TrigMultiTrkComboHypo::initialize() {
 
   ATH_CHECK( !(m_trigLevel == "L2IO" && m_doElectrons) );
 
-  if (m_trigLevel == "L2") {
+  if (m_trigLevel == "L2" || (m_trigLevel == "EF" && m_isMuTrkMode)) {
     ATH_CHECK( m_trackParticleContainerKey.initialize() );
     renounce(m_trackParticleContainerKey);
   }
@@ -238,6 +238,9 @@ StatusCode TrigMultiTrkComboHypo::execute(const EventContext& context) const {
       ATH_CHECK( findMultiLeptonCandidates(*electronState) );
       ATH_CHECK( processMergedElectrons(*electronState) );
     }
+    else if (m_isMuTrkMode) {
+      ATH_CHECK( findMuTrkCandidates(*muonState) );
+    }
     else {
       ATH_CHECK( mergeLeptonsFromDecisions(*muonState) );
       ATH_CHECK( findMultiLeptonCandidates(*muonState) );
@@ -691,6 +694,73 @@ StatusCode TrigMultiTrkComboHypo::processMergedElectrons(TrigMultiTrkState<xAOD:
 }
 
 
+StatusCode TrigMultiTrkComboHypo::findMuTrkCandidates(TrigMultiTrkState<xAOD::MuonContainer>& state) const {
+
+  ATH_MSG_DEBUG( "Try to find muon + track combinations from the same SG::View" );
+
+  auto& muons = state.leptons();
+  muons.clear();
+
+  const std::vector<double> particleMasses(2, PDG::mMuon);
+
+  for (const Decision* decision : state.previousDecisions()) {
+    if (!TrigCompositeUtils::isAnyIDPassing(decision, m_allowedIDs)) continue;
+
+    auto decisionEL = TrigCompositeUtils::decisionToElementLink(decision, state.context());
+    ATH_CHECK( decision->hasObjectLink(TrigCompositeUtils::featureString(), ClassID_traits<xAOD::MuonContainer>::ID()) );
+    auto muonEL = decision->objectLink<xAOD::MuonContainer>(TrigCompositeUtils::featureString());
+    const auto muon = *muonEL;
+    if (!muon->trackParticle(xAOD::Muon::TrackParticleType::CombinedTrackParticle)) continue;
+    if (!muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle)) continue;
+    const auto muonInDetTrack = muon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle);
+    auto muonMomentum = muonInDetTrack->genvecP4();
+    muonMomentum.SetM(PDG::mMuon);
+
+    // add muon from decision to state.leptons
+    DecisionIDContainer decisionIDs;
+    TrigCompositeUtils::decisionIDs(decision, decisionIDs);
+    muons.push_back({muonEL, ElementLinkVector<DecisionContainer>(1, decisionEL), decisionIDs});
+
+    ATH_MSG_DEBUG( "Found muon (CombinedTrackParticle): " << muon->pt() << " / " << muon->eta() << " / " << muon->phi() << " / " << muon->charge() );
+
+    auto viewLinkInfo = TrigCompositeUtils::findLink<ViewContainer>(decision, TrigCompositeUtils::viewString(), true);
+    ATH_CHECK( viewLinkInfo.isValid() );
+    auto view = *viewLinkInfo.link;
+
+    auto tracksHandle = ViewHelper::makeHandle(view, m_trackParticleContainerKey, state.context());
+    ATH_CHECK( tracksHandle.isValid() );
+    ATH_MSG_DEBUG( "Tracks container " << m_trackParticleContainerKey << " size: " << tracksHandle->size() );
+
+    // try to fit muon and track into common vertex: first track is always muon, second tracks comes from the same SG::View
+    std::vector<ElementLink<xAOD::TrackParticleContainer>> tracklist(2);
+    tracklist[0] = muon->inDetTrackParticleLink();
+    for (size_t idx = 0; idx < tracksHandle->size(); ++idx) {
+      const xAOD::TrackParticle* track = tracksHandle->at(idx);
+
+      if (track->pt() < m_trkPt[0][1] || isIdenticalTracks(track, muonInDetTrack)) continue;
+      auto trackMomentum = track->genvecP4();
+      trackMomentum.SetM(PDG::mMuon);
+      if (!isInMassRange((muonMomentum + trackMomentum).M())) continue;
+
+      tracklist[1] = ViewHelper::makeLink<xAOD::TrackParticleContainer>(view, tracksHandle, idx);
+
+      ATH_MSG_DEBUG( "Dump found muon+track pair before vertex fit: pT / eta / phi / charge" << endmsg <<
+                     "   muon:  " << muonMomentum.Pt() << " / " << muonMomentum.Eta() << " / " << muonMomentum.Phi() << " / " << muon->charge() << endmsg <<
+                     "   track: " << trackMomentum.Pt() << " / " << trackMomentum.Eta() << " / " << trackMomentum.Phi() << " / " << track->charge() );
+
+      auto fitterState = m_vertexFitter->makeState(state.context());
+      auto vertex = fit(tracklist, particleMasses, *fitterState);
+      if (!vertex) continue;
+      xAOD::TrigBphys* trigBphys = makeTrigBPhys(*vertex, particleMasses, state.beamSpotPosition(), *fitterState);
+      // trigBphys->setRoiId(initialRoI->roiWord());
+      state.addTrigBphysObject(trigBphys, std::vector<size_t>(1, muons.size() - 1));
+    }
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+
 StatusCode TrigMultiTrkComboHypo::copyDecisionObjects(TrigMultiTrkStateBase& state) const {
 
   if (state.isEventAccepted()) {
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.h
index 442527191337..8e3f6af88340 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypo.h
@@ -175,6 +175,12 @@ class TrigMultiTrkComboHypo: public ::ComboHypo {
    */
   StatusCode processMergedElectrons(TrigMultiTrkState<xAOD::ElectronContainer>&) const;
 
+  /**
+   * @brief Build J/psi candidates from muon from SG::View and tracks from the same SG::View,
+   * to be used for Tag-and-Probe PEB chains (similar to HLT_mu6_bJpsimutrk_MuonTrkPEB_L1MU5VF)
+   */
+  StatusCode findMuTrkCandidates(TrigMultiTrkState<xAOD::MuonContainer>&) const;
+
   /**
    * @brief All appropriate decisions from state.previousDecisions() will be copied to state.decisions()
    * if flag state.isEventAccepted() is set by filterTrackCombinations() method;
@@ -237,6 +243,8 @@ class TrigMultiTrkComboHypo: public ::ComboHypo {
     "chi2 cut for the fitted vertex"};
   Gaudi::Property<bool> m_isStreamer {this, "isStreamer", false,
     "if true we do not create trigger objects, just copy all appropriate decisions to the next step or break the chain"};
+  Gaudi::Property<bool> m_isMuTrkMode {this, "isMuTrkMode", false,
+    "make pairs between muon from SG::View and tracks from the same SG::View"};
   Gaudi::Property<bool> m_doElectrons {this, "doElectrons", false,
     "use electrons if true, otherwise use muons"};
   Gaudi::Property<std::string> m_trigLevel {this, "trigLevel", "EF",
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.cxx b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.cxx
index adf27b7b2c69..8a85a06cb15f 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.cxx
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.cxx
@@ -55,7 +55,7 @@ StatusCode TrigMultiTrkComboHypoTool::initialize() {
   else {  // chain with symmetric legs, as HLT_2mu4_bDimu_L12MU4
     m_legDecisionIDs.insert(m_legDecisionIDs.end(), m_legMultiplicities[0], decisionId().numeric());
   }
-  ATH_CHECK( m_nTrk <= m_legDecisionIDs.size() || m_isMergedElectronChain );
+  ATH_CHECK( m_nTrk <= m_legDecisionIDs.size() || m_isMergedElectronChain || m_isMuonTrkPEB );
 
   if (!m_monTool.empty()) {
     ATH_CHECK( m_monTool.retrieve() );
@@ -116,7 +116,7 @@ StatusCode TrigMultiTrkComboHypoTool::decideOnSingleObject(Decision* decision, c
   auto trigBphysEL = decision->objectLink<xAOD::TrigBphysContainer>(TrigCompositeUtils::featureString());
   ATH_CHECK( trigBphysEL.isValid() );
 
-  if (previousDecisionIDs.size() != (m_isMergedElectronChain ? 1 : m_nTrk.value())) {
+  if (previousDecisionIDs.size() != (m_isMergedElectronChain || m_isMuonTrkPEB ? 1 : m_nTrk.value())) {
     return StatusCode::SUCCESS;
   }
 
@@ -144,9 +144,9 @@ bool TrigMultiTrkComboHypoTool::checkPreviousDecisionIDs(const std::vector<const
   // trigger with asymmetric legs (like HLT_mu6_2mu4_bDimu_L1MU6_3MU4) is treated in a specific way:
   // all 6 possible combinations should be checked: {leg0, leg1}, {leg0, leg2}, {leg1, leg0}, {leg1, leg2}, {leg2, leg0}, {leg2, leg1}
 
-  if (m_isMergedElectronChain) {
+  if (m_isMergedElectronChain || m_isMuonTrkPEB) {
     if (!TrigCompositeUtils::passed(m_legDecisionIDs.at(0), *previousDecisionIDs[0])) {
-      ATH_MSG_DEBUG( "Trigger for close-by electrons didn't pass previous decision" );
+      ATH_MSG_DEBUG( "Trigger for " << (m_isMergedElectronChain ? "close-by electrons" : "muon+track") << " didn't pass previous decision" );
       return false;
     }
     return true;
diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.h b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.h
index 3d9b9b635de0..8006833d4bd5 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.h
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/src/TrigMultiTrkComboHypoTool.h
@@ -54,6 +54,7 @@ class TrigMultiTrkComboHypoTool: public ComboHypoToolBase {
   Gaudi::Property<float> m_LxyCut {this, "LxyCut", -999., "Applies an Lxy Cut if set > -999"};
   Gaudi::Property<bool> m_isCombinedChain {this, "isCombinedChain", false, "true for chains with different signatures, e.g. HLT_e9_mu6"};
   Gaudi::Property<bool> m_isMergedElectronChain {this, "isMergedElectronChain", false, "true for close-by electrons, e.g. HLT_e5_lhvloose_L1BPH-0DR3-EM7J15"};
+  Gaudi::Property<bool> m_isMuonTrkPEB {this, "isMuonTrkPEB", false, "chains like HLT_mu6_bJpsimutrk_MuonTrkPEB_L1MU5VF"};
   Gaudi::Property<std::vector<unsigned int>> m_legMultiplicities {this, "legMultiplicities", {2}, "taken from dict[chainMultiplicities]"};
   ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "", "Monitoring tool" };
 
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 59d441b65546..18525d420486 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -7469,6 +7469,8 @@ HLT_mu10_L1MU8F:
     1: 9
     2: 10
     3: 9
+HLT_mu10_bJpsimutrk_MuonTrkPEB_L1MU8F:
+  eventCount: 0
 HLT_mu10_ivarmedium_j70_0eta320_j50_0eta490_j0_DJMASS900j50_L1MJJ-500-NFF:
   eventCount: 1
   stepCounts:
@@ -8007,6 +8009,8 @@ HLT_mu20_L1MU5VF_AFP_A_AND_C:
   eventCount: 0
 HLT_mu20_L1MU5VF_AFP_A_OR_C:
   eventCount: 0
+HLT_mu20_bJpsimutrk_MuonTrkPEB_L1MU14FCH:
+  eventCount: 0
 HLT_mu20_ivarloose_tau20_medium1_tracktwo_03dRAB_L1MU14FCH:
   eventCount: 2
   stepCounts:
@@ -9056,6 +9060,8 @@ HLT_mu28_ivarmedium_L1MU14FCH:
     2: 4
     3: 4
     4: 4
+HLT_mu4_bJpsimutrk_MuonTrkPEB_L1MU3V:
+  eventCount: 0
 HLT_mu4_j20_0eta290_pf_ftf_boffperf_dRAB03_L1MU3V:
   eventCount: 7
   stepCounts:
@@ -9223,6 +9229,8 @@ HLT_mu6_LRT_idperf_L1MU5VF:
     1: 14
     2: 16
     3: 16
+HLT_mu6_bJpsimutrk_MuonTrkPEB_L1MU5VF:
+  eventCount: 0
 HLT_mu6_idperf_L1MU5VF:
   eventCount: 11
   stepCounts:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 08f501b6807f..286edd668db8 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -2872,6 +2872,8 @@ HLT_mu10_L1MU8F:
     0: 5
   stepFeatures:
     0: 5
+HLT_mu10_bJpsimutrk_MuonTrkPEB_L1MU8F:
+  eventCount: 0
 HLT_mu10_ivarmedium_j70_0eta320_j50_0eta490_j0_DJMASS900j50_L1MJJ-500-NFF:
   eventCount: 0
 HLT_mu10_ivarmedium_mu10_10invmAB70_L12MU8F:
@@ -3058,6 +3060,8 @@ HLT_mu20_L1MU5VF_AFP_A_AND_C:
   eventCount: 0
 HLT_mu20_L1MU5VF_AFP_A_OR_C:
   eventCount: 0
+HLT_mu20_bJpsimutrk_MuonTrkPEB_L1MU14FCH:
+  eventCount: 0
 HLT_mu20_ivarloose_tau20_medium1_tracktwo_03dRAB_L1MU14FCH:
   eventCount: 0
   stepFeatures:
@@ -3342,6 +3346,8 @@ HLT_mu28_ivarmedium_L1MU14FCH:
     0: 1
   stepFeatures:
     0: 1
+HLT_mu4_bJpsimutrk_MuonTrkPEB_L1MU3V:
+  eventCount: 0
 HLT_mu4_j20_0eta290_pf_ftf_boffperf_dRAB03_L1MU3V:
   eventCount: 2
   stepCounts:
@@ -3446,6 +3452,8 @@ HLT_mu6_LRT_idperf_L1MU5VF:
     1: 6
     2: 2
     3: 2
+HLT_mu6_bJpsimutrk_MuonTrkPEB_L1MU5VF:
+  eventCount: 0
 HLT_mu6_idperf_L1MU5VF:
   eventCount: 2
   stepCounts:
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index cf796e7a24bc..cec1ebad8146 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -401,6 +401,9 @@ TriggerHLTListRun3 = [
     ('xAOD::TrackParticleContainer#HLT_IDTrack_Bmumux_IDTrig',              'BS ESD AODFULL', 'Bphys', 'inViews:BmumuxViews'),
     ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_Bmumux_IDTrigAux.',       'BS ESD AODFULL', 'Bphys'),
     ('TrigRoiDescriptorCollection#HLT_Roi_Bmumux',                          'BS ESD AODFULL', 'Bphys'),
+    # Bphysics Tag-and-Probe J/psi from muon + track
+    ('xAOD::TrigBphysContainer#HLT_Bmutrk',                                 'BS ESD AODFULL AODSLIM AODVERYSLIM AODBLSSLIM', 'Bphys'),
+    ('xAOD::TrigBphysAuxContainer#HLT_BmutrkAux.',                          'BS ESD AODFULL AODSLIM AODVERYSLIM AODBLSSLIM', 'Bphys'),
     # Bphysics Di-electron chains
     ('xAOD::TrigBphysContainer#HLT_DiElecPrecision',                        'BS ESD AODFULL AODSLIM AODVERYSLIM AODBLSSLIM', 'Bphys'),
     ('xAOD::TrigBphysAuxContainer#HLT_DiElecPrecisionAux.',                 'BS ESD AODFULL AODSLIM AODVERYSLIM AODBLSSLIM', 'Bphys'),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bphysics/BphysicsChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bphysics/BphysicsChainConfiguration.py
index e1ee8b47f50f..7e10d8a504d8 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bphysics/BphysicsChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Bphysics/BphysicsChainConfiguration.py
@@ -15,7 +15,7 @@ from ..Muon.MuonChainConfiguration import mul2IOOvlpRmSequenceCfg, muEFCBSequenc
 
 from .BphysicsMenuSequences import dimuL2Sequence, dimuEFSequence, bmumuxSequence
 
-from TrigBphysHypo.TrigMultiTrkComboHypoConfig import StreamerDimuL2ComboHypoCfg, StreamerDimuL2IOComboHypoCfg, DimuEFComboHypoCfg, StreamerDimuEFComboHypoCfg, TrigMultiTrkComboHypoToolFromDict
+from TrigBphysHypo.TrigMultiTrkComboHypoConfig import StreamerDimuL2ComboHypoCfg, StreamerDimuL2IOComboHypoCfg, DimuEFComboHypoCfg, BmutrkComboHypoCfg, StreamerDimuEFComboHypoCfg, TrigMultiTrkComboHypoToolFromDict
 from TrigBphysHypo.TrigBmumuxComboHypoConfig import BmumuxComboHypoCfg, TrigBmumuxComboHypoToolFromDict
 
 #--------------------------------------------------------
@@ -66,6 +66,7 @@ class BphysicsChainConfiguration(MuonChainConfiguration):
         stepDictionary = {
             'dimu'   : [['getmuFast', 'getDimuL2'], ['getmuEFSA', 'getmuEFCB', 'getDimuEF']],
             'bmumux' : [['getmuFast', 'getDimuL2'], ['getmuEFSA', 'getDimuEFCB', 'getBmumux']],
+            'bmutrk' : [['getmuFast', 'getmuCombIO'], ['getmuEFSA', 'getmuEFCB', 'getBmutrk']],
         }
         return stepDictionary
 
@@ -74,17 +75,18 @@ class BphysicsChainConfiguration(MuonChainConfiguration):
         the_topo = self.dict['topo'][0]
 
         topo_dict = {
-            'bJpsimumu' : 'dimu',
-            'bJpsi'     : 'dimu',
-            'bUpsimumu' : 'dimu',
-            'bUpsi'     : 'dimu',
-            'bBmumu'    : 'dimu',
-            'bDimu'     : 'dimu',
-            'bDimu2700' : 'dimu',
-            'bDimu6000' : 'dimu',
-            'bPhi'      : 'dimu',
-            'bTau'      : 'dimu',
-            'bBmumux'   : 'bmumux'
+            'bJpsimumu'  : 'dimu',
+            'bJpsi'      : 'dimu',
+            'bJpsimutrk' : 'bmutrk',
+            'bUpsimumu'  : 'dimu',
+            'bUpsi'      : 'dimu',
+            'bBmumu'     : 'dimu',
+            'bDimu'      : 'dimu',
+            'bDimu2700'  : 'dimu',
+            'bDimu6000'  : 'dimu',
+            'bPhi'       : 'dimu',
+            'bTau'       : 'dimu',
+            'bBmumux'    : 'bmumux'
         }
 
         return topo_dict[the_topo]
@@ -103,3 +105,6 @@ class BphysicsChainConfiguration(MuonChainConfiguration):
 
     def getBmumux(self):
         return self.getStep(5, 'bmumux', [bmumuxSequenceCfg], comboHypoCfg=BmumuxComboHypoCfg, comboTools=[TrigBmumuxComboHypoToolFromDict])
+
+    def getBmutrk(self):
+        return self.getStep(5, 'bmutrk', [bmumuxSequenceCfg], comboHypoCfg=BmutrkComboHypoCfg, comboTools=[TrigMultiTrkComboHypoToolFromDict])
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 6dcce746293d..4ba2aad01284 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -969,11 +969,11 @@ def setupMenu():
         ChainProp(name='HLT_2mu4_bBmumux_BpmumuKp_L1BPH-2M9-0DR15-2MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup+EOFBPhysL1MuGroup),
         ChainProp(name='HLT_2mu4_bBmumux_BsmumuPhi_L1BPH-2M9-0DR15-2MU3V', l1SeedThresholds=['MU3V'], stream=["BphysDelayed"], groups=BphysicsGroup+EOFBPhysL1MuGroup),
 
-        # supplementary PEB triggers, temporarily commented out due to ATR-23615 to make ART back for Bphysics slice
-        #ChainProp(name='HLT_mu4_bJpsi_MuonTrkPEB_L1MU3V', stream =['BphysPEB'], groups=BphysicsGroup+['PS:Online']),
-        #ChainProp(name='HLT_mu6_bJpsi_MuonTrkPEB_L1MU5VF', stream =['BphysPEB'], groups=BphysicsGroup+['PS:Online']),
-        #ChainProp(name='HLT_mu10_bJpsi_MuonTrkPEB_L1MU8F', stream =['BphysPEB'], groups=BphysicsGroup+['PS:Online']),
-        #ChainProp(name='HLT_mu20_bJpsi_MuonTrkPEB_L1MU14FCH', stream =['BphysPEB'], groups=BphysicsGroup+['PS:Online']),
+        # supplementary PEB triggers
+        ChainProp(name='HLT_mu4_bJpsimutrk_MuonTrkPEB_L1MU3V', stream=['BphysPEB'], groups=BphysicsGroup+['PS:Online']),
+        ChainProp(name='HLT_mu6_bJpsimutrk_MuonTrkPEB_L1MU5VF', stream=['BphysPEB'], groups=BphysicsGroup+['PS:Online']),
+        ChainProp(name='HLT_mu10_bJpsimutrk_MuonTrkPEB_L1MU8F', stream=['BphysPEB'], groups=BphysicsGroup+['PS:Online']),
+        ChainProp(name='HLT_mu20_bJpsimutrk_MuonTrkPEB_L1MU14FCH', stream=['BphysPEB'], groups=BphysicsGroup+['PS:Online']),
 
         # RCP multiple candidate
         ChainProp(name='HLT_mu10_l2mt_mu4_l2mt_bJpsimumu_L1MU10BOM', l1SeedThresholds=['MU10BOM']*2, stream=["BphysDelayed"], groups=BphysicsGroup),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 3eb170474bdd..7ead99c9a9de 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -354,7 +354,7 @@ MuonChainParts_Default = {
 # Bphysics
 #==========================================================
 AllowedTopos_Bphysics = [
-    'bJpsimumu','bJpsi','bUpsimumu','bUpsi','bBmumu','bDimu','bDimu2700','bDimu6000','bPhi','bTau','bJpsimumul2io',
+    'bJpsimumu','bJpsi','bJpsimutrk','bUpsimumu','bUpsi','bBmumu','bDimu','bDimu2700','bDimu6000','bPhi','bTau',
     'Lxy0',
     'bBmumux','BpmumuKp','BcmumuPi','BsmumuPhi','BdmumuKst','LbPqKm', 'BcmumuDsloose', 'BcmumuDploose'
 ]
-- 
GitLab


From f773808376a2a7a6434eab945fbbf368eb5d6140 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 20 Sep 2021 17:40:04 +0200
Subject: [PATCH 229/347] TriggerMenuMT: delete legacy L1 XML menu code

Delete the legacy L1 XML menu code. This essentially deletes all files
in `LVL1MenuConfig` except a few that need to be relocated in a separate
MR. Also disable the L1 XML menu generation during the build.

Relates to ATR-21862.
---
 .../TriggerJobOpts/share/runHLT_standalone.py |    2 +-
 .../TriggerMenuMT/CMakeLists.txt              |  121 +-
 .../HLTMenuConfig/Menu/DictFromChainName.py   |   24 +-
 .../HLTMenuConfig/Menu/GenerateMenuMT.py      |   27 -
 .../python/HLTMenuConfig/Menu/L1Seeds.py      |    2 +-
 .../TriggerMenuMT/python/L1/Base/TopoAlgos.py |   81 +-
 .../LVL1MenuConfig/L1Topo/L1TopoFlags.py      |   34 -
 .../LVL1MenuConfig/L1Topo/L1TopoMenu.py       |  144 --
 .../python/LVL1MenuConfig/L1Topo/TopoAlgos.py |  149 --
 .../LVL1MenuConfig/L1Topo/TopoOutput.py       |   94 -
 .../python/LVL1MenuConfig/L1Topo/__init__.py  |    1 -
 .../LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py  |   80 -
 .../LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py  | 1337 --------------
 .../LVL1MenuConfig/L1TopoMenu/__init__.py     |    1 -
 .../LVL1MenuConfig/LVL1/BunchGroupSet.py      |  109 --
 .../python/LVL1MenuConfig/LVL1/CTPInfo.py     |   54 -
 .../python/LVL1MenuConfig/LVL1/Cabling.py     |  319 ----
 .../python/LVL1MenuConfig/LVL1/CaloInfo.py    |  208 ---
 .../python/LVL1MenuConfig/LVL1/Logic.py       |  202 ---
 .../LVL1MenuConfig/LVL1/Lvl1Condition.py      |   46 -
 .../python/LVL1MenuConfig/LVL1/Lvl1Menu.py    |  247 ---
 .../LVL1MenuConfig/LVL1/Lvl1MenuItems.py      |  198 --
 .../LVL1MenuConfig/LVL1/Lvl1MenuUtil.py       |  150 --
 .../LVL1MenuConfig/LVL1/Lvl1MonCounters.py    |   70 -
 .../LVL1MenuConfig/LVL1/Lvl1Thresholds.py     |  376 ----
 .../python/LVL1MenuConfig/LVL1/MuctpiInfo.py  |   10 -
 .../LVL1MenuConfig/LVL1/PrescaleHelper.py     |   58 -
 .../LVL1MenuConfig/LVL1/XMLMenuReader.py      |  258 ---
 .../python/LVL1MenuConfig/LVL1/XMLReader.py   |   60 -
 .../python/LVL1MenuConfig/LVL1Menu/CaloDef.py |   85 -
 .../python/LVL1MenuConfig/LVL1Menu/ItemDef.py | 1586 -----------------
 .../python/LVL1MenuConfig/LVL1Menu/L1Seeds.py |  430 -----
 .../LVL1Menu/Menu_L1_alfa_v2.py               |  175 --
 .../LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py    |  992 -----------
 .../LVL1MenuConfig/LVL1Menu/MonitorDef.py     |  246 ---
 .../LVL1MenuConfig/LVL1Menu/ThresholdDef.py   |  470 -----
 .../LVL1MenuConfig/LVL1Menu/__init__.py       |    1 -
 .../LVL1MenuConfig/TriggerConfigL1Topo.py     |  166 --
 .../LVL1MenuConfig/TriggerConfigLVL1.py       |  390 ----
 .../python/TriggerAPI/TriggerDataAccess.py    |    2 +-
 .../TriggerMenuMT/scripts/generateL1MenuMT.sh |   84 -
 .../scripts/generateL1MenuRun3.py             |    6 +-
 .../scripts/generateLVL1MenuMT.py             |  210 ---
 .../scripts/trigCompareOldandNewL1Menus.py    |  647 -------
 .../scripts/trigL1MenuMigrationCheck.sh       |   47 -
 .../TriggerMenuMT/share/LVL1config.dtd        |  202 ---
 .../TriggerMenuMT/share/test_menu_cf.py       |    4 +-
 47 files changed, 16 insertions(+), 10189 deletions(-)
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoFlags.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoMenu.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/TopoAlgos.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/TopoOutput.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/__init__.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/__init__.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/BunchGroupSet.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/CTPInfo.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/CaloInfo.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Logic.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Condition.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Menu.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MenuItems.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MenuUtil.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MonCounters.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Thresholds.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/MuctpiInfo.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/PrescaleHelper.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/XMLMenuReader.py
 delete mode 100755 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/XMLReader.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/CaloDef.py
 delete mode 100755 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/L1Seeds.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_L1_alfa_v2.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/MonitorDef.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/__init__.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigL1Topo.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigLVL1.py
 delete mode 100755 Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuMT.sh
 delete mode 100755 Trigger/TriggerCommon/TriggerMenuMT/scripts/generateLVL1MenuMT.py
 delete mode 100755 Trigger/TriggerCommon/TriggerMenuMT/scripts/trigCompareOldandNewL1Menus.py
 delete mode 100755 Trigger/TriggerCommon/TriggerMenuMT/scripts/trigL1MenuMigrationCheck.sh
 delete mode 100755 Trigger/TriggerCommon/TriggerMenuMT/share/LVL1config.dtd

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 67b24ec53b01..8f2cf7ec0ca5 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -442,7 +442,7 @@ elif ConfigFlags.Input.Format == 'BS' and not ConfigFlags.Trigger.Online.isParti
 if opt.setMenu:
     ConfigFlags.Trigger.triggerMenuSetup = opt.setMenu
 TriggerFlags.triggerMenuSetup = ConfigFlags.Trigger.triggerMenuSetup
-TriggerFlags.readLVL1configFromXML = True
+TriggerFlags.readLVL1configFromXML = False
 TriggerFlags.outputLVL1configFile = None
 
 from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu, createL1PrescalesFileFromMenu
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
index 9f23d537044d..f330b284c272 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
+++ b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
@@ -3,97 +3,6 @@
 # Declare the package name:
 atlas_subdir( TriggerMenuMT )
 
-#----------------------------------
-# Function to build trigger menu:
-function( atlas_build_lvl1_trigger_menu menu )
-
-   # Don't do anything in release recompilation dryrun mode. In all other
-   # modes, proceed as usual.
-   if( ATLAS_RELEASE_RECOMPILE_DRYRUN )
-      return()
-   endif()
-
-   cmake_parse_arguments( ARG "" "DEPENDS" "" ${ARGN} )
-
-   # Command to build trigger menu. The idea is that ${menu}.stamp gets
-   # created as the last command, should the menu generation succeed such that 
-   # after a successful menu generation it wouldn't be attempted again.
-   # In order for the installation step to not try to re-generate
-   # the menu in case it was the generation itself that failed, another
-   # stamp file, ${menu}.attempted.stamp is created as the first command.
-   # The menu is then only generated as part of the installation step if
-   # this ${menu}.attempted.stamp file doesn't even exist.
-
-   add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${menu}.stamp
-      COMMAND ${CMAKE_COMMAND} -E touch
-      ${CMAKE_CURRENT_BINARY_DIR}/${menu}.attempted.stamp
-      COMMAND ${CMAKE_COMMAND} -E make_directory
-      ${CMAKE_CURRENT_BINARY_DIR}/Menus/${menu}
-      COMMAND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/atlas_build_run.sh
-      ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/generateL1MenuMT.sh -r ${CMAKE_PROJECT_VERSION} ${menu}
-      ${CMAKE_CURRENT_BINARY_DIR}/Menus/${menu}
-      COMMAND ${CMAKE_COMMAND} -E make_directory
-      ${CMAKE_XML_OUTPUT_DIRECTORY}/TriggerMenuMT
-      COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/Menus/${menu}/
-      ${CMAKE_XML_OUTPUT_DIRECTORY}/TriggerMenuMT
-      #COMMAND ${CMAKE_COMMAND} -E touch           # do not create stamp file to force rebuild every time
-      #${CMAKE_CURRENT_BINARY_DIR}/${menu}.stamp
-      DEPENDS "Package_$<JOIN:$<TARGET_PROPERTY:ATLAS_PACKAGES_TARGET,ATLAS_PACKAGES>,;Package_>" )
-
-   # Create custom target and add it to package dependencies
-   add_custom_target( build_menu_${menu} ALL SOURCES
-      ${CMAKE_CURRENT_BINARY_DIR}/${menu}.stamp )
-
-   # Optional dependency on other menu
-   if ( ARG_DEPENDS )
-      add_dependencies( build_menu_${menu} build_menu_${ARG_DEPENDS} )
-   endif()
-
-   # In case the file generation failed, because it wasn't even attempted
-   # (failure in another package), then try to run the generation as part
-   # of the installation. Note that apparently chaining commands inside a
-   # single execute_process(...) call doesn't work correctly during installation
-   # for some reason. Hence it's taken apart into 3 separate calls.
-   install( CODE "if( NOT EXISTS
-                     ${CMAKE_CURRENT_BINARY_DIR}/${menu}.attempted.stamp )
-                     message( WARNING \"Generating trigger menu ${menu}\"
-                              \" during the installation\" )
-                     execute_process( COMMAND ${CMAKE_COMMAND} -E touch
-                        ${CMAKE_CURRENT_BINARY_DIR}/${menu}.attempted.stamp )
-                     execute_process(
-                        COMMAND ${CMAKE_COMMAND} -E make_directory
-                        ${CMAKE_CURRENT_BINARY_DIR}/Menus/${menu} )
-                     execute_process(
-                        COMMAND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/atlas_build_run.sh
-                        ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/generateL1MenuMT.sh
-                        -r ${CMAKE_PROJECT_VERSION} ${menu} ${CMAKE_CURRENT_BINARY_DIR}/Menus/${menu} )
-                  endif()" )
-
-   # Install the generated XML files. Note that this installation rule is
-   # executed after the previous code. So by this time the files should be
-   # in place, if they could be produced.
-   install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Menus/${menu}/
-      DESTINATION ${CMAKE_INSTALL_XMLDIR}/TriggerMenuMT
-      USE_SOURCE_PERMISSIONS
-      FILES_MATCHING PATTERN "*.xml" )
-
-   # Create a target that will depend on all the other targets, and will
-   # print the "right message" at the end of the build. Notice that
-   # we can't rely on the Package_TriggerMenuXML target here, since
-   # the XML generation depends on all package targets being ready before
-   # it could start. So it would cause a circular dependency to make the
-   # menu targets be dependencies of the package target.
-   if( NOT TARGET TriggerMenuMTMain )
-      add_custom_target( TriggerMenuMTMain ALL
-         COMMENT "Package build succeeded"
-         COMMAND ${CMAKE_COMMAND} -E echo
-         "TriggerMenuMT: Package build succeeded" )
-   endif()
-   add_dependencies( TriggerMenuMTMain build_menu_${menu} )
-
-endfunction ( atlas_build_lvl1_trigger_menu )
-
-#----------------------------------
 # Install files from the package:
 atlas_install_python_modules( python/*.py
                               python/LVL1MenuConfig
@@ -103,8 +12,7 @@ atlas_install_python_modules( python/*.py
                               python/CFtest
                               POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-extensions=ATL900,ATL901 )
 
-atlas_install_scripts( scripts/generateLVL1MenuMT.py
-                       scripts/generateL1MenuRun3.py
+atlas_install_scripts( scripts/generateL1MenuRun3.py
                        scripts/trigCompareOldandNewL1Menus.py
                        scripts/verify_menu_config.py                       
                        scripts/generateBunchGroupSetFromOldKey.py
@@ -115,9 +23,7 @@ atlas_install_scripts( scripts/generateLVL1MenuMT.py
                        POST_BUILD_CMD ${ATLAS_FLAKE8} )
 
 # Shell scripts without flake8 checking:
-atlas_install_scripts( scripts/generateL1MenuMT.sh
-                       scripts/trigL1MenuMigrationCheck.sh
-                       scripts/test_HLTmenu.sh
+atlas_install_scripts( scripts/test_HLTmenu.sh
                        scripts/test_slice_independence.sh
                        scripts/test_manual_menu_cf.sh
                        scripts/test_emu_step_menu_processing_cf.sh
@@ -164,29 +70,6 @@ atlas_add_test( RecoFragmentsPool
                 SCRIPT python -m unittest -v TriggerMenuMT.HLTMenuConfig.Test.RecoFragmentsPoolTest
                 POST_EXEC_SCRIPT nopost.sh )
 
-############ Support of legacy XML menus ############
-# Can be removed once all clients are migrated to JSON: ATR-21862
-#
-# Temporary copy of LVL1 XML DTD (remove this and the file once XML menu is deprecated)
-atlas_install_xmls( share/*.dtd )
-atlas_install_data( share/*.ref)
-
-# List of XML menus to be created:
-atlas_build_lvl1_trigger_menu( Physics_pp_run3_v1 )
-atlas_build_lvl1_trigger_menu( PhysicsP1_pp_run3_v1 )
-atlas_build_lvl1_trigger_menu( MC_pp_run3_v1 )
-atlas_build_lvl1_trigger_menu( Cosmic_run3_v1 )
-atlas_build_lvl1_trigger_menu( PhysicsP1_HI_run3_v1 )
-atlas_build_lvl1_trigger_menu( Dev_HI_run3_v1 )
-
-# Build of different prescales for same menu need to be serialized (ATR-22387):
-atlas_build_lvl1_trigger_menu( LS2_v1 )
-atlas_build_lvl1_trigger_menu( LS2_v1_Primary_prescale DEPENDS LS2_v1 )
-atlas_build_lvl1_trigger_menu( LS2_v1_TriggerValidation_prescale DEPENDS LS2_v1_Primary_prescale )
-atlas_build_lvl1_trigger_menu( LS2_v1_BulkMCProd_prescale DEPENDS LS2_v1_TriggerValidation_prescale )
-atlas_build_lvl1_trigger_menu( LS2_v1_CPSampleProd_prescale DEPENDS LS2_v1_BulkMCProd_prescale )
-#####################################################
-
 # Test L1 trigger menus:
 function( atlas_test_lvl1_trigger_menu menu )
    atlas_add_test( "L1_${menu}"
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
index 563803d15422..3b5dfdd8ba1b 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 """
 Class to obtain the chain configuration dictionary from the short or long name
@@ -39,26 +39,10 @@ def getOverallL1item(chainName):
     if l1seed in ['L1_Bkg', 'L1_Standby', 'L1_Calo', 'L1_Calo_EMPTY', 'L1_PhysicsHigh_noPS', 'L1_PhysicsVeryHigh_noPS',
         'L1_EMPTY_noPS', 'L1_FIRSTEMPTY_noPS', 'L1_UNPAIRED_ISO_noPS', 'L1_UNPAIRED_NONISO_noPS', 'L1_ABORTGAPNOTCALIB_noPS'] :
         # For these item seed specifications we need to derive the precise list of item names from the L1Menu.
-        # During the transition period to the new menu format it is important to pick the correct kind based
-        # on the temporary TriggerFlag readLVL1FromJSON.
-        from TriggerJobOpts.TriggerFlags import TriggerFlags
         from AthenaConfiguration.AllConfigFlags import ConfigFlags
-        if ConfigFlags.Trigger.readLVL1FromJSON:
-            lvl1name = getL1MenuFileName(ConfigFlags)
-            lvl1access = L1MenuAccess(lvl1name)
-            itemsDict = lvl1access.items(includeKeys = ['name','ctpid','triggerType'])
-        else:
-            from TriggerMenuMT.LVL1MenuConfig.LVL1.XMLReader import L1MenuXMLReader
-            fileName = TriggerFlags.inputLVL1configFile()
-            l1menu = L1MenuXMLReader(fileName)
-            l1items = l1menu.getL1Items()
-            itemsDict = {}
-            for item in l1items:
-                itemsDict[item['name']] = {
-                    'name' : item['name'],
-                    'ctpid' : item['ctpid'],
-                    'triggerType' : item['trigger_type'],
-                }
+        lvl1name = getL1MenuFileName(ConfigFlags)
+        lvl1access = L1MenuAccess(lvl1name)
+        itemsDict = lvl1access.items(includeKeys = ['name','ctpid','triggerType'])
         l1seedlist = getSpecificL1Seeds(l1seed, itemsDict)
         return l1seedlist
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index 6f9bc3ca904f..6fad58661b5c 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -101,25 +101,6 @@ class GenerateMenuMT(object, metaclass=Singleton):
         return (self.HLTPrescales)
 
 
-    def generateLVL1(self):
-        """
-        == Generates the LVL1 menu
-        """
-        if not TriggerFlags.readLVL1configFromXML() and not TriggerFlags.readMenuFromTriggerDb():
-            log.info('Generating L1 configuration for %s', TriggerFlags.triggerMenuSetup() )
-            from TriggerMenuMT.LVL1MenuConfig.TriggerConfigLVL1 import TriggerConfigLVL1
-            self.trigConfL1 = TriggerConfigLVL1( outputFile = TriggerFlags.outputLVL1configFile())
-            # build the menu structure
-            self.trigConfL1.generateMenu()
-            log.debug('Menu has %i items', len(self.trigConfL1.menu.items) )
-            # write xml file
-            self.trigConfL1.writeXML()
-        elif TriggerFlags.readLVL1configFromXML():
-            log.info("ReadingLVL1cofnigFromXML currently not implemented")
-        else:
-            log.info("Doing nothing with L1 menu configuration...")
-    
-
     def getChainDicts(self):
         chainCounter = 0
         all_chain_dicts = []
@@ -530,14 +511,6 @@ class GenerateMenuMT(object, metaclass=Singleton):
         """
         log.info('Starting menu generation')
 
-        # --------------------------------------------------------------------
-        # L1 menu generation
-        # - from the code, from DB and from xmls (if we want to maintain this)
-        # currently implementing the generation from configuration code
-        # --------------------------------------------------------------------
-        #generateLVL1()
-
-
         # --------------------------------------------------------------------
         # HLT menu generation
         # --------------------------------------------------------------------
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py
index bd0020705532..d277fa446b8f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon.Logging import logging
-log = logging.getLogger("TriggerMenuMT.LVL1MenuConfig.L1Seeds")
+log = logging.getLogger(__name__)
 
 from TriggerJobOpts.TriggerFlags  import TriggerFlags
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py
index 13c63733253f..bbcbdd416e29 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py
@@ -1,9 +1,8 @@
-# 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 collections import OrderedDict as odict
 
 from AthenaCommon.Logging import logging
-from TriggerJobOpts.TriggerFlags import TriggerFlags
 import re
 
 from .ThresholdType import ThrType
@@ -129,34 +128,6 @@ class SortingAlgo(TopoAlgo):
                 raise RuntimeError("In algorithm %s the variable %s with value %r is of type float but must be int" % (self.name,variable.name,variable.value))
         return confObj
 
-    def xml(self):
-        _emscale_for_decision=2
-        _mu_for_decision=1 # MU4->3GeV, MU6->5GeV, MU10->9GeV
-        if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'):
-            if TriggerFlags.useRun1CaloEnergyScale :
-                _emscale_for_decision=1
-                log.info("Changed mscale_for_decision %s for Run1CaloEnergyScale", _emscale_for_decision)
-        
-        s='  <SortAlgo type="%s" name="%s" output="%s" algoId="%i">\n' % (self.classtype, self.name, self.outputs, self.algoId)
-        s+='    <Fixed>\n'
-        s+='      <Input name="%s" value="%s"/>\n' % (self.inputs, self.inputvalue) 
-        s+='      <Output name="TobArrayOut" value="%s"/>\n' % (self.outputs)
-        for gene in self.generics:
-            s += '      <Generic name="%s" value="%s"/>\n' % (gene.name, gene.value)
-        s+='    </Fixed>\n'            
-        s+='    <Variable>\n'
-
-        for (pos, variable) in enumerate(self.variables):
-            # scale MinET if outputs match with EM or TAU
-            if variable.name=="MinET" and (self.outputs.find("TAU")>=0 or self.outputs.find("EM")>=0):
-                variable.value = variable.value * _emscale_for_decision
-            if variable.name=="MinET" and self.outputs.find("MU")>=0:
-                variable.value = ((variable.value - _mu_for_decision) if variable.value>0 else variable.value)
-            s+='      <Parameter pos="%i" name="%s" value="%i"/>\n' % ( pos, variable.name, variable.value )
-        s+='    </Variable>\n'    
-        s+='  </SortAlgo>\n'
-        return s
-
 
 class DecisionAlgo(TopoAlgo):
 
@@ -210,56 +181,6 @@ class DecisionAlgo(TopoAlgo):
         return confObj
 
 
-    def xml(self): 
-        _emscale_for_decision=2
-        _mu_for_decision=1 
-        if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'):
-            if TriggerFlags.useRun1CaloEnergyScale :
-                _emscale_for_decision=1
-                log.info("Changed mscale_for_decision %s for Run1CaloEnergyScale", _emscale_for_decision)
-        
-        s='  <DecisionAlgo type="%s" name="%s" algoId="%i">\n' % (self.classtype, self.name, self.algoId )
-        s+='    <Fixed>\n'
-        input_woovlp = []
-        for (tobid, _input) in enumerate(self.inputs):
-            if len(self.inputs)>1:
-                if _input not in input_woovlp:
-                    s+='      <Input name="Tob%s" value="%s" position="%s"/>\n' % (str(tobid+1), _input, str(tobid))
-                    input_woovlp += [_input]
-                else:
-                    s+='      <Input name="Tob%s" value="%s" position="%s"/>\n' % (str(tobid+1), _input, str(tobid))
-            else:
-                s+='      <Input name="Tob" value="%s" position="%s"/>\n' % (_input, str(tobid))
-        s+='      <Output name="Results" bits="%s">\n' % str(len(self.outputs))
-        for (bitid, _output) in enumerate(self.outputs):
-            s+='        <Bit selection="%s" name="%s"/>\n' % (str(bitid), _output)
-        s+='      </Output>\n'
-        for gene in self.generics:
-            s += '      <Generic name="%s" value="%s"/>\n' % (gene.name, gene.value)
-        s+='    </Fixed>\n'     
-        s+='    <Variable>\n'
-
-        for (pos, variable) in enumerate(self.variables):
-            # scale MinET if inputs match with EM or TAU
-            for _minet in ["MinET"]:
-                if variable.name==_minet+"1" or variable.name==_minet+"2" or variable.name==_minet+"3" or variable.name==_minet:
-                    for (tobid, _input) in enumerate(self.inputs):
-                        if (_input.find("TAU")>=0 or _input.find("EM")>=0):
-                            if (len(self.inputs)>1 and (variable.name==_minet+str(tobid+1) or (tobid==0 and variable.name==_minet))) or (len(self.inputs)==1 and (variable.name.find(_minet)>=0)):
-                                variable.value = variable.value * _emscale_for_decision
-
-                        if _input.find("MU")>=0:
-                            if (len(self.inputs)>1 and (variable.name==_minet+str(tobid+1) or (tobid==0 and variable.name==_minet))) or (len(self.inputs)==1 and (variable.name.find(_minet)>=0)):
-                                variable.value = ((variable.value - _mu_for_decision ) if variable.value>0 else variable.value)
-                            
-            s+='      <Parameter pos="%i" name="%s"%s value="%i"/>\n' % ( pos, variable.name, ((' selection="%i"'%variable.selection) if (variable.selection>=0) else ""), variable.value )
-        s+='    </Variable>\n'    
-        s+='  </DecisionAlgo>\n'
-        return s
-
-
-
-
 class MultiplicityAlgo(TopoAlgo):
 
     def __init__(self, classtype, name, algoId, threshold, input, output, nbits):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoFlags.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoFlags.py
deleted file mode 100644
index f76ca8a581ec..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoFlags.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-"""
-L1Topo specific flags
-"""
-
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
-from AthenaCommon.Logging import logging
-
-log = logging.getLogger(__name__)
-
-_flags = [] 
-
-class algos(JobProperty):
-    """Names of algos enabled in the selected L1Topo menu"""
-    statusOn=True
-    allowedTypes=['list']
-    StoredValue=[]
-
-_flags.append(algos)  
-
-class L1TopoTriggerFlags(JobPropertyContainer):
-    """ L1Topo flags used in menu generation """
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-TriggerFlags.add_Container(L1TopoTriggerFlags)
-
-for flag in _flags:
-    TriggerFlags.L1TopoTriggerFlags.add_JobProperty(flag)
-del _flags
-
-# make an alias
-L1TopoFlags = TriggerFlags.L1TopoTriggerFlags
-            
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoMenu.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoMenu.py
deleted file mode 100644
index ae6ad1ce5368..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/L1TopoMenu.py
+++ /dev/null
@@ -1,144 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from. TopoOutput import TriggerLine
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-class L1TopoMenu(object):
-
-    def __init__(self, menuName):
-        self.menuName = menuName
-        # algorithms and their output location
-        self.topoOutput = []
-
-        self.globalConfig = dict()
-
-    def __iter__(self):
-        return self.topoOutput.__iter__()
-
-    def __call__(self):
-        return self.topoOutput
-        
-    def algoNames(self):
-        return [x.algoname for x in self.topoOutput]         
-
-    def __len__(self):
-        return len(self.topoOutput)
-
-    def addTopoLine(self, topoline):
-        self.topoOutput += topoline
-
-    def __iadd__(self, topoline):
-        if topoline is not None:
-            self.topoOutput += [ topoline ]
-        return self
-
-    def addGlobalConfig(self, name, value):
-        self.globalConfig[name]=str(value)
-
-
-    def getTriggerLines(self):
-        from operator import attrgetter
-        outputLines = []
-        for output in self.topoOutput:
-            outputLines += TriggerLine.createTriggerlinesFromTopoOutput(output)
-        return sorted(outputLines, key=attrgetter('ordinal')) # return the TriggerLines, sorted by the ordinal
-
-
-
-    def xml(self, ind=1, step=2):
-        from operator import attrgetter        
-        s  = '<?xml version="1.0" ?>\n'
-        s += '<TOPO_MENU menu_name="Topo_pp_vX" menu_version="1">\n' # % (self.menuName.replace("Physics_pp_","").replace("MC_pp_",""))
-        s += '  <!--File is generated by TriggerMenu-->\n'
-        s += '  <!--No. L1Topo algos defined: %i-->\n' % len(self.topoOutput)
-        s += '  <OutputList>\n'
-        for output in self.topoOutput:  # (Setup for module, fpga, firstbit, clock should be modified in more flexible way.)
-            s += output.xml(ind+1,step)
-        s += '  </OutputList>\n\n'
-        s += '  <TopoConfig>\n'
-        
-        for gPar in sorted(self.globalConfig.keys()):
-            s += '    <Entry name="%s" value="%s"/>\n' % (gPar, self.globalConfig[gPar])
-        s += '  </TopoConfig>\n\n'
-        
-        allSortAlgs = set()
-        for output in self.topoOutput:
-            allSortAlgs.update(output.sortingAlgos)
-        for sortAlg in sorted(allSortAlgs, key=attrgetter('algoId')):
-            s += sortAlg.xml()+"\n"
-
-        for output in self.topoOutput:
-            s += output.algo.xml()+"\n"
-
-        s += '</TOPO_MENU>\n'
-        return s
-
-
-
-
-    def readMenuFromXML(self,inputFile):
-        from XMLMenuReader import readMenuFromXML
-        readMenuFromXML(self, inputFile)
-
-
-
-    def check(self):
-
-        allOk = True #self.check_consecutiveAlgId()
-        
-        allOk &= self.check_OutputOverlap()
-
-        allOk &= self.check_LUTassignment()
-
-        return allOk
-
-    def check_consecutiveAlgId(self):
-        """
-        This method is only for quick solutions but should be intermediate
-        """
-        allOk = True
-        idlist = [x.algo.algoId for x in self.topoOutput]
-        if len(idlist)>0 and len(idlist) != max(idlist)+1:
-            idlist.sort()
-            from itertools import groupby
-            partition = [list(g) for k,g in groupby(enumerate(idlist), lambda x : x[1]-x[0])]
-            log.error("Algorithm IDs must start at 0 and be consecutive, but algorithm IDs are %s",
-                      ','.join(["%i-%i" % (x[0][1],x[-1][1]) for x in partition]))
-            allOk = False
-        return allOk
-        
-
-    def check_OutputOverlap(self):
-
-        triggerlines = self.getTriggerLines()
-
-        allOk = True
-
-        tlKeys = [ (tl.cable, tl.fpga, tl.clock, tl.bit) for tl in triggerlines]
-        
-        from collections import Counter
-        c = Counter( tlKeys ).most_common()
-        for key,count in c:
-            if count == 1:
-                break
-            log.warning("Output cable %s, fpga %s, clock %s, bit %i is used more than once (%i times)!", key+count)
-            log.warning("Check these trigger lines:")
-            for tl in triggerlines:
-                if key == (tl.cable, tl.fpga, tl.clock, tl.bit):
-                    log.warning("     ",tl.trigger)
-
-            allOk = False
-
-
-        return allOk
-
-
-    def check_LUTassignment(self):
-        """
-        Check if multibit algos are on a single LUT
-        """
-
-        allOk = True
-
-        return allOk
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/TopoAlgos.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/TopoAlgos.py
deleted file mode 100644
index 3315975a824e..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/TopoAlgos.py
+++ /dev/null
@@ -1,149 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from AthenaCommon.Logging import logging
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-log = logging.getLogger(__name__)
-
-class TopoAlgo(object):
-
-    _availableVars = []
-
-    #__slots__ = ['_name', '_selection', '_value', '_generic']
-    def __init__(self, classtype, name, algoId=0):
-        self.classtype = classtype
-        self.name = name
-        self.algoId = int(algoId)
-        self.generics = []
-        self.variables = []
-        
-    def __str__(self):  
-        return self.name
-
-    def addvariable(self, name, value, selection = -1):
-        if name in self._availableVars:
-            self.variables += [ Variable(name, selection, value) ]
-        else:
-            raise RuntimeError("Variable parameter '%s' does not exist for algorithm %s of type %s,\navailable parameters are %r" % (name,self.name, self.classtype, self._availableVars))
-        return self
-
-    def addgeneric(self, name, value):
-        if name in self._availableVars:
-            self.generics += [ Generic(name, value) ]
-        else:
-            raise RuntimeError("Generic parameter '%s' does not exist for algorithm %s of type %s,\navailable parameters are %r" % (name,self.name, self.classtype, self._availableVars))
-        return self
-
-        
-    
-class Variable(object):
-    def __init__(self, name, selection, value):
-        self.name = name
-        self.selection = int(selection)
-        self.value = int(value)
-            
-class Generic(object):
-    def __init__(self, name, value):
-        self.name = name
-        from L1TopoHardware.L1TopoHardware import HardwareConstrainedParameter
-        if isinstance(value,HardwareConstrainedParameter):
-            self.value = ":%s:" % value.name
-        else:
-            self.value = str(int(value))
-
-        
-class SortingAlgo(TopoAlgo):
-    
-    def __init__(self, classtype, name, inputs, outputs, algoId):
-        super(SortingAlgo, self).__init__(classtype=classtype, name=name, algoId=algoId)
-        self.inputs = inputs
-        self.outputs = outputs
-        self.inputvalue=  self.inputs
-        if self.inputs.find("Cluster")>=0: # to extract inputvalue (for FW) from output name
-            if self.outputs.find("TAU")>=0:
-                self.inputvalue = self.inputvalue.replace("Cluster","Tau")
-            if self.outputs.find("EM")>=0:
-                self.inputvalue = self.inputvalue.replace("Cluster","Em")
-            
-    def xml(self):
-        _emscale_for_decision=2
-        _mu_for_decision=1 # MU4->3GeV, MU6->5GeV, MU10->9GeV
-        if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'):
-            if TriggerFlags.useRun1CaloEnergyScale :
-                _emscale_for_decision=1
-                log.info("Changed mscale_for_decision %s for Run1CaloEnergyScale", _emscale_for_decision)
-        
-        s='  <SortAlgo type="%s" name="%s" output="%s" algoId="%i">\n' % (self.classtype, self.name, self.outputs, self.algoId)
-        s+='    <Fixed>\n'
-        s+='      <Input name="%s" value="%s"/>\n' % (self.inputs, self.inputvalue) 
-        s+='      <Output name="TobArrayOut" value="%s"/>\n' % (self.outputs)
-        for gene in self.generics:
-            s += '      <Generic name="%s" value="%s"/>\n' % (gene.name, gene.value)
-        s+='    </Fixed>\n'            
-        s+='    <Variable>\n'
-
-        for (pos, variable) in enumerate(self.variables):
-            # scale MinET if outputs match with EM or TAU
-            if variable.name=="MinET" and (self.outputs.find("TAU")>=0 or self.outputs.find("EM")>=0):
-                variable.value = variable.value * _emscale_for_decision
-            if variable.name=="MinET" and self.outputs.find("MU")>=0:
-                variable.value = ((variable.value - _mu_for_decision) if variable.value>0 else variable.value)
-            s+='      <Parameter pos="%i" name="%s" value="%i"/>\n' % ( pos, variable.name, variable.value )
-        s+='    </Variable>\n'    
-        s+='  </SortAlgo>\n'
-        return s
-        
-class DecisionAlgo(TopoAlgo):
-
-    def __init__(self, classtype, name, inputs, outputs, algoId):
-        super(DecisionAlgo, self).__init__(classtype=classtype, name=name, algoId=algoId)
-        self.inputs = inputs if type(inputs)==list else [inputs]
-        self.outputs = outputs if type(outputs)==list else [outputs]
-        
-    def xml(self): 
-        _emscale_for_decision=2
-        _mu_for_decision=1 
-        if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'):
-            if TriggerFlags.useRun1CaloEnergyScale :
-                _emscale_for_decision=1
-                log.info("Changed mscale_for_decision %s for Run1CaloEnergyScale", _emscale_for_decision)
-        
-        s='  <DecisionAlgo type="%s" name="%s" algoId="%i">\n' % (self.classtype, self.name, self.algoId )
-        s+='    <Fixed>\n'
-        input_woovlp = []
-        for (tobid, _input) in enumerate(self.inputs):
-            if len(self.inputs)>1:
-                if _input not in input_woovlp:
-                    s+='      <Input name="Tob%s" value="%s" position="%s"/>\n' % (str(tobid+1), _input, str(tobid))
-                    input_woovlp += [_input]
-                else:
-                    s+='      <Input name="Tob%s" value="%s" position="%s"/>\n' % (str(tobid+1), _input, str(tobid))
-            else:
-                s+='      <Input name="Tob" value="%s" position="%s"/>\n' % (_input, str(tobid))
-        s+='      <Output name="Results" bits="%s">\n' % str(len(self.outputs))
-        for (bitid, _output) in enumerate(self.outputs):
-            s+='        <Bit selection="%s" name="%s"/>\n' % (str(bitid), _output)
-        s+='      </Output>\n'
-        for gene in self.generics:
-            s += '      <Generic name="%s" value="%s"/>\n' % (gene.name, gene.value)
-        s+='    </Fixed>\n'     
-        s+='    <Variable>\n'
-
-        for (pos, variable) in enumerate(self.variables):
-            # scale MinET if inputs match with EM or TAU
-            for _minet in ["MinET"]:
-                if variable.name==_minet+"1" or variable.name==_minet+"2" or variable.name==_minet+"3" or variable.name==_minet:
-                    for (tobid, _input) in enumerate(self.inputs):
-                        if (_input.find("TAU")>=0 or _input.find("EM")>=0):
-                            if (len(self.inputs)>1 and (variable.name==_minet+str(tobid+1) or (tobid==0 and variable.name==_minet))) or (len(self.inputs)==1 and (variable.name.find(_minet)>=0)):
-                                variable.value = variable.value * _emscale_for_decision
-
-                        if _input.find("MU")>=0:
-                            if (len(self.inputs)>1 and (variable.name==_minet+str(tobid+1) or (tobid==0 and variable.name==_minet))) or (len(self.inputs)==1 and (variable.name.find(_minet)>=0)):
-                                variable.value = ((variable.value - _mu_for_decision ) if variable.value>0 else variable.value)
-                            
-            s+='      <Parameter pos="%i" name="%s"%s value="%i"/>\n' % ( pos, variable.name, ((' selection="%i"'%variable.selection) if (variable.selection>=0) else ""), variable.value )
-        s+='    </Variable>\n'    
-        s+='  </DecisionAlgo>\n'
-        return s
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/TopoOutput.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/TopoOutput.py
deleted file mode 100644
index 9be531f0fc9e..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/TopoOutput.py
+++ /dev/null
@@ -1,94 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-
-class TopoOutput(object):
-    def __init__(self, algoname, module, fpga, clock, firstbit):
-        self.algo = None
-        self.sortingAlgos = []
-        self.algoname = algoname
-        self.module = module
-        self.fpga = fpga
-        self.clock = clock
-        self.firstbit = firstbit
-
-    def xml(self, ind, step=2):
-        t = (self.algoname, ",".join(self.algo.outputs), self.algo.algoId, self.module, self.fpga, self.firstbit, self.clock)
-        s = (' '*ind*step) + '<Output algname="%s" triggerline="%s" algoId="%i" module="%i" fpga="%i" firstbit="%i" clock="%i"/>\n' % t
-        return s
-
-
-    def __str__(self):
-        return "%s [id=%i] --> %s" % (self.algoname, self.algo.algoId, ",".join(self.algo.outputs))
-
-
-
-class TriggerLine(object):
-
-    import re
-    multibitPattern = re.compile(r"(?P<line>.*)\[(?P<bit>\d+)\]")
-
-    def __init__(self, trigger, cable, bit, clock, fpga, ordinal, firstbit):
-        """
-        trigger    name of the trigger line
-        cable      0 or 1, depending on the topo module
-        bit
-        """
-        # namedtuple("TriggerLine","trigger cable bit clock fpga ordinal firstbit")
-        self.trigger  = trigger 
-        self.cable    = cable   
-        self.bit      = bit     
-        self.clock    = clock   
-        self.fpga     = fpga    
-        self.ordinal  = ordinal 
-        self.firstbit = firstbit
-
-    def __str__(self):
-        return "{0} on cable {1}, fpga {2}, bit {3}, ordinal {4}".format(self.trigger,self.cable, self.fpga, self.bit, self.ordinal)
-
-    @staticmethod
-    def createTriggerlinesFromTopoOutput(topoOutput):
-
-        tl = []
-        for (idx,line) in enumerate(topoOutput.algo.outputs):
-                
-            ordinal = 64*topoOutput.module + 32*topoOutput.clock + 16*topoOutput.fpga + topoOutput.firstbit+idx
-        
-            tl += [ TriggerLine( trigger = line,
-                                 cable = topoOutput.module,
-                                 bit = topoOutput.firstbit+idx+16*topoOutput.fpga,
-                                 clock = topoOutput.clock,
-                                 fpga = topoOutput.fpga,
-                                 ordinal = ordinal,
-                                 firstbit = topoOutput.firstbit )
-                    ]
-        return tl
-            
-
-    @staticmethod
-    def checkMultibitConsistency(multibitTriggerlines):
-
-        cs = set()  # set to check consistency
-
-        bitlist = []
-        for tl in multibitTriggerlines:
-            m = TriggerLine.multibitPattern.match(tl.trigger)
-
-            if not m:
-                raise RuntimeError("Triggerline %s does not match multibit pattern 'line[bit]'" % tl.trigger)
-
-            cs.add( (m.groupdict()['line'], tl.bit - int(m.groupdict()['bit']), tl.cable, tl.clock, tl.fpga, tl.ordinal-int(m.groupdict()['bit'])) )
-
-            bitlist += [ int(m.groupdict()['bit']) ]
-
-        minimum = min(bitlist)
-        numberOfBits = max(bitlist)+1
-        if ( (minimum !=0) or
-             (numberOfBits != len(bitlist)) or
-             (len(cs) != 1) ):
-            raise RuntimeError("This set of triggerlines does not consistently describe a multiplicity topo trigger output %r" % [tl.trigger for tl in multibitTriggerlines])
-
-        uniqueDescription = cs.pop()
-
-        (commonNameOfLines, firstbit, cable, clock, fpga, ordinal) = uniqueDescription
-
-        return (commonNameOfLines, firstbit, numberOfBits, cable, clock, fpga, ordinal)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/__init__.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/__init__.py
deleted file mode 100644
index d0cb751d0f33..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1Topo/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-#Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py
deleted file mode 100644
index 3613c040657e..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/Menu_LS2_v1.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-def defineMenu():
-    """
-    Defines the following LlTopoFlags:
-    
-    algos   .... list of all algo names in the menu 
-
-    """
-    
- 
-    from ..L1Topo.L1TopoFlags import L1TopoFlags
-    from ..L1Topo.TopoOutput import TopoOutput
-
-    
-    L1TopoFlags.algos = [
-
-        # module: 0, FPGA: 0
-        TopoOutput( algoname='0DR25-TAU20abi-TAU12abi',                     module=0, fpga=0, clock=0, firstbit=0 ),
-        TopoOutput( algoname='0DR28-TAU20abi-TAU12abi',                     module=0, fpga=0, clock=0, firstbit=1 ),
-        TopoOutput( algoname='2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',       module=0, fpga=0, clock=0, firstbit=2 ),
-        TopoOutput( algoname='2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',       module=0, fpga=0, clock=0, firstbit=3 ),
-        TopoOutput( algoname='INVM_DPHI_NFF',                               module=0, fpga=0, clock=0, firstbit=4 ), # 4 bits
-        TopoOutput( algoname='0INVM10-3MU4ab',                              module=0, fpga=0, clock=0, firstbit=9 ),
-
-        # module: 0, FPGA: 1
-        TopoOutput( algoname='KF-XE-AJall',                                 module=0, fpga=1, clock=0, firstbit=0 ), # 6 bits
-        TopoOutput( algoname='ZAFB_DPHI',                                   module=0, fpga=1, clock=0, firstbit=6 ), # 2 bits
-        TopoOutput( algoname='CEP_CJ',                                      module=0, fpga=1, clock=0, firstbit=8 ), # 2 bits
-        TopoOutput( algoname='INVM_EMs6',                                   module=0, fpga=1, clock=0, firstbit=10 ), # 3bits to 2 bits
-        TopoOutput( algoname='27DPHI32-EMs1-EMs6',                          module=0, fpga=1, clock=0, firstbit=12 ),
-
-        # module: 1, FPGA: 0
-        TopoOutput( algoname='HT190-J15s5pETA21',                           module=1, fpga=0, clock=0, firstbit=0 ),
-        TopoOutput( algoname='0DR03-EM7ab-CJ15ab',                          module=1, fpga=0, clock=0, firstbit=1 ),
-        TopoOutput( algoname='INVM_NFF',                                    module=1, fpga=0, clock=0, firstbit=2 ), # 4 bits to 1 bit
-        TopoOutput( algoname='INVM_AJ_HighMass',                            module=1, fpga=0, clock=0, firstbit=3 ), # 4bits to 1 bit
-        TopoOutput( algoname='INVM_AJ_LowMass',                             module=1, fpga=0, clock=0, firstbit=4 ), # 4 bits to 1 bit
-        TopoOutput( algoname='HT150-J20s5pETA31',                           module=1, fpga=0, clock=0, firstbit=5 ),
-        TopoOutput( algoname='400INVM9999-AJ30s6pETA31-AJ20s6p31ETA49',     module=1, fpga=0, clock=0, firstbit=6 ),
-        TopoOutput( algoname='10MINDPHI-J20s2-XE30',                        module=1, fpga=0, clock=0, firstbit=7 ),
-        TopoOutput( algoname='10MINDPHI-J20s2-XE50',                        module=1, fpga=0, clock=0, firstbit=8 ),
-        TopoOutput( algoname='SC111-CJ15abpETA26',                          module=1, fpga=0, clock=0, firstbit=9 ),
-        TopoOutput( algoname='0DETA20-J50s1-Js2',                           module=1, fpga=0, clock=0, firstbit=10 ),
-        TopoOutput( algoname='2DISAMB-J25ab-0DR28-EM15his2-TAU12abi',       module=1, fpga=0, clock=0, firstbit=11 ),
-        TopoOutput( algoname='0INVM9-EM7ab-EMab',                           module=1, fpga=0, clock=0, firstbit=12 ),
-        TopoOutput( algoname='2DISAMB-TAU12abi-J25ab',                      module=1, fpga=0, clock=0, firstbit=13 ),
-        TopoOutput( algoname='0DR04-MU4ab-CJ15ab',                          module=1, fpga=0, clock=0, firstbit=14 ),
-        TopoOutput( algoname='0DR04-MU6ab-CJ20ab',                          module=1, fpga=0, clock=0, firstbit=15 ),
-
-        # module: 1, FPGA: 1
-        TopoOutput( algoname='DISAMB-30INVM-EM20his2-TAU12ab',              module=1, fpga=1, clock=0, firstbit=0 ),
-        TopoOutput( algoname='100RATIO-0MATCH-TAU30si2-EMall',              module=1, fpga=1, clock=0, firstbit=1 ),
-        TopoOutput( algoname='NOT-0MATCH-TAU30si1-EMall',                   module=1, fpga=1, clock=0, firstbit=2 ),
-        TopoOutput( algoname='LATE-MU10s1',                                 module=1, fpga=1, clock=0, firstbit=3 ),
-        TopoOutput( algoname='MULT-CMU4ab',                                 module=1, fpga=1, clock=0, firstbit=4 ),#2bits
-        TopoOutput( algoname='MULT-CMU6ab',                                 module=1, fpga=1, clock=0, firstbit=6 ),#2bits        
-        TopoOutput( algoname='0DR15-2MU6ab',                                module=1, fpga=1, clock=0, firstbit=8 ),
-#        TopoOutput( algoname='8INVM15-0DR22-2MU6ab',                        module=1, fpga=1, clock=0, firstbit=9 ),
-
-#        TopoOutput( algoname='8INVM15-0DR22-MU6ab-MU4ab',                   module=1, fpga=1, clock=1, firstbit=0 ),
-#        TopoOutput( algoname='2INVM9-0DR15-MU6ab-MU4ab',                    module=1, fpga=1, clock=1, firstbit=1 ),
-#        TopoOutput( algoname='2INVM9-0DR15-2MU4ab',                         module=1, fpga=1, clock=1, firstbit=2 ),
-#        TopoOutput( algoname='2INVM9-2DR15-2MU6ab',                         module=1, fpga=1, clock=1, firstbit=3 ),
-        TopoOutput( algoname='5DETA99-5DPHI99-2MU4ab',                      module=1, fpga=1, clock=1, firstbit=0 ),
-        TopoOutput( algoname='5DETA99-5DPHI99-MU6ab-MU4ab',                 module=1, fpga=1, clock=1, firstbit=1 ), 
-        TopoOutput( algoname='5DETA99-5DPHI99-2MU6ab',                      module=1, fpga=1, clock=1, firstbit=2 ),
-        TopoOutput( algoname='0DETA04-EM8abi-MU10ab',                       module=1, fpga=1, clock=1, firstbit=3 ),
-        TopoOutput( algoname='0DPHI03-EM8abi-MU10ab',                       module=1, fpga=1, clock=1, firstbit=4 ),
-        TopoOutput( algoname='0DETA04-EM15abi-MUab',                        module=1, fpga=1, clock=1, firstbit=5 ),
-        TopoOutput( algoname='0DPHI03-EM15abi-MUab',                        module=1, fpga=1, clock=1, firstbit=6 ),
-        TopoOutput( algoname='0INVM70-27DPHI32-EM10his1-EM10his6',          module=1, fpga=1, clock=1, firstbit=7 ),
-        TopoOutput( algoname='0INVM70-27DPHI32-EM12his1-EM12his6',          module=1, fpga=1, clock=1, firstbit=8 ),
-#        TopoOutput( algoname='0INVM10-0DR15-EM8abi-MU10ab',                 module=1, fpga=1, clock=1, firstbit=13 ),
-#        TopoOutput( algoname='0INVM10-0DR15-EM12abi-MU6ab',                 module=1, fpga=1, clock=1, firstbit=14 ),
-        TopoOutput( algoname='8INVM15-2CMU4ab',                             module=1, fpga=1, clock=1, firstbit=9 ),
-
-    ]      
-        
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py
deleted file mode 100644
index 2e63df0429f0..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/TopoAlgoDef.py
+++ /dev/null
@@ -1,1337 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-#
-# Disable flake8 checking due to the use of 'exec':
-# flake8: noqa
-#
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-# algorithm python base classes generated from C++ code
-import L1TopoAlgorithms.L1TopoAlgConfig as AlgConf
-import L1TopoHardware.L1TopoHardware as HW
-
-
-class TopoAlgoDef(object):
-    
-    @staticmethod
-    def registerTopoAlgos(tm):
-        currentAlgoId = 0
-        
-        _etamax = 49
-        _minet = 0
- 
-        _emscale_for_decision = 2 # global scale for EM, TAU        
-        if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'):
-            if TriggerFlags.useRun1CaloEnergyScale :
-                _emscale_for_decision=1     
-                log.info("Changed mscale_for_decision %s for Run1CaloEnergyScale" % _emscale_for_decision)
-
-        alg = AlgConf.ClusterNoSort( name = 'EMall', inputs = 'ClusterTobArray', outputs = 'EMall', algoId = currentAlgoId) ; currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.InputWidthEM)
-        alg.addgeneric('OutputWidth', HW.InputWidthEM)
-        alg.addvariable('IsoMask', 0)
-        tm.registerAlgo(alg)  
-
-                                
-        alg = AlgConf.ClusterSelect( name = 'TAUabi', inputs = 'ClusterTobArray', outputs = 'TAUabi', algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth',  HW.InputWidthTAU)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectTAU )
-        alg.addgeneric('OutputWidth', HW.OutputWidthSelectTAU)        
-        alg.addvariable('MinET', 12) 
-        alg.addvariable('IsoMask', 2) 
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', _etamax)
-        alg.addgeneric('DoIsoCut', 1)
-        tm.registerAlgo(alg) 
-
-
-        alg = AlgConf.ClusterSelect( name = 'EMabi', inputs = 'ClusterTobArray', outputs = 'EMabi', algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth',  HW.InputWidthEM)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM ) 
-        alg.addgeneric('OutputWidth', HW.OutputWidthSelectEM)
-        alg.addvariable('MinET', 8)
-        alg.addvariable('IsoMask', 2)
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', _etamax)
-        alg.addgeneric('DoIsoCut', 1)
-        tm.registerAlgo(alg) 
-
-
-        alg = AlgConf.ClusterSelect( name = 'EMabhi', inputs = 'ClusterTobArray', outputs = 'EMabhi', algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth',  HW.InputWidthEM)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM ) 
-        alg.addgeneric('OutputWidth', HW.OutputWidthSelectEM)
-        alg.addvariable('MinET', 8)
-        alg.addvariable('IsoMask', 3)
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', _etamax)
-        alg.addgeneric('DoIsoCut', 1)
-        tm.registerAlgo(alg) 
-
-        
-        alg = AlgConf.ClusterSelect( name = 'TAUab', inputs = 'ClusterTobArray', outputs = 'TAUab', algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth',  HW.InputWidthTAU)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectTAU )
-        alg.addgeneric('OutputWidth', HW.OutputWidthSelectTAU)
-        alg.addvariable('MinET', 12) 
-        alg.addvariable('IsoMask', 0)
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', _etamax)
-        alg.addgeneric('DoIsoCut', 0)
-        tm.registerAlgo(alg) 
-
-
-        alg = AlgConf.ClusterSort( name = 'EMs', inputs = 'ClusterTobArray', outputs = 'EMs', algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.InputWidthEM)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortEM)
-        alg.addgeneric('OutputWidth', HW.OutputWidthSortEM)
-        alg.addvariable('IsoMask', 0)
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', _etamax) 
-        alg.addgeneric('DoIsoCut', '0')
-        #alg.addgeneric('DoEtaCut', '1')
-        tm.registerAlgo(alg) 
-
-        
-        alg = AlgConf.ClusterSort( name = 'EMshi', inputs = 'ClusterTobArray', outputs = 'EMshi', algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.InputWidthEM)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortEM)
-        alg.addgeneric('OutputWidth', HW.OutputWidthSortEM)
-        alg.addvariable('IsoMask', 3) 
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', _etamax)
-        alg.addgeneric('DoIsoCut', '1')
-        #alg.addgeneric('DoEtaCut', '1')
-        tm.registerAlgo(alg)
-
-
-        alg = AlgConf.ClusterSort( name = 'TAUsi', inputs = 'ClusterTobArray', outputs = 'TAUsi', algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.InputWidthTAU)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortTAU)
-        alg.addgeneric('OutputWidth', HW.OutputWidthSortTAU)
-        alg.addvariable('IsoMask', 2) 
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', _etamax)
-        alg.addgeneric('DoIsoCut', '1')
-        #alg.addgeneric('DoEtaCut', '1')
-        tm.registerAlgo(alg)
-
-        
-        alg = AlgConf.JetNoSort( name = 'AJall', inputs = 'JetTobArray', outputs = 'AJall', algoId = currentAlgoId ) ; currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.InputWidthJET)
-        alg.addgeneric('OutputWidth', HW.InputWidthJET)
-        alg.addgeneric('JetSize', HW.DefaultJetSize)
-        tm.registerAlgo(alg)
-
-
-        alg = AlgConf.JetNoSort( name = 'AJjall', inputs = 'JetTobArray', outputs = 'AJjall', algoId = currentAlgoId ) ; currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.InputWidthJET)
-        alg.addgeneric('OutputWidth', HW.InputWidthJET)
-        alg.addgeneric('JetSize', 1 if HW.DefaultJetSize.value==2 else 2)
-        tm.registerAlgo(alg)
-
-
-        # for 0MATCH-4AJ20-4AJj15
-
-        alg = AlgConf.JetNoSortMatch( name = 'AJMatchall', inputs = 'JetTobArray', outputs = 'AJMatchall', algoId = currentAlgoId ) ; currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.InputWidthJET)
-        alg.addgeneric('OutputWidth', HW.InputWidthJET)
-        alg.addgeneric('JetSize', 2 if HW.DefaultJetSize.value==2 else 1)
-        alg.addvariable('MinET1', 15) # 4x4       
-        alg.addvariable('MinET2', 20) # 8x8
-        tm.registerAlgo(alg)        
-
-        # ab J lists:
-        for jet_type in ['J', 'CJ', 'FJ']:
-            jetabseta = _etamax
-            _minet = 25
-            _mineta=0
-            if jet_type=='J':
-                jetabseta = 31
-                _minet = 20
-            elif jet_type=='CJ':
-                jetabseta = 26 
-                _minet = 15
-            elif jet_type=='FJ':
-                _mineta = 31
-                _minet = 15
-
-            alg = AlgConf.JetSelect( name = jet_type+'ab', inputs = 'JetTobArray', outputs = jet_type+'ab', algoId = currentAlgoId ); currentAlgoId += 1
-
-            alg.addgeneric('InputWidth', HW.InputWidthJET)
-            alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectJET )            
-            alg.addgeneric('OutputWidth', HW.OutputWidthSelectJET)
-            alg.addgeneric('JetSize', HW.DefaultJetSize.value)
-            alg.addvariable('MinET', _minet)  
-            alg.addvariable('MinEta', _mineta)
-            alg.addvariable('MaxEta', jetabseta)
-            alg.addgeneric('DoEtaCut', 1)
-            tm.registerAlgo(alg) 
-
-        alg = AlgConf.JetSort( name = 'AJjs', inputs = 'JetTobArray', outputs = 'AJjs', algoId = currentAlgoId); currentAlgoId += 1
-
-        alg.addgeneric('InputWidth',  HW.InputWidthJET)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
-        alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
-        alg.addgeneric('JetSize', 1 if HW.DefaultJetSize.value==2 else 2)                
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', _etamax)
-        alg.addgeneric('DoEtaCut', 0)
-        tm.registerAlgo(alg) 
-
-
-        #input list needed for ATR-18824
-        alg = AlgConf.JetSort( name = 'FJjs23ETA49', inputs = 'JetTobArray', outputs = 'FJjs23ETA49', algoId = currentAlgoId); currentAlgoId += 1
-
-        alg.addgeneric('InputWidth',  HW.InputWidthJET)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
-        alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
-        alg.addgeneric('JetSize', 1 if HW.DefaultJetSize.value==2 else 2)
-        alg.addvariable('MinEta', 23)
-        alg.addvariable('MaxEta', _etamax)
-        alg.addgeneric('DoEtaCut', 1)
-        tm.registerAlgo(alg)
-            
-        
-        alg = AlgConf.JetSort( name = 'CJsETA21', inputs = 'JetTobArray', outputs = 'CJsETA21', algoId = currentAlgoId); currentAlgoId += 1
-        alg.addgeneric('InputWidth',  HW.InputWidthJET)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
-        alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
-        alg.addgeneric('JetSize', HW.DefaultJetSize.value)
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', 21)
-        tm.registerAlgo(alg)
-
-        # Sorted J lists:
-        for jet_type in ['AJ', 'FJ']:
-            jetabseta = _etamax
-            _minet = 25
-            _mineta = 0
-            if jet_type=='J':
-                jetabseta = 31
-                _minet = 20
-            elif jet_type=='CJ':
-                jetabseta = 26 
-                _minet = 15
-            elif jet_type=='FJ':
-                _mineta = 31
-                _minet = 15
-                
-            alg = AlgConf.JetSort( name = jet_type+'s', inputs = 'JetTobArray', outputs = jet_type+'s', algoId = currentAlgoId ); currentAlgoId += 1
-
-            alg.addgeneric('InputWidth',  HW.InputWidthJET)
-            alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
-            alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
-            alg.addgeneric('JetSize', HW.DefaultJetSize.value) 
-            alg.addvariable('MinEta', _mineta)
-            alg.addvariable('MaxEta', jetabseta)
-            if jet_type=='FJ':
-                alg.addgeneric('DoEtaCut', 1)
-            else:
-                alg.addgeneric('DoEtaCut', 0)
-            tm.registerAlgo(alg) 
-
-        for jet_type in ['J','CJ']:
-            jetabseta = _etamax
-            _minet = 25
-            if jet_type=='J':
-                jetabseta = 31
-                _minet = 20
-            elif jet_type=='CJ':
-                jetabseta = 26
-                _minet = 15
-
-            alg = AlgConf.JetSort( name = jet_type+'s', inputs = 'JetTobArray', outputs = jet_type+'s', algoId = currentAlgoId ); currentAlgoId += 1
-
-            alg.addgeneric('InputWidth',  HW.InputWidthJET)
-            alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortJET )
-            alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
-            alg.addgeneric('JetSize', HW.DefaultJetSize.value)
-            alg.addvariable('MinEta', 0)
-            alg.addvariable('MaxEta', jetabseta)
-            alg.addgeneric('DoEtaCut', 1)
-            tm.registerAlgo(alg)
-
-
-        alg = AlgConf.METNoSort( name = 'XENoSort', inputs = 'MetTobArray', outputs = 'XENoSort', algoId = currentAlgoId ); currentAlgoId += 1
-
-        alg.addgeneric('InputWidth', HW.InputWidthMET)
-        alg.addgeneric('OutputWidth', HW.OutputWidthMET)
-        tm.registerAlgo(alg)
-
-                
-        alg = AlgConf.MetSort( name = 'XE', inputs = 'MetTobArray', outputs = 'XE', algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.InputWidthMET)
-        alg.addgeneric('OutputWidth', HW.OutputWidthMET)
-        tm.registerAlgo(alg)
-
-        
-        alg = AlgConf.MuonSelect( name = 'MUab', inputs = 'MuonTobArray', outputs = 'MUab', algoId = currentAlgoId ); currentAlgoId += 1
-
-        alg.addgeneric('InputWidth', HW.InputWidthMU)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectMU )
-        alg.addgeneric('OutputWidth', HW.OutputWidthSelectMU)
-        alg.addvariable('MinET', 4) 
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', 25)
-        tm.registerAlgo(alg)            
-
-
-        alg = AlgConf.MuonSort( name = 'MUs', inputs = 'MuonTobArray', outputs = 'MUs', algoId = currentAlgoId ); currentAlgoId += 1
-
-        alg.addgeneric('InputWidth', HW.InputWidthMU)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortMU )
-        alg.addgeneric('OutputWidth', HW.OutputWidthSortMU)
-#        alg.addvariable('MinET', 4)
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', 25)
-        tm.registerAlgo(alg)
-
-
-        alg = AlgConf.MuonSelect( name = 'CMUab', inputs = 'MuonTobArray', outputs = 'CMUab', algoId = currentAlgoId ); currentAlgoId += 1                                     
-
-        alg.addgeneric('InputWidth', HW.InputWidthMU)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectMU )
-        alg.addgeneric('OutputWidth', HW.OutputWidthSelectMU)
-        alg.addvariable('MinET', 4) 
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', 10)
-        tm.registerAlgo(alg)
-
-
-        alg = AlgConf.MuonSort_1BC( name = 'LMUs', inputs = 'LateMuonTobArray', outputs = 'LMUs', algoId = currentAlgoId ); currentAlgoId += 1
-        #alg = AlgConf.MuonSort_1BC( name = 'LMUs', inputs = 'MuonTobArray', outputs = 'LMUs', algoId = currentAlgoId ); currentAlgoId += 1
-
-        alg.addgeneric('InputWidth', HW.InputWidthMU)
-        #alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSortMU )
-        alg.addgeneric('OutputWidth', HW.OutputWidthSortMU)
-        alg.addgeneric('nDelayedMuons', 1)
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', 25)
-        tm.registerAlgo(alg)
-
-        
-        # Abbreviated lists:
-        alg = AlgConf.ClusterSelect( name = 'EMab', inputs = 'ClusterTobArray', outputs = 'EMab', algoId = currentAlgoId ); currentAlgoId += 1
-
-        alg.addgeneric('InputWidth',  HW.InputWidthEM)
-        alg.addgeneric('InputWidth1stStage', HW.InputWidth1stStageSelectEM ) 
-        alg.addgeneric('OutputWidth', HW.OutputWidthSelectEM)
-        alg.addvariable('MinET', 5)
-        alg.addvariable('IsoMask', 0)                
-        alg.addvariable('MinEta', 0)
-        alg.addvariable('MaxEta', _etamax)
-        alg.addgeneric('DoIsoCut', 0)
-        tm.registerAlgo(alg) 
-        
-
-        # All lists:
-
-        alg = AlgConf.ClusterNoSort( name = 'TAUall', inputs = 'ClusterTobArray', outputs = 'TAUall', algoId = currentAlgoId) ; currentAlgoId += 1                                         
-
-        alg.addgeneric('InputWidth', HW.InputWidthTAU)
-        alg.addgeneric('OutputWidth', HW.InputWidthTAU)
-        alg.addvariable('IsoMask', 0)
-        tm.registerAlgo(alg)
-
-
-        alg = AlgConf.MuonNoSort( name = 'MUall', inputs = 'MuonTobArray', outputs = 'MUall',algoId = currentAlgoId) ; currentAlgoId += 1                                      
-
-        alg.addgeneric('InputWidth', HW.InputWidthMU)
-        alg.addgeneric('OutputWidth', HW.InputWidthMU)
-        tm.registerAlgo(alg)
-
-        #########
-        ##
-        ## Decision algorithms
-        ##
-        #########
-        currentAlgoId = 0
-        
-        # VBF items
-        for x in [
-                {"algoname": 'INVM_AJ_HighMass', "Threlist": [ 700], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6},
-                {"algoname": 'INVM_AJ_LowMass',  "Threlist": [ 300], "maxInvm": 9999, "otype" : "AJ", "ocut1" : 30, "olist" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 20, "nleading2" : 6}
-        ]:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            inputList = d.otype + d.olist
-            toponames=[]
-            for minInvm in d.Threlist:  
-                toponame = "%iINVM%i-%s%s%s%s-%s%s%s%s"  % (minInvm, d.maxInvm,
-                                                            d.otype, str(d.ocut1) , d.olist, str(d.nleading1) if d.olist=="s" else "",     
-                                                            d.otype, str(d.ocut2) , d.olist, str(d.nleading2) if d.olist=="s" else "")     
-                toponames.append(toponame)
-            alg = AlgConf.InvariantMassInclusive1( name = d.algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1  
-            alg.addgeneric('InputWidth', d.inputwidth1)      
-            alg.addgeneric('MaxTob', d.nleading1)            
-            alg.addgeneric('NumResultBits', len(toponames))
-            for bitid, minInvm in enumerate(d.Threlist):     
-                alg.addvariable('MinET1', d.ocut1, bitid)    
-                alg.addvariable('MinET2', d.ocut2, bitid)    
-                alg.addvariable('MinMSqr', minInvm * minInvm, bitid)  
-                alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm, bitid)  
-            tm.registerAlgo(alg)
-
-
-        # dimu DR items
-        listofalgos=[
-            {"minDr": 0, "maxDr": 15, "mult": 2, "otype1" : "MU", "ocut1": 6,  "olist" : "ab", "otype2" : "",   "ocut2": 6, "onebarrel": 0}, #0DR15-2MU6ab        
-        ]
-        for x in listofalgos:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])                
-            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist)    
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist)                                    
-            toponame = "%iDR%i-%s%s%s"  % (d.minDr, d.maxDr, "ONEBARREL-" if d.onebarrel==1 else "", obj1, "" if d.mult>1 else obj2)  # noqa: F821
-            log.info("Define %s" % toponame)
-            inputList = [d.otype1 + d.olist] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist, d.otype2 + d.olist]    
-            algoname = AlgConf.DeltaRSqrIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaRSqrIncl2         
-            alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1 
-            if (d.mult>1 or d.otype1==d.otype2):  
-                alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-                alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-                alg.addgeneric('RequireOneBarrel', d.onebarrel)  
-            else:
-                alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
-                alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU) 
-                alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
-                alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut1)            
-            alg.addvariable('MinET2', d.ocut2)            
-            alg.addvariable('DeltaRMin', d.minDr*d.minDr)   
-            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr)   
-            tm.registerAlgo(alg)
-
-            
-        # deta-dphi with ab+ab
-        for x in [
-            {"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 1, "otype1" : "MU", "ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "MU", "ocut2": 4, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #5DETA99-5DPHI99-MU6ab-MU4ab
-        {"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 2, "otype1" : "MU", "ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "", "ocut2": 6, "olist2": "", "nleading2": HW.OutputWidthSelectMU}, #5DETA99-5DPHI99-2MU6ab
-        {"minDeta": 5, "maxDeta": 99, "minDphi": 5, "maxDphi": 99, "mult": 2, "otype1" : "MU", "ocut1": 4, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "otype2" : "", "ocut2": 4, "olist2": "", "nleading2": HW.OutputWidthSelectMU}, #5DETA99-5DPHI99-2MU4ab
-            ]:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            obj1 = "%s%s%s%s" % ((str(d.mult) if d.mult>1 else ""), d.otype1, str(d.ocut1), d.olist1)  
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2)  
-            toponame = "%sDETA%s-%sDPHI%s-%s%s"  % (d.minDeta, d.maxDeta, d.minDphi, d.maxDphi, obj1, "" if d.mult>1 else obj2)            
-            log.info("Define %s" % toponame)
-            inputList = [d.otype1 + d.olist1] if (d.mult>1 or d.otype1==d.otype2) else [d.otype1 + d.olist1, d.otype2 + d.olist2]    
-            algoname = AlgConf.DeltaEtaPhiIncl1 if (d.mult>1 or d.otype1==d.otype2) else AlgConf.DeltaEtaPhiIncl2        
-            alg = algoname( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('NumResultBits', 1)                        
-            if (d.mult>1 or d.otype1==d.otype2):  # noqa: F821
-                alg.addgeneric('InputWidth', d.nleading1)  # noqa: F821
-                alg.addgeneric('MaxTob', d.nleading1)      # noqa: F821
-                alg.addvariable('MinET1', d.ocut1)         # noqa: F821
-                alg.addvariable('MinET2', d.ocut2)         # noqa: F821
-                alg.addvariable('MinDeltaEta', d.minDeta)  # noqa: F821
-                alg.addvariable('MaxDeltaEta', d.maxDeta)  # noqa: F821
-                alg.addvariable('MinDeltaPhi', d.minDphi)  # noqa: F821
-                alg.addvariable('MaxDeltaPhi', d.maxDphi)  # noqa: F821
-            else:
-                alg.addgeneric('InputWidth1', d.nleading1) # noqa: F821
-                alg.addgeneric('InputWidth2', d.nleading2) # noqa: F821
-                alg.addgeneric('MaxTob1', d.nleading1)     # noqa: F821
-                alg.addgeneric('MaxTob2', d.nleading2)     # noqa: F821
-                alg.addvariable('DeltaEtaMin', d.minDeta)  # noqa: F821
-                alg.addvariable('DeltaEtaMax', d.maxDeta)  # noqa: F821
-                alg.addvariable('DeltaPhiMin', d.minDphi)  # noqa: F821
-                alg.addvariable('DeltaPhiMax', d.maxDphi)  # noqa: F821
-                alg.addvariable('MinET1', d.ocut1)         # noqa: F821
-                alg.addvariable('MinET2', d.ocut2)         # noqa: F821
-            tm.registerAlgo(alg)
-
-
-        algolist=[
-            {"minDr": 0, "maxDr": 28, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # 0DR28-TAU20abi-TAU12abi
-            {"minDr": 0, "maxDr": 25, "otype1" : "TAU" ,"ocut1": 20, "olist1" : "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,"otype2" : "TAU", "ocut2": 12, "olist2" : "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, #        0DR25-TAU20abi-TAU12abi
-        ]
-        for x in algolist:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            obj1 = "%s%s%s" % (d.otype1, str(d.ocut1), d.olist1)       
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2)      
-            toponame = "%iDR%i-%s%s"  % (d.minDr, d.maxDr, obj1, obj2) 
-            log.info("Define %s" % toponame)
-            inputList = [d.otype1 + d.olist1] if d.otype1==d.otype2 else [d.otype1 + d.olist1, d.otype2 + d.olist2] 
-            algoname = AlgConf.DeltaRSqrIncl1 if d.otype1==d.otype2 else AlgConf.DeltaRSqrIncl2         
-            alg = algoname( name = toponame,  inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1                            
-            if d.otype1==d.otype2: 
-                alg.addgeneric('InputWidth', d.inputwidth1)   
-                alg.addgeneric('MaxTob', d.nleading1)         
-            else:
-                alg.addgeneric('InputWidth1', d.inputwidth1)  
-                alg.addgeneric('InputWidth2', d.inputwidth2)  
-                alg.addgeneric('MaxTob1', d.nleading1)        
-                alg.addgeneric('MaxTob2', d.nleading2)        
-            alg.addgeneric('NumResultBits', 1)
-            if d.otype1==d.otype2:  
-                alg.addvariable('MinET1', d.ocut1) 
-                alg.addvariable('MinET2', d.ocut2) 
-                alg.addvariable('DeltaRMin', d.minDr*d.minDr) 
-                alg.addvariable('DeltaRMax', d.maxDr*d.maxDr) 
-            else:
-                alg.addvariable('MinET1', d.ocut1, 0) 
-                alg.addvariable('MinET2', d.ocut2, 0) 
-                alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0) 
-                alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0) 
-            tm.registerAlgo(alg)        
-
-            
-        # (ATR-8194) L1Topo HT Trigger
-        algoList = [
-            {"minHT": 150, "otype" : "J", "ocut" : 20, "olist" : "s",   "nleading" : 5, "inputwidth": HW.OutputWidthSortJET, "oeta" : 31}, #HT150-J20s5.ETA31
-            {"minHT": 190, "otype" : "J", "ocut" : 15, "olist" : "s",   "nleading" : 5, "inputwidth": HW.OutputWidthSortJET, "oeta" : 21}, #HT190-J15s5.ETA21
-            ]
-        for x in algoList:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-             
-                
-            toponame = "HT%d-%s%s%s%spETA%s" % (d.minHT, d.otype, str(d.ocut), d.olist, str(d.nleading) if d.olist=="s" else "", str(d.oeta)) 
-            
-            log.info("Define %s" % toponame)
-            
-            inputList = d.otype + d.olist 
-
-            alg = AlgConf.JetHT( name = toponame, inputs = inputList, outputs = [toponame], algoId = currentAlgoId ); currentAlgoId += 1
-
-
-            alg.addgeneric('InputWidth', d.inputwidth)   # noqa: F821
-            alg.addgeneric('MaxTob', d.nleading)         # noqa: F821
-            alg.addgeneric('NumRegisters', 2 if d.olist=="all" else 0) # noqa: F821
-            alg.addgeneric('NumResultBits', 1) # noqa: F821
-            alg.addvariable('MinET', d.ocut)     # noqa: F821                    
-            alg.addvariable('MinEta', 0)
-            alg.addvariable('MaxEta', d.oeta)    # noqa: F821
-            alg.addvariable('MinHt', d.minHT)    # noqa: F821
-            tm.registerAlgo(alg)
-
-
-
-        # INVM_EM for Jpsi
-        invm_map = {"algoname": 'INVM_EMs6' , "ocutlist": [ 7, 12 ], "minInvm": 1, "maxInvm": 5, "otype" : "EM", "olist" : "s", "nleading" : 1, "inputwidth": HW.OutputWidthSortEM}
-
-        for x in [ invm_map,
-            ]:
-
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-
-
-            inputList = d.otype + d.olist  # noqa: F821
-            toponames=[]
-
-            for ocut in d.ocutlist:      # noqa: F821
-                toponame = "%iINVM%i-%s%s%s%s-EMs6"   % (d.minInvm, d.maxInvm, d.otype, str(ocut) if ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "")          # noqa: F821
-                toponames.append(toponame)
-
-            alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = [inputList, 'EMs'], outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1     # noqa: F821
-
-
-            alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821
-            #alg.addgeneric('InputWidth2', HW.InputWidthEM)
-            alg.addgeneric('InputWidth2', HW.OutputWidthSortEM)
-            alg.addgeneric('MaxTob1', d.nleading)       # noqa: F821
-            #alg.addgeneric('MaxTob2', HW.InputWidthEM)
-            alg.addgeneric('MaxTob2', HW.OutputWidthSortEM)
-            alg.addgeneric('NumResultBits', len(toponames))
-
-            for bitid, ocut in enumerate(d.ocutlist): # noqa: F821
-                alg.addvariable('MinET1', ocut, bitid)
-                alg.addvariable('MinET2', 0, bitid)
-                alg.addvariable('MinMSqr', (d.minInvm * _emscale_for_decision)*(d.minInvm * _emscale_for_decision), bitid)        # noqa: F821
-                alg.addvariable('MaxMSqr', (d.maxInvm * _emscale_for_decision)*(d.maxInvm * _emscale_for_decision), bitid)        # noqa: F821
-
-            tm.registerAlgo(alg)
-            
-            
-        # VBF deta    
-
-        algoList = [
-            {"minDeta": 0,  "maxDeta": 20, "otype" : "J",  "ocut1" : 50,  "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortJET, "ocut2" : 0, "nleading2": 2}, #0DETA20-J50s1-Js2
-        ]
-        for x in algoList:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            toponame = "%iDETA%i-%s%s%s%s-%s%s%s%s"  % (d.minDeta, d.maxDeta,  # noqa: F821
-                                                        d.otype, str(d.ocut1) if d.ocut1 > 0 else "", d.olist, str(d.nleading1) if d.olist=="s" else "", # noqa: F821
-                                                        d.otype, str(d.ocut2) if d.ocut2 > 0 else "", d.olist, str(d.nleading2) if d.olist=="s" else "") # noqa: F821
-            log.info("Define %s" % toponame)
-            inputList = d.otype + d.olist # noqa: F821
-            alg = AlgConf.DeltaEtaIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-            log.info("Current algo ID %i" % currentAlgoId )
-            alg.addgeneric('InputWidth', d.inputwidth1)  # noqa: F821
-            alg.addgeneric('MaxTob', d.nleading2)        # noqa: F821
-            alg.addgeneric('NumResultBits', 1)                        
-            alg.addvariable('MinET1', str(d.ocut1), 0)   # noqa: F821
-            alg.addvariable('MinET2', str(d.ocut2), 0)   # noqa: F821
-            alg.addvariable('MinDeltaEta', d.minDeta, 0) # noqa: F821
-            alg.addvariable('MaxDeltaEta', d.maxDeta, 0) # noqa: F821
-            tm.registerAlgo(alg)
-
-
-        # ZH Trigger
-        supportedalgolist = [
-            {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 30 }, #10MINDPHI-J20s2-XE30
-            {"minDPhi": 10, "otype" : "J", "ocut" : 20, "olist" : "s", "nleading" : 2, "inputwidth": HW.OutputWidthSortJET, "ocut2": 50 }, #10MINDPHI-J20s2-XE50
-        ] 
-        for x in supportedalgolist:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            toponame = "%iMINDPHI-%s%s%s%s-XE%i"  % (d.minDPhi, d.otype, str(d.ocut) if d.ocut > 0 else "", d.olist, str(d.nleading) if d.olist=="s" else "",d.ocut2) # noqa: F821
-            log.info("Define %s" % toponame)
-            inputList = d.otype + d.olist # noqa: F821
-            alg = AlgConf.MinDeltaPhiIncl2( name = toponame, inputs = [inputList, 'XE'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
-            log.info("Current algo ID %i" % currentAlgoId )
-            alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821
-            alg.addgeneric('InputWidth2', 1)  
-            alg.addgeneric('MaxTob1', d.nleading)       # noqa: F821
-            alg.addgeneric('MaxTob2', 1)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut)           # noqa: F821
-            alg.addvariable('MinET2', d.ocut2)          # noqa: F821
-            alg.addvariable('DeltaPhiMin', d.minDPhi, 0)# noqa: F821
-            tm.registerAlgo(alg)
-
-            
-        # LFV DETA ATR-14282 
-        algoList = [
-            {"minDeta": 0, "maxDeta": "04", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DETA04-EM8abi-MU10ab
-            {"minDeta": 0, "maxDeta": "04", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DETA04-EM15abi-MUab
-        ]
-        for x in algoList:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            toponame = "%sDETA%s-%s%s%s-%s%s%s"  % (d.minDeta, d.maxDeta, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2) # noqa: F821
-            log.info("Define %s at %i", toponame, currentAlgoId)
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
-            alg = AlgConf.DeltaEtaIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('NumResultBits', 1)
-            alg.addgeneric('InputWidth1', d.nleading1)   # noqa: F821
-            alg.addgeneric('InputWidth2', d.nleading2)   # noqa: F821
-            alg.addgeneric('MaxTob1', d.nleading1)       # noqa: F821
-            alg.addgeneric('MaxTob2', d.nleading2)       # noqa: F821
-            alg.addvariable('MinET1', d.ocut1, 0)        # noqa: F821
-            alg.addvariable('MinET2', d.ocut2, 0)        # noqa: F821
-            alg.addvariable('MinDeltaEta', d.minDeta, 0) # noqa: F821
-            alg.addvariable('MaxDeltaEta', d.maxDeta, 0) # noqa: F821
-            tm.registerAlgo(alg)
-
-  
-        #EMU dphi
-        algoList = [
-            {"minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 8, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 10, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DPHI03-EM8abi-MU10ab
-            {"minDphi": 0, "maxDphi": "03", "mult": 1, "otype1" : "EM", "ocut1": 15, "olist1" : "abi", "nleading1": HW.OutputWidthSelectEM, "otype2" : "MU", "ocut2": 0, "olist2": "ab", "nleading2": HW.OutputWidthSelectMU}, #0DPHI03-EM15abi-MUab
-        ]
-        for x in algoList:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            toponame = "%sDPHI%s-%s%s%s-%s%s%s"  % (d.minDphi, d.maxDphi, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2) if d.ocut2>0 else "", d.olist2) # noqa: F821
-            log.info("Define %s" % toponame)
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
-            alg = AlgConf.DeltaPhiIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('NumResultBits', 1)
-            alg.addgeneric('InputWidth1', d.nleading1)   # noqa: F821
-            alg.addgeneric('InputWidth2', d.nleading2)   # noqa: F821
-            alg.addgeneric('MaxTob1', d.nleading1)       # noqa: F821
-            alg.addgeneric('MaxTob2', d.nleading2)       # noqa: F821
-            alg.addvariable('MinET1', d.ocut1, 0)        # noqa: F821
-            alg.addvariable('MinET2', d.ocut2, 0)        # noqa: F821
-            alg.addvariable('MinDeltaPhi', d.minDphi, 0) # noqa: F821
-            alg.addvariable('MaxDeltaPhi', d.maxDphi, 0) # noqa: F821
-            tm.registerAlgo(alg)
-            
-  
-        # RATIO MATCH dedicated to Exotic 
-        toponame = '100RATIO-0MATCH-TAU30si2-EMall'
-        alg = AlgConf.RatioMatch( name = toponame, inputs = [ 'TAUsi', 'EMall'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth1', HW.OutputWidthSortTAU)
-        alg.addgeneric('InputWidth2', HW.InputWidthEM)      
-        alg.addgeneric('MaxTob1', 2)
-        alg.addgeneric('MaxTob2', HW.InputWidthEM)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinET1', 30)
-        alg.addvariable('MinET2',  0)
-        alg.addvariable('Ratio', 100, 0)
-        tm.registerAlgo(alg)        
-
-        # NOT MATCH dedicated to Exotic
-        toponame = 'NOT-0MATCH-TAU30si1-EMall'
-        alg = AlgConf.NotMatch( name = toponame, inputs = [ 'TAUsi', 'EMall'], outputs = [ toponame ], algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth1', HW.OutputWidthSortTAU)
-        alg.addgeneric('InputWidth2', HW.InputWidthEM)
-        alg.addgeneric('MaxTob1', 1)
-        alg.addgeneric('MaxTob2', HW.InputWidthEM)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinET1', 30)
-        alg.addvariable('MinET2', 0)
-        alg.addvariable('EtaMin1', 0)
-        alg.addvariable('EtaMax1', 49)
-        alg.addvariable('EtaMin2', 0)
-        alg.addvariable('EtaMax2', 49)
-        alg.addvariable('DRCut', 0)
-        tm.registerAlgo(alg)        
-
-        # MULT-BIT
-        for x in [
-            {"otype1" : "CMU" ,"ocut1": 4, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU}, #MULT-CMU4ab
-            {"otype1" : "CMU" ,"ocut1": 6, "olist1" : "ab", "nleading1": HW.OutputWidthSelectMU, "inputwidth1": HW.OutputWidthSelectMU}, #MULT-CMU6ab
-            ]:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-
-            
-                  
-            toponame = "MULT-%s%s%s" % (d.otype1, str(d.ocut1), d.olist1) # noqa: F821
-            toponames = [toponame+"[0]", toponame+"[1]"]
-            log.info("Define %s" % toponames)
-            
-            inputList = [d.otype1 + d.olist1]  # noqa: F821
-            alg = AlgConf.Multiplicity( name = toponame,  inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1
-            
-            alg.addgeneric('InputWidth', d.inputwidth1) # noqa: F821
-            alg.addgeneric('NumResultBits', 2)
-            alg.addvariable('MinET', d.ocut1-1) # for MU threshold -1   # noqa: F821
-            tm.registerAlgo(alg)        
-
-
-        # DISAMB 2 lists
-        algolist=[
-            {"disamb": 2, "otype1" : "TAU", "ocut1": 12, "olist1" : "abi", "nleading1": HW.OutputWidthSelectTAU, "otype2" : "J", "ocut2": 25, "olist2": "ab", "nleading2": HW.OutputWidthSelectJET}, #2DISAMB-TAU12abi-J25ab
-        ]            
-        for x in algolist :
-
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-
-     
- 
-            obj1 = "%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1) # noqa: F821
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2) # noqa: F821
-            toponame = "%sDISAMB-%s%s"  % ( d.disamb if d.disamb>0 else "", obj1, obj2) # noqa: F821
-            
-            log.info("Define %s" % toponame)
-            
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
-            alg = AlgConf.DisambiguationIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', d.nleading1 if d.olist1.find("ab")>=0 else -1000) # noqa: F821
-            alg.addgeneric('InputWidth2', d.nleading2 if d.olist2.find("ab")>=0 else -1000)  # noqa: F821
-            alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821
-            alg.addgeneric('MaxTob2', d.nleading2) # noqa: F821
-            alg.addgeneric('NumResultBits', 1)
-            alg.addgeneric('ClusterOnly', 1 if (d.otype1=="EM" and d.otype2=="TAU") or (d.otype1=="TAU" and d.otype2=="EM") else 0 ) # noqa: F821
-            alg.addgeneric('ApplyDR', 0)
-            alg.addvariable('MinET1', d.ocut1) # noqa: F821
-            alg.addvariable('MinET2', d.ocut2) # noqa: F821
-            alg.addvariable('DisambDRSqrMin', d.disamb*d.disamb) # noqa: F821
-            tm.registerAlgo(alg)
-        
-
-        # DISAMB 3 lists with DR cut to 2nd and 3rd lists
-        algolist=[
-            { "disamb": 2, "otype1" : "EM",  "ocut1": 15, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12,
-              "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab",
-              "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, #2DISAMB-J25ab-0DR28-EM15his2-TAU12abi
-            { "disamb": 2, "otype1" : "TAU",  "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,
-              "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J", "ocut3": 25, "olist3": "ab", 
-              "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 28}, # 2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi
-            { "disamb": 2, "otype1" : "TAU",  "ocut1": 20, "olist1": "abi","nleading1": HW.OutputWidthSelectTAU, "inputwidth1": HW.OutputWidthSelectTAU,
-              "otype2" : "TAU", "ocut2": 12, "olist2": "abi", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU, "otype3" : "J",
-              "ocut3": 25, "olist3": "ab", "nleading3": HW.OutputWidthSelectJET, "inputwidth3": HW.OutputWidthSelectJET, "drcutmin": 0, "drcutmax": 25 }, # 2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi
-        ]
-        for x in algolist:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            obj1 = "-%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else ""))  # noqa: F821
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2.replace('shi','his') + (str(d.nleading2) if d.olist2.find('s')>=0 else "")) # noqa: F821
-            obj3 = "%s%s%s" % (d.otype3, str(d.ocut3), d.olist3) # noqa: F821
-            toponame = "%sDISAMB-%s-%dDR%d%s%s"  % ( str(d.disamb) if d.disamb>0 else "", obj3, d.drcutmin, d.drcutmax, obj1, obj2)  # noqa: F821
-            log.info("Define %s" % toponame)
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2, d.otype3 + d.olist3]  # noqa: F821
-            alg = AlgConf.DisambiguationDRIncl3( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821
-            alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821
-            alg.addgeneric('InputWidth3', d.inputwidth3) # noqa: F821
-            alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821
-            alg.addgeneric('MaxTob2', d.nleading2) # noqa: F821
-            alg.addgeneric('MaxTob3', d.nleading3) # noqa: F821
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut1, 0) # noqa: F821
-            alg.addvariable('MinET2', d.ocut2, 0) # noqa: F821
-            alg.addvariable('MinET3', d.ocut3, 0) # noqa: F821
-            alg.addvariable('DisambDRSqrMin', d.drcutmin*d.drcutmin, 0) # noqa: F821
-            alg.addvariable('DisambDRSqrMax', d.drcutmax*d.drcutmax, 0) # noqa: F821
-            alg.addvariable('DisambDRSqr', d.disamb*d.disamb, 0) # noqa: F821
-            tm.registerAlgo(alg)            
-
-
-        # KF-XE-AJall
-        xemap = [{"etcut": 0, "Threlist": [ 40, 50, 55, 60, 65, 75 ]}]
-        for x in xemap:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            log.info("Define %s" % toponame)
-            inputList = ['XENoSort', 'AJall']
-            toponames=[]
-            for minxe in d.Threlist:  # noqa: F821
-                toponames.append("KF-XE%s-AJall"  % (minxe))
-            alg = AlgConf.KalmanMETCorrection( name = "KF-XE-AJall", inputs = inputList, outputs = toponames, algoId = currentAlgoId ); currentAlgoId += 1
-            alg.addgeneric('InputWidth', HW.InputWidthJET)
-            alg.addgeneric('NumResultBits', len(toponames))
-            alg.addvariable('MinET', 0)
-            for bitid,minxe in enumerate(d.Threlist):  # noqa: F821
-                alg.addvariable('KFXE', str(minxe), bitid)
-            tm.registerAlgo(alg)
-
-
-        # LATE MUON : LATE-MU10s1
-        for x in [     
-             {"otype" : "LATE-MU", "ocut" : 10, "inputwidth": HW.NumberOfDelayedMuons},
-            ]:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            toponame = "%s%ss1"  % ( d.otype, str(d.ocut) ) # noqa: F821
-            log.info("Define %s" % toponame)
-            inputList = 'LMUs'
-            alg = AlgConf.EtCut( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-            alg.addgeneric('InputWidth', d.inputwidth)  # noqa: F821
-            alg.addgeneric('MaxTob', 1)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET', str(d.ocut)) # noqa: F821
-            tm.registerAlgo(alg)
-            
-
-        # (ATR-12748) fat jet trigger with Simple Cone algo
-        algoList = [
-            {"minHT": 111, "otype" : "CJ", "ocut" : 15, "olist" : "ab", "nleading" : HW.OutputWidthSelectJET, "inputwidth": HW.OutputWidthSelectJET, "oeta" : 26}, #SC111-CJ15ab.ETA26
-        ]
-        for x in algoList:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            toponame = "SC%d-%s%s%s%spETA%s" % (d.minHT, d.otype, str(d.ocut), d.olist, str(d.nleading) if d.olist=="s" else "", str(d.oeta)) # noqa: F821
-            log.info("Define %s" % toponame)
-            inputList = d.otype + d.olist # noqa: F821
-            alg = AlgConf.SimpleCone( name = toponame, inputs = inputList, outputs = [toponame], algoId = currentAlgoId ); currentAlgoId += 1
-            alg.addgeneric('InputWidth', d.inputwidth) # noqa: F821
-            alg.addvariable('MinET', d.ocut)           # noqa: F821       
-            alg.addvariable('MinSumET', d.minHT)       # noqa: F821
-            alg.addvariable('MaxRSqr', 10*10)                        
-            tm.registerAlgo(alg)  
-
-
-        # DISAMB-INVM
-        for x in [
-                {"disamb": 0, "minInvm": 30, "maxInvm": 9999,"otype1" : "EM",  "ocut1": 20, "olist1": "shi","nleading1": 2, "inputwidth1": HW.OutputWidthSortEM, "otype2" : "TAU", "ocut2": 12, "olist2": "ab", "nleading2": HW.OutputWidthSelectTAU, "inputwidth2": HW.OutputWidthSelectTAU}, # DISAMB-30INVM-EM20his2-TAU12ab
-        ]:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            obj1 = "%s%s%s"  % (d.otype1, str(d.ocut1), d.olist1.replace('shi','his') + (str(d.nleading1) if d.olist1.find('s')>=0 else "")) # noqa: F821
-            obj2 = "-%s%s%s" % (d.otype2, str(d.ocut2), d.olist2) # noqa: F821
-            toponame = "%sDISAMB-%iINVM%s-%s%s"  % ( d.disamb if d.disamb>0 else "", d.minInvm, str(d.maxInvm) if d.maxInvm<9999 else "", obj1, obj2)       # noqa: F821    
-            log.info("Define %s" % toponame)
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2]      # noqa: F821         
-            #alg = AlgConf.DisambiguationInvariantMass2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1
-            alg = AlgConf.DisambiguationInvmIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821
-            alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821
-            alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821
-            alg.addgeneric('MaxTob2', d.nleading2) # noqa: F821
-            alg.addgeneric('NumResultBits', 1)            
-            alg.addvariable('MinET1', d.ocut1) # noqa: F821
-            alg.addvariable('MinET2', d.ocut2) # noqa: F821
-            alg.addvariable('MinMSqr', d.minInvm * d.minInvm) # noqa: F821
-            alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm) # noqa: F821        
-            tm.registerAlgo(alg)
-
-
-        #
-        for x in [
-            {  "minInvm": 400, "maxInvm": 9999, "otype1" : "AJ", "ocut1": 30, "olist1" : "s", "nleading1" : 6, "inputwidth1": HW.OutputWidthSortJET, "otype2" : "AJ", "ocut2": 20, "olist2" : "s", "nleading2" : 6, "inputwidth2": HW.OutputWidthSortJET, "applyEtaCut":1, "minEta1": 0 ,"maxEta1": 31 , "minEta2": 31 ,"maxEta2": 49 , }, #400INVM9999-AJ30s6.ETA31-AJ20s6.31ETA49
-        ]:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            obj1 =  "%s%s%sp%sETA%i"  % (d.otype1, str(d.ocut1), d.olist1 + (str(d.nleading1) if d.olist1.find('s')>=0 else ""),str(d.minEta1) if d.minEta1>0 else "", d.maxEta1) # noqa: F821
-            obj2 = "-%s%s%sp%sETA%i"  % (d.otype2, str(d.ocut2), d.olist2 + (str(d.nleading2) if d.olist2.find('s')>=0 else ""),str(d.minEta2) if d.minEta2>0 else "", d.maxEta2) # noqa: F821
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
-            toponame = "%iINVM%i-%s%s"   % (d.minInvm, d.maxInvm, obj1, obj2) # noqa: F821
-            alg = AlgConf.InvariantMassInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1    
-            alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821
-            alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821
-            alg.addgeneric('MaxTob1', d.nleading1) # noqa: F821
-            alg.addgeneric('MaxTob2', d.nleading2) # noqa: F821
-            alg.addgeneric('NumResultBits', 1)
-            if (d.applyEtaCut>0): # noqa: F821
-                alg.addgeneric('ApplyEtaCut', d.applyEtaCut) # noqa: F821            
-            alg.addvariable('MinET1', d.ocut1) # noqa: F821
-            alg.addvariable('MinET2', d.ocut2) # noqa: F821
-            alg.addvariable('MinMSqr', d.minInvm * d.minInvm ) # noqa: F821
-            alg.addvariable('MaxMSqr', d.maxInvm * d.maxInvm ) # noqa: F821
-            if (d.applyEtaCut>0): # noqa: F821
-                alg.addvariable('MinEta1', d.minEta1) # noqa: F821
-                alg.addvariable('MaxEta1', d.maxEta1) # noqa: F821
-                alg.addvariable('MinEta2', d.minEta2) # noqa: F821
-                alg.addvariable('MaxEta2', d.maxEta2) # noqa: F821            
-            tm.registerAlgo(alg)
-
-
-        #  0INVM9-EM7ab-EMab 
-        for x in [
-            {"minInvm" : 0, "maxInvm": 9, "otype" : "EM", "ocut1" : 7, "olist" : "ab", "inputwidth": HW.OutputWidthSelectEM, "ocut2" : 0},
-            ]:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            inputList = d.otype + d.olist # noqa: F821
-            toponame = "%iINVM%i-%s%s%s-%s%s"  % (d.minInvm, d.maxInvm,                                                    # noqa: F821
-                                                  d.otype, str(d.ocut1) , d.olist,     # noqa: F821
-                                                  d.otype, d.olist)     # noqa: F821 
-            alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId); currentAlgoId += 1  # noqa: F821
-            alg.addgeneric('InputWidth', d.inputwidth)      # noqa: F821
-            alg.addgeneric('MaxTob', HW.OutputWidthSelectEM)            # noqa: F821
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut1)    # noqa: F821
-            alg.addvariable('MinET2', d.ocut2)    # noqa: F821
-            alg.addvariable('MinMSqr', (d.minInvm * _emscale_for_decision)*(d.minInvm * _emscale_for_decision))        # noqa: F821
-            alg.addvariable('MaxMSqr', (d.maxInvm * _emscale_for_decision)*(d.maxInvm * _emscale_for_decision))        # noqa: F821
-            tm.registerAlgo(alg)
-
-
-
-
-        # added for b-phys, 0DR03-EM7ab-CJ15ab
-        for x in [  
-            {"minDr": 0, "maxDr": 3, "otype1" : "EM" ,"ocut1": 7,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"} 
-            ]:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            toponame = "%iDR%02d-%s%s%s-%s%s%s"  % (d.minDr, d.maxDr, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2), d.olist2) # noqa: F821
-            log.info("Define %s" % toponame)
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
-            alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM)
-            alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET)
-            alg.addgeneric('MaxTob1', HW.OutputWidthSelectEM)
-            alg.addgeneric('MaxTob2', HW.OutputWidthSelectJET)
-            alg.addgeneric('NumResultBits', 1)                        
-            alg.addvariable('MinET1', d.ocut1, 0) # noqa: F821
-            alg.addvariable('MinET2', d.ocut2, 0) # noqa: F821
-            alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0) # noqa: F821
-            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0) # noqa: F821
-            tm.registerAlgo(alg)
-
-
-        # VBF items INVM_NFF
-        invm_nff_map = { "algoname": 'INVM_NFF', "Threlist": [ 500 ], "maxInvm": 9999, "otype1" : "J", "ocut1" : 30, "olist1" : "s", "nleading1" : 6,
-                         "inputwidth": HW.OutputWidthSortJET,  "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 }
-        for x in [ invm_nff_map ]:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist1]      # noqa: F821       
-            toponames=[]
-            for minInvm in d.Threlist:  # noqa: F821
-                toponame = "%iINVM%i-%s%s%s%s-%s%s%s%s"  % (minInvm, d.maxInvm,                          
-                                                            d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "",
-                                                            d.otype2, str(d.ocut2) , d.olist2, str(d.nleading2) if d.olist2=="s" else "") 
-                toponames.append(toponame)
-            alg = AlgConf.InvariantMassInclusive2( name = d.algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1     # noqa: F821
-            alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821
-            alg.addgeneric('InputWidth2', d.inputwidth) # noqa: F821
-            alg.addgeneric('MaxTob1', d.nleading1)       # noqa: F821
-            alg.addgeneric('MaxTob2', d.nleading2)# noqa: F821
-            alg.addgeneric('NumResultBits', len(toponames))
-            for bitid, minInvm in enumerate(d.Threlist): # noqa: F821
-                alg.addvariable('MinET1', d.ocut1, bitid)# noqa: F821
-                alg.addvariable('MinET2', d.ocut2, bitid)# noqa: F821
-                alg.addvariable('MinMSqr', minInvm*minInvm , bitid)        # noqa: F821         
-                alg.addvariable('MaxMSqr', d.maxInvm *d.maxInvm , bitid)        # noqa: F821
-            tm.registerAlgo(alg)        
-
-
-        # Axion 2EM DPHI  
-        #27DPHI32-EMs1-EMs6
-        algoList = [
-            {"minDphi": 27,  "maxDphi": 32, "otype" : "EM",  "ocut1" : 0,  "olist" : "s", "nleading1" : 1, "inputwidth1": HW.OutputWidthSortEM, "ocut2" : 0, "nleading2": 6},
-        ]
-        for x in algoList:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            toponame = "%iDPHI%i-%s%s%s%s-%s%s%s%s"  % (d.minDphi, d.maxDphi,  # noqa: F821
-                                                        d.otype, str(d.ocut1) if d.ocut1 > 0 else "", d.olist, 
-                                                        str(d.nleading1) if d.olist=="s" else "", # noqa: F821
-                                                        d.otype, str(d.ocut2) if d.ocut2 > 0 else "", d.olist, 
-                                                        str(d.nleading2) if d.olist=="s" else "") # noqa: F821
-            log.info("Define %s" % toponame)
-            inputList = d.otype + d.olist # noqa: F821
-            alg = AlgConf.DeltaPhiIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-            alg.addgeneric('InputWidth', d.inputwidth1) # noqa: F821
-            alg.addgeneric('MaxTob', d.nleading2)       # noqa: F821 
-            alg.addgeneric('NumResultBits', 1)                        
-            alg.addvariable('MinET1', d.ocut1 if d.ocut1 > 0 else 3, 0) # noqa: F821   
-            alg.addvariable('MinET2', d.ocut2 if d.ocut2 > 0 else 3, 0) # noqa: F821  
-            alg.addvariable('MinDeltaPhi', d.minDphi, 0) # noqa: F821
-            alg.addvariable('MaxDeltaPhi', d.maxDphi, 0) # noqa: F821
-            tm.registerAlgo(alg)
-
-
-        # VBF items INVM_DPHI_NFF
-        NFFDphimap = [{ "minInvm": 400 , "maxInvm": 9999, "minDphi": 0, "maxDphiList": [26, 24, 22, 20], "otype1" : "J", "ocut1" : 30, "olist1" : "s",
-                        "nleading1" : 6, "inputwidth": HW.OutputWidthSortJET,  "otype2" : "AJ", "ocut2" : 20, "olist2" : "s", "nleading2" : 6 }]
-        for x in NFFDphimap:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist1]      # noqa: F821       
-            toponames=[]
-            for maxDphi in d.maxDphiList:  # noqa: F821
-                toponames.append ("%iINVM%i-%iDPHI%i-%s%s%s%s-%s%s%s%s"  % (d.minInvm, d.maxInvm, d.minDphi, maxDphi,
-                                                                 d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "", 
-                                                                 d.otype2, str(d.ocut2) , d.olist2, str(d.nleading2) if d.olist2=="s" else ""))
-            alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = 'INVM_DPHI_NFF', inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1     # noqa: F821
-            alg.addgeneric('InputWidth1', d.inputwidth) # noqa: F821
-            alg.addgeneric('InputWidth2', d.inputwidth) # noqa: F821
-            alg.addgeneric('MaxTob1', d.nleading1)       # noqa: F821
-            alg.addgeneric('MaxTob2', d.nleading2)# noqa: F821
-            alg.addgeneric('NumResultBits',  len(toponames))
-            for bitid,maxDphi in enumerate(d.maxDphiList):  # noqa: F821
-                alg.addvariable('MinET1', d.ocut1, bitid)# noqa: F821
-                alg.addvariable('MinET2', d.ocut2, bitid)# noqa: F821
-                alg.addvariable('MinMSqr', d.minInvm*d.minInvm , bitid)        # noqa: F821         
-                alg.addvariable('MaxMSqr', d.maxInvm*d.maxInvm , bitid)        # noqa: F821
-                alg.addvariable('MinDeltaPhi', d.minDphi, bitid) # noqa: F821
-                alg.addvariable('MaxDeltaPhi', maxDphi, bitid) # noqa: F821
-            tm.registerAlgo(alg)
-
-
-        #ATR-19355  
-        toponame = "0INVM10-3MU4ab"      # noqa: F821
-        log.info("Define %s" % toponame)    
-        inputList = 'MUab'        
-        alg = AlgConf.InvariantMassThreeTOBsIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinMSqr', 0)
-        alg.addvariable('MaxMSqr', 10*10)
-        alg.addvariable('MinET1', 4)
-        tm.registerAlgo(alg)
-
-
-        # added for muon-jet:
-        algoList = [
-            {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 4,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 15, "olist2" : "ab"}, #0DR04-MU4ab-CJ15ab
-            {"minDr": 0, "maxDr": 4, "otype1" : "MU" ,"ocut1": 6,  "olist1" : "ab", "otype2" : "CJ", "ocut2": 20, "olist2" : "ab"}, #0DR04-MU6ab-CJ20ab
-        ]
-        for x in algoList:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            toponame = "%iDR%02d-%s%s%s-%s%s%s"  % (d.minDr, d.maxDr, d.otype1, str(d.ocut1), d.olist1, d.otype2, str(d.ocut2), d.olist2) # noqa: F821
-            log.info("Define %s" % toponame)
-            inputList = [d.otype1 + d.olist1, d.otype2 + d.olist2] # noqa: F821
-            alg = AlgConf.DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = [ toponame ], algoId = currentAlgoId); currentAlgoId += 1
-            log.info("Current algo ID %i" % currentAlgoId )
-            alg.addgeneric('InputWidth1', HW.OutputWidthSelectMU)
-            alg.addgeneric('InputWidth2', HW.OutputWidthSelectJET)
-            alg.addgeneric('MaxTob1', HW.OutputWidthSelectMU)
-            alg.addgeneric('MaxTob2', HW.OutputWidthSelectJET)
-            alg.addgeneric('NumResultBits', 1)
-            alg.addvariable('MinET1', d.ocut1, 0) # noqa: F821
-            alg.addvariable('MinET2', d.ocut2, 0) # noqa: F821
-            alg.addvariable('DeltaRMin', d.minDr*d.minDr, 0) # noqa: F821
-            alg.addvariable('DeltaRMax', d.maxDr*d.maxDr, 0) # noqa: F821
-            tm.registerAlgo(alg)
-            
-            
-
-
-        #ATR-18815
- #       toponame = "0INVM10-0DR15-EM8abi-MU10ab"
- #       log.info("Define %s" % toponame)
-        
-#        inputList = ['EMabi','MUab']
-        
-#        alg = AlgConf.InvariantMassInclusive2DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-#        alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM)
-#        alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU)
-#        alg.addgeneric('MaxTob1', HW.OutputWidthSortEM)
-#        alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
-#        alg.addgeneric('NumResultBits', 1)
-#        alg.addvariable('MinMSqr', 0)
-#        alg.addvariable('MaxMSqr', 10*10*_emscale_for_decision) # Fix to add emscale
-#        alg.addvariable('MinET1', 8)
-#        alg.addvariable('MinET2', 10)
-#        alg.addgeneric('ApplyEtaCut', 0)
-#        alg.addvariable('MinEta1', 0)
-#        alg.addvariable('MinEta2', 0)
-#        alg.addvariable('MaxEta1', 9999)
-#        alg.addvariable('MaxEta2', 9999)
-#        alg.addvariable('DeltaRMin', 0)
-#        alg.addvariable('DeltaRMax', 15*15)
-#        tm.registerAlgo(alg)
-#        
-#        #ATR-18815
-#        toponame = "0INVM10-0DR15-EM12abi-MU6ab"
-#        log.info("Define %s" % toponame)
-#        
-#        inputList = ['EMabi','MUab']
-#        
-#        alg = AlgConf.InvariantMassInclusive2DeltaRSqrIncl2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-#        alg.addgeneric('InputWidth1', HW.OutputWidthSelectEM)
-#        alg.addgeneric('InputWidth2', HW.OutputWidthSelectMU)
-#        alg.addgeneric('MaxTob1', HW.OutputWidthSortEM)
-#        alg.addgeneric('MaxTob2', HW.OutputWidthSelectMU)
-#        alg.addgeneric('NumResultBits', 1)
-#        alg.addvariable('MinMSqr', 0)
-#        alg.addvariable('MaxMSqr', 10*10*_emscale_for_decision) # Fix to add emscale
-#        alg.addvariable('MinET1', 12)
-#        alg.addvariable('MinET2', 6)
-#        alg.addgeneric('ApplyEtaCut', 0)
-#        alg.addvariable('MinEta1', 0)
-#        alg.addvariable('MinEta2', 0)
-#        alg.addvariable('MaxEta1', 9999)
-#        alg.addvariable('MaxEta2', 9999)
-#        alg.addvariable('DeltaRMin', 0)
-#        alg.addvariable('DeltaRMax', 15*15)
-#        tm.registerAlgo(alg)
-#        
-
-
-        #ATR-18824 ZAFB-DPHI
-        
-        ZAFBDphimap = [
-            {"minInvm": 60 ,"maxInvm": 9999, "minDphiList": [4, 25], "maxDphi": 32, "minEta2": 23, "maxEta2": 49, "inputwidth1": HW.OutputWidthSortEM, "otype1" : "EM", "ocut1" : 15, "olist1" : "abhi", "nleading1" : HW.OutputWidthSortEM, "inputwidth2": HW.OutputWidthSortJET,  "ocut2" : 15,"nleading2" : 6}
-        ]
-        for x in ZAFBDphimap:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            inputList = [d.otype1 + d.olist1, 'FJjs23ETA49']      # noqa: F821       
-            toponames=[]
-            for minDphi in d.minDphiList:  # noqa: F821
-                toponames.append ("%iINVM%i-%02dDPHI%i-%s%s%s%s-FJj%ss%s%iETA%i"  % (d.minInvm, d.maxInvm, minDphi, d.maxDphi, d.otype1, str(d.ocut1) , d.olist1, str(d.nleading1) if d.olist1=="s" else "",  str(d.ocut2) , str(d.nleading2) , d.minEta2, d.maxEta2))  
-            alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = 'ZAFB_DPHI', inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1     # noqa: F821
-            alg.addgeneric('InputWidth1', d.inputwidth1) # noqa: F821
-            alg.addgeneric('InputWidth2', d.inputwidth2) # noqa: F821
-            alg.addgeneric('MaxTob1', d.nleading1)       # noqa: F821
-            alg.addgeneric('MaxTob2', d.nleading2)# noqa: F821
-            alg.addgeneric('NumResultBits',  len(toponames))
-            alg.addgeneric('ApplyEtaCut', 1)
-            alg.addvariable('MinEta1', 0)
-            alg.addvariable('MaxEta1', 9999)
-            alg.addvariable('MinEta2', 23)
-            alg.addvariable('MaxEta2', 49)
-            for bitid,minDphi in enumerate(d.minDphiList):  # noqa: F821
-                alg.addvariable('MinET1', d.ocut1, bitid)# noqa: F821
-                alg.addvariable('MinET2', d.ocut2, bitid)# noqa: F821
-                alg.addvariable('MinMSqr', d.minInvm*d.minInvm*_emscale_for_decision , bitid)        # noqa: F821 #ATR-18824 only one factor is needed as there is one EM object         
-                alg.addvariable('MaxMSqr', d.maxInvm*d.maxInvm*_emscale_for_decision , bitid)        # noqa: F821 #ATR-18824 only one factor is needed as there is one EM object
-                alg.addvariable('MinDeltaPhi', minDphi, bitid) # noqa: F821
-                alg.addvariable('MaxDeltaPhi', d.maxDphi, bitid) # noqa: F821
-            tm.registerAlgo(alg)
-
-
-        #ATR-19302: not included for now
-        toponame = "0INVM70-27DPHI32-EM10his1-EM10his6"
-        log.info("Define %s" % toponame)
-        inputList = ['EMshi','EMshi']
-        alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth1', HW.OutputWidthSortEM)
-        alg.addgeneric('InputWidth2', HW.OutputWidthSortEM)
-        alg.addgeneric('MaxTob1', 1)
-        alg.addgeneric('MaxTob2', 6)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinMSqr', 0)
-        alg.addvariable('MaxMSqr', (70*_emscale_for_decision)*(70*_emscale_for_decision))
-        alg.addvariable('MinET1', 10)
-        alg.addvariable('MinET2', 10)
-        alg.addgeneric('ApplyEtaCut', 1)
-        alg.addvariable('MinEta1', 0)
-        alg.addvariable('MaxEta1', 9999)
-        alg.addvariable('MinEta2', 0)
-        alg.addvariable('MaxEta2', 9999)
-        alg.addvariable('MinDeltaPhi', 27)
-        alg.addvariable('MaxDeltaPhi', 32)
-        tm.registerAlgo(alg)
-
-        
-        toponame = "0INVM70-27DPHI32-EM12his1-EM12his6"
-        log.info("Define %s" % toponame)
-        inputList = ['EMshi','EMshi']
-        alg = AlgConf.InvariantMassDeltaPhiInclusive2( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth1', HW.OutputWidthSortEM)
-        alg.addgeneric('InputWidth2', HW.OutputWidthSortEM)
-        alg.addgeneric('MaxTob1', 1)
-        alg.addgeneric('MaxTob2', 6)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinMSqr', 0)
-        alg.addvariable('MaxMSqr', (70*_emscale_for_decision)*(70*_emscale_for_decision))
-        alg.addvariable('MinET1', 10)
-        alg.addvariable('MinET2', 12)
-        alg.addgeneric('ApplyEtaCut', 1)
-        alg.addvariable('MinEta1', 0)
-        alg.addvariable('MaxEta1', 9999)
-        alg.addvariable('MinEta2', 0)
-        alg.addvariable('MaxEta2', 9999)
-        alg.addvariable('MinDeltaPhi', 27)
-        alg.addvariable('MaxDeltaPhi', 32)
-        tm.registerAlgo(alg)
-
-
-        #ATR-19720, L1_BPH-8M15-0DR22-2MU6
-#        toponame = "8INVM15-0DR22-2MU6ab"
-#        log.info("Define %s" % toponame)
-#        
-#        inputList = ['MUab']
-#        
-#        alg = AlgConf.InvariantMassInclusive1DeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-#        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-#        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-#        alg.addgeneric('NumResultBits', 1)
-#        alg.addvariable('MinMSqr', 8*8)
-#        alg.addvariable('MaxMSqr', 15*15)
-#        alg.addvariable('MinET1', 6)
-#        alg.addvariable('MinET2', 6)
-#        alg.addvariable('DeltaRMin', 0)
-#        alg.addvariable('DeltaRMax', 22*22)
-#        tm.registerAlgo(alg)
-#        
-#        #ATR-19720, L1_BPH-2M9-2DR15-2MU6
-#        toponame = "2INVM9-2DR15-2MU6ab"
-#        log.info("Define %s" % toponame)
-#    
-#        inputList = ['MUab']
-#    
-#        alg = AlgConf.InvariantMassInclusive1DeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-#        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-#        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-#        alg.addgeneric('NumResultBits', 1)
-#        alg.addvariable('MinMSqr', 2*2)
-#        alg.addvariable('MaxMSqr', 9*9)
-#        alg.addvariable('MinET1', 6)
-#        alg.addvariable('MinET2', 6)
-#        alg.addvariable('DeltaRMin', 2*2)
-#        alg.addvariable('DeltaRMax', 15*15)
-#        tm.registerAlgo(alg)
-#
-#        #ATR-19720, L1_BPH-2M9-0DR15-MU6MU4
-#        toponame = "2INVM9-0DR15-MU6ab-MU4ab"
-#        log.info("Define %s" % toponame)
-#        
-#        inputList = ['MUab']
-#        
-#        alg = AlgConf.InvariantMassInclusive1DeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-#        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-#        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-#        alg.addgeneric('NumResultBits', 1)
-#        alg.addvariable('MinMSqr', 2*2)
-#        alg.addvariable('MaxMSqr', 9*9)
-#        alg.addvariable('MinET1', 6)
-#        alg.addvariable('MinET2', 4)
-#        alg.addvariable('DeltaRMin', 0)
-#        alg.addvariable('DeltaRMax', 15*15)
-#        tm.registerAlgo(alg)
-#        
-#        #ATR-19720, L1_BPH-8M15-0DR22-MU6MU4-BO
-#        toponame = "8INVM15-0DR22-MU6ab-MU4ab"
-#        log.info("Define %s" % toponame)
-#        
-#        inputList = ['MUab']
-#        
-#        alg = AlgConf.InvariantMassInclusive1DeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-#        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-#        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-#        alg.addgeneric('NumResultBits', 1)
-#        alg.addvariable('MinMSqr', 8*8)
-#        alg.addvariable('MaxMSqr', 15*15)
-#        alg.addvariable('MinET1', 6)
-#        alg.addvariable('MinET2', 4)
-#        alg.addvariable('DeltaRMin', 0)
-#        alg.addvariable('DeltaRMax', 22*22)
-#        tm.registerAlgo(alg)
-#
-#        #ATR-19720, L1_BPH-2M9-0DR15-2MU4
-#        
-#        toponame = "2INVM9-0DR15-2MU4ab"
-#        log.info("Define %s" % toponame)
-#   
-#        inputList = ['MUab']
-#
-#        alg = AlgConf.InvariantMassInclusive1DeltaRSqrIncl1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-#        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-#        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-#        alg.addgeneric('NumResultBits', 1)
-#        alg.addvariable('MinMSqr', 2*2)
-#        alg.addvariable('MaxMSqr', 9*9)
-#        alg.addvariable('MinET1', 4)
-#        alg.addvariable('MinET2', 4)
-#        alg.addvariable('DeltaRMin', 0)
-#        alg.addvariable('DeltaRMax', 15*15)
-#        tm.registerAlgo(alg)
-#
-
-
-        currentAlgoId = 47
-
-        #ATR-20174, L1BPH-8M15-2MU4-BO
-        toponame = "8INVM15-2CMU4ab"
-        log.info("Define %s" % toponame)        
-        inputList = ['CMUab']        
-        alg = AlgConf.InvariantMassInclusive1( name = toponame, inputs = inputList, outputs = toponame, algoId = currentAlgoId ); currentAlgoId += 1
-        alg.addgeneric('InputWidth', HW.OutputWidthSelectMU)
-        alg.addgeneric('MaxTob', HW.OutputWidthSelectMU)
-        alg.addgeneric('NumResultBits', 1)
-        alg.addvariable('MinMSqr', 8*8)
-        alg.addvariable('MaxMSqr', 15*15)
-        alg.addvariable('MinET1', 4)
-        alg.addvariable('MinET2', 4)        
-        tm.registerAlgo(alg)
-        
-
-        #CEP algorithms
-        CEPmap = [{"algoname": 'CEP_CJ', "minETlist": [50, 60]}]
-        for x in CEPmap:
-            class d : pass
-            for k in x:
-                setattr (d, k, x[k])
-            inputList = ['CJs']
-            toponames=[]            
-            for minET in d.minETlist:  # noqa: F821
-                toponames.append ("CEP-CJ%is6" % (minET))     # noqa: F821 
-            alg = AlgConf.ExclusiveJets( name = d.algoname, inputs = inputList, outputs = toponames, algoId = currentAlgoId); currentAlgoId += 1 # noqa: F821
-            alg.addgeneric('InputWidth', HW.InputWidthJET) # noqa: F821
-            alg.addgeneric('MaxTob', HW.InputWidthJET)       # noqa: F821
-            alg.addgeneric('NumResultBits',  len(toponames)) # noqa: F821
-            for bitid,minET in enumerate(d.minETlist):  # noqa: F821
-                alg.addvariable('MinET1', minET, bitid)# noqa: F821
-            alg.addvariable('MinXi', 13000.0*0.02, bitid) # noqa: F821
-            alg.addvariable('MaxXi', 13000.0*0.05, bitid) # noqa: F821
-            tm.registerAlgo(alg)
-
-        
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/__init__.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/__init__.py
deleted file mode 100644
index d0cb751d0f33..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/L1TopoMenu/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-#Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/BunchGroupSet.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/BunchGroupSet.py
deleted file mode 100644
index 199f3644cca4..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/BunchGroupSet.py
+++ /dev/null
@@ -1,109 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from .Limits import Limits
-from .Lvl1Flags import Lvl1Flags
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-def setDefaultBunchGroupDefinition(bgs):
-    """
-    sets default bunchgroups for all menus, needed for simulation.
-    """
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-    bgs.bunchGroups = Limits.NumBunchgroups * [None]
-
-    # BGS and BG names
-    bgs.name = TriggerFlags.triggerMenuSetup().partition('_')[0]
-    bunchgroupnames = Lvl1Flags.BunchGroupNames()[:Limits.NumBunchgroups]
-    bunchgroupnames += ['BG_%i' % i for i in range( len(bunchgroupnames), Limits.NumBunchgroups)]
-
-    for i,bgname in enumerate(bunchgroupnames):
-        bgs.addBunchGroup( bgname, i, [] )
-
-    # this bunchgroups need to be filled for MC simulation
-    #    if 'MC_' in TriggerFlags.triggerMenuSetup():
-    bgs.bunchGroups[0].bunches = [1]
-    bgs.bunchGroups[1].bunches = [1]
-    bgs.bunchGroups[7].bunches = [1]
-
-class BunchGroupSet(object):
-
-    class BunchGroup(object):
-        def __init__(self, name='', internalNumber=0, partition=0, bunches=[]):
-            self.name           = name
-            self.internalNumber = internalNumber
-            self.menuPartition  = partition
-            self.bunches        = bunches
-
-        def xml(self, ind=1, step=2):
-            #s  = ind * step * ' ' + '<BunchGroup menuPartition="%i" internalNumber="%i" name="%s"' % (self.menuPartition, self.internalNumber, self.name)
-            s  = ind * step * ' ' + '<BunchGroup internalNumber="%i" name="%s"' % (self.internalNumber, self.name)
-            if not self.bunches:
-                s += '/>\n'
-            else:
-                s += '>\n'
-                for b in self.bunches:
-                    s += (ind+1) * step * ' ' + '<Bunch bunchNumber="%i"/>\n' % b
-                s += ind * step * ' ' + '</BunchGroup>\n'
-            return s
-        
-
-    def __init__(self, name='', menuPartition=0, bunchGroups = None):
-        self.name          = name
-        self.menuPartition = menuPartition
-        self.bunchGroups   = bunchGroups
-
-    def __len__(self):
-        return len(self.bunchGroups)
-
-
-    @classmethod
-    def partitioning(cls):
-        from .Lvl1Flags import Lvl1Flags
-        first = Lvl1Flags.BunchGroupPartitioning()
-        last = first[1:] + [ Limits.NumBunchgroups ]
-        partitioning = dict( zip([1,2,3],zip(first,last)) )
-        return partitioning
-
-    def setDefaultBunchGroupDefinition(self):
-        setDefaultBunchGroupDefinition(self)
-
-
-    def resize(self, newsize):
-        if type(self.bunchGroups) != list:
-            self.bunchGroups = []
-        self.bunchGroups += newsize * [None]
-        self.bunchGroups = self.bunchGroups[:newsize]
-
-
-    def addBunchGroup(self, name, internalNumber, bunches):
-        # check if internalNumber is within limits
-        if internalNumber<0 or internalNumber >= Limits.NumBunchgroups:
-            log.error('Warning: tried to add bunchgroup %i, which is not between 0 and %i', internalNumber, Limits.NumBunchgroups-1)
-            return self
-
-        # check if one already exists with this number
-        if self.bunchGroups[internalNumber] is not None:
-            log.error('Warning: tried to add bunchgroup %i, but one with that number already exists', internalNumber)
-            return self
-
-        partition=0
-        from .Lvl1Flags import Lvl1Flags
-        for lowestBG in Lvl1Flags.BunchGroupPartitioning():
-            if internalNumber >= lowestBG:
-                partition += 1
-
-        self.bunchGroups[internalNumber] = BunchGroupSet.BunchGroup(name, internalNumber, partition, bunches)
-        return self
-
-
-
-    def xml(self, ind=1, step=2):
-        s  = ind * step * ' ' + '<BunchGroupSet name="%s" menuPartition="%i">\n' % (self.name, self.menuPartition)
-        for bg in self.bunchGroups:
-            if bg:
-                s += bg.xml(ind+1,step)
-        s += ind * step * ' ' + '</BunchGroupSet>\n'
-        return s
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/CTPInfo.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/CTPInfo.py
deleted file mode 100644
index 60a718fccbd1..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/CTPInfo.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from .BunchGroupSet import BunchGroupSet
-from .Lvl1MenuUtil import oldStyle
-
-class CTPInfo(object):
-
-    class Random(object):
-        def __init__(self, names, cuts):
-            self.names = names
-            self.cuts  = cuts
-
-        def xml(self, ind=1, step=2):
-            if self.cuts[3] != 1:
-                raise RuntimeError("Random generator 3 has to run at 40MHz, so Random.cut3 must be set to 1")
-            
-            a = []
-            for idx, (name,cut) in enumerate( zip(self.names,self.cuts) ):
-                a += ['name%i="%s" cut%i="%i"' % (idx, name, idx, cut)]
-            return ind * step * ' ' + '<Random %s/>\n' % ' '.join(a)
-
-
-    class PrescaledClock(object):
-        def __init__(self, name = '', clock1 = 0, clock2 = 0):
-            self.name = name
-            self.clock1 = clock1
-            self.clock2 = clock2
-        def xml(self, ind=1, step=2):
-            return ind * step * ' ' + '<PrescaledClock clock1="%i" clock2="%i" name="%s"/>\n' % (self.clock1, self.clock2, self.name)
-
-
-    # Members of CTPInfo
-    def __init__(self):
-        self.random         = CTPInfo.Random( names = ['Random0', 'Random1', 'Random2', 'Random3'], cuts = [1, 1, 1, 1] )
-        self.prescaledClock = CTPInfo.PrescaledClock('psc01', 10, 100)
-        self.bunchGroupSet  = BunchGroupSet()
-
-    def setBunchGroupSetName(self, name):
-        self.bunchGroupSet.name = name
-        return self.bunchGroupSet
-
-    def addBunchGroup(self, name, internalNumber, bunches):
-        self.bunchGroupSet.addBunchGroup(name, internalNumber, bunches)
-
-    def xml(self, ind=1, step=2):
-        s = ''
-        if oldStyle(): # just to make sure the triggertool can still read old files for a while
-            s += ind * step * ' ' + '<Random name="rand01" rate1="0" rate2="0" seed1="1" seed2="1"/>\n'
-            s += ind * step * ' ' + '<Deadtime complex1_level="7" complex1_rate="415" complex2_level="7" complex2_rate="415" name="Physics" simple="5" version="1"/>\n'
-        else:            
-            s += self.random.xml(ind,step)
-        s += self.bunchGroupSet.xml(ind,step)
-        s += self.prescaledClock.xml(ind,step)
-        return s
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py
deleted file mode 100644
index 64a1e2f52043..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Cabling.py
+++ /dev/null
@@ -1,319 +0,0 @@
-# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-
-from .Limits import Limits
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-"""
-Thilo's proposal in the CTP meeting Oct 13
-
-* Run2 Cable to slot assignments:
-
-CTPIN-slot7
------------
-EM1  : 8x3b EM - mapping 0-7
-EM2  : 8x3b EM - mapping 8-15
-TAU1 : 8x3b TAU - mapping 0-7
-TAU2 : 8x3b TAU - mapping 8-15
-
-CTPIN-slot8
------------
-JET1 : 10x3b JET - mapping 0-9
-JET2 : 15x2b JET - mapping 10-24
-EN1  : 8x1b TE [0..7] (SumET)
-       8x1b XE [8..15] (missing ET)
-       8x1b XS [16..23] (missing ET significance)
-EN2  : 8x1b weighted SumET (restricted range TE)
-       8x1b restricted range MissET
-
-
-CTPIN-slot9
------------
-MUCTPI : first bit unused,
-         6x3b MU [1..18] - mapping 0-5
-CTPCAL : 6x1b BCM [0..5] - mapping 0-5
-         8x1b DBM [6..13] - mapping 0-7
-         2x1b BPTX [14..15] - mapping 0-1
-         6x1b LUCID [16..21] - mapping 0-5 (A,C,COMM,?,?,?)
-         3x1b ZDC [22..24] - mapping 0-2
-         3x1b CALREQ [28..30] last 3 bits! - mapping 0-2
-NIM1   : 12x1b MBTSSI [0..11] - mapping 0-11 A-side
-         4x1b NO [12..15] unused
-         1x3b MBTS [16..18]  A-side multiplicity
-         1x1b NIM [19] L1A  - mapping 0
-         1x1b NIM [20] LHCf - mapping 1
-         10x1b NIM [21..30] - mapping 2-11
-NIM2   : 12x1b MBTSSI [0..11]  - mapping 12-23 C-side 
-         4x1b NO [12..15] unused
-         1x3b MBTS [16..18] C-side multiplicity
-         1x1b NIM TGC-burst [19] - mapping 12
-         1x1b NIM RPC-burst [20] - mapping 13
-         1x1b NIM TRT-FastOR [21] - mapping 14
-         9x1b NIM [22..30] - mapping 15-23
-
-CTPCORE-slot10
---------------
-ALFA    : 64x1b ALFA mapping 0-63
-L1Topo0 : 64x1b TOPO mapping 0-63
-L1Topo1 : 64x1b TOPO mapping 64-127
-
-* Notes:
-- JET1: 8x3b will occupy all CTPIN LUTs, leaving only 2b per LUT.
-        This means that 2x3b cannot be counted properly.
-
-- Define where delayed minimum bias trigger is done, e.g. 1 bit in JET1
-"""
-
-
-def getLutInput(connector):
-    """
-    maps the direct input to the LUT number and LUT input
-    -- this is needed so that the multiplicity topo lines end up on the 
-    """
-
-
-
-class Cabling:
-    @staticmethod
-    def getInputCable(threshold):
-        return InputCable( threshold )
-
-
-
-    @staticmethod
-    def getCableName(thrtype,mapping):
-
-        from .Lvl1Flags import Lvl1Flags
-        run1 = Lvl1Flags.CTPVersion()<=3
-
-
-        if thrtype == 'EM' and mapping >= 16:
-            mapping = 15
-        elif thrtype == 'TAU' and mapping >= 16:
-            mapping = 15
-        elif thrtype == 'JET' and mapping >= 25:
-            mapping = 24
-        elif thrtype == 'XE' and mapping >=16:
-            mapping = 15
-        
-        if run1:
-            type2cablename  = { 'MUON'   : [(0,6,'MUCTPI')],
-                                'EM'     : [(0,8,'EM1'), (8,16,'EM2')],
-                                'TAU'    : [(0,8,'TAU1'), (8,16,'TAU2')],
-                                'JET'    : [(0,10,'JET1'), (10,25,'JET2')],
-                                'TE'     : [(0,8,'EN1')],
-                                'XE'     : [(0,8,'EN1')],
-                                'XS'     : [(0,8,'EN1')],
-                                'MBTSSI' : [(0,16,'NIM1'),(16,32,'NIM2')],
-                                'MBTS'   : [(0,1,'NIM1'), (1,2,'NIM2')],
-                                'LUCID'  : [(0,6,'CTPCAL')],
-                                'ZDC'    : [(0,3,'CTPCAL')],
-                                'CALREQ' : [(0,3,'CTPCAL')],
-                                'TOPO'   : [(0,64,'TOPO1'), (64,128,'TOPO2')],
-                                'ALFA'   : [(0,64,'ALFA')],
-                                'BCM'    : [(0,3,'CTPCAL')],
-                                'BCMCMB' : [(0,3,'CTPCAL')],
-                                'NIM'    : [(0,30,'NIM1'), (30,60,'NIM2')],
-                                'JF'     : [(0,4,'JET1')],
-                                'JB'     : [(0,4,'JET1')],
-                                'JE'     : [(0,4,'JET2')],
-                                }
-        else:
-            type2cablename  = { 'MUON'   : [(0,6,'MUCTPI')],
-                                'EM'     : [(0,8,'EM1'), (8,16,'EM2'), (16, 20, 'EM1'), (20, 26, 'EM2')],
-                                'TAU'    : [(0,8,'TAU1'), (8,16,'TAU2'), (16, 19, 'TAU1'), (19, 24, 'TAU2')],
-                                'JET'    : [(0,10,'JET1'), (10,25,'JET2'), (25, 33, 'JET1'), (33, 42, 'JET2')],
-                                'TE'     : [(0,8,'EN1'),(8,16,'EN2')],
-                                'XE'     : [(0,8,'EN1'),(8,16,'EN2'), (16, 24, 'EN1')],
-                                'XS'     : [(0,8,'EN1')],
-                                'MBTSSI' : [(0,16,'NIM1'),(16,32,'NIM2')],
-                                'MBTS'   : [(0,1,'NIM1'), (1,2,'NIM2')],
-                                'LUCID'  : [(0,6,'CTPCAL')],
-                                'ZDC'    : [(0,3,'CTPCAL')],
-                                'CALREQ' : [(0,3,'CTPCAL')],
-                                'TOPO'   : [(0,64,'TOPO1'), (64,128,'TOPO2')],
-                                'ALFA'   : [(0,64,'ALFA')],
-                                'BCM'    : [(0,3,'CTPCAL')],
-                                'BCMCMB' : [(0,1,'CTPCAL')],
-                                'BPTX'   : [(0,2,'CTPCAL')],
-                                'DBM'    : [(0,8,'CTPCAL')],
-                                'NIM'    : [(0,12,'NIM1'), (12,24,'NIM2')],
-                                'JF'     : [(0,4,'JET1')],
-                                'JB'     : [(0,4,'JET1')],
-                                'JE'     : [(0,4,'JET2')],
-                                }
-
-        x = type2cablename[thrtype]
-        for (minthr, maxthr, name) in x:
-            #print "BETTA ",mapping, minthr, maxthr, name
-            if mapping>=minthr and mapping<maxthr:
-                return name
-
-        raise RuntimeError("Threshold type %s has no cable for mapping '%i'" % (thrtype,mapping))
-
-
-    @staticmethod
-    def calcBitnum(thrtype):
-        # get the widths for the threshold types is defined in L1Common
-        nbits = getattr(Limits,'%s_bitnum' % thrtype)
-        return nbits
-
-
-
-class InputCable:
-        
-    def __fillTopoInputs(self, threshold):
-        # CTPCORE
-        self.isDirectIn  = True
-        connector = threshold.cable + 1
-        self.name        = "TOPO%i" % connector
-        self.connector   = "CON%i" % connector
-        self.bitnum      = threshold.bitnum
-        self.clock       = threshold.clock
-        self.range_begin = threshold.bitOnCable
-        self.range_end   = threshold.bitOnCable+self.bitnum-1
-
-        log.debug( 'Threshold type %s (mapping=%i) comes in on CTPCore on cable %s, bit %s, clock %i',
-                   self.thrtype, self.mapping, self.connector,
-                   ("%i" % self.range_begin) if self.bitnum==1 else ("%i-%i" % (self.range_begin, self.range_end)), self.clock )
-
-
-    def __fillAlfaInputs(self, threshold):
-        # CTPCORE
-        self.isDirectIn = True
-        self.name = Cabling.getCableName(self.thrtype,self.mapping)
-        self.connector = "CON0"
-        self.bitnum = 1
-        self.clock = self.mapping / 32
-        self.range_begin = self.mapping % 32
-        self.range_end   = self.range_begin
-
-        log.debug( 'Threshold type %s (mapping=%i) comes in on CTPCore on cable %s, bit %s, clock %i',
-                   self.thrtype, self.mapping, self.connector,
-                   ("%i" % self.range_begin) if self.bitnum==1 else ("%i-%i" % (self.range_begin, self.range_end)), self.clock )
-
- 
-
-    def __fillCTPIn(self):
-        self.name = Cabling.getCableName(self.thrtype,self.mapping)
-
-        self.calcSlotAndConnector()
-        log.debug( 'Threshold type %s (mapping=%i) comes in on CTPIN on cable %s/%s and bits %s',
-                   self.thrtype, self.mapping, self.slot, self.connector,
-                   ("%i" % self.range_begin) if self.bitnum==1 else ("%i-%i" % (self.range_begin, self.range_end)) )
-
-
-
-    def __init__(self, threshold ):
-
-        if threshold.ttype == 'ZB':
-            self.thrtype = threshold.seed_ttype
-        else:
-            self.thrtype = threshold.ttype
-        self.mapping = int(threshold.mapping)
-        thrtype = self.thrtype
-        mapping = self.mapping
-        if thrtype == 'EM' and mapping >= 16:
-            mapping = 15
-        elif thrtype == 'TAU' and mapping >= 16:
-            mapping = 15
-        elif thrtype == 'JET' and mapping >= 25:
-            mapping = 24
-        elif thrtype == 'XE' and mapping >=16:
-            mapping = 15
-        self.mapping = mapping
-
-        self.isDirectIn  = False # True for TOPO and ALFA which go into CTPCore
-        self.slot        = None  # input cable slot, possible values 7..9
-        self.connector   = None  # input cable connector, possible values 0..3
-        self.clock       = 0     # for direct inputs this can be 0 or 1 since they are overclocked x2
-        self.bitnum      = 0     # number of bits for multiplicity transmittion, possible values 1..3 
-        self.range_begin = 0     # first bit of range, possible values 0..30
-        self.range_end   = 0     # last bit of range, possible values 0..30 (should be first bit + bitnum - 1)
-
-        if self.thrtype=='TOPO':
-            self.__fillTopoInputs( threshold )
-        elif self.thrtype=='ALFA':
-            self.__fillAlfaInputs( threshold )
-        else:
-            self.__fillCTPIn()
-
-        if not self.connector:
-            raise RuntimeError("No cable has been assigned to threshold type '%s' with mapping %i" % (self.thrtype,self.mapping))
-
-
-    def __str__(self):
-        return "%s %r  (%s/%s) with %i bits [%i-%i] clock=%i" % (self.thrtype, self.mapping, self.slot, self.connector, self.bitnum, self.range_begin, self.range_end, self.clock)
-
-
-
-    def calcSlotAndConnector(self):
-
-        cableAssign = self.getCTPINCableAssignment(self.thrtype)
-
-        from .Lvl1Flags import Lvl1Flags
-        run1 = Lvl1Flags.CTPVersion()<=3
-        if run1 and self.thrtype=="EM":
-            cableAssign += self.getCTPINCableAssignment("TAU")
-
-        offset = self.mapping
-        name = Cabling.getCableName(self.thrtype,self.mapping)
-        if name == 'EM1' and self.mapping >= 16: 
-            offset -= 16
-        elif name == 'EM2' and self.mapping >= 20:
-            offset -= 12
-        elif name == 'TAU1' and self.mapping >= 16:
-            offset -= 16
-        elif name == 'TAU2' and self.mapping >= 19:
-            offset -= 11
-        elif name == 'JET1' and self.mapping >= 25:
-            offset -= 25
-        elif name == 'JET2' and self.mapping >= 33:
-            offset -= 23
-        elif self.thrtype == 'XE' and name == 'EN1' and self.mapping >= 16:
-            offset -= 16
-        for (slot, connector, start, stop, bitnum) in cableAssign:
-
-            self.bitnum = bitnum
-
-            delta = (stop - start + 1) / self.bitnum
-            log.debug( 'Cable SLOT%i / CON%i has room for %i thresholds of type %s', slot, connector, delta, self.thrtype )
-
-
-            if offset >= delta: # does not fit on this connector (only 0 to offset-1 will fit)
-                offset -= delta # move to the next cable for checking
-                continue
-
-            self.slot        = "SLOT%i" % slot
-            self.connector   = "CON%i" % connector
-            self.range_begin = start + offset * self.bitnum
-            self.range_end   = self.range_begin + self.bitnum-1
-            break
-        if not self.connector:
-            log.error("Cable mapping ERROR %s", cableAssign)
-            raise RuntimeError("No cable has been assigned to threshold type '%s' with mapping %i" % (self.thrtype,self.mapping))
-
-
-
-
-
-
-    def getCTPINCableAssignment(self,thrtype):
-        """
-        Gets the cable assignment from L1Common
-        """
-        cable = getattr(Limits,'%s_cable' % thrtype)
-        # we change the format for run 2, the tuple now contains also the bit multiplicity, as it is not constant per type
-        infosize = (len(cable)-1)/cable[0]
-
-        if infosize==5:
-            cableAssign = [tuple(cable[x:x+5]) for x in range(1,len(cable),5)]
-        else:
-            #print "Cabling for threshold type %s is not yet defined for Run 2" % thrtype
-            bitnum = Cabling.calcBitnum(thrtype)
-            cableAssign = [tuple(cable[x:x+4] + [bitnum]) for x in range(1,len(cable),4)]
-
-        return cableAssign
-
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/CaloInfo.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/CaloInfo.py
deleted file mode 100644
index 8702f2168dea..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/CaloInfo.py
+++ /dev/null
@@ -1,208 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from .Lvl1MenuUtil import log
-from .Lvl1MenuUtil import oldStyle
-from .Limits import CaloLimits
-
-class Isolation(object):
-
-    class Parametrization(object):
-        def __init__(self, isobit, offset, slope, mincut, upperlimit, etamin, etamax, priority):
-            self.isobit     = int(isobit)
-            self.offset     = int(offset)
-            self.slope      = int(slope)
-            self.upperlimit = int(upperlimit)
-            self.etamin     = int(etamin)
-            self.etamax     = int(etamax)
-            self.priority   = int(priority)
-            self.mincut     = int(mincut)  # minimum value for the isolation cut
-            if self.isobit not in range(1,6):
-                raise RuntimeError("Isolation bit is '%i' must be between 1 and 5" % self.isobit)
-
-        def xml(self, ind=1, step=2):
-            s = ind * step * ' ' + '<Parametrization isobit="%i" offset="%i" slope="%i" mincut="%i" upperlimit="%i" etamin="%i" etamax="%i" priority="%i"/>\n' % \
-                ( self.isobit, self.offset, self.slope, self.mincut, self.upperlimit, self.etamin, self.etamax, self.priority )
-            return s
-
-    class IsoGroup(object):
-        def __init__(self):
-            self.parameterizations = []
-
-        def __iter__(self):
-            for x in self.parameterizations:
-                yield x
-
-        def addIsolation(self, isobit, offset, slope, mincut=0, upperlimit=CaloLimits.ClusterOff, etamin=-49, etamax=49, priority=0):
-            self.parameterizations += [ Isolation.Parametrization(isobit=isobit, offset=offset, slope=slope, mincut=mincut, upperlimit=upperlimit, etamin=etamin, etamax=etamax, priority=priority) ]
-            return self
-
-
-    def __init__(self):
-        self.isolation = {'EMIsoForEMthr': Isolation.IsoGroup(), 'HAIsoForEMthr': Isolation.IsoGroup(), 'EMIsoForTAUthr': Isolation.IsoGroup()}
-
-    def __getitem__(self,k):
-        if k not in self.isolation:
-            raise RuntimeError("Isolation group %s doesn't exist. Should be one of %s" % (k, ','.join(self.isolation.keys())) )
-        return self.isolation[k]
-        
-    def xml(self, ind=1, step=2):
-        s=""
-        for thrtype in self.isolation.keys():
-            s += ind * step * ' ' + '<Isolation thrtype="%s">\n' % thrtype
-            for p in self.isolation[thrtype]:
-                s += p.xml(ind+1,step)
-            s += ind * step * ' ' + '</Isolation>\n'
-        return s
-
-
-
-class MinimumTOBPt(object):
-    def __init__(self, thrtype, ptmin, window=8, etamin=-49, etamax=49, priority=0):
-        self.thrtype    = str(thrtype).upper()
-        self.ptmin      = int(ptmin)
-        self.etamin     = int(etamin)
-        self.etamax     = int(etamax)
-        self.priority   = int(priority)
-        self.window     = int(window)
-        if self.thrtype not in [ "JETS", "JETL", "EM", "TAU"]:
-            raise RuntimeError("Unknown type %s for Minimum TOB PT, must be JETS, JETL, EM, or TAU")
-        
-
-    def xml(self, ind=1, step=2):
-        window = ' window="%i"' % self.window if self.thrtype.startswith("JET") else ""
-        s = ind * step * ' ' + '<MinimumTOBPt thrtype="%s"%s ptmin="%i" etamin="%i" etamax="%i" priority="%i"/>\n' % \
-            ( self.thrtype, window, self.ptmin, self.etamin, self.etamax, self.priority )
-        return s
-
-class CaloInfo(object):
-            
-    AverageOfThr = 1
-    LowerThr = 2
-    HigherThr = 3
-    def __init__(self, name='standard', globalEmScale=2, globalJetScale=1, jetWeights=[0]*12):
-        self.name        = name
-        self.globalEmScale  = globalEmScale
-        self.globalJetScale = globalJetScale
-        self.jetWeights  = jetWeights
-        self.xsParams    = { 'xsSigmaScale' : 0,
-                             'xsSigmaOffset': 0,
-                             'xeMin'        : 0,
-                             'xeMax'        : 0,
-                             'teSqrtMin'    : 0,
-                             'teSqrtMax'    : 0 }
-        self.isolation = Isolation()
-        self.minTOBPt = []
-
-    def setName(self, name):
-        self.name = name
-
-    def setGlobalEmScale(self, x):
-        self.globalEmScale = x
-
-    def setGlobalJetScale(self, x):
-        self.globalJetScale = x
-
-    def setJetWeights(self, weights):
-        self.jetWeights = weights
-
-    def setXsParams( self, **args ):
-        for k in args:
-            if k not in self.xsParams:
-                raise RuntimeError("'%s' is not a MET significance parameter" % k)
-            self.xsParams[k]  = args[k]
-
-    def xml(self, ind=1, step=2):
-        s = ind * step * ' ' + '<CaloInfo name="CaloInfo" global_em_scale="%g" global_jet_scale="%g">\n' % (self.globalEmScale, self.globalJetScale)
-        if oldStyle():
-            for i, jw in enumerate(self.jetWeights):
-                s += (ind+1) * step * ' ' + '<JetWeight num="%i" weight="%i">%i</JetWeight>\n' % (i+1, jw, jw)
-        s += (ind+1) * step * ' ' + '<METSignificance xeMin="11" xeMax="63" teSqrtMin="4" teSqrtMax="63" xsSigmaScale="1150" xsSigmaOffset="1640"/>\n'
-        if not oldStyle():
-            s += self.isolation.xml(ind+1)
-            for minObjPt in self.minTOBPt:
-                s += minObjPt.xml(ind+1)
-
-        s += ind * step * ' ' + '</CaloInfo>\n'
-        return s
-
-
-
-    @staticmethod
-    def calcJetWeightsFromThresholds(triggerConfigLvl1, use_fj=False):
-
-        def thr2weights(thrs, factor=1.25):
-            # thrs = [10.0, 15.0, 1023.0, 20.0, 30.0, 50.0, 75.0, 350.0]
-
-            # allow for thresholds being out of order
-            # need to skip any turned-off thresholds (thr=1023)
-            sthrs = sorted( filter(lambda x: x<1023, thrs)) + [0]
-            
-            # k = [(10.0, 15.0), (15.0, 20.0), (20.0, 30.0), (30.0, 50.0), (50.0, 75.0), (75.0, 350.0), (350.0, 0)]
-            k = zip(sthrs,sthrs[1:])
-
-            # compute weights
-            # TODO: this formula description, copied from LVL1.py doesn't seem to match the implementation (need to check with L1Calo - Joerg
-            # -------------------------------------------------------------------
-            # Jet thresholds: [5, 10, 18, 23, 35, 42, 70, 100 ][10, 18, 26, 65 ]
-            # Jet weights(w):  [ 7, 14, 20, 29, 38, 56, 85, 100 ][9, 6, 23, 19]
-            # Jet weights(W):[ 5,  6, 6, 8, 9, 17, 29, 15 ][9, 6, 23, 19]
-            # W_i=0.5*(thr_{i+1}-thr_{i-1}),
-            #     thr_{0}=0 and thr_{n+1}=thr_{n}+(thr_{n}-thr_{n-1})
-            # --------------------------------------------------------------------
-            sum = 0
-            weights = dict([(t,0) for t in thrs])
-            for thr,thrNext in k:
-                if thrNext != 0:
-                    w = int( (thr + thrNext + 1)/2.0) - sum
-                else:  
-                    w = int( thr * factor - sum)
-                weights[ thr ] = w
-                sum += w
-
-            return [ weights[thr] for thr in thrs ]
-
-    
-        l1_thrs = triggerConfigLvl1.menu.thresholds
-        jet_thresholds  = l1_thrs.allThresholdsOf('JET')
-        fjet_thresholds = l1_thrs.allThresholdsOf('JF')
-        log.debug('N jet thresholds: %d (8 expected)', len(jet_thresholds))
-        log.debug('N fjet thresholds: %d (4 expected)', len(fjet_thresholds))
-
-        jthr, fjthr           = [1023]*8, [1023]*4
-        jet_names, fjet_names = ['---']*8, ['---']*4
-
-        for j in jet_thresholds:
-            log.debug('jet threshold %s: %d', j.name, j.thresholdInGeV())
-            jthr[j.mapping] = j.thresholdInGeV()
-            jet_names[j.mapping] = j.name
-
-        for j in fjet_thresholds:
-            tvalues = j.thresholdValues
-            priority = 0
-            threshold_value = 0
-            for tv in tvalues:
-                if tv.priority > priority:
-                    threshold_value = tv.value
-            log.debug('fjet threshold %s: %d', j.name, threshold_value)
-            fjthr.append(threshold_value)
-            fjthr[j.mapping] = threshold_value
-            fjet_names[j.mapping] = j.name
-        #
-
-        log.debug('Jet thresholds: %s', ' '.join(jet_names))
-        log.debug('Fjet thresholds: %s', ' '.join(fjet_names))
-
-        if len(jthr) <= 8:
-            w = thr2weights(jthr)
-            jw = w
-        else:
-            jw = [0]*8
-
-        w = 4 * [0]
-
-        if use_fj and len(fjthr) <= 4:
-            w = thr2weights(fjthr)
-        jw.extend(w)
-        return jw
-
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Logic.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Logic.py
deleted file mode 100644
index c67c402bd803..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Logic.py
+++ /dev/null
@@ -1,202 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-__all__ = ['Logic', 'Not']
-
-from copy import copy
-
-from .Lvl1MenuUtil import log
-
-
-class Logic(object):
-    NONE = ''
-    AND = '&'
-    OR = '|'
-    NOT = '!'
-
-    @staticmethod
-    def symbolToString(x):
-        if x==Logic.AND:
-            return 'AND'
-        elif x==Logic.OR:
-            return 'OR'
-        elif x==Logic.NOT:
-            return 'NOT'
-        else:
-            return ''
-
-    @staticmethod
-    def Not(x):
-        a = Logic()
-        a.logic = Logic.NOT
-        a.subConditions.append(x)
-        return a
-
-
-
-
-    def __init__(self, condition=None):
-        self.condition = condition # hold a Lvl1Condition instance
-        self.logic = Logic.NONE
-        self.subConditions = [] # holds Logic instances
-
-
-    def __or__(self, x):
-        #print self, "OR", x
-        newLogic = Logic()
-        newLogic.logic = Logic.OR
-
-        if self.logic == Logic.OR:
-            newLogic.subConditions += copy(self.subConditions)
-        else:
-            newLogic.subConditions += [copy(self)]
-
-        if x.logic == Logic.OR:
-            newLogic.subConditions += copy(x.subConditions)
-        else:
-            newLogic.subConditions += [copy(x)]
-
-        return newLogic
-
-    
-    def __and__(self, x):
-        #print self, "AND", x
-        newLogic = Logic()
-        newLogic.logic = Logic.AND
-
-        if self.logic == Logic.AND:
-            newLogic.subConditions += copy(self.subConditions)
-        else:
-            newLogic.subConditions += [copy(self)]
-
-        if x.logic == Logic.AND:
-            newLogic.subConditions += copy(x.subConditions)
-        else:
-            newLogic.subConditions += [copy(x)]
-
-        return newLogic
-
-    def __not__(self, x):
-        log.debug('checking NOT')
-        a = self
-        if a.logic==Logic.NONE:
-            a.logic = Logic.NOT
-        if a.logic==Logic.NOT:
-            if len(a.subConditions) == 1:
-                log.debug('not is a unary operator, ignore it')
-            else:
-                a.subConditions.append(x)
-        return a
-
-
-    def __str__(self):
-        s = ''
-        if self.logic == Logic.NONE:
-            if len(self.subConditions)==0 and self.condition is not None:
-                return str(self.condition)
-            if len(self.subConditions)==1:
-                return str(self.subConditions[0])
-            if len(self.subConditions)>=1:
-                log.error('Logic NONE has more than one element')
-                return ''
-
-        if self.logic == Logic.NOT:
-            if len(self.subConditions)==1:
-                if self.subConditions[0].logic == Logic.NONE:
-                    return '!'+str(self.subConditions[0])
-                else:
-                    return '!('+str(self.subConditions[0]) + ')'
-            log.error('Logic NOT must have exactly one element but has %i', len(self.subConditions))
-            return ''
-
-        if self.logic == Logic.AND or self.logic == Logic.OR:
-            s = ''
-            if len(self.subConditions)<=1:
-                log.error('Logic AND/OR must have more than one sub element but has %i: %r', len(self.subConditions), self.subConditions)
-                return ''
-            else:
-                for (i, a) in enumerate(self.subConditions):
-                    if i > 0:
-                        s += self.logic
-                    if(a.logic == Logic.NONE or a.logic == Logic.NOT):
-                        s += str(a)
-                    else:
-                        s += '(' + str(a) + ')'
-        return s
-
-
-    def thresholdNames(self, include_bgrp=False):
-        names = set([])
-        if self.condition is not None:
-            from .Lvl1Condition import Lvl1InternalTrigger
-            if isinstance(self.condition, Lvl1InternalTrigger):
-                if include_bgrp:
-                    names.add(self.condition.name())
-            else:
-                names.add( self.condition.threshold.name )
-        else:
-            for sc in self.subConditions:
-                names.update( sc.thresholdNames(include_bgrp) )
-        return sorted(list(names))
-
-
-    def conditions(self, include_internal=False):
-        cond = set([])
-        if self.condition is not None:
-            from .Lvl1Condition import Lvl1InternalTrigger
-            if isinstance(self.condition, Lvl1InternalTrigger):
-                if include_internal:
-                    cond.add(self.condition)
-            else:
-                cond.add( self.condition )
-        else:
-            for sc in self.subConditions:
-                cond.update( sc.conditions(include_internal) )
-        return sorted(list(cond), key = lambda x: x.name())
-
-
-    def normalize(self):
-        if self.logic in (Logic.AND, Logic.OR):
-            mylogic = self.logic
-            newconditions = []
-            for c in self.subConditions:
-                if c.logic == mylogic: # X&(A&B) or X|(A|B) 
-                    # expand it to X&A&B or X|A|B
-                    c.normalize()
-                    newconditions.extend(c.subConditions)
-                else:
-                    newconditions.append(c)
-            self.subConditions = newconditions
-        else:
-            pass
-        pass
-
-
-    def xml(self, ind, step=2):
-        if self.logic==Logic.NONE:
-            return self.condition.xml(ind,step)
-
-        elif self.logic==Logic.AND or self.logic==Logic.OR or self.logic==Logic.NOT:
-            logic = Logic.symbolToString(self.logic)
-            s = ind * step * ' ' + '<%s>\n' % logic
-            for c in self.subConditions:
-                s += c.xml(ind+1, step) + "\n"
-            s += ind * step * ' ' + '</%s>' % logic
-            return s
-
-        else:
-            log.error('Unknown node in LVL1 item logic')
-            log.error('  ==> sublogic = %s', self.logic)
-            log.error('  ==> # subConditions = %i', len(self.subConditions))
-
-
-    def printIt(self):
-        for a in self.subConditions:
-            if a.logic==a.NONE and a.condition is not None:
-                log.info('subCondition :', str(a.condition))
-            else:
-                log.info('subCondition :', a.printIt())
-        return ''
-
-
-def Not(x):
-    return Logic.Not(x)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Condition.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Condition.py
deleted file mode 100644
index 9bb0eac3cff2..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Condition.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-
-from .Logic import Logic
-
-
-class Lvl1Condition(Logic):
-    def __init__(self):
-        super(Lvl1Condition, self).__init__(condition = self)
-
-
-
-class ThrCondition(Lvl1Condition):
-    def __init__(self, threshold, multiplicity=1):
-        super(ThrCondition, self).__init__()
-        self.threshold = threshold
-        self.multiplicity = multiplicity
-
-    def __str__(self):
-        return str(self.threshold) + '[x' + str(self.multiplicity)+']'
-
-    def x(self, multiplicity):
-        return ThrCondition(self.threshold, multiplicity) # provide a copy
-
-    def name(self):
-        return "%s_x%i" % (self.threshold.name, self.multiplicity)
-
-    def xml(self, ind, step=2):
-        return ind * step * ' ' + '<TriggerCondition multi="%i" name="%s" triggerthreshold="%s"/>' % \
-               (self.multiplicity, self.name(), self.threshold.name)
-
-
-
-class Lvl1InternalTrigger(Lvl1Condition):
-    def __init__(self, name):
-        super(Lvl1InternalTrigger, self).__init__()
-        self._name = name
-        
-    def __str__(self):
-        return str(self._name)
-
-    def name(self):
-        return self._name
-
-    def xml(self, ind, step=2):
-        return ind * step * ' ' + '<InternalTrigger name="%s"/>' % self.name()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Menu.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Menu.py
deleted file mode 100644
index d42027462d0a..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Menu.py
+++ /dev/null
@@ -1,247 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from .Lvl1Thresholds import LVL1Thresholds
-from .Lvl1MenuItems import LVL1MenuItems
-from .Lvl1MonCounters import Lvl1MonCounters
-from .CaloInfo import CaloInfo
-from .MuctpiInfo import MuctpiInfo
-from .CTPInfo import CTPInfo
-from .Limits import Limits
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-class Lvl1Menu(object):
-
-    def __init__(self, menuName):
-        self.menuName = menuName
-
-        # items in menu
-        self.items = LVL1MenuItems()
-        
-        # thresholds in menu
-        self.thresholds = LVL1Thresholds()
-
-        # thresholds in menu
-        self.counters = Lvl1MonCounters()
-
-        # CTP Info in the menu
-        self.CTPInfo = CTPInfo()
-        
-        # Muon Info in the menu
-        self.MuctpiInfo = MuctpiInfo(low_pt=1, high_pt=1, max_cand=13)
-
-        # Calo Info in the menu
-        em_scale=2
-        if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'):
-            if TriggerFlags.useRun1CaloEnergyScale :
-                em_scale=1
-                
-        self.CaloInfo = CaloInfo(name='standard', globalEmScale=em_scale, globalJetScale=1)
-
-        if self.menuName:
-            from .Lvl1MenuUtil import get_smk_psk_Name
-            smk_psk_Name = get_smk_psk_Name(self.menuName)
-            self.items.menuName = smk_psk_Name["smkName"]
-            self.items.pssName  = smk_psk_Name["pskName"]
-
-
-    @staticmethod
-    def partitioning():
-        from .Lvl1Flags import Lvl1Flags
-        first = Lvl1Flags.MenuPartitioning()
-        last = first[1:] + [ Limits.MaxTrigItems ]
-        partitioning = dict( zip([1,2,3],zip(first,last)) )
-        return partitioning
-
-    def addThreshold(self, threshold):
-        self.thresholds += threshold
-
-
-    def addItem(self, item):
-        self.items += item
-
-
-    def getItem(self,name):
-        return self.items.findItemByName(name)
-
-
-    def addCounters(self):
-        from TriggerMenuMT.LVL1MenuConfig.LVL1Menu.MonitorDef import MonitorDef
-        # add the CTPIN counters
-        for counter in MonitorDef.ctpinCounters( self.thresholds ):
-            self.counters.addCounter( counter )
-
-        # add the CTPMon counters
-        for counter in MonitorDef.ctpmonCounters( self.thresholds ):
-            self.counters.addCounter( counter )
-
-        # mark the L1 Items that they should be monitored
-        MonitorDef.applyItemCounter( self.items )
-        
-
-
-
-
-    def xml(self, ind=1, step=2):
-        s  = '<?xml version="1.0"?>\n'
-        s += '<!DOCTYPE LVL1Config SYSTEM "LVL1config.dtd">\n'
-        s += '<LVL1Config name="%s" ctpVersion="%i" l1Version="%i">\n' % (self.menuName, Limits.CTPVersion, Limits.L1CommonVersion)
-        s += '  <!--File is generated by TriggerMenu-->\n'
-        s += '  <!--No. L1 thresholds defined: %i-->\n' % len(self.thresholds)
-        s += '  <!--No. L1 items defined: %i-->\n' % len(self.items)
-        s += self.items.xml()
-        s += self.counters.xml()
-        s += self.thresholds.xml()
-        s += self.CTPInfo.xml()
-        s += self.CaloInfo.xml()
-        s += self.MuctpiInfo.xml()
-        s += '</LVL1Config>\n'
-        return s
-
-
-    def readMenuFromXML(self,inputFile):
-        from TriggerMenuMT.LVL1MenuConfig.LVL1.XMLMenuReader import readMenuFromXML
-        readMenuFromXML(self, inputFile)
-
-    def printCabling(self):
-        cablemap = []
-        for thr in self.thresholds:
-            if thr.ttype=='TOPO':
-                continue
-            cabling = thr.cableinfo
-            slot = cabling.slot if cabling.slot is not None else 'None'
-            cablemap += [(slot, cabling.connector, thr.ttype, cabling.range_begin, cabling.range_end, str(thr))]
-
-        cablemap.sort()
-
-        cable = None
-        for c in cablemap:
-            k = (c[0],c[1])
-            if k != cable:
-                cable = k
-                print("\nCable %s, %s" % cable)                   # noqa: ATL901
-                print("=================")                        # noqa: ATL901
-            print("%s  bit %i-%i (%s)" % (c[2],c[3],c[4],c[5]))   # noqa: ATL901
-
-    def checkL1(self):
-        """
-        All other checks should be implemented in TrigConfStorage/src/CheckConsistency.cxx
-        This method is only for quick solutions but should be intermediate
-        """
-
-        success = True
-        
-        # Checks if all needed thresholds are in the menu
-        for item in self.items:
-            allThrNames = self.thresholds.thresholdNames()
-            itemThrNames = item.thresholdNames(include_bgrp=False)
-            for thrName in itemThrNames:
-                if thrName not in allThrNames:
-                    log.error('Menu item %s contains threshold %s which is not part of the menu!', item.name, thrName)
-                    success = False
-
-        if not success:
-            raise RuntimeError("There is a problem in the menu that needs fixing")
-
-        # Check that the threshold multiplicities don't exceed the number of encodable values give the available bits
-        for item in self.items:
-            conditions = item.conditions()
-            for c in conditions:
-                log.debug("Item %s has threshold %s on cable %s with multiplicity %i", item, c.threshold, c.threshold.cableinfo, c.multiplicity)
-                maxAllowMult = {1 : 1, 2 : 3, 3 : 7} [c.threshold.cableinfo.bitnum]
-                if c.multiplicity > maxAllowMult:
-                    log.error("Item %s has condition %s. Threshold %s is on cable %s which allows maximum multiplicity %i",
-                              item.name, c, c.threshold.name, c.threshold.cableinfo.name, maxAllowMult)
-                    success = False
-                    
-        if not success:
-            raise RuntimeError("There is a problem in the menu that needs fixing")
-
-        # # Check all items are in the correct partition
-        # for item in self.items:
-        #     partitionRange = Lvl1Menu.partitioning()[item.partition]
-        #     if not (item.ctpid>=partitionRange[0] and item.ctpid<partitionRange[1]):
-        #         log.error('Item %s (ctpid %i, partition %i) outside allowed range for partition %r!' % (item.name, item.ctpid, item.partition, partitionRange))
-        #         success = False
-
-        # if not success:
-        #     raise RuntimeError("There is a problem in the menu that needs fixing")
-        
-
-        # Check for all items that their bunchgroups are in the same partition
-        bgpart = dict( [("BGRP%i" % bg.internalNumber, bg.menuPartition) for bg in self.CTPInfo.bunchGroupSet.bunchGroups] )
-        for item in self.items:
-            bgs = [t for t in item.thresholdNames(include_bgrp=True) if t.startswith('BGRP')]
-            if 'BGRP0' not in bgs:
-                log.error('Item %s (partition %i) is not using BGRP0 which is mandatory!', item.name,item.partition)
-            else:
-                bgs.remove('BGRP0')
-            for bg in bgs:
-                if bgpart[bg] != item.partition:
-                    log.error('Item %s (partition %i) uses BG %s which is in partition %i!', item.name,item.partition,bg,bgpart[bg])
-                    success = False
-
-        if not success:
-            raise RuntimeError("There is a problem in the menu that needs fixing")
-
-
-        # check that L1 CalReq are the last 3 items of the menu (509,510,511) - check with Thilo/Ralf
-        caldef = { "L1_CALREQ0" : 509, "L1_CALREQ1" : 510, "L1_CALREQ2" : 511 }
-        for name, ctpid in caldef.items():
-            calitem = self.getItem(name)
-            if calitem and calitem.ctpid != ctpid:
-                log.error('Item %s is not on CTPID %i', name, ctpid)
-                success = False
-        if not success:
-            raise RuntimeError("There is a problem in the menu that needs fixing")
-
-        
-        # check that the number of monitored items doesn't exceed the limit
-        (TBP, TAP, TAV) = (1, 2, 4)
-        items_LF = { TBP : set(), TAP : set(), TAV : set() }
-        items_HF = { TBP : set(), TAP : set(), TAV : set() }
-
-        for item in self.items:
-            for k in (TBP, TAP, TAV):
-                if item.monitorsLF & k:
-                    items_LF[k].add( item.name )
-                if item.monitorsHF & k:
-                    items_HF[k].add( item.name )
-
-        counts_LF = dict( map(lambda x : (x[0],len(x[1])), items_LF.items() ) )
-        counts_HF = dict( map(lambda x : (x[0],len(x[1])), items_HF.items() ) )
-
-        lutsLF = ( max(counts_LF.values() ) -1 ) // 8 + 1
-        lutsHF = ( max(counts_HF.values() ) -1 ) // 8 + 1
-
-        
-        if lutsLF + lutsHF <= 8:
-            log.info("LVL1 monitoring with %i LF groups (%i items) and %i HF groups (%i items)", lutsLF, max(counts_LF.values()), lutsHF, max(counts_HF.values()))
-        else:
-            log.error("too many monitoring items are defined")
-            log.error("   low frequency  TBP: %i", counts_LF[TBP])
-            log.error("                  TAP: %i", counts_LF[TAP])
-            log.error("                  TAV: %i", counts_LF[TAV])
-            log.error("   required LUTs: %i", lutsLF)
-            log.error("   high frequency TBP: %i", counts_HF[TBP])
-            log.error("                  TAP: %i", counts_HF[TAP])
-            log.error("                  TAV: %i", counts_HF[TAV])
-            log.error("   required LUTs: %i", lutsHF)
-            log.error("   this menu requires %i monitoring LUTs while only 8 are available", lutsLF + lutsHF)
-            log.error("   LF TBP:\n     %r", sorted(items_LF[TBP]))
-            log.error("   LF TAP:\n     %r", sorted(items_LF[TAP]))
-            log.error("   LF TAV:\n     %r", sorted(items_LF[TAV]))
-            log.error("   HF TBP:\n     %r", sorted(items_HF[TBP]))
-            log.error("   HF TAP:\n     %r", sorted(items_HF[TAP]))
-            log.error("   HF TAV:\n     %r", sorted(items_HF[TAV]))
-            success = False
-        if not success:
-            raise RuntimeError("There is a problem in the menu that needs fixing")
-
-
-
-
-        return success
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MenuItems.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MenuItems.py
deleted file mode 100644
index c3883abfe6d3..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MenuItems.py
+++ /dev/null
@@ -1,198 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from .PrescaleHelper import getCutFromPrescale, getPrescaleFromCut
-from .Lvl1MenuUtil import oldStyle
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-
-class LVL1MenuItem(object):
-
-    # global variable for item registration, if set, new items will be registered with l1configForRegistration (type TriggerConfigL1)
-    l1configForRegistration = None
-
-    # New items will be assigned to this partition
-    currentPartition = 0
-    
-    __slots__ = ['name', 'group', 'ctpid', 'psCut', 'complex_deadtime', 'trigger_type', 'partition', 'logic', 'monitorsLF', 'monitorsHF', 'verbose']
-    def __init__(self, name, ctpid=-1, group='1', prescale=1, complex_deadtime=0, psCut=None, verbose=False):
-        self.name             = name
-        self.group            = group
-        self.ctpid            = int(ctpid)
-        self.psCut            = psCut if psCut is not None else getCutFromPrescale(prescale)
-        self.complex_deadtime = complex_deadtime
-        self.trigger_type     = 0
-        self.partition        = LVL1MenuItem.currentPartition
-        self.logic            = None
-        self.monitorsLF       = 0
-        self.monitorsHF       = 0
-        self.verbose          = verbose
-
-        if self.verbose:
-            log.debug("Created %s", name)
-
-        if LVL1MenuItem.l1configForRegistration:
-            LVL1MenuItem.l1configForRegistration.registerItem(self.name, self)
-
-
-    def __str__(self):
-        s = "Item %s (ctp id=%i) [%s]" % (self.name, self.ctpid, self.logic)
-        return s
-    
-    @property
-    def prescale(self):
-        return getPrescaleFromCut(self.psCut)
-
-    @prescale.setter
-    def prescale(self, prescale):
-        self.psCut = getCutFromPrescale(prescale)
-        return self
-
-    @property
-    def priority(self):
-        log.error("Item priority not used anymore, replaced by complex_deadtime")
-        return self.complex_deadtime
-
-    @priority.setter
-    def priority(self,priority):
-        log.error("Setter: item priority not used anymore, replaced by complex_deadtime")
-
-    def addMonitor(self, flag, frequency):
-        from TriggerMenuMT.LVL1MenuConfig.LVL1Menu.MonitorDef import MonitorDef
-        if frequency == MonitorDef.LOW_FREQ:
-            self.monitorsLF |= flag
-        if frequency == MonitorDef.HIGH_FREQ:
-            self.monitorsHF |= flag
-    
-    def setLogic(self, logic):
-        self.logic = logic
-        if self.verbose:
-            log.debug('%s', self)
-        return self
-
-    def setCtpid(self, x):
-        self.ctpid = int(x)
-        return self
-
-    def thresholdNames(self, include_bgrp=False):
-        if self.logic is not None:
-            return self.logic.thresholdNames(include_bgrp)
-        else:
-            return []
-
-    def conditions(self, include_internal=False):
-        if self.logic is not None:
-            return self.logic.conditions(include_internal)
-        else:
-            return []
-
-    def setTriggerType(self, ttype):
-        self.trigger_type = int(ttype) & 0xff
-        return self
-
-
-    def binary_trigger_type(self, width=8):
-        from .Lvl1MenuUtil import binstr
-        return binstr(self.trigger_type, width=width)
-
-
-    def xml(self, ind, step=2):
-        monitor= ' monitor="LF:{0:03b}|HF:{1:03b}"'.format(self.monitorsLF,self.monitorsHF)
-        s = ind * step * ' ' + '<TriggerItem ctpid="%i" partition="%i" name="%s" complex_deadtime="%i" definition="(%s)" trigger_type="%s"%s>\n' % \
-            (self.ctpid, self.partition, self.name, self.complex_deadtime, str(self.logic).replace('&','&amp;'), self.binary_trigger_type(8 if self.partition==1 else 4), monitor)
-        if self.logic:
-            self.logic.normalize()
-            s += self.logic.xml(ind+1, step) + "\n"
-        s += ind * step * ' ' + '</TriggerItem>'
-        return s
-
-
-class LVL1MenuItems(object):
-    def __init__(self):
-        self.menuName = ''
-        self.pssName = ''
-        self.pssType = 'Physics'
-        self.items = []
-
-    def __iter__(self):
-        return self.items.__iter__()
-
-    def itemNames(self):
-        return [x.name for x in self.items]
-
-    def findItemByName(self, name):
-        return ([x for x in self.items if x.name==name] + [None])[0]
-
-    def __iadd__(self, item):
-        if item is None:
-            return self
-        if item.name in [x.name for x in self.items]:
-            log.warning("LVL1 item %s is already in the menu, will not add it again", item.name)
-            return self
-        if item.ctpid in [x.ctpid for x in self.items]:
-            log.warning("LVL1 item with ctpid %i is already in the menu, will not add %s", item.ctpid, item.name)
-            return self
-        self.items += [ item ]
-        return self
-    
-    def __contains__(self, itemname):
-        return itemname in [x.name for x in self.items] 
-
-    def __len__(self):
-        return len(self.items)
-
-    def xml(self, ind=1, step=2):
-
-        self.items.sort( key = lambda x: x.ctpid )
-
-        s = ind * step * ' ' + '<TriggerMenu name="%s" phase="lumi">\n' % self.menuName
-        for i in self.items:
-            s += i.xml(ind+1,step)+"\n"
-        s += ind * step * ' '+'</TriggerMenu>\n'
-
-        pshandler = PrescaleHandler(self.pssName, self.pssType, self.items)
-        s += pshandler.xml()
-
-        # write priorities
-        if oldStyle():
-            s += ind * step * ' ' + '<PrioritySet name="standard" version="1">\n'
-            for item in self.items:
-                s += (ind+1) * step * ' ' + '<Priority ctpid="%i" priority="%s"/>\n'  % (item.ctpid, "HIGH" if item.complex_deadtime==0 else "LOW")
-            s += ind * step * ' ' + '</PrioritySet>\n'
-
-        return s
-
-
-class PrescaleHandler(object):
-    def __init__(self, name, psType, menuitems):
-        self.name = name
-        self.psType = psType
-        self.items = menuitems
-        self.itemsByPartition = {}
-
-        for item in menuitems:
-            self.itemsByPartition.setdefault(item.partition,[]).append(item)
-
-        for itemList in self.itemsByPartition.values():
-            itemList.sort(key = lambda x: x.ctpid)
-
-    def xml(self, ind=1, step=2):
-        # write prescales (only prescales for which an item is defined)
-        # write one set per defined partition
-        s = ind * step * ' ' + '<PrescaleSet name="%s" type="%s" menuPartition="0">\n' % (self.name, self.psType)
-
-        from .Limits import Limits
-        cuts = [ getCutFromPrescale(-1) ] * Limits.MaxTrigItems
-        
-        for item in self.items:
-            cuts[item.ctpid] = item.psCut
-
-        for ctpid, pscut in enumerate(cuts):
-            psvalue = getPrescaleFromCut(pscut)
-            if oldStyle():
-                s += (ind+1) * step * ' ' + '<Prescale ctpid="%i" ps="%g"/>\n'  % (ctpid, psvalue)
-            else:
-                s += (ind+1) * step * ' ' + '<Prescale ctpid="%i" cut="%s%06x" value="%g"/>\n'  % (ctpid, '-' if pscut<0 else '', abs(pscut), psvalue)
-        s += ind * step * ' ' + '</PrescaleSet>\n'
-        return s
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MenuUtil.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MenuUtil.py
deleted file mode 100644
index 37e3ec7cbb28..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MenuUtil.py
+++ /dev/null
@@ -1,150 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-__all__ = ['log', 'idgen', 'binstr', 'get_smk_psk_Name', 'oldStyle']
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-# Old CTP = Old CTP
-def oldStyle():
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    oldStylePrescales = 'pp_v4' in TriggerFlags.triggerMenuSetup() or \
-                        'HI_v2' in TriggerFlags.triggerMenuSetup() or \
-                        'alfa_v2' in TriggerFlags.triggerMenuSetup() or \
-                        'DC14' in TriggerFlags.triggerMenuSetup()
-    return oldStylePrescales
-
-
-
-# unique id generator
-class idgen(object):
-    from collections import defaultdict
-    a =  defaultdict(int)
-    def get(self, kind):
-        self.a[kind] += 1
-        return str(self.a[kind])
-    def reset(self, kind=None):
-        if kind:
-            self.a[kind] = 0
-        else:
-            for kind in self.a:
-                self.a[kind] = 0
-            
-idgen = idgen()
-
-
-# turns an integer into a binary representation string of given width ( for the reverse just use int('10011',2) )
-def binstr(value, width):
-    return ''.join([str( value >> i & 1 ) for i in range( width-1, -1, -1 ) ])
-
-
-def get_smk_psk_Name(menuName):
-    import re
-    smk_psk_Name = {}
-    if "mc_prescale" in menuName:
-        form = "(.*)_(.*)_mc_prescale"
-        m = re.match(form, menuName)
-        (smkName, pskName) = m.groups()
-        pskName = pskName+"_mc" 
-    elif "prescale" in menuName:
-        #eg lumi1e31_simpleL1Calib_no_prescale
-        form = "(.*)_(.*)_prescale"
-        m = re.match(form,menuName)
-        (smkName, pskName) = m.groups()
-    else:
-        #eg lumi1e31 ps set name can be "default"
-        smkName = menuName
-        pskName = "default"
-    smk_psk_Name["smkName"] = str(smkName)
-    smk_psk_Name["pskName"] = str(smkName+"_"+pskName+"_prescale")
-
-    return smk_psk_Name
-
-def getJetWeights(triggerPythonConfig, use_fj=False):
-    jw = []
-    jthr, fjthr = [], []
-    def thr2weights(thrs, factor=1.25):
-        n = len(thrs)
-        # need to skip any turned-off thresholds
-        use = []
-        for i in range(n):
-            if thrs[i]<1023:
-               use.append(1)
-            else:
-               use.append(0)
-        # allow for thresholds being out of order
-        index = order(thrs)
-        # compute weights
-        sum = 0
-        weights = [0]*n
-        for j in range(n):
-            w = 0
-            if use[index[j]]>0:
-                jnext = j + 1
-                while (jnext < n and use[index[jnext]]==0):
-                    jnext = jnext + 1
-                if (jnext < n):
-                    w = int( (thrs[index[j]]+thrs[index[jnext]]+1)/2.0) - sum
-                else:  
-                    w = int(thrs[index[j]]*factor - sum)
-            weights[index[j]]=w
-            sum += w
-        return weights
-#
-    def order(thrs): 
-        n = len(thrs)
-        thr1 = list(thrs)
-        thr2 = sorted(thrs)
-        index = []
-        for i in range(n):
-            val = thr2[i]
-            pos = thr1.index(val)
-            index.append(pos)
-            if (thr1.count(val)>1):
-                thr1[pos] = -thr1[pos]
-        return index
-#
-    l1_thrs = triggerPythonConfig.Lvl1Thresholds()
-    jet_thresholds = l1_thrs.allThresholdsOf('JET')
-    fjet_thresholds = l1_thrs.allThresholdsOf('JF')
-    log.debug('N jet thresholds: %d (8 expected)', len(jet_thresholds))
-    log.debug('N fjet thresholds: %d (4 expected)', len(fjet_thresholds))
-    jthr = [1023]*8
-    fjthr = [1023]*4
-    jet_names, fjet_names = ['---']*8, ['---']*4
-    for j in jet_thresholds:
-        log.debug('jet threshold %s: %d', j.name, j.thresholdInGeV())
-        # jthr.append(j.thresholdInGeV())
-        jthr[j.mapping] = j.thresholdInGeV()
-        jet_names[j.mapping] = j.name
-    for j in fjet_thresholds:
-        tvalues = j.thresholdValues
-        priority = 0
-        threshold_value = 0
-        for tv in tvalues:
-            if tv.priority > priority:
-                threshold_value = tv.value
-        log.debug('fjet threshold %s: %d', j.name, threshold_value)
-        fjthr.append(threshold_value)
-        fjthr[j.mapping] = threshold_value
-        fjet_names[j.mapping] = j.name
-    #
-    s = ''
-    for j in jet_names:
-        s += '%s ' % j
-    log.debug('Jet thresholds: %s', s)
-    s = ''
-    for j in fjet_names:
-        s += '%s ' % j
-    log.debug('Fjet thresholds: %s', s)
-    if len(jthr) <= 8:
-        w = thr2weights(jthr)
-        jw = w
-    else:
-        jw = [0]*8
-    w = [0]*4
-    if use_fj:
-        if len(fjthr) <= 4:
-            w = thr2weights(fjthr)
-    jw.extend(w)
-    return jw
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MonCounters.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MonCounters.py
deleted file mode 100644
index ab07626c9692..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1MonCounters.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from past.builtins import cmp
-
-
-class Lvl1MonCounters(object):
-
-    def __init__(self):
-
-        # list of counters
-        self.counters = []
-
-
-    def addCounter(self, c):
-        self.counters += [c]
-
-
-    def xml(self, ind=1, step=2):
-        s  = ind * step * ' ' + '<TriggerCounterList>\n'
-        for c in sorted(self.counters):
-            s  += c.xml(ind+1,step)
-        s += ind * step * ' ' + '</TriggerCounterList>\n'
-        return s
-
-
-class Lvl1MonCounter(object):
-
-    def __init__(self, name, multiplicity, montype):
-        self.name = name
-        self.multiplicity = int(multiplicity)
-        self.montype = montype
-        pass
-
-    def __cmp__(self, o):
-        if(self.name!=o.name):
-            return cmp(self.name,o.name)
-        return cmp(self.multiplicity,o.multiplicity)
-
-    def __lt__(self, o):
-        if(self.name!=o.name):
-            return self.name < o.name
-        return self.multiplicity < o.multiplicity
-  
-
-class Lvl1CtpinCounter(Lvl1MonCounter):
-
-    def __init__(self, name, multiplicity):
-        super(Lvl1CtpinCounter, self).__init__(name, multiplicity, 'CTPIN')
-        #print 'Initialize ctpin counter name="%i%s" triggerthreshold="%s" multi="%i"' % (self.multiplicity, self.name, self.name, self.multiplicity)
-
-    def xml(self, ind=1, step=2):
-        s  = ind * step * ' ' + '<TriggerCounter name="%i%s" type="CTPIN">\n' % (self.multiplicity, self.name)
-        s += ind * step * ' ' + '  <TriggerCondition name="%i%s" triggerthreshold="%s" multi="%i"/>\n' % (self.multiplicity, self.name, self.name, self.multiplicity)
-        s += ind * step * ' ' + '</TriggerCounter>\n'
-        return s
-
-
-
-class Lvl1CtpmonCounter(Lvl1MonCounter):
-
-    def __init__(self, name, multiplicity):
-        super(Lvl1CtpmonCounter, self).__init__(name, multiplicity, 'CTPMON')
-        #print 'Initialize ctpmon counter name="%i%s" triggerthreshold="%s" multi="%i"' % (self.multiplicity, self.name, self.name, self.multiplicity)
-
-    def xml(self, ind=1, step=2):
-        s  = ind * step * ' ' + '<TriggerCounter name="%i%s" type="CTPMON">\n' % (self.multiplicity, self.name)
-        s += ind * step * ' ' + '  <TriggerCondition name="%i%s" triggerthreshold="%s" multi="%i"/>\n' % (self.multiplicity, self.name, self.name, self.multiplicity)
-        s += ind * step * ' ' + '</TriggerCounter>\n'
-        return s
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Thresholds.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Thresholds.py
deleted file mode 100644
index 24583b2a7542..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Thresholds.py
+++ /dev/null
@@ -1,376 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-from .Limits import CaloLimits as CL
-IsolationOff = CL.IsolationOff
-
-from copy import deepcopy
-
-from past.builtins import cmp
-
-class ThresholdValue(object):
-
-    defaultThresholdValues = {}
-    
-    @staticmethod
-    def setDefaults(ttype, dic):
-        ThresholdValue.defaultThresholdValues[ttype] = dic
-        
-    @staticmethod
-    def getDefaults(ttype):
-        defaults = {
-            'etamin'  : -49,
-            'etamax'  :  49,
-            'phimin'  :   0,
-            'phimax'  :  64,
-            'priority':   0,
-            }
-        if ttype == 'EM' or ttype == 'TAU':
-            defaults.update({'priority':   1,
-                             'em_isolation' : IsolationOff,
-                             'had_isolation' : IsolationOff,
-                             'had_veto' : IsolationOff,
-                             'isobits' : '00000',
-                             'use_relIso' : False,
-                             })
-        if ttype == 'JET':
-            defaults.update({'window': 8})
-
-        if ttype in ThresholdValue.defaultThresholdValues: # user defined
-            defaults.update( ThresholdValue.defaultThresholdValues[ttype] )
-
-        return defaults
-
-    def __init__(self, thrtype, value, etamin, etamax, phimin, phimax, window=0, priority=1, name=''):
-        self.name   = name
-        self.type   = thrtype
-        self.value  = value
-        self.etamin = etamin
-        self.etamax = etamax
-        self.phimin = phimin
-        self.phimax = phimax
-        self.em_isolation = IsolationOff
-        self.had_isolation = IsolationOff
-        self.had_veto = IsolationOff
-        self.window = window
-        self.priority = priority
-
-
-    def setIsolation(self, em_isolation, had_isolation, had_veto, isobits, use_relIso):
-        self.em_isolation = em_isolation
-        self.had_isolation = had_isolation
-        self.had_veto = had_veto
-        self.isobits = isobits
-        self.use_relIso = use_relIso
-        if self.use_relIso:
-            self.had_veto=99
-            
-    def xml(self, ind=1, step=2):
-        s  = ind * step * ' ' + '<TriggerThresholdValue em_isolation="%i" etamin="%i" etamax="%i" had_isolation="%i" had_veto="%i" ' % (self.em_isolation, self.etamin, self.etamax, self.had_isolation, self.had_veto)
-        if (self.type=='EM' or self.type=='TAU') and self.use_relIso:
-            s += 'isobits="%s" ' % self.isobits
-        s += 'name="%s" phimin="%i" phimax="%i" priority="%i" thresholdval="%g" type="%s" window="%i"' % (self.name, self.phimin, self.phimax, self.priority, self.value, self.type, self.window)
-        if self.type=='JET':
-            s += ' windowSize="%s"' % ( 'LARGE'  if self.window==8 else 'SMALL' ) 
-        s += '/>\n'
-        return s
-
-    def __cmp__(self, o):
-        if(self.priority!=o.priority):
-            return cmp(self.priority,o.priority)
-        if(self.etamin!=o.etamin):
-            return cmp(self.etamin,o.etamin)
-        return cmp(self.name,o.name)
-
-
-    def __lt__(self, o):
-        return self.__cmp__ (o) < 0
-
-
-    def __str__(self):
-        return "name=%s, value=%s, eta=(%s-%s)" % (self.name, self.value, self.etamin, self.etamax)
-
-
-
-class LVL1Threshold(object):
-    __slots__ = ['name','ttype','mapping','active','seed','seed_ttype', 'seed_multi', 'bcdelay', 'cableinfo', 'thresholdValues']
-
-    def __init__(self, name, ttype, mapping = -1, active = 1, seed='', seed_type = '', seed_multi = 0, bcdelay = 0):
-        self.name            = name
-        self.ttype           = ttype
-        self.mapping         = int(mapping)
-        self.active          = int(active)
-        self.seed            = seed
-        self.seed_ttype      = seed_type
-        self.seed_multi      = int(seed_multi)
-        self.bcdelay         = int(bcdelay)
-        self.cableinfo       = None
-        self.thresholdValues = []
-
-    def __str__(self):
-        return self.name
-
-    def getVarName(self):
-        """returns a string that can be used as a varname"""
-        return self.name.replace('p','')
-
-    def setCableInput(self):
-        from .Cabling import Cabling
-        self.cableinfo = Cabling.getInputCable(self)
-        return self
-
-
-    def addThrValue(self, value, *args, **kwargs):
-        if self.ttype == 'MUON':
-            return self.addMuonThresholdValue(value, *args, **kwargs)
-        if self.ttype == 'EM' or self.ttype == 'TAU':
-            return self.addEMThresholdValue(value, *args, **kwargs)
-        if self.ttype == 'JET' or self.ttype == 'JF' or self.ttype == 'JB':
-            return self.addJetThresholdValue(value, *args, **kwargs)
-        if self.ttype in ['JE', 'TE', 'XE', 'XS', 'CALREQ', 'MBTSSI', 'TRT', 'ZDC', 'BCM', 'BCMCMB', 'BPTX', 'LUCID', 'NIM']:
-            return self.addEnergyThresholdValue(value, *args, **kwargs)
-
-        raise RuntimeError("addThrValue() not defined for threshold type %s" % self.ttype)
-
-
-    def addMuonThresholdValue(self, value, *args, **kwargs):
-        defargs = ThresholdValue.getDefaults('MUON')
-        # during the transition period we will need to keep supporting
-        # formerly positional arguments, which were etamin, etamax, phimin, and phimax
-        posargs = dict(zip(['etamin', 'etamax', 'phimin', 'phimax'], args))
-        # then we evaluate the arguments: first defaults, then positional arguments, then named arguments
-        p = deepcopy(defargs)
-        p.update(posargs)
-        p.update(kwargs)
-        
-        thrv = ThresholdValue(self.ttype, value, etamin = p['etamin'], etamax=p['etamax'], phimin=p['phimin'], phimax=p['phimax'],
-                              priority = p['priority'], name = self.name+'full')
-
-        self.thresholdValues.append(thrv)
-        return self
-
-
-    def addEMThresholdValue(self, value, *args, **kwargs):
-        # supporting both EM and TAU
-        defargs = ThresholdValue.getDefaults(self.ttype) 
-        posargs = dict(zip(['etamin', 'etamax', 'phimin', 'phimax', 'em_isolation', 'had_isolation', 'had_veto', 'priority', 'isobits', 'use_relIso'], args))
-        # then we evaluate the arguments: first defaults, then positional arguments, then named arguments
-        p = deepcopy(defargs)
-        p.update(posargs)
-        p.update(kwargs)
-        thrv = ThresholdValue(self.ttype, value,
-                              etamin = p['etamin'], etamax=p['etamax'], phimin=p['phimin'], phimax=p['phimax'],
-                              priority = p['priority'], name = self.name+'full')
-        thrv.setIsolation(em_isolation = p['em_isolation'], had_isolation = p['had_isolation'], had_veto = p['had_veto'], isobits = p['isobits'], use_relIso = p['use_relIso'])
-        self.thresholdValues.append(thrv)
-        return self
-
-
-    def addJetThresholdValue(self, value, *args, **kwargs):
-        defargs = ThresholdValue.getDefaults(self.ttype)
-        posargs = dict(zip(['etamin', 'etamax', 'phimin', 'phimax', 'window', 'priority'], args))
-        p = deepcopy(defargs)
-        p.update(posargs)
-        p.update(kwargs)
-        
-        thrv = ThresholdValue(self.ttype, value, etamin=p['etamin'], etamax=p['etamax'], phimin=p['phimin'], phimax=p['phimax'],
-                              window=p['window'], priority=p['priority'], name=self.name+'full')
-        self.thresholdValues.append(thrv)
-        return self
-
-
-    def addEnergyThresholdValue(self, value, *args, **kwargs):
-        defargs = ThresholdValue.getDefaults(self.ttype)
-        posargs = dict(zip(['etamin', 'etamax', 'phimin', 'phimax', 'priority'], args))
-        p = deepcopy(defargs)
-        p.update(posargs)
-        p.update(kwargs)
-        thrv = ThresholdValue(self.ttype, value, etamin=p['etamin'], etamax=p['etamax'], phimin=p['phimin'], phimax=p['phimax'],
-                              priority=p['priority'], name=self.name+'full')
-        self.thresholdValues.append(thrv)
-        return self
-
-    def thresholdInGeV(self):
-        if len(self.thresholdValues)==0:
-            return 0
-        else:
-            return float(self.thresholdValues[0].value)
-
-    def xml(self, ind=1, step=2):
-        """ Returns XML representation of the LVL1 Threshold """
-        from .Lvl1MenuUtil import idgen
-        seed       = ' seed="%s"' % self.seed if self.ttype=='ZB' else ''
-        seed_multi = ' seed_multi="%i"' % self.seed_multi if self.ttype=='ZB' else ''
-        bcdelay    = ' bcdelay="%i"' % self.bcdelay if self.ttype=='ZB' else ''
-        inputboard = "ctpcore" if self.cableinfo.isDirectIn else "ctpin"
-        s = ind * step * ' ' + '<TriggerThreshold active="%i" bitnum="%i" id="%i" mapping="%i" name="%s" type="%s" input="%s"%s%s%s version="1">\n' % \
-            (self.active, self.cableinfo.bitnum, int(idgen.get('TriggerThreshold')), self.mapping, self.name, self.ttype, inputboard, seed, seed_multi, bcdelay)
-        for thrv in sorted(self.thresholdValues):
-            s += thrv.xml(ind+1,step)
-        if self.cableinfo.isDirectIn:
-            s += (ind+1) * step * ' ' + '<Cable connector="%s" input="CTPCORE" name="%s">\n' % (self.cableinfo.connector, self.cableinfo.name)
-            s += (ind+2) * step * ' ' + '<Signal range_begin="%i" range_end="%i" clock="%i"/>\n' % (self.cableinfo.range_begin, self.cableinfo.range_end, self.cableinfo.clock)
-        else:
-            s += (ind+1) * step * ' ' + '<Cable connector="%s" input="%s" name="%s">\n' % (self.cableinfo.connector, self.cableinfo.slot, self.cableinfo.name)
-            s += (ind+2) * step * ' ' + '<Signal range_begin="%i" range_end="%i"/>\n' % (self.cableinfo.range_begin, self.cableinfo.range_end)
-        s += (ind+1) * step * ' ' + '</Cable>\n'
-        s += ind * step * ' ' + '</TriggerThreshold>\n'
-        return s
-
-
-
-class LVL1TopoInput(LVL1Threshold):
-    """Class representing a direct input cable to the CTPCORE
-    
-    In the menu it is treated like a threshold, only the naming
-    convention is less strict (allows"-" and can start with a number)
-    """
-
-    #<TriggerThreshold active="1" bitnum="1" id="148" mapping="0" name="4INVM9999-AJ0s6-AJ0s6" type="TOPO" input="ctpcore" version="1">
-    #  <Cable connector="CON1" input="CTPCORE" name="TOPO1">
-    #    <Signal range_begin="0" range_end="0" clock="0"/>
-
-
-    def __init__(self, triggerlines = None , thresholdName = None , mapping = None , connector = None , firstbit = None , numberOfBits = None , clock = None , ttype = 'TOPO' ):
-
-        if triggerlines is not None :
-            # from triggerline
-            from TriggerMenuMT.LVL1MenuConfig.L1Topo.TopoOutput import TriggerLine
-            if type(triggerlines)==list:
-                # multibit triggerlines
-                (commonNameOfLines, firstbit, numberOfBits, cable, clock, fpga, ordinal) = TriggerLine.checkMultibitConsistency(triggerlines)
-                super(LVL1TopoInput,self).__init__(name=commonNameOfLines, ttype=ttype, mapping=ordinal)
-
-                self.cable      = cable           # 0 .. 1
-                self.bitnum     = numberOfBits
-                self.bitOnCable = firstbit        # 0 .. 31
-                self.fpga       = fpga
-                self.clock      = clock
-
-            else:
-                triggerline = triggerlines
-                super(LVL1TopoInput,self).__init__(name=triggerline.trigger, ttype=ttype, mapping=triggerline.ordinal)
-                self.cable      = triggerline.cable      # 0 .. 1
-                self.bitnum     = 1
-                self.bitOnCable = triggerline.bit        # 0 .. 31
-                self.fpga       = triggerline.fpga       # 0 .. 1
-                self.clock      = triggerline.clock
-        else:
-            # from XML
-            super(LVL1TopoInput,self).__init__(name=thresholdName, ttype=ttype, mapping=mapping)
-            self.cable      = int(connector[-1]) # 0 .. 1
-            self.bitnum     = numberOfBits
-            self.bitOnCable = firstbit           # 0 .. 31
-            self.fpga       = -1
-            self.clock      = clock
-
-    def setCableInput(self):
-        from .Cabling import Cabling
-        self.cableinfo = Cabling.getInputCable(self)
-        return self
-
-    def getVarName(self):
-        """returns a string that can be used as a varname"""
-        return ("TOPO_" + self.name).replace('p','').replace('-','_') # we can not have '.' or '-' in the variable name
-
-
-class LVL1Thresholds(object):
-
-    @staticmethod
-    def cableMapping(type, range_begin):
-        """Calculate the mapping of the input cable of the threshold to the
-        CTP from its (type, range_begin)"""
-        mapping = -1
-        if type == 'MUON':
-            mapping = range_begin/3
-        elif type=='EM':
-            mapping = range_begin/3
-        elif type=='TAU':
-            mapping = range_begin/3
-        elif type=='JET':
-            mapping = range_begin/3
-        elif type=='JE':
-            mapping = range_begin-24
-        elif type=='JB' or type=='FJL':
-            mapping = range_begin/2
-        elif type=='JF' or type=='FJR':
-            mapping = (range_begin-8)/2
-        elif type=='TE':
-            mapping = range_begin
-        elif type=='XE':
-            mapping = range_begin-4
-        return mapping
-
-
-    @staticmethod
-    def compThreshold(thr1, thr2):
-        """
-        Comparison of two LVL1Thresholds for the purpose of sorting
-        """
-        # First sort by type
-        if thr1.ttype!= thr2.ttype:
-            return cmp(thr1.ttype,thr2.ttype)
-
-        # Second sort by mapping if it's not -1
-        if (thr1.mapping >= 0 or thr2.mapping >= 0) and (thr1.mapping != thr2.mapping):
-            return cmp( thr1.mapping, thr2.mapping )
-
-        # If both mappings are -1 sort by threshold value and then threshold name
-        import re
-        thrv1, thrv2 = 0, 0
-        re_thrv = re.compile(r'(\d+)')
-        mg = re_thrv.search(thr1.name)
-        if mg:
-            thrv1 = int(mg.group(1))
-        mg = re_thrv.search(thr2.name)
-        if mg:
-            thrv2 = int(mg.group(1))
-
-        if thrv1 != thrv2:
-            return cmp(thrv1,thrv2)
-
-        return cmp(thr1.name, thr2.name)
-
-    # LVL1Thresholds constructor
-    def __init__(self):
-        self.thresholds = []
-
-    def __iter__(self):
-        return self.thresholds.__iter__()
-
-    def __call__(self):
-        return self.thresholds
-
-    def __iadd__(self, thr):
-        if thr is None:
-            return self
-        if self.thresholdOfName(thr.name) is None:
-            self.thresholds += [ thr ]
-        return self
-    
-    def __contains__(self, thrname):
-        return thrname in [x.name for x in self.thresholds] 
-    
-    def __len__(self):
-        return len(self.thresholds)
-
-    def thresholdNames(self):
-        return [x.name for x in self.thresholds]
-
-    def allThresholdsOf(self, type):
-        return [thr for thr in self.thresholds if thr.ttype==type]
-
-    def thresholdOfName(self, name):
-        for thr in self.thresholds:
-            if thr.name == name:
-                return thr
-        return None
-
-    def xml(self, ind=1, step=2):
-        import functools
-        self.thresholds.sort(key=functools.cmp_to_key(LVL1Thresholds.compThreshold))
-        s = ind * step * ' ' + '<TriggerThresholdList>\n'
-        for thr in self.thresholds:
-            s += thr.xml(ind+1,step)
-        s += ind * step * ' ' + '</TriggerThresholdList>\n'
-        return s
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/MuctpiInfo.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/MuctpiInfo.py
deleted file mode 100644
index 1dc2df92f99b..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/MuctpiInfo.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-class MuctpiInfo(object):
-    def __init__(self, low_pt=0, high_pt=0, max_cand=13):
-        self.low_pt = low_pt
-        self.high_pt = high_pt
-        self.max_cand = max_cand
-
-    def xml(self, ind=1, step=2):
-        return ind * step * ' ' + '<MuctpiInfo name="muctpi" low_pt="%i" high_pt="%i" max_cand="%i"/>\n' % (self.low_pt, self.high_pt, self.max_cand)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/PrescaleHelper.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/PrescaleHelper.py
deleted file mode 100644
index 39dcb8eeb366..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/PrescaleHelper.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-"""
-The prescaling uses a pseudo-random binary sequence generator of 24 bit width (31 bit internal)
-
-- Prescales are defined by a cutoff (C).
-- Each time a random number (R) is generated.
-- C, R are between 0 and 2**24-1
-
-- The trigger item is accepted if R>=C. The prescale (PS) corresponding to a cutoff C is PS = (2**24-1)/(2**24-C)
-
-
-In this scheme only number that are powers of 2 can be represented
-exactly. Effective prescales are typically non-integer.  Integer
-numbers can~t be represented exactly but have an error which grows with the
-prescale)
-"""
-
-maxPrescaleCut = 0xFFFFFF  # 2**24 - 1
-
-def getCutFromPrescale(prescale):
-    """
-    C = 2**24-(2**24-1)/PS
-    
-    PS =       1 --> C = 1
-    PS =       2 --> C = 8388609
-    PS =      10 --> C = 15099495
-    PS =    1000 --> C = 16760439
-    PS =   10000 --> C = 16775539
-    PS = 2**24-1 --> C = 2**24-1
-    """
-
-    if prescale==0:
-        raise RuntimeError("L1 Prescale value of 0 is not allowed")
-    
-    sign = -1 if prescale<0 else 1
-    prescale = abs(prescale)
-    cut=sign * ( 0x1000000 - (0xFFFFFF/prescale) )
-    cut = round( cut )
-    if  prescale > 0xFFFFFF:
-        cut=sign * (0x1000000-1)
-
-    return int(cut)
-
-def getPrescaleFromCut(cut):
-    """
-    PS = (2**24-1)/(2**24-C)
-
-    C =       1 --> PS =     1
-    C = 2**24-1 --> PS = 2**24-1
-    """
-    
-    if cut==0:
-        raise RuntimeError("L1 Prescale cut of 0 is not allowed, use cut=1 for a prescale value of 1")
-
-    sign = -1 if cut<0 else 1
-    cut = abs(cut)
-    return (sign * 0xFFFFFF) / ( 0x1000000 - cut )
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/XMLMenuReader.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/XMLMenuReader.py
deleted file mode 100644
index 89aa042e768a..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/XMLMenuReader.py
+++ /dev/null
@@ -1,258 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from Lvl1Thresholds import LVL1Threshold, LVL1TopoInput, ThresholdValue
-from Lvl1MenuItems import LVL1MenuItem
-
-from PrescaleHelper import getCutFromPrescale
-
-from Logic import Logic
-from Lvl1Condition import Lvl1InternalTrigger, ThrCondition
-from CaloInfo import MinimumTOBPt
-from Lvl1MonCounters import Lvl1CtpinCounter, Lvl1CtpmonCounter
-
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-
-def readLogic( logicElement, thresholdMap ):
-
-    if logicElement.tag == 'InternalTrigger':
-        return Lvl1InternalTrigger( logicElement.get('name') )
-
-    if logicElement.tag == 'TriggerCondition':
-        thr = thresholdMap[ logicElement.get('triggerthreshold') ]
-        return ThrCondition(thr, int(logicElement.get('multi')) )
-    
-    L = Logic()
-    if logicElement.tag == 'AND':
-        L.logic = Logic.AND
-    elif logicElement.tag == 'OR':
-        L.logic = Logic.OR
-    elif logicElement.tag == 'NOT':
-        L.logic = Logic.NOT
-    else:
-        raise RuntimeError("ERROR: don't understand tag %s" % logicElement.tag)
-
-    for c in logicElement.getchildren():
-        L.subConditions += [ readLogic(c, thresholdMap) ]
-
-    return L
-    
-
-
-def readMenuFromXML(l1menu, filename):
-
-    log.info("Reading L1 menu from %s", filename)
-    l1menu.l1menuFromXML = True
-
-    from XMLReader import L1MenuXMLReader
-    reader = L1MenuXMLReader(filename)
-
-
-    if 'ctpVersion' in reader.LVL1Config:
-        from TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1Flags import Lvl1Flags
-        Lvl1Flags.CTPVersion = int ( reader.LVL1Config['ctpVersion'] )
-
-
-    l1menu.menuName = reader.LVL1Config['name']
-    l1menu.items.menuName = reader.LVL1Config.TriggerMenu['name']
-    l1menu.items.pssName = reader.LVL1Config.PrescaleSet['name']
-
-    prioMap = {}
-    if hasattr(reader.LVL1Config,"PrioritySet"): # new files have no more PrioritySet
-        for prio in reader.LVL1Config.PrioritySet.Prioritys:
-            prioMap[int(prio['ctpid'])] = 0 if prio.strippedText()=="HIGH" else 1
-            
-
-
-    # Prescales
-    psMap = {}
-    for ps in reader.LVL1Config.PrescaleSet.Prescales:
-        if 'cut' in ps:
-            psMap[int(ps['ctpid'])] = int(ps['cut'], 16)  # new style
-        else:
-            psMap[int(ps['ctpid'])] = getCutFromPrescale(int(ps.strippedText())) # old style
-
-
-    # Thresholds from the TriggerThresholds section
-    for x in reader.getL1Thresholds():
-        seed = seed_type = ''
-        seed_multi = bcdelay = 0
-
-        if x['type']=='ZB':
-            seed       = x['seed']
-            seed_multi = x['seed_multi']
-            bcdelay    = x['bcdelay']
-            
-            seed_type  = [t for t in reader.getL1Thresholds() if t['name']==seed][0]['type']
-            
-        if x['type']=='TOPO' or x['type']=='ALFA':
-            ca = x.Cable
-            si = ca.Signal
-            firstbit = int(si['range_begin'])
-            lastbit = int(si['range_end'])
-
-            thr = LVL1TopoInput( thresholdName = x['name'], ttype = x['type'], mapping = int(x['mapping']), connector = ca['connector'],
-                                 firstbit = firstbit, numberOfBits = lastbit - firstbit + 1, clock = int(si['clock']))
-        else:
-            thr = LVL1Threshold( name=x['name'], ttype=x['type'], mapping = x['mapping'], active = x['active'],
-                                 seed_type = seed_type, seed = seed, seed_multi = seed_multi, bcdelay = bcdelay)
-
-
-        ca = x.Cable
-        thr.setCableInput()
-        #print "x[bitnum]", x['bitnum']
-        #print "type x[bitnum]", type(x['bitnum'])
-        #print "x['type']", x['type']
-
-
-        # overwrite cable info with data from xml file
-        si = ca.Signal
-        thr.cableinfo.bitnum      = int(x['bitnum'])
-        thr.cableinfo.name        = ca['name']
-        thr.cableinfo.slot        = ca['input'] if 'input' in ca else ca['ctpin']
-        thr.cableinfo.connector   = ca['connector']
-        thr.cableinfo.range_begin = int( si['range_begin'] )
-        thr.cableinfo.range_end   = int( si['range_end'] )
-
-        if hasattr(x,'TriggerThresholdValues'):
-            for xV in x.TriggerThresholdValues:
-                try:
-                    value = int(xV['thresholdval'])
-                except Exception:
-                    value = float(xV['thresholdval'])
-
-                thrVal = ThresholdValue(thrtype = xV['type'], value = value,
-                                        etamin = int(xV['etamin']), etamax = int(xV['etamax']), phimin = int(xV['phimin']), phimax = int(xV['phimax']),
-                                        window = int(xV['window']), priority = int(xV['priority']), name = xV['name'])
-
-                if xV['type']=='EM' or xV['type']=='TAU':
-                    em_isolation = int(xV['em_isolation'])
-                    had_isolation = int(xV['had_isolation'])
-                    had_veto = int(xV['had_veto'])
-                    isobits = xV['isobits'] if 'isobits' in xV else '00000'
-                    use_relIso = xV['use_relIso'] if 'use_relIso' in xV else True
-                    thrVal.setIsolation(em_isolation, had_isolation, had_veto, isobits, use_relIso)
-                
-                thr.thresholdValues.append(thrVal)
-
-        l1menu.thresholds.thresholds += [ thr ]
-
-    # for faster lookup, needed when building the items
-    thresholdMap = {}
-    for thr in l1menu.thresholds:
-        thresholdMap[thr.name] = thr
-
-    # Items
-    for itemelem in reader.getL1Items():
-        ctpid            = int(itemelem['ctpid'])
-        partition        = int(itemelem['partition'])
-        complex_deadtime = int(itemelem['complex_deadtime'] if 'complex_deadtime' in itemelem else prioMap[ctpid])
-        psCut            = psMap[ctpid]
-        triggerType      = int( itemelem['trigger_type'], 2 )
-
-        item = LVL1MenuItem( itemelem['name'], ctpid = ctpid, complex_deadtime = complex_deadtime, psCut = psCut).setTriggerType( triggerType )
-        item.partition = partition
-        
-        # read the thresholds for each item
-        if hasattr(itemelem,'AND'):
-            topLevelLogic = readLogic( itemelem.AND.element, thresholdMap )
-        else:
-            # L1_BGRP0 has no AND around, it is a single InternalTrigger
-            topLevelLogic = readLogic( itemelem.InternalTrigger.element, thresholdMap )
-        item.setLogic(topLevelLogic)
-
-        if 'monitor' in itemelem and itemelem['monitor'].startswith('LF'):
-            lf,hf = [ int(m[-3:],2) for m in itemelem['monitor'].split('|') ]
-            from TriggerMenuMT.LVL1MenuConfig.LVL1Menu.MonitorDef import MonitorDef
-            item.addMonitor(lf, MonitorDef.LOW_FREQ)
-            item.addMonitor(hf, MonitorDef.HIGH_FREQ)
-
-        l1menu.addItem( item )
-
-
-
-    # Bunch group set
-    bgs = reader.LVL1Config.BunchGroupSet
-    l1menu.CTPInfo.setBunchGroupSetName(bgs['name'])
-    lastBGNumber = max([int(bg['internalNumber']) for bg in reader.LVL1Config.BunchGroupSet.BunchGroups])
-    l1menu.CTPInfo.bunchGroupSet.resize(1+lastBGNumber)
-    for bg in reader.LVL1Config.BunchGroupSet.BunchGroups:
-        bunches = []
-        if hasattr(bg,'Bunch'):
-            for b in bg.Bunchs:
-                bunches.append( int(b['bunchNumber']) )
-        l1menu.CTPInfo.addBunchGroup( bg['name'], int(bg['internalNumber']), bunches )
-
-
-    # Random
-    rndm = reader.LVL1Config.Random
-    if 'name' in rndm:
-        # old style
-        l1menu.CTPInfo.random.name  = rndm['name']
-        l1menu.CTPInfo.random.rate1 = int( rndm['rate1'] )
-        l1menu.CTPInfo.random.rate2 = int( rndm['rate2'] )
-        l1menu.CTPInfo.random.seed1 = int( rndm['seed1'] )
-        l1menu.CTPInfo.random.seed2 = int( rndm['seed2'] )
-    else:
-        # new style
-        for i in range(4):
-            l1menu.CTPInfo.random.names[i] = rndm['name%i' % i]
-            l1menu.CTPInfo.random.cuts[i]  = int( rndm['cut%i' % i] )
-
-
-    # Deadtime
-    # has been removed
-
-    # CaloInfo
-    ci = reader.LVL1Config.CaloInfo
-    l1menu.CaloInfo.name = ci['name']
-    try:
-        l1menu.CaloInfo.setGlobalEmScale(float(ci['global_em_scale']))
-        l1menu.CaloInfo.setGlobalJetScale(float(ci['global_jet_scale']))
-    except Exception:
-        pass # will resolve itself once we have the em and jet scales in all XML
-
-    if hasattr(reader.LVL1Config.CaloInfo,"JetWeights"): # new CaloInfo have no more JetWeights
-        # jet weights
-        jw = [x[1] for x in sorted([ ( int(jw['num']),int(jw.strippedText())) for jw in reader.LVL1Config.CaloInfo.JetWeights])]
-        l1menu.CaloInfo.setJetWeights(jw)
-
-
-
-    for iso in reader.LVL1Config.CaloInfo.Isolations:
-        isoGroupName = iso['thrtype']
-        for p in iso.Parametrizations:
-            l1menu.CaloInfo.isolation[isoGroupName].addIsolation( isobit=p['isobit'],
-                                                                  offset=p['offset'],
-                                                                  slope=p['slope'],
-                                                                  mincut=p['mincut'],
-                                                                  upperlimit=p['upperlimit'],
-                                                                  etamin=p['etamin'],
-                                                                  etamax=p['etamax'],
-                                                                  priority=p['priority'])
-
-
-    for mintobpt in reader.LVL1Config.CaloInfo.MinimumTOBPts:
-        l1menu.CaloInfo.minTOBPt += [ MinimumTOBPt( thrtype = mintobpt['thrtype'],
-                                                    ptmin = mintobpt['ptmin'],
-                                                    window = mintobpt['window'] if 'window' in mintobpt else 0,
-                                                    etamin  = mintobpt['etamin'],
-                                                    etamax = mintobpt['etamax'],
-                                                    priority = mintobpt['priority']) ]
-
-
-    # Trigger counters for monitoring
-    for triggercounter in reader.LVL1Config.TriggerCounterList.TriggerCounters:
-        counterType = triggercounter['type']
-
-        triggerCondition = triggercounter.TriggerCondition
-
-        if counterType=='CTPIN':
-            l1menu.counters.addCounter( Lvl1CtpinCounter(  triggerCondition['triggerthreshold'], triggerCondition['multi']) )
-        elif counterType=='CTPMON':
-            l1menu.counters.addCounter( Lvl1CtpmonCounter(  triggerCondition['triggerthreshold'], triggerCondition['multi']) )
-        else:
-            raise RuntimeError("Monitoring counter of unknown type '%s'" % counterType)
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/XMLReader.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/XMLReader.py
deleted file mode 100755
index a576831e48b9..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/XMLReader.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-
-import xml.etree.cElementTree as ET
-
-class TrigXMLElement(object):
-    def __init__(self,element):
-        self.element = element
-        self.tag = element.tag
-        self.items = element.items()
-        self.children = element.getchildren()
-        self.readchildren()
-    def __str__(self):
-        s = "<%s %s>" % (self.tag, " ".join(['%s="%s"' % x for x in self.items]))
-        return s
-    def __repr__(self):
-        return self.tag
-
-    def __contains__(self,k):
-        return k in dict(self.items)
-
-    def __getitem__(self,k):
-        return dict(self.items)[k]
-
-    def strippedText(self):
-        return self.element.text.strip()
-
-    def readchildren(self):
-        self.childtags = []
-        self._childtagdict = {}
-        for c in self.children:
-            self._childtagdict.setdefault(c.tag,[]).append(TrigXMLElement(c))
-            if c.tag not in self.childtags:
-                self.childtags += [c.tag]
-        for t in self.childtags:
-            self.__dict__['%ss'%t] = self._childtagdict[t]
-            if len(self._childtagdict[t])==1:
-                self.__dict__['%s'%t] = self._childtagdict[t][0]
-
-class TrigXMLDocumentReader(object):
-    def __init__(self,filename):
-        self.filename=filename
-        from TrigConfigSvc.TrigConfigSvcConfig import findFileInXMLPATH
-        self.read(findFileInXMLPATH(filename))
-    def read(self,filename):
-        self.doc = ET.parse(filename)
-        root = TrigXMLElement(self.doc.getroot())
-        self.__dict__[root.tag] = root
-
-
-class L1MenuXMLReader(TrigXMLDocumentReader):
-    def __init__(self,filename):
-        super(L1MenuXMLReader,self).__init__(filename)
-    def getL1Items(self):
-        return self.LVL1Config.TriggerMenu.TriggerItems
-    def getL1Thresholds(self):
-        return self.LVL1Config.TriggerThresholdList.TriggerThresholds
-
-if __name__ == "__main__":
-    l1menu = L1MenuXMLReader("TriggerMenuXML/LVL1config_Cosmic2009_v1_7-bit_trigger_types.xml")
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/CaloDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/CaloDef.py
deleted file mode 100644
index ebbe5894510b..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/CaloDef.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-class CaloDef(object):
-
-    @staticmethod
-    def defineGlobalSettings(tc, tag=None):
-
-        from ..LVL1.CaloInfo import MinimumTOBPt, CaloInfo
-
-        caloInfo = tc.menu.CaloInfo
-        menuName = tc.menuName
-        # global scale
-        em_scale=2
-        if hasattr(TriggerFlags, 'useRun1CaloEnergyScale'):
-            if TriggerFlags.useRun1CaloEnergyScale :
-                em_scale=1
-
-        caloInfo.setGlobalEmScale(em_scale)
-        caloInfo.setGlobalJetScale(1)
-
-        # XS parameterization
-        # updated by ATR-10664
-        caloInfo.setXsParams( xsSigmaScale=1264, xsSigmaOffset=1496, xeMin=11, xeMax=63, teSqrtMin=4, teSqrtMax=63 )
-        #caloInfo.setXsParams( xsSigmaScale=660, xsSigmaOffset=1561, xeMin=11, xeMax=63, teSqrtMin=4, teSqrtMax=63 )
-        #caloInfo.setXsParams( xsSigmaScale=1150, xsSigmaOffset=1640, xeMin=11, xeMax=63, teSqrtMin=4, teSqrtMax=63 )
-
-        # isolation parametrization
-        """
-        (from Alan Watson)
-        Isolation <= ET/m + offset
-        where
-        offset: signed integer 100 MeV precision (offset = 25 means 2.5 GeV)
-        slope: signed integer for a slope of m the isolation cut loosens by 1 GeV for every m GeV increase in the cluster ET
-        
-        E.g: with offset=-52 slope=35 means isolation <= ET/3.5 - 5.2
-
-
-        The following defaults are applied if not specified
-        mincut     : 0,
-        upperlimit : 255,
-        etamin     : -49,
-        etamax     : 49,
-        priority   : 0
-        """
-
-
-        # for unused bits, fill with the loosest existing option (ATR-13892)
-        caloInfo.isolation["EMIsoForEMthr"] .addIsolation( isobit=1, slope=0, offset=0, upperlimit=0)\
-                                            .addIsolation( isobit=2, slope=80, offset=-18, mincut=20, upperlimit=50)\
-                                            .addIsolation( isobit=3, slope=80, offset=-18, mincut=20, upperlimit=50)\
-                                            .addIsolation( isobit=4, slope=80, offset=-18, mincut=20, upperlimit=50)\
-                                            .addIsolation( isobit=5, slope=80, offset=-18, mincut=20, upperlimit=50)
-
-        caloInfo.isolation["HAIsoForEMthr"] .addIsolation( isobit=1, slope=230, offset=-2, mincut=10, upperlimit=50)\
-                                            .addIsolation( isobit=2, slope=0, offset=0, upperlimit=0)\
-                                            .addIsolation( isobit=3, slope=230, offset=-2, mincut=10, upperlimit=50)\
-                                            .addIsolation( isobit=4, slope=230, offset=-2, mincut=10, upperlimit=50)\
-                                            .addIsolation( isobit=5, slope=230, offset=-2, mincut=10, upperlimit=50)
-
-        caloInfo.isolation["EMIsoForTAUthr"] .addIsolation( isobit=1, slope=100, offset=30, upperlimit=60 )\
-                                             .addIsolation( isobit=2, slope=100, offset=20, upperlimit=60 )\
-                                             .addIsolation( isobit=3, slope=100, offset=15, upperlimit=60 )\
-                                             .addIsolation( isobit=4, slope=0, offset=40, upperlimit=124 )\
-                                             .addIsolation( isobit=5, slope=100, offset=30, upperlimit=60 )
-
-
-
-        # min PT for TOBs
-        if "HI_" in menuName:
-            caloInfo.minTOBPt += [ MinimumTOBPt(thrtype="EM", ptmin=7) ]
-            caloInfo.minTOBPt += [ MinimumTOBPt(thrtype="TAU", ptmin=12) ]
-            caloInfo.minTOBPt += [ MinimumTOBPt(thrtype="JETS", ptmin=10, window=4) ]
-            caloInfo.minTOBPt += [ MinimumTOBPt(thrtype="JETL", ptmin=10, window=8) ]
-        else:
-            caloInfo.minTOBPt += [ MinimumTOBPt(thrtype="EM", ptmin=3) ]
-            caloInfo.minTOBPt += [ MinimumTOBPt(thrtype="TAU", ptmin=8) ]
-            caloInfo.minTOBPt += [ MinimumTOBPt(thrtype="JETS", ptmin=12, window=4) ]
-            caloInfo.minTOBPt += [ MinimumTOBPt(thrtype="JETL", ptmin=12, window=8) ]
-            
-        # jet weights
-        if len( tc.menu.thresholds.allThresholdsOf('JET') ) <= 8:
-            caloInfo.setJetWeights( CaloInfo.calcJetWeightsFromThresholds(tc) )  # no more jet weights in the new menu
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py
deleted file mode 100755
index 649f18427963..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ItemDef.py
+++ /dev/null
@@ -1,1586 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-#
-# Disable flake8 checking due to the use of 'exec':
-# flake8: noqa
-#
-
-from __future__ import print_function
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-# The trigger types
-from ..LVL1.TriggerTypeDef import TT
-from ..LVL1.Limits import Limits
-from ..LVL1.Logic import Logic, Not
-from ..LVL1.Lvl1MenuItems import LVL1MenuItem
-from ..LVL1.Lvl1Condition import ThrCondition, Lvl1InternalTrigger
-
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-class ItemDef(object):
-    """
-    Defines any items that might be needed in Run2
-    """
-
-    @staticmethod
-    def registerItems(tm):
-        """Register LVL1 thresholds for further use"""
-
-        # register all thresholds ...
-        from .ThresholdDef import ThresholdDef
-        ThresholdDef.registerThresholds(tm)
-
-        class d : pass
-
-        # ... and make them accessible by their name
-        for thr in tm.registeredThresholds.values():
-            setattr (d, thr.getVarName(), ThrCondition(thr))
-            
-        # InternalTriggers
-        for i in range( Limits.NumBunchgroups ):
-            setattr (d, "BGRP%i"%i, Logic(Lvl1InternalTrigger('BGRP%i'%i)))
-
-        for i in range( Limits.NumRndmTriggers ):
-            setattr (d, "RNDM%i"%i, Logic(Lvl1InternalTrigger('RNDM%i'%i)))
-
-
-        LVL1MenuItem.l1configForRegistration = tm  # from now on all new LVL1MenuItems are registered to tm
-
-        # Setting up bunch group and BPTX conditions
-        physcond            = d.BGRP0 & d.BGRP1
-        calibcond           = d.BGRP0 & d.BGRP2
-        cosmiccond          = d.BGRP0 & d.BGRP3
-        unpaired_isocond    = d.BGRP0 & d.BGRP4 # unpaired isolated (satellite bunches)
-        unpaired_nonisocond = d.BGRP0 & d.BGRP5 # unpaired non-isolated (parasitic bunches)
-        firstempty          = d.BGRP0 & d.BGRP6
-        unpairedRcond       = d.BGRP0 & d.BGRP7 # unpaired beams 1 oR beam 2
-        bgrp7cond           = d.BGRP0 & d.BGRP7 # No unpaired anymore
-        bgrp9cond           = d.BGRP0 & d.BGRP9 
-        bgrp11cond          = d.BGRP0 & d.BGRP11 
-        bgrp12cond          = d.BGRP0 & d.BGRP12
-        alfacalib           = d.BGRP0 & d.BGRP10
-        abortgap            = d.BGRP0 & d.BGRP8
-        
-        # partition 1
-        bgrpcond1           = d.BGRP0 & d.BGRP11
-        calibcond1          = d.BGRP0 & d.BGRP12
-
-        # partition 2
-        bgrpcond2           = d.BGRP0 & d.BGRP14
-
-
-        LVL1MenuItem.currentPartition = 1
-
-        # E/gamma ctpid=[0:0x1f]
-        LVL1MenuItem('L1_EM3'       ).setLogic( d.EM3        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3HI'     ).setLogic( d.EM3HI      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM4'       ).setLogic( d.EM4        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM5'       ).setLogic( d.EM5        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM7'       ).setLogic( d.EM7        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM10'      ).setLogic( d.EM10       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM24VHI'   ).setLogic( d.EM24VHI    & physcond).setTriggerType( TT.calo)
-        LVL1MenuItem('L1_EM8'       ).setLogic( d.EM8        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM12'      ).setLogic( d.EM12       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM14'      ).setLogic( d.EM14       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15'      ).setLogic( d.EM15       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15_BGRP7').setLogic( d.EM15       & bgrp7cond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VHI'   ).setLogic( d.EM15VHI    & physcond).setTriggerType( TT.calo )   
-        LVL1MenuItem('L1_EM16'      ).setLogic( d.EM16       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM8VH'     ).setLogic( d.EM8VH      & physcond).setTriggerType( TT.calo )           # noqa: F821
-        LVL1MenuItem('L1_EM10VH'    ).setLogic( d.EM10VH     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20A'     ).setLogic( d.EM20A      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20C'     ).setLogic( d.EM20C      & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH'    ).setLogic( d.EM15VH     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM18'      ).setLogic( d.EM18       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM18VH'    ).setLogic( d.EM18VH     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM18VHI'   ).setLogic( d.EM18VHI    & physcond).setTriggerType( TT.calo )      # noqa: F821
-        LVL1MenuItem('L1_EM20'      ).setLogic( d.EM20       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20VH'    ).setLogic( d.EM20VH     & physcond).setTriggerType( TT.calo )  
-        LVL1MenuItem('L1_EM20VHI'   ).setLogic( d.EM20VHI    & physcond).setTriggerType( TT.calo )  # isolation not yet defined
-        LVL1MenuItem('L1_EM30VHI'   ).setLogic( d.EM30VHI    & physcond).setTriggerType( TT.calo )  # isolation not yet defined
-        LVL1MenuItem('L1_EM22'      ).setLogic( d.EM22       & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM22VH'    ).setLogic( d.EM22VH     & physcond).setTriggerType( TT.calo )    # noqa: F821
-        LVL1MenuItem('L1_EM22VHI'   ).setLogic( d.EM22VHI    & physcond).setTriggerType( TT.calo )  # isolation not yet defined
-        LVL1MenuItem('L1_EM24VHIM'  ).setLogic( d.EM24VHIM   & physcond).setTriggerType( TT.calo )    # noqa: F821
-        LVL1MenuItem('L1_EM50V'     ).setLogic( d.EM50V      & physcond).setTriggerType( TT.calo )
-
-
-        # 2xEM, 3xEM
-        LVL1MenuItem('L1_2EM3'           ).setLogic( d.EM3.x(2)             & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM5'           ).setLogic( d.EM5.x(2)             & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM7'           ).setLogic( d.EM7.x(2)             & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM10'          ).setLogic( d.EM10.x(2)            & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM10VH'        ).setLogic( d.EM10VH.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM15'          ).setLogic( d.EM15.x(2)            & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM15VH'        ).setLogic( d.EM15VH.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM15VHI'       ).setLogic( d.EM15VHI.x(2)         & physcond).setTriggerType( TT.calo )        # noqa: F821
-        LVL1MenuItem('L1_2EM20VH'        ).setLogic( d.EM20VH.x(2)          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM7_2EM3'       ).setLogic( d.EM7 & d.EM3.x(2)     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM12_2EM3'      ).setLogic( d.EM12 & d.EM3.x(2)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20VH_2EM7'    ).setLogic( d.EM20VH & d.EM7.x(2)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20VH_3EM10VH'        ).setLogic( d.EM20VH & d.EM10VH.x(3)                   & physcond).setTriggerType( TT.calo )        
-        LVL1MenuItem('L1_EM20VH_2EM10VH_3EM8VH' ).setLogic( d.EM20VH & d.EM10VH.x(2) & d.EM8VH.x(3)    & physcond).setTriggerType( TT.calo )
-
-        # 4xEM
-        LVL1MenuItem('L1_EM15VH_3EM7'         ).setLogic( d.EM15VH & d.EM7.x(3)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_3EM8VH'       ).setLogic( d.EM15VH & d.EM8VH.x(3)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_3EM10VH'      ).setLogic( d.EM15VH & d.EM10VH.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_2EM10VH_3EM7' ).setLogic( d.EM15VH & d.EM10VH.x(2) & d.EM7.x(3) & physcond).setTriggerType( TT.calo )
-
-        # EM and jet
-        LVL1MenuItem('L1_JJ15p23ETA49').setLogic( d.JJ1523ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15p23ETA49' ).setLogic( d.J1523ETA49  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15p24ETA49' ).setLogic( d.J1524ETA49  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15p31ETA49' ).setLogic( d.J1531ETA49  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20p28ETA31' ).setLogic( d.J2028ETA31  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20p31ETA49' ).setLogic( d.J2031ETA49  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30p31ETA49' ).setLogic( d.J3031ETA49  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40p0ETA25'  ).setLogic( d.J400ETA25   & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J50p31ETA49' ).setLogic( d.J5031ETA49  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J70p31ETA49' ).setLogic( d.J7031ETA49  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J100p31ETA49').setLogic( d.J10031ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15p0ETA25'  ).setLogic( d.J150ETA25   & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20p0ETA28'  ).setLogic( d.J200ETA28   & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J25p0ETA23'  ).setLogic( d.J250ETA23   & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J35p0ETA23'  ).setLogic( d.J350ETA23   & physcond).setTriggerType(TT.calo)
-
-        # HI
-        LVL1MenuItem('L1_EM3_NZ'         ).setLogic( d.EM3      & Not(d.ZDC_AND) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM3_NZ'        ).setLogic( d.EM3.x(2) & Not(d.ZDC_AND) & physcond).setTriggerType( TT.calo )   
-
-        LVL1MenuItem('L1_EM3_NL'         ).setLogic( d.EM3      & Not(d.LUCID_A) & Not(d.LUCID_C) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2EM3_NL'        ).setLogic( d.EM3.x(2) & Not(d.LUCID_A) & Not(d.LUCID_C) & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_EM3_MV'         ).setLogic( d.EM3      & Not(d.MBTS_A & d.MBTS_C) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3_MV_VTE50'   ).setLogic( d.EM3      & Not(d.MBTS_A & d.MBTS_C) & Not(d.TE50) & physcond).setTriggerType( TT.calo ) 
-
-        LVL1MenuItem('L1_EM3_TE50'       ).setLogic( d.EM3      & d.TE50 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3_VTE50'      ).setLogic( d.EM3      & Not(d.TE50) & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_EM3_UNPAIRED_ISO'   ).setLogic(d.EM3 & unpaired_isocond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3_UNPAIRED_NONISO').setLogic(d.EM3 & unpaired_nonisocond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3_EMPTY'          ).setLogic(d.EM3 & cosmiccond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM3_FIRSTEMPTY'     ).setLogic(d.EM3 & firstempty).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_EM5_EMPTY'          ).setLogic(d.EM5 & cosmiccond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM5_UNPAIRED_ISO'   ).setLogic(d.EM5 & unpaired_isocond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM5_UNPAIRED_NONISO').setLogic(d.EM5 & unpaired_nonisocond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM5_FIRSTEMPTY'     ).setLogic(d.EM5 & firstempty).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_EM7_EMPTY'          ).setLogic(d.EM7 & cosmiccond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM7_UNPAIRED_ISO'   ).setLogic(d.EM7 & unpaired_isocond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM7_UNPAIRED_NONISO').setLogic(d.EM7 & unpaired_nonisocond).setTriggerType( TT.calo ) 
-        LVL1MenuItem('L1_EM7_FIRSTEMPTY'     ).setLogic(d.EM7 & firstempty).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_EM20VH_FIRSTEMPTY'    ).setLogic( d.EM20VH & firstempty).setTriggerType( TT.calo )  
-        LVL1MenuItem('L1_EM22VHI_FIRSTEMPTY'    ).setLogic( d.EM22VHI & firstempty).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_J10_VTE100'      ).setLogic( d.J10      & Not(d.TE100) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_J10_VTE200'      ).setLogic( d.J10      & Not(d.TE200) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_J10_VTE300'      ).setLogic( d.J10      & Not(d.TE300) & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_TE5_VTE200'      ).setLogic( d.TE5      & Not(d.TE200) & physcond).setTriggerType( TT.calo )
-
-        # MUON ctpid=[0x20;0x2f]
-        LVL1MenuItem('L1_MU0'  ).setLogic( d.MU0  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4'  ).setLogic( d.MU4  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6'  ).setLogic( d.MU6  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU10' ).setLogic( d.MU10 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU11' ).setLogic( d.MU11 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU15' ).setLogic( d.MU15 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU20' ).setLogic( d.MU20 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU21' ).setLogic( d.MU21 & physcond).setTriggerType(TT.muon)    
-
-        # 2xMU, 3xMU, 4xMU
-        LVL1MenuItem('L1_2MU0'     ).setLogic( d.MU0.x(2)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4'     ).setLogic( d.MU4.x(2)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU6'     ).setLogic( d.MU6.x(2)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU10'    ).setLogic( d.MU10.x(2)       & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU11'    ).setLogic( d.MU11.x(2)       & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU20'    ).setLogic( d.MU20.x(2)       & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_MU10' ).setLogic( d.MU4 & d.MU10      & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_MU4' ).setLogic( d.MU6 & d.MU4      & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU10_2MU6').setLogic( d.MU10 & d.MU6.x(2) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU11_2MU6').setLogic( d.MU11 & d.MU6.x(2) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU11_2MU10').setLogic( d.MU11 & d.MU10.x(2) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU10_2MU4').setLogic( d.MU10 & d.MU4.x(2) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_3MU4'     ).setLogic( d.MU4.x(3)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_4MU4'     ).setLogic( d.MU4.x(4)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_2MU4' ).setLogic( d.MU6 & d.MU4.x(2)  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_3MU4' ).setLogic( d.MU6 & d.MU4.x(3)  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU6_3MU4' ).setLogic( d.MU6.x(2) & d.MU4.x(3)  & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_3MU6'     ).setLogic( d.MU6.x(3)        & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU0_MU6' ).setLogic( d.MU0.x(2) & d.MU6  & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_2MU20_OVERLAY').setLogic( d.MU20.x(2)   & physcond).setTriggerType(TT.zerobs)
-
-        # HI
-        LVL1MenuItem('L1_MU0_NZ'   ).setLogic( d.MU0      & Not(d.ZDC_AND) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU0_NZ'  ).setLogic( d.MU0.x(2) & Not(d.ZDC_AND) & physcond).setTriggerType(TT.muon)   
-
-        LVL1MenuItem('L1_MU0_NL'   ).setLogic( d.MU0      & Not(d.LUCID_A) & Not(d.LUCID_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU0_NL'  ).setLogic( d.MU0.x(2) & Not(d.LUCID_A) & Not(d.LUCID_C) & physcond).setTriggerType(TT.muon)                  
-                            
-        LVL1MenuItem('L1_MU0_MV'   ).setLogic( d.MU0      & Not(d.MBTS_A & d.MBTS_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU0_MV'  ).setLogic( d.MU0.x(2) & Not(d.MBTS_A & d.MBTS_C) & physcond).setTriggerType(TT.muon)
-        
-        LVL1MenuItem('L1_MU4_VTE10').setLogic( d.MU4      & Not(d.TE10) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4_VTE10').setLogic( d.MU4.x(2)      & Not(d.TE10) & physcond).setTriggerType(TT.muon)
-        
-        LVL1MenuItem('L1_MU0_TE50' ).setLogic( d.MU0      & d.TE50 & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_MU4_TE50' ).setLogic( d.MU4      & d.TE50 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE70' ).setLogic( d.MU4      & d.TE70 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE90' ).setLogic( d.MU4      & d.TE90 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE120' ).setLogic( d.MU4     & d.TE120 & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_TE160' ).setLogic( d.MU4     & d.TE160 & physcond).setTriggerType(TT.muon)
-        
-        
-        LVL1MenuItem('L1_MU0_VTE50').setLogic( d.MU0      & Not(d.TE50) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_VTE50').setLogic( d.MU4      & Not(d.TE50) & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_MU0_MV_VTE50').setLogic( d.MU0 & Not(d.MBTS_A & d.MBTS_C) & Not(d.TE50) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_MV_VTE50').setLogic( d.MU4 & Not(d.MBTS_A & d.MBTS_C) & Not(d.TE50) & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_MU0_UNPAIRED_ISO'   ).setLogic(d.MU0 & unpaired_isocond   ).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU0_UNPAIRED_NONISO').setLogic(d.MU0 & unpaired_nonisocond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU0_EMPTY'          ).setLogic(d.MU0 & cosmiccond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU0_FIRSTEMPTY'     ).setLogic(d.MU0 & firstempty).setTriggerType( TT.muon )
-
-        LVL1MenuItem('L1_MU4_UNPAIRED_ISO'   ).setLogic(d.MU4 & unpaired_isocond   ).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU4_UNPAIRED_NONISO').setLogic(d.MU4 & unpaired_nonisocond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU4_EMPTY'          ).setLogic(d.MU4 & cosmiccond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU6_EMPTY'          ).setLogic(d.MU6 & cosmiccond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU4_FIRSTEMPTY'     ).setLogic(d.MU4 & firstempty).setTriggerType( TT.muon )
-
-        LVL1MenuItem('L1_MU6_FIRSTEMPTY'     ).setLogic(d.MU4  & firstempty).setTriggerType( TT.muon ) 
-        LVL1MenuItem('L1_MU10_EMPTY'         ).setLogic(d.MU10 & cosmiccond).setTriggerType( TT.muon ) 
-        LVL1MenuItem('L1_MU11_EMPTY'         ).setLogic(d.MU11 & cosmiccond).setTriggerType( TT.muon ) 
-        
-        LVL1MenuItem('L1_2MU0_EMPTY'         ).setLogic(d.MU0.x(2) & cosmiccond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_2MU4_EMPTY'         ).setLogic(d.MU4.x(2) & cosmiccond).setTriggerType( TT.muon ) 
-        LVL1MenuItem('L1_2MU6_UNPAIRED_ISO'  ).setLogic(d.MU6.x(2) & unpaired_isocond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_2MU6_UNPAIRED_NONISO').setLogic(d.MU6.x(2) & unpaired_nonisocond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_2MU6_EMPTY'         ).setLogic(d.MU6.x(2) & cosmiccond).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_2MU6_FIRSTEMPTY'    ).setLogic(d.MU6.x(2) & firstempty).setTriggerType( TT.muon )
-        LVL1MenuItem('L1_MU20_FIRSTEMPTY'    ).setLogic( d.MU20 & firstempty).setTriggerType(TT.muon)
-
-        # EM and MU
-        LVL1MenuItem('L1_EM6_MU10'   ).setLogic( d.EM6        & d.MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM7_MU10'   ).setLogic( d.EM7        & d.MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM7_MU15'   ).setLogic( d.EM7        & d.MU15     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM7_MU20'   ).setLogic( d.EM7        & d.MU20     & physcond).setTriggerType(TT.muon)   
-        LVL1MenuItem('L1_EM8VH_MU15' ).setLogic( d.EM8VH      & d.MU15     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM20VH_MU20').setLogic( d.EM20VH     & d.MU20     & physcond).setTriggerType(TT.muon) 
-        LVL1MenuItem('L1_EM8_MU10'   ).setLogic( d.EM8        & d.MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM15VH_MU10').setLogic( d.EM15VH     & d.MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM3_MU20'   ).setLogic( d.EM3        & d.MU20     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2EM8VH_MU10').setLogic( d.EM8VH.x(2) & d.MU10     & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_EM15VH_2EM8VH_MU6').setLogic( d.EM15VH & d.EM8VH.x(2) &  d.MU6 & physcond).setTriggerType(TT.muon)
-
-        # TAU ctpid=[0x40:0x4f]
-        LVL1MenuItem('L1_TAU5'  ).setLogic( d.HA5   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU6'  ).setLogic( d.HA6   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU8'  ).setLogic( d.HA8   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_2TAU5' ).setLogic( d.HA5.x(2)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2TAU8' ).setLogic( d.HA8.x(2)  & physcond).setTriggerType(TT.calo)
-
-        #LVL1MenuItem('L1_TAU10IM').setLogic( d.HA10IM  & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_TAU12'  ).setLogic( d.HA12   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12IL').setLogic( d.HA12IL & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12IM').setLogic( d.HA12IM & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12I' ).setLogic( d.HA12I  & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_TAU15' ).setLogic( d.HA15  & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_TAU20' ).setLogic( d.HA20  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IL' ).setLogic( d.HA20IL  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM' ).setLogic( d.HA20IM  & physcond).setTriggerType( TT.calo )
-        
-        LVL1MenuItem('L1_TAU20A' ).setLogic( d.HA20A  & physcond).setTriggerType( TT.calo ) 
-        LVL1MenuItem('L1_TAU20C' ).setLogic( d.HA20C  & physcond).setTriggerType( TT.calo ) 
-
-        LVL1MenuItem('L1_TAU25' ).setLogic( d.HA25  & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_TAU30' ).setLogic( d.HA30  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU40' ).setLogic( d.HA40  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU60' ).setLogic( d.HA60  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU90' ).setLogic( d.HA90  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU100').setLogic( d.HA100 & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_TAU8_UNPAIRED_ISO'   ).setLogic( d.HA8   & unpaired_isocond ).setTriggerType( TT.calo ) 
-
-        LVL1MenuItem('L1_TAU8_UNPAIRED_NONISO').setLogic( d.HA8   & unpaired_nonisocond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU8_EMPTY'          ).setLogic( d.HA8   & cosmiccond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU8_FIRSTEMPTY'     ).setLogic( d.HA8   & firstempty ).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_TAU12_UNPAIRED_ISO'   ).setLogic( d.HA12  & unpaired_isocond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12_UNPAIRED_NONISO').setLogic( d.HA12  & unpaired_nonisocond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12_EMPTY'          ).setLogic( d.HA12  & cosmiccond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12_FIRSTEMPTY'     ).setLogic( d.HA12  & firstempty ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU40_EMPTY'          ).setLogic( d.HA40  & cosmiccond ).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU40_UNPAIRED_ISO'   ).setLogic( d.HA40  & unpaired_isocond ).setTriggerType( TT.calo )
-
-
-        # 3xTAU
-        LVL1MenuItem('L1_TAU20_2TAU12'  ).setLogic( d.HA20 & d.HA12.x(2)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2TAU12I' ).setLogic( d.HA20 & d.HA12I.x(2) &  physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU40_2TAU20IM' ).setLogic( d.HA40 & d.HA20IM.x(2) &  physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM' ).setLogic( d.HA20IM & d.HA12IM.x(2) &  physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU60_2TAU40').setLogic( d.HA60 & d.HA40.x(2)  & physcond).setTriggerType( TT.calo )
-
-        # mixed tau
-        LVL1MenuItem('L1_EM15VH_2TAU12'              ).setLogic( d.EM15VH  & d.HA12.x(2)	  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_2TAU12IL'            ).setLogic( d.EM15VH  & d.HA12IL.x(2)	  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15_2TAU12'                ).setLogic( d.EM15    & d.HA12.x(2)	  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15_2TAU20'                ).setLogic( d.EM15    & d.HA20.x(2)	  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VH_2TAU20'              ).setLogic( d.EM15VH  & d.HA20.x(2)	  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15_TAU40_2TAU15'          ).setLogic( d.EM15    & d.HA40 & d.HA15.x(2)   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15HI_TAU40_2TAU15'        ).setLogic( d.EM15HI  & d.HA40 & d.HA15.x(2)   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15_2TAU12_J25_2J15_3J12'  ).setLogic( d.EM15    & d.HA12.x(2)  & d.J25 & d.J15.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_MU10_TAU12'       ).setLogic( d.MU10  & d.HA12          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12I'      ).setLogic( d.MU10  & d.HA12I         & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IM'     ).setLogic( d.MU10  & d.HA12IM        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU20'       ).setLogic( d.MU10  & d.HA20          & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU20IM'     ).setLogic( d.MU10  & d.HA20IM        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU11_TAU20IM'     ).setLogic( d.MU11  & d.HA20IM        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU20IM_J25_2J20'     ).setLogic( d.MU10  & d.HA20IM   & d.J25 & d.J20.x(2) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU20I'           ).setLogic( d.MU10  & d.HA20I        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU20_TAU12IM'          ).setLogic( d.MU20 & d.HA12IM & physcond).setTriggerType( TT.calo)        
-        LVL1MenuItem('L1_TAU12I_MU10_J25'       ).setLogic( d.HA12I & d.MU10 & d.J25    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12I_MU10_J25_2J12'  ).setLogic( d.HA12I & d.MU10 & d.J25 & d.J12.x(2)  & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12_J25_2J12'   ).setLogic( d.MU10 & d.HA12 & d.J25 & d.J12.x(2)     & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IM_J25_2J12' ).setLogic( d.MU10 & d.HA12IM & d.J25 & d.J12.x(2)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IL_J25_2J12' ).setLogic( d.MU10 & d.HA12IL & d.J25 & d.J12.x(2)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU25IM_2TAU20IM_2J25_3J20').setLogic( d.HA25IM & d.HA20IM.x(2)     & d.J25.x(2)  & d.J20.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU12I_MU10_J20p31ETA49' ).setLogic( d.HA12I & d.MU10 & d.J2031ETA49    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IM_3J12'       ).setLogic( d.MU10 & d.HA12IM & d.J12.x(3)    & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM_4J12p0ETA23').setLogic( d.HA20IM & d.HA12IM.x(2)  & d.J120ETA23.x(4) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM_4J12p0ETA25').setLogic( d.HA20IM & d.HA12IM.x(2)  & d.J120ETA25.x(4) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM_4J12p0ETA28').setLogic( d.HA20IM & d.HA12IM.x(2)  & d.J120ETA28.x(4) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2TAU12I_J25_2J15_3J12'   ).setLogic( d.HA20 & d.HA12I.x(2)     & d.J25 & d.J15.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2TAU12_J25_2J20_3J12'    ).setLogic( d.HA20 & d.HA12.x(2)     & d.J25 & d.J20.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM_J25_2J20_3J12').setLogic( d.HA20IM & d.HA12IM.x(2)     & d.J25 & d.J20.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IL_2TAU12IL_J25_2J20_3J12').setLogic( d.HA20IL & d.HA12IL.x(2)     & d.J25 & d.J20.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-
-        LVL1MenuItem('L1_2TAU12I_TAU20_J25_2J15_3J12'  ).setLogic( d.HA12I.x(2)   & d.HA20  & d.J25 & d.J15.x(2) & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2J20_XE45'              ).setLogic( d.HA20    & d.J20.x(2)   & d.XE45 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2J20_XE50'            ).setLogic( d.HA20IM   & d.J20.x(2)   & d.XE50 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2J20_XE45'            ).setLogic( d.HA20IM    & d.J20.x(2)   & d.XE45 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU25_2J20_XE45'              ).setLogic( d.HA25      & d.J20.x(2)   & d.XE45 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20_2TAU12_XE35'            ).setLogic( d.HA20    & d.HA12.x(2)  & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM_XE35'        ).setLogic( d.HA20IM  & d.HA12IM.x(2)  & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IL_2TAU12IL_XE35'        ).setLogic( d.HA20IL  & d.HA12IL.x(2)  & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20IM_2TAU12IM_XE40'        ).setLogic( d.HA20IM  & d.HA12IM.x(2)  & d.XE40 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU40_2TAU12IM_XE40'          ).setLogic( d.HA40  & d.HA12IM.x(2)  & d.XE40 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VHI_2TAU12IM'             ).setLogic( d.EM15VHI  & d.HA12IM.x(2)        & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VHI_TAU40_2TAU15'         ).setLogic( d.EM15VHI  & d.HA40 & d.HA15.x(2)   & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VHI_2TAU12IM_J25_3J12'    ).setLogic( d.EM15VHI  & d.HA12IM.x(2)  & d.J25 & d.J12.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VHI_2TAU12IM_4J12'        ).setLogic( d.EM15VHI  & d.HA12IM.x(2) & d.J12.x(4) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM20VHI_TAU20IM_2TAU20_J25_3J20').setLogic( d.EM20VHI  &  d.HA20IM  &  d.HA20.x(2) &  d.J25  & d.J20.x(3) & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_EM15VHI_2TAU12IM_XE35'        ).setLogic( d.EM15VHI  & d.HA12IM.x(2) & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12I_XE35'             ).setLogic( d.MU10    & d.HA12I      & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12_XE35'              ).setLogic( d.MU10    & d.HA12       & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IL_XE35'            ).setLogic( d.MU10    & d.HA12IL     & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IM_XE35'            ).setLogic( d.MU10    & d.HA12IM     & d.XE35 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_MU10_TAU12IM_XE40'            ).setLogic( d.MU10    & d.HA12IM     & d.XE40 & physcond).setTriggerType( TT.calo )
-        LVL1MenuItem('L1_TAU20I_2TAU12I_XE35'          ).setLogic( d.HA20I   & d.HA12I.x(2) & d.XE35 & physcond).setTriggerType( TT.calo )
-
-        # JET ctpid=[0x60:0x7f]
-        LVL1MenuItem('L1_J5'    ).setLogic( d.J5   & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10'   ).setLogic( d.J10  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J12'   ).setLogic( d.J12  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15'   ).setLogic( d.J15  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20'   ).setLogic( d.J20  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J25'   ).setLogic( d.J25  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30'   ).setLogic( d.J30  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J35'   ).setLogic( d.J35  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40'   ).setLogic( d.J40  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J50'   ).setLogic( d.J50  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J60'   ).setLogic( d.J60  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75'   ).setLogic( d.J75  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75A'  ).setLogic( d.J75A & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75C'  ).setLogic( d.J75C & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J85'   ).setLogic( d.J85  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J100'  ).setLogic( d.J100 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J120'  ).setLogic( d.J120 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J150'  ).setLogic( d.J150 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J175'  ).setLogic( d.J175 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J250'  ).setLogic( d.J250 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J400'  ).setLogic( d.J400 & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J10p31ETA49').setLogic( d.J1031ETA49 & physcond).setTriggerType(TT.calo)
-        #LVL1MenuItem('L1_J20.31ETA49').setLogic( d.J2031ETA49 & physcond).setTriggerType(TT.calo)
-        #LVL1MenuItem('L1_J30.31ETA49').setLogic( d.J3031ETA49 & physcond).setTriggerType(TT.calo)
-        #LVL1MenuItem('L1_J50.31ETA49').setLogic( d.J5031ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75p31ETA49').setLogic( d.J7531ETA49 & physcond).setTriggerType(TT.calo)
-        #LVL1MenuItem('L1_J100.31ETA49').setLogic( d.J10031ETA49 & physcond).setTriggerType(TT.calo)
-
-
-        LVL1MenuItem('L1_J10_UNPAIRED_ISO'   ).setLogic( d.J10 & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10_UNPAIRED_NONISO').setLogic( d.J10 & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10_EMPTY'          ).setLogic( d.J10 & cosmiccond         ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J10_FIRSTEMPTY'     ).setLogic( d.J10 & firstempty         ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J12_UNPAIRED_ISO'   ).setLogic( d.J12 & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J12_UNPAIRED_NONISO').setLogic( d.J12 & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J12_EMPTY'          ).setLogic( d.J12 & cosmiccond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J12_FIRSTEMPTY'     ).setLogic( d.J12 & firstempty ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J12_ABORTGAPNOTCALIB').setLogic( d.J12 & abortgap ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J50_UNPAIRED_ISO'   ).setLogic( d.J50 & unpaired_isocond   ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J50_UNPAIRED_NONISO').setLogic( d.J50 & unpaired_nonisocond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J50_ABORTGAPNOTCALIB').setLogic( d.J50 & abortgap ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J12_BGRP12').setLogic( d.J12 & bgrp12cond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30p31ETA49_BGRP12').setLogic( d.J3031ETA49 & bgrp12cond ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J30_EMPTY').setLogic( d.J30 & cosmiccond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30_UNPAIRED').setLogic( d.J30 & unpairedRcond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30_FIRSTEMPTY').setLogic( d.J30 & firstempty ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J10p31ETA49_EMPTY').setLogic( d.J1031ETA49 & cosmiccond ).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J15p31ETA49_UNPAIRED_ISO' ).setLogic( d.J1531ETA49 & unpaired_isocond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_J30p31ETA49_EMPTY'          ).setLogic( d.J3031ETA49 & cosmiccond ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30p31ETA49_FIRSTEMPTY'     ).setLogic( d.J3031ETA49 & firstempty ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30p31ETA49_UNPAIRED_ISO'   ).setLogic( d.J3031ETA49 & unpaired_isocond    ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30p31ETA49_UNPAIRED_NONISO').setLogic( d.J3031ETA49 & unpaired_nonisocond ).setTriggerType(TT.calo)
-
-        
-        LVL1MenuItem('L1_J100_FIRSTEMPTY').setLogic( d.J100 & firstempty ).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J100p31ETA49_FIRSTEMPTY' ).setLogic( d.J10031ETA49 & firstempty ).setTriggerType(TT.calo)
-
-        # multi jet
-        LVL1MenuItem('L1_2J25p31ETA49'  ).setLogic( d.J2531ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J15'   ).setLogic( d.J15.x(2)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J15_J15p31ETA49' ).setLogic( d.J15 & d.J1531ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J20_J20p31ETA49' ).setLogic( d.J20 & d.J2031ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J10'   ).setLogic( d.J10.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J15'   ).setLogic( d.J15.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J20'   ).setLogic( d.J20.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J40'   ).setLogic( d.J40.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J50'   ).setLogic( d.J50.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J75'   ).setLogic( d.J75.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J10'   ).setLogic( d.J10.x(4)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J15'   ).setLogic( d.J15.x(4)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J20'   ).setLogic( d.J20.x(4)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J30'   ).setLogic( d.J30.x(4)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_6J15'   ).setLogic( d.J15.x(6)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75_3J20' ).setLogic( d.J75 & d.J20.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J85_3J30' ).setLogic( d.J85 & d.J30.x(3)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J30p0ETA49_2J20p0ETA49' ).setLogic( d.J300ETA49 & d.J200ETA49.x(2)    & physcond).setTriggerType(TT.calo)    # noqa: F821
-        LVL1MenuItem('L1_J15p0ETA25_2J15p31ETA49' ).setLogic( d.J150ETA25 & d.J1531ETA49.x(2)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40p0ETA25_2J15p31ETA49' ).setLogic( d.J400ETA25 & d.J1531ETA49.x(2)    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40p0ETA25_2J25_J20p31ETA49' ).setLogic( d.J400ETA25 & d.J25.x(2) & d.J2031ETA49   & physcond).setTriggerType(TT.calo) 
-        LVL1MenuItem('L1_J40p0ETA25_2J30_J20p31ETA49' ).setLogic( d.J400ETA25 & d.J30.x(2) & d.J2031ETA49   & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J45p0ETA21_3J15p0ETA25'  ).setLogic( d.J450ETA21 & d.J150ETA25.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J50_2J40p0ETA25_3J15p0ETA25'  ).setLogic( d.J50 & d.J400ETA25.x(2) & d.J150ETA25.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J25p0ETA23_2J15p31ETA49'  ).setLogic( d.J250ETA23 & d.J1531ETA49.x(2) & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_4J17p0ETA22' ).setLogic( d.J170ETA22.x(4) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J25p0ETA23' ).setLogic( d.J250ETA23.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J35p0ETA23' ).setLogic( d.J350ETA23.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_3J15p0ETA25' ).setLogic( d.J150ETA25.x(3) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_4J15p0ETA25' ).setLogic( d.J150ETA25.x(4) & physcond).setTriggerType(TT.calo) 
-        LVL1MenuItem('L1_5J15p0ETA25' ).setLogic( d.J150ETA25.x(5) & physcond).setTriggerType(TT.calo)
-
-#        LVL1MenuItem('L1_ZB_J20').setLogic(ZB_EM15 & d.J20 & physcond).setTriggerType(TT.zerobs)
-        if (('Physics_HI_v3' in TriggerFlags.triggerMenuSetup()) or ('MC_HI_v3' in TriggerFlags.triggerMenuSetup()) or ('Physics_HI_v4' in TriggerFlags.triggerMenuSetup()) or ('MC_HI_v4' in TriggerFlags.triggerMenuSetup())):
-            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(ZB_J75 & physcond).setTriggerType(TT.zerobs)
-        else:
-            LVL1MenuItem('L1_ZB', ctpid=240).setLogic(d.ZB_EM15 & physcond).setTriggerType(TT.zerobs)
-
-
-        # combined jet - xe
-        #LVL1MenuItem('L1_J40_XE50').setLogic( d.J75 & d.XE40 & physcond).setTriggerType(TT.calo)#CB ERROR???
-        LVL1MenuItem('L1_J40_XE50').setLogic( d.J40 & d.XE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40p0ETA25_XE50').setLogic( d.J400ETA25 & d.XE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75_XE40' ).setLogic( d.J75 & d.XE40 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J75_XE50' ).setLogic( d.J75 & d.XE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J15_XE55').setLogic( d.J15.x(2) & d.XE55 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J40_XE45').setLogic( d.J40.x(2) & d.XE45 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J50_XE40').setLogic( d.J50.x(2) & d.XE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_J40_XE60' ).setLogic( d.J40 & d.XE60 & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_3J15p0ETA25_XE40').setLogic( d.J150ETA25.x(3) & d.XE40 & physcond).setTriggerType(TT.calo)
-        
-        # combined em - jet
-        LVL1MenuItem('L1_EM15VH_JJ15p23ETA49' ).setLogic( d.EM15VH  & d.JJ1523ETA49  & physcond).setTriggerType(TT.calo)
-        ### ATR-15524
-        LVL1MenuItem('L1_EM18VHI_3J20' ).setLogic( d.EM18VHI  & d.J20.x(3)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_EM20VH_3J20' ).setLogic( d.EM20VH  & d.J20.x(3)  & physcond).setTriggerType(TT.calo)
-
-        # combined mu - jet
-        LVL1MenuItem('L1_MU4_J12'   ).setLogic( d.MU4 & d.J12    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU6_J20'   ).setLogic( d.MU6 & d.J20    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU6_J40'   ).setLogic( d.MU6 & d.J40    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU6_J30p0ETA49_2J20p0ETA49').setLogic( d.MU6 & d.J300ETA49 & d.J200ETA49.x(2) & physcond).setTriggerType(TT.calo)    # noqa: F821
-        LVL1MenuItem('L1_MU6_J75'   ).setLogic( d.MU6 & d.J75    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_3J15'  ).setLogic( d.MU4 & d.J15.x(3)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_3J20'  ).setLogic( d.MU4 & d.J20.x(3)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_J30'   ).setLogic( d.MU4 & d.J30    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_J50'   ).setLogic( d.MU4 & d.J50    & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU10_3J20'  ).setLogic( d.MU10 & d.J20.x(3)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU10_2J20'  ).setLogic( d.MU10 & d.J20.x(2)  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU10_2J15_J20'  ).setLogic( d.MU10 & d.J15.x(2) & d.J20  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_J50_XE40'   ).setLogic( d.MU4 & d.J50 & d.XE40  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2MU4_J40_XE50'  ).setLogic( d.MU4.x(2) & d.J40 & d.XE50  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2MU4_J40_XE20'  ).setLogic( d.MU4.x(2) & d.J40 & d.XE20  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU4_J30_XE40_DPHI-J20s2XE30').setLogic( d.MU4 & d.J30 & d.XE40 & d.TOPO_10MINDPHI_J20s2_XE30  & physcond)
-        LVL1MenuItem('L1_MU4_J50_XE50_DPHI-J20s2XE30').setLogic( d.MU4 & d.J50 & d.XE50 & d.TOPO_10MINDPHI_J20s2_XE30  & physcond)
-        LVL1MenuItem('L1_MU20_J40'  ).setLogic( d.MU20 & d.J40 & physcond).setTriggerType(TT.calo) ## ATR-14377
-        LVL1MenuItem('L1_MU20_J50'  ).setLogic( d.MU20 & d.J50  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_MU20_XE30' ).setLogic( d.MU20 & d.XE30 & physcond) ## ATR-14377
-        LVL1MenuItem('L1_MU4_XE60'  ).setLogic( d.MU4 & d.XE60  & physcond).setTriggerType(TT.calo)
-        # HI
-        LVL1MenuItem('L1_J15_NZ' ).setLogic( d.J15      & Not(d.ZDC_AND) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J15_NZ').setLogic( d.J15.x(2) & Not(d.ZDC_AND) & physcond).setTriggerType(TT.calo)   
-
-        LVL1MenuItem('L1_J15_NL' ).setLogic( d.J15      & Not(d.LUCID_A) & Not(d.LUCID_C) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_2J15_NL').setLogic( d.J15.x(2) & Not(d.LUCID_A) & Not(d.LUCID_C) & physcond).setTriggerType(TT.calo)
-        
-        # XE
-        LVL1MenuItem('L1_XE35').setLogic( d.XE35 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE40').setLogic( d.XE40 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE45').setLogic( d.XE45 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE50').setLogic( d.XE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE55').setLogic( d.XE55 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE60').setLogic( d.XE60 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE70').setLogic( d.XE70 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE80').setLogic( d.XE80 & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_XE10').setLogic( d.XE10 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE20').setLogic( d.XE20 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE25').setLogic( d.XE25 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE30').setLogic( d.XE30 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE65').setLogic( d.XE65 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE75').setLogic( d.XE75 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE150').setLogic( d.XE150 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE300').setLogic( d.XE300 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE35_BGRP7').setLogic( d.XE35 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE40_BGRP7').setLogic( d.XE40 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE45_BGRP7').setLogic( d.XE45 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE50_BGRP7').setLogic( d.XE50 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE55_BGRP7').setLogic( d.XE55 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE60_BGRP7').setLogic( d.XE60 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE70_BGRP7').setLogic( d.XE70 & bgrp7cond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XE80_BGRP7').setLogic( d.XE80 & bgrp7cond).setTriggerType(TT.calo)
-
-        # XS
-        LVL1MenuItem('L1_XS20').setLogic( d.XS20.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS30').setLogic( d.XS30.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS40').setLogic( d.XS40.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS45').setLogic( d.XS45.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS50').setLogic( d.XS50.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS55').setLogic( d.XS55.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS60').setLogic( d.XS60.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_XS65').setLogic( d.XS65.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_EM10_XS20').setLogic( d.EM10 & d.XS20.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_EM12_XS20').setLogic( d.EM12 & d.XS20.x(1) & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_EM15_XS30').setLogic( d.EM15 & d.XS30.x(1) & physcond).setTriggerType(TT.calo)
-        
-        # TE
-        LVL1MenuItem('L1_TE0' ).setLogic( d.TE0  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE3' ).setLogic( d.TE3  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE5' ).setLogic( d.TE5  & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE10').setLogic( d.TE10 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE15').setLogic( d.TE15 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE20').setLogic( d.TE20 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE25').setLogic( d.TE25 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE30').setLogic( d.TE30 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE40').setLogic( d.TE40 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE45').setLogic( d.TE45 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE50').setLogic( d.TE50 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE55').setLogic( d.TE55 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE60').setLogic( d.TE60 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE65').setLogic( d.TE65 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE70').setLogic( d.TE70 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE90').setLogic( d.TE90 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE100').setLogic( d.TE100 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE120').setLogic( d.TE120 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE140').setLogic( d.TE140 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE160').setLogic( d.TE160 & physcond).setTriggerType(TT.calo)        
-        LVL1MenuItem('L1_TE200').setLogic( d.TE200 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE280').setLogic( d.TE280 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE300').setLogic( d.TE300 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE360').setLogic( d.TE360 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE2000').setLogic( d.TE2000 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE4000').setLogic( d.TE4000 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE10000').setLogic( d.TE10000 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE12000').setLogic( d.TE12000 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE14000').setLogic( d.TE14000 & physcond).setTriggerType(TT.calo)
-
-
-  # HI items
-        LVL1MenuItem('L1_TE500p0ETA49' ).setLogic( d.TE5000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE1500p0ETA49').setLogic( d.TE15000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE3000p0ETA49').setLogic( d.TE30000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE3500p0ETA49').setLogic( d.TE35000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE5000p0ETA49').setLogic( d.TE50000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE6500p0ETA49').setLogic( d.TE65000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE8000p0ETA49').setLogic( d.TE80000ETA49 & physcond).setTriggerType(TT.calo)
-        LVL1MenuItem('L1_TE9000p0ETA49').setLogic( d.TE90000ETA49 & physcond).setTriggerType(TT.calo)
-
-        LVL1MenuItem('L1_TE500p0ETA49_OVERLAY' ).setLogic( d.TE5000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE1500p0ETA49_OVERLAY').setLogic( d.TE15000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE3000p0ETA49_OVERLAY').setLogic( d.TE30000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE3500p0ETA49_OVERLAY').setLogic( d.TE35000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE5000p0ETA49_OVERLAY').setLogic( d.TE50000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE6500p0ETA49_OVERLAY').setLogic( d.TE65000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE8000p0ETA49_OVERLAY').setLogic( d.TE80000ETA49 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE9000p0ETA49_OVERLAY').setLogic( d.TE90000ETA49 & physcond).setTriggerType(TT.zerobs)
-
-        LVL1MenuItem('L1_TE5_NZ').setLogic( d.TE5 & Not(d.ZDC_AND) & physcond).setTriggerType(TT.calo) 
-        
-        # d.MBTS
-        MBTS_1   = d.MBTS_A | d.MBTS_C
-        MBTS_2   = (d.MBTS_A.x(2) | d.MBTS_C.x(2) | d.MBTS_A) & (d.MBTS_A.x(2) | d.MBTS_C.x(2) | d.MBTS_C)
-        MBTS_1_1 = d.MBTS_A & d.MBTS_C
-        MBTS_2_2 = d.MBTS_A.x(2) & d.MBTS_C.x(2)
-        MBTS_2_A = d.MBTS_A.x(2)
-        MBTS_2_C = d.MBTS_C.x(2)
-        MBTS_3_3 = d.MBTS_A.x(3) & d.MBTS_C.x(3)
-        MBTS_4_4 = d.MBTS_A.x(4) & d.MBTS_C.x(4)
-        MBTS_4_A = d.MBTS_A.x(4)
-        MBTS_4_C = d.MBTS_C.x(4)
-
-
-        LVL1MenuItem('L1_MBTS_1'             ).setLogic( MBTS_1   & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_OVERLAY'     ).setLogic( MBTS_1   & physcond ).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_MBTS_2'             ).setLogic( MBTS_2   & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1'           ).setLogic( MBTS_1_1 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1_OVERLAY'   ).setLogic( MBTS_1_1   & physcond ).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_MBTS_2_2'           ).setLogic( MBTS_2_2 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_A'           ).setLogic( MBTS_2_A & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_C'           ).setLogic( MBTS_2_C & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_3_3'           ).setLogic( MBTS_3_3 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_4'           ).setLogic( MBTS_4_4 & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_A'           ).setLogic( MBTS_4_A & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_C'           ).setLogic( MBTS_4_C & physcond ).setTriggerType(TT.minb)
-
-
-        LVL1MenuItem('L1_MBTS_1_UNPAIRED_ISO'   ).setLogic( MBTS_1   & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_UNPAIRED_ISO'   ).setLogic( MBTS_2   & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1_UNPAIRED_ISO' ).setLogic( MBTS_1_1 & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_2_UNPAIRED_ISO' ).setLogic( MBTS_2_2 & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_3_3_UNPAIRED_ISO' ).setLogic( MBTS_3_3 & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_4_UNPAIRED_ISO' ).setLogic( MBTS_3_3 & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_UNPAIRED_NONISO').setLogic( MBTS_1 & unpaired_nonisocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_UNPAIRED_NONISO').setLogic( MBTS_2 & unpaired_nonisocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_A_UNPAIRED_ISO' ).setLogic( MBTS_4_A & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_C_UNPAIRED_ISO' ).setLogic( MBTS_4_C & unpaired_isocond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_MBTS_1_EMPTY'       ).setLogic( MBTS_1   & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_EMPTY'       ).setLogic( MBTS_2   & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_1_1_EMPTY'     ).setLogic( MBTS_1_1 & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_2_EMPTY'     ).setLogic( MBTS_2_2 & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_3_3_EMPTY'     ).setLogic( MBTS_3_3 & cosmiccond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_MBTS_1_1_VTE50'     ).setLogic( MBTS_1_1  & Not(d.TE50) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_2_VTE50'     ).setLogic( MBTS_2_2  & Not(d.TE50) & physcond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_MBTSA0' ).setLogic( d.MBTS_A0 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA1' ).setLogic( d.MBTS_A1 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA2' ).setLogic( d.MBTS_A2 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA3' ).setLogic( d.MBTS_A3 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA4' ).setLogic( d.MBTS_A4 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA5' ).setLogic( d.MBTS_A5 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA6' ).setLogic( d.MBTS_A6 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA7' ).setLogic( d.MBTS_A7 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA8' ).setLogic( d.MBTS_A8 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA10').setLogic( d.MBTS_A10 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA12').setLogic( d.MBTS_A12 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSA14').setLogic( d.MBTS_A14 & physcond).setTriggerType(TT.minb)
-        # L1_MBTSA/C 9, 11, 13, 15 are removed in Run 2
-
-        LVL1MenuItem('L1_MBTSC0' ).setLogic( d.MBTS_C0 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC1' ).setLogic( d.MBTS_C1 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC2' ).setLogic( d.MBTS_C2 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC3' ).setLogic( d.MBTS_C3 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC4' ).setLogic( d.MBTS_C4 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC5' ).setLogic( d.MBTS_C5 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC6' ).setLogic( d.MBTS_C6 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC7' ).setLogic( d.MBTS_C7 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC8' ).setLogic( d.MBTS_C8 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC10').setLogic( d.MBTS_C10 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC12').setLogic( d.MBTS_C12 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTSC14').setLogic( d.MBTS_C14 & physcond).setTriggerType(TT.minb)
-        
-        LVL1MenuItem('L1_MBTS_1_BGRP9'    ).setLogic( MBTS_1 & bgrp9cond ).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_MBTS_1_1_BGRP9'  ).setLogic( MBTS_1_1 & bgrp9cond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_BGRP9'    ).setLogic( MBTS_2 & bgrp9cond ).setTriggerType(TT.minb)
-        
-        LVL1MenuItem('L1_MBTS_1_BGRP11'   ).setLogic( MBTS_1 & bgrp11cond ).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_MBTS_1_1_BGRP11' ).setLogic( MBTS_1_1 & bgrp11cond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_BGRP11'   ).setLogic( MBTS_2 & bgrp11cond ).setTriggerType(TT.minb) 
-
-
-        # ZDC
-        ZDC_A_C = d.ZDC_A & d.ZDC_C
-        VZDC_A_C = Not(d.ZDC_A) & Not(d.ZDC_C)
-        LVL1MenuItem('L1_ZDC'               ).setLogic((d.ZDC_A | d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A'             ).setLogic( d.ZDC_A & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C'             ).setLogic( d.ZDC_C & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_AND'           ).setLogic( d.ZDC_AND & physcond).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_ZDC_A_C'           ).setLogic( ZDC_A_C & physcond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_ZDC_A_C_OVERLAY' ).setLogic( ZDC_A_C & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_ZDC_A_OVERLAY'   ).setLogic( d.ZDC_A & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_ZDC_C_OVERLAY'   ).setLogic( d.ZDC_C & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_ZDC_A_C_VTE50_OVERLAY'     ).setLogic( ZDC_A_C & Not(d.TE50) & physcond).setTriggerType(TT.zerobs)     
-        LVL1MenuItem('L1_TE5_OVERLAY'    ).setLogic( d.TE5 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE10_OVERLAY'   ).setLogic( d.TE10 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE20_OVERLAY'   ).setLogic( d.TE20 & physcond).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_TE50_OVERLAY'   ).setLogic( d.TE50 & physcond).setTriggerType(TT.zerobs)
-
-        LVL1MenuItem('L1_ZDC_VTE200'        ).setLogic((d.ZDC_A | d.ZDC_C) & Not(d.TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_AND_VTE50'     ).setLogic( d.ZDC_AND & Not(d.TE50) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_VTE50'     ).setLogic( ZDC_A_C & Not(d.TE50) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_TE50'      ).setLogic( ZDC_A_C & d.TE50 & physcond).setTriggerType(TT.minb)
-        
-        LVL1MenuItem('L1_ZDC_A_VTE20'       ).setLogic( d.ZDC_A & Not(d.TE20) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_VTE20'       ).setLogic( d.ZDC_C & Not(d.TE20) & physcond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_ZDC_A_C_VTE200'    ).setLogic( ZDC_A_C & Not(d.TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_TE5_VTE200').setLogic( ZDC_A_C & d.TE5 & Not(d.TE200) & physcond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_ZDC_MBTS_1'        ).setLogic((d.ZDC_A | d.ZDC_C) & MBTS_1 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_MBTS_2'        ).setLogic((d.ZDC_A | d.ZDC_C) & MBTS_2 & physcond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_ZDC_MBTS_1_1'      ).setLogic((d.ZDC_A | d.ZDC_C) & MBTS_1_1 & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_MBTS_2_2'      ).setLogic((d.ZDC_A | d.ZDC_C) & MBTS_2_2 & physcond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_ZDC_EMPTY'           ).setLogic( (d.ZDC_A | d.ZDC_C) & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_EMPTY'         ).setLogic( d.ZDC_A & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_EMPTY'         ).setLogic( d.ZDC_C & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_UNPAIRED_ISO'    ).setLogic( (d.ZDC_A | d.ZDC_C) & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_UNPAIRED_NONISO' ).setLogic( (d.ZDC_A | d.ZDC_C) & unpaired_nonisocond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_ZDC_AND_EMPTY'           ).setLogic( d.ZDC_AND & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_AND_UNPAIRED_ISO'    ).setLogic( d.ZDC_AND & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_AND_UNPAIRED_NONISO' ).setLogic( d.ZDC_AND & unpaired_nonisocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_UNPAIRED_NONISO'   ).setLogic( d.ZDC_A & unpaired_nonisocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_UNPAIRED_NONISO'   ).setLogic( d.ZDC_C & unpaired_nonisocond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_ZDC_A_C_EMPTY'           ).setLogic( ZDC_A_C & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_UNPAIRED_ISO'    ).setLogic( ZDC_A_C & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_UNPAIRED_NONISO' ).setLogic( ZDC_A_C & unpaired_nonisocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_UNPAIRED_ISO'      ).setLogic( d.ZDC_A & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_UNPAIRED_ISO'      ).setLogic( d.ZDC_C & unpaired_isocond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_ZDC_A_C_BGRP9'      ).setLogic( ZDC_A_C & bgrp9cond & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_BGRP9'        ).setLogic( d.ZDC_A & bgrp9cond & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_BGRP9'        ).setLogic( d.ZDC_C & bgrp9cond & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_C_BGRP11'     ).setLogic( ZDC_A_C & bgrp11cond & physcond).setTriggerType(TT.minb)
-
-  # ATR-12470
-        ZDC_XOR = (d.ZDC_A & Not(d.ZDC_C)) | (d.ZDC_C & Not(d.ZDC_A))        
-        LVL1MenuItem('L1_ZDC_A_VZDC_C'        ).setLogic(d.ZDC_A & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_VZDC_A'        ).setLogic(d.ZDC_C & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_A_VZDC_C_VTE200' ).setLogic(d.ZDC_A & Not(d.ZDC_C) & Not(d.TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_C_VZDC_A_VTE200' ).setLogic(d.ZDC_C & Not(d.ZDC_A) & Not(d.TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_XOR'             ).setLogic(ZDC_XOR  & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_XOR_TE5_VTE200'  ).setLogic(ZDC_XOR  & d.TE5 & Not(d.TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_XOR_TRT_VTE200'  ).setLogic(ZDC_XOR  & d.NIMTRT & Not(d.TE200) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_ZDC_XOR_VTE200'      ).setLogic(ZDC_XOR  & Not(d.TE200) & physcond).setTriggerType(TT.minb)
-
-        # ATR-14967
-        LVL1MenuItem('L1_EM3_VZDC_A'               ).setLogic( d.EM3 & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_EM3_VZDC_C'               ).setLogic( d.EM3 & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_2EM3_VZDC_A'              ).setLogic( d.EM3.x(2) & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_2EM3_VZDC_C'              ).setLogic( d.EM3.x(2) & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_EM5_VZDC_A'               ).setLogic( d.EM5 & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_EM5_VZDC_C'               ).setLogic( d.EM5 & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE5_VZDC_A'               ).setLogic( d.TE5 & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE5_VZDC_C'               ).setLogic( d.TE5 & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE10_VZDC_A'              ).setLogic( d.TE10 & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE10_VZDC_C'              ).setLogic( d.TE10 & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE20_VZDC_A'              ).setLogic( d.TE20 & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_TE20_VZDC_C'              ).setLogic( d.TE20 & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_VTE10_VZDC_A'             ).setLogic( Not(d.TE10) & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_VTE10_VZDC_C'             ).setLogic( Not(d.TE10) & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J5_VZDC_A'                ).setLogic( d.J5 & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J5_VZDC_C'                ).setLogic( d.J5 & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J10_VZDC_A'               ).setLogic( d.J10 & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J10_VZDC_C'               ).setLogic( d.J10 & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J15_VZDC_A'               ).setLogic( d.J15 & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J15_VZDC_C'               ).setLogic( d.J15 & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J20_VZDC_A'               ).setLogic( d.J20 & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_J20_VZDC_C'               ).setLogic( d.J20 & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MU4_VZDC_A'               ).setLogic( d.MU4 & Not(d.ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_VZDC_C'               ).setLogic( d.MU4 & Not(d.ZDC_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4_VZDC_A'              ).setLogic( d.MU4.x(2) & Not(d.ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4_VZDC_C'              ).setLogic( d.MU4.x(2) & Not(d.ZDC_C) & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_MU4_VTE10_VZDC_A').setLogic( d.MU4      & Not(d.TE10) & Not(d.ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU4_VTE10_VZDC_C').setLogic( d.MU4      & Not(d.TE10) & Not(d.ZDC_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4_VTE10_VZDC_A').setLogic( d.MU4.x(2)      & Not(d.TE10) & Not(d.ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_2MU4_VTE10_VZDC_C').setLogic( d.MU4.x(2)      & Not(d.TE10) & Not(d.ZDC_C) & physcond).setTriggerType(TT.muon)
-
-        LVL1MenuItem('L1_MU4_VZDC_A_C'     ).setLogic( d.MU4 & VZDC_A_C & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_VZDC_A'       ).setLogic( d.MU6 & Not(d.ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_VZDC_C'       ).setLogic( d.MU6 & Not(d.ZDC_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_VTE10_VZDC_A' ).setLogic( d.MU6      & Not(d.TE10) & Not(d.ZDC_A) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_VTE10_VZDC_C' ).setLogic( d.MU6      & Not(d.TE10) & Not(d.ZDC_C) & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_MU6_VZDC_A_C'     ).setLogic( d.MU6 & VZDC_A_C & physcond).setTriggerType(TT.muon)
-        LVL1MenuItem('L1_RD0_FILLED_VZDC_A').setLogic( d.RNDM0 & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_RD0_FILLED_VZDC_C').setLogic( d.RNDM0 & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_C_VZDC_A'  ).setLogic( MBTS_4_C & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_4_A_VZDC_C'  ).setLogic( MBTS_4_A & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_MBTS_2_C_VZDC_A'  ).setLogic( MBTS_2_C & Not(d.ZDC_A) & physcond).setTriggerType(TT.minb)	
-        LVL1MenuItem('L1_MBTS_2_A_VZDC_C'  ).setLogic( MBTS_2_A & Not(d.ZDC_C) & physcond).setTriggerType(TT.minb)
-
-        # VDM
-        LVL1MenuItem('L1_ZDC_A_C_BGRP7'     ).setLogic( ZDC_A_C & bgrp7cond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_BGRP7'       ).setLogic( (d.LUCID_A | d.LUCID_C) & bgrp7cond).setTriggerType(TT.minb)
-        
-        # LUCID
-        #LVL1MenuItem('L1_LUCID_COMM'      ).setLogic( d.LUCID_COMM        & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A'           ).setLogic( d.LUCID_A             & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_C'           ).setLogic( d.LUCID_C             & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C',        ).setLogic( d.LUCID_A & d.LUCID_C   & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID'             ).setLogic((d.LUCID_A | d.LUCID_C)  & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_COMM'        ).setLogic( d.LUCID_COMM          & physcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_COMM_EMPTY'  ).setLogic( d.LUCID_COMM          & cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_EMPTY'       ).setLogic((d.LUCID_A | d.LUCID_C)  & cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C_EMPTY'   ).setLogic( d.LUCID_A & d.LUCID_C   & cosmiccond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_UNPAIRED_ISO').setLogic((d.LUCID_A | d.LUCID_C)  & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_COMM_UNPAIRED_ISO' ).setLogic( d.LUCID_COMM        & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C_UNPAIRED_ISO'  ).setLogic( d.LUCID_A & d.LUCID_C & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_LUCID_A_C_UNPAIRED_NONISO').setLogic(d.LUCID_A & d.LUCID_C & unpaired_nonisocond).setTriggerType(TT.minb)
-        
-        # BCM
-        LVL1MenuItem('L1_BCM_Wide'                   ).setLogic( d.BCM_Wide & physcond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_BGRP0'             ).setLogic( d.BCM_Wide & d.BGRP0 ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_EMPTY'             ).setLogic( d.BCM_Wide & cosmiccond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_UNPAIRED_ISO'      ).setLogic( d.BCM_Wide & unpaired_isocond ).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_UNPAIRED_NONISO'   ).setLogic( d.BCM_Wide & unpaired_nonisocond ).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_BCM_HT_BGRP0'               ).setLogic( d.BCM_Comb.x(7) & d.BGRP0).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_AC_CA_BGRP0'            ).setLogic((d.BCM_AtoC|d.BCM_CtoA) & d.BGRP0).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_BCM_AC_CA_UNPAIRED_ISO'     ).setLogic((d.BCM_AtoC|d.BCM_CtoA)&unpaired_isocond).setTriggerType(TT.minb)
-
-        LVL1MenuItem('L1_BCM_AC_UNPAIRED_ISO'     ).setLogic( d.BCM_AtoC & unpaired_isocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_CA_UNPAIRED_ISO'     ).setLogic( d.BCM_CtoA & unpaired_isocond).setTriggerType(TT.minb)
-        
-        LVL1MenuItem('L1_BCM_AC_UNPAIRED_NONISO'     ).setLogic( d.BCM_AtoC & unpaired_nonisocond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_CA_UNPAIRED_NONISO'     ).setLogic( d.BCM_CtoA & unpaired_nonisocond).setTriggerType(TT.minb)
-        
-        LVL1MenuItem('L1_BCM_AC_ABORTGAPNOTCALIB'     ).setLogic( d.BCM_AtoC & abortgap).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_CA_ABORTGAPNOTCALIB'     ).setLogic( d.BCM_CtoA & abortgap).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_ABORTGAPNOTCALIB'   ).setLogic( d.BCM_Wide & abortgap).setTriggerType(TT.minb)        
-
-        LVL1MenuItem('L1_BCM_AC_CALIB'     ).setLogic( d.BCM_AtoC & calibcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_CA_CALIB'     ).setLogic( d.BCM_CtoA & calibcond).setTriggerType(TT.minb)
-        LVL1MenuItem('L1_BCM_Wide_CALIB'   ).setLogic( d.BCM_Wide & calibcond).setTriggerType(TT.minb)        
-
-        #AFP
-        #LVL1MenuItem('L1_AFP_NSC').setLogic( d.AFP_NSC & physcond )
-        #LVL1MenuItem('L1_AFP_FSC').setLogic( d.AFP_FSC & physcond )
-        #LVL1MenuItem('L1_AFP_C_ANY').setLogic( (d.AFP_FSC | d.AFP_NSC) & physcond )
-        #LVL1MenuItem('L1_AFP_C_ANY_UNPAIRED_ISO').setLogic( (d.AFP_FSC | d.AFP_NSC) & unpaired_isocond)
-        #LVL1MenuItem('L1_AFP_C_ANY_UNPAIRED_NONISO').setLogic( (d.AFP_FSC | d.AFP_NSC) & unpaired_nonisocond)
-        #LVL1MenuItem('L1_AFP_C_ANY_EMPTY').setLogic( (d.AFP_FSC | d.AFP_NSC) & cosmiccond)
-        #LVL1MenuItem('L1_AFP_C_ANY_FIRSTEMPTY').setLogic( (d.AFP_FSC | d.AFP_NSC) & firstempty)
-        #LVL1MenuItem('L1_AFP_C_AND').setLogic( (d.AFP_FSC & d.AFP_NSC) & physcond )
-
-
-        # RANDOM
-        LVL1MenuItem('L1_RD0_FILLED'         ).setLogic( d.RNDM0 & physcond           ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_EMPTY'          ).setLogic( d.RNDM0 & cosmiccond         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_UNPAIRED_ISO'   ).setLogic( d.RNDM0 & unpaired_isocond   ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_FIRSTEMPTY'     ).setLogic( d.RNDM0 & firstempty         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_BGRP9'          ).setLogic( d.RNDM0 & bgrp9cond          ).setTriggerType(TT.rand) 
-        LVL1MenuItem('L1_RD0_BGRP11'         ).setLogic( d.RNDM0 & bgrp11cond         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD0_ABORTGAPNOTCALIB').setLogic( d.RNDM0 & abortgap          ).setTriggerType(TT.rand)
-
-        
-
-        LVL1MenuItem('L1_RD1_FILLED'         ).setLogic( d.RNDM1 & physcond           ).setTriggerType(TT.zerobs) # used to be TT.rand
-        LVL1MenuItem('L1_RD1_EMPTY'          ).setLogic( d.RNDM1 & cosmiccond         ).setTriggerType(TT.zerobs)
-        LVL1MenuItem('L1_RD1_BGRP10'         ).setLogic( d.RNDM1 & alfacalib          ).setTriggerType(TT.zerobs)
-
-        LVL1MenuItem('L1_RD2_FILLED'         ).setLogic( d.RNDM2 & physcond           ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD2_EMPTY'          ).setLogic( d.RNDM2 & cosmiccond         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD2_BGRP11'         ).setLogic( d.RNDM2 & bgrp11cond         ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD2_BGRP12'         ).setLogic( d.RNDM2 & bgrp12cond         ).setTriggerType(TT.rand)
-
-        LVL1MenuItem('L1_RD3_FILLED'         ).setLogic( d.RNDM3 & physcond           ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_RD3_EMPTY'          ).setLogic( d.RNDM3 & cosmiccond         ).setTriggerType(TT.rand)
-
-        # BGRP
-        LVL1MenuItem('L1_BGRP0').setLogic( d.RNDM0 & d.BGRP0 ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BGRP1').setLogic( d.RNDM0 & d.BGRP0 & d.BGRP1 ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BGRP7').setLogic( d.RNDM0 & d.BGRP0 & d.BGRP7 ).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BGRP9').setLogic( d.RNDM0 & d.BGRP0 & d.BGRP9 ).setTriggerType(TT.rand)  #fixed in ATR-14201
-
-        LVL1MenuItem('L1_BPTX0_BGRP0', ctpid=0xf1).setLogic(d.BPTX0 & d.BGRP0).setTriggerType(TT.rand)
-        LVL1MenuItem('L1_BPTX1_BGRP0', ctpid=0xf2).setLogic(d.BPTX1 & d.BGRP0).setTriggerType(TT.rand)   
-        
-        # lumi measurements
-        LVL1MenuItem('L1_MLZ_A').setLogic( (d.MBTS_A|d.ZDC_A|d.LUCID_A) & physcond).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_MLZ_C').setLogic( (d.MBTS_C|d.ZDC_C|d.LUCID_C) & physcond).setTriggerType(TT.minb) 
-        LVL1MenuItem('L1_MBLZ' ).setLogic( ( (d.MBTS_A|d.ZDC_A|d.LUCID_A) & (d.MBTS_C|d.ZDC_C|d.LUCID_C) | d.BCM_Wide) & physcond ).setTriggerType(TT.minb)  
-
-        LVL1MenuItem('L1_CALREQ0', ctpid=0x1fd).setLogic( d.CAL0 & calibcond).setTriggerType(TT.calreq0) 
-        LVL1MenuItem('L1_CALREQ1', ctpid=0x1fe).setLogic( d.CAL1 & calibcond).setTriggerType(TT.calreq1)
-        LVL1MenuItem('L1_CALREQ2', ctpid=0x1ff).setLogic( d.CAL2 & calibcond).setTriggerType(TT.calreq2)   
-
-        # TRT
-        LVL1MenuItem('L1_TRT'       , ctpid=0x4e).setLogic(d.NIMTRT & d.BGRP0).setTriggerType(TT.nim)
-        LVL1MenuItem('L1_TRT_FILLED').setLogic(d.NIMTRT & physcond).setTriggerType(TT.nim)
-        LVL1MenuItem('L1_TRT_EMPTY' ).setLogic(d.NIMTRT & cosmiccond).setTriggerType(TT.nim)
-
-        # TGC
-        LVL1MenuItem('L1_TGC_BURST').setLogic(d.NIMTGC & d.BGRP0).setTriggerType(TT.nim)
-        # LVL1MenuItem('L1_TGC_BURST_EMPTY').setLogic(d.NIMTGC & cosmiccond).setTriggerType(TT.nim)
-
-
-        # LHCF
-        LVL1MenuItem('L1_LHCF').setLogic( d.NIMLHCF & physcond).setTriggerType(TT.nim)
-        LVL1MenuItem('L1_LHCF_UNPAIRED_ISO').setLogic( d.NIMLHCF & unpaired_isocond).setTriggerType(TT.nim)
-        LVL1MenuItem('L1_LHCF_EMPTY').setLogic( d.NIMLHCF & cosmiccond).setTriggerType(TT.nim)
-        
-        # ALFA 
-
-        # LUT 22 (12 Outputs)
-        # ALFA LUT output #1-8 are the single thresholds
-        ALFA_ANY_A    = d.ALFA_B7L1U | d.ALFA_B7L1L | d.ALFA_A7L1U | d.ALFA_A7L1L  #  9
-        ALFA_ANY_C    = d.ALFA_A7R1U | d.ALFA_A7R1L | d.ALFA_B7R1U | d.ALFA_B7R1L  # 10
-        ALFA_ANY_U    = d.ALFA_B7L1U | d.ALFA_A7L1U | d.ALFA_A7R1U | d.ALFA_B7R1U  # 11
-        ALFA_ANY_L    = d.ALFA_A7R1L | d.ALFA_B7R1L | d.ALFA_B7L1L | d.ALFA_A7L1L  # 12
-
-        # LUT 23 (12 Outputs)
-        ALFA_LU       = d.ALFA2_A7L1U | d.ALFA2_B7L1U #  0
-        ALFA_RL       = d.ALFA2_A7R1L | d.ALFA2_B7R1L #  1
-        ALFA_LL       = d.ALFA2_B7L1L | d.ALFA2_A7L1L #  2
-        ALFA_RU       = d.ALFA2_A7R1U | d.ALFA2_B7R1U #  3
-
-        ALFA_A_UL_AA  = d.ALFA2_A7L1L | d.ALFA2_A7L1U #  4
-        ALFA_A_UL_AB  = d.ALFA2_A7L1U | d.ALFA2_B7L1L #  5
-        ALFA_A_UL_BA  = d.ALFA2_A7L1L | d.ALFA2_B7L1U #  6
-        ALFA_A_UL_BB  = d.ALFA2_B7L1L | d.ALFA2_B7L1U #  7
-
-        ALFA_C_UL_AA  = d.ALFA2_A7R1L | d.ALFA2_A7R1U #  8
-        ALFA_C_UL_AB  = d.ALFA2_A7R1U | d.ALFA2_B7R1L #  9
-        ALFA_C_UL_BA  = d.ALFA2_A7R1L | d.ALFA2_B7R1U # 10
-        ALFA_C_UL_BB  = d.ALFA2_B7R1L | d.ALFA2_B7R1U # 11
-
-        # LUT 24 (9 Outputs)
-        ALFA_ANY          = d.ALFA3_B7L1U | d.ALFA3_B7L1L | d.ALFA3_A7L1U | d.ALFA3_A7L1L | d.ALFA3_A7R1U | d.ALFA3_A7R1L | d.ALFA3_B7R1U | d.ALFA3_B7R1L # 0
-        NOT_ALFA_ANY_A    = Not(d.ALFA3_B7L1U | d.ALFA3_B7L1L | d.ALFA3_A7L1U | d.ALFA3_A7L1L)  #  1-4
-        NOT_ALFA_ANY_C    = Not(d.ALFA3_A7R1U | d.ALFA3_A7R1L | d.ALFA3_B7R1U | d.ALFA3_B7R1L)  #  5-8
-
-        # LUT 25 (4 outputs)
-        ALFA_AE1          = d.ALFA4_B7L1U | d.ALFA4_A7L1U | d.ALFA4_B7L1L | d.ALFA4_A7L1L
-        ALFA_AE2          = d.ALFA4_B7L1U | d.ALFA4_A7L1U | d.ALFA4_A7R1L | d.ALFA4_B7R1L
-        ALFA_AE3          = d.ALFA4_A7R1U | d.ALFA4_B7R1U | d.ALFA4_B7L1L | d.ALFA4_A7L1L
-        ALFA_AE4          = d.ALFA4_A7R1U | d.ALFA4_B7R1U | d.ALFA4_A7R1L | d.ALFA4_B7R1L
-
-
-        # further simplification (in CAM)
-        ALFA_A            = ALFA_A_UL_AA & ALFA_A_UL_AB & ALFA_A_UL_BA & ALFA_A_UL_BB
-        ALFA_C            = ALFA_C_UL_AA & ALFA_C_UL_AB & ALFA_C_UL_BA & ALFA_C_UL_BB
-        ALFA_ELASTIC      = ALFA_ANY_A & ALFA_ANY_C & ALFA_ANY_U & ALFA_ANY_L
-        ALFA_EINE         = ALFA_ANY_A & ALFA_ANY_C
-        ALFA_ANTI_ELASTIC = ALFA_AE1 & ALFA_AE2 & ALFA_AE3 & ALFA_AE4
-
-
-        d.MBTS_INNER = (d.MBTS_A0 | d.MBTS_A1 |  d.MBTS_A2 | d.MBTS_A3 | d.MBTS_A4 | d.MBTS_A5 | d.MBTS_A6 | d.MBTS_A7 | d.MBTS_C0 | d.MBTS_C1 | d.MBTS_C2 | d.MBTS_C3 | d.MBTS_C4 | d.MBTS_C5 | d.MBTS_C6 | d.MBTS_C7)         
-
-        ## AFP and ALFA
-        # AFP_C =  ((d.AFP_FSC | d.AFP_NSC) |  (d.AFP_FSC & d.AFP_NSC ))
-        # LVL1MenuItem('L1_AFP_C_MBTS_A').setLogic( AFP_C & d.MBTS_A & physcond )
-        # LVL1MenuItem('L1_AFP_C_ZDC_C').setLogic( AFP_C & d.ZDC_C & physcond )
-        # LVL1MenuItem('L1_AFP_C_J12').setLogic( AFP_C & d.J12 & physcond )# available lowest J threshold in the current v6 menu: J12 
-        # LVL1MenuItem('L1_AFP_C_EM3').setLogic( AFP_C & d.EM3 & physcond )
-        # LVL1MenuItem('L1_AFP_C_TE5').setLogic( AFP_C & d.TE5 & physcond )
-        # LVL1MenuItem('L1_AFP_C_ALFA_C').setLogic( AFP_C &  ALFA_C & physcond )
-        # LVL1MenuItem('L1_AFP_C_ALFA_A').setLogic( AFP_C &  ALFA_A & physcond )
-
-        #AFP_C =  (d.AFP_FSC & d.AFP_NSC)
-        #LVL1MenuItem('L1_AFP_C_MBTS_A').setLogic( AFP_C & d.MBTS_A & physcond )
-        #LVL1MenuItem('L1_AFP_C_ZDC_C').setLogic( AFP_C & d.ZDC_C & physcond )
-        #LVL1MenuItem('L1_AFP_C_J12').setLogic( AFP_C & d.J12 & physcond )
-        #LVL1MenuItem('L1_AFP_C_EM3').setLogic( AFP_C & d.EM3 & physcond )
-        #LVL1MenuItem('L1_AFP_C_MU4').setLogic( AFP_C & d.MU4 & physcond )
-        #LVL1MenuItem('L1_AFP_C_TE5').setLogic( AFP_C & d.TE5 & physcond )
-        #LVL1MenuItem('L1_AFP_C_ALFA_C').setLogic( AFP_C &  ALFA_C & physcond )
-        #LVL1MenuItem('L1_AFP_C_ALFA_A').setLogic( AFP_C &  ALFA_A & physcond )
-        #LVL1MenuItem('L1_AFP_C_ANY_MBTS_A').setLogic( (d.AFP_FSC | d.AFP_NSC) & d.MBTS_A & physcond )
-
-        ## ALFA Single items
-        LVL1MenuItem('L1_ALFA_B7L1U').setLogic(d.ALFA_B7L1U & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7L1L').setLogic(d.ALFA_B7L1L & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7L1U').setLogic(d.ALFA_A7L1U & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7L1L').setLogic(d.ALFA_A7L1L & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7R1U').setLogic(d.ALFA_A7R1U & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7R1L').setLogic(d.ALFA_A7R1L & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7R1U').setLogic(d.ALFA_B7R1U & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7R1L').setLogic(d.ALFA_B7R1L & d.BGRP0).setTriggerType(TT.alfa)
-
-
-        LVL1MenuItem('L1_ALFA_ELAST1').setLogic( d.ALFA_B7L1U & d.ALFA_A7L1U & d.ALFA_A7R1L & d.ALFA_B7R1L &
-                                                 Not(d.ALFA3_B7L1L | d.ALFA3_A7L1L | d.ALFA3_A7R1U | d.ALFA3_B7R1U)
-                                                 & physcond).setTriggerType(TT.alfa)
-        
-        LVL1MenuItem('L1_ALFA_ELAST2').setLogic( d.ALFA_B7L1L & d.ALFA_A7L1L & d.ALFA_A7R1U & d.ALFA_B7R1U &
-                                                 Not(d.ALFA3_B7L1U | d.ALFA3_A7L1U | d.ALFA3_A7R1L | d.ALFA3_B7R1L)
-                                                 & physcond).setTriggerType(TT.alfa)
-        
-        LVL1MenuItem('L1_ALFA_ELAST11').setLogic( d.ALFA_B7L1U & d.ALFA_A7L1U & d.ALFA_A7R1L & d.ALFA_B7R1L    & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST12').setLogic( d.ALFA_B7L1L & d.ALFA_A7L1L & d.ALFA_A7R1U & d.ALFA_B7R1U    & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST13').setLogic( ALFA_LU & (d.ALFA_A7R1L & d.ALFA_B7R1L)                  & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST14').setLogic( (d.ALFA_B7L1U & d.ALFA_A7L1U) & ALFA_RL & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST15').setLogic( ALFA_LU & ALFA_RL & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST15_Calib').setLogic( ALFA_LU & ALFA_RL &  alfacalib).setTriggerType(TT.alfa) ## CHECK
-        LVL1MenuItem('L1_ALFA_ELAST16').setLogic( ALFA_LL & (d.ALFA_A7R1U & d.ALFA_B7R1U) & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST17').setLogic((d.ALFA_B7L1L & d.ALFA_A7L1L) & ALFA_RU & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST18').setLogic( ALFA_LL & ALFA_RU & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELAST18_Calib').setLogic( ALFA_LL & ALFA_RU & alfacalib).setTriggerType(TT.alfa)
-
-
-        LVL1MenuItem('L1_ALFA_SDIFF1').setLogic( d.ALFA_B7L1U & d.ALFA_A7L1U &
-                                                 Not(d.ALFA3_B7L1L | d.ALFA3_A7L1L | d.ALFA3_A7R1U | d.ALFA3_A7R1L | d.ALFA3_B7R1U | d.ALFA3_B7R1L)
-                                                 & physcond).setTriggerType(TT.alfa)
-        
-        LVL1MenuItem('L1_ALFA_SDIFF2').setLogic( d.ALFA_A7R1L & d.ALFA_B7R1L &
-                                                 Not(d.ALFA3_B7L1U | d.ALFA3_B7L1L | d.ALFA3_A7L1U | d.ALFA3_A7L1L | d.ALFA3_A7R1U | d.ALFA3_B7R1U)
-                                                 & physcond).setTriggerType(TT.alfa)
-         
-        LVL1MenuItem('L1_ALFA_SDIFF3').setLogic( d.ALFA_B7L1L & d.ALFA_A7L1L &
-                                                 Not(d.ALFA3_B7L1U | d.ALFA3_A7L1U | d.ALFA3_A7R1U | d.ALFA3_A7R1L | d.ALFA3_B7R1U | d.ALFA3_B7R1L)
-                                                 & physcond).setTriggerType(TT.alfa)
-         
-        LVL1MenuItem('L1_ALFA_SDIFF4').setLogic( d.ALFA_A7R1U & d.ALFA_B7R1U &
-                                                 Not(d.ALFA3_B7L1U | d.ALFA3_B7L1L | d.ALFA3_A7L1U | d.ALFA3_A7L1L | d.ALFA3_A7R1L | d.ALFA3_B7R1L)
-                                                 & physcond).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_SDIFF5').setLogic( d.ALFA_B7L1U & d.ALFA_A7L1U &  physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_ALFA_SDIFF6').setLogic( d.ALFA_A7R1L & d.ALFA_B7R1L &  physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_ALFA_SDIFF7').setLogic( d.ALFA_B7L1L & d.ALFA_A7L1L &  physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_ALFA_SDIFF8').setLogic( d.ALFA_A7R1U & d.ALFA_B7R1U &  physcond).setTriggerType(TT.alfa) 
-                                                           
-        LVL1MenuItem('L1_MBTS_1_A_ALFA_C').setLogic( d.MBTS_A & ALFA_C  & physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_MBTS_1_C_ALFA_A').setLogic( d.MBTS_C & ALFA_A & physcond).setTriggerType(TT.alfa)        
-        LVL1MenuItem('L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO').setLogic( d.MBTS_A & ALFA_C & unpaired_isocond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO').setLogic( d.MBTS_C & ALFA_A & unpaired_isocond).setTriggerType(TT.alfa)        
-        LVL1MenuItem('L1_MBTS_1_ALFA_ANY').setLogic( MBTS_1 & ALFA_ANY  & physcond).setTriggerType(TT.alfa) ##should be called L1_MBTS_1_ALFA_ANY                          
-
-        ## check definition of d.MBTS_2
-        LVL1MenuItem('L1_MBTS_2_A_ALFA_C').setLogic( d.MBTS_A.x(2) & ALFA_C & physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_MBTS_2_C_ALFA_A').setLogic( d.MBTS_C.x(2) & ALFA_A & physcond).setTriggerType(TT.alfa)        
-        LVL1MenuItem('L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO').setLogic( d.MBTS_A.x(2) & ALFA_C & unpaired_isocond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO').setLogic( d.MBTS_C.x(2) & ALFA_A & unpaired_isocond).setTriggerType(TT.alfa)        
-        LVL1MenuItem('L1_MBTS_2_ALFA').setLogic( MBTS_2 & ALFA_ANY & physcond).setTriggerType(TT.alfa)              
-        
-        LVL1MenuItem('L1_LUCID_A_ALFA_C').setLogic( d.LUCID_A & ALFA_C & physcond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_LUCID_C_ALFA_A').setLogic( d.LUCID_C & ALFA_A & physcond).setTriggerType(TT.alfa)     
-        LVL1MenuItem('L1_LUCID_A_ALFA_C_UNPAIRED_ISO').setLogic( d.LUCID_A & ALFA_C & unpaired_isocond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_LUCID_C_ALFA_A_UNPAIRED_ISO').setLogic( d.LUCID_C & ALFA_A & unpaired_isocond).setTriggerType(TT.alfa) 
-        LVL1MenuItem('L1_LUCID_ALFA').setLogic( (d.LUCID_A | d.LUCID_C) & ALFA_ANY & physcond).setTriggerType(TT.alfa) 
-        
-        #LVL1MenuItem('L1_ZDC_A_ALFA_C').setLogic( d.ZDC_A  & ALFA_C & physcond).setTriggerType(TT.alfa) 
-        #LVL1MenuItem('L1_ZDC_C_ALFA_A').setLogic( ZDC_C  & ALFA_A & physcond).setTriggerType(TT.alfa)     
-        #LVL1MenuItem('L1_ZDC_ALFA').setLogic( (d.ZDC_A | ZDC_C) & ALFA_ANY & physcond).setTriggerType(TT.alfa) 
-        
-        LVL1MenuItem('L1_EM3_ALFA_ANY'             ).setLogic( d.EM3 & ALFA_ANY & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_ANY_UNPAIRED_ISO').setLogic( d.EM3 & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_ANY_VETO_MBTS' ).setLogic( d.EM3 & ALFA_ANY  & Not(d.MBTS_INNER) & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_EINE'          ).setLogic( d.EM3 & ALFA_EINE & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_EINE_VETO_MBTS').setLogic( d.EM3 & ALFA_EINE & Not(d.MBTS_INNER) & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_A'             ).setLogic( d.EM3 & d.MBTS_A & ALFA_ANY_A & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_C'             ).setLogic( d.EM3 & d.MBTS_C & ALFA_ANY_C & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_A_UNPAIRED_ISO').setLogic( d.EM3 & d.MBTS_A & ALFA_ANY_A & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_EM3_ALFA_MBTS_C_UNPAIRED_ISO').setLogic( d.EM3 & d.MBTS_A & ALFA_ANY_C & unpaired_isocond).setTriggerType(TT.alfa)
-        
-        LVL1MenuItem('L1_J12_ALFA_ANY'             ).setLogic( d.J12 & ALFA_ANY & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_J12_ALFA_ANY_UNPAIRED_ISO').setLogic( d.J12 & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_TE5_ALFA_ANY'             ).setLogic( d.TE5 & ALFA_ANY  & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_TE5_ALFA_ANY_UNPAIRED_ISO').setLogic( d.TE5 & ALFA_ANY  & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_TE5_ALFA_EINE'            ).setLogic( d.TE5 & ALFA_EINE & physcond).setTriggerType(TT.alfa)
-        
-        LVL1MenuItem('L1_TRT_ALFA_ANY'             ).setLogic( d.NIMTRT & ALFA_ANY & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_TRT_ALFA_ANY_UNPAIRED_ISO').setLogic( d.NIMTRT & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)
-                   
-        LVL1MenuItem('L1_TRT_ALFA_ANY_VETO_MBTS'           ).setLogic( d.NIMTRT & Not(d.MBTS_INNER) & ALFA_ANY & physcond).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_TRT_ALFA_EINE'                    ).setLogic( d.NIMTRT & ALFA_EINE & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_TRT_ALFA_EINE_VETO_MBTS'          ).setLogic( d.NIMTRT & Not(d.MBTS_INNER) & ALFA_EINE & physcond).setTriggerType(TT.alfa)
-        
-        LVL1MenuItem('L1_ALFA_ELASTIC_VETO_MBTS'           ).setLogic( Not(d.MBTS_INNER) & ALFA_ELASTIC & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ELASTIC_UNPAIRED_ISO'        ).setLogic( ALFA_ELASTIC & unpaired_isocond).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_ANTI_ELASTIC_VETO_MBTS'   ).setLogic( Not(d.MBTS_INNER) & ALFA_ANTI_ELASTIC & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANTI_ELASTIC_UNPAIRED_ISO').setLogic( ALFA_ANTI_ELASTIC & unpaired_isocond).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_ANY_VETO_MBTS'                      ).setLogic( Not(d.MBTS_INNER) & ALFA_ANY & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_VETO_MBTS_UNPAIRED_ISO'         ).setLogic( Not(d.MBTS_INNER) & ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)
-                
-        LVL1MenuItem('L1_LHCF_ALFA_ANY_A'             ).setLogic( d.NIMLHCF & ALFA_ANY_A & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_LHCF_ALFA_ANY_C'             ).setLogic( d.NIMLHCF & ALFA_ANY_C & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO').setLogic( d.NIMLHCF & ALFA_ANY_A & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO').setLogic( d.NIMLHCF & ALFA_ANY_C & unpaired_isocond).setTriggerType(TT.alfa)
-        
-        LVL1MenuItem('L1_ALFA_BGT' ).setLogic(d.RNDM3 & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_BGT_UNPAIRED_ISO' ).setLogic(d.RNDM3 & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_BGT_BGRP10').setLogic(d.RNDM3 & alfacalib).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_SHOWSYST5').setLogic( (ALFA_ANY_A & ALFA_ANY_C) & physcond).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_SYST9' ).setLogic( d.ALFA_B7L1U & d.ALFA_A7L1U & d.ALFA_A7R1U & d.ALFA_B7R1U & Not(d.ALFA3_B7L1L | d.ALFA3_A7L1L | d.ALFA3_A7R1L | d.ALFA3_B7R1L) & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_SYST10').setLogic( d.ALFA_B7L1L & d.ALFA_A7L1L & d.ALFA_A7R1L & d.ALFA_B7R1L & Not(d.ALFA3_B7L1U | d.ALFA3_A7L1U | d.ALFA3_A7R1U | d.ALFA3_B7R1U) & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_SYST11').setLogic( d.ALFA_B7L1U & d.ALFA_A7L1U & d.ALFA_A7R1U & d.ALFA_B7R1U & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_SYST12').setLogic( d.ALFA_B7L1L & d.ALFA_A7L1L & d.ALFA_A7R1L & d.ALFA_B7R1L & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_SYST17').setLogic( ALFA_LU & ALFA_RU & physcond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_SYST18').setLogic( ALFA_LL & ALFA_RL & physcond).setTriggerType(TT.alfa)
-       
-        LVL1MenuItem('L1_ALFA_ANY').setLogic(ALFA_ANY & physcond).setTriggerType(TT.alfa)
-        
-        LVL1MenuItem('L1_ALFA_ANY_EMPTY').setLogic(ALFA_ANY & cosmiccond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_FIRSTEMPTY').setLogic(ALFA_ANY & firstempty).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_UNPAIRED_ISO').setLogic(ALFA_ANY & unpaired_isocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_UNPAIRED_NONISO').setLogic(ALFA_ANY & unpaired_nonisocond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_BGRP10').setLogic(ALFA_ANY & alfacalib).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_ABORTGAPNOTCALIB').setLogic( ALFA_ANY & abortgap).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_CALIB').setLogic( ALFA_ANY & calibcond).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_ANY_A_EMPTY').setLogic(ALFA_ANY_A & cosmiccond).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_ANY_C_EMPTY').setLogic(ALFA_ANY_C & cosmiccond).setTriggerType(TT.alfa)
-
-        ## ALFA _OD items (LUT 26, 12 Outputs)
-        LVL1MenuItem('L1_ALFA_B7L1U_OD').setLogic(d.ALFA_B7L1U_OD & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7L1L_OD').setLogic(d.ALFA_B7L1L_OD & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7L1U_OD').setLogic(d.ALFA_A7L1U_OD & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7L1L_OD').setLogic(d.ALFA_A7L1L_OD & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7R1U_OD').setLogic(d.ALFA_A7R1U_OD & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7R1L_OD').setLogic(d.ALFA_A7R1L_OD & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7R1U_OD').setLogic(d.ALFA_B7R1U_OD & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7R1L_OD').setLogic(d.ALFA_B7R1L_OD & d.BGRP0).setTriggerType(TT.alfa)
-
-        LVL1MenuItem('L1_ALFA_B7L1_OD').setLogic( (d.ALFA_B7L1U_OD & d.ALFA_B7L1L_OD) & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7L1_OD').setLogic( (d.ALFA_A7L1U_OD & d.ALFA_A7L1L_OD) & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_B7R1_OD').setLogic( (d.ALFA_B7R1U_OD & d.ALFA_B7R1L_OD) & d.BGRP0).setTriggerType(TT.alfa)
-        LVL1MenuItem('L1_ALFA_A7R1_OD').setLogic( (d.ALFA_A7R1U_OD & d.ALFA_A7R1L_OD) & d.BGRP0).setTriggerType(TT.alfa)
-
-        #if (('Physics_HI_v3' not in TriggerFlags.triggerMenuSetup()) and ('MC_HI_v3' not in TriggerFlags.triggerMenuSetup())):
-            # Topo items (keep them all together)
-        #if not 'HI' in TriggerFlags.triggerMenuSetup():
-        #now also HI jets
-        if 1:
-            try:
-
-                    # M8 menu
-                    #LVL1MenuItem('L1_MJJ-4').setLogic( d.TOPO_4INVM9999_AJ0s6_AJ0s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-3').setLogic( d.TOPO_3INVM9999_AJ0s6_AJ0s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-2').setLogic( d.TOPO_2INVM9999_AJ0s6_AJ0s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-1').setLogic( d.TOPO_1INVM9999_AJ0s6_AJ0s6 & physcond)
-
-                    #LVL1MenuItem('L1_HT200-J20s5.ETA49').setLogic( d.TOPO_HT200_AJ20s5ETA49 & physcond)
-                    #LVL1MenuItem('L1_HT190-J20s5.ETA49').setLogic( d.TOPO_HT190_AJ20s5ETA49 & physcond)
-                    #LVL1MenuItem('L1_HT1-J0.ETA49').setLogic( d.TOPO_HT1_AJ0allETA49 & physcond)
-
-                    # LVL1MenuItem('L1_JPSI-1M5-EM6').setLogic( d.TOPO_1INVM5_EM6s2_EMall & physcond)
-                    #LVL1MenuItem('L1_JPSI-1M5-EMs').setLogic( d.TOPO_1INVM5_EMs2_EMs & physcond)
-                    #LVL1MenuItem('L1_JPSI-1M5-EM6s').setLogic( d.TOPO_1INVM5_EM6s2_EMs & physcond)
-                    #LVL1MenuItem('L1_JPSI-1M5-EM12s').setLogic( d.TOPO_1INVM5_EM12s2_EMs & physcond)
-
-                    ### NOT WORKING due to acceptaed number of bits in TOPO1
-                    LVL1MenuItem("L1_2MU4-BO"     ).setLogic( d.TOPO_MULT_CMU4ab.x(2) & physcond)
-                    LVL1MenuItem("L1_2MU6-BO"     ).setLogic( d.TOPO_MULT_CMU6ab.x(2) & physcond)
-                    LVL1MenuItem("L1_MU6MU4-BO").setLogic( d.TOPO_MULT_CMU4ab.x(2) & d.TOPO_MULT_CMU6ab & physcond)
-
-                    # B-jet
-                    LVL1MenuItem('L1_BTAG-MU4J15').setLogic( d.TOPO_0DR04_MU4ab_CJ15ab & physcond)
-                    LVL1MenuItem('L1_BTAG-MU6J20').setLogic( d.TOPO_0DR04_MU6ab_CJ20ab & physcond)
-
-
-                    # ZH
-                    #LVL1MenuItem('L1_DPHI-AJ20s2XE50'  ).setLogic( d.TOPO_10MINDPHI_AJ20s2_XE50    & physcond)
-
-                    #LVL1MenuItem('L1_J40_DPHI-Js2XE50'  ).setLogic( d.J40 & d.TOPO_10MINDPHI_Js2_XE50    & physcond) 
-                    LVL1MenuItem('L1_J40_DPHI-J20s2XE50').setLogic( d.J40 & d.TOPO_10MINDPHI_J20s2_XE50  & physcond) 
-                    LVL1MenuItem('L1_J40_DPHI-J20s2XE30').setLogic( d.J40 & d.TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_MU4_J20_XE30_DPHI-J20s2XE30').setLogic( d.MU4 & d.J20 & d.XE30 & d.TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_2MU4_J20_XE30_DPHI-J20s2XE30').setLogic( d.MU4.x(2) & d.J20 & d.XE30 & d.TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30').setLogic( d.MU4 & d.EM3.x(2) & d.J20 & d.XE30 & d.TOPO_10MINDPHI_J20s2_XE30  & physcond)
-                    LVL1MenuItem('L1_3EM3_J40_XE50_DPHI-J20s2XE50').setLogic( d.EM3.x(3) & d.J40 & d.XE50 & d.TOPO_10MINDPHI_J20s2_XE50  & physcond)
-
-
-                    LVL1MenuItem('L1_J40_XE50_DPHI-J20s2XE50').setLogic( d.J40 & d.XE50 & d.TOPO_10MINDPHI_J20s2_XE50  & physcond) 
-                    #LVL1MenuItem('L1_J40_DPHI-J20XE50'  ).setLogic( d.J40 & d.TOPO_10MINDPHI_J20ab_XE50  & physcond) 
-                    #LVL1MenuItem('L1_J40_DPHI-CJ20XE50' ).setLogic( d.J40 & d.TOPO_10MINDPHI_CJ20ab_XE50 & physcond) 
-
-                    # HT
-                    #LVL1MenuItem('L1_HT0-J0.ETA49'     ).setLogic( d.TOPO_HT0_AJ0allETA49    & physcond)
-                    #LVL1MenuItem('L1_HT190-J15.ETA21'  ).setLogic( d.TOPO_HT190_AJ15allETA21 & physcond)
-                    LVL1MenuItem('L1_HT190-J15s5pETA21').setLogic( d.TOPO_HT190_J15s5ETA21   & physcond)
-                    #LVL1MenuItem('L1_HT150-J20.ETA31'  ).setLogic( d.TOPO_HT150_AJ20allETA31 & physcond)
-                    LVL1MenuItem('L1_HT150-J20s5pETA31').setLogic( d.TOPO_HT150_J20s5ETA31   & physcond)
-
-
-                    #LVL1MenuItem('L1_HT150-J20s5.ETA31_MJJ-400').setLogic( d.TOPO_HT150_J20s5ETA31 & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)# new
-                    LVL1MenuItem('L1_HT150-J20s5pETA31_MJJ-400-CF').setLogic( d.TOPO_HT150_J20s5ETA31 & d.TOPO_400INVM9999_AJ30s6ETA31_AJ20s631ETA49 & physcond) #new
-                    LVL1MenuItem('L1_MJJ-400-NFF-0DPHI20').setLogic( d.TOPO_400INVM9999_0DPHI20_J30s6_AJ20s6 & physcond)    # noqa: F821
-                    LVL1MenuItem('L1_MJJ-400-NFF-0DPHI22').setLogic( d.TOPO_400INVM9999_0DPHI22_J30s6_AJ20s6 & physcond)    # noqa: F821
-                    LVL1MenuItem('L1_MJJ-400-NFF-0DPHI24').setLogic( d.TOPO_400INVM9999_0DPHI24_J30s6_AJ20s6 & physcond)    # noqa: F821
-                    LVL1MenuItem('L1_MJJ-400-NFF-0DPHI26').setLogic( d.TOPO_400INVM9999_0DPHI26_J30s6_AJ20s6 & physcond)    # noqa: F821
-
-                    # Jpsi T&P
-                    #LVL1MenuItem("L1_JPSI-1M5"     ).setLogic( d.TOPO_1INVM5_EMs1_EMs6   & physcond)
-                    LVL1MenuItem("L1_JPSI-1M5-EM7" ).setLogic( d.TOPO_1INVM5_EM7s1_EMs6  & physcond)
-                    LVL1MenuItem("L1_JPSI-1M5-EM12").setLogic( d.TOPO_1INVM5_EM12s1_EMs6 & physcond)
-
-                    # # W T&P
-                    # if not '_v6' in TriggerFlags.triggerMenuSetup():
-                    #     LVL1MenuItem("L1_W-05DPHI-JXE-0"   ).setLogic( d.TOPO_05MINDPHI_AJj20s6_XE0 & physcond)
-                    #     LVL1MenuItem("L1_W-10DPHI-JXE-0"   ).setLogic( d.TOPO_10MINDPHI_AJj20s6_XE0 & physcond)
-                    #     LVL1MenuItem("L1_W-15DPHI-JXE-0"   ).setLogic( d.TOPO_15MINDPHI_AJj20s6_XE0 & physcond)
-                    #     LVL1MenuItem("L1_W-10DPHI-EMXE-0"  ).setLogic( d.TOPO_10MINDPHI_EM10s6_XE0  & physcond)
-                    #     LVL1MenuItem("L1_W-15DPHI-EMXE-0"  ).setLogic( d.TOPO_15MINDPHI_EM10s6_XE0  & physcond)
-                    #     LVL1MenuItem("L1_W-05DPHI-EMXE-1"  ).setLogic( d.TOPO_05MINDPHI_EM15s6_XE0  & physcond)
-                    #     LVL1MenuItem("L1_W-05RO-XEHT-0"    ).setLogic( d.TOPO_05RATIO_XE0_HT0_AJj15allETA49   & physcond)
-                    #     LVL1MenuItem("L1_W-08RO-XEHT-0"    ).setLogic( d.TOPO_08RATIO_XE0_HT0_AJj15allETA49   & physcond)
-                    #     LVL1MenuItem("L1_W-90RO2-XEHT-0"   ).setLogic( d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49  & physcond)
-                    #     LVL1MenuItem("L1_W-250RO2-XEHT-0"  ).setLogic( d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    #     LVL1MenuItem("L1_W-HT20-JJ15.ETA49").setLogic( d.TOPO_HT20_AJj15allETA49 & physcond)
-                    #     LVL1MenuItem("L1_W-NOMATCH"        ).setLogic( d.TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT25").setLogic( d.TOPO_25MT_EM10s6_XE0 & d.EM10 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT30").setLogic( d.TOPO_30MT_EM10s6_XE0 & d.EM10 & physcond)
-                    #     LVL1MenuItem("L1_EM15_W-MT35").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" ).setLogic( d.TOPO_25MT_EM10s6_XE0 & d.EM10 & d.TOPO_15MINDPHI_AJj20s6_XE0 & d.TOPO_15MINDPHI_EM10s6_XE0 & d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30"           ).setLogic( d.TOPO_25MT_EM10s6_XE0 & d.EM10 & d.TOPO_15MINDPHI_AJj20s6_XE0 & d.TOPO_15MINDPHI_EM10s6_XE0 & d.XS30 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20"           ).setLogic( d.TOPO_25MT_EM10s6_XE0 & d.EM10 & d.TOPO_15MINDPHI_AJj20s6_XE0 & d.TOPO_15MINDPHI_EM10s6_XE0 & d.XS20 & physcond)
-                    #     LVL1MenuItem("L1_EM10_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE"                ).setLogic( d.TOPO_25MT_EM10s6_XE0 & d.EM10 & d.TOPO_15MINDPHI_AJj20s6_XE0 & d.TOPO_15MINDPHI_EM10s6_XE0 & physcond)
-                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_W-250RO2-XEHT-0").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj20s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS60"           ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj20s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & d.XS60 & physcond)
-                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE_XS30"           ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj20s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & d.XS30 & physcond)
-                    #     LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EMXE"                ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj20s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-                    #else:
-#                    LVL1MenuItem("L1_W-05DPHI-JXE-0"   ).setLogic( d.TOPO_05MINDPHI_AJj10s6_XE0 & physcond)
-#                    LVL1MenuItem("L1_W-10DPHI-JXE-0"   ).setLogic( d.TOPO_10MINDPHI_AJj10s6_XE0 & physcond)
-#                    LVL1MenuItem("L1_W-15DPHI-JXE-0"   ).setLogic( d.TOPO_15MINDPHI_AJj10s6_XE0 & physcond)
-#                    LVL1MenuItem("L1_W-05DPHI-EMXE-1"  ).setLogic( d.TOPO_05MINDPHI_EM12s6_XE0  & physcond)
-#
-#                    LVL1MenuItem("L1_W-05DPHI-EM15XE-1"  ).setLogic( d.TOPO_05MINDPHI_EM15s6_XE0  & physcond)
-#
-#                    LVL1MenuItem("L1_W-15DPHI-EM15XE-1"  ).setLogic( d.TOPO_15MINDPHI_EM15s6_XE0  & physcond)
-#                    LVL1MenuItem("L1_W-15DPHI-EMXE-1"  ).setLogic( d.TOPO_15MINDPHI_EM12s6_XE0  & physcond)
-#                    LVL1MenuItem("L1_W-05RO-XEHT-0"    ).setLogic( d.TOPO_05RATIO_XE0_HT0_AJj15allETA49   & physcond)
-#                    LVL1MenuItem("L1_W-90RO2-XEHT-0"   ).setLogic( d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49  & physcond)
-#                    LVL1MenuItem("L1_W-250RO2-XEHT-0"  ).setLogic( d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-#                    LVL1MenuItem("L1_W-HT20-JJ15.ETA49").setLogic( d.TOPO_HT20_AJj15allETA49 & physcond)
-#                    LVL1MenuItem("L1_W-NOMATCH"        ).setLogic( d.TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & physcond)
-#                    #LVL1MenuItem("L1_W-NOMATCH_W-05RO-XEEMHT").setLogic( d.TOPO_NOT_02MATCH_EM10s1_AJj15allETA49 & d.TOPO_05RATIO_XE0_SUM0_EM10s1_HT0_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_EM12_W-MT25").setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & physcond)
-                    #LVL1MenuItem("L1_EM12_W-MT30").setLogic( d.TOPO_30MT_EM12s6_XE0 & d.EM12 & physcond)
-                    #LVL1MenuItem("L1_EM15_W-MT35").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & physcond)
-
-                    #LVL1MenuItem("L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-                    #LVL1MenuItem("L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS60 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-                    #LVL1MenuItem("L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS40 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-                    #LVL1MenuItem("L1_EM15_W-MT35_XS60").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS60 & physcond)
-
-                    #LVL1MenuItem("L1_EM15VH_W-MT35_XS60").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15VH & d.XS60 & physcond)
-                    #LVL1MenuItem("L1_EM20VH_W-MT35_XS60").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM20VH & d.XS60 & physcond)
-                    #LVL1MenuItem("L1_EM22VHI_W-MT35_XS40").setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM22VHI & d.XS40 & physcond)
-
-
-                    
-                    #LVL1MenuItem("L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE"            ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.XS40 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM12s6_XE0 & physcond)
-#                    LVL1MenuItem("L1_EM12_W-MT35").setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & physcond)                    
-#                    #LVL1MenuItem("L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM12s6_XE0 & physcond)
-#                    #LVL1MenuItem("L1_EM12_W-MT35_XS50").setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.XS50 & physcond)
-#                    #LVL1MenuItem("L1_EM10VH_W-MT35_XS50").setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM10VH & d.XS50 & physcond)
-#                    #LVL1MenuItem("L1_W-15DPHI-EM15XE-0"  ).setLogic( d.TOPO_15MINDPHI_EM15s6_XE0  & physcond)
-#                    LVL1MenuItem("L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE" ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_250RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM15s6_XE0 & physcond)
-#                    LVL1MenuItem("L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS60 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM15s6_XE0 & physcond)
-#                    LVL1MenuItem("L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE"            ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.XS40 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM15s6_XE0 & physcond)
-#                    LVL1MenuItem("L1_W-15DPHI-EMXE-0"  ).setLogic( d.TOPO_15MINDPHI_EM12s6_XE0  & physcond)
-#                    LVL1MenuItem("L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE"            ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.XS30 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & physcond)
-#                    LVL1MenuItem("L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE"  ).setLogic( d.TOPO_35MT_EM12s6_XE0 & d.EM12 & d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & physcond)
-#                    # Old
-#                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0"   ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & d.TOPO_90RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-#                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS30"           ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & d.XS30 & physcond)
-#                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20"           ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & d.XS20 & physcond)
-#                    LVL1MenuItem("L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE"                ).setLogic( d.TOPO_25MT_EM12s6_XE0 & d.EM12 & d.TOPO_15MINDPHI_AJj10s6_XE0 & d.TOPO_15MINDPHI_EM12s6_XE0 & physcond)
-#
-#
-#                    LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30"         ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & d.XS30 & physcond)
-#                    LVL1MenuItem("L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE"              ).setLogic( d.TOPO_35MT_EM15s6_XE0 & d.EM15 & d.TOPO_05MINDPHI_AJj10s6_XE0 & d.TOPO_05MINDPHI_EM15s6_XE0 & physcond)
-#
-                    #LVL1MenuItem("L1_W-10DPHI-JXE-0").setLogic( d.TOPO_10MINDPHI_AJj15s2_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-20DPHI-JXE-1").setLogic( d.TOPO_20MINDPHI_AJjs6_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-20DPHI-JXE-0").setLogic( d.TOPO_20MINDPHI_AJj15s2_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-10DPHI-EMXE-0").setLogic( d.TOPO_10MINDPHI_EM6s1_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-20DPHI-EMXE-1").setLogic( d.TOPO_20MINDPHI_EM9s6_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-20DPHI-EMXE-0").setLogic( d.TOPO_20MINDPHI_EM6s1_XE0 & physcond)
-                    #LVL1MenuItem("L1_W-05RO-XEHT-0").setLogic( d.TOPO_05RATIO_XE0_HT0_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-08RO-XEHT-1").setLogic( d.TOPO_08RATIO_XE0_HT0_AJj0allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-40RO2-XEHT-0").setLogic( d.TOPO_40RATIO2_XE0_HT0_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-90RO2-XEHT-1").setLogic( d.TOPO_90RATIO2_XE0_HT0_AJj0allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-HT20-JJ0.ETA49").setLogic( d.TOPO_HT20_AJj0allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-NOMATCH").setLogic( d.TOPO_NOT_02MATCH_EM9s1_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_W-NOMATCH_W-05RO-XEEMHT").setLogic( d.TOPO_NOT_02MATCH_EM9s1_AJj15allETA49 & d.TOPO_05RATIO_XE0_SUM0_EM9s1_HT0_AJj15allETA49 & physcond)
-                    #LVL1MenuItem("L1_EM3_W-MT20").setLogic( d.TOPO_20MT_EM6s6_XE0 & d.EM3 & physcond)
-                    #LVL1MenuItem("L1_EM3_W-MT30").setLogic( d.TOPO_30MT_EM6s6_XE0 & d.EM3 & physcond)
-                    #LVL1MenuItem("L1_EM3_W-MT40").setLogic( d.TOPO_40MT_EM6s6_XE0 & d.EM3 & physcond)
-
-                    # Bphysics triggers
-    #                 if not '_v6' in TriggerFlags.triggerMenuSetup():
-    # #SX
-    #                     LVL1MenuItem("L1_BPH-DR-2MU4").setLogic( d.TOPO_2DR15_2MU4ab & physcond)            
-    #                     LVL1MenuItem("L1_BPH-2M-2MU4").setLogic( d.TOPO_2INVM999_2MU4ab & physcond)        
-    #                     LVL1MenuItem("L1_BPH-4M8-2MU4").setLogic( d.TOPO_4INVM8_2MU4ab & physcond)            
-    #                     LVL1MenuItem("L1_BPH-DR-2MU4_BPH-2M-2MU4").setLogic( d.TOPO_2DR15_2MU4ab & d.TOPO_2INVM999_2MU4ab & physcond)            
-    #                     LVL1MenuItem("L1_BPH-DR-2MU4_BPH-4M8-2MU4").setLogic( d.TOPO_2DR15_2MU4ab & d.TOPO_4INVM8_2MU4ab & physcond)            
-    #                     LVL1MenuItem("L1_BPH-DR-2MU6").setLogic( d.TOPO_2DR15_2MU6ab & physcond)            
-    #                     LVL1MenuItem("L1_BPH-2M-2MU6").setLogic( d.TOPO_2INVM999_2MU6ab & physcond)            
-    #                     LVL1MenuItem("L1_BPH-4M8-2MU6").setLogic( d.TOPO_4INVM8_2MU6ab & physcond)            
-    #                     LVL1MenuItem("L1_BPH-DR-2MU6_BPH-2M-2MU6").setLogic( d.TOPO_2DR15_2MU6ab & d.TOPO_2INVM999_2MU6ab & physcond)            
-    #                     LVL1MenuItem("L1_BPH-DR-2MU6_BPH-4M8-2MU6").setLogic( d.TOPO_2DR15_2MU6ab & d.TOPO_4INVM8_2MU6ab & physcond)            
-
-                    ##Combined L1Top 
-                    #LVL1MenuItem('L1_DR-MU10TAU12I_TAU12I-J25').setLogic( d.TOPO_0DR28_MU10ab_TAU12abi &  d.TOPO_1DISAMB_TAU12abi_J25ab & physcond)
-                    #LVL1MenuItem('L1_MU10_TAU12I-J25').setLogic( d.MU10 &  d.TOPO_1DISAMB_TAU12abi_J25ab & physcond)
-                    #LVL1MenuItem('L1_XE35_EM15-TAU12I').setLogic( d.XE35 &  d.TOPO_DISAMB_EM15abhi_TAU12abi & physcond)  
-                    #LVL1MenuItem('L1_XE40_EM15-TAU12I').setLogic( d.XE40 &  d.TOPO_DISAMB_EM15abhi_TAU12abiOB & physcond)  
-                    #LVL1MenuItem('L1_XE45_TAU20-J20').setLogic( d.XE45 & d.TOPO_1DISAMB_TAU20ab_J20ab & physcond)
-                    LVL1MenuItem('L1_J25_2J20_3J12_DR-TAU20ITAU12I').setLogic( d.J25 & d.J20.x(2) & d.J12.x(3) &  d.TOPO_0DR28_TAU20abi_TAU12abi & physcond)
-                    #LVL1MenuItem('L1_J25_3J12_EM15-TAU12I').setLogic( d.J25 & d.J12.x(3) &  d.TOPO_DISAMB_EM15abhi_TAU12abi & physcond)  
-                    #LVL1MenuItem('L1_J25_2J12_DR-MU10TAU12I').setLogic( d.J25 & d.J12.x(2) &  d.TOPO_0DR28_MU10ab_TAU12abi & physcond)
-                    #LVL1MenuItem('L1_J25_2J20_3J12_BOX-TAU20ITAU12I').setLogic( d.J25 & d.J20.x(2) & d.J12.x(3) & d.TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond)
-
-                    #LVL1MenuItem('L1_MU6_MJJ-200').setLogic( d.MU6 & d.TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MU6_MJJ-300').setLogic( d.MU6 & d.TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #LVL1MenuItem('L1_MU6_MJJ-400').setLogic( d.MU6 & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #LVL1MenuItem('L1_MU6_MJJ-500').setLogic( d.MU6 & d.TOPO_500INVM9999_AJ30s6_AJ20s6 & physcond) 
-
-                    #LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-400').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-700').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond) 
-                    #LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-800').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #LVL1MenuItem('L1_J30_2J20_4J20.0ETA49_MJJ-900').setLogic( d.J30 & d.J20.x(2) & d.J200ETA49.x(4) & d.TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)
-
-
-                    #LVL1MenuItem('L1_XE35_MJJ-200').setLogic( d.XE35 & d.TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #
-                    ### ATR-15062
-                    #LVL1MenuItem('L1_EM18VH_MJJ-300').setLogic( d.EM18VH & d.TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_EM18VHI_MJJ-300').setLogic( d.EM18VHI & d.TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)    # noqa: F821
-                    
-
-
-                    # CTP items for L1Topo streamers
-                    #LVL1MenuItem('L1_DPhi_AJsAJs').setLogic( d.TOPO_DPhi_AJsAJs & physcond)
-                    #LVL1MenuItem('L1_DPhi_EMsTAUs').setLogic( d.TOPO_DPhi_EMsTAUs & physcond)
-                    #LVL1MenuItem('L1_DEta_AJabAJab').setLogic( d.TOPO_DEta_AJabAJab & physcond)
-                    #LVL1MenuItem('L1_DEta_EMabTAUab').setLogic( d.TOPO_DEta_EMabTAUab & physcond)
-    #                 if not '_v6' in TriggerFlags.triggerMenuSetup():
-    # #SX
-    #                     LVL1MenuItem('L1_BPH-2M-2MU4-B').setLogic( d.TOPO_2INVM999_CMU4ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-2M-2MU4-BO').setLogic( d.TOPO_2INVM999_2CMU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-2M-MU6MU4').setLogic( d.TOPO_2INVM999_MU6ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-2M-MU6MU4-B').setLogic( d.TOPO_2INVM999_ONEBARREL_MU6ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-2M-MU6MU4-BO').setLogic( d.TOPO_2INVM999_CMU6ab_CMU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-4M8-2MU4-B').setLogic( d.TOPO_4INVM8_CMU4ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-4M8-2MU4-BO').setLogic( d.TOPO_4INVM8_2CMU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4').setLogic( d.TOPO_4INVM8_MU6ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4-B').setLogic( d.TOPO_4INVM8_ONEBARREL_MU6ab_MU4ab & physcond)
-    #                     LVL1MenuItem('L1_BPH-4M8-MU6MU4-BO').setLogic( d.TOPO_4INVM8_CMU6ab_CMU4ab & physcond)
-
-#                    LVL1MenuItem('L1_DY-DR-2MU4').setLogic( d.TOPO_2DR99_2MU4ab & physcond)
-                    LVL1MenuItem('L1_DY-BOX-MU6MU4').setLogic( d.TOPO_5DETA99_5DPHI99_MU6ab_MU4ab & physcond)
-                    LVL1MenuItem('L1_DY-BOX-2MU6').setLogic( d.TOPO_5DETA99_5DPHI99_2MU6ab & physcond)
-
-                    LVL1MenuItem('L1_BPH-0M10-3MU4' ).setLogic( d.TOPO_0INVM10_3MU4ab & physcond)# noqa: F821
-                    
-                    #LVL1MenuItem('L1_LFV-EM8I-MU11' ).setLogic( d.TOPO_0INVM10_0DR15_EM8abi_MU10ab & d.MU11 & physcond) # noqa: F821
-                    #LVL1MenuItem('L1_LFV-EM12I-MU6' ).setLogic( d.TOPO_0INVM10_0DR15_EM12abi_MU6ab & physcond) # noqa: F821
-
-                    LVL1MenuItem('L1_ZAFB-04DPHI-EM15I' ).setLogic( d.TOPO_60INVM9999_04DPHI32_EM15abhi_FJj15s623ETA49 & physcond) # noqa: F821
-                    LVL1MenuItem('L1_ZAFB-25DPHI-EM15I' ).setLogic( d.TOPO_60INVM9999_25DPHI32_EM15abhi_FJj15s623ETA49 & physcond) # noqa: F821
-                    LVL1MenuItem('L1_ZAFB-25DPHI-EM18I' ).setLogic( d.TOPO_60INVM9999_25DPHI32_EM15abhi_FJj15s623ETA49 & d.EM18VHI & physcond) # required for ATR-22109
-                    #LVL1MenuItem('L1_DPHI-M70-2EM12I' ).setLogic( d.TOPO_0INVM70_27DPHI32_EM12his1_EM12his6 & physcond)  # noqa: F821
-
-                                
-
-                    LVL1MenuItem('L1_DPHI-M70-2EM12I' ).setLogic( d.TOPO_0INVM70_27DPHI32_EM12his1_EM12his6 & physcond)  # noqa: F821
-
-                    LVL1MenuItem('L1_DY-BOX-2MU4' ).setLogic( d.TOPO_5DETA99_5DPHI99_2MU4ab & d.MU4.x(2) & physcond)  # noqa: F821
-
-
-                                
-
- 
-
- 
-                    LVL1MenuItem('L1_LFV-MU6').setLogic( d.TOPO_0DR15_2MU6ab & physcond)
-                    #LVL1MenuItem('L1_LFV-MU').setLogic( d.TOPO_0DR10_MU10ab_MU6ab & physcond)
-                    LVL1MenuItem('L1_LFV-MU11').setLogic( d.TOPO_0DR15_2MU6ab & d.MU11 & d.MU6.x(2) & physcond)
-                    if not '_v7' in TriggerFlags.triggerMenuSetup() and not 'LS2_v' in TriggerFlags.triggerMenuSetup() and not 'run3_v' in TriggerFlags.triggerMenuSetup():
-                        LVL1MenuItem('L1_LFV-EM8I').setLogic( d.TOPO_0DETA04_0DPHI03_EM8abi_MU10ab & physcond)
-                    else:
-                        LVL1MenuItem('L1_LFV-EM8I').setLogic( d.TOPO_0DETA04_EM8abi_MU10ab & d.TOPO_0DPHI03_EM8abi_MU10ab & physcond) #ATR-14282
-                    if not '_v7' in TriggerFlags.triggerMenuSetup() and not 'LS2_v' in TriggerFlags.triggerMenuSetup() and not 'run3_v' in TriggerFlags.triggerMenuSetup():
-                        LVL1MenuItem('L1_LFV-EM15I').setLogic( d.TOPO_0DETA04_0DPHI03_EM15abi_MUab & physcond)
-                    else:
-                        LVL1MenuItem('L1_LFV-EM15I').setLogic( d.TOPO_0DETA04_EM15abi_MUab & d.TOPO_0DPHI03_EM15abi_MUab & physcond) #ATR-14282
-                    LVL1MenuItem('L1_DPHI-J20s2XE50').setLogic( d.TOPO_10MINDPHI_J20s2_XE50 & physcond)
-                    #LVL1MenuItem('L1_DPHI-J20XE50').setLogic( d.TOPO_10MINDPHI_J20ab_XE50 & physcond)
-                    #LVL1MenuItem('L1_DPHI-CJ20XE50').setLogic( d.TOPO_10MINDPHI_CJ20ab_XE50 & physcond)
-
-                    #LVL1MenuItem('L1_MJJ-900').setLogic( d.TOPO_900INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-800').setLogic( d.TOPO_800INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-700').setLogic( d.TOPO_700INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-400').setLogic( d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-350').setLogic( d.TOPO_350INVM9999_AJ30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_MJJ-300').setLogic( d.TOPO_300INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-200').setLogic( d.TOPO_200INVM9999_AJ30s6_AJ20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-100').setLogic( d.TOPO_100INVM9999_AJ30s6_AJ20s6 & physcond)
-
-                    #LVL1MenuItem('L1_MJJ-350-0').setLogic( d.TOPO_350INVM9999_J30s6_J20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-300-0').setLogic( d.TOPO_300INVM9999_J30s6_J20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-250-0').setLogic( d.TOPO_250INVM9999_J30s6_J20s6 & physcond)
-                    #LVL1MenuItem('L1_MJJ-200-0').setLogic( d.TOPO_200INVM9999_J30s6_J20s6 & physcond)
-                    #LVL1MenuItem('L1_HT150-JJ15.ETA49').setLogic( d.TOPO_HT150_AJj15allETA49 & physcond)
-                    #LVL1MenuItem('L1_HT150-JJ15.ETA49_MJJ-400').setLogic( d.TOPO_HT150_AJj15allETA49 & d.TOPO_400INVM9999_AJ30s6_AJ20s6 & physcond)
-
-                    LVL1MenuItem('L1_MJJ-500-NFF').setLogic( d.TOPO_500INVM9999_J30s6_AJ20s6 & physcond)
-                    LVL1MenuItem('L1_J50_DETA20-J50J').setLogic( d.J50 & d.TOPO_0DETA20_J50s1_Js2 & physcond)    # noqa: F821
-                    LVL1MenuItem('L1_DPHI-2EM3').setLogic( d.TOPO_27DPHI32_EMs1_EMs6 & physcond)    # noqa: F821
-                    
-                    #LVL1MenuItem('L1_J4-MATCH').setLogic( d.TOPO_0MATCH_4AJ20ETA31_4AJj15ETA31 & physcond)
-
-                    LVL1MenuItem('L1_LLP-RO').setLogic( d.TOPO_100RATIO_0MATCH_TAU30si2_EMall & physcond)
-
-                    #LVL1MenuItem('L1_LLP-NOMATCH').setLogic( d.TOPO_NOT_0MATCH_TAU30si2_EMall & physcond)
-                    #LVL1MenuItem('L1_DR-MU10TAU12I').setLogic( d.TOPO_0DR28_MU10ab_TAU12abi & physcond)
-                    #LVL1MenuItem('L1_TAU12I-J25').setLogic( d.TOPO_1DISAMB_TAU12abi_J25ab & physcond)
-                    #LVL1MenuItem('L1_EM15TAU12I-J25').setLogic( d.TOPO_1DISAMB_EM15his2_TAU12abi_J25ab & physcond)
-
-                    #LVL1MenuItem('L1_DR-EM15TAU12I').setLogic( d.TOPO_DISAMB_0DR28_EM15his2_TAU12abi & physcond)
-                    #LVL1MenuItem('L1_DR-EM15TAU12I-J25').setLogic( d.TOPO_1DISAMB_J25ab_0DR28_EM15his2_TAU12abi & physcond)
-                    #LVL1MenuItem('L1_TAU20ITAU12I-J25').setLogic( d.TOPO_1DISAMB_TAU20abi_TAU12abi_J25ab & physcond)
-                    LVL1MenuItem('L1_DR25-TAU20ITAU12I').setLogic( d.TOPO_0DR25_TAU20abi_TAU12abi & physcond)
-
-                    LVL1MenuItem('L1_30M-EM20ITAU12').setLogic( d.TOPO_DISAMB_30INVM_EM20his2_TAU12ab & physcond)
-                    LVL1MenuItem('L1_MJJ-400-CF').setLogic( d.TOPO_400INVM9999_AJ30s6ETA31_AJ20s631ETA49 & physcond)
-                    LVL1MenuItem('L1_DR-TAU20ITAU12I').setLogic( d.TOPO_0DR28_TAU20abi_TAU12abi & physcond)
-                    #LVL1MenuItem('L1_BOX-TAU20ITAU12I').setLogic( d.TOPO_0DETA20_0DPHI20_TAU20abi_TAU12abi & physcond)
-                    LVL1MenuItem('L1_DR-TAU20ITAU12I-J25').setLogic( d.TOPO_2DISAMB_J25ab_0DR28_TAU20abi_TAU12abi & physcond)    # noqa: F821
-
-                    LVL1MenuItem('L1_DR25-TAU20ITAU12I-J25').setLogic( d.TOPO_2DISAMB_J25ab_0DR25_TAU20abi_TAU12abi & physcond)    # noqa: F821
-                    LVL1MenuItem('L1_DR-EM15TAU12I-J25').setLogic( d.TOPO_2DISAMB_J25ab_0DR28_EM15his2_TAU12abi & physcond)    # noqa: F821
-#                    LVL1MenuItem('L1_LAR-EM').setLogic( d.TOPO_LAR_EM50s1 & physcond).setTriggerType( TT.lardemo ) # LAr demo (ATR-11897)
-#                    LVL1MenuItem('L1_LAR-J').setLogic( d.TOPO_LAR_J100s1 & physcond).setTriggerType( TT.lardemo )  # LAr demo (ATR-11897)
-                    # if not '_v6' in TriggerFlags.triggerMenuSetup():
-                    #     LVL1MenuItem('L1_BPH-DR-2MU4-B').setLogic( d.TOPO_2DR15_CMU4ab_MU4ab & physcond)
-                    #     LVL1MenuItem('L1_BPH-DR-2MU4-BO').setLogic( d.TOPO_2DR15_2CMU4ab & physcond)
-                    #     LVL1MenuItem('L1_BPH-DR-MU6MU4').setLogic( d.TOPO_2DR15_MU6ab_MU4ab & physcond)
-                    #     LVL1MenuItem('L1_BPH-DR-MU6MU4-B').setLogic( d.TOPO_2DR15_ONEBARREL_MU6ab_MU4ab & physcond)
-                    #     LVL1MenuItem('L1_BPH-DR-MU6MU4-BO').setLogic( d.TOPO_2DR15_CMU6ab_CMU4ab & physcond)
-                    #     LVL1MenuItem("L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B").setLogic( d.TOPO_2DR15_CMU4ab_MU4ab & d.TOPO_2INVM999_CMU4ab_MU4ab & physcond)            
-                    #     LVL1MenuItem("L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B").setLogic( d.TOPO_2DR15_CMU4ab_MU4ab & d.TOPO_4INVM8_CMU4ab_MU4ab & physcond)            
-                    #     LVL1MenuItem("L1_BPH-DR-2MU4-BO_BPH-2M-2MU4-BO").setLogic( d.TOPO_2DR15_2CMU4ab & d.TOPO_2INVM999_2CMU4ab & physcond)            
-                    #     LVL1MenuItem("L1_BPH-DR-2MU4-BO_BPH-4M8-2MU4-BO").setLogic( d.TOPO_2DR15_2CMU4ab & d.TOPO_4INVM8_2CMU4ab & physcond)     
-                        
-                    LVL1MenuItem('L1_KF-XE40').setLogic( d.TOPO_KF_XE40_AJall & physcond)
-                    LVL1MenuItem('L1_KF-XE50').setLogic( d.TOPO_KF_XE50_AJall & physcond)
-                    LVL1MenuItem('L1_KF-XE55').setLogic( d.TOPO_KF_XE55_AJall & physcond)
-                    LVL1MenuItem('L1_KF-XE60').setLogic( d.TOPO_KF_XE60_AJall & physcond)
-                    LVL1MenuItem('L1_KF-XE65').setLogic( d.TOPO_KF_XE65_AJall & physcond)
-                    LVL1MenuItem('L1_KF-XE75').setLogic( d.TOPO_KF_XE75_AJall & physcond)
-    #SX ATR-12789
-
-                   # if  '_v6' in TriggerFlags.triggerMenuSetup():
-    # nominal L1-topo items
-                    #LVL1MenuItem('L1_BPH-1M19-2MU4_BPH-0DR34-2MU4'    ).setLogic( d.TOPO_1INVM19_2MU4ab & d.TOPO_0DR34_2MU4ab & physcond)           # 50% for Bs,J/psi,Upsi
-             
-#                    LVL1MenuItem('L1_BPH-2M8-2MU4_BPH-0DR15-2MU4'     ).setLogic( d.TOPO_2INVM8_2MU4ab & d.TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi
-#                    LVL1MenuItem('L1_BPH-2M9-2MU4_BPH-0DR15-2MU4'     ).setLogic( d.TOPO_2INVM9_2MU4ab & d.TOPO_0DR15_2MU4ab & physcond)            # 78% for Bs,J/psi
-#                    LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4'    ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_2MU4ab & physcond)           # 78% for Upsi
-#                    LVL1MenuItem('L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( d.TOPO_2INVM8_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & physcond)  # 86% for Bs,J/psi
-#                    LVL1MenuItem('L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' ).setLogic( d.TOPO_2INVM9_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & physcond)
-#  
-                    #LVL1MenuItem('L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4').setLogic( d.TOPO_8INVM15_MU6ab_MU4ab & d.TOPO_0DR22_MU6ab_MU4ab & physcond) # 86% for Upsi
-                    #LVL1MenuItem('L1_BPH-2M9-2MU6_BPH-2DR15-2MU6'     ).setLogic( d.TOPO_2INVM9_2MU6ab & d.TOPO_2DR15_2MU6ab & physcond)            # 96% for Bs,J/psi
-     
-                    #LVL1MenuItem('L1_BPH-8M15-2MU6_BPH-0DR22-2MU6'    ).setLogic( d.TOPO_8INVM15_2MU6ab & d.TOPO_0DR22_2MU6ab & physcond)           # 96% for Upsi
-
-# Barrel and BarrelOnly items w/o topo selection
-#                    LVL1MenuItem('L1_CMU6_2CMU4').setLogic( d.TOPO_MULT_CMU4ab.x(2) & d.TOPO_MULT_CMU6ab & physcond) # d.MU6_2MU4_BarrelOnly
-                    LVL1MenuItem('L1_2MU4-B'    ).setLogic( d.MU4.x(2) & d.TOPO_MULT_CMU4ab & physcond)              # 2MU4_Barrel
-                    LVL1MenuItem('L1_2MU6-B'    ).setLogic( d.MU6.x(2) & d.TOPO_MULT_CMU6ab & physcond)              # 2MU6_Barrel
-                    LVL1MenuItem('L1_MU6_2MU4-B').setLogic( d.MU6 & d.MU4.x(2) & d.TOPO_MULT_CMU4ab & physcond)        # MU6_2MU4_Barrel,     already in the menu
-
-# Barrel and BarrelOnly variants of L1Topo items
-                    #LVL1MenuItem('L1_BPH-1M19-2MU4-B_BPH-0DR34-2MU4'    ).setLogic( d.TOPO_1INVM19_CMU4ab_MU4ab & d.TOPO_0DR34_2MU4ab & physcond)               # 50% for Bs,J/psi,Upsi + OneBarrel
-
-                    #LVL1MenuItem('L1_BPH-2M8-2MU4-B_BPH-0DR15-2MU4'     ).setLogic( d.TOPO_2INVM8_CMU4ab_MU4ab & d.TOPO_0DR15_2MU4ab & physcond)                # 78% for Bs,J/psi + OneBarrel
-
-                    #LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-B'    ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_CMU4ab_MU4ab & physcond)               # 78% for Upsi + OneBarrel
-                    ##LVL1MenuItem('L1_BPH-1M19-2MU4-BO_BPH-0DR34-2MU4'   ).setLogic( d.TOPO_1INVM19_2CMU4ab & d.TOPO_0DR34_2MU4ab & physcond)                    # 50% for Bs,J/psi,Upsi + BarrelOnly
-
-                    #    #LVL1MenuItem('L1_BPH-2M8-2MU4-BO_BPH-0DR15-2MU4'    ).setLogic( d.TOPO_2INVM8_2CMU4ab & d.TOPO_0DR15_2MU4ab & physcond)                     # 78% for Bs,J/psi + BarrelOnly
-                    #LVL1MenuItem('L1_BPH-7M15-2MU4_BPH-0DR24-2MU4-BO'   ).setLogic( d.TOPO_7INVM15_2MU4ab & d.TOPO_0DR24_2CMU4ab & physcond)                    # 78% for Upsi + BarrelOnly
-                    #LVL1MenuItem('L1_BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4' ).setLogic( d.TOPO_2INVM8_ONEBARREL_MU6ab_MU4ab & d.TOPO_0DR15_MU6ab_MU4ab & physcond)  # 86% for Bs,J/psi + OneBarrel
-
-                    #LVL1MenuItem('L1_BPH-2M8-2MU4'       ).setLogic( d.TOPO_2INVM8_2MU4ab & physcond)                 # backup 71% for Bs,J/psi
-                    ##LVL1MenuItem('L1_BPH-2M9-2MU4'       ).setLogic( d.TOPO_2INVM9_2MU4ab & physcond)
-                    #LVL1MenuItem('L1_BPH-8M15-MU6MU4'    ).setLogic( d.TOPO_8INVM15_MU6ab_MU4ab & physcond)           # backup 71% for Upsi
-                    #LVL1MenuItem('L1_BPH-8M15-2MU6'      ).setLogic( d.TOPO_8INVM15_2MU6ab & physcond)                # backup 95% for Upsi
-    #SX end ATR-12789
-
-                    LVL1MenuItem('L1_LATE-MU10_XE40').setLogic( d.TOPO_LATE_MU10s1 & d.XE40 & physcond)  # noqa: F821
-                    LVL1MenuItem('L1_LATE-MU10_XE50').setLogic( d.TOPO_LATE_MU10s1 & d.XE50 & physcond) 
-                    LVL1MenuItem('L1_LATE-MU10_J50').setLogic(  d.TOPO_LATE_MU10s1 & d.J50 & physcond)  
-                    LVL1MenuItem('L1_SC111').setLogic(  d.TOPO_SC111_CJ15abETA26 & physcond)
-                    #LVL1MenuItem('L1_SC85').setLogic(  d.TOPO_SC85_CJ15abETA26 & physcond)
-                    LVL1MenuItem('L1_SC111-CJ15').setLogic(  d.TOPO_SC111_CJ15abETA26 & physcond)    # noqa: F821
-
-                    LVL1MenuItem('L1_TAU60_DR-TAU20ITAU12I' ).setLogic( d.HA60 & d.TOPO_0DR28_TAU20abi_TAU12abi & physcond)
-
-                    LVL1MenuItem('L1_CEP-CJ60').setLogic( d.TOPO_CEP_CJ60s6 & physcond ) # noqa: F821
-                    LVL1MenuItem('L1_CEP-CJ50').setLogic( d.TOPO_CEP_CJ50s6 & physcond ) # noqa: F821
-
-                    LVL1MenuItem('L1_BPH-8M15-2MU4-BO' ).setLogic( d.TOPO_8INVM15_2CMU4ab & physcond) # noqa: F821
-
-
-            except Exception as ex:
-                    print ("Creation of L1Topo item failed, will abort! Exception is : " , ex)
-                    raise RuntimeError("Creation of L1Topo item failed, will not continue")
-        
-        
-        # =======================================================
-        #
-        # Here we define the items for the secondary partitions
-        #
-        # =======================================================
-        
-        # Partition 2
-        LVL1MenuItem.currentPartition = 2
-
-        LVL1MenuItem('L1_RD2_BGRP14'         ).setLogic( d.RNDM2 & d.BGRP0 & d.BGRP14             ).setTriggerType(TT.rand)
-
-
-        # Partition 3
-        LVL1MenuItem.currentPartition = 3
-        
-        LVL1MenuItem('L1_RD3_BGRP15'         ).setLogic( d.RNDM3 & d.BGRP0 & d.BGRP15             ).setTriggerType(TT.rand)
-                      
-
-        # reset to partition 1
-        LVL1MenuItem.currentPartition = 1
-
-
-
-
-
-        LVL1MenuItem.l1configForRegistration = None
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/L1Seeds.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/L1Seeds.py
deleted file mode 100644
index 0773e5eb1d4c..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/L1Seeds.py
+++ /dev/null
@@ -1,430 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-from TriggerJobOpts.TriggerFlags  import TriggerFlags
-
-#######################################
-# trigger type definitions
-######################################
-from TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1Flags import Lvl1Flags
-run1 = Lvl1Flags.CTPVersion()<=3
-
-if run1:
-    from TriggerMenuMT.LVL1MenuConfig.LVL1.TriggerTypeDefRun1 import TT
-    rpcout_type = TT.rpcout | TT.phys
-    rpcin_type  = TT.rpcin  | TT.phys             
-else:
-    from TriggerMenuMT.LVL1MenuConfig.LVL1.TriggerTypeDef import TT
-    rpcout_type = TT.muon   | TT.phys
-    rpcin_type  = TT.muon   | TT.phys             
-
-
-cl_type     = TT.calo      | TT.phys
-mb_type     = TT.minb      | TT.phys
-
-
-calo_exceptions = set([])
-
-
-#######################################################
-# obtain the l1 items according to the the trigger type
-# function taken originally from TriggerPythonConfig
-#######################################################
-def Lvl1ItemByTriggerType(l1object, triggertype_pattern, triggertype_bitmask):
-    """
-    The function returns those items where the items triggertype, after applying the mask, matches the pattern.
-    With this one can also select items where a certain bit is disabled
-    """
-    if triggertype_pattern<0 or triggertype_pattern>0xFF:
-        raise RuntimeError('TriggerPythonConfig.Lvl1ItemByTriggerType(triggertype_pattern,triggertype_bitmask) needs to be called with 0<=triggertype_pattern<=0xFF, ' + \
-                               + 'but is called with triggertype_pattern=%i' % triggertype_pattern)
-    if triggertype_bitmask<0 or triggertype_bitmask>0xFF:
-        raise RuntimeError('TriggerPythonConfig.Lvl1ItemByTriggerType(triggertype_pattern,triggertype_bitmask) needs to be called with 0<=triggertype_bitmask<=0xFF, ' + \
-                               + 'but is called with triggertype_bitmask=%i' % triggertype_bitmask)
-    itemsForMenu = [item for item in l1object if l1object[item]['ctpid'] != -1]
-    if not itemsForMenu:
-        log.error('No item defined for the L1 Menu, the TriggerConfL1 object does not contain items')
-    res = [item for item in itemsForMenu if ( (triggertype_bitmask & int(l1object[item]['triggerType'],2)) == triggertype_pattern)]
-    return res
-
-##############################
-# define the various seeds
-##############################
-def getL1BackgroundSeed(menul1items):        
-    l1background_seeds = 'L1_BCM_AC_CA_BGRP0,L1_BCM_Wide_EMPTY,L1_BCM_Wide_UNPAIRED_ISO,L1_BCM_Wide_UNPAIRED_NONISO,L1_J30p31ETA49_UNPAIRED_ISO,L1_J12_UNPAIRED_ISO,L1_J12_UNPAIRED_NONISO,L1_J12_ABORTGAPNOTCALIB,L1_BCM_AC_UNPAIRED_ISO,L1_BCM_CA_UNPAIRED_ISO,L1_BCM_AC_UNPAIRED_NONISO,L1_BCM_CA_UNPAIRED_NONISO,L1_J30p31ETA49_UNPAIRED_NONISO,L1_BCM_AC_ABORTGAPNOTCALIB,L1_BCM_CA_ABORTGAPNOTCALIB,L1_BCM_Wide_ABORTGAPNOTCALIB,L1_BCM_AC_CALIB,L1_BCM_CA_CALIB,L1_BCM_Wide_CALIB,L1_J50_UNPAIRED_ISO,L1_J50_UNPAIRED_NONISO,L1_J50_ABORTGAPNOTCALIB'
-    
-    if TriggerFlags.triggerMenuSetup() == 'LS1_v1':
-        l1background_seeds = 'L1_BCM_AC_CA_BGRP0,L1_BCM_AC_CA_UNPAIRED_ISO,L1_BCM_Wide_EMPTY,L1_BCM_Wide_UNPAIRED_ISO,L1_BCM_Wide_UNPAIRED_NONISO,L1_EM3_UNPAIRED_ISO,L1_FJ30_UNPAIRED_ISO,L1_J10_UNPAIRED_ISO,L1_J10_UNPAIRED_NONISO,L1_LUCID_A_C_EMPTY,L1_LUCID_A_C_UNPAIRED_ISO,L1_LUCID_A_C_UNPAIRED_NONISO,L1_LUCID_EMPTY,L1_LUCID_UNPAIRED_ISO,L1_MU4_UNPAIRED_ISO,L1_LUCID_COMM_UNPAIRED_ISO,L1_LUCID_COMM_EMPTY'
-        
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1bgditems = l1background_seeds.split(',')
-    for item in l1bgditems:
-        if item not in menul1items:
-            log.error('L1 item %s from background seeds is not in current L1 menu', item)
-            
-    return l1background_seeds
-
-##############################
-def getL1_ALFA_Diff_Phys_Seeds(menul1items):        
-    # comma separated list fo l1 seeds
-    l1_seeds = 'L1_ALFA_SDIFF5,L1_ALFA_SDIFF6,L1_ALFA_SDIFF7,L1_ALFA_SDIFF8,L1_MBTS_1_A_ALFA_C,L1_MBTS_1_C_ALFA_A,L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO,L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO,L1_MBTS_2_A_ALFA_C,L1_MBTS_2_C_ALFA_A,L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO,L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO,L1_LUCID_A_ALFA_C,L1_LUCID_C_ALFA_A,L1_LUCID_A_ALFA_C_UNPAIRED_ISO,L1_LUCID_C_ALFA_A_UNPAIRED_ISO,L1_EM3_ALFA_ANY,L1_EM3_ALFA_ANY_UNPAIRED_ISO,L1_TE5_ALFA_ANY,L1_TE5_ALFA_ANY_UNPAIRED_ISO'
-     
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1items = l1_seeds.split(',')
-    for item in l1items:
-        if item not in menul1items:
-            log.error('L1 item %s from background seeds is not in current L1 menu', item)
-            
-    return l1_seeds
-
-##############################
-def getL1_ALFA_CDiff_Phys_Seeds (menul1items):        
-    # comma separated list fo l1 seeds
-    l1_seeds = 'L1_EM3_ALFA_EINE,L1_TE5_ALFA_EINE'
-     
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1items = l1_seeds.split(',')
-    for item in l1items:
-        if item not in menul1items:
-            log.error('L1 item %s from background seeds is not in current L1 menu', item)
-            
-    return l1_seeds
-
-##############################
-def getL1_ALFA_Jet_Phys_Seeds (menul1items):        
-    # comma separated list fo l1 seeds
-    l1_seeds = 'L1_J12_ALFA_ANY,L1_J12_ALFA_ANY_UNPAIRED_ISO'
-     
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1items = l1_seeds.split(',')
-    for item in l1items:
-        if item not in menul1items:
-            log.error('L1 item %s from background seeds is not in current L1 menu', item)
-            
-    return l1_seeds
-
-##############################
-def getL1StandbySeed(l1items):        
-    standby_seeds    = ",".join([ x for x in l1items if "_EMPTY" not in x and "CALREQ" not in x and "ZB" not in x and "-" not in x and "CMU" not in x and "ALFA" not in x  and "RD" not in x and "BCM" not in x and "BGRP12" not in x])
-    return standby_seeds
-
-##############################
-def getL1TopoSeed(l1items):
-    l1topo_seeds = ",".join([ x for x in l1items if "-" in x or "CMU" in x ])
-    return l1topo_seeds
-
-##############################
-def getL1CaloSeed(l1seed, l1object):
-    if ('EMPTY' in l1seed):
-        #l1calo_seeds = ','.join([ x for x in Lvl1ItemByTriggerType(l1object, cl_type, cl_type) \
-        #                              if (x not in calo_exceptions)  ])
-        l1calo_seeds = ','.join([ x for x in Lvl1ItemByTriggerType(l1object, cl_type, cl_type) \
-                                      if ('EMPTY' in x and 'FIRSTEMPTY' not in x)  ])
-    else:
-        l1calo_seeds = ','.join([ x for x in Lvl1ItemByTriggerType(l1object, cl_type, cl_type) if ("EMPTY" not in x or "FIRSTEMPTY" in x) \
-                                      and (x not in calo_exceptions)  ])
-    return l1calo_seeds
-
-##############################
-def getL1TauSeed(l1items):
-
-    tau_seeds    = ",".join([ x for x in l1items if "TAU" in x and "-" not in x and  "EMPTY" not in x  and "ISO" not in x])
-    return tau_seeds
-
-##############################
-def getL1BSSeed(menul1items):
-    l1_seeds = 'L1_J15,L1_3J15,L1_3J10,L1_4J10'
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1items = l1_seeds.split(',')
-    for item in l1items:
-        if item not in menul1items:
-            log.error('L1 item %s from beamspot seeds is not in current L1 menu', item)
-            
-    return l1_seeds
-
-##############################
-def getL1MinBiasSeed(l1seed, l1object):
-    if ('EMPTY' in l1seed):
-        l1minbias_seeds = ','.join([ x for x in Lvl1ItemByTriggerType(l1object, mb_type, mb_type)])
-    else:
-        l1minbias_seeds = ','.join([ x for x in Lvl1ItemByTriggerType(l1object, mb_type, mb_type)])
-    return l1minbias_seeds
-
-def getL1JetBS():
-    return 'L1_J15,L1_3J15,L1_3J10,L1_4J10'
-
-##############################
-def getL1MuonSeed(l1seed, l1object):
-    if ('EMPTY' in l1seed): # to only get MU*_EMPTY items
-        muon_seeds_list = [ x for x in Lvl1ItemByTriggerType(l1object, rpcout_type, rpcout_type) if ('MU' in x and '_EMPTY' in x )  ]
-        muon_seeds_list = list(set(muon_seeds_list))
-        muon_seeds      = ','.join(muon_seeds_list)
-    else: #this one does NOT include the EMPTY items
-        muon_seeds_list = [ x for x in Lvl1ItemByTriggerType(l1object, rpcout_type, rpcout_type) if ('MU' in x and 'FIRSTEMPTY' in x )  ]
-        muon_seeds_list += [ x for x in Lvl1ItemByTriggerType(l1object, rpcin_type, rpcin_type)  ]
-        muon_seeds_list = list(set(muon_seeds_list))
-        muon_seeds      = ','.join(muon_seeds_list)
-
-    return muon_seeds
-
-##############################
-def getEBnoL1PSSeed(l1items, l1seedname):
-
-    # All of these L1 items must be PS=1 for an EB campaign
-    noL1PS_seeds = ''
-    if ('L1_PhysicsHigh' in l1seedname):
-      #noL1PS_seeds = 'L1_MU6_3MU4,L1_EM15HI_2TAU12IM_J25_3J12,L1_EM15HI_2TAU12IM_XE35,L1_EM15HI_TAU40_2TAU15,L1_EM15VH_MU10,L1_EM15VH_3EM7,L1_EM22VHI,L1_2EM8VH_MU10,L1_MU10_TAU12IM_J25_2J12,L1_MU10_TAU12IM_XE35,L1_MU10_TAU20IM,L1_4J15,L1_XE50,L1_2J15_XE55,L1_TAU60,L1_TAU20IM_2TAU12IM_J25_2J20_3J12,L1_TAU20IM_2TAU12IM_XE35,L1_TAU20IM_2J20_XE45,L1_MU20,L1_MU6_J30.0ETA49_2J20.0ETA49,L1_MU10_3J20,L1_J40.0ETA25_2J15.31ETA49,L1_3MU6,L1_MU10_2J15_J20,L1_J40.0ETA25_2J25_J20.31ETA49,L1_2MU6_3MU4,L1_MU11_2MU6'
-      noL1PS_seeds = 'L1_MU6_3MU4,L1_EM15VH_MU10,L1_EM22VHI,L1_2EM8VH_MU10,L1_MU10_TAU12IM_J25_2J12,L1_MU10_TAU12IM_XE35,L1_MU10_TAU20IM,L1_4J15,L1_XE50,L1_2J15_XE55,L1_TAU60,L1_TAU20IM_2TAU12IM_J25_2J20_3J12,L1_TAU20IM_2TAU12IM_XE35,L1_TAU20IM_2J20_XE45,L1_MU20,L1_MU6_J30p0ETA49_2J20p0ETA49,L1_MU10_3J20,L1_J40p0ETA25_2J15p31ETA49,L1_3MU6,L1_MU10_2J15_J20,L1_J40p0ETA25_2J25_J20p31ETA49,L1_2MU6_3MU4,L1_MU11_2MU6'
-    elif ('L1_PhysicsVeryHigh' in l1seedname):
-      #noL1PS_seeds = 'L1_XE80,L1_J100.31ETA49,L1_J400,L1_6J15'
-      noL1PS_seeds = 'L1_XE80,L1_J400,L1_6J15'
-    elif ('L1_EMPTY' in l1seedname):
-      noL1PS_seeds = 'L1_J12_EMPTY,L1_MU11_EMPTY,L1_TAU8_EMPTY,L1_TAU30_EMPTY,L1_EM7_EMPTY'
-    elif ('L1_FIRSTEMPTY' in l1seedname):
-      #noL1PS_seeds = 'L1_J12_FIRSTEMPTY,L1_MU20_FIRSTEMPTY,L1_TAU8_FIRSTEMPTY,L1_EM7_FIRSTEMPTY'
-      noL1PS_seeds = 'L1_J12_FIRSTEMPTY,L1_TAU8_FIRSTEMPTY,L1_EM7_FIRSTEMPTY'
-    elif ('L1_UNPAIRED_ISO' in l1seedname):
-      noL1PS_seeds = 'L1_J12_UNPAIRED_ISO,L1_J15p31ETA49_UNPAIRED_ISO,L1_BCM_Wide_UNPAIRED_ISO,L1_BCM_AC_UNPAIRED_ISO,L1_BCM_CA_UNPAIRED_ISO,L1_MU4_UNPAIRED_ISO,L1_EM7_UNPAIRED_ISO,L1_TAU8_UNPAIRED_ISO,L1_TAU30_UNPAIRED_ISO'
-    elif ('L1_UNPAIRED_NONISO' in l1seedname):
-      noL1PS_seeds = 'L1_J12_UNPAIRED_NONISO,L1_BCM_Wide_UNPAIRED_NONISO,L1_BCM_AC_UNPAIRED_NONISO,L1_BCM_CA_UNPAIRED_NONISO'
-    elif ('L1_ABORTGAPNOTCALIB' in l1seedname): 
-      noL1PS_seeds = 'L1_J12_ABORTGAPNOTCALIB'
-    else:
-      log.error('Do not know how to supply EnhancedBias L1 seeds for %s', l1seedname)
-
-    # check if all the l1 seeds given are in the current L1 menu
-    l1EBitems = noL1PS_seeds.split(',')
-    for item in l1EBitems:
-        if item not in l1items:
-            log.error('L1 item %s from %s seed is not in current L1 menu (EnhancedBias)', item, l1seedname)
-            
-    return noL1PS_seeds
-
-##############################
-def getL1_ALFA_Phys(l1seed):
-
-    L1ALFA_Phys_seeds = 'L1_ALFA_ELAST1,L1_ALFA_ELAST2,L1_ALFA_ELAST11,L1_ALFA_ELAST12,L1_ALFA_ELAST13,L1_ALFA_ELAST14,L1_ALFA_ELAST15,L1_ALFA_ELAST16,L1_ALFA_ELAST17,L1_ALFA_ELAST18,L1_ALFA_SHOWSYST5,L1_ALFA_ANY_A_EMPTY,L1_ALFA_ANY_C_EMPTY'
-
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1bgditems = L1ALFA_Phys_seeds.split(',')
-    for item in l1bgditems:
-        if item not in l1seed:
-            log.error('L1 item %s from L1ALFA_Phys seeds is not in current L1 menu', item)
-            
-    return L1ALFA_Phys_seeds
-
-##############################
-def getL1_ALFA_Phys_Any(l1seed):
-
-    L1ALFA_Phys_Any_seeds = 'L1_ALFA_ANY,L1_ALFA_ANY_EMPTY,L1_ALFA_ANY_FIRSTEMPTY,L1_ALFA_ANY_UNPAIRED_ISO,L1_ALFA_ANY_UNPAIRED_NONISO,L1_ALFA_ANY_BGRP10'
-
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1bgditems = L1ALFA_Phys_Any_seeds.split(',')
-    for item in l1bgditems:
-        if item not in l1seed:
-            log.error('L1 item %s from L1ALFA_Phys_Any_seeds seeds is not in current L1 menu', item)
-            
-    return L1ALFA_Phys_Any_seeds
-
-##############################
-def getL1ALFA_Calib(l1seed):
-
-    L1ALFA_Calib_seeds = 'L1_ALFA_B7L1U,L1_ALFA_B7L1L,L1_ALFA_A7L1U,L1_ALFA_A7L1L,L1_ALFA_A7R1U,L1_ALFA_A7R1L,L1_ALFA_B7R1U,L1_ALFA_B7R1L'
-        #ATR-13743 'L1_ALFA_ELAST15_Calib,L1_ALFA_ELAST18_Calib,L1_ALFA_BGT,L1_ALFA_BGT_UNPAIRED_ISO,L1_ALFA_BGT_BGRP10,L1_ALFA_SHOWSYST5,L1_ALFA_ANY_EMPTY,L1_ALFA_ANY_FIRSTEMPTY,L1_ALFA_ANY_UNPAIRED_ISO,L1_ALFA_ANY_UNPAIRED_NONISO,L1_ALFA_ANY_BGRP10,L1_ALFA_ANY_CALIB,L1_ALFA_ANY_ABORTGAPNOTCALIB,
-           #L1_ALFA_B7L1U_OD,L1_ALFA_B7L1L_OD,L1_ALFA_A7L1U_OD,L1_ALFA_A7L1L_OD,L1_ALFA_A7R1U_OD,L1_ALFA_A7R1L_OD,L1_ALFA_B7R1U_OD,L1_ALFA_B7R1L_OD,L1_ALFA_B7L1_OD,L1_ALFA_A7L1_OD,L1_ALFA_A7R1_OD,L1_ALFA_B7R1_OD,L1_ALFA_ANY_A_EMPTY,L1_ALFA_ANY_C_EMPTY'
-
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1bgditems = L1ALFA_Calib_seeds.split(',')
-    for item in l1bgditems:
-        if item not in l1seed:
-            log.error('L1 item %s from L1ALFA_Calib_seeds seeds is not in current L1 menu', item)
-            
-    return L1ALFA_Calib_seeds
-
-##############################
-def getL1ALFA_CEP(l1seed):
-
-    L1ALFA_CEP_seeds = 'L1_ALFA_ELAST15,L1_ALFA_ELAST18,L1_ALFA_SYST17,L1_ALFA_SYST18,L1_ALFA_ELASTIC_UNPAIRED_ISO,L1_ALFA_ANTI_ELASTIC_UNPAIRED_ISO'
-
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1bgditems = L1ALFA_CEP_seeds.split(',')
-    for item in l1bgditems:
-        if item not in l1seed:
-            log.error('L1 item %s from L1ALFA_CEP_seeds seeds is not in current L1 menu', item)
-            
-    return L1ALFA_CEP_seeds
-
-##############################
-def getL1ALFA_SYS(l1seed):
-
-    L1ALFA_SYS_seeds = 'L1_ALFA_SYST9,L1_ALFA_SYST10,L1_ALFA_SYST11,L1_ALFA_SYST12,L1_ALFA_SYST17,L1_ALFA_SYST18'
-
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1bgditems = L1ALFA_SYS_seeds.split(',')
-    for item in l1bgditems:
-        if item not in l1seed:
-            log.error('L1 item %s from L1ALFA_SYS_seeds seeds is not in current L1 menu', item)
-            
-    return L1ALFA_SYS_seeds
-
-##############################
-def getL1ALFA_ELAS(l1seed):
-
-    L1ALFA_ELAS_seeds = 'L1_ALFA_ELAST1,L1_ALFA_ELAST2,L1_ALFA_ELAST11,L1_ALFA_ELAST12,L1_ALFA_ELAST13,L1_ALFA_ELAST14,L1_ALFA_ELAST15,L1_ALFA_ELAST16,L1_ALFA_ELAST17,L1_ALFA_ELAST18'
-
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1bgditems = L1ALFA_ELAS_seeds.split(',')
-    for item in l1bgditems:
-        if item not in l1seed:
-            log.error('L1 item %s from L1ALFA_ELAS_seeds seeds is not in current L1 menu', item)
-            
-    return L1ALFA_ELAS_seeds
-
-#####################################
-def getL1LowLumi(l1seed):
-
-    L1LowLumi_seeds = 'L1_EM20VH,L1_2EM10VH,L1_MU15,L1_2MU6,L1_3MU4,L1_EM15VH_MU10,L1_EM15I_MU4,L1_EM7_MU10,L1_2EM8VH_MU10,L1_TAU60,L1_TAU20IM_2TAU12IM_J25_2J20_3J12,L1_EM15HI_2TAU12IM_XE35,L1_MU10_TAU12IM_XE35,L1_TAU20_2TAU12_XE35,L1_TAU20IM_2TAU12IM_XE35,L1_EM15HI_2TAU12IM,L1_EM15HI_2TAU12IM_J25_3J12,L1_EM15HI_TAU40_2TAU15,L1_MU10_TAU12IM_J25_2J12,L1_MU10_TAU12IM,L1_J75,L1_4J15,L1_XE50,L1_3J25p0ETA23,L1_3J40,L1_2J15_XE55,L1_MU6_J40,L1_J75p31ETA49'
-
-    # check if all the l1 background seeds given are in the current L1 menu
-    l1bgditems = L1LowLumi_seeds.split(',')
-    for item in l1bgditems:
-        if item not in l1seed:
-            log.error('L1 item %s from L1LowLumi_seeds seeds is not in current L1 menu', item)
-            
-    return L1LowLumi_seeds
-        
-#####################################
-# assigned the seeds to the L1 names
-#####################################
-def getSpecificL1Seeds(l1seedname, l1itemobject):
-    l1items = l1itemobject.keys()
-    L1Seed = ''
-    if l1seedname == 'L1_J':
-        L1Seed = getL1JetBS()
-    if (l1seedname == 'L1_Bkg'):
-        L1Seed = getL1BackgroundSeed(l1items)
-#    elif (l1seedname == 'L1_ALFA_Diff_Phys' ):
-#        L1Seed = getL1_ALFA_Diff_Phys_Seeds(l1items)
-#    elif (l1seedname == 'L1_ALFA_CDiff_Phys' ):
-#        L1Seed = getL1_ALFA_CDiff_Phys_Seeds(l1items)
-#    elif (l1seedname == 'L1_ALFA_Jet_Phys' ):
-#        L1Seed = getL1_ALFA_Jet_Phys_Seeds(l1items)
-
-    elif (l1seedname in ['L1_PhysicsHigh_noPS', 'L1_PhysicsVeryHigh_noPS', 'L1_EMPTY_noPS', 'L1_FIRSTEMPTY_noPS', 'L1_UNPAIRED_ISO_noPS', 'L1_UNPAIRED_NONISO_noPS', 'L1_ABORTGAPNOTCALIB_noPS']):
-        L1Seed =  getEBnoL1PSSeed(l1items, l1seedname)
-        
-    elif (l1seedname == 'L1_Standby'):
-        L1Seed = getL1StandbySeed(l1items)
-
-    elif (l1seedname == 'L1_Topo'):
-        L1Seed = getL1TopoSeed(l1items)
-
-    elif (l1seedname in ['L1_Calo', 'L1_Calo_EMPTY']):
-        L1Seed = getL1CaloSeed(l1seedname, l1itemobject)
-
-    elif (l1seedname in ['L1_Muon', 'L1_Muon_EMPTY']):
-        L1Seed = getL1MuonSeed(l1seedname, l1itemobject)
-
-    elif (l1seedname == 'L1_TAU'):
-        L1Seed = getL1TauSeed(l1items)
-
-    elif (l1seedname == 'L1_BS'):
-        L1Seed = getL1BSSeed(l1items)
-        
-    elif (l1seedname in ['L1_MinBias', 'L1_MinBias_EMPTY']):
-        L1Seed = getL1MinBiasSeed(l1seedname, l1itemobject)
-
-#    elif (l1seedname == 'L1_ALFA_Phys'):
-#        L1Seed = getL1_ALFA_Phys(l1items)
-#
-#    elif (l1seedname == 'L1_ALFA_PhysAny'):
-#        L1Seed = getL1_ALFA_Phys_Any(l1items)
-#
-#    elif (l1seedname == 'L1_ALFA_Diff'):
-#        L1Seed = getL1ALFA_Diff(l1items)
-#
-#    elif (l1seedname == 'L1_ALFA_TRT_Diff'):
-#        L1Seed = getL1ALFA_TRT_Diff(l1items)
-#        
-    elif (l1seedname == 'L1_ALFA_Calib'):
-        L1Seed = getL1ALFA_Calib(l1items)
-#
-#    elif (l1seedname == 'L1_ALFA_ELAS'):
-#        L1Seed = getL1ALFA_ELAS(l1items)
-#
-#    elif (l1seedname == 'L1_ALFA_TRT_Calib'):
-#        L1Seed = getL1ALFA_TRT_Calib(l1items)
-#
-#    elif (l1seedname == 'L1_ALFA_Jet'):
-#        L1Seed = getL1ALFA_Jet(l1items)
-#        
-#    elif (l1seedname == 'L1_ALFA_SDiff'):
-#        L1Seed = getL1ALFA_SDiff(l1items)
-#
-#    elif (l1seedname == 'L1_ALFA_CEP'):
-#        L1Seed = getL1ALFA_CEP(l1items)
-#
-#    elif (l1seedname == 'L1_ALFA_TRT'):
-#        L1Seed = getL1ALFA_TRT(l1items)
-#
-#    elif (l1seedname == 'L1_ALFA_SYS'):
-#        L1Seed = getL1ALFA_SYS(l1items)
-
-
-    elif (l1seedname == 'L1_LowLumi'):
-        L1Seed = getL1LowLumi(l1items)
-        
-    elif (l1seedname == 'L1_All'):
-        return ''
-
-    elif (l1seedname == ''):
-        log.warning('No L1item name given!')
-
-    else: 
-        #log.error('Given seed %s could not be found!' %l1seedname)
-        return 'ERROR_'+l1seedname
-
-    L1Seed = L1Seed.split(",")
-    L1Seed.sort()
-    L1Seed = ",".join(L1Seed)
-
-    return L1Seed
-
-#####################################
-# map from l1item name to inputTE
-#####################################
-def getInputTEfromL1Item(l1item):
-    
-    L1Map = {
-        'L1_TAU8_EMPTY'          : ['HA8'],
-        'L1_TAU8_FIRSTEMPTY'     : ['HA8'],
-        'L1_TAU8_UNPAIRED_ISO'   : ['HA8'],
-        'L1_TAU8_UNPAIRED_NONISO': ['HA8'],
-        'L1_TAU12_EMPTY'         : ['HA12'],
-        'L1_TAU12_FIRSTEMPTY'    : ['HA12'],
-        'L1_TAU12_UNPAIRED_ISO'  : ['HA12'],
-        'L1_RD0_FIRSTEMPTY'      : [''],
-        'L1_TAU30'               : ['HA30'],
-        'L1_TAU30_EMPTY'         : ['HA30'],
-        'L1_TAU30_UNPAIRED_ISO'  : ['HA30'],
-        'L1_TAU40'               : ['HA40'],
-        'L1_TAU60'               : ['HA60'],
-        'L1_TAU100'              : ['HA100'],
-        }
-
-    if TriggerFlags.triggerMenuSetup() == 'LS1_v1': 
-        L1Map['L1_CALREQ2']=['NIM30']
-    else:
-        L1Map['L1_CALREQ2']=['CAL2']
-        
-    if l1item in L1Map:
-        TE = L1Map[l1item]
-        log.debug('Mapped L1 input TE from %s to %s.', l1item, TE)
-        return TE
-    else:
-        TE = l1item.replace("L1_","").split("_")[0]
-        TE = TE[1:] if TE[0].isdigit() else TE
-        return TE
-    
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_L1_alfa_v2.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_L1_alfa_v2.py
deleted file mode 100644
index 5332df5d1174..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_L1_alfa_v2.py
+++ /dev/null
@@ -1,175 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-#------------------------------------------------------------------------#
-#------------Just a copy of Physics_pp_v3 with empty HLT-----------------#
-#------------------------------------------------------------------------#
-def defineMenu():
-
-    from TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1Flags import Lvl1Flags
-
-    Lvl1Flags.CTPVersion = 4 # new CTP
-
-    Lvl1Flags.BunchGroupPartitioning = [1, 11, 14] # partition 1: 1-10, partition 2: 11-13, partition 3: 14-15 (note that BGRP0 is used by all items)
-    Lvl1Flags.BunchGroupNames = ['BCRVeto', 'Filled', 'Calib', 'Empty', 'UnpairedBeam1', 'UnpairedBeam2', 'FirstEmpty', 'InTrain']
-    Lvl1Flags.BunchGroupNames += ['NotUsed'] * len(Lvl1Flags.BunchGroupNames())
-
-    Lvl1Flags.MenuPartitioning = [0, 472, 492] # partition 1: ctpid 0-471, partition 2: ctpid 472-491, partition 3: ctpid 492-511
-
-    Lvl1Flags.RemapThresholdsAsListed = True
-
-    Lvl1Flags.thresholds = [
-        #------------------------------------
-        #------------------------------------
-        #      !!!!!!!IMPORTANT!!!!!!!!!
-        # Please make sure to use the right
-        # order to get the mapping right!!!
-        #------------------------------------
-        #------------------------------------
-        'MU4'      , 'MU6',   'MU10', 'MU11', 'MU15', 'MU20', 
-        'EM3'      , 'EM6', 'EM10VH', 'EM12', 'EM14VH', 'EM16V', 'EM16VH', 'EM18VH','EM30',
-        'HA8'      , 'HA11', 'HA11I', 'HA15','HA15I', 'HA20', 'HA40',
-        'J10'      , 'J15',   'J20', 'J30', 'J50', 'J75', 'J100', 'J350', 
-        'JE140'    , 'JE200', 'JE350','JE500',
-        'JB30'     , 'JB50',  'JB75', 'JB100',
-        'JF30'     , 'JF50',  'JF75', 'JF100',
-        'TE20'     , 'TE300', 'TE500', 'TE700', 'TE800', 'TE1000', 'TE1200', 'TE1400',# --> the last three are left in as a forced threshold.
-        'XS25'     , 'XS30', 'XS35', 'XS40', 'XS45', 'XS50', 'XS60', 'XS65',
-        'XE20', 'XE25', 'XE30', 'XE35', 'XE40', 'XE50', 'XE60', 'XE70',
-        'MBTS_A'   , 'MBTS_C',
-        'BPTX0'    ,'BPTX1',
-        'LUCID_A'  ,'LUCID_C',
-        'BCM_AtoC' , 'BCM_CtoA', 'BCM_Wide', 'BCM_Comb',
-        'ZDC_A'    , 'ZDC_C','ZDC_AND',
-        'NIMDIR5', 'NIMDIR25', 'NIMDIR26',
-        #CALREQ
-        'NIM28','NIM29','NIM30','NIM_MUB', 'NIM_MUE',
-        #ZB
-        'ZB_EM12',
-        ### The following are added in as forced thresholds (MBTSSI).
-        'MBTS_A0'  , 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 
-        'MBTS_A4'  , 'MBTS_A5', 'MBTS_A6', 'MBTS_A7', 
-        'MBTS_A8'  , 'MBTS_A9', 'MBTS_A10', 'MBTS_A11', 
-        'MBTS_A12' , 'MBTS_A13', 'MBTS_A14', 'MBTS_A15', 
-        'MBTS_C0'  , 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 
-        'MBTS_C4'  , 'MBTS_C5', 'MBTS_C6', 'MBTS_C7', 
-        'MBTS_C8'  , 'MBTS_C9', 'MBTS_C10', 'MBTS_C11', 
-        'MBTS_C12' , 'MBTS_C13', 'MBTS_C14', 'MBTS_C15',
-        #### Forced for ALFA
-        'NIM_B7R1L','NIM_B7R1U','NIM_B7L1L','NIM_B7L1U',
-        'NIM_A7R1L','NIM_A7R1U','NIM_A7L1L','NIM_A7L1U',
-        'NIM_B7R1L_OD','NIM_B7R1U_OD','NIM_B7L1L_OD','NIM_B7L1U_OD',
-        'NIM_A7R1L_OD','NIM_A7R1U_OD','NIM_A7L1L_OD','NIM_A7L1U_OD',
-        ### For L1_ALFA
-        'NIM_ALFA_LOG', 'NIM_ALFA_LOG_OD'
-        ]
-
-    Lvl1Flags.items = [
-        #EM thresholds
-        'L1_EM3', 'L1_EM6', 'L1_EM12', 'L1_EM10VH',
-        'L1_EM14VH','L1_EM16VH', 'L1_EM18VH', 'L1_EM30',
-        'L1_EM30_BGRP7',
-        #multi EM thresholds
-        'L1_2EM3', 'L1_2EM6', #'L1_2EM8',
-        'L1_2EM10VH', 'L1_2EM12',
-        'L1_2EM3_EM6', 'L1_2EM6_EM16VH', #'L1_2EM12_EM16V',
-        'L1_3EM6','L1_3EM6_EM14VH',
-        #Jet thresholds
-        'L1_J10','L1_J15', 'L1_J30','L1_J50','L1_J75','L1_J100','L1_J350',
-        #multi jets         
-        'L1_3J10','L1_3J15', 'L1_3J50','L1_3J75','L1_4J10',
-        'L1_4J15','L1_4J20','L1_4J30','L1_5J15','L1_6J10',
-        #forwards jets
-        'L1_FJ30','L1_FJ75','L1_2FJ30','L1_2FJ50',
-        #XS
-        'L1_XS30', 'L1_XS45', 'L1_XS50','L1_XS60','L1_XS65',
-        #XE
-        'L1_XE20','L1_XE30','L1_XE40','L1_XE50','L1_XE60','L1_XE70',
-        #JE
-        'L1_JE140', 'L1_JE350','L1_JE200','L1_JE500',
-        #TE
-        'L1_TE20','L1_TE300','L1_TE500','L1_TE700','L1_TE800',
-        #EMPTY, FIRSTEMPTY, UNPAIRED etc
-        'L1_TAU8_EMPTY', 
-        'L1_MU11_EMPTY',
-        'L1_J10_EMPTY','L1_J10_FIRSTEMPTY','L1_J10_UNPAIRED_ISO','L1_J10_UNPAIRED_NONISO',
-        'L1_J30_EMPTY','L1_J30_FIRSTEMPTY','L1_J30_UNPAIRED_ISO','L1_J30_UNPAIRED_NONISO',
-        'L1_FJ30_EMPTY','L1_FJ30_FIRSTEMPTY','L1_FJ30_UNPAIRED_ISO',
-        'L1_EM3_EMPTY','L1_EM3_FIRSTEMPTY','L1_EM3_UNPAIRED_ISO','L1_EM3_UNPAIRED_NONISO',
-        'L1_EM6_EMPTY'            ,
-        #ALFA 
-        'L1_ALFA_EMPTY','L1_ALFA_EMPTY_OD',        
-        'L1_ALFA_BGRP7', 'L1_ALFA_BGRP7_OD',
-        #"old" ALFA ITEMS
-        'L1_ALFA_ELAST1' ,'L1_ALFA_ELAST2' ,
-        'L1_ALFA_ELAST11','L1_ALFA_ELAST12','L1_ALFA_ELAST13','L1_ALFA_ELAST14',
-        'L1_ALFA_ELAST15','L1_ALFA_ELAST16','L1_ALFA_ELAST17','L1_ALFA_ELAST18',
-        'L1_ALFA_SDIFF1' ,'L1_ALFA_SDIFF2' ,'L1_ALFA_SDIFF3' ,'L1_ALFA_SDIFF4' ,
-        'L1_ALFA_SDIFF5' ,'L1_ALFA_SDIFF6' ,'L1_ALFA_SDIFF7' ,'L1_ALFA_SDIFF8' ,
-        'L1_ALFA_SHOW1','L1_ALFA_SHOW2','L1_ALFA_SHOW3','L1_ALFA_SHOW4',
-        'L1_ALFA_SYST1','L1_ALFA_SYST2','L1_ALFA_SYST3','L1_ALFA_SYST4','L1_ALFA_SYST9',
-        'L1_ALFA_SYST10','L1_ALFA_SYST11','L1_ALFA_SYST12','L1_ALFA_SYST17','L1_ALFA_SYST18',
-        'L1_ALFA_SHOWSYST1','L1_ALFA_SHOWSYST2','L1_ALFA_SHOWSYST3','L1_ALFA_SHOWSYST4','L1_ALFA_SHOWSYST5',
-        'L1_ALFA_ANY','L1_ALFA_ANY_EMPTY','L1_ALFA_ANY_FIRSTEMPTY',
-        'L1_ALFA_ANY_UNPAIRED_ISO','L1_ALFA_ANY_UNPAIRED_NONISO',    
-        #new ALFA itmes
-        'L1_ALFA_A7L1U_OD', 'L1_ALFA_A7L1L_OD','L1_ALFA_A7R1U_OD','L1_ALFA_A7R1L_OD', 
-        'L1_ALFA_B7L1U_OD', 'L1_ALFA_B7L1L_OD','L1_ALFA_B7R1U_OD', 'L1_ALFA_B7R1L_OD',
-        'L1_ALFA_A7L1_OD' ,'L1_ALFA_A7R1_OD' ,'L1_ALFA_B7L1_OD' ,'L1_ALFA_B7R1_OD' ,
-        
-        'L1_ALFA_B7L1U', 'L1_ALFA_B7L1L','L1_ALFA_A7L1U','L1_ALFA_A7L1L',             
-        'L1_ALFA_A7R1U','L1_ALFA_A7R1L','L1_ALFA_B7R1U','L1_ALFA_B7R1L',                 
-        'L1_ALFA_B1_EMPTY','L1_ALFA_B2_EMPTY',     
-        
-        'L1_MBTS_2_A_ALFA_C','L1_MBTS_2_C_ALFA_A','L1_MBTS_2_ALFA',             
-        'L1_MBTS_1_A_ALFA_C','L1_MBTS_1_C_ALFA_A',#'L1_MBTS_1_ALFA',             
-        'L1_MBTS_2_ALFA_UNPAIRED_ISO',
-        'L1_LUCID_A_ALFA_C','L1_LUCID_C_ALFA_A','L1_LUCID_ALFA',  
-        'L1_ZDC_A_ALFA_C','L1_ZDC_C_ALFA_A','L1_ZDC_ALFA',
-        #new combined alfa item
-        'L1_EM3_ALFA_ANY',
-        'L1_EM3_ALFA_MBTS_C',
-        'L1_EM3_ALFA_MBTS_A',
-        'L1_EM3_ALFA_ANY_UNPAIRED_ISO',
-        'L1_EM3_ALFA_MBTS_C_UNPAIRED_ISO',
-        'L1_EM3_ALFA_MBTS_A_UNPAIRED_ISO',        
-        #BGRP, L1A_Mon
-        'L1_BPTX0_BGRP0',  #BPTX, BGRP
-        'L1_BPTX1_BGRP0',
-        'L1_L1A_Mon' ,
-        'L1_BGRP1_ALFA_BGT','L1_BGRP4_ALFA_BGT','L1_BGRP7_ALFA_BGT',
-        'L1_BGRP7',
-        #ZDC
-        'L1_ZDC','L1_ZDC_EMPTY','L1_ZDC_A_C','L1_ZDC_A_C_EMPTY' ,
-        #RD0, RD1
-        'L1_RD0_EMPTY', 'L1_RD0_FILLED','L1_RD0_FIRSTEMPTY','L1_RD0_UNPAIRED_ISO',       
-        'L1_RD1_EMPTY' ,'L1_RD1_FILLED',
-        #TRT, ZB
-        'L1_TRT',  
-        'L1_ZB',        
-        #LUCID
-        'L1_LUCID','L1_LUCID_EMPTY','L1_LUCID_UNPAIRED_ISO',
-        'L1_LUCID_COMM','L1_LUCID_COMM_EMPTY','L1_LUCID_COMM_UNPAIRED_ISO',
-        'L1_LUCID_BGRP7',
-        'L1_LUCID_A_C','L1_LUCID_A_C_EMPTY','L1_LUCID_A_C_UNPAIRED_ISO','L1_LUCID_A_C_UNPAIRED_NONISO', 
-        #MBTS
-        'L1_MBTS_1', 'L1_MBTS_2' ,'L1_MBTS_4_4',
-        'L1_MBTS_2_UNPAIRED_ISO' ,
-        'L1_MBTS_1_UNPAIRED_ISO',
-        'L1_MBTS_2_BGRP7'        ,
-        #BCM
-        'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO',
-        'L1_BCM_Wide_BGRP0','L1_BCM_HT_BGRP0', 'L1_BCM_AC_CA_BGRP0',
-        'L1_BCM_AC_CA_UNPAIRED_ISO' ,                       
-        'L1_CALREQ0','L1_CALREQ1','L1_CALREQ2',
-        #UNPAIRED_ISO ADDITIONS:
-        'L1_LUCID_A_ALFA_C_UNPAIRED_ISO','L1_LUCID_C_ALFA_A_UNPAIRED_ISO',
-        'L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO','L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO',
-        'L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO','L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO',
-        ]
-    
-
-    Lvl1Flags.CtpIdMap =  {}
-
-
-
-    
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
deleted file mode 100644
index 8b66a160faba..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/Menu_LS2_v1.py
+++ /dev/null
@@ -1,992 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-def defineMenu():
-    """
-    Defines the following LvlFlags:
-    
-    thresholds   .... list of all threshold names in the menu (includes forced thresholds)
-    items        .... list of all L1 item names in the menu
-    CtpIdMap     .... map of item names to CTP IDs
-    """
-    
-    from ..LVL1.Lvl1Flags import Lvl1Flags
-
-    Lvl1Flags.CTPVersion = 4 # new CTP
-
-    Lvl1Flags.BunchGroupPartitioning = [1, 14, 15] # partition 1: 1-10, partition 2: 14, partition 3: 15 (note that BGRP0 is used by all items)
-    Lvl1Flags.BunchGroupNames = ['BCRVeto', 'Paired', 'CalReq', 'Empty', 'IsolatedUnpaired', 'NonIsolatedUnpaired', 'EmptyAfterPaired', 'InTrain', 'AbortGapNotCalReq', 'VdM', 'ALFA', 'EmptyBeforePaired','EmptyAndPaired']
-    Lvl1Flags.BunchGroupNames += ['NotUsed'] * len(Lvl1Flags.BunchGroupNames())
-
-    Lvl1Flags.MenuPartitioning = [0, 472, 492] # partition 1: ctpid 0-471, partition 2: ctpid 472-491, partition 3: ctpid 492-511
-
-    Lvl1Flags.RemapThresholdsAsListed = True
-
-    Lvl1Flags.thresholds = [
-        #------------------------------------
-        #------------------------------------
-        #      !!!!!!!IMPORTANT!!!!!!!!!
-        # Please make sure to use the right
-        # order to get the mapping right!!!
-        #------------------------------------
-        #------------------------------------
-
-        # Note that the forced thresholds (FTHR) are not used in the menu but are needed for input monitoring
-        # They can always be replaced with something that is needed for the menu
-
-
-        #-------------------------
-        # SLOT 7 / CON 0,1 (EM1,2)
-        #-------------------------
-
-        # 16 x EM
-        'EM3', 'EM7', 'EM8VH',
-        'EM10VH', 'EM12', 'EM15', 'EM15VH',
-        'EM15VHI',
-        'EM18VHI', 'EM20VH', 'EM20VHI', 'EM22VH', 'EM22VHI', 'EM24VHI', 'EM24VHIM', 'EM30VHI', 
-        # 1 x ZB/
-        'ZB_EM15',
-
-        #--------------------------
-        # SLOT 7 / CON 2,3 (TAU1,2)
-        #--------------------------
-
-        # 16 x TAU
-        'HA5', 'HA8', 'HA12', 'HA12IL', 'HA12IM', 'HA15', 'HA20', 'HA20IL', 'HA20IM', 'HA25', 'HA25IM', 'HA30', 'HA40', 'HA60', 'HA90', 'HA100',
-
-        #----------------------
-        # SLOT 8 / CON 0 (JET1)
-        #----------------------
-        # 10 x 3-bit JET (can have multiplicity 4 or more)
-
-        # 8 x JETs and central jets
-        'J12', 'J12p0ETA25', 'J15', 'J15p0ETA25','J20', 'J25','J25p0ETA23','J30',
-
-        # 2 x Central Jets
-        'J12p0ETA28', #'J12p0ETA25',
-
-        # VBF Jets
-        'J20p0ETA49', 'J30p0ETA49',
-
-        #----------------------
-        # SLOT 8 / CON 1 (JET2)
-        #----------------------
-        # 15 x 2-bit JET (can have maximum multiplicity of 3) (SLOT 8, CON 1)
-
-        # 3 x Central Jet
-        'J35p0ETA23','J40p0ETA25', #'J20p28ETA31',
-
-        # 6 Jets # replace J400 with J45.0ETA20 - ATR-19309
-        'J40', 'J50', 'J75', 'J85', 'J100', 'J45p0ETA21',  'J400', #'J120',
-
-        # 6 x FJ              
-        'J15p31ETA49', 'J20p31ETA49', 'J30p31ETA49', 'J50p31ETA49', 'J75p31ETA49',
-
-        #---------------------
-        # SLOT 8 / CON 2 (EN1) 
-        #---------------------
-        # 24 x 1-bit thresholds
-
-        # 8 x TE
-        'TE5', 'TE10', 'TE15', 'TE20', 'TE25', 'TE30', 'TE40', 'TE50',
-
-        # 8 x XE (for standard XE)
-        'XE10', 'XE20', 'XE25', 'XE30', 'XE35', 'XE40', 'XE45', 'XE50',
-        'XE55', 'XE60', 'XE65', 'XE70', 'XE75', 'XE80', 'XE150', 'XE300',
-        
-        # 8 x XS
-        'XS20', 'XS30', 'XS40', 'XS45', 'XS50', 'XS55', 'XS60', 'XS65', 
-
-        #---------------------
-        # SLOT 8 / CON 3 (EN2)
-        #---------------------
-        # 16 x 1-bit thresholds
-
-        # 8 x weighted sum ET
-        #'RXE35', 'RXE40', 'RXE45', 'RXE50', 'RXE55', 'RXE60', 'RXE70', 'RXE80', # FTHR
-
-        # 8 x restricted eta range
-        'TE5p0ETA24', 'TE10p0ETA24', 'TE15p0ETA24', 'TE20p0ETA24', 'TE25p0ETA24', 'TE30p0ETA24', 'TE40p0ETA24', 'TE70p0ETA24',
-
-        #------------------------
-        # SLOT 9 / CON 0 (MUCTPi) 
-        #------------------------
-        
-        # 6 x MU
-        'MU4', 'MU6', 'MU10', 'MU11', 'MU20', 'MU21',
-
-        #------------------------
-        # SLOT 9 / CON 1 (CTPCal)
-        #------------------------
-
-        # 3 x 1-bit BCM
-        'BCM_AtoC', 'BCM_CtoA', 'BCM_Wide',
-        # 1 x 3-bit BCM
-        'BCM_Comb',
-
-        # 8 x DBM
-        #'DBM0', 'DBM1', 'DBM2', 'DBM3', 'DBM4', 'DBM5', 'DBM6', 'DBM7', # FTHR
-
-        # 2  x BPTX
-       'BPTX0','BPTX1',
-
-        # 6 x LUCID 
-        'LUCID_A', 'LUCID_C',
-        #'LUCID_Coinc_AC', # FTHR
-        #'LUCID_COMM',
-        #'LUCID_05', 'LUCID_06', # FHTR
-
-        # 3 x ZDC
-        'ZDC_A', 'ZDC_C',
-        'ZDC_AND', # FTHR
-
-        # 3 x CALREQ
-        'CAL0','CAL1','CAL2',
-
- 
-
-        #-----------------------------
-        # SLOT 9 / CON 2,3 (NIM1,NIM2)
-        #-----------------------------
-
-        # 2 x MBTS
-        'MBTS_A', 'MBTS_C',
-
-        # 32 x MBTSSI (all FTHR)
-        # NOTE: THESE ARE OUT OF ORDER FOR A REASON! Do not change!
-        # The order defines the mapping - see ATR-17870.
-        'MBTS_A0', 'MBTS_A1',  'MBTS_A2',  'MBTS_A3',  'MBTS_A4',  'MBTS_A5', 'MBTS_A6',  'MBTS_A7',
-        'MBTS_A8', 'MBTS_A10', 'MBTS_A12', 'MBTS_A14', 'MBTS_A9',  'MBTS_A11','MBTS_A13', 'MBTS_A15',
-        'MBTS_C0', 'MBTS_C1',  'MBTS_C2',  'MBTS_C3',  'MBTS_C4',  'MBTS_C5', 'MBTS_C6',  'MBTS_C7',
-        'MBTS_C8', 'MBTS_C10', 'MBTS_C12', 'MBTS_C14', 'MBTS_C11', 'MBTS_C13','MBTS_C9',  'MBTS_C15',
-
-        # L1A for CTP monitoring itself
-        'NIML1A',
-
-        # LHCF
-        'NIMLHCF',
-
-        # TGC
-        'NIMTGC',
-        
-        # RPC
-        'NIMRPC',
-        
-        # TRT
-        'NIMTRT',
-
-        # AFP
-        'AFP_NSC', 'AFP_NSA',
-        'AFP_FSA_SIT', 'AFP_FSA_TOF', 'AFP_FSA_LOG',
-        'AFP_FSC_SIT', 'AFP_FSC_LOG', 'AFP_FSC_TOF',
-
-        
-        #-------------------------------------------------------------------
-        #L1 TOPO inputs 
-        #-------------------------------------------------------------------
-
-        #B-jets
-        #'BTAG-MU4J15',
-        #'BTAG-MU6J20',
-
-        #HT
-        'HT190-J15s5pETA21',
-        'HT150-J20s5pETA31',
-
-        
-
-        #ZH 
-        '10MINDPHI-J20s2-XE50', '10MINDPHI-J20s2-XE30', 
-
-        #Jpsi T&P
-         '1INVM5-EM7s1-EMs6', '1INVM5-EM12s1-EMs6',        
-
-        #W T&P - all were commented out
- 
-        
-        # central muon
-        'MULT-CMU4ab',
-        'MULT-CMU6ab',
-        
-
-        #B-physics
-        '0DR03-EM7ab-CJ15ab',
- 
-
-        # L1 thresholds for L1Topo streamers
-        #'2DR99_2MU4ab',
-        '5DETA99-5DPHI99-MU6ab-MU4ab',
-        '5DETA99-5DPHI99-2MU6ab',
-        '0DR15-2MU6ab',
-        '0DETA04-EM8abi-MU10ab',
-        '0DPHI03-EM8abi-MU10ab',
-        '0DETA04-EM15abi-MUab',
-        '0DPHI03-EM15abi-MUab',
-        #'800INVM9999-AJ30s6-AJ20s6',
-        '700INVM9999-AJ30s6-AJ20s6',
-        '300INVM9999-AJ30s6-AJ20s6',
-        #'400INVM9999-AJ30s6-AJ20s6',
-        '500INVM9999-J30s6-AJ20s6',
-        #'100INVM9999-AJ30s6-AJ20s6',
-        '0DETA20-J50s1-Js2',
-        '27DPHI32-EMs1-EMs6',
-        #'HT150-AJj15all.ETA49',
-        #'0MATCH-4AJ20.ETA31-4AJj15.ETA31',
-        '100RATIO-0MATCH-TAU30si2-EMall',
-        'NOT-0MATCH-TAU30si1-EMall',
-        #'1DISAMB-TAU12abi-J25ab',
-        #'1DISAMB-EM15his2-TAU12abi-J25ab',
-        '2DISAMB-TAU12abi-J25ab',
-        '2DISAMB-J25ab-0DR28-EM15his2-TAU12abi',
-        #'0DR28-MU10ab-TAU12abi',  # add back if needed
-        #'1DISAMB-TAU20abi-TAU12abi-J25ab',
-        '0DR25-TAU20abi-TAU12abi',
-        '0DR28-TAU20abi-TAU12abi',
-        '2DISAMB-J25ab-0DR25-TAU20abi-TAU12abi',
-        '2DISAMB-J25ab-0DR28-TAU20abi-TAU12abi',
-        'DISAMB-30INVM-EM20his2-TAU12ab',
-        '400INVM9999-AJ30s6pETA31-AJ20s6p31ETA49',
-
-        '0INVM9-EM7ab-EMab',
-        '400INVM9999-0DPHI20-J30s6-AJ20s6',
-        '400INVM9999-0DPHI22-J30s6-AJ20s6',
-        '400INVM9999-0DPHI24-J30s6-AJ20s6',
-        '400INVM9999-0DPHI26-J30s6-AJ20s6',
-
-        'LATE-MU10s1',
-        'SC111-CJ15abpETA26',
-        
-        
-        # ALFA (the replication is needed to build all the combinations in the CTPCore)
-        'ALFA_B7R1L', 'ALFA_B7R1U', 'ALFA_A7R1L', 'ALFA_A7R1U', 'ALFA_A7L1L', 'ALFA_A7L1U', 'ALFA_B7L1L', 'ALFA_B7L1U',
-        'ALFA2_B7R1L', 'ALFA2_B7R1U', 'ALFA2_A7R1L', 'ALFA2_A7R1U', 'ALFA2_A7L1L', 'ALFA2_A7L1U', 'ALFA2_B7L1L', 'ALFA2_B7L1U',
-        'ALFA3_B7R1L', 'ALFA3_B7R1U', 'ALFA3_A7R1L', 'ALFA3_A7R1U', 'ALFA3_A7L1L', 'ALFA3_A7L1U', 'ALFA3_B7L1L', 'ALFA3_B7L1U',
-        'ALFA4_B7R1L', 'ALFA4_B7R1U', 'ALFA4_A7R1L', 'ALFA4_A7R1U', 'ALFA4_A7L1L', 'ALFA4_A7L1U', 'ALFA4_B7L1L', 'ALFA4_B7L1U',
-#ATR-13743      
-        'ALFA_B7R1L_OD', 'ALFA_B7R1U_OD', 'ALFA_A7R1L_OD', 'ALFA_A7R1U_OD', 'ALFA_A7L1L_OD', 'ALFA_A7L1U_OD', 'ALFA_B7L1L_OD', 'ALFA_B7L1U_OD',
-
-        #ATR-19355
-        '0INVM10-3MU4ab',
-
-        #ATR-18815 - Algorithm needs to be moved to master
-#        '0INVM10-0DR15-EM8abi-MU10ab',
-#        '0INVM10-0DR15-EM12abi-MU6ab',
-
-        #ATR-18824
-        '60INVM9999-25DPHI32-EM15abhi-FJj15s623ETA49',
-        '60INVM9999-04DPHI32-EM15abhi-FJj15s623ETA49',
-        #ATR-19302
-        '0INVM70-27DPHI32-EM12his1-EM12his6',
-
-        #ATR-19720
-        #'8INVM15-0DR22-2MU6ab',
-        #'2INVM9-2DR15-2MU6ab',
-        #'2INVM9-0DR15-MU6ab-MU4ab',
-        #'8INVM15-0DR22-MU6ab-MU4ab',
-        #'2INVM9-0DR15-2MU4ab',
-
-        #ATR-19510
-        '5DETA99-5DPHI99-2MU4ab',
-            
-        #ATR-17320
-        'CEP-CJ60s6',
-        'CEP-CJ50s6',
-       
-        #ATR-20174
-        '8INVM15-2CMU4ab'
-    ]
-
-    
-    Lvl1Flags.items = [
-
-        # single EM
-        'L1_EM3','L1_EM7','L1_EM12', 'L1_EM8VH',
-        'L1_EM10VH', 'L1_EM15',
-        #'L1_EM30VHI',
-        'L1_EM15VHI',
-        'L1_EM15VH', 'L1_EM18VHI', 'L1_EM20VH', 'L1_EM20VHI', 'L1_EM22VHI', 'L1_EM22VH','L1_EM24VHI', 
-        'L1_EM3_EMPTY', 'L1_EM7_EMPTY', 'L1_EM7_UNPAIRED_ISO', 'L1_EM7_FIRSTEMPTY',
-        'L1_EM20VH_FIRSTEMPTY',
-
-
-        # combined EM -jet - all commented
-
-        # single MU
-        "L1_MU4", "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU20", "L1_MU21",
-        
-        "L1_MU4_EMPTY", "L1_MU6_EMPTY", "L1_MU4_FIRSTEMPTY", "L1_MU11_EMPTY",
-        'L1_MU4_UNPAIRED_ISO',
-
-
-        
-        # multi lepton
-        "L1_2EM3", "L1_2EM7",
-        "L1_2EM15", "L1_2EM15VH", "L1_2EM15VHI",
-        "L1_2EM20VH",
-        "L1_EM20VH_3EM10VH", 
-        "L1_EM7_MU10",
-        "L1_2MU4", "L1_2MU6", "L1_2MU10", "L1_2MU20_OVERLAY",  "L1_MU11_2MU6", "L1_3MU4", "L1_MU6_2MU4", "L1_3MU6",  "L1_4MU4", "L1_MU6_3MU4", "L1_2MU6_3MU4", "L1_2MU11", "L1_MU11_2MU10",
-        "L1_2EM8VH_MU10", "L1_EM15VH_MU10",  "L1_EM7_MU20",
-
-        # single tau
-        "L1_TAU12IM",   "L1_TAU20IM",
-        "L1_TAU40_EMPTY","L1_TAU40_UNPAIRED_ISO", "L1_TAU40", "L1_TAU60", "L1_TAU100", "L1_TAU8_EMPTY", 
-        "L1_TAU8_UNPAIRED_ISO","L1_TAU8_FIRSTEMPTY",
-
-        # multi tau
-        "L1_TAU20IM_2TAU12IM",   "L1_TAU60_2TAU40", "L1_2TAU8",
-
-        # combined tau - lepton
-        "L1_EM15VHI_2TAU12IM",          
-        "L1_EM15VHI_2TAU12IM_J25_3J12",   
-        "L1_EM15VHI_2TAU12IM_4J12",
-        #"L1_EM15VHI_TAU40_2TAU15",
-        "L1_MU10_TAU12IM",  
-        "L1_MU10_TAU12IM_J25_2J12",
-        "L1_MU10_TAU12IM_3J12",
-        #'L1_DR-MU10TAU12I_TAU12I-J25',
-        "L1_MU10_TAU20IM",
-        "L1_MU11_TAU20IM",
-        "L1_MU10_TAU20IM_J25_2J20",
-
-        # combined tau - jet
-        "L1_TAU20IM_2TAU12IM_J25_2J20_3J12",
-        "L1_TAU20IM_2TAU12IM_4J12p0ETA25",
-        #"L1_TAU20IM_2TAU12IM_4J12p0ETA28",
-        "L1_TAU25IM_2TAU20IM_2J25_3J20", 
-
-        # combined tau - xe
-        "L1_TAU20IM_2J20_XE45",
-        "L1_TAU20IM_2J20_XE50",
-
-        #"L1_EM15HI_2TAU12I_XE35",
-        "L1_EM15VHI_2TAU12IM_XE35",
-        #'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20',
-
-        "L1_MU10_TAU12IM_XE35",
-
-        "L1_TAU20IM_2TAU12IM_XE35",
-        "L1_TAU40_2TAU12IM_XE40",
-
-        # combined em - jet
-        'L1_EM18VHI_3J20',
-        'L1_EM20VH_3J20',
-
-        # combined mu - jet
-        'L1_MU6_J20', 'L1_MU6_J40', 'L1_MU6_J75',
-        'L1_MU10_2J20','L1_MU10_3J20', 'L1_MU10_2J15_J20',
-        'L1_MU20_J40',
-        'L1_MU20_XE30',
-        'L1_MU20_J50',
-
-        # single jet
-        "L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100",  "L1_J400", #"L1_J120",
-        "L1_J20p31ETA49", "L1_J30p31ETA49", "L1_J50p31ETA49", "L1_J75p31ETA49", 'L1_J15p31ETA49',
-        "L1_J12_EMPTY","L1_J12_FIRSTEMPTY", "L1_J12_UNPAIRED_ISO", "L1_J12_UNPAIRED_NONISO", "L1_J12_ABORTGAPNOTCALIB", 
-        "L1_J15p31ETA49_UNPAIRED_ISO",
-        "L1_J30_EMPTY", "L1_J30_FIRSTEMPTY", "L1_J30p31ETA49_EMPTY", "L1_J30p31ETA49_UNPAIRED_ISO", "L1_J30p31ETA49_UNPAIRED_NONISO",
-        "L1_J50_UNPAIRED_ISO", "L1_J50_UNPAIRED_NONISO", "L1_J50_ABORTGAPNOTCALIB",         
-        'L1_J100_FIRSTEMPTY',
-        
-        # multi jet
-        "L1_J45p0ETA21_3J15p0ETA25", "L1_J50_2J40p0ETA25_3J15p0ETA25",
-        "L1_3J50", "L1_4J15", "L1_4J20", #"L1_4J20.0ETA49",
-        "L1_3J15p0ETA25_XE40",
-        
-        "L1_6J15",
-        "L1_J85_3J30",
-        # multi jet forward
-        "L1_J25p0ETA23_2J15p31ETA49",
-        "L1_J40p0ETA25_2J15p31ETA49",
-        "L1_J40p0ETA25_2J25_J20p31ETA49",
-        #"L1_J30p0ETA49_2J20p0ETA49",
-        
-        # multi jet central
-        "L1_3J25p0ETA23",
-        "L1_3J35p0ETA23",
-        "L1_4J15p0ETA25",
-        "L1_5J15p0ETA25",
-        # combined jet
-        "L1_2J15_XE55", "L1_J40_XE50",
-
-        #'L1_2J40_XE45',
-        "L1_2J50_XE40", "L1_J40_XE60",
-
-        # XE
-        "L1_XE35", "L1_XE40", "L1_XE45", "L1_XE50",
-        "L1_XE55", "L1_XE60", #"L1_XE70", #"L1_XE80",
-        'L1_XE30', 'L1_XE300',
-        #"L1_XE10",
-        
-        #XS
-        #'L1_EM12_XS20', 'L1_EM15_XS30',
-        
-        # TE
-#        'L1_TE5', ## disabled?
-
-        #VTE + MBTS
-        #"L1_MBTS_1_VTE2", "L1_MBTS_1_VTE3", "L1_MBTS_1_VTE4", "L1_MBTS_1_VTE5", "L1_MBTS_1_VTE10", "L1_MBTS_2_VTE2", "L1_MBTS_2_VTE3", "L1_MBTS_2_VTE4", "L1_MBTS_2_VTE5", "L1_MBTS_2_VTE10", 
-        
-        #TE + MU
-
-        # MBTS
-        "L1_MBTS_1_EMPTY",
-        "L1_MBTS_2_EMPTY",
-        "L1_MBTS_1_1_EMPTY",
-        # beam splashes
-        
-        #Overlay
-#        "L1_MBTS_1_OVERLAY","L1_TE20_OVERLAY",
-        
-        #BeamSpot
-#        "L1_MBTS_1_VTE70",
-
-        #BGRP9
-
-        #BGRP11
-        'L1_RD0_BGRP11',
-
-        # RNDM
-        'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO',  'L1_RD0_EMPTY',
-        "L1_RD1_EMPTY",
-        'L1_RD0_FIRSTEMPTY', 
-        'L1_RD0_ABORTGAPNOTCALIB',
-        'L1_RD2_FILLED', 'L1_RD2_EMPTY',
-        'L1_RD3_FILLED', 'L1_RD3_EMPTY',
-
-        #LUCID
-#        'L1_LUCID_A_C_EMPTY', 'L1_LUCID_A_C_UNPAIRED_ISO', 'L1_LUCID_A_C_UNPAIRED_NONISO',
-        #'L1_LUCID_COMM_EMPTY', 'L1_LUCID_COMM_UNPAIRED_ISO', 
-
-
-        # ZDC
-         # FTHR
-
-        # VDM
-         #"L1_BGRP7",
-
-        # TRT
-        # "L1_TRT",
-        "L1_TRT_FILLED",
-        "L1_TRT_EMPTY",
-
-        # TGC
-        "L1_TGC_BURST",
-#        "L1_TGC_BURST_EMPTY",
-
-        # LHCF
-    
-        #CALREQ
-        "L1_CALREQ2",
-
-        #ZB
-        "L1_ZB",
-
-        # BPTX
-        
-        # BCM
-         #'L1_BCM_AC_CA_UNPAIRED_ISO',
-        'L1_BCM_AC_CA_BGRP0', 'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO',
-        'L1_BCM_AC_UNPAIRED_ISO','L1_BCM_CA_UNPAIRED_ISO',
-        'L1_BCM_AC_UNPAIRED_NONISO','L1_BCM_CA_UNPAIRED_NONISO',
-        'L1_BCM_AC_ABORTGAPNOTCALIB', 'L1_BCM_CA_ABORTGAPNOTCALIB','L1_BCM_Wide_ABORTGAPNOTCALIB',
-        'L1_BCM_AC_CALIB', 'L1_BCM_CA_CALIB','L1_BCM_Wide_CALIB',
-
-        #AFP
-#         'L1_AFP_FSC', 
-#        'L1_AFP_C_ANY', 'L1_AFP_C_ANY_UNPAIRED_ISO', 'L1_AFP_C_ANY_UNPAIRED_NONISO', 'L1_AFP_C_ANY_EMPTY', 'L1_AFP_C_ANY_FIRSTEMPTY', 'L1_AFP_C_AND',
-
-#	'L1_EM7_AFP_A_AND_C','L1_EM12_AFP_A_AND_C',
-
-
-        #--------------------------------
-        # TOPO items
-        #--------------------------------
-
-        # B-jet
-        #'L1_BTAG-MU4J15',
-        #'L1_BTAG-MU6J20',
-
-        # ZH - all removed
-   
-
-        #Higgsino
-        #'L1_2MU4_J40_XE50',
-        'L1_MU4_J30_XE40_DPHI-J20s2XE30','L1_MU4_J50_XE50_DPHI-J20s2XE30',
-        #'L1_MU4_XE60',
-
-        # HT
-        'L1_HT190-J15s5pETA21',
-
-        "L1_HT150-J20s5pETA31_MJJ-400-CF",
-        
-        # Jpsi T&P
-        'L1_JPSI-1M5-EM7', 'L1_JPSI-1M5-EM12',    
-#            
-        
-        # W T&P - all removed
-        'L1_LFV-MU6',
-        'L1_LFV-MU11',
-        'L1_LFV-EM8I',
-        'L1_LFV-EM15I',
-        'L1_DPHI-J20s2XE50',
-        'L1_J40_XE50_DPHI-J20s2XE50',
-        'L1_2MU4_J20_XE30_DPHI-J20s2XE30',
-        'L1_MJJ-700',
-        'L1_MJJ-300',
-        #'L1_MJJ-100',
-        #'L1_MJJ-400',
-        #'L1_MJJ-800',
-        'L1_MJJ-500-NFF',
-        'L1_J50_DETA20-J50J',
-        'L1_DPHI-2EM3',
-        #'L1_HT150-JJ15.ETA49',
-        #'L1_HT150-JJ15.ETA49_MJJ-400',
-        #'L1_J4-MATCH',
-        'L1_LLP-RO',
-        #'L1_LLP-NOMATCH',
-        #'L1_EM15TAU12I-J25',
-        'L1_DR-EM15TAU12I-J25',
-        #'L1_TAU20ITAU12I-J25',
-        'L1_DR-TAU20ITAU12I',    
-        'L1_DR-TAU20ITAU12I-J25',
-        #'L1_DR-MU10TAU12I',
-
-        'L1_30M-EM20ITAU12',
-        'L1_MJJ-400-CF',
-    
-        #'L1_LAR-EM',
-        #'L1_LAR-J',
-        #'L1_LAR-ZEE',
-        #'L1_LAR-ZEE_LAR-EM',
-        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4',
-        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4',
-        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6',
-        #'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO',
-
-        #ATR-19720 - no algorithm in master
-#        'L1_BPH-8M15-0DR22-2MU6',
-#        'L1_BPH-2M9-2DR15-2MU6',
-#        'L1_BPH-2M9-0DR15-MU6MU4',
-#        'L1_BPH-8M15-0DR22-MU6MU4-BO',
-#        'L1_BPH-2M9-0DR15-2MU4',
-#
-#        'L1_BPH-0M9-EM7-EM5',        
-#        'L1_BPH-0DR3-EM7J15',
-#        'L1_BPH-0M9-EM7-EM5_MU6',
-#        'L1_BPH-0DR3-EM7J15_MU6',
-#        'L1_BPH-0M9-EM7-EM5_2MU4',
-#        'L1_BPH-0DR3-EM7J15_2MU4',
-#
-        # combined L1Topo for VBF
-        
-        # INVM + DPHI 
-        #'L1_MJJ-400-NFF-0DPHI20',
-        'L1_MJJ-400-NFF-0DPHI22',
-        'L1_MJJ-400-NFF-0DPHI24',
-        'L1_MJJ-400-NFF-0DPHI26',
-   
-        ### ATR-15062
-        'L1_EM18VHI_MJJ-300',
-
-        'L1_LATE-MU10_XE50','L1_LATE-MU10_XE40', 'L1_LATE-MU10_J50',
-
-        'L1_TAU60_DR-TAU20ITAU12I',
-
-        'L1_SC111-CJ15',
-#        'L1_SC85-CJ15',
-        
-        ##     # Partition 1
-        ##     'L1_CALREQ0_P1', 'L1_CALREQ1_P1', 'L1_CALREQ2_P1',
-
-        #ALFA
-        'L1_ALFA_ANY',
-        'L1_ALFA_B7L1U','L1_ALFA_B7L1L','L1_ALFA_A7L1U','L1_ALFA_A7L1L','L1_ALFA_A7R1U','L1_ALFA_A7R1L','L1_ALFA_B7R1U','L1_ALFA_B7R1L',
-        
-#        'L1_ALFA_SDIFF5','L1_ALFA_SDIFF6','L1_ALFA_SDIFF7','L1_ALFA_SDIFF8',
-#        'L1_MBTS_1_A_ALFA_C','L1_MBTS_1_C_ALFA_A','L1_MBTS_1_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_1_C_ALFA_A_UNPAIRED_ISO',
-#        'L1_MBTS_2_A_ALFA_C','L1_MBTS_2_C_ALFA_A','L1_MBTS_2_A_ALFA_C_UNPAIRED_ISO','L1_MBTS_2_C_ALFA_A_UNPAIRED_ISO',
-#        'L1_LUCID_A_ALFA_C','L1_LUCID_C_ALFA_A','L1_LUCID_A_ALFA_C_UNPAIRED_ISO','L1_LUCID_C_ALFA_A_UNPAIRED_ISO',
-#
-#        'L1_ALFA_ELASTIC_UNPAIRED_ISO', 'L1_ALFA_ANTI_ELASTIC_UNPAIRED_ISO',        
-#
-#        #'L1_ZDC_A_ALFA_C','L1_ZDC_C_ALFA_A','L1_ZDC_ALFA',
-#        'L1_EM3_ALFA_ANY',
-#        'L1_EM3_ALFA_ANY_UNPAIRED_ISO',
-#
-#        'L1_EM3_ALFA_EINE',
-#        'L1_J12_ALFA_ANY','L1_J12_ALFA_ANY_UNPAIRED_ISO',
-#        'L1_TE5_ALFA_ANY','L1_TE5_ALFA_ANY_UNPAIRED_ISO',
-#         'L1_TE5_ALFA_EINE',
-#        'L1_TRT_ALFA_ANY','L1_TRT_ALFA_ANY_UNPAIRED_ISO',
-#        'L1_TRT_ALFA_EINE',
-#        #'L1_LHCF_ALFA_ANY_A',
-#        #'L1_LHCF_ALFA_ANY_C',
-##        'L1_LHCF_ALFA_ANY_A_UNPAIRED_ISO','L1_LHCF_ALFA_ANY_C_UNPAIRED_ISO',
-#        'L1_ALFA_BGT','L1_ALFA_BGT_UNPAIRED_ISO',
-#        'L1_ALFA_ANY_A_EMPTY','L1_ALFA_ANY_C_EMPTY',
-#
-#         'L1_AFP_C_MBTS_A',
-#         'L1_AFP_C_ZDC_C',
-#         'L1_AFP_C_J12',
-#         'L1_AFP_C_EM3',
-#         'L1_AFP_C_TE5',
-#         'L1_AFP_C_ALFA_C',
-#         'L1_AFP_C_ALFA_A',
-#         'L1_AFP_C_ANY_MBTS_A',
-#         'L1_AFP_C_MU4',
-
-        # Items for beta*=90m run
-#        'L1_J12_ALFA_EINE',
-#        'L1_2EM3_ALFA_EINE',
-#        'L1_MU4_ALFA_ANY',
-#        'L1_MU4_ALFA_ANY_UNPAIRED_ISO',
-#        'L1_MU4_ALFA_ANY_PAIRED_UNPAIRED_ISO',
-#        'L1_MU4_ALFA_EINE',
-
-
-        #ATR-18815
-        #'L1_LFV-EM8I-MU11',
-        #'L1_LFV-EM12I-MU6',
-
-        #ATR-19355
-        'L1_BPH-0M10-3MU4',
-
-        #ATR-18824
-        'L1_ZAFB-04DPHI-EM15I',
-        'L1_ZAFB-25DPHI-EM15I',
-        'L1_ZAFB-25DPHI-EM18I',
-
-        #ATR-19302: 
-#        'L1_DPHI-M70-2EM10I',
-        'L1_DPHI-M70-2EM12I',
-
-        #ATR-19510
-        'L1_DY-BOX-2MU4',
-        #'L1_DY-DR-2MU4',
-        'L1_DY-BOX-2MU6',
-
-                
-        #ATR-17320
-        'L1_CEP-CJ60',
-        'L1_CEP-CJ50' ,
-        #'L1_CEP-CJ50pETA21',
-
-        #ATR-20174
-        'L1_BPH-8M15-2MU4-BO'
-
-
-
-        ]
-    
-
-    #CTP IDs are taken from this mapping. Every L1 item needs a unique ctpid.
-    # Run this file as python <this file> to print out available IDs
-    # 463-464 are reserved for L1_RD2_BGRP14 and L1_RD3_BGRP15 (from run 2)
-    # 509-511 are reserved for CALREQ
-
-    
-
-    Lvl1Flags.CtpIdMap = {
-
-        'L1_EM3' : 0,
-        'L1_EM7' : 1,
-        'L1_EM12' : 2,
-        'L1_EM8VH' : 3,
-        'L1_EM10VH' : 4,
-        'L1_EM15' : 6,
-        #'L1_EM30VHI' : 25,
-        'L1_EM15VHI' : 29,
-        #'L1_EM24VHIM': 30,
-        'L1_EM15VH'  : 7,
-        'L1_EM18VHI' : 8,
-        'L1_EM20VH'  : 9,
-        'L1_EM20VHI' : 10,
-        'L1_EM22VHI' : 11,
-        'L1_EM22VH'  : 295,
-        'L1_EM24VHI' : 392,
-        'L1_EM3_EMPTY' : 12,
-        'L1_EM7_EMPTY' : 13,
-        'L1_EM7_UNPAIRED_ISO' : 389,
-        'L1_EM7_FIRSTEMPTY' : 371,
-        'L1_EM20VH_FIRSTEMPTY' : 411,
-        'L1_MU4' : 14,
-        'L1_MU6' : 15,
-        'L1_MU10' : 16,
-        'L1_MU11' : 256,
-        'L1_MU20' : 18,
-        'L1_MU21' : 17,
-        'L1_MU4_EMPTY' : 19,
-        'L1_MU6_EMPTY' : 66,
-        'L1_MU4_FIRSTEMPTY' : 20,
-        'L1_MU11_EMPTY' : 21,
-        'L1_MU4_UNPAIRED_ISO' : 22,
-        'L1_2EM3' : 23,
-        'L1_2EM7' : 24,
-        'L1_2EM15' : 27,
-        'L1_2EM15VH' : 28,
-        'L1_2EM15VHI' : 31,
-        'L1_2EM20VH' : 400,
-        'L1_EM20VH_3EM10VH' : 431,
-        'L1_EM7_MU10' : 65,
-        'L1_2MU4' : 32,
-        'L1_2MU6' : 33,
-        'L1_2MU10' : 34,
-        'L1_2MU20_OVERLAY' : 35,
-        'L1_MU11_2MU6' : 37,
-        'L1_3MU4' : 38,
-        'L1_MU6_2MU4' : 39,
-        'L1_3MU6' : 40,
-        'L1_4MU4' : 46,
-        'L1_MU6_3MU4' : 36,
-        'L1_2MU6_3MU4' : 42,
-        'L1_2MU11' : 48,
-        'L1_MU11_2MU10' : 49,
-        'L1_2EM8VH_MU10' : 43,
-        'L1_EM15VH_MU10' : 44,
-        'L1_EM7_MU20' : 483,
-        #'L1_TAU5' : 50,
-        #'L1_TAU12' : 45,
-        'L1_TAU12IM' : 47,
-        'L1_TAU20IM' : 51,
-        #'L1_TAU30' : 53,
-        'L1_TAU40_EMPTY' : 341,
-        'L1_TAU40_UNPAIRED_ISO' : 343,
-        'L1_TAU40' : 54,
-        'L1_TAU60' : 55,
-        #'L1_TAU90' : 56,
-        'L1_TAU100' : 52,
-        'L1_TAU8_EMPTY' : 57,
-        'L1_TAU8_UNPAIRED_ISO' : 388,
-        'L1_TAU8_FIRSTEMPTY' : 391,
-        'L1_TAU20IM_2TAU12IM' : 58,
-        'L1_TAU60_2TAU40' : 458,
-        #'L1_2TAU5' : 59,
-        'L1_2TAU8' : 459,
-        'L1_EM15VHI_2TAU12IM' : 60,
-        'L1_EM15VHI_2TAU12IM_J25_3J12' : 61,
-        'L1_EM15VHI_2TAU12IM_4J12' : 5,
-        #'L1_EM15VHI_TAU40_2TAU15' : 62,
-        'L1_MU10_TAU12IM' : 63,
-        'L1_MU10_TAU12IM_J25_2J12' : 64,
-        'L1_MU10_TAU12IM_3J12' : 482,
-        'L1_MU10_TAU20IM' : 67,
-        'L1_MU11_TAU20IM' : 430,
-        'L1_MU10_TAU20IM_J25_2J20' : 377,
-        'L1_TAU20IM_2TAU12IM_J25_2J20_3J12' : 70,
-        'L1_TAU20IM_2TAU12IM_4J12p0ETA25' : 316,
-        #'L1_TAU20IM_2TAU12IM_4J12.0ETA25' : 73,
-        #'L1_TAU20IM_2TAU12IM_4J12p0ETA28' : 77,
-        'L1_TAU25IM_2TAU20IM_2J25_3J20' : 398,
-        'L1_TAU20IM_2J20_XE45' : 74,
-        'L1_TAU20IM_2J20_XE50' : 79,
-        'L1_EM15VHI_2TAU12IM_XE35' : 78,
-        #'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20' : 69,
-        'L1_MU10_TAU12IM_XE35' : 81,
-        'L1_TAU20IM_2TAU12IM_XE35' : 83,
-        'L1_TAU40_2TAU12IM_XE40' : 429,
-        'L1_EM18VHI_3J20' : 172,
-        'L1_EM20VH_3J20' : 26,
-        'L1_MU6_J20' : 88,
-        #'L1_MU6_J30p0ETA49_2J20p0ETA49' : 382,
-        'L1_MU6_J40' : 89,
-        'L1_MU6_J75' : 90,
-        'L1_MU10_2J20' : 278,
-        'L1_MU10_3J20' : 173,
-        'L1_MU10_2J15_J20' : 255,
-        'L1_MU20_J40' : 428,
-        'L1_MU20_XE30' : 433,
-        'L1_MU20_J50' : 82,
-        'L1_J15' : 92,
-        'L1_J20' : 93,
-        'L1_J25' : 94,
-        'L1_J30' : 95,
-        'L1_J40' : 96,
-        'L1_J50' : 97,
-        'L1_J75' : 98,
-        'L1_J85' : 99,
-        'L1_J100' : 100,
-        #'L1_J120' : 101,
-        'L1_J400' : 102,
-        #'L1_4J20.0ETA49' : 383,
-        'L1_J20p31ETA49' : 103,
-        'L1_J30p31ETA49' : 104,
-        'L1_J50p31ETA49' : 105,
-        'L1_J75p31ETA49' : 106,
-        'L1_J15p31ETA49' : 109,
-        #'L1_J30p0ETA49_2J20p0ETA49' : 137,
-        'L1_J12_EMPTY' : 111,
-        'L1_J12_FIRSTEMPTY' : 112,
-        'L1_J12_UNPAIRED_ISO' : 113,
-        'L1_J12_UNPAIRED_NONISO' : 114,
-        'L1_J12_ABORTGAPNOTCALIB' : 115,
-        'L1_J15p31ETA49_UNPAIRED_ISO' : 75,
-        'L1_J30_EMPTY' : 116,
-        'L1_J30_FIRSTEMPTY' : 117,
-        'L1_J30p31ETA49_EMPTY' : 118,
-        'L1_J30p31ETA49_UNPAIRED_ISO' : 119,
-        'L1_J30p31ETA49_UNPAIRED_NONISO' : 120,
-        'L1_J50_UNPAIRED_ISO' : 121,
-        'L1_J50_UNPAIRED_NONISO' : 122,
-        'L1_J50_ABORTGAPNOTCALIB' : 123,
-        'L1_J100_FIRSTEMPTY' : 414,
-        'L1_J45p0ETA21_3J15p0ETA25' : 86,
-        'L1_J50_2J40p0ETA25_3J15p0ETA25' : 87,
-        'L1_3J50' : 130,
-        'L1_4J15' : 131,
-        'L1_4J20' : 132,
-        'L1_3J15p0ETA25_XE40' : 184,
-        'L1_6J15' : 135,
-        'L1_J85_3J30' : 480,
-        'L1_J25p0ETA23_2J15p31ETA49' : 335,
-        'L1_J40p0ETA25_2J15p31ETA49' : 181,
-        'L1_J40p0ETA25_2J25_J20p31ETA49' : 182,
-        'L1_3J25p0ETA23' : 373,
-        'L1_3J35p0ETA23' : 425,
-        'L1_4J15p0ETA25' : 41,
-        'L1_5J15p0ETA25' : 140,
-        'L1_2J15_XE55' : 141,
-        'L1_J40_XE50' : 142,
-        'L1_2J50_XE40' : 175,
-        'L1_J40_XE60' : 176,
-        #'L1_XE10' : 68,
-        'L1_XE35' : 144,
-        'L1_XE40' : 145,
-        'L1_XE45' : 146,
-        'L1_XE50' : 147,
-        'L1_XE55' : 148,
-        'L1_XE60' : 149,
-        #'L1_XE70' : 150,
-        #'L1_XE80' : 151,
-        'L1_XE30' : 85,
-        'L1_XE300' : 187,
-        #'L1_EM12_XS20' : 154,
-        #'L1_EM15_XS30' : 155,
-        'L1_RD0_FILLED' : 200,
-        'L1_RD0_UNPAIRED_ISO' : 201,
-        'L1_RD0_EMPTY' : 202,
-        'L1_RD0_FIRSTEMPTY' : 209,
-        'L1_RD1_EMPTY'  : 204,
-        'L1_RD2_FILLED' : 205,
-        'L1_RD2_EMPTY'  : 206,
-        'L1_RD3_FILLED' : 207,
-        'L1_RD3_EMPTY'  : 208,
-        'L1_RD0_BGRP11' : 211,
-        'L1_TRT_FILLED' : 218,
-        'L1_TRT_EMPTY'  : 219,
-        'L1_RD0_ABORTGAPNOTCALIB' : 372,
-        'L1_TGC_BURST' : 220,
-        'L1_ZB' : 240,
-        'L1_BCM_AC_CA_BGRP0' : 223,
-        'L1_BCM_Wide_EMPTY' : 224,
-        'L1_BCM_Wide_UNPAIRED_ISO' : 225,
-        'L1_BCM_Wide_UNPAIRED_NONISO' : 161,
-        'L1_BCM_AC_UNPAIRED_ISO' : 163,
-        'L1_BCM_CA_UNPAIRED_ISO' : 229,
-        'L1_BCM_AC_UNPAIRED_NONISO' : 230,
-        'L1_BCM_CA_UNPAIRED_NONISO' : 231,
-        'L1_BCM_AC_ABORTGAPNOTCALIB' : 232,
-        'L1_BCM_CA_ABORTGAPNOTCALIB' : 233,
-        'L1_BCM_Wide_ABORTGAPNOTCALIB' : 234,
-        'L1_BCM_AC_CALIB' : 235,
-        'L1_BCM_CA_CALIB' : 236,
-        'L1_BCM_Wide_CALIB' : 237,
-        #'L1_BTAG-MU4J15' : 238,
-        #'L1_BTAG-MU6J20' : 243,
-        #'L1_2MU4_J40_XE50' : 449,
-        'L1_MU4_J30_XE40_DPHI-J20s2XE30' : 452,
-        'L1_MU4_J50_XE50_DPHI-J20s2XE30' : 453,
-        #'L1_MU4_XE60' : 454,
-        'L1_HT190-J15s5pETA21' : 259,
-        'L1_HT150-J20s5pETA31_MJJ-400-CF' : 91,
-        'L1_JPSI-1M5-EM7' : 263,
-        'L1_JPSI-1M5-EM12' : 264,
-        'L1_LFV-MU6' : 332,
-        'L1_LFV-MU11' : 364,
-        'L1_LFV-EM8I' : 320,
-        'L1_LFV-EM15I' : 321,
-        'L1_DPHI-J20s2XE50' : 323,
-        'L1_J40_XE50_DPHI-J20s2XE50' : 245,
-        'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271,
-        'L1_MJJ-700' : 216,
-        'L1_MJJ-300' : 331,
-        #'L1_MJJ-100' : 333,
-        #'L1_MJJ-400' : 329,
-        #'L1_MJJ-800' : 327,
-        'L1_MJJ-500-NFF' : 108,
-        'L1_J50_DETA20-J50J' : 275,
-        'L1_DPHI-2EM3' : 288,
-        #'L1_HT150-JJ15.ETA49' : 334,
-        #'L1_HT150-JJ15.ETA49_MJJ-400' : 416,
-        #'L1_J4-MATCH' : 336,
-        'L1_LLP-RO' : 338,
-        #'L1_LLP-NOMATCH' : 339,
-        #'L1_EM15TAU12I-J25' : 345,
-        #'L1_DR-MU10TAU12I' : 340,
-        #'L1_DR-MU10TAU12I_TAU12I-J25' : 72,
-        'L1_DR-EM15TAU12I-J25' : 346,
-        #'L1_TAU20ITAU12I-J25' : 347,
-        'L1_DR-TAU20ITAU12I' : 348,
-        'L1_DR-TAU20ITAU12I-J25' : 350,
-        'L1_30M-EM20ITAU12' : 387,
-        'L1_MJJ-400-CF' : 397,
-        #'L1_LAR-EM' : 351,
-        #'L1_LAR-J' : 352,
-        #'L1_LAR-ZEE' : 71,
-        #'L1_LAR-ZEE_LAR-EM' : 285,
-        #'L1_BPH-2M9-2MU4_BPH-0DR15-2MU4' : 426,
-        #'L1_BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4' : 427,
-        'L1_BPH-8M15-MU6MU4_BPH-0DR22-MU6MU4-BO' : 488,
-        #'L1_BPH-8M15-2MU6_BPH-0DR22-2MU6' : 301,
-        'L1_BPH-8M15-0DR22-2MU6' : 107,
-        'L1_BPH-2M9-2DR15-2MU6' : 110,
-        'L1_BPH-2M9-0DR15-MU6MU4' : 125,
-        'L1_BPH-8M15-0DR22-MU6MU4-BO' : 126,
-        'L1_BPH-2M9-0DR15-2MU4' : 127,
-        'L1_BPH-0M9-EM7-EM5' : 80,
-        'L1_BPH-0DR3-EM7J15' : 84,
-        'L1_BPH-0M9-EM7-EM5_MU6' : 124,
-        'L1_BPH-0DR3-EM7J15_MU6' : 134,
-        'L1_BPH-0M9-EM7-EM5_2MU4' : 153,
-        'L1_BPH-0DR3-EM7J15_2MU4' : 156,
-        #'L1_MJJ-400-NFF-0DPHI20' : 128,
-        'L1_MJJ-400-NFF-0DPHI22' : 129,
-        'L1_MJJ-400-NFF-0DPHI24' : 133,
-        'L1_MJJ-400-NFF-0DPHI26' : 136,
-        'L1_EM18VHI_MJJ-300' : 385,
-        'L1_LATE-MU10_XE50' : 354,
-        'L1_LATE-MU10_XE40' : 466,
-        'L1_LATE-MU10_J50' : 355,
-        'L1_TAU60_DR-TAU20ITAU12I' : 76,
-        'L1_SC111-CJ15' : 356,
-        #'L1_LFV-EM8I-MU11' : 138,
-        #'L1_LFV-EM12I-MU6' : 139,
-        'L1_BPH-0M10-3MU4' : 143,
-        'L1_ZAFB-04DPHI-EM15I' : 152,
-        'L1_ZAFB-25DPHI-EM15I' : 157,
-        #'L1_ZAFB-25DPHI-EM18I' : 158,
-        'L1_DPHI-M70-2EM12I' : 159,
-        #'L1_DY-DR-2MU4' : 315,
-        'L1_DY-BOX-2MU6' : 318,
-        'L1_DY-BOX-2MU4' : 160,
-        'L1_CEP-CJ60' : 162,
-        'L1_CEP-CJ50' : 80,
-        'L1_MBTS_1_EMPTY' : 164,
-        'L1_MBTS_2_EMPTY' : 166,
-        'L1_MBTS_1_1_EMPTY' : 168,
-        'L1_BPH-8M15-2MU4-BO' : 165,
-        'L1_CALREQ2' : 511,
-        'L1_ALFA_B7L1U' : 489,
-        'L1_ALFA_ANY'   : 490,
-        'L1_ALFA_A7L1U' : 491,
-        'L1_ALFA_A7L1L' : 492,
-        'L1_ALFA_A7R1U' : 493,
-        'L1_ALFA_A7R1L' : 494,
-        'L1_ALFA_B7R1U' : 495,
-        'L1_ALFA_B7R1L' : 496,
-        'L1_ALFA_B7L1L' : 497,
-
-}
-
-
-    Lvl1Flags.prescales = {}
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/MonitorDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/MonitorDef.py
deleted file mode 100644
index f538e2348800..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/MonitorDef.py
+++ /dev/null
@@ -1,246 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-"""
-The CTP monitors three different types of signals. In the XML file
-they are listed in the section <TriggerCounterList>
-
-1) type CTPIN
-
-Almost each input threshold is monitored with one counter per
-multiplicity it can have. E.g. there are 7 counters for the EM10VH
-threshold: "1EM10VH" ... "7EM10VH"
-
-Due to limitations of the CTPIN monitoring LUT (there are only 4 LUT
-per CTPIN connector and a LUT has 8 bit input) only 2 3-bit thresholds
-can be monitored per LUT, so max 8 3-bit thresholds per
-connector. Hence JET thresholds 8 and 9 can not be monitored.
-
-
-2) type CTPMON
-
-This allows to monitor any combination of conditions built in the same
-way as L1 Items. However, since we can also monitor L1 Items directly
-(see 3)), there is little need for this type of monitoring. We use it to monitor simple conditions
-
-
-3) type TBP, TAP, TAV
-
-For each of these type 64 L1Items can be monitored independently
-
-"""
-
-from TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1MonCounters import Lvl1CtpinCounter, Lvl1CtpmonCounter
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-class MonitorDef(object):
-
-    LOW_FREQ = 0
-    HIGH_FREQ = 1
-
-
-    # CTPIN counters
-    # these are generated for all CTPIN except the two highest JET inputs and the direct inputs
-    @staticmethod
-    def ctpinCounters( thresholds ):
-
-        counters = []
-
-        for thr in thresholds:
-            # this special check addresses the LUT size issue for the monitoring (see file header and Cabling.py)
-            dontGenerateCounter = (thr.ttype=="JET" and (thr.mapping==8 or thr.mapping==9)) \
-                                  or thr.ttype=="TOPO" or thr.ttype=="ALFA"
-            if dontGenerateCounter:
-                continue
-            for mult in range(1, 2**thr.cableinfo.bitnum):
-                counters += [ Lvl1CtpinCounter(thr.name,mult) ]
-
-        return counters
-
-
-    # CTPMON counters
-    # we only have a few for the moment
-    @staticmethod
-    def ctpmonCounters( thresholds ):
-
-        counters = []
-
-        from operator import attrgetter
-        emthresholds = sorted([thr for thr in thresholds if thr.ttype=='EM'], key = attrgetter('mapping'))
-        
-        thrNames = [thr.name for thr in thresholds]
-        if "MBTS_A" in thrNames:
-            counters += [ Lvl1CtpmonCounter("MBTS_A",1) ]
-        if "MBTS_C" in thrNames:
-            counters += [ Lvl1CtpmonCounter("MBTS_C",1) ]
-        if emthresholds:
-            counters += [ Lvl1CtpmonCounter(emthresholds[0].name,1) ] # lowest EM threshold
-
-        return counters
-
-    @staticmethod
-    def applyItemCounter( items ):
-
-        TBP=1
-        TAP=2
-        TAV=4
-
-        monItems   = { 1 :[], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [] }
-        monItemsHF = { 1 :[], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [] }
-
-        # definitions hardcoded at the moment
-
-#        monItems[TBP] = [
-#            "L1_MBTSA0", "L1_MBTSA1", "L1_MBTSA2", "L1_MBTSA3", "L1_MBTSA4", "L1_MBTSA5", "L1_MBTSA6", "L1_MBTSA7", "L1_MBTSA8", "L1_MBTSA10", "L1_MBTSA12", "L1_MBTSA14", 
-#            "L1_MBTSC0", "L1_MBTSC1", "L1_MBTSC2", "L1_MBTSC3", "L1_MBTSC4", "L1_MBTSC5", "L1_MBTSC6", "L1_MBTSC7", "L1_MBTSC8", "L1_MBTSC10", "L1_MBTSC12", "L1_MBTSC14",
-#            "L1_LUCID", "L1_LUCID_A_C_EMPTY",
-#            "L1_LHCF",
-#            "L1_ALFA_A7R1U",
-#            "L1_ALFA_B7L1_OD","L1_ALFA_A7L1_OD","L1_ALFA_A7R1_OD","L1_ALFA_B7R1_OD",
-#            "L1_BPTX0_BGRP0", "L1_BPTX1_BGRP0",
-#            ]
-#        
-#        monItems[TAP|TAV] = [
-#            "L1_EM7", "L1_EM12", "L1_EM8VH", "L1_EM10VH", "L1_EM15", "L1_EM15HI", "L1_EM15VH", 
-#            "L1_MU6", "L1_MU10", "L1_MU11", "L1_MU15", "L1_MU20",
-#            "L1_TAU20", "L1_TAU20IL", "L1_TAU20IM", "L1_TAU20IT", 
-#            "L1_J20", "L1_J100", 
-#            "L1_XE80", "L1_XS65", "L1_TE50",
-#            "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
-#            ]
-#        
-#        monItems[TBP|TAP|TAV] = [
-#            "L1_EM3", "L1_MU4", "L1_TAU12", "L1_J12", "L1_XE35", "L1_XS20", "L1_TE20",
-#            "L1_MBTS_4_A", "L1_MBTS_4_C", 
-#            "L1_HT200-J20s5.ETA49", "L1_HT1-J0.ETA49", "L1_HT190-J20s5.ETA49", "L1_JPSI-1M5-EMs", "L1_JPSI-1M5-EM6s", "L1_JPSI-1M5-EM12s",
-#            "L1_MJJ-4", "L1_MJJ-3", "L1_MJJ-2", "L1_MJJ-1", "L1_MJJ-350-0", "L1_MJJ-300-0", "L1_MJJ-250-0", "L1_MJJ-200-0", 
-#            "L1_RD0_FILLED", "L1_RD1_FILLED", "L1_RD2_FILLED", "L1_RD3_FILLED", 
-#            ]
-#
-#        monItemsHF[TBP] = [
-#            "L1_ALFA_ANY", 
-#            "L1_ALFA_A7R1L","L1_ALFA_B7R1U","L1_ALFA_B7R1L", "L1_ALFA_B7L1U", "L1_ALFA_B7L1L","L1_ALFA_A7L1U","L1_ALFA_A7L1L",
-#            ]
-#
-#        monItemsHF[TBP|TAP|TAV] = [
-#            "L1_BCM_Wide_BGRP0",
-#            "L1_BCM_AC_CA_BGRP0",
-#            "L1_BCM_AC_UNPAIRED_ISO",
-#            "L1_BCM_CA_UNPAIRED_ISO",
-#            "L1_J12",
-#            "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
-#            ]
-
-
-        monItems[TBP] = [
-            "L1_ALFA_B7L1U", "L1_ALFA_B7L1L", "L1_ALFA_A7L1U", "L1_ALFA_A7L1L", "L1_ALFA_A7R1U", "L1_ALFA_A7R1L", "L1_ALFA_B7R1U", "L1_ALFA_B7R1L"
-            ]
-
-        monItems[TBP|TAP|TAV] = [
-            "L1_EM3","L1_EM20VH","L1_EM22VHI",
-            "L1_MU4","L1_MU10","L1_MU20",
-            "L1_TAU12", "L1_TAU12IT", "L1_TAU20", "L1_TAU60",
-            "L1_J12", "L1_J20", "L1_J100", "L1_J400", "L1_J20p31ETA49", "L1_J30p31ETA49",
-            "L1_XE35", "L1_XE80", "L1_XS20", 
-            "L1_MBTS_4_A", "L1_MBTS_4_C", "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
-            "L1_LUCID", "L1_LUCID_A_C_EMPTY", "L1_ALFA_ANY",
-            "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_AND",
-            "L1_BPTX0_BGRP0","L1_BPTX1_BGRP0",
-            "L1_CALREQ2",
-            "L1_AFP_NSC","L1_AFP_FSC",
-            "L1_BPH-2M8-2MU4","L1_BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4","L1_BPH-2M9-2MU6_BPH-2DR15-2MU6",
-            "L1_MU6MU4-BO","L1_2MU4-B",
-            "L1_LFV-EM8I",
-            "L1_TGC_BURST",
-            "L1_LLP-NOMATCH",
-            "L1_DR-TAU20ITAU12I",
-            "L1_HT190-J15s5pETA21",
-            "L1_3J15_BTAG-MU4J15",
-            "L1_MJJ-900",
-            "L1_J40_DPHI-J20s2XE50",
-            "L1_KF-XE55",
-            ]
-
-        monItemsHF[TBP|TAP|TAV] = [
-            "L1_BCM_Wide_BGRP0",
-            "L1_BCM_AC_CA_BGRP0",
-            "L1_BCM_AC_UNPAIRED_ISO",
-            "L1_BCM_CA_UNPAIRED_ISO",
-            "L1_J12",
-            "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
-            ]
-
-
-        check = False
-        if check:
-            counts_LF_items = { TBP : set(), TAP : set(), TAV : set() }
-            counts_HF_items = { TBP : set(), TAP : set(), TAV : set() }
-
-            for k in range(1,8):
-
-                if k & TBP:
-                    counts_LF_items[TBP].update( monItems[k] )
-                    counts_HF_items[TBP].update( monItemsHF[k] )
-
-                if k & TAP:
-                    counts_LF_items[TAP].update( monItems[k] )
-                    counts_HF_items[TAP].update( monItemsHF[k] )
-
-                if k & TAV:
-                    counts_LF_items[TAV].update( monItems[k] )
-                    counts_HF_items[TAV].update( monItemsHF[k] )
-
-            counts_LF = dict( map(lambda x : (x[0],len(x[1])), counts_LF_items.items() ) )
-            counts_HF = dict( map(lambda x : (x[0],len(x[1])), counts_HF_items.items() ) )
-
-            lutsLF = ( max(counts_LF.values())-1) / 8 + 1
-            lutsHF = ( max(counts_HF.values())-1) / 8 + 1
-
-            if lutsLF + lutsHF > 8:
-                log.warning("too many monitoring items are defined:")
-                log.warning("   low frequency  TBP: %i", counts_LF[TBP])
-                log.warning("                  TAP: %i", counts_LF[TAP])
-                log.warning("                  TAV: %i", counts_LF[TAV])
-                log.warning("   required LUTs: %i", lutsLF)
-                log.warning("   high frequency TBP: %i", counts_HF[TBP])
-                log.warning("                  TAP: %i", counts_HF[TAP])
-                log.warning("                  TAV: %i", counts_HF[TAV])
-                log.warning("   required LUTs: %i", lutsHF)
-                log.warning("   this menu requires %i monitoring LUTs while only 8 are available", (lutsLF + lutsHF))
-            
-
-
-        #MonitorDef.checkForNonExistingMonItems(items, monItems)
-
-        # for each item set the monitor flags
-        for item in items:
-            itemName = item.name
-            for k,l in monItems.items():
-                if itemName in l:
-                    item.addMonitor(k, MonitorDef.LOW_FREQ)
-
-            for k,l in monItemsHF.items():
-                if itemName in l:
-                    item.addMonitor(k, MonitorDef.HIGH_FREQ)
-
-
-    @staticmethod
-    def checkForNonExistingMonItems(items, monItems):
-        # check is based on item names
-        allItemNames = [item.name for item in items]
-
-        # unify all item names that are monitored
-        allMonitorItems = set()
-        for i in range(1,8):
-            allMonitorItems.update(monItems[i])
-
-        # register all monitems that don't exist in here
-        nonExistiginMonItems = []
-        
-        for monItem in allMonitorItems:
-            if monItem not in allItemNames:
-                nonExistiginMonItems += [monItem]
-
-        if len(nonExistiginMonItems)>0:
-            raise RuntimeError("These monitoring items are part of the menu: %s" % ','.join(nonExistiginMonItems))
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py
deleted file mode 100644
index 6f646cdd38cc..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/ThresholdDef.py
+++ /dev/null
@@ -1,470 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-from TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1Thresholds import ThresholdValue
-from TriggerMenuMT.LVL1MenuConfig.LVL1.Limits import CaloLimits as CL
-
-ClusterOff   = CL.ClusterOff
-IsolationOff = CL.IsolationOff
-JetOff       = CL.JetOff
-EtSumOff     = CL.EtSumOff
-EtMissOff    = CL.EtMissOff
-JetEtOff     = CL.JetEtOff
-
-
-class ThresholdDef(object):
-
-    @staticmethod
-    def registerThresholds(tc):
-        
-        # MUON
-        ThresholdValue.setDefaults('MUON', {'etamin' : -49,'etamax' : 49, 'phimin' : 0,'phimax' : 64}) # keep this as an example how defaults for groups can be defined
-
-        for thrV in [0, 4, 6, 10, 11, 15, 20, 21]:
-            tc.registerThr('MU%i' % thrV, 'MUON').addThrValue(thrV)
-
-
-        # EM 
-        ThresholdValue.setDefaults('EM',{'isobits' : '00000', 'use_relIso' : True })
-
-        for thrV in [3, 4, 5, 6, 7, 8, 10, 12, 14, 15, 16, 18, 20, 22, 30, 50]:
-            tc.registerThr('EM%i' % thrV, 'EM').addThrValue(thrV)
-
-
-        # for beam splashes:
-        #ThresholdValue.setDefaults('EM', {'etamin' : 16,'etamax' : 20, 'phimin' : 0,'phimax' : 64, 'isobits' : '00000', 'use_relIso' : True })
-        tc.registerThr('EM20A', 'EM').addThrValue(255, priority=1)\
-            .addThrValue(20,16,20,priority=2)
-        
-        #ThresholdValue.setDefaults('EM', {'etamin' : -20,'etamax' : -16, 'phimin' : 0,'phimax' : 64, 'isobits' : '00000', 'use_relIso' : True })
-        tc.registerThr('EM20C', 'EM').addThrValue(255, priority=1)\
-            .addThrValue(20,-20,-16,priority=2)
-
-
-
-        # variable thresholds (V)
-        # hadronic isolation (H) had_isolation=1GeV
-        # em isolation (I)
-
-        # V section
-        
-        tc.registerThr( 'EM50V', type='EM').addThrValue(52, priority=1)\
-                        .addThrValue(51, -12, -8, priority=2).addThrValue(51, 8, 12, priority=2)\
-                        .addThrValue(50, -16, -12, priority=2).addThrValue(50, 12, 16, priority=2)\
-                        .addThrValue(51, -20, -16, priority=2).addThrValue(51, 16, 20, priority=2)
-
-        # VH section
-
-        ThresholdValue.setDefaults('EM', {'isobits' : '00001', 'use_relIso' : True })
-
-        tc.registerThr( 'EM8VH', type='EM').addThrValue(9, priority=1)\
-            .addThrValue(9, -8, 0, priority=2).addThrValue(9, 0, 8, priority=2)\
-            .addThrValue(7, -11, -8, priority=2).addThrValue(7, 8, 11, priority=2)\
-            .addThrValue(6, -14, -11, priority=2).addThrValue(6, 11, 14, priority=2)\
-            .addThrValue(5, -15, -14, priority=2).addThrValue(5, 14, 15, priority=2)\
-            .addThrValue(7, -18, -15, priority=2).addThrValue(7, 15, 18, priority=2)\
-            .addThrValue(8, -25, -18, priority=2).addThrValue(8, 18, 25, priority=2)
-        
-        tc.registerThr( 'EM10VH', type='EM').addThrValue(11, priority=1)\
-            .addThrValue(11, -8, 0, priority=2).addThrValue(11, 0, 8, priority=2)\
-            .addThrValue(9, -11, -8, priority=2).addThrValue(9, 8, 11, priority=2)\
-            .addThrValue(8, -14, -11, priority=2).addThrValue(8, 11, 14, priority=2)\
-            .addThrValue(7, -15, -14, priority=2).addThrValue(7, 14, 15, priority=2)\
-            .addThrValue(9, -18, -15, priority=2).addThrValue(9, 15, 18, priority=2)\
-            .addThrValue(10, -25, -18, priority=2).addThrValue(10, 18, 25, priority=2)
-        
-        tc.registerThr( 'EM13VH', type='EM').addThrValue(15, priority=1)\
-            .addThrValue(15, -7, 0, priority=2).addThrValue(15, 0, 7, priority=2)\
-            .addThrValue(14, -9, -7, priority=2).addThrValue(14, 7, 9, priority=2)\
-            .addThrValue(13, -12, -9, priority=2).addThrValue(13, 9, 12, priority=2)\
-            .addThrValue(12, -14, -12, priority=2).addThrValue(12, 12, 14, priority=2)\
-            .addThrValue(11, -15, -14, priority=2).addThrValue(11, 14, 15, priority=2)\
-            .addThrValue(13, -17, -15, priority=2).addThrValue(13, 15, 17, priority=2)\
-            .addThrValue(14, -25, -17, priority=2).addThrValue(14, 17, 25, priority=2)
-        
-        tc.registerThr( 'EM15VH', type='EM').addThrValue(17, priority=1)\
-            .addThrValue(17, -7, 0, priority=2).addThrValue(17, 0, 7, priority=2)\
-            .addThrValue(16, -9, -7, priority=2).addThrValue(16, 7, 9, priority=2)\
-            .addThrValue(15, -12, -9, priority=2).addThrValue(15, 9, 12, priority=2)\
-            .addThrValue(14, -14, -12, priority=2).addThrValue(14, 12, 14, priority=2)\
-            .addThrValue(13, -15, -14, priority=2).addThrValue(13, 14, 15, priority=2)\
-            .addThrValue(15, -17, -15, priority=2).addThrValue(15, 15, 17, priority=2)\
-            .addThrValue(16, -25, -17, priority=2).addThrValue(16, 17, 25, priority=2)
-        
-        tc.registerThr( 'EM18VH', type='EM').addThrValue(20, priority=1)\
-            .addThrValue(20, -7, 0, priority=2).addThrValue(20, 0, 7, priority=2)\
-            .addThrValue(19, -8, -7, priority=2).addThrValue(19, 7, 8, priority=2)\
-            .addThrValue(18, -11, -8, priority=2).addThrValue(18, 8, 11, priority=2)\
-            .addThrValue(17, -13, -11, priority=2).addThrValue(17, 11, 13, priority=2)\
-            .addThrValue(16, -14, -13, priority=2).addThrValue(16, 13, 14, priority=2)\
-            .addThrValue(15, -15, -14, priority=2).addThrValue(15, 14, 15, priority=2)\
-            .addThrValue(17, -17, -15, priority=2).addThrValue(17, 15, 17, priority=2)\
-            .addThrValue(19, -25, -17, priority=2).addThrValue(19, 17, 25, priority=2)
-        
-        tc.registerThr( 'EM20VH', type='EM').addThrValue(22, priority=1)\
-            .addThrValue(22, -7, 0, priority=2).addThrValue(22, 0, 7, priority=2)\
-            .addThrValue(21, -8, -7, priority=2).addThrValue(21, 7, 8, priority=2)\
-            .addThrValue(20, -11, -8, priority=2).addThrValue(20, 8, 11, priority=2)\
-            .addThrValue(19, -13, -11, priority=2).addThrValue(19, 11, 13, priority=2)\
-            .addThrValue(18, -14, -13, priority=2).addThrValue(18, 13, 14, priority=2)\
-            .addThrValue(17, -15, -14, priority=2).addThrValue(17, 14, 15, priority=2)\
-            .addThrValue(19, -17, -15, priority=2).addThrValue(19, 15, 17, priority=2)\
-            .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)
-
-        tc.registerThr( 'EM22VH', type='EM').addThrValue(24, priority=1)\
-            .addThrValue(24, -7, 0, priority=2).addThrValue(24, 0, 7, priority=2)\
-            .addThrValue(23, -8, -7, priority=2).addThrValue(23, 7, 8, priority=2)\
-            .addThrValue(22, -11, -8, priority=2).addThrValue(22, 8, 11, priority=2)\
-            .addThrValue(21, -13, -11, priority=2).addThrValue(21, 11, 13, priority=2)\
-            .addThrValue(20, -14, -13, priority=2).addThrValue(20, 13, 14, priority=2)\
-            .addThrValue(19, -15, -14, priority=2).addThrValue(19, 14, 15, priority=2)\
-            .addThrValue(21, -17, -15, priority=2).addThrValue(21, 15, 17, priority=2)\
-            .addThrValue(23, -25, -17, priority=2).addThrValue(23, 17, 25, priority=2)
-
-
-
-
-        # I section
-
-        ThresholdValue.setDefaults('EM', {'isobits' : '00010', 'use_relIso' : True })
-
-   
- 
-        for thrV in [8]:
-            tc.registerThr('EM%iI' % thrV, 'EM').addThrValue(thrV)
-
-
-
-        # (V)HI section
-        ThresholdValue.setDefaults('EM', {'isobits' : '00100', 'use_relIso' : True })
-
-        for thrV in [15]:
-            tc.registerThr('EM%iHI' % thrV, 'EM').addThrValue(thrV)
-
-        tc.registerThr( 'EM15VHI', type='EM').addThrValue(17, priority=1)\
-            .addThrValue(17, -7, 0, priority=2).addThrValue(17, 0, 7, priority=2)\
-            .addThrValue(16, -9, -7, priority=2).addThrValue(16, 7, 9, priority=2)\
-            .addThrValue(15, -12, -9, priority=2).addThrValue(15, 9, 12, priority=2)\
-            .addThrValue(14, -14, -12, priority=2).addThrValue(14, 12, 14, priority=2)\
-            .addThrValue(13, -15, -14, priority=2).addThrValue(13, 14, 15, priority=2)\
-            .addThrValue(15, -17, -15, priority=2).addThrValue(15, 15, 17, priority=2)\
-            .addThrValue(16, -25, -17, priority=2).addThrValue(16, 17, 25, priority=2)
-
-        tc.registerThr( 'EM18VHI', type='EM').addThrValue(20, priority=1)\
-            .addThrValue(20, -7, 0, priority=2).addThrValue(20, 0, 7, priority=2)\
-            .addThrValue(19, -8, -7, priority=2).addThrValue(19, 7, 8, priority=2)\
-            .addThrValue(18, -11, -8, priority=2).addThrValue(18, 8, 11, priority=2)\
-            .addThrValue(17, -13, -11, priority=2).addThrValue(17, 11, 13, priority=2)\
-            .addThrValue(16, -14, -13, priority=2).addThrValue(16, 13, 14, priority=2)\
-            .addThrValue(15, -15, -14, priority=2).addThrValue(15, 14, 15, priority=2)\
-            .addThrValue(17, -17, -15, priority=2).addThrValue(17, 15, 17, priority=2)\
-            .addThrValue(19, -25, -17, priority=2).addThrValue(19, 17, 25, priority=2)
-
-
-        tc.registerThr( 'EM20VHI', type='EM').addThrValue(22, priority=1)\
-            .addThrValue(22, -7, 0, priority=2).addThrValue(22, 0, 7, priority=2)\
-            .addThrValue(21, -8, -7, priority=2).addThrValue(21, 7, 8, priority=2)\
-            .addThrValue(20, -11, -8, priority=2).addThrValue(20, 8, 11, priority=2)\
-            .addThrValue(19, -13, -11, priority=2).addThrValue(19, 11, 13, priority=2)\
-            .addThrValue(18, -14, -13, priority=2).addThrValue(18, 13, 14, priority=2)\
-            .addThrValue(17, -15, -14, priority=2).addThrValue(17, 14, 15, priority=2)\
-            .addThrValue(19, -17, -15, priority=2).addThrValue(19, 15, 17, priority=2)\
-            .addThrValue(21, -25, -17, priority=2).addThrValue(21, 17, 25, priority=2)
-
-        tc.registerThr( 'EM22VHI', type='EM').addThrValue(24, priority=1)\
-            .addThrValue(24, -7, 0, priority=2).addThrValue(24, 0, 7, priority=2)\
-            .addThrValue(23, -8, -7, priority=2).addThrValue(23, 7, 8, priority=2)\
-            .addThrValue(22, -11, -8, priority=2).addThrValue(22, 8, 11, priority=2)\
-            .addThrValue(21, -13, -11, priority=2).addThrValue(21, 11, 13, priority=2)\
-            .addThrValue(20, -14, -13, priority=2).addThrValue(20, 13, 14, priority=2)\
-            .addThrValue(19, -15, -14, priority=2).addThrValue(19, 14, 15, priority=2)\
-            .addThrValue(21, -17, -15, priority=2).addThrValue(21, 15, 17, priority=2)\
-            .addThrValue(23, -25, -17, priority=2).addThrValue(23, 17, 25, priority=2)
-        
-        tc.registerThr( 'EM24VHI', type='EM').addThrValue(24, priority=1)\
-            .addThrValue(26, -7, 0, priority=2).addThrValue(26, 0, 7, priority=2)\
-            .addThrValue(25, -8, -7, priority=2).addThrValue(25, 7, 8, priority=2)\
-            .addThrValue(24, -11, -8, priority=2).addThrValue(24, 8, 11, priority=2)\
-            .addThrValue(23, -13, -11, priority=2).addThrValue(23, 11, 13, priority=2)\
-            .addThrValue(22, -14, -13, priority=2).addThrValue(22, 13, 14, priority=2)\
-            .addThrValue(21, -15, -14, priority=2).addThrValue(21, 14, 15, priority=2)\
-            .addThrValue(23, -17, -15, priority=2).addThrValue(23, 15, 17, priority=2)\
-            .addThrValue(25, -25, -17, priority=2).addThrValue(25, 17, 25, priority=2)
-
-        tc.registerThr( 'EM26VHI', type='EM').addThrValue(26, priority=1)\
-            .addThrValue(28, -7, 0, priority=2).addThrValue(28, 0, 7, priority=2)\
-            .addThrValue(27, -8, -7, priority=2).addThrValue(27, 7, 8, priority=2)\
-            .addThrValue(26, -11, -8, priority=2).addThrValue(26, 8, 11, priority=2)\
-            .addThrValue(25, -13, -11, priority=2).addThrValue(25, 11, 13, priority=2)\
-            .addThrValue(24, -14, -13, priority=2).addThrValue(24, 13, 14, priority=2)\
-            .addThrValue(23, -15, -14, priority=2).addThrValue(23, 14, 15, priority=2)\
-            .addThrValue(25, -17, -15, priority=2).addThrValue(25, 15, 17, priority=2)\
-            .addThrValue(27, -25, -17, priority=2).addThrValue(27, 17, 25, priority=2)
-
-        tc.registerThr( 'EM30VHI', type='EM').addThrValue(30, priority=1)\
-            .addThrValue(32, -7, 0, priority=2).addThrValue(32, 0, 7, priority=2)\
-            .addThrValue(31, -8, -7, priority=2).addThrValue(31, 7, 8, priority=2)\
-            .addThrValue(30, -11, -8, priority=2).addThrValue(30, 8, 11, priority=2)\
-            .addThrValue(29, -13, -11, priority=2).addThrValue(29, 11, 13, priority=2)\
-            .addThrValue(28, -14, -13, priority=2).addThrValue(28, 13, 14, priority=2)\
-            .addThrValue(27, -15, -14, priority=2).addThrValue(27, 14, 15, priority=2)\
-            .addThrValue(29, -17, -15, priority=2).addThrValue(29, 15, 17, priority=2)\
-            .addThrValue(31, -29, -17, priority=2).addThrValue(31, 17, 29, priority=2)
-
-        ThresholdValue.setDefaults('EM', {'isobits' : '01000', 'use_relIso' : True })
-        tc.registerThr( 'EM24VHIM', type='EM').addThrValue(24, priority=1)\
-            .addThrValue(26, -7, 0, priority=2).addThrValue(26, 0, 7, priority=2)\
-            .addThrValue(25, -8, -7, priority=2).addThrValue(25, 7, 8, priority=2)\
-            .addThrValue(24, -11, -8, priority=2).addThrValue(24, 8, 11, priority=2)\
-            .addThrValue(23, -13, -11, priority=2).addThrValue(23, 11, 13, priority=2)\
-            .addThrValue(22, -14, -13, priority=2).addThrValue(22, 13, 14, priority=2)\
-            .addThrValue(21, -15, -14, priority=2).addThrValue(21, 14, 15, priority=2)\
-            .addThrValue(23, -17, -15, priority=2).addThrValue(23, 15, 17, priority=2)\
-            .addThrValue(25, -25, -17, priority=2).addThrValue(25, 17, 25, priority=2)
-
-
-
-        tc.registerThr( 'EM3HI', type='EM').addThrValue(3, priority=1)\
-
-        #ThresholdValue.setDefaults('EM', {'etamin' : 16,'etamax' : 20, 'phimin' : 0,'phimax' : 64, 'isobits' : '00000', 'use_relIso' : True })
-        #tc.registerThr('EM20A', 'EM').addThrValue(20)
-        #ThresholdValue.setDefaults('EM', {'etamin' : -20,'etamax' : -16, 'phimin' : 0,'phimax' : 64, 'isobits' : '00000', 'use_relIso' : True })
-        #tc.registerThr('EM20C', 'EM').addThrValue(20)
-
-
-        ThresholdValue.setDefaults('EM', {})
-
-
-        # TAU
-
-        ThresholdValue.setDefaults('TAU',{'isobits' : '00000', 'use_relIso' : True })
-
-        for thrV in [5, 6, 8, 12, 15, 20, 25, 30, 35, 40, 50, 60, 90, 100]:
-            tc.registerThr('HA%i' % thrV, 'TAU').addThrValue(thrV)
-
-        # beam splashes     
-        for thrV in [20]: 
-            tc.registerThr('HA%iA' % thrV, 'TAU').addThrValue(255, priority=1).addThrValue( thrV, etamin = 12,  etamax = 16, priority=2) 
-            tc.registerThr('HA%iC' % thrV, 'TAU').addThrValue(255, priority=1).addThrValue( thrV, etamin = -16,  etamax = -12, priority=2) 
-
-
-#        ThresholdValue.setDefaults('TAU', {'isobits' : '00100', 'use_relIso' : True })
-#        for thrV in [12,20]:
-#            tc.registerThr('HA%iI' % thrV, 'TAU').addThrValue(thrV)
-#
-#        ThresholdValue.setDefaults('TAU', {'isobits' : '00001', 'use_relIso' : True })
-#        for thrV in [12]:
-#            tc.registerThr('HA%iIL' % thrV, 'TAU').addThrValue(thrV)
-
-        ThresholdValue.setDefaults('TAU', {'isobits' : '00001', 'use_relIso' : True })
-        for thrV in [12,20]:
-            tc.registerThr('HA%iIL' % thrV, 'TAU').addThrValue(thrV)
-
-        ThresholdValue.setDefaults('TAU', {'isobits' : '00010', 'use_relIso' : True })
-        for thrV in [12,20,25]:
-            tc.registerThr('HA%iIM' % thrV, 'TAU').addThrValue(thrV)
-
-        ThresholdValue.setDefaults('TAU', {'isobits' : '00100', 'use_relIso' : True })
-        for thrV in [12,20,25]:
-            tc.registerThr('HA%iIT' % thrV, 'TAU').addThrValue(thrV)
-
-        ThresholdValue.setDefaults('TAU', {'isobits' : '01000', 'use_relIso' : True })
-        for thrV in [12,20]:
-            tc.registerThr('HA%iI' % thrV, 'TAU').addThrValue(thrV)
-
-        ThresholdValue.setDefaults('TAU', {})
-            
-            
-        # JET
-        ThresholdValue.setDefaults('JET', {'window' : 8})
-
-        for thrV in [5, 10, 12, 15, 20, 25, 30, 35, 40, 50, 60, 70, 75, 85, 100, 120, 150,175, 250, 400]:
-            tc.registerThr('J%i' % thrV, 'JET').addThrValue(JetOff).addThrValue(thrV, etamin=-31, etamax=31, priority=1) # jets are between -31 and 31 -ATR-11526
-        
-        ThresholdValue.setDefaults('JET', {})
-
-        
-        # JB and JF
-        ThresholdValue.setDefaults('JET', {'window' : 8})
-        
-        #for thrV in [25]:
-        #    tc.registerThr('JF%i' % thrV, 'JET').addThrValue(JetOff).addThrValue( thrV, etamin=31,  etamax=49, priority=1)
-        #    tc.registerThr('JB%i' % thrV, 'JET').addThrValue(JetOff).addThrValue( thrV, etamin=-49, etamax=-31, priority=1)
-
-        # Beam Splashes
-        for thrV in [75]:
-            tc.registerThr('J%iA' % thrV, 'JET').addThrValue(JetOff).addThrValue( thrV, etamin = 16,  etamax = 24, priority=1)
-            tc.registerThr('J%iC' % thrV, 'JET').addThrValue(JetOff).addThrValue( thrV, etamin = -24,  etamax = -16, priority=1)          
-        
-
-        # Central jet
-        for (thrV, etamax) in [(12,23), (12,25), (12,28), (15,25), (17,22), (20,28), (25,23), (35,23), (20,49), (30,49), (40,25), (45,21)]:
-            tc.registerThr('J%ip0ETA%i'  % (thrV, etamax), 'JET').addThrValue(JetOff).addThrValue( thrV, etamin = -etamax,  etamax = etamax, priority=1)  
-
-        # Standard forward jet
-        for thrV in [10, 15, 20, 25, 30, 35, 45, 50, 70, 75, 100]:
-            tc.registerThr('J%ip31ETA49' % thrV, 'JET').addThrValue(JetOff).addThrValue( thrV, etamin=31,  etamax=49, priority=1).addThrValue( thrV, etamin=-49, etamax=-31, priority=1)
-
-        # Custom Forward jet and VBF jets
-        for (thrV, etamin, etamax) in [ (15,23,49), (15,24,49), (20,28,31) ]:
-            tc.registerThr('J%ip%iETA%i' % (thrV, etamin,etamax), 'JET').addThrValue(JetOff).addThrValue( thrV, etamin  =  etamin, etamax=etamax, priority=1).addThrValue( thrV, etamin = -etamax, etamax = -etamin, priority=1)
-
-        ##4x4 jet windows for forward electrons
-        ThresholdValue.setDefaults('JET', {'window' : 4})
-        
-        for thrV in [15]:
-            tc.registerThr('JJ%ip23ETA49' % thrV, 'JET').addThrValue(JetOff).addThrValue( thrV, etamin=23,  etamax=49, priority=1).addThrValue( thrV, etamin=-49, etamax=-23, priority=1)
-
-        ThresholdValue.setDefaults('JET', {})
-
-
-        # ZB
-        tc.registerThr('ZB_EM12', 'ZB', seed='EM12',seed_ttype = 'EM',  seed_multi=1, bcdelay=3564)
-        tc.registerThr('ZB_EM15', 'ZB', seed='EM15',seed_ttype = 'EM',  seed_multi=1, bcdelay=3564)
-        tc.registerThr('ZB_J10',  'ZB', seed='J10', seed_ttype = 'JET', seed_multi=1, bcdelay=3564)
-        # tc.registerThr('ZB_J20',  'ZB', seed='J20', seed_ttype = 'JET', seed_multi=1, bcdelay=3564)
-        tc.registerThr('ZB_J75',  'ZB', seed='J75', seed_ttype = 'JET', seed_multi=1, bcdelay=3564)
-
-
-        # JE
-        ThresholdValue.setDefaults('JE', {'etamin' : -49,'etamax' : 49, 'phimin' : 0,'phimax' : 64,
-                                                       'window' : 8, 'priority': 0})
-
-        for thrV in [100, 140, 200, 300, 350, 500]:
-            tc.registerThr('JE%i' % thrV, 'JE').addThrValue(thrV)
-        
-        # TE
-        for thrV in [0, 3, 5, 10, 15, 20, 25, 30, 40, 45, 50, 55, 60, 65, 70, 90, 100, 120, 140, 160, 200, 280, 300, 360, 2000, 4000, 10000, 12000, 14000]:
-            tc.registerThr('TE%i' % thrV, 'TE').addThrValue(thrV)
-
-        # XE
-        for thrV in [10, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 150, 300]:
-            tc.registerThr('XE%i' % thrV, 'XE').addThrValue(thrV)
-
-        # XS
-        for thrV in [20, 25, 30, 35, 40, 45, 50, 55, 60, 65]:
-            tc.registerThr('XS%i' % thrV, 'XS').addThrValue(thrV)
-
-        # Restricted range TE |eta|<2.4
-        etamax = 24
-        for thrV in [0, 3, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 80, 110, 150, 180, 1000, 2000, 5000, 6500, 8000, 9000]:
-            tc.registerThr('TE%ip0ETA%i' % (thrV, etamax), 'TE').addThrValue(EtSumOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1)
-        
-        # RXE (restriced range ET miss)
-        for thrV in [35, 40, 45, 50, 55, 60, 70, 80]:
-            tc.registerThr('XE%ip0ETA%i'    % (thrV, etamax), 'XE').addThrValue(EtMissOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1) 
-
-        # Restricted range TE |eta|<4.9
-        etamax = 49
-        for thrV in [500, 1500, 3000, 3500, 5000, 6500, 8000, 9000]:
-            tc.registerThr('TE%ip0ETA%i' % (thrV, etamax), 'TE').addThrValue(EtSumOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1)
-
-
-        ##RESTRICTED ETA THRESHOLD FOR TE and XE HAVE TO USE THE SAME ETA RANGE. Only possible for thesholds 8-15
-        #ThresholdValue.setDefaults('TE', {'etamin' : -24,'etamax' : 24, 'priority': 1})
-        #
-        #for  thrV in [(30),]:
-        #    tc.registerThr('TE%i.0ETA24' % (thrV), 'TE').addThrValue(thrV)
-            
-            
-        # CALREQ
-            
-        for i in range(3):
-            tc.registerThr('CAL%i' % i, 'CALREQ', mapping=i).addThrValue(40)
-
-
-        ## MBTS
-
-        # MBTS naming scheme defined in
-        # https://docs.google.com/spreadsheets/d/1R0s8Lw-0nPSjqe9YTuZBCeAdedn_Ve4Ax6bbMe_4bSk/edit#gid=1818891632
-
-        # run 1
-        thresholdA=[ 32.04, 26.98, 35.00, 33.54, 32.08, 36.46, 30.63, 32.08, 33.54, 30.63, 29.17, 33.54, 32.08, 32.08, 30.63, 26.25]
-        thresholdC=[ 55.42, 31.98, 32.81, 49.48, 98.44, 32.11, 32.62, 29.90, 24.06, 25.81, 25.52, 35.00, 27.71, 36.46, 26.25, 30.63]
-
-        # run 2 above MBTS_A08 only the even numbers are used
-        thresholdA=[ 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 100.0, 0.0, 100.0, 0.0, 100.0, 0.0]
-        thresholdC=[ 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 100.0, 0.0, 100.0, 0.0, 100.0, 0.0]
-
-        for i, (vA, vC) in enumerate(zip(thresholdA, thresholdC)):
-            #if(thresholdA[i]!=0):
-            tc.registerThr('MBTS_A%i' % i, 'MBTSSI').addThrValue(thresholdA[i])
-            #if(thresholdC[i]!=0):
-            tc.registerThr('MBTS_C%i' % i, 'MBTSSI').addThrValue(thresholdC[i])
-
-
-        thr_mbtsA = tc.registerThr('MBTS_A', 'MBTS', mapping=0)
-        thr_mbtsC = tc.registerThr('MBTS_C', 'MBTS', mapping=1)
-        for x in range(16):
-            if tc.getRegisteredThreshold('MBTS_A%i' % x):
-                thr_mbtsA.thresholdValues += [ tc.getRegisteredThreshold('MBTS_A%i' % x).thresholdValues[0] ]
-            if tc.getRegisteredThreshold('MBTS_C%i' % x):
-                thr_mbtsC.thresholdValues += [ tc.getRegisteredThreshold('MBTS_C%i' % x).thresholdValues[0] ]
-
-        ## ZDC
-        tc.registerThr('ZDC_A',   'ZDC').addThrValue(250)
-        tc.registerThr('ZDC_C',   'ZDC').addThrValue(250)
-        tc.registerThr('ZDC_AND', 'ZDC').addThrValue(250)
-
-        ## BCM
-        tc.registerThr('BCM_AtoC', 'BCM').addThrValue(40)
-        tc.registerThr('BCM_CtoA', 'BCM').addThrValue(40)
-        tc.registerThr('BCM_Wide', 'BCM').addThrValue(40)
-        tc.registerThr('BCM_Comb', 'BCMCMB').addThrValue(40)
-
-        ## LUCID
-        tc.registerThr('LUCID_A', 'LUCID').addThrValue(650)
-        tc.registerThr('LUCID_C', 'LUCID').addThrValue(650)
-        tc.registerThr('LUCID_Coinc_AC', 'LUCID').addThrValue(650)
-        tc.registerThr('LUCID_COMM', 'LUCID').addThrValue(650)
-        tc.registerThr('LUCID_05', 'LUCID').addThrValue(650)
-        tc.registerThr('LUCID_06', 'LUCID').addThrValue(650)
-
-        ## AFP
-        tc.registerThr('AFP_NSC',     'NIM', mapping=2).addThrValue(50)
-        tc.registerThr('AFP_NSA',     'NIM', mapping=3).addThrValue(50)
-        tc.registerThr('AFP_FSA_SIT', 'NIM', mapping=4).addThrValue(50)
-        tc.registerThr('AFP_FSA_TOF', 'NIM', mapping=5).addThrValue(50)
-        tc.registerThr('AFP_FSA_LOG', 'NIM', mapping=6).addThrValue(50)
-        tc.registerThr('AFP_FSC_SIT', 'NIM', mapping=7).addThrValue(50)
-        tc.registerThr('AFP_FSC_LOG', 'NIM', mapping=8).addThrValue(50)
-        tc.registerThr('AFP_FSC_TOF', 'NIM', mapping=9).addThrValue(50)
-
-        # Diamond beam monitors
-        #for i in range(8):
-        #    tc.registerThr('DBM%i'    % i, 'DBM')
-
-        ## BPTX
-        tc.registerThr('BPTX0', 'BPTX').addThrValue(40)
-        tc.registerThr('BPTX1', 'BPTX').addThrValue(40)
-
-        ## Other NIMs
-        tc.registerThr('NIML1A', 'NIM', mapping=0).addThrValue(40)
-        tc.registerThr('NIMLHCF','NIM', mapping=1).addThrValue(40)
-        tc.registerThr('NIMTGC', 'NIM', mapping=12).addThrValue(40)
-        tc.registerThr('NIMRPC', 'NIM', mapping=13).addThrValue(40)
-        tc.registerThr('NIMTRT', 'NIM', mapping=14).addThrValue(40)
-
-        #for m,i in enumerate([5,6,7,8,14,25,36]):
-        #for m,i in enumerate([5,25]):
-        #    tc.registerThr('NIMDIR%i' % i, 'NIM', mapping=m+2).addThrValue(40)
-        #tc.registerThr('NIMDIR26', 'NIM', mapping=35).addThrValue(40)
-
-
-        # ALFA
-        LUT1offset =  2 # this is needed because the first 4 direct inputs are in a LUT with 8 PITs so the OR with the next inputs would not work
-        LUT2offset =  8
-        LUT3offset = 14
-        LUT4offset = 20
-        LUT5offset = 26
-        for i, alfa in enumerate( ['B7R1L', 'B7R1U', 'A7R1L', 'A7R1U', 'A7L1L', 'A7L1U', 'B7L1L', 'B7L1U'] ):
-            phaseOffset = 32 * (i%2)
-            tc.registerThr('ALFA_%s'    % alfa, 'ALFA', mapping = LUT1offset + i/2 + phaseOffset )
-            tc.registerThr('ALFA2_%s'   % alfa, 'ALFA', mapping = LUT2offset + i/2 + phaseOffset )
-            tc.registerThr('ALFA3_%s'   % alfa, 'ALFA', mapping = LUT3offset + i/2 + phaseOffset )
-            tc.registerThr('ALFA4_%s'   % alfa, 'ALFA', mapping = LUT4offset + i/2 + phaseOffset )
-            tc.registerThr('ALFA_%s_OD' % alfa, 'ALFA', mapping = LUT5offset + i/2 + phaseOffset )
-
-
-
-        # DIRECT INPUTS
-        # all topo inputs are directly set from the L1Topo menu
-        
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/__init__.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/__init__.py
deleted file mode 100644
index d0cb751d0f33..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1Menu/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-#Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigL1Topo.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigL1Topo.py
deleted file mode 100644
index 1b2a6b30061b..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigL1Topo.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-from .L1Topo.L1TopoMenu import L1TopoMenu
-from .L1Topo.L1TopoFlags import L1TopoFlags
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-class TriggerConfigL1Topo(object):
-    
-    def __init__(self, outputFile = None , inputFile = None , menuName = None ):
-        """
-        inputFile: if set the topo menu will be read from this xml file (not yet implemented)
-        outputFile: if no input file is specified the topo menu will be generated and written to outputFile
-        menuName: ignored now
-        """
-        from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-        self.menuName = TriggerConfigL1Topo.getMenuBaseName(TriggerFlags.triggerMenuSetup())
-
-        self.inputFile     = inputFile
-        self.outputFile    = outputFile
-        
-        # all registered algos
-        self.registeredAlgos = {}
-
-        self.runningid=0
-        
-        # menu
-        self.menu = L1TopoMenu(self.menuName)
-        
-        if self.inputFile is not None:
-            """Read menu from XML"""
-            log.error("Menu input is not implemented!!")
-        else:
-            """Build menu from menu name"""
-
-            # defines the menu (algo only for now)
-            self.defineMenu(self.menuName)
-
-            # registers all items ever defined
-            self.registerMenu()
-
-
-    # remove prescale suffixes
-    @staticmethod
-    def getMenuBaseName(menuName):
-        import re 
-        pattern = re.compile(r'_v\d+|DC14')
-        patternPos = pattern.search(menuName)
-        if patternPos:
-            menuName=menuName[:patternPos.end()]
-            if 'run3_v1' in menuName:
-                menuName = 'LS2_v1'
-        else:
-            log.info('Can\'t find pattern to shorten menu name, either non-existent in name or not implemented.')
-        return menuName         
-
-
-
-
-    def registerAlgo(self, algo):
-        """ Add a L1Topo algo to the set of algos which are registered for further use"""
-
-        if algo.name in self.registeredAlgos:
-            raise RuntimeError('L1Topo algo %s is already registered' % algo.name)
-            
-        self.registeredAlgos[algo.name] = algo
-        log.debug("Added in the algo list: %s, ID:%s", algo.name, algo.algoId)
-        return algo
-
-
-
-    def getRegisteredAlgo(self, name):
-        if name in self.registeredAlgos:
-#            print "Returning algo: {0}, ID:{1}, reassigning to {2}" .format(self.registeredAlgos[name].name,self.registeredAlgos[name].algoId,self.runningid )
-#            self.registeredAlgos[name].algoId=self.runningid
-            self.runningid+=1
-            return self.registeredAlgos[name]
-        
-        return None
-
-
-    def findRegisteredSortingAlgoByOutput(self, algo):
-        """returns a list of all sorting algorithms that are needed to
-        produce the required output. Even one missing will raise a runtime exception"""
-        sortingAlgs = []
-        missingOutput = []
-        for requiredInput in algo.inputs:
-            foundOutput = False
-            for name, alg in self.registeredAlgos.items():
-                if type(alg.outputs)==list:
-                    foundOutput = (requiredInput in alg.outputs)
-                else:
-                    foundOutput = (requiredInput == alg.outputs)
-                if foundOutput:
-                    sortingAlgs += [alg]
-                    break
-            if not foundOutput:
-                missingOutput += [(algo.name, requiredInput)]
-        if missingOutput:
-            raise RuntimeError("For some algorithms not all inputs could be found. Missing are: %r" % ["%s <- %s" % (algname, inputname) for (algname, inputname) in missingOutput] )
-        return sortingAlgs
-
-
-    def writeXML(self):
-        """ Writes L1Topo XML file"""
-        if self.outputFile is None:
-            log.warning("Can't write xml file since no name was provided")
-            return
-        FH = open( self.outputFile, mode="wt" )
-        FH.write( self.menu.xml() )
-        FH.close()
-        log.info("Wrote %s ", self.outputFile)
-
-
-    @staticmethod
-    def defineMenu(menuName = None ):
-        """
-        Defines the list if algo names that will be in the menu
-
-        Calls defineMenu() of the correct module 'Menu_<menuname>.py'
-
-        Menu.defineMenu() defines the menu via L1TopoFlags
-        """
-
-        menuName = TriggerConfigL1Topo.getMenuBaseName(menuName)
-        menumodule = __import__('TriggerMenuMT.LVL1MenuConfig.L1TopoMenu.Menu_%s' % menuName, globals(), locals(), ['defineMenu'], 0)
-        menumodule.defineMenu()
-        log.info("%s menu contains %i algos.", menuName, len(L1TopoFlags.algos()))
-        
-
-    def registerMenu(self):
-        """
-        Calls registerTopoAlgos() of the correct module 'TopoalgoDef.py'
-        
-        Has to run AFTER defineMenu
-        """
-        algodefmodule = __import__('TriggerMenuMT.LVL1MenuConfig.L1TopoMenu.TopoAlgoDef', globals(), locals(), ['TopoAlgoDef'], 0)
-        algodefmodule.TopoAlgoDef.registerTopoAlgos(self)
-        log.info("Registered %i algos.", len(self.registeredAlgos))
-
-        
-    def generateMenu(self):
-        """
-        Generates the menu structure from the list of algo names in the L1TopoFlags
-
-        Always to be called after defineMenu()
-        """
-
-        # add the algos to the menu
-        for topooutput in L1TopoFlags.algos():
-            topooutput.algo = self.getRegisteredAlgo(topooutput.algoname)
-            if topooutput.algo is None:
-                raise RuntimeError("L1Topo algo of name '%s' is not defined in L1Topo algo definition file TopoAlgoDef.py." % topooutput.algoname )
-
-            topooutput.sortingAlgos = self.findRegisteredSortingAlgoByOutput(topooutput.algo)
-            #print "For decision alg %s with inputs %r found the following sorting algs %r" % (topooutput.algo.name, topooutput.algo.inputs, [x.name for x in topooutput.sortingAlgos])
-            self.menu += topooutput
-
-
-        if not self.menu.check():
-            raise RuntimeError("Menu check failed")
-
-
-        
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigLVL1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigLVL1.py
deleted file mode 100644
index 6f4a6674a221..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/TriggerConfigLVL1.py
+++ /dev/null
@@ -1,390 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-import re
-
-from .TriggerConfigL1Topo import TriggerConfigL1Topo
-from .LVL1.Lvl1Menu import Lvl1Menu
-from .LVL1.Lvl1Flags import Lvl1Flags
-
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-class TriggerConfigLVL1(object):
-
-    current = None
-    def __init__(self, outputFile = None , inputFile = None , menuName = None , topoMenu = "MATCH" ):
-        """
-        menuName: if None taken from TF.triggerMenuSetup, otherwise assume externally defined menu
-        topoMenu: MATCH means that the L1Topo menu matches the L1 menu
-        """
-        TriggerConfigLVL1.current = self
-
-        from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-        self.menuName = TriggerFlags.triggerMenuSetup() if menuName is None else menuName
-
-        self.inputFile     = inputFile
-        self.outputFile    = outputFile
-        self.topoMenu      = topoMenu
-        self.l1menuFromXML = None # flag if l1menu is read from XML file
-
-        # all registered items
-        self.registeredItems = {}
-        
-        # all registered thresholds
-        self.registeredThresholds = {}
-
-        # get L1Topo trigger line connections
-        if topoMenu=="MATCH":
-            topoMenu = self.menuName # topo menu name should match CTP menu for correct connection
-        if topoMenu is not None:
-            self.topotriggers = self.getL1TopoTriggerLines(topoMenu)
-            self.registerAllTopoTriggersAsThresholds()
-
-
-        # menu
-        self.menu = Lvl1Menu(self.menuName)
-
-        if self.inputFile is not None:
-            """Read menu from XML"""
-            self.l1menuFromXML = True
-            self.menu.readMenuFromXML(self.inputFile)
-        elif menuName is None:
-            """Build menu from menu name"""
-            # defines the menu (item and threshold names)
-            TriggerConfigLVL1.defineMenu(self.menuName)
-
-            # registers all items ever defined
-            self.registerMenu()
-
-
-    ## L1 Topo connection
-    def getL1TopoTriggerLines(self, menu):
-        if menu is None:
-            return None
-
-        if menu.endswith(".xml"):
-            raise RuntimeError("Can't read the topo trigger lines from xml yet")
-
-        else:
-            triggerLines = None
-            try:
-                tpcl1 = TriggerConfigL1Topo()
-                tpcl1.generateMenu()
-                triggerLines = tpcl1.menu.getTriggerLines()
-
-            except Exception as ex:
-                log.warning("Topo menu generation inside L1 menu failed, but will be ignored for the time being: %s", ex)
-                import traceback
-                traceback.print_exc()
-
-            return triggerLines
-
-            
-    ## Thresholds
-    def registerThr(self, name, type, mapping=-1, active=1,
-                    seed='', seed_ttype='', seed_multi=0, bcdelay=0 ):
-        """
-        Add LVL1 thresholds with the given type and mapping and store
-        it in the list of available thresholds.
-
-        The cable input information will be calculated from type and
-        mapping.
-
-        Seed, seed_ttype, seed_multi and bcdelay are for the zero bias
-        trigger only.
-        """
-
-        if name in self.registeredThresholds:
-            log.error("LVL1 threshold of name '%s' already registered, will ignore this new registration request", name)
-            return self.registeredThresholds[name]
-
-        from .LVL1.Lvl1Thresholds import LVL1Threshold
-        thr = LVL1Threshold( name, type,
-                             mapping = mapping, active = active,
-                             seed_type = seed_ttype, seed = seed, seed_multi = seed_multi, bcdelay = bcdelay
-                             )
-
-        self.registeredThresholds[name] = thr
-        return thr
-
-
-    def registerAllTopoTriggersAsThresholds(self):
-        """
-        Add all L1Topo triggers as allowed input to the menu
-        """
-        if not self.topotriggers:
-            return
-        
-        from .LVL1.Lvl1Thresholds import LVL1TopoInput
-        from collections import defaultdict
-
-        multibitTopoTriggers = defaultdict(list)
-        multibitPattern = re.compile(r"(?P<line>.*)\[(?P<bit>\d+)\]")
-        for triggerline in self.topotriggers:
-            m = multibitPattern.match(triggerline.trigger) # tries to match "trigger[bit]"
-            if m:
-                multibitTopoTriggers[m.groupdict()['line']] += [triggerline]  # multibit triggerlines are temporarilty stored in multibitTopoTriggers
-            else:
-                thr = LVL1TopoInput( triggerline )
-                thr.setCableInput()
-                self.registeredThresholds[thr.name] = thr
-
-        # create thresholds from topo-multibit 
-        for multibitTriggerlines in multibitTopoTriggers.values():
-            thr = LVL1TopoInput( multibitTriggerlines )
-            thr.setCableInput()
-            self.registeredThresholds[thr.name] = thr
-
-
-
-            
-    def getRegisteredThreshold(self, name):
-        if name in self.registeredThresholds:
-            return self.registeredThresholds[name]
-        return None
-    
-
-    ## Items
-    def registerItem(self, name, item):
-        """ Adds a LVL1 item to the set of items which are registered for further use"""
-        if name in self.registeredItems:
-            log.error('LVL1 item %s is already registered with ctpid=%d',
-                      name, int(self.registeredItems[name].ctpid))
-        else:
-            self.registeredItems[name] = item
-
-    def getRegisteredItem(self, name):
-        if name in self.registeredItems:
-            return self.registeredItems[name]
-        return None
-
-
-    def CTPInfo(self):
-        return self.menu.CTPInfo
-
-
-    def Lvl1CaloInfo(self):
-        return self.menu.CaloInfo
-
-
-    def writeXML(self):
-        """
-        Writes L1 XML file
-        returns the file name
-        """
-        if self.outputFile is None:
-            log.warning("Can't write xml file since no name was provided")
-            return
-
-        from .LVL1.Lvl1MenuUtil import idgen
-        idgen.reset()
-
-        FH = open( self.outputFile, mode="wt" )
-        FH.write( self.menu.xml() )
-        FH.close()
-        from .LVL1.Lvl1MenuUtil import oldStyle
-        log.info("Wrote %s in %s", self.outputFile, "run 1 style" if oldStyle() else "run 2 style")
-        return self.outputFile
-
-
-
-    @staticmethod
-    def defineMenu(menuName = None ):
-        """
-        Defines the list if item and threshold names that will be in the menu
-
-        Calls defineMenu() of the correct module 'Menu_<menuname>.py'
-
-        Menu.defineMenu() defines the menu via Lvl1Flags
-        """
-
-        from TriggerJobOpts.TriggerFlags import TriggerFlags
-        if not menuName:
-            menuName = TriggerFlags.triggerMenuSetup()
-
-        menuName=TriggerConfigL1Topo.getMenuBaseName(menuName)
-        menumodule = __import__('TriggerMenuMT.LVL1MenuConfig.LVL1Menu.Menu_%s' % menuName, globals(), locals(), ['defineMenu'], 0)
-        menumodule.defineMenu()
-        log.info("menu %s contains %i items and %i thresholds", menuName, len(Lvl1Flags.items()), len(Lvl1Flags.thresholds()))
-
-
-
-    def registerMenu(self):
-        """
-        Registers the list if items and thresholds that could be used in the menu of Run1
-
-        Calls registerItem() of the correct module 'ItemDef.py' or 'ItemDefRun1.py'
-
-        Has to run AFTER defineMenu
-        """
-
-        run1 = Lvl1Flags.CTPVersion()<=3
-
-        itemdefmodule = __import__('TriggerMenuMT.LVL1MenuConfig.LVL1Menu.ItemDef%s' % ('Run1' if run1 else ''), globals(), locals(), ['ItemDef'], 0)
-
-        itemdefmodule.ItemDef.registerItems(self)
-        log.info("registered %i items and %i thresholds (%s)", len(self.registeredItems), len(self.registeredThresholds), ('Run 1' if run1 else 'Run 2'))
-
-
-
-    def generateMenu(self):
-        """
-        Generates the menu structure from the list of item and threshold names in the Lvl1Flags
-
-        To be called after defineMenu()
-        """
-
-        if self.l1menuFromXML:
-            log.info("Menu was read from input file '%s', generateMenu() will not run", self.inputFile)
-            return
-
-        # build list of items for the menu from the list of requested names
-        itemsForMenu = []
-
-        for itemName in Lvl1Flags.items():
-            registeredItem = self.getRegisteredItem(itemName)
-            if registeredItem is None:
-                log.fatal("LVL1 item '%s' has not been registered in LVL1Menu/ItemDef.py", itemName)
-                raise RuntimeError("LVL1 item %s has not been registered in LVL1Menu/ItemDef.py" % itemName)
-
-            if itemName in Lvl1Flags.CtpIdMap():
-                newCTPID = Lvl1Flags.CtpIdMap()[itemName]
-                registeredItem.setCtpid(newCTPID)
-
-            itemsForMenu += [ registeredItem ]
-
-        # pre-assigned ctpIDs (as integer values)
-        assigned_ctpids = [item.ctpid for item in itemsForMenu]
-
-        # CTP IDs available for assignment
-        from .LVL1.Limits import Limits
-        available_ctpids = sorted( list( set(range(Limits.MaxTrigItems)) - set(assigned_ctpids) ) )
-        available_ctpids.reverse()
-
-        # add the items to the menu
-        from .LVL1.TriggerTypeDef import TT
-        for item in itemsForMenu:
-            # set the physics bit
-            if not item.name.startswith('L1_CALREQ'):
-                item.setTriggerType( item.trigger_type | TT.phys )
-            # assign ctp IDs to items that don't have one
-            if item.ctpid == -1:
-                item.setCtpid( available_ctpids.pop() )
-            # add the items into the menu
-            self.menu.addItem( item )
-
-        # printout
-        for item in self.menu.items:
-            if item.verbose:
-                log.info(str(item))
-
-        # add the thresholds to the menu
-        undefined_thr = False
-        list_of_undefined_thresholds = []
-        for index, thresholdName in enumerate(Lvl1Flags.thresholds()):
-                        
-            if thresholdName in self.menu.thresholds:
-                continue
-            threshold = self.getRegisteredThreshold(thresholdName)
-            if threshold is None and not thresholdName=="":
-                log.error('Threshold %s is listed in menu but not defined', thresholdName )
-                undefined_thr = True
-                list_of_undefined_thresholds += [ thresholdName ]
-            else:
-                self.menu.addThreshold( threshold )
-        if undefined_thr:
-            raise RuntimeError("Found undefined threshold in menu %s, please add these thresholds to l1menu/ThresholdDef.py: %s" % (self.menu.menuName, ', '.join(list_of_undefined_thresholds)) )
-                
-        # threshold mapping
-        self.mapThresholds()
-
-        # ZB thresholds on the right connectors
-        self.assignZeroBiasConnectors()
-
-        # add the counters to the menu
-        self.menu.addCounters()
-
-        # update the prescales that are not 1
-        self.updateItemPrescales()
-
-        # other menu information
-        self.setCTPInfo()
-        self.setCaloInfo()
-
-        # final consistency check
-        self.menu.checkL1()
-
-
-
-    def mapThresholds(self):
-        """
-        Set the correct mapping of thresholds according to the
-        order it was given in Lvl1Flags.thresholds list. That list
-        is usually defined in the setupMenu function of each menu
-
-        NIM and CALREQ types are not remapped !!
-        """
-        existingMappings = {}
-        for thr in self.menu.thresholds():
-            if thr.ttype not in existingMappings:
-                existingMappings[thr.ttype] = set()
-            if thr.mapping<0:
-                continue
-            existingMappings[thr.ttype].add(thr.mapping)
-
-        nextFreeMapping = {}
-        for k in  existingMappings:
-            nextFreeMapping[k] = 0
-
-        for thr in self.menu.thresholds():
-            if thr.mapping < 0:
-                while nextFreeMapping[thr.ttype] in existingMappings[thr.ttype]:
-                    nextFreeMapping[thr.ttype] += 1
-                log.debug('Setting mapping of threshold %s as %i', thr, nextFreeMapping[thr.ttype])
-                thr.mapping = nextFreeMapping[thr.ttype]
-                nextFreeMapping[thr.ttype] += 1
-
-            thr.setCableInput()
-
-
-    def assignZeroBiasConnectors(self):
-        from collections import Counter
-        from copy import copy
-        c = Counter()
-        for thr in self.menu.thresholds:
-            if thr.ttype=="ZB":
-                if thr.seed not in self.menu.thresholds:
-                    raise RuntimeError("Zero bias threshold '%s' based on non-existing threshold '%s'" % (thr,thr.seed) )
-                seed = self.menu.thresholds.thresholdOfName(thr.seed) # the ZB seed
-                thr.cableinfo = copy(seed.cableinfo)
-                thr.cableinfo.bitnum      = 1
-                thr.cableinfo.range_begin = 30
-                thr.cableinfo.range_end   = 30
-                c += Counter( ((thr.cableinfo.slot,thr.cableinfo.connector),) ) 
-        
-        if len(c)>0 and sorted(c.values())[-1]>1:
-            for k,v in c.items():
-                if v>1:
-                    log.error("Slot %i, connector %i has more than one ZB threshold", k)
-            raise RuntimeError("Multiple zero bias thresholds on single connector")
-            
-
-            
-    def updateItemPrescales(self):
-        for (it_name, ps) in Lvl1Flags.prescales().items():
-            item = self.menu.getItem(it_name)
-            if item:
-                item.prescale = ps
-            else:
-                log.warning('Cannot find item %s to set the prescale', it_name )
-
-
-    def setCTPInfo(self):
-        self.menu.CTPInfo.bunchGroupSet.setDefaultBunchGroupDefinition()
-
-        
-    def setCaloInfo(self):
-        from .LVL1Menu.CaloDef import CaloDef
-        CaloDef.defineGlobalSettings(self)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/TriggerAPI/TriggerDataAccess.py b/Trigger/TriggerCommon/TriggerMenuMT/python/TriggerAPI/TriggerDataAccess.py
index f2d430fa8798..a38a4baca02e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/TriggerAPI/TriggerDataAccess.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/TriggerAPI/TriggerDataAccess.py
@@ -304,7 +304,7 @@ def getHLTmap_fromTM(period, release):
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
     from TriggerJobOpts.TriggerFlags import TriggerFlags
     TriggerFlags.triggerMenuSetup = menu
-    TriggerFlags.readLVL1configFromXML = True
+    TriggerFlags.readLVL1configFromXML = False
     TriggerFlags.outputLVL1configFile = None
     
     mutelog = logging.getLogger(__name__)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuMT.sh b/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuMT.sh
deleted file mode 100755
index 767d93f15fd7..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuMT.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/env sh
-# Script to generate the trigger LVL1 menu XML files
-# Based on TriggerMenuXML/XMLDumperFromAthena.sh
-
-help() {
-    echo "Syntax: generateL1MenuMT.sh [-r VERSION] MENU [DEST]"
-}
-
-if [ $# -lt 1 ]; then
-    help
-    exit 0
-fi
-
-while true; do
-    case "$1" in
-        -r)
-            release=$2
-            shift 2
-            ;;
-        -h)
-            help
-            exit 0
-            ;;
-        -*)
-            echo "Invalid parameter"
-            exit 1
-            ;;
-        *)
-            break
-    esac
-done
-
-#if [ -z ${PYTHONDONTWRITEBYTE+x} ]; then export PYTHONDONTWRITEBYTECODE=1; fi # don't write .pyc files, keep source directory clean
-
-menu=$1
-dest=$2
-if [ -z "$dest" ]; then
-    dest=$PWD
-fi
-
-# Get absolute path name
-dest=`cd $dest; pwd`
-
-if [ -z "$release" ]; then
-    release=${AtlasVersion}    # for interactive use
-fi
-
-# Temporary run directroy and cleanup traps in case of termination
-rundir=`mktemp -t -d tmxml.${menu}.XXXXXXXXXX`
-
-TRAPINT() {
-    rm -rf $rundir
-    return 130 # 128+SIGINT
-}
-TRAPTERM() {
-    rm -rf $rundir
-    return 143 # 128+SIGTERM
-}
-
-
-## menu generation starts here
-echo "generateL1MenuMT: Building menu: ${menu} for ${release}"
-
-logfilelvl1=lvl1_${menu}.log
-
-cd $rundir
-
-generateLVL1MenuMT.py   $menu 2>&1 >> $logfilelvl1 
-
-cp L*.xml ${dest}
-cp $logfilelvl1 ${dest}
-
-if [[ -e outputLVL1config.xml ]]; then
-    cp outputLVL1config.xml ${dest}/LVL1config_${menu}_${release}.xml
-fi
-
-#this gives some more sensitivity to hidden problems
-grep --colour ERROR ${dest}/$logfile/*.log
-grep --colour -A 100 "Shortened traceback" ${dest}/$logfile/*.log
-
-rm -rf $rundir
-
-# Do not return real athena exit code as we want to pretend everything was fine
-#unset PYTHONDONTWRITEBYTECODE
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuRun3.py b/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuRun3.py
index afafea319a73..c368b1695f7c 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuRun3.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateL1MenuRun3.py
@@ -1,6 +1,6 @@
 #!/bin/env python
 
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 import sys
 
@@ -74,6 +74,10 @@ def main():
 
     cmdline = parseCmdLine(possibleMenus = availableMenus.keys())
 
+    # Make sure output directory exists
+    from pathlib import Path
+    Path(cmdline.dest).mkdir(parents=True, exist_ok=True)
+
     if cmdline.menu.lower() in availableMenus:
         menu = availableMenus[cmdline.menu.lower()]
         if not isinstance(menu,list):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateLVL1MenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateLVL1MenuMT.py
deleted file mode 100755
index 4448c069100d..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateLVL1MenuMT.py
+++ /dev/null
@@ -1,210 +0,0 @@
-#!/bin/env python
-
-# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-
-import sys,os
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags as TF
-from TriggerMenuMT.LVL1MenuConfig.TriggerConfigLVL1 import TriggerConfigLVL1
-from TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1Flags import Lvl1Flags
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger("generateLVL1MenuMT")
-
-def generateL1Menu(menu):
-    # what menu to build
-    TF.triggerMenuSetup = menu
-
-    # TPC for L1
-    tpcl1 = TriggerConfigLVL1( outputFile = TF.outputLVL1configFile() )
-
-    # build the menu structure
-    tpcl1.generateMenu()
-
-    # write xml file
-    outfilename = tpcl1.writeXML()
-
-    # consistency checker
-    checkResult = os.system("get_files -xmls -symlink LVL1config.dtd > /dev/null")
-    checkResult = os.system("xmllint --noout --dtdvalid LVL1config.dtd %s" % outfilename)
-    if checkResult == 0:
-        log.info("XML file %s is conform with LVL1config.dtd", outfilename)
-    else:
-        log.error("The XML does not follow the document type definition LVL1config.dtd")
-        
-    return tpcl1.menu
-
-
-def readL1MenuFromXML(menu):
-    tpcl1 = TriggerConfigLVL1( inputFile = menu, outputFile = "test.xml" )
-    tpcl1.writeXML()
-    return tpcl1.menu
-
-
-def findUnneededRun2():
-    from TriggerJobOpts.TriggerFlags import TriggerFlags as TF
-    from TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1Flags import Lvl1Flags
-    
-    menus = ['Physics_pp_v6']
-
-    for menu in menus:
-        TF.triggerMenuSetup = menu
-        tpcl1 = TriggerConfigLVL1()
-
-        log.info(set(tpcl1.registeredItems.keys()) - set(Lvl1Flags.items()))
-
-
-def findUnneededRun1(what="items"):
-    
-    from pickle import load
-    f = open("L1Items.pickle","r")
-    [menus,allItems,allThrs] = load(f)
-
-    # the TPC for L1
-    tpcl1 = TriggerConfigLVL1( outputFile = TF.outputLVL1configFile() )
-
-    if what=="items":
-        unneeded = sorted(list(set( tpcl1.registeredItems.keys() ) - allItems))
-    else:
-        unneeded = sorted(list(set( tpcl1.registeredThresholds.keys() ) - allThrs))
-
-    log.info("==> unneeded %s:%d", what, len(unneeded))
-
-    import re
-    p = re.compile('.*$')
-
-    log.info([x for x in unneeded if p.match(x)])
-
-def findFreeCTPIDs(menu):
-    from pickle import load
-    f = open("L1Items.pickle","r")
-    [menus,allItems,allThrs] = load(f)
-
-    TF.triggerMenuSetup = menu
-    tpcl1 = TriggerConfigLVL1( outputFile = TF.outputLVL1configFile() )  # noqa: F841
-
-    log.info(set(Lvl1Flags.CtpIdMap().keys()) - allItems)
-
-
-    
-def main():
-    printCabling = False
-    for arg in sys.argv:
-        if arg.lower().startswith("cab"):
-            printCabling = True
-
-    if len(sys.argv)==1:
-        
-        generateL1Menu(menu="LS2_v1" )
-        generateL1Menu(menu="Physics_pp_run3_v1" )
-        generateL1Menu(menu="PhysicsP1_pp_run3_v1" )
-        generateL1Menu(menu="MC_pp_run3_v1" )
-        generateL1Menu(menu="Cosmic_run3_v1")
-        generateL1Menu(menu="Dev_HI_run3_v1" )
-        generateL1Menu(menu="PhysicsP1_HI_run3_v1" )
-
-        return 0
- 
-
-    if sys.argv[1].endswith(".xml"):
-        readL1MenuFromXML(sys.argv[1])
-        return 0
-    
-    if sys.argv[1].lower().startswith("physics_pp_run3_v1"):
-        menu = generateL1Menu(menu="Physics_pp_run3_v1")
-        menu.printCabling()
-        return 0
-
-    if sys.argv[1].lower().startswith("physicsp1_pp_run3_v1"):
-        menu = generateL1Menu(menu="PhysicsP1_pp_run3_v1")
-        menu.printCabling()
-        return 0
-
-    if sys.argv[1].lower().startswith("mc_pp_run3_v1"):
-        menu = generateL1Menu(menu="MC_pp_run3_v1")
-        menu.printCabling()
-        return 0
-
-    if sys.argv[1].lower().startswith("physicsp1_hi_run3_v1"):
-        menu = generateL1Menu(menu="PhysicsP1_HI_run3_v1")
-        menu.printCabling()
-        return 0
-
-    if sys.argv[1].lower().startswith("dev_hi_run3_v1"):
-        menu = generateL1Menu(menu="Dev_HI_run3_v1")
-        menu.printCabling()
-        return 0
-
-    if sys.argv[1].lower().startswith("phy6"):
-        menu = generateL1Menu(menu="Physics_pp_v6")
-        if printCabling:
-            menu.printCabling()
-        return 0
-
-    if sys.argv[1].lower().startswith("phy7"):
-        menu = generateL1Menu(menu="Physics_pp_v7")
-        if printCabling:
-            menu.printCabling()
-        return 0
-    
-    if sys.argv[1].lower().startswith("mc6"):
-        menu = generateL1Menu(menu="MC_pp_v6")
-        if printCabling:
-            menu.printCabling()
-        return 0
-
-    if sys.argv[1].lower().startswith("mc7"):
-        menu = generateL1Menu(menu="MC_pp_v7")
-        if printCabling:
-            menu.printCabling()
-        return 0
-
-
-    if sys.argv[1].lower().startswith("mc4"):
-        generateL1Menu(menu="MC_pp_v4")
-        return 0
-
-    if sys.argv[1].lower().startswith("mc"):
-        generateL1Menu(menu="MC_pp_v6")
-        return 0
-
-    if sys.argv[1].lower().startswith("mcp"):
-        generateL1Menu(menu="MC_pp_v6_no_prescale")
-        generateL1Menu(menu="MC_pp_v6_loose_mc_prescale")
-        generateL1Menu(menu="MC_pp_v6_tight_mc_prescale")
-        return 0
-
-    if sys.argv[1].lower().startswith("ls"):
-        menu = generateL1Menu(menu="LS2_v1")
-        menu.printCabling()
-        return 0
-
-    if sys.argv[1].lower().startswith("cosmic"):
-        menu = generateL1Menu(menu="Cosmic_run3_v1")
-        menu.printCabling()
-        return 0
-
-    if sys.argv[1].lower().startswith("dc14"):
-        generateL1Menu(menu="DC14")
-        return 0
-
-    if sys.argv[1].lower().startswith("hiphy"):
-        generateL1Menu(menu="Physics_HI_v3")
-        return 0
-
-    if sys.argv[1].lower().startswith("himc"):
-        generateL1Menu(menu="MC_HI_v3")
-        return 0
-    
-    if sys.argv[1].lower().startswith("hipphy"):
-        generateL1Menu(menu="Physics_HI_v4")
-        return 0
-
-    if sys.argv[1].lower().startswith("hipmc"):
-        generateL1Menu(menu="MC_HI_v4")
-        return 0    
-
-if __name__=="__main__":
-    sys.exit( main() )
-        
-        
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigCompareOldandNewL1Menus.py b/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigCompareOldandNewL1Menus.py
deleted file mode 100755
index 2cbedbb8cddb..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigCompareOldandNewL1Menus.py
+++ /dev/null
@@ -1,647 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-
-# this script is to help find differences between the old (xml) and new (json) L1 menus
-# it also checks inputs of to the HLT and if they are available in L1
-
-# this helps with the consistent transition from old to new L1 menu. It should be 
-# deleted once we have concluded this transition
-
-import sys
-import xml.etree.cElementTree as ET
-from collections import namedtuple
-from itertools import chain
-from copy import deepcopy
-
-from AthenaCommon.Logging import logging, Constants
-log = logging.getLogger("TestMenuMigration")
-log.setLevel(Constants.DEBUG)
-from TrigConfIO.L1TriggerConfigAccess import L1MenuAccess
-from TrigConfIO.HLTTriggerConfigAccess import HLTMenuAccess
-
-class bcolors:
-    HEADER = '\033[95m'
-    OKBLUE = '\033[94m'
-    OKGREEN = '\033[92m'
-    WARNING = '\033[93m'
-    FAIL = '\033[91m'
-    ENDC = '\033[0m'
-    BOLD = '\033[1m'
-    UNDERLINE = '\033[4m'
-
-def boolStr(bval):
-    return f"{bcolors.BOLD}{bcolors.OKBLUE}pass{bcolors.ENDC}" if bval else f"{bcolors.BOLD}{bcolors.FAIL}fail{bcolors.ENDC}"
-
-
-def _liststr(arg):
-    if type(arg) == list:
-        return ','.join(arg)
-    return arg
-
-class MenuComp:
-    def __init__(self, files ):
-
-        self.fn_r22_l1_json = None
-        self.fn_r22_l1_xml  = None
-        self.fn_r22_hlt     = None
-        self.fn_r22_topo    = None
-        self.fn_r211_topo   = None
-        self.check = [True]
-
-        for fileName in files:
-            if fileName.endswith(".json"):
-                if fileName.startswith("L1"):
-                    self.fn_r22_l1_json = fileName
-                else:
-                    self.fn_r22_hlt = fileName
-            elif fileName.endswith(".xml"):
-                if fileName.startswith("L1Topo"):                
-                    if "smk" in fileName.lower(): # EB run configuration => r21.1
-                        self.fn_r211_topo = fileName
-                    elif '22.0' in fileName: # r22
-                        self.fn_r22_topo = fileName
-                else:
-                    if '22.0' in fileName:
-                        self.fn_r22_l1_xml = fileName
-
-        self.r22_l1_json = L1MenuAccess(self.fn_r22_l1_json) if self.fn_r22_l1_json else None
-        self.r22_l1_xml  = ET.parse(self.fn_r22_l1_xml).getroot() if self.fn_r22_l1_xml else None
-        self.r22_hlt     = HLTMenuAccess(self.fn_r22_hlt) if self.fn_r22_hlt else None
-        self.r22_topo    = ET.parse(self.fn_r22_topo).getroot() if self.fn_r22_topo else None
-        self.r211_topo   = ET.parse(self.fn_r211_topo).getroot() if self.fn_r211_topo else None
-        log.info("Release 22 L1 Menu      : %s", self.fn_r22_l1_json)
-        log.info("Release 22 L1 Menu (xml): %s", self.fn_r22_l1_xml )
-        log.info("Release 22 HLT Menu     : %s", self.fn_r22_hlt    )
-        log.info("Release 22 L1Topo       : %s", self.fn_r22_topo   )
-        log.info("Release 21.1 L1Topo     : %s", self.fn_r211_topo  )
-
-    def compareCTPIN(self):
-        if self.r22_l1_xml is None or self.r22_l1_json is None: 
-            return
-        log.info("Comparing the CTPIN inputs in r21.1 and r22")
-        log.info("===========================================")
-        # CHECK 1: all CTPIN thresholds must be migrated        
-        THR = namedtuple("THR", "conn, firstbit, nbits, thrtype, mapping, name")
-        ctpinThresholdsXML = []
-        for thr in self.r22_l1_xml.find("TriggerThresholdList").iterfind("TriggerThreshold"):
-            if "AFP" in thr.attrib["name"]:
-                continue # AFP thresholds have been already updated for Run3
-            if thr.attrib['input'] != 'ctpin':
-                continue
-            cable = thr.find("Cable")
-            if cable.attrib["name"] == 'MUCTPI':
-                continue
-            signal = cable.find("Signal")
-            ctpinThresholdsXML += [ THR( name = thr.attrib["name"], thrtype = thr.attrib["type"], mapping = int(thr.attrib["mapping"]),
-                                         conn = cable.attrib["name"], firstbit = int(signal.attrib["range_begin"]), 
-                                         nbits = int(signal.attrib["range_end"]) - int(signal.attrib["range_begin"]) + 1) ]
-        ctpinThresholdsJSON = []
-        for connName,connDef in self.r22_l1_json.connectors().items():
-            if connDef['type'] != 'ctpin':
-                continue
-            allThresholds = self.r22_l1_json.thresholds()
-            thr2typeMap = {}
-            for thrType in self.r22_l1_json.thresholdTypes():
-                for thr in self.r22_l1_json.thresholds(thrType):
-                    thr2typeMap[thr] = thrType
-            for tl in connDef['triggerlines']:
-                thrName = tl['name']
-                if "AFP" in thrName:
-                    continue  # AFP thresholds have been already updated for Run3
-                thr = allThresholds[thrName]
-                ctpinThresholdsJSON += [  THR( name = thrName, thrtype = thr2typeMap[thrName], mapping = thr["mapping"],
-                                               conn = connName, firstbit = tl['startbit'], nbits = tl['nbits']) ]
-        onlyInXML = sorted(set(ctpinThresholdsXML) - set(ctpinThresholdsJSON))
-        onlyInJSON = sorted(set(ctpinThresholdsJSON) - set(ctpinThresholdsXML))
-        cc = len(self.check)
-        self.check += [ len(onlyInXML) + len(onlyInJSON) ==0 ]
-        log.info("CHECK %i: all ctpin inputs (except MUCTPI) must be correctly migrated from xml to json: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            if len(onlyInXML)>0:
-                log.debug("These %i ctpin inputs have not been (correctly) migrated" , len(onlyInXML))
-                for x in onlyInXML:
-                    log.debug("    %s", x)
-            if len(onlyInJSON)>0:
-                log.debug("These %i ctpin inputs are new" , len(onlyInJSON))
-                for x in onlyInJSON:
-                    log.debug("    %s", x)
-                
-        #for x in onlyInXML:
-        #print("In XML %i" % len(ctpinThresholdsXML))
-        #print("In JSON %i" % len(ctpinThresholdsJSON))
-        #for i,x in enumerate(ctpinThresholdsXML):
-        #    print(f"{i}: {x}")
-        #for i,x in enumerate(ctpinThresholdsJSON):
-        #    print(f"{i}: {x}")
-        #for i,x in enumerate(onlyInXML):
-        #    print(f"{i}: {x}")
-
-
-
-    def compareL1MenusXMLwithJSON(self):
-        if self.r22_l1_xml is None or self.r22_l1_json is None: 
-            return
-        l1items_xml  = self.r22_l1_xml.find("TriggerMenu").findall("TriggerItem")
-        l1items_json = self.r22_l1_json.items()
-        log.info("Comparing the r22-xml and r22-json")
-        log.info("==================================")
-
-        itemNames_xml = [x.attrib['name'] for x in l1items_xml]
-        itemNames_json = l1items_json.keys()
-        ids_xml = dict([ (x.attrib['name'],int(x.attrib['ctpid'])) for x in l1items_xml])
-        ids_json = dict([ (x['name'],x['ctpid']) for x in l1items_json.values()])
-
-        # CHECK 1: All items migrated
-        itemNamesNoTopo_xml = []
-        for x in itemNames_xml:
-            if "-" not in x:
-                itemNamesNoTopo_xml += [x]  # no need to check legacy L1Topo
-        itemsOnlyInXML =  list( set(itemNamesNoTopo_xml) - set(itemNames_json) )
-        cc = len(self.check)
-        self.check += [ len(itemsOnlyInXML)==0 ]
-        log.info("CHECK %i: All items from r22 xml must be migrated: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            log.debug("These %i legacy items are not migrated:", len(itemsOnlyInXML))
-            for x in itemsOnlyInXML:
-                log.debug("    %s", x)
-
-        # CHECK 2: No new legacy items
-        legacyItemNames_json = [x['name'] for x in l1items_json.values() if 'legacy' in x  ]
-        legacyItemNamesNoTopo_json = []
-        for x in legacyItemNames_json:
-            if "-" not in x and "AFP" not in x:
-                legacyItemNamesNoTopo_json += [x] # no need to check legacy L1Topo and AFP 
-        legacyItemsOnlyInJson =  list( set(legacyItemNamesNoTopo_json) - set(itemNamesNoTopo_xml) )
-        cc = len(self.check)
-        self.check += [ len(legacyItemsOnlyInJson)==0 ]
-        log.info("CHECK %i: There should be no extra legacy items in json that are not in xml: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            log.debug("These %i legacy items are new in the json version (should be none!)" , len(legacyItemsOnlyInJson))
-            for x in legacyItemsOnlyInJson:
-                log.debug("    %s", x)
-
-        # CHECK 3: CTPID match
-        inboth = set(itemNames_json).intersection(set(itemNames_xml))
-        noMatchId = []
-        for name in sorted(inboth):
-            if "-" in name:
-                continue # No need to check IDs for L1Topo items
-            if ids_xml[name] != ids_json[name]:
-                noMatchId += [(name, ids_xml[name], ids_json[name])]
-        cc = len(self.check)
-        self.check += [ len(noMatchId)==0 ]
-        log.info("CHECK %i: CTP-IDs must match in xml and json: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            log.debug("From %i items that are in both, these %i have non-matching CTP id's (should be 0)" , len(inboth),len(noMatchId))
-            log.debug("    Name, CTPID in xml, CTPID in json")
-            for x in noMatchId:
-                log.debug("    %s", x)
-
-        # CHECK 4: isolation parametrization
-        iso_xml  = self.r22_l1_xml.find("CaloInfo").findall("Isolation")
-        iso_json = deepcopy(self.r22_l1_json.thresholdExtraInfo("EM")["isolation"]) # 'HAIsoForEMthr', 'EMIsoForEMthr'
-        iso_json.update(deepcopy(self.r22_l1_json.thresholdExtraInfo("TAU")["isolation"])) # 'EMIsoForTAUthr'
-        noMatchValue = []
-        for iso_x in iso_xml:
-            isoType = iso_x.attrib["thrtype"]
-            iso_j = iso_json[isoType]['Parametrization']
-            for bit, (x,j) in enumerate(zip(iso_x,iso_j)):
-                for p in j:
-                    if j[p] != int(x.attrib[p]):
-                        noMatchValue += [ (isoType,bit+1,p,j[p],x.attrib[p]) ]
-                cc = len(self.check)
-        self.check += [ len(noMatchValue)==0 ]
-        log.info("CHECK %i: isolation parametrization for legacy L1Calo must match in xml and json: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            log.debug("These %i parametrization values are different (should be 0)" , len(noMatchValue))
-            log.debug("    Type, bit, parameter: value in xml != value in json")
-            for x in noMatchValue:
-                log.debug("    %s, %i, %s: %i != %s", *x )
-
-
-
-    def checkHltInputsPresent(self):
-        if self.r22_l1_json is None or self.r22_hlt is None: 
-            return
-        log.info("Checking L1-HLT consistency")
-        log.info("===========================")
-        availableItems = set(self.r22_l1_json.items().keys())
-        availableItems.add('')    
-
-        neededItemNotInL1 = []
-        for cname,cdef in self.r22_hlt["chains"].items():
-            inputItem = cdef['l1item']
-            if ',' in inputItem:
-                requiredItems = inputItem.split(',')
-            else:
-                requiredItems = [ inputItem ]
-            requiredItemsNotInL1 = [ i for i in requiredItems if i not in availableItems ] 
-            if len(requiredItemsNotInL1)!=0:
-                neededItemNotInL1 += [ (cname, cdef['l1item'], requiredItemsNotInL1) ]
-
-        cc = len(self.check)
-        self.check += [ len(neededItemNotInL1)==0 ]
-        log.info("CHECK %i: All items required by HLT must be available: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            log.debug("These %i chains have input items that are not available in the L1 menu" , len(neededItemNotInL1))
-            for (hlt,l1,missingItem) in neededItemNotInL1:
-                if ',' in l1:
-                    log.debug("    chain %s misses input item %s (this chain has multiple inputs!)", hlt,", ".join(missingItem))
-                else:
-                    log.debug("    chain %s misses input item %s", hlt,", ".join(missingItem))
-
-
-
-
-    def compareL1TopoMenusRun2Legacy(self):
-        if self.r211_topo is None or self.r22_l1_json is None:
-            return
-        log.info("Checking Legacy L1Topo migration")
-        log.info("================================")
-
-        OL = namedtuple('OL','board, fpga, clock, bit, triggerline')
-        ALG = namedtuple('A','id, triggerline')
-        AP = namedtuple('AP', 'name, klass, inputs, outputs, gPars, vPars')
-        
-        # triggerlines
-        r2_xml = []
-        # algos
-        r2_algos_xml = {}
-        r2_algDefs_xml = {}
-
-        # extract info from xml file
-        for output in (dict(x.items()) for x in self.r211_topo.find('OutputList')):
-            algoname = output["algname"]
-            algoId = int(output["algoId"])
-            board = int(output["module"])
-            fpga = int(output['fpga'])
-            clock = int(output['clock'])
-            bit = int(output['firstbit'])
-            triggerline = output['triggerline'].split(',')
-            for tl in triggerline:
-                tl = tl.replace('.','p')
-                r2_xml.append( OL(board=board, fpga=fpga, clock=clock, bit=bit, triggerline=tl) )
-                r2_algos_xml[algoname.replace('.','p')] = ALG( id = algoId, triggerline=','.join(triggerline))
-                bit += 1
-
-        for sa in chain( self.r211_topo.iterfind('SortAlgo'),
-                         self.r211_topo.iterfind('DecisionAlgo') ):
-            isSortAlg = "value" in sa.find("Fixed").find("Output").attrib
-            algName = sa.get('name')
-            algType = sa.get('type')
-            algId = int(sa.get('algoId'))
-            fixedParam = sa.find("Fixed")
-            inputs = [ x.attrib['value'] for x in fixedParam.iterfind("Input") ]
-            if isSortAlg:
-                outputs = [ fixedParam.find("Output").attrib["value"] ]
-            else:
-                outputs = []
-                for o in fixedParam.find("Output").iterfind("Bit"):
-                    outputs += [ o.attrib['name'].replace('.','p') ]
-            gpars = {}
-            for x in fixedParam.iterfind("Generic"):
-                gpars[x.attrib['name']] = x.attrib['value']
-            allvPars = sa.find("Variable").findall("Parameter")
-            vpars = len(allvPars) * [None]
-            for x in allvPars:
-                vpars[int(x.attrib['pos'])] = (x.attrib['name'],x.attrib['value'],x.get('selection'))
-            r2_algDefs_xml[algName.replace('.','p')] = AP( name = algName, klass = algType, inputs = inputs, outputs = outputs, gPars = gpars, vPars = vpars)
-            r2_algos_xml[algName.replace('.','p')] = ALG( id = algId, triggerline = ','.join(outputs))
-
-        # json connector names
-        r3_json = []
-        topoConn_json = self.r22_l1_json['connectors']
-        for board in [0,1]:
-            for fpga in [0,1]:
-                for clock in [0,1]:                
-                    set1 = topoConn_json['LegacyTopo%i' % board]['triggerlines']['fpga%i' % fpga]['clock%i' % clock]
-                    for tl in set1:
-                        tl_name = tl['name'].split('_',1)[-1]
-                        bit = tl['startbit']
-                        r3_json.append( OL(board=board, fpga=fpga, clock=clock, bit=bit, triggerline=tl_name) )
-
-        # CHECK: topo lines
-        linesOnlyInR2Xml = sorted(set([x for x in r2_xml]) - set([x for x in r3_json]))
-        linesOnlyInR3Json = sorted(set([x for x in r3_json]) - set([x for x in r2_xml]))
-        cc = len(self.check)
-        self.check += [ len(linesOnlyInR3Json) + len(linesOnlyInR2Xml)==0 ]
-        log.info("CHECK %i: Topo lines must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            if len(linesOnlyInR2Xml)>0:
-                log.debug("These %i legacy topo items are missing in the legacy part of the new L1 menu" , len(linesOnlyInR2Xml))
-                for x in linesOnlyInR2Xml:
-                    log.debug(f"    {x.triggerline} on board {x.board}, fpga {x.fpga}, clock {x.clock}, bit {x.bit}")
-            if len(linesOnlyInR3Json)>0:
-                log.debug("These %i legacy topo items are new in the legacy part of the new L1 menu" , len(linesOnlyInR3Json))
-                for x in linesOnlyInR3Json:
-                    log.debug(f"    {x.triggerline} on board {x.board}, fpga {x.fpga}, clock {x.clock}, bit {x.bit}")
-
-        # CHECK Algo names
-        r3_algos_json = {}
-        for algName,algDef in self.r22_l1_json['topoAlgorithms']['R2TOPO']['decisionAlgorithms'].items():
-            r3_algos_json[algName] = ALG( id = algDef['algId'], triggerline=','.join(algDef['output']))
-        for algName,algDef in self.r22_l1_json['topoAlgorithms']['R2TOPO']['sortingAlgorithms'].items():
-            r3_algos_json[algName] = ALG( id = algDef['algId'], triggerline=','.join(algDef['output']))
-        algosOnlyInR2Xml = sorted(set(r2_algos_xml) - set(r3_algos_json))
-        algosOnlyInR3Json = sorted(set(r3_algos_json) - set(r2_algos_xml))
-        cc = len(self.check)
-        self.check += [ len(algosOnlyInR2Xml) + len(algosOnlyInR3Json)==0 ]
-        log.info("CHECK %i: Algorithm names must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            if len(algosOnlyInR2Xml)>0:
-                log.debug("These %i legacy topo algoriths are missing in the legacy part of the new L1 menu" , len(algosOnlyInR2Xml))
-                for algName in algosOnlyInR2Xml:
-                    log.debug(f"    {algName}")
-            if len(algosOnlyInR3Json)>0:
-                log.debug("These %i legacy topo items are new in the legacy part of the new L1 menu" , len(algosOnlyInR3Json))
-                for algName in algosOnlyInR3Json:
-                    log.debug(f"    {algName}")
-
-        # CHECK Algo ID match
-        algosWithoutMatchingId = []
-        for algName in set(r2_algos_xml).intersection(set(r3_algos_json)):
-            r2id = r2_algos_xml[algName].id
-            r3id = r3_algos_json[algName].id
-            if r2id != r3id:
-                algosWithoutMatchingId += [(algName, r2id, r3id)]
-        cc = len(self.check)
-        self.check += [ len(algosWithoutMatchingId)==0 ]
-        log.info("CHECK %i: All legacy topo algorithm IDs must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            log.debug("These %i legacy topo algos have non-matching IDs (old => new)" , len(algosWithoutMatchingId))
-            for x in algosWithoutMatchingId:
-                log.debug(f"    {x[0]}  ({x[1]} => {x[2]})")
-
-        # CHECK algo class match
-        klassMismatch = []
-        for (algName, algDef) in chain( self.r22_l1_json['topoAlgorithms']['R2TOPO']['sortingAlgorithms'].items(),
-                                        self.r22_l1_json['topoAlgorithms']['R2TOPO']['decisionAlgorithms'].items()):
-            if algName not in r2_algDefs_xml:
-                continue
-            r2alg = r2_algDefs_xml[algName]
-            if algDef['klass'] != r2alg.klass:
-                klassMismatch += [ (algName, r2alg.klass, algDef['klass']) ]
-        cc = len(self.check)
-        self.check += [ len(klassMismatch)==0 ]
-        log.info("CHECK %i: All class names must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            for algName, r2klass, r3klass in klassMismatch:
-                log.debug(f"Class of algorithm {algName} changes from  {r2klass} to {r3klass}")
-        
-
-        # CHECK properties match
-        fixedPropertyMismatch = []
-        varPropertyMismatch = []
-        varNumberMismatch = []
-        for (algName, algDef) in chain( self.r22_l1_json['topoAlgorithms']['R2TOPO']['sortingAlgorithms'].items(),
-                                        self.r22_l1_json['topoAlgorithms']['R2TOPO']['decisionAlgorithms'].items() ):
-            r2alg = r2_algDefs_xml[algName]
-            if _liststr(r2alg.inputs) != _liststr(algDef['input']):
-                fixedPropertyMismatch += [ (algName, "Input", _liststr(r2alg.inputs), _liststr(algDef['input'])) ]
-            if _liststr(r2alg.outputs) != _liststr(algDef['output']):
-                fixedPropertyMismatch += [ (algName, "Output", _liststr(r2alg.outputs), _liststr(algDef['output'])) ]
-            for (gname, gval) in algDef['fixedParameters']['generics'].items():
-                if r2alg.gPars[gname] != str(gval['value']):
-                    fixedPropertyMismatch += [ (algName, "Generic parameter " + gname, r2alg.gPars[gname], str(gval['value'])) ]
-            if len(algDef['variableParameters']) != len(r2alg.vPars):
-                varNumberMismatch += [ (algName, len(r2alg.vPars), len(algDef['variableParameters'])) ]
-            else:
-                for pos,par in enumerate(algDef['variableParameters']):
-                    if r2alg.vPars[pos][0] != par['name']:
-                        varPropertyMismatch += [ (algName, pos, "name", r2alg.vPars[pos][0], par['name']) ]
-                    if r2alg.vPars[pos][1] != str(par['value']):
-                        varPropertyMismatch += [ (algName, pos, "value", r2alg.vPars[pos][1], str(par['value'])) ]
-                    if par.get('selection') is not None or r2alg.vPars[pos][2] in range(1,10):
-                        if str(r2alg.vPars[pos][2]) != str(par.get('selection')):
-                            varPropertyMismatch += [ (algName, pos, "selection", r2alg.vPars[pos][2], par.get('selection')) ]
-
-        # CHECK number variables
-        cc = len(self.check)
-        self.check += [ len(varNumberMismatch)==0 ]
-        log.info("CHECK %i: Number of algorithm variable parameters must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            for algName, l1, l2 in varNumberMismatch:
-                log.debug(f"    Number of variable parameters for algorithm {algName} changes from  {l1} to {l2}")
-
-        # CHECK algorithm properties
-        cc = len(self.check)
-        self.check += [ len(fixedPropertyMismatch) + len(varPropertyMismatch) ==0 ]
-        log.info( "CHECK %i: Algorithm property values must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            for algName, var, r2val, r3val in fixedPropertyMismatch:
-                log.debug(f"    {var} of algorithm {algName} changes from  {r2val} to {r3val}")
-            for (algName, pos, nameOrVal, r2, r3) in varPropertyMismatch:
-                log.debug(f"    Variable parameter at pos {pos} of algorithm {algName} changes {nameOrVal} from  {r2} to {r3}")
-            
-
-
-    def compareL1TopoMenusRun3(self):
-        if self.r22_topo is None or self.r22_l1_json is None:
-            return
-        log.info("Checking Run 3 L1Topo migration")
-        log.info("===============================")
-
-        OL = namedtuple('OL','board, fpga, clock, bit, triggerline')
-        ALG = namedtuple('A','id, triggerline')
-        AP = namedtuple('AP', 'name, klass, inputs, outputs, gPars, vPars')
-        
-        # triggerlines
-        r2_xml = []
-        # algos
-        r2_algos_xml = {}
-        r2_algDefs_xml = {}
-
-        # extract info from xml file
-        for output in (dict(x.items()) for x in self.r22_topo.find('OutputList')):
-            algoname = output["algname"]
-            algoId = int(output["algoId"])
-            board = int(output["module"])
-            fpga = int(output['fpga'])
-            clock = int(output['clock'])
-            bit = int(output['firstbit'])
-            triggerline = output['triggerline'].split(',')
-            for tl in triggerline:
-                tl = tl.replace('.','p')
-                r2_xml.append( OL(board=board+2, fpga=fpga, clock=clock, bit=bit, triggerline=tl) )
-                r2_algos_xml[algoname.replace('.','p')] = ALG( id = algoId, triggerline=','.join(triggerline))
-                bit += 1
-
-        for sa in chain( self.r22_topo.iterfind('SortAlgo'),
-                         self.r22_topo.iterfind('DecisionAlgo') ):
-            isSortAlg = "value" in sa.find("Fixed").find("Output").attrib
-            algName = sa.get('name')
-            algType = sa.get('type')
-            algId = int(sa.get('algoId'))
-            fixedParam = sa.find("Fixed")
-            inputs = [ x.attrib['value'] for x in fixedParam.iterfind("Input") ]
-            if isSortAlg:
-                outputs = [ fixedParam.find("Output").attrib["value"] ]
-            else:
-                outputs = []
-                for o in fixedParam.find("Output").iterfind("Bit"):
-                    outputs += [ o.attrib['name'].replace('.','p') ]
-            gpars = {}
-            for x in fixedParam.iterfind("Generic"):
-                gpars[x.attrib['name']] = x.attrib['value']
-            allvPars = sa.find("Variable").findall("Parameter")
-            vpars = len(allvPars) * [None]
-            for x in allvPars:
-                vpars[int(x.attrib['pos'])] = (x.attrib['name'],x.attrib['value'],x.get('selection'))
-            r2_algDefs_xml[algName.replace('.','p')] = AP( name = algName, klass = algType, inputs = inputs, outputs = outputs, gPars = gpars, vPars = vpars)
-            r2_algos_xml[algName.replace('.','p')] = ALG( id = algId, triggerline = ','.join(outputs))
-
-        # json connector names
-        r3_json = []
-        topoConn_json = self.r22_l1_json['connectors']
-        for board in [2,3]:
-            for fpga in [0,1]:
-                for clock in [0,1]:                
-                    set1 = topoConn_json['Topo%iEl' % board]['triggerlines']['fpga%i' % fpga]['clock%i' % clock]
-                    for tl in set1:
-                        tl_name = tl['name'].split('_',1)[-1]
-                        bit = tl['startbit']
-                        r3_json.append( OL(board=board, fpga=fpga, clock=clock, bit=bit, triggerline=tl_name) )
-
-
-        # CHECK 1: topo lines
-        linesOnlyInR2Xml = sorted(set([x for x in r2_xml]) - set([x for x in r3_json]))
-        linesOnlyInR3Json = sorted(set([x for x in r3_json]) - set([x for x in r2_xml]))
-        cc = len(self.check)
-        self.check += [ len(linesOnlyInR3Json) + len(linesOnlyInR2Xml)==0 ]
-        log.info("CHECK %i: Topo lines must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            if len(linesOnlyInR2Xml)>0:
-                log.debug("These %i topo lines are missing in the new L1 menu" , len(linesOnlyInR2Xml))
-                for x in linesOnlyInR2Xml:
-                    log.debug(f"    {x.triggerline} on board {x.board}, fpga {x.fpga}, clock {x.clock}, bit {x.bit}")
-            if len(linesOnlyInR3Json)>0:
-                log.debug("These %i legacy topo items are new in the legacy part of the new L1 menu" , len(linesOnlyInR3Json))
-                for x in linesOnlyInR3Json:
-                    log.debug(f"    {x.triggerline} on board {x.board}, fpga {x.fpga}, clock {x.clock}, bit {x.bit}")
-
-
-        # CHECK 2: Algo names
-        r3_algos_json = {}
-        for algName,algDef in self.r22_l1_json['topoAlgorithms']['TOPO']['decisionAlgorithms'].items():
-            r3_algos_json[algName] = ALG( id = algDef['algId'], triggerline=','.join(algDef['output']))
-        for algName,algDef in self.r22_l1_json['topoAlgorithms']['TOPO']['sortingAlgorithms'].items():
-            r3_algos_json[algName] = ALG( id = algDef['algId'], triggerline=','.join(algDef['output']))
-        algosOnlyInR2Xml = sorted(set(r2_algos_xml) - set(r3_algos_json))
-        algosOnlyInR3Json = sorted(set(r3_algos_json) - set(r2_algos_xml))
-        cc = len(self.check)
-        self.check += [ len(algosOnlyInR2Xml) + len(algosOnlyInR3Json)==0 ]
-        log.info("CHECK %i: Algorithm names must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            if len(algosOnlyInR2Xml)>0:
-                log.debug("These %i legacy topo algoriths are missing in the legacy part of the new L1 menu" , len(algosOnlyInR2Xml))
-                for algName in algosOnlyInR2Xml:
-                    log.debug(f"    {algName}")
-            if len(algosOnlyInR3Json)>0:
-                log.debug("These %i legacy topo items are new in the legacy part of the new L1 menu" , len(algosOnlyInR3Json))
-                for algName in algosOnlyInR3Json:
-                    log.debug(f"    {algName}")
-
-
-        # CHECK algo class match
-        klassMismatch = []
-        for (algName, algDef) in chain( self.r22_l1_json['topoAlgorithms']['TOPO']['sortingAlgorithms'].items(),
-                                        self.r22_l1_json['topoAlgorithms']['TOPO']['decisionAlgorithms'].items()):
-            if algName not in r2_algDefs_xml:
-                continue
-            r2alg = r2_algDefs_xml[algName]
-            if algDef['klass'] != r2alg.klass:
-                klassMismatch += [ (algName, r2alg.klass, algDef['klass']) ]
-        cc = len(self.check)
-        self.check += [ len(klassMismatch)==0 ]
-        log.info("CHECK %i: All class names must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            for algName, r2klass, r3klass in klassMismatch:
-                log.debug(f"Class of algorithm {algName} changes from  {r2klass} to {r3klass}")
-        
-
-        # CHECK: properties match
-        fixedPropertyMismatch = []
-        varPropertyMismatch = []
-        varNumberMismatch = []
-        for (algName, algDef) in chain( self.r22_l1_json['topoAlgorithms']['TOPO']['sortingAlgorithms'].items(),
-                                        self.r22_l1_json['topoAlgorithms']['TOPO']['decisionAlgorithms'].items() ):
-            if algName not in r2_algDefs_xml:
-                continue
-            r2alg = r2_algDefs_xml[algName]
-            if _liststr(r2alg.inputs) != _liststr(algDef['input']):
-                fixedPropertyMismatch += [ (algName, "Input", _liststr(r2alg.inputs), _liststr(algDef['input'])) ]
-            if _liststr(r2alg.outputs) != _liststr(algDef['output']):
-                fixedPropertyMismatch += [ (algName, "Output", _liststr(r2alg.outputs), _liststr(algDef['output'])) ]
-            for (gname, gval) in algDef['fixedParameters']['generics'].items():
-                if r2alg.gPars[gname] != str(gval['value']):
-                    fixedPropertyMismatch += [ (algName, "Generic parameter " + gname, r2alg.gPars[gname], str(gval['value'])) ]
-            if len(algDef['variableParameters']) != len(r2alg.vPars):
-                varNumberMismatch += [ (algName, len(r2alg.vPars), len(algDef['variableParameters'])) ]
-            else:
-                for pos,par in enumerate(algDef['variableParameters']):
-                    if r2alg.vPars[pos][0] != par['name']:
-                        varPropertyMismatch += [ (algName, pos, "name", r2alg.vPars[pos][0], par['name']) ]
-                    if r2alg.vPars[pos][1] != str(par['value']):
-                        varPropertyMismatch += [ (algName, "%i (%s)" % (pos,par['name']), "value", r2alg.vPars[pos][1], str(par['value'])) ]
-                    if par.get('selection') is not None or r2alg.vPars[pos][2] in range(1,10):
-                        if str(r2alg.vPars[pos][2]) != str(par.get('selection')):
-                            varPropertyMismatch += [ (algName, pos, "selection", r2alg.vPars[pos][2], par.get('selection')) ]
-
-
-        # CHECK number variables
-        cc = len(self.check)
-        self.check += [ len(varNumberMismatch)==0 ]
-        log.info("CHECK %i: Number of algorithm variable parameters must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            for algName, l1, l2 in varNumberMismatch:
-                log.debug(f"    Number of variable parameters for algorithm {algName} changes from  {l1} to {l2}")
-
-
-        # CHECK algorithm properties
-        cc = len(self.check)
-        self.check += [ len(fixedPropertyMismatch) + len(varPropertyMismatch) ==0 ]
-        log.info( "CHECK %i: Algorithm property values must match: %s", cc, boolStr(self.check[cc]) )
-        if not self.check[cc]:
-            for algName, var, r2val, r3val in fixedPropertyMismatch:
-                log.debug(f"    {var} of algorithm {algName} changes from  {r2val} to {r3val}")
-            for (algName, pos, nameOrVal, r2, r3) in varPropertyMismatch:
-                log.debug(f"    Variable parameter at pos {pos} of algorithm {algName} changes {nameOrVal} from  {r2} to {r3}")
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-def main():
-
-    if len(sys.argv) <3:
-        log.info("Please specify at least two menu files (L1Menu.xml, L1Menu.json, HLTMenu.json)")
-
-    mc = MenuComp( sys.argv[1:] )
-
-    mc.compareL1MenusXMLwithJSON()
-
-    mc.compareCTPIN()
-
-    mc.checkHltInputsPresent()
-
-    mc.compareL1TopoMenusRun2Legacy()
-    
-    # not needed any more
-    #mc.compareL1TopoMenusRun3()
-
-    return 0
-    
-if __name__ == "__main__":
-    sys.exit(main())
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigL1MenuMigrationCheck.sh b/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigL1MenuMigrationCheck.sh
deleted file mode 100755
index d8bc958f53f5..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/trigL1MenuMigrationCheck.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/env sh
-
-testdir=tmp
-rm -rf ${testdir}
-mkdir ${testdir}
-cd ${testdir}
-mkdir log
-
-echo "Test directory: ${testdir}/"
-echo "Log files directory: ${testdir}/log/"
-echo "AtlasVersion = ${AtlasVersion}"
-
-echo "Generating L1 xml menus: LVL1config_LS2_v1_${AtlasVersion}.xml"
-cmd="generateL1MenuMT.sh LS2_v1"
-echo "Command:" > ./log/l1menuGeneration.log
-echo "${cmd}" >> ./log/l1menuGeneration.log
-echo "Output:" >> ./log/l1menuGeneration.log
-${cmd} >> ./log/l1menuGeneration.log 2>&1
-
-echo "Generating HLT and L1 json menu: HLTMenu_LS2_v1_${AtlasVersion}.json"
-DS=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data18_13TeV.00360026.physics_EnhancedBias.merge.RAW._lb0151._SFO-1._0001.1
-echo "Command:" > ./log/hltmenuGeneration.log
-echo "DS=${DS}" >> ./log/hltmenuGeneration.log
-echo "Output:" >> ./log/hltmenuGeneration.log
-
-echo "athena.py --config-only=config.pkl -c \"setMenu='LS2_v1'\" --imf --perfmon --threads=1 --evtMax=1 --filesInput=${DS}  TriggerJobOpts/runHLT_standalone.py " >> ./log/hltmenuGeneration.log
-athena.py --config-only=config.pkl -c "setMenu='LS2_v1'" --imf --perfmon --threads=1 --evtMax=1 --filesInput=${DS}  TriggerJobOpts/runHLT_standalone.py >> ./log/hltmenuGeneration.log 2>&1
-
-# generate EB run 360026 files: LVL1 menu LVL1config_SMK_2749.xml, HLTconfig_SMK_2749.xml, L1TopoConfig_SMK_2749.xml
-echo "Downloading L1Topo menu from EB run 360026: L1TopoConfig_SMK_2749.xml"
-cmd="TrigConfReadWrite -i TRIGGERDB 2749 -o xml SMK_2749"
-echo "Command:" > ./log/run2L1TopoDownload.log
-echo "${cmd}" >> ./log/run2L1TopoDownload.log
-echo "Output:" >> ./log/run2L1TopoDownload.log
-${cmd} >> ./log/run2L1TopoDownload.log 2>&1
-
-cmd="trigCompareOldandNewL1Menus.py \
-L1Menu_LS2_v1_${AtlasVersion}.json \
-LVL1config_LS2_v1_${AtlasVersion}.xml \
-HLTMenu_LS2_v1_${AtlasVersion}.json \
-L1TopoConfig_SMK_2749.xml"
-
-echo "Running menu comparison"
-echo "Command:"
-echo "${cmd}"
-echo "Output:"
-${cmd}
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/share/LVL1config.dtd b/Trigger/TriggerCommon/TriggerMenuMT/share/LVL1config.dtd
deleted file mode 100755
index ead9c7b432ab..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/share/LVL1config.dtd
+++ /dev/null
@@ -1,202 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!ENTITY % input_name '(SLOT7 | SLOT8 | SLOT9 | CTPCORE) "SLOT9"'>
-<!ENTITY % type_name '(ELECTRICAL | OPTICAL) "ELECTRICAL"'>
-<!ENTITY % cable_name '(CON0 | CON1 | CON2 | CON3) "CON0"'>
-<!ENTITY % counter_name '(CTPIN | CTPMON | CORETBP | CORETAP | CORETAV) "CTPIN"'>
-<!ENTITY % trigger_name '(BGRP0 | BGRP1 | BGRP2 | BGRP3 | BGRP4 | BGRP5 | BGRP6 | BGRP7 | BGRP8 | BGRP9 | BGRP10 | BGRP11 | BGRP12 | BGRP13 | BGRP14 | BGRP15 | RNDM0 | RNDM1 | RNDM2 | RNDM3) '>
-
-<!ELEMENT LVL1Config (TriggerMenu,PrescaleSet,TriggerCounterList?,TriggerThresholdList,Random,BunchGroupSet,PrescaledClock,CaloInfo,MuctpiInfo)>
-<!ATTLIST LVL1Config
-     name               CDATA           #IMPLIED
-     ctpVersion         CDATA           #IMPLIED
-     l1Version          CDATA           #IMPLIED
-     id                 CDATA           #IMPLIED>
-
-<!ELEMENT TriggerMenu (TriggerItem)*>
-<!ATTLIST TriggerMenu
-     name               ID              #REQUIRED
-     version            CDATA           #IMPLIED
-     phase              CDATA           #IMPLIED>
-
-<!ELEMENT  TriggerItem (AND|OR|NOT|TriggerCondition|InternalTrigger)>
-<!ATTLIST  TriggerItem
-     id                 CDATA           #IMPLIED
-     name               CDATA           #REQUIRED
-     version            CDATA           #IMPLIED
-     ctpid              CDATA           #REQUIRED
-     partition          CDATA           #IMPLIED
-     complex_deadtime   CDATA           #IMPLIED
-     definition         CDATA           #IMPLIED
-     trigger_type       CDATA           #IMPLIED
-     monitor            CDATA           #IMPLIED>
-
-<!ELEMENT AND (AND|OR|NOT|TriggerCondition|InternalTrigger)+>
-
-<!ELEMENT OR (AND|OR|NOT|TriggerCondition|InternalTrigger)+>
-
-<!ELEMENT NOT (AND|OR|NOT|TriggerCondition|InternalTrigger)>
-
-<!ELEMENT TriggerCondition EMPTY>
-<!ATTLIST TriggerCondition
-     id                 CDATA           #IMPLIED
-     name               CDATA           #REQUIRED
-     version            CDATA           #IMPLIED
-     triggerthreshold   CDATA           #REQUIRED
-     multi              CDATA           #REQUIRED>
-
-<!ELEMENT InternalTrigger EMPTY>
-<!ATTLIST InternalTrigger
-     id                 CDATA           #IMPLIED
-     name               %trigger_name;  #REQUIRED>
-
-<!ELEMENT TriggerThresholdList (TriggerThreshold*)>
-
-<!ELEMENT TriggerThreshold (TriggerThresholdValue*, Cable)>
-<!ATTLIST TriggerThreshold
-     id                 CDATA           #IMPLIED
-     name               CDATA           #REQUIRED
-     version            CDATA           #IMPLIED
-     type               CDATA           #REQUIRED
-     bitnum             CDATA           #REQUIRED
-     OPL                CDATA           "NO"
-     confirm            CDATA           "0"
-     active             CDATA           #IMPLIED
-     mapping            CDATA           #IMPLIED
-     input              CDATA           #IMPLIED
-     seed               CDATA           #IMPLIED
-     seed_multi         CDATA           #IMPLIED
-     bcdelay            CDATA           #IMPLIED>
-
-<!ELEMENT TriggerThresholdValue EMPTY>
-<!ATTLIST TriggerThresholdValue
-     id                 CDATA           #IMPLIED
-     name               CDATA           #REQUIRED
-     version            CDATA           #IMPLIED
-     type               CDATA           #REQUIRED
-     thresholdval       CDATA           #REQUIRED
-     em_isolation       CDATA           "5"
-     had_isolation      CDATA           "10"
-     had_veto           CDATA           "20"
-     window             CDATA           "2"
-     phimin             CDATA           #REQUIRED
-     phimax             CDATA           #REQUIRED
-     etamin             CDATA           #REQUIRED
-     etamax             CDATA           #REQUIRED
-     priority           CDATA           #IMPLIED
-     isobits            CDATA           #IMPLIED
-     windowSize         CDATA           #IMPLIED>
-
-<!ELEMENT Cable (Signal+)>
-<!ATTLIST Cable
-     name               CDATA           #REQUIRED
-     input              %input_name;
-     ctpin              CDATA           #IMPLIED
-     type               %type_name;
-     connector          %cable_name;>
-
-<!ELEMENT Signal EMPTY>
-<!ATTLIST Signal
-     range_begin        CDATA           #REQUIRED
-     range_end          CDATA           #REQUIRED
-     clock              CDATA           #IMPLIED
-     phase              CDATA           #IMPLIED>
-
-<!ELEMENT TriggerCounterList (TriggerCounter*)>
-
-<!ELEMENT TriggerCounter (AND|OR|NOT|TriggerCondition)*>
-<!ATTLIST TriggerCounter
-     id                 CDATA           #IMPLIED
-     name               CDATA           #REQUIRED
-     version            CDATA           #IMPLIED
-     type               %counter_name;>
-
-<!ELEMENT Random EMPTY>
-<!ATTLIST Random
-     name0              CDATA           #REQUIRED
-     cut0               CDATA           #REQUIRED
-     name1              CDATA           #REQUIRED
-     cut1               CDATA           #REQUIRED
-     name2              CDATA           #REQUIRED
-     cut2               CDATA           #REQUIRED
-     name3              CDATA           #REQUIRED
-     cut3               CDATA           #REQUIRED>     
-
-<!ELEMENT PrescaleSet (Prescale*)>
-<!ATTLIST PrescaleSet 
-     name               CDATA           #REQUIRED
-     type               CDATA           #IMPLIED
-     menuPartition      CDATA           #IMPLIED>
-     
-<!ELEMENT Prescale (#PCDATA)>
-<!ATTLIST Prescale
-     ctpid              CDATA           #REQUIRED
-     cut                CDATA           #IMPLIED
-     value              CDATA           #IMPLIED>
-     
-<!ELEMENT BunchGroupSet (BunchGroup*,Bunch*)>
-<!ATTLIST BunchGroupSet
-     name              CDATA            #REQUIRED
-     menuPartition     CDATA            #IMPLIED>
-
-<!ELEMENT BunchGroup (Bunch*)>
-<!ATTLIST BunchGroup
-     internalNumber    CDATA            #REQUIRED
-     name              CDATA            #REQUIRED>
-
-<!ELEMENT Bunch EMPTY>
-<!ATTLIST Bunch
-     bunchNumber       CDATA            #REQUIRED>
-
-<!ELEMENT PrescaledClock EMPTY>
-<!ATTLIST PrescaledClock
-     name              CDATA            #REQUIRED
-     clock1            CDATA            #REQUIRED
-     clock2            CDATA            #REQUIRED>
-     
-<!ELEMENT CaloInfo (METSignificance*,Isolation*,MinimumTOBPt*)>
-<!ATTLIST CaloInfo
-     name              CDATA            #REQUIRED
-     global_em_scale   CDATA            #REQUIRED
-     global_jet_scale  CDATA            #REQUIRED>
-
-<!ELEMENT METSignificance (#PCDATA)>
-<!ATTLIST METSignificance
-     xeMin             CDATA            #REQUIRED
-     xeMax             CDATA            #REQUIRED
-     teSqrtMin         CDATA            #REQUIRED
-     teSqrtMax         CDATA            #REQUIRED
-     xsSigmaScale      CDATA            #REQUIRED
-     xsSigmaOffset     CDATA            #REQUIRED>
-
-<!ELEMENT Isolation (Parametrization*)>
-<!ATTLIST Isolation
-     thrtype           CDATA            #REQUIRED>
-
-<!ELEMENT Parametrization (#PCDATA)>
-<!ATTLIST Parametrization
-     isobit            CDATA            #REQUIRED
-     offset            CDATA            #REQUIRED
-     slope             CDATA            #REQUIRED
-     mincut            CDATA            #REQUIRED
-     upperlimit        CDATA            #REQUIRED
-     etamin            CDATA            #REQUIRED
-     etamax            CDATA            #REQUIRED
-     priority          CDATA            #REQUIRED>
-
-<!ELEMENT MinimumTOBPt (#PCDATA)>
-<!ATTLIST MinimumTOBPt
-     thrtype           CDATA            #REQUIRED
-     ptmin             CDATA            #REQUIRED
-     etamin            CDATA            #REQUIRED
-     etamax            CDATA            #REQUIRED
-     priority          CDATA            #REQUIRED
-     window            CDATA            #IMPLIED>
-
-<!ELEMENT MuctpiInfo (#PCDATA)>
-<!ATTLIST MuctpiInfo
-     name           CDATA            #REQUIRED
-     low_pt             CDATA            #REQUIRED
-     high_pt            CDATA            #REQUIRED
-     max_cand            CDATA            #REQUIRED>
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/share/test_menu_cf.py b/Trigger/TriggerCommon/TriggerMenuMT/share/test_menu_cf.py
index 040490461ed8..41261ba02ff1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/share/test_menu_cf.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/share/test_menu_cf.py
@@ -29,14 +29,12 @@ for option in defaultOptions:
 
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
 ConfigFlags.Trigger.generateMenuDiagnostics = True
+ConfigFlags.Trigger.triggerMenuSetup = "LS2_v1"
 
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags
 createHLTMenuExternally=True # menu will be build up explicitly here 
 doWriteRDOTrigger = False
 doWriteBS = False
 forceEnableAllChains=True
-TriggerFlags.triggerMenuSetup = "LS2_v1"
 
 # load all configuration as the real HLT
 include("TriggerJobOpts/runHLT_standalone.py")
-- 
GitLab


From d322fd18647898953f88214c5d717f943a156dda Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 21 Sep 2021 10:45:35 +0200
Subject: [PATCH 230/347] TrigConfigSvc: disable legacy L1 XML menu

Disable the use of the legacy (Run-2) L1 XML menu as input to the
LVL1ConfigSvc.
---
 .../TrigConfigSvc/python/TrigConfigSvcCfg.py      | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py
index 150b3bdaf501..34074da4533d 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py
@@ -193,19 +193,8 @@ def L1ConfigSvcCfg( flags ):
     l1ConfigSvc = TrigConf__LVL1ConfigSvc("LVL1ConfigSvc")
 
     if cfg["SOURCE"] == "FILE":
-        # Run 2 configuration
-        l1ConfigSvc.ConfigSource = "XML"
-        from TriggerJobOpts.TriggerFlags import TriggerFlags
-        l1XMLFile = TriggerFlags.inputLVL1configFile() if flags is None else flags.Trigger.LVL1ConfigFile
-        # check if file exists in this directory otherwise add the package to aid path resolution
-        # also a '/' in the file name indicates that no package needs to be added
-        import os.path
-        if not ( "/" in l1XMLFile or os.path.isfile(l1XMLFile) ):
-            l1XMLFile = "TriggerMenuMT/" + l1XMLFile
-        l1ConfigSvc.XMLMenuFile = l1XMLFile
-        log.info( "For run 2 style menu access configured LVL1ConfigSvc with input file : %s", l1XMLFile )
-        # Run 3 configuration
         generatedFile, generatedBgsFile = generateL1Menu( flags )
+        l1ConfigSvc.ConfigSource = "none"
         l1ConfigSvc.InputType = "file"
         l1ConfigSvc.JsonFileName = generatedFile
         l1ConfigSvc.JsonFileNameBGS = generatedBgsFile
@@ -234,7 +223,7 @@ def HLTConfigSvcCfg( flags ):
 
     if cfg["SOURCE"] == "FILE":
         hltXMLFile = "None"
-        hltConfigSvc.ConfigSource = "None"
+        hltConfigSvc.ConfigSource = "none"
         hltConfigSvc.XMLMenuFile = hltXMLFile
         hltConfigSvc.InputType = "file"
         hltJsonFileName = getHLTMenuFileName( flags )
-- 
GitLab


From 2af353d1982210e6ba2c16f1b484616716cf2535 Mon Sep 17 00:00:00 2001
From: Alaettin Serhan Mete <alaettin.serhan.mete@cern.ch>
Date: Tue, 21 Sep 2021 14:36:18 +0200
Subject: [PATCH 231/347] Exclude common sequences from component monitoring

---
 .../PerfMonComps/src/PerfMonMTSvc.cxx         | 31 +++++++------------
 .../PerfMonComps/src/PerfMonMTSvc.h           | 10 ++++--
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.cxx b/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.cxx
index ea4c9b2528b1..e1e8c9aea226 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.cxx
+++ b/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.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
 */
 
 /*
@@ -123,19 +123,15 @@ void PerfMonMTSvc::handle(const Incident& inc) {
  * Start Auditing
  */
 void PerfMonMTSvc::startAud(const std::string& stepName, const std::string& compName) {
+  // Snapshots, i.e. Initialize, Event Loop, etc.
+  startSnapshotAud(stepName, compName);
+
   /*
-   * This if statement is temporary. It will be removed.
-   * In current implementation the very first thing called is stopAud function
-   * for PerfMonMTSvc. There are some components before it. We miss them.
-   * It should be fixed.
+   * Perform component monitoring only if the user asked for it.
+   * By default we don't monitor a set of common components.
+   * Once we adopt C++20, we can switch this from count to contains.
    */
-  if (compName != "AthenaHiveEventLoopMgr" && compName != "PerfMonMTSvc") {
-    // Snapshots, i.e. Initialize, Event Loop, etc.
-    startSnapshotAud(stepName, compName);
-
-    // Nothing more to do if we don't listen to components
-    if (!m_doComponentLevelMonitoring) return;
-
+  if (m_doComponentLevelMonitoring && !m_exclusionSet.count(compName)) {
     // Start component auditing
     auto const &ctx = Gaudi::Hive::currentContext();
     startCompAud(stepName, compName, ctx);
@@ -146,14 +142,11 @@ void PerfMonMTSvc::startAud(const std::string& stepName, const std::string& comp
  * Stop Auditing
  */
 void PerfMonMTSvc::stopAud(const std::string& stepName, const std::string& compName) {
-  // Don't self-monitor
-  if (compName != "AthenaHiveEventLoopMgr" && compName != "PerfMonMTSvc") {
-    // Snapshots, i.e. Initialize, Event Loop, etc.
-    stopSnapshotAud(stepName, compName);
-
-    // Nothing more to do if we don't listen to components
-    if (!m_doComponentLevelMonitoring) return;
+  // Snapshots, i.e. Initialize, Event Loop, etc.
+  stopSnapshotAud(stepName, compName);
 
+  // Check if we should monitor this component
+  if (m_doComponentLevelMonitoring && !m_exclusionSet.count(compName)) {
     // Stop component auditing
     auto const &ctx = Gaudi::Hive::currentContext();
     stopCompAud(stepName, compName, ctx);
diff --git a/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.h b/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.h
index e8b8346f5264..25e31463dbb3 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.h
+++ b/Control/PerformanceMonitoring/PerfMonComps/src/PerfMonMTSvc.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
 */
 
 /*
@@ -157,6 +157,12 @@ class PerfMonMTSvc : virtual public IPerfMonMTSvc, virtual public IIncidentListe
   /// Set the number of messages for the event-level report
   Gaudi::Property<uint64_t> m_eventLoopMsgLimit{this, "eventLoopMsgLimit", 10, "Maximum number of event-level messages."};
 
+  /// Exclude some common components from monitoring
+  /// In the future this might be converted to a inclusion set
+  /// which would allow user to monitor only a set of algorithms...
+  const std::set<std::string> m_exclusionSet = {"AthMasterSeq", "AthAlgEvtSeq", "AthAllAlgSeq", "AthAlgSeq", "AthOutSeq",
+    "AthCondSeq", "AthBeginSeq", "AthEndSeq", "AthenaEventLoopMgr", "AthenaHiveEventLoopMgr", "PerfMonMTSvc"};
+
   /// Snapshots data
   std::vector<PMonMT::MeasurementData> m_snapshotData;
   std::vector<std::string> m_snapshotStepNames = {"Configure", "Initialize", "Execute", "Finalize"};
@@ -174,7 +180,7 @@ class PerfMonMTSvc : virtual public IPerfMonMTSvc, virtual public IIncidentListe
   // Instant event-loop report counter
   std::atomic<uint64_t> m_eventLoopMsgCounter;
 
-  /* 
+  /*
    * Data structure  to store component level measurements
    * We use pointer to the MeasurementData, because we use new keyword while creating them. Clear!
    */
-- 
GitLab


From 0cc113860a1acdcd61d9a13cbcecc5af68d8136f Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 20 Sep 2021 17:11:46 +0200
Subject: [PATCH 232/347] Update PDGHelpers.getPDGTABLE module to use
 functional.lru_cache

Caching the result of PDGHelpers.getPDGTABLE should ensure that a "clean" PDGTABLE.MeV
file is only retrieved once per job. This approach should also be compatible with
ComponentAccumulator-based configuration.
---
 .../python/ExtraParticlesConfig.py            | 10 +-
 .../ExtraParticles/python/PDGHelpers.py       |  8 +-
 .../share/specialConfig/preInclude.AMSB.py    | 48 +++++-----
 .../share/specialConfig/preInclude.GMSB.py    | 60 ++++++------
 .../specialConfig/preInclude.Monopole.py      | 51 +++++-----
 .../share/specialConfig/preInclude.Qball.py   | 53 ++++++-----
 .../share/specialConfig/preInclude.Quirks.py  | 94 ++++++++++---------
 .../preInclude.RHadronsPythia8.py             | 11 ++-
 .../specialConfig/preInclude.SleptonsLLP.py   | 50 +++++-----
 .../share/specialConfig/preInclude.fcp.py     | 36 +++----
 10 files changed, 216 insertions(+), 205 deletions(-)

diff --git a/Simulation/G4Extensions/ExtraParticles/python/ExtraParticlesConfig.py b/Simulation/G4Extensions/ExtraParticles/python/ExtraParticlesConfig.py
index 54050e03bb98..1d89f5dbc1a4 100644
--- a/Simulation/G4Extensions/ExtraParticles/python/ExtraParticlesConfig.py
+++ b/Simulation/G4Extensions/ExtraParticles/python/ExtraParticlesConfig.py
@@ -1,15 +1,17 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaCommon import CfgMgr
-from ExtraParticles import PDGHelpers
+from ExtraParticles.PDGHelpers import getPDGTABLE, PDGParser
 
 from G4AtlasApps.SimFlags import simFlags
 
 
 def getExtraParticlesPhysicsTool(name="ExtraParticlesPhysicsTool", **kwargs):
-    parser = PDGHelpers.PDGParser(simFlags.ExtraParticlesPDGTABLE.get_Value(),
-                                  simFlags.ExtraParticlesRanges.get_Value())
-
+    if getPDGTABLE(simFlags.ExtraParticlesPDGTABLE.get_Value()):
+        parser = PDGParser(simFlags.ExtraParticlesPDGTABLE.get_Value(),
+                           simFlags.ExtraParticlesRanges.get_Value())
+    else:
+        print("ERROR Failed to find PDGTABLE.MEV file.")
     kwargs.setdefault("ExtraParticlesConfig", parser.createList())
 
     return CfgMgr.ExtraParticlesPhysicsTool(name, **kwargs)
diff --git a/Simulation/G4Extensions/ExtraParticles/python/PDGHelpers.py b/Simulation/G4Extensions/ExtraParticles/python/PDGHelpers.py
index f7091c81ac78..fa5fc789aa6c 100644
--- a/Simulation/G4Extensions/ExtraParticles/python/PDGHelpers.py
+++ b/Simulation/G4Extensions/ExtraParticles/python/PDGHelpers.py
@@ -31,9 +31,9 @@ import os
 from AthenaCommon.SystemOfUnits import MeV, joule
 from AthenaCommon.PhysicalConstants import hbar_Planck, h_Planck
 from AthenaCommon.Logging import logging
-from G4AtlasApps.SimFlags import simFlags
-
+from functools import lru_cache
 
+@lru_cache
 def getPDGTABLE(table):
     # Delete a local file if present
     if os.path.isfile(table):
@@ -43,10 +43,6 @@ def getPDGTABLE(table):
     return True
 
 
-# retreive the PDGTABLE file
-tableRetrieved = getPDGTABLE(simFlags.ExtraParticlesPDGTABLE.get_Value())
-
-
 class ExtraParticle(object):
     name = ""
     mass = -1
diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.AMSB.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.AMSB.py
index 879b1bd9ef8c..e9b1aab03bec 100644
--- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.AMSB.py
+++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.AMSB.py
@@ -3,32 +3,34 @@ def get_and_fix_PDGTABLE(replace):
     import os, shutil, re
 
     # Download generic PDGTABLE (overwrite existing one if it exists)
-    import ExtraParticles.PDGHelpers
-    shutil.move('PDGTABLE.MeV', 'PDGTABLE.MeV.org')
+    from G4AtlasApps.SimFlags import simFlags
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE(simFlags.ExtraParticlesPDGTABLE.get_Value()):
+        shutil.move('PDGTABLE.MeV', 'PDGTABLE.MeV.org')
 
-    # an example line to illustrate the fixed format, see PDGTABLE.MeV for more details
-    # M 1000022                          0.E+00         +0.0E+00 -0.0E+00 ~chi(0,1)     0
+        # an example line to illustrate the fixed format, see PDGTABLE.MeV for more details
+        # M 1000022                          0.E+00         +0.0E+00 -0.0E+00 ~chi(0,1)     0
 
-    lines = open('PDGTABLE.MeV.org').readlines()
-    for pdgid,mass,name,charge in replace:
-        if not re.search(r'[MW]\s+'+str(pdgid)+'\s+\S+', ''.join(lines)):
-            lines.append('M' + str(pdgid).rjust(8) +''.ljust(26) +
-                         ('%11.5E' % mass).ljust(15) +
-                         '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
-                         name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
-            lines.append('W' + str(pdgid).rjust(8) +''.ljust(26) +
-                         '0.E+00'.ljust(15) + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
-                         name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
-        else:
-            from past.builtins import xrange # Temporary workaround for python3 compatibility use range in CA-based config
-            for i in xrange(len(lines)):
-                if re.search(r'M\s+'+str(pdgid)+'\s+\S+', lines[i]):
-                    l = lines[i]
-                    lines[i] = l[0:35] + ('%11.5E' % mass).ljust(14) + l[49:]
+        lines = open('PDGTABLE.MeV.org').readlines()
+        for pdgid,mass,name,charge in replace:
+            if not re.search(r'[MW]\s+'+str(pdgid)+'\s+\S+', ''.join(lines)):
+                lines.append('M' + str(pdgid).rjust(8) +''.ljust(26) +
+                             ('%11.5E' % mass).ljust(15) +
+                             '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+                lines.append('W' + str(pdgid).rjust(8) +''.ljust(26) +
+                             '0.E+00'.ljust(15) + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+            else:
+                from past.builtins import xrange # Temporary workaround for python3 compatibility use range in CA-based config
+                for i in xrange(len(lines)):
+                    if re.search(r'M\s+'+str(pdgid)+'\s+\S+', lines[i]):
+                        l = lines[i]
+                        lines[i] = l[0:35] + ('%11.5E' % mass).ljust(14) + l[49:]
 
-    update = open('PDGTABLE.MeV', 'w')
-    update.write(''.join(lines))
-    update.close()
+        update = open('PDGTABLE.MeV', 'w')
+        update.write(''.join(lines))
+        update.close()
 
 
 doG4SimConfig = True
diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.GMSB.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.GMSB.py
index 6005eaef6842..2f13dfbcae01 100644
--- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.GMSB.py
+++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.GMSB.py
@@ -6,35 +6,37 @@ def get_and_fix_PDGTABLE(replace):
     import os, shutil, re
 
     # Download generic PDGTABLE (overwrite existing one if it exists)
-    import ExtraParticles.PDGHelpers
-    shutil.move('PDGTABLE.MeV', 'PDGTABLE.MeV.org')
-
-    # an example line to illustrate the fixed format, see PDGTABLE.MeV for more details
-    # M 1000022                          0.E+00         +0.0E+00 -0.0E+00 ~chi(0,1)     0
-
-    lines = open('PDGTABLE.MeV.org').readlines()
-    for pdgid,mass,name,charge in replace:
-        if not re.search(r'[MW]\s+'+str(pdgid)+'\s+\S+', ''.join(lines)):
-            lines.append('M' + str(pdgid).rjust(8) +''.ljust(26) +
-                         ('%11.5E' % mass).ljust(15) +
-                         '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
-                         name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
-            lines.append('W' + str(pdgid).rjust(8) +''.ljust(26) +
-                         '0.E+00'.ljust(15) + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
-                         name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
-        else:
-            from past.builtins import xrange # Temporary workaround for python3 compatibility use range in CA-based config
-            for i in xrange(len(lines)):
-                if re.search(r'M\s+'+str(pdgid)+'\s+\S+', lines[i]):
-                    l = lines[i]
-                    lines[i] = l[0:35] + ('%11.5E' % mass).ljust(14) + l[49:]
-
-    update = open('PDGTABLE.MeV', 'w')
-    update.write(''.join(lines))
-    update.close()
-
-    printfunc ('modfied PDGTABLE\n%s\n' % ''.join(lines))
-    sys.stdout.flush()
+    from G4AtlasApps.SimFlags import simFlags
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE(simFlags.ExtraParticlesPDGTABLE.get_Value()):
+        shutil.move('PDGTABLE.MeV', 'PDGTABLE.MeV.org')
+
+        # an example line to illustrate the fixed format, see PDGTABLE.MeV for more details
+        # M 1000022                          0.E+00         +0.0E+00 -0.0E+00 ~chi(0,1)     0
+
+        lines = open('PDGTABLE.MeV.org').readlines()
+        for pdgid,mass,name,charge in replace:
+            if not re.search(r'[MW]\s+'+str(pdgid)+'\s+\S+', ''.join(lines)):
+                lines.append('M' + str(pdgid).rjust(8) +''.ljust(26) +
+                             ('%11.5E' % mass).ljust(15) +
+                             '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+                lines.append('W' + str(pdgid).rjust(8) +''.ljust(26) +
+                             '0.E+00'.ljust(15) + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+            else:
+                from past.builtins import xrange # Temporary workaround for python3 compatibility use range in CA-based config
+                for i in xrange(len(lines)):
+                    if re.search(r'M\s+'+str(pdgid)+'\s+\S+', lines[i]):
+                        l = lines[i]
+                        lines[i] = l[0:35] + ('%11.5E' % mass).ljust(14) + l[49:]
+
+        update = open('PDGTABLE.MeV', 'w')
+        update.write(''.join(lines))
+        update.close()
+
+        printfunc ('modfied PDGTABLE\n%s\n' % ''.join(lines))
+        sys.stdout.flush()
 
 def load_files_for_GMSB_scenario(simdict):
 
diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Monopole.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Monopole.py
index e38a23f50e1f..2e6078895ec5 100644
--- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Monopole.py
+++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Monopole.py
@@ -5,33 +5,34 @@
 def load_files_for_monopole_scenario(MASS, GCHARGE):
     import os, shutil, sys
 
-    import ExtraParticles.PDGHelpers
-
-    ALINE1="M 4110000                         {intmass}.E+03       +0.0E+00 -0.0E+00 Monopole         0".format(intmass=int(MASS))
-    ALINE2="W 4110000                          0.E+00         +0.0E+00 -0.0E+00 Monopole         0"
-    BLINE1="4110000 {intmass}.00 0.0 {gcharge} # Monopole".format(intmass=int(MASS), gcharge=GCHARGE)
-    BLINE2="-4110000 {intmass}.00 0.0 -{gcharge} # MonopoleBar".format(intmass=int(MASS), gcharge=GCHARGE)
+    from G4AtlasApps.SimFlags import simFlags
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE(simFlags.ExtraParticlesPDGTABLE.get_Value()):
+        ALINE1="M 4110000                         {intmass}.E+03       +0.0E+00 -0.0E+00 Monopole         0".format(intmass=int(MASS))
+        ALINE2="W 4110000                          0.E+00         +0.0E+00 -0.0E+00 Monopole         0"
+        BLINE1="4110000 {intmass}.00 0.0 {gcharge} # Monopole".format(intmass=int(MASS), gcharge=GCHARGE)
+        BLINE2="-4110000 {intmass}.00 0.0 -{gcharge} # MonopoleBar".format(intmass=int(MASS), gcharge=GCHARGE)
 
-    f=open('PDGTABLE.MeV','a')
-    f.writelines(str(ALINE1))
-    f.writelines('\n')
-    f.writelines(str(ALINE2))
-    f.writelines('\n')
-    f.close()
-    partmod = os.path.isfile('particles.txt')
-    if partmod is True:
-        os.remove('particles.txt')
-    f=open('particles.txt','w')
-    f.writelines(str(BLINE1))
-    f.writelines('\n')
-    f.writelines(str(BLINE2))
-    f.writelines('\n')
-    f.close()
+        f=open('PDGTABLE.MeV','a')
+        f.writelines(str(ALINE1))
+        f.writelines('\n')
+        f.writelines(str(ALINE2))
+        f.writelines('\n')
+        f.close()
+        partmod = os.path.isfile('particles.txt')
+        if partmod is True:
+            os.remove('particles.txt')
+        f=open('particles.txt','w')
+        f.writelines(str(BLINE1))
+        f.writelines('\n')
+        f.writelines(str(BLINE2))
+        f.writelines('\n')
+        f.close()
 
-    del ALINE1
-    del ALINE2
-    del BLINE1
-    del BLINE2
+        del ALINE1
+        del ALINE2
+        del BLINE1
+        del BLINE2
 
 doG4SimConfig = True
 from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py
index 4ace9cf858e5..b511dabe0892 100644
--- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py
+++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Qball.py
@@ -5,35 +5,36 @@
 def load_files_for_qball_scenario(MASS, CHARGE):
     import os, shutil, sys
 
-    import ExtraParticles.PDGHelpers
-
-    CODE=10000000+int(float(CHARGE)*100)
+    from G4AtlasApps.SimFlags import simFlags
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE(simFlags.ExtraParticlesPDGTABLE.get_Value()):
+        CODE=10000000+int(float(CHARGE)*100)
 
-    ALINE1="M {code}                         {intmass}.E+03       +0.0E+00 -0.0E+00 Qball           +".format(code=CODE,intmass=int(MASS))
-    ALINE2="W {code}                         0.E+00         +0.0E+00 -0.0E+00 Qball           +".format(code=CODE)
-    BLINE1="{code}  {intmass}.00  {charge}  0.0 # Qball".format(code=CODE,intmass=int(MASS), charge=CHARGE)
-    BLINE2="-{code}  {intmass}.00  -{charge}  0.0 # QballBar".format(code=CODE,intmass=int(MASS), charge=CHARGE)
+        ALINE1="M {code}                         {intmass}.E+03       +0.0E+00 -0.0E+00 Qball           +".format(code=CODE,intmass=int(MASS))
+        ALINE2="W {code}                         0.E+00         +0.0E+00 -0.0E+00 Qball           +".format(code=CODE)
+        BLINE1="{code}  {intmass}.00  {charge}  0.0 # Qball".format(code=CODE,intmass=int(MASS), charge=CHARGE)
+        BLINE2="-{code}  {intmass}.00  -{charge}  0.0 # QballBar".format(code=CODE,intmass=int(MASS), charge=CHARGE)
 
-    f=open('PDGTABLE.MeV','a')
-    f.writelines(str(ALINE1))
-    f.writelines('\n')
-    f.writelines(str(ALINE2))
-    f.writelines('\n')
-    f.close()
-    partmod = os.path.isfile('particles.txt')
-    if partmod is True:
-        os.remove('particles.txt')
-    f=open('particles.txt','w')
-    f.writelines(str(BLINE1))
-    f.writelines('\n')
-    f.writelines(str(BLINE2))
-    f.writelines('\n')
-    f.close()
+        f=open('PDGTABLE.MeV','a')
+        f.writelines(str(ALINE1))
+        f.writelines('\n')
+        f.writelines(str(ALINE2))
+        f.writelines('\n')
+        f.close()
+        partmod = os.path.isfile('particles.txt')
+        if partmod is True:
+            os.remove('particles.txt')
+        f=open('particles.txt','w')
+        f.writelines(str(BLINE1))
+        f.writelines('\n')
+        f.writelines(str(BLINE2))
+        f.writelines('\n')
+        f.close()
 
-    del ALINE1
-    del ALINE2
-    del BLINE1
-    del BLINE2
+        del ALINE1
+        del ALINE2
+        del BLINE1
+        del BLINE2
 
 doG4SimConfig = True
 from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Quirks.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Quirks.py
index 9f1672cfcb03..7d4d74f20056 100644
--- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Quirks.py
+++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Quirks.py
@@ -1,53 +1,55 @@
 
 import os
 
-import ExtraParticles.PDGHelpers
-
-quirk_firststring=1e-6 #mm
-quirk_maxboost=1e-2
-quirk_maxmerge=1e-6 #mm
-quirk_debugenabled=False
-quirk_debugdist=1000 #mm
-quirk_debugsteps=1000
-
-doG4SimConfig = True
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-import PyUtils.AthFile as af
-try:
-    f = af.fopen(athenaCommonFlags.FilesInput()[0])
-
-    if "StreamHITS" in f.infos["stream_names"]:
-        from Digitization.DigitizationFlags import digitizationFlags
-        simdict = digitizationFlags.specialConfiguration.get_Value()
-        doG4SimConfig = False
-    else:
+from G4AtlasApps.SimFlags import simFlags
+from ExtraParticles.PDGHelpers import getPDGTABLE
+if getPDGTABLE(simFlags.ExtraParticlesPDGTABLE.get_Value()):
+
+    quirk_firststring=1e-6 #mm
+    quirk_maxboost=1e-2
+    quirk_maxmerge=1e-6 #mm
+    quirk_debugenabled=False
+    quirk_debugdist=1000 #mm
+    quirk_debugsteps=1000
+
+    doG4SimConfig = True
+    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+    import PyUtils.AthFile as af
+    try:
+        f = af.fopen(athenaCommonFlags.FilesInput()[0])
+
+        if "StreamHITS" in f.infos["stream_names"]:
+            from Digitization.DigitizationFlags import digitizationFlags
+            simdict = digitizationFlags.specialConfiguration.get_Value()
+            doG4SimConfig = False
+        else:
+            from G4AtlasApps.SimFlags import simFlags
+            simdict = simFlags.specialConfiguration.get_Value()
+    except:
         from G4AtlasApps.SimFlags import simFlags
         simdict = simFlags.specialConfiguration.get_Value()
-except:
-    from G4AtlasApps.SimFlags import simFlags
-    simdict = simFlags.specialConfiguration.get_Value()
-
-quirk_mass = float(simdict["MASS"])
-quirk_charge = float(simdict["CHARGE"])
-quirk_pdgid = int(simdict["PDGID"])
-quirk_stringforce = float(simdict["STRINGFORCE"])
-
-f = open('PDGTABLE.MeV', 'a')
-f.write("M%8d                          %.8E +0.0E+00 -0.0E+00 Quirk               +\n" % (quirk_pdgid, quirk_mass))
-f.write("W%8d                          0.E+00         +0.0E+00 -0.0E+00 Quirk               +\n" % quirk_pdgid)
-f.close()
-
-if doG4SimConfig:
-    f = open('quirks_setup.txt', 'w')
-    for x in [quirk_mass, quirk_charge, quirk_pdgid, quirk_stringforce, quirk_firststring, quirk_maxboost, quirk_maxmerge, quirk_maxmerge]:
-        f.write(repr(x) + "\n")
-    if quirk_debugenabled:
-        f.write("1\n")
-        f.write(repr(quirk_debugdist) + "\n")
-        f.write(repr(quirk_debugsteps) + "\n")
-    else:
-        f.write("0\n")
+
+    quirk_mass = float(simdict["MASS"])
+    quirk_charge = float(simdict["CHARGE"])
+    quirk_pdgid = int(simdict["PDGID"])
+    quirk_stringforce = float(simdict["STRINGFORCE"])
+
+    f = open('PDGTABLE.MeV', 'a')
+    f.write("M%8d                          %.8E +0.0E+00 -0.0E+00 Quirk               +\n" % (quirk_pdgid, quirk_mass))
+    f.write("W%8d                          0.E+00         +0.0E+00 -0.0E+00 Quirk               +\n" % quirk_pdgid)
     f.close()
 
-    simFlags.PhysicsOptions += ["QuirksPhysicsTool"]
-del quirk_firststring, quirk_maxboost, quirk_maxmerge, quirk_debugenabled, quirk_debugdist, quirk_debugsteps, doG4SimConfig, simdict, f, quirk_mass, quirk_charge, quirk_pdgid, quirk_stringforce
+    if doG4SimConfig:
+        f = open('quirks_setup.txt', 'w')
+        for x in [quirk_mass, quirk_charge, quirk_pdgid, quirk_stringforce, quirk_firststring, quirk_maxboost, quirk_maxmerge, quirk_maxmerge]:
+            f.write(repr(x) + "\n")
+        if quirk_debugenabled:
+            f.write("1\n")
+            f.write(repr(quirk_debugdist) + "\n")
+            f.write(repr(quirk_debugsteps) + "\n")
+        else:
+            f.write("0\n")
+        f.close()
+
+        simFlags.PhysicsOptions += ["QuirksPhysicsTool"]
+    del quirk_firststring, quirk_maxboost, quirk_maxmerge, quirk_debugenabled, quirk_debugdist, quirk_debugsteps, doG4SimConfig, simdict, f, quirk_mass, quirk_charge, quirk_pdgid, quirk_stringforce
diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.RHadronsPythia8.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.RHadronsPythia8.py
index 14a35b62a73b..7c68c7e9ce88 100644
--- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.RHadronsPythia8.py
+++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.RHadronsPythia8.py
@@ -19,11 +19,12 @@ def create_rhadron_particles_file(input_param_card='SLHA_INPUT.DAT',spectrum=1):
 def create_rhadron_pdgtable(input_param_card='SLHA_INPUT.DAT',spectrum=1):
     """Add lines to the PDG table"""
 
-    import ExtraParticles.PDGHelpers
-
-    # Update the PDG table using our helper function
-    from RHadrons.RHadronMasses import update_PDG_table
-    update_PDG_table('SLHA_INPUT.DAT','PDGTABLE.MeV',spectrum)
+    from G4AtlasApps.SimFlags import simFlags
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE(simFlags.ExtraParticlesPDGTABLE.get_Value()):
+        # Update the PDG table using our helper function
+        from RHadrons.RHadronMasses import update_PDG_table
+        update_PDG_table('SLHA_INPUT.DAT','PDGTABLE.MeV',spectrum)
 
 
 def addLineToPhysicsConfiguration(KEY, VALUE):
diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.SleptonsLLP.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.SleptonsLLP.py
index 648cc0af2554..18f1acd29b1b 100644
--- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.SleptonsLLP.py
+++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.SleptonsLLP.py
@@ -6,35 +6,37 @@ def get_and_fix_PDGTABLE(replace):
     import os, shutil, re, sys
 
     # Download generic PDGTABLE (do not overwrite existing one if it exists, use existing one instead) 
-    import ExtraParticles.PDGHelpers
-    shutil.move('PDGTABLE.MeV', 'PDGTABLE.MeV.org')
+    from G4AtlasApps.SimFlags import simFlags
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE(simFlags.ExtraParticlesPDGTABLE.get_Value()):
+        shutil.move('PDGTABLE.MeV', 'PDGTABLE.MeV.org')
 
     # an example line to illustrate the fixed format, see PDGTABLE.MeV for more details
-    # M 1000022                          0.E+00         +0.0E+00 -0.0E+00 ~chi(0,1)     0
+        # M 1000022                          0.E+00         +0.0E+00 -0.0E+00 ~chi(0,1)     0
 
-    lines = open('PDGTABLE.MeV.org').readlines()
-    for pdgid,mass,name,charge in replace:
-        if not re.search(r'[MW]\s+'+str(pdgid)+'\s+\S+', ''.join(lines)):
-            lines.append('M' + str(pdgid).rjust(8) +''.ljust(26) +
-                         ('%11.5E' % mass).ljust(15) +
-                         '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
-                         name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
-            lines.append('W' + str(pdgid).rjust(8) +''.ljust(26) +
-                         '0.E+00'.ljust(15) + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
-                         name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
-        else:
-            from past.builtins import xrange # Temporary workaround for python3 compatibility use range in CA-based config
-            for i in xrange(len(lines)):
-                if re.search(r'M\s+'+str(pdgid)+'\s+\S+', lines[i]):
-                    l = lines[i]
-                    lines[i] = l[0:35] + ('%11.5E' % mass).ljust(14) + l[49:]
+        lines = open('PDGTABLE.MeV.org').readlines()
+        for pdgid,mass,name,charge in replace:
+            if not re.search(r'[MW]\s+'+str(pdgid)+'\s+\S+', ''.join(lines)):
+                lines.append('M' + str(pdgid).rjust(8) +''.ljust(26) +
+                             ('%11.5E' % mass).ljust(15) +
+                             '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+                lines.append('W' + str(pdgid).rjust(8) +''.ljust(26) +
+                             '0.E+00'.ljust(15) + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+            else:
+                from past.builtins import xrange # Temporary workaround for python3 compatibility use range in CA-based config
+                for i in xrange(len(lines)):
+                    if re.search(r'M\s+'+str(pdgid)+'\s+\S+', lines[i]):
+                        l = lines[i]
+                        lines[i] = l[0:35] + ('%11.5E' % mass).ljust(14) + l[49:]
 
-    update = open('PDGTABLE.MeV', 'w')
-    update.write(''.join(lines))
-    update.close()
+        update = open('PDGTABLE.MeV', 'w')
+        update.write(''.join(lines))
+        update.close()
 
-    printfunc ('modfied PDGTABLE\n%s\n' % ''.join(lines))
-    sys.stdout.flush()
+        printfunc ('modfied PDGTABLE\n%s\n' % ''.join(lines))
+        sys.stdout.flush()
 
 def load_files_for_sleptonLLP_scenario(simdict):
 
diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.fcp.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.fcp.py
index ddfe4c570cb5..81b57bf2cac8 100755
--- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.fcp.py
+++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.fcp.py
@@ -13,24 +13,26 @@ def load_files_for_fcp_scenario(MASS, CHARGE, X, Y):
     particleLine1="{code}  {intmass}.00  {fcharge}  0.0 # fcp\n".format(code=CODE,intmass=int(MASS), fcharge=float(CHARGE))
     particleLine2="-{code}  {intmass}.00  -{fcharge}  0.0 # fcpBar\n".format(code=CODE,intmass=int(MASS), fcharge=float(CHARGE))
 
-    import ExtraParticles.PDGHelpers
-
-    f=open('PDGTABLE.MeV','a')
-    f.writelines(str(pdgLine1))
-    f.writelines(str(pdgLine2))
-    f.close()
-    partmod = os.path.isfile('particles.txt')
-    if partmod is True:
-        os.remove('particles.txt')
-    f=open('particles.txt','w')
-    f.writelines(str(particleLine1))
-    f.writelines(str(particleLine2))
-    f.close()
+    # retreive the PDGTABLE file
+    from G4AtlasApps.SimFlags import simFlags
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE(simFlags.ExtraParticlesPDGTABLE.get_Value()):
+        f=open('PDGTABLE.MeV','a')
+        f.writelines(str(pdgLine1))
+        f.writelines(str(pdgLine2))
+        f.close()
+        partmod = os.path.isfile('particles.txt')
+        if partmod is True:
+            os.remove('particles.txt')
+        f=open('particles.txt','w')
+        f.writelines(str(particleLine1))
+        f.writelines(str(particleLine2))
+        f.close()
 
-    del pdgLine1
-    del pdgLine2
-    del particleLine1
-    del particleLine2
+        del pdgLine1
+        del pdgLine2
+        del particleLine1
+        del particleLine2
 
 doG4SimConfig = True
 from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-- 
GitLab


From fcf8725d0ce7b202d240543bf7e3a69425920edc Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Tue, 21 Sep 2021 15:34:11 +0200
Subject: [PATCH 233/347] Revert "Merge branch
 'gaudi82.DetDescrCnvSvc-20210917' into 'master'"

This reverts merge request !46585
---
 .../DetDescrCnvSvc/src/DetDescrCnvSvc.cxx             | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx b/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx
index c0beb1e4b511..c5f9af64e3fa 100755
--- a/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx
+++ b/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Include files
@@ -122,15 +122,6 @@ DetDescrCnvSvc::initialize()     {
 	log << MSG::INFO << "Found DetectorStore service" << endmsg;
     }
 
-    // Working around Gaudi Issue https://gitlab.cern.ch/gaudi/Gaudi/issues/82
-    if (m_detStore->FSMState() < Gaudi::StateMachine::INITIALIZED) {
-      log << MSG::INFO << "Explicitly initializing DetDescrCnvSvc" << endmsg;
-      if (m_detStore->sysInitialize().isFailure()) {
-	log << MSG::FATAL << "Error initializing DetectorStore !" << endmsg;
-	return StatusCode::FAILURE;
-      }
-    } 
-
     // fill in the Addresses for Transient Detector Store objects
 
     log << MSG::INFO << " filling proxies for detector managers " <<endmsg ;
-- 
GitLab


From 78a95d0d10fc6c0fe75ecfa2c3e12e47352703af Mon Sep 17 00:00:00 2001
From: tstreble <thomas.strebler@cern.ch>
Date: Tue, 21 Sep 2021 15:48:15 +0200
Subject: [PATCH 234/347] Fix ATR-24177

---
 .../TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py        | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py b/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py
index a06e0744fb20..bc3d39ff061e 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py
+++ b/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py
@@ -69,7 +69,10 @@ class ConfiguredTrackingGeometrySvc( Trk__TrackingGeometrySvc ) :
               if hasattr(ToolSvc, TrkDetFlags.InDetTrackingGeometryBuilderName()):
                   InDetTrackingGeometryBuilder = getattr(ToolSvc, TrkDetFlags.InDetTrackingGeometryBuilderName())
           else:
-              from InDetTrackingGeometry.ConfiguredStagedTrackingGeometryBuilder import ConfiguredStagedTrackingGeometryBuilder as IDGeometryBuilder
+              if not TrkDetFlags.InDetStagedGeometryBuilder():
+                  from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder
+              else:
+                  from InDetTrackingGeometry.ConfiguredStagedTrackingGeometryBuilder import ConfiguredStagedTrackingGeometryBuilder as IDGeometryBuilder
               InDetTrackingGeometryBuilder = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder')
                 
           InDetTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
-- 
GitLab


From aca407cfc9b7939c5b39605c9981f27c0c415192 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 21 Sep 2021 16:11:32 +0200
Subject: [PATCH 235/347] RecExCommon: delete obsolete shell testing scripts

Delete obsolete testing scripts that are unused and have not been
updated in a very long time:
- `RecExCommon_doall.sh`
- `qtest_run1.sh`
- `qtest_run2.sh`
---
 .../RecExample/RecExCommon/CMakeLists.txt     |   2 +-
 .../RecExCommon/share/RecExCommon_doall.sh    | 449 ------------------
 .../RecExCommon/share/qtest_run1.sh           |  28 --
 .../RecExCommon/share/qtest_run2.sh           |  27 --
 4 files changed, 1 insertion(+), 505 deletions(-)
 delete mode 100755 Reconstruction/RecExample/RecExCommon/share/RecExCommon_doall.sh
 delete mode 100755 Reconstruction/RecExample/RecExCommon/share/qtest_run1.sh
 delete mode 100755 Reconstruction/RecExample/RecExCommon/share/qtest_run2.sh

diff --git a/Reconstruction/RecExample/RecExCommon/CMakeLists.txt b/Reconstruction/RecExample/RecExCommon/CMakeLists.txt
index e74cfbac9c44..42387bdca807 100644
--- a/Reconstruction/RecExample/RecExCommon/CMakeLists.txt
+++ b/Reconstruction/RecExample/RecExCommon/CMakeLists.txt
@@ -8,4 +8,4 @@ atlas_subdir( RecExCommon )
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
 atlas_install_runtime( data/*.ascii.gz )
-atlas_install_scripts( share/RecExCommon_links.sh share/recexcommon-links.py share/qtest_run1.sh share/qtest_run2.sh )
+atlas_install_scripts( share/RecExCommon_links.sh share/recexcommon-links.py )
diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_doall.sh b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_doall.sh
deleted file mode 100755
index 32cc41d7d8f9..000000000000
--- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_doall.sh
+++ /dev/null
@@ -1,449 +0,0 @@
-#set -x
-#
-#single script to run RecExCommon in an empty directory
-#
-#    MYRELEASE need to be set before hand if the script 
-#is not taken from a release (official or nightly)
-#    export MYRELEASE=/afs/cern.ch/atlas/software/dist/6.2.0
-#
-#    MYTAGS need to be set to configure cmt if something 
-#  different from the default ( opt ) is needed
-#     export MYTAGS=dbg
-#
-# no setup of CMT should have been done
-#
-# possible argument (one value allowed)
-#  copy if the content should be copied rather than checked out
-#         this allows testing of private modifications. However, cvs 
-#         can then not be used on this directory
-#  head if the content should be checked out from the head rather 
-#         than from the tag taken from the directory tree
-#  RecExCommon-xx-yy-zz if a specific tag should be used, different 
-#               from the one in the directory sturcture
-#  ""     default is to check out from the tag in directory structure
-#
-#examples:
-#  source /afs/cern.ch/atlas/software/dist/3.0.1/Reconstruction/RecExample/RecExCommon/*/share/RecExCommon_doall.sh
-#
-# or 
-# export MYRELEASE=/afs/cern.ch/atlas/software/dist/3.0.1
-# source ~user/mycbnt/Reconstruction/RexExample/RecExCommon/*/share/RecExCommon_doall.sh copy
-#
-#directory where the script is run
-export WORKAREA=`pwd`
-#cmt version 
-
-#if test "${CMTVERSION}" = "" ; then
-#CMT version, might be overriden by the one defined in the release
-
-
-export CMTVERSION=v1r20p20090520
-
-
-
-#fi
-
-#see if there is anything in the directory
-
-ANYTHING=`ls`
-if test ! "${ANYTHING}" = "" ; then
-  echo "## working directory not empty"
-  echo "## RecExCommon_doall.sh need be run in a clean directory. Stop"
-  return
-fi
-
-
-
-#get where this script is taken (this work only if the script 
-# is taken from  a RecExCommon package that has been cmt checked out
-# wether in any release (even nightly) or in a private area
-# and only an absolute path to the script is used
-
-script=$0
-if test "`dirname ${script}`" = ".."; then
-  echo "##Please use an absolute path to reach this script"
-  return
-fi
-
-
-FROMDIR=`dirname $script`
-
-FROMDIR=`dirname ${FROMDIR}`
-
-VERSIONFILE=${FROMDIR}/cmt/version.cmt
-
-if [ -f $VERSIONFILE ]; then
-    MYTAG=`cat ${FROMDIR}/cmt/version.cmt`
-    PROJECTBUILD=1
-    echo "## Project build recognised"
-else
-    MYTAG=${FROMDIR}
-    FROMDIR=`dirname ${FROMDIR}`
-    PROJECTBUILD=0
-    echo "## Monolithic build recognised. ERROR nnot supported anymore !"
-    return
-fi
-echo "MYTAG=" $MYTAG
-
-
-FROMDIR=`dirname ${FROMDIR}`
-FROMDIR=`dirname ${FROMDIR}`
-FROMDIR=`dirname ${FROMDIR}`
-
-TOPREL=`basename ${FROMDIR}`
-
-MYTAG=`basename ${MYTAG}`
-
-echo FROMDIR=$FROMDIR
-echo MYTAG=$MYTAG
-echo TOPREL=$TOPREL
-
-TODO="$1"
-echo argument = $1
-if [ $# -eq 0  ] ; then
-    echo no arguments
-    echo I check out  RecExCommon with  tag  $MYTAG 
-    TODO="nothing"
-elif [ $# -eq 1  ] ; then
- echo one argument seen
- if [ $TODO = "copy" ] ; then
-    echo I copy RecExCommon from $FROMDIR with tag $MYTAG 
- elif [ $TODO = "head" ] ; then
-    MYTAG="HEAD"
-    echo I check out  RecExCommon from the HEAD 
- else
-    MYTAG=$TODO
-    echo I check out  RecExCommon with  tag  $MYTAG with 
- fi
-else
-  echo Invalid number of arguments. Should be 0 or 1.
-  echo stop
-  return
-fi
-
-if test ! "${MYRELEASE}" = ""; then
-    echo I use additional release $MYRELEASE
-    RELEASE=$MYRELEASE
-
-else
-
-    echo I use same release as from $FROMDIR
-    RELEASE=$TOPREL
-
-fi
-
-echo RELEASE=$RELEASE
-
-
-echo "##using tags $MYTAGS"  
-
-#the release to be used
-#CMTPATH: packages are taken first in the new area,
-#then in the area where the script reside
-#then (possibly) in a release specified as follows
-#export MYRELEASE=/afs/cern.ch/atlas/software/dist/2.4.0
-#It is not necessary to specify MYRELEASE is the script is taken
-#directly from a release (even a nightly one)
-
-mkdir -p cmtdir
-cd cmtdir
-
-rm -f requirements
-
-echo WORKAREA=$WORKAREA
-
-echo "## set up CMT with user home requirements file in cvs"
-
-
-    echo "## ...  project build"
-  # take into account that AtlasAnalysis build 1.3.0 correspond to release 11.3.0 
-  # while AtlasAnalysis rel_1 correspond to release rel_1
-  NPAT=`echo $RELEASE | cut -d. -f3`
-  if [ $RELEASE = $NPAT ] ; then
-      RELEASETAG=$RELEASE
-      echo "## nightly project build use release tag:"$RELEASETAG
-  else
-      NMAJ=`echo $RELEASE | cut -d. -f1`
-      NMIN=`echo $RELEASE | cut -d. -f2`
-      #only project AtlasOffline NEWMAJ=$(($NMAJ+10))
-      NEWMAJ=$NMAJ
-      NCACHE=`echo $RELEASE | cut -d. -f4`
-      if [ ! -z $NCACHE ] ; then
-         RELEASETAG=$NEWMAJ.$NMIN.$NPAT.$NCACHE
-      else
-	  RELEASETAG=$NEWMAJ.$NMIN.$NPAT
-      fi	  
-      echo "## project release use release tag:"$RELEASETAG
-  fi
-
-
-
-echo "## ...  building requirements "
-    cat <<EOF >|requirements
-set   CMTSITE  CERN
-set   SITEROOT /afs/cern.ch
-set ATLAS_DIST_AREA /afs/cern.ch/atlas/software/dist                               
-# do not append release number to test area
-apply_tag oneTest
-macro ATLAS_TEST_AREA "${WORKAREA}"
-# optimised by default
-# apply_tag  dbg
-apply_tag  setup
-apply_tag  setupCMT
-apply_tag 32
-apply_tag ${RELEASETAG} 
-EOF
-
-
-#idem if test "${MYTAGS}X" != "X" ; then
-#idem if [ "${MYTAGS}X" != "X" ] ; then
-if [ ${(c)#MYTAGS} -ne 0 ] ; then
-    echo "apply_tag ${MYTAGS} " >> requirements
-fi
-
-
-
-
-    if [ ! -z `echo $FROMDIR | awk /"14.1.0.Y"/` ]; then
-	echo "apply_tag 14.1.0.Y " >> requirements
-    fi
-
-
-
-    if [ ! -z `echo $FROMDIR | awk /"14.2.0.Y"/` ]; then
-	echo "apply_tag 14.2.0.Y " >> requirements
-    fi
-
-
-    if [ ! -z `echo $FROMDIR | awk /"14.2.10.Y"/` ]; then
-	echo "apply_tag 14.2.10.Y " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"14.4.X.Y-VAL"/` ]; then
-	echo "apply_tag 14.4.X.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"14.4.X.Y"/` ]; then
-	echo "apply_tag 14.4.X.Y " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"14.5.X.Y-VAL"/` ]; then
-	echo "apply_tag 14.5.X.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"14.5.X.Y"/` ]; then
-	echo "apply_tag 14.5.X.Y " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"14.5.X-VAL"/` ]; then
-	echo "apply_tag 14.5.X-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"14.5.X"/` ]; then
-	echo "apply_tag 14.5.X " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"15.0.0.Y-VAL"/` ]; then
-	echo "apply_tag 15.0.0.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.0.0.Y"/` ]; then
-	echo "apply_tag 15.0.0.Y " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"15.1.X.Y-VAL"/` ]; then
-	echo "apply_tag 15.1.X.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.1.X.Y"/` ]; then
-	echo "apply_tag 15.1.X.Y " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"15.2.X.Y-VAL"/` ]; then
-	echo "apply_tag 15.2.X.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.2.X.Y"/` ]; then
-	echo "apply_tag 15.2.X.Y " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"15.3.X.Y-VAL"/` ]; then
-	echo "apply_tag 15.3.X.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.3.X.Y"/` ]; then
-	echo "apply_tag 15.3.X.Y " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"15.4.X.Y-VAL"/` ]; then
-	echo "apply_tag 15.4.X.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.4.X.Y"/` ]; then
-	echo "apply_tag 15.4.X.Y " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"15.5.X.Y-VAL"/` ]; then
-	echo "apply_tag 15.5.X.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.5.X.Y"/` ]; then
-	echo "apply_tag 15.5.X.Y " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.5.X-VAL"/` ]; then
-	echo "apply_tag 15.5.X-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.5.X"/` ]; then
-	echo "apply_tag 15.5.X " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"15.6.X.Y-VAL"/` ]; then
-	echo "apply_tag 15.6.X.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.6.X.Y"/` ]; then
-	echo "apply_tag 15.6.X.Y " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.6.X-VAL"/` ]; then
-	echo "apply_tag 15.6.X-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"15.6.X"/` ]; then
-	echo "apply_tag 15.6.X " >> requirements
-    fi
-
-
-    if [ ! -z `echo $FROMDIR | awk /"16.0.X.Y-VAL"/` ]; then
-	echo "apply_tag 15.3.X.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"16.0.X.Y"/` ]; then
-	echo "apply_tag 15.3.X.Y " >> requirements
-    fi
-
-
-
-    if [ ! -z `echo $FROMDIR | awk /"14.2.2X.Y-VAL"/` ]; then
-	echo "apply_tag 14.2.2X.Y-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"14.2.2X.Y"/` ]; then
-	echo "apply_tag 14.2.2X.Y " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"14.2.2X-VAL"/` ]; then
-	echo "apply_tag 14.2.2X-VAL " >> requirements
-    elif [ ! -z `echo $FROMDIR | awk /"14.2.2X"/` ]; then
-	echo "apply_tag 14.2.2X " >> requirements
-    fi
-
-
-    if [ ! -z `echo $FROMDIR | awk /AtlasPoint1/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag AtlasPoint1 " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /AtlasTier0/` ]; then
-	echo "apply_tag AtlasTier0 " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /AtlasProduction/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag AtlasProduction " >> requirements
-    fi
-
-
-    if [ ! -z `echo $FROMDIR | awk /bugfix/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag bugfix " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /devval/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag devval " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /"\/val"/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag val " >> requirements
-    fi
-
-#    if [ ! -z `echo $FROMDIR | awk /"VAL"/` ]; then
-#	echo "##bugfix nightly release"
-#	echo "apply_tag val " >> requirements
-#    fi
-
-    if [ ! -z `echo $FROMDIR | awk /pcache/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag pcache " >> requirements
-	echo "apply_tag AtlasProduction " >> requirements
-	echo "apply_tag gcc323 " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /devmig0/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag devmig0 " >> requirements
-	echo "apply_tag dbg " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /devmig1/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag devmig1 " >> requirements
-	echo "apply_tag dbg " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /devmig2/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag devmig2 " >> requirements
-	echo "apply_tag dbg " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /devmig3/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag devmig3 " >> requirements
-	echo "apply_tag dbg " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /devmig4/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag devmig4 " >> requirements
-	echo "apply_tag dbg " >> requirements
-    fi
-
-    if [ ! -z `echo $FROMDIR | awk /lcg/` ]; then
-	echo "##bugfix nightly release"
-	echo "apply_tag lcg " >> requirements
-    fi
-
-
-echo "use AtlasLogin AtlasLogin-* /afs/cern.ch/atlas/software/dist" >> requirements
-
-
-
-
-echo "## requirements built"
-cat requirements
-
-unset CMTPATH
-unset CMTCONFIG
-
-CMTROOT=/afs/cern.ch/sw/contrib/CMT/$CMTVERSION; export CMTROOT
-. ${CMTROOT}/mgr/setup.sh ""
-which cmt
-cmt config
-source setup.sh 
-
-cd ../
-
-echo CMTROOT=$CMTROOT
-echo CMTCONFIG=$CMTCONFIG
-echo CMTPATH=$CMTPATH
-
-NEWDIR=Reconstruction/RecExample/RecExCommon
-
-if test "${TODO}" = "copy" ; then
-#create by hand the correct structure
-
-  mkdir -p $NEWDIR
-  cd $NEWDIR
-  mkdir share
-  mkdir cmt
-  mkdir Testing
-#copy the files accompanying the script
-  cp -pf  ${FROMDIR}/${NEWDIR}/* .
-  cp -pf  ${FROMDIR}/${NEWDIR}/share/* share/
-  cp -pf  ${FROMDIR}/${NEWDIR}/Testing/* Testing/
-  cp -pf  ${FROMDIR}/${NEWDIR}/cmt/* cmt/
-#clean
-  cd cmt
-  cmt config
-  gmake clean
-else
-#checkout
- cmt co -r $MYTAG Reconstruction/RecExample/RecExCommon   
- cd $NEWDIR
- cd cmt
-fi
-
-echo "##Build"
-
-echo "##Setup environment variables" 
-# (to be done once per window )
-# empty argument necessary in scripts
-# should not be necessary anymore when using apply_tag setup
-#source setup.sh ""
-gmake
-
-echo "##now run" 
-gmake check
-
-echo "##done \a" 
diff --git a/Reconstruction/RecExample/RecExCommon/share/qtest_run1.sh b/Reconstruction/RecExample/RecExCommon/share/qtest_run1.sh
deleted file mode 100755
index 427ca148abcf..000000000000
--- a/Reconstruction/RecExample/RecExCommon/share/qtest_run1.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# fun starts here : need different configuration for 19.X
-#RELEASEDATA=`cmt show projects | grep -v '(current)' | head -1 | sed "s/.\+(in \(.\+\)).\+/\1/g"`
-#RELEASEDATA="$RELEASEDATA/InstallArea/$CMTCONFIG/ReleaseData"
-IFS=:
-set -f
-helper=( $CMAKE_PREFIX_PATH )
-RELEASEDATA="${helper[0]}/ReleaseData"
-
-
-release=`grep '^release:' $RELEASEDATA | gawk -F \: '{print $2}'`
-
-nn=`grep '^nightly name:' $RELEASEDATA | gawk -F \: '{print $2}'`
-pn=`grep '^project name:' $RELEASEDATA | gawk -F \: '{print $2}'`
-nr=`grep '^nightly release:' $RELEASEDATA | gawk -F \: '{print $2}'`
-echo "Will run Qtest on run1 MC on release $release build from nightly $nn $pn $nr"
-
-REL19_preExec=''
-if  [[ $release == 19.* ]] ;
-then
-    echo "Need special MaterialVersion V17 for releases in the 19.X series"
-    REL19_preExec=';from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags;TrkDetFlags.MaterialVersion=17'
-
-fi
-
-# Run 1 (RDO)
-Reco_tf.py --DBRelease='current' --autoConfiguration='everything' --conditionsTag='OFLCOND-RUN12-SDR-22' --geometryVersion='ATLAS-R1-2012-02-00-00' --maxEvents 25 --postExec 'CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' 'HITtoRDO:job.StandardPileUpToolsAlg.PileUpTools["MergeMcEventCollTool"].OnlySaveSignalTruth=True' --postInclude='RecJobTransforms/UseFrontier.py' --preExec 'rec.doTrigger.set_Value_and_Lock(False);rec.Commissioning.set_Value_and_Lock(True);jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0)' 'HITtoRDO:from LArROD.LArRODFlags import larRODFlags;larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.UseDelta.set_Value_and_Lock(3)' "RAWtoESD:from LArROD.LArRODFlags import larRODFlags;larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.UseDelta.set_Value_and_Lock(3);from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False$REL19_preExec" "ESDtoAOD:TriggerFlags.AODEDMSet='AODFULL'$REL19_preExec" --skipEvents='0' --inputRDOFile /afs/cern.ch/atlas/project/rig/referencefiles/QTests-Run2/RDO-run1.Nov5.2014-500events.pool.root --outputAODFile='AOD.pool.root' --outputESDFile='ESD.pool.root'
diff --git a/Reconstruction/RecExample/RecExCommon/share/qtest_run2.sh b/Reconstruction/RecExample/RecExCommon/share/qtest_run2.sh
deleted file mode 100755
index d463afd8c0e0..000000000000
--- a/Reconstruction/RecExample/RecExCommon/share/qtest_run2.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-# fun start here : need different configuration for 19.1
-#RELEASEDATA=`cmt show projects | grep -v '(current)' | head -1 | sed "s/.\+(in \(.\+\)).\+/\1/g"`
-#RELEASEDATA="$RELEASEDATA/InstallArea/$CMTCONFIG/ReleaseData"
-IFS=:
-set -f
-helper=( $CMAKE_PREFIX_PATH )
-RELEASEDATA="${helper[0]}/ReleaseData"
-
-
-release=`grep '^release:' $RELEASEDATA | gawk -F \: '{print $2}'`
-
-nn=`grep '^nightly name:' $RELEASEDATA | gawk -F \: '{print $2}'`
-pn=`grep '^project name:' $RELEASEDATA | gawk -F \: '{print $2}'`
-nr=`grep '^nightly release:' $RELEASEDATA | gawk -F \: '{print $2}'`
-echo "Will run Qtest on run2 MC on release $release build from nightly $nn $pn $nr"
-
-REL191_preExec=''
-if  [[ $release == 19.1.* ]] ;
-then
-    echo "Need special egamma options for releases in the 19.1 series"
-    REL191_preExec='"RAWtoESD:ToolSvc.egammaConversionFinderTool.VertexFitterTool=ToolSvc.InDetAdaptiveVxFitterTool;ToolSvc.egammaAmbiguityTool.minNoPixHits=3"'
-fi
-
-# Run 2 (RDO)
-Reco_tf.py --AMITag r5787 --DBRelease="current" --autoConfiguration="everything" --conditionsTag="OFLCOND-RUN12-SDR-22" --geometryVersion="ATLAS-R2-2015-01-01-00" --maxEvents 25 --postExec "CfgMgr.MessageSvc().setError+=[\"HepMcParticleLink\"]" "HITtoRDO:job.StandardPileUpToolsAlg.PileUpTools[\"MergeMcEventCollTool\"].OnlySaveSignalTruth=True" $REL191_preeExec --postInclude="RecJobTransforms/UseFrontier.py" --preExec "rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25);from LArROD.LArRODFlags import larRODFlags;larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4)" "RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup=\"MC_pp_v5\";from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False" "ESDtoAOD:TriggerFlags.AODEDMSet=\"AODFULL\"" --preInclude HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInclude.PileUpBunchTrainsUpgradeConfig1_25ns.py,RunDependentSimData/configLumi_run222222.py --inputRDOFile /afs/cern.ch/atlas/project/rig/referencefiles/QTests-Run2/RDO-run2.Nov5.2014-500events.pool.root --outputAODFile="AOD.pool.root" --outputESDFile="ESD.pool.root"
-- 
GitLab


From 4c84d8080cd1742ca9b6da81f2d0f31d89d8b405 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 21 Sep 2021 15:49:28 +0200
Subject: [PATCH 236/347] RunTier0Tests: remove reference to obsolete trigger
 menu flag

---
 Tools/PROCTools/python/RunTier0Tests.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/Tools/PROCTools/python/RunTier0Tests.py b/Tools/PROCTools/python/RunTier0Tests.py
index a0aea66e61bf..94817aecc15b 100755
--- a/Tools/PROCTools/python/RunTier0Tests.py
+++ b/Tools/PROCTools/python/RunTier0Tests.py
@@ -528,7 +528,7 @@ def main():
                       type="string",
                       dest="extraArgs",
                       default="",
-                      help="define additional args to pass e.g. --preExec 'r2e':'from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup=\"MC_pp_v5\"' ")
+                      help="define additional args to pass e.g. --preExec 'r2e':'...' ")
     parser.add_option("-a",
                       "--r2a",
                       action="store_true",
@@ -607,12 +607,7 @@ def main():
 
     (options,args)=parser.parse_args()
 
-    extraArg = ""
-    if options.extraArgs == "MC_pp_v5":
-        extraArg = "--preExec 'r2e':'from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup=\"MC_pp_v5\"' "
-    else:
-        extraArg = options.extraArgs
-
+    extraArg        = options.extraArgs
     RunSim          = options.sim_flag
     RunOverlay      = options.overlay_flag
     RunFast         = options.fast_flag
-- 
GitLab


From cda52649bb4d765d6e041bd09a46126f355eaa92 Mon Sep 17 00:00:00 2001
From: Noemi Calace <noemi.calace@cern.ch>
Date: Tue, 21 Sep 2021 16:17:33 +0200
Subject: [PATCH 237/347] Updating code for ITk tracking geometry material map
 creation

---
 .../python/AtlasTrackingGeometrySvcConfig.py  |   4 +-
 .../TrkDetDescrAlgs/CMakeLists.txt            |   2 +-
 .../TrkDetDescrAlgs/MaterialMapping.h         |  84 +++-
 .../TrkDetDescrAlgs/MaterialValidation.h      |  49 +-
 .../python/TrkDetDescrAlgsConfig.py           | 142 ++++++
 .../scripts/RunMaterialMappingITk.py          | 116 +++++
 .../scripts/RunMaterialValidationITk.py       |  93 ++++
 .../TrkDetDescrAlgs/src/MaterialMapping.cxx   | 426 +++++++++---------
 .../src/MaterialValidation.cxx                |  45 +-
 .../LayerMaterialAnalyser.h                   |  38 +-
 .../src/LayerMaterialAnalyser.cxx             | 153 ++++---
 .../python/TrkG4UserActionsConfigNew.py       |  37 ++
 .../TrkG4UserActions/python/__init__.py       |   0
 .../scripts/RunGeantinoStepRecordingITk.py    | 141 ++++++
 14 files changed, 961 insertions(+), 369 deletions(-)
 create mode 100644 Tracking/TrkDetDescr/TrkDetDescrAlgs/python/TrkDetDescrAlgsConfig.py
 create mode 100644 Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialMappingITk.py
 create mode 100644 Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialValidationITk.py
 create mode 100644 Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfigNew.py
 create mode 100644 Tracking/TrkG4Components/TrkG4UserActions/python/__init__.py
 create mode 100644 Tracking/TrkG4Components/TrkG4UserActions/scripts/RunGeantinoStepRecordingITk.py

diff --git a/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py b/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py
index 39d77143c6cf..94012d79769c 100644
--- a/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py
+++ b/Tracking/TrkConfig/python/AtlasTrackingGeometrySvcConfig.py
@@ -24,11 +24,9 @@ def _setupCondDB(flags, CoolDataBaseFolder, quiet=True):
     if flags.Detector.GeometryITk:
       AtlasMaterialTag = flags.ITk.trackingGeometry.materialTag+str(flags.ITk.trackingGeometry.version)+'_'
     cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>'
-    
-    
+        
     if flags.Detector.GeometryITk and flags.ITk.trackingGeometry.loadLocalDbForMaterialMaps:
         DataBaseName=flags.ITk.trackingGeometry.localDatabaseName
-        
         from IOVDbSvc.IOVDbSvcConfig import addFolders
         result.merge(addFolders(flags,"/GLOBAL/TrackingGeo/LayerMaterialITK",detDb=DataBaseName, tag=AtlasMaterialTag))
         cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'</tag>'
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/CMakeLists.txt b/Tracking/TrkDetDescr/TrkDetDescrAlgs/CMakeLists.txt
index 05f41201d75f..9dffe2e8ce16 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrAlgs/CMakeLists.txt
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/CMakeLists.txt
@@ -15,4 +15,4 @@ atlas_add_component( TrkDetDescrAlgs
 
 # Install files from the package:
 atlas_install_headers( TrkDetDescrAlgs )
-
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialMapping.h b/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialMapping.h
index 8695db946d8e..ab803dd50ca7 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialMapping.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialMapping.h
@@ -1,13 +1,14 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
 //////////////////////////////////////////////////////////////////
 // MaterialMapping.h, (c) ATLAS Detector software
 ///////////////////////////////////////////////////////////////////
 
 #ifndef TRKDETDESCRALGS_MATERIALMAPPING_H
 #define TRKDETDESCRALGS_MATERIALMAPPING_H
+#define LEGACY_TRKGEOM
 
 // Athena & Gaudi includes
 #include "AthenaBaseComps/AthAlgorithm.h"
@@ -19,8 +20,19 @@
 #include <string>
 #include <map>
 #include "GeoPrimitives/GeoPrimitives.h"
-#include "StoreGate/ReadHandleKey.h"
-#include "TrkGeometry/MaterialStepCollection.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "TrkGeometry/MaterialStepCollection.h"
+//TrkDetDescr Algs, Interfaces, Utils
+#include "TrkDetDescrInterfaces/IMaterialMapper.h"
+#include "TrkDetDescrInterfaces/ILayerMaterialCreator.h"
+#include "TrkDetDescrInterfaces/ILayerMaterialAnalyser.h"
+// TrkExtrapolation
+#include "TrkExInterfaces/IExtrapolationEngine.h"
+// TrkGeometry
+#include "TrkGeometry/TrackingGeometry.h"
+#ifdef LEGACY_TRKGEOM
+#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h"
+#endif
 
 #ifdef TRKDETDESCR_MEMUSAGE   
 #include "TrkDetDescrUtils/MemoryLogger.h"
@@ -43,7 +55,6 @@ namespace Trk {
 
     class Layer;
     class TrackingVolume;
-    class TrackingGeometry;
     class SurfaceMaterialRecord;
     class LayerMaterialRecord;
     class LayerMaterialMap;
@@ -52,11 +63,6 @@ namespace Trk {
     class BinnedLayerMaterial;
     class CompressedLayerMaterial;
     class ElementTable;
-    class IExtrapolationEngine;
-    class IMaterialMapper;
-    class ILayerMaterialAnalyser;
-    class ILayerMaterialCreator;
-    class ITrackingGeometrySvc;
 
     /** @class MaterialMapping
 
@@ -85,7 +91,7 @@ namespace Trk {
         
         /** standard Athena-Algorithm method */
         StatusCode          finalize();
-
+        
       private:
 
         /** Associate the Step to the Layer */
@@ -104,15 +110,13 @@ namespace Trk {
         //!< create the LayerMaterialRecord */
         void insertLayerMaterialRecord(const Trk::Layer& lay);
 
-        /** Retrieve the TrackingGeometry */
-        StatusCode retrieveTrackingGeometry();
-
-        /** Tracking Geometry */
-        ServiceHandle<Trk::ITrackingGeometrySvc>             m_trackingGeometrySvc;       //!< Name of the TrackingGeometrySvc
-        mutable const TrackingGeometry*                      m_trackingGeometry;          //!< The underlying TrackingGeometry
+        /** Retrieve the TrackingGeometry and its informations */
+        StatusCode handleTrackingGeometry();
+        
+        const TrackingGeometry& trackingGeometry() const;
 
         bool                                                 m_checkForEmptyHits;         //!< use extrapoaltion engine to check for empty hits
-        ToolHandle<IExtrapolationEngine>                     m_extrapolationEngine;       //!< cross-check for empty hit scaling
+        ToolHandle<IExtrapolationEngine> m_extrapolationEngine {this, "ExtrapolationEngine", "", "Extrapolation Engine"};
         
         std::string                                          m_mappingVolumeName;
         const Trk::TrackingVolume*                           m_mappingVolume;
@@ -127,13 +131,13 @@ namespace Trk {
         bool                                                 m_useLayerThickness;             //!< use the actual layer thickness
         int                                                  m_associationType;
 
-        ToolHandle<ILayerMaterialAnalyser>                   m_layerMaterialRecordAnalyser;   //!< the layer material analyser for the layer material record
-        ToolHandleArray<ILayerMaterialAnalyser>              m_layerMaterialAnalysers;        //!< the layer material analysers per creator (if wanted)
-        ToolHandleArray<ILayerMaterialCreator>               m_layerMaterialCreators;         //!< the layer material creators
+        ToolHandle<ILayerMaterialAnalyser>       m_layerMaterialRecordAnalyser {this, "LayerMaterialRecordAnalyser", "", "Layer material analyser for the layer material record"};
+        ToolHandleArray<ILayerMaterialAnalyser>  m_layerMaterialAnalysers {this, "LayerMaterialAnalysers", {}, "Layer material analysers per creator (if wanted)"};
+        ToolHandleArray<ILayerMaterialCreator>   m_layerMaterialCreators {this, "LayerMaterialCreators", {}, "Layer material creators"};
                                                              
         /** Mapper and Inspector */                          
         bool                                                 m_mapMaterial;
-        ToolHandle<IMaterialMapper>                          m_materialMapper;                //!< Pointer to an IMaterialMapper algTool
+        ToolHandle<IMaterialMapper>  m_materialMapper {this, "MaterialMapper", "" , "IMaterialMapper algTool"};
         bool                                                 m_mapComposition;                //!< map the composition of the material
         double                                               m_minCompositionFraction;        //!< minimal fraction to be accounted for the composition recording
         
@@ -154,12 +158,44 @@ namespace Trk {
         
         int                                                  m_layerMaterialScreenOutput;
         
+        
+#ifdef LEGACY_TRKGEOM
+        ServiceHandle<ITrackingGeometrySvc> m_trackingGeometrySvc {this, "TrackingGeometrySvc", "",""};
+#endif
+        void throwFailedToGetTrackingGeometry() const;
+        const TrackingGeometry* retrieveTrackingGeometry(const EventContext& ctx) const {
+#ifdef LEGACY_TRKGEOM
+           if (m_trackingGeometryReadKey.key().empty()) {
+              return m_trackingGeometrySvc->trackingGeometry();
+           }
+#endif
+           SG::ReadCondHandle<TrackingGeometry>  handle(m_trackingGeometryReadKey,ctx);
+           if (!handle.isValid()) {
+              ATH_MSG_FATAL("Could not load TrackingGeometry with name '" << m_trackingGeometryReadKey.key() << "'. Aborting." );
+              throwFailedToGetTrackingGeometry();
+           }
+           return handle.cptr();
+        }
+
+        SG::ReadCondHandleKey<TrackingGeometry>   m_trackingGeometryReadKey
+           {this, "TrackingGeometryReadKey", "", "Key of the TrackingGeometry conditions data."};
+
+        
 #ifdef TRKDETDESCR_MEMUSAGE      
         MemoryLogger                                         m_memoryLogger;                //!< in case the memory is logged        
 #endif 
         
 
     };
+    
+    inline const Trk::TrackingGeometry& Trk::MaterialMapping::trackingGeometry() const {
+       const Trk::TrackingGeometry *tracking_geometry = retrieveTrackingGeometry(Gaudi::Hive::currentContext());
+       if (!tracking_geometry){
+          ATH_MSG_FATAL("Did not get valid TrackingGeometry. Aborting." );
+          throw GaudiException("MaterialMapping", "Problem with TrackingGeometry loading.", StatusCode::FAILURE);
+       }
+       return *tracking_geometry;
+    }
 }
 
 #endif
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialValidation.h b/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialValidation.h
index 35ce8535d7d8..0da48192283e 100755
--- a/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialValidation.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialValidation.h
@@ -8,6 +8,7 @@
 
 #ifndef TRKDETDESCRALGS_MATERIALVALIDATION_H
 #define TRKDETDESCRALGS_MATERIALVALIDATION_H
+#define LEGACY_TRKGEOM
 
 // Gaudi includes
 #include "AthenaBaseComps/AthAlgorithm.h"
@@ -16,12 +17,15 @@
 #include "GaudiKernel/ToolHandle.h"
 //Eigen
 #include "GeoPrimitives/GeoPrimitives.h"
+// TrkGeometry
+#include "TrkGeometry/TrackingGeometry.h"
+#ifdef LEGACY_TRKGEOM
+#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h"
+#endif
 
 namespace Trk {
 
-    class ITrackingGeometrySvc;
     class IMaterialMapper;
-    class TrackingGeometry;
     class TrackingVolume;
     class Surface;
 
@@ -72,16 +76,32 @@ namespace Trk {
                                                   const Amg::Vector3D& position, 
                                                   const Amg::Vector3D& direction);
           
-        /** Retrieve the TrackingGeometry */
-        StatusCode retrieveTrackingGeometry();
-
-        /** Tracking Geometry */
-        ServiceHandle<Trk::ITrackingGeometrySvc>             m_trackingGeometrySvc;       //!< Name of the TrackingGeometrySvc
-        mutable const TrackingGeometry*                      m_trackingGeometry;          //!< The underlying TrackingGeometry
+        const TrackingGeometry& trackingGeometry() const;
+
+        #ifdef LEGACY_TRKGEOM
+        ServiceHandle<ITrackingGeometrySvc> m_trackingGeometrySvc {this, "TrackingGeometrySvc", "",""};
+#endif
+        void throwFailedToGetTrackingGeometry() const;
+        const TrackingGeometry* retrieveTrackingGeometry(const EventContext& ctx) const {
+#ifdef LEGACY_TRKGEOM
+           if (m_trackingGeometryReadKey.key().empty()) {
+              return m_trackingGeometrySvc->trackingGeometry();
+           }
+#endif
+           SG::ReadCondHandle<TrackingGeometry>  handle(m_trackingGeometryReadKey,ctx);
+           if (!handle.isValid()) {
+              ATH_MSG_FATAL("Could not load TrackingGeometry with name '" << m_trackingGeometryReadKey.key() << "'. Aborting." );
+              throwFailedToGetTrackingGeometry();
+           }
+           return handle.cptr();
+        }
+
+        SG::ReadCondHandleKey<TrackingGeometry>   m_trackingGeometryReadKey
+           {this, "TrackingGeometryReadKey", "", "Key of the TrackingGeometry conditions data."};
         
         /** Mapper and Inspector */                          
         ToolHandle<IMaterialMapper>                          m_materialMapper;            //!< Pointer to an IMaterialMapper algTool
-        int                                                  m_maxMaterialMappingEvents;  //!< limit the number of validation records to avoid 2G files
+        int                                                  m_maxMaterialValidationEvents;  //!< limit the number of validation records to avoid 2G files
         
 
         Rndm::Numbers*                                       m_flatDist;                   //!< Random generator for flat distribution
@@ -91,9 +111,16 @@ namespace Trk {
         
         double                                               m_accTinX0;                   //!< accumulated t in X0
         
-
-
     };
+    
+    inline const Trk::TrackingGeometry& Trk::MaterialValidation::trackingGeometry() const {
+       const Trk::TrackingGeometry *tracking_geometry = retrieveTrackingGeometry(Gaudi::Hive::currentContext());
+       if (!tracking_geometry){
+          ATH_MSG_FATAL("Did not get valid TrackingGeometry. Aborting." );
+          throw GaudiException("MaterialValidation", "Problem with TrackingGeometry loading.", StatusCode::FAILURE);
+       }
+       return *tracking_geometry;
+    }
 }
 
 #endif 
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/python/TrkDetDescrAlgsConfig.py b/Tracking/TrkDetDescr/TrkDetDescrAlgs/python/TrkDetDescrAlgsConfig.py
new file mode 100644
index 000000000000..dfb7f27d9fc3
--- /dev/null
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/python/TrkDetDescrAlgsConfig.py
@@ -0,0 +1,142 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+"""Define methods to configure TrkDetDescrAlgs"""
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+
+def ITkMaterialMappingCfg(flags, name="ITkMaterialMapping", **kwargs):
+  """Return configured ComponentAccumulator and tool for MaterialMapping"""
+  
+  result=ComponentAccumulator()
+  LayerMaterialName = 'LayerMaterialITK'    
+  LayerMaterialDirectory = '/GLOBAL/TrackingGeo/'
+  
+  from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelGeometryCfg
+  itkPixel = ITkPixelGeometryCfg(flags)
+  result.merge(itkPixel)
+   
+  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripGeometryCfg
+  itkStrip = ITkStripGeometryCfg(flags)
+  result.merge(itkStrip)
+    
+  from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
+  result.merge(BeamPipeGeometryCfg(flags))
+      
+  # get the correct TrackingGeometry setup
+  geom_svc=None
+  geom_cond_key=''
+  from InDetRecExample.TrackingCommon import use_tracking_geometry_cond_alg
+  if not use_tracking_geometry_cond_alg :
+     from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
+     acc = TrackingGeometrySvcCfg(flags)
+     geom_svc = acc.getPrimary()
+     result.merge(acc)      
+     kwargs.setdefault("TrackingGeometrySvc", geom_svc)
+  else :
+     from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig import TrackingGeometryCondAlgCfg
+     result.merge( TrackingGeometryCondAlgCfg(flags) )
+     geom_cond_key = 'AtlasTrackingGeometry'
+     kwargs.setdefault("TrackingGeometryReadKey", geom_cond_key)    
+    
+  if 'MappingVolumeName' not in kwargs :
+      kwargs.setdefault("MappingVolumeName", 'InDet::Containers::InnerDetector')
+  
+  if 'ExtrapolationEngine' not in kwargs :
+      from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
+      kwargs.setdefault("ExtrapolationEngine", result.getPrimaryAndMerge(AtlasExtrapolationEngineCfg(flags)))
+  
+  if 'MaterialMapper' not in kwargs :
+      MaterialMapper = CompFactory.Trk.MaterialMapper("MaterialMapper")
+      kwargs.setdefault("MaterialMapper", MaterialMapper)
+  
+  if 'LayerMaterialRecordAnalyser' not in kwargs :
+      LayerMaterialAnalyser = CompFactory.Trk.LayerMaterialAnalyser(name="LayerMaterialRecordAnalyser")
+      kwargs.setdefault("LayerMaterialRecordAnalyser", LayerMaterialAnalyser)
+  
+  if 'LayerMaterialCreators' not in kwargs :
+      BinnedLayerMaterialCreator = CompFactory.Trk.BinnedLayerMaterialCreator(name="BinnedLayerMaterialCreator")
+      BinnedLayerMaterialCreator.LayerMaterialName         = LayerMaterialName
+      BinnedLayerMaterialCreator.LayerMaterialDirectory    = LayerMaterialDirectory
+      LayerMaterialCreators  = [BinnedLayerMaterialCreator]
+      kwargs.setdefault("LayerMaterialCreators", LayerMaterialCreators)
+      
+  if 'LayerMaterialAnalysers' not in kwargs :
+      BinnedLayerMaterialAnalyser = CompFactory.Trk.LayerMaterialAnalyser(name="BinnedLayerMaterialAnalyser")
+      BinnedLayerMaterialAnalyser.LayerMaterialName         =  LayerMaterialName
+      BinnedLayerMaterialAnalyser.ValidationTreeName        = 'BinnedLayerMaterialAnalyser'
+      BinnedLayerMaterialAnalyser.ValidationTreeDescription = 'Output of the BinnedLayerMaterialAnalyser'
+      BinnedLayerMaterialAnalyser.ValidationTreeFolder      = '/val/BinnedLayerMaterialAnalyser'
+      LayerMaterialAnalysers = [ BinnedLayerMaterialAnalyser ]
+      kwargs.setdefault("LayerMaterialAnalysers", LayerMaterialAnalysers)
+      
+  histSvc = CompFactory.THistSvc(Output = ["val DATAFILE='AtlasGeant4Geometry.root' TYPE='ROOT' OPT='RECREATE'"])
+  result.addService( histSvc )
+  
+  algo = CompFactory.Trk.MaterialMapping(name=name, **kwargs)
+  result.addEventAlgo(algo, primary = True)
+  
+  from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg    
+  result.merge(OutputConditionsAlgCfg(flags, name = "CondAlg_Material",
+                                      outputFile="AtlasLayerMaterial.pool.root",
+                                      ObjectList=['Trk::LayerMaterialMap#'+LayerMaterialDirectory+LayerMaterialName],
+                                      WriteIOV=True,IOVTagList=[flags.ITk.trackingGeometry.materialTag] ))
+  
+  result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = True))
+  
+  return result
+  
+  
+def ITkMaterialValidationCfg(flags, name="MaterialValidation", **kwargs):
+  """Return configured ComponentAccumulator and tool for MaterialMapping"""
+  
+  result=ComponentAccumulator()
+  
+  from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelGeometryCfg
+  itkPixel = ITkPixelGeometryCfg(flags)
+  result.merge(itkPixel)
+   
+  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripGeometryCfg
+  itkStrip = ITkStripGeometryCfg(flags)
+  result.merge(itkStrip)
+    
+  from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
+  result.merge(BeamPipeGeometryCfg(flags))
+  
+  # get the correct TrackingGeometry setup
+  geom_svc=None
+  geom_cond_key=''
+  from InDetRecExample.TrackingCommon import use_tracking_geometry_cond_alg
+  if not use_tracking_geometry_cond_alg :
+     from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
+     acc = TrackingGeometrySvcCfg(flags)
+     geom_svc = acc.getPrimary()
+     result.merge(acc)      
+     kwargs.setdefault("TrackingGeometrySvc", geom_svc)
+  else :
+     from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig import TrackingGeometryCondAlgCfg
+     result.merge( TrackingGeometryCondAlgCfg(flags) )
+     geom_cond_key = 'AtlasTrackingGeometry'
+     kwargs.setdefault("TrackingGeometryReadKey", geom_cond_key)    
+    
+  
+  if 'MaterialMapper' not in kwargs :
+      MaterialMapper = CompFactory.Trk.MaterialMapper("MaterialMapper")
+      kwargs.setdefault("MaterialMapper", MaterialMapper)
+      
+  if 'MinEta' not in kwargs :
+      minEta = -6.
+      kwargs.setdefault("MinEta", minEta)
+      
+  if 'MaxEta' not in kwargs :
+      maxEta = 6.
+      kwargs.setdefault("MaxEta", maxEta)
+  
+  histSvc = CompFactory.THistSvc(Output = ["val DATAFILE='AtlasTrackingGeometry.root' TYPE='ROOT' OPT='RECREATE'"])
+  result.addService( histSvc )
+  
+  algo = CompFactory.Trk.MaterialValidation(name=name, **kwargs)
+  result.addEventAlgo(algo, primary = True)
+  
+  return result
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialMappingITk.py b/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialMappingITk.py
new file mode 100644
index 000000000000..3af26e28265b
--- /dev/null
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialMappingITk.py
@@ -0,0 +1,116 @@
+#!/usr/bin/env python
+"""
+
+Run material mapping for tracking geometry.
+Uses as MaterialStepsCollections as input.
+
+"""
+from AthenaCommon.Configurable import Configurable
+from AthenaCommon.Logging import log
+from argparse import ArgumentParser
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+
+Configurable.configurableRun3Behavior = True
+
+# Argument parsing
+parser = ArgumentParser("RunMaterialMappingITk.py")
+parser.add_argument("detectors", metavar="detectors", type=str, nargs="*",
+                    help="Specify the list of detectors")
+parser.add_argument("--localgeo", default=False, action="store_true",
+                    help="Use local geometry Xml files")
+parser.add_argument("-V", "--verboseAccumulators", default=False, 
+                    action="store_true",
+                    help="Print full details of the AlgSequence")
+parser.add_argument("-S", "--verboseStoreGate", default=False, 
+                    action="store_true",
+                    help="Dump the StoreGate(s) each event iteration")
+parser.add_argument("--maxEvents",default=10, type=int,
+                    help="The number of events to run. 0 skips execution")
+parser.add_argument("--geometrytag",default="ATLAS-P2-ITK-24-00-00", type=str,
+                    help="The geometry tag to use")
+parser.add_argument("--inputfile",
+                    default="MaterialStepCollection.root",
+                    help="The input material step file to use")
+args = parser.parse_args()
+
+# Some info about the job
+print("----MaterialMapping for ITk geometry----")
+print()
+print("Using Geometry Tag: "+args.geometrytag)
+if args.localgeo:
+    print("...overridden by local Geometry Xml files")
+print("Input File:"+args.inputfile)
+if not args.detectors:
+    print("Running complete detector")
+else:
+    print("Running with: {}".format(", ".join(args.detectors)))
+print()
+
+LocalDataBaseName = ConfigFlags.ITk.trackingGeometry.localDatabaseName
+ConfigFlags.IOVDb.DBConnection='sqlite://;schema='+LocalDataBaseName+';dbname=OFLP200'
+
+# necessity to create a new PoolFileCatalog
+import os
+if os.path.exists('./PoolFileCatalog.xml') :
+  print('[!] PoolFileCatalog exists in the run directory (may use old PFN!)')
+  print('[>] Deleting it now !')
+  os.remove('./PoolFileCatalog.xml')
+
+ConfigFlags.Input.isMC             = True
+
+if args.localgeo:
+  configFlags.GeoModel.useLocalGeometry = True
+  
+from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
+detectors = args.detectors if 'detectors' in args and args.detectors else ['ITkPixel', 'ITkStrip']
+detectors.append('Bpipe')  # always run with beam pipe
+setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
+
+ConfigFlags.GeoModel.AtlasVersion = args.geometrytag
+ConfigFlags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
+ConfigFlags.GeoModel.Align.Dynamic = False
+ConfigFlags.TrackingGeometry.MaterialSource = "None"
+ConfigFlags.Beam.Type =''
+
+ConfigFlags.Detector.GeometryCalo  = False
+ConfigFlags.Detector.GeometryMuon  = False
+
+# This should run serially for the moment.
+ConfigFlags.Concurrency.NumThreads = 1
+ConfigFlags.Concurrency.NumConcurrentEvents = 1
+
+import glob
+FileList = glob.glob(args.inputfile)
+ConfigFlags.Input.Files = FileList
+
+log.debug('Lock config flags now.')
+ConfigFlags.lock()
+
+from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+cfg=MainServicesCfg(ConfigFlags)
+
+### setup dumping of additional information
+if args.verboseAccumulators:
+  cfg.printConfig(withDetails=True)
+if args.verboseStoreGate:
+  cfg.getService("StoreGateSvc").Dump = True
+  
+log.debug('Dumping of ConfigFlags now.')
+ConfigFlags.dump()
+
+from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+cfg.merge(PoolReadCfg(ConfigFlags))
+
+from TrkDetDescrAlgs.TrkDetDescrAlgsConfig import ITkMaterialMappingCfg
+cfg.merge(ITkMaterialMappingCfg(ConfigFlags))
+  
+cfg.printConfig(withDetails = True, summariseProps = True)
+
+events = args.maxEvents
+if events<=0:
+  events = 10000000000
+cfg.run(maxEvents=events)
+f=open("MaterialMappingITk.pkl","wb")
+cfg.store(f)
+f.close()
+
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialValidationITk.py b/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialValidationITk.py
new file mode 100644
index 000000000000..38c1610bc4b4
--- /dev/null
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialValidationITk.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+"""
+
+Run material validation to check material maps for tracking geometry.
+
+"""
+
+from AthenaCommon.Configurable import Configurable
+from AthenaCommon.Logging import log
+from argparse import ArgumentParser
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+
+Configurable.configurableRun3Behavior = True
+
+# Argument parsing
+parser = ArgumentParser("RunMaterialValidationITk.py")
+parser.add_argument("detectors", metavar="detectors", type=str, nargs="*",
+                    help="Specify the list of detectors")
+parser.add_argument("--localgeo", default=False, action="store_true",
+                    help="Use local geometry Xml files")
+parser.add_argument("-V", "--verboseAccumulators", default=False, 
+                    action="store_true",
+                    help="Print full details of the AlgSequence")
+parser.add_argument("-S", "--verboseStoreGate", default=False, 
+                    action="store_true",
+                    help="Dump the StoreGate(s) each event iteration")
+parser.add_argument("--maxEvents",default=10, type=int,
+                    help="The number of events to run. 0 skips execution")
+parser.add_argument("--geometrytag",default="ATLAS-P2-ITK-24-00-00", type=str,
+                    help="The geometry tag to use")
+args = parser.parse_args()
+
+# Some info about the job
+print("----MaterialValidation for ITk geometry----")
+print()
+print("Using Geometry Tag: "+args.geometrytag)
+if args.localgeo:
+    print("...overridden by local Geometry Xml files")
+print()
+
+ConfigFlags.Input.isMC             = True
+
+if args.localgeo:
+  configFlags.GeoModel.useLocalGeometry = True
+  
+from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
+detectors = args.detectors if 'detectors' in args and args.detectors else ['ITkPixel', 'ITkStrip']
+detectors.append('Bpipe')  # always run with beam pipe
+setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
+
+ConfigFlags.GeoModel.AtlasVersion = args.geometrytag
+ConfigFlags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
+ConfigFlags.GeoModel.Align.Dynamic = False
+ConfigFlags.TrackingGeometry.MaterialSource = "COOL"
+ConfigFlags.Beam.Type =''
+
+ConfigFlags.Detector.GeometryCalo  = False
+ConfigFlags.Detector.GeometryMuon  = False
+
+# This should run serially for the moment.
+ConfigFlags.Concurrency.NumThreads = 1
+ConfigFlags.Concurrency.NumConcurrentEvents = 1
+
+ConfigFlags.ITk.trackingGeometry.loadLocalDbForMaterialMaps=True
+LocalDataBaseName = ConfigFlags.ITk.trackingGeometry.localDatabaseName
+ConfigFlags.IOVDb.DBConnection='sqlite://;schema='+LocalDataBaseName+';dbname=OFLP200'
+
+log.debug('Lock config flags now.')
+ConfigFlags.lock()
+
+from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+cfg=MainServicesCfg(ConfigFlags)
+
+### setup dumping of additional information
+if args.verboseAccumulators:
+  cfg.printConfig(withDetails=True)
+if args.verboseStoreGate:
+  cfg.getService("StoreGateSvc").Dump = True
+  
+log.debug('Dumping of ConfigFlags now.')
+ConfigFlags.dump()
+
+from TrkDetDescrAlgs.TrkDetDescrAlgsConfig import ITkMaterialValidationCfg
+cfg.merge(ITkMaterialValidationCfg(ConfigFlags))
+  
+cfg.printConfig(withDetails = True, summariseProps = True)
+
+## as no input file, maxEvents should be a valid number
+cfg.run(maxEvents=args.maxEvents)
+f=open("MaterialValidationITk.pkl","wb")
+cfg.store(f)
+f.close()
+
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/src/MaterialMapping.cxx b/Tracking/TrkDetDescr/TrkDetDescrAlgs/src/MaterialMapping.cxx
index a8d949b23efc..0ecfab62c7a8 100755
--- a/Tracking/TrkDetDescr/TrkDetDescrAlgs/src/MaterialMapping.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/src/MaterialMapping.cxx
@@ -10,19 +10,11 @@
 #include "GaudiKernel/SystemOfUnits.h"
 //TrkDetDescr Algs, Interfaces, Utils
 #include "TrkDetDescrAlgs/MaterialMapping.h"
-#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h"
-#include "TrkDetDescrInterfaces/IMaterialMapper.h"
-#include "TrkDetDescrInterfaces/ILayerMaterialCreator.h"
-#include "TrkDetDescrInterfaces/ILayerMaterialAnalyser.h"
 #include "TrkDetDescrUtils/GeometryStatics.h"
 #include "TrkDetDescrUtils/LayerIndex.h"
 #include "TrkDetDescrUtils/BinUtility.h"
-// TrkExtrapolation
-#include "TrkExInterfaces/IExtrapolationEngine.h"
 // TrkGeometry
 #include "TrkGeometry/LayerMaterialRecord.h"
-//#include "TrkGeometry/ElementTable.h"
-#include "TrkGeometry/TrackingGeometry.h"
 #include "TrkGeometry/TrackingVolume.h"
 #include "TrkGeometry/MaterialStep.h"
 #include "TrkGeometry/MaterialProperties.h"
@@ -43,8 +35,6 @@
 
 Trk::MaterialMapping::MaterialMapping(const std::string& name, ISvcLocator* pSvcLocator)
 : AthAlgorithm(name,pSvcLocator),
-  m_trackingGeometrySvc("AtlasTrackingGeometrySvc",name),
-  m_trackingGeometry(nullptr),
   m_checkForEmptyHits(true),
   m_mappingVolumeName("Atlas"),
   m_mappingVolume(nullptr),
@@ -53,10 +43,8 @@ Trk::MaterialMapping::MaterialMapping(const std::string& name, ISvcLocator* pSvc
   m_etaSide(0),
   m_useLayerThickness(false),
   m_associationType(1),
-  m_layerMaterialRecordAnalyser(""),
   m_mapMaterial(true),
-  m_materialMapper(""),
-  m_mapComposition(true),
+  m_mapComposition(false),
   m_minCompositionFraction(0.005),
   m_elementTable(nullptr),
   m_inputEventElementTable("ElementTable"),
@@ -70,26 +58,18 @@ Trk::MaterialMapping::MaterialMapping(const std::string& name, ISvcLocator* pSvc
   ,m_memoryLogger()
 #endif 
 {
-    // the name of the TrackingGeometry to be retrieved
-    declareProperty("TrackingGeometrySvc"         , m_trackingGeometrySvc);
+    // the name of the volume to map
     declareProperty("MappingVolumeName"           , m_mappingVolumeName);
     // the extrapolation engine
     declareProperty("CheckForEmptyHits"           , m_checkForEmptyHits);
-    declareProperty("ExtrapolationEngine"         , m_extrapolationEngine);
     // general steering
     declareProperty("EtaCutOff"                   , m_etaCutOff);
     declareProperty("EtaSide"                     , m_etaSide);
-    // for the analysis of the material 
-    declareProperty("LayerMaterialRecordAnalyser" , m_layerMaterialRecordAnalyser);
-    // for the creation of the material 
-    declareProperty("LayerMaterialCreators"       , m_layerMaterialCreators);
-    declareProperty("LayerMaterialAnalysers"      , m_layerMaterialAnalysers);
     // the toolhandle of the MaterialMapper to be used
     declareProperty("MapMaterial"                 , m_mapMaterial);
-    declareProperty("MaterialMapper"              , m_materialMapper);
-	// Composition related parameters
-    declareProperty("MapComposition"              , m_mapComposition);	
-    declareProperty("MinCompositionFraction"      , m_minCompositionFraction);	
+    // Composition related parameters
+    declareProperty("MapComposition"              , m_mapComposition);
+    declareProperty("MinCompositionFraction"      , m_minCompositionFraction);
     // Steer the layer thickness
     declareProperty("UseActualLayerThicknesss"    , m_useLayerThickness);
     // some job setup
@@ -110,23 +90,26 @@ StatusCode Trk::MaterialMapping::initialize()
 
     ATH_MSG_INFO("initialize()");
 
-    if ( (m_trackingGeometrySvc.retrieve()).isFailure() )
-        ATH_MSG_WARNING("Could not retrieve TrackingGeometrySvc");
+#ifdef LEGACY_TRKGEOM
+    if (!m_trackingGeometrySvc.empty()) {
+       ATH_CHECK( m_trackingGeometrySvc.retrieve());
+    }
+#endif
+    ATH_CHECK( m_trackingGeometryReadKey.initialize(!m_trackingGeometryReadKey.key().empty()) );
 
-    if (m_extrapolationEngine.retrieve().isFailure())
-        ATH_MSG_WARNING("Could not retrieve ExtrapolationEngine - needed for emopty hit scaling");
+    ATH_CHECK(m_extrapolationEngine.retrieve());
 
-    if (!m_materialMapper.empty() &&  (m_materialMapper.retrieve()).isFailure() )
-        ATH_MSG_WARNING("Could not retrieve MaterialMapper");
+    if ( !m_materialMapper.empty() )
+      ATH_CHECK( m_materialMapper.retrieve() );
     
-    if ( !m_layerMaterialRecordAnalyser.empty() && m_layerMaterialRecordAnalyser.retrieve().isFailure() )  
-        ATH_MSG_WARNING("Could not retrieve LayerMaterialAnalyser");
+    if ( !m_layerMaterialRecordAnalyser.empty() ) 
+      ATH_CHECK( m_layerMaterialRecordAnalyser.retrieve() );
         
-    if ( !m_layerMaterialCreators.empty() && m_layerMaterialCreators.retrieve().isFailure() )        
-        ATH_MSG_WARNING("Could not retrieve any LayerMaterialCreators");
+    if ( !m_layerMaterialCreators.empty() )
+      ATH_CHECK( m_layerMaterialCreators.retrieve() );
 
-    if ( !m_layerMaterialAnalysers.empty() && m_layerMaterialAnalysers.retrieve().isFailure() )        
-        ATH_MSG_WARNING("Could not retrieve any LayerMaterialAnalysers");
+    if ( !m_layerMaterialAnalysers.empty() )
+      ATH_CHECK( m_layerMaterialAnalysers.retrieve() );
 
     ATH_CHECK( m_inputMaterialStepCollection.initialize() );
     ATH_CHECK(  m_inputEventElementTable.initialize() );
@@ -140,189 +123,190 @@ StatusCode Trk::MaterialMapping::execute()
     ATH_MSG_VERBOSE("MaterialMapping execute() start");
 
     // ------------------------------- get the trackingGeometry at first place
-    if (!m_trackingGeometry) {
-        StatusCode retrieveCode = retrieveTrackingGeometry();
+    if (!m_mappingVolume) {
+        StatusCode retrieveCode = handleTrackingGeometry();
         if (retrieveCode.isFailure()){
-            ATH_MSG_INFO("Could not retrieve TrackingGeometry. Exiting.");
+            ATH_MSG_INFO("Could not retrieve mapping volume from tracking geometry. Exiting.");
             return retrieveCode;
         }
     } 
-    if (m_trackingGeometry)
-      ATH_MSG_VERBOSE("TrackingGeometry sucessfully retrieved");  
+    if (m_mappingVolume)
+      ATH_MSG_VERBOSE("Mapping volume correctly retrieved from tracking geometry");  
+    
     
     SG::ReadHandle<MaterialStepCollection> materialStepCollection(m_inputMaterialStepCollection);
-
+    
         // --------- prepare the element table ---------------------------------------------------
 
-    SG::ReadHandle<Trk::ElementTable> eTableEvent(m_inputEventElementTable);	  
+    if (m_mapComposition) {
+      SG::ReadHandle<Trk::ElementTable> eTableEvent(m_inputEventElementTable);
+      (*m_elementTable) += (*eTableEvent);  // accummulate the table 
+    }
     
-    (*m_elementTable) += (*eTableEvent);  // accummulate the table 
-    m_mapComposition = eTableEvent.isValid();
-        
-        
-        // event parameters - associated asteps, and layers hit per event
-        int associatedSteps      = 0;
-        m_accumulatedMaterialXX0 = 0.;
-        m_accumulatedRhoS        = 0.;
-        m_layersRecordedPerEvent.clear();
-        // clearing the recorded layers per event
-        if (materialStepCollection.isValid() && !materialStepCollection->empty()){
-
-           // get the number of material steps 
-           size_t materialSteps = materialStepCollection->size();
-           ATH_MSG_DEBUG("[+] Successfully read  "<<  materialSteps << " geantino steps");
-           
-           // create a direction out of the last material step
-           double dirx = (*materialStepCollection)[materialSteps-1]->hitX();
-           double diry = (*materialStepCollection)[materialSteps-1]->hitY();
-           double dirz = (*materialStepCollection)[materialSteps-1]->hitZ();
-           Amg::Vector3D direction = Amg::Vector3D(dirx,diry,dirz).unit();
-           
-           double eta = direction.eta();
-           // skip the event if the eta cut is not met
-           if ( fabs(eta) > m_etaCutOff || (m_etaSide && m_etaSide*eta < 0.)  ) {
-               ATH_MSG_VERBOSE("[-] Event is outside eta acceptance of " << m_etaCutOff << ". Skipping it.");
-               return StatusCode::SUCCESS;
-           }
-           
-           // now propagate through the full detector and collect the layers
-           Trk::NeutralCurvilinearParameters ncP(Amg::Vector3D(0.,0.,0.), direction, 0.);
-           // create a neutral extrapolation cell
-           Trk::ExtrapolationCell<Trk::NeutralParameters> ecc(ncP);
-           ecc.navigationCurvilinear = false;
-           ecc.addConfigurationMode(Trk::ExtrapolationMode::StopAtBoundary);
-           ecc.addConfigurationMode(Trk::ExtrapolationMode::CollectPassive);
-           ecc.addConfigurationMode(Trk::ExtrapolationMode::CollectBoundary);
-           
-           // let's extrapolate through the detector and remember which layers (with material) should have been hit
-           std::vector< std::pair<const Trk::Layer*, Amg::Vector3D> > layersAndHits;
-           // call the extrapolation engine
-           Trk::ExtrapolationCode eCode = m_extrapolationEngine->extrapolate(ecc);
-           // end the parameters if there
-           if (eCode.isSuccess()){
-               // name of passive surfaces found
-               size_t nLayersHit = ecc.extrapolationSteps.size();
-               ATH_MSG_VERBOSE("[+] Extrapolation to layers did succeed and found " << nLayersHit << " layers.");
-               // reserve the size of the vectors
-               layersAndHits.reserve(nLayersHit);
-               // for screen output
-               size_t ilayer = 0;
-               // find all the intersected material - remember the last parameters
-               const Trk::NeutralParameters* parameters = nullptr; 
-               // loop over the collected information
-               for (auto& es : ecc.extrapolationSteps){
-                   // continue if we have parameters
-                  parameters = es.parameters;
-                  if (parameters){
-                      const Trk::Surface& pSurface = parameters->associatedSurface();
-                      // get the surface with associated layer (that has material)
-                      ATH_MSG_VERBOSE("[L] Testing layer with associatedLayer() " << pSurface.associatedLayer() << " and materialLayer() " << pSurface.materialLayer() );
-                      // 
-                      if ( ( pSurface.associatedLayer() && pSurface.associatedLayer()->layerMaterialProperties() )  || pSurface.materialLayer() ){
-                          // material layer 
-                          const Trk::Layer* mLayer = pSurface.materialLayer() ? pSurface.materialLayer() : pSurface.associatedLayer();
-                          // record that one
-                          std::pair<const Trk::Layer*, Amg::Vector3D> layerHitPair(mLayer, parameters->position());
-                          ATH_MSG_VERBOSE("[L] Layer " << ++ilayer << " with index " << mLayer->layerIndex().value() << " hit at " << Amg::toString(parameters->position()));
-                          layersAndHits.push_back(layerHitPair);
-                      }
-                      delete parameters;
+    
+    // event parameters - associated asteps, and layers hit per event
+    int associatedSteps      = 0;
+    m_accumulatedMaterialXX0 = 0.;
+    m_accumulatedRhoS        = 0.;
+    m_layersRecordedPerEvent.clear();
+    // clearing the recorded layers per event
+    if (materialStepCollection.isValid() && !materialStepCollection->empty()){
+    
+       // get the number of material steps 
+       size_t materialSteps = materialStepCollection->size();
+       ATH_MSG_DEBUG("[+] Successfully read  "<<  materialSteps << " geantino steps");
+       
+       // create a direction out of the last material step
+       double dirx = (*materialStepCollection)[materialSteps-1]->hitX();
+       double diry = (*materialStepCollection)[materialSteps-1]->hitY();
+       double dirz = (*materialStepCollection)[materialSteps-1]->hitZ();
+       Amg::Vector3D direction = Amg::Vector3D(dirx,diry,dirz).unit();
+       
+       double eta = direction.eta();
+       // skip the event if the eta cut is not met
+       if ( fabs(eta) > m_etaCutOff || (m_etaSide && m_etaSide*eta < 0.)  ) {
+           ATH_MSG_VERBOSE("[-] Event is outside eta acceptance of " << m_etaCutOff << ". Skipping it.");
+           return StatusCode::SUCCESS;
+       }
+       
+       // now propagate through the full detector and collect the layers
+       Trk::NeutralCurvilinearParameters ncP(Amg::Vector3D(0.,0.,0.), direction, 0.);
+       // create a neutral extrapolation cell
+       Trk::ExtrapolationCell<Trk::NeutralParameters> ecc(ncP);
+       ecc.navigationCurvilinear = false;
+       ecc.addConfigurationMode(Trk::ExtrapolationMode::StopAtBoundary);
+       ecc.addConfigurationMode(Trk::ExtrapolationMode::CollectPassive);
+       ecc.addConfigurationMode(Trk::ExtrapolationMode::CollectBoundary);
+       
+       // let's extrapolate through the detector and remember which layers (with material) should have been hit
+       std::vector< std::pair<const Trk::Layer*, Amg::Vector3D> > layersAndHits;
+       // call the extrapolation engine
+       Trk::ExtrapolationCode eCode = m_extrapolationEngine->extrapolate(ecc);
+       // end the parameters if there
+       if (eCode.isSuccess()){
+           // name of passive surfaces found
+           size_t nLayersHit = ecc.extrapolationSteps.size();
+           ATH_MSG_VERBOSE("[+] Extrapolation to layers did succeed and found " << nLayersHit << " layers.");
+           // reserve the size of the vectors
+           layersAndHits.reserve(nLayersHit);
+           // for screen output
+           size_t ilayer = 0;
+           // find all the intersected material - remember the last parameters
+           const Trk::NeutralParameters* parameters = nullptr; 
+           // loop over the collected information
+           for (auto& es : ecc.extrapolationSteps){
+               // continue if we have parameters
+              parameters = es.parameters;
+              if (parameters){
+                  const Trk::Surface& pSurface = parameters->associatedSurface();
+                  // get the surface with associated layer (that has material)
+                  ATH_MSG_VERBOSE("[L] Testing layer with associatedLayer() " << pSurface.associatedLayer() << " and materialLayer() " << pSurface.materialLayer() );
+                  // 
+                  if ( ( pSurface.associatedLayer() && pSurface.associatedLayer()->layerMaterialProperties() )  || pSurface.materialLayer() ){
+                      // material layer 
+                      const Trk::Layer* mLayer = pSurface.materialLayer() ? pSurface.materialLayer() : pSurface.associatedLayer();
+                      // record that one
+                      std::pair<const Trk::Layer*, Amg::Vector3D> layerHitPair(mLayer, parameters->position());
+                      ATH_MSG_VERBOSE("[L] Layer " << ++ilayer << " with index " << mLayer->layerIndex().value() << " hit at " << Amg::toString(parameters->position()));
+                      layersAndHits.push_back(layerHitPair);
                   }
-                }
-                // cleanup of the final hits
-                if (ecc.endParameters != parameters) delete ecc.endParameters;
-                
-                // we have no layers and Hits
-                if (layersAndHits.empty()){
-                    ATH_MSG_VERBOSE("[!] No Layer was intersected - skipping.");
-                    return StatusCode::SUCCESS;
-                }
-                
-                // layers are ordered, hence you can move the starting point along
-                size_t currentLayer = 0;
-                // loop through hits and find the closest layer, the start point moves outwards as we go 
-                for ( const Trk::MaterialStep* step : *materialStepCollection ) {
-                   // verbose output    
-                   ATH_MSG_VERBOSE("[L] starting from layer " << currentLayer << " from layer collection for this step.");
-                   // step length and position
-                   double t     = step->steplength();
-                   Amg::Vector3D pos(step->hitX(), step->hitY(), step->hitZ());
-                   // skip if : 
-                   // -- 0) no mapping volume exists
-                   // -- 1) outside the mapping volume 
-                   // -- 2) outside the eta acceptance
-                   if (!m_mappingVolume || !(m_mappingVolume->inside(pos)) || fabs(pos.eta()) > m_etaCutOff ){
-                      ++m_skippedOutside;
-                      continue;
-                   }
-                   // now find the closest layer
-                   // (a) if the currentLayer is the last layer and the hit is still inside -> assign
-                   if (currentLayer < nLayersHit-1) {
-                       // search through the layers - this is the reference distance for projection
-                       double currentDistance = (pos-layersAndHits[currentLayer].second).mag();
-                       ATH_MSG_VERBOSE("- current distance is " << currentDistance << " from " << Amg::toString(pos) << " and " << Amg::toString(layersAndHits[currentLayer].second) );
-                       for (size_t testLayer = (currentLayer+1); testLayer < nLayersHit; ++testLayer){
-                           // calculate teh distance to the testLayer
-                           double testDistance = (pos-layersAndHits[testLayer].second).mag();
-                           ATH_MSG_VERBOSE("[L] Testing layer " << testLayer << " from layer collection for this step.");
-                           ATH_MSG_VERBOSE("- test    distance is " << testDistance << " from " << Amg::toString(pos) << " and " << Amg::toString(layersAndHits[testLayer].second) );
-                           if ( testDistance < currentDistance ){
-                               // screen output
-                               ATH_MSG_VERBOSE("[L] Skipping over to current layer " << testLayer << " because " << testDistance << " < " << currentDistance); 
-                               // the test distance did shrink - update currentLayer
-                               currentLayer      = testLayer; 
-                               currentDistance   = testDistance;
-                           } else {
-                               // stick to the layer you have 
-                               break;
-                           }
-                       }
-                   }
-                   // the currentLayer *should* be correct now 
-                   const Trk::Layer* assignedLayer =  layersAndHits[currentLayer].first;
-                   Amg::Vector3D assignedPosition  = layersAndHits[currentLayer].second;
-                   // associate the hit 
-                   // (1) count it 
-                   ++associatedSteps;
-                   // (2) associate it
-                   associateHit(*assignedLayer, pos, assignedPosition, t, step->fullMaterial());
-              } // loop over material Steps
+                  delete parameters;
+              }
+            }
+            // cleanup of the final hits
+            if (ecc.endParameters != parameters) delete ecc.endParameters;
             
-              // check for the empty hits - they need to be taken into account
-              ATH_MSG_VERBOSE("Found " << layersAndHits.size() << " intersected layers - while having " << m_layersRecordedPerEvent.size() << " recorded ones.");
+            // we have no layers and Hits
+            if (layersAndHits.empty()){
+                ATH_MSG_VERBOSE("[!] No Layer was intersected - skipping.");
+                return StatusCode::SUCCESS;
+            }
             
-              // now - cross-chek if you have additional layers 
-              for ( auto& lhp : layersAndHits){
-                  // check if you find the layer int he already done record-map : not found - we need to do an empty hit scaling
-                  if (m_layersRecordedPerEvent.find(lhp.first) == m_layersRecordedPerEvent.end()){
-                      // try to find the layer material record
-                      auto clIter = m_layerRecords.find(lhp.first);
-                      if (clIter != m_layerRecords.end() ){
-                          (*clIter).second.associateEmptyHit(lhp.second);
-                          ATH_MSG_VERBOSE("- to layer with index "<< lhp.first->layerIndex().value() << " with empty hit detected.");
-                      } else
-                          ATH_MSG_WARNING("- no Layer found in the associated map! Should not happen.");
-                  }
+            // layers are ordered, hence you can move the starting point along
+            size_t currentLayer = 0;
+            // loop through hits and find the closest layer, the start point moves outwards as we go 
+            for ( const Trk::MaterialStep* step : *materialStepCollection ) {
+               // verbose output    
+               ATH_MSG_VERBOSE("[L] starting from layer " << currentLayer << " from layer collection for this step.");
+               // step length and position
+               double t     = step->steplength();
+               Amg::Vector3D pos(step->hitX(), step->hitY(), step->hitZ());
+               // skip if : 
+               // -- 0) no mapping volume exists
+               // -- 1) outside the mapping volume 
+               // -- 2) outside the eta acceptance
+               if (!m_mappingVolume || !(m_mappingVolume->inside(pos)) || fabs(pos.eta()) > m_etaCutOff ){
+                  ++m_skippedOutside;
+                  continue;
                }
-               
-               // check whether the event was good for at least one hit
-               if (associatedSteps) {
-                   ATH_MSG_VERBOSE("There are associated steps, need to call finalizeEvent() & record to the MaterialMapper.");
-                   // finalize the event   --------------------- Layers ---------------------------------------------
-                   for (auto& lRecord : m_layerRecords ) {
-                       // associated material
-                       Trk::AssociatedMaterial* assMatHit = lRecord.second.finalizeEvent((*lRecord.first));
-                       // record the full layer hit 
-                       if (assMatHit && !m_materialMapper.empty()) m_materialMapper->recordLayerHit(*assMatHit, true);
-                       delete assMatHit;
-                       // call the material mapper finalize method
-                       ATH_MSG_VERBOSE("Calling finalizeEvent on the MaterialMapper ...");
-                   } 
-               } // the event had at least one associated hit
-
-            } // end of eCode.success : needed for new mapping schema  
-         
-         } // material steps existed
+               // now find the closest layer
+               // (a) if the currentLayer is the last layer and the hit is still inside -> assign
+               if (currentLayer < nLayersHit-1) {
+                   // search through the layers - this is the reference distance for projection
+                   double currentDistance = (pos-layersAndHits[currentLayer].second).mag();
+                   ATH_MSG_VERBOSE("- current distance is " << currentDistance << " from " << Amg::toString(pos) << " and " << Amg::toString(layersAndHits[currentLayer].second) );
+                   for (size_t testLayer = (currentLayer+1); testLayer < nLayersHit; ++testLayer){
+                       // calculate teh distance to the testLayer
+                       double testDistance = (pos-layersAndHits[testLayer].second).mag();
+                       ATH_MSG_VERBOSE("[L] Testing layer " << testLayer << " from layer collection for this step.");
+                       ATH_MSG_VERBOSE("- test    distance is " << testDistance << " from " << Amg::toString(pos) << " and " << Amg::toString(layersAndHits[testLayer].second) );
+                       if ( testDistance < currentDistance ){
+                           // screen output
+                           ATH_MSG_VERBOSE("[L] Skipping over to current layer " << testLayer << " because " << testDistance << " < " << currentDistance); 
+                           // the test distance did shrink - update currentLayer
+                           currentLayer      = testLayer; 
+                           currentDistance   = testDistance;
+                       } else {
+                           // stick to the layer you have 
+                           break;
+                       }
+                   }
+               }
+               // the currentLayer *should* be correct now 
+               const Trk::Layer* assignedLayer =  layersAndHits[currentLayer].first;
+               Amg::Vector3D assignedPosition  = layersAndHits[currentLayer].second;
+               // associate the hit 
+               // (1) count it 
+               ++associatedSteps;
+               // (2) associate it
+               associateHit(*assignedLayer, pos, assignedPosition, t, step->fullMaterial());
+          } // loop over material Steps
+        
+          // check for the empty hits - they need to be taken into account
+          ATH_MSG_VERBOSE("Found " << layersAndHits.size() << " intersected layers - while having " << m_layersRecordedPerEvent.size() << " recorded ones.");
+        
+          // now - cross-chek if you have additional layers 
+          for ( auto& lhp : layersAndHits){
+              // check if you find the layer int he already done record-map : not found - we need to do an empty hit scaling
+              if (m_layersRecordedPerEvent.find(lhp.first) == m_layersRecordedPerEvent.end()){
+                  // try to find the layer material record
+                  auto clIter = m_layerRecords.find(lhp.first);
+                  if (clIter != m_layerRecords.end() ){
+                      (*clIter).second.associateEmptyHit(lhp.second);
+                      ATH_MSG_VERBOSE("- to layer with index "<< lhp.first->layerIndex().value() << " with empty hit detected.");
+                  } else
+                      ATH_MSG_WARNING("- no Layer found in the associated map! Should not happen.");
+              }
+           }
+           
+           // check whether the event was good for at least one hit
+           if (associatedSteps) {
+               ATH_MSG_VERBOSE("There are associated steps, need to call finalizeEvent() & record to the MaterialMapper.");
+               // finalize the event   --------------------- Layers ---------------------------------------------
+               for (auto& lRecord : m_layerRecords ) {
+                   // associated material
+                   Trk::AssociatedMaterial* assMatHit = lRecord.second.finalizeEvent((*lRecord.first));
+                   // record the full layer hit 
+                   if (assMatHit && !m_materialMapper.empty()) m_materialMapper->recordLayerHit(*assMatHit, true);
+                   delete assMatHit;
+                   // call the material mapper finalize method
+                   ATH_MSG_VERBOSE("Calling finalizeEvent on the MaterialMapper ...");
+               } 
+           } // the event had at least one associated hit
+
+        } // end of eCode.success : needed for new mapping schema  
+     
+     } // material steps existed
          
 
     return StatusCode::SUCCESS;
@@ -341,7 +325,7 @@ bool Trk::MaterialMapping::associateHit( const Trk::Layer& associatedLayer,
     const Trk::Layer* layer = &associatedLayer;
     
     // get the associated volume
-    const Trk::TrackingVolume* associatedVolume = m_trackingGeometry->lowestTrackingVolume(pos);
+    const Trk::TrackingVolume* associatedVolume = trackingGeometry().lowestTrackingVolume(pos);
     
     // try to find the layer material record
     auto clIter = m_layerRecords.find(layer);              
@@ -525,30 +509,23 @@ StatusCode Trk::MaterialMapping::finalize()
 }
 
 
-StatusCode Trk::MaterialMapping::retrieveTrackingGeometry()
+StatusCode Trk::MaterialMapping::handleTrackingGeometry()
 {
-
-    // Retrieve the TrackingGeometry from the DetectorStore
-    if ((detStore()->retrieve(m_trackingGeometry, m_trackingGeometrySvc->trackingGeometryName())).isFailure()) {
-        ATH_MSG_FATAL("Could not retrieve TrackingGeometry from DetectorStore!");
-        return StatusCode::FAILURE;
-    }
-    
     // either get a string volume or the highest one
-    const Trk::TrackingVolume* trackingVolume = m_trackingGeometry->highestTrackingVolume();
+    const Trk::TrackingVolume* trackingVolume = trackingGeometry().highestTrackingVolume();
     
     // prepare the mapping volume
-    m_mappingVolume = m_trackingGeometry->trackingVolume(m_mappingVolumeName);
+    m_mappingVolume = trackingGeometry().trackingVolume(m_mappingVolumeName);
     
     // register the confined layers from the TrackingVolume
     registerVolume(*trackingVolume, 0);
     
     ATH_MSG_INFO("Add "<< m_layerRecords.size() << " confined volume layers to mapping setup.");
-    ATH_MSG_INFO("Add "<< m_trackingGeometry->boundaryLayers().size() << " boundary layers to mapping setup.");
+    ATH_MSG_INFO("Add "<< trackingGeometry().boundaryLayers().size() << " boundary layers to mapping setup.");
     
     // register the layers from boundary surfaces
-    auto bLayerIter = m_trackingGeometry->boundaryLayers().begin();
-    for (; bLayerIter != m_trackingGeometry->boundaryLayers().end(); ++bLayerIter)
+    auto bLayerIter = trackingGeometry().boundaryLayers().begin();
+    for (; bLayerIter != trackingGeometry().boundaryLayers().end(); ++bLayerIter)
         insertLayerMaterialRecord(*bLayerIter->first);
 
     ATH_MSG_INFO("Map for "<< m_layerRecords.size() << " layers booked & prepared for mapping procedure");
@@ -632,3 +609,10 @@ void Trk::MaterialMapping::insertLayerMaterialRecord(const Trk::Layer& lay){
  }
 }
 
+void Trk::MaterialMapping::throwFailedToGetTrackingGeometry() const {
+   std::stringstream msg;
+   msg << "Failed to get conditions data " << m_trackingGeometryReadKey.key() << ".";
+   throw std::runtime_error(msg.str());
+}
+
+
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.cxx b/Tracking/TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.cxx
index 93f10c158c4d..cc027352e509 100755
--- a/Tracking/TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.cxx
@@ -11,12 +11,10 @@
 // Trk
 #include "TrkDetDescrAlgs/MaterialValidation.h"
 #include "TrkGeometry/TrackingVolume.h"
-#include "TrkGeometry/TrackingGeometry.h"
 #include "TrkGeometry/Layer.h"
 #include "TrkGeometry/LayerMaterialProperties.h"
 #include "TrkGeometry/MaterialProperties.h"
 #include "TrkGeometry/AssociatedMaterial.h"
-#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h"
 #include "TrkDetDescrInterfaces/IMaterialMapper.h"
 #include "TrkNeutralParameters/NeutralParameters.h"
 
@@ -29,10 +27,8 @@
 
 Trk::MaterialValidation::MaterialValidation(const std::string& name, ISvcLocator* pSvcLocator)
 : AthAlgorithm(name,pSvcLocator)    ,
-  m_trackingGeometrySvc("AtlasTrackingGeometrySvc",name),
-  m_trackingGeometry(nullptr),
   m_materialMapper("Trk::MaterialMapper/MappingMaterialMapper"),
-  m_maxMaterialMappingEvents(25000),
+  m_maxMaterialValidationEvents(25000),
   m_flatDist(nullptr),
   m_etaMin(-3.),
   m_etaMax(3.),
@@ -40,12 +36,10 @@ Trk::MaterialValidation::MaterialValidation(const std::string& name, ISvcLocator
   m_accTinX0(0)
 {
 
-    // ---------------------- The TrackingGeometrySvc ------------------------ //
-    declareProperty("TrackingGeometrySvc"         , m_trackingGeometrySvc);
     // ---------------------- The Material Mapping -------------------------- //
     // the toolhandle of the MaterialMapper to be used
     declareProperty("MaterialMapper"               , m_materialMapper);
-    declareProperty("MaximumMappingEvents"         , m_maxMaterialMappingEvents);
+    declareProperty("MaximumMappingEvents"         , m_maxMaterialValidationEvents);
     // ---------------------- Range setup ----------------------------------- //
     declareProperty("MinEta"                      , m_etaMin);
     declareProperty("MaxEta"                      , m_etaMax);
@@ -63,11 +57,12 @@ StatusCode Trk::MaterialValidation::initialize()
 {
     
     // Get the TrackingGeometry from StoreGate
-    // initialize the TrackingGeometrySvc
-    if (m_trackingGeometrySvc.retrieve().isFailure()) {
-        ATH_MSG_FATAL( "Cannot retrieve TrackingGeometrySvc. Abort job. " );
-        return StatusCode::FAILURE;
+#ifdef LEGACY_TRKGEOM
+    if (!m_trackingGeometrySvc.empty()) {
+       ATH_CHECK( m_trackingGeometrySvc.retrieve());
     }
+#endif
+    ATH_CHECK( m_trackingGeometryReadKey.initialize(!m_trackingGeometryReadKey.key().empty()) );
     
     if ( (m_materialMapper.retrieve()).isFailure() )
         ATH_MSG_WARNING("Could not retrieve MaterialMapper");
@@ -82,15 +77,6 @@ StatusCode Trk::MaterialValidation::execute()
 {
     ATH_MSG_VERBOSE( "MaterialValidation execute() start ================================================" );
 
-    // ------------------------------- get the trackingGeometry at first place
-    if (!m_trackingGeometry) {
-        StatusCode retrieveCode = retrieveTrackingGeometry();
-        if (retrieveCode.isFailure()){
-            ATH_MSG_INFO( "Could not retrieve TrackingGeometry. Exiting." );
-            return retrieveCode;
-        }
-    }
-
     // create the random direction - flat in eta
     double eta   = m_etaMin + (m_etaMax-m_etaMin)*m_flatDist->shoot();
     double theta = 2.*atan(exp(-eta));
@@ -104,7 +90,7 @@ StatusCode Trk::MaterialValidation::execute()
     ATH_MSG_DEBUG("[>] Start mapping event with phi | eta = " << phi << " | " << direction.eta()); 
      
     // find the start TrackingVolume
-    const Trk::TrackingVolume* sVolume = m_trackingGeometry->lowestTrackingVolume(position);
+    const Trk::TrackingVolume* sVolume = trackingGeometry().lowestTrackingVolume(position);
     const Trk::TrackingVolume* nVolume = sVolume;
     while (nVolume ) {
         Trk::PositionAtBoundary paB = collectMaterialAndExit(*nVolume, position, direction);
@@ -312,13 +298,10 @@ StatusCode Trk::MaterialValidation::finalize()
     return StatusCode::SUCCESS;
 }
 
-StatusCode Trk::MaterialValidation::retrieveTrackingGeometry()
-{
-
-    // Retrieve the TrackingGeometry from the DetectorStore
-    if ((detStore()->retrieve(m_trackingGeometry, m_trackingGeometrySvc->trackingGeometryName())).isFailure()) {
-        ATH_MSG_FATAL( "Could not retrieve TrackingGeometry from DetectorStore!" );
-        return StatusCode::FAILURE;
-    }
-    return StatusCode::SUCCESS;
+void Trk::MaterialValidation::throwFailedToGetTrackingGeometry() const {
+   std::stringstream msg;
+   msg << "Failed to get conditions data " << m_trackingGeometryReadKey.key() << ".";
+   throw std::runtime_error(msg.str());
 }
+
+
diff --git a/Tracking/TrkDetDescr/TrkDetDescrTestTools/TrkDetDescrTestTools/LayerMaterialAnalyser.h b/Tracking/TrkDetDescr/TrkDetDescrTestTools/TrkDetDescrTestTools/LayerMaterialAnalyser.h
index 66d41538fa24..c0a87deeb88b 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrTestTools/TrkDetDescrTestTools/LayerMaterialAnalyser.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrTestTools/TrkDetDescrTestTools/LayerMaterialAnalyser.h
@@ -74,25 +74,25 @@ namespace Trk {
         std::string           m_validationTreeDescription; //!< validation tree description - second argument in TTree
         std::string           m_validationTreeFolder;      //!< stream/folder to for the TTree to be written out
         
-        mutable int           m_layerIndex;                //!< the layer index given by the TrackingGeometry
-        mutable int           m_layerType;                 //!< the type of the layer 1 - cylinder, 2 - disk
-        mutable float         m_layerTranslation[3]{};       //!< center of the transform
-        mutable float         m_layerRotation[9]{};          //!< orientation of the layer         
-        mutable float         m_layerDimension0;           //!< dimension 0 : cylinder r, disk r_min
-        mutable float         m_layerDimension1;           //!< dimension 1 : cylinder z, disk r_max
-        mutable int           m_layerBins;                 //!< total number of bins - loc0 * loc 1
-        mutable int           m_layerBins0;                //!< total number of bins - loc 0
-        mutable int           m_layerBins1;                //!< total number of bins - loc 0
-        mutable std::vector<int> m_bin0 {LAYERMAXBINS};        //!< bin 0
-        mutable std::vector<int> m_bin1 {LAYERMAXBINS};        //!< bin 1
-        mutable std::vector<float> m_thickness {LAYERMAXBINS};   //!< gathered thickness from material mapping/material properties
-        mutable std::vector<float> m_X0 {LAYERMAXBINS};          //!< gathered X0 from material mapping/material properties
-        mutable std::vector<float> m_L0 {LAYERMAXBINS};          //!< gathered L0 from material mapping/material properties
-        mutable std::vector<float> m_A {LAYERMAXBINS};           //!< gathered A from material mapping/material properties
-        mutable std::vector<float> m_Z {LAYERMAXBINS};           //!< gathered Z from material mapping/material properties
-        mutable std::vector<float> m_Rho {LAYERMAXBINS};         //!< gathered rho from material mapping/material properties
-        mutable std::vector<int> m_elements {LAYERMAXBINS};    //!< gathered number of elements from material mapping/material properties
-        mutable std::vector<int> m_binCounter {LAYERMAXBINS};  //!< how often was this bin hit / used
+        mutable int                 m_layerIndex;                //!< the layer index given by the TrackingGeometry
+        mutable int                 m_layerType;                 //!< the type of the layer 1 - cylinder, 2 - disk
+        std::vector<float>* m_layerTranslation;       //!< center of the transform
+        std::vector<float>* m_layerRotation;          //!< orientation of the layer         
+        mutable float               m_layerDimension0;           //!< dimension 0 : cylinder r, disk r_min
+        mutable float               m_layerDimension1;           //!< dimension 1 : cylinder z, disk r_max
+        mutable int                 m_layerBins;                 //!< total number of bins - loc0 * loc 1
+        mutable int                 m_layerBins0;                //!< total number of bins - loc 0
+        mutable int                 m_layerBins1;                //!< total number of bins - loc 0
+        std::vector<int>*   m_bin0;        //!< bin 0
+        std::vector<int>*   m_bin1;        //!< bin 1
+        std::vector<float>* m_thickness;   //!< gathered thickness from material mapping/material properties
+        std::vector<float>* m_X0;          //!< gathered X0 from material mapping/material properties
+        std::vector<float>* m_L0;          //!< gathered L0 from material mapping/material properties
+        std::vector<float>* m_A;           //!< gathered A from material mapping/material properties
+        std::vector<float>* m_Z;           //!< gathered Z from material mapping/material properties
+        std::vector<float>* m_Rho;         //!< gathered rho from material mapping/material properties
+        std::vector<int>*   m_elements;    //!< gathered number of elements from material mapping/material properties
+        std::vector<int>*   m_binCounter;  //!< how often was this bin hit / used
 
     };
 
diff --git a/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/LayerMaterialAnalyser.cxx b/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/LayerMaterialAnalyser.cxx
index 4fccf295713b..971ea4ddb371 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/LayerMaterialAnalyser.cxx
+++ b/Tracking/TrkDetDescr/TrkDetDescrTestTools/src/LayerMaterialAnalyser.cxx
@@ -37,15 +37,25 @@ Trk::LayerMaterialAnalyser::LayerMaterialAnalyser(const std::string& t, const st
   m_validationTreeName("LayerMaterialAnalyser"),
   m_validationTreeDescription("LayerMaterialAnalyser information"),
   m_validationTreeFolder("/val/LayerMaterialAnalyser"),
-  m_layerIndex{},        
-  m_layerType{},
-  m_layerDimension0{},   
-  m_layerDimension1{},   
-  m_layerBins{},         
-  m_layerBins0{},         
-  m_layerBins1{}      
-
-  
+  m_layerIndex(0),        
+  m_layerType(0),
+  m_layerTranslation(nullptr),
+  m_layerRotation(nullptr),
+  m_layerDimension0(0.),   
+  m_layerDimension1(0.),   
+  m_layerBins(0),         
+  m_layerBins0(0),         
+  m_layerBins1(0),
+  m_bin0(nullptr),
+  m_bin1(nullptr),
+  m_thickness(nullptr),
+  m_X0(nullptr),
+  m_L0(nullptr),
+  m_A(nullptr),
+  m_Z(nullptr),
+  m_Rho(nullptr),
+  m_elements(nullptr),
+  m_binCounter(nullptr)
 {
     declareInterface<Trk::ILayerMaterialAnalyser>(this);
     // give the map a name
@@ -63,7 +73,20 @@ Trk::LayerMaterialAnalyser::~LayerMaterialAnalyser()
 // initialize
 StatusCode Trk::LayerMaterialAnalyser::initialize() 
 {
-
+  
+    m_layerTranslation = new std::vector<float>(3, 0.);
+    m_layerRotation    = new std::vector<float>(9, 0.);
+    m_bin0             = new std::vector<int>(LAYERMAXBINS, 0);
+    m_bin1             = new std::vector<int>(LAYERMAXBINS, 0);
+    m_thickness        = new std::vector<float>(LAYERMAXBINS, 0.);
+    m_X0               = new std::vector<float>(LAYERMAXBINS, 0.);
+    m_L0               = new std::vector<float>(LAYERMAXBINS, 0.);
+    m_A                = new std::vector<float>(LAYERMAXBINS, 0.);
+    m_Z                = new std::vector<float>(LAYERMAXBINS, 0.);
+    m_Rho              = new std::vector<float>(LAYERMAXBINS, 0.);
+    m_elements         = new std::vector<int>(LAYERMAXBINS, 0);
+    m_binCounter       = new std::vector<int>(LAYERMAXBINS, 0);
+    
     // now register the Tree
     ITHistSvc* tHistSvc = nullptr;
     
@@ -71,25 +94,25 @@ StatusCode Trk::LayerMaterialAnalyser::initialize()
     m_validationTree = new TTree(m_validationTreeName.c_str(), m_validationTreeDescription.c_str());
 
     // position coordinates of the update
-    m_validationTree->Branch("LayerIndex",            &m_layerIndex,           "lIndex/I");
-    m_validationTree->Branch("LayerType",             &m_layerType,            "lType/I");
-    m_validationTree->Branch("LayerTranslation",      m_layerTranslation,      "lTranslation[3]/F");
-    m_validationTree->Branch("LayerRotation",         m_layerRotation,         "lRotation[9]/F");
-    m_validationTree->Branch("LayerDimension0",       &m_layerDimension0,      "lDimension0/F");    
-    m_validationTree->Branch("LayerDimension1",       &m_layerDimension1,      "lDimension1/F");
-    m_validationTree->Branch("LayerBins",             &m_layerBins,            "lBins/I");
-    m_validationTree->Branch("LayerBins0",            &m_layerBins0,           "lBins0/I");
-    m_validationTree->Branch("LayerBins1",            &m_layerBins1,           "lBins1/I");
-    m_validationTree->Branch("LayerBin0",             m_bin0.data(),           "lBin0[lBins]/I");
-    m_validationTree->Branch("LayerBin1",             m_bin1.data(),           "lBin1[lBins]/I");
-    m_validationTree->Branch("LayerBinCounter",       m_binCounter.data(),     "lBinC[lBins]/I");
-    m_validationTree->Branch("LayerThickness",        m_thickness.data(),      "lt[lBins]/F");
-    m_validationTree->Branch("LayerX0",               m_X0.data(),             "lX0[lBins]/F");
-    m_validationTree->Branch("LayerL0",               m_L0.data(),             "lL0[lBins]/F");
-    m_validationTree->Branch("LayerA",                m_A.data(),              "lA[lBins]/F");
-    m_validationTree->Branch("LayerZ",                m_Z.data(),              "lZ[lBins]/F");
-    m_validationTree->Branch("LayerRo",               m_Rho.data(),            "lRho[lBins]/F");
-    m_validationTree->Branch("LayerElements",         m_elements.data(),       "lElements[lBins]/I");
+    m_validationTree->Branch("LayerIndex",            &m_layerIndex         );
+    m_validationTree->Branch("LayerType",             &m_layerType          );
+    m_validationTree->Branch("LayerTranslation",      &m_layerTranslation   );
+    m_validationTree->Branch("LayerRotation",         &m_layerRotation      );
+    m_validationTree->Branch("LayerDimension0",       &m_layerDimension0    );
+    m_validationTree->Branch("LayerDimension1",       &m_layerDimension1    );
+    m_validationTree->Branch("LayerBins",             &m_layerBins          );
+    m_validationTree->Branch("LayerBins0",            &m_layerBins0         );
+    m_validationTree->Branch("LayerBins1",            &m_layerBins1         );
+    m_validationTree->Branch("LayerBin0",             &m_bin0               );
+    m_validationTree->Branch("LayerBin1",             &m_bin1               );
+    m_validationTree->Branch("LayerBinCounter",       &m_binCounter         );
+    m_validationTree->Branch("LayerThickness",        &m_thickness          );
+    m_validationTree->Branch("LayerX0",               &m_X0                 );
+    m_validationTree->Branch("LayerL0",               &m_L0                 );
+    m_validationTree->Branch("LayerA",                &m_A                  );
+    m_validationTree->Branch("LayerZ",                &m_Z                  );
+    m_validationTree->Branch("LayerRo",               &m_Rho                );
+    m_validationTree->Branch("LayerElements",         &m_elements           );
     
     // now register the Tree
     if (service("THistSvc",tHistSvc).isFailure()) {
@@ -109,6 +132,18 @@ StatusCode Trk::LayerMaterialAnalyser::initialize()
 // finalize
 StatusCode Trk::LayerMaterialAnalyser::finalize() 
 {
+    delete m_layerTranslation ;
+    delete m_layerRotation    ;
+    delete m_bin0             ;
+    delete m_bin1             ;
+    delete m_thickness        ;
+    delete m_X0               ;
+    delete m_L0               ;
+    delete m_A                ;
+    delete m_Z                ;
+    delete m_Rho              ;
+    delete m_elements         ;
+    delete m_binCounter       ;
     return StatusCode::SUCCESS;
 }
 
@@ -167,24 +202,24 @@ StatusCode Trk::LayerMaterialAnalyser::analyse(const Trk::Layer& layer,
                                                const Trk::MaterialPropertiesMatrix& mpMatrix,
                                                const std::vector< std::vector< unsigned int > >* bCounter ) const
 {
-
+  
     // general layer information
     m_layerIndex = layer.layerIndex().value();
     const Trk::Surface& lSurface = layer.surfaceRepresentation();
-    m_layerTranslation[0] = lSurface.center().x();
-    m_layerTranslation[1] = lSurface.center().y();
-    m_layerTranslation[2] = lSurface.center().z();
+    m_layerTranslation->at(0) = lSurface.center().x();
+    m_layerTranslation->at(1) = lSurface.center().y();
+    m_layerTranslation->at(2) = lSurface.center().z();
     
     AmgMatrix(3,3) rMatrix = lSurface.transform().rotation();
-    m_layerRotation[0] = rMatrix(0,0);
-    m_layerRotation[1] = rMatrix(1,0);
-    m_layerRotation[2] = rMatrix(2,0);
-    m_layerRotation[3] = rMatrix(0,1);
-    m_layerRotation[4] = rMatrix(1,1);
-    m_layerRotation[5] = rMatrix(2,1);
-    m_layerRotation[6] = rMatrix(0,2);
-    m_layerRotation[7] = rMatrix(1,2);
-    m_layerRotation[8] = rMatrix(2,2);
+    m_layerRotation->at(0) = rMatrix(0,0);
+    m_layerRotation->at(1) = rMatrix(1,0);
+    m_layerRotation->at(2) = rMatrix(2,0);
+    m_layerRotation->at(3) = rMatrix(0,1);
+    m_layerRotation->at(4) = rMatrix(1,1);
+    m_layerRotation->at(5) = rMatrix(2,1);
+    m_layerRotation->at(6) = rMatrix(0,2);
+    m_layerRotation->at(7) = rMatrix(1,2);
+    m_layerRotation->at(8) = rMatrix(2,2);
 
     // cylinder bounds 
     if ( lSurface.type() == Trk::SurfaceType::Cylinder ){
@@ -213,29 +248,29 @@ StatusCode Trk::LayerMaterialAnalyser::analyse(const Trk::Layer& layer,
     for (const auto & outerIter : mpMatrix){
         int bin0 = 0;
         for (const auto & innerIter : outerIter ){
-            m_bin0[m_layerBins] = bin0;
-            m_bin1[m_layerBins] = bin1;
+            m_bin0->at(m_layerBins) = bin0;
+            m_bin1->at(m_layerBins) = bin1;
             // get the material
             const Trk::MaterialProperties* mProperties = innerIter;
             if (mProperties){
-                m_thickness[m_layerBins] = mProperties->thickness();
-                m_X0[m_layerBins]        = mProperties->x0();
-                m_L0[m_layerBins]        = mProperties->l0();
-                m_A[m_layerBins]         = mProperties->averageA();
-                m_Z[m_layerBins]         = mProperties->averageZ();
-                m_Rho[m_layerBins]       = mProperties->averageRho();
-                m_elements[m_layerBins]  = mProperties->material().composition ? mProperties->material().composition->size() : 0;    
+                m_thickness->at(m_layerBins) = mProperties->thickness();
+                m_X0->at(m_layerBins)        = mProperties->x0();
+                m_L0->at(m_layerBins)        = mProperties->l0();
+                m_A->at(m_layerBins)         = mProperties->averageA();
+                m_Z->at(m_layerBins)         = mProperties->averageZ();
+                m_Rho->at(m_layerBins)       = mProperties->averageRho();
+                m_elements->at(m_layerBins)  = mProperties->material().composition ? mProperties->material().composition->size() : 0;    
             } else  {
-                m_thickness[m_layerBins] = 0.;
-                m_X0[m_layerBins]        = 0.;
-                m_L0[m_layerBins]        = 0.;
-                m_A[m_layerBins]         = 0.;
-                m_Z[m_layerBins]         = 0.;
-                m_Rho[m_layerBins]       = 0.;
-                m_elements[m_layerBins]  = 0.;                
+                m_thickness->at(m_layerBins) = 0.;
+                m_X0->at(m_layerBins)        = 0.;
+                m_L0->at(m_layerBins)        = 0.;
+                m_A->at(m_layerBins)         = 0.;
+                m_Z->at(m_layerBins)         = 0.;
+                m_Rho->at(m_layerBins)       = 0.;
+                m_elements->at(m_layerBins)  = 0.;                
             }
             // set the bin Counter 
-            m_binCounter[m_layerBins]    = bCounter ? (*bCounter)[bin1][bin0] : 1;
+            m_binCounter->at(m_layerBins)    = bCounter ? (*bCounter)[bin1][bin0] : 1;
             //     
             ++bin0;
             if (!bin1) ++m_layerBins0;
diff --git a/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfigNew.py b/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfigNew.py
new file mode 100644
index 000000000000..4c3962d5cd51
--- /dev/null
+++ b/Tracking/TrkG4Components/TrkG4UserActions/python/TrkG4UserActionsConfigNew.py
@@ -0,0 +1,37 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+"""Define methods to configure TrkG4UserActions"""
+
+def MaterialStepRecorderCfg(configFlags, name="G4UA::UserActionSvc.MaterialStepRecorderTool", **kwargs):
+  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+  from AthenaConfiguration.ComponentFactory import CompFactory
+  result = ComponentAccumulator()  
+  result.setPrivateTools(CompFactory.G4UA.MaterialStepRecorderTool(name, **kwargs))
+  return result
+  
+
+def MaterialStepRecorderUserActionSvcCfg(configFlags, name="G4UA::MaterialStepRecorderUserActionSvc", **kwargs):
+  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+  from AthenaConfiguration.ComponentFactory import CompFactory
+  
+  result = ComponentAccumulator()
+  
+  #Setting up the CA for the MaterialStepRecorder
+  actionAcc = ComponentAccumulator()
+  actions = []
+  actions += [actionAcc.popToolsAndMerge(MaterialStepRecorderCfg(configFlags))]
+  actionAcc.setPrivateTools(actions)
+  MaterialStepRecorderAction = result.popToolsAndMerge(actionAcc)
+  
+  #Retrieving the default action list
+  from G4AtlasServices.G4AtlasUserActionConfigNew import getDefaultActions
+  defaultActions = result.popToolsAndMerge(getDefaultActions(configFlags))
+    
+  #Adding LengthIntegrator to defaults
+  actionList = (defaultActions + MaterialStepRecorderAction)
+
+  #Setting up UserActionsService
+  kwargs.setdefault("UserActionTools",actionList)
+  result.addService(CompFactory.G4UA.UserActionSvc(name, **kwargs))    
+    
+  return result
diff --git a/Tracking/TrkG4Components/TrkG4UserActions/python/__init__.py b/Tracking/TrkG4Components/TrkG4UserActions/python/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/Tracking/TrkG4Components/TrkG4UserActions/scripts/RunGeantinoStepRecordingITk.py b/Tracking/TrkG4Components/TrkG4UserActions/scripts/RunGeantinoStepRecordingITk.py
new file mode 100644
index 000000000000..a5be31adac98
--- /dev/null
+++ b/Tracking/TrkG4Components/TrkG4UserActions/scripts/RunGeantinoStepRecordingITk.py
@@ -0,0 +1,141 @@
+#!/usr/bin/env python
+"""
+
+Run geantino processing for material step creation
+
+"""
+
+from argparse import ArgumentParser
+from AthenaCommon.Configurable import Configurable
+from AthenaCommon.Logging import log
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+# Set up logging and new style config
+Configurable.configurableRun3Behavior = True
+
+# Argument parsing
+parser = ArgumentParser("RunGeantinoStepRecordingITk.py")
+parser.add_argument("detectors", metavar="detectors", type=str, nargs="*",
+                    help="Specify the list of detectors")
+parser.add_argument("--simulate", default=True, action="store_true",
+                    help="Run Simulation")
+parser.add_argument("--localgeo", default=False, action="store_true",
+                    help="Use local geometry Xml files")
+parser.add_argument("-V", "--verboseAccumulators", default=False, 
+                    action="store_true",
+                    help="Print full details of the AlgSequence")
+parser.add_argument("-S", "--verboseStoreGate", default=False, 
+                    action="store_true",
+                    help="Dump the StoreGate(s) each event iteration")
+parser.add_argument("--maxEvents",default=10, type=int,
+                    help="The number of events to run. 0 skips execution")
+parser.add_argument("--skipEvents",default=0, type=int,
+                    help="The number of events to skip")
+parser.add_argument("--geometrytag",default="ATLAS-P2-ITK-24-00-00", type=str,
+                    help="The geometry tag to use")
+parser.add_argument("--inputevntfile",
+                    default="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetSLHC_Example/inputs/pgun_2M_10GeV_geantinos_Eta6_v2_EVNT.root",
+                    help="The input EVNT file to use")
+parser.add_argument("--outputhitsfile",default="myHITS.pool.root", type=str,
+                    help="The output HITS filename")
+args = parser.parse_args()
+
+
+# Some info about the job
+print("----GeantinoStepRecording for ITk geometry----")
+print()
+print("Using Geometry Tag: "+args.geometrytag)
+if args.localgeo:
+    print("...overridden by local Geometry Xml files")
+print("Input EVNT File:"+args.inputevntfile)
+if not args.detectors:
+    print("Running complete detector")
+else:
+    print("Running with: {}".format(", ".join(args.detectors)))
+print()
+
+# Configure
+if args.localgeo:
+    ConfigFlags.GeoModel.useLocalGeometry = True
+
+ConfigFlags.Input.Files = [args.inputevntfile]
+ConfigFlags.Output.HITSFileName = args.outputhitsfile
+
+ConfigFlags.GeoModel.AtlasVersion = args.geometrytag
+ConfigFlags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
+ConfigFlags.GeoModel.Align.Dynamic = False
+
+ConfigFlags.Exec.SkipEvents = args.skipEvents
+
+from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
+detectors = args.detectors if 'detectors' in args and args.detectors else ['ITkPixel', 'ITkStrip']
+detectors.append('Bpipe')  # always run with beam pipe
+setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
+  
+log.debug('Lock config flags now.')
+ConfigFlags.lock()
+
+# Construct our accumulator to run
+acc = MainServicesCfg(ConfigFlags)
+
+### setup dumping of additional information
+if args.verboseAccumulators:
+  acc.printConfig(withDetails=True)
+if args.verboseStoreGate:
+  acc.getService("StoreGateSvc").Dump = True
+  
+log.debug('Dumping of ConfigFlags now.')
+ConfigFlags.dump()
+
+from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
+acc.merge(PoolReadCfg(ConfigFlags))
+acc.merge(PoolWriteCfg(ConfigFlags))
+
+# add BeamEffectsAlg
+from BeamEffects.BeamEffectsAlgConfig import BeamEffectsAlgCfg
+acc.merge(BeamEffectsAlgCfg(ConfigFlags))
+
+kwargs = {}
+
+svcName = "G4UA::MaterialStepRecorderUserActionSvc"
+from TrkG4UserActions.TrkG4UserActionsConfigNew import MaterialStepRecorderUserActionSvcCfg
+acc.merge(MaterialStepRecorderUserActionSvcCfg(ConfigFlags,svcName,**kwargs))
+kwargs.update(UserActionSvc=svcName)
+
+if args.simulate:
+  from G4AtlasAlg.G4AtlasAlgConfigNew import G4AtlasAlgCfg
+  acc.merge(G4AtlasAlgCfg(ConfigFlags, "ITkG4AtlasAlg", **kwargs))
+  
+AthenaOutputStream=CompFactory.AthenaOutputStream
+AthenaOutputStreamTool=CompFactory.AthenaOutputStreamTool
+writingTool = AthenaOutputStreamTool( "MaterialStepCollectionStreamTool" )
+
+outputStream = AthenaOutputStream(name = "MaterialStepCollectionStream",
+                                  WritingTool = writingTool,
+                                  ItemList=['EventInfo#*', 'Trk::MaterialStepCollection#*'],
+                                  MetadataItemList = [ "EventStreamInfo#MaterialStepCollectionStream", "IOVMetaDataContainer#*" ],
+                                  OutputFile = "MaterialStepCollection.root")
+
+StoreGateSvc=CompFactory.StoreGateSvc
+acc.addService(StoreGateSvc("MetaDataStore"))
+outputStream.MetadataStore = acc.getService("MetaDataStore")
+
+MakeEventStreamInfo=CompFactory.MakeEventStreamInfo
+streamInfoTool = MakeEventStreamInfo( "MaterialStepCollectionStream_MakeEventStreamInfo" )
+streamInfoTool.Key = "MaterialStepCollectionStream"
+streamInfoTool.EventInfoKey = "EventInfo"
+outputStream.HelperTools.append(streamInfoTool)
+    
+acc.addEventAlgo(outputStream)
+
+acc.printConfig(withDetails = True, summariseProps = True)
+
+acc.run(maxEvents=args.maxEvents)
+
+f=open("GeantinoStepRecordingITk.pkl","wb")
+acc.store(f)
+f.close()
-- 
GitLab


From e72975ee78abb22a2d4bf263ec08d65ffeddf5c9 Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Tue, 21 Sep 2021 16:38:45 +0200
Subject: [PATCH 238/347] Switch off test_ReSimulation.sh for the AthSimulation
 project

---
 .../Tests/ISF_Validation/test/test_ReSimulation.sh  | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/Simulation/Tests/ISF_Validation/test/test_ReSimulation.sh b/Simulation/Tests/ISF_Validation/test/test_ReSimulation.sh
index d484ff736c40..dee43a7cf88b 100755
--- a/Simulation/Tests/ISF_Validation/test/test_ReSimulation.sh
+++ b/Simulation/Tests/ISF_Validation/test/test_ReSimulation.sh
@@ -1,18 +1,11 @@
 #!/bin/sh
 #
-# art-description: Reading single particle gen events, checking that the SkipEvents argument works, using 2015 geometry and conditions
-# art-include: 21.0/Athena
-# art-include: 21.0/AthSimulation
-# art-include: 21.3/Athena
-# art-include: 21.9/Athena
+# art-description: ReSimulation Workflow running with MC16 conditions/geometry
 # art-include: master/Athena
-# art-include: master/AthSimulation
 # art-type: grid
 # art-output: log.*
 # art-output: original.HITS.pool.root
-# art-output: renamed.HITS.pool.root
-# art-output: retest.HITS.pool.root
-# art-output: test.HITS.pool.root
+# art-output: resim.HITS.pool.root
 
 INPUTEVNTFILE="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1"
 #INPUTEVNTFILE='/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ISF_Validation/pi_E50_eta0-60.evgen.pool.root'
@@ -47,7 +40,7 @@ ReSim_tf.py \
 --DataRunNumber '284500' \
 --geometryVersion 'ReSim:ATLAS-R2-2016-01-00-01' \
 --inputHITSFile "original.HITS.pool.root" \
---outputHITS_RSMFile "retest.HITS.pool.root" \
+--outputHITS_RSMFile "resim.HITS.pool.root" \
 --maxEvents $MAXEVENTS \
 --imf False
 
-- 
GitLab


From 21eb9bc4ca9265639cefd6cb1cafdc26818a76a7 Mon Sep 17 00:00:00 2001
From: Francesco Giuseppe Gravili <francesco.giuseppe.gravili@cern.ch>
Date: Tue, 21 Sep 2021 16:39:06 +0200
Subject: [PATCH 239/347] NSW Trigger Simulation - MicroMegas: smart pointers
 follow-up

---
 .../TrigT1/TrigT1NSW/src/NSWL1Simulation.cxx  |   2 -
 .../TrigT1NSWSimTools/IMMTriggerTool.h        |   2 -
 .../TrigT1NSWSimTools/MMLoadVariables.h       |  15 +-
 .../TrigT1NSWSimTools/MMT_Diamond.h           |   8 +-
 .../TrigT1NSWSimTools/MMT_Finder.h            |  10 +-
 .../TrigT1NSWSimTools/MMT_Fitter.h            |  46 ++--
 .../TrigT1NSWSimTools/MMT_Hit.h               |   2 +-
 .../TrigT1NSWSimTools/MMT_Road.h              |   2 +-
 .../TrigT1NSWSimTools/MMT_struct.h            |   8 +-
 .../TrigT1NSWSimTools/MMTriggerTool.h         |  12 +-
 .../TrigT1NSWSimTools/src/MMLoadVariables.cxx |  29 +--
 .../TrigT1NSWSimTools/src/MMT_Diamond.cxx     |  36 ++-
 .../TrigT1NSWSimTools/src/MMT_Finder.cxx      |  36 +--
 .../TrigT1NSWSimTools/src/MMT_Fitter.cxx      | 235 +++++++++---------
 .../TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx  |   6 +-
 .../TrigT1/TrigT1NSWSimTools/src/MMT_Road.cxx |   2 +-
 .../TrigT1NSWSimTools/src/MMT_struct.cxx      |  10 +-
 .../TrigT1NSWSimTools/src/MMTriggerTool.cxx   | 190 +++++++-------
 18 files changed, 304 insertions(+), 347 deletions(-)

diff --git a/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.cxx b/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.cxx
index 99e2e1731aa8..e465f8a5bb62 100644
--- a/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.cxx
+++ b/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.cxx
@@ -95,7 +95,6 @@ namespace NSWL1 {
     
     if(m_doMM ){
       ATH_CHECK(m_mmtrigger.retrieve());
-      if(m_doMMDiamonds) ATH_CHECK( m_mmtrigger->initDiamondAlgorithm() );
     }
 
     // Connect to Monitoring Service
@@ -162,7 +161,6 @@ namespace NSWL1 {
     for ( auto& mon :  m_monitors ) {
       ATH_CHECK(mon->finalHists());
     }
-    if(m_doMM) ATH_CHECK( m_mmtrigger->finalizeDiamondAlgorithm(m_doMMDiamonds) );
     return StatusCode::SUCCESS;
   }
 
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/IMMTriggerTool.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/IMMTriggerTool.h
index dc45f7af1a01..8de5a0ca69d7 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/IMMTriggerTool.h
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/IMMTriggerTool.h
@@ -24,8 +24,6 @@ namespace NSWL1 {
     virtual ~IMMTriggerTool() {}
 
     virtual StatusCode runTrigger(const bool do_MMDiamonds) = 0;
-    virtual StatusCode initDiamondAlgorithm() = 0;
-    virtual StatusCode finalizeDiamondAlgorithm(const bool do_MMDiamonds) = 0;
 
     static const InterfaceID& interfaceID() {
         static const InterfaceID IID_IMMTriggerTool("NSWL1::IMMTriggerTool", 1 ,0);
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMLoadVariables.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMLoadVariables.h
index af03f9340449..dfee188ab402 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMLoadVariables.h
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMLoadVariables.h
@@ -27,20 +27,21 @@ namespace MuonGM {
 
   public:
 
-    MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetectorManager* detManager, const MmIdHelper* idhelper, std::map<std::string,MMT_Parameters*> pars);
+    MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetectorManager* detManager, const MmIdHelper* idhelper);
 
     StatusCode getMMDigitsInfo(std::map<std::pair<int,unsigned int>,std::vector<digitWrapper> >& entries,
                          std::map<std::pair<int,unsigned int>,std::map<hitData_key,hitData_entry> >& Hits_Data_Set_Time,
-                         std::map<std::pair<int,unsigned int>,evInf_entry>& Event_Info);
+                         std::map<std::pair<int,unsigned int>,evInf_entry>& Event_Info,
+                         std::map<std::string,std::shared_ptr<MMT_Parameters> > &pars);
     //Import_Athena..._.m stuff
     double phi_shift(double athena_phi,const std::string& wedgeType, int stationPhi) const;
     int Get_VMM_chip(int strip) const;  //*** Not Finished... Rough
-    int strip_number(int station, int plane, int spos, const MMT_Parameters *par)const;
+    int strip_number(int station, int plane, int spos, std::shared_ptr<MMT_Parameters> par)const;
     int Get_Strip_ID(double X,double Y,int plane) const;
     bool Mimic_VMM_Chip_Deadtime(hitData_entry& candy);
-    void xxuv_to_uvxx(ROOT::Math::XYZVector& hit, int plane, const MMT_Parameters *par)const;
-    void hit_rot_stereo_fwd(ROOT::Math::XYZVector& hit, const MMT_Parameters *par)const;//x to v, u to x
-    void hit_rot_stereo_bck(ROOT::Math::XYZVector& hit, const MMT_Parameters *par)const;//x to u, v to x
+    void xxuv_to_uvxx(ROOT::Math::XYZVector& hit, int plane, std::shared_ptr<MMT_Parameters> par)const;
+    void hit_rot_stereo_fwd(ROOT::Math::XYZVector& hit, std::shared_ptr<MMT_Parameters> par)const;//x to v, u to x
+    void hit_rot_stereo_bck(ROOT::Math::XYZVector& hit, std::shared_ptr<MMT_Parameters> par)const;//x to u, v to x
 
     struct histogramVariables{
         std::vector<std::string> *m_NSWMM_dig_stationName;
@@ -143,9 +144,7 @@ namespace MuonGM {
     const MuonGM::MuonDetectorManager* m_detManager;        //!< MuonDetectorManager
     const MmIdHelper* m_MmIdHelper;        //!< MM offline Id helper
     StoreGateSvc* m_evtStore;
-    std::map<std::string, MMT_Parameters*> m_pars{};
     bool m_striphack{};
-    std::string getWedgeType(const MmDigitContainer *nsw_MmDigitContainer);
 
 
   };
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Diamond.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Diamond.h
index 2c7082833c7d..6fd2661f2524 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Diamond.h
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Diamond.h
@@ -40,9 +40,9 @@ struct diamond_t {
   unsigned int wedgeCounter;
   char sector;
   int phi;
-  std::vector<MMT_Road*> ev_roads;
+  std::vector<std::shared_ptr<MMT_Road> > ev_roads;
   std::vector<slope_t> slopes;
-  std::vector<MMT_Hit*> ev_hits;
+  std::vector<std::shared_ptr<MMT_Hit> > ev_hits;
 };
 
 class MMT_Diamond : public AthMessaging {
@@ -50,13 +50,13 @@ class MMT_Diamond : public AthMessaging {
     MMT_Diamond(const MuonGM::MuonDetectorManager* detManager);
 
     void clearEvent();
-    void createRoads_fillHits(const unsigned int iterator, std::vector<hitData_entry> &hitDatas, const MuonGM::MuonDetectorManager* detManager, MMT_Parameters *par, const int phi);
+    void createRoads_fillHits(const unsigned int iterator, std::vector<hitData_entry> &hitDatas, const MuonGM::MuonDetectorManager* detManager, std::shared_ptr<MMT_Parameters> par, const int phi);
     void findDiamonds(const unsigned int iterator, const double &sm_bc, const int &event);
     double phiShift(const int &n, const double &phi, const char &side);
     std::vector<diamond_t> getDiamondVector() const { return m_diamonds; }
     diamond_t getDiamond(const unsigned int iterator) const { return m_diamonds.at(iterator); }
     std::vector<double> getHitSlopes() const { return m_hitslopes; }
-    std::vector<MMT_Hit*> getHitVector(const unsigned int iterator) const { return m_diamonds.at(iterator).ev_hits; }
+    std::vector<std::shared_ptr<MMT_Hit> > getHitVector(const unsigned int iterator) const { return m_diamonds.at(iterator).ev_hits; }
     std::vector<slope_t> getSlopeVector(const unsigned int iterator) const { return m_diamonds.at(iterator).slopes; }
     unsigned int getDiamondSize() const { return m_diamonds.size(); }
     int getUVfactor() const { return m_uvfactor; }
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Finder.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Finder.h
index 764936c79341..738e10c1a5ac 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Finder.h
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Finder.h
@@ -12,13 +12,12 @@
 
 class MMT_Finder : public AthMessaging {
  public:
-  MMT_Finder(MMT_Parameters *par, int nUVRoads = 1);
-  ~MMT_Finder(){}
-  int Coincidence_Gate(const std::vector<bool>& plane_hits) const;
+  MMT_Finder(std::shared_ptr<MMT_Parameters> par, int nUVRoads = 1);
+  int Coincidence_Gate(const std::vector<bool>& plane_hits, std::shared_ptr<MMT_Parameters> par) const;
   void set_roads(int roads) { m_nRoads=roads; }
   int get_roads() const {return m_nRoads;}
-  void fillHitBuffer(std::map<std::pair<int,int>,finder_entry>& hitBuffer, const Hit& hit) const;
-  void checkBufferForHits(std::vector<bool>& plane_is_hit, std::vector<Hit>& track, int road, std::map<std::pair<int,int>,finder_entry> hitBuffer) const;
+  void fillHitBuffer(std::map<std::pair<int,int>,finder_entry>& hitBuffer, const Hit& hit, std::shared_ptr<MMT_Parameters> par) const;
+  void checkBufferForHits(std::vector<bool>& plane_is_hit, std::vector<Hit>& track, int road, std::map<std::pair<int,int>,finder_entry> hitBuffer, std::shared_ptr<MMT_Parameters> par) const;
 
  private:
   std::vector<int> q_planes(const std::string& type) const;
@@ -29,7 +28,6 @@ class MMT_Finder : public AthMessaging {
   double m_slope_max;
   std::vector<std::vector<double> > m_gateFlags;
   std::vector<std::vector<finder_entry> > m_finder;
-  MMT_Parameters* m_par;
 
   int m_nUVRoads;
 };
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Fitter.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Fitter.h
index 1ba687f7b3de..70bcaaa42930 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Fitter.h
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Fitter.h
@@ -12,50 +12,48 @@
 
 class MMT_Fitter : AthMessaging {
  public:
-  MMT_Fitter(MMT_Parameters *par, int nlg=256, double LG_min=0., double LG_max=0.5);
+  MMT_Fitter(int nlg=256, double LG_min=0., double LG_max=0.5);
   void Get_Fit(std::vector<Hit>& track, std::map<int,evFit_entry>& Event_Fit, std::map<hitData_key,hitData_entry>& Hits_Data_Set_Time);
-  evFit_entry fit_event(int event, std::vector<Hit>& track, std::vector<hitData_entry>& hitDatas, int& nfit, std::vector<std::pair<double,double> >&mxmy, double& mxl, double& mv, double& mu) const;
+  evFit_entry fit_event(int event, std::vector<Hit>& track, std::vector<hitData_entry>& hitDatas, int& nfit, std::vector<std::pair<double,double> >&mxmy, double& mxl, double& mv, double& mu, std::shared_ptr<MMT_Parameters> par) const;
   int get_last() const {return m_last;}
-  int SC_ROI_n_x() const {return m_par->n_x;}
-  int SC_ROI_n_y() const {return m_par->n_y;}
+  int SC_ROI_n_x(std::shared_ptr<MMT_Parameters> par) const {return par->n_x;}
+  int SC_ROI_n_y(std::shared_ptr<MMT_Parameters> par) const {return par->n_y;}
   int find_hitData(const std::vector<hitData_entry>& hitDatas, const hitData_key& key) const;
 
  protected:
   int m_last;
-  //some variables
-  MMT_Parameters *m_par;
 
   //functions translated
-  int Filter_UV(std::vector<Hit>& track) const;
-  double Get_Global_Slope(const std::vector<Hit>& track, const std::string& type) const;
-  double Get_Local_Slope(const std::vector<Hit>& Track,double theta=-999.,double phi=-999.) const;
-  ROI Get_ROI(double M_x,double M_u,double M_v,const std::vector<Hit>&track) const;
-  double phi_correct_factor(const std::vector<Hit>&track)const;
-  double Get_Delta_Theta(double M_local,double M_global) const;
-  double Get_Delta_Theta_division(double M_local,double M_global, double a=1.) const;
-  int Rough_ROI_temp(double theta, double phi) const;
+  int Filter_UV(std::vector<Hit>& track, std::shared_ptr<MMT_Parameters> par) const;
+  double Get_Global_Slope(const std::vector<Hit>& track, const std::string& type, std::shared_ptr<MMT_Parameters> par) const;
+  double Get_Local_Slope(const std::vector<Hit>& Track,double theta, double phi, std::shared_ptr<MMT_Parameters> par) const;
+  ROI Get_ROI(double M_x,double M_u,double M_v,const std::vector<Hit>&track, std::shared_ptr<MMT_Parameters> par) const;
+  double phi_correct_factor(const std::vector<Hit>&track, std::shared_ptr<MMT_Parameters> par)const;
+  double Get_Delta_Theta(double M_local,double M_global, std::shared_ptr<MMT_Parameters> par) const;
+  double Get_Delta_Theta_division(double M_local,double M_global, double a) const;
+  int Rough_ROI_temp(double theta, double phi, std::shared_ptr<MMT_Parameters> par) const;
 
   //sim hit code stuff
-  int track_to_index(const std::vector<Hit>&track)const;
+  int track_to_index(const std::vector<Hit>&track, std::shared_ptr<MMT_Parameters> par)const;
 
   //ideal local slope for debugging purposes
-  double ideal_local_slope(const std::vector<Hit>& Track)const;
-  double ideal_z(const Hit& hit)const;
-  double ideal_ak(const std::vector<Hit>& Track)const;
-  double ideal_zbar(const std::vector<Hit>& Track)const;
+  double ideal_local_slope(const std::vector<Hit>& Track, std::shared_ptr<MMT_Parameters> par)const;
+  double ideal_z(const Hit& hit, std::shared_ptr<MMT_Parameters> par)const;
+  double ideal_ak(const std::vector<Hit>& Track, std::shared_ptr<MMT_Parameters> par)const;
+  double ideal_zbar(const std::vector<Hit>& Track, std::shared_ptr<MMT_Parameters> par)const;
 
   //translated from Table_Generators.m
   double LG_lgr(int ilgr, double a, int number_LG_regions, double min, double max) const;
   double mult_factor_lgr(int ilgr, double a, int number_LG_regions, double min, double max) const;
-  double Slope_Components_ROI_val(int jy, int ix, int thetaphi) const;
-  double Slope_Components_ROI_theta(int jy, int ix) const;
-  double Slope_Components_ROI_phi(int jy, int ix) const;
-  double DT_Factors_val(int i, int j) const;
+  double Slope_Components_ROI_val(int jy, int ix, int thetaphi, std::shared_ptr<MMT_Parameters> par) const;
+  double Slope_Components_ROI_theta(int jy, int ix, std::shared_ptr<MMT_Parameters> par) const;
+  double Slope_Components_ROI_phi(int jy, int ixi, std::shared_ptr<MMT_Parameters> par) const;
+  double DT_Factors_val(int i, int j, std::shared_ptr<MMT_Parameters> par) const;
 
 
  private:
   //some functions
-  std::vector<Hit> q_hits(const std::string& type,const std::vector<Hit>& hits) const;
+  std::vector<Hit> q_hits(const std::string& type,const std::vector<Hit>& hits,std::shared_ptr<MMT_Parameters> par) const;
 
   //Fitter components
   int m_number_LG_regions,m_n_fit;
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Hit.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Hit.h
index 86e0057b8c0f..2dd9f06071a9 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Hit.h
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Hit.h
@@ -52,7 +52,7 @@ class MMT_Hit : public AthMessaging {
     void setYZSlope(double slope) { m_YZslope = slope; }
     void setY(double y) { m_Y = y; }
     void setZ(double z) { m_Z = z; }
-    void updateHitProperties(const MMT_Parameters *par);
+    void updateHitProperties(std::shared_ptr<MMT_Parameters> par);
     bool verifyHit();
 
   private:
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Road.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Road.h
index 635b9f778414..c6aa9ba1f5b9 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Road.h
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Road.h
@@ -42,7 +42,7 @@ class MMT_Road : public AthMessaging {
     MMT_Road(const char sector, const MuonGM::MuonDetectorManager* detManager, const micromegas_t mm, int xthr, int uvthr, int iroadx, int iroadu = -1, int iroadv = -1);
     ~MMT_Road();
 
-    void addHits(std::vector<MMT_Hit*> &hits);
+    void addHits(std::vector<std::shared_ptr<MMT_Hit> > &hits);
     double avgSofX();
     double avgSofUV(const int uv1, const int uv2);
     double avgZofUV(const int uv1, const int uv2);
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_struct.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_struct.h
index 8605a8d949f1..def43cbaac50 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_struct.h
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_struct.h
@@ -397,9 +397,9 @@ struct evAna_entry{
 };
 
 struct hitData_info{
-  hitData_info(int plane,int station_eta,int strip,MMT_Parameters *par,const ROOT::Math::XYZVector& tru,double tpos,double ppos);
+  hitData_info(int plane,int station_eta,int strip,std::shared_ptr<MMT_Parameters> par,const ROOT::Math::XYZVector& tru,double tpos,double ppos);
   hitData_info(int the_pl=0,double the_y=0,double the_z=-999);
-  double mis_dy(int pl,MMT_Parameters *m_par,double tpos,double ppos)const;
+  double mis_dy(int pl,std::shared_ptr<MMT_Parameters> par,double tpos,double ppos)const;
   std::string hdr()const;
   std::string str()const;
   void print()const;
@@ -430,9 +430,9 @@ struct hitData_entry{
 	     double fit_the=0, double fit_phi=0, double fit_dth=0, double tru_dth=0,// double tru_thl=0, double tru_thg=0,
 	     double mxg=0, double mug=0, double mvg=0, double mxl=0, double the_mx=0, double the_my=0, int the_roi=0);
 
-  Hit entry_hit(MMT_Parameters *m_par)const;
+  Hit entry_hit(std::shared_ptr<MMT_Parameters> par)const;
   hitData_key entry_key() const;
-  hitData_info entry_info(MMT_Parameters *m_par)const;
+  hitData_info entry_info(std::shared_ptr<MMT_Parameters> par)const;
   void fit_fill(double fthe,double fphi, double fdth, double mxg=0., double mug=0., double mvg=0., double mxl=0., double m_x=0., double m_y=0., int king=0);
   void print() const;
 
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMTriggerTool.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMTriggerTool.h
index 6a841f0fe9b4..39b5f13d46e9 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMTriggerTool.h
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMTriggerTool.h
@@ -40,11 +40,8 @@ namespace NSWL1 {
     //load event stuff
     std::vector<hitData_entry> event_hitDatas(int find_event, std::map<hitData_key,hitData_entry>& Hits_Data_Set_Time) const;
     std::vector<hitData_key> event_hitData_keys(int find_event, std::map<hitData_key,hitData_entry>& Hits_Data_Set_Time) const;
-    MMT_Parameters *m_par;
-    MMT_Parameters *m_par_large;
-    MMT_Parameters *m_par_small;
-
-    MMT_Diamond *diamond;
+    std::shared_ptr<MMT_Parameters> m_par_large;
+    std::shared_ptr<MMT_Parameters> m_par_small;
 
     //MMT_Loader stuff end
 
@@ -58,13 +55,10 @@ namespace NSWL1 {
 
     virtual void handle (const Incident& inc);
 
-    StatusCode initDiamondAlgorithm();
     StatusCode runTrigger(const bool do_MMDiamonds);
-    StatusCode finalizeDiamondAlgorithm(const bool do_MMDiamonds);
 
   private:
 
-    std::string getWedgeType(const MmDigitContainer *nsw_MmDigitContainer);
     // needed Servives, Tools and Helpers
     ServiceHandle< IIncidentSvc >      m_incidentSvc;       //!< Athena/Gaudi incident Service
     const MuonGM::MuonDetectorManager* m_detManager;        //!< MuonDetectorManager
@@ -75,8 +69,6 @@ namespace NSWL1 {
     void clear_ntuple_variables();                          //!< clear the variables used in the analysis ntuple
     void fillNtuple(const MMLoadVariables& loadedVariables);
 
-    void storeEventProperties(const unsigned int iterator); //!< Store event variable for Diamond Road algorithm
-
     // properties: container and service names
     StringProperty   m_MmDigitContainer;                    //!< property, see @link MMStripTdsOfflineTool::MMStripTdsOfflineTool @endlink
 
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMLoadVariables.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMLoadVariables.cxx
index 87569d3664fa..ccc7ace4843f 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMLoadVariables.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMLoadVariables.cxx
@@ -30,17 +30,17 @@ using std::map;
 using std::vector;
 using std::string;
 
-MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetectorManager* detManager, const MmIdHelper* idhelper, std::map<std::string,MMT_Parameters*> pars):
+MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetectorManager* detManager, const MmIdHelper* idhelper):
    AthMessaging(Athena::getMessageSvc(), "MMLoadVariables") {
-      m_pars = pars;
       m_evtStore = evtStore;
       m_detManager = detManager;
       m_MmIdHelper = idhelper;
 }
 
-  StatusCode MMLoadVariables::getMMDigitsInfo(map<std::pair<int,unsigned int>,std::vector<digitWrapper> >& entries,
-                                        map<std::pair<int,unsigned int>,map<hitData_key,hitData_entry> >& Hits_Data_Set_Time,
-                                        map<std::pair<int,unsigned int>,evInf_entry>& Event_Info) {
+  StatusCode MMLoadVariables::getMMDigitsInfo(std::map<std::pair<int,unsigned int>,std::vector<digitWrapper> >& entries,
+                                        std::map<std::pair<int,unsigned int>,map<hitData_key,hitData_entry> >& Hits_Data_Set_Time,
+                                        std::map<std::pair<int,unsigned int>,evInf_entry>& Event_Info,
+                                        std::map<std::string, std::shared_ptr<MMT_Parameters> > &pars) {
       //*******Following MuonPRD code to access all the variables**********
 
       histogramVariables fillVars;
@@ -60,6 +60,7 @@ MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetec
       // get digit container (a container corresponds to a multilayer of a module)
       const MmDigitContainer *nsw_MmDigitContainer = nullptr;
       ATH_CHECK( m_evtStore->retrieve(nsw_MmDigitContainer,"MM_DIGITS") );
+      if (nsw_MmDigitContainer->digit_size() == 0) return StatusCode::SUCCESS;
 
       std::vector<ROOT::Math::PtEtaPhiEVector> truthParticles, truthParticles_ent, truthParticles_pos;
       std::vector<int> pdg;
@@ -351,7 +352,7 @@ MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetec
         }
 
         std::string station = it->second[0].stName;
-        m_uvxxmod=(m_pars[station]->setup.compare("xxuvuvxx")==0);
+        m_uvxxmod=(pars[station]->setup.compare("xxuvuvxx")==0);
 
         map<hitData_key,hitData_entry> hit_info;
         vector<hitData_key> keys;
@@ -381,7 +382,7 @@ MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetec
           ROOT::Math::XYZVector recon(athena_rec.Y(),-athena_rec.X(),athena_rec.Z());
 
           if(m_uvxxmod){
-            xxuv_to_uvxx(recon,thisPlane,m_pars[station]);
+            xxuv_to_uvxx(recon,thisPlane,pars[station]);
           }
 
           //We're doing everything by the variable known as "athena_event" to reflect C++ vs MATLAB indexing
@@ -428,7 +429,7 @@ MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetec
         m_VMM_ChipLastHitTime=vector<vector<int> >(m_numVMM_PerPlane,vector<int>(8,0));
 
         int xhit=0,uvhit=0;
-        vector<bool>plane_hit(m_pars[station]->setup.size(),false);
+        vector<bool>plane_hit(pars[station]->setup.size(),false);
 
         for(map<hitData_key,hitData_entry>::iterator it=hit_info.begin(); it!=hit_info.end(); ++it){
           int plane=it->second.plane;
@@ -439,8 +440,8 @@ MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetec
 
         for(unsigned int ipl=0;ipl<plane_hit.size();ipl++){
           if(plane_hit[ipl]){
-            if(m_pars[station]->setup.substr(ipl,1)=="x") xhit++;
-            else if(m_pars[station]->setup.substr(ipl,1)=="u" || m_pars[station]->setup.substr(ipl,1)=="v") uvhit++;
+            if(pars[station]->setup.substr(ipl,1)=="x") xhit++;
+            else if(pars[station]->setup.substr(ipl,1)=="u" || pars[station]->setup.substr(ipl,1)=="v") uvhit++;
           }
         }
 
@@ -462,7 +463,7 @@ MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetec
     else return athena_phi;
 
   }
-  void MMLoadVariables::xxuv_to_uvxx(ROOT::Math::XYZVector& hit,const int plane, const MMT_Parameters *par) const{
+  void MMLoadVariables::xxuv_to_uvxx(ROOT::Math::XYZVector& hit,const int plane, std::shared_ptr<MMT_Parameters> par) const{
     if(plane<4)return;
     else if(plane==4)hit_rot_stereo_bck(hit, par);//x to u
     else if(plane==5)hit_rot_stereo_fwd(hit, par);//x to v
@@ -470,7 +471,7 @@ MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetec
     else if(plane==7)hit_rot_stereo_bck(hit, par);//v to x
   }
 
-  void MMLoadVariables::hit_rot_stereo_fwd(ROOT::Math::XYZVector& hit, const MMT_Parameters *par)const{
+  void MMLoadVariables::hit_rot_stereo_fwd(ROOT::Math::XYZVector& hit, std::shared_ptr<MMT_Parameters> par)const{
     double degree=TMath::DegToRad()*(par->stereo_degree);
     if(m_striphack) hit.SetY(hit.Y()*cos(degree));
     else{
@@ -479,7 +480,7 @@ MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetec
     }
   }
 
-  void MMLoadVariables::hit_rot_stereo_bck(ROOT::Math::XYZVector& hit, const MMT_Parameters *par)const{
+  void MMLoadVariables::hit_rot_stereo_bck(ROOT::Math::XYZVector& hit, std::shared_ptr<MMT_Parameters> par)const{
     double degree=-TMath::DegToRad()*(par->stereo_degree);
     if(m_striphack) hit.SetY(hit.Y()*std::cos(degree));
     else{
@@ -495,7 +496,7 @@ MMLoadVariables::MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetec
   }
 
   int 
-  MMLoadVariables::strip_number(int station, int plane, int spos, const MMT_Parameters *par)const{
+  MMLoadVariables::strip_number(int station, int plane, int spos, std::shared_ptr<MMT_Parameters> par)const{
     if (station<=0||station>par->n_stations_eta) {
       int base_strip = 0;
       return base_strip;
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Diamond.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Diamond.cxx
index c3ba01156d0b..e0bf038f3187 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Diamond.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Diamond.cxx
@@ -10,21 +10,15 @@ MMT_Diamond::MMT_Diamond(const MuonGM::MuonDetectorManager* detManager): AthMess
 void MMT_Diamond::clearEvent() {
   if (!m_diamonds.empty()) {
     for (auto &diam : m_diamonds) {
-      if (!diam.ev_roads.empty()) {
-        for (auto &road : diam.ev_roads) delete road;
-        diam.ev_roads.clear();
-      }
-      if (!diam.ev_hits.empty()) {
-        for (auto &hit : diam.ev_hits) delete hit;
-        diam.ev_hits.clear();
-      }
+      if (!diam.ev_roads.empty()) diam.ev_roads.clear();
+      if (!diam.ev_hits.empty()) diam.ev_hits.clear();
       diam.slopes.clear();
     }
     m_diamonds.clear();
   }
 }
 
-void MMT_Diamond::createRoads_fillHits(const unsigned int iterator, std::vector<hitData_entry> &hitDatas, const MuonGM::MuonDetectorManager* detManager, MMT_Parameters *par, const int phi) {
+void MMT_Diamond::createRoads_fillHits(const unsigned int iterator, std::vector<hitData_entry> &hitDatas, const MuonGM::MuonDetectorManager* detManager, std::shared_ptr<MMT_Parameters> par, const int phi) {
   ATH_MSG_DEBUG("createRoads_fillHits: Feeding hitDatas Start");
 
   diamond_t entry;
@@ -93,40 +87,40 @@ void MMT_Diamond::createRoads_fillHits(const unsigned int iterator, std::vector<
   this->setUVfactor(uvfactor);
 
   for (int ihds = 0; ihds < (int)hitDatas.size(); ihds++) {
-    MMT_Hit *myhit = new MMT_Hit(par->getSector(), hitDatas[ihds], detManager);
+    auto myhit = std::make_shared<MMT_Hit>(par->getSector(), hitDatas[ihds], detManager);
     myhit->updateHitProperties(par);
     if (myhit->verifyHit()) {
       m_hitslopes.push_back(myhit->getRZSlope());
       entry.ev_hits.push_back(myhit);
-    } else delete myhit;
+    }
   }
 
-  std::vector<MMT_Road*> temp_roads;
+  std::vector<std::shared_ptr<MMT_Road> > temp_roads;
   for (int i = 0; i < nroad; i++) {
 
-    MMT_Road* myroad = new MMT_Road(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i);
+    auto myroad = std::make_shared<MMT_Road>(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i);
     temp_roads.push_back(myroad);
 
     int nuv = (this->getUV()) ? this->getUVfactor() : 0;
     for (int uv = 1; uv <= nuv; uv++) {
       if (i-uv < 0) continue;
 
-      MMT_Road* myroad_0 = new MMT_Road(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i+uv, i-uv);
+      auto myroad_0 = std::make_shared<MMT_Road>(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i+uv, i-uv);
       temp_roads.push_back(myroad_0);
 
-      MMT_Road* myroad_1 = new MMT_Road(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i-uv, i+uv);
+      auto myroad_1 = std::make_shared<MMT_Road>(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i-uv, i+uv);
       temp_roads.push_back(myroad_1);
 
-      MMT_Road* myroad_2 = new MMT_Road(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i+uv-1, i-uv);
+      auto myroad_2 = std::make_shared<MMT_Road>(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i+uv-1, i-uv);
       temp_roads.push_back(myroad_2);
 
-      MMT_Road* myroad_3 = new MMT_Road(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i-uv, i+uv-1);
+      auto myroad_3 = std::make_shared<MMT_Road>(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i-uv, i+uv-1);
       temp_roads.push_back(myroad_3);
 
-      MMT_Road* myroad_4 = new MMT_Road(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i-uv+1, i+uv);
+      auto myroad_4 = std::make_shared<MMT_Road>(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i-uv+1, i+uv);
       temp_roads.push_back(myroad_4);
 
-      MMT_Road* myroad_5 = new MMT_Road(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i+uv, i-uv+1);
+      auto myroad_5 = std::make_shared<MMT_Road>(par->getSector(), detManager, micromegas, this->getXthreshold(), this->getUVthreshold(), i, i+uv, i-uv+1);
       temp_roads.push_back(myroad_5);
     }
   }
@@ -166,14 +160,14 @@ void MMT_Diamond::findDiamonds(const unsigned int iterator, const double &sm_bc,
   m_diamonds[iterator].slopes.clear();
 
   // Comparison with lambda function (easier to implement)
-  std::sort(m_diamonds[iterator].ev_hits.begin(), m_diamonds[iterator].ev_hits.end(), [](MMT_Hit *h1, MMT_Hit *h2){ return h1->getAge() < h2->getAge(); });
+  std::sort(m_diamonds[iterator].ev_hits.begin(), m_diamonds[iterator].ev_hits.end(), [](auto h1, auto h2){ return h1->getAge() < h2->getAge(); });
   bc_start = m_diamonds[iterator].ev_hits.front()->getAge() - bc_wind*2;
   bc_end = m_diamonds[iterator].ev_hits.back()->getAge() + bc_wind*2;
   ATH_MSG_DEBUG("Window Start: " << bc_start << " - Window End: " << bc_end);
 
   for (const auto &road : m_diamonds[iterator].ev_roads) road->reset();
 
-  std::vector<MMT_Hit*> hits_now = {};
+  std::vector<std::shared_ptr<MMT_Hit> > hits_now = {};
   std::vector<int> vmm_same  = {};
   std::vector< std::pair<int, int> > addc_same = {};
   std::vector<int> to_erase = {};
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Finder.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Finder.cxx
index e91416e5237b..04dab1021a54 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Finder.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Finder.cxx
@@ -10,40 +10,39 @@ using std::map;
 using std::pair;
 using std::string;
 
-MMT_Finder::MMT_Finder(MMT_Parameters *par, int nUVRoads) :
+MMT_Finder::MMT_Finder(std::shared_ptr<MMT_Parameters> par, int nUVRoads) :
   AthMessaging(Athena::getMessageSvc(), "MMT_Finder") {
 
   ATH_MSG_DEBUG("MMT_Finder::building finder");
 
-  m_par = par;
   m_nUVRoads = nUVRoads;
 
-  m_nRoads = ceil(  ( ( m_par->slope_max - m_par->slope_min ) / m_par->h  )  ); //initialization, can use floats
+  m_nRoads = std::ceil(  ( ( par->slope_max - par->slope_min ) / par->h  )  ); //initialization, can use floats
 
   if(m_nUVRoads>1){
     m_nRoads *= m_nUVRoads; // This should probably be configurable and dynamic based on the geometry of the chamber
   }
 
-  int nplanes=m_par->setup.size();
+  int nplanes=par->setup.size();
 
-  ATH_MSG_DEBUG( "MMT_Find::finder entries " << m_nRoads << " " << m_par->slope_max << " " << m_par->slope_min << " " << m_par->h << " " << nplanes );
+  ATH_MSG_DEBUG( "MMT_Finder entries " << m_nRoads << " " << par->slope_max << " " << par->slope_min << " " << par->h << " " << nplanes );
 
   m_gateFlags = vector<vector<double> >(m_nRoads,(vector<double>(2,0)));// sloperoad,
   m_finder    = vector<vector<finder_entry> >(m_nRoads,(vector<finder_entry>(nplanes,finder_entry())));  //[strip,slope,hit_index];
 
-  ATH_MSG_DEBUG("MMT_Find::built finder");
+  ATH_MSG_DEBUG("MMT_Finder built");
 
   return;
 
 }
 
 void MMT_Finder::fillHitBuffer( map< pair<int,int> , finder_entry > & hitBuffer, // Map (road,plane) -> Finder entry
-                                const Hit& hit) const {
+                                const Hit& hit, std::shared_ptr<MMT_Parameters> par) const {
   // This function takes in the Hit object and places it into the hit buffer hitBuffer, putting it in any relevant (road,plane)
 
   //Get initial parameters: tolerance, step size (h), slope of hit
   double tol;
-  double h=m_par->h;
+  double h=par->h;
 
   //Conver hit to slope here
   double slope=hit.info.slope;
@@ -52,10 +51,10 @@ void MMT_Finder::fillHitBuffer( map< pair<int,int> , finder_entry > & hitBuffer,
   //Plane and key info of the hit
   int plane=hit.info.plane;
 
-  string plane_type=m_par->setup.substr(plane,1);
+  string plane_type=par->setup.substr(plane,1);
 
-  if(plane_type=="x") tol=m_par->x_error;
-  else if(plane_type=="u"||plane_type=="v") tol=m_par->uv_error;
+  if(plane_type=="x") tol=par->x_error;
+  else if(plane_type=="u"||plane_type=="v") tol=par->uv_error;
   else {
     ATH_MSG_WARNING("WARNING: unsupported plane option!");
     return;
@@ -65,8 +64,8 @@ void MMT_Finder::fillHitBuffer( map< pair<int,int> , finder_entry > & hitBuffer,
   //---slope road boundaries based on hit_slope +/- tolerance---; if min or max is out of bounds, put it at the limit
   double s_min = slope - tol, s_max = slope + tol;
 
-  int road_min = round( (  (s_min - m_par->slope_min)/h  ) );
-  int road_max = round( (  (s_max - m_par->slope_min)/h  ) );
+  int road_min = std::round( (  (s_min - par->slope_min)/h  ) );
+  int road_max = std::round( (  (s_max - par->slope_min)/h  ) );
 
   if( road_min < 0 ) road_min = 0 ;
   if( road_max >= (m_nRoads/m_nUVRoads) ){ road_max = (m_nRoads/m_nUVRoads) - 1 ; }
@@ -145,11 +144,12 @@ void MMT_Finder::fillHitBuffer( map< pair<int,int> , finder_entry > & hitBuffer,
 void MMT_Finder::checkBufferForHits(vector<bool>& plane_is_hit,
                                     vector<Hit>& track,
                                     int road,
-                                    map<pair<int,int>,finder_entry> hitBuffer
+                                    map<pair<int,int>,finder_entry> hitBuffer,
+                                    std::shared_ptr<MMT_Parameters> par
                                     ) const{
   //Loops through the buffer which should have entries = nplanes
   //Takes the hit and bool for each plane (if it exists)
-  int nplanes=m_par->setup.size();
+  int nplanes=par->setup.size();
 
   pair<int,int> key (road,0);
 
@@ -165,7 +165,7 @@ void MMT_Finder::checkBufferForHits(vector<bool>& plane_is_hit,
   }
 }
 
-int MMT_Finder::Coincidence_Gate(const vector<bool>& plane_hits) const{
+int MMT_Finder::Coincidence_Gate(const vector<bool>& plane_hits, std::shared_ptr<MMT_Parameters> par) const{
 
   // This function should be updated to include the clock and age of the hits...
 
@@ -177,7 +177,7 @@ int MMT_Finder::Coincidence_Gate(const vector<bool>& plane_hits) const{
   //Eg, 4X+4UV > 3+3.   Also,
   int X_count=0,U_count=0,V_count=0,value=0;bool front=false,back=false;
   //search the string
-  vector<int> u_planes=m_par->q_planes("u"), x_planes=m_par->q_planes("x"), v_planes=m_par->q_planes("v");
+  vector<int> u_planes=par->q_planes("u"), x_planes=par->q_planes("x"), v_planes=par->q_planes("v");
   for(unsigned int ip=0;ip<x_planes.size();ip++){
     if(plane_hits[x_planes[ip]]){
       X_count++;
@@ -188,7 +188,7 @@ int MMT_Finder::Coincidence_Gate(const vector<bool>& plane_hits) const{
   for(unsigned int ip=0;ip<u_planes.size();ip++) U_count+=plane_hits[u_planes[ip]];
   for(unsigned int ip=0;ip<v_planes.size();ip++) V_count+=plane_hits[v_planes[ip]];
   int UV_count = U_count + V_count;
-  bool xpass=X_count>=m_par->CT_x,uvpass=UV_count>=m_par->CT_uv,fbpass=front&&back;
+  bool xpass=X_count>=par->CT_x,uvpass=UV_count>=par->CT_uv,fbpass=front&&back;
   value = 10*X_count+UV_count;
   if(!xpass||!uvpass){
     value*=-1;
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Fitter.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Fitter.cxx
index d2dd972d7a46..6c7ca95b5e73 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Fitter.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Fitter.cxx
@@ -14,32 +14,31 @@ using std::pair;
 using std::string;
 
 
-MMT_Fitter::MMT_Fitter(MMT_Parameters *par, int nlg, double lgmin, double lgmax):
+MMT_Fitter::MMT_Fitter(int nlg, double lgmin, double lgmax):
   AthMessaging(Athena::getMessageSvc(), "MMT_Fitter"),
   m_number_LG_regions(nlg), m_LG_min(lgmin), m_LG_max(lgmax)
 {
-  ATH_MSG_DEBUG("MMT_F::building fitter");
-  m_par=par;
+  ATH_MSG_DEBUG("MMT_Fitter start building");
   m_last=0;
   m_n_fit=0;
-  ATH_MSG_DEBUG("MMT_F::built fitter");
+  ATH_MSG_DEBUG("MMT_Fitter built");
 }
 
 
-evFit_entry MMT_Fitter::fit_event(int event, vector<Hit>& track, vector<hitData_entry>& hitDatas, int& nfit,vector<pair<double,double> >&mxmy, double& mxl, double& mv, double& mu) const{
+evFit_entry MMT_Fitter::fit_event(int event, vector<Hit>& track, vector<hitData_entry>& hitDatas, int& nfit,vector<pair<double,double> >&mxmy, double& mxl, double& mv, double& mu, std::shared_ptr<MMT_Parameters> par) const{
   ATH_MSG_DEBUG("Begin fit event!");
   bool did_fit=false;
-  int check=Filter_UV(track);
-  vector<int> xpl=m_par->q_planes("x");
-  vector<int> upl=m_par->q_planes("u");
-  vector<int> vpl=m_par->q_planes("v");
+  int check=Filter_UV(track,par);
+  vector<int> xpl=par->q_planes("x");
+  vector<int> upl=par->q_planes("u");
+  vector<int> vpl=par->q_planes("v");
   //---- Calc global slopes and local X slope -----
-  double M_x_global = Get_Global_Slope(track,"x");
-  double M_u_global = (check>=10?(-999.):Get_Global_Slope(track,"u"));
-  double M_v_global = (check%10==1?(-999.):Get_Global_Slope(track,"v"));
+  double M_x_global = Get_Global_Slope(track,"x",par);
+  double M_u_global = (check>=10?(-999.):Get_Global_Slope(track,"u",par));
+  double M_v_global = (check%10==1?(-999.):Get_Global_Slope(track,"v",par));
   //----  Calc delta theta ----------
   //----- Calc ROI ----------
-  ROI ROI = Get_ROI(M_x_global,M_u_global,M_v_global,track);
+  ROI ROI = Get_ROI(M_x_global,M_u_global,M_v_global,track,par);
   mxmy.push_back(pair<double,double>(ROI.m_x,ROI.m_y));
   mu  = M_u_global;
   mv  = M_v_global;
@@ -47,20 +46,20 @@ evFit_entry MMT_Fitter::fit_event(int event, vector<Hit>& track, vector<hitData_
   if(ROI.theta==-999){
     for(unsigned int i=0;i<track.size();i++)  track[i].print();
     ATH_MSG_WARNING("SOMETHING IS OFF!  fit_event, ROI has theta=-999 (bad reconstruction) \n");
-    evFit_entry empty(event,-999,-999,-999,ROI.roi,-999,-999,-999,-999,-999,track_to_index(track));
+    evFit_entry empty(event,-999,-999,-999,ROI.roi,-999,-999,-999,-999,-999,track_to_index(track, par));
     return empty;
     //throw std::runtime_error("MMT_Fitter::fit_event: invalid ROI.theta");
   }
   static_assert(std::is_trivially_copyable<double>::value);
   static_assert(std::is_trivially_destructible<double>::value);
-  double M_x_local   = Get_Local_Slope(track, ROI.theta, ROI.phi);
+  double M_x_local   = Get_Local_Slope(track, ROI.theta, ROI.phi, par);
   double Delta_Theta_division = Get_Delta_Theta_division(M_x_local, M_x_global, 1.);
-  double Delta_Theta = Get_Delta_Theta(M_x_local, M_x_global);
-  double dtheta_idl  = Get_Delta_Theta_division(ideal_local_slope(track), M_x_global);
+  double Delta_Theta = Get_Delta_Theta(M_x_local, M_x_global, par);
+  double dtheta_idl  = Get_Delta_Theta_division(ideal_local_slope(track,par), M_x_global, 1.);
 
   mxl = M_x_local;
 
-  if(dtheta_idl-std::abs(Delta_Theta_division) > 2.e-3) m_par->fill0 = true;
+  if(dtheta_idl-std::abs(Delta_Theta_division) > 2.e-3) par->fill0 = true;
   ATH_MSG_DEBUG("Mxg=" << M_x_global << ", Mug=" << M_u_global << ", Mvg=" << M_v_global << ", Mxl=" << M_x_local << ", dth=" <<Delta_Theta);
   //@@@@@@@@ Begin Info Storage for Later Analysis @@@@@@@@@@@@@@@@@@@@@@@
   vector<bool> planes_hit_tr(8,false), planes_hit_bg(8,false);
@@ -94,17 +93,17 @@ evFit_entry MMT_Fitter::fit_event(int event, vector<Hit>& track, vector<hitData_
   //FINISH ME!!!!!!!
   double candtheta=ROI.theta,candphi=ROI.phi;
   /* I think this bit appears redundant but could end up being stupid; the fitter shouldn't care about CT stuff (beyond having min num hits to do fit, which the -999 or w/e is responsible for taking care of)
-  bool xfail=(n_xpl_tr+n_xpl_bg<m_par->CT_x),uvfail= (n_uvpl_tr+n_uvpl_bg<m_par->CT_uv);
+  bool xfail=(n_xpl_tr+n_xpl_bg<par->CT_x),uvfail= (n_uvpl_tr+n_uvpl_bg<par->CT_uv);
   msg(MSG::DEBUG) << n_xpl_tr+n_xpl_bg<<" x hits");
   if(xfail)candtheta=-999.;
   if(uvfail)candphi=-999.;
   */
   bool fitkill = (ROI.theta==-999 || Delta_Theta==-999||Delta_Theta==-4);// ||xfail||uvfail);
-  ATH_MSG_DEBUG("HIT CODE: " << track_to_index(track));
-  evFit_entry aemon(event,candtheta,candphi,Delta_Theta_division,ROI.roi,n_xpl_tr,n_uvpl_tr,n_xpl_bg,n_uvpl_bg,Delta_Theta,track_to_index(track));
+  ATH_MSG_DEBUG("HIT CODE: " << track_to_index(track, par));
+  evFit_entry aemon(event,candtheta,candphi,Delta_Theta_division,ROI.roi,n_xpl_tr,n_uvpl_tr,n_xpl_bg,n_uvpl_bg,Delta_Theta,track_to_index(track, par));
   if(fitkill) return aemon;
 
-  int nplanes = m_par->setup.size();
+  int nplanes = par->setup.size();
   for(int plane=0; plane<nplanes; plane++){
     if(track[plane].info.slope == -999) continue; //&& Delta_Theta_division~=-999
     int hitData_pos = find_hitData(hitDatas, track[plane].key);
@@ -127,11 +126,11 @@ int MMT_Fitter::find_hitData(const vector<hitData_entry>& hitDatas, const hitDat
 }
 
 
-int MMT_Fitter::Filter_UV(vector<Hit>& track) const{
+int MMT_Fitter::Filter_UV(vector<Hit>& track, std::shared_ptr<MMT_Parameters> par) const{
   return 0;
-  double h=m_par->h, tolerance = h;//*2;  //Can be optimized...
-  vector<int> u_planes = m_par->q_planes("u"), v_planes = m_par->q_planes("v");
-  vector<Hit> u_hits = q_hits("u",track), v_hits = q_hits("v",track);
+  double h=par->h, tolerance = h;//*2;  //Can be optimized...
+  vector<int> u_planes = par->q_planes("u"), v_planes = par->q_planes("v");
+  vector<Hit> u_hits = q_hits("u",track,par), v_hits = q_hits("v",track,par);
   bool pass_u =! u_hits.empty(), pass_v =! v_hits.empty();
 
   //if the difference in slope between the first and last u/v planes is too great don't pass, set track hits to zero
@@ -153,9 +152,9 @@ int MMT_Fitter::Filter_UV(vector<Hit>& track) const{
   return return_val;
 }
 
-double MMT_Fitter::Get_Global_Slope (const vector<Hit>& track, const string& type) const
+double MMT_Fitter::Get_Global_Slope (const vector<Hit>& track, const string& type, std::shared_ptr<MMT_Parameters> par) const
 {
-  vector<Hit> qhits = q_hits(type,track);
+  vector<Hit> qhits = q_hits(type,track,par);
   double sum = 0.;
   if(qhits.size()==0) return -999;
   double nhitdiv= 1./qhits.size();
@@ -166,12 +165,12 @@ double MMT_Fitter::Get_Global_Slope (const vector<Hit>& track, const string& typ
 }
 
 //CHANGE!
-double MMT_Fitter::Get_Local_Slope (const vector<Hit>& Track,double theta,double phi) const
+double MMT_Fitter::Get_Local_Slope (const vector<Hit>& Track,double theta,double phi,std::shared_ptr<MMT_Parameters> par) const
 {
-  vector<int> x_planes = m_par->q_planes("x"), ybin_hits(x_planes.size(),-1);
+  vector<int> x_planes = par->q_planes("x"), ybin_hits(x_planes.size(),-1);
   int nxp=x_planes.size();
   for(int ipl=0; ipl<nxp; ipl++){
-    ybin_hits[ipl]=(((Track[x_planes[ipl]].info.slope==-999) || (Track[x_planes[ipl]].info.slope==-4)) ? -1 : m_par->ybin(Track[x_planes[ipl]].info.y,x_planes[ipl]));
+    ybin_hits[ipl]=(((Track[x_planes[ipl]].info.slope==-999) || (Track[x_planes[ipl]].info.slope==-4)) ? -1 : par->ybin(Track[x_planes[ipl]].info.y,x_planes[ipl]));
   }
   bool hit=false;
   double yzsum=0;
@@ -181,22 +180,22 @@ double MMT_Fitter::Get_Local_Slope (const vector<Hit>& Track,double theta,double
   int xdex=-1;
   int ybin=-1;
   int which=-1;
-  m_par->key_to_indices(ybin_hits, xdex, ybin, which);
+  par->key_to_indices(ybin_hits, xdex, ybin, which);
   if(xdex<0 || ybin<0 || which<0) return -999;
 
-  double zbar=m_par->Ak_local_slim[xdex][ybin][which];
-  double bk=m_par->Bk_local_slim[xdex][ybin][which];
+  double zbar=par->Ak_local_slim[xdex][ybin][which];
+  double bk=par->Bk_local_slim[xdex][ybin][which];
   ATH_MSG_DEBUG("zbar is " << zbar << ", and bk is " << bk);
-  int ebin = m_par->eta_bin(theta);
-  int pbin = m_par->phi_bin(phi);
+  int ebin = par->eta_bin(theta);
+  int pbin = par->phi_bin(phi);
   for(int ipl=0; ipl<nxp; ipl++){
     double z = Track[x_planes[ipl]].info.z;
     double y = Track[x_planes[ipl]].info.y;
     double zfirst = Track[x_planes[0]].info.z;
     double yfirst = Track[x_planes[0]].info.y;
     if(ebin != -1){
-      z = z+m_par->zmod[ebin][pbin][ipl];
-      y = y+m_par->ymod[ebin][pbin][ipl];
+      z = z+par->zmod[ebin][pbin][ipl];
+      y = y+par->ymod[ebin][pbin][ipl];
     }
     if(Track[x_planes[ipl]].info.slope == -999 || Track[x_planes[ipl]].info.slope == -4) continue;
     hit=true;
@@ -212,25 +211,25 @@ double MMT_Fitter::Get_Local_Slope (const vector<Hit>& Track,double theta,double
   return mxl;
 }
 
-int MMT_Fitter::track_to_index(const vector<Hit>&track)const{
-  vector<bool>hits(m_par->setup.size(),false);
+int MMT_Fitter::track_to_index(const vector<Hit>&track, std::shared_ptr<MMT_Parameters> par)const{
+  vector<bool>hits(par->setup.size(),false);
   for(int ihit=0; ihit<(int)track.size(); ihit++) hits[track[ihit].info.plane] = (hits[track[ihit].info.plane] ? true : track[ihit].info.slope>-2.);
-  return m_par->bool_to_index(hits);
+  return par->bool_to_index(hits);
 }
 
-double MMT_Fitter::ideal_local_slope(const vector<Hit>& Track)const{
+double MMT_Fitter::ideal_local_slope(const vector<Hit>& Track, std::shared_ptr<MMT_Parameters> par)const{
   vector<vector<double> > z_hit;
-  for(unsigned int i = 0; i<m_par->z_large.size(); i++){
+  for(unsigned int i = 0; i<par->z_large.size(); i++){
     vector<double> temp;
-    for(unsigned int j = 0; j<m_par->z_large[i].size(); j++) temp.push_back(m_par->z_large[i][j]);
+    for(unsigned int j = 0; j<par->z_large[i].size(); j++) temp.push_back(par->z_large[i][j]);
     z_hit.push_back(temp);
   }
-  vector<int> x_planes=m_par->q_planes("x");
+  vector<int> x_planes=par->q_planes("x");
   int nxp=x_planes.size();
   bool hit=false;
   double sum_xy=0, sum_y=0;
-  double ak_idl = ideal_ak(Track);
-  double bk_idl = ak_idl*ideal_zbar(Track);
+  double ak_idl = ideal_ak(Track, par);
+  double bk_idl = ak_idl*ideal_zbar(Track,par);
   for(int ipl=0; ipl<nxp; ipl++){
     double y = Track[x_planes[ipl]].info.y;
     double z = Track[x_planes[ipl]].info.z;
@@ -244,23 +243,23 @@ double MMT_Fitter::ideal_local_slope(const vector<Hit>& Track)const{
   return ls_idl;
 }
 
-double MMT_Fitter::ideal_z(const Hit& hit)const{
+double MMT_Fitter::ideal_z(const Hit& hit, std::shared_ptr<MMT_Parameters> par)const{
   int plane=hit.info.plane;
-  double tilt = (plane<4 ? m_par->correct.rotate.X() : 0);
-  double dz   = (plane<4 ? m_par->correct.translate.Z() : 0);
-  double nominal = m_par->z_nominal[plane];
-  double y = hit.info.y - m_par->ybases[plane].front();
+  double tilt = (plane<4 ? par->correct.rotate.X() : 0);
+  double dz   = (plane<4 ? par->correct.translate.Z() : 0);
+  double nominal = par->z_nominal[plane];
+  double y = hit.info.y - par->ybases[plane].front();
   double z = nominal+dz+y*std::tan(tilt);
   return z;
 }
 
-double MMT_Fitter::ideal_ak(const vector<Hit>& Track)const{
-  vector<int> x_planes=m_par->q_planes("x");//this tells us which planes are x planes
+double MMT_Fitter::ideal_ak(const vector<Hit>& Track, std::shared_ptr<MMT_Parameters> par)const{
+  vector<int> x_planes=par->q_planes("x");//this tells us which planes are x planes
   int n_xplanes=x_planes.size(),hits=0;
   double sum_x=0,sum_xx=0;
   for(int ip=0; ip<n_xplanes; ip++){
     if(Track[x_planes[ip]].info.slope==-999) continue;
-    double addme=ideal_z(Track[x_planes[ip]]);//z_hit[x_planes[plane]];
+    double addme=ideal_z(Track[x_planes[ip]],par);//z_hit[x_planes[plane]];
     hits++;//there's a hit
     sum_x  += addme;
     sum_xx += addme*addme;
@@ -270,34 +269,34 @@ double MMT_Fitter::ideal_ak(const vector<Hit>& Track)const{
   return hits/diff;
 }
 
-double MMT_Fitter::ideal_zbar(const vector<Hit>& Track)const{
-  vector<int> x_planes = m_par->q_planes("x");//this tells us which planes are x planes
+double MMT_Fitter::ideal_zbar(const vector<Hit>& Track, std::shared_ptr<MMT_Parameters> par)const{
+  vector<int> x_planes = par->q_planes("x");//this tells us which planes are x planes
   double ztot=0;
   int nhit=0;
   for(unsigned int ip=0; ip<x_planes.size(); ip++) {
     if(Track[x_planes[ip]].info.slope == -999) continue;
     nhit++;
-    ztot += ideal_z(Track[x_planes[ip]]);
+    ztot += ideal_z(Track[x_planes[ip]],par);
   }
   return ztot/nhit;
 }
 
-double MMT_Fitter::Get_Delta_Theta(double M_local, double M_global) const{
+double MMT_Fitter::Get_Delta_Theta(double M_local, double M_global, std::shared_ptr<MMT_Parameters> par) const{
   int region=-1;
   double LG = M_local * M_global;
   for(int j=0;j<m_number_LG_regions;j++){   //m_number_LG_regions
-    if(LG <= DT_Factors_val(j,0)){
+    if(LG <= DT_Factors_val(j,0,par)){
       region = j;
       break;
     }
   }
   if(region==-1) return -999;
-  return DT_Factors_val(region,1)*(M_local - M_global);
+  return DT_Factors_val(region,1,par)*(M_local - M_global);
 }
 
-double MMT_Fitter::DT_Factors_val(int i, int j) const{
-  if(m_par->val_tbl){
-    return m_par->DT_Factors[i][j];
+double MMT_Fitter::DT_Factors_val(int i, int j, std::shared_ptr<MMT_Parameters> par) const{
+  if(par->val_tbl){
+    return par->DT_Factors[i][j];
   }
   if(j<0 || j>1){
     ATH_MSG_WARNING("DT_Factors only has two entries on the second index (for LG and mult_factor); you inputed an index of " << j );
@@ -329,13 +328,13 @@ double MMT_Fitter::Get_Delta_Theta_division(double M_local, double M_global, dou
   return double( (M_local - M_global) / ( (M_local*M_global) / a  +  a  ));
 }
 
-vector<Hit> MMT_Fitter::q_hits(const string& type,const vector<Hit>& track) const{
-  string setup(m_par->setup);
+vector<Hit> MMT_Fitter::q_hits(const string& type,const vector<Hit>& track, std::shared_ptr<MMT_Parameters> par) const{
+  string setup(par->setup);
   if(setup.length()!=track.size()){
     ATH_MSG_WARNING("Setup has length: "<<setup.length()<<", but there are "<<track.size()<<" hits in the track");
     throw std::runtime_error("MMT_Fitter::q_hits: inconsistent setup");
   }
-  vector<int> qpl(m_par->q_planes(type));
+  vector<int> qpl(par->q_planes(type));
   vector<Hit> q_hits;
   for(unsigned int ihit=0; ihit<qpl.size(); ihit++){
     if( !(track[qpl[ihit]].info.slope==-999) )  {q_hits.push_back(track[qpl[ihit]]);
@@ -345,12 +344,12 @@ vector<Hit> MMT_Fitter::q_hits(const string& type,const vector<Hit>& track) cons
 }
 
 //change this to take u and/or v out of the roi calculation
-ROI MMT_Fitter::Get_ROI(double M_x, double M_u, double M_v, const vector<Hit>&track) const{
+ROI MMT_Fitter::Get_ROI(double M_x, double M_u, double M_v, const vector<Hit>&track, std::shared_ptr<MMT_Parameters> par) const{
   //M_* are all global slopes
   ATH_MSG_DEBUG("\nGet_ROI(" << M_x << "," << M_u << "," << M_v << ") ");
 
   //--- calc constants ------
-  double b=TMath::DegToRad()*(m_par->stereo_degree);
+  double b=TMath::DegToRad()*(par->stereo_degree);
   double A=1./std::tan(b);
   double B=1./std::tan(b);
 
@@ -375,49 +374,49 @@ ROI MMT_Fitter::Get_ROI(double M_x, double M_u, double M_v, const vector<Hit>&tr
   //--- average of 2 mx slope values ----if both u and v were bad, give it a -999 value to know not to use m_x
   //*** check to see if U and V are necessary for fit
   double mx = (nu+nv==0 ? 0 : (mxv+mxu)/(nu+nv));
-  if(m_par->correct.translate.X()!=0 && m_par->correct.type==2){
-    mx += phi_correct_factor(track)*m_par->correct.translate.X()/m_par->z_nominal[3];
+  if(par->correct.translate.X()!=0 && par->correct.type==2){
+    mx += phi_correct_factor(track,par)*par->correct.translate.X()/par->z_nominal[3];
   }
   ATH_MSG_DEBUG("(b,A,B,my,mxu,mxv,mx)=(" << b << "," << A << "," << B << "," << my << "," << mxu << "," << mxv << "," << mx << ")\n");
 
   //Get mx and my in parameterized values
-  int a_x = round((mx-m_par->m_x_min)/m_par->h_mx);
-  int a_y = round((my-m_par->m_y_min)/m_par->h_my);
+  int a_x = std::round((mx-par->m_x_min)/par->h_mx);
+  int a_y = std::round((my-par->m_y_min)/par->h_my);
   // Generally, this offers a reality check or cut.  The only reason a slope
   // should be "out of bounds" is because it represents a weird UV combination
   // -- ie. highly background influenced
-  if(a_y>m_par->n_y || a_y<0){
-    ATH_MSG_DEBUG( "y slope (theta) out of bounds in Get_ROI....(a_x,a_y,m_par->n_x,m_par->n_y)=("<< a_x << "," << a_y << "," << m_par->n_x << "," << m_par->n_y << ")");
+  if(a_y>par->n_y || a_y<0){
+    ATH_MSG_DEBUG( "y slope (theta) out of bounds in Get_ROI....(a_x,a_y,par->n_x,par->n_y)=("<< a_x << "," << a_y << "," << par->n_x << "," << par->n_y << ")");
     return ROI(-999,-999,-999,-999,-999);
   }
 
-  if(a_x>m_par->n_x || a_x<0){
-    ATH_MSG_DEBUG( "x slope (phi) out of bounds in Get_ROI....(a_x,a_y,m_par->n_x,m_par->n_y)=(" << a_x << "," << a_y << "," << m_par->n_x << "," <<m_par->n_y << ")");
+  if(a_x>par->n_x || a_x<0){
+    ATH_MSG_DEBUG( "x slope (phi) out of bounds in Get_ROI....(a_x,a_y,par->n_x,par->n_y)=(" << a_x << "," << a_y << "," << par->n_x << "," <<par->n_y << ")");
     return ROI(-999,-999,-999,-999,-999);
   }
 
   ATH_MSG_DEBUG("fv_angles...(a_x,a_y)=("<<a_x<<","<<a_y<<")");
   double phicor=0.;
-  if(m_par->correct.rotate.Z()!=0 && m_par->correct.type==2){
-    phicor=-0.2*m_par->correct.rotate.Z();
+  if(par->correct.rotate.Z()!=0 && par->correct.type==2){
+    phicor=-0.2*par->correct.rotate.Z();
   }
 
-  double fv_theta = Slope_Components_ROI_theta(a_y,a_x);
-  double fv_phi = (mx==0) ? -999 : Slope_Components_ROI_phi(a_y,a_x)+phicor;
+  double fv_theta = Slope_Components_ROI_theta(a_y,a_x,par);
+  double fv_phi = (mx==0) ? -999 : Slope_Components_ROI_phi(a_y,a_x,par)+phicor;
   ATH_MSG_DEBUG("fv_theta=" << fv_theta << ", fv_phi=" << fv_phi);
 
   //--- More hardware realistic approach but need fine tuning ----
-  int roi = Rough_ROI_temp(fv_theta,fv_phi);
+  int roi = Rough_ROI_temp(fv_theta,fv_phi,par);
 
   //--- current "roi" which is not an actual roi but an approx phi and theta
   return ROI(fv_theta,fv_phi,mx,my,roi);
 }
 
-double MMT_Fitter::phi_correct_factor(const vector<Hit>&track)const{
-  if((m_par->correct.rotate.Z()==0 && m_par->correct.translate.X()==0) || m_par->correct.type!=2) return 0.;
+double MMT_Fitter::phi_correct_factor(const vector<Hit>&track, std::shared_ptr<MMT_Parameters> par)const{
+  if((par->correct.rotate.Z()==0 && par->correct.translate.X()==0) || par->correct.type!=2) return 0.;
   int nxmis=0, nx=0, numis=0, nu=0, nvmis=0, nv=0;
   double xpart=0.5, upart=0.5, vpart=0.5;
-  string set=m_par->setup;
+  string set=par->setup;
   for(int ihit=0;ihit<(int)track.size();ihit++){
     int n_pln=track[ihit].info.plane;
     bool ismis=n_pln<4;
@@ -440,74 +439,74 @@ double MMT_Fitter::phi_correct_factor(const vector<Hit>&track)const{
   return xpart*1.*nxmis/nx+upart*1.*numis/nu+vpart*1.*nvmis/nv;
 }
 
-double MMT_Fitter::Slope_Components_ROI_val(int jy, int ix, int thetaphi) const{
-  if(m_par->val_tbl){
-    return m_par->Slope_to_ROI[jy][ix][thetaphi];
+double MMT_Fitter::Slope_Components_ROI_val(int jy, int ix, int thetaphi, std::shared_ptr<MMT_Parameters> par) const{
+  if(par->val_tbl){
+    return par->Slope_to_ROI[jy][ix][thetaphi];
   }
   if(thetaphi<0 || thetaphi>1){
     ATH_MSG_WARNING("Slope_Components_ROI only has two entries on the third index (for theta and phi); you inputed an index of " << thetaphi);
     throw std::runtime_error("MMT_Fitter::Slope_Components_ROI_val: invalid number of entries");
   }
-  if(thetaphi==0) return Slope_Components_ROI_theta(jy,ix);
-  return Slope_Components_ROI_phi(jy,ix);
+  if(thetaphi==0) return Slope_Components_ROI_theta(jy,ix,par);
+  return Slope_Components_ROI_phi(jy,ix,par);
 }
 
-double MMT_Fitter::Slope_Components_ROI_theta(int jy, int ix) const{
+double MMT_Fitter::Slope_Components_ROI_theta(int jy, int ix, std::shared_ptr<MMT_Parameters> par) const{
   //get some parameter information
-  if(jy<0 || jy>=m_par->n_y){
-    ATH_MSG_WARNING("You picked a y slope road index of " << jy << " in Slope_Components_ROI_theta; there are only " << m_par->n_y << " of these.\n");
-    if(jy >= m_par->n_y) jy=m_par->n_y-1;
+  if(jy<0 || jy>=par->n_y){
+    ATH_MSG_WARNING("You picked a y slope road index of " << jy << " in Slope_Components_ROI_theta; there are only " << par->n_y << " of these.\n");
+    if(jy >= par->n_y) jy=par->n_y-1;
     else jy=0;
   }
-  if(ix<0||ix>=m_par->n_x){
-    ATH_MSG_WARNING("You picked an x slope road index of " << ix << " in Slope_Components_ROI_theta; there are only " << m_par->n_x << " of these.\n");
-    if(ix >= m_par->n_x) ix=m_par->n_x-1;
+  if(ix<0||ix>=par->n_x){
+    ATH_MSG_WARNING("You picked an x slope road index of " << ix << " in Slope_Components_ROI_theta; there are only " << par->n_x << " of these.\n");
+    if(ix >= par->n_x) ix=par->n_x-1;
     else ix=0;
   }
   int xdex=ix, ydex=jy+1;
   if(xdex==0) xdex++;
-  double mx = m_par->m_x_min+m_par->h_mx*xdex;
-  double my = m_par->m_y_min+m_par->h_my*ydex;
+  double mx = par->m_x_min+par->h_mx*xdex;
+  double my = par->m_y_min+par->h_my*ydex;
   double theta = std::atan(sqrt( (mx*mx+my*my) ));
-  if(theta<m_par->minimum_large_theta || theta>m_par->maximum_large_theta){
+  if(theta<par->minimum_large_theta || theta>par->maximum_large_theta){
     theta=0;
   }
   return theta;
 }
 
-double MMT_Fitter::Slope_Components_ROI_phi(int jy, int ix) const{
-  if(jy<0 || jy>=m_par->n_y){
-    ATH_MSG_WARNING("You picked a y slope road index of " << jy << " in Slope_Components_ROI_phi; there are only " << m_par->n_y << " of these.\n");
-    if(jy >= m_par->n_y) jy=m_par->n_y-1;
+double MMT_Fitter::Slope_Components_ROI_phi(int jy, int ix, std::shared_ptr<MMT_Parameters> par) const{
+  if(jy<0 || jy>=par->n_y){
+    ATH_MSG_WARNING("You picked a y slope road index of " << jy << " in Slope_Components_ROI_phi; there are only " << par->n_y << " of these.\n");
+    if(jy >= par->n_y) jy=par->n_y-1;
     else jy=0;
   }
-  if(ix<0 || ix>=m_par->n_x){
-    ATH_MSG_WARNING("You picked an x slope road index of " << ix << " in Slope_Components_ROI_phi; there are only " << m_par->n_x << " of these.\n");
+  if(ix<0 || ix>=par->n_x){
+    ATH_MSG_WARNING("You picked an x slope road index of " << ix << " in Slope_Components_ROI_phi; there are only " << par->n_x << " of these.\n");
     //right now we're assuming these are cases just on the edges and so put the values to the okay limits
-    if(ix >= m_par->n_x) ix=m_par->n_x-1;
+    if(ix >= par->n_x) ix=par->n_x-1;
     else ix=0;
   }
   int xdex=ix, ydex=jy+1;
-  double mx=m_par->m_x_min+m_par->h_mx*xdex;
-  double my=m_par->m_y_min+m_par->h_my*ydex;
-  ATH_MSG_DEBUG("m_par->m_x_min+m_par->h_mx*xdex=" << m_par->m_x_min << "+" << m_par->h_mx << "*" << xdex << "=" << mx << ", ");
-  ATH_MSG_DEBUG("m_par->m_y_min+m_par->h_my*ydex=" << m_par->m_y_min << "+" << m_par->h_my << "*" << ydex << "=" << my << ", ");
+  double mx=par->m_x_min+par->h_mx*xdex;
+  double my=par->m_y_min+par->h_my*ydex;
+  ATH_MSG_DEBUG("par->m_x_min+par->h_mx*xdex=" << par->m_x_min << "+" << par->h_mx << "*" << xdex << "=" << mx << ", ");
+  ATH_MSG_DEBUG("par->m_y_min+par->h_my*ydex=" << par->m_y_min << "+" << par->h_my << "*" << ydex << "=" << my << ", ");
 
   double phi = std::atan2(mx,my);//the definition is flipped from what you'd normally think
   ATH_MSG_DEBUG("for a phi of " << phi);
-  if(phi < m_par->minimum_large_phi || phi > m_par->maximum_large_phi){
-    ATH_MSG_DEBUG("Chucking phi of " << phi <<" which registers as not in [" << m_par->minimum_large_phi << "," << m_par->maximum_large_phi << "]");
+  if(phi < par->minimum_large_phi || phi > par->maximum_large_phi){
+    ATH_MSG_DEBUG("Chucking phi of " << phi <<" which registers as not in [" << par->minimum_large_phi << "," << par->maximum_large_phi << "]");
     phi=999;
   }
   return phi;
 }
 
-int MMT_Fitter::Rough_ROI_temp(double theta, double phi) const{
+int MMT_Fitter::Rough_ROI_temp(double theta, double phi, std::shared_ptr<MMT_Parameters> par) const{
   //temporary function to identify areas of the wedge.
-  double minimum_large_theta = m_par->minimum_large_theta;
-  double maximum_large_theta = m_par->maximum_large_theta;
-  double minimum_large_phi = m_par->minimum_large_phi;
-  double maximum_large_phi = m_par->maximum_large_phi;
+  double minimum_large_theta = par->minimum_large_theta;
+  double maximum_large_theta = par->maximum_large_theta;
+  double minimum_large_phi = par->minimum_large_phi;
+  double maximum_large_phi = par->maximum_large_phi;
   int n_theta_rois=32, n_phi_rois=16;//*** ASK BLC WHAT THESE VALUES OUGHT TO BE!
 
   double h_theta = (maximum_large_theta - minimum_large_theta)/n_theta_rois;
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx
index 0ed24ee33d86..3203438e0c3b 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx
@@ -58,7 +58,7 @@ MMT_Hit::MMT_Hit(const MMT_Hit &hit) : AthMessaging(Athena::getMessageSvc(), "MM
   m_RZslope = hit.m_RZslope;
   m_YZslope = hit.m_YZslope;
   m_isNoise = hit.m_isNoise;
-  m_detManager = NULL;
+  m_detManager = nullptr;
 }
 
 MMT_Hit& MMT_Hit::operator=(const MMT_Hit& hit) {
@@ -84,7 +84,7 @@ MMT_Hit& MMT_Hit::operator=(const MMT_Hit& hit) {
   m_RZslope = hit.m_RZslope;
   m_YZslope = hit.m_YZslope;
   m_isNoise = hit.m_isNoise;
-  m_detManager = NULL;
+  m_detManager = nullptr;
 
   return *this;
 }
@@ -130,7 +130,7 @@ void MMT_Hit::setHitProperties(const Hit &hit) {
   m_Z = hit.info.z;
 }
 
-void MMT_Hit::updateHitProperties(const MMT_Parameters *par) {
+void MMT_Hit::updateHitProperties(std::shared_ptr<MMT_Parameters> par) {
   Identifier strip_id = this->getDetManager()->mmIdHelper()->channelID(this->getStationName(), this->getStationEta(), this->getStationPhi(), this->getMultiplet(), this->getGasGap(), this->getChannel());
   const MuonGM::MMReadoutElement* readout = this->getDetManager()->getMMReadoutElement(strip_id);
   Amg::Vector3D globalPos(0.0, 0.0, 0.0);
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Road.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Road.cxx
index a89be54c5078..bfc70b4f1a3a 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Road.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Road.cxx
@@ -27,7 +27,7 @@ MMT_Road::~MMT_Road() {
   this->reset();
 }
 
-void MMT_Road::addHits(std::vector<MMT_Hit*> &hits) {
+void MMT_Road::addHits(std::vector<std::shared_ptr<MMT_Hit> > &hits) {
   for (auto hit_i : hits) {
     int bo = hit_i->getPlane();
     bool has_hit = false;
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_struct.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_struct.cxx
index 3a3578b397f0..31021f7accbd 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_struct.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_struct.cxx
@@ -333,7 +333,7 @@ MMT_Parameters::MMT_Parameters(par_par inputParams, char wedgeSize, const MuonGM
                  "\t\t\t\t dlStereoTop/Bottom: " << roParam_top_mult1.dlStereoTop << " " << roParam_top_mult1.dlStereoBottom << "\n" <<
                  "\t\t\t\t Active area --> (Top, Bottom, Height) : (" << roParam_top_mult1.activeTopLength << ", " << roParam_top_mult1.activeBottomLength << ", " << roParam_top_mult1.activeH << ")");
   } else if (sector == 'S') {
-    ATH_MSG_INFO("SM2 " <<
+    ATH_MSG_INFO("SM2 \n" <<
                  "\t\t\t\t KO strips TopEta: " << roParam_top_mult1.nMissedTopEta << " - BottomEta: " << roParam_top_mult1.nMissedBottomEta << "\n" <<
                  "\t\t\t\t KO strips TopStereo: " << roParam_top_mult1.nMissedTopStereo << " - BottomStereo: " << roParam_top_mult1.nMissedBottomStereo << "\n" <<
                  "\t\t\t\t (Top, Bottom, Length): (" << mm_top_mult1->lWidth() << ", " << mm_top_mult1->sWidth() << ", " << mm_top_mult1->Length() << ")\n" <<
@@ -1084,7 +1084,7 @@ void hitData_key::print()const{
 }
 
 
-hitData_info::hitData_info(int pl,int station_eta,int strip,MMT_Parameters *par,const ROOT::Math::XYZVector &tru,double tpos,double ppos):plane(pl){
+hitData_info::hitData_info(int pl,int station_eta,int strip,std::shared_ptr<MMT_Parameters> par,const ROOT::Math::XYZVector &tru,double tpos,double ppos):plane(pl){
   (void) tru;
   //The idea here is to calculate/assign a y and a z to a given hit based on its pl/station/strip, the geometry of the detector (in par), and misalignment based on position.
   //We start by assigning the plane dependent strip width (the stereo planes come in skew and so get divided by cos(stereo_angle)
@@ -1120,7 +1120,7 @@ hitData_info::hitData_info(int pl,int station_eta,int strip,MMT_Parameters *par,
   slope =  (zflt!=0.) ? yflt / zflt : 0.;
 }
 
-double hitData_info::mis_dy(int plane,MMT_Parameters *par,double tpos,double ppos)const{
+double hitData_info::mis_dy(int plane,std::shared_ptr<MMT_Parameters> par,double tpos,double ppos)const{
   if(par->misal.type!=1 || plane>3) return 0.;
   double zplane=par->z_nominal[plane];
   double base=par->ybases[plane].front();
@@ -1208,14 +1208,14 @@ hitData_entry::hitData_entry(int ev, double gt, double q, int vmm, int mmfe, int
   event(ev),gtime(gt),charge(q),VMM_chip(vmm),MMFE_VMM(mmfe),plane(pl),strip(st),station_eta(est),station_phi(phi),multiplet(mult),gasgap(gg),localX(locX),tru_theta_ip(tr_the),tru_phi_ip(tru_phi),truth_nbg(q_tbg),BC_time(bct),time(t),truth(tru),recon(rec),fit_theta(fit_the),fit_phi(fit_ph),fit_dtheta(fit_dth),tru_dtheta(tru_dth),
   /*tru_theta_local(tru_thl),tru_theta_global(tru_thg),*/M_x_global(mxg),M_u_global(mug),M_v_global(mvg),M_x_local(mxl),mx(the_mx),my(the_my),roi(the_roi) {}
 
-Hit hitData_entry::entry_hit(MMT_Parameters *par)const{
+Hit hitData_entry::entry_hit(std::shared_ptr<MMT_Parameters> par)const{
   return Hit(entry_key(),entry_info(par));
 }
 hitData_key hitData_entry::entry_key() const{
   return hitData_key(BC_time,time,gtime,VMM_chip,event);
 }
 
-hitData_info hitData_entry::entry_info(MMT_Parameters *par)const{
+hitData_info hitData_entry::entry_info(std::shared_ptr<MMT_Parameters> par)const{
   hitData_info spade(plane,station_eta,strip,par,recon,tru_theta_ip,tru_phi_ip);//truth or recon? doesn't matter too much--it's for misalignment
   return spade;
 }
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx
index c19b9565be82..76966ab1a8cc 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx
@@ -45,8 +45,6 @@ namespace NSWL1 {
     declareInterface<NSWL1::IMMTriggerTool>(this);
     declareProperty("MM_DigitContainerName", m_MmDigitContainer = "MM_DIGITS", "the name of the MM digit container");
     declareProperty("DoNtuple", m_doNtuple = true, "input the MMStripTds branches into the analysis ntuple");
-
-    diamond = nullptr;
   }
 
   MMTriggerTool::~MMTriggerTool() {
@@ -107,29 +105,12 @@ namespace NSWL1 {
     }
 
     //Calculate and retrieve wedge geometry, defined in MMT_struct
+    const par_par standard = par_par(0.0009,4,4,0.0035,"xxuvxxuv",true);
+    const par_par xxuvuvxx = par_par(0.0009,4,4,0.007,"xxuvuvxx",true,true); //.0035 for uv_tol before...
+    const par_par xxuvuvxx_uvroads = par_par(0.0009,4,4,0.0035,"xxuvuvxx",true,true); //.0035 for uv_tol before...
 
-    const par_par standard=par_par(0.0009,4,4,0.0035,"xxuvxxuv",true);
-    const par_par xxuvuvxx=par_par(0.0009,4,4,0.007,"xxuvuvxx",true,true); //.0035 for uv_tol before...
-    const par_par xxuvuvxx_uvroads=par_par(0.0009,4,4,0.0035,"xxuvuvxx",true,true); //.0035 for uv_tol before...
-
-    // par_par pars=dlm;
-    m_par_large = new MMT_Parameters(xxuvuvxx,'L', m_detManager); // Need to figure out where to delete this!! It's needed once per run
-    m_par_small = new MMT_Parameters(xxuvuvxx,'S', m_detManager); // Need to figure out where to delete this!! It's needed once per run
-
-    return StatusCode::SUCCESS;
-  }
-
-  StatusCode MMTriggerTool::initDiamondAlgorithm() {
-    diamond = new MMT_Diamond(m_detManager);
-    diamond->setTrapezoidalShape(true);
-    diamond->setXthreshold(2);
-    diamond->setUV(true);
-    diamond->setUVthreshold(2);
-    diamond->setRoadSize(8);
-    diamond->setRoadSizeUpX(4);
-    diamond->setRoadSizeDownX(0);
-    diamond->setRoadSizeUpUV(4);
-    diamond->setRoadSizeDownUV(0);
+    m_par_large = std::make_shared<MMT_Parameters>(xxuvuvxx,'L', m_detManager);
+    m_par_small = std::make_shared<MMT_Parameters>(xxuvuvxx,'S', m_detManager);
 
     return StatusCode::SUCCESS;
   }
@@ -150,22 +131,37 @@ namespace NSWL1 {
     const MmDigitContainer *nsw_MmDigitContainer = nullptr;
     ATH_CHECK( evtStore()->retrieve(nsw_MmDigitContainer,"MM_DIGITS") );
 
-    std::map<std::string, MMT_Parameters*> pars;
+    std::map<std::string, std::shared_ptr<MMT_Parameters> > pars;
     pars["MML"] = m_par_large;
     pars["MMS"] = m_par_small;
-    MMLoadVariables load = MMLoadVariables(&(*(evtStore())), m_detManager, m_MmIdHelper, pars);
+    MMLoadVariables load = MMLoadVariables(&(*(evtStore())), m_detManager, m_MmIdHelper);
 
     std::map<std::pair<int, unsigned int>,std::vector<digitWrapper> > entries;
-    std::map<std::pair<int, unsigned int>,map<hitData_key,hitData_entry> > Hits_Data_Set_Time;
+    std::map<std::pair<int, unsigned int>,std::map<hitData_key,hitData_entry> > Hits_Data_Set_Time;
     std::map<std::pair<int, unsigned int>,evInf_entry> Event_Info;
-    ATH_CHECK( load.getMMDigitsInfo(entries, Hits_Data_Set_Time, Event_Info) );
+    ATH_CHECK( load.getMMDigitsInfo(entries, Hits_Data_Set_Time, Event_Info, pars) );
     this->fillNtuple(load);
 
     unsigned int particles = entries.rbegin()->first.second +1, nskip=0;
 
     if (entries.empty()) {
-      ATH_MSG_ERROR("No entries available, something is going wrong");
-      return StatusCode::FAILURE;
+      ATH_MSG_WARNING("No digits available for processing, exiting");
+      Hits_Data_Set_Time.clear();
+      Event_Info.clear();
+      return StatusCode::SUCCESS;
+    }
+
+    auto diamond = std::unique_ptr<MMT_Diamond>(new MMT_Diamond(m_detManager));
+    if (do_MMDiamonds) {
+      diamond->setTrapezoidalShape(true);
+      diamond->setXthreshold(2);
+      diamond->setUV(true);
+      diamond->setUVthreshold(2);
+      diamond->setRoadSize(8);
+      diamond->setRoadSizeUpX(4);
+      diamond->setRoadSizeDownX(0);
+      diamond->setRoadSizeUpUV(4);
+      diamond->setRoadSizeDownUV(0);
     }
 
     for (unsigned int i=0; i<particles; i++) {
@@ -183,10 +179,10 @@ namespace NSWL1 {
           m_trigger_truePtRange->push_back(trupt);
 
           tpos=truth_info.theta_pos;
-          m_trigger_trueThe->push_back(truth_info.theta_ip);
+          m_trigger_trueThe->push_back(truth_info.theta_ent);
 
           ppos=truth_info.phi_pos;
-          m_trigger_truePhi->push_back(truth_info.phi_ip);
+          m_trigger_truePhi->push_back(ppos);
 
           dt=truth_info.dtheta;
           m_trigger_trueDth->push_back(dt);
@@ -208,7 +204,7 @@ namespace NSWL1 {
       if (reco_it != Hits_Data_Set_Time.end()) {
         if (!reco_it->second.empty()) {
           std::vector<hitData_entry> hitDatas;
-          for (auto hit_it = reco_it->second.begin(); hit_it != reco_it->second.end(); hit_it++) hitDatas.push_back(hit_it->second);
+          for (const auto &hit_it : reco_it->second) hitDatas.push_back(hit_it.second);
           if (do_MMDiamonds) {
             /*
              * Filling hits for each event: a new class, MMT_Hit, is called in
@@ -221,10 +217,10 @@ namespace NSWL1 {
               else if (hitDatas[ihds].BC_time < smallest_bc) smallest_bc = hitDatas[ihds].BC_time;
 
               // The PrintHits function below gives identical results to the following one: hitDatas[ihds].print();
-	      m_trigger_VMM->push_back(hitDatas[ihds].VMM_chip);
-	      m_trigger_plane->push_back(hitDatas[ihds].plane);
-	      m_trigger_station->push_back(hitDatas[ihds].station_eta);
-	      m_trigger_strip->push_back(hitDatas[ihds].strip);
+              m_trigger_VMM->push_back(hitDatas[ihds].VMM_chip);
+              m_trigger_plane->push_back(hitDatas[ihds].plane);
+              m_trigger_station->push_back(hitDatas[ihds].station_eta);
+              m_trigger_strip->push_back(hitDatas[ihds].strip);
             }
             diamond->printHits(i-nskip);
             std::vector<double> slopes = diamond->getHitSlopes();
@@ -236,7 +232,34 @@ namespace NSWL1 {
              */
             if (diamond->getHitVector(i-nskip).size() >= (diamond->getXthreshold()+diamond->getUVthreshold())) {
               diamond->findDiamonds(i-nskip, smallest_bc, event);
-              storeEventProperties(i-nskip);
+
+              if (!diamond->getSlopeVector(i-nskip).empty()) {
+                m_trigger_diamond_ntrig->push_back(diamond->getSlopeVector(i-nskip).size());
+                for (const auto &slope : diamond->getSlopeVector(i-nskip)) {
+                  m_trigger_diamond_stationPhi->push_back(diamond->getDiamond(i-nskip).phi);
+                  m_trigger_diamond_sector->push_back(diamond->getDiamond(i-nskip).sector);
+                  m_trigger_diamond_bc->push_back(slope.BC);
+                  m_trigger_diamond_totalCount->push_back(slope.totalCount);
+                  m_trigger_diamond_realCount->push_back(slope.realCount);
+                  m_trigger_diamond_XbkgCount->push_back(slope.xbkg);
+                  m_trigger_diamond_UVbkgCount->push_back(slope.uvbkg);
+                  m_trigger_diamond_XmuonCount->push_back(slope.xmuon);
+                  m_trigger_diamond_UVmuonCount->push_back(slope.uvmuon);
+                  m_trigger_diamond_iX->push_back(slope.iRoad);
+                  m_trigger_diamond_iU->push_back(slope.iRoadu);
+                  m_trigger_diamond_iV->push_back(slope.iRoadv);
+                  m_trigger_diamond_age->push_back(slope.age);
+                  m_trigger_diamond_Xavg->push_back(slope.xavg);
+                  m_trigger_diamond_Uavg->push_back(slope.uavg);
+                  m_trigger_diamond_Vavg->push_back(slope.vavg);
+                  m_trigger_diamond_mxl->push_back(slope.mxl);
+                  m_trigger_diamond_theta->push_back(slope.theta);
+                  m_trigger_diamond_eta->push_back(slope.eta);
+                  m_trigger_diamond_dtheta->push_back(slope.dtheta);
+                  m_trigger_diamond_phi->push_back(slope.phi);
+                  m_trigger_diamond_phiShf->push_back(slope.phiShf);
+                }
+              } else ATH_MSG_WARNING("No output slopes to store");
             }
           } else {
             //////////////////////////////////////////////////////////////
@@ -246,18 +269,18 @@ namespace NSWL1 {
             //////////////////////////////////////////////////////////////
 
             //Initialization of the finder: defines all the roads
-	    MMT_Finder find = MMT_Finder(pars[station], 1);
-	    ATH_MSG_DEBUG(  "Number of Roads Configured " <<  find.get_roads()  );
+            auto find = std::unique_ptr<MMT_Finder>(new MMT_Finder(pars[station], 1));
+            ATH_MSG_DEBUG(  "Number of Roads Configured " <<  find->get_roads()  );
 
             std::map<pair<int,int>,finder_entry> hitBuffer;
-            for (auto hit_it = reco_it->second.begin(); hit_it != reco_it->second.end(); hit_it++) {
-              find.fillHitBuffer( hitBuffer, hit_it->second.entry_hit(pars[station]) ); // Hit object, Map (road,plane) -> Finder entry
+            for (const auto &hit_it : reco_it->second) {
+              find->fillHitBuffer( hitBuffer, hit_it.second.entry_hit(pars[station]), pars[station] ); // Hit object, Map (road,plane) -> Finder entry
   
-              hitData_info hitInfo = hit_it->second.entry_hit(pars[station]).info;
-              m_trigger_VMM->push_back(hit_it->second.VMM_chip);
-              m_trigger_plane->push_back(hit_it->second.plane);
-              m_trigger_station->push_back(hit_it->second.station_eta);
-              m_trigger_strip->push_back(hit_it->second.strip);
+              hitData_info hitInfo = hit_it.second.entry_hit(pars[station]).info;
+              m_trigger_VMM->push_back(hit_it.second.VMM_chip);
+              m_trigger_plane->push_back(hit_it.second.plane);
+              m_trigger_station->push_back(hit_it.second.station_eta);
+              m_trigger_strip->push_back(hit_it.second.strip);
               m_trigger_slope->push_back(hitInfo.slope);
             }
             if (reco_it->second.size() > 7) {
@@ -273,18 +296,18 @@ namespace NSWL1 {
               }
             }
 
-            //////////////////////////////////////////////////////////////
-            //                                                          //
-            //                 Fitter Applied Here                      //
-            //                                                          //
-            //////////////////////////////////////////////////////////////
+            ////////////////////////////////////////////////////////////////
+            ////                                                          //
+            ////                 Fitter Applied Here                      //
+            ////                                                          //
+            ////////////////////////////////////////////////////////////////
 
-            MMT_Fitter fit = MMT_Fitter(pars[station]);
+            auto fit = std::unique_ptr<MMT_Fitter>(new MMT_Fitter());
 
             //First loop over the roads and planes and apply the fitter
             int fits_occupied = 0;
             const int nfit_max = 1;  //MOVE THIS EVENTUALLY
-            int nRoads = find.get_roads();
+            int nRoads = find->get_roads();
 
             vector<evFit_entry> road_fits = vector<evFit_entry>(nRoads,evFit_entry());
 
@@ -300,23 +323,24 @@ namespace NSWL1 {
               vector<Hit> track;
 
               //Check if there are hits in the buffer
-              find.checkBufferForHits(  plane_is_hit, // Empty, To be filled by function.
-                                        track,        // Empty, To be filled by function.
-                                        iRoad,        // roadID
-                                        hitBuffer     // All hits. Map ( (road,plane) -> finder_entry  )
+              find->checkBufferForHits(  plane_is_hit, // Empty, To be filled by function.
+                                         track,        // Empty, To be filled by function.
+                                         iRoad,        // roadID
+                                         hitBuffer,    // All hits. Map ( (road,plane) -> finder_entry  )
+                                         pars[station] // Pointer to geometrical info class
                                       );
 
               //Look for coincidences
-              int road_num = find.Coincidence_Gate(plane_is_hit);
+              int road_num = find->Coincidence_Gate(plane_is_hit, pars[station]);
               if (road_num > 0) {
                 if (fits_occupied >= nfit_max) break;
 
                 //Perform the fit -> calculate local, global X, UV slopes -> calculate ROI and TriggerTool signal (theta, phi, deltaTheta)
-                evFit_entry candidate = fit.fit_event(event,track,hitDatas,fits_occupied,mxmy,mxl,mvGlobal,muGlobal);
+                evFit_entry candidate = fit->fit_event(event,track,hitDatas,fits_occupied,mxmy,mxl,mvGlobal,muGlobal,pars[station]);
 
                 ATH_MSG_DEBUG( "THETA " << candidate.fit_theta << " PHI " << candidate.fit_phi << " DTH " << candidate.fit_dtheta );
                 road_fits[iRoad] = candidate;
-                fillmxl = mxl; 
+                fillmxl = mxl;
                 fits_occupied++;
               }
               road_fits[iRoad].hcode = road_num;
@@ -400,48 +424,4 @@ namespace NSWL1 {
 
     return StatusCode::SUCCESS;
   }
-
-  void MMTriggerTool::storeEventProperties(const unsigned int iterator) {
-    if (diamond->getDiamond(iterator).wedgeCounter == iterator) {
-      if (diamond->getSlopeVector(iterator).empty()) return;
-      m_trigger_diamond_ntrig->push_back(diamond->getSlopeVector(iterator).size());
-
-      for (const auto &slope : diamond->getSlopeVector(iterator)) {
-        m_trigger_diamond_stationPhi->push_back(diamond->getDiamond(iterator).phi);
-        m_trigger_diamond_sector->push_back(diamond->getDiamond(iterator).sector);
-        m_trigger_diamond_bc->push_back(slope.BC);
-        m_trigger_diamond_totalCount->push_back(slope.totalCount);
-        m_trigger_diamond_realCount->push_back(slope.realCount);
-        m_trigger_diamond_XbkgCount->push_back(slope.xbkg);
-        m_trigger_diamond_UVbkgCount->push_back(slope.uvbkg);
-        m_trigger_diamond_XmuonCount->push_back(slope.xmuon);
-        m_trigger_diamond_UVmuonCount->push_back(slope.uvmuon);
-        m_trigger_diamond_iX->push_back(slope.iRoad);
-        m_trigger_diamond_iU->push_back(slope.iRoadu);
-        m_trigger_diamond_iV->push_back(slope.iRoadv);
-        m_trigger_diamond_age->push_back(slope.age);
-        m_trigger_diamond_Xavg->push_back(slope.xavg);
-        m_trigger_diamond_Uavg->push_back(slope.uavg);
-        m_trigger_diamond_Vavg->push_back(slope.vavg);
-        m_trigger_diamond_mxl->push_back(slope.mxl);
-        m_trigger_diamond_theta->push_back(slope.theta);
-        m_trigger_diamond_eta->push_back(slope.eta);
-        m_trigger_diamond_dtheta->push_back(slope.dtheta);
-        m_trigger_diamond_phi->push_back(slope.phi);
-        m_trigger_diamond_phiShf->push_back(slope.phiShf);
-      }
-    }
-    else ATH_MSG_FATAL( "Iterators don't match! Cannot retrieve corresponding variables" );
-  }
-
-  StatusCode MMTriggerTool::finalizeDiamondAlgorithm(const bool do_MMDiamonds) {
-   /*
-    * Place here all the cleaning stuff: pointer deletion etc...
-    */
-    if(do_MMDiamonds) delete diamond;
-    delete m_par_large;
-    delete m_par_small;
-
-    return StatusCode::SUCCESS;
-  }
 }//end namespace
-- 
GitLab


From 01a9fc950de3c46266ca3d12cc0f9d5426cf67c3 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Tue, 21 Sep 2021 17:03:57 +0200
Subject: [PATCH 240/347] Support appending auxiliary inputs e.g. minbias
 samples

---
 .../SimuJobTransforms/python/simTrfArgs.py    | 10 +--
 ..._Digi_tf_multistep_presampling_CA_vs_CG.sh | 32 ++++++--
 Tools/PyJobTransforms/python/transform.py     | 27 +++++--
 Tools/PyJobTransforms/python/trfArgClasses.py | 80 +++++++++++--------
 Tools/PyJobTransforms/python/trfExe.py        | 13 ++-
 Tools/PyJobTransforms/python/trfJobOptions.py | 21 +++--
 Tools/PyJobTransforms/python/trfReports.py    |  4 +
 7 files changed, 126 insertions(+), 61 deletions(-)

diff --git a/Simulation/SimuJobTransforms/python/simTrfArgs.py b/Simulation/SimuJobTransforms/python/simTrfArgs.py
index 52514eff937d..859c4077eaac 100644
--- a/Simulation/SimuJobTransforms/python/simTrfArgs.py
+++ b/Simulation/SimuJobTransforms/python/simTrfArgs.py
@@ -75,19 +75,19 @@ def addPileUpTrfArgs(parser):
     parser.add_argument('--testPileUpConfig',
                         type=argFactory(argBool),
                         help='Calculates the number of background events that will be require for a given pile-up configuration.', group='PileUp')
-    parser.add_argument('--inputLowPtMinbiasHitsFile','--LowPtMinbiasHitsFile', nargs='+',
+    parser.add_argument('--inputLowPtMinbiasHitsFile','--LowPtMinbiasHitsFile', nargs='+', action='append',
                         type=argFactory(argHITSFile, io='input', executor=['EVNTtoRDO','HITtoRDO'], auxiliaryFile=True),
                         help='Input HITS file for low pT minimum bias pile-up sub-events', group='PileUp')
-    parser.add_argument('--inputHighPtMinbiasHitsFile','--HighPtMinbiasHitsFile', nargs='+',
+    parser.add_argument('--inputHighPtMinbiasHitsFile','--HighPtMinbiasHitsFile', nargs='+', action='append',
                         type=argFactory(argHITSFile, io='input', executor=['EVNTtoRDO','HITtoRDO'], auxiliaryFile=True),
                         help='Input HITS file for high pT minimum bias pile-up sub-events', group='PileUp')
-    parser.add_argument('--inputCavernHitsFile', '--cavernHitsFile', nargs='+',
+    parser.add_argument('--inputCavernHitsFile', '--cavernHitsFile', nargs='+', action='append',
                         type=argFactory(argHITSFile, io='input', executor=['EVNTtoRDO','HITtoRDO'], auxiliaryFile=True),
                         help='Input HITS file for cavern background sub-events', group='PileUp')
-    parser.add_argument('--inputBeamHaloHitsFile', '--beamHaloHitsFile', nargs='+',
+    parser.add_argument('--inputBeamHaloHitsFile', '--beamHaloHitsFile', nargs='+', action='append',
                         type=argFactory(argHITSFile, io='input', executor=['EVNTtoRDO','HITtoRDO'], auxiliaryFile=True),
                         help='Input HITS file for beam halo sub-events', group='PileUp'),
-    parser.add_argument('--inputBeamGasHitsFile', '--beamGasHitsFile', nargs='+',
+    parser.add_argument('--inputBeamGasHitsFile', '--beamGasHitsFile', nargs='+', action='append',
                         type=argFactory(argHITSFile, io='input', executor=['EVNTtoRDO','HITtoRDO'], auxiliaryFile=True),
                         help='Input HITS file for beam gas sub-events', group='PileUp')
     parser.add_argument('--numberOfLowPtMinBias',
diff --git a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_multistep_presampling_CA_vs_CG.sh b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_multistep_presampling_CA_vs_CG.sh
index c9fc9428395d..f3193e5dbafe 100755
--- a/Simulation/Tests/DigitizationTests/test/test_Digi_tf_multistep_presampling_CA_vs_CG.sh
+++ b/Simulation/Tests/DigitizationTests/test/test_Digi_tf_multistep_presampling_CA_vs_CG.sh
@@ -12,8 +12,12 @@ Events=100
 DigiOutFileNameCG="multistep_presampling.CG.RDO.pool.root"
 DigiOutFileNameCA="multistep_presampling.CA.RDO.pool.root"
 HSHitsFile="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/mc16_13TeV.900149.PG_single_nu_Pt50.simul.HITS.e8307_s3482/HITS.24078104._234467.pool.root.1"
-HighPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.800831.Py8EG_minbias_inelastic_highjetphotonlepton.simul.HITS_FILT.e8341_s3687_s3704/*"
-LowPtMinbiasHitsFiles="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.900311.Epos_minbias_inelastic_lowjetphoton.simul.HITS_FILT.e8341_s3687_s3704/*"
+HighPtMinbiasHitsFiles1="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.800831.Py8EG_minbias_inelastic_highjetphotonlepton.simul.HITS_FILT.e8341_s3687_s3704/HITS_FILT.26106512._000149.pool.root.1"
+HighPtMinbiasHitsFiles2="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.800831.Py8EG_minbias_inelastic_highjetphotonlepton.simul.HITS_FILT.e8341_s3687_s3704/HITS_FILT.26106512._000581.pool.root.1"
+HighPtMinbiasHitsFiles3="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.800831.Py8EG_minbias_inelastic_highjetphotonlepton.simul.HITS_FILT.e8341_s3687_s3704/HITS_FILT.26106512._000717.pool.root.1"
+LowPtMinbiasHitsFiles1="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.900311.Epos_minbias_inelastic_lowjetphoton.simul.HITS_FILT.e8341_s3687_s3704/HITS_FILT.26106626._000068.pool.root.1"
+LowPtMinbiasHitsFiles2="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.900311.Epos_minbias_inelastic_lowjetphoton.simul.HITS_FILT.e8341_s3687_s3704/HITS_FILT.26106626._000480.pool.root.1"
+LowPtMinbiasHitsFiles3="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.900311.Epos_minbias_inelastic_lowjetphoton.simul.HITS_FILT.e8341_s3687_s3704/HITS_FILT.26106626._000574.pool.root.1"
 
 
 # config only
@@ -26,8 +30,12 @@ Digi_tf.py \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --inputHITSFile ${HSHitsFile} \
---inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
---inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles1} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles2} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles3} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles1} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles2} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles3} \
 --jobNumber 568 \
 --maxEvents ${Events} \
 --outputRDOFile ${DigiOutFileNameCG} \
@@ -51,8 +59,12 @@ Digi_tf.py \
 --digiSteeringConf "StandardSignalOnlyTruth" \
 --geometryVersion default:ATLAS-R2-2016-01-00-01 \
 --inputHITSFile ${HSHitsFile} \
---inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
---inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles1} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles2} \
+--inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles3} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles1} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles2} \
+--inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles3} \
 --jobNumber 568 \
 --maxEvents ${Events} \
 --outputRDOFile ${DigiOutFileNameCG} \
@@ -91,8 +103,12 @@ then
     --digiSteeringConf "StandardSignalOnlyTruth" \
     --geometryVersion default:ATLAS-R2-2016-01-00-01 \
     --inputHITSFile ${HSHitsFile} \
-    --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles} \
-    --inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles} \
+    --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles1} \
+    --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles2} \
+    --inputHighPtMinbiasHitsFile ${HighPtMinbiasHitsFiles3} \
+    --inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles1} \
+    --inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles2} \
+    --inputLowPtMinbiasHitsFile ${LowPtMinbiasHitsFiles3} \
     --jobNumber 568 \
     --maxEvents ${Events} \
     --outputRDOFile ${DigiOutFileNameCA} \
diff --git a/Tools/PyJobTransforms/python/transform.py b/Tools/PyJobTransforms/python/transform.py
index 946bfabe469d..7ef44b7f8004 100644
--- a/Tools/PyJobTransforms/python/transform.py
+++ b/Tools/PyJobTransforms/python/transform.py
@@ -328,7 +328,11 @@ class transform(object):
             for k, v in self._argdict.items():
                 if isinstance(v, argument):
                     v.name = k
-                    
+                elif isinstance(v, list):
+                    for it in v:
+                        if isinstance(it, argument):
+                            it.name = k
+
             # Now we parsed all arguments, if a pickle/json dump is requested do it here and exit
             if 'dumpPickle' in self._argdict:
                 msg.info('Now dumping pickled version of command line to {0}'.format(self._argdict['dumpPickle']))
@@ -497,13 +501,20 @@ class transform(object):
             # Note specifier [A-Za-z0-9_]+? makes this match non-greedy (avoid swallowing the optional 'File' suffix)
             m = re.match(r'(input|output|tmp)([A-Za-z0-9_]+?)(File)?$', key)
             # N.B. Protect against taking argunents which are not type argFile
-            if m and isinstance(value, argFile):
-                if m.group(1) == 'input':
-                    self._inputData.append(m.group(2))
-                else:
-                    self._outputData.append(m.group(2))
-                self._dataDictionary[m.group(2)] = value
-                
+            if m:
+                if isinstance(value, argFile):
+                    if m.group(1) == 'input':
+                        self._inputData.append(m.group(2))
+                    else:
+                        self._outputData.append(m.group(2))
+                    self._dataDictionary[m.group(2)] = value
+                elif isinstance(value, list) and value and isinstance(value[0], argFile):
+                    if m.group(1) == 'input':
+                        self._inputData.append(m.group(2))
+                    else:
+                        self._outputData.append(m.group(2))
+                    self._dataDictionary[m.group(2)] = value
+
         ## @note If we have no real data then add the pseudo datatype NULL, which allows us to manage
         #  transforms which can run without data
         if len(self._inputData) == 0:
diff --git a/Tools/PyJobTransforms/python/trfArgClasses.py b/Tools/PyJobTransforms/python/trfArgClasses.py
index 482dad31beba..1e0170b57012 100644
--- a/Tools/PyJobTransforms/python/trfArgClasses.py
+++ b/Tools/PyJobTransforms/python/trfArgClasses.py
@@ -514,7 +514,7 @@ class argFile(argList):
         self._mergeTargetSize = mergeTargetSize
         self._auxiliaryFile = auxiliaryFile
         self._originalName = None
-        
+
         # User setter to get valid value check
         self.io = io
 
@@ -2488,50 +2488,66 @@ class trfArgParser(argparse.ArgumentParser):
     def allArgs(self):
         return list(self._helpString)
 
+    # @brief parsing helper
+    def _parse_list_helper(self, value):
+        # We build on the value[0] instance as this contains the correct metadata
+        # and object references for this instance (shallow copying can
+        # mess up object references and deepcopy thows exceptions!)
+        newValueObj = value[0]
+        msg.debug('Started with: %s = %s', type(newValueObj), newValueObj)
+        if isinstance(value[0], argSubstep):
+            # Make sure you do not have a reference to the original value - this is a deeper copy
+            newValues = dictSubstepMerge(value[0].value, {})
+        elif isinstance(value[0], list):
+            if len(value) == 1:
+                return self._parse_list_helper(value[0])
+            msg.debug('Handling a list of arguments for key')
+            newValues = []
+            for v in value:
+                processedValueObj, processedValues = self._parse_list_helper(v)
+                processedValueObj.value = processedValues
+                newValues.append(processedValueObj)
+            newValueObj = newValues
+            return newValueObj, newValues
+        elif isinstance(value[0].value, list):
+            newValues = value[0].value
+        elif isinstance(value[0].value, dict):
+            newValues = value[0].value
+        else:
+            newValues = [value[0].value,]
+        for valueObj in value[1:]:
+            msg.debug('Value Object: %s = %s', type(valueObj), valueObj)
+            if isinstance(value[0], argSubstep):
+                # Special merger for lists attached to substeps
+                newValues = dictSubstepMerge(newValues, valueObj.value)
+            elif isinstance(valueObj.value, list):
+                # General lists are concatenated
+                newValues.extend(valueObj.value)
+            elif isinstance(valueObj.value, dict):
+                # General dictionaries are merged
+                newValues.update(valueObj.value)
+            else:
+                newValues.append(valueObj.value)
+        return newValueObj, newValues
 
     ## @brief Call argument_parser parse_args, then concatenate values
     #  @details Sets-up the standard argparse namespace, then use a special
     #           treatment for lists (arising from nargs='+'), where values
     #           are appropriately concatenated and a single object is returned 
     #  @return argument_parser namespace object
-    def parse_args(self, args = None, namespace = None): 
+    def parse_args(self, args = None, namespace = None):
         if namespace:
-            super(trfArgParser, self).parse_args(args = args, namespace = namespace) 
+            super(trfArgParser, self).parse_args(args = args, namespace = namespace)
         else:
             namespace = super(trfArgParser, self).parse_args(args = args)
         for k, v in namespace.__dict__.items():
             msg.debug('Treating key %s (%s)', k, v)
             if isinstance(v, list):
-                # We build on the v[0] instance as this contains the correct metadata
-                # and object references for this instance (shallow copying can 
-                # mess up object references and deepcopy thows exceptions!)
-                newValueObj = v[0] 
-                msg.debug('Started with: %s = %s', type(newValueObj), newValueObj)
-                if isinstance(v[0], argSubstep):
-                    # Make sure you do not have a reference to the original value - this is a deeper copy
-                    newValues = dictSubstepMerge(v[0].value, {})
-                elif isinstance(v[0].value, list):
-                    newValues = v[0].value
-                elif isinstance(v[0].value, dict):
-                    newValues = v[0].value
-                else:
-                    newValues = [v[0].value,]
-                for valueObj in v[1:]:
-                    msg.debug('Value Object: %s = %s', type(valueObj), valueObj)
-                    if isinstance(v[0], argSubstep):
-                        # Special merger for lists attached to substeps
-                        newValues = dictSubstepMerge(newValues, valueObj.value)
-                    elif isinstance(valueObj.value, list):
-                        # General lists are concatenated
-                        newValues.extend(valueObj.value)
-                    elif isinstance(valueObj.value, dict):
-                        # General dictionaries are merged
-                        newValues.update(valueObj.value)
-                    else:
-                        newValues.append(valueObj.value)
-                newValueObj.value = newValues
+                newValueObj, newValues = self._parse_list_helper(v)
+                if not isinstance(newValueObj, list):
+                    newValueObj.value = newValues
                 namespace.__dict__[k] = newValueObj
-                msg.debug('Set to %s', newValueObj.value)                
+                msg.debug('Set to %s', newValues)
 
         return namespace
 
diff --git a/Tools/PyJobTransforms/python/trfExe.py b/Tools/PyJobTransforms/python/trfExe.py
index fc2b3b2e9ae7..ba3ca11e8b91 100755
--- a/Tools/PyJobTransforms/python/trfExe.py
+++ b/Tools/PyJobTransforms/python/trfExe.py
@@ -1091,8 +1091,17 @@ class athenaExecutor(scriptExecutor):
             # See if we have any 'extra' file arguments
             nameForFiles = commonExecutorStepName(self._name)
             for dataType, dataArg in self.conf.dataDictionary.items():
-                if dataArg.io == 'input' and nameForFiles in dataArg.executor:
-                    inputFiles[dataArg.subtype] = dataArg
+                if isinstance(dataArg, list) and dataArg:
+                    if self.conf.totalExecutorSteps <= 1:
+                        raise ValueError('Multiple input arguments provided but only running one substep')
+                    if self.conf.totalExecutorSteps != len(dataArg):
+                        raise ValueError(f'{len(dataArg)} input arguments provided but running {self.conf.totalExecutorSteps} substeps')
+
+                    if dataArg[self.conf.executorStep].io == 'input' and nameForFiles in dataArg[self.conf.executorStep].executor:
+                        inputFiles[dataArg[self.conf.executorStep].subtype] = dataArg
+                else:
+                    if dataArg.io == 'input' and nameForFiles in dataArg.executor:
+                        inputFiles[dataArg.subtype] = dataArg
 
             msg.debug('Input Files: {0}; Output Files: {1}'.format(inputFiles, outputFiles))
             
diff --git a/Tools/PyJobTransforms/python/trfJobOptions.py b/Tools/PyJobTransforms/python/trfJobOptions.py
index 6e898353908c..c6380a320620 100644
--- a/Tools/PyJobTransforms/python/trfJobOptions.py
+++ b/Tools/PyJobTransforms/python/trfJobOptions.py
@@ -120,12 +120,21 @@ class JobOptionsTemplate(object):
                 # Now deal with our input and output files
                 print(os.linesep, "# Input data", file=runargsFile)
                 for dataType, dataArg in input.items():
-                    print('{0}.input{1}File = {2!r}'.format(self._runArgsName, dataType, dataArg.value), file=runargsFile)
-                    print('{0}.input{1}FileType = {2!r}'.format(self._runArgsName, dataType, dataArg.type), file=runargsFile)
-                    # Add the input event count, if we know it
-                    if dataArg.isCached(metadataKeys = ['nentries']):
-                        print('{0}.input{1}FileNentries = {2!r}'.format(self._runArgsName, dataType, dataArg.nentries), file=runargsFile)
-                    print("{0}.{1}FileIO = {2!r}".format(self._runArgsName, dataType, self._exe.conf.dataDictionary[dataType].io), file=runargsFile) 
+                    if isinstance(dataArg, list) and dataArg:
+                        dataArgStep = dataArg[self._exe.conf.executorStep]
+                        print('{0}.input{1}File = {2!r}'.format(self._runArgsName, dataType, dataArgStep.value), file=runargsFile)
+                        print('{0}.input{1}FileType = {2!r}'.format(self._runArgsName, dataType, dataArgStep.type), file=runargsFile)
+                        # Add the input event count, if we know it
+                        if dataArgStep.isCached(metadataKeys = ['nentries']):
+                            print('{0}.input{1}FileNentries = {2!r}'.format(self._runArgsName, dataType, dataArgStep.nentries), file=runargsFile)
+                        print("{0}.{1}FileIO = {2!r}".format(self._runArgsName, dataType, dataArgStep.io), file=runargsFile)
+                    else:
+                        print('{0}.input{1}File = {2!r}'.format(self._runArgsName, dataType, dataArg.value), file=runargsFile)
+                        print('{0}.input{1}FileType = {2!r}'.format(self._runArgsName, dataType, dataArg.type), file=runargsFile)
+                        # Add the input event count, if we know it
+                        if dataArg.isCached(metadataKeys = ['nentries']):
+                            print('{0}.input{1}FileNentries = {2!r}'.format(self._runArgsName, dataType, dataArg.nentries), file=runargsFile)
+                        print("{0}.{1}FileIO = {2!r}".format(self._runArgsName, dataType, dataArg.io), file=runargsFile)
                 
                 print(os.linesep, "# Output data", file=runargsFile)
                 for dataType, dataArg in output.items():
diff --git a/Tools/PyJobTransforms/python/trfReports.py b/Tools/PyJobTransforms/python/trfReports.py
index 08252250d90f..b3d126c6c1e5 100644
--- a/Tools/PyJobTransforms/python/trfReports.py
+++ b/Tools/PyJobTransforms/python/trfReports.py
@@ -157,6 +157,8 @@ class trfJobReport(trfReport):
                 myDict['files'][fileType] = []
         # Should have a dataDictionary, unless something went wrong very early...
         for dataType, dataArg in self._trf._dataDictionary.items():
+            if isinstance(dataArg, list): # Always skip lists from the report (auxiliary files)
+                continue
             if dataArg.auxiliaryFile: # Always skip auxilliary files from the report
                 continue
             if fileReport[dataArg.io]:
@@ -266,6 +268,8 @@ class trfJobReport(trfReport):
 
         # Now add information about output files
         for dataArg in self._trf._dataDictionary.values():
+            if isinstance(dataArg, list): # Always skip lists from the report (auxiliary files)
+                continue
             if dataArg.io == 'output':
                 for fileEltree in trfFileReport(dataArg).classicEltreeList(fast = fast):
                     trfTree.append(fileEltree)
-- 
GitLab


From 8cb026ef161d23683611a275a21e98f078696ce1 Mon Sep 17 00:00:00 2001
From: Christian Sander <christian.sander@desy.de>
Date: Tue, 21 Sep 2021 20:55:39 +0200
Subject: [PATCH 241/347] Some improvements and fixes:

---
 .../SCT_CalibAlgs/python/runSelector.py        | 18 +++++++++---------
 .../SCT_CalibAlgs/share/ReadCoolUPD4.py        | 17 +++++++++++------
 .../SCT_CalibAlgs/share/SCTCalibConfig.py      |  4 ++--
 .../SCT_CalibAlgs/share/skeleton.sct_calib.py  |  1 +
 .../SCT_CalibAlgs/src/SCTCalib.cxx             |  8 ++++----
 5 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/python/runSelector.py b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/python/runSelector.py
index 86d069fa5d3e..c638bcca7ba1 100755
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/python/runSelector.py
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/python/runSelector.py
@@ -36,7 +36,7 @@ def main( runNum = None, procType = None, forceSkipQueue = 0, Stream = None ):
     runQuery  = 'AtlRunQuery.py '
     runQuery += '--run \"' + str(Run0) + '\" '
 
-    if 'cos' not in Stream:
+    if 'cos' not in Stream and 'idcomm' not in Stream:
         runQuery += '--lhc \"stablebeams TRUE\" '
 
     runQuery += '--partition \"ATLAS\" '
@@ -47,12 +47,10 @@ def main( runNum = None, procType = None, forceSkipQueue = 0, Stream = None ):
         runQuery += '--projecttag \"data*_*eV\" '
     elif 'hi' in Stream:
         runQuery += '--projecttag \"data*_hi\" '
-    else:
+    elif 'cos' in Stream:
         runQuery += '--projecttag \"data*_cos\" '
-    # if 'cos' not in Stream:
-    #     runQuery += '--projecttag \"data*_*eV\" '
-    # else:
-    #     runQuery += '--projecttag \"data*_cos\" '
+    else:
+        runQuery += '--projecttag \"data*_idcom\" '
 
     if pType == 'doNoisyStrip':
         runQuery += '--streams \"*calibration_SCTNoise 10000+\" '
@@ -77,7 +75,7 @@ def main( runNum = None, procType = None, forceSkipQueue = 0, Stream = None ):
     print(Run0)
 
 #    --- Check stable beam flag if stream _is not_ cosmics
-    if 'cos' not in Stream:
+    if 'cos' not in Stream and 'idcomm' not in Stream:
     
         StableBeam = False
         if os.path.exists('./data/MyLBCollection.xml'):
@@ -127,7 +125,7 @@ def main( runNum = None, procType = None, forceSkipQueue = 0, Stream = None ):
         runQuery += '--run \"' + str(RunLast[:-1]) + '+\" '
 
 #        if 'cos' not in Stream:
-        if 'cos' not in Stream:
+        if 'cos' not in Stream and 'idcomm' not in Stream:
             runQuery += '--lhc \"stablebeams TRUE\" '
         runQuery += '--partition \"ATLAS\" '
         runQuery += '--detmaskin \"240A\" '
@@ -136,8 +134,10 @@ def main( runNum = None, procType = None, forceSkipQueue = 0, Stream = None ):
             runQuery += '--projecttag \"data*_*eV\" '
         elif 'hi' in Stream:
             runQuery += '--projecttag \"data*_hi\" '
-        else:
+        elif 'cos' in Stream:
             runQuery += '--projecttag \"data*_cos\" '
+        else:
+            runQuery += '--projecttag \"data*_idcomm\" '
         # if 'cos' not in Stream:
         #     runQuery += '--projecttag \"data*_*eV\" '
         # else:
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCoolUPD4.py b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCoolUPD4.py
index e23665cb12dc..1885baca87fe 100755
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCoolUPD4.py
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/ReadCoolUPD4.py
@@ -29,7 +29,7 @@ def openDatabase(dbstring):
   return db
 
 def formIov(runNumber):
-  s,u=((runNumber-1 ) << 32), ((runNumber + 1) << 32) - 1
+  s,u=((runNumber) << 32), ((runNumber + 1) << 32) - 1
   print ("formIOV: ", s, u)
   return s,u
 
@@ -47,9 +47,9 @@ def getRunNumberStart(runNumber, k):
     content_list = [line for line in content_list if line.strip()]
     integer_int_list = list(map(int, content_list))
     if (runNumber >= integer_int_list[-1]):
-        RNS = integer_int_list[len(integer_int_list)-k]
+        RNS = integer_int_list[len(integer_int_list)-(k+5)]
     else:
-        RNS = integer_int_list[integer_int_list.index(runNumber)-k]
+        RNS = integer_int_list[integer_int_list.index(runNumber)-(k+5)]
     return RNS
   
 #############################################################################################
@@ -82,11 +82,16 @@ def GetRunList(dbstring, folder, tag, runNumber, k):
     Temp=sorted(temp)
     #print('GetRunList: array is', Temp)
     ls=[]
+    runtmp = -999
+    if ( Temp[0] != runNumber ):
+        ls.append(Temp[0])
+        runtmp = Temp[0]
     for i in range(len(Temp)-1):
-        if (Temp[i] != Temp[i+1]):
-             ls.append(Temp[i])
+        if (Temp[i] != runtmp):
+             if ( Temp[i] != runNumber ):
+                 ls.append(Temp[i])
+                 runtmp = Temp[i]
    
-    #ls.append(Temp[len(Temp)-1])
     print(ls)
 
     mylist=[]
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/SCTCalibConfig.py b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/SCTCalibConfig.py
index 0f5b6f8cbd9c..04b20a6b5b0a 100755
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/SCTCalibConfig.py
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/SCTCalibConfig.py
@@ -94,8 +94,8 @@ NoisyModuleAverageInDB = -1.
 NoisyStripLastRunInDB  = -999
 NoisyStripAverageInDB  = -999.
 NoisyModuleList        = 5000
-NoisyModuleDiff        = 0.500
-NoisyStripDiff         = 5120
+NoisyModuleDiff        = 0.300
+NoisyStripDiff         = 0.300
             
 #--- Dead strips/chips
 DeadStripMinStat      = 5000
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/skeleton.sct_calib.py b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/skeleton.sct_calib.py
index eefb9ce134f3..0dd2b2c4bdf7 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/skeleton.sct_calib.py
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/share/skeleton.sct_calib.py
@@ -585,6 +585,7 @@ SCTCalib.NoisyWaferThrECC       = NoisyWaferThrECC
 SCTCalib.NoisyWaferFraction     = NoisyWaferFraction
 SCTCalib.NoisyChipFraction      = NoisyChipFraction
 SCTCalib.NoisyUploadTest        = NoisyUploadTest
+SCTCalib.NoisyStripAverageInDB  = NoisyStripAverageInDB
 SCTCalib.NoisyModuleAverageInDB = NoisyModuleAverageInDB
 SCTCalib.NoisyStripLastRunInDB  = NoisyStripLastRunInDB
 SCTCalib.NoisyModuleList        = NoisyModuleList
diff --git a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
index 8e287a7c6d0e..c0c7b160b82c 100644
--- a/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
+++ b/InnerDetector/InDetCalibAlgs/SCT_CalibAlgs/src/SCTCalib.cxx
@@ -520,7 +520,7 @@ void SCTCalib::doHVPrintXML(const std::pair<int, int>& timeInterval, const std::
 ///////////////////////////////////////////////////////////////////////////////////
 StatusCode SCTCalib::getNoisyStrip ATLAS_NOT_THREAD_SAFE () { // Thread unsafe writeModuleListToCool method is used.
    enum Categories {ALL, NEW, REF, N_CATEGORIES};
-   
+
 
    ATH_MSG_INFO("----- in getNoisyStrip() ----- ");
 
@@ -2767,7 +2767,7 @@ SCTCalib::writeModuleListToCool ATLAS_NOT_THREAD_SAFE // Thread unsafe SCTCalibW
                   ATH_MSG_ERROR("Could not create defect strip entry in the CalibWriteTool.");
                }
                nDefects++;
-            }; 
+            };
          } else {
             if (m_noisyStripAll) { //--- ALL noisy strips
                if (!defectStripsAll.empty() || m_noisyWriteAllModules) {
@@ -3058,7 +3058,7 @@ StatusCode SCTCalib::noisyStripsToSummaryXml(const std::map<Identifier, std::set
          isNoisyMinStat    = m_numberOfEvents > m_noisyMinStat;
          isNoisyModuleList = numModulesAll < m_noisyModuleList;
          isNoisyModuleDiff = ((static_cast<float>(numModulesAll) - m_noisyModuleAverageInDB)/m_noisyModuleAverageInDB) < m_noisyModuleDiff;
-         isNoisyStripDiff  = (numStripsAll - m_noisyStripAverageInDB) < m_noisyStripDiff;
+         isNoisyStripDiff = ((static_cast<float>(numStripsAll) - m_noisyStripAverageInDB)/m_noisyStripAverageInDB) < m_noisyStripDiff;
          if (!isNoisyMinStat or !isNoisyModuleList) {
             strUploadFlag = "R";
          } else {
@@ -3078,7 +3078,7 @@ StatusCode SCTCalib::noisyStripsToSummaryXml(const std::map<Identifier, std::set
    osNoisyMinStat    << "#events more than "                                                                      << m_noisyMinStat.value();
    osNoisyModuleList << "#(modules w/ at least 1 noisy strip) less than "                                         << m_noisyModuleList.value();
    osNoisyModuleDiff << "Increase of #(modules w/ at least 1 noisy strip) from average of recent runs less than " << m_noisyModuleDiff*100 << "%";
-   osNoisyStripDiff  << "Increase of #(noisy strips) from average of recent runs less than "                      << m_noisyStripDiff.value();
+   osNoisyStripDiff  << "Increase of #(noisy strips) from average of recent runs less than "                      << m_noisyStripDiff*100 << "%";
 
    std::ostringstream osFlagReason;
    if (!isNoisyMinStat)    osFlagReason << "FAILED in " << osNoisyMinStat.str()    << "; ";
-- 
GitLab


From aaab95d02aaec2db7fec3ca871db9e80f27558a5 Mon Sep 17 00:00:00 2001
From: Adam Edward Barton <adam.edward.barton@cern.ch>
Date: Tue, 21 Sep 2021 21:00:08 +0200
Subject: [PATCH 242/347] Database: String optimizations

---
 .../CoolConvUtilities/src/AtlCoolCopy.cxx     |  12 +-
 Database/CoolConvUtilities/src/LisToCool.cxx  |  10 +-
 .../CoolConvUtilities/src/ReplicaSorter.cxx   |   6 +-
 Database/CoraCool/CoraCool/CoraCoolDatabase.h |   2 +-
 Database/CoraCool/src/CoraCoolDatabase.cxx    |  44 +-
 Database/CoraCool/src/CoraCoolFolder.cxx      |   3 +-
 Database/CoraCool/src/CoraCoolObjectIter.cxx  |  19 +-
 Database/CrestApi/CrestApi/CrestApi.h         |  24 +-
 Database/CrestApi/src/CrestApi.cxx            | 611 +++++++++++-------
 .../TrigHLTMonitoring/src/HLTMonTool.cxx      |   4 +-
 10 files changed, 471 insertions(+), 264 deletions(-)

diff --git a/Database/CoolConvUtilities/src/AtlCoolCopy.cxx b/Database/CoolConvUtilities/src/AtlCoolCopy.cxx
index 01d45b3c5975..8324b5b90fcb 100755
--- a/Database/CoolConvUtilities/src/AtlCoolCopy.cxx
+++ b/Database/CoolConvUtilities/src/AtlCoolCopy.cxx
@@ -431,15 +431,15 @@ bool AtlCoolCopy::addFolder(const std::string& folder,const bool onlyTags) {
     // for leading part matches, next char in folder name must be '/'
     // so /CALO/SetA matches /CALO/SetA/X but not /CALO/SetAB
     if (*nodeitr==folder || folder=="/" ||
-      (nodeitr->substr(0,folder.size())==folder && 
-     nodeitr->size()>folder.size() && nodeitr->substr(folder.size(),1)=='/')) {
+      (nodeitr->compare(0,folder.size(),folder)==0 && 
+     nodeitr->size()>folder.size() && nodeitr->compare(folder.size(),1,"/")==0)) {
       // check if folder on exclude list
       bool exclude=false;
       for (std::vector<std::string>::const_iterator iexcl=m_folderexcl.begin();
 	   iexcl!=m_folderexcl.end();++iexcl) {
-	if (iexcl->substr(0,1)=="/") {
+	if (iexcl->compare(0,1,"/")==0) {
   	  // exclude pattern starting / matches folder path (/SCT or /SCT/DCS)
-          exclude=(exclude || nodeitr->substr(0,iexcl->size())==*iexcl);
+          exclude=(exclude || nodeitr->compare(0,iexcl->size(),*iexcl)==0);
 	} else {
 	  // exclude pattern without leading / matches anywhere in folder
 	  exclude=(exclude || (nodeitr->find(*iexcl)!=std::string::npos));
@@ -2097,9 +2097,9 @@ bool AtlCoolCopy::procOptVector(const int argc, const char* argv[],
   bool error=false;
   while (ic<argc) {
     int ir=argc-ic;
-    std::string par0=argv[ic];
+    std::string_view par0=argv[ic];
     // strip double "--" to achieve compatability with python-style options
-    if (par0.substr(0,2)=="--") par0=par0.substr(1);
+    if (par0.compare(0,2,"--")==0) par0=par0.substr(1);
     if ((par0=="-f" || par0=="-folder") && ir>1) {
       folders.emplace_back(argv[ic+1]);
       ++ic;
diff --git a/Database/CoolConvUtilities/src/LisToCool.cxx b/Database/CoolConvUtilities/src/LisToCool.cxx
index ce47f521e090..462c651a4781 100755
--- a/Database/CoolConvUtilities/src/LisToCool.cxx
+++ b/Database/CoolConvUtilities/src/LisToCool.cxx
@@ -90,7 +90,7 @@ LisToCool::LisToCool(const std::string& lisdb, const std::string& lisfolder,
     m_lisfolder << std::endl;
   std::cout << "Write to COOL DB: " << m_cooldbstr << " folder " <<
     m_coolfolder << std::endl;
-  std::string smode="Undefined";
+  std::string_view smode="Undefined";
   if (m_mode==1) smode="CondDBTable";
   if (m_mode==11) smode="CondDBTable compressed";
   if (m_mode==2) smode="Blob with Tags";
@@ -275,16 +275,18 @@ void LisToCool::copyCondTable(bool compress) {
   // from each folder)
   std::vector<std::string> newcolname;
   // set folder description string for single channel folder in Athena
-  std::string timestr;
+  std::string_view timestr;
   if (m_runevent) {
     timestr="<timeStamp>run-event</timeStamp>";
   } else {
     timestr="<timeStamp>time</timeStamp>";
   }
   if (m_channel==-1) {
-    m_cooldesc=timestr+"<addrHeader><address_header service_type=\"71\" clid=\"40774348\" /></addrHeader><typeName>AthenaAttributeList</typeName>";
+    m_cooldesc=std::string(timestr);
+    m_cooldesc+="<addrHeader><address_header service_type=\"71\" clid=\"40774348\" /></addrHeader><typeName>AthenaAttributeList</typeName>";
   } else {
-    m_cooldesc=timestr+"<addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>";
+    m_cooldesc=std::string(timestr);
+    m_cooldesc+="<addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>";
     std::cout << "Data will be written in COOL channel " << m_channel 
 	      << std::endl;
     // setup list of column names from tagprefix string (reused)
diff --git a/Database/CoolConvUtilities/src/ReplicaSorter.cxx b/Database/CoolConvUtilities/src/ReplicaSorter.cxx
index d18b612d6dbb..e0568bea738e 100644
--- a/Database/CoolConvUtilities/src/ReplicaSorter.cxx
+++ b/Database/CoolConvUtilities/src/ReplicaSorter.cxx
@@ -31,7 +31,7 @@ void ReplicaSorter::sort(std::vector<
       std::string::size_type ipos1=conn.find("://");
       std::string::size_type ipos2=conn.find('/',ipos1+3);
       if (ipos1!=std::string::npos && ipos2!=std::string::npos) {
-        const std::string server=conn.substr(ipos1+3,ipos2-ipos1-3);
+        const std::string_view server=std::string_view(conn).substr(ipos1+3,ipos2-ipos1-3);
         // check if this server is on list of replicas to use for domain
         // if so, add it with its associated priority
         for (ServerMap::const_iterator sitr=m_servermap.begin();
@@ -178,7 +178,9 @@ FILE* ReplicaSorter::findFile(const std::string& filename,
   while (!fptr && iofs1<len) {
     iofs2=pathvar.find(':',iofs1);
     if (iofs2==std::string::npos) iofs2=len;
-    name=pathvar.substr(iofs1,iofs2-iofs1)+"/"+filename;
+    name=pathvar.substr(iofs1,iofs2-iofs1);
+    name+='/';
+    name+=filename;
     fptr=fopen(name.c_str(),"r");
     iofs1=iofs2+1;
   }
diff --git a/Database/CoraCool/CoraCool/CoraCoolDatabase.h b/Database/CoraCool/CoraCool/CoraCoolDatabase.h
index 09be51b9bb65..a33735a25ba4 100755
--- a/Database/CoraCool/CoraCool/CoraCoolDatabase.h
+++ b/Database/CoraCool/CoraCool/CoraCoolDatabase.h
@@ -80,7 +80,7 @@ class CoraCoolDatabase {
   bool deleteFolder(const std::string& coolfolder);
 
  private:
-  bool extractCoralConStr(const std::string& coolstr);
+  bool extractCoralConStr(std::string_view coolstr);
   std::string encodeAttrSpec(const cool::IRecordSpecification& spec);
   bool storeSpec(const std::string& tablename,const std::string& spec);
 
diff --git a/Database/CoraCool/src/CoraCoolDatabase.cxx b/Database/CoraCool/src/CoraCoolDatabase.cxx
index 06347e470b97..bb25860cba33 100755
--- a/Database/CoraCool/src/CoraCoolDatabase.cxx
+++ b/Database/CoraCool/src/CoraCoolDatabase.cxx
@@ -79,13 +79,13 @@ bool CoraCoolDatabase::disconnect() {
   return m_connected;
 }
 
-bool CoraCoolDatabase::extractCoralConStr(const std::string& coolstr) {
+bool CoraCoolDatabase::extractCoralConStr(const std::string_view coolstr) {
   // extract CORAL database string from COOL one
   bool dbok=false;
   // first check for initial colon - if so, technology-specific string
   std::string::size_type c1=coolstr.find(':');
   if (c1!=std::string::npos) {
-    std::string techno,server,schema,user,passwd;
+    std::string_view techno,server,schema;
     techno=coolstr.substr(0,c1);
     std::string::size_type c2;
     c2=coolstr.find(';');
@@ -101,25 +101,30 @@ bool CoraCoolDatabase::extractCoralConStr(const std::string& coolstr) {
     if (c1!=std::string::npos) {
       c2=coolstr.find(';',c1+7);
       if (c2==std::string::npos) c2=coolstr.size();
-      m_dbname=coolstr.substr(c1+7,c2-c1-7);
+      m_dbname=std::string(coolstr.substr(c1+7,c2-c1-7));
     }
     // construct the connection string
     if (techno=="oracle" || techno=="mysql" || techno=="frontier") {
       if (!server.empty() && !schema.empty()) {
-        m_dbconn=techno+"://"+server+"/"+schema;
+        m_dbconn=std::string(techno);
+        m_dbconn+= "://";
+        m_dbconn+=server;
+        m_dbconn+='/';
+        m_dbconn+=schema;
 	dbok=true;
       }
     } else if (techno=="sqlite") {
       if (!schema.empty()) {
-	m_dbconn="sqlite_file:"+schema;
+	m_dbconn="sqlite_file:";
+        m_dbconn+=schema;
 	dbok=true;
       }
     }
   } else {
     c1=coolstr.find('/');
     if (c1!=std::string::npos) {
-      m_dbconn=coolstr.substr(0,c1);
-      m_dbname=coolstr.substr(c1+1);
+      m_dbconn=std::string(coolstr.substr(0,c1));
+      m_dbname=std::string(coolstr.substr(c1+1));
       dbok=true;
     }
   }
@@ -136,8 +141,10 @@ std::string CoraCoolDatabase::encodeAttrSpec(
   unsigned int n=spec.size();
   for (unsigned int i=0;i<n;++i) {
     const cool::IFieldSpecification& field=spec[i];
-    result+=field.name()+":"+field.storageType().name();
-    if (i<n-1) result+=",";
+    result+=field.name();
+    result+=':';
+    result+=field.storageType().name();
+    if (i<n-1) result+=',';
   }
   return result;
 }
@@ -210,12 +217,19 @@ CoraCoolFolderPtr CoraCoolDatabase::createFolder(const std::string& coolpath,
   p1=description.find("<coracool>");
   p2=description.find("</coracool>");
   if (p1!=std::string::npos && p2!=std::string::npos) {
-    newdesc=description.substr(0,p1)+description.substr(p2+11);
+    newdesc=description.substr(0,p1);
+    newdesc.append(description, p2+11);
   }
   // COOL foreign key column is name of COOL payload attribute
-  newdesc=newdesc+"<coracool>"+coraltable+":"+
-    fkspec[0].name()+":"+
-    coralfk+":"+coralpk+"</coracool>";
+  newdesc+="<coracool>";
+  newdesc+=coraltable;
+  newdesc+=':';
+  newdesc+=fkspec[0].name();
+  newdesc+=':';
+  newdesc+= coralfk;
+  newdesc+=':';
+  newdesc+=coralpk;
+  newdesc+="</coracool>";
   m_log << coral::Debug << "Created new description: " << newdesc << 
     coral::MessageStream::endmsg;
 
@@ -335,7 +349,9 @@ bool CoraCoolDatabase::parseFolderDescription(const std::string& folderdesc,
   c2=folderdesc.find(':',c1+1);
   if (c2==std::string::npos) return false;
 
-  tablename=m_dbname+"_"+folderdesc.substr(p1+10,c1-p1-10);
+  tablename=m_dbname;
+  tablename+= '_';
+  tablename.append(folderdesc,p1+10,c1-p1-10);
   keycolcool=folderdesc.substr(c1+1,c2-c1-1);
   fkeycolcoral=folderdesc.substr(c2+1,p2-c2-1);
   // check for third colon to specify separate primary key
diff --git a/Database/CoraCool/src/CoraCoolFolder.cxx b/Database/CoraCool/src/CoraCoolFolder.cxx
index a95445bc9352..9ea7d54281df 100755
--- a/Database/CoraCool/src/CoraCoolFolder.cxx
+++ b/Database/CoraCool/src/CoraCoolFolder.cxx
@@ -461,8 +461,7 @@ bool CoraCoolFolder::decodeAttrSpec() {
           iofs3=spec.size();
           last=true;
         }
-        m_attrvec.push_back(std::pair<std::string,std::string> (
-         spec.substr(iofs1,iofs2-iofs1),spec.substr(iofs2+1,iofs3-iofs2-1)));
+        m_attrvec.emplace_back(spec.substr(iofs1,iofs2-iofs1),spec.substr(iofs2+1,iofs3-iofs2-1));
         if (!last) iofs1=iofs3+1;
       }
       bres=true;
diff --git a/Database/CoraCool/src/CoraCoolObjectIter.cxx b/Database/CoraCool/src/CoraCoolObjectIter.cxx
index cca69725f209..965c615b12e5 100755
--- a/Database/CoraCool/src/CoraCoolObjectIter.cxx
+++ b/Database/CoraCool/src/CoraCoolObjectIter.cxx
@@ -18,6 +18,7 @@
 #include "CoraCool/CoraCoolObject.h"
 #include "CoraCool/CoraCoolException.h"
 #include "CoraCool/CoraCoolObjectIter.h"
+#include <unordered_map>
 
 // performance tuning parameters
 // maximum number of ranges and query terms to use for CORAL query
@@ -73,7 +74,7 @@ void  CoraCoolObjectIter::readDataToBuffer(){
     std::string fktypestr;
     // keep map of FKvalue to list of associated COOL channels
     typedef std::vector<unsigned int> KeyVec;
-    typedef std::map<long long,KeyVec > KeyMap;
+    typedef std::unordered_map<long long,KeyVec > KeyMap;
     KeyMap keymap;
 
     while (m_inbuf<m_buflen && iHasNext() && 
@@ -328,13 +329,23 @@ void CoraCoolObjectIter::QueryBuilder::getQuery(std::string& where,
     if (m_lower[i]==m_upper[i]) {
       // bounds are equal - simple equivalence term
       std::string keyname=addKey(ikey,fkeys,spec,m_lower[i]);
-      where+=coralkey+"=:"+keyname;
+      where+=coralkey;
+      where+="=:";
+      where+=keyname;
     } else {
       // bounds are not equal - need  A>=B and A<=C
       std::string keyname=addKey(ikey,fkeys,spec,m_lower[i]);
-      where+="("+coralkey+">=:"+keyname+" AND "+coralkey+"<=:";
+      where+='(';
+      where+=coralkey;
+      where+=">=:";
+      where+=keyname;
+      where+=" AND ";
+      where+=coralkey;
+      where+="<=:";
+
       keyname=addKey(ikey,fkeys,spec,m_upper[i]);
-      where+=keyname+")";
+      where+=keyname;
+      where+=')';
     }
   }
 }
diff --git a/Database/CrestApi/CrestApi/CrestApi.h b/Database/CrestApi/CrestApi/CrestApi.h
index 40e009baa437..1d6dc8944500 100644
--- a/Database/CrestApi/CrestApi/CrestApi.h
+++ b/Database/CrestApi/CrestApi/CrestApi.h
@@ -163,7 +163,7 @@ namespace Crest {
  *
  */
     std::string performRequest(const std::string& current_path, Action action, nlohmann::json& js,
-                               const std::string& method_name);
+                               const char* method_name);
 
 
 /**
@@ -209,7 +209,7 @@ namespace Crest {
  *  It was used to throw an exception if the library method not implemented for file system.
  * @param method_name - method name.
  */
-    void checkFsException(std::string& method_name);
+    void checkFsException(const char* method_name);
 
 
 /**
@@ -224,14 +224,14 @@ namespace Crest {
  * </pre>
  * @param method - method name, where was the error.
  */
-    int checkErrors(const nlohmann::json& js, const std::string& method);
+    int checkErrors(const nlohmann::json& js, const char* method);
 
 /**
  * This method removes all XML/HTML tags from a string.
  * (It is an auxillary method to clear the CREST Server response.)
  * @param xmlBuffer - the text (a std::string ) to be cleared.
  */
-    std::string ParseXMLOutput(std::string xmlBuffer);
+    std::string ParseXMLOutput(std::string_view xmlBuffer);
 
 /**
  * This method removes all end of line and carriage return symbols from a string.
@@ -249,7 +249,7 @@ namespace Crest {
  * @param st - the CURL response,
  * @param method_name - the name on a method which calls one of the perform request methods.
  */
-    void checkResult(CURLcode res, long response_code, const std::string& st, const std::string& method_name);
+    void checkResult(CURLcode res, long response_code, const std::string& st, const char* method_name);
   public:
 // ===================================
 // CONSTRUCTORS
@@ -283,7 +283,7 @@ namespace Crest {
  *    CrestClient myCrestClient = CrestClient(url);
  * </pre>
  */
-    CrestClient(const std::string& url);
+    CrestClient(std::string_view url);
 
     ~CrestClient();
 
@@ -308,7 +308,7 @@ namespace Crest {
  * @return - JSON object as nlohmann::json
  *
  */
-    nlohmann::json getJson(const std::string& str, const std::string& method); // string to json
+    nlohmann::json getJson(const std::string& str, const char* method); // string to json
 
 /**
  * Auxillary method to get a file as a string.
@@ -1065,7 +1065,7 @@ namespace Crest {
  *    myCrestClient.storeBatchPayloadsFs(name39, str39);
  * </pre>
  */
-    void storeBatchPayloadsFs(std::string tag_name, std::string& iovsetupload);
+    void storeBatchPayloadsFs(const std::string &tag_name, std::string& iovsetupload);
 
 /**
  * This auxillary method stores several payloads in batch mode in the file storage.
@@ -1080,7 +1080,7 @@ namespace Crest {
  *    myCrestClient.storeBatchPayloadsFs(name39, js39);
  * </pre>
  */
-    void storeBatchPayloadsFs(std::string tag_name, nlohmann::json& js);
+    void storeBatchPayloadsFs(const std::string &tag_name, nlohmann::json& js);
 
 
 /**
@@ -1094,7 +1094,7 @@ namespace Crest {
  *
  * @param varname - a variable name.
  */
-    std::string getEnvA(const std::string& varname);
+    std::string getEnvA(const char* varname);
 
 /**
  * Auxillary method to get an environment variable DAT_PATH.
@@ -1275,7 +1275,7 @@ namespace Crest {
  * @param str - a string to split.
  * @param delim - a deliminator.
  */
-    std::vector<std::string> split(const std::string& str, const std::string& delim);
+    std::vector<std::string> split(std::string_view str, char delim);
 
 /**
  * This method gets a tag meta info from the CREST database in IOVDbSvc format.
@@ -1394,7 +1394,7 @@ namespace Crest {
  * This method uses SHA256 algorithm (PicoSHA2 C++ library)
  * @param str - a string
  */
-    std::string getHash(std::string str);
+    std::string getHash(std::string_view str);
 
 /**
  * The auxillary method to get a current data and time.
diff --git a/Database/CrestApi/src/CrestApi.cxx b/Database/CrestApi/src/CrestApi.cxx
index b1e665cc25ab..01d82f1850e1 100644
--- a/Database/CrestApi/src/CrestApi.cxx
+++ b/Database/CrestApi/src/CrestApi.cxx
@@ -40,27 +40,29 @@ namespace Crest {
       SERVER_MODE) {
   }
 
-  CrestClient::CrestClient(const std::string& url) : m_mode(SERVER_MODE) {
+  CrestClient::CrestClient(std::string_view url) : m_mode(SERVER_MODE) {
     size_t found = url.find_first_of(':');
 
-    std::string protocol = url.substr(0, found);
-    std::string url_new = url.substr(found + 3); //url_new is the url excluding the http part
+    std::string_view url_new = url.substr(found + 3); //url_new is the url excluding the http part
     size_t found1 = url_new.find_first_of(':');
     size_t found2 = url_new.find_first_of('/');
+    std::string_view host;
+    std::string_view port;
     if (found1 != std::string::npos && found2 != std::string::npos) {
-      m_host = url_new.substr(0, found1);
-      m_port = url_new.substr(found1 + 1, found2 - found1 - 1);
+      host = url_new.substr(0, found1);
+      port = url_new.substr(found1 + 1, found2 - found1 - 1);
     } else if (found1 != std::string::npos) {
-      m_host = url_new.substr(0, found1);
-      m_port = url_new.substr(found1 + 1);
+      host = url_new.substr(0, found1);
+      port = url_new.substr(found1 + 1);
     } else if (found2 != std::string::npos) {
-      m_port = "80";
-      m_host = url_new.substr(0, found2);
+      port = "80";
+      host = url_new.substr(0, found2);
     } else {
-      m_port = "80";
-      m_host = url_new;
+      port = "80";
+      host = url_new;
     }
-
+    m_port = std::string(port);
+    m_host = std::string(host);
     std::cout << "host=" << m_host << " port" << m_port << std::endl;
   }
 
@@ -73,12 +75,12 @@ namespace Crest {
 //
 
   nlohmann::json CrestClient::listTags() {
-    std::string method_name = "CrestClient::listTags";
+    const char* method_name = "CrestClient::listTags";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_TAG_PATH;
-    std::string getTxt = "GET";
+    std::string current_path = s_PATH;
+    current_path += s_TAG_PATH;
 
     std::string retv;
 
@@ -91,7 +93,7 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::listTags(int size, int page) {
-    std::string method_name = "CrestClient::listTags";
+    const char* method_name = "CrestClient::listTags";
 
     checkFsException(method_name);
 
@@ -107,21 +109,25 @@ namespace Crest {
     }
 
     if (size != size_default) {
-      size_param = "size=" + std::to_string(size);
-      params = params + size_param;
+      size_param = "size=";
+      size_param += std::to_string(size);
+      params += size_param;
     }
     if (page != page_default) {
-      page_param = "page=" + std::to_string(page);
-      if (page_param == "") {
-        params = params + page_param;
+      page_param = "page=";
+      page_param += std::to_string(page);
+      if (page_param.empty()) {
+        params += page_param;
       } else {
-        params = params + "&" + page_param;
+        params += '&';
+        params += page_param;
       }
     }
 
-    std::string current_path = s_PATH + s_TAG_PATH + "?" + params;
-    std::string getTxt = "GET";
-
+    std::string current_path = s_PATH;
+    current_path += s_TAG_PATH;
+    current_path += '?';
+    current_path += params;
     std::string retv;
 
     nlohmann::json js = nullptr;
@@ -133,18 +139,30 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::listTags(const std::string& name, int size, int page, const std::string& sort) {
-    std::string method_name = "CrestClient::listTags";
+    const char* method_name = "CrestClient::listTags";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_TAG_PATH;
-
-    if (name != "") {
-      std::string nameString = "?by=name:" + name;
-      current_path = current_path + nameString + "&size=" + std::to_string(size) + "&page=" + std::to_string(page) +
-                     "&sort=" + sort;
+    std::string current_path = s_PATH;
+    current_path += s_TAG_PATH;
+
+    if (!name.empty()) {
+      std::string nameString = "?by=name:";
+      nameString += name;
+      current_path +=  nameString;
+      current_path += "&size=";
+      current_path += std::to_string(size);
+      current_path += "&page=";
+      current_path += std::to_string(page);
+      current_path += "&sort=";
+      current_path += sort;
     } else {
-      current_path = current_path + "?size=" + std::to_string(size) + "&page=" + std::to_string(page) + "&sort=" + sort;
+      current_path += "?size=";
+      current_path += std::to_string(size);
+      current_path += "&page=";
+      current_path +=  std::to_string(page);
+      current_path += "&sort=";
+      current_path +=  sort;
     }
 
     nlohmann::json js = nullptr;
@@ -156,13 +174,15 @@ namespace Crest {
   }
 
   void CrestClient::removeTag(const std::string& tagName) {
-    std::string method_name = "removeTag";
+    const char* method_name = "removeTag";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_ADMIN_PATH + s_TAG_PATH + '/' + tagName;
-    std::string getTxt = "DELETE";
-
+    std::string current_path = s_PATH;
+    current_path += s_ADMIN_PATH;
+    current_path += s_TAG_PATH;
+    current_path += '/';
+    current_path += tagName;
     std::string retv;
 
     nlohmann::json js = nullptr;
@@ -171,13 +191,12 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::findTag(const std::string& tagName) {
-    std::string method_name = "findTag";
+    const char* method_name = "findTag";
     if (m_mode == FILESYSTEM_MODE) {
       return findTagFs(tagName);
     }
 
     std::string current_path = s_PATH + s_TAG_PATH + '/' + tagName;
-    std::string getTxt = "GET";
 
     std::string retv;
 
@@ -191,7 +210,7 @@ namespace Crest {
   }
 
   void CrestClient::createTag(const std::string& name, const std::string& desc, const std::string& timeType) {
-    std::string method_name = "CrestClient::createTag";
+    //const char* method_name = "CrestClient::createTag";
 
     nlohmann::json js2 = {{"description", desc}, {"endOfValidity", 0},
                           {"lastValidatedTime", 0}, {"synchronization", "none"}, {"payloadSpec", "json"},
@@ -201,7 +220,7 @@ namespace Crest {
 
   void CrestClient::createTag(const std::string& name, const std::string& desc, const std::string& timeType,
                               const std::string& payloadSpec) {
-    std::string method_name = "CrestClient::createTag";
+    //const char* method_name = "CrestClient::createTag";
 
     nlohmann::json js2 = {{"description", desc}, {"endOfValidity", 0},
                           {"lastValidatedTime", 0}, {"synchronization", "none"}, {"payloadSpec", payloadSpec},
@@ -211,13 +230,14 @@ namespace Crest {
   }
 
   void CrestClient::createTag(nlohmann::json& js) {
-    std::string method_name = "CrestClient::createTag";
+    const char* method_name = "CrestClient::createTag";
     if (m_mode == FILESYSTEM_MODE) {
       createTagDump(js);
       return;
     }
 
-    std::string current_path = s_PATH + s_TAG_PATH;
+    std::string current_path = s_PATH;
+    current_path += s_TAG_PATH;
 
     std::string retv;
 
@@ -225,11 +245,14 @@ namespace Crest {
   }
 
   void CrestClient::updateTag(const std::string& tagname, nlohmann::json body) {
-    std::string method_name = "CrestClient::updateTag";
+    const char* method_name = "CrestClient::updateTag";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_TAG_PATH + '/' + tagname;
+    std::string current_path = s_PATH;
+    current_path += s_TAG_PATH;
+    current_path += '/';
+    current_path += tagname;
 
     std::string retv;
 
@@ -237,11 +260,14 @@ namespace Crest {
   }
 
   void CrestClient::updateTagSpecification(const std::string& tagname, const std::string& objectType) {
-    std::string method_name = "CrestClient::updateTagSpecification";
+    const char* method_name = "CrestClient::updateTagSpecification";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_TAG_PATH + '/' + tagname;
+    std::string current_path = s_PATH;
+    current_path += s_TAG_PATH;
+    current_path += '/';
+    current_path += tagname;
 
     nlohmann::json body;
     body["objectType"] = objectType;
@@ -254,12 +280,16 @@ namespace Crest {
   void CrestClient::createTagDump(nlohmann::json& js) {
     std::string name = js["name"];
 
-    std::string rootDir = m_root_folder + s_FS_TAG_PATH;
+    std::string rootDir = m_root_folder;
+    rootDir += s_FS_TAG_PATH;
     if (!std::filesystem::exists(std::filesystem::path(rootDir))) {
       std::filesystem::create_directory(std::filesystem::path(rootDir));
     }
 
-    std::string workDir = m_root_folder + s_FS_TAG_PATH + '/' + name;
+    std::string workDir = m_root_folder;
+    workDir += s_FS_TAG_PATH;
+    workDir += '/';
+    workDir += name;
     if (!std::filesystem::exists(std::filesystem::path(workDir))) {
       std::filesystem::create_directory(std::filesystem::path(workDir));
     }
@@ -309,11 +339,12 @@ namespace Crest {
 // IOVs
 
   void CrestClient::createIov(nlohmann::json& js) {
-    std::string method_name = "CrestClient::createIov";
+    const char* method_name = "CrestClient::createIov";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_IOV_PATH;
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
 
     std::string retv;
 
@@ -321,12 +352,15 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::findAllIovs(const std::string& tagname) {
-    std::string method_name = "CrestClient::findAllIovs";
+    const char* method_name = "CrestClient::findAllIovs";
     if (m_mode == FILESYSTEM_MODE) {
       return findAllIovsFs(tagname);
     }
 
-    std::string current_path = s_PATH + s_IOV_PATH + "?by=tagname:" + tagname;
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
+    current_path += "?by=tagname:";
+    current_path += tagname;
 
     std::string retv;
 
@@ -341,7 +375,7 @@ namespace Crest {
 
   nlohmann::json CrestClient::findAllIovs(const std::string& tagname, int size, int page, const std::string& sort,
                                           const std::string& dateformat) {
-    std::string method_name = "CrestClient::findAllIovs";
+    const char* method_name = "CrestClient::findAllIovs";
     if (m_mode == FILESYSTEM_MODE) {
       return findAllIovsFs(tagname);
     }
@@ -350,8 +384,18 @@ namespace Crest {
     // http://crest-01.cern.ch:8080/crestapi/iovs?by=tagname:test_MvG3b&size=1&page=1
     // http://crest-02.cern.ch:8090/crestapi/tags?size=10&page=2&sort=name:DESC
 
-    std::string current_path = s_PATH + s_IOV_PATH + "?by=tagname:" + tagname + "&size=" + std::to_string(size) +
-                               "&page=" + std::to_string(page) + "&sort=" + sort + "&dateformat=" + dateformat;
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
+    current_path += "?by=tagname:";
+    current_path += tagname;
+    current_path += "&size=";
+    current_path += std::to_string(size);
+    current_path += "&page=";
+    current_path += std::to_string(page);
+    current_path += "&sort=";
+    current_path += sort;
+    current_path += "&dateformat=";
+    current_path += dateformat;
 
     std::string retv;
 
@@ -365,11 +409,15 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::getSizeByTag(const std::string& tagname) {
-    std::string method_name = "CrestClient::getSizeByTag";
+    const char* method_name = "CrestClient::getSizeByTag";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_IOV_PATH + s_IOV_SIZE_PATH_FOR_TAG + "?tagname=" + tagname; //return json
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
+    current_path += s_IOV_SIZE_PATH_FOR_TAG;
+    current_path += "?tagname=";
+    current_path += tagname; //return json
 
     std::string retv;
 
@@ -383,11 +431,15 @@ namespace Crest {
   }
 
   int CrestClient::getSize(const std::string& tagname) {
-    std::string method_name = "CrestClient::getSize";
+    const char* method_name = "CrestClient::getSize";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_IOV_PATH + s_IOV_SIZE_PATH + "?tagname=" + tagname; //return json
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
+    current_path += s_IOV_SIZE_PATH;
+    current_path += "?tagname=";
+    current_path += tagname; //return json
 
     std::string retv;
 
@@ -401,11 +453,15 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::selectIovs(const std::string& tagname) {
-    std::string method_name = "CrestClient::selectIovs";
+    const char* method_name = "CrestClient::selectIovs";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_IOV_PATH + s_IOV_SELECT_PATH + "?tagname=" + tagname; //return json
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
+    current_path += s_IOV_SELECT_PATH;
+    current_path += "?tagname=";
+    current_path += tagname; //return json
 
     std::string retv;
 
@@ -419,12 +475,17 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::selectIovs(const std::string& tagname, long snapshot) {
-    std::string method_name = "CrestClient::selectIovs";
+    const char* method_name = "CrestClient::selectIovs";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_IOV_PATH + s_IOV_SELECT_PATH + "?tagname=" + tagname + "&snapshot=" +
-                               std::to_string(snapshot); //return json
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
+    current_path += s_IOV_SELECT_PATH;
+    current_path += "?tagname=";
+    current_path += tagname;
+    current_path += "&snapshot=";
+    current_path += std::to_string(snapshot); //return json
 
     std::string retv;
 
@@ -438,11 +499,15 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::selectGroups(const std::string& tagname) {
-    std::string method_name = "CrestClient::selectGroups";
+    const char* method_name = "CrestClient::selectGroups";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_IOV_PATH + s_IOV_GROUP_PATH + "?tagname=" + tagname; //return json
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
+    current_path += s_IOV_GROUP_PATH;
+    current_path += "?tagname=";
+    current_path += tagname; //return json
 
     std::string retv;
 
@@ -456,12 +521,17 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::selectGroups(const std::string& tagname, long snapshot) {
-    std::string method_name = "CrestClient::selectGroups";
+    const char* method_name = "CrestClient::selectGroups";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_IOV_PATH + s_IOV_GROUP_PATH + "?tagname=" + tagname + "&snapshot=" +
-                               std::to_string(snapshot); //return json
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
+    current_path += s_IOV_GROUP_PATH;
+    current_path += "?tagname=";
+    current_path += tagname;
+    current_path += "&snapshot=";
+    current_path += std::to_string(snapshot); //return json
 
     std::string retv;
 
@@ -474,11 +544,15 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::selectSnapshot(const std::string& tagname) {
-    std::string method_name = "CrestClient::selectSnapshot";
+    const char* method_name = "CrestClient::selectSnapshot";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_IOV_PATH + s_IOV_SNAPSHOT_PATH + "?tagname=" + tagname; //return json
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
+    current_path += s_IOV_SNAPSHOT_PATH;
+    current_path += "?tagname=";
+    current_path += tagname; //return json
 
     std::string retv;
 
@@ -492,12 +566,17 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::selectSnapshot(const std::string& tagname, long snapshot) {
-    std::string method_name = "CrestClient::selectSnapshot";
+    const char* method_name = "CrestClient::selectSnapshot";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_IOV_PATH + s_IOV_SNAPSHOT_PATH + "?tagname=" + tagname + "&snapshot=" +
-                               std::to_string(snapshot); //return json
+    std::string current_path = s_PATH;
+    current_path += s_IOV_PATH;
+    current_path += s_IOV_SNAPSHOT_PATH;
+    current_path += "?tagname=";
+    current_path += tagname;
+    current_path += "&snapshot=";
+    current_path += std::to_string(snapshot); //return json
 
     std::string retv;
 
@@ -513,11 +592,15 @@ namespace Crest {
 // GLOBALTAGS
 
   void CrestClient::updateGlobalTag(const std::string& name, nlohmann::json body) {
-    std::string method_name = "CrestClient::updateGlobalTag";
+    const char* method_name = "CrestClient::updateGlobalTag";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_ADMIN_PATH + s_GLOBALTAG_PATH + '/' + name;
+    std::string current_path = s_PATH;
+    current_path += s_ADMIN_PATH;
+    current_path += s_GLOBALTAG_PATH;
+    current_path += '/';
+    current_path += name;
 
     std::string retv;
 
@@ -525,27 +608,28 @@ namespace Crest {
   }
 
   void CrestClient::createGlobalTag(nlohmann::json& js) {
-    std::string method_name = "CrestClient::createGlobalTag";
+    const char* method_name = "CrestClient::createGlobalTag";
 
     if (m_mode == FILESYSTEM_MODE) {
       createGlobalTagFs(js);
       return;
     }
 
-    std::string current_path = s_PATH + s_GLOBALTAG_PATH;
+    std::string current_path = s_PATH;
+    current_path += s_GLOBALTAG_PATH;
     std::string retv;
     retv = performRequest(current_path, POST, js, method_name);
   }
 
   void CrestClient::createGlobalTag(const std::string& tag) {
-    std::string method_name = "CrestClient::createGlobalTag";
+    const char* method_name = "CrestClient::createGlobalTag";
 
     nlohmann::json js = getJson(tag, method_name);
     createGlobalTag(js);
   }
 
   void CrestClient::createGlobalTag(const std::string& tagname, const std::string& description) {
-    std::string method_name = "CrestClient::createGlobalTag";
+    //const char* method_name = "CrestClient::createGlobalTag";
 
     nlohmann::json js =
     {
@@ -562,7 +646,7 @@ namespace Crest {
   }
 
   std::string CrestClient::findGlobalTagAsString(const std::string& name) {
-    std::string method_name = "CrestClient::findGlobalTagAsString";
+    const char* method_name = "CrestClient::findGlobalTagAsString";
 
     if (m_mode == FILESYSTEM_MODE) {
       nlohmann::json j = findGlobalTagFs(name);
@@ -570,7 +654,10 @@ namespace Crest {
       return s;
     }
 
-    std::string current_path = s_PATH + s_GLOBALTAG_PATH + '/' + name;
+    std::string current_path = s_PATH;
+    current_path += s_GLOBALTAG_PATH;
+    current_path += '/';
+    current_path += name;
     std::string retv;
 
     nlohmann::json js = nullptr;
@@ -580,7 +667,7 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::findGlobalTag(const std::string& name) {
-    std::string method_name = "CrestClient::findGlobalTag";
+    const char* method_name = "CrestClient::findGlobalTag";
 
     if (m_mode == FILESYSTEM_MODE) {
       return findGlobalTagFs(name);
@@ -593,22 +680,27 @@ namespace Crest {
   }
 
   void CrestClient::removeGlobalTag(const std::string& name) {
-    std::string method_name = "CrestClient::removeGlobalTag";
+    const char* method_name = "CrestClient::removeGlobalTag";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_ADMIN_PATH + s_GLOBALTAG_PATH + '/' + name;
+    std::string current_path = s_PATH;
+    current_path += s_ADMIN_PATH;
+    current_path += s_GLOBALTAG_PATH;
+    current_path += '/';
+    current_path += name;
     std::string retv;
     nlohmann::json js = nullptr;
     retv = performRequest(current_path, DELETE, js, method_name);
   }
 
   nlohmann::json CrestClient::listGlobalTags() {
-    std::string method_name = "CrestClient::listGlobalTags";
+    const char* method_name = "CrestClient::listGlobalTags";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_GLOBALTAG_PATH;
+    std::string current_path = s_PATH;
+    current_path += s_GLOBALTAG_PATH;
     std::string retv;
     nlohmann::json js = nullptr;
     retv = performRequest(current_path, GET, js, method_name);
@@ -618,11 +710,12 @@ namespace Crest {
   }
 
   std::string CrestClient::listGlobalTagsAsString() {
-    std::string method_name = "CrestClient::listGlobalTagsAsString";
+    const char* method_name = "CrestClient::listGlobalTagsAsString";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_GLOBALTAG_PATH;
+    std::string current_path = s_PATH;
+    current_path += s_GLOBALTAG_PATH;
 
     std::string retv;
 
@@ -634,17 +727,29 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::listGlobalTags(const std::string& name, int size, int page, const std::string& sort) {
-    std::string method_name = "CrestClient::listGlobalTags";
+    const char* method_name = "CrestClient::listGlobalTags";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_GLOBALTAG_PATH;
-    if (name != "") {
-      std::string nameString = "?by=name:" + name;
-      current_path = current_path + nameString + "&size=" + std::to_string(size) + "&page=" + std::to_string(page) +
-                     "&sort=" + sort;
+    std::string current_path = s_PATH;
+    current_path += s_GLOBALTAG_PATH;
+    if (!name.empty()) {
+      std::string nameString = "?by=name:";
+      nameString += name;
+      current_path += nameString;
+      current_path += "&size=";
+      current_path += std::to_string(size);
+      current_path += "&page=";
+      current_path += std::to_string(page);
+      current_path += "&sort=";
+      current_path += sort;
     } else {
-      current_path = current_path + "?size=" + std::to_string(size) + "&page=" + std::to_string(page) + "&sort=" + sort;
+      current_path += "?size=";
+      current_path += std::to_string(size);
+      current_path += "&page=";
+      current_path += std::to_string(page);
+      current_path += "&sort=";
+      current_path += sort;
     }
 
     std::string retv;
@@ -659,13 +764,16 @@ namespace Crest {
 // GLOBALTAGM MAPs
 
   nlohmann::json CrestClient::findGlobalTagMap(const std::string& name) {
-    std::string method_name = "CrestClient::findGlobalTagMap";
+    const char* method_name = "CrestClient::findGlobalTagMap";
 
     if (m_mode == FILESYSTEM_MODE) {
       return findGlobalTagMapFs(name);
     }
 
-    std::string current_path = s_PATH + s_GLOBALTAG_MAP_PATH + '/' + name;
+    std::string current_path = s_PATH;
+    current_path += s_GLOBALTAG_MAP_PATH;
+    current_path += '/';
+    current_path += name;
 
     std::string retv;
 
@@ -679,14 +787,15 @@ namespace Crest {
   }
 
   void CrestClient::createGlobalTagMap(nlohmann::json& js) {
-    std::string method_name = "CrestClient::createGlobalTagMap";
+    const char* method_name = "CrestClient::createGlobalTagMap";
 
     if (m_mode == FILESYSTEM_MODE) {
       createGlobalTagMapFs(js);
       return;
     }
 
-    std::string current_path = s_PATH + s_GLOBALTAG_MAP_PATH;
+    std::string current_path = s_PATH;
+    current_path += s_GLOBALTAG_MAP_PATH;
 
     std::string retv;
 
@@ -695,7 +804,7 @@ namespace Crest {
 
   void CrestClient::createGlobalTagMap(const std::string& globaltag, const std::string& tagname,
                                        const std::string& record, const std::string& label) {
-    std::string method_name = "CrestClient::createGlobalTagMap";
+    const char* method_name = "CrestClient::createGlobalTagMap";
 
     nlohmann::json js =
     {
@@ -721,12 +830,15 @@ namespace Crest {
 //BLOBS & PAYLOADS
 
   std::string CrestClient::getBlob(const std::string& hash) {
-    std::string method_name = "CrestClient::getBlob";
+    const char* method_name = "CrestClient::getBlob";
     if (m_mode == FILESYSTEM_MODE) {
       return getBlobFs(hash);
     }
 
-    std::string current_path = s_PATH + s_PAYLOAD_PATH + '/' + hash;
+    std::string current_path = s_PATH;
+    current_path += s_PAYLOAD_PATH;
+    current_path += '/';
+    current_path += hash;
 
     std::string retv;
 
@@ -738,12 +850,15 @@ namespace Crest {
   }
 
   std::string CrestClient::getBlobInStream(const std::string& hash, std::ofstream& out) {
-    std::string method_name = "CrestClient::getBlobInStream";
+    //const char* method_name = "CrestClient::getBlobInStream";
     if (m_mode == FILESYSTEM_MODE) {
       return getBlobInStreamFs(hash, out);
     }
 
-    std::string current_path = s_PATH + s_PAYLOAD_PATH + '/' + hash;
+    std::string current_path = s_PATH;
+    current_path += s_PAYLOAD_PATH;
+    current_path += '/';
+    current_path += hash;
 
     std::string retv;
 
@@ -756,13 +871,17 @@ namespace Crest {
 // PAYLOADS
 
   nlohmann::json CrestClient::getPayloadMetaInfo(const std::string& hash) {
-    std::string method_name = "CrestClient::getPayloadMetaInfo";
+    const char* method_name = "CrestClient::getPayloadMetaInfo";
 
     if (m_mode == FILESYSTEM_MODE) {
       return getPayloadMetaInfoAsJsonFS(hash);
     }
 
-    std::string current_path = s_PATH + s_PAYLOAD_PATH + '/' + hash + s_META_PATH;
+    std::string current_path = s_PATH;
+    current_path += s_PAYLOAD_PATH;
+    current_path += '/';
+    current_path += hash;
+    current_path += s_META_PATH;
 
     std::string retv;
 
@@ -776,13 +895,17 @@ namespace Crest {
   }
 
   std::string CrestClient::getPayloadMetaInfoAsString(const std::string& hash) {
-    std::string method_name = "CrestClient::getPayloadMetaInfoAsString";
+    const char* method_name = "CrestClient::getPayloadMetaInfoAsString";
 
     if (m_mode == FILESYSTEM_MODE) {
       return getPayloadMetaInfoAsStringFS(hash);
     }
 
-    std::string current_path = s_PATH + s_PAYLOAD_PATH + '/' + hash + s_META_PATH;
+    std::string current_path = s_PATH;
+    current_path += s_PAYLOAD_PATH;
+    current_path += '/';
+    current_path += hash;
+    current_path += s_META_PATH;
 
     std::string retv;
 
@@ -794,11 +917,14 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::listPayloadTagInfo(const std::string& tagname) {
-    std::string method_name = "CrestClient::getPayloadTagInfo";
+    const char* method_name = "CrestClient::getPayloadTagInfo";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_MONITORING_PAYLOAD_PATH + "?tagname=" + tagname;
+    std::string current_path = s_PATH;
+    current_path += s_MONITORING_PAYLOAD_PATH;
+    current_path += "?tagname=";
+    current_path += tagname;
 
     std::string retv;
 
@@ -812,11 +938,12 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::listPayloadTagInfo() {
-    std::string method_name = "CrestClient::getPayloadTagInfo";
+    const char* method_name = "CrestClient::getPayloadTagInfo";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_MONITORING_PAYLOAD_PATH;
+    std::string current_path = s_PATH;
+    current_path += s_MONITORING_PAYLOAD_PATH;
 
     std::string retv;
 
@@ -830,13 +957,17 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::getPayloadAsJson(const std::string& hash) {
-    std::string method_name = "CrestClient::getPayloadAsJson";
+    const char* method_name = "CrestClient::getPayloadAsJson";
 
     if (m_mode == FILESYSTEM_MODE) {
       return getPayloadAsJsonFS(hash);
     }
 
-    std::string current_path = s_PATH + s_PAYLOAD_PATH + '/' + hash + "?format=DTO";
+    std::string current_path = s_PATH;
+    current_path += s_PAYLOAD_PATH;
+    current_path += '/';
+    current_path += hash;
+    current_path += "?format=DTO";
 
     std::string retv;
 
@@ -850,13 +981,17 @@ namespace Crest {
   }
 
   std::string CrestClient::getPayloadAsString(const std::string& hash) {
-    std::string method_name = "CrestClient::getPayloadAsString";
+    const char* method_name = "CrestClient::getPayloadAsString";
 
     if (m_mode == FILESYSTEM_MODE) {
       return getPayloadAsStringFS(hash);
     }
 
-    std::string current_path = s_PATH + s_PAYLOAD_PATH + '/' + hash + "?format=BLOB";
+    std::string current_path = s_PATH;
+    current_path += s_PAYLOAD_PATH;
+    current_path += '/';
+    current_path += hash;
+    current_path += "?format=BLOB";
 
     std::string retv;
 
@@ -868,7 +1003,7 @@ namespace Crest {
   }
 
   void CrestClient::createPayload(nlohmann::json& js) {
-    std::string method_name = "CrestClient::createPayload";
+    const char* method_name = "CrestClient::createPayload";
 
     checkFsException(method_name);
 
@@ -882,19 +1017,19 @@ namespace Crest {
 // METHODS to store the PAYLOADS in BATCH mode
 
   void CrestClient::storeBatchPayloads(const std::string& tag_name, uint64_t endtime, const std::string& iovsetupload) {
-    std::string method_name = "CrestClient::storeBatchPayloads";
+    const char* method_name = "CrestClient::storeBatchPayloads";
     nlohmann::json js = getJson(iovsetupload, method_name);
     storeBatchPayloads(tag_name, endtime, js);
   }
 
   void CrestClient::storeBatchPayloads(const std::string& tag_name, uint64_t endtime, nlohmann::json& js) {
-    std::string method_name = "CrestClient::storeBatchPayloads";
+    const char* method_name = "CrestClient::storeBatchPayloads";
     if (m_mode == FILESYSTEM_MODE) {
       storeBatchPayloadsFs(tag_name, js);
       return;
     }
     if (!js.is_array()) {
-      throw std::runtime_error("ERROR in " + method_name + " JSON has wrong type (must be array)");
+      throw std::runtime_error("ERROR in " + std::string(method_name) + " JSON has wrong type (must be array)");
     }
 
     nlohmann::json jsObj = {};
@@ -912,7 +1047,7 @@ namespace Crest {
 // FOLDERS
 
   nlohmann::json CrestClient::listFolders() {
-    std::string method_name = "CrestClient::listFolders";
+    const char* method_name = "CrestClient::listFolders";
 
     checkFsException(method_name);
 
@@ -930,7 +1065,7 @@ namespace Crest {
   }
 
   std::string CrestClient::createFolder(nlohmann::json& body) {
-    std::string method_name = "CrestClient::createFolder";
+    const char* method_name = "CrestClient::createFolder";
 
     checkFsException(method_name);
 
@@ -947,7 +1082,7 @@ namespace Crest {
 // RUN INFO
 
   nlohmann::json CrestClient::listRunLumiInfo() {
-    std::string method_name = "CrestClient::listRunLumiInfo";
+    const char* method_name = "CrestClient::listRunLumiInfo";
 
     checkFsException(method_name);
 
@@ -965,7 +1100,7 @@ namespace Crest {
   }
 
   void CrestClient::createRunLumiInfo(nlohmann::json& body) {
-    std::string method_name = "CrestClient::createRunLumiInfo";
+    const char* method_name = "CrestClient::createRunLumiInfo";
 
     checkFsException(method_name);
 
@@ -977,11 +1112,15 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::findRunLumiInfo(urlParameters params) {
-    std::string method_name = "CrestClient::findRunLumiInfo";
+    const char* method_name = "CrestClient::findRunLumiInfo";
 
     checkFsException(method_name);
 
-    std::string current_path = s_PATH + s_RUNINFO_PATH + s_RUNINFO_LIST_PATH + "?" + params.getParams();
+    std::string current_path = s_PATH;
+    current_path += s_RUNINFO_PATH;
+    current_path += s_RUNINFO_LIST_PATH;
+    current_path += '?';
+    current_path += params.getParams();
 
     std::string retv;
 
@@ -1072,7 +1211,7 @@ namespace Crest {
       // data to check the errors in the server response:
       long response_code;
       curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
-      std::string method_name = "CrestClient::storePayload";
+      const char* method_name = "CrestClient::storePayload";
 
       /* always cleanup */
       curl_easy_cleanup(curl);
@@ -1091,7 +1230,7 @@ namespace Crest {
   }
 
   std::string CrestClient::performRequest(const std::string& current_path, Action action, nlohmann::json& js,
-                                          const std::string& method_name) {
+                                          const char* method_name) {
     CURL* curl;
     CURLcode res;
 
@@ -1149,13 +1288,13 @@ namespace Crest {
       return s;
     }
 
-    throw std::runtime_error("ERROR in " + method_name + " | CURL not init");
+    throw std::runtime_error(std::string("ERROR in ") + std::string(method_name) + " | CURL not init");
   }
 
 // REQUEST OLD VERSION
 
   std::string CrestClient::performRequest(const std::string& current_path, Action action, nlohmann::json& js) {
-    std::string method = "Unknown";
+    const char* method = "Unknown";
     return performRequest(current_path, action, js, method);
   }
 
@@ -1286,8 +1425,8 @@ namespace Crest {
 // Request method to store payloads in batch mode
 
   std::string CrestClient::storeBatchPayloadRequest(const std::string& tag, uint64_t endtime, const std::string& js) {
-    std::string current_path = "/crestapi/payloads/storebatch";
-    std::string mes = "ERROR in CrestClient::storeBatchPayloads";
+    std::string_view current_path = "/crestapi/payloads/storebatch";
+    
     CURL* curl;
     CURLcode res;
 
@@ -1299,8 +1438,6 @@ namespace Crest {
     curl_global_init(CURL_GLOBAL_DEFAULT);
     curl = curl_easy_init();
 
-    std::string stt;
-    std::string myst;
     struct curl_slist* headers = NULL;
     if (curl) {
       std::ostringstream url;
@@ -1347,7 +1484,7 @@ namespace Crest {
       // data to check the errors in the server response:
       long response_code;
       curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
-      std::string method_name = "CrestClient::storePayload";
+      const char* method_name = "CrestClient::storePayload";
 
       /* always cleanup */
       curl_easy_cleanup(curl);
@@ -1361,7 +1498,7 @@ namespace Crest {
 
       return s;
     }
-
+    std::string mes = "ERROR in CrestClient::storeBatchPayloads";
     throw std::runtime_error(mes + " | CURL not init");
   }
 
@@ -1371,13 +1508,13 @@ namespace Crest {
 // UTILITIES
 
 
-  nlohmann::json CrestClient::getJson(const std::string& str, const std::string& method) {
+  nlohmann::json CrestClient::getJson(const std::string& str, const char* method) {
     try {
       nlohmann::json js = nlohmann::json::parse(str);
       return js;
     }
     catch (nlohmann::json::parse_error& e) {
-      if (method == "") {
+      if (method==nullptr || *method == '\0') {
         // method name is undefined
 
         std::string wh = e.what();
@@ -1385,7 +1522,7 @@ namespace Crest {
       } else {
         std::string str2 = ParseXMLOutput(str);  // to remove HTML tags use this function
         std::string str3 = removeCR(str2); // to remove carridge return
-        throw std::runtime_error("ERROR in " + method + " | CREST Server response : " + str3);
+        throw std::runtime_error("ERROR in " + std::string(method) + " | CREST Server response : " + str3);
       }
     }
   }
@@ -1396,26 +1533,23 @@ namespace Crest {
 
   // The auxillary method to remove XML/HTML tags from a std::string
 
-  std::string CrestClient::ParseXMLOutput(std::string xmlBuffer) {
+  std::string CrestClient::ParseXMLOutput(std::string_view xmlBuffer) {
     bool copy = true;
 
     std::string plainString = "";
-    std::stringstream convertStream;
 
     // remove all xml tags
     for (long unsigned int i = 0; i < xmlBuffer.length(); i++) {
-      convertStream << xmlBuffer[i];
+      char convertc = xmlBuffer[i];
 
-      if (convertStream.str().compare("<") == 0) copy = false;
-      else if (convertStream.str().compare(">") == 0) {
+      if (convertc == '<') copy = false;
+      else if (convertc == '>') {
         copy = true;
-        convertStream.str(std::string());
         continue;
       }
 
-      if (copy) plainString.append(convertStream.str());
+      if (copy) plainString += convertc;
 
-      convertStream.str(std::string());
     }
 
     return plainString;
@@ -1423,14 +1557,11 @@ namespace Crest {
 
   std::string CrestClient::removeCR(const std::string& str) {
     std::string str2 = str;
-    std::string needle = "\n";
+    std::replace(str2.begin(), str2.end(), '\n', '|');
+    char needle = '\r';
     size_t pos;
     while ((pos = str2.find(needle)) != str2.npos) {
-      str2.replace(pos, 1, "|");
-    }
-    needle = "\r";
-    while ((pos = str2.find(needle)) != str2.npos) {
-      str2.replace(pos, 1, "");
+      str2.erase(pos, 1);
     }
     return str2;
   }
@@ -1446,29 +1577,32 @@ namespace Crest {
   }
 
   void CrestClient::checkResult(CURLcode res, const long response_code, const std::string& st,
-                                const std::string& method_name) {
-    std::string mes = "ERROR in " + method_name + " | ";
-    std::string s = st;
+                                const char* method_name) {
 
     // Bad HTTP response:
 
     if (res != CURLE_OK) {
+      std::string mes = "ERROR in ";
+      mes += method_name;
+      mes += " | ";
       throw std::runtime_error(mes + std::to_string(response_code));
     }
 
     // Errors, decoded from JSON CREST Server messages:
 
-    if (isJson(s)) {
-      nlohmann::json respond = getJson(s);
+    if (isJson(st)) {
+      nlohmann::json respond = getJson(st);
       checkErrors(respond, method_name);
     }
 
     // HTTP response code error interval:
 
     if (response_code >= 400 || response_code == 303) {
-      s = ParseXMLOutput(s);  // to remove HTML tags
+      std::string s = ParseXMLOutput(st);  // to remove HTML tags
       s = removeCR(s);        // to remove end lines and carridge returns
-
+      std::string mes = "ERROR in ";
+      mes += method_name;
+      mes += " | ";
       throw std::runtime_error(mes + "CREST Server response : " + s);
     }
   }
@@ -1509,7 +1643,12 @@ namespace Crest {
 
   nlohmann::json CrestClient::findTagFs(const std::string& name) {
     nlohmann::json js = nullptr;
-    std::string file_path = m_root_folder + '/' + s_FS_TAG_PATH + '/' + name + s_FS_TAG_FILE;
+    std::string file_path = m_root_folder;
+    file_path += '/';
+    file_path += s_FS_TAG_PATH;
+    file_path += '/';
+    file_path += name;
+    file_path += s_FS_TAG_FILE;
     try{
       std::string tag = getFileString(file_path);
       js = nlohmann::json::parse(tag);
@@ -1523,7 +1662,12 @@ namespace Crest {
 
   nlohmann::json CrestClient::findAllIovsFs(const std::string& tagname) {
     nlohmann::json js = nullptr;
-    std::string file_path = m_root_folder + '/' + s_FS_TAG_PATH + '/' + tagname + s_FS_IOV_FILE;
+    std::string file_path = m_root_folder;
+    file_path += '/';
+    file_path += s_FS_TAG_PATH;
+    file_path += '/';
+    file_path += tagname;
+    file_path += s_FS_IOV_FILE;
 
     try{
       std::string tag = getFileString(file_path);
@@ -1538,11 +1682,9 @@ namespace Crest {
 
 // auxillary method to get a file name from hash
   std::string CrestClient::getFileName(const std::string& path) {
-    std::string filename = "";
     int size = path.size();
     int pos = path.find(':');
-    filename = path.substr(pos + 3, size);
-    return filename;
+    return path.substr(pos + 3, size);
   }
 
 // this is test only, later it will be deleted
@@ -1562,8 +1704,8 @@ namespace Crest {
   //==========================================
   // storeBatchPayloadsFs methods
 
-  void CrestClient::storeBatchPayloadsFs(std::string tag_name, std::string& iovsetupload) {
-    std::string method_name = "CrestClient::storeBatchPayloadsFs";
+  void CrestClient::storeBatchPayloadsFs(const std::string &tag_name, std::string& iovsetupload) {
+    const char* method_name = "CrestClient::storeBatchPayloadsFs";
     nlohmann::json js = getJson(iovsetupload, method_name);
     if (!js.is_array()) {
       throw std::runtime_error("ERROR in CrestClient::storeBatchPayloadsFs: JSON has wrong type (must be array");
@@ -1572,8 +1714,8 @@ namespace Crest {
     storeBatchPayloadsFs(tag_name, js);
   }
 
-  void CrestClient::storeBatchPayloadsFs(std::string tag_name, nlohmann::json& js) {
-    std::string method_name = "CrestClient::storeBatchPayloadsFs";
+  void CrestClient::storeBatchPayloadsFs(const std::string &tag_name, nlohmann::json& js) {
+    const char* method_name = "CrestClient::storeBatchPayloadsFs";
 
     try {
       for (auto& kvp : js) {
@@ -1583,7 +1725,7 @@ namespace Crest {
       }
     } // end of try
     catch (...) {
-      throw std::runtime_error("ERROR in " + method_name + " cannot store the data in a file");
+      throw std::runtime_error("ERROR in " + std::string(method_name) + " cannot store the data in a file");
     } // end of catch
     flush();
   }
@@ -1591,32 +1733,33 @@ namespace Crest {
   // storeBatchPayloadsFs (end)
 
 
-  std::string CrestClient::getEnvA(const std::string& varname) {
+  std::string CrestClient::getEnvA(const char* varname) {
     std::string respond = "";
 
     char* pPath;
-    const char* c = varname.data();
+    const char* c = varname;
     pPath = std::getenv(c);
     if (pPath != NULL) respond = std::string(pPath);
     return respond;
   }
 
   std::string CrestClient::getDataPath() {
-    std::string varName = "DAT_PATH";
-    std::string respond = getEnvA(varName) + "/data/crestapi";
+    const char* varName = "DAT_PATH";
+    std::string respond = getEnvA(varName);
+    respond += "/data/crestapi";
     return respond;
   }
 
-  int CrestClient::checkErrors(const nlohmann::json& js, const std::string& method) {
+  int CrestClient::checkErrors(const nlohmann::json& js, const char* method) {
     int result = 0;
     auto res = js.find("type");
 
     if (res != js.end()) {
       std::string type = js.value("type", " unknown type ");
-      std::string message = js.value("message", " unknown message ");
       if (type == "error" || type == "info") {
+        std::string message = js.value("message", " unknown message ");
         result = 1;
-        throw std::runtime_error("ERROR in " + method + " | CREST response: " + message);
+        throw std::runtime_error("ERROR in " + std::string(method) + " | CREST response: " + message);
       }
     } else {
       result = 0;
@@ -1624,9 +1767,9 @@ namespace Crest {
     return result;
   }
 
-  void CrestClient::checkFsException(std::string& method_name) {
+  void CrestClient::checkFsException(const char* method_name) {
     if (m_mode == FILESYSTEM_MODE) {
-      throw std::runtime_error("ERROR in " + method_name + " This methods is unsupported for FILESYSTEM mode");
+      throw std::runtime_error("ERROR in " + std::string(method_name) + " This methods is unsupported for FILESYSTEM mode");
     }
     return;
   }
@@ -1655,9 +1798,9 @@ namespace Crest {
     std::string result = "";
     int array_length = js.size();
     for (int i = 0; i < array_length; i++) {
-      nlohmann::json elem = js[i];
-      if (elem.find(name) != elem.end()) {
-        return elem[name];
+      const nlohmann::json &elem = js[i];
+      if (auto itr = elem.find(name); itr != elem.end()) {
+        return *itr;
       }
     }
     return result;
@@ -1665,7 +1808,7 @@ namespace Crest {
 
   nlohmann::json CrestClient::convertTagMetaInfo2IOVDbSvc(nlohmann::json& js) {
     std::string jsName = "tagInfo";
-    std::string method_name = "CrestClient::convertTagMetaInfo2IOVDbSvc";
+    const char*  method_name = "CrestClient::convertTagMetaInfo2IOVDbSvc";
     nlohmann::json res = getJson(js[jsName], method_name);
     return res;
   }
@@ -1676,7 +1819,7 @@ namespace Crest {
     std::string tagInfo = js.dump();
 
     nlohmann::json result;
-    result["tagInfo"] = tagInfo;
+    result["tagInfo"] = std::move(tagInfo);
     result["description"] = "none";
 
     std::string node_desc = js["node_description"];
@@ -1686,7 +1829,7 @@ namespace Crest {
     result["chansize"] = chan_size;
 
     try{
-      colsize = split(payload_spec, ",").size();
+      colsize = split(payload_spec, ',').size();
     }
     catch (...) {
       colsize = 0;
@@ -1697,15 +1840,15 @@ namespace Crest {
     return result;
   }
 
-  std::vector<std::string> CrestClient::split(const std::string& str, const std::string& delim) {
+  std::vector<std::string> CrestClient::split(std::string_view str, char delim) {
     std::vector<std::string> tokens;
     std::size_t prev = 0, pos = 0;
     do {
       pos = str.find(delim, prev);
       if (pos == std::string::npos) pos = str.length();
-      std::string token = str.substr(prev, pos - prev);
-      if (!token.empty()) tokens.push_back(token);
-      prev = pos + delim.length();
+      std::string_view token = str.substr(prev, pos - prev);
+      if (!token.empty()) tokens.emplace_back(token);
+      prev = pos + 1;
     } while (pos < str.length() && prev < str.length());
     return tokens;
   }
@@ -1713,7 +1856,7 @@ namespace Crest {
 // Tag Meta Info Methods
 
   void CrestClient::createTagMetaInfo(nlohmann::json& js) {
-    std::string method_name = "CrestClient::createTagMetaInfo";
+    const char* method_name = "CrestClient::createTagMetaInfo";
 
     if (m_mode == FILESYSTEM_MODE) {
       createTagMetaInfoFs(js);
@@ -1729,7 +1872,11 @@ namespace Crest {
               "ERROR in CrestClient::createTagMetaInfo cannot get the tag name from tag meta info JSON.");
     }
 
-    std::string current_path = s_PATH + s_TAG_PATH + '/' + tagname + s_META_PATH;
+    std::string current_path = s_PATH;
+    current_path += s_TAG_PATH;
+    current_path += '/';
+    current_path += tagname;
+    current_path += s_META_PATH;
 
     std::string retv;
 
@@ -1739,7 +1886,7 @@ namespace Crest {
   }
 
   void CrestClient::createTagMetaInfo(const std::string& tagname, nlohmann::json& js) {
-    std::string method_name = "CrestClient::createTagMetaInfo";
+    //const char* method_name = "CrestClient::createTagMetaInfo";
     std::string name = js["tagName"];
     if (tagname != name) {
       throw std::runtime_error("ERROR in CrestClient::createTagMetaInfo tagname in method and in JSON are different.");
@@ -1749,14 +1896,17 @@ namespace Crest {
   }
 
   nlohmann::json CrestClient::getTagMetaInfo(const std::string& tagname) {
-    std::string method_name = "CrestClient::getTagMetaInfo";
+    const char* method_name = "CrestClient::getTagMetaInfo";
 
     if (m_mode == FILESYSTEM_MODE) {
       return getTagMetaInfoFs(tagname);
     }
 
-    std::string current_path = s_PATH + s_TAG_PATH + '/' + tagname + s_META_PATH;
-    std::string getTxt = "GET";
+    std::string current_path = s_PATH;
+    current_path += s_TAG_PATH;
+    current_path += '/';
+    current_path += tagname;
+    current_path += s_META_PATH;
 
     std::string retv;
 
@@ -1769,7 +1919,7 @@ namespace Crest {
   }
 
   void CrestClient::updateTagMetaInfo(nlohmann::json& js) {
-    std::string method_name = "CrestClient::updateTagMetaInfo";
+    const char* method_name = "CrestClient::updateTagMetaInfo";
 
 
 
@@ -1796,7 +1946,7 @@ namespace Crest {
   }
 
   void CrestClient::updateTagMetaInfo(const std::string& tagname, nlohmann::json& js) {
-    std::string method_name = "CrestClient::updateTagMetaInfo";
+    const char* method_name = "CrestClient::updateTagMetaInfo";
 
     if (m_mode == FILESYSTEM_MODE) {
       std::string name = "";
@@ -1826,7 +1976,7 @@ namespace Crest {
 // Tag Meta Info Methods (IOVDbSvc format)
 
   nlohmann::json CrestClient::getTagMetaInfoIOVDbSvc(const std::string& tagname) {
-    std::string method_name = "CrestClient::updateTagMetaInfo";
+    const char* method_name = "CrestClient::updateTagMetaInfo";
 
     checkFsException(method_name);
 
@@ -1840,7 +1990,7 @@ namespace Crest {
   }
 
   void CrestClient::createTagMetaInfoIOVDbSvc(const std::string& tagname, nlohmann::json& js) {
-    std::string method_name = "CrestClient::createTagMetaInfoIOVDbSvc";
+    const char* method_name = "CrestClient::createTagMetaInfoIOVDbSvc";
 
     checkFsException(method_name);
 
@@ -1854,7 +2004,7 @@ namespace Crest {
 
   void CrestClient::createTagMetaInfoIOVDbSvc(const std::string& tagname, nlohmann::json& js,
                                               const std::string& description) {
-    std::string method_name = "CrestClient::createTagMetaInfoIOVDbSvc";
+    const char* method_name = "CrestClient::createTagMetaInfoIOVDbSvc";
 
     checkFsException(method_name);
 
@@ -1878,8 +2028,12 @@ namespace Crest {
       throw std::runtime_error(
               "ERROR in CrestClient::createTagMetaInfoFs cannot get the tag name from tag meta info JSON.");
     }
-    std::string workDir = m_root_folder + s_FS_TAG_PATH + '/' + name;
-    std::string tagMetaFile = workDir + s_FS_TAGMETAINFO_FILE;
+    std::string workDir = m_root_folder;
+    workDir += s_FS_TAG_PATH;
+    workDir += '/';
+    workDir += name;
+    std::string tagMetaFile = workDir;
+    tagMetaFile += s_FS_TAGMETAINFO_FILE;
 
     if (!std::filesystem::exists(std::filesystem::path(workDir))) {
       std::filesystem::create_directory(std::filesystem::path(workDir));
@@ -1902,7 +2056,11 @@ namespace Crest {
 
   nlohmann::json CrestClient::getTagMetaInfoFs(const std::string& name) {
     nlohmann::json js = nullptr;
-    std::string file_path = m_root_folder + s_FS_TAG_PATH + '/' + name + s_FS_TAGMETAINFO_FILE;
+    std::string file_path = m_root_folder;
+    file_path+= s_FS_TAG_PATH;
+    file_path += '/';
+    file_path += name;
+    file_path += s_FS_TAGMETAINFO_FILE;
     try{
       std::string tag = getFileString(file_path);
       js = nlohmann::json::parse(tag);
@@ -1965,9 +2123,13 @@ namespace Crest {
       throw std::runtime_error("ERROR in CrestClient::createGlobalTagFs: cannot get the global tag name from JSON.");
     }
 
-    std::string gTagDir = m_root_folder + s_FS_GLOBALTAG_PATH;
-    std::string workDir = gTagDir + '/' + name;
-    std::string globalTagFile = workDir + s_FS_GLOBALTAG_FILE;
+    std::string gTagDir = m_root_folder;
+    gTagDir += s_FS_GLOBALTAG_PATH;
+    std::string workDir = gTagDir;
+    workDir + '/';
+    workDir += name;
+    std::string globalTagFile = workDir;
+    globalTagFile += s_FS_GLOBALTAG_FILE;
 
 
     if (!std::filesystem::exists(std::filesystem::path(gTagDir))) {
@@ -1997,8 +2159,12 @@ namespace Crest {
     nlohmann::json js = nullptr;
 
 
-    std::string workDir = m_root_folder + s_FS_GLOBALTAG_PATH + '/' + name;
-    std::string file_path = workDir + s_FS_GLOBALTAG_FILE;
+    std::string workDir = m_root_folder;
+    workDir += s_FS_GLOBALTAG_PATH;
+    workDir += '/';
+    workDir += name;
+    std::string file_path = workDir;
+    file_path += s_FS_GLOBALTAG_FILE;
 
     try{
       std::string tag = getFileString(file_path);
@@ -2031,11 +2197,15 @@ namespace Crest {
       throw std::runtime_error("ERROR in CrestClient::createGlobalTagMapFs: cannot get the tag name from JSON.");
     }
 
-    std::string fname = '/' + tagname + ".json";
+    std::string fname = "/";
+    fname += tagname;
+    fname += ".json";
 
 
     std::string gTagDir = m_root_folder + s_FS_GLOBALTAG_PATH;
-    std::string workDir = gTagDir + '/' + name;
+    std::string workDir = gTagDir;
+    workDir += '/';
+    workDir += name;
 
 
     if (!std::filesystem::exists(std::filesystem::path(workDir))) {
@@ -2059,7 +2229,7 @@ namespace Crest {
         // the file storage contains the record of the global tag map:
         int m = cathalogue.size();
         for (int i = 0; i < m; i++) {
-          std::string tn = cathalogue[i]["tagName"];
+          const std::string &tn = cathalogue[i]["tagName"];
           if (tn == tagname) {
             cathalogue.erase(i);
           }
@@ -2095,7 +2265,10 @@ namespace Crest {
     nlohmann::json js = nullptr;
 
     std::string workDir = m_root_folder + s_FS_GLOBALTAG_PATH;
-    std::string file_path = workDir + '/' + name + s_FS_MAP_FILE;
+    std::string file_path = workDir;
+    file_path += '/';
+    file_path += name;
+    file_path += s_FS_MAP_FILE;
 
     try{
       std::string tag = getFileString(file_path);
@@ -2117,7 +2290,7 @@ namespace Crest {
   // Store Payload FS methods:
 
 
-  std::string CrestClient::getHash(std::string str) {
+  std::string CrestClient::getHash(std::string_view str) {
     std::string hash_hex_str = picosha2::hash256_hex_string(str.begin(), str.end());
     return hash_hex_str;
   }
@@ -2129,7 +2302,9 @@ namespace Crest {
 
     // payload file:
     std::string hashCode = getHash(js);
-    std::string workDir = m_data_folder + '/' + hashCode;
+    std::string workDir = m_data_folder;
+    workDir += '/';
+    workDir += hashCode;
     if (!std::filesystem::exists(std::filesystem::path(workDir))) {
       std::filesystem::create_directory(std::filesystem::path(workDir));
     }
@@ -2196,7 +2371,9 @@ namespace Crest {
   }
 
   std::string CrestClient::getPayloadAsStringFS(const std::string& hash) {
-    std::string workDir = m_data_folder + '/' + hash;
+    std::string workDir = m_data_folder;
+    workDir += '/';
+    workDir += hash;
     std::string filePath = workDir + "/payload.json";
     std::string res = "";
 
diff --git a/Trigger/TrigMonitoring/TrigHLTMonitoring/src/HLTMonTool.cxx b/Trigger/TrigMonitoring/TrigHLTMonitoring/src/HLTMonTool.cxx
index feb66e95d5a4..4ab042fca079 100755
--- a/Trigger/TrigMonitoring/TrigHLTMonitoring/src/HLTMonTool.cxx
+++ b/Trigger/TrigMonitoring/TrigHLTMonitoring/src/HLTMonTool.cxx
@@ -492,8 +492,8 @@ StatusCode HLTMonTool::fillForChain(const std::string& chain){
  
   // christos (Nov-14): is there a reason to still check these flags???
   unsigned int cond = isHLTChain ? TrigDefs::EF_passedRaw : TrigDefs::L2_passedRaw;
-  results["RAW"] = getTDT()->isPassed(chain, cond);
-  results["PS"] = results["RAW"] && (getTDT()->getPrescale(chain) != 1);
+  bool raw = results["RAW"] = getTDT()->isPassed(chain, cond);
+  results["PS"] = raw && (getTDT()->getPrescale(chain) != 1);
   results["PT"] = getTDT()->isPassed(chain, TrigDefs::eventAccepted);
   
   //set up iterators and such
-- 
GitLab


From 3d7b062fcec62245acda7eec92f7b4bcb5cd88a3 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 9 Sep 2021 22:27:29 -0400
Subject: [PATCH 243/347] AthOnnxruntimeService: cmake fix

AthOnnxruntimeServiceLib is not an interface-only library.
---
 Control/AthOnnxruntimeService/CMakeLists.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Control/AthOnnxruntimeService/CMakeLists.txt b/Control/AthOnnxruntimeService/CMakeLists.txt
index ae172540d4d5..ea7ee02c224c 100644
--- a/Control/AthOnnxruntimeService/CMakeLists.txt
+++ b/Control/AthOnnxruntimeService/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's name.
 atlas_subdir( AthOnnxruntimeService )
@@ -9,7 +9,6 @@ find_package( onnxruntime )
 # Component(s) in the package.
 atlas_add_library( AthOnnxruntimeServiceLib
    AthOnnxruntimeService/*.h Root/*.cxx
-   INTERFACE
    PUBLIC_HEADERS AthOnnxruntimeService
    INCLUDE_DIRS ${ONNXRUNTIME_INCLUDE_DIRS}
    LINK_LIBRARIES ${ONNXRUNTIME_LIBRARIES} AsgServicesLib)
-- 
GitLab


From b28391ecfb7ebb79017d7c46ae37b43a44b14ac3 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 17 Sep 2021 16:45:11 -0400
Subject: [PATCH 244/347] InDetAlignmentMonitoring: Capture return of
 getHolesOnTrack in a unique_ptr.

Good practice, and also needed for compatibility with upcoming debugging
changes to try to track down ATLASRECTS-6331.
---
 .../InDetAlignmentMonitoring/src/IDAlignMonEfficiencies.cxx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonEfficiencies.cxx b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonEfficiencies.cxx
index 0e7359a72133..2867debb7844 100644
--- a/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonEfficiencies.cxx
+++ b/InnerDetector/InDetMonitoring/InDetAlignmentMonitoring/src/IDAlignMonEfficiencies.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
  */
 
 // **********************************************************************
@@ -1320,9 +1320,8 @@ StatusCode IDAlignMonEfficiencies::fillHistograms() {
     } // TSOS on track
     ATH_MSG_DEBUG(" End of loop on TSOS of track " << nTrackCount << "  Now searching for holes ");
 
-    const DataVector<const Trk::TrackStateOnSurface>* HTSOS;
     if (m_holeSearchTool != 0) {
-      HTSOS = m_holeSearchTool->getHolesOnTrack(**trksItr);
+      std::unique_ptr<const Trk::TrackStates> HTSOS (m_holeSearchTool->getHolesOnTrack(**trksItr));
       ATH_MSG_DEBUG(" -- Hole TSOS collection has size " << HTSOS->size());
       DataVector<const Trk::TrackStateOnSurface>::const_iterator HTSOSItr = HTSOS->begin();
       DataVector<const Trk::TrackStateOnSurface>::const_iterator HTSOSItrE = HTSOS->end();
@@ -1586,7 +1585,6 @@ StatusCode IDAlignMonEfficiencies::fillHistograms() {
         } // holes as measurements (?)
       }
       ATH_MSG_DEBUG("end of loop on " << HTSOS->size() << " holes ");
-      delete HTSOS;
     } // hole tool exists
   }
   ATH_MSG_DEBUG("end of loop on " << nTrackCount << " tracks ok");
-- 
GitLab


From c2560f84ee78fb27d3f9ff54018701254c9d598e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 17 Sep 2021 17:08:15 -0400
Subject: [PATCH 245/347] InDetTrackValidation: Capture return of
 getHolesOnTrack in a unique_ptr.

Good practice, and also needed for compatibility with upcoming debugging
changes to try to track down ATLASRECTS-6331.
---
 .../InDetTrackValidation/src/HoleSearchValidation.cxx        | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetValidation/InDetTrackValidation/src/HoleSearchValidation.cxx b/InnerDetector/InDetValidation/InDetTrackValidation/src/HoleSearchValidation.cxx
index c6a5c871e070..4111ebdb4b2b 100755
--- a/InnerDetector/InDetValidation/InDetTrackValidation/src/HoleSearchValidation.cxx
+++ b/InnerDetector/InDetValidation/InDetTrackValidation/src/HoleSearchValidation.cxx
@@ -482,8 +482,8 @@ unsigned int HoleSearchValidation::doHoleSearch( const Trk::Track* track) const
   ATH_MSG_VERBOSE(  "start hole search for track ( " << track << ")" ) ;
   unsigned int nHoles(0);
 
-  const DataVector<const Trk::TrackStateOnSurface>* holesOnTrack 
-    = m_holeSearchTool->getHolesOnTrack(*track, track->info().particleHypothesis());
+  std::unique_ptr<const Trk::TrackStates> holesOnTrack
+    (m_holeSearchTool->getHolesOnTrack(*track, track->info().particleHypothesis()));
   // loop over holes
   if (!holesOnTrack) {
     ATH_MSG_WARNING(  "HoleSearchTool returned NULL !" ) ;
@@ -501,7 +501,6 @@ unsigned int HoleSearchValidation::doHoleSearch( const Trk::Track* track) const
       printInfoTSoS( *it );
     } // end loop on holes
   }
-  delete holesOnTrack;
   return nHoles;
 }
 
-- 
GitLab


From 4f5cd80e6e7fab657ffa9ae86d7978ec6c16c54e Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 17 Sep 2021 15:28:20 -0400
Subject: [PATCH 246/347] TRT_CalibAlgs: Capture return of getHolesOnTrack in a
 unique_ptr.

Good practice, and also needed for compatibility with upcoming debugging
changes to try to track down ATLASRECTS-6331.
---
 .../TRT_CalibAlgs/src/TRT_StrawStatus.cxx              | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRT_StrawStatus.cxx b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRT_StrawStatus.cxx
index 601071841ee2..561c1d10cf33 100644
--- a/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRT_StrawStatus.cxx
+++ b/InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/src/TRT_StrawStatus.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -233,13 +233,13 @@ StatusCode InDet::TRT_StrawStatus::execute(){
 
         // add holeIdentifiers - fill vector
 
-        const DataVector<const Trk::TrackStateOnSurface>* holes = m_trt_hole_finder->getHolesOnTrack( *track );
+        std::unique_ptr<const Trk::TrackStates> holes (m_trt_hole_finder->getHolesOnTrack( *track ));
         if ( holes==0 ) continue; // no holes found
-        for ( DataVector<const Trk::TrackStateOnSurface>::const_iterator trackStatesIt = holes->begin(); trackStatesIt != holes->end(); ++trackStatesIt ) {
+        for (const Trk::TrackStateOnSurface* trackStates : *holes) {
 
-            if ( !(*trackStatesIt)->type(   Trk::TrackStateOnSurface::Hole  )  ) { ATH_MSG_ERROR( "m_trt_hole_finder returned something that is not a hole" ); continue; }
+            if ( !trackStates->type(   Trk::TrackStateOnSurface::Hole  )  ) { ATH_MSG_ERROR( "m_trt_hole_finder returned something that is not a hole" ); continue; }
 
-            const Trk::TrackParameters* track_parameters = (*trackStatesIt)->trackParameters();
+            const Trk::TrackParameters* track_parameters = trackStates->trackParameters();
             if (!track_parameters) { ATH_MSG_WARNING( "m_trt_hole_finder track_parameters missing" ); continue; }
 
             Identifier id = track_parameters->associatedSurface().associatedDetectorElementIdentifier();
-- 
GitLab


From a198d119bc093611ebd6a6e9dbb666867c242692 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 17 Sep 2021 17:34:36 -0400
Subject: [PATCH 247/347] TrkValTools: Capture return of getHolesOnTrack in a
 unique_ptr.

Good practice, and also needed for compatibility with upcoming debugging
changes to try to track down ATLASRECTS-6331.
---
 .../TrkValTools/src/MeasurementVectorNtupleTool.cxx           | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Tracking/TrkValidation/TrkValTools/src/MeasurementVectorNtupleTool.cxx b/Tracking/TrkValidation/TrkValTools/src/MeasurementVectorNtupleTool.cxx
index ba82392cce00..59bd35f50dc0 100644
--- a/Tracking/TrkValidation/TrkValTools/src/MeasurementVectorNtupleTool.cxx
+++ b/Tracking/TrkValidation/TrkValTools/src/MeasurementVectorNtupleTool.cxx
@@ -559,7 +559,7 @@ StatusCode Trk::MeasurementVectorNtupleTool::fillTrackData (
   //----------------------------------------------
   // do hole search if selected
   if (m_doHoleSearch) {
-    const DataVector<const Trk::TrackStateOnSurface>* holesOnTrack = m_holeSearchTool->getHolesOnTrack(track, track.info().particleHypothesis());
+    std::unique_ptr<const Trk::TrackStates> holesOnTrack (m_holeSearchTool->getHolesOnTrack(track, track.info().particleHypothesis()));
     // loop over holes
     if (!holesOnTrack) {
       msg(MSG::WARNING) << "Got no holes on track" << endmsg;
@@ -576,8 +576,6 @@ StatusCode Trk::MeasurementVectorNtupleTool::fillTrackData (
         msg(MSG::WARNING) << "info about TrackState (hole) could not be written to ntuple" << endmsg;
       }
     } // end loop on holes
-    delete holesOnTrack;
-    holesOnTrack = nullptr;
   }
 
   return StatusCode::SUCCESS;
-- 
GitLab


From 0810f0b6ae005940ea149fec78a0d102b58ce46d Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 10 Aug 2021 15:19:24 -0400
Subject: [PATCH 248/347] AthContainers: Allow customizing DV object deletion.

Add a mechanism to DataVector to customize how objects are deleted.
This is done by a polymorphic Deleter interface.

The goal here is to be able to use an alternate memory allocator
for the objects in a DV.  But for compatibility and other reasons,
we don't want to change the DV types themselves, which is why this
is done via a polymorphic interface.
---
 .../AthContainers/AthContainers/DataVector.h  |  70 ++++++++++
 .../AthContainers/DataVector.icc              | 125 +++++++++++++++---
 Control/AthContainers/CMakeLists.txt          |   2 +-
 .../AthContainers/test/DataVector_test.icc    |  88 ++++++++++++
 4 files changed, 269 insertions(+), 16 deletions(-)

diff --git a/Control/AthContainers/AthContainers/DataVector.h b/Control/AthContainers/AthContainers/DataVector.h
index 37e4ae0a045e..9bc8775a4384 100644
--- a/Control/AthContainers/AthContainers/DataVector.h
+++ b/Control/AthContainers/AthContainers/DataVector.h
@@ -837,6 +837,9 @@ public:
   typedef DataVector base_data_vector;
 
 
+  using Deleter = typename BASE::Deleter;
+
+
   //========================================================================
   /** @name Constructors, destructors, assignment. */
   //@{
@@ -1710,6 +1713,20 @@ public:
               SG::IndexTrackingPolicy trackIndices);
 
 
+  /**
+   * @brief Erase all the elements in the collection, and change 
+   *        how elements are to be deleted.
+   * @param deleter Object to be used to delete object.
+   *                Passing nullptr will change back to the default.
+   *
+   * If the container owns its elements, then the removed elements
+   * will be deleted.  Any duplicates will be removed in this process,
+   * but don't rely on this.
+   * After the current elements are deleted, the Deleter object is changed.
+   */
+  void clear (std::unique_ptr<Deleter> deleter);
+
+
   /**
    * @brief Return the DV/DL info struct for this class.
    *
@@ -2046,6 +2063,22 @@ public:
 
   typedef DataVector base_data_vector;
 
+
+  /**
+   * @brief Interface to allow customizing how elements are to be deleted.
+   */
+  class Deleter
+  {
+  public:
+    using value_type = DataVector::value_type;
+    using PtrVector = DataVector::PtrVector;
+    virtual ~Deleter() = default;
+    virtual void doDelete (value_type p) = 0;
+    virtual void doDelete (typename PtrVector::iterator first,
+                           typename PtrVector::iterator last) = 0;
+  };
+
+
   //========================================================================
   /** @name Constructors, destructors, assignment. */
   //@{
@@ -2920,6 +2953,20 @@ public:
               SG::IndexTrackingPolicy trackIndices);
 
 
+  /**
+   * @brief Erase all the elements in the collection, and change 
+   *        how elements are to be deleted.
+   * @param deleter Object to be used to delete object.
+   *                Passing nullptr will change back to the default.
+   *
+   * If the container owns its elements, then the removed elements
+   * will be deleted.  Any duplicates will be removed in this process,
+   * but don't rely on this.
+   * After the current elements are deleted, the Deleter object is changed.
+   */
+  void clear (std::unique_ptr<Deleter> deleter);
+
+
   /**
    * @brief Return the DV/DL info struct for this class.
    *
@@ -3146,6 +3193,22 @@ protected:
              typename PtrVector::iterator last);
 
 
+  /**
+   * @brief Delete an element
+   * @param p The element to delete.
+   */
+  void doDelete (value_type p);
+
+
+  /**
+   * @brief Delete a range of elements
+   * @param first Start of range to delete.
+   * @param last End of range to delete.
+   */
+  void doDelete (typename PtrVector::iterator first,
+                 typename PtrVector::iterator last);
+
+
 protected:
   /// The ownership policy of this container ---
   /// either SG::OWNS_ELEMENTS or SG::VIEW_ELEMENTS.
@@ -3154,6 +3217,12 @@ protected:
   /// This actually holds the elements.
   PtrVector m_pCont;
 
+  /// Interface telling us how to delete objects.
+  /// If null, just use the C++ default.
+  // This should really be a unique_ptr --- but that causes problems
+  // with ROOT persistency (even though this is tagged as transient).
+  Deleter* m_deleter = nullptr;
+
 
   /**
    * @brief Clear @c m_isMostDerived for this instance and for all bases.
@@ -3261,6 +3330,7 @@ public:
 #endif  
    /// Declare the automatically created variable transient
    ROOT_SELECTION_NS::MemberAttributes< kTransient > m_isMostDerived;
+   ROOT_SELECTION_NS::MemberAttributes< kTransient > m_deleter;
 
 };
 
diff --git a/Control/AthContainers/AthContainers/DataVector.icc b/Control/AthContainers/AthContainers/DataVector.icc
index 59db0982ae16..b5518a0624ad 100644
--- a/Control/AthContainers/AthContainers/DataVector.icc
+++ b/Control/AthContainers/AthContainers/DataVector.icc
@@ -77,6 +77,7 @@ struct VirtBases<B1, DataModel_detail::NoBase, DataModel_detail::NoBase>
   typedef typename DataVector<B1>::size_type size_type;
   typedef typename DataVector<B1>::difference_type difference_type;
   typedef typename DataVector<B1>::allocator_type allocator_type;
+  typedef typename DataVector<B1>::Deleter Deleter;
 
   // We're using virtual derivation.
   static const bool has_virtual = true;
@@ -154,6 +155,7 @@ struct VirtBases<B1, B2, DataModel_detail::NoBase>
   typedef typename DataVector<B1>::size_type size_type;
   typedef typename DataVector<B1>::difference_type difference_type;
   typedef typename DataVector<B1>::allocator_type allocator_type;
+  typedef typename DataVector<B1>::Deleter Deleter;
 
   // We're using virtual derivation.
   static const bool has_virtual = true;
@@ -240,6 +242,7 @@ struct VirtBases
   typedef typename DataVector<B1>::size_type size_type;
   typedef typename DataVector<B1>::difference_type difference_type;
   typedef typename DataVector<B1>::allocator_type allocator_type;
+  typedef typename DataVector<B1>::Deleter Deleter;
 
   // We're using virtual derivation.
   static const bool has_virtual = true;
@@ -409,6 +412,8 @@ DataVector<T, BASE>::DataVector (DataVector&& rhs) noexcept
   SG::AuxVectorBase::operator= (std::move (rhs));
   this->m_ownPolicy = rhs.m_ownPolicy;
   this->m_pCont = std::move (rhs.m_pCont);
+  this->m_deleter = std::move(rhs.m_deleter);
+  rhs.m_deleter = nullptr;
 
   // Need to reset the container pointer on elements.
   this->setIndices (this->begin(), this->end());
@@ -551,6 +556,10 @@ DataVector<T, BASE>::operator= (DataVector<T, BASE>&& rhs) noexcept
     this->m_ownPolicy = rhs.m_ownPolicy;
     this->m_pCont = std::move (rhs.m_pCont);
 
+    delete this->m_deleter;
+    this->m_deleter = std::move(rhs.m_deleter);
+    rhs.m_deleter = nullptr;
+
     // Need to reset the container pointer on elements.
     this->setIndices (this->begin(), this->end());
   }
@@ -1369,7 +1378,7 @@ void DataVector<T, BASE>::pop_back()
 {
   if (!this->m_pCont.empty()) {
     if (this->m_ownPolicy == SG::OWN_ELEMENTS)
-      delete this->m_pCont.back();
+      this->doDelete (this->m_pCont.back());
     else
       this->clearIndex (iterator (this->m_pCont.end() - 1, this));
     this->m_pCont.pop_back();
@@ -1420,6 +1429,7 @@ void DataVector<T, BASE>::swap(DataVector& rhs)
   std::swap(this->m_ownPolicy, rhs.m_ownPolicy);
   SG::AuxVectorBase::swap (rhs);
   this->m_pCont.swap(rhs.m_pCont);
+  std::swap (this->m_deleter, rhs.m_deleter);
   this->setIndices (this->begin(), this->end());
   rhs.setIndices (rhs.begin(), rhs.end());
 }
@@ -1670,6 +1680,26 @@ const DataModel_detail::DVLInfoBase& DataVector<T, BASE>::dvlinfo()
 }
 
 
+/**
+ * @brief Erase all the elements in the collection, and change 
+ *        how elements are to be deleted.
+ * @param deleter Object to be used to delete object.
+ *                Passing nullptr will change back to the default.
+ *
+ * If the container owns its elements, then the removed elements
+ * will be deleted.  Any duplicates will be removed in this process,
+ * but don't rely on this.
+ * After the current elements are deleted, the Deleter object is changed.
+ */
+template <class T, class BASE>
+void DataVector<T, BASE>::clear (std::unique_ptr<Deleter> deleter)
+{
+  this->clear();
+  delete this->m_deleter;
+  this->m_deleter = deleter.release();
+}
+
+
 /**
  * @brief Return the DV/DL info struct for this class.
  *
@@ -1815,7 +1845,7 @@ void DataVector<T, BASE>::assignElement (typename BaseContainer::iterator pos,
 {
   testInsert ("assignElement");
   if (this->m_ownPolicy == SG::OWN_ELEMENTS)
-    delete *pos;
+    this->doDelete (*pos);
   else
     this->clearIndex (iterator (pos, this));
   *pos = newElem;
@@ -1841,7 +1871,7 @@ DataVector<T, BASE>::assignElement (typename BaseContainer::iterator pos,
     SG::throwExcNonowningContainer();
 
   testInsert ("assignElement");
-  delete *pos;
+  this->doDelete (*pos);
   value_type ptr = newElem.release();
   *pos = ptr;
   this->moveAux (pos - this->m_pCont.begin(), ptr);
@@ -1863,7 +1893,7 @@ DataVector<T, BASE>::assignBaseElement (typename BaseContainer::iterator pos,
 {
   testInsert ("assignBaseElement");
   if (this->m_ownPolicy == SG::OWN_ELEMENTS)
-    delete *pos;
+    this->doDelete (*pos);
   else
     this->clearIndex (iterator (pos, this));
   *pos = newElem;
@@ -2058,6 +2088,9 @@ DATAVECTOR::DataVector(DataVector&& rhs) noexcept
     m_ownPolicy(rhs.m_ownPolicy),
     m_pCont(std::move (rhs.m_pCont))
 {
+  m_deleter = std::move(rhs.m_deleter);
+  rhs.m_deleter = nullptr;
+
   // Need to reset the container pointer on elements.
   this->setIndices (this->begin(), this->end());
 
@@ -2172,6 +2205,10 @@ DATAVECTOR& DATAVECTOR::operator= (DATAVECTOR&& rhs) noexcept
     this->m_ownPolicy = rhs.m_ownPolicy;
     this->m_pCont = std::move (rhs.m_pCont);
 
+    delete this->m_deleter;
+    this->m_deleter = std::move(rhs.m_deleter);
+    rhs.m_deleter = nullptr;
+
     // Need to reset the container pointer on elements.
     this->setIndices (this->begin(), this->end());
   }
@@ -2250,10 +2287,9 @@ DATAVECTOR::~DataVector()
   if (m_ownPolicy == SG::OWN_ELEMENTS) {
     typename PtrVector::iterator new_end =
       DataVector_detail::remove_duplicates(m_pCont.begin(), m_pCont.end());
-    typename PtrVector::iterator iter = m_pCont.begin();
-    while (iter != new_end)
-      delete *(iter++);
-    }
+    this->doDelete (m_pCont.begin(), new_end);
+  }
+  delete m_deleter;
 }
 
 
@@ -3063,7 +3099,7 @@ void DATAVECTOR::pop_back()
 {
   if (!m_pCont.empty()) {
     if (m_ownPolicy == SG::OWN_ELEMENTS)
-      delete m_pCont.back();
+      this->doDelete (m_pCont.back());
     else
       this->clearIndex (m_pCont.end() - 1);
     m_pCont.pop_back();
@@ -3114,6 +3150,7 @@ void DATAVECTOR::swap(DataVector& rhs)
   std::swap(m_ownPolicy, rhs.m_ownPolicy);
   SG::AuxVectorBase::swap (rhs);
   m_pCont.swap(rhs.m_pCont);
+  std::swap (this->m_deleter, rhs.m_deleter);
   this->setIndices (this->begin(), this->end());
   rhs.setIndices (rhs.begin(), rhs.end());
 }
@@ -3388,6 +3425,27 @@ const DataModel_detail::DVLInfoBase& DATAVECTOR::dvlinfo()
 }
 
 
+/**
+ * @brief Erase all the elements in the collection, and change 
+ *        how elements are to be deleted.
+ * @param deleter Object to be used to delete object.
+ *                (The DataVector does not take ownership.)
+ *                Passing nullptr will change back to the default.
+ *
+ * If the container owns its elements, then the removed elements
+ * will be deleted.  Any duplicates will be removed in this process,
+ * but don't rely on this.
+ * After the current elements are deleted, the Deleter object is changed.
+ */
+template <class T>
+void DATAVECTOR::clear (std::unique_ptr<Deleter> deleter)
+{
+  this->clear();
+  delete this->m_deleter;
+  this->m_deleter = deleter.release();
+}
+
+
 /**
  * @brief Return the DV/DL info struct for this class.
  *
@@ -3492,7 +3550,7 @@ void DATAVECTOR::assignElement (typename BaseContainer::iterator pos,
 {
   testInsert ("assignElement");
   if (this->m_ownPolicy == SG::OWN_ELEMENTS)
-    delete *pos;
+    this->doDelete (*pos);
   else
     this->clearIndex (iterator (pos, this));
   *pos = newElem;
@@ -3518,7 +3576,7 @@ DATAVECTOR::assignElement (typename BaseContainer::iterator pos,
     SG::throwExcNonowningContainer();
 
   testInsert ("assignElement");
-  delete *pos;
+  this->doDelete (*pos);
   value_type ptr = newElem.release();
   *pos = ptr;
   this->moveAux (pos - this->m_pCont.begin(), ptr);
@@ -3539,7 +3597,7 @@ void DATAVECTOR::assignBaseElement (typename BaseContainer::iterator pos,
 {
   testInsert ("assignBaseElement");
   if (this->m_ownPolicy == SG::OWN_ELEMENTS)
-    delete *pos;
+    this->doDelete (*pos);
   else
     this->clearIndex (iterator (pos, this));
   *pos = newElem;
@@ -3624,7 +3682,7 @@ typename DATAVECTOR::PtrVector::iterator
 DATAVECTOR::erase_base(typename PtrVector::iterator position)
 { 
   if (m_ownPolicy == SG::OWN_ELEMENTS && position != m_pCont.end())
-    delete *position;
+    this->doDelete (*position);
   return m_pCont.erase(position);
 }
 
@@ -3649,13 +3707,50 @@ DATAVECTOR::erase_base(typename PtrVector::iterator first,
   if (m_ownPolicy == SG::OWN_ELEMENTS) {
     typename PtrVector::iterator new_end =
       DataVector_detail::remove_duplicates(first, last);
-    typename PtrVector::iterator iter = first;
-    while (iter != new_end) delete *(iter++);
+    this->doDelete (first, new_end);
   }
   return m_pCont.erase(first, last);
 }
 
 
+/**
+ * @brief Delete an element
+ * @param p The element to delete.
+ */
+template <class T>
+inline
+void DATAVECTOR::doDelete (value_type p)
+{
+  if (m_deleter) {
+    m_deleter->doDelete (p);
+  }
+  else {
+    delete p;
+  }
+}
+
+
+/**
+ * @brief Delete a range of elements
+ * @param first Start of range to delete.
+ * @param last End of range to delete.
+ */
+template <class T>
+inline
+void DATAVECTOR::doDelete (typename PtrVector::iterator first,
+                           typename PtrVector::iterator last)
+{
+  if (m_deleter) {
+    m_deleter->doDelete (first, last);
+  }
+  else {
+    for (; first != last; ++first) {
+      delete *first;
+    }
+  }
+}
+
+
 /**
  * @brief Test if we can insert; raise an exception if not.
  * @param op Description of the attempted operation.
diff --git a/Control/AthContainers/CMakeLists.txt b/Control/AthContainers/CMakeLists.txt
index 20179e3c0a41..503a7a5e0e0d 100644
--- a/Control/AthContainers/CMakeLists.txt
+++ b/Control/AthContainers/CMakeLists.txt
@@ -7,7 +7,7 @@ atlas_subdir( AthContainers )
 
 # Extra dependencies, based on the environment we are in:
 if( NOT XAOD_STANDALONE )
-   set( extra_libs AthenaKernel SGTools GaudiKernel )
+   set( extra_libs AthenaKernel AthAllocators SGTools GaudiKernel )
    set( extra_sources src/*.cxx )
 endif()
 
diff --git a/Control/AthContainers/test/DataVector_test.icc b/Control/AthContainers/test/DataVector_test.icc
index 1c6b223e4136..17acce3150d8 100644
--- a/Control/AthContainers/test/DataVector_test.icc
+++ b/Control/AthContainers/test/DataVector_test.icc
@@ -6022,6 +6022,93 @@ void test2_elconversions()
 }
 
 
+template <class DV>
+class TestDeleter
+  : public DV::Deleter
+{
+public:
+  using value_type = typename DV::Deleter::value_type;
+  using PtrVector = typename DV::Deleter::PtrVector;
+
+  TestDeleter (std::vector<int>& the_v) : v(the_v) {}
+
+  virtual void doDelete (value_type p) override
+  {
+    v.push_back (p->x);
+    delete p;
+  }
+  virtual void doDelete (typename PtrVector::iterator first,
+                         typename PtrVector::iterator last) override
+  {
+    for (; first != last; ++first) {
+      v.push_back ((*first)->x);
+      delete *first;
+    }
+  }
+
+  std::vector<int>& v;
+};
+template <class T>
+void test2_deleter1()
+{
+  std::vector<int> v;
+  DataVector<T> dv;
+  dv.clear (std::make_unique<TestDeleter<DataVector<T> > > (v));
+  dv.push_back (new T(1));
+  dv.push_back (new T(2));
+  dv.push_back (new T(3));
+  assert (v.empty());
+  dv.pop_back();
+  assert (v == std::vector<int>{3});
+  v.clear();
+  dv.clear();
+  assert (v == (std::vector<int>{1, 2}));
+}
+
+
+template <class T>
+void test2_deleter2()
+{
+  std::vector<int> v;
+  DataVector<T> dv1;
+  dv1.clear (std::make_unique<TestDeleter<DataVector<T> > > (v));
+  dv1.push_back (new T(1));
+  dv1.push_back (new T(2));
+  dv1.push_back (new T(3));
+
+  DataVector<T> dv2 (std::move (dv1));
+  assert (v.empty());
+  assert (dv1.empty());
+  assert (dv2.size() == 3);
+  dv2.pop_back();
+  assert (v == std::vector<int>{3});
+  v.clear();
+
+  dv1 = std::move (dv2);
+  assert (v.empty());
+  assert (dv1.size() == 2);
+  assert (dv2.empty());
+  dv1.pop_back();
+  assert (v == std::vector<int>{2});
+  v.clear();
+
+  dv1.swap (dv2);
+  assert (v.empty());
+  assert (dv1.empty());
+  assert (dv2.size() == 1);
+  dv2.pop_back();
+  assert (v == std::vector<int>{1});
+}
+
+
+template <class B, class D>
+void test2_deleter()
+{
+  test2_deleter1<B>();
+  test2_deleter1<D>();
+}
+
+
 template <class B, class D>
 void do_test2()
 {
@@ -6084,6 +6171,7 @@ void do_test2()
   test2_move<B,D> ();
   test2_offset<B,D> ();
   test2_elconversions<B,D>();
+  test2_deleter<B,D>();
 }
 
 
-- 
GitLab


From 315163bfb7e3485d94869bf637a5188f0abcbd43 Mon Sep 17 00:00:00 2001
From: Nils Krumnack <krumnack@iastate.edu>
Date: Tue, 21 Sep 2021 18:16:35 -0500
Subject: [PATCH 249/347] fix for python3 print command

Apparently that wasn't used in the repository so far, with nobody
experiencing that it was actually broken.
---
 .../D3PDTools/EventLoopGrid/Root/GridDriver.cxx           | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/PhysicsAnalysis/D3PDTools/EventLoopGrid/Root/GridDriver.cxx b/PhysicsAnalysis/D3PDTools/EventLoopGrid/Root/GridDriver.cxx
index cece8c28defa..2853c5f5a656 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopGrid/Root/GridDriver.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopGrid/Root/GridDriver.cxx
@@ -1016,7 +1016,7 @@ namespace EL {
     const std::string getNickname() {
       const char pyGetNickName[] =
 	"from pandatools import PsubUtils;"
-	"print PsubUtils.getNickname();";
+	"print (PsubUtils.getNickname());";
       return gSystem->GetFromPipe(Form("python -c \"%s\" 2>/dev/null", 
 				       pyGetNickName)).Data();    
     }
@@ -1054,11 +1054,11 @@ namespace EL {
 	<< "            gs.killServer()\n" 
 	<< "            time.sleep(60)\n"      
 	<< "            if not gs.startServer():\n"
-	<< "                print \"Failed to start server\"\n" 
+	<< "                print (\"Failed to start server\")\n" 
 	<< "                exit(0)\n"
-	<< "print gs.sendCmd(\"\"\"\n"
+	<< "print (gs.sendCmd(\"\"\"\n"
 	<< cmd
-	<< "\"\"\")\n"
+	<< "\"\"\"))\n"
 	<< "EOL\n";    
 
       out = gSystem->GetFromPipe(sendCmd.str().c_str()).Data();
-- 
GitLab


From 011bc52caa03d95044f8a99fb1727b9de9b85d42 Mon Sep 17 00:00:00 2001
From: Daniele Zanzi <daniele.zanzi@cern.ch>
Date: Wed, 22 Sep 2021 09:32:32 +0200
Subject: [PATCH 250/347] fix in CTP inputs for pilot run (ATR-22905)

---
 .../TriggerMenuMT/python/L1/Config/CTPInputConfig.py          | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/CTPInputConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/CTPInputConfig.py
index 64d6d1e1b307..415a7cfa6c0d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/CTPInputConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/CTPInputConfig.py
@@ -15,7 +15,7 @@ class CTPInputConfig:
     def cablingLayout():
         inputLayout = odict()
         inputLayout["optical"] = odict([
-            ( "connector0", "MuCTPiOpt0" ),
+            ( "connector0", "Topo3El" ),
             ( "connector1", "Topo1Opt0" ),
             ( "connector2", "Topo1Opt1" ),
             ( "connector3", "Topo1Opt2" ),
@@ -24,7 +24,7 @@ class CTPInputConfig:
         inputLayout["electrical"] = odict([
             ( "connector0", "AlfaCtpin" ),
             ( "connector1", "LegacyTopo0" ),
-            ( "connector2", "Topo3El" )
+            ( "connector2", "MuCTPiOpt0" )
         ])
         inputLayout["ctpin"] = odict()
         inputLayout["ctpin"]["slot7"] = odict([
-- 
GitLab


From 76c6fd85bea3c1bd01d734df9cfcf4019e792654 Mon Sep 17 00:00:00 2001
From: Peter Berta <peter.berta@cern.ch>
Date: Wed, 22 Sep 2021 09:32:11 +0200
Subject: [PATCH 251/347] Merge branch 'master-DQegamma_07092021_for22.0-mc20'
 into '22.0-mc20'

Fix Tag and Probe monitors by using both electron branches

See merge request atlas/athena!46650

(cherry picked from commit e84605548f33e17a1afafc77d3a25570be43d976)

51262cd6 Bugfix to take into account possible multi chain setup for TnP monitors
4841e140 Bugfix to remove the trigger requirement of TnP monitors
4fdb1eec New trigger setup for JPsi and no trigger for Zee (TnP monitors)
401990f9 Bug fix on the TnP configuration
ad138993 bug fix for TnP algs - use both electron candidates except in the eta/phi distributions of probes
41355989 fix to TnP monitors and implementation of double precision histogram for electron eta monitoring
---
 .../egammaPerformance/python/SetupEgammaMonitoring.py  |  8 ++++----
 .../egammaPerformance/src/MonitorElectronAlgorithm.cxx | 10 +++++++---
 .../egammaPerformance/src/MonitorTnPAlgorithm.cxx      |  5 +----
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py b/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py
index d0a142fd8543..629c64b15d45 100755
--- a/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py
+++ b/Reconstruction/egamma/egammaPerformance/python/SetupEgammaMonitoring.py
@@ -80,7 +80,7 @@ def BookHistograms(groupe,reconame,particletype,withTrigger=""):
 
         hname= "Eta"
         htitle= particletype + " #eta" + " (" + reconame + " " + withTrigger + ")"+ " ; #eta" + tlabel + " ; N" + tlabel
-        groupe.defineHistogram(hname,title=htitle, path='',xbins=64,xmin=-3.2,xmax=3.2)
+        groupe.defineHistogram(hname,title=htitle, path='',type = "TH1D", xbins=64,xmin=-3.2,xmax=3.2)
 
         if particletype in ["Photon"] :
             hname= "EtaConv"
@@ -370,15 +370,15 @@ def BookTnPHistograms(groupe,reconame,TnPType,MassLowerCut,MassUpperCut):
     # Probe electron candidate distributions
 
     hname = "Etprobe;Etprobe_distribution"
-    htitle = "Number of "+ TnPType +" candidates vs of leading e ; Et_{probe} ; N_{e_ {probe}}"
+    htitle = "Number of "+ TnPType +" candidates vs of leading e ; Et_{probe} ; N_{e_{probe}}"
     groupe.defineHistogram(hname,title=htitle, path='ElectronProbes',xbins=100,xmin=-1000.0,xmax=200000.0)
 
     hname = "Etaprobe;Etaprobe_distribution"
-    htitle = "#eta distribution of probe candidates ; #eta_{e_{probe}} ; N_{e_ {probe}}"
+    htitle = "#eta distribution of probe candidates ; #eta_{e_{probe}} ; N_{e_{probe}}"
     groupe.defineHistogram(hname,title=htitle,path='ElectronProbes', xbins=64,xmin=-3.2,xmax=3.2)
 
     hname = "Phiprobe;Phiprobe_distribution"
-    htitle = "#phi distribution of probe candidates ; #phi_{e_{probe}} ; N_{e_ {probe}}"
+    htitle = "#phi distribution of probe candidates ; #phi_{e_{probe}} ; N_{e_{probe}}"
     groupe.defineHistogram(hname,title=htitle,path='ElectronProbes', xbins=64,xmin=-3.2,xmax=3.2)
 
     hname = "Etaprobe,Phiprobe;Eta_Phi_map_of_electron_probes_for_T_and_P_"+ TnPType
diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx
index 274f45b3c454..ec7ab028ed8a 100755
--- a/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx
+++ b/Reconstruction/egamma/egammaPerformance/src/MonitorElectronAlgorithm.cxx
@@ -52,7 +52,9 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c
     // Particle variables to be monitored
     auto np = Monitored::Scalar<int>("N",0.0);
     auto et = Monitored::Scalar<Float_t>("Et",0.0);
-    auto eta = Monitored::Scalar<Float_t>("Eta",0.0);
+    // Check if small differences between old and new monitoring are related to rounding effects
+    // auto eta = Monitored::Scalar<Float_t>("Eta",0.0);
+    auto eta = Monitored::Scalar<Double_t>("Eta",0.0);
     auto phi = Monitored::Scalar<Float_t>("Phi",0.0);
     auto is_pt_gt_2_5gev = Monitored::Scalar<bool>("is_pt_gt_2_5gev",false);
     auto is_pt_gt_4gev = Monitored::Scalar<bool>("is_pt_gt_4gev",false);
@@ -168,7 +170,8 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c
       }
       if(isGood) {
 	mynp++;
-	Float_t myetaloc = e_iter->eta();
+	//Float_t myetaloc = e_iter->eta();
+	Double_t myetaloc = e_iter->eta();
 	auto regionloc = GetRegion(myetaloc);
         ATH_MSG_DEBUG("Test electron in region : " << regionloc);
 	switch(regionloc){
@@ -191,7 +194,8 @@ StatusCode MonitorElectronAlgorithm::fillHistograms( const EventContext& ctx ) c
       // do specific stuff with electrons
 
       Float_t myet = e_iter->pt(); // in MeV (/Gaudi::Units::GeV; // in GeV)
-      Float_t myeta = e_iter->eta();
+      //Float_t myeta = e_iter->eta();
+      Double_t myeta = e_iter->eta();
       Float_t myphi = e_iter->phi();
 
       bool myis_pt_gt_2_5gev = myet > 2500. ;
diff --git a/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx b/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx
index 66d1222f6c08..277c7e367369 100644
--- a/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx
+++ b/Reconstruction/egamma/egammaPerformance/src/MonitorTnPAlgorithm.cxx
@@ -144,16 +144,13 @@ StatusCode MonitorTnPAlgorithm::fillHistograms( const EventContext& ctx ) const
   bool subl_isLHTight = false;
   if ( !subl_el->passSelection(subl_isLHTight,"LHTight") ) return StatusCode::FAILURE;
 
-  // Use only one electron from a single TnP candidate to avoid introducing correlations in the distributions related to probes
   // If leading electron is LHTight use subleading as probe
-  bool EventZcandidateUsed = false;
   if(lead_isLHTight) {
     ATH_CHECK(fillElectronProbe(subl_el, true, ctx));
-    EventZcandidateUsed = true;
   }
   // If subleading electron is LHTight use leading as probe
   if(subl_isLHTight) {
-    if (!EventZcandidateUsed) ATH_CHECK(fillElectronProbe(lead_el, false, ctx));
+    ATH_CHECK(fillElectronProbe(lead_el, false, ctx));
   }
 
 return StatusCode::SUCCESS;
-- 
GitLab


From fd4e0810cf8837991120d024566ae4e75b0f183f Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 22 Sep 2021 09:56:08 +0200
Subject: [PATCH 252/347] Tier0ChainTests: delete obsolete mc16a/c ART tests

Delete obsolete mc16a/c ART tests. These tests are not enabled (we have
an mc16e test) and they are referencing obsolete `TriggerFlags` that are
being removed from the release.
---
 Tools/Tier0ChainTests/test/test_reco_mc16a.sh    | 12 ------------
 Tools/Tier0ChainTests/test/test_reco_mc16c.sh    | 13 -------------
 Tools/Tier0ChainTests/test/test_reco_mc16c_mp.sh |  6 ------
 3 files changed, 31 deletions(-)
 delete mode 100755 Tools/Tier0ChainTests/test/test_reco_mc16a.sh
 delete mode 100755 Tools/Tier0ChainTests/test/test_reco_mc16c.sh
 delete mode 100755 Tools/Tier0ChainTests/test/test_reco_mc16c_mp.sh

diff --git a/Tools/Tier0ChainTests/test/test_reco_mc16a.sh b/Tools/Tier0ChainTests/test/test_reco_mc16a.sh
deleted file mode 100755
index 5619922d719d..000000000000
--- a/Tools/Tier0ChainTests/test/test_reco_mc16a.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-#
-# art-description: RecoTrf
-# art-type: grid
-
-Reco_tf.py --digiSteeringConf 'StandardSignalOnlyTruth' --conditionsTag 'default:OFLCOND-MC16-SDR-17' --valid 'True' --pileupFinalBunch '6' --numberOfHighPtMinBias '0.152593389' --autoConfiguration 'everything' --numberOfLowPtMinBias '58.3474065525' --steering 'doRDO_TRIG' --preInclude 'HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInclude.PileUpBunchTrainsMC15_2015_25ns_Config1.py,RunDependentSimData/configLumi_run284500_mc16a.py' --postExec 'all:CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' 'ESDtoAOD:fixedAttrib=[s if "CONTAINER_SPLITLEVEL = \"99\"" not in s else "" for s in svcMgr.AthenaPoolCnvSvc.PoolAttributes];svcMgr.AthenaPoolCnvSvc.PoolAttributes=fixedAttrib' 'RDOtoRDOTrigger:conddb.addOverride("/CALO/Ofl/Noise/PileUpNoiseLumi","CALOOflNoisePileUpNoiseLumi-mc15-mu30-dt25ns")' --postInclude 'default:PyJobTransforms/UseFrontier.py' --preExec 'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True)' 'all:from InDetRecExample.InDetJobProperties import InDetFlags; InDetFlags.doWriteTracksToESD.set_Value_and_Lock(True)' 'ESDtoAOD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet.set_Value_and_Lock("AODFULL");' 'RDOtoRDOTrigger:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup.set_Value_and_Lock("MC_pp_v6_tight_mc_prescale");' 'RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup.set_Value_and_Lock("MC_pp_v6_tight_mc_prescale");' 'all:from TriggerJobOpts.TriggerFlags import TriggerFlags as TF;TF.run2Config="2016"' --geometryVersion 'default:ATLAS-R2-2016-01-00-01' --numberOfCavernBkg '0' --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/* --maxEvents=100 --outputAODFile=myAOD.pool.root --outputRDOFile="myRDO.pool.root" --outputESDFile="myESD.pool.root" --runNumber=410000 --jobNumber=1 --inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/* --inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/* --imf False
-echo "art-result: $?"
-
-ArtPackage=$1
-ArtJobName=$2
-art.py compare grid --entries 10 ${ArtPackage} ${ArtJobName}
-echo "art-result: $?"
diff --git a/Tools/Tier0ChainTests/test/test_reco_mc16c.sh b/Tools/Tier0ChainTests/test/test_reco_mc16c.sh
deleted file mode 100755
index e3553c02be94..000000000000
--- a/Tools/Tier0ChainTests/test/test_reco_mc16c.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-#
-# art-description: RecoTrf
-# art-type: grid
-
-Reco_tf.py --digiSteeringConf 'StandardSignalOnlyTruth' --conditionsTag 'default:OFLCOND-MC16-SDR-17' --valid 'True' --pileupFinalBunch '6' --numberOfHighPtMinBias '0.152593389' --autoConfiguration 'everything' --numberOfLowPtMinBias '58.3474065525' --steering 'doRDO_TRIG' --preInclude 'HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run300000_mc16c.py' --postExec 'all:CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' 'ESDtoAOD:fixedAttrib=[s if "CONTAINER_SPLITLEVEL = \"99\"" not in s else "" for s in svcMgr.AthenaPoolCnvSvc.PoolAttributes];svcMgr.AthenaPoolCnvSvc.PoolAttributes=fixedAttrib' --postInclude 'default:PyJobTransforms/UseFrontier.py' --preExec 'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True)' 'all:from InDetRecExample.InDetJobProperties import InDetFlags; InDetFlags.doWriteTracksToESD.set_Value_and_Lock(True)' 'ESDtoAOD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet.set_Value_and_Lock("AODFULL");' 'RDOtoRDOTrigger:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup.set_Value_and_Lock("MC_pp_v7_tight_mc_prescale");' 'RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup.set_Value_and_Lock("MC_pp_v7_tight_mc_prescale");' --geometryVersion 'default:ATLAS-R2-2016-01-00-01' --numberOfCavernBkg '0' --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/* --maxEvents=100 --outputAODFile=myAOD.pool.root --outputRDOFile="myRDO.pool.root" --outputESDFile="myESD.pool.root" --runNumber=410000 --jobNumber=1 --inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/* --inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/* --imf False
-echo "art-result: $?"
-
-ArtPackage=$1
-ArtJobName=$2
-art.py compare grid --entries 10 ${ArtPackage} ${ArtJobName}
-echo "art-result: $?"
-
diff --git a/Tools/Tier0ChainTests/test/test_reco_mc16c_mp.sh b/Tools/Tier0ChainTests/test/test_reco_mc16c_mp.sh
deleted file mode 100755
index 7d5ff9ab5725..000000000000
--- a/Tools/Tier0ChainTests/test/test_reco_mc16c_mp.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-#
-# art-description: RecoTrf
-# art-type: grid
-
-Reco_tf.py --athenaopts='--nprocs=2' --digiSteeringConf 'StandardSignalOnlyTruth' --conditionsTag 'default:OFLCOND-MC16-SDR-17' --valid 'True' --pileupFinalBunch '6' --numberOfHighPtMinBias '0.152593389' --autoConfiguration 'everything' --numberOfLowPtMinBias '58.3474065525' --steering 'doRDO_TRIG' --preInclude 'HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInlcude.PileUpBunchTrainsMC16c_2017_Config1.py,RunDependentSimData/configLumi_run300000_mc16c.py' --postExec 'all:CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' 'ESDtoAOD:fixedAttrib=[s if "CONTAINER_SPLITLEVEL = \"99\"" not in s else "" for s in svcMgr.AthenaPoolCnvSvc.PoolAttributes];svcMgr.AthenaPoolCnvSvc.PoolAttributes=fixedAttrib' --postInclude 'default:PyJobTransforms/UseFrontier.py' --preExec 'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True)' 'all:from InDetRecExample.InDetJobProperties import InDetFlags; InDetFlags.doWriteTracksToESD.set_Value_and_Lock(True)' 'ESDtoAOD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.AODEDMSet.set_Value_and_Lock("AODFULL");' 'RDOtoRDOTrigger:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup.set_Value_and_Lock("MC_pp_v7_tight_mc_prescale");' 'RAWtoESD:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup.set_Value_and_Lock("MC_pp_v7_tight_mc_prescale");' --geometryVersion 'default:ATLAS-R2-2016-01-00-01' --numberOfCavernBkg '0' --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3091/* --maxEvents=100 --outputAODFile=myAOD.pool.root --outputRDOFile="myRDO.pool.root" --outputESDFile="myESD.pool.root" --runNumber=410000 --jobNumber=1 --inputLowPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361238.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_low.merge.HITS.e4981_s3087_s3089/* --inputHighPtMinbiasHitsFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc16_13TeV.361239.Pythia8EvtGen_A3NNPDF23LO_minbias_inelastic_high.merge.HITS.e4981_s3087_s3089/*
-- 
GitLab


From 3e464aafeee3a5a90d1317c6c9cc72e404f1eb9a Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 22 Sep 2021 10:25:37 +0200
Subject: [PATCH 253/347] TrigSimTransforms: delete legacy trigger simulation
 transform

This transform (simulating the trigger on old bytestream) is currently not
used to simulate the trigger. Instead we are using RDOtoRDOTrigger to
simulate past data-taking periods.
---
 .../TrigSimTransforms/CMakeLists.txt          |   16 -
 .../doc/RunLegacyTransforms.md                |  124 --
 .../TrigSimTransforms/python/__init__.py      |    2 -
 .../python/rdo2bs_rodversion_setup.py         |   33 -
 .../TrigSimTransforms/python/rodconfig.py     |   21 -
 .../TrigSimTransforms/python/trfTrigSimExe.py |   60 -
 .../python/trfTrigSimUtils.py                 |   73 --
 .../TrigSimTransforms/scripts/RDOtoBS_tf.py   |   74 --
 .../scripts/TrigAndReco_tf.py                 |   55 -
 .../scripts/getLegacySimulationTransforms.sh  |    8 -
 .../scripts/printRODVersions.py               |   84 --
 .../scripts/runLegacySimulation_combined.sh   |   58 -
 .../runLegacySimulation_digitization.sh       |   67 --
 .../scripts/runLegacySimulation_merge.sh      |   36 -
 .../scripts/runLegacySimulation_rdo2bs.sh     |   36 -
 .../scripts/runLegacySimulation_trigsim.sh    |   37 -
 ...ergingEventLoopMgr_TriggerBSandRDOtoRDO.py |  211 ----
 ...entLoopMgr_TriggerBSandRDOtoRDO_Example.py |   12 -
 .../TrigSimTransforms/share/athena_RDOtoBS.py |  174 ---
 .../share/athena_RDOtoBS_Example.py           |   18 -
 .../share/skeleton.RDOtoBS.py                 |   36 -
 .../share/skeleton.TRIGBStoRDO.py             |    9 -
 .../src/MergingEventLoopMgr.cxx               | 1018 -----------------
 .../src/MergingEventLoopMgr.h                 |  121 --
 .../components/TrigSimTransforms_entries.cxx  |    3 -
 25 files changed, 2386 deletions(-)
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/CMakeLists.txt
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/doc/RunLegacyTransforms.md
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/python/__init__.py
 delete mode 100755 Trigger/TriggerSimulation/TrigSimTransforms/python/rdo2bs_rodversion_setup.py
 delete mode 100755 Trigger/TriggerSimulation/TrigSimTransforms/python/rodconfig.py
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/python/trfTrigSimExe.py
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/python/trfTrigSimUtils.py
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/scripts/RDOtoBS_tf.py
 delete mode 100755 Trigger/TriggerSimulation/TrigSimTransforms/scripts/TrigAndReco_tf.py
 delete mode 100755 Trigger/TriggerSimulation/TrigSimTransforms/scripts/getLegacySimulationTransforms.sh
 delete mode 100755 Trigger/TriggerSimulation/TrigSimTransforms/scripts/printRODVersions.py
 delete mode 100755 Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_combined.sh
 delete mode 100755 Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_digitization.sh
 delete mode 100755 Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_merge.sh
 delete mode 100755 Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_rdo2bs.sh
 delete mode 100755 Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_trigsim.sh
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO.py
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO_Example.py
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/share/athena_RDOtoBS.py
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/share/athena_RDOtoBS_Example.py
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/share/skeleton.RDOtoBS.py
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/share/skeleton.TRIGBStoRDO.py
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/src/MergingEventLoopMgr.cxx
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/src/MergingEventLoopMgr.h
 delete mode 100644 Trigger/TriggerSimulation/TrigSimTransforms/src/components/TrigSimTransforms_entries.cxx

diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/CMakeLists.txt b/Trigger/TriggerSimulation/TrigSimTransforms/CMakeLists.txt
deleted file mode 100644
index 00a3b98091fa..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/CMakeLists.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-# Declare the package name:
-atlas_subdir( TrigSimTransforms )
-
-# Component(s) in the package:
-atlas_add_component( TrigSimTransforms
-                     src/*.cxx
-                     src/components/*.cxx
-                     LINK_LIBRARIES AthenaKernel EventInfo GaudiKernel SGTools StoreGateLib TrigSteeringEvent )
-
-# Install files from the package:
-atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
-atlas_install_joboptions( share/*.py )
-atlas_install_scripts( scripts/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
-atlas_install_scripts( scripts/*.sh )
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/doc/RunLegacyTransforms.md b/Trigger/TriggerSimulation/TrigSimTransforms/doc/RunLegacyTransforms.md
deleted file mode 100644
index 00e6c99feaad..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/doc/RunLegacyTransforms.md
+++ /dev/null
@@ -1,124 +0,0 @@
-PREPARATION
-===========
-
-Use one of the two options for running trnaforms, either run directly from
-release, or checkout (newer) transform version locally.
-
-
-To use transforms from release
-------------------------------
-
-If you want to use transforms from release setup AtlasProduction release:
-    
-    asetup AtlasProduction,devval,rel_1
-
-Then pick an arbitrary place to work:
-    
-    mkdir -p develop; cd develop
-
-
-To check out transforms locally
--------------------------------
-
-Alternatively if you want to update transforms which are in `TrigSimTransforms`
-package, check it out and build (with cmake):
-    
-    mkdir -p legacysim/source; cd legacysim/source
-    
-    # setup release and test area
-    asetup AtlasProduction,devval,rel_1,here
-    
-    # checkout package
-    svnco TrigSimTransforms
-    cd ..
-
-    # usually build directory is called "build" but some tools are
-    # still broken if you don't call it InstallArea
-    mkdir InstallArea; cd InstallArea
-    cmake ../source
-    make
-
-    # update environment for test area
-    source $CMTCONFIG/setup.sh
-
-    # go to working directory
-    cd ..
-    mkdir -p run; cd run
-
-
-Running individual transform steps
-==================================
-
-Now we can run any of the transforms, as long as the input is available.
-
-
-Digitization step
------------------
-
-* Input: always available on afs, or check and update the script to change defaults.
-* Output: `./digitization/` directory by default, file name is `digiRDO.pool.root`.
-
-To run it:
-    
-    get_files -scripts runLegacySimulation_digitization.sh
-    # modify script if necessary
-    ./runLegacySimulation_digitization.sh
-
-
-RDO to BS step
---------------
-
-* Input: `digitization/digiRDO.pool.root`.
-* Output: `./rdo2bs/` directory by default, file name is `digiBS.data`.
-
-To run it:
-    
-    get_files -scripts runLegacySimulation_rdo2bs.sh
-    # modify script if necessary
-    ./runLegacySimulation_rdo2bs.sh
-
-To check the ROD versions in produced output:
-    
-    printRODVersions.py rdo2bs/digiBS.data
-
-
-Trigger Simulation step
------------------------
-
-* Input: `./rdo2bs/digiBS.data`.
-* Output: `./bs2trigbs/` directory by default, file name is `trigBS.data`
-
-To run it:
-    
-    get_files -scripts runLegacySimulation_trigsim.sh
-    # modify script if necessary
-    ./runLegacySimulation_trigsim.sh
-
-
-RDO+BS merging step
--------------------
-
-* Input: `digitization/digiRDO.pool.root` and `./bs2trigbs/trigBS.data`.
-* Output: `./trigbs2rdo/` directory by default, file name is `trigRDO.pool.root`.
-
-To run it:
-    
-    get_files -scripts runLegacySimulation_merge.sh
-    # modify script if necessary
-    ./runLegacySimulation_merge.sh
-
-
-Running three-step transform
-============================
-
-Separate script will run three of the above steps in one go: RDO to BS, Trigger
-Simulation, and RDO+BS merge.
-
-* Input: check `runLegacySimulation_combined.sh`, modify if necessary
-* Output: `./rdo2trigger2rdo/` directory by default, file name is `trigRDO.pool.root`
-
-To run it:
-    
-    get_files -scripts runLegacySimulation_combined.sh
-    # modify script if necessary
-    ./runLegacySimulation_combined.sh
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/python/__init__.py b/Trigger/TriggerSimulation/TrigSimTransforms/python/__init__.py
deleted file mode 100644
index 74583d364ec2..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/python/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/python/rdo2bs_rodversion_setup.py b/Trigger/TriggerSimulation/TrigSimTransforms/python/rdo2bs_rodversion_setup.py
deleted file mode 100755
index 4256a5c139b8..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/python/rdo2bs_rodversion_setup.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-
-def rod_version_setup(trigger_release):
-
-    from TrigSimTransforms.rodconfig import get_rod_config
-
-    rodconfig = get_rod_config(trigger_release)
-
-    # LAr setup
-    # taken from TriggerJobOpts/share/Trigger_topOptions_writeBS.py
-    lar_rodconfig = rodconfig["LAR"]
-    from AthenaCommon.AppMgr import ToolSvc
-    ToolSvc.LArRawDataContByteStreamTool.DSPRunMode      = lar_rodconfig["DSPRunMode"]
-    ToolSvc.LArRawDataContByteStreamTool.RodBlockVersion = lar_rodconfig["RodBlockVersion"]
-    ToolSvc.LArRawDataContByteStreamTool.IncludeDigits   = lar_rodconfig["IncludeDigits"]
-
-
-
-
-
-
-def main():
-    from TrigSimTransforms.rodconfig import get_rod_config
-    print(get_rod_config("17.1.3.4"))
-    return 0
-
-
-if __name__=="__main__":
-    import sys
-    sys.exit(main())
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/python/rodconfig.py b/Trigger/TriggerSimulation/TrigSimTransforms/python/rodconfig.py
deleted file mode 100755
index bee9e51e3c98..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/python/rodconfig.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# this file provides lookup for the ROD versions of all sub-detectors by release
-
-
-
-rodconfig = {}
-
-rodconfig["17.1.3.4"] = {}
-
-rodconfig["17.1.3.4"]["LAR"] = {"DSPRunMode" : 4, "RodBlockVersion" : 9, "IncludeDigits" : True }
-
-
-def get_rod_config(trigger_release):
-    """
-    provides ROD version lookup for trigger release
-
-    returns dictionary {"subdetector" -> version}
-    """
-
-    return rodconfig[trigger_release]
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/python/trfTrigSimExe.py b/Trigger/TriggerSimulation/TrigSimTransforms/python/trfTrigSimExe.py
deleted file mode 100644
index 6b09a3dea986..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/python/trfTrigSimExe.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-"""
-Executor classes specific to Trigger simulation
-"""
-
-import logging
-import os
-import shutil
-
-from PyJobTransforms.trfExe import athenaExecutor
-
-msg = logging.getLogger(__name__)
-
-
-class athenaExecutorJO(athenaExecutor):
-    """
-    Special Athena executor which uses few JO files from current environment.
-
-    This is useful when running athen from the release which is different
-    from current release but which needs JO files from current release.
-    """
-
-    def _prepAthenaCommandLine(self):
-
-        def _findInPath(relName, searchpath):
-            """ Find anf return file name in a search path """
-            for dir in searchpath:
-                path = os.path.join(dir, relName)
-                if os.path.exists(path):
-                    return path
-            return None
-
-        joFiles = []
-        if 'copyJO' in self.conf.argdict:
-            joFiles = self.conf.argdict['copyJO'].returnMyValue(name=self._name, substep=self._substep,
-                                                                first=self.conf.firstExecutor)
-            msg.info('Will try to copy JO files to local directory: %s', joFiles)
-        else:
-            msg.info('self.conf.argdict: %s', self.conf.argdict)
-
-        # copy JO files to a special directory
-        searchpath = os.environ.get('JOBOPTSEARCHPATH', '').split(os.pathsep)
-        joDirName = None
-        for jo in joFiles:
-            joPath = _findInPath(jo, searchpath)
-            if not joPath:
-                raise OSError('Failed to find {} in $JOBOPTSEARCHPATH'.format(jo))
-
-            joDirName = 'jobOptions.' + self._name
-            dst = os.path.join(joDirName, jo)
-            os.makedirs(os.path.dirname(dst))
-            shutil.copyfile(joPath, dst)
-
-        # call base class to construct athena command line
-        athenaExecutor._prepAthenaCommandLine(self)
-
-        # adjust command line to set $JOBOPTSEARCHPATH
-        if joDirName:
-            self._cmd.insert(0, 'JOBOPTSEARCHPATH="' + joDirName + ':$JOBOPTSEARCHPATH"')
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/python/trfTrigSimUtils.py b/Trigger/TriggerSimulation/TrigSimTransforms/python/trfTrigSimUtils.py
deleted file mode 100644
index 538a433568a6..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/python/trfTrigSimUtils.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-"""
-Module whichde defines transform steps and arguments specific
-to Trigger simulation.
-"""
-
-from PyJobTransforms.trfArgClasses import argFactory, argBSFile, argPOOLFile, argSubstep, argSubstepList
-from PyJobTransforms.trfExe import athenaExecutor
-from .trfTrigSimExe import athenaExecutorJO
-
-# # @brief Add trigger simulation substeps
-def addTrigSimSubsteps(executorSet):
-
-    executorSet.add(athenaExecutor(name='RDOtoBSOLD', skeletonFile='TrigSimTransforms/skeleton.RDOtoBS.py',
-                                   substep='r2bo', inData=['RDO'], outData=['BS_OLD']
-                                   ))
-
-    executorSet.add(athenaExecutorJO(name='BStoTRIGBS', skeletonFile='TrigSimTransforms/skeleton.BStoTRIGBS.py',
-                                     substep='b2tb', inData=['BS_OLD'], outData=['BS_TRIG_OLD']
-                                     ))
-
-    executorSet.add(athenaExecutor(name='TRIGBStoRDO', skeletonFile='TrigSimTransforms/skeleton.TRIGBStoRDO.py',
-                                   substep='tb2tr', inData=[('BS_TRIG_OLD', 'RDO')], outData=['RDO_TRIG_OLD']
-                                   ))
-
-
-# # @brief Add trigger simulation related arguments
-def addTrigSimArguments(parser):
-    parser.defineArgGroup('LegacyTrigger', 'Legacy Trigger Simulation Related Options')
-
-    # input and output
-    parser.add_argument('--outputBS_OLDFile',
-                        type=argFactory(argBSFile, io='output'),
-                        help='Output BS file after transforming to legacy payload',
-                        group='LegacyTrigger')
-
-    parser.add_argument('--inputBS_OLDFile',
-                        type=argFactory(argBSFile, io='input'),
-                        help='Input BS file with legacy payload',
-                        group='LegacyTrigger')
-
-    parser.add_argument('--outputBS_TRIG_OLDFile',
-                        type=argFactory(argBSFile, io='output'),
-                        help='Output BS file after legacy trigger simulation',
-                        group='LegacyTrigger')
-
-    parser.add_argument('--inputBS_TRIG_OLDFile',
-                        type=argFactory(argBSFile, io='input'),
-                        help='Input BS file with legacy trigger data',
-                        group='LegacyTrigger')
-
-    parser.add_argument('--outputRDO_TRIG_OLDFile',
-                        type=argFactory(argPOOLFile, io='output'),
-                        help='Output RDO file after legacy trigger simulation and merging with RDO',
-                        group='LegacyTrigger')
-
-    parser.add_argument('--copyJO', group = 'LegacyTrigger',
-                        type=argFactory(argSubstepList, splitter=','), nargs='+',
-                        metavar='substep:PATH,PATH,...',
-                        help='Specifies one or more JO files to copy from current release, '
-                        'can be used with steps specifying different release')
-
-    parser.add_argument('--outputBSEformatVersion', group='LegacyTrigger',
-                        type=argFactory(argSubstep), nargs='+',
-                        metavar='substep:VERSION',
-                        help='Specifies eformat version name for ByteStream output, use "run1" to '
-                        'produce run1-compatible output.')
-    parser.add_argument('--outputBSEventStorageVersion', group='LegacyTrigger',
-                        type=argFactory(argSubstep), nargs='+',
-                        metavar='substep:VERSION',
-                        help='Specifies EventStorage version name for ByteStream output, use "run1" to '
-                        'produce run1-compatible output.')
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/RDOtoBS_tf.py b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/RDOtoBS_tf.py
deleted file mode 100644
index 78d902cb1a5f..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/RDOtoBS_tf.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-#-------------------------------------------------------------------------------
-def add_RDOtoBS_args(parser):
-    import PyJobTransforms.trfArgClasses as trfArgClasses
-
-    parser.defineArgGroup('RDOtoBS_trf', 'RDO to BS specific options')
-
-    parser.add_argument('--inputRDOFile', group = 'RDOtoBS_trf',
-                nargs = '+',
-                type = trfArgClasses.argFactory(
-                    trfArgClasses.argPOOLFile,
-                    io = 'input',
-                    runarg = True,
-                    type = 'rdo'
-                ),
-                help = 'Input RDO file'
-            )
-
-    parser.add_argument('--outputBSFile', group = 'RDOtoBS_trf',
-                type = trfArgClasses.argFactory(
-                    trfArgClasses.argBSFile,
-                    io = 'output',
-                    runarg = True,
-                    type = 'bs'
-                    ),
-                help = 'Output BS file'
-            )
-
-    parser.add_argument('--triggerConfig', group = 'RDOtoBS_trf',
-                type = trfArgClasses.argFactory(
-                        trfArgClasses.argString,
-                        runarg = True
-                    ),
-                help = 'Trigger config to be used'
-            )
-
-#-------------------------------------------------------------------------------
-def get_transform():
-    from PyJobTransforms.transform import transform
-    from PyJobTransforms.trfExe import athenaExecutor
-    trf =  transform(executor = athenaExecutor(
-                name = 'RDOtoBS',
-                skeletonFile = 'TrigSimTransforms/skeleton.RDOtoBS.py',
-                substep = 'r2b',
-            ))
-
-    from PyJobTransforms.trfArgs import addAthenaArguments
-    addAthenaArguments(trf.parser)
-
-    add_RDOtoBS_args(trf.parser)
-
-    return trf
-
-#-------------------------------------------------------------------------------
-if __name__ == "__main__":
-    import sys
-    from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
-
-    @stdTrfExceptionHandler
-    @sigUsrStackTrace
-    def main():
-        trf = get_transform()
-        trf.parseCmdLineArgs(sys.argv[1:])
-        trf.execute()
-        trf.generateReport()
-
-        sys.exit(trf.exitCode)
-
-
-
-    main()
-
-#-------------------------------------------------------------------------------
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/TrigAndReco_tf.py b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/TrigAndReco_tf.py
deleted file mode 100755
index 79364fe38dfa..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/TrigAndReco_tf.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#! /usr/bin/env python
-
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-## TrigAndReco_tf.py - Temporary transform to develop the .
-
-import sys
-import time
-
-# Setup core logging here
-from PyJobTransforms.trfLogger import msg
-msg.info('logging set in %s', sys.argv[0])
-
-from PyJobTransforms.transform import transform
-from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments, addTriggerArguments
-from PyJobTransforms.trfDecorators import stdTrfExceptionHandler, sigUsrStackTrace
-from RecJobTransforms.recTransformUtils import addAllRecoArgs, addRecoSubsteps
-
-from TrigSimTransforms.trfTrigSimUtils import addTrigSimSubsteps, addTrigSimArguments
-
-
-@stdTrfExceptionHandler
-@sigUsrStackTrace
-def main():
-    
-    msg.info('This is %s', sys.argv[0])
-
-    trf = getTransform()
-    trf.parseCmdLineArgs(sys.argv[1:])
-    trf.execute()
-    trf.generateReport()
-
-    msg.info("%s stopped at %s, trf exit code %d", sys.argv[0], time.asctime(), trf.exitCode)
-    sys.exit(trf.exitCode)
-
-def getTransform():
-    executorSet = set()
-    addRecoSubsteps(executorSet)
-    addTrigSimSubsteps(executorSet)
-    
-    trf = transform(executor = executorSet, description = 'General purpose ATLAS reconstruction transform, which also supports'
-                    ' digitisation. Inputs can be HITS, RDO, BS, ESD or AOD, with outputs of RDO, ESD, AOD or DPDs.'
-                    ' See https://twiki.cern.ch/twiki/bin/view/AtlasComputing/RecoTf for more details.')
-    
-    addAthenaArguments(trf.parser)
-    addDetectorArguments(trf.parser)
-    addTriggerArguments(trf.parser)
-    addTrigSimArguments(trf.parser)
-    addAllRecoArgs(trf)
-
-    return trf
-
-
-if __name__ == '__main__':
-    main()
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/getLegacySimulationTransforms.sh b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/getLegacySimulationTransforms.sh
deleted file mode 100755
index aa00e9580aa1..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/getLegacySimulationTransforms.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-echo "Getting trigger simulation transforms"
-get_files -symlink -scripts runLegacySimulation_digitization.sh
-get_files -symlink -scripts runLegacySimulation_rdo2bs.sh
-get_files -symlink -scripts runLegacySimulation_trigsim.sh
-get_files -symlink -scripts runLegacySimulation_merge.sh
-get_files -symlink -scripts runLegacySimulation_combined.sh
-
-get_files -symlink -scripts printRODVersions.py
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/printRODVersions.py b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/printRODVersions.py
deleted file mode 100755
index 09798e85de56..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/printRODVersions.py
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-from __future__ import print_function
-import sys
-import eformat
-from collections import defaultdict
-
-filename = sys.argv[1]
-bsfile = eformat.istream(filename)
-print("Read file %s with %i events" % (filename,bsfile.total_events))
-
-event = bsfile[0]
-
-
-rob_by_subdet = defaultdict(list)
-subdets = set()
-
-subdetsData = [
-    'LAR_EM_BARREL_A_SIDE', 'LAR_EM_BARREL_C_SIDE', 'LAR_EM_ENDCAP_A_SIDE', 'LAR_EM_ENDCAP_C_SIDE', 'LAR_FCAL_A_SIDE', 'LAR_FCAL_C_SIDE', 'LAR_HAD_ENDCAP_A_SIDE', 'LAR_HAD_ENDCAP_C_SIDE',
-    'MUON_MDT_BARREL_A_SIDE', 'MUON_MDT_BARREL_C_SIDE', 'MUON_MDT_ENDCAP_A_SIDE', 'MUON_MDT_ENDCAP_C_SIDE', 'MUON_RPC_BARREL_A_SIDE', 'MUON_RPC_BARREL_C_SIDE', 'MUON_TGC_ENDCAP_A_SIDE', 'MUON_TGC_ENDCAP_C_SIDE',
-    'PIXEL_BARREL', 'PIXEL_B_LAYER', 'PIXEL_DISK_SIDE',
-    'SCT_BARREL_A_SIDE', 'SCT_BARREL_C_SIDE', 'SCT_ENDCAP_A_SIDE', 'SCT_ENDCAP_C_SIDE',
-    'TDAQ_CALO_CLUSTER_PROC_DAQ', 'TDAQ_CALO_CLUSTER_PROC_ROI', 'TDAQ_CALO_JET_PROC_DAQ', 'TDAQ_CALO_JET_PROC_ROI', 'TDAQ_CALO_PREPROC',
-    'TDAQ_CTP',
-    #'TDAQ_EVENT_FILTER', 'TDAQ_LVL2',
-    'TDAQ_MUON_CTP_INTERFACE',
-    'TILECAL_BARREL_A_SIDE', 'TILECAL_BARREL_C_SIDE', 'TILECAL_EXT_A_SIDE', 'TILECAL_EXT_C_SIDE',
-    'TRT_BARREL_A_SIDE', 'TRT_BARREL_C_SIDE', 'TRT_ENDCAP_A_SIDE', 'TRT_ENDCAP_C_SIDE'
-    ]
-
-
-first = True
-for rob in event:
-    if first:
-        first = False
-        #help(rob)
-        #print dir(rob)
-        #print "ROB version",rob.version(),type(rob.version())
-        #print "ROB minor version",rob.minor_version()
-        #print "ROD version",rob.rod_version()
-        #print "ROB source sub det ID", rob.rob_source_id().subdetector_id()
-        #print "ROB source sub det ID", dir(rob.rob_source_id().subdetector_id())
-        #print "ROB header",rob.header_size_word(),rob.header()
-        #print "ROD header",len(rob.rod_header()), '[' + ", ".join(["0x%08x" % x for x in rob.rod_header()])+"]"
-
-    # define the key for the dictionary in which we store ROD versions by subdetector
-    det = rob.rob_source_id().subdetector_group().name
-    split_index = 10
-    if det in ['PIXEL','SCT','TRT','LAR','TILECAL']:
-        split_index = 1
-    if det in ['MUON']:
-        split_index = 4
-    if det in ['TDAQ']:
-        split_index = 10
-
-    subdet = rob.rob_source_id().subdetector_id().name
-    subdets.add(subdet)
-    key = '_'.join( subdet.split('_')[:split_index] )
-
-    rob_by_subdet[ key ] += [ rob ]
-
-
-
-# print
-
-width = max([len(s) for s in rob_by_subdet.keys()]+[15]) + 5
-
-print("Detector%sROD version%s#ROBs" % (' ' * (width-8), ' ' * (14) ))
-print("--------%s-----------%s-----" % ('-' * (width-8), '-' * (14) ))
-
-for subdet in sorted(rob_by_subdet.keys()):
-
-    roblist = rob_by_subdet[subdet]
-
-    robset = set(["%s" % rob.rod_version() for rob in roblist])
-
-    print("%-*s%-*s%i" % (width, subdet, 25, ", ".join(robset), len(roblist) ))
-
-subdet_missing = set(subdetsData) - subdets
-if subdet_missing:
-    print("Missing the following sub detectors in the file:")
-    for sd in sorted(subdet_missing):
-        print("    ",sd)
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_combined.sh b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_combined.sh
deleted file mode 100755
index 7790b9b4ddd6..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_combined.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-#
-# Script which runs three-step legacy trigger simulation:
-#   1. RDO to BS conversion
-#   2. Trigger simulation on BS file using some legacy release
-#      producing BS_OLD output file
-#   3. Merging of RDO and BS_OLD file into output RDO
-#
-
-WORKDIR=${1:-rdo2trigger2rdo}
-
-echo "Combined workdir: "$WORKDIR
-rm -rf $WORKDIR
-mkdir $WORKDIR
-cd $WORKDIR
-
-#INPUTRDO='root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid3.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2579_r6164_tid05062245_00/RDO.05062245._000003.pool.root.1'
-#INPUTRDO=/afs/cern.ch/work/s/stelzer/LegacySimWorkareaForWernerJoerg/digitizedRDO/digiRDO.pool.root
-INPUTRDO='root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/LegacySim/digitizedRDO/digiRDO.pool.root'
-
-OUTPUTRDO="trigRDO.pool.root"
-
-CONDTAG="all:OFLCOND-MC12b-SDR-01"
-
-GEOMTAG="ATLAS-R1-2012-02-00-00 b2tb:ATLAS-GEO-21-02-02"
-
-TRIGCONFIG='default=MCRECO:MC_pp_v6'
-TRIGCONFIG_OLD='b2tb=MCRECO:DB:TRIGGERDBMC_RUN1:325,142,266'
-
-ASETUP="b2tb:17.2.11.2,slc5"
-COPYJO="b2tb:TrigSimTransforms/skeleton.BStoTRIGBS.py"
-
-echo
-echo "Input RDO file : "$INPUTRDO
-echo "Output         : "$OUTPUTRDO
-echo
-echo "Conditions     : "$CONDTAG
-echo "Geometry       : "$GEOMTAG
-echo "Trigger        : "$TRIGCONFIG $TRIGCONFIG_OLD
-echo
-
-#
-# Note --ignoreErrors option, some (or all steps) are still producing ERROR
-# messages which are not fatal but need futher work on configuration to avoid
-# them, once all ERROR messages are suppressed this otion can be removed
-#
-TrigAndReco_tf.py \
-    --inputRDOFile $INPUTRDO \
-    --outputRDO_TRIG_OLDFile $OUTPUTRDO \
-    --triggerConfig $TRIGCONFIG $TRIGCONFIG_OLD \
-    --geometryVersion $GEOMTAG \
-    --conditionsTag $CONDTAG \
-    --asetup "$ASETUP" \
-    --copyJO "$COPYJO" \
-    --outputBSEformatVersion "r2bo:run1" \
-    --outputBSEventStorageVersion "r2bo:run1" \
-    --imf false \
-    > log  2>&1
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_digitization.sh b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_digitization.sh
deleted file mode 100755
index 5706d55394aa..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_digitization.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-WORKDIR=${1:-digitization}
-
-echo "Digitization workdir: "$WORKDIR
-rm -rf $WORKDIR
-mkdir $WORKDIR
-cd $WORKDIR
-
-#INPUTDIR="/afs/cern.ch/work/s/stelzer/LegacySimWorkareaForWernerJoerg/hitfiles"
-INPUTDIR="root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/LegacySim/hitfiles"
-INPUTHITS="mc12_8TeV.126940.PowhegPythia8_AU2CT10_ZZ_4mu_mll4_2pt5.merge.HITS.e1280_s1469_s1470_tid00857308_00/HITS.00857308._000585.pool.root.1"
-
-# globbing does not work well with EOS, need to specify each individual file
-#INPUTMBLOWPT="HITS.743321._[001996,001997,001998,001999,002000].pool.root"
-INPUTMBLOWPT="\
-mc12_8TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1119_s1469_s1471_tid743321_00/HITS.743321._001996.pool.root.5 \
-mc12_8TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1119_s1469_s1471_tid743321_00/HITS.743321._001997.pool.root.6 \
-mc12_8TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1119_s1469_s1471_tid743321_00/HITS.743321._001998.pool.root.5 \
-mc12_8TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1119_s1469_s1471_tid743321_00/HITS.743321._001999.pool.root.4 \
-mc12_8TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1119_s1469_s1471_tid743321_00/HITS.743321._002000.pool.root.4 \
-"
-#INPUTMBHIGHPT="HITS.743322._[005996,005997,005998,005999,006000].pool.root"
-INPUTMBHIGHPT="\
-mc12_8TeV.119996.Pythia8_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e1119_s1469_s1471_tid743322_00/HITS.743322._005996.pool.root.1 \
-mc12_8TeV.119996.Pythia8_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e1119_s1469_s1471_tid743322_00/HITS.743322._005997.pool.root.1 \
-mc12_8TeV.119996.Pythia8_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e1119_s1469_s1471_tid743322_00/HITS.743322._005998.pool.root.1 \
-mc12_8TeV.119996.Pythia8_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e1119_s1469_s1471_tid743322_00/HITS.743322._005999.pool.root.1 \
-mc12_8TeV.119996.Pythia8_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e1119_s1469_s1471_tid743322_00/HITS.743322._006000.pool.root.1 \
-"
-
-OUTPUT="digiRDO.pool.root"
-
-CONDTAG=OFLCOND-MC12-SDR-06
-GEOMTAG=ATLAS-R1-2012-02-00-00
-
-echo "Input files dir: "$INPUTDIR
-echo "Input hits     : "$INPUTHITS
-echo "Low pt minbias : "$INPUTMBLOWPT
-echo "High pt minbias: "$INPUTMBHIGHPT
-echo
-echo "Output: "$OUTPUT
-echo
-echo "Conditions: "$CONDTAG
-echo "Geometry  : "$GEOMTAG
-echo
-
-
-Reco_tf.py \
-    --inputHITSFile="$INPUTDIR/$INPUTHITS" \
-    --maxEvents="50" \
-    --skipEvents="50" \
-    --runNumber="126940" \
-    --preInclude="h2r:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInclude.PileUpBunchTrains2011Config8_DigitConfig.py,RunDependentSimData/configLumi_mc12_v1.py" \
-    --preExec="h2r:from LArROD.LArRODFlags import larRODFlags;larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.UseDelta.set_Value_and_Lock(3);from Digitization.DigitizationFlags import digitizationFlags;digitizationFlags.overrideMetadata+=[\"SimLayout\",\"PhysicsList\"];from GeoModelSvc.GeoModelSvcConf import GeoModelSvc;GeoModelSvc = GeoModelSvc();GeoModelSvc.IgnoreTagDifference = True" \
-    --autoConfiguration="everything" \
-    --conditionsTag="$CONDTAG" \
-    --geometryVersion="$GEOMTAG" \
-    --outputRDOFile="$OUTPUT" \
-    --numberOfLowPtMinBias="39.954664" \
-    --numberOfHighPtMinBias="0.045336" \
-    $(for path in $INPUTMBLOWPT; do echo --inputLowPtMinbiasHitsFile=$INPUTDIR/$path; done) \
-    --DataRunNumber="-1" \
-    --jobNumber="1200" \
-    --digiSeedOffset1="1200" \
-    --digiSeedOffset2="1200" \
-    $(for path in $INPUTMBHIGHPT; do echo --inputHighPtMinbiasHitsFile=$INPUTDIR/$path; done) \
-    --digiRndmSvc="AtDSFMTGenSvc" \
-    > log 2>&1
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_merge.sh b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_merge.sh
deleted file mode 100755
index 0adf66f6ed31..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_merge.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# Script which runs three-step legacy trigger simulation:
-#   1. RDO to BS conversion
-#   2. Trigger simulation on BS file using some legacy release
-#      producing BS_OLD output file
-#   3. Merging of RDO and BS_OLD file into output RDO
-#
-
-WORKDIR=${1:-trigbs2rdo}
-
-echo "Merge workdir  : "$WORKDIR
-rm -rf $WORKDIR && mkdir $WORKDIR && cd $WORKDIR
-
-#INPUTRDO='root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/mc12_8TeV.208002.Pythia8B_AU2_CTEQ6L1_pp_Jpsimu6mu6.recon.RDO.e1331_a159_a190_tid01180650_00/RDO.01180650._000002.pool.root.1'
-INPUTRDO='../digitization/digiRDO.pool.root'
-INPUTBS='../bs2trigbs/trigBS.data'
-
-OUTPUTRDO="trigRDO.pool.root"
-
-CONDTAG=OFLCOND-MC12-SDR-06
-GEOMTAG=ATLAS-R1-2012-02-00-00
-
-echo
-echo "Input RDO file : "$INPUTRDO
-echo "Input BS file  : "$INPUTBS
-echo "Output         : "$OUTPUTRDO
-echo
-
-TrigAndReco_tf.py \
-    --inputBS_TRIG_OLDFile $INPUTBS \
-    --inputRDOFile $INPUTRDO \
-    --outputRDO_TRIG_OLDFile $OUTPUTRDO \
-    --geometryVersion "tb2tr:$GEOMTAG" \
-    --conditionsTag "tb2tr:$CONDTAG" \
-    > log  2>&1
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_rdo2bs.sh b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_rdo2bs.sh
deleted file mode 100755
index eea467b5af84..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_rdo2bs.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-WORKDIR=${1:-rdo2bs}
-
-echo "Digitization workdir: "$WORKDIR
-rm -rf $WORKDIR
-mkdir $WORKDIR
-cd $WORKDIR
-
-#INPUTRDO='root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid3.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2579_r6164_tid05062245_00/RDO.05062245._000003.pool.root.1'
-#INPUTRDO='root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/LegacySim/digitizedRDO/digiRDO.pool.root'
-INPUTRDO='../digitization/digiRDO.pool.root'
-OUTPUTBS="digiBS.data"
-
-TRIGCONFIG='all=MCRECO:MC_pp_v6'
-#TRIGCONFIG='all=MCRECO:DB:TRIGGERDBMC_RUN1:325,142,266'
-CONDTAG="OFLCOND-MC12-SDR-06"
-GEOMTAG=ATLAS-R1-2012-02-00-00
-
-echo "Input file : "$INPUTRDO
-echo "Output     : "$OUTPUTBS
-echo "Workdir    : "$WORKDIR
-echo
-echo "Conditions : "$CONDTAG
-echo "Geometry   : "$GEOMTAG
-echo "Trigger    : "$TRIGCONFIG
-
-TrigAndReco_tf.py --inputRDOFile $INPUTRDO --outputBS_OLDFile $OUTPUTBS \
-    --imf false \
-    --maxEvents 100 \
-    --triggerConfig $TRIGCONFIG \
-    --geometryVersion "r2bo:$GEOMTAG" \
-    --conditionsTag "r2bo:$CONDTAG" \
-    --outputBSEformatVersion "r2bo:run1" \
-    --outputBSEventStorageVersion "r2bo:run1" \
-    > log 2>&1
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_trigsim.sh b/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_trigsim.sh
deleted file mode 100755
index 751e23ea88fb..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/scripts/runLegacySimulation_trigsim.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-WORKDIR=${1:-bs2trigbs}
-
-echo "Simulation workdir: "$WORKDIR
-rm -rf $WORKDIR
-mkdir $WORKDIR
-cd $WORKDIR
-
-INPUTBS="../rdo2bs/digiBS.data"
-
-OUTPUTBS="trigBS.data"
-
-GEOMTAG="ATLAS-GEO-21-02-02"
-CONDTAG="OFLCOND-MC12b-SDR-01"
-#CONDTAG="OFLCOND-RUN12-SDR-25"
-#GEOMTAG="ATLAS-R1-2012-02-00-00"  # crashes
-TRIGCONFIG='all=MCRECO:DB:TRIGGERDBMC_RUN1:325,142,266'
-ASETUP="b2tb:17.2.11.2,slc5"
-
-echo "Input file : "$INPUTBS
-echo "Output     : "$OUTPUTBS
-echo
-echo "Conditions : "$CONDTAG
-echo "Geometry   : "$GEOMTAG
-echo "Trigger    : "$TRIGCONFIG
-echo
-
-test -n "$ASETUP" && ASETUP="--asetup \"$ASETUP\""
-
-eval TrigAndReco_tf.py --inputBS_OLDFile $INPUTBS --outputBS_TRIG_OLDFile $OUTPUTBS \
-    --imf false \
-    --triggerConfig $TRIGCONFIG \
-    --geometryVersion "b2tb:$GEOMTAG" --conditionsTag "b2tb:$CONDTAG" \
-    --copyJO "b2tb:TrigSimTransforms/skeleton.BStoTRIGBS.py" \
-    $ASETUP \
-    > log  2>&1
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO.py b/Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO.py
deleted file mode 100644
index 78f0df31fb19..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO.py
+++ /dev/null
@@ -1,211 +0,0 @@
-#-------------------------------------------------------------------------------
-SKIPEVENTS = 0
-#-------------------------------------------------------------------------------
-from AthenaCommon.AppMgr import theApp, ServiceMgr, ToolSvc
-from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-from AthenaCommon.GlobalFlags import globalflags
-from StoreGate.StoreGateConf import StoreGateSvc
-from StoreGate.StoreGateConf import ActiveStoreSvc
-from SGComps.SGCompsConf import ProxyProviderSvc
-#-------------------------------------------------------------------------------
-from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamEventStorageInputSvc
-from ByteStreamCnvSvc.ByteStreamCnvSvcConf import EventSelectorByteStream
-from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamCnvSvc
-from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ROBDataProviderSvc
-from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ByteStreamAddressProviderSvc
-#-------------------------------------------------------------------------------
-from AthenaPoolCnvSvc.AthenaPoolCnvSvcConf import AthenaPoolCnvSvc
-from PoolSvc.PoolSvcConf import PoolSvc
-from AthenaPoolServices.AthenaRootStreamerSvcConf import AthenaRootStreamerSvc
-from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import EventSelectorAthenaPool
-from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import AthenaPoolAddressProviderSvc
-from AthenaServices.AthenaServicesConf import MetaDataSvc
-#-------------------------------------------------------------------------------
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-#-------------------------------------------------------------------------------
-from AthenaCommon.Logging import logging
-logger = logging.getLogger("MergingTest")
-#-------------------------------------------------------------------------------
-
-# Needed for muon cabling config / athfile - atleast for the import below
-athenaCommonFlags.FilesInput = athenaCommonFlags.PoolRDOInput()
-
-globalflags.DetDescrVersion.set_Value_and_Lock(runArgs.geometryVersion)
-globalflags.ConditionsTag.set_Value_and_Lock(runArgs.conditionsTag)
-
-
-#-------------------------------------------------------------------------------
-# Shared configuration
-#-------------------------------------------------------------------------------
-theApp.EventLoop = "TrigSim::MergingEventLoopMgr/MergingEventLoopMgr"
-
-from TrigSimTransforms.TrigSimTransformsConf import TrigSim__MergingEventLoopMgr
-svcMgr += TrigSim__MergingEventLoopMgr("MergingEventLoopMgr")
-svcMgr.MergingEventLoopMgr.IncidentSvc      = svcMgr.IncidentSvc
-
-from AthenaCommon.DetFlags import DetFlags
-DetFlags.detdescr.all_setOn()
-DetFlags.dcs.all_setOn()
-DetFlags.makeRIO.all_setOff()
-
-DetFlags.readRDOPool.all_setOn()
-DetFlags.readRIOPool.all_setOn()
-DetFlags.readRDOBS.all_setOff()
-
-DetFlags.readRDOPool.LVL1_setOff()
-DetFlags.readRIOPool.LVL1_setOff()
-DetFlags.readRDOBS.LVL1_setOn()
-DetFlags.readRIOBS.LVL1_setOn()
-
-include("RecExCond/AllDet_detDescr.py")
-# svcMgr.GeoModelSvc.AutomaticGeometryVersion = True
-svcMgr.GeoModelSvc.IgnoreTagDifference = True
-
-import MuonCnvExample.MuonCablingConfig
-
-# PixelLorentzAngleSvc and SCTLorentzAngleSvc (see JIRA ATR-15109/ATEAM-339)
-from InDetRecExample.InDetJobProperties import InDetFlags
-include("InDetRecExample/InDetRecConditionsAccess.py")
-
-#-------------------------------------------------------------------------------
-
-#-------------------------------------------------------------------------------
-# BS conf.
-#-------------------------------------------------------------------------------
-# Store Gate
-svcMgr += StoreGateSvc("BSMetaDataStore")
-svcMgr += StoreGateSvc("BSStoreGate")
-
-svcMgr += ByteStreamEventStorageInputSvc("ByteStreamInputSvc")
-svcMgr.ByteStreamInputSvc.EventStore        = svcMgr.BSStoreGate
-svcMgr.ByteStreamInputSvc.MetaDataStore     = svcMgr.BSMetaDataStore
-svcMgr.EventSelector.Input      = athenaCommonFlags.BSRDOInput()
-
-svcMgr += EventSelectorByteStream("BSEventSelector")
-svcMgr.BSEventSelector.ByteStreamInputSvc = "ByteStreamInputSvc"
-svcMgr.BSEventSelector.SkipEvents = SKIPEVENTS
-
-svcMgr += ByteStreamCnvSvc()
-svcMgr.ByteStreamCnvSvc.IsSimulation = True
-
-svcMgr += ROBDataProviderSvc()
-
-svcMgr.EventPersistencySvc.CnvServices += [ "ByteStreamCnvSvc" ]
-
-
-svcMgr += ByteStreamAddressProviderSvc()
-
-from AthenaKernel import StoreID
-svcMgr.ByteStreamAddressProviderSvc.StoreID = StoreID.UNKNOWN
-
-"""
-# LVL1
-svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "DataVector<LVL1::TriggerTower>/TriggerTowers" ]
-svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "LVL1::JEPBSCollection/JEPBSCollection" ]
-svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "LVL1::JEPRoIBSCollection/JEPRoIBSCollection" ]
-svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "LVL1::CPBSCollection/CPBSCollection" ]
-svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "DataVector<LVL1::CPMRoI>/CPMRoIs" ]
-
-# LVL2
-svcMgr.ByteStreamAddressProviderSvc.TypeNames   += [ "HLT::HLTResult/HLTResult_L2" ]
-svcMgr.ByteStreamAddressProviderSvc.TypeNames   += [ "HLT::HLTResult/HLTResult_EF" ]
-
-svcMgr.ByteStreamAddressProviderSvc.TypeNames   += [ "CTP_RDO/CTP_RDO" ]
-svcMgr.ByteStreamAddressProviderSvc.TypeNames   += [ "MuCTPI_RDO/MuCTPI_RDO" ]
-"""
-svcMgr.ByteStreamAddressProviderSvc.TypeNames   += [ "MuCTPI_RDO/MuCTPI_RDO" ]
-svcMgr.ByteStreamAddressProviderSvc.TypeNames   += \
-        ['CTP_RDO/CTP_RDO',
-         'DataVector<LVL1::CMMCPHits>/CMMCPHits',
-         'DataVector<LVL1::CMMEtSums>/JEMEtSums',
-         'DataVector<LVL1::CMMJetHits>/CMMJetHits',
-         'DataVector<LVL1::CPMHits>/CPMHits',
-         'DataVector<LVL1::CPMRoI>/CPMRoIs',
-         'DataVector<LVL1::CPMTower>/CPMTowers',
-         'DataVector<LVL1::JEMEtSums>/JEMEtSums',
-         'DataVector<LVL1::JEMHits>/JEMHits',
-         'DataVector<LVL1::JEMRoI>/JEMRoIs',
-         'DataVector<LVL1::JetElement>/JetElements',
-         'DataVector<LVL1::TriggerTower>/TriggerTowers',
-         'HLT::HLTResult/HLTResult_L2',
-         'HLT::HLTResult/HLTResult_EF',
-         'LVL1::CMMRoI/CMMRoIs',
-#         'LVL1::CPBSCollection/CPBSCollection',
-#         'LVL1::JEPBSCollection/JEPBSCollection',
-#         'LVL1::JEPRoIBSCollection/JEPRoIBSCollection',
-        ]
-
-
-svcMgr += ProxyProviderSvc()
-svcMgr.ProxyProviderSvc.ProviderNames += [ "ByteStreamAddressProviderSvc" ]
-
-svcMgr.MergingEventLoopMgr.SecondaryEventStore       = svcMgr.BSStoreGate
-svcMgr.MergingEventLoopMgr.SecondaryEventSelector    = "BSEventSelector"
-#-------------------------------------------------------------------------------
-
-
-#-------------------------------------------------------------------------------
-# RDO conf
-#-------------------------------------------------------------------------------
-import AthenaPoolCnvSvc.ReadAthenaPool
-
-svcMgr.MergingEventLoopMgr.PrimaryEventStore    = svcMgr.StoreGateSvc
-svcMgr.MergingEventLoopMgr.PrimaryEventSelector = "EventSelector"
-
-svcMgr.AthenaPoolCnvSvc.PoolAttributes = [ "DEFAULT_BUFFERSIZE = '2048'" ]
-svcMgr.EventSelector.InputCollections = athenaCommonFlags.PoolRDOInput()
-svcMgr.PoolSvc.AttemptCatalogPatch = True
-
-#-------------------------------------------------------------------------------
-
-
-#-------------------------------------------------------------------------------
-# Setup merging
-#-------------------------------------------------------------------------------
-svcMgr.MergingEventLoopMgr.OverwritePrimaryTriggerInfo = True
-svcMgr.MergingEventLoopMgr.ShareSecondaryProxies = True
-#svcMgr.MergingEventLoopMgr.SharePrimaryProxies = True
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# AthenaOutputStreamTool
-#-------------------------------------------------------------------------------
-#http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Control/AthenaExamples/AthExThinning/share/WriteSlimmedData_jobOptions.py
-#import AthenaPoolCnvSvc.WriteAthenaPool
-svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DEFAULT_SPLITLEVEL ='0'" ]
-svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "STREAM_MEMBER_WISE = '1'" ]
-svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "DEFAULT_BUFFERSIZE = '32000'" ]
-svcMgr.AthenaPoolCnvSvc.PoolAttributes += [ "ContainerName = 'TTree=POOLContainer'; TREE_AUTO_FLUSH = '0'" ]
-
-from OutputStreamAthenaPool.CreateOutputStreams import AthenaPoolOutputStream
-ostream = AthenaPoolOutputStream("StreamRDO", athenaCommonFlags.PoolRDOOutput(), True)
-
-ostream.TakeItemsFromInput = True
-
-ostream.ItemList += [n.replace("/", "#") for n in svcMgr.ByteStreamAddressProviderSvc.TypeNames]
-
-
-
-#-------------------------------------------------------------------------------
-
-
-
-
-#-------------------------------------------------------------------------------
-# Print some post output post config
-#-------------------------------------------------------------------------------
-print(svcMgr)
-
-print(topSequence)
-
-print(DetFlags.Print())
-
-svcMgr.MessageSvc.debugLimit = 500000000
-
-
-svcMgr.InputMetaDataStore.Dump = True
-
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO_Example.py b/Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO_Example.py
deleted file mode 100644
index 51d5b3e52aa1..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/share/MergingEventLoopMgr_TriggerBSandRDOtoRDO_Example.py
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-athenaCommonFlags.PoolRDOInput      = [ "step1.x.RDO.pool.root" ]
-athenaCommonFlags.BSRDOInput        = [ "step3.x.RDOBS.data" ]
-athenaCommonFlags.PoolRDOOutput     =   "step4.x.RDO.pool.root"
-
-include("TrigSimTransforms/MergingEventLoopMgr_TriggerBSandRDOtoRDO.py")
-
-
-
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/share/athena_RDOtoBS.py b/Trigger/TriggerSimulation/TrigSimTransforms/share/athena_RDOtoBS.py
deleted file mode 100644
index 3214c045ed41..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/share/athena_RDOtoBS.py
+++ /dev/null
@@ -1,174 +0,0 @@
-# this runs
-
-
-## Algorithm AthSequencer/TopAlg:
-##     'EventCounter/EventCounter',
-##     'LVL1::TriggerTowerMaker/TriggerTowerMaker',
-##     'LVL1::CPMTowerMaker/CPMTowerMaker',
-##     'LVL1::JetElementMaker/JetElementMaker',
-##     'LVL1::EmTauTrigger/EmTauTrigger',
-##     'LVL1::JetTrigger/JetTrigger',
-##     'LVL1::EnergyTrigger/EnergyTrigger',
-##     'LVL1::ROD/ROD',
-##     'LVL1::CPCMMMaker/CPCMMMaker',
-##     'LVL1::JEPCMMMaker/JEPCMMMaker',
-##     'LVL1::TrigT1MBTS/LVL1::TrigT1MBTS',
-##     'MuonRdoToMuonDigit/MuonRdoToMuonDigit',
-##     'TrigT1RPC/TrigT1RPC',
-##     'LVL1TGCTrigger::LVL1TGCTrigger/LVL1TGCTrigger',
-##     'LVL1MUCTPI::L1Muctpi/L1Muctpi',
-##     'LVL1::TrigT1BCM/LVL1::TrigT1BCM',
-##     'LVL1::TrigT1TRT/LVL1::TrigT1TRT',
-##     'LVL1::TrigT1ZDC/LVL1::TrigT1ZDC',
-##     'LVL1CTP::CTPSimulation/CTPSimulation',
-##     'ROIB::RoIBuilder/RoIBuilder',
-##     'JetGlobalEventSetup/JetGlobalEventSetup',
-##     'JobInfo/JobInfo',
-##     'CreateLumiBlockCollectionFromFile/CreateLumiBlockCollectionFromFile']
-
-
-#-------------------------------------------------------------------------------
-# Authors:  Gorm Galster <gorm.galster@cern.ch>
-#           Joerg Stelzer <stelzer@cern.ch>
-# Date:     ~ December, 2012
-# About:    A job options file to convert a RDO from digitization to a
-#           byte stream file. Apparently this seem to require the running of
-#           L1 trigger. The L1 result is stripped (EventHeader info is NOT
-#           stripped at this point)
-#-------------------------------------------------------------------------------
-
-
-try:
-    include("PATJobTransforms/CommonSkeletonJobOptions.py")
-except NameError as e:
-    if not str(e) == "name 'runArgs' is not defined": raise e
-
-#-------------------------------------------------------------------------------
-from AthenaCommon.GlobalFlags import globalflags
-globalflags.DetGeo = "atlas"
-globalflags.DataSource = "geant4"
-#-------------------------------------------------------------------------------
-from AthenaCommon.AppMgr import ToolSvc
-
-# Disable AOD and ESD
-rec.doAOD.set_Value_and_Lock(False)
-rec.doESD.set_Value_and_Lock(False)
-
-# Enable BS writing
-rec.doWriteBS.set_Value_and_Lock(True)
-rec.doWriteBS   =   False
-rec.doWriteRDO  =   False
-rec.doWriteESD  =   False
-rec.doWriteAOD  =   False
-rec.doWriteTAG  =   False
-rec.doWriteTAGCOM = False
-
-# Define input
-rec.readRDO.set_Value_and_Lock(True)
-rec.readESD = False
-rec.readAOD = False
-rec.readTAG = False
-globalflags.InputFormat.set_Value_and_Lock('pool')
-
-# Do trigger
-rec.doTrigger.set_Value_and_Lock(True)
-recAlgs.doTrigger.set_Value_and_Lock(True)
-
-# Config trigger
-TriggerFlags.doLVL1.set_Value_and_Lock(True)   # this should be disabled in the future
-TriggerFlags.doHLT.set_Value_and_Lock(False)
-#-------------------------------------------------------------------------------
-TriggerFlags.configurationSourceList.set_Value_and_Lock(["xml"])
-
-# Forget truth
-rec.doTruth.set_Value_and_Lock(False)
-
-
-# Follow the "normal" reco
-include("RecExCommon/RecExCommon_topOptions.py")
-
-theApp.EvtMax = runArgs.maxEvents
-#theApp.SkipEvents = 7
-
-from TrigSimTransforms.rdo2bs_rodversion_setup import rod_version_setup
-
-rod_version_setup("17.1.3.4")
-
-
-# Blacklist the following modules, they are not wanted at this point
-_blacklist =  []
-#_blacklist += [ "CTP_RDO#*", "MuCTPI_RDO#*", "HLT::HLTResult#*", "ROIB::RoIBResult#*", ]
-#_blacklist += [ "DataVector<LVL1::TriggerTower>#TriggerTowers" ]
-#_blacklist += [ "LVL1::JEPBSCollection#JEPBSCollection" ] #
-#_blacklist += [ "LVL1::JEPRoIBSCollection#JEPRoIBSCollection" ]
-#_blacklist += [ "LVL1::CPBSCollection#CPBSCollection" ] #
-#_blacklist += [ "DataVector<LVL1::CPMRoI>#CPMRoIs" ]
-
-## _blacklist  = [ "CTP_RDO#*" ]
-## _blacklist += [ "DataVector<LVL1::CMMCPHits>#*" ]
-## _blacklist += [ "DataVector<LVL1::CMMEtSums>#*" ]
-## _blacklist += [ "DataVector<LVL1::CMMJetHits>#*" ]
-## _blacklist += [ "DataVector<LVL1::CPMHits>#*" ]
-## _blacklist += [ "DataVector<LVL1::CPMRoI>#*" ]
-## _blacklist += [ "DataVector<LVL1::CPMTower>#*" ]
-## _blacklist += [ "DataVector<LVL1::JEMEtSums>#*" ]
-## _blacklist += [ "DataVector<LVL1::JEMHits>#*" ]
-## _blacklist += [ "DataVector<LVL1::JEMRoI>#*" ]
-## _blacklist += [ "DataVector<LVL1::JetElement>#*" ]
-## _blacklist += [ "HLT::HLTResult#*" ]
-## _blacklist += [ "LVL1::CMMRoI#*" ]
-## _blacklist += [ "LVL1::CPBSCollection#*" ]
-## _blacklist += [ "LVL1::JEPBSCollection#*" ]
-## _blacklist += [ "LVL1::JEPRoIBSCollection#*" ]
-## _blacklist += [ "MuCTPI_RDO#*" ]
-## _blacklist += [ "ROIB::RoIBResult#*" ]
-
-StreamBSFileOutput.ItemList = [f for f in StreamBSFileOutput.ItemList if f not in _blacklist]
-# + [ "TileTTL1Container#TileTTL1Cnt", "LArTTL1Container#LArTTL1EM", "LArTTL1Container#LArTTL1HAD" ]
-
-StreamBSFileOutput.ItemList += [ "TileRawChannelContainer#*" ]
-# StreamBSFileOutput.ItemList += [ "TileTTL1Container#*" ]
-# StreamBSFileOutput.ItemList += [ "LVL1::MbtsCTP#*" ]
-del _blacklist
-
-print "JOERG These collections are in StreamBSFileOutput"
-for coll in StreamBSFileOutput.ItemList:
-    print "     ",coll
-
-
-
-from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamEventStorageOutputSvc
-
-svcMgr.ByteStreamCnvSvc
-
-# Gimme some good ol debug
-svcMgr.StoreGateSvc.Dump = True
-
-
-print "All Services:"
-for svc in svcMgr.getChildren():
-    print "       ",svc
-
-from AthenaCommon.AppMgr import theApp
-#theApp.EvtMax = 1
-#theApp.SkipEvents = 2
-
-svcMgr.ByteStreamCnvSvc.OutputLevel = DEBUG
-
-
-svcMgr.ByteStreamEventStorageOutputSvc.OutputLevel = DEBUG
-
-ToolSvc.LArRawDataContByteStreamTool.OutputLevel = VERBOSE
-ToolSvc.LArRawDataContByteStreamTool.DSPRunMode = 4
-ToolSvc.LArRawDataContByteStreamTool.RodBlockVersion = 10 
-
-MessageSvc.debugLimit = 100000
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-
-print "Algorithms"
-import AthenaCommon.Configurable as Configurable
-Configurable.log.setLevel( INFO )
-print svcMgr
-print topSequence
-
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/share/athena_RDOtoBS_Example.py b/Trigger/TriggerSimulation/TrigSimTransforms/share/athena_RDOtoBS_Example.py
deleted file mode 100644
index 0052a3b05485..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/share/athena_RDOtoBS_Example.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import os
-
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-athenaCommonFlags.PoolRDOInput.set_Value_and_Lock([ os.getenv('INPUTRDO',"../digiRDO.pool.root") ])
-athenaCommonFlags.BSRDOOutput.set_Value_and_Lock( os.getenv('OUTPUTBS',"digiBS.data") )
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-TriggerFlags.triggerConfig.set_Value_and_Lock("MCRECO:MC_pp_v2_loose_mc_prescale")
-
-from AthenaCommon.GlobalFlags import globalflags
-globalflags.ConditionsTag   = os.getenv('DIGICON',"OFLCOND-MC12-SDR-06")
-globalflags.DetDescrVersion = os.getenv('DIGIGEO',"ATLAS-GEO-18-01-01")
-
-include("TrigSimTransforms/athena_RDOtoBS.py")
-
-
-
-
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/share/skeleton.RDOtoBS.py b/Trigger/TriggerSimulation/TrigSimTransforms/share/skeleton.RDOtoBS.py
deleted file mode 100644
index e0ef53aae593..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/share/skeleton.RDOtoBS.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import logging
-log = logging.getLogger("RDOtoBS")
-
-log.info("="*20 + "Beginning of RDOtoBS" + "="*20)
-
-# Input and output
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-athenaCommonFlags.PoolRDOInput.set_Value_and_Lock(runArgs.inputRDOFile)
-athenaCommonFlags.BSRDOOutput.set_Value_and_Lock(runArgs.outputBS_OLDFile)
-athenaCommonFlags.EvtMax = -1
-if hasattr(runArgs, "skipEvents"): athenaCommonFlags.SkipEvents.set_Value_and_Lock(runArgs.skipEvents)
-
-# Trigger configuration
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-TriggerFlags.triggerConfig.set_Value_and_Lock(runArgs.triggerConfig)
-
-# Detector geometry and conditions data
-from AthenaCommon.GlobalFlags import globalflags
-globalflags.DetDescrVersion.set_Value_and_Lock(runArgs.geometryVersion)
-globalflags.ConditionsTag.set_Value_and_Lock(runArgs.conditionsTag)
-
-from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamEventStorageOutputSvc
-if hasattr(runArgs, "outputBSEformatVersion"):
-    ByteStreamEventStorageOutputSvc.EformatVersion = runArgs.outputBSEformatVersion
-if hasattr(runArgs, "outputBSEventStorageVersion"):
-    ByteStreamEventStorageOutputSvc.EventStorageVersion = runArgs.outputBSEventStorageVersion
-
-# disable check of geometry tags
-from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
-GeoModelSvc = GeoModelSvc()
-GeoModelSvc.IgnoreTagDifference = True
-
-include("TrigSimTransforms/athena_RDOtoBS.py")
-
-
-log.info("="*20 + "End of RDOtoBS" + "="*20)
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/share/skeleton.TRIGBStoRDO.py b/Trigger/TriggerSimulation/TrigSimTransforms/share/skeleton.TRIGBStoRDO.py
deleted file mode 100644
index abf49b8efaa0..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/share/skeleton.TRIGBStoRDO.py
+++ /dev/null
@@ -1,9 +0,0 @@
-
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-# input
-athenaCommonFlags.PoolRDOInput = runArgs.inputRDOFile
-athenaCommonFlags.BSRDOInput = runArgs.inputBS_TRIG_OLDFile
-# output
-athenaCommonFlags.PoolRDOOutput = runArgs.outputRDO_TRIG_OLDFile
-
-include("TrigSimTransforms/MergingEventLoopMgr_TriggerBSandRDOtoRDO.py")
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/src/MergingEventLoopMgr.cxx b/Trigger/TriggerSimulation/TrigSimTransforms/src/MergingEventLoopMgr.cxx
deleted file mode 100644
index fa2df603c4b9..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/src/MergingEventLoopMgr.cxx
+++ /dev/null
@@ -1,1018 +0,0 @@
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-//------------------------------------------------------------------------------
-/*
- *  Author:     Gorm Galster <gorm.galster@cern.ch>
- *  
- *  Purpose:    The purpose of the Merging event loop manager is to read a BS
- *              file and a RDO file simultanously to provide an interface for
- *              merging trigger information (from BS) with detector information
- *              (from RDO).
- *
- *  Credit:     Most of the code here is inspired by the original work done by
- *              Attila Krasznahorkay Jr. <Attila.Krasznahorkay@cern.ch> on the
- *              TwoInputEventLoopMgr for used for event-by-event BS comparison.
- *
- */
-//------------------------------------------------------------------------------
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-#include "EventInfo/EventType.h"
-#include "EventInfo/TriggerInfo.h"
-
-#include "SGTools/DataProxy.h"
-
-#include "TrigSteeringEvent/HLTResult.h"
-
-#include "AthenaKernel/IAthenaEvtLoopPreSelectTool.h"
-#include "AthenaKernel/ExtendedEventContext.h"
-#include "AthenaKernel/EventContextClid.h"
-
-#include "GaudiKernel/Algorithm.h"
-#include "GaudiKernel/Incident.h"
-#include "GaudiKernel/ThreadLocalContext.h"
-
-
-#include "MergingEventLoopMgr.h"
-
-
-
-
-//------------------------------------------------------------------------------
-/*
- * PLEASE READ: 
- *
- * There is little black magic and a lot of jazz to this. So read carefully.
- *
- * The objective here is to get access to the DataStore of a StoreGateSvc.
- * This is (seemingly) needed to manipulate the proxies directly.
- *
- * Unfortunately both the pointer, m_pStore, and the getter function, 
- * store(), is declared as private.
- *
- * The "clever" trick here is to use a suitable templated function and get write
- * a specialization of this function for some dummy class.
- *
- * Lets get started...
- *
- */
-/*
- * Include the necessary headers
- */
-#include "StoreGate/StoreGateSvc.h" 
-#include "SGTools/DataStore.h"
-/*
- * Define some dummy class in some protected/controled namespace to avoid
- * clashing with the intended behaviour of the function.
- */
-// namespace TrigSim {
-//     namespace Backdoor {
-//         class DSfromSG; // DetectoreStore from StoreGate
-//     }
-// }
-/*
- * I found the following templated function suitable:
- * 
- *  template <typename T>
- *  T* StoreGateSvc::retrieve ()
- *
- * Now the only thing left is to write the specialization of the function.
- * In the function definition one can of cause access private data members, but
- * we will still have to respect the function prototype:
- */
-// template <>
-// TrigSim::Backdoor::DSfromSG* StoreGateSvc::retrieve<TrigSim::Backdoor::DSfromSG>() {
-//   return (TrigSim::Backdoor::DSfromSG *) m_pStore;
-// }
-/*
- * Usage will be:
- *
- *  DataStorage *pDS = (DataStorage *) pSG->retrieve<TrigSim::BackDoor::DSfromSG>();
- *
- */
-//------------------------------------------------------------------------------
-
-
-
-
-
-
-
-
-
-
-
-
-//------------------------------------------------------------------------------
-namespace TrigSim {
-//------------------------------------------------------------------------------
-
-
-
-
-//------------------------------------------------------------------------------
-    /*
-     * Take the vector with proxy pointers and populate the name-to-proxy map
-     * as well as the set of proxy names
-     */
-    inline
-    void proxyContainerPopulate(std::vector<const SG::DataProxy *> vector,
-                std::map<std::string, SG::DataProxy *> *map,
-                std::set<std::string>                  *names
-            ) {
-
-        for(std::vector<const SG::DataProxy *>::iterator it = vector.begin();
-                it != vector.end(); ++it) {
-
-            (*it)->isValid();
-
-            names->insert((*it)->name());
-
-            // Const cast as we will not respect the constness
-            (*map)[(*it)->name()] = const_cast<SG::DataProxy *> (*it);
-        }
-    }
-//------------------------------------------------------------------------------
-
-
-
-
-//------------------------------------------------------------------------------
-    MergingEventLoopMgr::MergingEventLoopMgr(const std::string& name,
-                                             ISvcLocator* svcLoc)
-            : MinimalEventLoopMgr(name, svcLoc),
-              m_incidentSvc             ("IncidentSvc",  name),
-              m_primEvtStore            ("StoreGateSvc", name),
-              m_secEvtStore             ("StoreGateSvc", name),
-              m_primEvtSelector         (0),
-              m_primEvtContext          (0),
-              m_primEvtSelName          ("EventSelector"),
-              m_secEvtSelector          (0),
-              m_secEvtContext           (0),
-              m_secEvtSelName           ("EventSelector"),
-              m_currentRun              (0),
-              m_firstRun                (true),
-              m_nEvt                    (0),
-              m_log                     (msgSvc(), name) {
-
-        // Body of constructor
-        declareProperty("IncidentSvc", m_incidentSvc);
-
-        declareProperty("PrimaryEventStore",   m_primEvtStore);
-        declareProperty("SecondaryEventStore", m_secEvtStore);
-
-        declareProperty("PrimaryEventSelector",   m_primEvtSelName);
-        declareProperty("SecondaryEventSelector", m_secEvtSelName);
-
-
-        /*
-         * Steering options
-         */
-        declareProperty("OverwritePrimaryTriggerInfo",
-                        m_overwritePrimTriggerInfo = false,
-                        "Overwrite the TriggerInfo object in the primary stream with that from the secondary stream"
-                );
-        declareProperty("OverwriteSecondaryTriggerInfo",
-                        m_overwriteSecTriggerInfo = false,
-                        "Overwrite the TriggerInfo object in the secondary stream with that from the primary stream"
-                );
-
-        declareProperty("SharePrimaryProxies",
-                        m_sharePrimProxies = false,
-                        "Provide the proxies of the primary event store to the secondary event store"
-                );
-        
-        declareProperty("ShareSecondaryProxies",
-                        m_shareSecProxies = false,
-                        "Provide the proxies of the primary event store to the secondary event store"
-                );
-        
-        declareProperty("SafeProxySharing",
-                        m_shareProxiesSafe = true,
-                        "Try to avoid clashes when sharing proxies."
-                );
-
-    }
-//------------------------------------------------------------------------------
-    MergingEventLoopMgr::~MergingEventLoopMgr() {
-    } 
-//------------------------------------------------------------------------------
-    StatusCode MergingEventLoopMgr::initialize() {
-        /*
-         * Print some welcome message:
-         */
-        m_log.setLevel( m_outputLevel.value() );
-
-        m_log << MSG::INFO << "Initializing TrigSim::MergingEventLoopMgr/" << name() << endmsg;
-
-        /*
-         * Does the steering make sense
-         */
-        if(m_overwritePrimTriggerInfo && m_overwriteSecTriggerInfo) {
-            m_log << MSG::FATAL << "Can not overwrite both primary and secondary TriggerInfo"
-                  << endmsg;
-
-            return StatusCode::FAILURE;
-        }
-
-
-
-
-        /*
-         * Initialise the base class:
-         */
-        StatusCode sc = MinimalEventLoopMgr::initialize();
-        if(sc.isFailure()) {
-            m_log << MSG::FATAL << "Failed to initialize MinimalEventLoopMgr base class"
-                  << endmsg;
-            return sc;
-        }
-
-        /*
-         * Retrieve the incident service:
-         */
-        sc = m_incidentSvc.retrieve();
-        if(sc.isFailure()) {
-            m_log << MSG::FATAL << "Failed to retrieve handle to the incident service"
-                  << endmsg;
-            return sc;
-        }
-
-        /*
-         * Retrieve the primary SG service:
-         */
-        sc = m_primEvtStore.retrieve();
-        if(sc.isFailure()) {
-            m_log << MSG::FATAL << "Failed to retrieve handle to the primary StoreGateSvc"
-                  << endmsg;
-            return sc;
-        }
-        
-        /*
-         * Retrieve the secondary SG service:
-         */
-
-        sc = m_secEvtStore.retrieve();
-        if(sc.isFailure()) {
-            m_log << MSG::FATAL << "Failed to retrieve handle to the BS StoreGateSvc"
-                  << endmsg;
-            return sc;
-        }
-
-
-        /*
-         * Set up the primary event selector service:
-         */
-        sc = serviceLocator()->service(m_primEvtSelName.value(),
-                                       m_primEvtSelector);
-        if(sc.isFailure()) {
-            m_log << MSG::FATAL << "Failed to access primary event selector called: "
-                  << m_primEvtSelName.value() << endmsg;
-            throw GaudiException("No valid primary event selector", name(),
-                                 StatusCode::FAILURE);
-        }
-
-        sc = m_primEvtSelector->createContext(m_primEvtContext);
-        if(sc.isFailure()) {
-            m_log << MSG::FATAL << "Failed to setup the primary event selector context"
-                  << endmsg;
-            throw GaudiException("Failed to setup the primary event selector context",
-                                 name(), StatusCode::FAILURE);
-        }
-
-        Service* theSvc = dynamic_cast< Service* >(m_primEvtSelector);
-        if(!theSvc) {
-            m_log << MSG::FATAL
-                  << "Failed to cast the primary event selector into a Service"
-                  << endmsg;
-            return StatusCode::FAILURE;
-        }
-        m_log << MSG::INFO << "Setup primary EventSelector service: " << theSvc->name()
-              << endmsg;
-
-
-        
-        /*
-         * Set up the secondary event selector service:
-         */
-
-        sc = serviceLocator()->service(m_secEvtSelName.value(),
-                                       m_secEvtSelector);
-        if(sc.isFailure()) {
-            m_log << MSG::FATAL << "Failed to access BS event selector called: "
-                  << m_secEvtSelName.value() << endmsg;
-            throw GaudiException("No valid BS event selector", name(),
-                                 StatusCode::FAILURE);
-        }
-
-        sc = m_secEvtSelector->createContext(m_secEvtContext);
-        if(sc.isFailure()) {
-            m_log << MSG::FATAL << "Failed to setup the BS event selector context"
-                  << endmsg;
-            throw GaudiException("Failed to setup the BS event selector context",
-                                 name(), StatusCode::FAILURE);
-        }
-
-        theSvc = dynamic_cast< Service* >(m_secEvtSelector);
-        if(!theSvc) {
-            m_log << MSG::FATAL
-                  << "Failed to cast the BS event selector into a Service"
-                  << endmsg;
-            return StatusCode::FAILURE;
-        }
-        m_log << MSG::INFO << "Setup BS EventSelector service: " << theSvc->name()
-              << endmsg;
-
-        // Get the AlgExecStateSvc
-        m_aess = serviceLocator()->service("AlgExecStateSvc");
-        if( !m_aess.isValid() ) {
-          fatal() << "Error retrieving AlgExecStateSvc" << endmsg;
-          return StatusCode::FAILURE;
-        }
-
-        return StatusCode::SUCCESS;
-    }
-//------------------------------------------------------------------------------
-    StatusCode MergingEventLoopMgr::finalize() {
-        
-        /*
-         * Finalize base class
-         */
-
-        StatusCode sc = MinimalEventLoopMgr::finalize();
-        if(sc.isFailure()) {
-            m_log << MSG::ERROR << "Failed to finalize MinimalEventLoopMgr base class"
-                  << endmsg;
-            return StatusCode::FAILURE;
-        }
-
-
-        /*
-         * Release remaining services and jazz..
-         */
-
-        m_incidentSvc.release().ignore();
-
-        m_primEvtSelector = releaseInterface(m_primEvtSelector);
-        delete m_primEvtContext; m_primEvtContext = 0;
-
-        m_secEvtSelector  = releaseInterface(m_secEvtSelector);
-        delete m_secEvtContext; m_secEvtContext = 0;
-        
-        return StatusCode::SUCCESS;
-    }
-//------------------------------------------------------------------------------
-    StatusCode MergingEventLoopMgr::nextEvent(int maxEvt) {
-        m_log << MSG::INFO << "Entering nextEvent(...)" << endmsg;
-        
-        StatusCode sc;
-
-        /*
-         * Loop over "all" events...
-         */
-        while( maxEvt == -1 || m_nEvt < maxEvt ) {
-
-            
-            /*
-             * Get primary event
-             */
-            
-            const EventInfo* pPrimEvt = 0;
-
-            if(m_primEvtContext) {
-                IOpaqueAddress* primAddr = 0;
-           
-                sc = m_primEvtSelector->next(*m_primEvtContext);
-
-                if(sc.isFailure()) {
-                    m_log << MSG::INFO << "No more events in primary event selection"
-                          << endmsg;
-                    sc = StatusCode::SUCCESS;
-                    break;
-                }
-
-                if (m_primEvtSelector->createAddress(*m_primEvtContext, primAddr).isFailure()) {
-                    m_log << MSG::ERROR  << "Could not create a primary IOpaqueAddress"
-                          << endmsg;
-                    break;
-                } 
-            
-                if (primAddr != 0) {
-                    sc = m_primEvtStore->recordAddress(primAddr);
-                    if(!sc.isSuccess()) {
-                        m_log << MSG::WARNING << "Error declaring primary Event object"
-                              << endmsg;
-                        break;
-                    }
-                }
-
-                if ((sc=m_primEvtStore->loadEventProxies()).isFailure()) {
-                    m_log << MSG::ERROR  << "Error loading primary event proxies"
-                          << endmsg;
-                    break;
-                }
-
-                sc = m_primEvtStore->retrieve(pPrimEvt);
-                if( !sc.isSuccess() ) {
-                    m_log << MSG::ERROR << "Unable to retrieve primary Event root object"
-                          << endmsg;
-                    break;
-                }
-            } // primary context
-
-
-            /*
-             * Get secondary event
-             */
-            
-            const EventInfo* pSecEvt = 0;
-            
-            if(m_secEvtContext) {
-                IOpaqueAddress* secAddr = 0;
-           
-                sc = m_secEvtSelector->next(*m_secEvtContext);
-                
-                if(sc.isFailure()) {
-                    m_log << MSG::INFO << "No more events in secondary event selection"
-                          << endmsg;
-                    sc = StatusCode::SUCCESS;
-                    break;
-                }
-
-                if (m_secEvtSelector->createAddress(*m_secEvtContext, secAddr).isFailure()) {
-                    m_log << MSG::ERROR  << "Could not create a secondary IOpaqueAddress"
-                          << endmsg;
-                    break;
-                } 
-            
-                if (secAddr != 0) {
-                    sc = m_secEvtStore->createProxy(secAddr);
-                    if(!sc.isSuccess()) {
-                        m_log << MSG::WARNING << "Error declaring secondary Event object"
-                              << endmsg;
-                        break;
-                    }
-                }
-
-                if ((sc=m_secEvtStore->loadEventProxies()).isFailure()) {
-                    m_log << MSG::ERROR  << "Error loading secondary event proxies"
-                          << endmsg;
-                    break;
-                }
-
-                sc = m_secEvtStore->retrieve(pSecEvt);
-                if( !sc.isSuccess() ) {
-                    m_log << MSG::ERROR << "Unable to retrieve secondary Event root object"
-                          << endmsg;
-                    break;
-                }
-            } // secondary context
-
-        
-            /*
-             * Check if primary event matches secondary event.
-             * NOTE: A sneakier way could have been found to do this,
-             *       but for current purposes, events lines up nicely
-             */
-
-            if( pPrimEvt == 0 || pSecEvt == 0
-                || pPrimEvt->event_ID()->event_number() != pSecEvt->event_ID()->event_number()
-                || pPrimEvt->event_ID()->run_number() != pSecEvt->event_ID()->run_number()) {
-
-                m_log << MSG::ERROR << "EventInfo for primary and secondary differs or could not be retreived. This scenario has NOT been counted for (yet)."
-                      << endmsg;
-                sc = StatusCode::FAILURE;
-                break;
-            }
-
-            m_eventContext.setEventID( *((EventIDBase*) pPrimEvt->event_ID()) );
-            m_eventContext.set(m_nEvt,0);
-            m_eventContext.setExtension( Atlas::ExtendedEventContext( m_primEvtStore->hiveProxyDict(),
-                                                                      pPrimEvt->event_ID()->run_number() ) );
-
-            Gaudi::Hive::setCurrentContext( m_eventContext );
-
-            m_aess->reset(m_eventContext);
-            if (m_primEvtStore->record(std::make_unique<EventContext> (m_eventContext),
-                                       "EventContext").isFailure())
-            {
-              m_log << MSG::ERROR 
-                    << "Error recording event context object" << endmsg;
-              return (StatusCode::FAILURE);
-            }
-
-
-            /*
-             * Start new/first run if necessary
-             */
-
-            if(m_currentRun != pPrimEvt->event_ID()->run_number() || m_firstRun) {
-
-                if(!m_firstRun) {
-                    m_incidentSvc->fireIncident(Incident( name(), "EndRun"));
-                }
-
-                m_currentRun = pPrimEvt->event_ID()->run_number();
-                m_firstRun = false;
-
-                m_incidentSvc->fireIncident(Incident(name(),IncidentType::BeginRun,Gaudi::Hive::currentContext()));
-            }
-
-
-
-
-
-
-
-
-            /*
-             *  Fire suitable incident
-             */
-
-            m_incidentSvc->fireIncident(Incident(name(),IncidentType::BeginEvent,Gaudi::Hive::currentContext()));
-
-
-
-            
-            /*
-             * Owerwrite the TriggerInfo in EventInfo if asked.
-             */
-            
-            if(m_overwritePrimTriggerInfo || m_overwriteSecTriggerInfo) {
-                
-                EventInfo *from = (EventInfo *)(m_overwritePrimTriggerInfo ? pSecEvt  : pPrimEvt);
-                EventInfo *to =   (EventInfo *)(m_overwritePrimTriggerInfo ? pPrimEvt : pSecEvt);
-
-                sc = overwriteTriggerInfo(from, to);
-
-                if(sc.isFailure()) {
-                    m_log << MSG::ERROR << "Failed to overwrite the primary TriggerInfo."
-                          << endmsg;
-                    break;
-                }
-            }
-
-
-            /*
-             * Share proxies
-             */
-            if(m_sharePrimProxies || m_shareSecProxies) {
-                m_log << MSG::INFO << "Setting up proxy sharing. Trouble may lie ahead..." << endmsg;
-                
-                /*
-                 * Get and order primary proxies
-                 */
-                std::map<std::string, SG::DataProxy *> primProxyMap;
-                std::set<std::string> *                primProxyNames = new std::set<std::string>;
-                proxyContainerPopulate(m_primEvtStore->proxies(), &primProxyMap, primProxyNames);
-
-                /*
-                m_log << MSG::DEBUG << "Got " << primProxyNames->size()<< " primary proxies."
-                      << endmsg;
-                for(std::set<std::string>::iterator it = primProxyNames->begin();
-                        it != primProxyNames->end(); ++it) {
-                    m_log << MSG::DEBUG << "Primary proxy:   " << (*it)
-//                          << " @ " << primProxyMap[(*it)]
-                          << endmsg;
-                }
-                */
-
-
-                /*
-                 * Get and order secondary proxies
-                 */
-                std::map<std::string, SG::DataProxy *> secProxyMap;
-                std::set<std::string> *                secProxyNames = new std::set<std::string>;
-                proxyContainerPopulate(m_secEvtStore->proxies(), &secProxyMap, secProxyNames);
-
-
-                /*
-                m_log << MSG::DEBUG << "Got " << secProxyNames->size()<< " secondary proxies."
-                      << endmsg;
-                for(std::set<std::string>::iterator it = secProxyNames->begin();
-                        it != secProxyNames->end(); ++it) {
-                    m_log << MSG::DEBUG << "Secondary proxy: " << (*it)
-//                          << " @ " << secProxyMap[(*it)]
-                          << endmsg;
-                }
-                */
-
-
-                /*
-                 * Make a blacklist and start by filling it with the intersecting proxies
-                 * as intersecting names/proxies can not be "shared" in this sense
-                 */
-                std::set<std::string> blacklist;
-                std::set_intersection(primProxyNames->begin(),      primProxyNames->end(),
-                                      secProxyNames->begin(),       secProxyNames->end(),
-                                      std::inserter(blacklist,      blacklist.begin()));
-
-
-                
-                /*
-                 *  Don't allow the EventInfo to be mirrored.
-                 */
-                blacklist.insert(m_primEvtStore->proxy(pPrimEvt)->name());
-                blacklist.insert(m_secEvtStore->proxy(pSecEvt)->name());
-
-
-                if(m_shareProxiesSafe) {
-                    /* BS proxy/proxies known to cause problems */
-                    blacklist.insert("ByteStreamDataHeader");
-
-                    
-                    /* RDO proxy/proxies known to cause problems */
-                    blacklist.insert("Input");
-                }
-
-
-                /*
-                 * Remove affected proxies
-                 */
-                for(std::set<std::string>::iterator it = blacklist.begin();
-                        it != blacklist.end(); ++it) {
-                    primProxyMap.erase((*it));
-                    secProxyMap.erase((*it));
-                }
-
-                
-                
-                
-                
-                /*
-                 * From here on, don't rely on the list of proxy names
-                 */
-                delete primProxyNames;  primProxyNames = 0;
-                delete secProxyNames;   secProxyNames = 0;
-
-
-
-
-
-                /*
-                 *
-                 *
-                 *      Future potential for other hooks here.
-                 *
-                 *
-                 */
-
-
-
-
-
-
-                /*
-                 * Get DataStore handles
-                 */
-                // SG::DataStore *primDataStore = (SG::DataStore *)m_primEvtStore->retrieve<Backdoor::DSfromSG>();
-                // SG::DataStore *secDataStore  = (SG::DataStore *)m_secEvtStore->retrieve<Backdoor::DSfromSG>();
-
-
-                /*
-                 * Setup sharing of the primary proxies
-                 */
-                if(m_sharePrimProxies) {
-                    m_log << MSG::INFO << "Setting up sharing of primary proxies..."
-                        << endmsg;
-
-                    for(std::map<std::string, SG::DataProxy *>::iterator it = primProxyMap.begin();
-                            it != primProxyMap.end(); ++it) {
-            
-                        if (! it->second->address()) continue;
-
-                        m_log << MSG::INFO << "Adding primary proxy '" << it->first << "' to secondary data store."
-                              //<< " Proxy is " << (it->second->isValid() ? "" : "NOT ") << "valid"
-                              << endmsg;
-
-			// sc = secDataStore->addToStore(it->second->address()->clID(), it->second);
-                        sc = m_secEvtStore->addToStore(it->second->address()->clID(), it->second);
-
-                        if(sc.isFailure()) break;
-                    }
-                }
-
-
-
-
-                /*
-                 * Setup sharing of the secondary proxies
-                 */
-                if(m_shareSecProxies) {
-                    m_log << MSG::INFO << "Setting up sharing of secondary proxies..."
-                        << endmsg;
-
-                    for(std::map<std::string, SG::DataProxy *>::iterator it = secProxyMap.begin();
-                            it != secProxyMap.end(); ++it) {
-            
-                        if (! it->second->address()) continue;
-
-                        m_log << MSG::INFO << "Adding secondary proxy '" << it->first << "' to primary data store."
-                              //<< " Proxy is " << (it->second->isValid() ? "" : "NOT ") << "valid"
-                              << endmsg;
-
-			// sc = primDataStore->addToStore(it->second->address()->clID(), it->second);
-                        sc = m_primEvtStore->addToStore(it->second->address()->clID(), it->second);
-
-                        if(sc.isFailure()) break;
-                    }
-                }
-
-                if(sc.isFailure()) {
-                    m_log << MSG::ERROR << "Failed to set up proxy sharing of secondary proxies"
-                          << endmsg;
-                    sc = StatusCode::FAILURE;
-                    break;
-                }
-            } // proxy sharing
-
-
-
-
-
-            sc = loadObjects();
-            if(sc.isFailure()) {
-                m_log << MSG::ERROR << "Failure while preloading data."
-                      << endmsg;
-                break;
-            }
-
-            /*
-             * Print some info about the process of execution
-             */
-
-            m_log << MSG::INFO << "  ===>>>  start processing of event #"
-                  << pPrimEvt->event_ID()->event_number() << ", run #" << pPrimEvt->event_ID()->run_number()
-                  << ". " << m_nEvt << " events processed so far  <<<==="
-                  << endmsg;
-
-            m_log << MSG::DEBUG << " ===>>> dumping trigger info for primary event: <<<==="
-                  << (*pPrimEvt->trigger_info())
-                  << endmsg;
-
-            m_log << MSG::DEBUG << " ===>>> dumping trigger info for primary event: <<<==="
-                  << (*pSecEvt->trigger_info())
-                  << endmsg;
-
-
-
-            /*
-             * Execute algorithms
-             */
-
-            sc = executeAlgorithms();
-
-            if(sc.isFailure()) {
-                m_aess->setEventStatus( EventStatus::AlgFail, m_eventContext );
-                m_log << MSG::ERROR << "Failure during algorithm execute."
-                      << endmsg;
-                break;
-            }
-
-            m_aess->setEventStatus( EventStatus::Success, m_eventContext );
-
-
-            /*
-
-            SG::DataStore *dataStoreRDO = (SG::DataStore *)m_primEvtStore->retrieve<Backdoor::DSfromSG>();
-            SG::DataStore *dataStoreBS  = (SG::DataStore *)m_secEvtStore->retrieve<Backdoor::DSfromSG>();
-
-            std::vector<const SG::DataProxy*> proxiesBS = m_secEvntStore->proxies();
-            m_log << MSG::DEBUG << "Found " << proxiesBS.size() << " proxies. Starting mirroring." << endmsg;
-           
-
-
-
-            std::vector<const SG::DataProxy*>::iterator it;
-            for(it = proxiesBS.begin(); it != proxiesBS.end(); it++) {
-                SG::DataProxy *proxy = (SG::DataProxy *)(*it);
-
-                m_log << MSG::DEBUG << "Found proxy " << proxy->name()
-                      << endmsg;
-                if(!proxy->isValid() ||
-                    proxy->name() == "Input" ||
-                    proxy->name() == "ByteStreamDataHeader" ||
-                    proxy->name() == "ByteStreamEventInfo") {
-                    continue;
-                }
-
-                sc = dataStoreRDO->addToStore(proxy->address()->clID(), proxy);
-                if(sc.isFailure()) {
-                    m_log << MSG::ERROR << "Failed to mirror proxy " << proxy->name()
-                          << endmsg;
-                }
-            }
-            
-            
-            const HLT::HLTResult* l2ResultRDO;
-            m_primaryEventStore->retrieve(l2ResultRDO, "HLTResult_L2" ).ignore();
-            */
-
-            //const HLT::HLTResult* l2ResultRDO;
-            //m_primEvtStore->retrieve(l2ResultRDO, "HLTResult_L2").ignore();
-
-
-
-
-
-
-
-            m_log << MSG::DEBUG << " ===>>> dumping primary StoreGate: <<<==="
-                  << m_primEvtStore->dump()
-                  << endmsg;
-            m_log << MSG::DEBUG << " ===>>> dumping secondary StoreGate: <<<==="
-                  << m_secEvtStore->dump()
-                  << endmsg;
-
-            
-
-
-
-
-
-            /*
-             *  Fire suitable incident
-             */
-            m_incidentSvc->fireIncident(Incident(name(),IncidentType::EndEvent,Gaudi::Hive::currentContext()));
-
-
-
-            /*
-             *  Increment the counter
-             */
-            ++m_nEvt;
-
-            
-            /*
-             * Dump store gates for debug
-             */
-/*
-            m_log << MSG::DEBUG << " ===>>> dumping primary StoreGate: <<<==="
-                  << m_primEvtStore->dump()
-                  << endmsg;
-            m_log << MSG::DEBUG << " ===>>> dumping secondary StoreGate: <<<==="
-                  << m_secEvtStore->dump()
-                  << endmsg;
-*/
-            
-
-            /*
-             * Clear store gate(s)
-             */
-
-            sc = m_primEvtStore->clearStore();
-            if(sc.isFailure()) {
-                m_log << MSG::ERROR << "Failed to clear primary event store"
-                      << endmsg;
-                break;
-            }
-           
-            sc = m_secEvtStore->clearStore();
-            if(sc.isFailure()) {
-                m_log << MSG::ERROR << "Failed to clear secondary event store"
-                      << endmsg;
-                break;
-            }
-            
-
-        } // the big while loop
-
-
-        m_incidentSvc->fireIncident(Incident(name(), "EndRun"));
-
-        return sc;
-    }
-//------------------------------------------------------------------------------
-    StatusCode MergingEventLoopMgr::executeEvent(EventContext && /*ctx*/) {
-      m_log << MSG::FATAL
-              << "executeEvent(...) is not implemented for MergingEventLoopMgr"
-              << endmsg;
-        return StatusCode::FAILURE;
-    }
-//------------------------------------------------------------------------------
-    StatusCode MergingEventLoopMgr::executeRun(int maxEvt) {
-        m_log << MSG::INFO << "Entering executeRun(...)" << endmsg;
-        
-        if(initializeAlgorithms().isFailure()) {
-            m_log << MSG::ERROR  << "One or more algorithms failed to initialize"
-                  << endmsg;
-            return StatusCode::FAILURE;
-        }
-
-        m_incidentSvc->fireIncident(Incident(name(), "BeginEvtLoop"));
-
-        StatusCode sc = nextEvent(maxEvt);
-        
-        m_incidentSvc->fireIncident(Incident(name(), "EndEvtLoop"));
-
-        return sc;
-    }
-//------------------------------------------------------------------------------
-    StatusCode MergingEventLoopMgr::seek(int /*evt*/) {
-        m_log << MSG::ERROR
-              << "seek() is not implemented for MergingEventLoopMgr"
-              << endmsg;
-        return StatusCode::FAILURE;
-    }
-//------------------------------------------------------------------------------
-    int MergingEventLoopMgr::curEvent() {
-        return m_nEvt; 
-    } 
-//------------------------------------------------------------------------------
-    StatusCode MergingEventLoopMgr::initializeAlgorithms() {
-        bool failed = false;
-
-        ListAlg::iterator it;
-        for(it = m_topAlgList.begin(); it != m_topAlgList.end(); ++it) {
-            m_log << MSG::DEBUG << "Initializong algorithm: "
-                  << (*it)->name() << endmsg;
-
-            if((*it)->sysInitialize().isFailure()) {
-                m_log << MSG::ERROR << "Unable to initialize algorithm: "
-                      << (*it)->name() << endmsg;
-                failed = true;
-            } 
-        }
-
-        for(it = m_outStreamList.begin(); it != m_outStreamList.end(); ++it) {
-            m_log << MSG::INFO << "Initialize Output Stream: "
-                  << (*it)->name() << endmsg;
-            if((*it)->sysInitialize().isFailure()) {
-                m_log << MSG::ERROR << "Unable to initialize Output Stream: "
-                      << (*it)->name() << endmsg;
-                failed = true;
-            }
-        }
-
-
-        return failed ? StatusCode::FAILURE : StatusCode::SUCCESS;
-    }
-
-//------------------------------------------------------------------------------
-    StatusCode MergingEventLoopMgr::executeAlgorithms() {
-
-        for(ListAlg::iterator it = m_topAlgList.begin(); it != m_topAlgList.end(); ++it) {
-
-            const StatusCode& sc = (*it)->sysExecute(m_eventContext); 
-            // this duplicates what is already done in Algorithm::sysExecute, which
-            // calls Algorithm::setExecuted, but eventually we plan to remove that 
-            // function
-            m_aess->algExecState(*it,m_eventContext).setState(AlgExecState::State::Done, sc);
-
-            if(sc.isFailure()) {
-                m_log << MSG::ERROR << "Algorithm failed in sysExecute(): "
-                      << (*it)->name() << endmsg;
-                return sc;
-            } 
-        }
-        return StatusCode::SUCCESS;
-    }
-//------------------------------------------------------------------------------
-    StatusCode MergingEventLoopMgr::overwriteTriggerInfo(EventInfo *pFrom, EventInfo *pTo) {
-        m_log << MSG::INFO << "Overwriting TriggerInfo..." << endmsg;
-        
-        pTo->setTriggerInfo(new TriggerInfo(*pFrom->trigger_info()));
-       
-        return StatusCode::SUCCESS;
-    } 
-//------------------------------------------------------------------------------
-    StatusCode MergingEventLoopMgr::loadObjects() {
-
-        SG::DataProxy *proxy;
-        std::vector<const SG::DataProxy *> proxies;
-        std::vector<const SG::DataProxy *>::iterator it;
-        
-        proxies = m_primEvtStore->proxies();
-        for(it = proxies.begin(); it != proxies.end(); ++it) {
-            proxy = const_cast<SG::DataProxy *>(*it);
-            proxy->accessData();
-        }
-        
-        proxies = m_secEvtStore->proxies();
-        for(it = proxies.begin(); it != proxies.end(); ++it) {
-            proxy = const_cast<SG::DataProxy *>(*it);
-            proxy->accessData();
-        }
-        
-
-        return StatusCode::SUCCESS;
-    }
-    
-    
-
-    
-
-
-
-
-
-
-
-
-
-//------------------------------------------------------------------------------
-} // Namespace TrigSim
-//------------------------------------------------------------------------------
-
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/src/MergingEventLoopMgr.h b/Trigger/TriggerSimulation/TrigSimTransforms/src/MergingEventLoopMgr.h
deleted file mode 100644
index 7fc857924458..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/src/MergingEventLoopMgr.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-//------------------------------------------------------------------------------
-#ifndef __TRIGSIMTRANSFORMS_MERGINGEVENTLOOPMGR_H_
-#define __TRIGSIMTRANSFORMS_MERGINGEVENTLOOPMGR_H_
-//------------------------------------------------------------------------------
-// Gaudi/Athena include(s):
-#include "GaudiKernel/MinimalEventLoopMgr.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/MsgStream.h"
-#include "Gaudi/Property.h"
-#include "GaudiKernel/IEvtSelector.h"
-#include "GaudiKernel/IIncidentSvc.h"
-#include "GaudiKernel/EventContext.h"
-#include "GaudiKernel/IAlgExecStateSvc.h"
-
-#include "StoreGate/StoreGateSvc.h"
-#include "SGTools/DataStore.h"
-
-#include "EventInfo/EventID.h"
-#include "EventInfo/EventInfo.h"
-
-//------------------------------------------------------------------------------
-namespace TrigSim {
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-    class MergingEventLoopMgr : public MinimalEventLoopMgr {
-        
-    protected:
-      /// Reference to the Algorithm Execution State Svc
-      SmartIF<IAlgExecStateSvc>  m_aess;
-
-    public:
-        // Constructor
-        MergingEventLoopMgr(const std::string& name, ISvcLocator* svcLoc);
-        // Destructor
-        virtual ~MergingEventLoopMgr();
-
-        // Function initialising the event loop manager
-        virtual StatusCode initialize();
-        // Function finalising the event loop manager
-        virtual StatusCode finalize();
-        // Function running the event loop itself
-        virtual StatusCode nextEvent(int maxEvt);
-        // Function processing one input event
-        virtual StatusCode executeEvent(EventContext &&ctx);
-        // Function looping over one run (the same as nextEvent(int) for now
-        virtual StatusCode executeRun(int maxEvt);
-        // Function seeking to a given event (not implemented)
-        virtual StatusCode seek(int evt);
-        // Function returning the current event number
-        virtual int curEvent();
-        
-
-
-        // Dealing with algorithms
-        StatusCode initializeAlgorithms();
-        StatusCode executeAlgorithms();
-   
-
-        // Handle for the incident service
-        ServiceHandle< IIncidentSvc > m_incidentSvc;
-        
-        
-        // Handle for the two store gate services
-        ServiceHandle< StoreGateSvc > m_primEvtStore;
-        ServiceHandle< StoreGateSvc > m_secEvtStore;
-
-        // Variables used to read the events from the RDO source:
-        IEvtSelector*          m_primEvtSelector;
-        IEvtSelector::Context* m_primEvtContext;
-        StringProperty         m_primEvtSelName;
-
-        // Variables used to read the events from the bytestream source:
-        IEvtSelector*          m_secEvtSelector;
-        IEvtSelector::Context* m_secEvtContext;
-        StringProperty         m_secEvtSelName;
-
-
-        // The run number of the current event
-        EventID::number_type m_currentRun;
-        
-        // Flag showing if the next event will be the first one
-        bool m_firstRun;
-        
-        // The number of events processed already
-        int m_nEvt;
-
-        // Object for writing messages
-        mutable MsgStream m_log;
-
-        EventContext m_eventContext;
-
-        // Functionality for overwriting TriggerInfo
-        BooleanProperty m_overwritePrimTriggerInfo;
-        BooleanProperty m_overwriteSecTriggerInfo;
-
-        StatusCode overwriteTriggerInfo(EventInfo *pFrom, EventInfo *pTo);
-
-
-        // Share proxies between event stores.
-        BooleanProperty m_sharePrimProxies;
-        BooleanProperty m_shareSecProxies;
-        BooleanProperty m_shareProxiesSafe;
-
-
-        StatusCode loadObjects();
-
-    }; // Class MergingEventLoopMgr
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-} // Namespace TrigSim
-//------------------------------------------------------------------------------
-#endif
-//------------------------------------------------------------------------------
-
diff --git a/Trigger/TriggerSimulation/TrigSimTransforms/src/components/TrigSimTransforms_entries.cxx b/Trigger/TriggerSimulation/TrigSimTransforms/src/components/TrigSimTransforms_entries.cxx
deleted file mode 100644
index fc71eb497602..000000000000
--- a/Trigger/TriggerSimulation/TrigSimTransforms/src/components/TrigSimTransforms_entries.cxx
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "../MergingEventLoopMgr.h"
-
-DECLARE_COMPONENT( TrigSim::MergingEventLoopMgr )
-- 
GitLab


From 59321378f6a9777641497014dae5f0090d5e5a2d Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Wed, 22 Sep 2021 10:49:13 +0200
Subject: [PATCH 254/347] Add in-Athena DQ postprocessing algorithm

---
 .../python/OldFlags2NewFlags.py               |   7 +
 .../python/AthMonitorCfgHelper.py             |  12 +-
 .../python/AthenaMonitoringCfg.py             |   2 +-
 Control/AthenaMonitoring/python/DQMonFlags.py |  14 +
 .../share/DQMonFlagsConfig_jobOptions.py      |   5 -
 .../share/DataQualitySteering_jobOptions.py   |  12 +
 .../src/HistogramFiller/HistogramFactory.cxx  |  16 +-
 .../test/HistogramFactoryTestSuite.cxx        |  13 +-
 Control/AthenaPython/python/Bindings.py       |  27 +-
 .../python/DQPostProcessingAlg.py             | 271 ++++++++++++++++++
 .../python/MDTPostProcessing.py               |  46 +--
 .../python/MdtMonUtils.py                     |  25 +-
 12 files changed, 388 insertions(+), 62 deletions(-)
 create mode 100644 DataQuality/DataQualityUtils/python/DQPostProcessingAlg.py

diff --git a/Control/AthenaConfiguration/python/OldFlags2NewFlags.py b/Control/AthenaConfiguration/python/OldFlags2NewFlags.py
index c80d3365c4e7..3d20e4636560 100644
--- a/Control/AthenaConfiguration/python/OldFlags2NewFlags.py
+++ b/Control/AthenaConfiguration/python/OldFlags2NewFlags.py
@@ -16,9 +16,12 @@ def getNewConfigFlags():
         ConfigFlags.Input.Files = jobproperties.AthenaCommonFlags.FilesInput.get_Value()
     ConfigFlags.IOVDb.GlobalTag = jobproperties.Global.ConditionsTag()
     ConfigFlags.Beam.BunchSpacing = jobproperties.Beam.bunchSpacing()
+    ConfigFlags.Output.HISTFileName = jobproperties.DQMonFlagsCont.histogramFile()
     # Geometry - General
     ConfigFlags.GeoModel.AtlasVersion = jobproperties.Global.DetDescrVersion()
     ConfigFlags.GeoModel.Align.Dynamic = InDetGeometryFlags.useDynamicAlignFolders()
+    # Environment
+    ConfigFlags.Common.isOnline = jobproperties.AthenaCommonFlags.isOnline()
 
     # Concurrency
     from AthenaCommon.ConcurrencyFlags import jobproperties as jp
@@ -61,4 +64,8 @@ def getNewConfigFlags():
     for flag in reco_flag_map:   
         ConfigFlags._set('Detector.Enable'+flag, getattr(DetFlags.haveRIO,reco_flag_map[flag]+'_on')() )
 
+    # miscellaneous settings
+    ConfigFlags.InDet.doTIDE_Ambi=jobproperties.InDetJobProperties.doTIDE_Ambi()
+    ConfigFlags.InDet.useDCS=jobproperties.InDetJobProperties.useDCS()
+
     return ConfigFlags
diff --git a/Control/AthenaMonitoring/python/AthMonitorCfgHelper.py b/Control/AthenaMonitoring/python/AthMonitorCfgHelper.py
index f39ce830d3c3..c684f11d51fc 100644
--- a/Control/AthenaMonitoring/python/AthMonitorCfgHelper.py
+++ b/Control/AthenaMonitoring/python/AthMonitorCfgHelper.py
@@ -123,6 +123,7 @@ class AthMonitorCfgHelper(object):
         tool -- a GenericMonitoringToolArray object. This is used to define histograms
                 associated with each group in the array.
         '''
+        # Generate the n-dimensional array
         from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringArray
         array = GenericMonitoringArray(baseName,dimensions)
 
@@ -134,6 +135,8 @@ class AthMonitorCfgHelper(object):
             self.resobj.merge(acc)
 
         pathToSet = self.inputFlags.DQ.FileKey+('/%s' % topPath if topPath else '')
+        if self.inputFlags.Output.HISTFileName:
+            pathToSet = '/' + pathToSet
         array.broadcast('HistPath',pathToSet)
         array.broadcast('UseCache',True)
         convention = 'ONLINE' if self.inputFlags.Common.isOnline else 'OFFLINE'
@@ -267,7 +270,9 @@ class AthMonitorCfgHelperOld(object):
             from GaudiSvc.GaudiSvcConf import THistSvc
             svcMgr += THistSvc()
         # Set the histogram path
-        pathToSet = self.dqflags.monManFileKey() + ('/%s' % topPath if topPath else '')
+        pathToSet = self.dqflags.monManFileKey()+('/%s' % topPath if topPath else '')
+        if self.dqflags.histogramFile():
+            pathToSet = '/' + pathToSet
         # Detect if online or offline
         from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
         conventionName = 'OFFLINE' if not athenaCommonFlags.isOnline() else 'ONLINE'
@@ -311,8 +316,9 @@ def getDQTHistSvc(inputFlags):
         return result
 
     histsvc = THistSvc()
-    histsvc.Output += ["%s DATAFILE='%s' OPT='RECREATE'" % (inputFlags.DQ.FileKey, 
-                                                            inputFlags.Output.HISTFileName)]
+    if inputFlags.Output.HISTFileName:
+        histsvc.Output += ["%s DATAFILE='%s' OPT='RECREATE'" % (inputFlags.DQ.FileKey, 
+                                                                inputFlags.Output.HISTFileName)]
     result.addService(histsvc)
     return result
 
diff --git a/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py b/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py
index 68602c3dfad0..323d614a805f 100644
--- a/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py
+++ b/Control/AthenaMonitoring/python/AthenaMonitoringCfg.py
@@ -123,7 +123,7 @@ def AthenaMonitoringCfg(flags):
             for t in algo.GMTools:
                 for h in t.Histograms:
                     ho = json.loads(h)
-                    fullpath = os.path.join(ho['convention'], t.HistPath, ho['path'], ho['alias'])
+                    fullpath = os.path.join(t.HistPath, ho['path'], ho['alias']) + ':' + ho['convention']
                     if fullpath in definedhists:
                         previous = definedhists[fullpath]
                         error(f'Multiple definition of histogram {fullpath} by:\n\t{algo.getName()}/{t.getName()} ({ho}) and\n\t{previous[0]}/{previous[1]} ({previous[2]})')
diff --git a/Control/AthenaMonitoring/python/DQMonFlags.py b/Control/AthenaMonitoring/python/DQMonFlags.py
index b7edcfb4e150..771a0f9b9412 100644
--- a/Control/AthenaMonitoring/python/DQMonFlags.py
+++ b/Control/AthenaMonitoring/python/DQMonFlags.py
@@ -442,6 +442,20 @@ class triggerMixedMode(JobProperty):
     StoredValue=False
 list+=[triggerMixedMode]
 
+class doPostProcessing(JobProperty):
+    """ Run histogram postprocessing in Athena job """
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=False
+list+=[doPostProcessing]
+
+class postProcessingInterval(JobProperty):
+    """ Set number of events between postprocessing steps """
+    statusOn=True
+    allowedTypes=['int']
+    StoredValue=100
+list+=[postProcessingInterval] 
+
 ##-----------------------------------------------------------------------------
 ## 2nd step
 ## Definition of the DQMon flag container
diff --git a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
index 2c958d49fa28..de1b70429fff 100644
--- a/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DQMonFlagsConfig_jobOptions.py
@@ -489,15 +489,10 @@ from AthenaConfiguration.OldFlags2NewFlags import getNewConfigFlags
 # Translate all needed flags from old jobProperties to a new AthConfigFlag Container
 ConfigFlags = getNewConfigFlags()
 
-ConfigFlags.InDet.usePixelDCS=InDetFlags.usePixelDCS()
-ConfigFlags.InDet.doTIDE_Ambi=InDetFlags.doTIDE_Ambi()
-
-ConfigFlags.Output.HISTFileName=DQMonFlags.histogramFile()
 ConfigFlags.DQ.FileKey=DQMonFlags.monManFileKey()
 ConfigFlags.DQ.Environment=DQMonFlags.monManEnvironment()
 ConfigFlags.DQ.useTrigger=DQMonFlags.useTrigger()
 ConfigFlags.DQ.triggerDataAvailable=DQMonFlags.useTrigger()
-ConfigFlags.IOVDb.GlobalTag=globalflags.ConditionsTag()
 ConfigFlags.DQ.isReallyOldStyle=False
 
 from AthenaConfiguration import ComponentAccumulator
diff --git a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
index 781e45bed31b..de48273c23d3 100644
--- a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
@@ -382,4 +382,16 @@ if DQMonFlags.doMonitoring():
          asq = AthSequencer("AthBeginSeq")
          asq += AthenaMonitoringConf.ForceIDConditionsAlg("ForceIDConditionsAlg")
 
+   if DQMonFlags.doPostProcessing():
+      from AthenaConfiguration.AllConfigFlags import ConfigFlags
+      asq = AthSequencer("AthEndSeq")
+      from DataQualityUtils.DQPostProcessingAlg import DQPostProcessingAlg
+      ppa = DQPostProcessingAlg("DQPostProcessingAlg")
+      ppa.ExtraInputs = [( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' )]
+      ppa.Interval = DQMonFlags.postProcessingInterval()
+      if ConfigFlags.Common.isOnline:
+         ppa.FileKey = ((ConfigFlags.DQ.FileKey + '/') if not ConfigFlags.DQ.FileKey.endswith('/') 
+                        else ConfigFlags.DQ.FileKey) 
+      asq += ppa
+
 del local_logger
diff --git a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.cxx b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.cxx
index 29733fd0d283..430fb5bfe04c 100644
--- a/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.cxx
+++ b/Control/AthenaMonitoringKernel/src/HistogramFiller/HistogramFactory.cxx
@@ -19,10 +19,14 @@ HistogramFactory::HistogramFactory(const ServiceHandle<ITHistSvc>& histSvc,
                                    std::string histoPath)
 : m_histSvc(histSvc)
 {
-  size_t split = histoPath.find('/');
-  m_streamName = histoPath.substr(0,split);
-  m_groupName = split!=std::string::npos ? histoPath.substr(split) : "";
-
+  size_t whereToStart = 0;
+  // do we have a leading slash? This distinguishes temporary streams in THistSvc
+  if (! histoPath.empty() && histoPath[0] == '/') {
+    whereToStart = 1;
+  }
+  size_t split = histoPath.find('/', whereToStart);
+  m_streamName = (whereToStart == 1 ? "/" : "") + histoPath.substr(0,split);
+  m_groupName = split!=std::string::npos ? histoPath.substr(split+1) : "";
   // Infrequently, loading a ROOT class in a MT context can fail.
   // So try to load the classes we'll need early.
   TClass::GetClass("TH1F");
@@ -260,14 +264,14 @@ namespace {
 }
 std::string HistogramFactory::getFullName(const HistogramDef& def) const {
 
-  
+  // for online paths, always prepend a slash. Otherwise take it from provided stream name
   std::string path;
   if ( onlinePaths.count( def.path)!=0 ) {
     path =  "/" + def.path + "/" + m_streamName + "/" + m_groupName;
   } else if ( def.path=="DEFAULT" ) {
     path = "/" + m_streamName + "/" + m_groupName;
   } else {
-    path = "/" + m_streamName + "/" + def.tld + "/" + m_groupName + "/" + def.path;
+    path = m_streamName + "/" + def.tld + "/" + m_groupName + "/" + def.path;
   }
 
   // remove duplicate slashes
diff --git a/Control/AthenaMonitoringKernel/test/HistogramFactoryTestSuite.cxx b/Control/AthenaMonitoringKernel/test/HistogramFactoryTestSuite.cxx
index 04b20227e15a..ef58d0075424 100644
--- a/Control/AthenaMonitoringKernel/test/HistogramFactoryTestSuite.cxx
+++ b/Control/AthenaMonitoringKernel/test/HistogramFactoryTestSuite.cxx
@@ -50,6 +50,7 @@ class HistogramFactoryTestSuite {
         REGISTER_TEST_CASE(test_shouldProperlyFormatPathForDefaultHistograms),
         REGISTER_TEST_CASE(test_shouldProperlyFormatPathForCustomHistograms),
         REGISTER_TEST_CASE(test_shouldProperlyFormatPathForOfflineHistograms),
+        REGISTER_TEST_CASE(test_shouldProperlyFormatPathForTempOfflineHistograms),
         REGISTER_TEST_CASE(test_shouldSetXAxisLabelsFor1DHistogram),
         REGISTER_TEST_CASE(test_shouldSetXAndYAxisLabelsFor2DHistogram),
         REGISTER_TEST_CASE(test_shouldSetExtendAxesWhenkCanRebinIsSet),
@@ -62,7 +63,7 @@ class HistogramFactoryTestSuite {
   // ==================== Test code ====================
   private:
     void beforeEach() {
-      m_testObj.reset(new HistogramFactory(m_histSvc, "HistogramFactoryTestSuite"));
+      m_testObj.reset(new HistogramFactory(m_histSvc, "/HistogramFactoryTestSuite"));
     }
 
     void afterEach() {
@@ -180,6 +181,16 @@ class HistogramFactoryTestSuite {
       VALUE(m_histSvc->exists("/HistogramFactoryTestSuite/run_XXXXXX/lbYYY/custom/path/for/histogram/offlineAlias")) EXPECTED(true);
     }
 
+    void test_shouldProperlyFormatPathForTempOfflineHistograms() {
+      m_testObj.reset(new HistogramFactory(m_histSvc, "HistogramFactoryTestSuite"));
+      HistogramDef histogramDef = defaultHistogramDef("TH1F");
+      histogramDef.path = "/custom/path/for/histogram";
+      histogramDef.alias = "offlineAlias";
+      histogramDef.tld = "/run_XXXXXX/lbYYY/";
+      m_testObj->create(histogramDef);
+      VALUE(m_histSvc->exists("HistogramFactoryTestSuite/run_XXXXXX/lbYYY/custom/path/for/histogram/offlineAlias")) EXPECTED(true);
+    }
+
     void test_shouldSetXAxisLabelsFor1DHistogram() {
       HistogramDef histogramDef = defaultHistogramDef("TH1F");
       histogramDef.alias = "labels1DTestAlias";
diff --git a/Control/AthenaPython/python/Bindings.py b/Control/AthenaPython/python/Bindings.py
index cb265b608d53..a0f1c9c79f9a 100644
--- a/Control/AthenaPython/python/Bindings.py
+++ b/Control/AthenaPython/python/Bindings.py
@@ -353,7 +353,7 @@ def _py_init_THistSvc():
 
     # save original regXYZ methods: we'll use some modified ones
     # to improve look-up time from python
-    for n in ('Hist', 'Graph', 'Tree'):
+    for n in ('Hist', 'Graph', 'Efficiency', 'Tree'):
         code = "ITHistSvc._cpp_reg%s = ITHistSvc.reg%s" % (n,n)
         exec (code, globals(),locals())
 
@@ -395,6 +395,8 @@ def _py_init_THistSvc():
                 meth = '_cpp_regHist'
             elif isinstance(obj, (ROOT.TGraph,)):
                 meth = '_cpp_regGraph'
+            elif isinstance(obj, (ROOT.TEfficiency,)):
+                meth = '_cpp_regEfficiency'
             elif isinstance(obj, (ROOT.TTree,)):
                 meth = '_cpp_regTree'
             else:
@@ -431,8 +433,7 @@ def _py_init_THistSvc():
         except KeyError:
             pass
         def _get_helper(klass, hsvc, meth, oid, update_cache=True):
-            import cppyy
-            makeNullPtr = cppyy.libPyROOT.MakeNullPointer
+            makeNullPtr = ROOT.MakeNullPointer
             o = makeNullPtr(klass)
             if meth(oid, o).isSuccess():
                 if update_cache:
@@ -446,6 +447,8 @@ def _py_init_THistSvc():
                 return _get_helper(klass, self, self.getHist, oid)
             if issubclass(klass, (ROOT.TGraph,)):
                 return _get_helper(klass, self, self.getGraph, oid)
+            if issubclass(klass, (ROOT.TEfficiency,)):
+                return _get_helper(klass, self, self.getEfficiency, oid)
             if issubclass(klass, (ROOT.TTree,)):
                 return _get_helper(klass, self, self.getTree, oid)
             raise RuntimeError('unsupported type [%r]'%klass)
@@ -464,11 +467,14 @@ def _py_init_THistSvc():
                 obj = _get_helper(klass, self, self.getHist, name)
 
         # then graphs
-        ## FIXME: no 'ITHistSvc::getGraphs' method !!
-        ## https://savannah.cern.ch/bugs/index.php?36379
-##         oids = [n for n in self.getGraphs() if not n in self._py_cache.keys()]
-##         for name in oids:
-##             _get_helper(ROOT.TGraph, self, self.getGraph, name)
+        oids = [n for n in self.getGraphs() if n not in self._py_cache.keys()]
+        for name in oids:
+            _get_helper(ROOT.TGraph, self, self.getGraph, name)
+
+        # then efficiencies
+        oids = [n for n in self.getEfficiencies() if n not in self._py_cache.keys()]
+        for name in oids:
+            _get_helper(ROOT.TEfficiency, self, self.getEfficiency, name)
         
         # finally try ttrees
         oids = [n for n in self.getTrees() if n not in self._py_cache.keys()]
@@ -501,7 +507,7 @@ def _py_init_THistSvc():
     del setitem
 
     ## ties some loose ends
-    for n in ('Hist', 'Graph', 'Tree'):
+    for n in ('Hist', 'Graph', 'Efficiency', 'Tree'):
         code = """\
 def reg%s(self, oid, oid_type=None):
     if not (oid_type is None):
@@ -521,9 +527,10 @@ del reg%s""" % (n,n,n,n,n)
         its type. `oid_type' is a string whose value is either:
          - 'hist',  to load any THx and TProfiles
          - 'tree',  to load TTrees
+         - 'efficiency', to load TEfficiency
          - 'graph', to load TGraph and TGraphErrors
         """
-        _allowed_values = ('hist','tree','graph')
+        _allowed_values = ('hist','tree','efficiency','graph')
         if oid_type not in _allowed_values:
             raise ValueError(
                 'oid_type (=%r) MUST be one of %r'%(oid_type,
diff --git a/DataQuality/DataQualityUtils/python/DQPostProcessingAlg.py b/DataQuality/DataQualityUtils/python/DQPostProcessingAlg.py
new file mode 100644
index 000000000000..c757114b2a16
--- /dev/null
+++ b/DataQuality/DataQualityUtils/python/DQPostProcessingAlg.py
@@ -0,0 +1,271 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+# from AthenaPython.PyAthenaComps import StatusCode
+from AthenaPython import PyAthena
+
+import histgrinder
+import histgrinder.interfaces
+from histgrinder.HistObject import HistObject
+from typing import (Union, Iterable, Mapping, Any, Collection,
+                    Pattern, Generator)
+
+StatusCode = PyAthena.StatusCode
+
+class DQPostProcessingAlg(PyAthena.Alg):
+    def __init__(self, name=None, **kw):
+        super(DQPostProcessingAlg, self).__init__(name, **kw)
+        self.Interval = 1
+        self.FileKey = '/CombinedMonitoring/run_%(run)s/'
+        self._ctr = 0
+        self._run = 0
+        self._transformermap = {}
+        self._timings = {}
+        self.DoTiming = True
+        self.DoEntryOptimization = True
+
+    def initialize(self):
+        from histgrinder.config import read_configuration
+        from histgrinder.transform import Transformer
+        import os, glob
+        from DataQualityUtils._resolve_data_path import resolve_data_path
+
+        self.hsvc = PyAthena.py_svc('THistSvc')
+
+        dpath = resolve_data_path("DataQualityUtils")
+        if dpath is None:
+            self.msg.error("Unable to resolve DataQualityUtils data path, not running new-style postprocessing")
+            return StatusCode.Failure
+
+        # read configuration & set up transformations
+        self._transformers = []
+        postprocfiles = glob.glob(os.path.join(dpath,'postprocessing/*.yaml'))
+        self.msg.info(f'The postprocessing config file list is {postprocfiles}')
+        for configfile in glob.glob(os.path.join(dpath,'postprocessing/*.yaml')):
+            config = read_configuration(configfile)
+            self._transformers += [Transformer(_) for _ in config]
+        selectors = set()
+        for transform in self._transformers:
+            selectors.update(transform.inregexes)
+            if self.DoTiming:
+                self._timings[transform] = 0.
+
+        # Configure input
+        self._im = AthInputModule()
+        in_configuration = {'source': self}
+        # if args.prefix:
+        in_configuration['prefix'] = f'{self.FileKey}'
+        self._im.configure(in_configuration)
+        self._im.setSelectors(selectors)
+
+        # Configure output
+        self._om = AthOutputModule()
+        out_configuration = {'target': self}
+        # if args.prefix:
+        out_configuration['prefix'] = f'{self.FileKey}'
+        self._om.configure(out_configuration)
+        return StatusCode.Success
+
+    def _process(self):
+        import time
+        for obj in self._im:
+            self.msg.debug(f'now processing for {obj.name}')
+            translist = self._transformermap.get(obj.name, self._transformers)
+            needtocache = (translist == self._transformers)
+            cached = []
+            for _ in translist:
+                self.msg.debug(f'consider transformer {_.tc.description}')
+                if self.DoTiming:
+                    t0 = time.perf_counter()
+                v = _.consider(obj)
+                if self.DoTiming:
+                    t = time.perf_counter()-t0
+                    self._timings[_] += t
+                if v:
+                    if needtocache:
+                        cached.append(_)
+                    self.msg.debug('Match made!')
+                    self._om.publish(v)
+            if needtocache:
+                self._transformermap[obj.name] = cached
+        self._om.finalize()
+
+    def execute(self):
+        self._ctr += 1
+        if ((self._ctr - 1) % self.Interval) != 0: return StatusCode.Success
+        self._run = self.evtStore['EventInfo'].runNumber()
+        try:
+            self._process()
+        except Exception as e:
+            import traceback
+            self.msg.info(f"Caught exception: {e}")
+            self.msg.info(traceback.format_exc())
+        self.msg.debug("I've got it made")
+        return StatusCode.Success
+
+    def finalize(self):
+        self.msg.debug("Finalizing")
+        if self.DoTiming:
+            self.msg.info('Timings')
+            for k, v in self._timings.items():
+                self.msg.info(f'{k.tc.description}, {v}')
+        try:
+            self._process()
+        except Exception as e:
+            import traceback
+            self.msg.info(f"Caught transformation exception: {e}")
+            self.msg.warning(traceback.format_exc())
+        return StatusCode.Success
+
+class AthInputModule(histgrinder.interfaces.InputModule):
+    def __init__(self):
+        self.source = None
+        self.classwarnings = set()
+        self.selectors = None
+        self.entries = {}
+
+    def configure(self, options: Mapping[str, Any]) -> None:
+        """
+        Configure this module. Potential elements of "options":
+        source: should be a ROOT-openable filename or URL.
+        prefix: directory path to search under. Returned histogram names
+            will not include this.
+        """
+        if 'source' not in options:
+            raise ValueError("Must specify 'source' as an "
+                             "option to AthInputModule")
+        self.source = options['source']
+        self.prefix = options.get('prefix', '/')
+        self.cachednames = set()
+        self.matchednames = {}
+
+    def setSelectors(self, selectors: Collection[Pattern]) -> None:
+        """ Do more later """
+        self.selectors = selectors
+
+    def _getklass(self, k):
+        import ROOT
+        hsvc = self.source.hsvc
+        if hsvc.existsHist(k):
+            hptr = ROOT.MakeNullPointer(ROOT.TH1)
+            if hsvc.getHist(k, hptr).isSuccess():
+                klass = getattr(ROOT, hptr.ClassName())
+                return klass
+        return None
+
+
+    def iterate(self, dryrun) -> Generator[HistObject, None, None]:
+        """ Iterate over all histograms in THistSvc """
+        import ROOT
+        log = self.source.msg
+        specprefix = self.prefix % { 'run': self.source._run }
+        log.debug(f'Would like to match {specprefix}')
+        hsvc = self.source.hsvc
+
+        # check if we have new histograms; if so, check against selectors to see if we're interested
+        currenthists = set(str(_) for _ in hsvc.getHists())
+        for k in currenthists - self.cachednames:
+            # log.info(f'We have ... ? {k}')
+            if not k.startswith(specprefix):
+                continue
+            shortk = k.replace(specprefix, '', 1)
+            if self.selectors is not None:
+                if not any(_.match(shortk) for _ in self.selectors):
+                    continue
+            self.matchednames[k] = None
+        self.cachednames.update(currenthists)
+        log.debug(f'We now have {len(self.cachednames)} entries in our cache, of {len(currenthists)} total plots')
+        log.debug(f'There are {len(self.matchednames)} matches to be considered')
+
+        # postprocess only matched histograms
+        for k, klass in self.matchednames.items():
+            if dryrun:
+                yield HistObject(k.replace(specprefix, '', 1), None)
+                
+            log.debug(f'ROOT input trying to read {k}')
+            if klass is None:
+                klass = self._getklass(k)
+                self.matchednames[k] = klass
+            hptr = ROOT.MakeNullPointer(klass)
+            if hsvc.getHist(k, hptr).isSuccess():
+                log.debug(f'ROOT input read {k} as {type(hptr)}')
+                # obj = hptr.Clone()
+                # obj.SetDirectory(0)
+                obj = hptr
+                if k in self.entries:
+                    if obj.GetEntries() == self.entries[k]:
+                        continue
+                    self.entries[k] = obj.GetEntries()
+                yield HistObject(k.replace(specprefix, '', 1), obj)
+            else:
+                log.error(f'Cannot read {k}')
+            
+        log.debug('Done on input side')
+
+    def __iter__(self) -> Iterable[HistObject]:
+        return self.iterate(dryrun=False)
+
+    def warmup(self) -> Iterable[HistObject]:
+        return self.iterate(dryrun=True)
+
+class AthOutputModule(histgrinder.interfaces.OutputModule):
+    def __init__(self):
+        self.target = None
+
+    def configure(self, options: Mapping[str, Any]) -> None:
+        """
+        Configure this module. Potential elements of "options":
+        target: should be a ROOT-openable filename or URL which
+            can be opened for writing.
+        prefix: directory path to place results under.
+        overwrite: boolean to indicate whether results should overwrite
+            existing histograms in the file.
+        delay: only write histograms in finalize() (not during publish()).
+        """
+        if 'target' not in options:
+            raise ValueError("Must specify 'target' as an option "
+                             "to AthInputModule")
+        self.target = options['target']
+        self.overwrite = bool(options.get('overwrite', True))
+        self.prefix = options.get('prefix', '/')
+        self.delay = bool(options.get('delay', True))
+        self.queue = {}
+
+    def publish(self, obj: Union[HistObject, Iterable[HistObject]]) -> None:
+        """ Accepts a HistObject containing a ROOT object to write to file """
+        if isinstance(obj, HistObject):
+            obj = [obj]
+        obj = { _.name: _ for _ in obj }
+        if self.delay:
+            self.queue.update(obj)
+        else:
+            self.queue = obj
+            self._write()
+            self.queue = None
+
+    def _write(self) -> None:
+        """ write obj to THistSvc """
+        import ROOT
+        import os.path
+        if not self.queue:
+            return  # Nothing to do
+        log = self.target.msg
+        hsvc = self.target.hsvc
+        for _, o in self.queue.items():
+            ROOT.SetOwnership(o.hist, False)
+            fulltargetname = os.path.join(self.prefix, o.name) % { 'run': self.target._run }
+            log.debug(f"Attempt to publish {fulltargetname}")
+            o.hist.SetName(os.path.basename(fulltargetname))
+            if hsvc.existsHist(fulltargetname):
+                # following kind of silly procedure is necessary to avoid memory leaks
+                hptr = ROOT.MakeNullPointer(ROOT.TH1)
+                if hsvc.getHist(fulltargetname, hptr).isSuccess():
+                    hsvc.deReg(hptr)
+            if not hsvc._cpp_regHist(fulltargetname, o.hist).isSuccess():
+                log.error(f"Unable to register {fulltargetname}")
+            else:
+                log.debug("Published")
+        self.queue.clear()
+
+    def finalize(self) -> None:
+        """ Writes outstanding HistObjects to file """
+        self._write()
\ No newline at end of file
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTPostProcessing.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTPostProcessing.py
index c388529d0fab..8e60e7d29458 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTPostProcessing.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MDTPostProcessing.py
@@ -8,8 +8,10 @@ from math import sqrt
 import numpy as np
 
 def make_hits_per_evt(inputs):
-   EvtOccBCap = inputs[0][1][1].Clone()
-   EvtOccECap = inputs[0][1][2].Clone()
+   inputs=list(inputs)
+   i01 = inputs[0][1]
+   EvtOccBCap = i01[1].Clone()
+   EvtOccECap = i01[2].Clone()
    EvtOccBCap.Reset()
    EvtOccECap.Reset()
    EvtOccBCap.SetName("HitsPerEvtInBarrelPerChamber_ADCCut")
@@ -17,8 +19,8 @@ def make_hits_per_evt(inputs):
    EvtOccECap.SetName("HitsPerEvtInEndCapPerChamber_ADCCut")
    EvtOccECap.SetTitle("Avg # hits/evt Endcap, ADCCut")
    
-   VolumeMapBCap = inputs[0][1][1].Clone()
-   VolumeMapECap = inputs[0][1][2].Clone()
+   VolumeMapBCap = i01[1].Clone()
+   VolumeMapECap = i01[2].Clone()
    VolumeMapBCap.Reset()
    VolumeMapECap.Reset()
    VolumeMapBCap.SetName("VolumeMapBarrel")
@@ -27,10 +29,7 @@ def make_hits_per_evt(inputs):
    VolumeMapECap.SetTitle("Volume Map (#tubes*tubeVol in m^3) Endcap")
 
    size = len(inputs)
-   chamberHits_vec = []
-   for i in range(size):
-      hi = inputs[i][1][0].Clone()
-      chamberHits_vec.append(hi.GetEntries())
+   chamberHits_vec = [_[1][0].GetEntries() for _ in inputs]
 
    sorted_chamberHits_vec = np.sort(chamberHits_vec)
    medianChamberHits = 0
@@ -40,9 +39,11 @@ def make_hits_per_evt(inputs):
    elif(size > 0):
       medianChamberHits = sorted_chamberHits_vec[den]
 
+   h_trigger = inputs[0][1][3]
+   nTriggers = int(h_trigger.GetEntries())
    for i in range(size):
       hvOff = False
-      hi = inputs[i][1][0].Clone()
+      hi = inputs[i][1][0]
       name = hi.GetName()
       xAxis = name[0]+name[4]+name[3]
       yAxis = name[1]+name[5]+name[6]
@@ -66,9 +67,6 @@ def make_hits_per_evt(inputs):
       elif(nhits < 0.07 * medianChamberHits + 0.1):
          hvOff = True
 
-      h_trigger = inputs[0][1][3]
-      nTriggers = int(h_trigger.GetEntries())
-
       tubeRadiusScale = 1
       tubeLength =      getTubeLength(name)
       if(name[0:3] == "BME" or name[0:3] == "BMG"):
@@ -107,12 +105,13 @@ def make_eff_histo(inputs, ec):
    ecap_fullStr_lower = "mdt"+ecap_str
    heff = TH1F(ecap_fullStr_lower+"_TUBE_eff",ecap_fullStr_lower+"_TUBE_eff",100,0,1)
 
-   size = len(inputs)
    dencut = 10
 
-   for i in range(size): 
-      hi_num = inputs[i][1][0].Clone()
-      hi_den = inputs[i][1][1].Clone()
+   for itr in inputs: 
+      if itr is None:
+         continue
+      hi_num = itr[1][0]
+      hi_den = itr[1][1]
       nbin=hi_den.GetNbinsX()
       for ibin in range(nbin):
          if( hi_den.At(ibin) > dencut ):
@@ -121,7 +120,8 @@ def make_eff_histo(inputs, ec):
    return [heff]
 
 def make_eff_histo_perML(inputs, ec):
-
+   if inputs[0] is None:
+      return []
    ecap = ["BA", "BC", "EA", "EC"]
    ecap_str= ecap[ec]
    heff_outer = inputs[0][1][2].Clone()
@@ -149,11 +149,12 @@ def make_eff_histo_perML(inputs, ec):
    heff_extra.SetTitle("effsIn"+ecap_str+"ExtraPerMultiLayer, ADCCut")
    heff_extra_N = heff_extra.Clone()
 
-   size = len(inputs)
-   for i in range(size):
-      hi_num = inputs[i][1][0].Clone()
+   for itr in inputs:
+      if itr is None:
+         continue
+      hi_num = itr[1][0]
       name_num = hi_num.GetName()
-      hi_den = inputs[i][1][1].Clone()
+      hi_den = itr[1][1]
       name=name_num[0:7]
       countsML1, countsML2, entriesML1, entriesML2 = MDTTubeEff(name,hi_num,hi_den)
       ch_name = name[0:7]
@@ -226,11 +227,10 @@ def drift_time_monitoring(inputs, ec):
    sumtdrift.SetAxisRange(0,1200,"y")
    sumtdrift.Reset()
 
-   h=TH1F()
    
    for i in range(size):
       currentbin=i+1
-      h = inputs[i][1][0].Clone()
+      h = inputs[i][1][0]
       t0, t0err, tmax, tmaxerr = MDTFitTDC(h)
 
       layer=""
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MdtMonUtils.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MdtMonUtils.py
index cbf657d30bed..4a774b068ff2 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MdtMonUtils.py
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/MdtRawDataMonitoring/python/MdtMonUtils.py
@@ -196,17 +196,10 @@ def getTubeLength( name ):
 
     tubeLength = 4.9615
 
-    if name03 in tubeLenght_dict:
-        tubeLength = tubeLenght_dict[name03]
-
-    if name04 in tubeLenght_dict:
-        tubeLength = tubeLenght_dict[name04]
-
-    if name03+name56 in tubeLenght_dict:
-        tubeLength = tubeLenght_dict[name03+name56]
-
-    if name04+name56 in tubeLenght_dict:
-        tubeLength = tubeLenght_dict[name04+name56]
+    tubeLength = tubeLenght_dict.get(name03, tubeLength)
+    tubeLength = tubeLenght_dict.get(name04, tubeLength)
+    tubeLength = tubeLenght_dict.get(name03+name56, tubeLength)
+    tubeLength = tubeLenght_dict.get(name04+name56, tubeLength)
 
     return tubeLength 
 
@@ -268,11 +261,15 @@ def fittzero(x, par):
    fitvaltzero = par[0] + ( par[3] / ( 1 + ( TMath.Exp((-x[0]+par[1])/par[2]) ) ) )
    return fitvaltzero
 
+tf1_fittzero = TF1("func1", fittzero, 0., 200., 4)
+
 
 def fittmax(x, par):
    fitvaltmax = par[0] + ( par[3] / ( 1 + ( TMath.Exp((x[0]-par[1])/par[2]) ) ) )
    return fitvaltmax
 
+tf1_fittmax = TF1("func2", fittmax, 0., 200., 4)
+
 def MDTFitTDC(h):
    t0 = 0
    tmax = 0
@@ -288,7 +285,8 @@ def MDTFitTDC(h):
    parESD1 = up
    parESD2 = 20
    parESD3 = h.GetBinContent(h.GetMaximumBin()) - h.GetBinContent(h.GetMinimumBin())
-   func1 = TF1("func1", fittzero, 0., up, 4)
+   func1 = tf1_fittzero
+   func1.SetRange(0., up)
    func1.SetParameters(parESD0, parESD1, parESD2, parESD3)
    func1.SetLineColor(kBlue+2)
    if(h.GetEntries()>100):
@@ -306,7 +304,8 @@ def MDTFitTDC(h):
    parESD1 = down
    parESD2 = 50
    parESD3 = (h.GetBinContent(h.GetMaximumBin())-h.GetBinContent(h.GetMinimumBin()))/10.
-   func2 = TF1("func2", fittmax, (down-135), (down+135), 4)
+   func2 = tf1_fittmax
+   func2.SetRange((down-135), (down+135))
    func2.SetParameters(parESD0,parESD1,parESD2,parESD3)
    func2.SetLineColor(kRed+1)
    if(h.GetEntries()>100):
-- 
GitLab


From 4f324a4cdd7e6de6aa5b18866fd4b74a52c86f99 Mon Sep 17 00:00:00 2001
From: Nikita Belyaev <nikita.belyaev@cern.ch>
Date: Wed, 22 Sep 2021 10:51:01 +0200
Subject: [PATCH 255/347] Fix of large array-related memory issue in
 TRTMonitoringRun3

---
 .../python/TRTMonitoringRun3ESD_Alg.py        |   3 +-
 .../python/TRTMonitoringRun3RAW_Alg.py        |  14 ++-
 .../python/TRTPostProcessing.py               |   2 +-
 .../TRTMonitoringRun3RAW_Alg_jobOptions.py    |  14 ++-
 .../src/TRTMonitoringRun3ESD_Alg.cxx          | 101 +++++++++---------
 .../src/TRTMonitoringRun3RAW_Alg.cxx          |  98 +++++------------
 6 files changed, 87 insertions(+), 145 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3ESD_Alg.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3ESD_Alg.py
index 3f6a89137035..f4f6250c58a8 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3ESD_Alg.py
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3ESD_Alg.py
@@ -242,6 +242,7 @@ if __name__ == '__main__':
     ConfigFlags.Detector.GeometrySCT = True
     ConfigFlags.Detector.GeometryTRT = True
     ConfigFlags.Detector.GeometryMuon = False
+    ConfigFlags.IOVDb.GlobalTag = "CONDBR2-BLKPA-RUN2-03"
     ConfigFlags.lock()
 
     # Initialize configuration object, add accumulator, merge, and run.
@@ -266,4 +267,4 @@ if __name__ == '__main__':
     ServiceMgr.Dump = False
 
     cfg.merge(TRTMonitoringRun3Acc)
-    cfg.run(100)
+    cfg.run(200)
diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
index 6690133d2eae..9a69bb1565bf 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTMonitoringRun3RAW_Alg.py
@@ -154,12 +154,12 @@ def TRTMonitoringRun3RAW_AlgConfig(inputFlags):
             rdoLLHLOccGroup.defineHistogram('AvgHLOccMod_side_x,AvgHLOccMod_side_y;hAvgHLOccMod_{0}'.format(regionMarker),type='TProfile',title='Avg. HL Occupancy: {0}s{1};{2};Occupancy'.format(moduleOrWheel[ibe],regionTag,moduleNumAssign[ibe]),path='TRT/{0}/Expert'.format(barrelOrEndcap[ibe]),xbins=moduleNum[ibe],xmin=0,xmax=moduleNum[ibe])
 
     effGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistograms')
-    effGroup.defineHistogram('Efficiency_eta_passed,Efficiency_eta;hefficiency_eta',type='TProfile',title='Efficiency vs #eta;#eta;Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.8,xmax=2.8)
-    effGroup.defineHistogram('Efficiency_phi_passed,Efficiency_phi;hefficiency_phi',type='TProfile',title='Efficiency vs #phi;#phi (deg);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-3.2,xmax=3.2)
-    effGroup.defineHistogram('Efficiency_pt_passed,Efficiency_pt;hefficiency_pt',type='TProfile',title='Efficiency vs pT;pT (GeV);Efficiency',path='TRT/Efficiency',xbins=50,xmin=0,xmax=10)
-    effGroup.defineHistogram('Efficiency_z0_passed,Efficiency_z0;hefficiency_z0',type='TProfile',title='Efficiency vs z0;z0;Efficiency',path='TRT/Efficiency',xbins=50,xmin=-200,xmax=200)
-    effGroup.defineHistogram('EfficiencyBarrel_locR,EfficiencyBarrel_locR_passed;hefficiencyBarrel_locR',type='TProfile',title='Efficiency vs Track-to-Wire Distance for Xenon Straws (Barrel);Track-to-Wire Distance (mm);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5)
-    effGroup.defineHistogram('EfficiencyBarrel_locR_Ar,EfficiencyBarrel_locR_Ar_passed;hefficiencyBarrel_locR_Ar',type='TProfile',title='Efficiency vs Track-to-Wire Distance for Argon Straws (Barrel);Track-to-Wire Distance (mm);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5)
+    effGroup.defineHistogram('Efficiency_eta_passed,Efficiency_eta;hEfficiency_eta',type='TProfile',title='Efficiency vs #eta;#eta;Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.8,xmax=2.8)
+    effGroup.defineHistogram('Efficiency_phi_passed,Efficiency_phi;hEfficiency_phi',type='TProfile',title='Efficiency vs #phi;#phi (deg);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-3.2,xmax=3.2)
+    effGroup.defineHistogram('Efficiency_pt_passed,Efficiency_pt;hEfficiency_pt',type='TProfile',title='Efficiency vs pT;pT (GeV);Efficiency',path='TRT/Efficiency',xbins=50,xmin=0,xmax=10)
+    effGroup.defineHistogram('Efficiency_z0_passed,Efficiency_z0;hEfficiency_z0',type='TProfile',title='Efficiency vs z0;z0;Efficiency',path='TRT/Efficiency',xbins=50,xmin=-200,xmax=200)
+    effGroup.defineHistogram('EfficiencyBarrel_locR,EfficiencyBarrel_locR_passed;hEfficiencyBarrel_locR',type='TProfile',title='Efficiency vs Track-to-Wire Distance for Xenon Straws (Barrel);Track-to-Wire Distance (mm);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5)
+    effGroup.defineHistogram('EfficiencyBarrel_locR_Ar,EfficiencyBarrel_locR_Ar_passed;hEfficiencyBarrel_locR_Ar',type='TProfile',title='Efficiency vs Track-to-Wire Distance for Argon Straws (Barrel);Track-to-Wire Distance (mm);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5)
     effBarrelGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistogramsBarrel')
     effBarrelGroup.defineHistogram('EfficiencyBarrelMap,EfficiencyBarrelMap_passed;hEfficiencyBarrelMap',type='TProfile',title='Straw Efficiency Map (Barrel);Straw Number;Efficiency',path='TRT/Efficiency',xbins=strawMax[0],xmin=0,xmax=strawMax[0])
     effEndcapGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistogramsEndCap')
@@ -223,8 +223,6 @@ def TRTMonitoringRun3RAW_AlgConfig(inputFlags):
                 trackGroup.defineHistogram('HitHWonTMapC;unscaled_hHitHWonTMapC',type='TH1F',title='HL Hit(In time Window) on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe])
                 trackGroup.defineHistogram('HtoLonTMapS,HtoLonTMapS_passed;hHtoLonTMapS',type='TProfile',title='HL/LL Ratio on Track: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe])
                 trackGroup.defineHistogram('HtoLWonTMapS,HtoLWonTMapS_passed;hHtoLWonTMapS',type='TProfile',title='HL/LL (In Time Window) Ratio on Track: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe])
-                trackGroup.defineHistogram('HitonTrackVAllS_x,HitonTrackVAllS_y;hHitonTrackVAllS',type='TProfile',title='(Hit on Track) / (Any LL Bit): Straws;Straw Number in Stack;Ratio',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe])
-                trackGroup.defineHistogram('HitonTrackVAllC_x,HitonTrackVAllC_y;hHitonTrackVAllC',type='TProfile',title='(Hit on Track) / (Any LL Bit): Chips;Chip Number in Stack;Ratio',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe])
                 trackGroup.defineHistogram('HtoLWonTMapC,HtoLWonTMapC_passed;hHtoLWonTMapC',type='TProfile',title='HL/LL(In Time Window) Ratio on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe])
                 trackGroup.defineHistogram('HtoLonTMapC,HtoLonTMapC_passed;hHtoLonTMapC',type='TProfile',title='HL/LL Ratio on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe])
 
diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTPostProcessing.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTPostProcessing.py
index 3049cd7a1c27..94c2d45b494b 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTPostProcessing.py
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/python/TRTPostProcessing.py
@@ -59,7 +59,7 @@ def hHitOnTrackVsAll(inputs):
     if element == 'C':
         name  = 'C'
         titleElement = 'Chips'
-    rh = ROOT.TH1F('hHitOnTrackVsAll' + name, '(Hit on Track) / (Any LL Bit): ' + titleElement, 1, 0, 1)
+    rh = ROOT.TH1F('hHitonTrackVsAll' + name, '(Hit on Track) / (Any LL Bit): ' + titleElement, 1, 0, 1)
     rh.GetXaxis().SetTitle(titleElement[:-1] + ' Number in Stack')
     rh.GetYaxis().SetTitle('Ratio')
     for i in range(len(inputs[0][1])):
diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/share/TRTMonitoringRun3RAW_Alg_jobOptions.py b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/share/TRTMonitoringRun3RAW_Alg_jobOptions.py
index 68ef492e8ece..952354184492 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/share/TRTMonitoringRun3RAW_Alg_jobOptions.py
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/share/TRTMonitoringRun3RAW_Alg_jobOptions.py
@@ -112,12 +112,12 @@ for ibe in range(2):
         rdoLLHLOccGroup.defineHistogram('AvgHLOccMod_side_x,AvgHLOccMod_side_y;hAvgHLOccMod_{0}'.format(regionMarker),type='TProfile',title='Avg. HL Occupancy: {0}s{1};{2};Occupancy'.format(moduleOrWheel[ibe],regionTag,moduleNumAssign[ibe]),path='TRT/{0}/Expert'.format(barrelOrEndcap[ibe]),xbins=moduleNum[ibe],xmin=0,xmax=moduleNum[ibe])
 
 effGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistograms')
-effGroup.defineHistogram('Efficiency_eta_passed,Efficiency_eta;hefficiency_eta',type='TProfile',title='Efficiency vs #eta;#eta;Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.8,xmax=2.8)
-effGroup.defineHistogram('Efficiency_phi_passed,Efficiency_phi;hefficiency_phi',type='TProfile',title='Efficiency vs #phi;#phi (deg);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-3.2,xmax=3.2)
-effGroup.defineHistogram('Efficiency_pt_passed,Efficiency_pt;hefficiency_pt',type='TProfile',title='Efficiency vs pT;pT (GeV);Efficiency',path='TRT/Efficiency',xbins=50,xmin=0,xmax=10)
-effGroup.defineHistogram('Efficiency_z0_passed,Efficiency_z0;hefficiency_z0',type='TProfile',title='Efficiency vs z0;z0;Efficiency',path='TRT/Efficiency',xbins=50,xmin=-200,xmax=200)
-effGroup.defineHistogram('EfficiencyBarrel_locR,EfficiencyBarrel_locR_passed;hefficiencyBarrel_locR',type='TProfile',title='Efficiency vs Track-to-Wire Distance for Xenon Straws (Barrel);Track-to-Wire Distance (mm);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5)
-effGroup.defineHistogram('EfficiencyBarrel_locR_Ar,EfficiencyBarrel_locR_Ar_passed;hefficiencyBarrel_locR_Ar',type='TProfile',title='Efficiency vs Track-to-Wire Distance for Argon Straws (Barrel);Track-to-Wire Distance (mm);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5)
+effGroup.defineHistogram('Efficiency_eta_passed,Efficiency_eta;hEfficiency_eta',type='TProfile',title='Efficiency vs #eta;#eta;Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.8,xmax=2.8)
+effGroup.defineHistogram('Efficiency_phi_passed,Efficiency_phi;hEfficiency_phi',type='TProfile',title='Efficiency vs #phi;#phi (deg);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-3.2,xmax=3.2)
+effGroup.defineHistogram('Efficiency_pt_passed,Efficiency_pt;hEfficiency_pt',type='TProfile',title='Efficiency vs pT;pT (GeV);Efficiency',path='TRT/Efficiency',xbins=50,xmin=0,xmax=10)
+effGroup.defineHistogram('Efficiency_z0_passed,Efficiency_z0;hEfficiency_z0',type='TProfile',title='Efficiency vs z0;z0;Efficiency',path='TRT/Efficiency',xbins=50,xmin=-200,xmax=200)
+effGroup.defineHistogram('EfficiencyBarrel_locR,EfficiencyBarrel_locR_passed;hEfficiencyBarrel_locR',type='TProfile',title='Efficiency vs Track-to-Wire Distance for Xenon Straws (Barrel);Track-to-Wire Distance (mm);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5)
+effGroup.defineHistogram('EfficiencyBarrel_locR_Ar,EfficiencyBarrel_locR_Ar_passed;hEfficiencyBarrel_locR_Ar',type='TProfile',title='Efficiency vs Track-to-Wire Distance for Argon Straws (Barrel);Track-to-Wire Distance (mm);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5)
 effBarrelGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistogramsBarrel')
 effBarrelGroup.defineHistogram('EfficiencyBarrelMap,EfficiencyBarrelMap_passed;hEfficiencyBarrelMap',type='TProfile',title='Straw Efficiency Map (Barrel);Straw Number;Efficiency',path='TRT/Efficiency',xbins=strawMax[0],xmin=0,xmax=strawMax[0])
 effEndcapGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistogramsEndCap')
@@ -181,8 +181,6 @@ for ibe in range(2):
             trackGroup.defineHistogram('HitHWonTMapC;unscaled_hHitHWonTMapC',type='TH1F',title='HL Hit(In time Window) on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe])
             trackGroup.defineHistogram('HtoLonTMapS,HtoLonTMapS_passed;hHtoLonTMapS',type='TProfile',title='HL/LL Ratio on Track: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe])
             trackGroup.defineHistogram('HtoLWonTMapS,HtoLWonTMapS_passed;hHtoLWonTMapS',type='TProfile',title='HL/LL (In Time Window) Ratio on Track: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe])
-            trackGroup.defineHistogram('HitonTrackVAllS_x,HitonTrackVAllS_y;hHitonTrackVAllS',type='TProfile',title='(Hit on Track) / (Any LL Bit): Straws;Straw Number in Stack;Ratio',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe])
-            trackGroup.defineHistogram('HitonTrackVAllC_x,HitonTrackVAllC_y;hHitonTrackVAllC',type='TProfile',title='(Hit on Track) / (Any LL Bit): Chips;Chip Number in Stack;Ratio',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe])
             trackGroup.defineHistogram('HtoLWonTMapC,HtoLWonTMapC_passed;hHtoLWonTMapC',type='TProfile',title='HL/LL(In Time Window) Ratio on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe])
             trackGroup.defineHistogram('HtoLonTMapC,HtoLonTMapC_passed;hHtoLonTMapC',type='TProfile',title='HL/LL Ratio on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe])
 
diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx
index ca081b5c5305..40c9befda92e 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3ESD_Alg.cxx
@@ -1197,71 +1197,66 @@ for (; p_trk != trackCollection.end(); ++p_trk) {
         }
     }
 
-    if (m_environment != Environment_t::online) {
-        if (m_doShift) {
-            Summary = 0;
-            SummaryWeight = 1.;
+    if (m_doShift) {
+        Summary = 0;
+        SummaryWeight = 1.;
+        fill("SmryHistograms", SummaryWeight, Summary);
+
+        if (m_doTracksMon) {
+            Summary = 1;
+            SummaryWeight = nTotalTracks;
             fill("SmryHistograms", SummaryWeight, Summary);
+            Summary = 2;
+            SummaryWeight = nTracksB[0];
+            fill("SmryHistograms", SummaryWeight, Summary);
+            Summary = 3;
+            SummaryWeight = nTracksB[1];
+            fill("SmryHistograms", SummaryWeight, Summary);
+            Summary = 4;
+            SummaryWeight = nTracksEC[0];
+            fill("SmryHistograms", SummaryWeight, Summary);
+            Summary = 5;
+            SummaryWeight = nTracksEC[1];
+            fill("SmryHistograms", SummaryWeight, Summary);
+            Summary = 6;
+            SummaryWeight = nTracksEC_B[0];
+            fill("SmryHistograms", SummaryWeight, Summary);
+            Summary = 7;
+            SummaryWeight = nTracksEC_B[1];
+            fill("SmryHistograms", SummaryWeight, Summary);
+        }
 
-            if (m_doTracksMon) {
-                Summary = 1;
-                SummaryWeight = nTotalTracks;
-                fill("SmryHistograms", SummaryWeight, Summary);
-                Summary = 2;
-                SummaryWeight = nTracksB[0];
-                fill("SmryHistograms", SummaryWeight, Summary);
-                Summary = 3;
-                SummaryWeight = nTracksB[1];
-                fill("SmryHistograms", SummaryWeight, Summary);
-                Summary = 4;
-                SummaryWeight = nTracksEC[0];
-                fill("SmryHistograms", SummaryWeight, Summary);
-                Summary = 5;
-                SummaryWeight = nTracksEC[1];
-                fill("SmryHistograms", SummaryWeight, Summary);
-                Summary = 6;
-                SummaryWeight = nTracksEC_B[0];
-                fill("SmryHistograms", SummaryWeight, Summary);
-                Summary = 7;
-                SummaryWeight = nTracksEC_B[1];
-                fill("SmryHistograms", SummaryWeight, Summary);
-            }
+        const unsigned int lumiBlock = eventInfo.lumiBlock();
+        ATH_MSG_VERBOSE("This is lumiblock : " << lumiBlock);
+        int lastLumiBlock = -99; // ToDo - last lumiblock calculation is not correct
+        if ((int)lumiBlock != lastLumiBlock) {
+            lastLumiBlock = lumiBlock;
         }
+        float evtLumiBlock = 1.;
+        float lumiBlockScale = (evtLumiBlock > 0) ? (1. / evtLumiBlock) : 0;
 
-        if (m_doShift) {
-            const unsigned int lumiBlock = eventInfo.lumiBlock();
-            ATH_MSG_VERBOSE("This is lumiblock : " << lumiBlock);
-            int lastLumiBlock = -99; // ToDo - last lumiblock calculation is not correct
-            if ((int)lumiBlock != lastLumiBlock) {
-                lastLumiBlock = lumiBlock;
-            }
-            float evtLumiBlock = 1.;
-            float lumiBlockScale = (evtLumiBlock > 0) ? (1. / evtLumiBlock) : 0;
+        if (m_doTracksMon && evtLumiBlock > 0) {
+            NTrksperLB_x = lastLumiBlock;
+            NTrksperLB_y = (float)nTrksperLB_B * lumiBlockScale;
+            fill("ShiftTRTTrackHistograms0", NTrksperLB_x, NTrksperLB_y);
 
-            if (m_doTracksMon && evtLumiBlock > 0) {
+            for (int iside = 0; iside < 2; iside++) {
                 NTrksperLB_x = lastLumiBlock;
-                NTrksperLB_y = (float)nTrksperLB_B * lumiBlockScale;
-                fill("ShiftTRTTrackHistograms0", NTrksperLB_x, NTrksperLB_y);
-
-                for (int iside = 0; iside < 2; iside++) {
-                    NTrksperLB_x = lastLumiBlock;
-                    NTrksperLB_y = (float)nTrksperLB_E[iside] * lumiBlockScale;
-                    fill("ShiftTRTTrackHistograms1"+std::to_string(iside), NTrksperLB_x, NTrksperLB_y);
-                }
-
-                nTrksperLB_B = 0;
+                NTrksperLB_y = (float)nTrksperLB_E[iside] * lumiBlockScale;
+                fill("ShiftTRTTrackHistograms1"+std::to_string(iside), NTrksperLB_x, NTrksperLB_y);
+            }
 
-                for (int iside = 0; iside < 2; iside++) {
-                    nTrksperLB_E[iside] = 0;
-                }
+            nTrksperLB_B = 0;
 
+            for (int iside = 0; iside < 2; iside++) {
+                nTrksperLB_E[iside] = 0;
             }
         }
-
-        ATH_MSG_DEBUG("end of event and lumi block");
-        //number of events in lumiblock counter setted to zero since it is end of the run or the lumiblock
     }
 
+    ATH_MSG_DEBUG("end of event and lumi block");
+    //number of events in lumiblock counter setted to zero since it is end of the run or the lumiblock
+
     return StatusCode::SUCCESS;
 }
 
diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3RAW_Alg.cxx b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3RAW_Alg.cxx
index 5f0bb2e25353..a0242b2f5810 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3RAW_Alg.cxx
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3RAW_Alg.cxx
@@ -809,78 +809,30 @@ StatusCode TRTMonitoringRun3RAW_Alg::fillTRTRDOs(const TRT_RDO_Container& rdoCon
         HLmoduleHits_E[i] = 0;
     }
 
-    short int scale_hHitWMap_B_passed[2][s_Straw_max[0]];
-    short int scale_hHitWMap_E_passed[2][2][s_Straw_max[1]];
-
-    for (int i = 0; i < 2; i++) {
-        for (int j = 0; j < s_Straw_max[0]; j++) {
-            scale_hHitWMap_B_passed[i][j] = 0;
-        }
-    }
-
-    for (int i = 0; i < 2; i++) {
-        for (int j = 0; j < 2; j++) {
-            for (int k = 0; k < s_Straw_max[1]; k++) {
-                scale_hHitWMap_E_passed[i][j][k] = 0;
-            }
-        }
-    }
-
-    short int scale_hHitHWMapS_B_passed[s_numberOfBarrelStacks*2][s_Straw_max[0]];
-    short int scale_hHitHWMapC_B_passed[s_numberOfBarrelStacks*2][s_iChip_max[0]];
-    short int scale_hHitWMapS_B_passed[s_numberOfBarrelStacks*2][s_Straw_max[0]];
-    short int scale_hHitWMapC_B_passed[s_numberOfBarrelStacks*2][s_iChip_max[0]];
-    short int scale_hHitAMapS_B_passed[s_numberOfBarrelStacks*2][s_Straw_max[0]];
-    short int scale_hHitAMapC_B_passed[s_numberOfBarrelStacks*2][s_iChip_max[0]];
-    short int scale_hHitAWMapS_B_passed[s_numberOfBarrelStacks*2][s_Straw_max[0]];
-    short int scale_hHitAWMapC_B_passed[s_numberOfBarrelStacks*2][s_iChip_max[0]];
-    short int scale_hHitHMapS_B_passed[s_numberOfBarrelStacks*2][s_Straw_max[0]];
-    short int scale_hHitHMapC_B_passed[s_numberOfBarrelStacks*2][s_iChip_max[0]];
-
-    for (int i = 0; i < s_numberOfBarrelStacks*2; i++) {
-        for (int j = 0; j < s_iChip_max[0]; j++) {
-            scale_hHitHWMapC_B_passed[i][j] = 0;
-            scale_hHitWMapC_B_passed[i][j]  = 0;
-            scale_hHitAMapC_B_passed[i][j]  = 0;
-            scale_hHitAWMapC_B_passed[i][j] = 0;
-            scale_hHitHMapC_B_passed[i][j]  = 0;
-        }
-        for (int j = 0; j < s_Straw_max[0]; j++) {
-            scale_hHitHWMapS_B_passed[i][j] = 0;
-            scale_hHitWMapS_B_passed[i][j]  = 0;
-            scale_hHitAMapS_B_passed[i][j]  = 0;
-            scale_hHitAWMapS_B_passed[i][j] = 0;
-            scale_hHitHMapS_B_passed[i][j]  = 0;
-        }
-    }
-
-    short int scale_hHitHWMapS_E_passed[s_numberOfEndCapStacks*2][s_Straw_max[1]];
-    short int scale_hHitHWMapC_E_passed[s_numberOfEndCapStacks*2][s_iChip_max[1]];
-    short int scale_hHitWMapS_E_passed[s_numberOfEndCapStacks*2][s_Straw_max[1]];
-    short int scale_hHitWMapC_E_passed[s_numberOfEndCapStacks*2][s_iChip_max[1]];
-    short int scale_hHitAMapS_E_passed[s_numberOfEndCapStacks*2][s_Straw_max[1]];
-    short int scale_hHitAMapC_E_passed[s_numberOfEndCapStacks*2][s_iChip_max[1]];
-    short int scale_hHitAWMapS_E_passed[s_numberOfEndCapStacks*2][s_Straw_max[1]];
-    short int scale_hHitAWMapC_E_passed[s_numberOfEndCapStacks*2][s_iChip_max[1]];
-    short int scale_hHitHMapC_E_passed[s_numberOfEndCapStacks*2][s_iChip_max[1]];
-    short int scale_hHitHMapS_E_passed[s_numberOfEndCapStacks*2][s_Straw_max[1]];
-
-    for (int i = 0; i < s_numberOfEndCapStacks*2; i++) {
-        for (int j = 0; j < s_iChip_max[1]; j++) {
-            scale_hHitHWMapC_E_passed[i][j] = 0;
-            scale_hHitWMapC_E_passed[i][j]  = 0;
-            scale_hHitAMapC_E_passed[i][j]  = 0;
-            scale_hHitAWMapC_E_passed[i][j] = 0;
-            scale_hHitHMapC_E_passed[i][j]  = 0;
-        }
-        for (int j = 0; j < s_Straw_max[1]; j++) {
-            scale_hHitHWMapS_E_passed[i][j] = 0;
-            scale_hHitWMapS_E_passed[i][j]  = 0;
-            scale_hHitAMapS_E_passed[i][j]  = 0;
-            scale_hHitAWMapS_E_passed[i][j] = 0;
-            scale_hHitHMapS_E_passed[i][j]  = 0;
-        }
-    }
+    auto scale_hHitWMap_B_passed = std::make_unique<short int[][s_Straw_max[0]]>(2);
+    auto scale_hHitWMap_E_passed = std::make_unique<short int[][2][s_Straw_max[1]]>(2);
+
+    auto scale_hHitHWMapS_B_passed = std::make_unique<short int[][s_Straw_max[0]]>(s_numberOfBarrelStacks*2);
+    auto scale_hHitHWMapC_B_passed = std::make_unique<short int[][s_iChip_max[0]]>(s_numberOfBarrelStacks*2);
+    auto scale_hHitWMapS_B_passed  = std::make_unique<short int[][s_Straw_max[0]]>(s_numberOfBarrelStacks*2);
+    auto scale_hHitWMapC_B_passed  = std::make_unique<short int[][s_iChip_max[0]]>(s_numberOfBarrelStacks*2);
+    auto scale_hHitAMapS_B_passed  = std::make_unique<short int[][s_Straw_max[0]]>(s_numberOfBarrelStacks*2);
+    auto scale_hHitAMapC_B_passed  = std::make_unique<short int[][s_iChip_max[0]]>(s_numberOfBarrelStacks*2);
+    auto scale_hHitAWMapS_B_passed = std::make_unique<short int[][s_Straw_max[0]]>(s_numberOfBarrelStacks*2);
+    auto scale_hHitAWMapC_B_passed = std::make_unique<short int[][s_iChip_max[0]]>(s_numberOfBarrelStacks*2);
+    auto scale_hHitHMapS_B_passed  = std::make_unique<short int[][s_Straw_max[0]]>(s_numberOfBarrelStacks*2);
+    auto scale_hHitHMapC_B_passed  = std::make_unique<short int[][s_iChip_max[0]]>(s_numberOfBarrelStacks*2);
+
+    auto scale_hHitHWMapS_E_passed = std::make_unique<short int[][s_Straw_max[1]]>(s_numberOfEndCapStacks*2);
+    auto scale_hHitHWMapC_E_passed = std::make_unique<short int[][s_iChip_max[1]]>(s_numberOfEndCapStacks*2);
+    auto scale_hHitWMapS_E_passed  = std::make_unique<short int[][s_Straw_max[1]]>(s_numberOfEndCapStacks*2);
+    auto scale_hHitWMapC_E_passed  = std::make_unique<short int[][s_iChip_max[1]]>(s_numberOfEndCapStacks*2);
+    auto scale_hHitAMapS_E_passed  = std::make_unique<short int[][s_Straw_max[1]]>(s_numberOfEndCapStacks*2);
+    auto scale_hHitAMapC_E_passed  = std::make_unique<short int[][s_iChip_max[1]]>(s_numberOfEndCapStacks*2);
+    auto scale_hHitAWMapS_E_passed = std::make_unique<short int[][s_Straw_max[1]]>(s_numberOfEndCapStacks*2);
+    auto scale_hHitAWMapC_E_passed = std::make_unique<short int[][s_iChip_max[1]]>(s_numberOfEndCapStacks*2);
+    auto scale_hHitHMapS_E_passed  = std::make_unique<short int[][s_Straw_max[1]]>(s_numberOfEndCapStacks*2);
+    auto scale_hHitHMapC_E_passed  = std::make_unique<short int[][s_iChip_max[1]]>(s_numberOfEndCapStacks*2);
 
     int goodid_status = 0;
     int prev_bcid = 0;
@@ -2152,8 +2104,6 @@ StatusCode TRTMonitoringRun3RAW_Alg::fillTRTHits(const TrackCollection& trackCol
     auto HtoLWonTMapC_passed     = Monitored::Scalar<bool>("HtoLWonTMapC_passed", false);
     auto HitTronTMapC_x          = Monitored::Scalar<float>("HitTronTMapC_x", 0.0);
     auto HitTronTMapC_y          = Monitored::Scalar<float>("HitTronTMapC_y", 0.0);
-    auto HitonTrackVAllS_x       = Monitored::Scalar<float>("HitonTrackVAllS_x", 0.0);
-    auto HitonTrackVAllS_y       = Monitored::Scalar<float>("HitonTrackVAllS_y", 0.0);
 
     auto p_trk = trackCollection.begin();
 
-- 
GitLab


From d139e4280eb5c9cb8752fc8c149a9ad98f8f3c99 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Wed, 22 Sep 2021 11:08:27 +0200
Subject: [PATCH 256/347] MuonCondSvc+MuonCondInterface: Fix cppcheck warnings.

---
 .../MuonCondInterface/RpcICoolStrSvc.h         |  8 ++++----
 .../MuonCondSvc/MuonCondSvc/CscCoolStrSvc.icc  |  9 +++------
 .../MuonCondSvc/MuonCondSvc/RpcCoolStrSvc.h    | 16 ++++++++--------
 .../MuonCondSvc/src/CSCCondSummarySvc.cxx      |  6 +++---
 .../MuonCondSvc/src/CscCoolStrSvc.cxx          | 16 +++++-----------
 .../MuonCondSvc/src/NSWCondUtils.cxx           |  2 +-
 .../MuonCondSvc/src/RPCCondSummarySvc.cxx      |  4 ++--
 .../MuonCondSvc/src/RpcCoolStrSvc.cxx          | 10 +++++-----
 .../MuonCondSvc/src/RpcStatusDbSvc.cxx         | 18 +++++-------------
 .../MuonCondSvc/src/TGCCondSummarySvc.cxx      |  6 +++---
 10 files changed, 39 insertions(+), 56 deletions(-)

diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/RpcICoolStrSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/RpcICoolStrSvc.h
index f11dc40f7db7..e700fc7890bf 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/RpcICoolStrSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/RpcICoolStrSvc.h
@@ -27,12 +27,12 @@ namespace MuonCalib {
             static const InterfaceID& interfaceID();
 
             // put data in file into COOL 
-            virtual StatusCode putFile(const std::string filename) const=0;
-            virtual StatusCode putOnlineFile(const std::string filename) const=0;
+            virtual StatusCode putFile(const std::string& filename) const=0;
+            virtual StatusCode putOnlineFile(const std::string& filename) const=0;
 
             //put data back into datafile
-            virtual StatusCode makeFile(const std::string fileName) const = 0;
-            virtual StatusCode makeOnlineFile(const std::string fileName) const = 0;
+            virtual StatusCode makeFile(const std::string& fileName) const = 0;
+            virtual StatusCode makeOnlineFile(const std::string& fileName) const = 0;
 
             virtual StatusCode writeToDB() const=0;
             virtual StatusCode writeToOnlineDB() const=0;
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.icc b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.icc
index 29f378a6b17e..1bb6190ccae6 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.icc
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/CscCoolStrSvc.icc
@@ -144,11 +144,9 @@ namespace MuonCalib {
     //initialize all strings with metadata. Right now, the only meta data is the
     //version number of the string. Eventually we may add extra data such as 
     //category and such
-    std::vector<std::string>::iterator strItr = strVec.begin();
-    std::vector<std::string>::iterator strEnd = strVec.end();
-    for(; strItr != strEnd ; strItr++) {
-      *strItr += version_number;
-      *strItr += " <BEGIN_DATA>";
+    for (std::string& s : strVec) {
+      s += version_number;
+      s += " <BEGIN_DATA>";
     }
 
     std::vector<bool> chansToUpdate(maxCoolChan,false);
@@ -361,7 +359,6 @@ namespace MuonCalib {
 
 
     //Now end each string, and submit it to the database;
-    strItr = strVec.begin();
     for(unsigned int coolChan =1; coolChan <= maxCoolChan ; coolChan++) {
       //If we don't have new data for this channel, don't update it.
       if(!chansToUpdate.at(coolChan-1))
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RpcCoolStrSvc.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RpcCoolStrSvc.h
index c90261e04894..a253924ef88b 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RpcCoolStrSvc.h
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/MuonCondSvc/RpcCoolStrSvc.h
@@ -49,27 +49,27 @@ namespace MuonCalib {
     RpcCoolStrSvc(const std::string& name, ISvcLocator* svc);
     virtual ~RpcCoolStrSvc()=default;
 
-    virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface);
+    virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override;
 
     virtual const InterfaceID& type() const;
-    virtual StatusCode initialize();
+    virtual StatusCode initialize() override;
 
     /**putFile copies data from a calibration file to the database. 
       @param filename The name of the file to copy from.
      */
-    virtual StatusCode putFile(const std::string filename) const;
+    virtual StatusCode putFile(const std::string& filename) const override;
     /**makeFile reads data from the db and creates a claibration file 
       @param filename The name of the file to write to
      */
-    virtual StatusCode makeFile(const std::string filename) const;
+    virtual StatusCode makeFile(const std::string& filename) const override;
     /**putOnlineFile copies data from a file containing dead channels to the database. 
       @param filename The name of the file to copy from.
      */
-    virtual StatusCode putOnlineFile(const std::string filename) const;
+    virtual StatusCode putOnlineFile(const std::string& filename) const override;
     /**makeOnlineFile copies dead chans from the db to the file. 
       @param filename The name of the file to write to
      */
-    virtual StatusCode makeOnlineFile(const std::string filename) const;
+    virtual StatusCode makeOnlineFile(const std::string& filename) const override;
 
     private:
     /**p_detstore hold a pointer to the transient data storage*/
@@ -81,8 +81,8 @@ namespace MuonCalib {
     /**Cool folder name*/
     std::string m_folder;
 
-    virtual StatusCode writeToDB() const;
-    virtual StatusCode writeToOnlineDB() const;
+    virtual StatusCode writeToDB() const override;
+    virtual StatusCode writeToOnlineDB() const override;
 
 
   };
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CSCCondSummarySvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CSCCondSummarySvc.cxx
index 2fdf4ff622b7..dd089c0c1957 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CSCCondSummarySvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CSCCondSummarySvc.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 "MuonCondSvc/CSCCondSummarySvc.h"
@@ -84,7 +84,7 @@ bool CSCCondSummarySvc::isGoodWireLayer(const Identifier & Id) const{
   if (not m_noReports){
     ServiceHandleArray<ICSCConditionsSvc>::const_iterator svc= m_reportingServices.begin();
     ServiceHandleArray<ICSCConditionsSvc>::const_iterator lastSvc= m_reportingServices.end();
-    for (;svc not_eq  lastSvc;svc++){
+    for (;svc not_eq  lastSvc;++svc){
       if ((*svc)->deadStationsId().size()!=0) {
 	bool found = std::binary_search((*svc)->deadStationsId().begin(),(*svc)->deadStationsId().end(),ChamberId,Compare);
 	if(found) result= false;
@@ -126,7 +126,7 @@ bool CSCCondSummarySvc::isGoodChamber(const Identifier & Id) const{
   int counter =0;
    ServiceHandleArray<ICSCConditionsSvc>::const_iterator svc= m_reportingServices.begin();
     ServiceHandleArray<ICSCConditionsSvc>::const_iterator lastSvc= m_reportingServices.end();
-    for (;svc not_eq  lastSvc;svc++){
+    for (;svc not_eq  lastSvc;++svc){
       ATH_MSG_WARNING(" Dead Stations from the service , size= "<<(*svc)->deadStationsId().size());
       if ((*svc)->deadStationsId().size()!=0){
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx
index 495b075a11c3..5d94b7b62a39 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/CscCoolStrSvc.cxx
@@ -723,17 +723,13 @@ namespace MuonCalib {
 
     ATH_MSG_DEBUG("Merging provided csc conditions data into the COOL data string for writing to database.");
     //CscCondDataContainer mergedContainer
-    CscCondDataContainer::const_iterator newItr = newCont->begin();
-    CscCondDataContainer::const_iterator endItr = newCont->end();
-    for(; newItr != endItr ; newItr++) {
-      if(!(*newItr))
+    for (const CscCondDataCollectionBase * newColl : *newCont) {
+      if(!newColl)
       {
         ATH_MSG_ERROR("Empty element in container with new data. Can't merge");
         return StatusCode::RECOVERABLE;
       }
 
-      const CscCondDataCollectionBase * newColl = *newItr;
-
       std::string parName = newColl->getParName();
       std::map<std::string, CscCondDataCollectionBase*>::const_iterator refItr =  
         m_parNameMap.find(parName);
@@ -788,11 +784,9 @@ namespace MuonCalib {
   /** callback functions called whenever a database folder goes out of date*/
   StatusCode CscCoolStrSvc::callback( IOVSVC_CALLBACK_ARGS_P(/*I*/,keys))
   { //IOVSVC_CALLBACK_ARGS is (int& idx, std::list<std::string>& keylist)
-    std::list<std::string>::const_iterator keyItr = keys.begin();
-    std::list<std::string>::const_iterator keyEnd = keys.end();
-    for(; keyItr != keyEnd; keyItr++) {
-      if(!cacheParameter(*keyItr).isSuccess()) {
-        ATH_MSG_WARNING("Failed at caching key " << (*keyItr));
+    for (const std::string& key : keys) {
+      if(!cacheParameter(key).isSuccess()) {
+        ATH_MSG_WARNING("Failed at caching key " << key);
       }
     } 
     return StatusCode::SUCCESS;
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/NSWCondUtils.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/NSWCondUtils.cxx
index dabdde1407fa..e4520a0459ca 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/NSWCondUtils.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/NSWCondUtils.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2020, 2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include <string>
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPCCondSummarySvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPCCondSummarySvc.cxx
index 12bf5f1bf64b..4739b1d8d47a 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPCCondSummarySvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RPCCondSummarySvc.cxx
@@ -89,7 +89,7 @@ bool RPCCondSummarySvc::isGoodPanel(const Identifier & Id) const{
   //Identifier PanelId = Id;
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
-  for (;svc not_eq  lastSvc;svc++){
+  for (;svc not_eq  lastSvc;++svc){
     ATH_MSG_DEBUG(" Eff Panels from the service, size= "<<(*svc)->EffPanelId().size());
     if ((*svc)->EffPanelId().size()!=0){
       bool found = std::binary_search((*svc)->EffPanelId().begin(),(*svc)->EffPanelId().end(),PanelId,Compare);
@@ -115,7 +115,7 @@ bool RPCCondSummarySvc::isGoodStrip(const Identifier & Id) const{
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
   ServiceHandleArray<IRPCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
   if (not m_noReports){
-    for (;svc not_eq  lastSvc;svc++){
+    for (;svc not_eq  lastSvc;++svc){
       if ((*svc)->EffPanelId().size()!=0) {
 	bool found = std::binary_search((*svc)->EffPanelId().begin(),(*svc)->EffPanelId().end(),PanelId,Compare);
 	if(found) result= false;
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcCoolStrSvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcCoolStrSvc.cxx
index e7d64c3369b9..9d533cfe5e00 100755
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcCoolStrSvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcCoolStrSvc.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
 */
 
 //Service designed to read in calibration files to the cool database. Can also read them
@@ -67,7 +67,7 @@ namespace MuonCalib {
     return StatusCode::SUCCESS;
   }
 
-  StatusCode RpcCoolStrSvc::putOnlineFile(const std::string filename) const {
+  StatusCode RpcCoolStrSvc::putOnlineFile(const std::string& filename) const {
 
     // for the time being let's keep this 
 
@@ -112,7 +112,7 @@ namespace MuonCalib {
   //for placing in the database. It uses putDbParameter() to actually put a parameter's values into a database.
 
 
-  StatusCode RpcCoolStrSvc::putFile(const std::string filename) const 
+  StatusCode RpcCoolStrSvc::putFile(const std::string& filename) const 
   {
     
 
@@ -297,7 +297,7 @@ namespace MuonCalib {
     
   }
   
-  StatusCode RpcCoolStrSvc::makeOnlineFile(const std::string fileName) const{
+  StatusCode RpcCoolStrSvc::makeOnlineFile(const std::string& fileName) const{
     
         ATH_MSG_DEBUG("Opening online mask output file "<< fileName << " for writing.");
         std::ofstream out(fileName.c_str());
@@ -337,7 +337,7 @@ namespace MuonCalib {
 
 
   /**Generate a calibration file*/
-  StatusCode RpcCoolStrSvc::makeFile(const std::string fileName) const
+  StatusCode RpcCoolStrSvc::makeFile(const std::string& fileName) const
   {
 
         ATH_MSG_DEBUG("Opening calibration output file "<< fileName << " for writing.");
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcStatusDbSvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcStatusDbSvc.cxx
index b723c9d092e3..67caae8ab778 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcStatusDbSvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/RpcStatusDbSvc.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 "GaudiKernel/MsgStream.h"
@@ -16,19 +16,11 @@
 
 RpcStatusDbSvc::RpcStatusDbSvc(const std::string& name, ISvcLocator* pSvcLocator) :
   AthService(name, pSvcLocator),
-  m_dbTool(0)
+  m_dbTool(0),
+  m_rpcStatusDataLocation("RpcKey")
 {
-
-
-  m_dbToolType = "RpcDetectorStatusDbTool"; 
-  m_dbToolName = "RpcDetectorStatusDbTool";  
-  
-  declareProperty("DBToolType", m_dbToolType);
-  declareProperty("DBToolName", m_dbToolName);
-  
-  m_rpcStatusDataLocation="RpcKey"; 
-  
-                                 
+  declareProperty("DBToolType", m_dbToolType = "RpcDetectorStatusDbTool");
+  declareProperty("DBToolName", m_dbToolName = "RpcDetectorStatusDbTool");
 }
 
 
diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TGCCondSummarySvc.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TGCCondSummarySvc.cxx
index 55a48d2ee71b..6083a7851fb2 100644
--- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TGCCondSummarySvc.cxx
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/src/TGCCondSummarySvc.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 "MuonCondSvc/TGCCondSummarySvc.h"
@@ -79,7 +79,7 @@ bool TGCCondSummarySvc::isGoodChamber(const Identifier & Id){
   if (not m_noReports){
     ServiceHandleArray<ITGCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
     ServiceHandleArray<ITGCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
-    for (;svc not_eq  lastSvc;svc++){
+    for (;svc not_eq  lastSvc;++svc){
       if ((*svc)->deadStationsId().size()!=0){
 	bool found = std::binary_search( 
   	   (*svc)->deadStationsId().begin(),(*svc)->deadStationsId().end(),Id,Compare);
@@ -100,7 +100,7 @@ const std::vector<Identifier>& TGCCondSummarySvc::deadStationsId(){
   if (not m_noReports){
     ServiceHandleArray<ITGCConditionsSvc>::const_iterator svc(m_reportingServices.begin());
     ServiceHandleArray<ITGCConditionsSvc>::const_iterator lastSvc(m_reportingServices.end());
-    for (;svc not_eq  lastSvc;svc++){
+    for (;svc not_eq  lastSvc;++svc){
       if ((*svc)->deadStationsId().size()!=0){
 	return (*svc)->deadStationsId();
       }else{
-- 
GitLab


From b293ef31e98325bd2f0ad8ef675405a0e644d790 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Wed, 22 Sep 2021 11:33:01 +0200
Subject: [PATCH 257/347] AGDDControl+AGDDHandlers+AGDD2GeoSvc+MuonAGDD: Remove
 AGDDController singleton.

---
 .../AGDD2GeoSvc/AGDD2GeoSvc/AGDD2GeoSvc.h     | 12 ++++---
 .../AGDD/AGDD2GeoSvc/src/AGDD2GeoSvc.cxx      | 21 ++++++++++--
 .../AGDD/AGDD2GeoSvc/src/DefaultAGDDTool.cxx  | 13 +++----
 .../AGDDControl/AGDDControl/AGDDController.h  | 34 +++++++------------
 .../AGDDControl/AGDDControl/AGDDToolBase.h    |  7 ++--
 .../AGDDControl}/IAGDD2GeoSvc.h               | 12 ++++---
 .../AGDD/AGDDControl/src/AGDDController.cxx   | 22 +++++-------
 .../AGDD/AGDDControl/src/AGDDToolBase.cxx     | 15 ++++----
 .../AGDDHandlers/AGDDHandlers/importHandler.h | 12 ++++---
 .../AGDD/AGDDHandlers/src/importHandler.cxx   |  9 +++--
 .../MuonAGDD/src/MuonAGDDTool.cxx             | 21 ++++++------
 .../MuonAGDD/src/MuonAGDDToolHelper.cxx       |  4 +--
 .../MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx | 19 ++++++-----
 13 files changed, 112 insertions(+), 89 deletions(-)
 rename DetectorDescription/AGDD/{AGDD2GeoSvc/AGDD2GeoSvc => AGDDControl/AGDDControl}/IAGDD2GeoSvc.h (59%)

diff --git a/DetectorDescription/AGDD/AGDD2GeoSvc/AGDD2GeoSvc/AGDD2GeoSvc.h b/DetectorDescription/AGDD/AGDD2GeoSvc/AGDD2GeoSvc/AGDD2GeoSvc.h
index 39cf35585f1f..aee3ddc3dc2b 100644
--- a/DetectorDescription/AGDD/AGDD2GeoSvc/AGDD2GeoSvc/AGDD2GeoSvc.h
+++ b/DetectorDescription/AGDD/AGDD2GeoSvc/AGDD2GeoSvc/AGDD2GeoSvc.h
@@ -1,18 +1,20 @@
 /*
-  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 AGDD2GeoSvc_H
 #define AGDD2GeoSvc_H
 
-#include "AGDD2GeoSvc/IAGDD2GeoSvc.h"
+#include "AGDDControl/IAGDD2GeoSvc.h"
 #include "AGDDControl/XMLHandler.h"
 #include "AGDDControl/IAGDDToolBase.h"
+#include "AGDDControl/AGDDController.h"
 #include "AthenaBaseComps/AthService.h"
 
 #include "AGDDKernel/AGDDDetectorStore.h"
 
 #include <vector>
+#include <mutex>
 
 class ISvcLocator;
 class IToolSvc;
@@ -26,7 +28,8 @@ public:
 
   virtual StatusCode initialize() override final;
 
-  virtual void addHandler(XMLHandler* v) override final { m_handlerVector.push_back(v);}
+  virtual void addHandler(XMLHandler* v) override final;
+  virtual LockedController getController() override final;
 
   // Standard Constructor
   AGDDtoGeoSvc(const std::string& name, ISvcLocator* svc);
@@ -41,7 +44,8 @@ private:
   std::vector<XMLHandler*> m_handlerVector;
 
   ToolHandleArray<IAGDDToolBase> m_builders; // public ToolHandleArray
-
+  AGDDController m_controller;
+  std::recursive_mutex m_mutex;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDD2GeoSvc/src/AGDD2GeoSvc.cxx b/DetectorDescription/AGDD/AGDD2GeoSvc/src/AGDD2GeoSvc.cxx
index bf45453822be..df046ac93dfe 100644
--- a/DetectorDescription/AGDD/AGDD2GeoSvc/src/AGDD2GeoSvc.cxx
+++ b/DetectorDescription/AGDD/AGDD2GeoSvc/src/AGDD2GeoSvc.cxx
@@ -1,12 +1,13 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AGDD2GeoSvc/AGDD2GeoSvc.h"
-#include "AGDD2GeoSvc/IAGDD2GeoSvc.h"
+#include "AGDDControl/IAGDD2GeoSvc.h"
 
 #include "AGDDControl/IAGDDToolBase.h"
 #include "AGDDControl/AGDDTokenizer.h"
+#include "AGDDControl/AGDDController.h"
 #include "AGDDKernel/AliasStore.h"
 
 #include <iostream>
@@ -89,7 +90,7 @@ void AGDDtoGeoSvc::localInitialization()
 	addHandler(new unionHandler("union"));
 	addHandler(new varHandler("var"));
 	addHandler(new versionHandler("version"));
-	addHandler(new importHandler("import"));
+	addHandler(new importHandler("import", m_controller));
 	
 	addHandler(new chamberPositionerHandler("chamberPosition"));
 
@@ -130,3 +131,17 @@ void AGDDtoGeoSvc::localInitialization()
 	AliasStore::GetAliasList()->AddAlias("PolyBoronH3B03","shield::PolyboronH3B03");
 	AliasStore::GetAliasList()->AddAlias("PolyBoron207HD5","shield::Polyboron207HD5");
 }
+
+
+void AGDDtoGeoSvc::addHandler (XMLHandler* v)
+{
+  std::scoped_lock lock (m_mutex);
+  m_handlerVector.push_back(v);
+}
+
+
+IAGDDtoGeoSvc::LockedController AGDDtoGeoSvc::getController()
+{
+  std::unique_lock lock (m_mutex);
+  return LockedController (m_controller, std::move (lock));
+}
diff --git a/DetectorDescription/AGDD/AGDD2GeoSvc/src/DefaultAGDDTool.cxx b/DetectorDescription/AGDD/AGDD2GeoSvc/src/DefaultAGDDTool.cxx
index bbf3e19e6ad5..2ed5c9c6ad26 100644
--- a/DetectorDescription/AGDD/AGDD2GeoSvc/src/DefaultAGDDTool.cxx
+++ b/DetectorDescription/AGDD/AGDD2GeoSvc/src/DefaultAGDDTool.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 "AGDD2GeoSvc/DefaultAGDDTool.h"
@@ -25,23 +25,24 @@ StatusCode DefaultAGDDTool::construct()
 	ATH_MSG_INFO(" Name = "<<name());
 	
 	ATH_MSG_INFO(" trying to parse files ");
-	m_controller->ParseFiles();
+        IAGDDtoGeoSvc::LockedController controller = m_svc->getController();
+	controller->ParseFiles();
 	
 	if (m_printSections) 
 	{
 		ATH_MSG_INFO(" \tPrinting all Sections");
-		m_controller->PrintSections();
+		controller->PrintSections();
 	}
 	
 	if (!m_defaultDetector.empty())
     {
 		ATH_MSG_INFO(" setting default detector to "<<m_defaultDetector.value());
-	   	m_controller->UseGeoModelDetector(m_defaultDetector.value());
+	   	controller->UseGeoModelDetector(m_defaultDetector.value());
 	}
 	
-	m_controller->BuildAll();
+	controller->BuildAll();
 	
-	m_controller->Clean();
+	controller->Clean();
 	
 	return StatusCode::SUCCESS;
 }
diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDController.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDController.h
index e6335436e3da..013cff5de7b1 100644
--- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDController.h
+++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDController.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 AGDDController_H
@@ -16,45 +16,37 @@ class GeoFullPhysVol;
 
 class AGDDController {
 public:
+	AGDDController();
 	~AGDDController();
-	static AGDDController* GetController();
 	void SetBuilder(AGDDBuilder *b);
 	void SetParser(IAGDDParser *b);
 	AGDDBuilder* GetBuilder();
 	IAGDDParser* GetParser();
-	void AddFile(std::string fName);
-	void AddSection(std::string section);
-	void AddVolume(std::string volume);
+	void AddFile(const std::string& fName);
+	void AddSection(const std::string& section);
+	void AddVolume(const std::string& volume);
 	void ParseFiles();
-	void ParseString(std::string);
-	bool WriteAGDDtoDBFile(std::string);
+	void ParseString(const std::string&);
+	bool WriteAGDDtoDBFile(const std::string&);
 	void PrintSections() const;
 	void BuildVolumes();
 	void BuildSections();
 	void BuildAll();
 	void Clean();
 	
-	static void PrintVolumeHierarchy(std::string, int);
+	static void PrintVolumeHierarchy(const std::string&, int);
 	
-	void UseGeoModelDetector(std::string);
+	void UseGeoModelDetector(const std::string&);
 	
 	void Locked(bool b) {m_locked=b;}
-	bool Locked() {return m_locked;}
+	bool Locked() const {return m_locked;}
 	
 	void DisableSections(bool b) {m_disableSections=b;}
-	bool DisableSections() {return m_disableSections;}
+	bool DisableSections() const {return m_disableSections;}
 private:
 	
-	AGDDController();
-	AGDDController(const AGDDController& c):m_theParser(c.m_theParser),m_theBuilder(c.m_theBuilder) {;}
-	AGDDController& operator=(const AGDDController& c) 
-	{
-		if (this!=&c) {
-			m_theParser=c.m_theParser;
-			m_theBuilder=c.m_theBuilder;
-		}
-		return *this;
-	}
+        AGDDController(const AGDDController& c) = delete;
+        AGDDController& operator=(const AGDDController& c) = delete;
 	IAGDDParser *m_theParser;
 	AGDDBuilder* m_theBuilder;
 	
diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDToolBase.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDToolBase.h
index 333bf98cb72e..22e906b7a9bd 100644
--- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDToolBase.h
+++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/AGDDToolBase.h
@@ -1,12 +1,14 @@
 /*
-  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 AGDDCONTROL_AGDDToolBase_H
 #define AGDDCONTROL_AGDDToolBase_H
 
 #include "AGDDControl/IAGDDToolBase.h"
+#include "AGDDControl/IAGDD2GeoSvc.h"
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ServiceHandle.h"
 
 class AGDDController;
 
@@ -40,7 +42,8 @@ protected:
   Gaudi::Property<std::string> m_DBFileName{this,"OutputFileName","","specify name for DB text file"};
   Gaudi::Property<std::string> m_agdd2GeoSvcName{this,"AGDDtoGeoSvcName","AGDDtoGeoSvc","specify name of AGDDtoGeoSvc"};
 
-  AGDDController* m_controller {};
+  ServiceHandle<IAGDDtoGeoSvc> m_svc
+    { this, "AGDDtoGeoSvc", "AGDDtoGeoSvc", "" };
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDD2GeoSvc/AGDD2GeoSvc/IAGDD2GeoSvc.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDD2GeoSvc.h
similarity index 59%
rename from DetectorDescription/AGDD/AGDD2GeoSvc/AGDD2GeoSvc/IAGDD2GeoSvc.h
rename to DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDD2GeoSvc.h
index c4eb9f8e46d7..bcd4dbd36e6d 100644
--- a/DetectorDescription/AGDD/AGDD2GeoSvc/AGDD2GeoSvc/IAGDD2GeoSvc.h
+++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDD2GeoSvc.h
@@ -1,17 +1,19 @@
 /*
-  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 IAGGDtoGeoSvc_H
-#define IAGGDtoGeoSvc_H
+#ifndef AGDDCONTROL_IAGGD2GEOSVC_H
+#define AGDDCONTROL_IAGGD2GEOSVC_H
 
 // Include Files
 #include "GaudiKernel/IService.h"
+#include "CxxUtils/LockedPointer.h"
 #include <string>
 #include <vector>
 
 // Forward declarations
 class XMLHandler;
+class AGDDController;
 
 typedef std::vector<std::string>::const_iterator StrVecIterator;
 
@@ -21,9 +23,11 @@ public:
   /// Creates the InterfaceID and interfaceID() method
   DeclareInterfaceID(IAGDDtoGeoSvc, 1 , 0);
 
+  using LockedController = CxxUtils::LockedPointer<AGDDController>;
+
   // accessors
   virtual void addHandler(XMLHandler*) = 0;
-
+  virtual LockedController getController() = 0;
 };
 
 
diff --git a/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx b/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
index 307f982b2eea..1f4b24cc2c9d 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/AGDDController.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 "AGDDControl/AGDDController.h"
@@ -80,15 +80,15 @@ IAGDDParser* AGDDController::GetParser()
 {
 	return m_theParser;
 }
-void AGDDController::AddFile(std::string fName) 
+void AGDDController::AddFile(const std::string& fName) 
 {
 	m_filesToParse.push_back(fName);
 }
-void AGDDController::AddSection(std::string section) 
+void AGDDController::AddSection(const std::string& section) 
 {
 	m_sectionsToBuild.push_back(section);
 }
-void AGDDController::AddVolume(std::string section) 
+void AGDDController::AddVolume(const std::string& section) 
 {
 	m_volumesToBuild.push_back(section);
 }
@@ -129,13 +129,13 @@ void AGDDController::PrintSections() const
   	ss->PrintAllSections();
 }
 
-void AGDDController::ParseString(std::string s)
+void AGDDController::ParseString(const std::string& s)
 {
 	if (!m_theParser) m_theParser=new XercesParser;
 	m_theParser->ParseStringAndNavigate(s);
 }
 
-bool AGDDController::WriteAGDDtoDBFile(std::string s)
+bool AGDDController::WriteAGDDtoDBFile(const std::string& s)
 {
 	if (!m_theParser)
 	{
@@ -148,13 +148,7 @@ bool AGDDController::WriteAGDDtoDBFile(std::string s)
 	}
 }
 
-AGDDController* AGDDController::GetController()
-{
-	static AGDDController* theController=new AGDDController;
-	return theController;
-}
-
-void AGDDController::UseGeoModelDetector(std::string name)
+void AGDDController::UseGeoModelDetector(const std::string& name)
 {
 	StoreGateSvc* pDetStore=0;
 	ISvcLocator* svcLocator = Gaudi::svcLocator();
@@ -180,7 +174,7 @@ void AGDDController::UseGeoModelDetector(std::string name)
 
 }
 
-void AGDDController::PrintVolumeHierarchy(std::string name, int ilevel)
+void AGDDController::PrintVolumeHierarchy(const std::string& name, int ilevel)
 {
 	AGDDVolumeStore *vs=AGDDVolumeStore::GetVolumeStore();
 	AGDDVolume *vol=vs->GetVolume(name);
diff --git a/DetectorDescription/AGDD/AGDDControl/src/AGDDToolBase.cxx b/DetectorDescription/AGDD/AGDDControl/src/AGDDToolBase.cxx
index 05c0aec7df6b..65c35109d0db 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/AGDDToolBase.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/AGDDToolBase.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 "AGDDControl/AGDDToolBase.h"
@@ -10,11 +10,11 @@ AGDDToolBase::AGDDToolBase(const std::string& type, const std::string& name,
   : base_class(type,name,parent)
 {
   ATH_MSG_DEBUG(" trying to get the controller");
-  m_controller = AGDDController::GetController();
 }
 
 StatusCode AGDDToolBase::initialize()
 {
+  ATH_CHECK( m_svc.retrieve() );
   InitializeAGDD();
   return StatusCode::SUCCESS;
 }
@@ -22,14 +22,15 @@ StatusCode AGDDToolBase::initialize()
 void AGDDToolBase::InitializeAGDD()
 {
 	ATH_MSG_INFO(" initializing AGDD builder");
-	
-	m_controller->Locked(m_locked);
+
+        IAGDDtoGeoSvc::LockedController controller = m_svc->getController();
+	controller->Locked(m_locked);
 	
 	ATH_MSG_INFO(" XML file ");
   	for (unsigned int i=0;i<m_xmlFiles.size();i++)
   	{
   		ATH_MSG_INFO(" \t file "<<m_xmlFiles[i]);
-		m_controller->AddFile(m_xmlFiles[i]);		
+		controller->AddFile(m_xmlFiles[i]);		
   	}
   	ATH_MSG_INFO (" ---------");	
 	
@@ -38,7 +39,7 @@ void AGDDToolBase::InitializeAGDD()
   	for (unsigned int i=0;i<m_sectionsToBuild.size();i++)
   	{
   		ATH_MSG_INFO(" \t section "<<m_sectionsToBuild[i]);
-		m_controller->AddSection(m_sectionsToBuild[i]);		
+		controller->AddSection(m_sectionsToBuild[i]);		
   	}
   	ATH_MSG_INFO (" ---------");
 	
@@ -47,7 +48,7 @@ void AGDDToolBase::InitializeAGDD()
   	for (unsigned int i=0;i<m_volumesToBuild.size();i++)
   	{
   		ATH_MSG_INFO(" \t volume "<<m_volumesToBuild[i]);
-		m_controller->AddVolume(m_volumesToBuild[i]);		
+		controller->AddVolume(m_volumesToBuild[i]);		
   	}
   	ATH_MSG_INFO (" ---------");
 
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/importHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/importHandler.h
index 194cb08ecc3f..e527d329023e 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/importHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/importHandler.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 importHandler_H
@@ -7,12 +7,16 @@
 
 #include "AGDDControl/XMLHandler.h"
 #include <string>
+class AGDDController;
+
 
 class importHandler:public XMLHandler {
 public:
-	importHandler(std::string);
-	void ElementHandle();
-
+        importHandler(const std::string&,
+                      AGDDController& controller);
+        virtual void ElementHandle() override;
+private:
+        AGDDController& m_controller;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/importHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/importHandler.cxx
index cb0cb4137420..36c0f2680bd3 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/importHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/importHandler.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 "AGDDHandlers/importHandler.h"
@@ -9,7 +9,10 @@
 #include <iostream>
 
 
-importHandler::importHandler(std::string s):XMLHandler(s)
+importHandler::importHandler(const std::string& s,
+                             AGDDController& controller)
+  : XMLHandler(s),
+    m_controller (controller)
 {
 }
 
@@ -17,5 +20,5 @@ void importHandler::ElementHandle()
 {
 	std::string filename=getAttributeAsString("filename");
 	std::cout<<" trying to parse file "<<filename<<std::endl;
-	(AGDDController::GetController()->GetParser())->ParseFileAndNavigate(filename);
+	m_controller.GetParser()->ParseFileAndNavigate(filename);
 }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx
index d71e85429dfa..fd2f1ec70b32 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.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 "MuonAGDD/MuonAGDDTool.h"
@@ -56,7 +56,8 @@ StatusCode MuonAGDDTool::construct()
 	MuonAGDDToolHelper theHelper;
 	theHelper.setAGDDtoGeoSvcName(m_agdd2GeoSvcName);
 
-	m_controller->UseGeoModelDetector("Muon");
+        IAGDDtoGeoSvc::LockedController controller = m_svc->getController();
+	controller->UseGeoModelDetector("Muon");
 	
 	if (!m_locked)
 	{
@@ -70,7 +71,7 @@ StatusCode MuonAGDDTool::construct()
 	// reading from a local AGDD xml file
 	if (!m_readAGDD) {
 		ATH_MSG_INFO(" Parsing local xml file ");
-		m_controller->ParseFiles();
+		controller->ParseFiles();
     // reading the AGDD xml blob from the ATLAS geometry database
 	} else {
 	    ATH_MSG_INFO(" now reading AGDD blob ");
@@ -83,36 +84,36 @@ StatusCode MuonAGDDTool::construct()
 		    ATH_MSG_ERROR("\t-- empty AGDDfile - this cannot be correct " );
 		    return StatusCode::FAILURE;
 	    }
-	    m_controller->ParseString(AGDDfile);
+	    controller->ParseString(AGDDfile);
 	}
 
 	if (m_printSections) {	
 		ATH_MSG_INFO("\t Printing all sections");
-		m_controller->PrintSections();
+		controller->PrintSections();
 	}
 
     // when reading from a local AGDD xml file and not creating a layout (i.e. running simulation from a local xml file),
     // only build those volumes that are specified at the 'Volumes' property (analogously to the AGDD2GeoSwitches when reading the blob)
     if (!m_readAGDD && !m_writeDBfile) {
         for (const auto &vol:m_volumesToBuild) {
-            m_controller->GetBuilder()->BuildFromVolume(vol);
+            controller->GetBuilder()->BuildFromVolume(vol);
         }
     } else {
     // when reading the AGDD xml blob, only build the volumes specified via the AGDD2GeoSwitches
 	    for (const auto &structure: m_structuresFromFlags) {
             if (!m_buildNSW && structure=="NewSmallWheel") continue;
-            m_controller->GetBuilder()->BuildFromVolume(structure);
+            controller->GetBuilder()->BuildFromVolume(structure);
         }
     }
 
 	if(m_writeDBfile)
 	{
 		// build model before writing blob - if Athena crashes the XML is not good and should not become a blob
-		((AGDD2GeoModelBuilder*)m_controller->GetBuilder())->BuildAllVolumes();
+		((AGDD2GeoModelBuilder*)controller->GetBuilder())->BuildAllVolumes();
 		ATH_MSG_INFO("\t-- attempting to write output to "<< m_outFileName );
 		if( !m_outFileName.empty() )
 		{
-			if(!m_controller->WriteAGDDtoDBFile( m_outFileName ))
+			if(!controller->WriteAGDDtoDBFile( m_outFileName ))
 			{
 				ATH_MSG_ERROR("\t-- something went wrong during writing AGDD file - crashing" );
 				return StatusCode::FAILURE;
@@ -135,7 +136,7 @@ StatusCode MuonAGDDTool::construct()
 		}
 	}
 
-	m_controller->Clean();
+	controller->Clean();
 
 	return StatusCode::SUCCESS;
 }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
index 4b205e39d39a..2829393b9554 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.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 "MuonAGDDToolHelper.h"
@@ -16,7 +16,7 @@
 #include "AGDDControl/AGDDController.h"
 #include "AGDDModel/AGDDParameterStore.h"
 #include "AGDDControl/AGDD2GeoModelBuilder.h"
-#include "AGDD2GeoSvc/IAGDD2GeoSvc.h"
+#include "AGDDControl/IAGDD2GeoSvc.h"
 #include "AGDDKernel/AliasStore.h"
 #include "AGDDKernel/AGDDDetector.h"
 #include "AGDDKernel/AGDDDetectorStore.h"
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx
index ceb10ed4e3cb..08775bc544f3 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.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 "MuonAGDD/NSWAGDDTool.h"
@@ -7,7 +7,7 @@
 #include "MuonAGDDToolHelper.h"
 #include "AGDDControl/AGDDController.h"
 #include "AGDDControl/AGDD2GeoModelBuilder.h"
-#include "AGDD2GeoSvc/IAGDD2GeoSvc.h"
+#include "AGDDControl/IAGDD2GeoSvc.h"
 #include "AGDDModel/AGDDParameterStore.h"
 #include "AGDDKernel/AGDDDetector.h"
 #include "AGDDKernel/AGDDDetectorStore.h"
@@ -59,28 +59,29 @@ StatusCode NSWAGDDTool::construct()
 {
 	ATH_MSG_INFO(name()<<"::construct()");
 	
+        IAGDDtoGeoSvc::LockedController controller = m_svc->getController();
 	MuonAGDDToolHelper theHelper;
 	theHelper.setAGDDtoGeoSvcName(m_agdd2GeoSvcName);
 	if (!m_readAGDD)
 	{
 		ATH_MSG_INFO(" trying to parse files ");
-		m_controller->ParseFiles();
+		controller->ParseFiles();
 	}
 	else
 	{
 		ATH_MSG_INFO(" trying to parse data base content ");
 		std::string AGDDfile = theHelper.GetAGDD(m_dumpAGDD, m_outFileType, m_DBFileName);
-		m_controller->ParseString(AGDDfile);
+		controller->ParseString(AGDDfile);
 	}
 	
 	if (m_printSections) 
 	{
 		ATH_MSG_INFO("\t Printing all sections ");
-		m_controller->PrintSections();
+		controller->PrintSections();
 	}
 	
-	m_controller->UseGeoModelDetector("Muon");
-	m_controller->BuildAll();
+	controller->UseGeoModelDetector("Muon");
+	controller->BuildAll();
 	
 	// part needed to build the NSW RO geometry
 	
@@ -98,7 +99,7 @@ StatusCode NSWAGDDTool::construct()
 		ATH_MSG_INFO("\t-- attempting to write output to "<< m_outFileName );
 		if( !m_outFileName.empty() )
 		{
-			if(!m_controller->WriteAGDDtoDBFile( m_outFileName ))
+			if(!controller->WriteAGDDtoDBFile( m_outFileName ))
 			{
 				ATH_MSG_ERROR("\t-- something went wrong during writing AGDD file - crashing" );
 				return StatusCode::FAILURE;
@@ -121,7 +122,7 @@ StatusCode NSWAGDDTool::construct()
 		}
 	}
 
-	m_controller->Clean();
+	controller->Clean();
 	
 	return StatusCode::SUCCESS;
 }
-- 
GitLab


From 90f1bc04a0fec394140345ddc7090ca01e7862a9 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Wed, 22 Sep 2021 11:35:34 +0200
Subject: [PATCH 258/347] TRT_Monitoring+TRTMonitoringRun3: Capture return of
 getHolesOnTrack in a unique_ptr.

---
 .../TRTMonitoringRun3/src/TRTMonitoringRun3RAW_Alg.cxx      | 6 ++----
 .../TRT_Monitoring/src/TRT_Monitoring_Tool.cxx              | 5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3RAW_Alg.cxx b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3RAW_Alg.cxx
index 5f0bb2e25353..3237a3d510b5 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3RAW_Alg.cxx
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/src/TRTMonitoringRun3RAW_Alg.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
 */
 
 #define FILLEVENTNORMALIZATION(NBINS, MIN, WIDTH, VALUE, VARPASSED, VAR, HISTGROUP) \
@@ -1980,7 +1980,7 @@ StatusCode TRTMonitoringRun3RAW_Alg::fillTRTEfficiency(const TrackCollection& co
 
         // Use hole finder to find holes on this track
         if (m_useHoleFinder) {
-            const DataVector<const Trk::TrackStateOnSurface> *holes = m_trt_hole_finder->getHolesOnTrack(**track);
+            std::unique_ptr<const Trk::TrackStates> holes (m_trt_hole_finder->getHolesOnTrack(**track));
 
             if (!holes) {
 
@@ -2090,8 +2090,6 @@ StatusCode TRTMonitoringRun3RAW_Alg::fillTRTEfficiency(const TrackCollection& co
                     Efficiency_z0 = 0.0;
                     fill("TRTEfficiencyHistograms", Efficiency_z0_passed, Efficiency_z0);
                 }
-
-                delete holes;
             }
         }
     }
diff --git a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx
index c4b2e71bb928..678e6070fe2a 100644
--- a/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.cxx
+++ b/InnerDetector/InDetMonitoring/TRT_Monitoring/src/TRT_Monitoring_Tool.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 "TRT_Monitoring_Tool.h"
@@ -3689,7 +3689,7 @@ StatusCode TRT_Monitoring_Tool::fillTRTEfficiency(const TrackCollection& combTra
 		//use hole finder to find holes on this track !
 
 		if (m_useHoleFinder) {
-			const DataVector<const Trk::TrackStateOnSurface> *holes = m_trt_hole_finder->getHolesOnTrack(**track);
+                        std::unique_ptr<const Trk::TrackStates>  holes (m_trt_hole_finder->getHolesOnTrack(**track));
 
 			if (!holes) {
 				ATH_MSG_WARNING("TRTTrackHoleSearchTool returned null results.");
@@ -3770,7 +3770,6 @@ StatusCode TRT_Monitoring_Tool::fillTRTEfficiency(const TrackCollection& combTra
 					m_hefficiency_z0->Fill(m_track_z0, 0.0);
 				}
 
-				delete holes;
 			}
 		}
 	}
-- 
GitLab


From 8c26c71a6ced3bd43446b899eebef0cfe5aff945 Mon Sep 17 00:00:00 2001
From: Hamza Hanif <hamza.hanif@cern.ch>
Date: Wed, 22 Sep 2021 11:53:42 +0200
Subject: [PATCH 259/347] Made changes so InDet LRT tracking monitoring tool
 just run on "collisions" data set

---
 .../config/InDetGlobal/collisions_run.config             | 2 +-
 .../python/InDetGlobalLRTMonAlgCfg.py                    | 9 ++++-----
 .../python/InDetGlobalMonitoringRun3TestConfig.py        | 2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/DataQuality/DataQualityConfigurations/config/InDetGlobal/collisions_run.config b/DataQuality/DataQualityConfigurations/config/InDetGlobal/collisions_run.config
index e17bf60f49b5..0d29b4e95a8e 100644
--- a/DataQuality/DataQualityConfigurations/config/InDetGlobal/collisions_run.config
+++ b/DataQuality/DataQualityConfigurations/config/InDetGlobal/collisions_run.config
@@ -377,7 +377,7 @@ dir InDetGlobal {
     }
     hist Trk_Base_eta_phi {
       algorithm = Histogram_Not_Empty
-      output = InnerDetector/Global/LRTTrack/LRTTrackRates
+      output = InnerDetector/Global/LRTTrack
     }
     hist Trk_LoosePrimary_eta_phi_ratio {
       algorithm = Histogram_Not_Empty
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalLRTMonAlgCfg.py b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalLRTMonAlgCfg.py
index b2d9bdfb7a03..122ab4341717 100644
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalLRTMonAlgCfg.py
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalLRTMonAlgCfg.py
@@ -17,10 +17,9 @@ def InDetGlobalLRTMonAlgCfg(helper, alg, **kwargs):
     m_nBinsEta = 50
     m_nBinsPhi = 50
     m_trackBin = 75
-    m_c_etaRange = 2.5
+    m_c_etaRange = 3
     m_c_etaRangeTRT = 2.0
     m_c_range_LB = 3000
-    m_trackMax = 75
 
     # this creates a "lrtGroup" called "alg" which will put its histograms into the subdirectory "Track"
     lrtGroup = helper.addGroup(alg, 'LRT')
@@ -30,12 +29,12 @@ def InDetGlobalLRTMonAlgCfg(helper, alg, **kwargs):
 
     varName = 'm_nBase;nCOMBtrks' #done
     title = 'Track multiplicity (baseline tracks);Track multiplicity;Events'
-    lrtGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_trackBin, xmin=-5, xmax=m_trackMax + 0.5)
+    lrtGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_trackBin, xmin=-5, xmax=10 + 0.5)
 
 
     varName = 'm_d0_perigee;trkD' #done 
     title = 'd_{0} ;d_{0} (mm)'
-    lrtGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=20, xmin=-300, xmax=300)
+    lrtGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=20, xmin=-325, xmax=325)
 
     varName = 'm_z0_perigee;trkZ' #done 
     title = 'z_{0} ;z_{0} (mm);'
@@ -54,7 +53,7 @@ def InDetGlobalLRTMonAlgCfg(helper, alg, **kwargs):
 
     varName = 'm_phi_perigee1;trkPhi' #done 
     title = ' #varphi of all tracks; #varphi (rad);'
-    lrtGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_nBinsPhi, xmin=-M_PI, xmax=M_PI)
+    lrtGroup.defineHistogram(varName, type='TH1F', path=pathtrack, title=title, xbins=m_nBinsPhi, xmin=-3.2, xmax=3.2)
 
     varName = 'm_trkPt;trkPt' #done
     title = 'Track Pt;p_{T} (GeV);'
diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalMonitoringRun3TestConfig.py b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalMonitoringRun3TestConfig.py
index 1e0df38789b5..b5759b35013d 100644
--- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalMonitoringRun3TestConfig.py
+++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoringRun3Test/python/InDetGlobalMonitoringRun3TestConfig.py
@@ -62,7 +62,7 @@ def InDetGlobalMonitoringRun3TestConfig(flags):
         ########### here ends InDetGlobalTrackMonAlg ###########
 
 
-    if flags.DQ.Environment in ('online', 'tier0', 'tier0Raw') and flags.DQ.DataType != 'cosmics':
+    if flags.DQ.Environment in ('online', 'tier0', 'tier0Raw') and flags.DQ.DataType == 'collisions':
         ########### here begins InDetGlobalLRTMonAlg ###########
         kwargsInDetGlobalLRTMonAlg = { 
             'DoIBL' : True,                       #InDetFlags.doIBL(), #Turn on/off IBL histograms 
-- 
GitLab


From a3bcbdb836d40f798d7a00b922231e57f2d5429a Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 21 Sep 2021 15:32:16 +0200
Subject: [PATCH 260/347] TrigT1TGC: remove obsolete trigger menu settings

---
 .../TrigT1TGC/python/TrigT1TGCConfig.py       | 23 +------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/Trigger/TrigT1/TrigT1TGC/python/TrigT1TGCConfig.py b/Trigger/TrigT1/TrigT1TGC/python/TrigT1TGCConfig.py
index 75cbdd919d91..dfa57e3f3c6f 100755
--- a/Trigger/TrigT1/TrigT1TGC/python/TrigT1TGCConfig.py
+++ b/Trigger/TrigT1/TrigT1TGC/python/TrigT1TGCConfig.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 TrigT1TGC.TrigT1TGCConf import LVL1TGCTrigger__LVL1TGCTrigger
 from AthenaCommon.AlgSequence import AlgSequence
@@ -22,27 +22,6 @@ job = AlgSequence()
 TrigT1TGC = TrigT1TGCConfig()
 job += TrigT1TGC
 
-
-# Configuration of TGC Coincidence Window (default is setK defined in LVL1TGCTrigger constructor)
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-triggerMenuSetup = TriggerFlags.triggerMenuSetup()
-if triggerMenuSetup.startswith('MC_pp_v2'): # setH (the lowest threshold is L1_MU0) is used for MC_pp_v2 menus. 
-    job.LVL1TGCTrigger.VersionCW='setH'
-    job.LVL1TGCTrigger.MaskFileName12="TrigT1TGCMaskedChannel._12.MC_pp_v2.db"
-    print ('TrigT1TGCConfig.py: TGC Coincidence Window setH will be used for %s menu.' % triggerMenuSetup)
-elif triggerMenuSetup.startswith('MC_pp_v3'): # setI (MU4' is the lowest, for 2011 autumn pp runs/MC_pp_v3 menus) 
-    job.LVL1TGCTrigger.VersionCW='setI'
-    print ('TrigT1TGCConfig.py: TGC Coincidence Window setI will be used for %s menu.' % triggerMenuSetup)
-elif triggerMenuSetup.startswith('MC_HI_v1'): # setJ (for 2011 Heavy Ion runs) is used for MC_HI_v1 menus. 
-    job.LVL1TGCTrigger.VersionCW='setJ'
-    print ('TrigT1TGCConfig.py: TGC Coincidence Window setJ will be used for %s menu.' % triggerMenuSetup)
-elif triggerMenuSetup.startswith('MC_HI_v2'): # setL (for 2013 Heavy Ion runs) is used for MC_HI_v2 menus. 
-    job.LVL1TGCTrigger.VersionCW='setL'
-    print ('TrigT1TGCConfig.py: TGC Coincidence Window setL will be used for %s menu.' % triggerMenuSetup)
-elif triggerMenuSetup.startswith('Physics_lumi1E34'): # setE (PT=0,6,10,15,20,40) is used for high lumi MC
-    job.LVL1TGCTrigger.VersionCW='setE'
-    print ('TrigT1TGCConfig.py: TGC Coincidence Window setE will be used for %s menu.' % triggerMenuSetup)
-
 if globalflags.DataSource() == 'geant4':
 
     conddb.addFolder("TGC_OFL","/TGC/TRIGGER/CW_EIFI",className='CondAttrListCollection')
-- 
GitLab


From a911686229b7ad1ae1ee21fd1c47cd97fc6806a5 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 21 Sep 2021 15:52:13 +0200
Subject: [PATCH 261/347] TrigP1Test: remove usage of obsolete TriggerFlags

---
 Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py b/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py
index c36c81540845..491ed1322886 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py
+++ b/Trigger/TrigValidation/TrigP1Test/share/PEBDSTest.py
@@ -158,7 +158,7 @@ for collectionConfig in TriggerEDMRun3.TriggerHLTListRun3:
 TriggerEDMRun3.TriggerHLTListRun3 = myTriggerHLTListRun3
 
 # Set menu flag and slice options for runHLT_standalone
-ConfigFlags.Trigger.triggerMenuSetup = TriggerFlags.triggerMenuSetup = 'LS2_v1'
+ConfigFlags.Trigger.triggerMenuSetup = 'LS2_v1'
 doEmptyMenu = True
 doEgammaSlice = True
 doMuonSlice = True
-- 
GitLab


From 97c660024104b4d93fca4a167eac9f589dedf569 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 22 Sep 2021 12:05:11 +0200
Subject: [PATCH 262/347] TriggerMenuMT: further cleanup of legacy menu code

- remove usage of obsolete `TriggerFlags`
- delete remaining LVL1 legacy menu code
- delete unused `MenuUtil.py`
---
 .../TriggerMenuMT/CMakeLists.txt              |   1 -
 .../HLTMenuConfig/Menu/DictFromChainName.py   |   2 +-
 .../python/HLTMenuConfig/Menu/L1Seeds.py      |  34 ++--
 .../HLTMenuConfig/Menu/MenuPrescaleConfig.py  |   6 +-
 .../python/HLTMenuConfig/Menu/MenuUtil.py     | 134 ----------------
 .../TriggerMenuMT/python/L1/Base/L1Menu.py    |   4 +-
 .../python/LVL1MenuConfig/LVL1/Limits.py      |  81 ----------
 .../python/LVL1MenuConfig/LVL1/Lvl1Flags.py   | 145 ------------------
 .../LVL1MenuConfig/LVL1/TriggerTypeDef.py     |  22 ---
 .../LVL1MenuConfig/LVL1/TriggerTypeDefRun1.py |  41 -----
 .../python/LVL1MenuConfig/LVL1/__init__.py    |   1 -
 .../python/LVL1MenuConfig/__init__.py         |   2 -
 .../python/TriggerAPI/TriggerDataAccess.py    |   6 +-
 13 files changed, 19 insertions(+), 460 deletions(-)
 delete mode 100755 Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Limits.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Flags.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/TriggerTypeDef.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/TriggerTypeDefRun1.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/__init__.py
 delete mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/__init__.py

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
index f330b284c272..a3617d548297 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
+++ b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
@@ -5,7 +5,6 @@ atlas_subdir( TriggerMenuMT )
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py
-                              python/LVL1MenuConfig
                               python/L1
                               python/HLTMenuConfig
                               python/TriggerAPI
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
index 3b5dfdd8ba1b..d384fb408bbc 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
@@ -43,7 +43,7 @@ def getOverallL1item(chainName):
         lvl1name = getL1MenuFileName(ConfigFlags)
         lvl1access = L1MenuAccess(lvl1name)
         itemsDict = lvl1access.items(includeKeys = ['name','ctpid','triggerType'])
-        l1seedlist = getSpecificL1Seeds(l1seed, itemsDict)
+        l1seedlist = getSpecificL1Seeds(l1seed, itemsDict, ConfigFlags.Trigger.triggerMenuSetup)
         return l1seedlist
 
     return l1seed
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py
index d277fa446b8f..5da1309a6161 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/L1Seeds.py
@@ -3,26 +3,14 @@
 from AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
 
-from TriggerJobOpts.TriggerFlags  import TriggerFlags
-
 #######################################
 # trigger type definitions
 ######################################
-from TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1Flags import Lvl1Flags
-run1 = Lvl1Flags.CTPVersion()<=3
-
-if run1:
-    from TriggerMenuMT.LVL1MenuConfig.LVL1.TriggerTypeDefRun1 import TT
-    rpcout_type = TT.rpcout | TT.phys
-    rpcin_type  = TT.rpcin  | TT.phys             
-else:
-    from TriggerMenuMT.LVL1MenuConfig.LVL1.TriggerTypeDef import TT
-    rpcout_type = TT.muon   | TT.phys
-    rpcin_type  = TT.muon   | TT.phys             
-
-
-cl_type     = TT.calo      | TT.phys
-mb_type     = TT.minb      | TT.phys
+from TriggerMenuMT.L1.Config.TriggerTypeDef import TT
+rpcout_type = TT.muon | TT.phys
+rpcin_type  = TT.muon | TT.phys
+cl_type     = TT.calo | TT.phys
+mb_type     = TT.minb | TT.phys
 
 
 calo_exceptions = set([])
@@ -52,7 +40,7 @@ def Lvl1ItemByTriggerType(l1object, triggertype_pattern, triggertype_bitmask):
 ##############################
 # define the various seeds
 ##############################
-def getL1BackgroundSeed(menul1items):        
+def getL1BackgroundSeed(menul1items, menu_name):
     l1bgditems = [
         'L1_BCM_AC_CA_BGRP0',
         'L1_BCM_Wide_EMPTY', 'L1_BCM_Wide_UNPAIRED_ISO', 'L1_BCM_Wide_UNPAIRED_NONISO',
@@ -69,7 +57,7 @@ def getL1BackgroundSeed(menul1items):
         'L1_J12_EMPTY', 'L1_J12_BGRP12',
         ]
     
-    if TriggerFlags.triggerMenuSetup() == 'LS1_v1':
+    if menu_name == 'LS1_v1':
         l1bgditems = [
             'L1_BCM_AC_CA_BGRP0','L1_BCM_AC_CA_UNPAIRED_ISO',
             'L1_BCM_Wide_EMPTY','L1_BCM_Wide_UNPAIRED_ISO','L1_BCM_Wide_UNPAIRED_NONISO',
@@ -388,13 +376,13 @@ def getL1LowLumi(l1seed):
 #####################################
 # assigned the seeds to the L1 names
 #####################################
-def getSpecificL1Seeds(l1seedname, l1itemobject):
+def getSpecificL1Seeds(l1seedname, l1itemobject, menu_name):
     l1items = l1itemobject.keys()
     L1Seed = ''
     if l1seedname == 'L1_J':
         L1Seed = getL1JetBS()
     if (l1seedname == 'L1_Bkg'):
-        L1Seed = getL1BackgroundSeed(l1items)
+        L1Seed = getL1BackgroundSeed(l1items, menu_name)
 #    elif (l1seedname == 'L1_ALFA_Diff_Phys' ):
 #        L1Seed = getL1_ALFA_Diff_Phys_Seeds(l1items)
 #    elif (l1seedname == 'L1_ALFA_CDiff_Phys' ):
@@ -485,7 +473,7 @@ def getSpecificL1Seeds(l1seedname, l1itemobject):
 #####################################
 # map from l1item name to inputTE
 #####################################
-def getInputTEfromL1Item(l1item):
+def getInputTEfromL1Item(l1item, menu_name):
     
     L1Map = {
         'L1_TAU8_EMPTY'          : ['HA8'],
@@ -504,7 +492,7 @@ def getInputTEfromL1Item(l1item):
         'L1_TAU100'              : ['HA100'],
         }
 
-    if TriggerFlags.triggerMenuSetup() == 'LS1_v1': 
+    if menu_name == 'LS1_v1':
         L1Map['L1_CALREQ2']=['NIM30']
     else:
         L1Map['L1_CALREQ2']=['CAL2']
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
index d7974ee168fd..f22afde43ccc 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.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 TriggerJobOpts.TriggerFlags import TriggerFlags
 
@@ -12,7 +12,9 @@ def MenuPrescaleConfig(triggerConfigHLT):
     HLTPrescales = {}
     Prescales = PrescaleClass()
 
-    menu_name = TriggerFlags.triggerMenuSetup()
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    menu_name = ConfigFlags.Trigger.triggerMenuSetup
+
     ## Do some aliasing here
     if menu_name == 'Physics_default': 
         menu_name = 'LS2_v1'
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py
deleted file mode 100755
index cc7a4f23d068..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py
+++ /dev/null
@@ -1,134 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-def checkGroups(triggerPythonConfig):
-    """ Make sure the groups used in Physics and MC menu exists
-    """
-    menu_name = TriggerFlags.triggerMenuSetup()
-    log.info("Menu: %s", menu_name)
-    
-    from TriggerMenuMT.HLTMenuConfig.Menu.GroupInfo       import getAllAllowedGroups
-    allgroup=getAllAllowedGroups(menu_name)
-
-    for chain in triggerPythonConfig.theHLTChains:
-        if len(chain.groups) == 0:
-            log.error( "group undefined for chain: %s", chain.chain_name )
-        for i in chain.groups:
-            if 'BW' in i:
-                if i.split('BW:')[1] not in allgroup:
-                    log.error( "BW Group %d for chain %s not allowed.", i, chain.chain_name)
-
-                  
-        
-def checkTriggerGroupAssignment(triggerPythonConfig):
-    """ Checks menu consistency
-
-    Checks trigger-groups assignment in Physics_ and MC_ menus.
-    Excludes those chains which either have no group assigned or have a wrong group attached in Physics_
-    which allows only primary, supporting and calibration triggers. 
-    """
-    menu_name = TriggerFlags.triggerMenuSetup()
-    log.info("Menu: %s", menu_name)
-    GroupItems = []
-    CheckGroups=False
-
-    if menu_name.startswith('Physics_lumi'):
-        CheckGroups=True
-        GroupItems = ['Primary', 'Supporting', 'Calibration', 'Monitoring']
-    elif menu_name.startswith('MC_lumi'):
-        CheckGroups=True
-        GroupItems = ['Primary', 'Supporting', 'Calibration', 'Monitoring', 'Backup', 'Commissioning', 'Test']
-
-    for chain in triggerPythonConfig.theL2HLTChains + triggerPythonConfig.theEFHLTChains:
-        if len(chain.groups) == 0:
-            log.error( "IN CHAIN: GROUP undefined for chain: %s", chain.chain_name )
-        else:
-            GroupAssigned=False
-            
-            for group in GroupItems:
-                if group in chain.groups:
-                    GroupAssigned=True
-            if GroupAssigned is False and CheckGroups is True:
-                log.warning( "IN CHAIN: GROUP (primary, supporting, ... etc) undefined for chain: %s", chain.chain_name )
-
-#def checkStreamConsistency(triggerPythonConfig,streamConfig):
-def checkStreamConsistency(triggerPythonConfig):
-    """ Checks streamer consistency
-    Checks that all chains are assigned to existing streams
-    """
-    menu_name = TriggerFlags.triggerMenuSetup()
-    log.info("Menu: %s", menu_name)
-
-    from TriggerMenuMT.HLTMenuConfig.Menu.StreamInfo       import getAllStreams
-
-    allStreams = getAllStreams()
-
-    ##Check that all the streams associated to the chains exists
-    ##Chech that there is no duplication of ROB_ID for the ds streams used in a specific menu
-    already_used_robs={}
-    for chain in triggerPythonConfig.theHLTChains:
-        if len(chain.stream_tag) == 0:
-            log.error( "IN CHAIN: STREAMTAG undefined for chain: %s", chain.chain_name )
-        else:
-            for stream in chain.stream_tag:
-                if stream[0] not in allStreams:
-                    log.error('Chain: %s has the wrong streamer %s', chain.chain_name, stream[0])
-                else:
-                    ##check data scouting streaming name
-                    if "DataScouting" in stream[0]:
-                        rob_id= stream[0].split("_")[1]                        
-                        if rob_id  in already_used_robs and stream[0] is not already_used_robs[rob_id]:
-                            log.error("Duplicated ROB in stream %s (ROB number %s already used in stream %s)",
-                                      stream[0], stream[0].split("_")[1],
-                                      already_used_robs[stream[0].split("_")[1]])
-                            already_used_robs[rob_id]=stream[0]
-                        else:                 
-                            already_used_robs[rob_id]=stream[0] 
-
-    
-    ##Chech that there is no duplication of ROB_ID for the ds streams defined in the all TM
-    already_used_robs={}
-    for stream in allStreams:
-        if "DataScouting" in stream:
-            rob_id= stream.split("_")[1]                        
-            if rob_id  in already_used_robs:
-                log.error("Duplicated ROB in stream %s (ROB number %s already used in stream %s)",
-                          stream, rob_id, already_used_robs[rob_id])
-                already_used_robs[rob_id]=stream
-            else:
-                already_used_robs[rob_id]=stream
-                
-
-def allSignatures():
-    sigs = []
-    slices = (
-        TriggerFlags.MuonSlice,
-        TriggerFlags.JetSlice,
-        TriggerFlags.METSlice,
-        TriggerFlags.TauSlice,
-        TriggerFlags.EgammaSlice,
-        TriggerFlags.MinBiasSlice,
-        TriggerFlags.CombinedSlice,
-        )
-    for a in slices:
-        if a.signatures.statusOn: 
-            sigs += a.signatures()
-    return sigs
-
-
-def findL1TT(chain, triggerPythonConfig):
-    l2_chain = chain
-    if chain.level == 'EF':
-        l2_chain_name = chain.lower_chain_name
-        l2_chain = triggerPythonConfig.getHLTChain(l2_chain_name)
-    if l2_chain is None:
-        return -2
-    l1_item_name = l2_chain.lower_chain_name
-    l1_item = triggerPythonConfig.getLvl1Item(l1_item_name)
-    if l1_item is None:
-        return -1
-    return l1_item.trigger_type
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py
index 3e896623e5d8..82e3c872eaab 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py
@@ -8,6 +8,7 @@ from .Boards import MenuBoardsCollection
 from .Connectors import MenuConnectorsCollection
 from .MenuUtils import get_smk_psk_Name
 from .Limits import Limits
+from .L1MenuFlags import L1MenuFlags
 
 from collections import OrderedDict as odict
 from AthenaCommon.Logging import logging
@@ -46,8 +47,7 @@ class L1Menu(object):
 
     @staticmethod
     def partitioning():
-        from Lvl1Flags import Lvl1Flags
-        first = Lvl1Flags.MenuPartitioning()
+        first = L1MenuFlags.MenuPartitioning()
         last = first[1:] + [ Limits.MaxTrigItems ]
         partitioning = dict( zip([1,2,3],zip(first,last)) )
         return partitioning
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Limits.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Limits.py
deleted file mode 100644
index f376c5096647..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Limits.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-"""
-This temporarily holds CTP sizes
-"""
-
-from AthenaCommon.Logging import logging
-log = logging.getLogger(__name__)
-
-class Access(type):
-    """Metaclass to implement __getattr__ for class variables"""
-    def __getattr__(cls, key):
-        if cls.ctpDataFormat is None:
-            raise RuntimeError("CTP version has not been set, you need to call Limits.setLimits(ctpversion) before you can use the limits")
-
-        if hasattr(cls.ctpDataFormat, key):
-            return getattr( cls.ctpDataFormat, key)
-        elif hasattr(cls.l1common, key):
-            return getattr( cls.l1common, key)
-        else:
-            raise AttributeError("Neither class 'CTPdataformat' nor class 'L1Common' have an attribute '%s'" % key)
-    
-    def __str__(cls):
-        if cls.ctpDataFormat is None:
-            return "None"
-
-        s = "CTP DataFormat version %i\n" % cls.CTPVersion
-        varnames = ['MaxTrigItems', 'NumBunchgroups', 'NumRndmTriggers']
-        for varname in varnames:
-            s += "     %s = %r\n" % (varname, getattr( cls.ctpDataFormat, varname)) 
-        s += "L1Common version %i\n" % cls.L1CommonVersion
-        varnames = ['MUON_bitnum','EM_bitnum', 'TAU_bitnum', 'JET_bitnum', 'JE_bitnum', 'JB_bitnum', 'JF_bitnum', 'TE_bitnum', 'XE_bitnum', 'XS_bitnum',
-                    'MBTS_bitnum', 'MBTSSI_bitnum', 'NIM_bitnum', 'ZDC_bitnum', 'TRT_bitnum', 'BCM_bitnum', 'BCMCMB_bitnum', 'LUCID_bitnum', 'CALREQ_bitnum',
-                    'MUON_cable', 'EM_cable', 'TAU_cable', 'JET_cable', 'JE_cable', 'JB_cable', 'JF_cable', 'TE_cable', 'XE_cable', 'XS_cable', 'MBTS_cable', 
-                    'MBTSSI_cable', 'NIM_cable', 'ZDC_cable', 'TRT_cable', 'BCM_cable', 'BCMCMB_cable', 'LUCID_cable', 'CALREQ_cable']
-        for varname in varnames:
-            s += "     %s = %r\n" % (varname, getattr( cls.l1common, varname)) 
-        return s
-
-
-
-class Limits(object, metaclass=Access):
-
-    CTPVersion      = None
-    L1CommonVersion = None
-
-    ctpDataFormat = None
-    l1common      = None
-
-    @staticmethod
-    def getCTPdataformat(version):
-        module = __import__('CTPfragment.CTPdataformat_v%i' % version, globals(), locals(), ['CTPdataformat_v%i' % version], 0)
-        return getattr(module, "CTPdataformat_v%i" % version)
-
-    @staticmethod
-    def getL1Common(version):
-        module = __import__('L1Common.L1Common_v%i' % version, globals(), locals(), ['L1Common_v%i' % version], 0)
-        return getattr(module, "L1Common_v%i" % version)
-
-    @staticmethod
-    def setLimits(CTPVersion, verbose = False):
-        Limits.CTPVersion = CTPVersion
-        Limits.L1CommonVersion = 0 if CTPVersion <= 3 else 1
-        #print "Setting limits for CTP version %i and L1Common Version %i" % (Limits.CTPVersion, Limits.L1CommonVersion)
-        Limits.ctpDataFormat = Limits.getCTPdataformat( Limits.CTPVersion )
-        Limits.l1common = Limits.getL1Common( Limits.L1CommonVersion )
-        if verbose:
-            log.debug(Limits)
-
-    
-
-
-class CaloLimits(object):
-    # Maximum values for calo thresholds to disable that threshold
-    ClusterOff   = 255
-    IsolationOff = 63
-    JetOff       = 1023
-    EtSumOff     = 32767
-    EtMissOff    = 32767 
-    JetEtOff     = 13286
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Flags.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Flags.py
deleted file mode 100644
index b2fcfb017487..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/Lvl1Flags.py
+++ /dev/null
@@ -1,145 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-"""
-Lvl1 specific flags
-"""
-
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
-from AthenaCommon.Logging import logging
-from .Limits import Limits
-
-__author__  = 'J.Stelzer'
-__doc__="Level 1 specific flags for Run 2"
-
-log = logging.getLogger(__name__)
-
-_flags = [] 
-class CTPVersion(JobProperty):
-    """Version of the CTP configuration"""
-
-    statusOn = True
-    allowedTypes = [int]
-    allowedValues = [0,1,2,3,4,5]
-    StoredValue = 4
-    
-    Limits.setLimits(3)
-
-    def _do_action(self):
-        """Load the limits"""
-        from .Limits import Limits
-        Limits.setLimits(self.get_Value())
-
-
-_flags.append(CTPVersion)
-
-class items(JobProperty):
-    """Names of items enabled in the selected L1 menu"""
-    statusOn=True
-    allowedTypes=['list']
-    StoredValue=[]
-
-_flags.append(items)
-
-class thresholds(JobProperty):
-    """Names of thresholds enabled in selected L1 menu """
-    statusOn=True
-    allowedTypes=['list']
-    StoredValue   = []
-
-_flags.append(thresholds)
-
-class prescales(JobProperty):
-    """Maps prescales to items that are different from 1"""
-    statusOn=True
-    allowedTypes=['dict']
-    StoredValue   = {}
-
-_flags.append(prescales)
-
-class RemapThresholdsAsListed(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue = False
-
-_flags.append(RemapThresholdsAsListed)
-
-class CtpIdMap(JobProperty):
-    statusOn = True
-    allowedTypes = ['dict']
-    StoredValue = {}
-
-_flags.append(CtpIdMap)
-
-class BunchGroupPartitioning(JobProperty):
-    statusOn = True
-    allowedTypes = ['list']
-    StoredValue = []
-
-_flags.append(BunchGroupPartitioning)
-
-class BunchGroupNames(JobProperty):
-    statusOn = True
-    allowedTypes = ['list']
-    StoredValue = []
-
-_flags.append(BunchGroupNames)
-
-class MenuPartitioning(JobProperty):
-    statusOn = True
-    allowedTypes = ['list']
-    StoredValue = []
-
-_flags.append(MenuPartitioning)
-
-class OldStylePrescales(JobProperty):
-    statusOn = True
-    allowedTypes = ['bool']
-    StoredValue = False
-
-class ThresholdMap(JobProperty):
-    statusOn = True
-    allowedTypes = ['dict']
-    StoredValue = {}
-
-_flags.append(ThresholdMap)
-
-
-class ItemMap(JobProperty):
-    statusOn = True
-    allowedTypes = ['dict']
-    StoredValue = {}
-
-_flags.append(ItemMap)
-
-
-
-_flags.append(OldStylePrescales)
-
-
-
-class Lvl1(JobPropertyContainer):
-    """ Lvl1 flags used in menu generation """
-
-
-
-
-# execute
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-TriggerFlags.add_Container(Lvl1)
-
-for flag in _flags:
-    TriggerFlags.Lvl1.add_JobProperty(flag)
-del _flags
-
-
-
-# make an alias
-Lvl1Flags = TriggerFlags.Lvl1
-
-
-
-#  LocalWords:  AllowedList
-
-
-            
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/TriggerTypeDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/TriggerTypeDef.py
deleted file mode 100644
index 5262d14f2774..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/TriggerTypeDef.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-
-class TT(object):
-    """
-    Trigger type logic
-    should also match StreamingDef.py definitions
-    """
-    rand        = 1 << 0
-    zerobs      = 1 << 1  # trigger type for zero bias triggers
-    calo        = 1 << 2        
-    muon        = 1 << 3
-    lardemo     = 1 << 4
-    ftk = minb  = 1 << 5  # min-bias TT is needed for TM internal use (L1Seeds.py) 
-    nim = alfa  = 1 << 6
-    phys        = 1 << 7
-
-    # Calibration requests
-    #  From David B - for calibration events TriggerType
-    #  will be reset by CTP - values below are placeholders
-    calreq0 = 0x30
-    calreq1 = 0x32
-    calreq2 = 0x34
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/TriggerTypeDefRun1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/TriggerTypeDefRun1.py
deleted file mode 100644
index ef07604c0ab2..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/TriggerTypeDefRun1.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags as TF
-
-class TT:
-    """
-    Trigger type logic
-    should also match StreamingDef.py definitions
-    """
-    rand        = 1 << 0
-    zerobs      = 1 << 1  # trigger type for zero bias triggers
-    calo        = 1 << 2        
-    rpcin = tgc = 1 << 3  # Assign TGC to RPCIN to free one bit for new and CALOEM trigger type
-    caloem      = 1 << 4  # to stream separately
-    minb        = 1 << 5
-    rpcout      = 1 << 6
-    phys        = 1 << 7
-
-    # Calibration requests
-    #  From David B - for calibration events TriggerType
-    #  will be reset by CTP - values below are placeholders
-    calreq0 = 0x30
-    calreq1 = 0x32
-    calreq2 = 0x34
-
-    if any([ x in TF.triggerMenuSetup() for x in
-             [ 'InitialBeam_HI',
-               'Cosmic_v3',
-               'L1_pp',
-               'L1_alfa',
-               'MC_pp',
-               'MC_HI',
-               'MC_loose',
-               'MC_tight',
-               'Physics_pp',
-               'Physics_default',
-               'Physics_HI',
-               ]]):
-        caloem = 0
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/__init__.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/__init__.py
deleted file mode 100644
index d0cb751d0f33..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/LVL1/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-#Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/__init__.py b/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/__init__.py
deleted file mode 100644
index 139597f9cb07..000000000000
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/LVL1MenuConfig/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/TriggerAPI/TriggerDataAccess.py b/Trigger/TriggerCommon/TriggerMenuMT/python/TriggerAPI/TriggerDataAccess.py
index a38a4baca02e..15f12b631bcc 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/TriggerAPI/TriggerDataAccess.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/TriggerAPI/TriggerDataAccess.py
@@ -302,11 +302,7 @@ def getHLTmap_fromTM(period, release):
     menu = "Physics_pp_run3_v1"
     
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    from TriggerJobOpts.TriggerFlags import TriggerFlags
-    TriggerFlags.triggerMenuSetup = menu
-    TriggerFlags.readLVL1configFromXML = False
-    TriggerFlags.outputLVL1configFile = None
-    
+
     mutelog = logging.getLogger(__name__)
     mutelog.setLevel(logging.WARNING) #avoid spam from Menu.L1.L1MenuConfig
 
-- 
GitLab


From 333bf9c26bcf445a7f700436fcc343c95abe5764 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 21 Sep 2021 15:53:17 +0200
Subject: [PATCH 263/347] TriggerFlags: remove legacy menu flags

Remove the following obsolete legacy menu flags:
- `readLVL1configFromXML`
- `inputLVL1configFile`
- `outputLVL1configFile`
- `triggerMenuSetup`
- `menuVersion`
---
 .../scripts/chain.sh                          |   2 +-
 .../python/TriggerConfigGetter.py             |   7 -
 .../TriggerJobOpts/python/TriggerFlags.py     | 236 +-----------------
 .../BStoESD_Tier0_HLTConfig_jobOptions.py     |  19 +-
 .../TriggerJobOpts/share/runHLT_standalone.py |   3 -
 5 files changed, 12 insertions(+), 255 deletions(-)

diff --git a/Event/EventOverlay/EventOverlayJobTransforms/scripts/chain.sh b/Event/EventOverlay/EventOverlayJobTransforms/scripts/chain.sh
index 5af342f77e62..af73d194b4f9 100755
--- a/Event/EventOverlay/EventOverlayJobTransforms/scripts/chain.sh
+++ b/Event/EventOverlay/EventOverlayJobTransforms/scripts/chain.sh
@@ -39,7 +39,7 @@ if [ $doreco == 1 ]; then
 #rdotrig="--outputRDO_TRIGFile testRTT.RDO_TRIG.pool.root --triggerConfig MCRECO:DBF:TRIGGERDBMC:2046,20,48 "
 aodout="--outputAODFile testRTT.AOD.pool.root"
 #trigflag="from TriggerJobOpts.TriggerFlags import TriggerFlags as TF; TF.doLVL1.set_Value_and_Lock(False); TF.doL1Topo.set_Value_and_Lock(False); TF.doLVL2.set_Value_and_Lock(True); TF.doEF.set_Value_and_Lock(True);"
-trigflag="from TriggerJobOpts.TriggerFlags import TriggerFlags as TF; TF.readLVL1configFromXML.set_Value_and_Lock(True); TF.configForStartup.set_Value_and_Lock('HLToffline'); TF.configurationSourceList.set_Value_and_Lock('xml');"
+trigflag="from TriggerJobOpts.TriggerFlags import TriggerFlags as TF; TF.configForStartup.set_Value_and_Lock('HLToffline');"
 #dotrig="rec.doTrigger=True;"
 
 Reco_tf.py \
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py
index 028979f05623..23619669e145 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py
@@ -240,13 +240,6 @@ class TriggerConfigGetter(Configured):
             # non-MT (Run-2) Trigger Configuration
             self.svc = SetupTrigConfigSvc()
 
-            if 'xml' in self.ConfigSrcList:
-                # sets them if plain XML reading is to be used
-                self.svc.l1XmlFile     = TriggerFlags.outputLVL1configFile()    # generated in python
-                # FW, May 2021: setting of HLT XML file removed
-                if TriggerFlags.readLVL1configFromXML():
-                    self.svc.l1XmlFile  = TriggerFlags.inputLVL1configFile() # given XML
-
             try:
                 self.svc.SetStates( self.ConfigSrcList )
             except Exception:
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
index d46ac7a6eadc..e6123c73b554 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
@@ -1,7 +1,5 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
-import re
-
 from AthenaCommon.Logging import logging
 log = logging.getLogger( 'TriggerJobOpts.TriggerFlags' )
 
@@ -69,11 +67,11 @@ _flags.append(doValidationMonitoring)
 
 # trigger configuration source list
 class configurationSourceList(JobProperty):
-    """ define where to read trigger configuration from. Allowed values: ['xml','aod','ds']"""
+    """ define where to read trigger configuration from. Allowed values: ['aod','ds']"""
     statusOn=True
     allowedType=['list']
     StoredValue=[]
-    allowedValues = AllowedList( ['aod','xml','ds'] )
+    allowedValues = AllowedList( ['aod','ds'] )
 
 _flags.append(configurationSourceList)
 
@@ -207,6 +205,11 @@ class triggerConfig(JobProperty):
                 
         log = logging.getLogger( 'TriggerFlags.triggerConfig' )
         log.info("triggerConfig: \""+self.get_Value()+"\"")
+
+        # FW, 09/21: This flag is obsolete but need a bit more cleanup before removing it
+        # to avoid accidentally breaking job options
+        log.warning("The use of TriggerFlags.triggerConfig is deprecated")
+
         # We split the string passed to the flag
         configs = self.get_Value().split(":")
         
@@ -282,15 +285,7 @@ class triggerConfig(JobProperty):
                     log.info("triggerConfig: LVL1 from DB configured with wrong number of keys/arguments" )
 
             else:
-                ### We read config from XML
-                tf.readLVL1configFromXML=True
-                if (configs[1] == 'DEFAULT' or configs[1] == 'default'):
-                    tf.triggerMenuSetup = 'default'
-                else:
-                    tf.triggerMenuSetup = configs[1]
-                log.info("triggerConfig: LVL1 menu from xml (%s)", tf.triggerMenuSetup())
-
-                
+                log.error("Reading the LVL1 menu from XML is no longer supported")
 
         #------
         # MCRECO: Reconstruction of MC
@@ -327,14 +322,7 @@ class triggerConfig(JobProperty):
                 tf.triggerMenuSetup=getMenuNameFromDB(tf.triggerDbConnection(),tf.triggerDbKeys()[2])
                 log.info("triggerConfig: Setting tf.triggerMenuSetup to " + tf.triggerMenuSetup())
             else:
-                ### We read the menu from xml
-                if (configs[-1] == 'DEFAULT' or configs[-1] == 'default'):
-                    tf.triggerMenuSetup = 'default'
-                else:
-                    tf.triggerMenuSetup = configs[-1]
-
-                tf.readLVL1configFromXML=True
-                log.info("triggerConfig: MCRECO menu from xml (%s)", tf.triggerMenuSetup())
+                log.error("Reading the LVL1 menu from XML is no longer supported")
 
             # This part was there in the original (old) csc_reco_trigger.py snippet
             # Still wanted?
@@ -359,36 +347,6 @@ class triggerConfig(JobProperty):
 _flags.append(triggerConfig)
 
 
-
-class readLVL1configFromXML(JobProperty):
-    """ If set to True the LVL1 config file is read from earlier generated XML file """
-    statusOn=True
-    allowedType=['bool']
-    # note: if you change the following default value, you must also change the default value in class inputLVL1configFile
-    # StoredValue=False
-    StoredValue = False
-
-    def _do_action(self):
-        """ setup some consistency """
-        import os
-        log = logging.getLogger( 'TriggerFlags.readLVL1configFromXML' )
-
-        import TriggerMenuMT.LVL1MenuConfig.LVL1.Lvl1Flags  # noqa: F401
-        
-        if self.get_Value() is False:
-            TriggerFlags.inputLVL1configFile = TriggerFlags.outputLVL1configFile()
-            TriggerFlags.Lvl1.items.set_On()
-        else:
-            TriggerFlags.inputLVL1configFile = "TriggerMenuMT/LVL1config_"+_getMenuBaseName(TriggerFlags.triggerMenuSetup())+"_" + TriggerFlags.menuVersion() + ".xml"
-            xmlFile=TriggerFlags.inputLVL1configFile()
-            from TrigConfigSvc.TrigConfigSvcConfig import findFileInXMLPATH
-            if xmlFile!='NONE' and not os.path.exists(findFileInXMLPATH(xmlFile)):
-                log.error("Cannot find LVL1 xml file %s", xmlFile)
-
-            TriggerFlags.Lvl1.items.set_Off()
-
-_flags.append(readLVL1configFromXML)
-
 class triggerDbKeys(JobProperty):
     """ define the keys [Configuration, LVL1Prescale, HLTPrescale, L1BunchGroupSet] in that order!"""
     statusOn=False
@@ -413,182 +371,6 @@ class triggerCoolDbConnection(JobProperty):
 
 _flags.append(triggerCoolDbConnection)
 
-class outputLVL1configFile(JobProperty):
-    """ File name for output LVL1 configuration XML file """
-    statusOn=True
-    StoredValue=""
-
-    def __call__(self):
-        if self.get_Value() == "":
-            return "LVL1config_"+_getMenuBaseName(TriggerFlags.triggerMenuSetup())+"_" + TriggerFlags.menuVersion() + ".xml"
-        else:
-            return self.get_Value()
-        
-_flags.append(outputLVL1configFile)
-
-
-class inputLVL1configFile(JobProperty):
-    """ File name for input LVL1 configuration XML file """
-    statusOn=True
-#    allowedType=['str']
-#   The following default is appropriate when XML cofig is the default
-#    StoredValue="TriggerMenuXML/LVL1config_default_" + TriggerFlags.menuVersion() + ".xml"
-#   The following default is appropriate when python config is the default
-    StoredValue=""
-#    StoredValue = "TriggerMenuXML/LVL1config_default_" + TriggerFlags.menuVersion() + ".xml"
-
-    def __call__(self):
-        if self.get_Value() == "":
-            return "LVL1config_"+_getMenuBaseName(TriggerFlags.triggerMenuSetup())+"_" + TriggerFlags.menuVersion() + ".xml"
-        else:
-            return self.get_Value()
-
-_flags.append(inputLVL1configFile)
-
-# remove prescale suffixes
-def _getMenuBaseName(menuName):
-    m = re.match(r'(.*v\d(?:_primaries)?).*', menuName)
-    if m:
-        menuName = m.groups()[0]
-    return menuName
-
-
-# =================
-#
-# trigger menu flags - menu version, prescale sets
-#
-# =================
-class menuVersion(JobProperty):
-    """ Defines the menu version to use, usually the same as the release number. This is part of the XML file name. """
-    statusOn=True
-    allowedType=['str']
-    
-    from AthenaCommon.AppMgr import release_metadata
-    StoredValue = release_metadata()['release']  # returns '?' if missing
-    
-_flags.append(menuVersion)
-
-
-class triggerMenuSetup(JobProperty):
-    """ Defines the luminosity dependent setup of trigger lumi01 == 10^33, switches on/off signatures """
-    statusOn=True
-    allowedType=['str']
-    allowedValues = [
-        'default', 'cosmic_default', 'InitialBeam_default',
-        # menus for 10^31 with EMScale L1 calib
-        'Physics_lumi1E31_simpleL1Calib','Physics_lumi1E31_simpleL1Calib_no_prescale',
-        'MC_lumi1E31_simpleL1Calib','MC_lumi1E31_simpleL1Calib_no_prescale',
-        'MC_lumi1E31_simpleL1Calib_physics_prescale',
-        # menus for 10^32 with EMScale L1 calib
-        'Physics_lumi1E32_simpleL1Calib','Physics_lumi1E32_simpleL1Calib_no_prescale',
-        'MC_lumi1E32_simpleL1Calib','MC_lumi1E32_simpleL1Calib_no_prescale',
-        'MC_lumi1E32_simpleL1Calib_physics_prescale',
-        # menus for 10^33
-        'Physics_lumi1E33','Physics_lumi1E33_no_prescale',
-        'MC_lumi1E33','MC_lumi1E33_no_prescale',
-        'Physics_lumi1E34','Physics_lumi1E34_no_prescale',
-        'MC_lumi1E34','MC_lumi1E34_no_prescale',
-        #
-        'Cosmics','Cosmic_v1', 'Cosmic2009_v1', 'Cosmic2009_v2', 
-        'InitialBeam_v1', 'MC_InitialBeam_v1', 'MC_InitialBeam_v1_no_prescale',
-        'Cosmic2009_simpleL1Calib', 'Cosmic2009_inclMuons',
-        'enhBias',
-        # for 2010 running
-        'Cosmic_v2','Cosmic_v3',
-        'InitialBeam_v2', 'MC_InitialBeam_v2', 'MC_InitialBeam_v2_no_prescale',
-        'InitialBeam_v3', 'MC_InitialBeam_v3', 'MC_InitialBeam_v3_no_prescale',
-        #for 2010-2011 running
-        'Physics_pp_v1', 'Physics_pp_v1_no_prescale', 'Physics_pp_v1_cosmics_prescale',
-        'MC_pp_v1', 'MC_pp_v1_no_prescale',
-        'MC_pp_v1_tight_mc_prescale', 'MC_pp_v1_loose_mc_prescale',
-        #v2 
-        'Physics_pp_v2', 'Physics_pp_v2_no_prescale', 'Physics_pp_v2_cosmics_prescale', 
-        'MC_pp_v2', 'MC_pp_v2_primary', 'MC_pp_v2_no_prescale', 
-        'MC_pp_v2_tight_mc_prescale', 'MC_pp_v2_loose_mc_prescale',
-        #v3
-        'Physics_pp_v3', 'Physics_pp_v3_no_prescale', 'Physics_pp_v3_cosmics_prescale', 
-        'MC_pp_v3', 'MC_pp_v3_primary', 'MC_pp_v3_no_prescale', 
-        'MC_pp_v3_tight_mc_prescale', 'MC_pp_v3_loose_mc_prescale',
-        #v4
-        'Physics_pp_v4', 'Physics_pp_v4_no_prescale', 'Physics_pp_v4_cosmics_prescale',
-        'MC_pp_v4', 'MC_pp_v4_primary', 'MC_pp_v4_no_prescale',
-        'MC_pp_v4_upgrade_mc_prescale','MC_pp_v4_tight_mc_prescale', 'MC_pp_v4_loose_mc_prescale',
-        # L1 v2 for testing
-        'L1_pp_v2',
-        'L1_pp_v3',
-        'L1_pp_v4',
-        'L1_pp_test',
-        'L1_alfa_v1',
-        'L1_alfa_v2',
-        # for HeavyIon
-        'InitialBeam_HI_v1', 'InitialBeam_HI_v1_no_prescale',
-        'MC_InitialBeam_HI_v1', 'MC_InitialBeam_HI_v1_no_prescale',
-        'Physics_HI_v1', 'Physics_HI_v1_no_prescale',
-        'MC_HI_v1',     'MC_HI_v1_no_prescale', 'MC_HI_v1_pPb_mc_prescale',
-        #
-        'Physics_HI_v2', 'Physics_HI_v2_no_prescale', 
-        'MC_HI_v2',  'MC_HI_v2_no_prescale', 'MC_HI_v2_pPb_mc_prescale',
-        #
-        'Physics_default', 'MC_loose_default', 'MC_tight_default', 'default_loose', 'default_tight',
-        # -----------------------------------------------------------------
-        # Run 2
-        'MC_pp_v5', 'MC_pp_v5_no_prescale', 'MC_pp_v5_tight_mc_prescale', 'MC_pp_v5_loose_mc_prescale','MC_pp_v5_special_mc_prescale', # for development and simulation
-        'Physics_pp_v5', # for testing algorithms and software quality during LS1, later for data taking
-        'Physics_pp_v5_cosmics_prescale',
-        'Physics_pp_v5_tight_physics_prescale', 
-        'LS1_v1', # for P1 detector commissioning (cosmics, streamers)
-        'DC14', 'DC14_no_prescale', 'DC14_tight_mc_prescale', 'DC14_loose_mc_prescale', # for DC14
-        'Physics_HI_v3', 'Physics_HI_v3_no_prescale', # for 2015 lead-lead menu 
-        'MC_HI_v3', 'MC_HI_v3_tight_mc_prescale',
-        'Physics_HI_v4', 'Physics_HI_v4_no_prescale', # for 2016 proton-lead menu 
-        'MC_HI_v4', 'MC_HI_v4_tight_mc_prescale',
-
-        'MC_pp_v6','Physics_pp_v6','MC_pp_v6_no_prescale', 'MC_pp_v6_tight_mc_prescale', 'MC_pp_v6_tightperf_mc_prescale', 'MC_pp_v6_loose_mc_prescale','Physics_pp_v6_tight_physics_prescale',
-        'MC_pp_v7','Physics_pp_v7','Physics_pp_v7_primaries','MC_pp_v7_no_prescale', 'MC_pp_v7_tight_mc_prescale', 'MC_pp_v7_tightperf_mc_prescale', 'MC_pp_v7_loose_mc_prescale','Physics_pp_v7_tight_physics_prescale',
-        # -----------------------------------------------------------------
-        # Run 3 (and preparation for Run-3)
-        'LS2_v1', # for development of AthenaMT
-        'LS2_emu_v1', # emulation test menu for AthenaMT
-        'MC_pp_run3_v1', # MC_pp_run3 for AthenaMT
-        'PhysicsP1_pp_run3_v1', # PhysicsP1_pp_run3 for AthenaMT
-        'Physics_pp_run3_v1', # Physics_pp_run3 for AthenaMT
-        'PhysicsP1_HI_run3_v1',  # PhysicsP1_HI_run3 for AthenaMT
-        'Dev_HI_run3_v1', # Dev_HI_run3 for AthenaMT
-        'MC_pp_v7_TriggerValidation_mc_prescale', # MC trigger simulated in 21.0 but reconstructed in 22.0
-        'MC_pp_v8', 'Physics_pp_v8', 'MC_pp_v8_no_prescale', 'MC_pp_v8_tight_mc_prescale', 'MC_pp_v8_tightperf_mc_prescale', 'MC_pp_v8_loose_mc_prescale','Physics_pp_v8_tight_physics_prescale',
-        'Cosmic_run3_v1',
-        'LS2_v1_Primary_prescale',
-        'LS2_v1_TriggerValidation_prescale',
-        'LS2_v1_BulkMCProd_prescale',
-        'LS2_v1_CPSampleProd_prescale'
-        ]
-
-    _default_menu='Physics_pp_v7_primaries'
-    _default_cosmic_menu='Physics_pp_v5_cosmics_prescale'
-    _default_InitialBeam_menu='MC_InitialBeam_v3_no_prescale'
-    
-    StoredValue = _default_menu
-
-    def _do_action(self):
-        """ setup some consistency """
-
-        # meaning full default menu
-        if self.get_Value() == 'default':
-            self.set_Value(self._default_menu)
-            self._log.info("%s - trigger menu 'default' changed to '%s'", self.__class__.__name__, self.get_Value())
-        elif self.get_Value() == 'cosmic_default':
-            self.set_Value(self._default_cosmic_menu)
-            self._log.info("%s - trigger menu 'cosmic_default' changed to '%s'", self.__class__.__name__, self.get_Value())
-        elif self.get_Value() == 'InitialBeam_default':
-            self.set_Value(self._default_InitialBeam_menu)
-            self._log.info("%s - trigger menu 'InitialBeam_default' changed to '%s'", self.__class__.__name__, self.get_Value())
-
-        # filenames for LVL1 and HLT
-        if TriggerFlags.readLVL1configFromXML() is True:
-            TriggerFlags.inputLVL1configFile = "LVL1config_"+_getMenuBaseName(TriggerFlags.triggerMenuSetup())+"_" + TriggerFlags.menuVersion() + ".xml"
-
-_flags.append(triggerMenuSetup)
-
 
 # the container of all trigger flags
 
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py b/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
index 8720eae9897d..8f69a71606ef 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
@@ -62,23 +62,8 @@ if rec.doTrigger():
         from AthenaCommon.Resilience import treatException
         treatException("Could not run TriggerConfigGetter()")
 
-    #---------------------------------------------------------------------------    
-    if tf.configForStartup()=="HLToffline": # HLT is ran offline so cannot read from COOL.
-        if ConfigFlags.Trigger.EDMVersion == 1 or ConfigFlags.Trigger.EDMVersion == 2: # Run 1+2 setup, not needed for Run 3 reco
-            tf.readLVL1configFromXML = True # has to use the .xml file used for reco
-            # You have to set the 2 following files to the .xml files you want.
-            # Here are the default files for reprocessing special case with trigger
-            # FW, May 2021: Setting of HLT XML file removed
-            tf.inputLVL1configFile = "LVL1Menu.xml" # Has to be set correctly
-            tf.inputLVL1configFile.lock() # this is needed to not be overwritten by TrigT1CTMonitoring
-
-    #---------------------------------------------------------------------------    
-    elif tf.configForStartup()=="HLTonline": # need to talk to clients using LVL1ConfigSvc and add new folders into
-        #Just to be sure we use no LVL1 xml file and do not forget any clients
-        tf.inputLVL1configFile = "LVL1configDUMMY.xml"
-        tf.inputLVL1configFile.lock()
-        tf.readLVL1configFromXML=False
-        tf.readLVL1configFromXML.lock()
+    #---------------------------------------------------------------------------
+    if tf.configForStartup()=="HLTonline": # need to talk to clients using LVL1ConfigSvc and add new folders into
 
         # do not need thresholds but are using LVL1ConfigSvc
         if not hasattr(ToolSvc,'RecMuCTPIByteStreamTool'):
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index 3454150cd604..c7971f5c7f00 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -441,9 +441,6 @@ elif ConfigFlags.Input.Format == 'BS' and not ConfigFlags.Trigger.Online.isParti
 # ---------------------------------------------------------------
 if opt.setMenu:
     ConfigFlags.Trigger.triggerMenuSetup = opt.setMenu
-TriggerFlags.triggerMenuSetup = ConfigFlags.Trigger.triggerMenuSetup
-TriggerFlags.readLVL1configFromXML = False
-TriggerFlags.outputLVL1configFile = None
 
 from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu, createL1PrescalesFileFromMenu
 generateL1Menu(ConfigFlags)
-- 
GitLab


From efa65cafa8eaa75804da936fb2093ee2afd18fd9 Mon Sep 17 00:00:00 2001
From: Siarhei Harkusha <siarhei.harkusha@cern.ch>
Date: Wed, 22 Sep 2021 13:43:27 +0200
Subject: [PATCH 264/347] TileMonitoring: Add post processing for Tile online
 monitoring

---
 .../DQOnlinePostprocessing/python/atlas_oh.py |   4 +-
 TileCalorimeter/TileMonitoring/CMakeLists.txt |   1 +
 .../data/TileDigiNoisePostProc.yaml           |  12 ++
 .../data/TileRawChanNoisePostProc.yaml        |  33 ++++
 .../TileMonitoring/data/TileTMDBPostProc.yaml |  18 +++
 .../python/TilePostProcessing.py              | 141 ++++++++++++++++++
 6 files changed, 207 insertions(+), 2 deletions(-)
 create mode 100644 TileCalorimeter/TileMonitoring/data/TileDigiNoisePostProc.yaml
 create mode 100644 TileCalorimeter/TileMonitoring/data/TileRawChanNoisePostProc.yaml
 create mode 100644 TileCalorimeter/TileMonitoring/data/TileTMDBPostProc.yaml

diff --git a/DataQuality/DQOnlinePostprocessing/python/atlas_oh.py b/DataQuality/DQOnlinePostprocessing/python/atlas_oh.py
index 9844e4fd423a..80a2622898f9 100644
--- a/DataQuality/DQOnlinePostprocessing/python/atlas_oh.py
+++ b/DataQuality/DQOnlinePostprocessing/python/atlas_oh.py
@@ -46,7 +46,7 @@ class OHInputModule(InputModule):
             raise ValueError("Must specify 'source' as an "
                              "option to OHInputModule")
         self.source = options['source']
-        self.partition, self.server, self.provider = self.source.split(':')
+        self.partition, self.server, self.provider = self.source.split(';')
         self.prefix = options.get('prefix', '')
         if not IPCPartition(self.partition).isValid():
             raise ValueError(f'Input partition {self.partition} does not exist')
@@ -134,7 +134,7 @@ class OHOutputModule(OutputModule):
             raise ValueError("Must specify 'target' as an option "
                              "to OHInputModule")
         self.target = options['target']
-        self.partition, self.server, self.provider = self.target.split(':')
+        self.partition, self.server, self.provider = self.target.split(';')
         self.partition = ispy.IPCPartition(self.partition)
         if not self.partition.isValid():
             raise ValueError(f'Output partition {self.partition.name()} is not valid')
diff --git a/TileCalorimeter/TileMonitoring/CMakeLists.txt b/TileCalorimeter/TileMonitoring/CMakeLists.txt
index 8f95b22b336c..834b51cf4f61 100644
--- a/TileCalorimeter/TileMonitoring/CMakeLists.txt
+++ b/TileCalorimeter/TileMonitoring/CMakeLists.txt
@@ -32,6 +32,7 @@ atlas_add_component( TileMonitoring
 atlas_install_headers( TileMonitoring )
 atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
+atlas_install_data( data/*.yaml )
 
 # Tests:
 atlas_add_test( TileCellMonitorAlgorithm_test
diff --git a/TileCalorimeter/TileMonitoring/data/TileDigiNoisePostProc.yaml b/TileCalorimeter/TileMonitoring/data/TileDigiNoisePostProc.yaml
new file mode 100644
index 000000000000..5955c13830d3
--- /dev/null
+++ b/TileCalorimeter/TileMonitoring/data/TileDigiNoisePostProc.yaml
@@ -0,0 +1,12 @@
+#
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+#
+# Post-processing of histograms from Tile digi noise monitoring
+## Separate blocks with ---
+---
+Input: [ 'Tile/DigiNoise/TileDigiNoisePed_(?P<partition>[L|E]B[C|A])_(?P<gain>[H|L]G)' ]
+Output: [ 'Tile/DigiNoise/TileDigiNoiseLFN_{partition}_{gain}' ]
+Function: TileMonitoring.TilePostProcessing.getProfile2D_RMS
+Parameters: { title: 'Low frequency noise (LFN)', name: 'TileDigiNoiseLFN'}
+Description: Produce Tile 2D with low frequency noise (LFN) per partition
+
diff --git a/TileCalorimeter/TileMonitoring/data/TileRawChanNoisePostProc.yaml b/TileCalorimeter/TileMonitoring/data/TileRawChanNoisePostProc.yaml
new file mode 100644
index 000000000000..88184f75c41c
--- /dev/null
+++ b/TileCalorimeter/TileMonitoring/data/TileRawChanNoisePostProc.yaml
@@ -0,0 +1,33 @@
+#
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+#
+# Post-processing of histograms from Tile Raw channel noise monitoring
+## Separate blocks with ---
+Input: [ 'Tile/RawChannelNoise/LBA/(?P<module>LBA[0-6]\d{1})/TileRawChannelNoise_(?P=module)_[ABCDE]\d[0-5\*]?_ch_(?P<channel>\d{1,2})_HG' ]
+Output: [ 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_RMS_LBA', 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Sigma_LBA',
+          'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Chi2_LBA', 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Probability_LBA',
+          'Tile/RawChannelNoise/Summary/TileRawChannelNoise_RmsOverSigma_LBA']
+Function: TileMonitoring.TilePostProcessing.getTilePartitionRawChannelNoise
+Description: Produces 2D histograms with Tile raw channel noise for LBA partition
+---
+Input: [ 'Tile/RawChannelNoise/LBC/(?P<module>LBC[0-6]\d{1})/TileRawChannelNoise_(?P=module)_[ABCDE]\d[0-5\*]?_ch_(?P<channel>\d{1,2})_HG' ]
+Output: [ 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_RMS_LBC', 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Sigma_LBC',
+          'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Chi2_LBC', 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Probability_LBC',
+          'Tile/RawChannelNoise/Summary/TileRawChannelNoise_RmsOverSigma_LBC' ]
+Function: TileMonitoring.TilePostProcessing.getTilePartitionRawChannelNoise
+Description: Produces 2D histograms with Tile raw channel noise for LBC partition
+---
+Input: [ 'Tile/RawChannelNoise/EBA/(?P<module>EBA[0-6]\d{1})/TileRawChannelNoise_(?P=module)_[ABCDE]\d[0-5\*]?_ch_(?P<channel>\d{1,2})_HG' ]
+Output: [ 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_RMS_EBA', 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Sigma_EBA',
+          'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Chi2_EBA', 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Probability_EBA',
+          'Tile/RawChannelNoise/Summary/TileRawChannelNoise_RmsOverSigma_EBA' ]
+Function: TileMonitoring.TilePostProcessing.getTilePartitionRawChannelNoise
+Description: Produces 2D histograms with Tile raw channel noise for EBA partition
+---
+Input: [ 'Tile/RawChannelNoise/EBC/(?P<module>EBC[0-6]\d{1})/TileRawChannelNoise_(?P=module)_[ABCDE]\d[0-5\*]?_ch_(?P<channel>\d{1,2})_HG' ]
+Output: [ 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_RMS_EBC', 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Sigma_EBC',
+          'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Chi2_EBC', 'Tile/RawChannelNoise/Summary/TileRawChannelNoise_Probability_EBC',
+          'Tile/RawChannelNoise/Summary/TileRawChannelNoise_RmsOverSigma_EBC' ]
+Function: TileMonitoring.TilePostProcessing.getTilePartitionRawChannelNoise
+Description: Produces 2D histograms with Tile raw channel noise for EBC partition
+
diff --git a/TileCalorimeter/TileMonitoring/data/TileTMDBPostProc.yaml b/TileCalorimeter/TileMonitoring/data/TileTMDBPostProc.yaml
new file mode 100644
index 000000000000..37982b5014dd
--- /dev/null
+++ b/TileCalorimeter/TileMonitoring/data/TileTMDBPostProc.yaml
@@ -0,0 +1,18 @@
+#
+#  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+#
+# Post-processing of histograms from Tile TMDB monitoring
+## Separate blocks with ---
+---
+Input: [ 'Tile/TMDBDigits/TMDB_DigitsPedestal_(?P<partition>[L|E]B[C|A])' ]
+Output: [ 'Tile/TMDBDigits/TMDB_DigitsLFN_{partition}' ]
+Function: TileMonitoring.TilePostProcessing.getProfile2D_RMS
+Parameters: { title: 'LFN in TMDB', name: 'TMDB_DigitsLFN' }
+Description: Produce Tile TMDB 2D plots with LFN per partition
+---
+Input: [ 'Tile/TMDB/TMDB_Energy_(?P<partition>[L|E]B[C|A])' ]
+Output: [ 'Tile/TMDB/TMDB_Noise_{partition}' ]
+Function: TileMonitoring.TilePostProcessing.getProfile2D_RMS
+Parameters: { title: 'Noise [MeV] in TMDB', name: 'TMDB_Noise'}
+Description: Produce Tile TMDB 2D plots with noise per partition
+
diff --git a/TileCalorimeter/TileMonitoring/python/TilePostProcessing.py b/TileCalorimeter/TileMonitoring/python/TilePostProcessing.py
index c7fb323794f0..8eaa49d5bfd5 100644
--- a/TileCalorimeter/TileMonitoring/python/TilePostProcessing.py
+++ b/TileCalorimeter/TileMonitoring/python/TilePostProcessing.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
 #
 #  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 #
@@ -7,6 +8,9 @@
 @brief Functions for post-processing of histograms from TileMonitoring for the Run III
 '''
 
+import os, sys, signal, subprocess
+from AthenaCommon.Utils.unixtools import find_datafile
+
 def getProfile2D_RMS(inputs, title, name):
     """ This function produces 2D histogram with RMS from Profile2D per Tile partition """
 
@@ -28,3 +32,140 @@ def getProfile2D_RMS(inputs, title, name):
     inputProfile.GetYaxis().Copy(outputHistogram.GetYaxis())
 
     return [outputHistogram]
+
+
+def getTilePartitionRawChannelNoise(inputs):
+    """ This function produces 2D histograms with Tile raw channel noise per partition """
+
+    import ROOT
+    # Force batch mode
+    ROOT.gROOT.SetBatch(True)
+
+    from TileMonitoring.TileMonitoringCfgHelper import getLabels
+    from TileCalibBlobObjs.Classes import TileCalibUtils as Tile
+
+    def _getTilePartitionHistogram2D(name, title, partition, run):
+        fullName = 'TileRawChannelNoise_{}_{}'.format(name, partition)
+        fullTitle = 'Run {} Partition {}: {}'.format(run, partition, title)
+        histogram = ROOT.TH2F(fullName, fullTitle,
+                              Tile.MAX_DRAWER, 0.5, Tile.MAX_DRAWER + 0.5,
+                              Tile.MAX_CHAN, -0.5, Tile.MAX_CHAN - 0.5)
+        moduleLables = getLabels(('modules'), partition)
+        channelLables = getLabels(('channels'), partition)
+        for axis,labels in ((histogram.GetXaxis(), moduleLables), (histogram.GetYaxis(), channelLables)):
+            for bin in range(0, len(labels)):
+                axis.SetBinLabel(bin + 1, labels[bin])
+        return histogram
+
+
+    partition = inputs[0][0]['module'][:3]
+    run = str(inputs[0][1][0].GetTitle()).split(' ')[1]
+
+    rmsHistogram = _getTilePartitionHistogram2D('RMS', 'RMS of gaussians', partition, run)
+    sigmaHistogram = _getTilePartitionHistogram2D('Sigma', 'Sigma of gaussians', partition, run)
+    chi2Histogram = _getTilePartitionHistogram2D('Chi2', 'Chi2 of gaussians', partition, run)
+    probabilityHistogram = _getTilePartitionHistogram2D('Prob', 'Probability of gaussians', partition, run)
+    rmsOverSigmaHistogram = _getTilePartitionHistogram2D('RmsOverSigma', 'RMS/Sigma of gaussians', partition, run)
+
+    fitfunction = ROOT.TF1("total", "gaus(0)")
+    fitfunction.SetLineColor(2)
+
+    for input in inputs:
+
+        module = int(input[0]['module'][3:])
+        channel = int(input[0]['channel'])
+
+        plot = input[1][0]
+
+        nEntries = plot.GetEntries()
+
+        if nEntries > 100:
+
+            rms = plot.GetRMS()
+            rmsHistogram.Fill(module, channel, rms)
+
+            fitfunction.SetParameters(0.1 * nEntries, 0., 0.7 * rms)
+
+            binWidth = plot.GetBinWidth(0)
+            lowLimit = binWidth * 0.5
+            highLimit = max(rms * 1.05, binWidth * 2.0)
+
+            fitfunction.SetParLimits(0, 0., nEntries)
+            fitfunction.FixParameter(1, 0.)
+            fitfunction.SetParLimits(2, lowLimit, highLimit)
+
+            plot.Fit(fitfunction, "BQ")
+
+            sigma = fitfunction.GetParameter(2)
+            chi2 = fitfunction.GetChisquare()
+            prob = fitfunction.GetProb()
+
+            sigmaHistogram.Fill(module, channel, sigma)
+            chi2Histogram.Fill(module, channel, chi2)
+            probabilityHistogram.Fill(module, channel, prob)
+            rmsOverSigmaHistogram.Fill(module, channel, rms/sigma)
+
+    return [rmsHistogram, sigmaHistogram, chi2Histogram, probabilityHistogram, rmsOverSigmaHistogram]
+
+
+if __name__== '__main__':
+
+    import argparse
+    parser= argparse.ArgumentParser()
+
+    parser.add_argument('--stateless', action="store_true", help='Run Online Tile Post Processing in partition')
+    parser.add_argument('--tmdb', action="store_true", help='Run Tile TMDB Post Processing')
+    parser.add_argument('--digi-noise', action="store_true", dest='digiNoise', help='Run Tile Digi Noise Post Processing')
+    parser.add_argument('--raw-chan-noise', action="store_true", dest='rawChanNoise', help='Run Tile Digi Noise Post Processing')
+    parser.add_argument('--interval', type=int, default=60, help='Interval (in seconds) to run Tile Monitoring Post Processing')
+    parser.add_argument('--noise-interval', type=int, default=300, dest='noiseInterval',
+                        help='Interval (in seconds) to run Tile Noise Monitoring Post Processing')
+
+    args = parser.parse_args()
+
+    if args.stateless:
+
+        server = 'Histogramming'
+        partition = os.getenv("TDAQ_PARTITION", "ATLAS")
+
+        dataPath = find_datafile('TileMonitoring')
+
+        def sigtermHandler(signal, frame):
+            print('Terminating postporcessing ...')
+            sys.exit(0)
+
+        signal.signal(signal.SIGTERM, sigtermHandler)
+
+        if args.tmdb:
+
+            inputPath = f'{partition};{server};TileMIG:TileGatherer'
+            outputPath = f'{partition};{server};TilePT-stateless-PP'
+
+            physConfigurations = []
+            if args.tmdb:
+                physConfigurations += [os.path.join(dataPath, 'TileTMDBPostProc.yaml')]
+
+            physPostProcess = (['histgrinder', inputPath, outputPath,
+                                 '--inmodule', 'DQOnlinePostprocessing.atlas_oh.OHInputModule',
+                                 '--outmodule', 'DQOnlinePostprocessing.atlas_oh.OHOutputModule',
+                                 '-c'] + physConfigurations)
+
+            subprocess.run(physPostProcess)
+
+        elif any([args.digiNoise, args.rawChanNoise]):
+
+            inputPath = f'{partition};{server};TilePT-stateless-noise-01'
+            outputPath = f'{partition};{server};TilePT-stateless-noise-PP'
+
+            noiseConfigurations = []
+            if args.digiNoise:
+                noiseConfigurations += [os.path.join(dataPath, 'TileDigiNoisePostProc.yaml')]
+            if args.rawChanNoise:
+                noiseConfigurations += [os.path.join(dataPath, 'TileRawChanNoisePostProc.yaml')]
+
+            noisePostProcess = (['histgrinder', inputPath, outputPath,
+                                 '--inmodule', 'DQOnlinePostprocessing.atlas_oh.OHInputModule',
+                                 '--outmodule', 'DQOnlinePostprocessing.atlas_oh.OHOutputModule',
+                                 '-c'] + noiseConfigurations)
+
+            subprocess.run(noisePostProcess)
-- 
GitLab


From 81481e2749b393a548860d31b24011f2e1ee3d09 Mon Sep 17 00:00:00 2001
From: Edward Moyse <edward.moyse@cern.ch>
Date: Wed, 22 Sep 2021 15:38:29 +0200
Subject: [PATCH 265/347] Update Projects/AthDataQuality/version.txt,
 Projects/AthSimulation/version.txt, Projects/Athena/version.txt,
 Projects/DetCommon/version.txt, Projects/VP1Light/version.txt files

---
 Projects/AthDataQuality/version.txt | 2 +-
 Projects/AthSimulation/version.txt  | 2 +-
 Projects/Athena/version.txt         | 2 +-
 Projects/DetCommon/version.txt      | 2 +-
 Projects/VP1Light/version.txt       | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Projects/AthDataQuality/version.txt b/Projects/AthDataQuality/version.txt
index e2b274ee15be..fd058e47d476 100644
--- a/Projects/AthDataQuality/version.txt
+++ b/Projects/AthDataQuality/version.txt
@@ -1 +1 @@
-22.0.44
+22.0.45
diff --git a/Projects/AthSimulation/version.txt b/Projects/AthSimulation/version.txt
index e2b274ee15be..fd058e47d476 100644
--- a/Projects/AthSimulation/version.txt
+++ b/Projects/AthSimulation/version.txt
@@ -1 +1 @@
-22.0.44
+22.0.45
diff --git a/Projects/Athena/version.txt b/Projects/Athena/version.txt
index e2b274ee15be..fd058e47d476 100644
--- a/Projects/Athena/version.txt
+++ b/Projects/Athena/version.txt
@@ -1 +1 @@
-22.0.44
+22.0.45
diff --git a/Projects/DetCommon/version.txt b/Projects/DetCommon/version.txt
index e2b274ee15be..fd058e47d476 100644
--- a/Projects/DetCommon/version.txt
+++ b/Projects/DetCommon/version.txt
@@ -1 +1 @@
-22.0.44
+22.0.45
diff --git a/Projects/VP1Light/version.txt b/Projects/VP1Light/version.txt
index e2b274ee15be..fd058e47d476 100644
--- a/Projects/VP1Light/version.txt
+++ b/Projects/VP1Light/version.txt
@@ -1 +1 @@
-22.0.44
+22.0.45
-- 
GitLab


From 5a092c5256889bdb98bde05419c9697f93e0799b Mon Sep 17 00:00:00 2001
From: Daniele Zanzi <daniele.zanzi@cern.ch>
Date: Wed, 22 Sep 2021 16:39:46 +0200
Subject: [PATCH 266/347] fix cTAU configuration, work on jEM, jJ,  jLJ, XE and
 TE (ATR-24012, ATR-21235, ATR-24114)

---
 .../TrigConfData/CMakeLists.txt               |   2 +-
 .../TrigConfData/L1ThrExtraInfo.h             | 167 +++++++++++++--
 .../TrigConfData/TrigConfData/L1Threshold.h   |  97 +++++++++
 .../TrigConfData/L1TopoAlgorithm.h            |  49 ++++-
 .../TrigConfData/src/L1ThrExtraInfo.cxx       | 191 +++++++++++++++++-
 .../TrigConfData/src/L1Threshold.cxx          |  46 ++++-
 .../TrigConfData/src/L1ThresholdBase.cxx      |  24 ++-
 .../TrigConfData/src/L1TopoAlgorithm.cxx      |   4 +
 .../TrigConfIO/src/JsonFileWriterL1.cxx       | 171 +++++++++++++++-
 .../utils/TestTriggerMenuAccess.cxx           |  61 +++++-
 .../L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx   |   4 +-
 .../TrigT1/TrigT1CTP/src/CTPSimulation.cxx    |  18 +-
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 100 +++++++++
 .../share/ref_v1Dev_decodeBS_build.ref        | 100 +++++++++
 .../python/HLTMenuConfig/Menu/LS2_v1.py       |  79 +++++---
 .../HLTMenuConfig/Menu/Physics_pp_run3_v1.py  |   3 +-
 .../TriggerMenuMT/python/L1/Base/L1Menu.py    |   8 +-
 .../python/L1/Base/ThresholdType.py           |   4 +-
 .../python/L1/Base/Thresholds.py              | 166 +++++++++++++--
 .../TriggerMenuMT/python/L1/Base/TopoAlgos.py |  24 ++-
 .../TriggerMenuMT/python/L1/Config/ItemDef.py |  59 ++++--
 .../python/L1/Config/ThresholdDef.py          | 121 ++++++++---
 .../L1/Config/TopoAlgoDefMultiplicity.py      |  65 ++++--
 .../L1/Config/TypeWideThresholdConfig.py      |  97 ++++++++-
 .../python/L1/Menu/Menu_MC_pp_v8.py           |  21 +-
 .../python/L1/Menu/Menu_MC_pp_v8_inputs.py    |  21 +-
 26 files changed, 1506 insertions(+), 196 deletions(-)

diff --git a/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt
index 48efdb89527d..31b5b0cfc5f4 100644
--- a/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt
+++ b/Trigger/TrigConfiguration/TrigConfData/CMakeLists.txt
@@ -51,7 +51,7 @@ if( NOT XAOD_ANALYSIS )
 atlas_add_test( TestDoubleMenuLoad SOURCES test/doubleLoad.cxx
                 INCLUDE_DIRS ${CORAL_INCLUDE_DIRS}
                 LINK_LIBRARIES ${CORAL_LIBRARIES} TrigConfData TrigConfIO
-                ENVIRONMENT "CLArgs=TRIGGERDBDEV1_I8 92 442 429 4"
+                ENVIRONMENT "CLArgs=TRIGGERDBDEV1_I8 99 497 487 4"
                 PRE_EXEC_SCRIPT "rm -f *1.json *2.json NoDBConnection.txt"
                 POST_EXEC_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/share/doubleTestComp.py )
 endif()
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThrExtraInfo.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThrExtraInfo.h
index e094be9df16a..e6f801142425 100644
--- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThrExtraInfo.h
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThrExtraInfo.h
@@ -19,11 +19,16 @@ namespace TrigConf {
    class L1ThrExtraInfo_JETLegacy;
    class L1ThrExtraInfo_XSLegacy;
    class L1ThrExtraInfo_eEM;
+   class L1ThrExtraInfo_jEM;
    class L1ThrExtraInfo_eTAU;
    class L1ThrExtraInfo_jTAU;
    class L1ThrExtraInfo_cTAU;
    class L1ThrExtraInfo_jJ;
+   class L1ThrExtraInfo_jLJ;
    class L1ThrExtraInfo_gXE;
+   class L1ThrExtraInfo_jXE;
+   class L1ThrExtraInfo_gTE;
+   class L1ThrExtraInfo_jTE;
    class L1ThrExtraInfo_MU;
 
    class L1ThrExtraInfo {
@@ -37,11 +42,16 @@ namespace TrigConf {
       const L1ThrExtraInfo_JETLegacy & JET() const;
       const L1ThrExtraInfo_XSLegacy & XS() const;
       const L1ThrExtraInfo_eEM & eEM() const;
+      const L1ThrExtraInfo_jEM & jEM() const;
       const L1ThrExtraInfo_eTAU & eTAU() const;
       const L1ThrExtraInfo_jTAU & jTAU() const;
       const L1ThrExtraInfo_cTAU & cTAU() const;
       const L1ThrExtraInfo_jJ & jJ() const;
+      const L1ThrExtraInfo_jLJ & jLJ() const;
       const L1ThrExtraInfo_gXE & gXE() const;
+      const L1ThrExtraInfo_jXE & jXE() const;
+      const L1ThrExtraInfo_gTE & gTE() const;
+      const L1ThrExtraInfo_jTE & jTE() const;
       const L1ThrExtraInfo_MU & MU() const;
 
       const L1ThrExtraInfoBase & thrExtraInfo(const std::string & thrTypeName) const;
@@ -139,14 +149,14 @@ namespace TrigConf {
          int wstot_fw()      const { return m_wstot_fw; }
          int rhad_fw()       const { return m_rhad_fw; }
          unsigned int maxEt()  const { return m_maxEt; }
-         double reta_d()       const { return m_reta_d; } 
-         double wstot_d()     const { return m_wstot_d; }
-         double rhad_d()       const { return m_rhad_d; }
+         float reta_d()       const { return m_reta_d; } 
+         float wstot_d()     const { return m_wstot_d; }
+         float rhad_d()       const { return m_rhad_d; }
       private:
          bool m_isDefined { false };
-         double m_reta_d { 0 };
-         double m_wstot_d { 0 };
-         double m_rhad_d { 0 };
+         float m_reta_d { 0 };
+         float m_wstot_d { 0 };
+         float m_rhad_d { 0 };
          int   m_reta_fw { 0 };
          int   m_wstot_fw { 0 };
          int   m_rhad_fw { 0 };
@@ -170,6 +180,53 @@ namespace TrigConf {
    };
    std::ostream & operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_eEM::WorkingPoints_eEM & iso);
 
+   class L1ThrExtraInfo_jEM final : public L1ThrExtraInfoBase {
+   public:
+      class WorkingPoints_jEM {
+      public:
+         WorkingPoints_jEM() = default;
+         WorkingPoints_jEM( const boost::property_tree::ptree & );
+         bool isDefined() const { return m_isDefined; }
+         int iso_fw()       const { return m_iso_fw; }
+         int frac_fw()      const { return m_frac_fw; }
+         int frac2_fw()       const { return m_frac2_fw; }
+         unsigned int maxEt()  const { return m_maxEt; }
+         float iso_d()       const { return m_iso_d; }
+         float frac_d()     const { return m_frac_d; }
+         float frac2_d()       const { return m_frac2_d; }
+      private:
+         bool m_isDefined { false };
+         float m_iso_d { 0 };
+         float m_frac_d { 0 };
+         float m_frac2_d { 0 };
+         int   m_iso_fw { 0 };
+         int   m_frac_fw { 0 };
+         int   m_frac2_fw { 0 };
+         unsigned int m_maxEt { 0 };
+      };
+      L1ThrExtraInfo_jEM(const std::string & thrTypeName, const ptree & data) :
+         L1ThrExtraInfoBase(thrTypeName, data) { load(); }
+      virtual ~L1ThrExtraInfo_jEM() = default;
+      virtual std::string className() const { return "L1ThrExtraInfo_jEM"; }
+      const WorkingPoints_jEM & isolation(TrigConf::Selection::WP wp, int eta) const { return m_isolation.at(wp).at(eta); }
+      const ValueWithEtaDependence<WorkingPoints_jEM> & isolation(TrigConf::Selection::WP wp) const { return m_isolation.at(wp); }
+      float ptMinToTopo(int eta = 0) const { return ptMinToTopoMeV(eta) / 1000.0; }
+      unsigned int ptMinToTopoMeV(int eta = 0) const { return m_ptMinToTopoMeV.at(eta); }
+      unsigned int ptMinToTopoCounts(int eta = 0) const { return energyInCounts( ptMinToTopoMeV(eta), resolutionMeV() ); }
+      const ValueWithEtaDependence<int> & ptMinToTopoEtaMeV() const { return m_ptMinToTopoMeV; }
+      float ptMinxTOB(int eta = 0) const { return ptMinxTOBMeV(eta) / 1000.0; }
+      unsigned int ptMinxTOBMeV(int eta = 0) const { return m_ptMinxTOBMeV.at(eta); }
+      unsigned int ptMinxTOBCounts(int eta = 0) const { return energyInCounts( ptMinxTOBMeV(eta), resolutionMeV() ); }
+      const ValueWithEtaDependence<int> & ptMinxTOBEtaMeV() const { return m_ptMinxTOBMeV; }
+   private:
+      /** Update the internal members */
+      void load();
+      /** jEM specific data */
+      ValueWithEtaDependence<int> m_ptMinToTopoMeV{"jEMptMinTopo"};
+      ValueWithEtaDependence<int> m_ptMinxTOBMeV{"jEMptMinxTOB"};
+      std::map<TrigConf::Selection::WP, ValueWithEtaDependence<WorkingPoints_jEM>> m_isolation{};
+   };
+   std::ostream & operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_jEM::WorkingPoints_jEM & iso);
 
    class L1ThrExtraInfo_eTAU final : public L1ThrExtraInfoBase {
    public:
@@ -178,16 +235,16 @@ namespace TrigConf {
          WorkingPoints_eTAU( const boost::property_tree::ptree & );
          bool isDefined() const { return m_isDefined; }
          int isoConeRel_fw() const { return m_isoConeRel_fw; }
-         double isoConeRel_d() const { return m_isoConeRel_d; }
+         float isoConeRel_d() const { return m_isoConeRel_d; }
          int fEM_fw() const { return m_fEM_fw; }
-         double fEM_d() const { return m_fEM_d; }
+         float fEM_d() const { return m_fEM_d; }
          unsigned int maxEt() const { return m_maxEt; } 
       private:
          bool m_isDefined { false };
          int m_isoConeRel_fw {0};
          int m_fEM_fw {0};
-         double m_isoConeRel_d { 0 };
-         double m_fEM_d { 0 };      
+         float m_isoConeRel_d { 0 };
+         float m_fEM_d { 0 };      
          unsigned int m_maxEt { 0 };
       };
       L1ThrExtraInfo_eTAU(const std::string & thrTypeName, const ptree & data) :
@@ -215,28 +272,34 @@ namespace TrigConf {
          WorkingPoints_jTAU( const boost::property_tree::ptree & );
          bool isDefined() const { return m_isDefined; }
          int isolation_fw() const { return m_isolation_fw; }
-         double isolation_d() const { return m_isolation_d; }
+         float isolation_d() const { return m_isolation_d; }
          unsigned int maxEt() const { return m_maxEt; }
       private:
          bool m_isDefined { false };
          int m_isolation_fw {0};
-         double m_isolation_d { 0 };
+         float m_isolation_d { 0 };
          unsigned int m_maxEt { 0 };
       };
       L1ThrExtraInfo_jTAU(const std::string & thrTypeName, const ptree & data) :
          L1ThrExtraInfoBase(thrTypeName, data) { load(); }
       virtual ~L1ThrExtraInfo_jTAU() = default;
       virtual std::string className() const { return "L1ThrExtraInfo_jTAU"; }
-      float ptMinToTopo() const { return m_ptMinToTopoMeV/1000.0f; }
-      unsigned int ptMinToTopoMeV() const { return m_ptMinToTopoMeV; }
-      unsigned int ptMinToTopoCounts() const { return energyInCounts( m_ptMinToTopoMeV, resolutionMeV() ); }
+      float ptMinToTopo(int eta = 0) const { return ptMinToTopoMeV(eta) / 1000.0; }
+      unsigned int ptMinToTopoMeV(int eta = 0) const { return m_ptMinToTopoMeV.at(eta); }
+      unsigned int ptMinToTopoCounts(int eta = 0) const { return energyInCounts( ptMinToTopoMeV(eta), resolutionMeV() ); }
+      const ValueWithEtaDependence<int> & ptMinToTopoEtaMeV() const { return m_ptMinToTopoMeV; }
+      float ptMinxTOB(int eta = 0) const { return ptMinxTOBMeV(eta) / 1000.0; }
+      unsigned int ptMinxTOBMeV(int eta = 0) const { return m_ptMinxTOBMeV.at(eta); }
+      unsigned int ptMinxTOBCounts(int eta = 0) const { return energyInCounts( ptMinxTOBMeV(eta), resolutionMeV() ); }
+      const ValueWithEtaDependence<int> & ptMinxTOBEtaMeV() const { return m_ptMinxTOBMeV; }
       const WorkingPoints_jTAU & isolation(TrigConf::Selection::WP wp, int eta) const { return m_isolation.at(wp).at(eta); }
       const ValueWithEtaDependence<WorkingPoints_jTAU> & isolation(TrigConf::Selection::WP wp) const  { return m_isolation.at(wp); }
    private:
       /** Update the internal members */
       void load();
      /** jTAU specific data */
-      unsigned int m_ptMinToTopoMeV{0};
+      ValueWithEtaDependence<int> m_ptMinToTopoMeV{"jTAUptMinTopo"};
+      ValueWithEtaDependence<int> m_ptMinxTOBMeV{"jTAUptMinxTOB"};
       std::map<TrigConf::Selection::WP, ValueWithEtaDependence<WorkingPoints_jTAU>> m_isolation{};
    };
    std::ostream & operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_jTAU::WorkingPoints_jTAU & iso);
@@ -248,13 +311,11 @@ namespace TrigConf {
          WorkingPoints_cTAU( const boost::property_tree::ptree & );
          bool isDefined() const { return m_isDefined; }
          int isolation_fw() const { return m_isolation_fw; }
-         double isolation_d() const { return m_isolation_d; }
-         unsigned int maxEt() const { return m_maxEt; }
+         float isolation_d() const { return m_isolation_d; }
       private:
          bool m_isDefined { false };
          int m_isolation_fw {0};
-         double m_isolation_d { 0 };
-         unsigned int m_maxEt { 0 };
+         float m_isolation_d { 0 };
       };
       L1ThrExtraInfo_cTAU(const std::string & thrTypeName, const ptree & data) :
          L1ThrExtraInfoBase(thrTypeName, data) { load(); }
@@ -276,15 +337,68 @@ namespace TrigConf {
          L1ThrExtraInfoBase(thrTypeName, data) { load(); }
       virtual ~L1ThrExtraInfo_jJ() = default;
       virtual std::string className() const { return "L1ThrExtraInfo_jJ"; }
-      double ptMinToTopo(int eta = 0) const { return ptMinToTopoMeV(eta) / 1000.0; }
+      float ptMinToTopo(int eta = 0) const { return ptMinToTopoMeV(eta) / 1000.0; }
       unsigned int ptMinToTopoMeV(int eta = 0) const { return m_ptMinToTopoMeV.at(eta); }
       unsigned int ptMinToTopoCounts(int eta = 0) const { return energyInCounts( ptMinToTopoMeV(eta), resolutionMeV() ); }
       const ValueWithEtaDependence<int> & ptMinToTopoEtaMeV() const { return m_ptMinToTopoMeV; }
+      float ptMinxTOB(int eta = 0) const { return ptMinxTOBMeV(eta) / 1000.0; }
+      unsigned int ptMinxTOBMeV(int eta = 0) const { return m_ptMinxTOBMeV.at(eta); }
+      unsigned int ptMinxTOBCounts(int eta = 0) const { return energyInCounts( ptMinxTOBMeV(eta), resolutionMeV() ); }
+      const ValueWithEtaDependence<int> & ptMinxTOBEtaMeV() const { return m_ptMinxTOBMeV; }
    private:
       /** Update the internal members */
       void load();
       /** jJ specific data */
       ValueWithEtaDependence<int> m_ptMinToTopoMeV{"jJptMinTopo"};
+      ValueWithEtaDependence<int> m_ptMinxTOBMeV{"jJptMinxTOB"};
+   };
+
+   class L1ThrExtraInfo_jLJ final : public L1ThrExtraInfoBase {
+   public:
+      L1ThrExtraInfo_jLJ(const std::string & thrTypeName, const ptree & data) :
+         L1ThrExtraInfoBase(thrTypeName, data) { load(); }
+      virtual ~L1ThrExtraInfo_jLJ() = default;
+      virtual std::string className() const { return "L1ThrExtraInfo_jLJ"; }
+      float ptMinToTopo(int eta = 0) const { return ptMinToTopoMeV(eta) / 1000.0; }
+      unsigned int ptMinToTopoMeV(int eta = 0) const { return m_ptMinToTopoMeV.at(eta); }
+      unsigned int ptMinToTopoCounts(int eta = 0) const { return energyInCounts( ptMinToTopoMeV(eta), resolutionMeV() ); }
+      const ValueWithEtaDependence<int> & ptMinToTopoEtaMeV() const { return m_ptMinToTopoMeV; }
+      float ptMinxTOB(int eta = 0) const { return ptMinxTOBMeV(eta) / 1000.0; }
+      unsigned int ptMinxTOBMeV(int eta = 0) const { return m_ptMinxTOBMeV.at(eta); }
+      unsigned int ptMinxTOBCounts(int eta = 0) const { return energyInCounts( ptMinxTOBMeV(eta), resolutionMeV() ); }
+      const ValueWithEtaDependence<int> & ptMinxTOBEtaMeV() const { return m_ptMinxTOBMeV; }
+   private:
+      /** Update the internal members */
+      void load();
+      /** jLJ specific data */
+      ValueWithEtaDependence<int> m_ptMinToTopoMeV{"jLJptMinTopo"};
+      ValueWithEtaDependence<int> m_ptMinxTOBMeV{"jLJptMinxTOB"};
+   };
+
+   class L1ThrExtraInfo_jXE final : public L1ThrExtraInfoBase {
+   public:
+      L1ThrExtraInfo_jXE(const std::string & thrTypeName, const ptree & data) :
+         L1ThrExtraInfoBase(thrTypeName, data) { load(); }
+      virtual ~L1ThrExtraInfo_jXE() = default;
+      virtual std::string className() const { return "L1ThrExtraInfo_jXE"; }
+   private:
+      /** Update the internal members */
+      void load();
+      /** jXE specific data */
+   };
+
+   class L1ThrExtraInfo_jTE final : public L1ThrExtraInfoBase {
+   public:
+      L1ThrExtraInfo_jTE(const std::string & thrTypeName, const ptree & data) :
+         L1ThrExtraInfoBase(thrTypeName, data) { load(); }
+      virtual ~L1ThrExtraInfo_jTE() = default;
+      virtual std::string className() const { return "L1ThrExtraInfo_jTE"; }
+      unsigned int  etaBoundary() const { return m_etaBoundary; }
+   private:
+      /** Update the internal members */
+      void load();
+      /** jTE specific data */
+      unsigned int m_etaBoundary{0};
    };
 
    class L1ThrExtraInfo_gXE final : public L1ThrExtraInfoBase {
@@ -299,6 +413,17 @@ namespace TrigConf {
       /** gXE specific data */
    };
 
+   class L1ThrExtraInfo_gTE final : public L1ThrExtraInfoBase {
+   public:
+      L1ThrExtraInfo_gTE(const std::string & thrTypeName, const ptree & data) :
+         L1ThrExtraInfoBase(thrTypeName, data) { load(); }
+      virtual ~L1ThrExtraInfo_gTE() = default;
+      virtual std::string className() const { return "L1ThrExtraInfo_gTE"; }
+   private:
+      /** Update the internal members */
+      void load();
+      /** gTE specific data */
+   };
 
    class L1ThrExtraInfo_MU final : public L1ThrExtraInfoBase {
    public:
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h
index 418fab857ee2..dca141b1cc86 100644
--- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1Threshold.h
@@ -160,6 +160,29 @@ namespace TrigConf {
       Selection::WP m_wstot { Selection::WP::NONE };
    };
 
+   class L1Threshold_jEM final : public L1Threshold_Calo {
+   public:
+      L1Threshold_jEM( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> extraInfo, const ptree & data) :
+         L1Threshold_Calo(name, type, extraInfo, data) { load(); }
+      virtual ~L1Threshold_jEM() = default;
+      virtual std::string className() const override { return "L1Threshold_jEM"; }
+      // access functions
+      Selection::WP iso() const { return m_iso; }
+      Selection::WP frac() const { return m_frac; }
+      Selection::WP frac2() const { return m_frac2; }
+   protected:
+      virtual void update() override {
+         L1Threshold_Calo::update();
+         load();
+      }
+   private:
+      void load();
+      // the isolation requirement
+      Selection::WP m_iso { Selection::WP::NONE };
+      Selection::WP m_frac { Selection::WP::NONE };
+      Selection::WP m_frac2 { Selection::WP::NONE };
+   };
+      
    class L1Threshold_eTAU final : public L1Threshold_Calo {
    public:
       L1Threshold_eTAU( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> extraInfo, const ptree & data) :
@@ -234,6 +257,80 @@ namespace TrigConf {
       void load();
    };
 
+   class L1Threshold_jLJ final : public L1Threshold_Calo {
+   public:
+      L1Threshold_jLJ( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> extraInfo, const ptree & data) :
+         L1Threshold_Calo(name, type, extraInfo, data) { load(); }
+      virtual ~L1Threshold_jLJ() = default;
+      virtual std::string className() const override { return "L1Threshold_jLJ"; }
+   protected:
+      virtual void update() override {
+         L1Threshold_Calo::update();
+         load();
+      }
+   private:
+      void load();
+   };
+
+   class L1Threshold_jXE final : public L1Threshold_Calo {
+   public:
+      L1Threshold_jXE( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> extraInfo, const ptree & data) :
+         L1Threshold_Calo(name, type, extraInfo, data) { load(); }
+      virtual ~L1Threshold_jXE() = default;
+      virtual std::string className() const override { return "L1Threshold_jXE"; }
+   protected:
+      virtual void update() override {
+         L1Threshold_Calo::update();
+         load();
+      }
+   private:
+      void load();
+   };
+
+   class L1Threshold_jTE final : public L1Threshold_Calo {
+   public:
+      L1Threshold_jTE( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> extraInfo, const ptree & data) :
+         L1Threshold_Calo(name, type, extraInfo, data) { load(); }
+      virtual ~L1Threshold_jTE() = default;
+      virtual std::string className() const override { return "L1Threshold_jTE"; }
+   protected:
+      virtual void update() override {
+         L1Threshold_Calo::update();
+         load();
+      }
+   private:
+      void load();
+   };
+
+   class L1Threshold_gXE final : public L1Threshold_Calo {
+   public:
+      L1Threshold_gXE( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> extraInfo, const ptree & data) :
+         L1Threshold_Calo(name, type, extraInfo, data) { load(); }
+      virtual ~L1Threshold_gXE() = default;
+      virtual std::string className() const override { return "L1Threshold_gXE"; }
+   protected:
+      virtual void update() override { 
+         L1Threshold_Calo::update();
+         load();
+      }  
+   private:
+      void load();
+   };
+
+   class L1Threshold_gTE final : public L1Threshold_Calo {
+   public:
+      L1Threshold_gTE( const std::string & name, const std::string & type, std::weak_ptr<L1ThrExtraInfoBase> extraInfo, const ptree & data) :
+         L1Threshold_Calo(name, type, extraInfo, data) { load(); }
+      virtual ~L1Threshold_gTE() = default;
+      virtual std::string className() const override { return "L1Threshold_gTE"; }
+   protected:
+      virtual void update() override {
+         L1Threshold_Calo::update();
+         load();
+      }
+   private:
+      void load();
+   };
 
    /************************************
     *
diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h
index 0f4f761634e3..de316d6b40d1 100644
--- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h
@@ -19,7 +19,7 @@ namespace TrigConf {
     */
    class L1TopoAlgorithm final : public DataStructure {
    public:
-
+      
       enum class AlgorithmType { SORTING, DECISION, MULTIPLICITY, UNKNOWN };
 
       struct VariableParameter {
@@ -110,6 +110,53 @@ namespace TrigConf {
 
    };
 
+   class XEFlavour {
+   public:
+      /** DO NOT CHANGE! Need to match with firmware values */
+      enum class FLAV { 
+          jXE     = 0,
+          jXEC    = 1, 
+          jTE     = 2, 
+          jTEC    = 3, 
+          jTEFWD  = 4, 
+          jTEFWDA = 5, 
+          jTEFWDC = 6, 
+          gXE     = 7, 
+          gXERHO  = 8, 
+          gXEPUFIT = 9, 
+          gTE     = 10 };
+
+      static std::string flavourIntToStr(const unsigned int flavInt){
+          if(flavInt==int(FLAV::jXE))     return "jXE";
+          if(flavInt==int(FLAV::jXEC))    return "jXEC";
+          if(flavInt==int(FLAV::jTE))     return "jTE";
+          if(flavInt==int(FLAV::jTEC))    return "jTEC";
+          if(flavInt==int(FLAV::jTEFWD))  return "jTEFWD";
+          if(flavInt==int(FLAV::jTEFWDA)) return "jTEFWDA";
+          if(flavInt==int(FLAV::jTEFWDC)) return "jTEFWDC";
+          if(flavInt==int(FLAV::gXE))     return "gXE";
+          if(flavInt==int(FLAV::gXERHO))  return "gXERHO";
+          if(flavInt==int(FLAV::gXEPUFIT)) return "gXEPUFIT";
+          if(flavInt==int(FLAV::gTE))     return "gTE";
+          throw std::runtime_error("Flavour " + std::to_string(flavInt) + " for EnergyThreshold algorithm not recongnised!");
+      };
+      static unsigned int flavourStrToInt(const std::string & flavStr){
+          if(flavStr=="jXE")     return int(FLAV::jXE);
+          if(flavStr=="jXEC")    return int(FLAV::jXEC);
+          if(flavStr=="jTE")     return int(FLAV::jTE);
+          if(flavStr=="jTEC")    return int(FLAV::jTEC);
+          if(flavStr=="jTEFWD")  return int(FLAV::jTEFWD);
+          if(flavStr=="jTEFWDA") return int(FLAV::jTEFWDA);
+          if(flavStr=="jTEFWDC") return int(FLAV::jTEFWDC);
+          if(flavStr=="gXE")     return int(FLAV::gXE);
+          if(flavStr=="gXERHO")  return int(FLAV::gXERHO);
+          if(flavStr=="gXEPUFIT") return int(FLAV::gXEPUFIT);
+          if(flavStr=="gTE")     return int(FLAV::gTE);
+          throw std::runtime_error("Flavour " + flavStr + " for EnergyThreshold algorithm not recongnised!");
+      };
+
+   };
+
 }
 
 #endif
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx
index 34df1ca587e9..817ba8f1df9a 100644
--- a/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx
@@ -31,6 +31,9 @@ TrigConf::L1ThrExtraInfo::createExtraInfo(const std::string & thrTypeName, const
    if( thrTypeName == "eEM" )
       return std::make_unique<L1ThrExtraInfo_eEM>(thrTypeName, data);
 
+   if( thrTypeName == "jEM" )
+      return std::make_unique<L1ThrExtraInfo_jEM>(thrTypeName, data);
+
    if( thrTypeName == "eTAU" )
       return std::make_unique<L1ThrExtraInfo_eTAU>(thrTypeName, data);
 
@@ -43,6 +46,21 @@ TrigConf::L1ThrExtraInfo::createExtraInfo(const std::string & thrTypeName, const
    if( thrTypeName == "jJ" )
       return std::make_unique<L1ThrExtraInfo_jJ>(thrTypeName, data);      
 
+   if( thrTypeName == "jLJ" )
+      return std::make_unique<L1ThrExtraInfo_jLJ>(thrTypeName, data);
+
+   if( thrTypeName == "jXE" )
+      return std::make_unique<L1ThrExtraInfo_jXE>(thrTypeName, data);
+
+   if( thrTypeName == "jTE" )
+      return std::make_unique<L1ThrExtraInfo_jTE>(thrTypeName, data);
+
+   if( thrTypeName == "gXE" )
+      return std::make_unique<L1ThrExtraInfo_gXE>(thrTypeName, data);
+
+   if( thrTypeName == "gTE" )
+      return std::make_unique<L1ThrExtraInfo_gTE>(thrTypeName, data);
+
    // if no special extra information is supplied for the threshold type return base class
    return std::make_unique<L1ThrExtraInfoBase>(thrTypeName, data);
 }
@@ -100,6 +118,11 @@ TrigConf::L1ThrExtraInfo::eEM() const {
    return dynamic_cast<const TrigConf::L1ThrExtraInfo_eEM&>( * m_thrExtraInfo.at("eEM") );
 }
 
+const TrigConf::L1ThrExtraInfo_jEM &
+TrigConf::L1ThrExtraInfo::jEM() const {
+   return dynamic_cast<const TrigConf::L1ThrExtraInfo_jEM&>( * m_thrExtraInfo.at("jEM") );
+}
+
 const TrigConf::L1ThrExtraInfo_eTAU &
 TrigConf::L1ThrExtraInfo::eTAU() const {
    return dynamic_cast<const TrigConf::L1ThrExtraInfo_eTAU&>( * m_thrExtraInfo.at("eTAU") );
@@ -120,11 +143,31 @@ TrigConf::L1ThrExtraInfo::jJ() const {
    return dynamic_cast<const TrigConf::L1ThrExtraInfo_jJ&>( * m_thrExtraInfo.at("jJ") );
 }
 
+const TrigConf::L1ThrExtraInfo_jLJ &
+TrigConf::L1ThrExtraInfo::jLJ() const {
+   return dynamic_cast<const TrigConf::L1ThrExtraInfo_jLJ&>( * m_thrExtraInfo.at("jLJ") );
+}
+
+const TrigConf::L1ThrExtraInfo_jXE &
+TrigConf::L1ThrExtraInfo::jXE() const {
+   return dynamic_cast<const TrigConf::L1ThrExtraInfo_jXE&>( * m_thrExtraInfo.at("jXE") );
+}
+
+const TrigConf::L1ThrExtraInfo_jTE &
+TrigConf::L1ThrExtraInfo::jTE() const {
+   return dynamic_cast<const TrigConf::L1ThrExtraInfo_jTE&>( * m_thrExtraInfo.at("jTE") );
+}
+
 const TrigConf::L1ThrExtraInfo_gXE &
 TrigConf::L1ThrExtraInfo::gXE() const {
    return dynamic_cast<const TrigConf::L1ThrExtraInfo_gXE&>( * m_thrExtraInfo.at("gXE") );
 }
 
+const TrigConf::L1ThrExtraInfo_gTE &
+TrigConf::L1ThrExtraInfo::gTE() const {
+   return dynamic_cast<const TrigConf::L1ThrExtraInfo_gTE&>( * m_thrExtraInfo.at("gTE") );
+}
+
 const TrigConf::L1ThrExtraInfo_MU &
 TrigConf::L1ThrExtraInfo::MU() const {
    return dynamic_cast<const TrigConf::L1ThrExtraInfo_MU&>( * m_thrExtraInfo.at("MU") );
@@ -259,6 +302,62 @@ TrigConf::L1ThrExtraInfo_eEM::load()
    }
 }
 
+/*******
+ * jEM
+ *******/
+TrigConf::L1ThrExtraInfo_jEM::WorkingPoints_jEM::WorkingPoints_jEM( const boost::property_tree::ptree & pt ) {
+   m_isDefined = true;
+   m_iso_d  = pt.get_optional<float>("iso").get_value_or(0);
+   m_frac_d = pt.get_optional<float>("frac").get_value_or(0);
+   m_frac2_d  = pt.get_optional<float>("frac2").get_value_or(0);
+   m_iso_fw  = pt.get_optional<int>("iso_fw").get_value_or(0);
+   m_frac_fw = pt.get_optional<int>("frac_fw").get_value_or(0);
+   m_frac2_fw  = pt.get_optional<int>("frac2_fw").get_value_or(0);
+   m_maxEt = pt.get_optional<unsigned int>("maxEt").get_value_or(0);
+}
+
+std::ostream &
+TrigConf::operator<<(std::ostream & os, const TrigConf::L1ThrExtraInfo_jEM::WorkingPoints_jEM & iso) {
+   os << "iso_fw=" << iso.iso_fw() << ", frac_fw=" << iso.frac_fw() << ", frac2_fw=" << iso.frac2_fw();
+   return os;
+}
+
+void
+TrigConf::L1ThrExtraInfo_jEM::load()
+{
+   for( auto & x : m_extraInfo ) {
+      if( x.first == "ptMinToTopo" ) {
+         for( auto & k : x.second.data() ) {
+            int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
+            int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
+            float value = k.second.get_optional<float>("value").get_value_or(0);
+            auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
+            m_ptMinToTopoMeV.addRangeValue( lround(1000*value),
+                                            etamin, etamax, priority, /*symmetric=*/ false);
+         }
+      } else if( x.first == "ptMinxTOB" ){
+         for( auto & k : x.second.data() ) {
+            int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
+            int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
+            float value = k.second.get_optional<float>("value").get_value_or(0);
+            auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
+            m_ptMinxTOBMeV.addRangeValue( lround(1000*value),
+                                            etamin, etamax, priority, /*symmetric=*/ false);
+         }
+      } else if( x.first == "workingPoints" ) {
+         for( auto & y : x.second.data() ) {
+            auto wp = Selection::stringToWP(y.first);
+            auto & iso = m_isolation.emplace(wp, string("jEM_WP_" + y.first)).first->second;
+            for(auto & c : y.second ) {
+               int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
+               int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
+               unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
+               iso.addRangeValue(WorkingPoints_jEM(c.second), etamin, etamax, priority, /*symmetric=*/ false);
+            }
+         }
+      }
+   }
+}
 
 /*******
  * eTAU
@@ -320,7 +419,23 @@ TrigConf::L1ThrExtraInfo_jTAU::load()
 {
    for( auto & x : m_extraInfo ) {
       if( x.first == "ptMinToTopo" ) {
-         m_ptMinToTopoMeV = lround(1000 * x.second.getValue<float>());
+         for( auto & k : x.second.data() ) {
+            int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
+            int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
+            float value = k.second.get_optional<float>("value").get_value_or(0);
+            auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
+            m_ptMinToTopoMeV.addRangeValue( lround(1000*value),
+                                            etamin, etamax, priority, /*symmetric=*/ false);
+         }
+      } else if( x.first == "ptMinxTOB" ){
+         for( auto & k : x.second.data() ) {
+            int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
+            int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
+            float value = k.second.get_optional<float>("value").get_value_or(0);
+            auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
+            m_ptMinxTOBMeV.addRangeValue( lround(1000*value),
+                                            etamin, etamax, priority, /*symmetric=*/ false);
+         }
       } else if( x.first == "workingPoints" ) {
          for( auto & y : x.second.data() ) {
             auto wp = TrigConf::Selection::stringToWP(y.first);
@@ -343,7 +458,6 @@ TrigConf::L1ThrExtraInfo_cTAU::WorkingPoints_cTAU::WorkingPoints_cTAU( const boo
    m_isDefined = true;
    m_isolation_d    = pt.get_optional<float>("isolation").get_value_or(0);
    m_isolation_fw   = pt.get_optional<float>("isolation_fw").get_value_or(0);
-   m_maxEt          = pt.get_optional<unsigned int>("maxEt").get_value_or(0);
 }
 
 std::ostream &
@@ -381,13 +495,72 @@ TrigConf::L1ThrExtraInfo_jJ::load()
    for( auto & x : m_extraInfo ) {
       if( x.first == "ptMinToTopo" ) {
          for( auto & k : x.second.data() ) {
-            auto etamin = k.second.get_child("etamin").get_value<unsigned int>();
-            auto etamax = k.second.get_child("etamax").get_value<unsigned int>();
-            auto value = k.second.get_child("value").get_value<float>();
+            int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
+            int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
+            float value = k.second.get_optional<float>("value").get_value_or(0);
             auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);            
             m_ptMinToTopoMeV.addRangeValue( lround(1000*value),
                                             etamin, etamax, priority, /*symmetric=*/ false);
          }
+      } else if( x.first == "ptMinxTOB" ){
+         for( auto & k : x.second.data() ) {
+            int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
+            int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
+            float value = k.second.get_optional<float>("value").get_value_or(0);
+            auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
+            m_ptMinxTOBMeV.addRangeValue( lround(1000*value),
+                                            etamin, etamax, priority, /*symmetric=*/ false);
+         }
+      }
+   }
+}
+
+/*******
+ * jLJ
+ *******/
+void
+TrigConf::L1ThrExtraInfo_jLJ::load()
+{
+   for( auto & x : m_extraInfo ) {
+      if( x.first == "ptMinToTopo" ) {
+         for( auto & k : x.second.data() ) {
+            int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
+            int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
+            float value = k.second.get_optional<float>("value").get_value_or(0);
+            auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
+            m_ptMinToTopoMeV.addRangeValue( lround(1000*value),
+                                            etamin, etamax, priority, /*symmetric=*/ false);
+         }
+      } else if( x.first == "ptMinxTOB" ){
+         for( auto & k : x.second.data() ) {
+            int etamin = k.second.get_optional<int>("etamin").get_value_or(-49);
+            int etamax = k.second.get_optional<int>("etamax").get_value_or(49);
+            float value = k.second.get_optional<float>("value").get_value_or(0);
+            auto priority = k.second.get_optional<unsigned int>("priority").get_value_or(0);
+            m_ptMinxTOBMeV.addRangeValue( lround(1000*value),
+                                            etamin, etamax, priority, /*symmetric=*/ false);
+         }
+      }
+   }
+}
+
+/*******
+ * jXE
+ *******/
+void
+TrigConf::L1ThrExtraInfo_jXE::load()
+{
+}
+
+/*******
+ * jTE
+ *******/
+void
+TrigConf::L1ThrExtraInfo_jTE::load()
+{
+   for( auto & x : m_extraInfo ) {
+      if( x.first == "etaBoundary" ) {
+         m_etaBoundary = x.second.getValue<unsigned int>();
       }
    }
 }
@@ -400,6 +573,14 @@ TrigConf::L1ThrExtraInfo_gXE::load()
 {
 }
 
+/*******
+ * gTE
+ *******/
+void
+TrigConf::L1ThrExtraInfo_gTE::load()
+{
+}
+
 /*******
  * MU
  *******/
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx
index aea3ab3e8c52..cde93187ac59 100644
--- a/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1Threshold.cxx
@@ -112,44 +112,70 @@ TrigConf::L1Threshold_ZB::load()
  *
  ******************************************/
 
-/**
- * eEM
- */
 void
 TrigConf::L1Threshold_eEM::load()
 {
    // read the isolation requirements
-   m_reta  = Selection::stringToWP(getAttribute("reta"));
-   m_rhad  = Selection::stringToWP(getAttribute("rhad"));
-   m_wstot = Selection::stringToWP(getAttribute("wstot"));
+   m_reta  = Selection::stringToWP(getAttribute_optional<std::string>("reta").value_or("None"));
+   m_rhad  = Selection::stringToWP(getAttribute_optional<std::string>("rhad").value_or("None"));
+   m_wstot = Selection::stringToWP(getAttribute_optional<std::string>("wstot").value_or("None"));
+}
+
+void
+TrigConf::L1Threshold_jEM::load()
+{
+   // read the isolation requirements
+   m_iso  = Selection::stringToWP(getAttribute_optional<std::string>("iso").value_or("None"));
+   m_frac  = Selection::stringToWP(getAttribute_optional<std::string>("frac").value_or("None"));
+   m_frac2 = Selection::stringToWP(getAttribute_optional<std::string>("frac2").value_or("None"));
 }
 
 void
 TrigConf::L1Threshold_eTAU::load()
 {
    // read the isolation requirements
-   m_isoConeRel  = Selection::stringToWP(getAttribute("isoConeRel"));
-   m_fEM  = Selection::stringToWP(getAttribute("fEM"));
+   m_isoConeRel  = Selection::stringToWP(getAttribute_optional<std::string>("isoConeRel").value_or("None"));
+   m_fEM  = Selection::stringToWP(getAttribute_optional<std::string>("fEM").value_or("None"));
 }
 
 void
 TrigConf::L1Threshold_jTAU::load()
 {
    // read the isolation requirements
-   m_isolation  = Selection::stringToWP(getAttribute("isolation"));
+   m_isolation  = Selection::stringToWP(getAttribute_optional<std::string>("isolation").value_or("None"));
 }
 
 void
 TrigConf::L1Threshold_cTAU::load()
 {
    // read the isolation requirements
-   m_isolation  = Selection::stringToWP(getAttribute("isolation"));
+   m_isolation  = Selection::stringToWP(getAttribute_optional<std::string>("isolation").value_or("None"));
 }
 
 void
 TrigConf::L1Threshold_jJ::load()
 {}
 
+void
+TrigConf::L1Threshold_jLJ::load()
+{}
+
+void
+TrigConf::L1Threshold_jXE::load()
+{}
+
+void
+TrigConf::L1Threshold_jTE::load()
+{}
+
+void
+TrigConf::L1Threshold_gXE::load()
+{}
+
+void
+TrigConf::L1Threshold_gTE::load()
+{}
+
 /******************************************
  *
  * Muon threshold
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx
index eab875b152b8..86eb2036ef07 100644
--- a/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx
@@ -49,6 +49,9 @@ TrigConf::L1Threshold::createThreshold( const std::string & name, const std::str
    if( type == "eEM" )
       return std::make_shared<L1Threshold_eEM>( name, type, extraInfo, data );
 
+   if( type == "jEM" )
+      return std::make_shared<L1Threshold_jEM>( name, type, extraInfo, data );
+
    if( type == "eTAU" )
       return std::make_shared<L1Threshold_eTAU>( name, type, extraInfo, data );
 
@@ -61,6 +64,21 @@ TrigConf::L1Threshold::createThreshold( const std::string & name, const std::str
    if( type == "jJ" )
       return std::make_shared<L1Threshold_jJ>( name, type, extraInfo, data );
 
+   if( type == "jLJ" )
+      return std::make_shared<L1Threshold_jLJ>( name, type, extraInfo, data );
+
+   if( type == "jXE" )
+      return std::make_shared<L1Threshold_jXE>( name, type, extraInfo, data );
+
+   if( type == "jTE" )
+      return std::make_shared<L1Threshold_jTE>( name, type, extraInfo, data );
+
+   if( type == "gXE" )
+      return std::make_shared<L1Threshold_gXE>( name, type, extraInfo, data );
+
+   if( type == "gTE" )
+      return std::make_shared<L1Threshold_gTE>( name, type, extraInfo, data );
+
    if( type == "MU" )
       return std::make_shared<L1Threshold_MU>( name, type, extraInfo, data );
 
@@ -76,12 +94,6 @@ TrigConf::L1Threshold::createThreshold( const std::string & name, const std::str
    if( type == "internal" )
       return std::make_shared<L1Threshold_internal>( name, type, extraInfo, data );
 
-   static const std::string caloBaseImp[] = { "gXE", "jXE" };
-   bool useCaloBaseClass = std::find(std::begin(caloBaseImp), std::end(caloBaseImp),type) != std::end(caloBaseImp);
-
-   if( useCaloBaseClass )
-      return std::make_shared<L1Threshold_Calo>( name, type, extraInfo, data );
-
    static const std::string noSpecialImp[] = { "JET", "XS", "TOPO", "MULTTOPO", "MUTOPO", "R2TOPO", "ALFA"};
    bool useBaseClass = std::find(std::begin(noSpecialImp), std::end(noSpecialImp),type) != std::end(noSpecialImp);
 
diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx
index aba8af7b3d3e..c28e898c12f8 100644
--- a/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx
+++ b/Trigger/TrigConfiguration/TrigConfData/src/L1TopoAlgorithm.cxx
@@ -45,9 +45,13 @@ TrigConf::L1TopoAlgorithm::load()
          m_outputs.push_back(o.getValue());
       }
    } else if( m_type == AlgorithmType::MULTIPLICITY ) { // MULTIPLICITY algo
+
       if(auto & input = getAttribute("input"); input!="null") {
          m_inputs.push_back(input);
       }
+      if(hasAttribute("flavour")){ // EnergyThreshold
+         m_parameters.emplace_back("flavour", TrigConf::XEFlavour::flavourStrToInt(getAttribute("flavour")));     
+      }
       m_outputs.push_back(getAttribute("output"));
    } else { // SORTING algo
       if( hasAttribute("input") ) {
diff --git a/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileWriterL1.cxx b/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileWriterL1.cxx
index 6557675a19ec..f4828ce3fcda 100644
--- a/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileWriterL1.cxx
+++ b/Trigger/TrigConfiguration/TrigConfIO/src/JsonFileWriterL1.cxx
@@ -168,6 +168,23 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
             }
          } catch(std::bad_cast&) {};
 
+         // jEM
+         try {
+            auto jEMThr = dynamic_cast<const TrigConf::L1Threshold_jEM &>(*thr);
+            jThr["iso"] = TrigConf::Selection::wpToString(jEMThr.iso());
+            jThr["frac"] = TrigConf::Selection::wpToString(jEMThr.frac());
+            jThr["frac2"] = TrigConf::Selection::wpToString(jEMThr.frac2());
+            jThr["thrValues"] = json::value_t::array;
+            for(auto & rv : jEMThr.thrValues()) {
+               json jRV({});
+               jRV["value"] = static_cast<unsigned int>(rv.value());
+               jRV["etamin"] = rv.etaMin();
+               jRV["etamax"] = rv.etaMax();
+               jRV["priority"] = rv.priority();
+               jThr["thrValues"] += jRV;
+            }
+         } catch(std::bad_cast&) {};
+
          // eTAU
          try {
             auto eTAUThr = dynamic_cast<const TrigConf::L1Threshold_eTAU &>(*thr);
@@ -193,16 +210,55 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
          // jJ
          try {
             auto jJThr = dynamic_cast<const TrigConf::L1Threshold_jJ &>(*thr);
-            jThr["ranges"] = json::array_t({});
+            jThr["thrValues"] = json::array_t({});
             for(auto & rv : jJThr.thrValues()) {
                json jRV({});
-               jThr["value"] = int(jJThr.thrValue(rv.etaMin()));
+               jRV["value"] = static_cast<unsigned int>(rv.value());
                jRV["etamin"] = rv.etaMin();
                jRV["etamax"] = rv.etaMax();
-               jThr["ranges"] += jRV;
+               jRV["priority"] = rv.priority();
+               jThr["thrValues"] += jRV;
             }
          } catch(std::bad_cast&) {};
 
+         // jLJ
+         try {
+            auto jLJThr = dynamic_cast<const TrigConf::L1Threshold_jLJ &>(*thr);
+            jThr["thrValues"] = json::array_t({});
+            for(auto & rv : jLJThr.thrValues()) {
+               json jRV({});
+               jRV["value"] = static_cast<unsigned int>(rv.value());
+               jRV["etamin"] = rv.etaMin();
+               jRV["etamax"] = rv.etaMax();
+               jRV["priority"] = rv.priority();
+               jThr["thrValues"] += jRV;
+            }
+         } catch(std::bad_cast&) {};
+
+         // jXE
+         try {
+            auto jXEThr = dynamic_cast<const TrigConf::L1Threshold_jXE &>(*thr);
+            jThr["value"] = int(jXEThr.thrValue());
+         } catch(std::bad_cast&) {};
+
+         // jTE
+         try {
+            auto jTEThr = dynamic_cast<const TrigConf::L1Threshold_jTE &>(*thr);
+            jThr["value"] = int(jTEThr.thrValue());
+         } catch(std::bad_cast&) {};         
+         
+         // gXE
+         try {
+            auto gXEThr = dynamic_cast<const TrigConf::L1Threshold_gXE &>(*thr);
+            jThr["value"] = int(gXEThr.thrValue());
+         } catch(std::bad_cast&) {};         
+
+         // gTE
+         try {
+            auto gTEThr = dynamic_cast<const TrigConf::L1Threshold_gTE &>(*thr);
+            jThr["value"] = int(gTEThr.thrValue());
+         } catch(std::bad_cast&) {};
+
          jThresholsByType[thr->name()] = jThr;
       };
       json jThrType({});
@@ -331,6 +387,44 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
          }
       }
 
+      if(thrType == "jEM") {
+         auto & jeminfo = l1menu.thrExtraInfo().jEM();
+         jThrType["ptMinToTopo"] = json::array_t({});
+         for(auto & x : jeminfo.ptMinToTopoEtaMeV() ) {
+            jThrType["ptMinToTopo"] += json({
+                  {"etamin",x.etaMin()},
+                  {"etamax",x.etaMax()},
+                  {"value",int(x.value()/1000.)},
+               });
+         }
+         jThrType["ptMinxTOB"] = json::array_t({});
+         for(auto & x : jeminfo.ptMinxTOBEtaMeV() ) {
+            jThrType["ptMinxTOB"] += json({
+                  {"etamin",x.etaMin()},
+                  {"etamax",x.etaMax()},
+                  {"value",int(x.value()/1000.)},
+               });
+         }
+         for( auto wp : {TrigConf::Selection::WP::LOOSE, TrigConf::Selection::WP::MEDIUM, TrigConf::Selection::WP::TIGHT} ) {
+            auto wpstr = TrigConf::Selection::wpToString(wp);
+            jThrType["workingPoints"][wpstr] = json::array_t({});
+            for(auto & iso : jeminfo.isolation(wp)) {
+               json jWPIso({});
+               jWPIso["iso"] = iso.value().iso_d();
+               jWPIso["iso_fw"] = iso.value().iso_fw();
+               jWPIso["frac"] = iso.value().frac_d();
+               jWPIso["frac_fw"] = iso.value().frac_fw();
+               jWPIso["frac2"] = iso.value().frac2_d();
+               jWPIso["frac2_fw"] = iso.value().frac2_fw();
+               jWPIso["etamin"] = iso.etaMin();
+               jWPIso["etamax"] = iso.etaMax();
+               jWPIso["priority"] = iso.priority();
+               jWPIso["maxEt"] = iso.value().maxEt();
+               jThrType["workingPoints"][wpstr] += jWPIso;
+            }
+         }
+      }
+
       if(thrType == "eTAU") {
          auto & eeminfo = l1menu.thrExtraInfo().eTAU();
          for( auto wp : {TrigConf::Selection::WP::LOOSE, TrigConf::Selection::WP::MEDIUM, TrigConf::Selection::WP::TIGHT, TrigConf::Selection::WP::HAD} ) {
@@ -349,11 +443,27 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
       }
 
       if(thrType == "jTAU") {
-         auto & eeminfo = l1menu.thrExtraInfo().jTAU();
+         auto & jtauinfo = l1menu.thrExtraInfo().jTAU();
+         jThrType["ptMinToTopo"] = json::array_t({});
+         for(auto & x : jtauinfo.ptMinToTopoEtaMeV() ) {
+            jThrType["ptMinToTopo"] += json({
+                  {"etamin",x.etaMin()},
+                  {"etamax",x.etaMax()},
+                  {"value",int(x.value()/1000.)},
+               });
+         }
+         jThrType["ptMinxTOB"] = json::array_t({});
+         for(auto & x : jtauinfo.ptMinxTOBEtaMeV() ) {
+            jThrType["ptMinxTOB"] += json({
+                  {"etamin",x.etaMin()},
+                  {"etamax",x.etaMax()},
+                  {"value",int(x.value()/1000.)},
+               });
+         }
          for( auto wp : {TrigConf::Selection::WP::LOOSE, TrigConf::Selection::WP::MEDIUM, TrigConf::Selection::WP::TIGHT} ) {
             auto wpstr = TrigConf::Selection::wpToString(wp);
             jThrType["workingPoints"][wpstr] = json::array_t({});
-            for(auto & iso : eeminfo.isolation(wp)) {
+            for(auto & iso : jtauinfo.isolation(wp)) {
                json jWPIso({});
                jWPIso["isolation"] = iso.value().isolation_d();
                jWPIso["isolation_fw"] = iso.value().isolation_fw();
@@ -372,7 +482,6 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
                json jWPIso({});
                jWPIso["isolation"] = iso.value().isolation_d();
                jWPIso["isolation_fw"] = iso.value().isolation_fw();
-               jWPIso["maxEt"] = iso.value().maxEt();
                jThrType["workingPoints"][wpstr] += jWPIso;
             }
          }
@@ -388,6 +497,51 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
                   {"value",int(x.value()/1000.)},
                });
          }
+         jThrType["ptMinxTOB"] = json::array_t({});
+         for(auto & x : ei.ptMinxTOBEtaMeV() ) {
+            jThrType["ptMinxTOB"] += json({
+                  {"etamin",x.etaMin()},
+                  {"etamax",x.etaMax()},
+                  {"value",int(x.value()/1000.)},
+               });
+         }
+      }
+
+      if(thrType == "jLJ") {
+         auto & ei = l1menu.thrExtraInfo().jLJ();
+         jThrType["ptMinToTopo"] = json::array_t({});
+         for(auto & x : ei.ptMinToTopoEtaMeV() ) {
+            jThrType["ptMinToTopo"] += json({
+                  {"etamin",x.etaMin()},
+                  {"etamax",x.etaMax()},
+                  {"value",int(x.value()/1000.)},
+               });
+         }
+         jThrType["ptMinxTOB"] = json::array_t({});
+         for(auto & x : ei.ptMinxTOBEtaMeV() ) {
+            jThrType["ptMinxTOB"] += json({
+                  {"etamin",x.etaMin()},
+                  {"etamax",x.etaMax()},
+                  {"value",int(x.value()/1000.)},
+               });
+         }
+      }
+
+      if(thrType == "jXE") {
+          // nothing to do for now...
+      }
+
+      if(thrType == "jTE") {
+         auto & ei = l1menu.thrExtraInfo().jTE();
+         jThrType["etaBoundary"] = ei.etaBoundary();   
+      }
+
+      if(thrType == "gXE") {
+          // nothing to do for now...
+      }
+
+      if(thrType == "gTE") {
+          // nothing to do for now...
       }
 
       std::vector<std::string> legacyCalo = {"EM", "JET", "TAU", "XE", "TE", "XS", "ZB", "JB", "JF", "JE", "R2TOPO"};
@@ -512,6 +666,11 @@ TrigConf::JsonFileWriterL1::writeJsonFile(const std::string & filename, const L1
             if(topoCat == "MULTTOPO") {
                jalg["nbits"] = alg.getAttribute<unsigned int>("nbits");
                jalg["threshold"] = alg.getAttribute("threshold");
+               if(alg.klass()=="EnergyThreshold"){
+                  for(const L1TopoAlgorithm::VariableParameter & vpar : alg.parameters()) { 
+                     if(vpar.name()=="flavour") jalg["flavour"] = XEFlavour::flavourIntToStr(vpar.value());
+                  }
+               }
             } else {
                auto ds = alg.generics();
                for(auto & gpname : ds.getKeys()) {
diff --git a/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx b/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx
index 6c6e3aa6b47a..76738b13f9eb 100644
--- a/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx
+++ b/Trigger/TrigConfiguration/TrigConfIO/utils/TestTriggerMenuAccess.cxx
@@ -271,8 +271,11 @@ testL1Menu_Thresholds(const TrigConf::L1Menu & l1menu, bool printdetail)
       cout << "   value at eta = " << eta << ": " << thrTERR.thrValue(eta) << " GeV, " << thrTERR.thrValueMeV(eta) << " MeV, " << thrTERR.thrValueCounts(eta) << " counts" << endl;
    }
 
-   const auto & threEM = dynamic_cast<const TrigConf::L1Threshold_eEM&>(l1menu.threshold("eEM18VHI"));
-   cout << "eEM18VHI isolation: rhad = " << (int)threEM.rhad() << ", reta = " << (int)threEM.reta() << ", wstot = " << (int)threEM.wstot() << endl;
+   const auto & threEM = dynamic_cast<const TrigConf::L1Threshold_eEM&>(l1menu.threshold("eEM18M"));
+   cout << "eEM18M isolation: rhad = " << (int)threEM.rhad() << ", reta = " << (int)threEM.reta() << ", wstot = " << (int)threEM.wstot() << endl;
+
+   const auto & thrjEM = dynamic_cast<const TrigConf::L1Threshold_jEM&>(l1menu.threshold("jEM18M"));
+   cout << "jEM18M isolation: iso = " << (int)thrjEM.iso() << ", frac = " << (int)thrjEM.frac() << ", frac2 = " << (int)thrjEM.frac2() << endl;
 
    const auto & thrMU10 = dynamic_cast<const TrigConf::L1Threshold_MU&>(l1menu.threshold("MU10"));
    cout << "Threshold MU10 with "
@@ -364,13 +367,58 @@ testL1Menu_Extrainfo(const TrigConf::L1Menu & l1menu)
       //cout << "    working point Medium at eta = -20:" << ex.isolation(TrigConf::Selection::WP::MEDIUM,-20) << endl;
       cout << "    working point Medium at eta = 20:" << ex.isolation(TrigConf::Selection::WP::LOOSE,20) << endl;
    }
+   {
+      auto & ex = l1menu.thrExtraInfo().jEM();
+      cout << "  jEM" << endl;
+      cout << "    energy resolution (MeV) " << ex.resolutionMeV() << endl;
+      cout << "    ptMinToTopo " << ex.ptMinToTopo() << endl;
+      cout << "    ptMinToTopo (MeV) " << ex.ptMinToTopoMeV() << endl;
+      cout << "    ptMinToTopo (counts)" << ex.ptMinToTopoCounts() << endl;
+      cout << "    ptMinxTOB " << ex.ptMinxTOB() << endl;
+      cout << "    ptMinxTOB (MeV) " << ex.ptMinxTOBMeV() << endl;
+      cout << "    ptMinxTOB (counts) " << ex.ptMinxTOBCounts() << endl;
+      cout << "    working point Loose" << endl;
+      for(auto & iso : ex.isolation(TrigConf::Selection::WP::LOOSE)) {
+         cout << "      range etaMin=" << iso.etaMin() << ", etaMax=" << iso.etaMax()
+              << ", priority=" << iso.priority() << ", symmetric=" << (iso.symmetric() ? "yes" : "no")
+              << ", isolation=" << iso.value() << endl;
+      }
+      cout << "    working point Medium" << endl;
+      for(auto & iso : ex.isolation(TrigConf::Selection::WP::MEDIUM)) {
+         cout << "      range etaMin=" << iso.etaMin() << ", etaMax=" << iso.etaMax()
+              << ", priority=" << iso.priority() << ", symmetric=" << (iso.symmetric() ? "yes" : "no")
+              << ", isolation=" << iso.value() << endl;
+      }
+      cout << "    working point Tight" << endl;
+      for(auto & iso : ex.isolation(TrigConf::Selection::WP::TIGHT)) {
+         cout << "      range etaMin=" << iso.etaMin() << ", etaMax=" << iso.etaMax()
+              << ", priority=" << iso.priority() << ", symmetric=" << (iso.symmetric() ? "yes" : "no")
+              << ", isolation=" << iso.value() << endl;
+      }
+      //cout << "    working point Medium at eta = -20:" << ex.isolation(TrigConf::Selection::WP::MEDIUM,-20) << endl;
+      cout << "    working point Medium at eta = 20:" << ex.isolation(TrigConf::Selection::WP::LOOSE,20) << endl;
+   }
    {
       auto & ex = l1menu.thrExtraInfo().jJ();
       cout << "  jJ" << endl;
       cout << "    energy resolution (MeV) " << ex.resolutionMeV() << endl;
-      cout << "    ptMinToTopoWindow " << ex.ptMinToTopo() << endl;
-      cout << "    ptMinToTopoWindow (MeV) " << ex.ptMinToTopoMeV() << endl;
-      cout << "    ptMinToTopoWindow (counts) " << ex.ptMinToTopoCounts() << endl;
+      cout << "    ptMinToTopo " << ex.ptMinToTopo() << endl;
+      cout << "    ptMinToTopo (MeV) " << ex.ptMinToTopoMeV() << endl;
+      cout << "    ptMinToTopo (counts) " << ex.ptMinToTopoCounts() << endl;
+      cout << "    ptMinxTOB " << ex.ptMinxTOB() << endl;
+      cout << "    ptMinxTOB (MeV) " << ex.ptMinxTOBMeV() << endl;
+      cout << "    ptMinxTOB (counts) " << ex.ptMinxTOBCounts() << endl;
+   }
+   {
+      auto & ex = l1menu.thrExtraInfo().jLJ();
+      cout << "  jLJ" << endl;
+      cout << "    energy resolution (MeV) " << ex.resolutionMeV() << endl;
+      cout << "    ptMinToTopo " << ex.ptMinToTopo() << endl;
+      cout << "    ptMinToTopo (MeV) " << ex.ptMinToTopoMeV() << endl;
+      cout << "    ptMinToTopo (counts) " << ex.ptMinToTopoCounts() << endl;
+      cout << "    ptMinxTOB " << ex.ptMinxTOB() << endl;
+      cout << "    ptMinxTOB (MeV) " << ex.ptMinxTOBMeV() << endl;
+      cout << "    ptMinxTOB (counts) " << ex.ptMinxTOBCounts() << endl;
    }
    {
       auto & ex = l1menu.thrExtraInfo().eTAU();
@@ -411,6 +459,9 @@ testL1Menu_Extrainfo(const TrigConf::L1Menu & l1menu)
       cout << "    ptMinToTopo " << ex.ptMinToTopo() << endl;
       cout << "    ptMinToTopo (MeV) " << ex.ptMinToTopoMeV() << endl;
       cout << "    ptMinToTopo (counts)" << ex.ptMinToTopoCounts() << endl;
+      cout << "    ptMinxTOB " << ex.ptMinxTOB() << endl;
+      cout << "    ptMinxTOB (MeV) " << ex.ptMinxTOBMeV() << endl;
+      cout << "    ptMinxTOB (counts) " << ex.ptMinxTOBCounts() << endl;
       cout << "    working point Loose" << endl;
       for(auto & iso : ex.isolation(TrigConf::Selection::WP::LOOSE)) {
          cout << "      range etaMin=" << iso.etaMin() << ", etaMax=" << iso.etaMax()
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx
index b6c5b3316a91..ed5ac5ee07bf 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jFEXFPGA.cxx
@@ -665,8 +665,8 @@ uint32_t jFEXFPGA::formLargeRJetTOB(int &iphi, int &ieta)
 
   // Retrieve the L1 menu configuration
   SG::ReadHandle<TrigConf::L1Menu> l1Menu (m_l1MenuKey/*, ctx*/);
-  auto & thr_jJ = l1Menu->thrExtraInfo().jJ();
-  unsigned int minEtThreshold = thr_jJ.ptMinToTopoMeV()/jFEXETResolution;
+  auto & thr_jLJ = l1Menu->thrExtraInfo().jLJ();
+  unsigned int minEtThreshold = thr_jLJ.ptMinToTopoMeV()/jFEXETResolution;
 
   //unsigned int minEtThreshold = 60;
   if (jFEXLargeRJetTOBEt < minEtThreshold) return 0;
diff --git a/Trigger/TrigT1/TrigT1CTP/src/CTPSimulation.cxx b/Trigger/TrigT1/TrigT1CTP/src/CTPSimulation.cxx
index ff03f73a045b..71517ffe04f1 100644
--- a/Trigger/TrigT1/TrigT1CTP/src/CTPSimulation.cxx
+++ b/Trigger/TrigT1/TrigT1CTP/src/CTPSimulation.cxx
@@ -136,11 +136,11 @@ LVL1CTP::CTPSimulation::createMultiplicityHist(const std::string & type, unsigne
    StatusCode sc;
    std::map<std::string,std::vector<std::string>> typeMapping = {
       { "muon", {"MU"} },
-      { "jet", {"JET", "jJ", "gJ"} },
+      { "jet", {"JET", "jJ", "jLJ", "gJ"} },
       { "xe", {"XE", "gXE", "jXE"} },
-      { "te", {"TE"} },
+      { "te", {"TE", "jTE", "gTE"} },
       { "xs", {"XS"} },
-      { "em", {"EM", "eEM"} },
+      { "em", {"EM", "eEM", "jEM"} },
       { "tau", {"TAU", "eTAU", "jTAU", "cTAU"} }
    };
    std::vector<TrigConf::L1Threshold> thrV;
@@ -159,11 +159,11 @@ LVL1CTP::CTPSimulation::setMultiplicityHistLabels(const TrigConf::L1Menu& l1menu
    StatusCode sc;
    std::map<std::string,std::vector<std::string>> typeMapping = {
       { "muon", {"MU"} },
-      { "jet", {"JET", "jJ", "gJ"} },
+      { "jet", {"JET", "jJ", "jLJ", "gJ"} },
       { "xe", {"XE", "gXE", "jXE"} },
-      { "te", {"TE"} },
+      { "te", {"TE", "jTE", "gTE"} },
       { "xs", {"XS"} },
-      { "em", {"EM", "eEM"} },
+      { "em", {"EM", "eEM", "jEM"} },
       { "tau", {"TAU", "eTAU", "jTAU", "cTAU"} }
    };
 
@@ -954,12 +954,16 @@ LVL1CTP::CTPSimulation::calculateTopoOptMultiplicity( const TrigConf::L1Threshol
   std::string subfolder = "";
   if (confThr.type().find("XE") != std::string::npos) {
     subfolder = "xe";
+  } else if (confThr.type().find("TE") != std::string::npos) {
+    subfolder = "te";
   } else if (confThr.type().find("TAU") != std::string::npos) {
     subfolder = "tau";
   } else if (confThr.type().find("EM") != std::string::npos) {
     subfolder = "em";
   } else if (confThr.type().find("jJ") != std::string::npos) {
     subfolder = "jet";
+  } else if (confThr.type().find("jLJ") != std::string::npos) {
+    subfolder = "jet";
   } else if (confThr.type().find("gJ") != std::string::npos) {
     subfolder = "jet";
   }
@@ -1152,7 +1156,7 @@ LVL1CTP::CTPSimulation::finalize() {
    {
       // run 3 thresholds
       auto hist = * get2DHist( "/multi/all/R3Mult" );
-      std::vector<std::string> thrHists = { "em/eEM", "muon/MU", "tau/eTAU", "tau/jTAU", "tau/cTAU", "jet/jJ", "jet/gJ", "xe/gXE", "xe/jXE" };
+      std::vector<std::string> thrHists = { "em/eEM", "em/jEM", "muon/MU", "tau/eTAU", "tau/jTAU", "tau/cTAU", "jet/jJ", "jet/jLJ", "jet/gJ", "xe/gXE", "xe/jXE", "te/jTE", "te/gTE" };
       for(const std::string & histpath : thrHists) {
          auto h = * get2DHist( "/multi/" + histpath + "Mult" );
          auto xaxis = h->GetXaxis();
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 59d441b65546..32486a8f02f8 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -9735,10 +9735,110 @@ HLT_noalg_L1eTAU60:
   eventCount: 0
 HLT_noalg_L1eTAU8:
   eventCount: 0
+HLT_noalg_L1gTE50:
+  eventCount: 0
+HLT_noalg_L1gXE30:
+  eventCount: 0
+HLT_noalg_L1gXE40:
+  eventCount: 0
+HLT_noalg_L1gXE50:
+  eventCount: 0
+HLT_noalg_L1gXEPUFIT30:
+  eventCount: 0
+HLT_noalg_L1gXEPUFIT50:
+  eventCount: 0
+HLT_noalg_L1gXERHO30:
+  eventCount: 0
+HLT_noalg_L1gXERHO50:
+  eventCount: 0
+HLT_noalg_L1jEM15:
+  eventCount: 0
+HLT_noalg_L1jEM15M:
+  eventCount: 0
+HLT_noalg_L1jEM18M:
+  eventCount: 0
+HLT_noalg_L1jJ100:
+  eventCount: 0
+HLT_noalg_L1jJ12:
+  eventCount: 0
+HLT_noalg_L1jJ120:
+  eventCount: 0
+HLT_noalg_L1jJ12p0ETA25:
+  eventCount: 0
+HLT_noalg_L1jJ15:
+  eventCount: 0
+HLT_noalg_L1jJ15p0ETA25:
+  eventCount: 0
+HLT_noalg_L1jJ15p31ETA49:
+  eventCount: 0
+HLT_noalg_L1jJ20:
+  eventCount: 0
+HLT_noalg_L1jJ20p31ETA49:
+  eventCount: 0
+HLT_noalg_L1jJ25:
+  eventCount: 0
+HLT_noalg_L1jJ25p0ETA23:
+  eventCount: 0
+HLT_noalg_L1jJ30:
+  eventCount: 0
+HLT_noalg_L1jJ30p31ETA49:
+  eventCount: 0
+HLT_noalg_L1jJ35p0ETA23:
+  eventCount: 0
+HLT_noalg_L1jJ40:
+  eventCount: 0
+HLT_noalg_L1jJ400:
+  eventCount: 0
+HLT_noalg_L1jJ40p0ETA25:
+  eventCount: 0
+HLT_noalg_L1jJ45p0ETA20:
+  eventCount: 0
+HLT_noalg_L1jJ50:
+  eventCount: 0
+HLT_noalg_L1jJ50p31ETA49:
+  eventCount: 0
+HLT_noalg_L1jJ75:
+  eventCount: 0
+HLT_noalg_L1jJ75p31ETA49:
+  eventCount: 0
+HLT_noalg_L1jJ85:
+  eventCount: 0
+HLT_noalg_L1jLJ100:
+  eventCount: 0
+HLT_noalg_L1jLJ140:
+  eventCount: 0
+HLT_noalg_L1jLJ160:
+  eventCount: 0
+HLT_noalg_L1jLJ80:
+  eventCount: 0
 HLT_noalg_L1jTAU12:
   eventCount: 0
 HLT_noalg_L1jTAU12M:
   eventCount: 0
+HLT_noalg_L1jTE100:
+  eventCount: 0
+HLT_noalg_L1jTEC100:
+  eventCount: 0
+HLT_noalg_L1jTEFWD100:
+  eventCount: 0
+HLT_noalg_L1jTEFWDA100:
+  eventCount: 0
+HLT_noalg_L1jTEFWDC100:
+  eventCount: 0
+HLT_noalg_L1jXE30:
+  eventCount: 0
+HLT_noalg_L1jXE300:
+  eventCount: 0
+HLT_noalg_L1jXE35:
+  eventCount: 0
+HLT_noalg_L1jXE40:
+  eventCount: 0
+HLT_noalg_L1jXE50:
+  eventCount: 0
+HLT_noalg_L1jXE55:
+  eventCount: 0
+HLT_noalg_L1jXEC50:
+  eventCount: 0
 HLT_noalg_LArPEBCalib_L1LAR-ZEE:
   eventCount: 1
   stepCounts:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 08f501b6807f..5f78dd2e6835 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -3913,10 +3913,110 @@ HLT_noalg_L1eTAU60:
   eventCount: 0
 HLT_noalg_L1eTAU8:
   eventCount: 0
+HLT_noalg_L1gTE50:
+  eventCount: 0
+HLT_noalg_L1gXE30:
+  eventCount: 0
+HLT_noalg_L1gXE40:
+  eventCount: 0
+HLT_noalg_L1gXE50:
+  eventCount: 0
+HLT_noalg_L1gXEPUFIT30:
+  eventCount: 0
+HLT_noalg_L1gXEPUFIT50:
+  eventCount: 0
+HLT_noalg_L1gXERHO30:
+  eventCount: 0
+HLT_noalg_L1gXERHO50:
+  eventCount: 0
+HLT_noalg_L1jEM15:
+  eventCount: 0
+HLT_noalg_L1jEM15M:
+  eventCount: 0
+HLT_noalg_L1jEM18M:
+  eventCount: 0
+HLT_noalg_L1jJ100:
+  eventCount: 0
+HLT_noalg_L1jJ12:
+  eventCount: 0
+HLT_noalg_L1jJ120:
+  eventCount: 0
+HLT_noalg_L1jJ12p0ETA25:
+  eventCount: 0
+HLT_noalg_L1jJ15:
+  eventCount: 0
+HLT_noalg_L1jJ15p0ETA25:
+  eventCount: 0
+HLT_noalg_L1jJ15p31ETA49:
+  eventCount: 0
+HLT_noalg_L1jJ20:
+  eventCount: 0
+HLT_noalg_L1jJ20p31ETA49:
+  eventCount: 0
+HLT_noalg_L1jJ25:
+  eventCount: 0
+HLT_noalg_L1jJ25p0ETA23:
+  eventCount: 0
+HLT_noalg_L1jJ30:
+  eventCount: 0
+HLT_noalg_L1jJ30p31ETA49:
+  eventCount: 0
+HLT_noalg_L1jJ35p0ETA23:
+  eventCount: 0
+HLT_noalg_L1jJ40:
+  eventCount: 0
+HLT_noalg_L1jJ400:
+  eventCount: 0
+HLT_noalg_L1jJ40p0ETA25:
+  eventCount: 0
+HLT_noalg_L1jJ45p0ETA20:
+  eventCount: 0
+HLT_noalg_L1jJ50:
+  eventCount: 0
+HLT_noalg_L1jJ50p31ETA49:
+  eventCount: 0
+HLT_noalg_L1jJ75:
+  eventCount: 0
+HLT_noalg_L1jJ75p31ETA49:
+  eventCount: 0
+HLT_noalg_L1jJ85:
+  eventCount: 0
+HLT_noalg_L1jLJ100:
+  eventCount: 0
+HLT_noalg_L1jLJ140:
+  eventCount: 0
+HLT_noalg_L1jLJ160:
+  eventCount: 0
+HLT_noalg_L1jLJ80:
+  eventCount: 0
 HLT_noalg_L1jTAU12:
   eventCount: 0
 HLT_noalg_L1jTAU12M:
   eventCount: 0
+HLT_noalg_L1jTE100:
+  eventCount: 0
+HLT_noalg_L1jTEC100:
+  eventCount: 0
+HLT_noalg_L1jTEFWD100:
+  eventCount: 0
+HLT_noalg_L1jTEFWDA100:
+  eventCount: 0
+HLT_noalg_L1jTEFWDC100:
+  eventCount: 0
+HLT_noalg_L1jXE30:
+  eventCount: 0
+HLT_noalg_L1jXE300:
+  eventCount: 0
+HLT_noalg_L1jXE35:
+  eventCount: 0
+HLT_noalg_L1jXE40:
+  eventCount: 0
+HLT_noalg_L1jXE50:
+  eventCount: 0
+HLT_noalg_L1jXE55:
+  eventCount: 0
+HLT_noalg_L1jXEC50:
+  eventCount: 0
 HLT_noalg_LArPEBCalib_L1LAR-ZEE:
   eventCount: 0
 HLT_noalg_LArPEBCalib_L1RD0_BGRP11:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 6dcce746293d..721ddf44c6ac 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -53,6 +53,8 @@ from TriggerMenuMT.HLTMenuConfig.Menu.Physics_pp_run3_v1 import (PhysicsStream,
                                                                  UnconvTrkGroup,
                                                                  TauPhaseIStreamersGroup,
                                                                  EgammaPhaseIStreamersGroup,  
+                                                                 JetPhaseIStreamersGroup,
+                                                                 METPhaseIStreamersGroup,
                                                                  )
 
 def setupMenu():
@@ -1321,29 +1323,60 @@ def setupMenu():
         ChainProp(name='HLT_noalg_L1eEM22M',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=EgammaPhaseIStreamersGroup),
         ChainProp(name='HLT_noalg_L1eEM22T',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=EgammaPhaseIStreamersGroup),
 
-        #ChainProp(name='HLT_noalg_L1jJ12',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ120pETA25',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ15',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ15p0ETA25',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ15p31ETA49',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ20',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ20p31ETA49',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ25',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ25p0ETA23',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ30',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ30p31ETA49',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ35p0ETA23',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ40',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ40p0ETA25',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ45p0ETA20',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ50',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ50p31ETA49',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ75',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ75p31ETA49',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ85',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ100',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ120',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
-        #ChainProp(name='HLT_noalg_L1jJ400',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup+PrimaryPhIGroup),
+        ChainProp(name='HLT_noalg_L1jEM15',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=EgammaPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jEM15M',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=EgammaPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jEM18M',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=EgammaPhaseIStreamersGroup),
+
+        ChainProp(name='HLT_noalg_L1jJ12',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ12p0ETA25',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ15',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ15p0ETA25',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ15p31ETA49',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ20',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ20p31ETA49',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ25',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ25p0ETA23',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ30',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ30p31ETA49',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ35p0ETA23',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ40',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ40p0ETA25',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ45p0ETA20',   l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ50',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ50p31ETA49',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ75',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ75p31ETA49',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ85',          l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ100',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ120',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jJ400',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup+PrimaryPhIGroup),
+
+        ChainProp(name='HLT_noalg_L1jLJ80',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jLJ100',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jLJ140',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jLJ160',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetPhaseIStreamersGroup),
+
+        ChainProp(name='HLT_noalg_L1jXE30',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jXE35',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jXE40',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jXE50',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jXE55',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jXE300',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1gXE30',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1gXE40',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1gXE50',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1gXERHO30',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1gXERHO50',      l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1gXEPUFIT30',    l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1gXEPUFIT50',    l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+
+        ChainProp(name='HLT_noalg_L1jXEC50',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1gTE50',         l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jTE100',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jTEC100',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jTEFWD100',     l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jTEFWDA100',    l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+        ChainProp(name='HLT_noalg_L1jTEFWDC100',    l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
 
     ]
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
index 6a02ae1e840f..d0d66e88bca1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/Physics_pp_run3_v1.py
@@ -46,8 +46,9 @@ EgammaPhaseIStreamersGroup = ['RATE:PhaseISeededStreamers', 'BW:Egamma']
 TauStreamersGroup = ['RATE:SeededStreamers', 'BW:Tau']
 TauPhaseIStreamersGroup = ['RATE:PhaseISeededStreamers', 'BW:Tau']
 JetStreamersGroup = ['RATE:SeededStreamers', 'BW:Jet']
-JetPhaseIStreamersGroup = ['RATE:SeededStreamers', 'BW:Jet']
+JetPhaseIStreamersGroup = ['RATE:PhaseISeededStreamers', 'BW:Jet']
 METStreamersGroup = ['RATE:SeededStreamers', 'BW:MET']
+METPhaseIStreamersGroup = ['RATE:PhaseISeededStreamers', 'BW:MET']
 BCIDmonGroup = ['MON:BCID']
 # For chains seeded by L1 muon (no calo items)
 PrimaryL1MuGroup = ['Primary:L1Muon']
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py
index 3e896623e5d8..8b1809ef7a4e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1Menu.py
@@ -132,10 +132,10 @@ class L1Menu(object):
         boardName = connDefName+fpgaName
 
         allowedInputs = odict()
-        allowedInputs['Topo1Opt0'] = ['MU', 'eEM', 'eTAU',              'g', ] # TOPO1A, FPGA1
-        allowedInputs['Topo1Opt1'] = ['MU', 'eEM', 'eTAU',              'g', ] # TOPO1A, FPGA2
-        allowedInputs['Topo1Opt2'] = ['MU',        'eTAU', 'cTAU', 'j', 'g', ] # TOPO1B, FPGA1
-        allowedInputs['Topo1Opt3'] = ['MU',        'eTAU', 'cTAU', 'j', 'g', ] # TOPO1B, FPGA2
+        allowedInputs['Topo1Opt0'] = ['MU', 'eEM', 'eTAU',              'gJ',  'gLJ',               ] # TOPO1A, FPGA1
+        allowedInputs['Topo1Opt1'] = ['MU', 'eEM', 'eTAU',              'gJ',  'gLJ',               ] # TOPO1A, FPGA2
+        allowedInputs['Topo1Opt2'] = ['MU',        'eTAU', 'cTAU', 'j',               'gXE', 'gTE', ] # TOPO1B, FPGA1
+        allowedInputs['Topo1Opt3'] = ['MU',        'eTAU', 'cTAU', 'j',               'gXE', 'gTE', ] # TOPO1B, FPGA2
         allowedInputs['Topo2El0']  = ['MU',        'eTAU',         'j',      ] # TOPO2, FPGA1
         allowedInputs['Topo2El1']  = [      'eEM',                 'j',      ] # TOPO2, FPGA2
         allowedInputs['Topo3El0']  = [      'eEM', 'eTAU',         'j',      ] # TOPO3, FPGA1
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/ThresholdType.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/ThresholdType.py
index f83603e50a09..9e8311a8fa4d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/ThresholdType.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/ThresholdType.py
@@ -12,7 +12,7 @@ class ThrType( Enum ):
 
     # run 3 calo and muon thresholds
     # cTau is the combined taus computed in the L1Topo multiplicity board matching eTAU and jTAU
-    eEM = 1; eTAU = 2; jTAU = 3; cTAU=4; jJ = 5; gJ = 6; gXE = 7; jXE = 8; MU = 9 # noqa: E702
+    eEM = 1; jEM = 2; eTAU = 3; jTAU = 4; cTAU=5; jJ = 6; jLJ = 7; gJ = 8; gXE = 9; gTE = 10; jXE = 11; jTE = 12; MU = 13 # noqa: E702
 
     # NIM thresholds
     BCM = 21; BCMCMB = 22; LUCID = 23; ZDC = 24; BPTX = 25; CALREQ = 26; MBTS = 27; MBTSSI = 28; NIM = 29 # noqa: E702
@@ -35,7 +35,7 @@ class ThrType( Enum ):
     
     @staticmethod
     def Run3Types():
-        return [ ThrType.MU, ThrType.eEM, ThrType.eTAU, ThrType.jTAU, ThrType.cTAU, ThrType.jJ, ThrType.gJ, ThrType.gXE, ThrType.jXE ]
+        return [ ThrType.MU, ThrType.eEM, ThrType.jEM, ThrType.eTAU, ThrType.jTAU, ThrType.cTAU, ThrType.jJ, ThrType.jLJ, ThrType.gJ, ThrType.gXE, ThrType.gTE, ThrType.jXE, ThrType.jTE ]
     
     @staticmethod
     def NIMTypes():
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Thresholds.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Thresholds.py
index f78c611aa538..7b91004bea91 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Thresholds.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Thresholds.py
@@ -279,10 +279,10 @@ class LegacyThreshold( Threshold ):
 
 
 
-class EMThreshold (Threshold):
+class eEMThreshold (Threshold):
     
     def __init__(self, name, ttype = 'eEM', mapping = -1):
-        super(EMThreshold,self).__init__(name = name, ttype = ttype, mapping = mapping, run = 3 if ttype=='eEM' else 2)
+        super(eEMThreshold,self).__init__(name = name, ttype = ttype, mapping = mapping, run = 3 if ttype=='eEM' else 2)
         mres = re.match("(?P<type>[A-z]*)[0-9]*(?P<suffix>[VHILMT]*)",name).groupdict()
         self.suffix = mres["suffix"]
         self.rhad = "None"
@@ -348,6 +348,75 @@ class EMThreshold (Threshold):
         return confObj
 
 
+class jEMThreshold (Threshold):
+
+    def __init__(self, name, ttype = 'jEM', mapping = -1):
+        super(jEMThreshold,self).__init__(name = name, ttype = ttype, mapping = mapping, run = 3 if ttype=='jEM' else 2)
+        mres = re.match("(?P<type>[A-z]*)[0-9]*(?P<suffix>[VHILMT]*)",name).groupdict()
+        self.suffix = mres["suffix"]
+        self.iso = "None"
+        self.frac = "None"
+        self.frac2 = "None"
+
+    def isV(self):
+        return 'V' in self.suffix
+
+    def isI(self):
+        return 'I' in self.suffix
+
+    def isL(self):
+        return 'L' in self.suffix
+
+    def isM(self):
+        return 'M' in self.suffix
+
+    def setIsolation(self, iso = "None", frac = "None", frac2 = "None"):
+        allowed = [ "None", "Loose", "Medium", "Tight" ]
+        if iso not in allowed:
+            raise RuntimeError("Threshold %s of type %s: isolation wp %s not allowed for iso, must be one of %s", self.name, self.ttype, iso, ', '.join(allowed) )
+        if frac not in allowed:
+            raise RuntimeError("Threshold %s of type %s: isolation wp %s not allowed for frac, must be one of %s", self.name, self.ttype, frac, ', '.join(allowed) )
+        if frac2 not in allowed:
+            raise RuntimeError("Threshold %s of type %s: isolation wp %s not allowed for frac2, must be one of %s", self.name, self.ttype, frac2, ', '.join(allowed) )
+        self.iso = iso
+        self.frac = frac
+        self.frac2 = frac2
+        return self
+
+    def addThrValue(self, value, *args, **kwargs):
+        # supporting both EM and TAU
+        defargs = ThresholdValue.getDefaults(self.ttype.name)
+        posargs = dict(zip(['etamin', 'etamax', 'phimin', 'phimax', 'priority'], args))
+
+        # then we evaluate the arguments: first defaults, then positional arguments, then named arguments
+        p = deepcopy(defargs)
+        p.update(posargs)
+        p.update(kwargs)
+
+        thrv = ThresholdValue(self.ttype, value,
+                              etamin = p['etamin'], etamax=p['etamax'], phimin=p['phimin'], phimax=p['phimax'],
+                              priority = p['priority'], name = self.name+'full')
+
+        self.thresholdValues.append(thrv)
+        return self
+
+    def json(self):
+        confObj = odict()
+        confObj["mapping"] = self.mapping
+        confObj["iso"] = self.iso
+        confObj["frac"] = self.frac
+        confObj["frac2"] = self.frac2
+        confObj["thrValues"] = []
+        for thrV in self.thresholdValues:
+            tvco = odict()
+            tvco["value"] = thrV.value
+            tvco["etamin"] = thrV.etamin
+            tvco["etamax"] = thrV.etamax
+            tvco["priority"] = thrV.priority
+            confObj["thrValues"].append( tvco )
+        return confObj
+
+
 class MuonThreshold( Threshold ):
 
     def __init__(self, name, run = 3, tgcFlags = "", mapping = -1):
@@ -575,36 +644,73 @@ class cTauThreshold( Threshold ):
         confObj["isolation"] = self.isolation
         return confObj
 
-class JetThreshold( Threshold ):
+class jJetThreshold( Threshold ):
 
     def __init__(self, name, ttype = 'jJ', mapping = -1):
-        super(JetThreshold,self).__init__(name = name, ttype = ttype, mapping = mapping, run = 3 if ttype=='jJ' else 2)
-        self.pt = None
-        self.ranges = [] # full range if empty
+        super(jJetThreshold,self).__init__(name = name, ttype = ttype, mapping = mapping, run = 3 if ttype=='jJ' else 2)
 
-    def setPt(self,pt):
-        """sets pt value"""
-        self.pt = pt
-        return self
+    def addThrValue(self, value, *args, **kwargs):
+        defargs = ThresholdValue.getDefaults(self.ttype.name)
+        posargs = dict(zip(['etamin', 'etamax', 'phimin', 'phimax', 'priority'], args))
 
-    def addRange(self,etamin, etamax):
-        """
-        range for which the pt is valid
-        outside those the threshold is not defined
-        """
-        etamin, etamax = sorted([etamin,etamax])
-        self.ranges += [ odict([("etamin", etamin),("etamax", etamax)]) ]
+        # then we evaluate the arguments: first defaults, then positional arguments, then named arguments
+        p = deepcopy(defargs)
+        p.update(posargs)
+        p.update(kwargs)
+
+        thrv = ThresholdValue(self.ttype, value,
+                              etamin = p['etamin'], etamax=p['etamax'], phimin=p['phimin'], phimax=p['phimax'],
+                              priority = p['priority'], name = self.name+'full')
+
+        self.thresholdValues.append(thrv)
         return self
 
     def json(self):
         confObj = odict()
-        confObj["value"] = self.pt
         confObj["mapping"] = self.mapping
-        if len(self.ranges)==0:
-            confObj["ranges"] = [ odict([("etamin", -49),("etamax", 49)]) ]
-        else:
-            confObj["ranges"] = self.ranges
+        confObj["thrValues"] = []
+        for thrV in self.thresholdValues:
+            tvco = odict()
+            tvco["value"] = thrV.value
+            tvco["etamin"] = thrV.etamin
+            tvco["etamax"] = thrV.etamax
+            tvco["priority"] = thrV.priority
+            confObj["thrValues"].append( tvco )
+        return confObj
+
+
+class jLJetThreshold( Threshold ):
 
+    def __init__(self, name, ttype = 'jLJ', mapping = -1):
+        super(jLJetThreshold,self).__init__(name = name, ttype = ttype, mapping = mapping, run = 3 if ttype=='jLJ' else 2)
+
+    def addThrValue(self, value, *args, **kwargs):
+        defargs = ThresholdValue.getDefaults(self.ttype.name)
+        posargs = dict(zip(['etamin', 'etamax', 'phimin', 'phimax', 'priority'], args))
+
+        # then we evaluate the arguments: first defaults, then positional arguments, then named arguments
+        p = deepcopy(defargs)
+        p.update(posargs)
+        p.update(kwargs)
+
+        thrv = ThresholdValue(self.ttype, value,
+                              etamin = p['etamin'], etamax=p['etamax'], phimin=p['phimin'], phimax=p['phimax'],
+                              priority = p['priority'], name = self.name+'full')
+
+        self.thresholdValues.append(thrv)
+        return self
+
+    def json(self):
+        confObj = odict()
+        confObj["mapping"] = self.mapping
+        confObj["thrValues"] = []
+        for thrV in self.thresholdValues:
+            tvco = odict()
+            tvco["value"] = thrV.value
+            tvco["etamin"] = thrV.etamin
+            tvco["etamax"] = thrV.etamax
+            tvco["priority"] = thrV.priority
+            confObj["thrValues"].append( tvco )
         return confObj
 
 class XEThreshold( Threshold ):
@@ -624,6 +730,22 @@ class XEThreshold( Threshold ):
         confObj["mapping"] = self.mapping
         return confObj
 
+class TEThreshold( Threshold ):
+
+    def __init__(self, name, ttype, mapping = -1):
+        super(TEThreshold,self).__init__(name = name, ttype = ttype, mapping = mapping, run = 3 if ttype.startswith('gTE') or ttype.startswith('jTE') else 2)
+        self.xe = None
+
+    def setTE(self, xe):
+        """te value in GeV"""
+        self.xe = xe
+        return self
+
+    def json(self):
+        confObj = odict()
+        confObj["value"] = self.xe
+        confObj["mapping"] = self.mapping
+        return confObj
 
 class NimThreshold( Threshold ):
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py
index 13c63733253f..ea0da0eabc45 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/TopoAlgos.py
@@ -181,7 +181,7 @@ class DecisionAlgo(TopoAlgo):
         # variable parameters
         confObj["variableParameters"] = list()
         _emscale_for_decision = self.getScaleToCountsEM() # for legacy algos
-        _mu_for_decision= 10 # MU4->3GeV, MU6->5GeV, MU10->9GeV because selection is done by pt>X in 100 MeV units for Run3 muons
+        _mu_for_decision= 1 # MU4->3GeV, MU6->5GeV, MU10->9GeV because selection is done by pt>X in 100 MeV units for Run3 muons
         if "MUCTP-" in self.name:
             _mu_for_decision= 1 
         for (pos, variable) in enumerate(self.variables):
@@ -283,10 +283,10 @@ class MultiplicityAlgo(TopoAlgo):
         confObj["nbits"] = self.nbits
         return confObj
 
-
-class eEmMultiplicityAlgo(MultiplicityAlgo):
+# eEM and jEM
+class EMMultiplicityAlgo(MultiplicityAlgo):
     def __init__(self, name, algoId, threshold, nbits, classtype ):
-        super(eEmMultiplicityAlgo, self).__init__(classtype=classtype, name=name, 
+        super(EMMultiplicityAlgo, self).__init__(classtype=classtype, name=name, 
                                                  algoId=algoId, 
                                                  threshold = threshold, 
                                                  input=None, output="%s" % threshold,
@@ -294,6 +294,7 @@ class eEmMultiplicityAlgo(MultiplicityAlgo):
         mres = re.match("(?P<type>[A-z]*)[0-9]*(?P<suffix>[VHILMT]*)",threshold).groupdict()
         self.input = mres["type"]
 
+# eTAU, jTAU, cTAU
 class TauMultiplicityAlgo(MultiplicityAlgo):
     def __init__(self, name, algoId, threshold, nbits, classtype ):
         super(TauMultiplicityAlgo, self).__init__(classtype=classtype, name=name, 
@@ -304,6 +305,7 @@ class TauMultiplicityAlgo(MultiplicityAlgo):
         mres = re.match("(?P<type>[A-z]*)[0-9]*(?P<suffix>[HLMT]*)",threshold).groupdict()
         self.input = mres["type"]
 
+# jJ and jLJ
 class JetMultiplicityAlgo(MultiplicityAlgo):
     def __init__(self, name, algoId, threshold, nbits, classtype ):
         super(JetMultiplicityAlgo, self).__init__(classtype=classtype, name=name, 
@@ -314,14 +316,26 @@ class JetMultiplicityAlgo(MultiplicityAlgo):
         mres = re.match("(?P<type>[A-z]*)[0-9]*(?P<suffix>[A-z]*)",threshold).groupdict()
         self.input = mres["type"]
 
+# all XE and TE flavours
 class XEMultiplicityAlgo(MultiplicityAlgo):
     def __init__(self, name, algoId, threshold, nbits, classtype = "EnergyThreshold"):
         super(XEMultiplicityAlgo, self).__init__( classtype = classtype, name=name, 
                                                   algoId = algoId, 
-                                                  threshold = threshold, 
+                                                  threshold = threshold,
                                                   input=None, output="%s" % threshold,
                                                   nbits=nbits)
+        mres = re.match("(?P<type>[A-z]*)[0-9]*(?P<suffix>[A-z]*)",threshold).groupdict()
+        self.input = mres["type"]
+        self.flavour = mres["type"]
 
+    def json(self):
+        confObj = super(XEMultiplicityAlgo, self).json()
+        confObj["threshold"] = self.threshold
+        confObj["input"] = self.input
+        confObj["output"] = self.outputs
+        confObj["flavour"] = self.flavour
+        confObj["nbits"] = self.nbits
+        return confObj
 
 class MuMultiplicityAlgo(MultiplicityAlgo):
     def __init__(self, classtype, name, algoId, input, output, nbits):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
index 19d34e9730c1..ada283f89266 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
@@ -515,29 +515,38 @@ class ItemDef:
         MenuItem('L1_J400_LAR' ).setLogic( d.J400 & physcond).setTriggerType(TT.lardemo) # ATR-22344
 
         MenuItem('L1_jJ12'          ).setLogic( d.jJ12         & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ12p0ETA25'   ).setLogic( d.jJ120ETA25  & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ12p0ETA25'   ).setLogic( d.jJ120ETA25   & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ15'          ).setLogic( d.jJ15         & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ15p0ETA25'   ).setLogic( d.jJ150ETA25  & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ15p31ETA49'  ).setLogic( d.jJ1531ETA49 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ15p0ETA25'   ).setLogic( d.jJ150ETA25   & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ15p31ETA49'  ).setLogic( d.jJ1531ETA49  & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ20'          ).setLogic( d.jJ20         & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ20p31ETA49'  ).setLogic( d.jJ2031ETA49 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ20p31ETA49'  ).setLogic( d.jJ2031ETA49  & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ25'          ).setLogic( d.jJ25         & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ25p0ETA23'   ).setLogic( d.jJ250ETA23  & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ25p0ETA23'   ).setLogic( d.jJ250ETA23   & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ30'          ).setLogic( d.jJ30         & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ30p31ETA49'  ).setLogic( d.jJ3031ETA49 & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ35p0ETA23'   ).setLogic( d.jJ350ETA23  & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ30p31ETA49'  ).setLogic( d.jJ3031ETA49  & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ35p0ETA23'   ).setLogic( d.jJ350ETA23   & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ40'          ).setLogic( d.jJ40         & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ40p0ETA25'   ).setLogic( d.jJ400ETA25  & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ45p0ETA20'   ).setLogic( d.jJ450ETA20  & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ40p0ETA25'   ).setLogic( d.jJ400ETA25   & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ45p0ETA20'   ).setLogic( d.jJ450ETA20   & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ50'          ).setLogic( d.jJ50         & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ50p31ETA49'  ).setLogic( d.jJ5031ETA49 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ50p31ETA49'  ).setLogic( d.jJ5031ETA49  & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ75'          ).setLogic( d.jJ75         & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jJ75p31ETA49'  ).setLogic( d.jJ7531ETA49 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jJ75p31ETA49'  ).setLogic( d.jJ7531ETA49  & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ85'          ).setLogic( d.jJ85         & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ100'         ).setLogic( d.jJ100        & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ120'         ).setLogic( d.jJ120        & physcond).setTriggerType(TT.calo)
         MenuItem('L1_jJ400'         ).setLogic( d.jJ400        & physcond).setTriggerType(TT.calo)
 
+        MenuItem('L1_jLJ80'         ).setLogic( d.jLJ80        & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jLJ100'        ).setLogic( d.jLJ100       & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jLJ140'        ).setLogic( d.jLJ140       & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jLJ160'        ).setLogic( d.jLJ160       & physcond).setTriggerType(TT.calo)
+
+        MenuItem('L1_jEM15'         ).setLogic( d.jEM15        & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jEM15M'        ).setLogic( d.jEM15M       & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jEM18M'        ).setLogic( d.jEM18M       & physcond).setTriggerType(TT.calo)
+
         MenuItem('L1_J10p31ETA49').setLogic( d.J1031ETA49 & physcond).setTriggerType(TT.calo)
         MenuItem('L1_J75p31ETA49').setLogic( d.J7531ETA49 & physcond).setTriggerType(TT.calo)
 
@@ -676,13 +685,31 @@ class ItemDef:
         MenuItem('L1_XE60').setLogic( d.XE60 & physcond).setTriggerType(TT.calo)
         MenuItem('L1_XE70').setLogic( d.XE70 & physcond).setTriggerType(TT.calo)
         MenuItem('L1_XE80').setLogic( d.XE80 & physcond).setTriggerType(TT.calo)
-
-        MenuItem('L1_gXERHO20').setLogic( d.gXERHO20 & physcond).setTriggerType(TT.calo)
+        # phase1
+        MenuItem('L1_gXERHO30').setLogic( d.gXERHO30 & physcond).setTriggerType(TT.calo)
         MenuItem('L1_gXERHO50').setLogic( d.gXERHO50 & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_gXEPUFIT20').setLogic( d.gXEPUFIT20 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_gXEPUFIT30').setLogic( d.gXEPUFIT30 & physcond).setTriggerType(TT.calo)
         MenuItem('L1_gXEPUFIT50').setLogic( d.gXEPUFIT50 & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_gXE50').setLogic( d.gXE50 & physcond).setTriggerType(TT.calo)
-        MenuItem('L1_jXE50').setLogic( d.jXE50 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_gXE30' ).setLogic( d.gXE30 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_gXE40' ).setLogic( d.gXE40 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_gXE50' ).setLogic( d.gXE50 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jXE30' ).setLogic( d.jXE30 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jXE35' ).setLogic( d.jXE35 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jXE40' ).setLogic( d.jXE40 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jXE50' ).setLogic( d.jXE50 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jXE55' ).setLogic( d.jXE55 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jXE300').setLogic( d.jXE300 & physcond).setTriggerType(TT.calo)
+
+        MenuItem('L1_jXEC50' ).setLogic( d.jXEC50 & physcond).setTriggerType(TT.calo)
+
+        # phase1 TE
+        MenuItem('L1_gTE50'      ).setLogic( d.gTE50 & physcond).setTriggerType(TT.calo)
+
+        MenuItem('L1_jTE100'     ).setLogic( d.jTE100 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jTEC100'    ).setLogic( d.jTEC100 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jTEFWD100'  ).setLogic( d.jTEFWD100 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jTEFWDA100' ).setLogic( d.jTEFWDA100 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jTEFWDC100' ).setLogic( d.jTEFWDC100 & physcond).setTriggerType(TT.calo)
 
         MenuItem('L1_XE10').setLogic( d.XE10 & physcond).setTriggerType(TT.calo)
         MenuItem('L1_XE20').setLogic( d.XE20 & physcond).setTriggerType(TT.calo)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py
index 2c65c12ff7db..22ba33e3a492 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py
@@ -1,6 +1,6 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
-from ..Base.Thresholds import MuonThreshold, EMThreshold, eTauThreshold, jTauThreshold, cTauThreshold, JetThreshold, XEThreshold, MBTSThreshold, MBTSSIThreshold, NimThreshold
+from ..Base.Thresholds import MuonThreshold, eEMThreshold, jEMThreshold, eTauThreshold, jTauThreshold, cTauThreshold, jJetThreshold, jLJetThreshold, XEThreshold, TEThreshold, MBTSThreshold, MBTSSIThreshold, NimThreshold
 
 class ThresholdDef:
 
@@ -13,6 +13,19 @@ class ThresholdDef:
         }
     }
 
+    jJVar = {
+        0 : {
+            # boundaries fixed in L1Topo FW, do not change!
+            "eta_bin_boundaries": [0, 0.8, 1.6, 4.9], # 3 bins => 4 boundaries
+            "shift": [ 0, 0, 0]
+        },
+        1 : {
+            # boundaries fixed in L1Topo FW, do not change!
+            "eta_bin_boundaries": [0, 0.8, 1.6, 4.9], # 3 bins => 4 boundaries
+            "shift": [ 1, -1, 0]
+        }
+    }
+
     @staticmethod
     def addVaryingThrValues(thr, pt, shift_set):
         eta_bin_boundaries = ThresholdDef.eEMVar[shift_set]["eta_bin_boundaries"]
@@ -28,6 +41,31 @@ class ThresholdDef:
             thr.addThrValue( pt + sh, eta_min, eta_max, priority=2)
         return thr
 
+    def addJetVaryingThrValues(thr, pt, shift_set, rangemin, rangemax):
+        eta_bin_boundaries = ThresholdDef.jJVar[shift_set]["eta_bin_boundaries"]
+        shift = ThresholdDef.jJVar[shift_set]["shift"]
+        for idx,sh in reversed(list(enumerate(shift))):
+            eta_min = int(10 * eta_bin_boundaries[idx])
+            eta_max = int(10 * eta_bin_boundaries[idx+1])
+            if -eta_min < -rangemax or -eta_max > -rangemin:
+                continue
+            if -eta_min > - rangemin:
+                eta_min = rangemin
+            if -eta_max < - rangemax:
+                eta_max = rangemax
+            thr.addThrValue( pt + sh, -eta_max, -eta_min, priority=1)
+        for idx,sh in enumerate(shift):
+            eta_min = int(10 * eta_bin_boundaries[idx])
+            eta_max = int(10 * eta_bin_boundaries[idx+1])
+            if eta_min > rangemax or eta_max < rangemin:
+                continue
+            if eta_max > rangemax:
+                eta_max = rangemax
+            if eta_min < rangemin:
+                eta_min = rangemin
+            thr.addThrValue( pt + sh, eta_min, eta_max, priority=1)
+        return thr
+
 
     @staticmethod
     def registerThresholds(tc, menuName):
@@ -67,26 +105,33 @@ class ThresholdDef:
         MuonThreshold( "MU8EOF"   ).setThrValue( thr=8  ).setTGCFlags("F").setRegion("EC,FW")  # forward muon, commissioning
         MuonThreshold( "MU3EOF"   ).setThrValue( thr=3, ba=4 ).setTGCFlags("F").setRegion("EC,FW")  # forward muon, commissioning
 
-        # EM 
+        # eEM 
         for thrV in [3, 5, 8, 15, 20, 22]:
-            #EMThreshold('eEM%i' % thrV, 'eEM').addThrValue(thrV)
-            ThresholdDef.addVaryingThrValues( EMThreshold(  'eEM%i'% thrV,  'eEM'), pt=thrV,  shift_set = 1 )
+            #eEMThreshold('eEM%i' % thrV, 'eEM').addThrValue(thrV)
+            ThresholdDef.addVaryingThrValues( eEMThreshold(  'eEM%i'% thrV,  'eEM'), pt=thrV,  shift_set = 1 )
 
         # L section (used to be VH in Run2)
-        ThresholdDef.addVaryingThrValues( EMThreshold(  'eEM8L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=8,  shift_set = 1 ) 
-        ThresholdDef.addVaryingThrValues( EMThreshold( 'eEM10L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=10, shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( EMThreshold( 'eEM15L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=15, shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( EMThreshold( 'eEM20L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=20, shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( EMThreshold( 'eEM22L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=22, shift_set = 1 )
+        ThresholdDef.addVaryingThrValues( eEMThreshold(  'eEM8L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=8,  shift_set = 1 ) 
+        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM10L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=10, shift_set = 1 )
+        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM15L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=15, shift_set = 1 )
+        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM20L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=20, shift_set = 1 )
+        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM22L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=22, shift_set = 1 )
 
         # M section (used to be VHI in Run2)
-        ThresholdDef.addVaryingThrValues( EMThreshold(  'eEM8M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=8,  shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( EMThreshold( 'eEM15M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=15, shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( EMThreshold( 'eEM20M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=20, shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( EMThreshold( 'eEM22M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=22, shift_set = 1 )
+        ThresholdDef.addVaryingThrValues( eEMThreshold(  'eEM8M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=8,  shift_set = 1 )
+        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM15M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=15, shift_set = 1 )
+        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM20M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=20, shift_set = 1 )
+        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM22M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=22, shift_set = 1 )
 
         # T section (used to be VHIM in Run2)
-        ThresholdDef.addVaryingThrValues( EMThreshold( 'eEM22T',  'eEM').setIsolation( reta = "Tight", wstot = "Tight", rhad = "Tight" ),    pt=22, shift_set = 1 )
+        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM22T',  'eEM').setIsolation( reta = "Tight", wstot = "Tight", rhad = "Tight" ),    pt=22, shift_set = 1 )
+
+        # jEM
+        for thrV in [15]:
+            jEMThreshold('jEM%i' % thrV, 'jEM').addThrValue(thrV)
+
+        for thrV in [15,18]:
+            jEMThreshold('jEM%iM' % thrV, 'jEM').addThrValue(thrV).setIsolation( iso = "Medium", frac = "Medium", frac2 = "Medium" )
 
         # eTAU
         for et in [8, 12, 20, 25, 40, 60, 100]:
@@ -109,33 +154,61 @@ class ThresholdDef:
         for et in [12]:
             jTauThreshold('jTAU%iM' % et, 'jTAU').setEt(et).setIsolation( isolation = "Medium" )
 
-        # JET
+        # jJET (default range)
         for thrV in [12, 15, 20, 25, 30, 40, 50, 75, 85, 100, 120, 400]:
-            JetThreshold('jJ%i' % thrV, 'jJ').setPt(thrV).addRange(etamin=-31, etamax=31) # jets are between -31 and 31 -ATR-11526
+            ThresholdDef.addJetVaryingThrValues( jJetThreshold('jJ%i' % thrV, 'jJ'), pt=thrV, shift_set=0, rangemin=0, rangemax=31 )
 
-        # Central jet
+        # jJET central
         for (thrV, etamax) in [(12,25), (15,25), (25,23), (35,23), (40,25), (45,20)]:
-            JetThreshold('jJ%ip0ETA%i'  % (thrV, etamax), 'jJ').setPt(thrV).addRange(etamin = -etamax,  etamax = etamax)  
+            ThresholdDef.addJetVaryingThrValues( jJetThreshold( 'jJ%ip0ETA%i'  % (thrV, etamax), 'jJ'), pt=thrV, shift_set=0, rangemin=0, rangemax=etamax )
 
-        # Standard forward jet
+        # jJET central, variable eta (EXAMPLE)
+        # ThresholdDef.addJetVaryingThrValues( jJetThreshold('jJ12p0ETA25V', 'jJ'), pt=12, shift_set=1, rangemin=0, rangemax=25 )
+
+        # jJET forward jet
         for thrV in [15, 20, 30, 50, 75]:
-            JetThreshold('jJ%ip31ETA49' % thrV, 'jJ').setPt(thrV).addRange(etamin=31, etamax=49).addRange(etamin=-49, etamax=-31)
+            ThresholdDef.addJetVaryingThrValues( jJetThreshold('jJ%ip31ETA49' % thrV, 'jJ'), pt=thrV, shift_set=0, rangemin=31, rangemax=49 )
+
+        # jLJET (default range)
+        for thrV in [80, 100, 140, 160]:
+            ThresholdDef.addJetVaryingThrValues( jLJetThreshold('jLJ%i' % thrV, 'jLJ'), pt=thrV, shift_set=0, rangemin=0, rangemax=31 )
 
-        # XE
-        for thrV in [20, 50]:
+        # gXE
+        for thrV in [30, 50]:
             XEThreshold('gXEPUFIT%i' % thrV, 'gXE').setXE(thrV)
 
-        for thrV in [20, 30, 35, 40, 45, 50]:
+        for thrV in [30, 50]:
             XEThreshold('gXERHO%i' % thrV, 'gXE').setXE(thrV)
 
-        for thrV in [50]:
+        for thrV in [30, 40, 50]:
             XEThreshold('gXE%i' % thrV, 'gXE').setXE(thrV)
 
+        # gTE
         for thrV in [50]:
+            TEThreshold('gTE%i' % thrV, 'gTE').setTE(thrV)
+
+        # jXE
+        for thrV in [30, 35, 40, 50, 55, 300]:
             XEThreshold('jXE%i' % thrV, 'jXE').setXE(thrV)
 
+        for thrV in [50]:
+            XEThreshold('jXEC%i' % thrV, 'jXE').setXE(thrV)
+
+        # jTE
+        for thrV in [100,]:
+            TEThreshold('jTE%i' % thrV, 'jTE').setTE(thrV)
+
+        for thrV in [100,]:
+            TEThreshold('jTEC%i' % thrV, 'jTE').setTE(thrV)
+
+        for thrV in [100,]:
+            TEThreshold('jTEFWD%i' % thrV, 'jTE').setTE(thrV)
 
+        for thrV in [100,]:
+            TEThreshold('jTEFWDA%i' % thrV, 'jTE').setTE(thrV)
 
+        for thrV in [100,]:
+            TEThreshold('jTEFWDC%i' % thrV, 'jTE').setTE(thrV)
 
         # CALREQ
             
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py
index 7c3bf9ac0b00..cd7875459e21 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py
@@ -3,7 +3,8 @@
 from AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
 
-from ..Base.TopoAlgos import eEmMultiplicityAlgo, TauMultiplicityAlgo, JetMultiplicityAlgo, XEMultiplicityAlgo
+from ..Base.TopoAlgos import EMMultiplicityAlgo, TauMultiplicityAlgo, JetMultiplicityAlgo, XEMultiplicityAlgo
+
 
 class TopoAlgoDefMultiplicity(object):
     """
@@ -23,17 +24,29 @@ class TopoAlgoDefMultiplicity(object):
         ]
 
         for em in emThresholds_3bits:
-            alg = eEmMultiplicityAlgo( name = em,
+            alg = EMMultiplicityAlgo( name = em,
                                       algoId = currentAlgoId,
                                       threshold = em,
                                       nbits = 3, classtype='eEmMultiplicity')
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
+
         for em in emThresholds_2bits:
-            alg = eEmMultiplicityAlgo( name = em,
+            alg = EMMultiplicityAlgo( name = em,
                                       algoId = currentAlgoId,
                                       threshold = em,
                                       nbits = 2, classtype='eEmMultiplicity')
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
+
+        emThresholds_2bits = [ 'jEM15', 'jEM15M', 'jEM18M', ]
+        for em in emThresholds_2bits:
+            alg = EMMultiplicityAlgo( name = em,
+                                      algoId = currentAlgoId,
+                                      threshold = em,
+                                      nbits = 2, classtype='jEmMultiplicity')
+            tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
                 
         etauThresholds_3bits = [ 'eTAU8', 'eTAU12', ]
         jtauThresholds_3bits = [ 'jTAU12', ]        
@@ -48,37 +61,47 @@ class TopoAlgoDefMultiplicity(object):
                                        threshold = tau,
                                        nbits = 3, classtype='eTauMultiplicity')
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
+
         for tau in jtauThresholds_3bits:
             alg = TauMultiplicityAlgo( name = tau,
                                        algoId = currentAlgoId,
                                        threshold = tau,
                                        nbits = 3, classtype='jTauMultiplicity')
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
+
         for tau in ctauThresholds_3bits:
             alg = TauMultiplicityAlgo( name = tau,
                                        algoId = currentAlgoId,
                                        threshold = tau,
                                        nbits = 3, classtype='cTauMultiplicity')
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
+
         for tau in etauThresholds_2bits:
             alg = TauMultiplicityAlgo( name = tau,
                                        algoId = currentAlgoId,
                                        threshold = tau,
                                        nbits = 2, classtype='eTauMultiplicity')
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
+
         for tau in jtauThresholds_2bits:
             alg = TauMultiplicityAlgo( name = tau,
                                        algoId = currentAlgoId,
                                        threshold = tau,
                                        nbits = 2, classtype='jTauMultiplicity')
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
+
         for tau in ctauThresholds_2bits:
             alg = TauMultiplicityAlgo( name = tau,
                                        algoId = currentAlgoId,
                                        threshold = tau,
                                        nbits = 2, classtype='cTauMultiplicity')
             tm.registerTopoAlgo(alg)
-
+            currentAlgoId += 1
 
         jJThresholds_3bits = [ 'jJ12', 'jJ12p0ETA25', 'jJ15', 'jJ15p0ETA25', 'jJ20', 'jJ25', 'jJ25p0ETA23', 'jJ30',]
         jJThresholds_2bits = [ 'jJ15p31ETA49', 'jJ20p31ETA49', 'jJ30p31ETA49', 'jJ35p0ETA23', 'jJ40', 'jJ40p0ETA25', 'jJ45p0ETA20',
@@ -91,29 +114,43 @@ class TopoAlgoDefMultiplicity(object):
                                        threshold = jJet,
                                        nbits = 3, classtype='jJetMultiplicity')
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
+
         for jJet in jJThresholds_2bits:
             alg = JetMultiplicityAlgo( name = jJet,
                                        algoId = currentAlgoId,
                                        threshold = jJet,
                                        nbits = 2, classtype='jJetMultiplicity')
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
 
-        gXEThresholds = [ "gXERHO20", "gXERHO30", "gXERHO35", "gXERHO40", "gXERHO45", "gXERHO50", "gXEPUFIT20", "gXEPUFIT50", "gXE50" ]
+        jLJThresholds_2bits = [ 'jLJ80', 'jLJ100', 'jLJ140', 'jLJ160' ]
 
-        for gXE in gXEThresholds:
-            alg = XEMultiplicityAlgo( name = gXE,
-                                      algoId = currentAlgoId,
-                                      threshold = gXE,
-                                      nbits = 1)
+        for jLJet in jLJThresholds_2bits:
+            alg = JetMultiplicityAlgo( name = jLJet,
+                                       algoId = currentAlgoId,
+                                       threshold = jLJet,
+                                       nbits = 2, classtype='jLJetMultiplicity')
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
 
+        XEThresholds = [ 
+            'gXE30', 'gXE40', 'gXE50',
+            'gXERHO30', 'gXERHO50', 
+            'gXEPUFIT30', 'gXEPUFIT50',
 
-        jXEThresholds = [ "jXE50" ]
+            'jXE30', 'jXE35', 'jXE40', 'jXE50', 'jXE55', 'jXE300',
 
-        for jXE in jXEThresholds:
-            alg = XEMultiplicityAlgo( name = jXE,
+            'jXEC50', 'jTE100', 'jTEC100', 'jTEFWD100', 'jTEFWDA100', 'jTEFWDC100', 
+            'gTE50',
+        ]
+
+        for XE in XEThresholds:
+            alg = XEMultiplicityAlgo( name = XE,
                                       algoId = currentAlgoId,
-                                      threshold = jXE,
+                                      threshold = XE,
                                       nbits = 1)
             tm.registerTopoAlgo(alg)
+            currentAlgoId += 1
+
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py
index 3120572dc843..b6c5860f2ed3 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py
@@ -15,6 +15,8 @@ def getTypeWideThresholdConfig(ttype):
         return getConfig_MU()
     if ttype == ThrType.eEM:
         return getConfig_eEM()
+    if ttype == ThrType.jEM:
+        return getConfig_jEM()
     if ttype == ThrType.eTAU:
         return getConfig_eTAU()
     if ttype == ThrType.cTAU:
@@ -23,6 +25,16 @@ def getTypeWideThresholdConfig(ttype):
         return getConfig_jTAU()
     if ttype == ThrType.jJ:
         return getConfig_jJ()
+    if ttype == ThrType.jLJ:
+        return getConfig_jLJ()
+    if ttype == ThrType.jXE:
+        return getConfig_jXE()
+    if ttype == ThrType.jTE:
+        return getConfig_jTE()
+    if ttype == ThrType.gXE:
+        return getConfig_gXE()
+    if ttype == ThrType.gTE:
+        return getConfig_gTE()
     if ttype == ThrType.EM:
         return getConfig_EM()
     if ttype == ThrType.TAU:
@@ -82,6 +94,35 @@ def getConfig_eEM():
 
     return confObj
 
+def getConfig_jEM():
+    confObj = odict()
+    confObj["workingPoints"] = odict()
+    confObj["workingPoints"]["Loose"] = [
+        odict([("iso_fw", 58), ("iso", 0.121), ("frac_fw", 8), ("frac", 4.0), ("frac2_fw", 16), ("frac2", 0.333), ("maxEt", 60), ("etamin", -49), ("etamax", 49), ("priority", 1)]),
+    ]
+    confObj["workingPoints"]["Medium"] = [
+        odict([("iso_fw", 65), ("iso", 0.11), ("frac_fw", 9), ("frac", 3.556), ("frac2_fw", 22), ("frac2", 0.267), ("maxEt", 60), ("etamin", -49), ("etamax", 49), ("priority", 1)]),
+    ]
+    confObj["workingPoints"]["Tight"] = [
+        odict([("iso_fw", 72), ("iso", 0.1), ("frac_fw", 25), ("frac", 1.28), ("frac2_fw", 23), ("frac2", 0.258), ("maxEt", 60), ("etamin", -49), ("etamax", 49), ("priority", 1)]),
+    ]
+    confObj["ptMinToTopo"] = [
+        odict([("etamin",-49), ("etamax",49), ("value", 15)])
+    ]
+    confObj["ptMinxTOB"] = [
+        odict([("etamin",-49), ("etamax",49), ("value", 15)])
+    ]
+    confObj["resolutionMeV"] = 200
+
+    # Check that FW values are integers
+    for wp in confObj["workingPoints"]:
+        for ssthr in confObj["workingPoints"][wp]:
+            for ssthr_i in ssthr:
+                if "_fw" in ssthr_i:
+                     if not isinstance(ssthr[ssthr_i], int):
+                          raise RuntimeError("Threshold %s in jEM configuration is not an integer!", ssthr_i )
+
+    return confObj
 
 def getConfig_eTAU():
     confObj = odict()
@@ -107,22 +148,22 @@ def getConfig_eTAU():
             for ssthr_i in ssthr:
                 if "_fw" in ssthr_i:
                      if not isinstance(ssthr[ssthr_i], int):
-                          raise RuntimeError("Threshold %s in eEM configuration is not an integer!", ssthr_i )
+                          raise RuntimeError("Threshold %s in eTAU configuration is not an integer!", ssthr_i )
     return confObj
 
 def getConfig_cTAU():
     confObj = odict()
     confObj["workingPoints"] = odict()
     confObj["workingPoints"]["Loose"] = [
-        odict([("isolation", 0.40), ("isolation_fw", 40), ("maxEt", 60)]),
+        odict([("isolation", 0.40), ("isolation_fw", 410)]),
     ]
     confObj["workingPoints"]["Medium"] = [
-        odict([("isolation", 0.35), ("isolation_fw", 50), ("maxEt", 60)]),
+        odict([("isolation", 0.35), ("isolation_fw", 358)]),
     ]
     confObj["workingPoints"]["Tight"] = [
-        odict([("isolation", 0.30), ("isolation_fw", 60), ("maxEt", 60)]),
+        odict([("isolation", 0.30), ("isolation_fw", 307)]),
     ]
-    confObj["resolutionMeV"] = 200
+    confObj["resolutionMeV"] = 100
 
     # Check that FW values are integers
     for wp in confObj["workingPoints"]:
@@ -130,7 +171,7 @@ def getConfig_cTAU():
             for ssthr_i in ssthr:
                 if "_fw" in ssthr_i:
                      if not isinstance(ssthr[ssthr_i], int):
-                          raise RuntimeError("Threshold %s in eEM configuration is not an integer!", ssthr_i )
+                          raise RuntimeError("Threshold %s in cTAU configuration is not an integer!", ssthr_i )
     return confObj
 
 def getConfig_jTAU():
@@ -145,7 +186,12 @@ def getConfig_jTAU():
     confObj["workingPoints"]["Tight"] = [
         odict([("isolation", 0.30), ("isolation_fw", 60), ("maxEt", 60)]),
     ]
-    confObj["ptMinToTopo"] = 5
+    confObj["ptMinToTopo"] = [
+        odict([("etamin",-49), ("etamax",49), ("value", 5)])
+    ]
+    confObj["ptMinxTOB"] = [
+        odict([("etamin",-49), ("etamax",49), ("value", 5)])
+    ]
     confObj["resolutionMeV"] = 200
 
     # Check that FW values are integers
@@ -154,7 +200,7 @@ def getConfig_jTAU():
             for ssthr_i in ssthr:
                 if "_fw" in ssthr_i:
                      if not isinstance(ssthr[ssthr_i], int):
-                          raise RuntimeError("Threshold %s in eEM configuration is not an integer!", ssthr_i )
+                          raise RuntimeError("Threshold %s in jTAU configuration is not an integer!", ssthr_i )
     return confObj
 
 def getConfig_jJ():
@@ -162,9 +208,44 @@ def getConfig_jJ():
     confObj["ptMinToTopo"] = [
         odict([("etamin",-49), ("etamax",49), ("value", 12)])
     ]
+    confObj["ptMinxTOB"] = [
+        odict([("etamin",-49), ("etamax",49), ("value", 12)])
+    ]
     confObj["resolutionMeV"] = 200  
     return confObj
 
+def getConfig_jLJ():
+    confObj = odict()
+    confObj["ptMinToTopo"] = [
+        odict([("etamin",-49), ("etamax",49), ("value", 80)])
+    ]
+    confObj["ptMinxTOB"] = [
+        odict([("etamin",-49), ("etamax",49), ("value", 80)])
+    ]
+    confObj["resolutionMeV"] = 200
+    return confObj
+
+def getConfig_jXE():
+    confObj = odict()
+    confObj["resolutionMeV"] = 200
+    return confObj
+
+def getConfig_jTE():
+    confObj = odict()
+    confObj["etaBoundary"] = 32
+    confObj["resolutionMeV"] = 200
+    return confObj
+
+def getConfig_gXE():
+    confObj = odict()
+    confObj["resolutionMeV"] = 200
+    return confObj
+
+def getConfig_gTE():
+    confObj = odict()
+    confObj["resolutionMeV"] = 200
+    return confObj
+
 
 # LEGACY
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
index 2cf10d6e5761..34ba3365448e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
@@ -134,7 +134,13 @@ def defineMenu():
         'L1_jJ30', 'L1_jJ30p31ETA49', 'L1_jJ35p0ETA23', 'L1_jJ40', 'L1_jJ40p0ETA25', 'L1_jJ45p0ETA20', 'L1_jJ50', 'L1_jJ50p31ETA49',
         'L1_jJ75', 'L1_jJ75p31ETA49', 'L1_jJ85',
         'L1_jJ100', 'L1_jJ120', 'L1_jJ400',
-       
+      
+        # jLJ
+        'L1_jLJ80', 'L1_jLJ100', 'L1_jLJ140', 'L1_jLJ160', 
+
+        # jEM
+        'L1_jEM15', 'L1_jEM15M', 'L1_jEM18M',    
+
         # multi jet
         'L1_J45p0ETA21_3J15p0ETA25',
         'L1_J50_2J40p0ETA25_3J15p0ETA25',
@@ -162,12 +168,13 @@ def defineMenu():
         'L1_XE35', 'L1_XE40', 'L1_XE45', 'L1_XE50', 
         'L1_XE55', 'L1_XE60', 'L1_XE30', 'L1_XE300',
         # new calo
-        'L1_gXERHO50',
-        'L1_gXEPUFIT50',
-        'L1_gXERHO20',
-        'L1_gXEPUFIT20',
-        'L1_gXE50',
-        'L1_jXE50',
+        'L1_gXERHO30', 'L1_gXERHO50',
+        'L1_gXEPUFIT30', 'L1_gXEPUFIT50',
+        'L1_gXE30', 'L1_gXE40', 'L1_gXE50',
+        'L1_gTE50',
+
+        'L1_jXE30', 'L1_jXE35', 'L1_jXE40', 'L1_jXE50', 'L1_jXE55', 'L1_jXE300', 
+        'L1_jXEC50', 'L1_jTE100', 'L1_jTEC100', 'L1_jTEFWD100', 'L1_jTEFWDA100', 'L1_jTEFWDC100',
                 
         # RNDM
         'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO',  'L1_RD0_EMPTY', 'L1_RD0_ABORTGAPNOTCALIB',
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
index 43471727c35c..edb8177f42f8 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
@@ -82,7 +82,7 @@ def defineInputsMenu():
         "nbitsDefault" : 2,
         "type" : "optical",
         "legacy" : False,
-        "thresholds" : [  # Topo1A: eFex EM, eFex TAU, gFex 
+        "thresholds" : [  # Topo1A: eFex EM, eFex TAU, gJ, gLJ 
             ('eEM3',3), ('eEM5',3), ('eEM8',3), ('eEM8L',3), 
             'eEM8M', 'eEM10L', 'eEM15', 'eEM15L', 'eEM15M',
             'eEM20', 'eEM20L', 'eEM20M', 
@@ -97,7 +97,7 @@ def defineInputsMenu():
         "type" : "optical",
         "fpga" : 0,
         "legacy" : False,
-        "thresholds" : [ # Topo1A: eFex EM, eFex TAU, gFex 
+        "thresholds" : [ # Topo1A: eFex EM, eFex TAU, gJ, gLJ
              ('eTAU8',3), ('eTAU12',3), 'eTAU12L', 'eTAU12M', 'eTAU20',
              'eTAU25', 'eTAU30H', 'eTAU40', 'eTAU60', 'eTAU100',
         ]
@@ -106,13 +106,19 @@ def defineInputsMenu():
     topoBoards["Topo1"]["connectors"].append({ # third optical connector
         "name" : "Topo1Opt2",
         "format" : "multiplicity",
-        "nbitsDefault" : 3,
+        "nbitsDefault" : 2,
         "type" : "optical",
         "fpga" : 1,
         "legacy" : False,
         "thresholds" : [ # Topo1B: jFex small-R jet, jFex large-R jet, combined eFex/jFex TAU, gFex+jFex EX, gFex+jFex SumET, jFex TAU
-            ('gXERHO20',1),  ('gXERHO30',1),  ('gXERHO35',1),  ('gXERHO40',1),  ('gXERHO45',1),  ('gXERHO50',1),
-            ('gXEPUFIT20',1),  ('gXEPUFIT50',1),  ('gXE50',1),
+            'jLJ80', 'jLJ100', 'jLJ140', 'jLJ160', 
+
+            'jEM15', 'jEM15M', 'jEM18M', 
+
+            ('gXERHO30',1),  ('gXERHO50',1),
+            ('gXEPUFIT30',1),  ('gXEPUFIT50',1),  
+            ('gXE30',1), ('gXE40',1), ('gXE50',1),
+            ('gTE50',1),
         ]
     })
 
@@ -131,7 +137,10 @@ def defineInputsMenu():
             'jJ35p0ETA23', 'jJ40', 'jJ40p0ETA25', 'jJ45p0ETA20', 'jJ50', 'jJ50p31ETA49', 'jJ75', 'jJ75p31ETA49',
             'jJ85', 'jJ100', 'jJ120', 'jJ400',
 
-            ('jXE50',1),
+            ('jXE30',1), ('jXE35',1), ('jXE40',1), ('jXE50',1), ('jXE55',1), ('jXE300',1),
+            # test thresholds
+            ('jXEC50',1),
+            ('jTE100',1), ('jTEC100',1), ('jTEFWD100',1), ('jTEFWDA100',1), ('jTEFWDC100',1)
         ]
     })
 
-- 
GitLab


From 7d478c49e42f0d0b6ecbf47d8d4fc8ddcb09bc28 Mon Sep 17 00:00:00 2001
From: Ben Wynne <bwynne@t3-mw2.ph.ed.ac.uk>
Date: Wed, 22 Sep 2021 16:51:59 +0100
Subject: [PATCH 267/347] Test that element links refer back to the correct
 place. Update helper to make sure they do

---
 Control/AthViews/AthViews/ViewHelper.h      |   7 +-
 Control/AthViews/share/ViewLinking_test.ref |   9 +-
 Control/AthViews/test/ViewLinking_test.cxx  | 130 +++++++++++++++-----
 3 files changed, 108 insertions(+), 38 deletions(-)

diff --git a/Control/AthViews/AthViews/ViewHelper.h b/Control/AthViews/AthViews/ViewHelper.h
index 5594c2443961..432d14f26122 100644
--- a/Control/AthViews/AthViews/ViewHelper.h
+++ b/Control/AthViews/AthViews/ViewHelper.h
@@ -225,8 +225,9 @@ namespace ViewHelper
         }
 
         //Declare remapping
+        auto proxy = inputView->proxy( queryHandle.clid(), queryHandle.key() ); //shouldn't need to test validity since queryHandle already used
         m_sg->remap( ClassID_traits< DataVector< T > >::ID(),
-                     inputView->viewKey (queryHandle.name()),
+                     proxy->name(),
                      queryHandle.name(),
                      offset );
         offset += queryHandle->size();
@@ -277,7 +278,9 @@ namespace ViewHelper
   template<typename T>
   ElementLink<T> makeLink( const SG::View* view, const SG::ReadHandle<T>& handle, size_t index )
   {
-    return ElementLink<T>( view->viewKey (handle.key()), index );
+    auto proxy = view->proxy( handle.clid(), handle.key() );
+    if ( proxy == nullptr ) throw std::runtime_error( "Attempting to make element link with invalid key " + handle.key() );
+    return ElementLink<T>( proxy->name(), index );
   }
 
 } // EOF namspace ViewHelper
diff --git a/Control/AthViews/share/ViewLinking_test.ref b/Control/AthViews/share/ViewLinking_test.ref
index d394bd76b53a..5629645288f9 100644
--- a/Control/AthViews/share/ViewLinking_test.ref
+++ b/Control/AthViews/share/ViewLinking_test.ref
@@ -13,7 +13,8 @@ ApplicationMgr Ready
 ClassIDSvc           INFO  getRegistryEntries: read 811 CLIDRegistry entries for module ALL
 ViewLinking_test     INFO SG pointer: 0xdab760
 ClassIDSvc           INFO  getRegistryEntries: read 400 CLIDRegistry entries for module ALL
-ViewLinking_test     INFO Views that are not linked behave correctly 
-ViewLinking_test     INFO Views that are linked behave correctly 
-ViewLinking_test     INFO Hiding works as expected 
-ViewLinking_test     INFO Fall through works as expected 
+ViewLinking_test     INFO Views that are not linked behave correctly
+ViewLinking_test     INFO Views that are linked behave correctly
+ViewLinking_test     INFO Hiding works as expected
+ViewLinking_test     INFO Fall through works as expected
+ViewLinking_test     INFO Fall through works with links as expected
diff --git a/Control/AthViews/test/ViewLinking_test.cxx b/Control/AthViews/test/ViewLinking_test.cxx
index eee8ae53b168..dff7925a4ccd 100644
--- a/Control/AthViews/test/ViewLinking_test.cxx
+++ b/Control/AthViews/test/ViewLinking_test.cxx
@@ -13,20 +13,23 @@
 #include "TestTools/expect.h"
 #include "TestTools/expect_exception.h"
 #include "AthViews/View.h"
+#include "AthViews/ViewHelper.h"
 
 struct TestClass {
   int value = 0;
 };
+CLASS_DEF( TestClass, 16530831, 1 )
+
+typedef std::vector<TestClass*> TestContainer;
+CLASS_DEF( TestContainer, 16530833, 1 )
 
-CLASS_DEF( TestClass , 16530831 , 1 )
 using namespace SG;
 void testDataInView( StoreGateSvc* /*sg*/ , MsgStream& log ) {
-  auto parentView = new View( "ParentView", -1 );
 
+  // Make parent view
+  auto parentView = new View( "ParentView", -1 );
   auto t1 = std::make_unique<TestClass>();
   t1->value = 1;
-  //  auto status1 = parentView->recordObject( t1, "test1" );
-    
   {
     SG::WriteHandle<TestClass> wh( "test1" );
     wh.setProxyDict( parentView ).ignore();
@@ -34,78 +37,75 @@ void testDataInView( StoreGateSvc* /*sg*/ , MsgStream& log ) {
     VALUE( status.isSuccess() ) EXPECTED( true );
   }
 
+  // Make child view
   auto childView = new View( "ChildView", -1 );
-
   auto t2 = std::make_unique<TestClass>();
   t2->value = 2;
   {
     SG::WriteHandle<TestClass> wh( "test2" );
     wh.setProxyDict( childView ).ignore();
     auto status = wh.record( std::move( t2 ) );
-    VALUE( status.isSuccess() ) EXPECTED( true ); 
+    VALUE( status.isSuccess() ) EXPECTED( true );
   }
-  //  auto status2 = childView->recordObject( t2, "test1" );
-  // all prepared, will start testing if querries respond correctly
+
+  // All prepared, will start testing if queries respond correctly
   {
-    // rtivial test, we ask for a wrong object
+    // Ask for an object that doesn't exist
     SG::ReadHandle<TestClass> rh( "test" );
     rh.setProxyDict( childView ).ignore();
     VALUE( rh.isValid() ) EXPECTED( false );
   }
-
-
-
   {
+    // Ask for object in the child view
     SG::ReadHandle<TestClass> rh( "test2" );
     rh.setProxyDict( childView ).ignore();
     VALUE( rh.isValid() ) EXPECTED( true );
     VALUE( rh->value ) EXPECTED( 2 );
   }
-
   {
+    // Ask child view for object that only exists in the parent
     SG::ReadHandle<TestClass> rh( "test1" );
     rh.setProxyDict( childView ).ignore();
     VALUE( rh.isValid() ) EXPECTED( false );
   }
-  log << MSG::INFO << "Views that are not linked behave correctly " << endmsg;
-  // link them and see if data object is accessible
-  childView->linkParent( parentView );
+  log << MSG::INFO << "Views that are not linked behave correctly" << endmsg;
 
+  // Link views and see if data object is accessible
+  childView->linkParent( parentView );
   {
+    // Is the original object still there?
     SG::ReadHandle<TestClass> rh( "test2" );
     rh.setProxyDict( childView ).ignore();
     VALUE( rh.isValid() ) EXPECTED( true );
     VALUE( rh->value ) EXPECTED( 2 );
   }
   {
+    // Is the object from the parent now also visible?
     SG::ReadHandle<TestClass> rh( "test1" );
     rh.setProxyDict( childView ).ignore();
     VALUE( rh.isValid() ) EXPECTED( true );
     VALUE( rh->value ) EXPECTED( 1 );
   }
-  log << MSG::INFO << "Views that are linked behave correctly " << endmsg;
+  log << MSG::INFO << "Views that are linked behave correctly" << endmsg;
 
-  // hide object from parent by adding one in the Child
+  // Hide object from parent by adding one with same name to the Child
   auto t3 = std::make_unique<TestClass>();
   t3->value = 3;
-
   {
+    // Can it be recorded? (should be allowed)
     SG::WriteHandle<TestClass> wh( "test1" );
     wh.setProxyDict( childView ).ignore();
     auto status = wh.record( std::move( t3 ) );
     VALUE( status.isSuccess() ) EXPECTED( true );
   }
-
   {
+    // Do we now see the child object in preference to the parent?
     SG::ReadHandle<TestClass> rh( "test1" );
     rh.setProxyDict( childView ).ignore();
     VALUE( rh.isValid() ) EXPECTED( true );
     VALUE( rh->value ) EXPECTED ( 3 );
   }
-
-  log << MSG::INFO << "Hiding works as expected " << endmsg;
-
-
+  log << MSG::INFO << "Hiding works as expected" << endmsg;
 }
 
 void testFallThrough( StoreGateSvc* sg , MsgStream& log) {
@@ -113,8 +113,8 @@ void testFallThrough( StoreGateSvc* sg , MsgStream& log) {
   SG::WriteHandle<TestClass> wh( "inStore" );
   wh.setProxyDict( sg ).ignore();
   auto status = wh.record( std::move( t ) );
-  VALUE( status.isSuccess() ) EXPECTED( true ); 
-    
+  VALUE( status.isSuccess() ) EXPECTED( true );
+
   // the whole trick is that the read handle is pointed to the view,
   // but should read from the main store if the fall though
   // is enabled
@@ -130,21 +130,86 @@ void testFallThrough( StoreGateSvc* sg , MsgStream& log) {
     rh.setProxyDict( transparentView ).ignore();
     VALUE( rh.isValid() ) EXPECTED( true );
   }
-  log << MSG::INFO << "Fall through works as expected " << endmsg;
+  log << MSG::INFO << "Fall through works as expected" << endmsg;
 }
 
+void testFallThroughLinks( StoreGateSvc* sg , MsgStream& log ) {
 
+  // Have to make a container to test element links
+  auto t = std::make_unique<TestContainer>();
+  t->push_back( new TestClass() );
+  t->back()->value = 5;
+  t->push_back( new TestClass() );
+  t->back()->value = 4;
+
+  // Store the container in the event-level store
+  SG::WriteHandle<TestContainer> wh( "inStore" );
+  wh.setProxyDict( sg ).ignore();
+  auto status = wh.record( std::move( t ) );
+  VALUE( status.isSuccess() ) EXPECTED( true );
+
+  // Make another container for testing parent/child links
+  auto t2 = std::make_unique<TestContainer>();
+  t2->push_back( new TestClass() );
+  t2->back()->value = 3;
+  t2->push_back( new TestClass() );
+  t2->back()->value = 2;
+
+  // Make a parent view and store the container
+  auto parentView = new View( "parentView", -1 );
+  SG::WriteHandle<TestContainer> wh2( "inParent" );
+  wh2.setProxyDict( parentView ).ignore();
+  status = wh2.record( std::move( t2 ) );
+  VALUE( status.isSuccess() ) EXPECTED( true );
+
+  // Just test a straightforward element link to the parent
+  {
+    SG::ReadHandle<TestContainer> rh( "inParent" );
+    auto link = ViewHelper::makeLink( parentView, rh, 0 );
+    VALUE( link.isValid() ) EXPECTED( true );
+    VALUE( ( *link )->value ) EXPECTED( 3 );
+    VALUE( link.proxy()->name() == "_parentView_inParent" ) EXPECTED( true );
+  }
+
+  // Element links need to point to the right object
+  // even if it's not in the current view
+  {
+    // Child to parent
+    auto childView = new View( "childView", -1 );
+    childView->linkParent( parentView );
+    SG::ReadHandle<TestContainer> rh( "inParent" );
+    auto link = ViewHelper::makeLink( childView, rh, 1 );
+    VALUE( link.isValid() ) EXPECTED( true );
+    VALUE( ( *link )->value ) EXPECTED( 2 );
+    VALUE( link.proxy()->name() == "_parentView_inParent" ) EXPECTED( true );
+  }
+  {
+    // Parent to store
+    SG::ReadHandle<TestContainer> rh( "inStore" );
+    auto link = ViewHelper::makeLink( parentView, rh, 0 );
+    VALUE( link.isValid() ) EXPECTED( true );
+    VALUE( ( *link )->value ) EXPECTED( 5 );
+    VALUE( link.proxy()->name() == "inStore" ) EXPECTED( true );
+  }
+  {
+    // Child to store
+    auto childView = new View( "childView", -1 );
+    childView->linkParent( parentView );
+    SG::ReadHandle<TestContainer> rh( "inStore" );
+    auto link = ViewHelper::makeLink( childView, rh, 1 );
+    VALUE( link.isValid() ) EXPECTED( true );
+    VALUE( ( *link )->value ) EXPECTED( 4 );
+    VALUE( link.proxy()->name() == "inStore" ) EXPECTED( true );
+  }
+  log << MSG::INFO << "Fall through works with links as expected" << endmsg;
+}
 
 int main() {
   using namespace std;
 
   MsgStream log(Athena::getMessageSvc(), "ViewLinking_test");
 
-  //  MsgStream* msglog = &log;
-
-
   ISvcLocator* pSvcLoc;
-  //if (!Athena_test::initGaudi("test.txt",  pSvcLoc)) {
   if (!Athena_test::initGaudi("",  pSvcLoc)) {
     log << MSG::ERROR << "Can not intit Gaudi" << endmsg;
     return -1;
@@ -162,6 +227,7 @@ int main() {
 
   testDataInView( pStore, log );
   testFallThrough( pStore, log );
-  
+  testFallThroughLinks( pStore, log );
+
   return 0;
 }
-- 
GitLab


From 295d2ea3c7d098076e524e7d5ce938cdbcc68099 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 22 Sep 2021 19:00:20 +0200
Subject: [PATCH 268/347] TriggerMenuMT: disable L1Topo monitoring on Run-2
 data

After the removal of the legacy MUCTPI simulation (ATR-23763), we can no
longer run the L1Topo simulation on Run-2 data (it still works if
`doL1Sim` is enabled).

Closes ATR-24179.
---
 .../CalibCosmicMon/MonitorChainConfiguration.py              | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py
index ae73411fa2e2..08fd2b044ccc 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/MonitorChainConfiguration.py
@@ -100,7 +100,10 @@ class MonitorChainConfiguration(ChainConfigurationBase):
         if monType == 'timeburner':
             chainSteps.append(self.getTimeBurnerStep())
         elif monType == 'l1topodebug':
-            chainSteps.append(self.getL1TopoOnlineMonitorStep())
+            if ConfigFlags.Trigger.enableL1MuonPhase1:
+                chainSteps.append(self.getL1TopoOnlineMonitorStep())
+            else:
+                log.warning('Not adding chain %s. L1Topo monitoring only supported with Phase-1 MUCTPI (ATR-24179)', self.chainName)
         else:
             raise RuntimeError('Unexpected monType '+monType+' in MonitorChainConfiguration')
 
-- 
GitLab


From 55fb3124b07fcc9c04c427cb620a654379b07317 Mon Sep 17 00:00:00 2001
From: Atlas Larcommissioning <larcomm@lxplus739.cern.ch>
Date: Wed, 22 Sep 2021 20:00:37 +0200
Subject: [PATCH 269/347] Fix for PEB events

---
 LArCalorimeter/LArCafJobs/python/LArShapeDumperSkeleton.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/LArCalorimeter/LArCafJobs/python/LArShapeDumperSkeleton.py b/LArCalorimeter/LArCafJobs/python/LArShapeDumperSkeleton.py
index 499a270059ef..9de15a03a43d 100644
--- a/LArCalorimeter/LArCafJobs/python/LArShapeDumperSkeleton.py
+++ b/LArCalorimeter/LArCafJobs/python/LArShapeDumperSkeleton.py
@@ -23,6 +23,11 @@ def fromRunArgs(runArgs):
     ConfigFlags.Input.Files=runArgs.inputBSFile
     ConfigFlags.LArShapeDump.outputNtup=runArgs.outputNTUP_SAMPLESMONFile
 
+    #protection for LArPEB event:
+    ConfigFlags.Trigger.L1.doMuon=False
+    ConfigFlags.Trigger.L1.doCalo=False
+    ConfigFlags.Trigger.L1.doTopo=False
+
     if hasattr(runArgs,"outputNTUP_HECNOISEFile"):
         ConfigFlags.LArShapeDump.HECNoiseNtup=runArgs.outputNTUP_HECNOISEFile
         
-- 
GitLab


From 7100e2fd97d9cfd84bea876b950e231c382a9f06 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 8 Sep 2021 22:30:53 -0400
Subject: [PATCH 270/347] AthAllocators: const fix

Fix for instantiating STL allocators with a const type.
Otherwise, we end up with a duplicate member because reference
and const_reference are the same.
---
 .../AthAllocators/ArenaHeapSTLAllocator.h     | 11 ++++++++++-
 .../AthAllocators/ArenaHeapSTLAllocator.icc   | 19 ++++---------------
 .../AthAllocators/ArenaPoolSTLAllocator.h     |  5 ++++-
 .../AthAllocators/ArenaPoolSTLAllocator.icc   | 15 +--------------
 .../ArenaSharedHeapSTLAllocator.h             | 11 ++++++++++-
 .../ArenaSharedHeapSTLAllocator.icc           | 18 ++++--------------
 .../test/ArenaHeapSTLAllocator_test.cxx       |  6 ++++++
 .../test/ArenaPoolSTLAllocator_test.cxx       |  6 ++++++
 .../test/ArenaSharedHeapSTLAllocator_test.cxx |  6 ++++++
 9 files changed, 51 insertions(+), 46 deletions(-)

diff --git a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h
index bec3954769ff..bbde5203abee 100644
--- a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h
+++ b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h
@@ -43,6 +43,7 @@
 
 
 #include "AthAllocators/ArenaHeapAllocator.h"
+#include "CxxUtils/concepts.h"
 #include "CxxUtils/checker_macros.h"
 #include <string>
 
@@ -199,7 +200,9 @@ public:
 
   /// Convert a reference to an address.
   pointer address (reference x) const;
-  const_pointer address (const_reference x) const;
+  ATH_MEMBER_REQUIRES(!(std::is_same_v<reference,const_reference>),
+                      const_pointer)
+  address (const_reference x) const { return &x; }
 
 
   /**
@@ -215,6 +218,12 @@ public:
    * @param n Number of objects to deallocate.  Must be 1.
    */
   void deallocate (pointer, size_type n);
+  ATH_MEMBER_REQUIRES(!(std::is_same_v<pointer,const_pointer>), void)
+  deallocate (const_pointer p, size_type n) const
+  {
+    pointer p_nc ATLAS_THREAD_SAFE = const_cast<pointer>(p);
+    deallocate (p_nc, n);
+  }
 
 
   /**
diff --git a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc
index e1271cd79a15..aac7c863cee7 100644
--- a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc
@@ -201,19 +201,6 @@ ArenaHeapSTLAllocator<T, VETO>::address (reference x) const
 }
 
 
-/**
- * @brief Convert a reference to an address.
- */
-template <class T, class VETO>
-inline
-typename ArenaHeapSTLAllocator<T, VETO>::const_pointer
-ArenaHeapSTLAllocator<T, VETO>::address (const_reference x) const
-{
-  return &x;
-}
-
-
-
 /**
  * @brief Allocate new objects.
  * @param n Number of objects to allocate.  Must be 1.
@@ -248,7 +235,9 @@ void ArenaHeapSTLAllocator<T, VETO>::deallocate (pointer p, size_type
                              )
 {
   assert (n == 1);
-  m_pool.free (reinterpret_cast<ArenaHeapAllocator::pointer> (p));
+  using pointer_nc = std::remove_const_t<T>*;
+  pointer_nc pp ATLAS_THREAD_SAFE = const_cast<pointer_nc>(p);
+  m_pool.free (reinterpret_cast<ArenaHeapAllocator::pointer> (pp));
 }
 
 
@@ -276,7 +265,7 @@ template <class... Args>
 inline
 void ArenaHeapSTLAllocator<T, VETO>::construct (pointer p, Args&&... args)
 {
-  new (reinterpret_cast<void*>(p)) T(std::forward<Args>(args)...);
+  new (p) T(std::forward<Args>(args)...);
 }
 
 
diff --git a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h
index 0c9a21a9b6c9..b29487aa8102 100644
--- a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h
+++ b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h
@@ -54,6 +54,7 @@
 
 
 #include "AthAllocators/ArenaPoolAllocator.h"
+#include "CxxUtils/concepts.h"
 #include "CxxUtils/checker_macros.h"
 #include <string>
 #include <type_traits>
@@ -212,7 +213,9 @@ public:
 
   /// Convert a reference to an address.
   pointer address (reference x) const;
-  const_pointer address (const_reference x) const;
+  ATH_MEMBER_REQUIRES(!(std::is_same_v<reference,const_reference>),
+                      const_pointer)
+  address (const_reference x) const { return &x; }
 
 
   /**
diff --git a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc
index 2e3215521752..ce8589816673 100644
--- a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc
@@ -198,19 +198,6 @@ ArenaPoolSTLAllocator<T, VETO>::address (reference x) const
 }
 
 
-/**
- * @brief Convert a reference to an address.
- */
-template <class T, class VETO>
-inline
-typename ArenaPoolSTLAllocator<T, VETO>::const_pointer
-ArenaPoolSTLAllocator<T, VETO>::address (const_reference x) const
-{
-  return &x;
-}
-
-
-
 /**
  * @brief Allocate new objects.
  * @param n Number of objects to allocate.  Must be 1.
@@ -276,7 +263,7 @@ template <class... Args>
 inline
 void ArenaPoolSTLAllocator<T, VETO>::construct (pointer p, Args&&... args)
 {
-  new (reinterpret_cast<void*>(p)) T(std::forward<Args>(args)...);
+  new (p) T(std::forward<Args>(args)...);
 }
 
 
diff --git a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h
index 12a7e096566d..96fef82ab315 100644
--- a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h
+++ b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h
@@ -63,6 +63,7 @@
 #include "AthAllocators/ArenaHeapAllocator.h"
 #include "AthAllocators/ArenaHeapSTLAllocator.h"
 #include "AthAllocators/ArenaAllocatorRegistry.h"
+#include "CxxUtils/concepts.h"
 #include <string>
 #include <vector>
 
@@ -316,7 +317,9 @@ public:
 
   /// Convert a reference to an address.
   pointer address (reference x) const;
-  const_pointer address (const_reference x) const;
+  ATH_MEMBER_REQUIRES(!(std::is_same_v<reference,const_reference>),
+                      const_pointer)
+  address (const_reference x) const { return &x; }
 
 
   /**
@@ -332,6 +335,12 @@ public:
    * @param n Number of objects to deallocate.  Must be 1.
    */
   void deallocate (pointer, size_type n);
+  ATH_MEMBER_REQUIRES(!(std::is_same_v<pointer,const_pointer>), void)
+  deallocate (const_pointer p, size_type n) const
+  {
+    pointer p_nc ATLAS_THREAD_SAFE = const_cast<pointer>(p);
+    deallocate (p_nc, n);
+  }
 
 
   /**
diff --git a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc
index eed3dae4cd73..0f9312705200 100644
--- a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc
+++ b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc
@@ -273,18 +273,6 @@ ArenaSharedHeapSTLAllocator<T>::address (reference x) const
 }
 
 
-/**
- * @brief Convert a reference to an address.
- */
-template <class T>
-inline
-typename ArenaSharedHeapSTLAllocator<T>::const_pointer
-ArenaSharedHeapSTLAllocator<T>::address (const_reference x) const
-{
-  return &x;
-}
-
-
 /**
  * @brief Allocate new objects.
  * @param n Number of objects to allocate.  Must be 1.
@@ -319,7 +307,9 @@ void ArenaSharedHeapSTLAllocator<T>::deallocate (pointer p, size_type
                              )
 {
   assert (n == 1);
-  poolptr()->free (reinterpret_cast<ArenaAllocatorBase::pointer> (p));
+  using pointer_nc = std::remove_const_t<T>*;
+  pointer_nc pp ATLAS_THREAD_SAFE = const_cast<pointer_nc>(p);
+  poolptr()->free (reinterpret_cast<ArenaAllocatorBase::pointer> (pp));
 }
 
 
@@ -347,7 +337,7 @@ template <class... Args>
 inline
 void ArenaSharedHeapSTLAllocator<T>::construct (pointer p, Args&&... args)
 {
-  new (reinterpret_cast<void*>(p)) T(std::forward<Args>(args)...);
+  new (p) T(std::forward<Args>(args)...);
 }
 
 
diff --git a/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx b/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx
index ddc6419f0cdd..9e464a67675f 100644
--- a/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaHeapSTLAllocator_test.cxx
@@ -155,6 +155,12 @@ void test1()
 
   assert (Payload::n == 2);
   assert (Payload::v.size() == 0);
+
+  {
+    SG::ArenaHeapSTLAllocator<const Payload, int> a5;
+    const Payload* p = a5.allocate (1);
+    a5.deallocate (p, 1);
+  }
 }
 
 
diff --git a/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx b/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx
index 0dae06d846aa..d117bb9400aa 100644
--- a/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaPoolSTLAllocator_test.cxx
@@ -156,6 +156,12 @@ void test1()
 
   assert (Payload::n == 2);
   assert (Payload::v.size() == 0);
+
+  {
+    SG::ArenaPoolSTLAllocator<const Payload, int> a5;
+    const Payload* p = a5.allocate (1);
+    a5.deallocate (p, 1);
+  }
 }
 
 
diff --git a/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx b/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx
index 8c0d921e60c8..734f630edc0e 100644
--- a/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx
+++ b/Control/AthAllocators/test/ArenaSharedHeapSTLAllocator_test.cxx
@@ -172,6 +172,12 @@ void test1()
   a2.deallocate (p1, 1);
   a3.deallocate (p2, 1);
   a4.deallocate (p3, 1);
+
+  {
+    SG::ArenaSharedHeapSTLAllocator<const Payload> a5;
+    const Payload* p = a5.allocate (1);
+    a5.deallocate (p, 1);
+  }
  }
 
 
-- 
GitLab


From 6c57f19bd8fcfd51f97ea3382e1aa46c2120b1de Mon Sep 17 00:00:00 2001
From: Siarhei Harkusha <Siarhei.Harkusha@cern.ch>
Date: Wed, 22 Sep 2021 23:20:28 +0200
Subject: [PATCH 271/347] TileMonitoring: Add n%32 gain switch problem test for
 calibration runs

Test of n%32 gain switch problem has been added for calibration runs,
which actually has been implemented by Tibor.
---
 .../TileMonitoring/TileDigitsMonTool.h        |  6 +-
 .../TileMonitoring/src/TileDigitsMonTool.cxx  | 58 ++++++++++++++++---
 2 files changed, 54 insertions(+), 10 deletions(-)

diff --git a/TileCalorimeter/TileMonitoring/TileMonitoring/TileDigitsMonTool.h b/TileCalorimeter/TileMonitoring/TileMonitoring/TileDigitsMonTool.h
index bb0b10474629..79a11cbf48cb 100644
--- a/TileCalorimeter/TileMonitoring/TileMonitoring/TileDigitsMonTool.h
+++ b/TileCalorimeter/TileMonitoring/TileMonitoring/TileDigitsMonTool.h
@@ -59,7 +59,7 @@ class TileDigitsMonTool: public TilePaterMonTool
     /** A crude method to check  Read-Out ADC channel stuckbits.
      */
     int stuckBits_Amp(TH1S *hist, int adc);
-    int stuckBits_Amp2(TH1S *hist, int adc, TH2C *outhist = NULL, int ch = 0, uint8_t *stuck_probs = NULL);
+    int stuckBits_Amp2(TH1S *hist, TH1C *modhist, int adc, TH2C *outhist = NULL, int ch = 0, uint8_t *stuck_probs = NULL);
     /** Method to check global CRC and DMU CRC.
      */
     void CRCcheck(const TileDQstatus* dqStatus,
@@ -144,6 +144,7 @@ class TileDigitsMonTool: public TilePaterMonTool
       //Pointers to Histograms
       std::vector<TH1S *> m_hist0[5][64]; // ros,drawer
       std::vector<TH1S *> m_hist1[5][64][48][2]; // ros,drawer,channel,gain
+      std::vector<TH1C *> m_histC[5][64][48][2]; // ros,drawer,channel,gain
       std::vector<TH1I *> m_hist_DMUerr[5][64][48][2]; // ros,drawer,channel,gain for DMU BCID/CRC errors
       std::vector<TH2F *> m_hist2[5][64][2];
       std::vector<TProfile *> m_histP[5][64][48][2];
@@ -175,6 +176,9 @@ class TileDigitsMonTool: public TilePaterMonTool
     bool m_is12bit;
     int m_shiftnbins;
 
+    int m_zeroLimitHG;
+    int m_saturationLimitHG;
+
     SG::ReadHandleKey<TileDQstatus> m_DQstatusKey;
 };
 
diff --git a/TileCalorimeter/TileMonitoring/src/TileDigitsMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TileDigitsMonTool.cxx
index b021687ed7f8..bf82ab9914b2 100644
--- a/TileCalorimeter/TileMonitoring/src/TileDigitsMonTool.cxx
+++ b/TileCalorimeter/TileMonitoring/src/TileDigitsMonTool.cxx
@@ -76,6 +76,8 @@ TileDigitsMonTool::TileDigitsMonTool(const std::string & type, const std::string
   declareProperty("FillPedestalDifference", m_fillPedestalDifference = true);
   declareProperty("TileInfoName", m_infoName = "TileInfo");
   declareProperty("TileDQstatus", m_DQstatusKey = "TileDQstatus");
+  declareProperty("ZeroLimitHG", m_zeroLimitHG = 0);
+  declareProperty("SaturationLimitHG", m_saturationLimitHG = 1023);
 
   m_path = "/Tile/Digits"; //ROOT file directory
 }
@@ -245,6 +247,17 @@ void TileDigitsMonTool::bookHists(int ros, int drawer)
 
       m_data->m_hist1[ros][drawer][ch][adc].push_back(book1S(subDir, histName, histTitle, m_i_ADCmax + 1, -0.5, m_i_ADCmax + 0.5));
 
+      //eventnumber % 32 for n/32 gain switch failure
+      sStr.str("");
+      sStr << moduleName << "_ch_" << sCh << gain[gn] << "_evtn_mod32";
+      histName = sStr.str();
+
+      sStr.str("");
+      sStr << moduleName << " CH " << ch << gain[3 + gn] << " event number % 32";
+      histTitle = sStr.str();
+
+      m_data->m_histC[ros][drawer][ch][adc].push_back(book1C(subDir, histName, histTitle, 32, -0.5, 31.5));
+
       // average profile for a given channel/gain
       sStr.str("");
       sStr << moduleName << "_ch_" << sCh << gain[gn] << "_prof";
@@ -441,6 +454,8 @@ StatusCode TileDigitsMonTool::fillHists()
       adc_id = tileDigits->adc_HWID();
       int chan = m_tileHWID->channel(adc_id);
       int gain = (m_bigain) ? m_tileHWID->adc(adc_id) : 0; // ignore gain in monogain run
+
+      m_data->m_histC[ros][drawer][chan][gain][0]->Fill(m_nEvents % 32, 1.0);
       
       std::vector<float> vdigits = tileDigits->samples();
       
@@ -631,13 +646,14 @@ StatusCode TileDigitsMonTool::finalHists()
           sStr.str("");
           sStr << moduleName << gain[3 + gn] << " Stuck bits and saturation";
           histTitle = sStr.str();
-          m_data->m_final_hist_stucks[ros][drawer][adc] = book2C(subDir, histName, histTitle, 48, 0.0, 48.0, 6, 0., 6.);
+          m_data->m_final_hist_stucks[ros][drawer][adc] = book2C(subDir, histName, histTitle, 48, 0.0, 48.0, 7, 0., 7.);
           m_data->m_final_hist_stucks[ros][drawer][adc]->GetYaxis()->SetBinLabel(1, "SB 0");
           m_data->m_final_hist_stucks[ros][drawer][adc]->GetYaxis()->SetBinLabel(2, "SB 1,2");
           m_data->m_final_hist_stucks[ros][drawer][adc]->GetYaxis()->SetBinLabel(3, "SB 3,4");
           m_data->m_final_hist_stucks[ros][drawer][adc]->GetYaxis()->SetBinLabel(4, "SB 5-9");
           m_data->m_final_hist_stucks[ros][drawer][adc]->GetYaxis()->SetBinLabel(5, "zeros");
           m_data->m_final_hist_stucks[ros][drawer][adc]->GetYaxis()->SetBinLabel(6, "saturation");
+          m_data->m_final_hist_stucks[ros][drawer][adc]->GetYaxis()->SetBinLabel(7, "n % 32");
 
           for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) {
 
@@ -729,7 +745,9 @@ StatusCode TileDigitsMonTool::finalHists()
               }
             }
             m_data->m_final_hist1[ros][drawer][adc][3]->SetBinContent(channel + 1, weight);
-            stuckBits_Amp2(hist, adc, m_data->m_final_hist_stucks[ros][drawer][adc], channel, m_data->m_stuck_probs[ros][drawer][channel][adc]);
+            stuckBits_Amp2(hist, m_data->m_histC[ros][drawer][channel][adc][0], adc,
+                           m_data->m_final_hist_stucks[ros][drawer][adc], channel,
+                           m_data->m_stuck_probs[ros][drawer][channel][adc]);
           } // end of loop over channels
 
           // BCID
@@ -1402,7 +1420,7 @@ int TileDigitsMonTool::stuckBits_Amp(TH1S * hist, int /*adc*/) {
 }
 
 /* version 2. */
-int TileDigitsMonTool::stuckBits_Amp2(TH1S * hist, int /*adc*/, TH2C *outhist, int ch, uint8_t *stuck_probs) {
+int TileDigitsMonTool::stuckBits_Amp2(TH1S * hist, TH1C *modhist, int gain, TH2C *outhist, int ch, uint8_t *stuck_probs) {
 
   if (hist->GetEntries() < 1000)  return 0; /* too few events (1000 / N_samples) in histogram, ignore */
 
@@ -1415,6 +1433,9 @@ int TileDigitsMonTool::stuckBits_Amp2(TH1S * hist, int /*adc*/, TH2C *outhist, i
   int f; // flip-flop of non-zero contents of previous bin
   int cm, cp; // previous and next bin contents
   double prob; // probability
+  int zero_limit, saturation_limit;
+  zero_limit = gain ? m_zeroLimitHG : 0;
+  saturation_limit = gain ? m_saturationLimitHG : m_i_ADCmax;
   cp = hist->GetBinContent(1);
   f = !!cp;
   if (f) first_non0 = 0;
@@ -1527,24 +1548,43 @@ int TileDigitsMonTool::stuckBits_Amp2(TH1S * hist, int /*adc*/, TH2C *outhist, i
     outhist->Fill((double) ch, 1., sb_prob[1]);
     outhist->Fill((double) ch, 2., sb_prob[2]);
     outhist->Fill((double) ch, 3., sb_prob[3]);
-    if (first_non0 == m_i_ADCmax)
+    if (first_non0 >= saturation_limit)
       outhist->Fill((double) ch, 5., 100.);
-    else if (last_non0 == m_i_ADCmax) {
+    else if (last_non0 >= saturation_limit) {
       double frac;
-      frac = 100. * (double) hist->GetBinContent(m_i_ADCmax + 1) / hist->GetEntries();
+      int saturation_entries = 0;
+      int maxADC = m_i_ADCmax + 1;
+      for  (i = saturation_limit + 1; i <= maxADC; ++i)
+        saturation_entries += hist->GetBinContent(i);
+      frac = 100. * (double) saturation_entries / hist->GetEntries();
       if (frac > 0. && frac < 1.) frac = 1.;
       if (frac > 99. && frac < 100.) frac = 99.;
       outhist->Fill((double) ch, 5., frac);
     }
-    if (last_non0 == 0)
+    if (last_non0 <= zero_limit)
       outhist->Fill((double) ch, 4., 100.);
-    else if (first_non0 == 0) {
+    else if (first_non0 <= zero_limit) {
       double frac;
-      frac = 100. * (double) hist->GetBinContent(1) / hist->GetEntries();
+      int zero_entries = 0;
+      for  (i = 1; i <= zero_limit + 1; ++i)
+        zero_entries += hist->GetBinContent(i);
+      frac = 100. * (double) zero_entries / hist->GetEntries();
       if (frac > 0. && frac < 1.) frac = 1.;
       if (frac > 99. && frac < 100.) frac = 99.;
       outhist->Fill((double) ch, 4., frac);
     }
+    int mod32empty = 0;
+    int mod32full = 0;
+    for (i = 1; i <= 32; ++i) {
+      if (modhist->GetBinContent(i) == 0)
+        ++mod32empty;
+      else if (modhist->GetBinContent(i) > 20)
+        ++mod32full;
+    }
+    if (mod32empty + mod32full == 32) //skip in the case of small number of events
+      if (mod32empty != 0 && mod32full != 0) //some but not all n%32 positions have events
+        outhist->Fill((double) ch, 6., mod32empty);
+
     outhist->SetMaximum(100.);
   }
   return is_stack;
-- 
GitLab


From 5670b23d1e65ff1fd19a6ed6dd1eb2ad7fa4b9d5 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Sep 2021 12:19:39 -0400
Subject: [PATCH 272/347] AthenaServices: Fix duplicate clids.

Fix a couple duplicate clid values in classes used for tests.
---
 .../share/AthenaOutputStream_test.ref         | 279 +++++++++++++++++-
 Control/AthenaServices/test/FooBar.h          |   6 +-
 2 files changed, 269 insertions(+), 16 deletions(-)

diff --git a/Control/AthenaServices/share/AthenaOutputStream_test.ref b/Control/AthenaServices/share/AthenaOutputStream_test.ref
index 3b2df63383f7..6349e3b58e1e 100644
--- a/Control/AthenaServices/share/AthenaOutputStream_test.ref
+++ b/Control/AthenaServices/share/AthenaOutputStream_test.ref
@@ -1,23 +1,123 @@
 *** AthenaOutputStream_test starts ***
 
 
+Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/rootaccess/build-clang/joboptions/AthenaServices/AthenaOutputStream_test.txt
+JobOptionsSvc        INFO # =======> /home/sss/atlas/rootaccess/build-clang/joboptions/AthenaServices/AthenaOutputStream_test.txt
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 2
+JobOptionsSvc        INFO # (6,1): StoreGateSvc.OutputLevel = 2
+JobOptionsSvc        INFO # (8,1): AthenaOutputStream.OutputLevel = 1
+JobOptionsSvc        INFO # (10,1): AthenaOutputStream.ItemList = ["Bar#uno", "Bar#due", "Bar#tre", "8101#*", "Fee#quattro", "Fee!#cinque", "Baz#sei", "BazAuxContainer#seiAux.aaa.ccc", "Baz#comp", "BazAuxContainer#compAux.foo.bar.zzz", "13#*"]
+JobOptionsSvc        INFO # (20,1): AthenaOutputStream.CompressionBitsHigh = 10
+JobOptionsSvc        INFO # (21,1): AthenaOutputStream.CompressionListHigh = ["BazAuxContainer#compAux.foo.bar"]
+JobOptionsSvc        INFO # (22,1): AthenaOutputStream.CompressionBitsLow = 16
+JobOptionsSvc        INFO # (23,1): AthenaOutputStream.CompressionListLow = ["BazAuxContainer#compAux.zzz"]
+JobOptionsSvc        INFO # (25,1): AthenaOutputStream.AcceptAlgs = ["AthenaOutputStream", "aSFQS"]
+JobOptionsSvc        INFO Job options successfully read in from /home/sss/atlas/rootaccess/build-clang/joboptions/AthenaServices/AthenaOutputStream_test.txt
+MessageSvc          DEBUG Service base class initialized successfully
 ApplicationMgr      DEBUG Getting my own properties
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Tue Sep  7 12:14:46 2021
+====================================================================================================================================
 ApplicationMgr       INFO Application Manager Configured successfully
+ServiceManager      DEBUG Initializing service AppMgrRunable
+AppMgrRunable       DEBUG Service base class initialized successfully
+ServiceManager      DEBUG Initializing service EventLoopMgr
+EventLoopMgr        DEBUG Service base class initialized successfully
+IncidentSvc         DEBUG Service base class initialized successfully
+IncidentSvc         DEBUG Adding [AbortEvent] listener '<unknown>' with priority 0
+EventDataSvc        DEBUG Service base class initialized successfully
+EventPersistenc...  DEBUG Service base class initialized successfully
+AlgExecStateSvc     DEBUG Service base class initialized successfully
 EventLoopMgr      WARNING Unable to locate service "EventSelector" 
 EventLoopMgr      WARNING No events will be processed from external input.
+HistogramDataSvc    DEBUG Service base class initialized successfully
+HistogramPersis...  DEBUG Service base class initialized successfully
+HistogramPersis...  DEBUG Histograms saving not required.
 ApplicationMgr       INFO Application Manager Initialized successfully
 ApplicationMgr Ready
+ClassIDSvc          DEBUG Service base class initialized successfully
+IncidentSvc         DEBUG Adding [ModuleLoaded] listener 'ClassIDSvc' with priority 100
+ClassIDSvc          DEBUG processCLIDDB: read 1678 entries from CLIDDB file: /home/sss/atlas/rootaccess/build-clang/share/clid.db
+ClassIDSvc           INFO getRegistryEntries: read 1758 CLIDRegistry entries for module ALL
+StoreGateSvc        DEBUG Service base class initialized successfully
+StoreGateSvc        DEBUG trying to create store SGImplSvc/StoreGateSvc_Impl
+StoreGateSvc_Impl   DEBUG Service base class initialized successfully
+ProxyProviderSvc    DEBUG Service base class initialized successfully
+IncidentSvc         DEBUG Adding [EndEvent] listener 'StoreGateSvc' with priority 100
+IncidentSvc         DEBUG Adding [BeginEvent] listener 'StoreGateSvc' with priority 100
+ClassIDSvc           INFO getRegistryEntries: read 2213 CLIDRegistry entries for module ALL
+AthenaOutputStream  DEBUG Property update for OutputLevel : new value = 1
+ToolSvc             DEBUG Service base class initialized successfully
+AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
+AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
+AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
+AthenaOutputStreamVERBOSE ServiceLocatorHelper::service: found service EventDataSvc
+TimelineSvc         DEBUG Service base class initialized successfully
+TimelineSvc         DEBUG initialize
+AthenaOutputStreamVERBOSE ServiceLocatorHelper::service: found service TimelineSvc
+AthenaOutputStream  DEBUG In initialize 
+AthenaOutputStream  DEBUG Found IDecisionSvc.
 DecisionSvc          INFO Inserting stream: AthenaOutputStream with no Algs
+AthenaOutputStream  DEBUG Trying to add AthenaOutputStream of stream AthenaOutputStream to AcceptAlg list
+AthenaOutputStream  DEBUG Trying to add aSFQS of stream AthenaOutputStream to AcceptAlg list
+AthenaOutputStream  DEBUG End initialize 
+AthenaOutputStream  DEBUG In initialize
+AthenaOutputStream  DEBUG Found StoreGateSvc store.
 AthDictLoaderSvc     INFO in initialize...
 AthDictLoaderSvc     INFO acquired Dso-registry
+AthTPCnvSvc         DEBUG Service base class initialized successfully
+ItemListSvc         DEBUG ItemListSvc initialize
 OutputStreamSeq...  DEBUG Initializing OutputStreamSequencerSvc
+AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
 AthenaOutputStr...   INFO Initializing AthenaOutputStream.AthenaOutputStreamTool
+DataModelCompatSvc  DEBUG Service base class initialized successfully
+DataModelCompatSvc  DEBUG FILE:LINE (StatusCode DataModelCompatSvc::initialize()): running
+IncidentSvc         DEBUG Adding [BeginProcessing] listener 'DataModelCompatSvc' with priority 0
+IncidentSvc         DEBUG Adding [BeginEvent] listener 'DataModelCompatSvc' with priority 0
+PoolSvc             DEBUG Service base class initialized successfully
+IoComponentMgr      DEBUG --> initialize()
+IoComponentMgr      DEBUG Service base class initialized successfully
+IncidentSvc         DEBUG Adding [BeginOutputFile] listener 'IoComponentMgr' with priority 100
+IncidentSvc         DEBUG Adding [BeginInputFile] listener 'IoComponentMgr' with priority 100
+IoComponentMgr      DEBUG --> io_register(PoolSvc)
+IoComponentMgr      DEBUG     registering IoComponent "PoolSvc"
+IoComponentMgr      DEBUG --> io_register(PoolSvc,W,PoolFileCatalog.xml)
+IoComponentMgr      DEBUG --> io_hasitem()
+PoolSvc              INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok]
+PoolSvc              INFO Set connectionsvc retry/timeout/IDLE timeout to  'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled
+PoolSvc              INFO Frontier compression level set to 5
+DBReplicaSvc        DEBUG Service base class initialized successfully
+DBReplicaSvc        DEBUG HOSTNAME  has no domain - try hostname --fqdn
+DBReplicaSvc        DEBUG HOSTNAME from fqdn: karma
+DBReplicaSvc         INFO Read replica configuration from /home/sss/atlas/rootaccess/build-clang/share/dbreplica.config
+DBReplicaSvc         INFO No specific match for domain found - use default fallback
+DBReplicaSvc        DEBUG Candidate server atlas_dd (priority 5)
+DBReplicaSvc         INFO Total of 1 servers found for host karma [atlas_dd ]
+PoolSvc              INFO Successfully setup replica sorting algorithm
 PoolSvc             DEBUG OutputLevel is 2
+PoolSvc              INFO Setting up APR FileCatalog and Streams
+Gaudi::MultiFil...  DEBUG Service base class initialized successfully
+PoolSvc              INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml
+DbSession            INFO     Open     DbSession    
+Domain[ROOT_All]     INFO >   Access   DbDomain     READ      [ROOT_All] 
+ChronoStatSvc       DEBUG Service base class initialized successfully
+IoComponentMgr      DEBUG --> io_register(AthenaPoolCnvSvc)
+IoComponentMgr      DEBUG     registering IoComponent "AthenaPoolCnvSvc"
 AthenaPoolCnvSvc    DEBUG Registering all Tools in ToolHandleArray OutputStreamingTool
 ServiceManager      FATAL No Service factory for DetectorStore available.
 AthenaOutputStr...  ERROR ServiceLocatorHelper::service: can not locate service DetectorStore
+AthenaOutputStream   INFO Found HelperTools = PrivateToolHandleArray([])
 AthenaOutputStream   INFO Data output: DidNotNameOutput.root
-AthenaOutputStream   INFO ../O reinitialization...
+IoComponentMgr      DEBUG --> io_register(AthenaOutputStream)
+IoComponentMgr      DEBUG     registering IoComponent "AthenaOutputStream"
+IoComponentMgr      DEBUG --> io_register(AthenaOutputStream,W,DidNotNameOutput.root)
+IoComponentMgr      DEBUG --> io_hasitem()
+AthenaOutputStream   INFO I/O reinitialization...
+IncidentSvc         DEBUG Adding [MetaDataStop] listener 'AthenaOutputStream' with priority 50
+AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
+ClassIDSvc           INFO getRegistryEntries: read 721 CLIDRegistry entries for module ALL
 AthDictLoaderSvc     INFO could not retrieve typename for clid [13]
 AthDictLoaderSvc    DEBUG loading [Foo (from clid=8101)]...
 AthDictLoaderSvc    DEBUG loading [Foo]...
@@ -45,22 +145,22 @@ AthDictLoaderSvc    DEBUG loading [Fee]...
 AthDictLoaderSvc    DEBUG loading [Fee (from clid=8108)]...
 AthDictLoaderSvc    DEBUG loading [Fee]...
 AthDictLoaderSvc    DEBUG loading [Fee]...
-AthDictLoaderSvc    DEBUG loading [Baz (from clid=8111)]...
+AthDictLoaderSvc    DEBUG loading [Baz (from clid=8211)]...
 AthDictLoaderSvc    DEBUG loading [Baz]...
 AthDictLoaderSvc    DEBUG loading [Baz]...
 AthDictLoaderSvc    DEBUG loading [Baz (from typeinfo)]...
 AthDictLoaderSvc    DEBUG loading [Baz]...
-AthDictLoaderSvc    DEBUG loading [Baz (from clid=8111)]...
+AthDictLoaderSvc    DEBUG loading [Baz (from clid=8211)]...
 AthDictLoaderSvc    DEBUG loading [Baz]...
 AthDictLoaderSvc    DEBUG loading [Baz]...
 AthDictLoaderSvc    DEBUG loading [Baz (from typeinfo)]...
 AthDictLoaderSvc    DEBUG loading [Baz]...
-AthDictLoaderSvc    DEBUG loading [BazAuxContainer (from clid=8112)]...
+AthDictLoaderSvc    DEBUG loading [BazAuxContainer (from clid=8212)]...
 AthDictLoaderSvc    DEBUG loading [BazAuxContainer]...
 AthDictLoaderSvc    DEBUG loading [BazAuxContainer]...
 AthDictLoaderSvc    DEBUG loading [BazAuxContainer (from typeinfo)]...
 AthDictLoaderSvc    DEBUG loading [BazAuxContainer]...
-AthDictLoaderSvc    DEBUG loading [BazAuxContainer (from clid=8112)]...
+AthDictLoaderSvc    DEBUG loading [BazAuxContainer (from clid=8212)]...
 AthDictLoaderSvc    DEBUG loading [BazAuxContainer]...
 AthDictLoaderSvc    DEBUG loading [BazAuxContainer]...
 AthDictLoaderSvc    DEBUG loading [BazAuxContainer (from typeinfo)]...
@@ -68,34 +168,187 @@ AthDictLoaderSvc    DEBUG loading [BazAuxContainer]...
 AthDictLoaderSvc    DEBUG loading [Token]...
 AthenaOutputStream   INFO Either high or low (or both) float compression lists are defined. Float compression will be applied.
 AthenaOutputStream   INFO High compression will use 10 mantissa bits, and low compression will use 16 mantissa bits.
+AthenaOutputStream  DEBUG End initialize
+AthenaOutputStreamVERBOSE ServiceLocatorHelper::service: found service AlgExecStateSvc
 AlgExecStateSvc     DEBUG preInit: will add Alg AthenaOutputStream later
+AthenaOutputStream  DEBUG input handles: 0
+AthenaOutputStream  DEBUG output handles: 2
+AthenaOutputStream  DEBUG Registering all Tools in ToolHandleArray HelperTools
+AthenaOutputStream  DEBUG Adding private ToolHandle tool AthenaOutputStream.AthenaOutputStreamTool (AthenaOutputStreamTool)
+AthenaOutputStream  DEBUG Data Deps for AthenaOutputStream
   + INPUT IGNORED  ( 'AthenaAttributeList' , '' ) 
   + OUTPUT  ( 'SG::CompressionInfo' , 'StoreGateSvc+CompressionInfo_AthenaOutputStream' ) 
   + OUTPUT  ( 'SG::SelectionVetoes' , 'StoreGateSvc+SelectionVetoes_AthenaOutputStream' ) 
+StoreGateSvc        DEBUG Recorded object @0x4e18010 with key uno of type Foo(CLID 8101)
+ in DataObject @0x35f0a10
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x4e18060 with key due of type Foo(CLID 8101)
+ in DataObject @0x4e0f4a0
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x4e0f570 with key uno of type Bar(CLID 8107)
+ in DataObject @0x4e0e530
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x4e0e6b0 with key due of type Bar(CLID 8107)
+ in DataObject @0x4e0e700
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x4e0e870 with key quattro of type Bar(CLID 8107)
+ in DataObject @0x4e0e8c0
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x4e0ea50 with key cinque of type Bar(CLID 8107)
+ in DataObject @0x4e0eaa0
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x4e0e850 with key sei of type Baz(CLID 8211)
+ in DataObject @0x4e0f110
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x4e0a8d0 with key seiAux. of type BazAuxContainer(CLID 8212)
+ in DataObject @0x36555c0
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x4e0f1e0 with key comp of type Baz(CLID 8211)
+ in DataObject @0x36626e0
+ object modifiable when retrieved
+StoreGateSvc        DEBUG Recorded object @0x3656090 with key compAux. of type BazAuxContainer(CLID 8212)
+ in DataObject @0x3662b70
+ object modifiable when retrieved
+ClassIDSvc           INFO getRegistryEntries: read 9 CLIDRegistry entries for module ALL
 AthenaOutputStr...WARNING add: can not find clid 13 in clid db
+AthenaOutputStream  DEBUG addItemObjects(13,"*") called
+AthenaOutputStream  DEBUG            Key:*
+AthenaOutputStr...  DEBUG Property update for OutputLevel : new value = 1
+AthenaOutputStream  DEBUG      Comp Attr 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr 0 with 16 mantissa bits.
 MetaDataSvc          INFO Initializing MetaDataSvc
+InputMetaDataStore  DEBUG Service base class initialized successfully
+InputMetaDataStore  DEBUG trying to create store SGImplSvc/InputMetaDataStore_Impl
+InputMetaDataSt...  DEBUG Service base class initialized successfully
+IncidentSvc         DEBUG Adding [EndEvent] listener 'InputMetaDataStore' with priority 100
+IncidentSvc         DEBUG Adding [BeginEvent] listener 'InputMetaDataStore' with priority 100
+MetaDataStore       DEBUG Service base class initialized successfully
+MetaDataStore       DEBUG trying to create store SGImplSvc/MetaDataStore_Impl
+MetaDataStore_Impl  DEBUG Service base class initialized successfully
+IncidentSvc         DEBUG Adding [EndEvent] listener 'MetaDataStore' with priority 100
+IncidentSvc         DEBUG Adding [BeginEvent] listener 'MetaDataStore' with priority 100
+FileMgr             DEBUG Service base class initialized successfully
+FileMgr             DEBUG Successfully registered handler for tech "ROOT"
+FileMgr             DEBUG Successfully registered handler for tech "POSIX"
+MetaDataSvc          INFO Found MetaDataTools = PublicToolHandleArray([])
+IncidentSvc         DEBUG Adding [FirstInputFile] listener 'MetaDataSvc' with priority 80
+IncidentSvc         DEBUG Adding [BeginInputFile] listener 'MetaDataSvc' with priority 80
+IncidentSvc         DEBUG Adding [EndInputFile] listener 'MetaDataSvc' with priority 10
+IoComponentMgr      DEBUG --> io_register(MetaDataSvc)
+IoComponentMgr      DEBUG     registering IoComponent "MetaDataSvc"
 MetaDataSvc         DEBUG Registering all Tools in ToolHandleArray MetaDataTools
 MetaDataSvc         DEBUG Not translating metadata item ID #13
+AthenaOutputStream  DEBUG  Failed to receive proxy iterators from StoreGate for 13,"*". Skipping
+AthenaOutputStream  DEBUG addItemObjects(8101,"*") called
+AthenaOutputStream  DEBUG            Key:*
+AthenaOutputStream  DEBUG      Comp Attr 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr 0 with 16 mantissa bits.
 MetaDataSvc         DEBUG Not translating metadata item ID #8101
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], *, *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [, ], *, *)
+AthenaOutputStream  DEBUG  Added object 8101,"due"
+AthenaOutputStream  DEBUG  Added object 8101,"uno"
+AthenaOutputStream  DEBUG addItemObjects(8107,"due") called
+AthenaOutputStream  DEBUG            Key:due
+AthenaOutputStream  DEBUG      Comp Attr 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr 0 with 16 mantissa bits.
 MetaDataSvc         DEBUG Not translating metadata item ID #8107
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], due, *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [due], due, *)
+AthenaOutputStream  DEBUG  Added object 8107,"due"
+AthenaOutputStream  DEBUG addItemObjects(8107,"tre") called
+AthenaOutputStream  DEBUG            Key:tre
+AthenaOutputStream  DEBUG      Comp Attr 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr 0 with 16 mantissa bits.
 MetaDataSvc         DEBUG Not translating metadata item ID #8107
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], tre, *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [tre], tre, *)
+AthenaOutputStreamVERBOSE Calling matchKey( [tre], cinque)
+AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
+AthenaOutputStreamVERBOSE Done calling matchKey( [tre], cinque) with result: 0
+AthenaOutputStreamVERBOSE Calling matchKey( [tre], due)
+AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
+AthenaOutputStreamVERBOSE Done calling matchKey( [tre], due) with result: 0
+AthenaOutputStreamVERBOSE Calling matchKey( [tre], quattro)
+AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
+AthenaOutputStreamVERBOSE Done calling matchKey( [tre], quattro) with result: 0
+AthenaOutputStreamVERBOSE Calling matchKey( [tre], uno)
+AthenaOutputStreamVERBOSE Couldn't match every sub-string... return: 0
+AthenaOutputStreamVERBOSE Done calling matchKey( [tre], uno) with result: 0
+AthenaOutputStream  DEBUG  No object matching 8107,"tre" found
+AthenaOutputStream  DEBUG addItemObjects(8107,"uno") called
+AthenaOutputStream  DEBUG            Key:uno
+AthenaOutputStream  DEBUG      Comp Attr 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr 0 with 16 mantissa bits.
 MetaDataSvc         DEBUG Not translating metadata item ID #8107
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], uno, *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [uno], uno, *)
+AthenaOutputStream  DEBUG  Added object 8107,"uno"
+AthenaOutputStream  DEBUG addItemObjects(8108,"cinque") called
+AthenaOutputStream  DEBUG            Key:cinque
+AthenaOutputStream  DEBUG      Comp Attr 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr 0 with 16 mantissa bits.
 MetaDataSvc         DEBUG Not translating metadata item ID #8108
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], cinque, *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [cinque], cinque, *)
+AthenaOutputStream  DEBUG  Added object 8108,"cinque"
+AthenaOutputStream  DEBUG addItemObjects(8108,"quattro") called
+AthenaOutputStream  DEBUG            Key:quattro
+AthenaOutputStream  DEBUG      Comp Attr 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr 0 with 16 mantissa bits.
 MetaDataSvc         DEBUG Not translating metadata item ID #8108
-MetaDataSvc         DEBUG Not translating metadata item ID #8111
-MetaDataSvc         DEBUG Not translating metadata item ID #8111
-MetaDataSvc         DEBUG Not translating metadata item ID #8112
-MetaDataSvc         DEBUG Not translating metadata item ID #8112
-8112 compAux.
-8112 seiAux.
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], quattro, *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [quattro], quattro, *)
+AthenaOutputStream  DEBUG  Added object 8108,"quattro"
+AthenaOutputStream  DEBUG addItemObjects(8211,"comp") called
+AthenaOutputStream  DEBUG            Key:comp
+AthenaOutputStream  DEBUG      Comp Attr 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr 0 with 16 mantissa bits.
+MetaDataSvc         DEBUG Not translating metadata item ID #8211
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], comp, *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [comp], comp, *)
+AthenaOutputStream  DEBUG  Added object 8211,"comp"
+AthenaOutputStream  DEBUG addItemObjects(8211,"sei") called
+AthenaOutputStream  DEBUG            Key:sei
+AthenaOutputStream  DEBUG      Comp Attr 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr 0 with 16 mantissa bits.
+MetaDataSvc         DEBUG Not translating metadata item ID #8211
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], sei, *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [sei], sei, *)
+AthenaOutputStream  DEBUG  Added object 8211,"sei"
+AthenaOutputStream  DEBUG addItemObjects(8212,"compAux.") called
+AthenaOutputStream  DEBUG            Key:compAux.
+AthenaOutputStream  DEBUG       Aux Attr:foo.bar.zzz
+AthenaOutputStream  DEBUG      Comp Attr 2 with 10 mantissa bits.
+AthenaOutputStream  DEBUG        >> bar
+AthenaOutputStream  DEBUG        >> foo
+AthenaOutputStream  DEBUG      Comp Attr 1 with 16 mantissa bits.
+AthenaOutputStream  DEBUG        >> zzz
+MetaDataSvc         DEBUG Not translating metadata item ID #8212
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], compAux., *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [compAux.], compAux., *)
+AthenaOutputStream  DEBUG  Added object 8212,"compAux."
+AthenaOutputStream  DEBUG Container comp has 1 variables that'll be lossy float compressed with 10 mantissa bits
+AthenaOutputStream  DEBUG Container comp has 1 variables that'll be lossy float compressed with 16 mantissa bits
+AthenaOutputStream  DEBUG addItemObjects(8212,"seiAux.") called
+AthenaOutputStream  DEBUG            Key:seiAux.
+AthenaOutputStream  DEBUG       Aux Attr:aaa.ccc
+AthenaOutputStream  DEBUG      Comp Attr 0 with 10 mantissa bits.
+AthenaOutputStream  DEBUG      Comp Attr 0 with 16 mantissa bits.
+MetaDataSvc         DEBUG Not translating metadata item ID #8212
+AthenaOutputStreamVERBOSE Calling tokenizeAtStep( [], seiAux., *)
+AthenaOutputStreamVERBOSE Done calling tokenizeAtStep( [seiAux.], seiAux., *)
+AthenaOutputStream  DEBUG  Added object 8212,"seiAux."
+8212 compAux.
+8212 seiAux.
 8101 due
 8101 uno
 8107 due
 8107 uno
 8108 cinque
 8107 quattro
-8111 comp
-8111 sei
+8211 comp
+8211 sei
 StoreGateSvc        DEBUG Retrieved const pointer to object SelectionVetoes_AthenaOutputStream  of type SG::SelectionVetoes(CLID 3789442)
 StoreGateSvc        DEBUG Retrieved const pointer to object CompressionInfo_AthenaOutputStream  of type SG::CompressionInfo(CLID 39950991)
 *** AthenaOutputStream_test OK ***
diff --git a/Control/AthenaServices/test/FooBar.h b/Control/AthenaServices/test/FooBar.h
index 7f26d8c656ca..b8851a385dfb 100644
--- a/Control/AthenaServices/test/FooBar.h
+++ b/Control/AthenaServices/test/FooBar.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 TEST_FOOBAR_H
@@ -43,7 +43,7 @@ class Baz
 {
 };
 SG_BASE (Baz, SG::AuxElement);
-CLASS_DEF( Baz, 8111, 0)
+CLASS_DEF( Baz, 8211, 0)
 
 
 class BazAuxContainer
@@ -51,7 +51,7 @@ class BazAuxContainer
 {
 };
 SG_BASE (BazAuxContainer, xAOD::AuxContainerBase);
-CLASS_DEF( BazAuxContainer, 8112, 0)
+CLASS_DEF( BazAuxContainer, 8212, 0)
 
 
 #endif // TEST_FOOBAR_H
-- 
GitLab


From 183f79036c4f90a48bb634d0acbb56a4881f3332 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Tue, 7 Sep 2021 19:49:01 -0400
Subject: [PATCH 273/347] CrestApi: Fix cppcheck warnings.

Fix cppcheck warnings.
---
 Database/CrestApi/doc/crest_example.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Database/CrestApi/doc/crest_example.cxx b/Database/CrestApi/doc/crest_example.cxx
index e41c3d6b3c59..813870458fbf 100644
--- a/Database/CrestApi/doc/crest_example.cxx
+++ b/Database/CrestApi/doc/crest_example.cxx
@@ -26,7 +26,7 @@ void print_path() {
   std::cout << (std::string) SURL << std::endl;
 }
 
-bool createDirTree(const std::string full_path) {
+bool createDirTree(const std::string& full_path) {
   size_t pos = 0;
   bool ret_val = true;
 
@@ -168,7 +168,7 @@ void testListTagsParams() {
   }
 }
 
-void testListTagsParams(std::string name) {
+void testListTagsParams(const std::string& name) {
   std::cout << std::endl << "test: listTagsParams" << std::endl;
   CrestClientExt myCrestClient = CrestClientExt((std::string) SURL);
 
-- 
GitLab


From a7b2035ca5337307f7bf511231552dc96b3f35b2 Mon Sep 17 00:00:00 2001
From: Riccardo Maria Bianchi <riccardo.maria.bianchi@cern.ch>
Date: Thu, 23 Sep 2021 01:41:32 +0200
Subject: [PATCH 274/347] Add DumpGeo jobOptions example to dump a Tile tag

---
 .../share/dump-geo_jobOptions_TileGeometry.py | 116 ++++++++++++++++++
 1 file changed, 116 insertions(+)
 create mode 100644 DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo_jobOptions_TileGeometry.py

diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo_jobOptions_TileGeometry.py b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo_jobOptions_TileGeometry.py
new file mode 100644
index 000000000000..4232539c0559
--- /dev/null
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/DumpGeo/share/dump-geo_jobOptions_TileGeometry.py
@@ -0,0 +1,116 @@
+# 
+# An Athena job to dump a specific, custom TileCal geometry tag
+# to a standalone GeoModel SQLite `.db` file. 
+# The .db file can then be visualized with the GeoModel's 
+# standalone visualization program `gmex`.
+#
+# How to run this jobOptions file:
+#
+# ```
+# setupATLAS
+# asetup Athena,master,latest  # (or any release where `DumpGeo` is present)
+# athena dump-geo_jobOptions_TileGeometry.py
+# ```
+#
+# At the end, you will find a `geometry.db` file in the run directory.
+# You can now open it with `gmex` on any laptop/desktop machine.
+# 
+# -----
+# Note: 
+# `gmex` is not part of Athena, for the GeoModel suite is now 
+# standalone and decoupled from Athena completely; 
+# that lets you visualize the geometry and use the all GeoModel tools 
+# on your laptop! 
+#
+# More info on `gmex` here:
+# https://geomodel.web.cern.ch
+# -----
+#
+#
+# Author: Riccardo Maria BIANCHI, <riccardo.maria.bianchi@cern.ch>
+# Initial version: Sep 2021
+#
+#
+
+
+##############
+# --- MWE 
+##############
+# No input data file here, 
+# so we set an Athena 'minimal working environment'
+
+# Create an event selector:
+import AthenaCommon.AtlasUnixGeneratorJob
+# Configure GlobalFlags
+from AthenaCommon.GlobalFlags import globalflags
+globalflags.DetGeo.set_Value_and_Lock('atlas')
+globalflags.DataSource.set_Value_and_Lock('geant4')
+
+# Generate one dummy event
+from AthenaCommon.AppMgr import AppMgr as appMgr
+appMgr.EvtMax = 0
+
+# Set conditions tag, to avoid crashes
+vp1GlobCond="OFLCOND-SDR-BS7T-05-14"
+from IOVDbSvc.CondDB import conddb
+conddb.setGlobalTag(vp1GlobCond)
+
+PoolSvc = Service("PoolSvc")
+PoolSvc.SortReplicas = False
+# --- MWE (end)
+##############
+
+
+##############
+# --- GEOMETRY
+##############
+
+#Detector setup:
+# Detector flags
+from AthenaCommon.DetFlags import DetFlags
+DetFlags.Tile_setOn()
+DetFlags.Print()
+
+# GeoModel, minimal setup
+# If wanted, here we can set a custom, global geometry tag
+globalflags.DetDescrVersion = "ATLAS-R2-2016-01-00-01"
+# with this, the default GeoModel tag for the release will be used
+from AtlasGeoModel import SetGeometryVersion
+from AtlasGeoModel import GeoModelInit
+from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
+GeoModelSvc = GeoModelSvc()
+
+
+# If wanted, we can set a specific tag for a particular sub-system
+# Here, we set a specific tag for the TileCal calorimeter
+# Get an handle on the TileCal configuration
+from TileGeoModel.TileGeoModelConf import TileDetectorTool
+GeoModelSvc.DetectorTools += [ TileDetectorTool() ]
+from AthenaCommon.GlobalFlags import jobproperties
+detDescrVersion = jobproperties.Global.DetDescrVersion()
+# Setup geometry versions
+GeoModelSvc.AtlasVersion = detDescrVersion
+GeoModelSvc.TileVersionOverride = "TileCal-GEO-12"
+# --- GEOMETRY (end)
+##############
+
+
+
+#######################
+# --- DumpGeo ALGORITHM
+#######################
+# Import the Athena's algorithms' scheduler
+from AthenaCommon.AlgSequence import AlgSequence
+topSequence = AlgSequence()
+
+#Import and schedule the DumpGeo algorithm itself:
+from DumpGeo.DumpGeoConf import DumpGeo
+topSequence += DumpGeo()
+
+DumpGeo.NoGui=True
+
+topSequence.TimeOut=0
+# --- DumpGeo ALGORITHM (end)
+#######################
+
+
-- 
GitLab


From 6b872e591d55d6d06183c39e6810fbbfc59bb3b1 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Thu, 5 Aug 2021 12:40:57 -0400
Subject: [PATCH 275/347] DecisionHandling: Fix clang warnings.

Spurious copies in range-for.
---
 Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx   |  4 ++--
 .../DecisionHandling/src/ComboHypoToolBase.cxx         |  2 +-
 Trigger/TrigSteer/DecisionHandling/src/HypoBase.cxx    | 10 +++++-----
 .../TrigSteer/DecisionHandling/src/TestHypoTool.cxx    |  4 ++--
 .../TrigSteer/DecisionHandling/src/TestInputMaker.cxx  |  4 ++--
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx b/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx
index 57d776ca4fc6..2a54bcc5da3d 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx
@@ -230,7 +230,7 @@ StatusCode ComboHypo::execute(const EventContext& context ) const {
       // Finally, the same behaviour may also be triggered by the HypoAlg adding an an int32_t decoration called "noCombo" with value 1
       // to the Decision Object.
 
-      for (const ElementLink<DecisionContainer>& dEL : it->second){
+      for (const ElementLink<DecisionContainer> dEL : it->second){
         uint32_t featureKey = 0, roiKey = 0; // The container hash of the DecisionObject's most-recent feature, and its initial ROI
         uint16_t featureIndex = 0, roiIndex = 0; // The container index of the DecisionObject's most-recent feature, and its initial ROI
         bool roiIsFullscan = false; // Will be set to true if the DecisionObject's initial ROI is flagged as FullScan
@@ -510,7 +510,7 @@ StatusCode ComboHypo::fillDecisionsMap( Combo::LegDecisionsMap &  dmap, const Ev
       ATH_MSG_DEBUG("leg ["<<legCount<<"]: ");
       const ElementLinkVector<DecisionContainer>& decisions = entry.second;
       ATH_MSG_DEBUG(" ++++ " << HLT::Identifier( entry.first ) <<" Number Decisions: "<< decisions.size());
-      for (const ElementLink<DecisionContainer>& d : decisions){
+      for (const ElementLink<DecisionContainer> d : decisions){
         ATH_MSG_DEBUG("     Decision: (ContainerKey:"<<d.dataID()<<", DecisionElementIndex:"<<d.index()<<")");
       }
       legCount++;
diff --git a/Trigger/TrigSteer/DecisionHandling/src/ComboHypoToolBase.cxx b/Trigger/TrigSteer/DecisionHandling/src/ComboHypoToolBase.cxx
index efc062e09dce..19fb6d792cde 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/ComboHypoToolBase.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/ComboHypoToolBase.cxx
@@ -192,7 +192,7 @@ StatusCode ComboHypoToolBase::selectLegs(const Combo::LegDecisionsMap& IDCombMap
     const Combo::LegDecisionsMap::const_iterator it = IDCombMap.find(legIdentifier.numeric());
 
     if (it != IDCombMap.end()) {
-      for (const ElementLink<DecisionContainer>& el : it->second) {
+      for (const ElementLink<DecisionContainer> el : it->second) {
         decisionObjectsOnLeg.emplace_back(legIdentifier, el);
       }
     }
diff --git a/Trigger/TrigSteer/DecisionHandling/src/HypoBase.cxx b/Trigger/TrigSteer/DecisionHandling/src/HypoBase.cxx
index 7761ac9a0cdd..2c5868718826 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/HypoBase.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/HypoBase.cxx
@@ -112,7 +112,7 @@ StatusCode HypoBase::recursiveValidateGraph(const ElementLink<DecisionContainer>
 
   // Continue upstream
   const ElementLinkVector<DecisionContainer> seeds = (*dEL)->objectCollectionLinks<DecisionContainer>(seedString());
-  for (const ElementLink<DecisionContainer>& seed : seeds) {
+  for (const ElementLink<DecisionContainer> seed : seeds) {
     if (fullyExploredFrom.count( (*seed) ) == 1) {
       continue; // Already fully explored from this seed and up
     }
@@ -186,7 +186,7 @@ StatusCode HypoBase::validateParentLinking(const ElementLink<DecisionContainer>&
     return StatusCode::FAILURE;
   }
 
-  for (const ElementLink<DecisionContainer>& seed : seeds) {
+  for (const ElementLink<DecisionContainer> seed : seeds) {
     if (expectedParentsPtr->count( (*seed)->name() ) == 0) {
       printErrorHeader(dEL, msg);
       msg << MSG::ERROR << "! Invalid linking from node with name '" << name << "' to one with name '"<< (*seed)->name() << "'." << endmsg;
@@ -258,7 +258,7 @@ StatusCode HypoBase::validateLogicalFlow(const ElementLink<DecisionContainer>& d
   for (const DecisionID id : decisionIDSet) {
     // For each chain that I'm passing, check how many of my parents were also passing the chain
     size_t parentsWithDecision = 0;  
-    for (const ElementLink<DecisionContainer>& seed : seeds) {
+    for (const ElementLink<DecisionContainer> seed : seeds) {
       if ( not seed.isValid() ) {
         msg << MSG::ERROR << "Invalid seed element link in recursiveValidateGraph" << endmsg;
         return StatusCode::FAILURE;
@@ -288,7 +288,7 @@ StatusCode HypoBase::validateLogicalFlow(const ElementLink<DecisionContainer>& d
       msg << MSG::ERROR << "! This Decision object is not respecting logical flow of DecisionIDs for chain: " << HLT::Identifier( id ) << endmsg;
       msg << MSG::ERROR << "! This chain's DecisionID can not be found in any parents of this Decision object:" << endmsg;
       size_t seed_n = 0;
-      for (const ElementLink<DecisionContainer>& seed : seeds) {
+      for (const ElementLink<DecisionContainer> seed : seeds) {
         msg << MSG::ERROR << "! Index:" << (*seed)->index() << " from collection:" << seed.dataID() << endmsg;
         msg << MSG::ERROR << "! " << **seed << endmsg;
         DecisionIDContainer objDecisions;      
@@ -313,7 +313,7 @@ StatusCode HypoBase::validateLogicalFlow(const ElementLink<DecisionContainer>& d
       msg << MSG::ERROR << "! As this Decision object represents the output of a HypoAlg, it must respect logical flow on all " 
         << seeds.size() << " of its parent(s):" << endmsg;
       size_t seed_n = 0;
-      for (const ElementLink<DecisionContainer>& seed : seeds) {
+      for (const ElementLink<DecisionContainer> seed : seeds) {
         msg << MSG::ERROR << "! Index:" << (*seed)->index() << " from collection:" << seed.dataID() << endmsg;
         msg << MSG::ERROR << "! " << **seed << endmsg;
         DecisionIDContainer objDecisions;      
diff --git a/Trigger/TrigSteer/DecisionHandling/src/TestHypoTool.cxx b/Trigger/TrigSteer/DecisionHandling/src/TestHypoTool.cxx
index efec693c102f..fee6154686c5 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/TestHypoTool.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/TestHypoTool.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 "TestHypoTool.h"
 #include "TrigCompositeUtils/HLTIdentifier.h"
@@ -37,7 +37,7 @@ namespace HLTTest {
       //get previous decisions
       ElementLinkVector<DecisionContainer> inputLinks = getLinkToPrevious(d);
       ATH_MSG_DEBUG("Decision "<< counter <<": Got "<<inputLinks.size()<<" input decisions");
-      for (const auto& previousDecisions: inputLinks){
+      for (const auto previousDecisions: inputLinks){
 
         TrigCompositeUtils::DecisionIDContainer objDecisions;      
         TrigCompositeUtils::decisionIDs( *previousDecisions, objDecisions );
diff --git a/Trigger/TrigSteer/DecisionHandling/src/TestInputMaker.cxx b/Trigger/TrigSteer/DecisionHandling/src/TestInputMaker.cxx
index 98bb57228a0d..43d005b59b2c 100644
--- a/Trigger/TrigSteer/DecisionHandling/src/TestInputMaker.cxx
+++ b/Trigger/TrigSteer/DecisionHandling/src/TestInputMaker.cxx
@@ -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
 */
 
 #include "TestInputMaker.h"
@@ -62,7 +62,7 @@ namespace HLTTest {
     for (const  auto outputDecision : *outputHandle){ 
       const ElementLinkVector<DecisionContainer> inputLinks = getLinkToPrevious(outputDecision);
       ATH_MSG_DEBUG("Element "<< count << " has " << inputLinks.size() <<" previous links");
-      for (const auto& input: inputLinks){
+      for (const auto input: inputLinks){
         ATH_MSG_DEBUG( " -- Got seed link to input  "<<input.dataID() <<" and index "<< input.index() );
         const Decision* inputDecision = *input;
         const auto roiELInfo = TrigCompositeUtils::findLink<TrigRoiDescriptorCollection>( inputDecision,  m_roisLink.value());
-- 
GitLab


From 5531a2c58b04f508a233b04f548a931930ab3444 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 10 Sep 2021 15:33:35 -0400
Subject: [PATCH 276/347] MuonTrackMonitoring: Fix clang warning.

Spurious copy in range-for.
---
 .../MuonTrackMonitoring/src/MuonTrackMonitorAlgorithm.cxx   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonTrackMonitorAlgorithm.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonTrackMonitorAlgorithm.cxx
index 6a5b2522e23c..a4269e0089d1 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonTrackMonitorAlgorithm.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonTrackMonitorAlgorithm.cxx
@@ -246,10 +246,10 @@ StatusCode	MuonTrackMonitorAlgorithm::analyseCombinedTracks(const xAOD::MuonCont
 	std::vector<const xAOD::Muon*>	vecNonCombinedMuonsHighPT;
 	std::vector<const xAOD::Muon*>	vecNonCombinedMuons;
 
-	for(const auto& muon : Muons) {
+	for(const auto muon : Muons) {
 		xAOD::Muon::MuonType muonType = muon->muonType();
-        MuonType = muonType;
-        fill(tool, MuonType);
+                MuonType = muonType;
+                fill(tool, MuonType);
 		if (muonType==xAOD::Muon::Combined) {
 			CBMuonLumiBlock = lumiBlockID;
 			fill(tool, CBMuonLumiBlock);
-- 
GitLab


From b5814a64551a6b0b7017e8199a1f1bda818345f5 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Thu, 23 Sep 2021 09:18:53 +0200
Subject: [PATCH 277/347] remove LArPedestalBuilder and LArAutoCorrBuilder.
 Superseeded by LArPedestalAutoCorrBuilder

---
 .../LArCalibUtils/LArAutoCorrBuilder.h        |  70 ----
 .../LArCalibUtils/LArPedestalBuilder.h        |  69 ----
 .../LArCalibUtils/src/LArAutoCorrBuilder.cxx  | 121 ------
 .../LArCalibUtils/src/LArPedestalBuilder.cxx  | 200 ---------
 .../src/components/LArCalibUtils_entries.cxx  |   4 -
 .../LArCalib_DigitAccumulator_jobOptions.py   | 378 ------------------
 6 files changed, 842 deletions(-)
 delete mode 100644 LArCalorimeter/LArCalibUtils/LArCalibUtils/LArAutoCorrBuilder.h
 delete mode 100644 LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPedestalBuilder.h
 delete mode 100644 LArCalorimeter/LArCalibUtils/src/LArAutoCorrBuilder.cxx
 delete mode 100644 LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx
 delete mode 100644 LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_DigitAccumulator_jobOptions.py

diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArAutoCorrBuilder.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArAutoCorrBuilder.h
deleted file mode 100644
index ef7d1a278d21..000000000000
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArAutoCorrBuilder.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//Dear emacs, this is -*-c++-*-
-
-#ifndef LARAUTOCORRBUILDER_H
-#define LARAUTOCORRBUILDER_H
-/********************************************************************
- 
- NAME:     LArAutoCorrBuilder.h
- PACKAGE:  offline/LArCalorimeter/LArCalibUtils
- 
- AUTHORS:  R. Lafaye
- CREATED:  Jun. 12, 2008 from LArAutoCorrMaker
-    
- PURPOSE:  Get the autocorrelation for each cell from LArAccumulatedDigits
-           at each gain and records them in TDS
-
-           In fact only the last (m_nsamples-1) elements of the 
-           first line (or column) of autocorrelation matrix are
-           recovered and stored in TDS, for these reasons:
-           - symetry of autocorrelation matrix
-           - equivalence of autocorrelation elements: 
-             B(n,n+i)\eq B(m,m+i) (eg B12 \eq B23).
-HISTORY:
-          Walter Lampl, 26 Aug 2009:
-          Derive from LArPedestalBuilder 
-                      
-********************************************************************/
-
-// Include files
-#include "GaudiKernel/Algorithm.h"
-#include "StoreGate/StoreGateSvc.h"
-#include "LArCalibUtils/LArPedestalBuilder.h"
-
-#include "LArRawEvent/LArAccumulatedDigitContainer.h"
-
-#include "LArRawConditions/LArAutoCorrComplete.h"
-
-//-----------------------------------------------------------------------
-class LArAutoCorrBuilder : public LArPedestalBuilder
-//-----------------------------------------------------------------------
-{
- public:
-
-  // Constructor
-  LArAutoCorrBuilder(const std::string & name, ISvcLocator * pSvcLocator);
-
-  // Destructor
-  ~LArAutoCorrBuilder();
-
-  // Algorithm initialization   
-  //StatusCode initialize();  Inherited from LArPedestalBuilder
-
-  // Algorithm execution
-  //StatusCode execute(); Inherited from LArPedestal Builder
-
-  // Algorithm finalization
-  StatusCode stop(); 
-  StatusCode finalize(){return StatusCode::SUCCESS;}
-  
- private:
-  //MGV Decide whether or not to normalize autocorr elements
-  int m_normalize;
-  std::string m_acContName;
-};
-
-#endif
-
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPedestalBuilder.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPedestalBuilder.h
deleted file mode 100644
index 52237e3015ee..000000000000
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPedestalBuilder.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//Dear emacs, this is -*-c++-*-
-#ifndef LARPEDESTALBUILDER_H
-#define LARPEDESTALBUILDER_H
-/********************************************************************
- 
- NAME:     LArPedestalBuilder.h
- PACKAGE:  offline/LArCalorimeter/LArCalibUtils
- 
- AUTHORS:  R. Lafaye
- CREATED:  Jun. 12, 2008 from LArPedestalMaker
-  
- PURPOSE:  Get the pedestal and rms for each cell from LArAccumulatedDigits
-           at each gain and records them in TDS
-
-********************************************************************/
-
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "LArRawEvent/LArAccumulatedDigitContainer.h"
-#include "LArRawConditions/LArConditionsContainer.h"
-
-class LArOnlineID;
-
-//-----------------------------------------------------------------------
-class LArPedestalBuilder : public AthAlgorithm
-//-----------------------------------------------------------------------
-{
- public:
-
-  // Constructor
-  LArPedestalBuilder(const std::string & name, ISvcLocator * pSvcLocator);
-
-  // Destructor
-  ~LArPedestalBuilder();
-
-  // Algorithm initialization   
-  StatusCode initialize(); 
-
-  // Algorithm execution
-  StatusCode execute();
-
-  // Algorithm finalization
-  virtual StatusCode stop();
-  virtual StatusCode finalize(){return StatusCode::SUCCESS;}
-
- protected:
-
-  const LArOnlineID * m_onlineHelper;
-  // Container key list
-  std::vector<std::string> m_keylist;
-  
-  // Grouping type
-  std::string m_groupingType;
-  
-  // Cache to accumulated substeps
-  typedef LArConditionsContainer<LArAccumulatedDigit> ACCU;
-  ACCU m_accu;
-
- private:
-  unsigned m_event_counter;
-  std::string m_pedContName;
-  uint16_t m_fatalFebErrorPattern;
- 
-};
-
-#endif
diff --git a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrBuilder.cxx
deleted file mode 100644
index 46f3d2f10624..000000000000
--- a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrBuilder.cxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/********************************************************************
- 
- NAME:     LArAutoCorrBuilder.cxx
- PACKAGE:  offline/LArCalorimeter/LArCalibUtils
- 
- AUTHORS:  R. Lafaye
- CREATED:  Jun. 12, 2008 from LArPedestalMaker
-    
- PURPOSE:  Get the autocorrelation for each cell from LArAccumulatedDigits
-           at each gain and records them in TDS
-
-           In fact only the last (m_nsamples-1) elements of the 
-           first line (or column) of autocorrelation matrix are
-           recovered and stored in TDS, for these reasons:
-           - symetrie of autocorrelation matrix
-           - equivalence of autocorrelation elements: 
-             B(n,n+i)\eq B(m,m+i) (eg B12 \eq B23).
-
-  HISTORY:
-          Walter Lampl, 26 Aug 2009:
-          Derive from LArPedestalBuilder 
-             
-********************************************************************/
-
-// Include files
-#include "LArCalibUtils/LArAutoCorrBuilder.h"
-//#include "LArIdentifier/LArOnlineID.h"
-
-//#include <math.h>
-//#include <unistd.h>
-
-
-LArAutoCorrBuilder::LArAutoCorrBuilder(const std::string& name, ISvcLocator* pSvcLocator) 
-  : LArPedestalBuilder(name, pSvcLocator)
-{
-  declareProperty("normalize",    m_normalize=1); 
-  declareProperty("AutoCorrKey",   m_acContName="LArAutoCorr");
-}
-
-
-LArAutoCorrBuilder::~LArAutoCorrBuilder()
-{}
-
-//---------------------------------------------------------------------------
-StatusCode LArAutoCorrBuilder::stop() {
-
-  ATH_MSG_DEBUG(">>> stop()");
-
-  auto larAutoCorrComplete = std::make_unique<LArAutoCorrComplete>();
-  // Initialize LArAutoCorrComplete 
-  StatusCode sc=larAutoCorrComplete->setGroupingType(m_groupingType,msg());
-  if (sc.isFailure()) {
-    ATH_MSG_ERROR( "Failed to set groupingType for LArAutoCorrComplete object" );
-    return sc;
-  }
-  sc=larAutoCorrComplete->initialize(); 
-  if (sc.isFailure()) {
-    ATH_MSG_ERROR( "Failed initialize LArAutoCorrComplete object" );
-    return sc;
-  }
-
-
-  int n_zero,n_min, n_max, n_cur;
-  n_zero=0; n_max=n_min=-1;
-  unsigned NAutoCorr=0;
-  std::vector<float> cov;
-  //Loop over gains
-  for (unsigned k=0;k<(int)CaloGain::LARNGAIN;k++) {
-    CaloGain::CaloGain gain=(CaloGain::CaloGain)k;
-    //Loop over cells
-    ACCU::ConditionsMapIterator cell_it=m_accu.begin(gain);
-    ACCU::ConditionsMapIterator cell_it_e=m_accu.end(gain);
-    if (cell_it==cell_it_e) continue; //No data for this gain
-    for (;cell_it!=cell_it_e;cell_it++) {
-      const LArAccumulatedDigit& dg=*cell_it;
-      n_cur = dg.nTrigger();
-      if(n_cur==0) { n_zero++; continue; }
-
-      HWIdentifier chid = cell_it.channelId();
-     
-      
-      if(n_cur<n_min || n_min<0) n_min=n_cur;
-      if(n_cur>n_max || n_max<0) n_max=n_cur;
-      
-      // Fill the data class with pedestal and rms values
-      dg.getCov(cov,m_normalize);
-
-      larAutoCorrComplete->set(chid,gain,cov);
-      NAutoCorr++;
-    }//end loop over all cells
-
-    ATH_MSG_DEBUG( "Gain " << gain << " Number of cells with 0 events to compute autocorr: " <<  n_zero );
-    ATH_MSG_DEBUG( "Gain " << gain << " Minimum number of events to compute autocorr: " <<  n_min );
-    ATH_MSG_DEBUG( "Gain " << gain << " Maximum number of events to compute autocorr: " <<  n_max );
-  }//end loop over gains
-
-  //msg(MSG::INFO << " Summary : Number of cells with a autocorr value computed : " << larAutoCorrComplete->totalNumberOfConditions()  );
-  ATH_MSG_INFO( " Summary : Number of cells with a autocorr value computed : " << NAutoCorr  );
-  ATH_MSG_INFO( " Summary : Number of Barrel PS cells side A or C (connected+unconnected):   3904+ 192 =  4096 " );
-  ATH_MSG_INFO( " Summary : Number of Barrel    cells side A or C (connected+unconnected):  50944+2304 = 53248 " );
-  ATH_MSG_INFO( " Summary : Number of EMEC      cells side A or C (connected+unconnected):  31872+3456 = 35328 " );
-  ATH_MSG_INFO( " Summary : Number of HEC       cells side A or C (connected+unconnected):   2816+ 256 =  3072 " );
-  ATH_MSG_INFO( " Summary : Number of FCAL      cells side A or C (connected+unconnected):   1762+  30 =  1792 " );
-  
-  // Record LArAutoCorrComplete
-  ATH_CHECK( detStore()->record(std::move(larAutoCorrComplete),m_acContName) );
-   
-  return StatusCode::SUCCESS;
-}
-
-
-
-
-
-
-
-
diff --git a/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx
deleted file mode 100644
index 96e0414647b7..000000000000
--- a/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-/********************************************************************
- 
- NAME:     LArPedestalBuilder.cxx
- PACKAGE:  offline/LArCalorimeter/LArCalibUtils
- 
- AUTHORS:  R. Lafaye
- CREATED:  Jun. 12, 2008 from LArPedestalMaker
-  
- PURPOSE:  Get the pedestal and rms for each cell from LArAccumulatedDigits
-           at each gain and records them in TDS
-
- HISTORY:
-             
-********************************************************************/
-
-// Include files
-#include "LArCalibUtils/LArPedestalBuilder.h"
-#include "LArRawConditions/LArPedestalComplete.h"
-#include "LArIdentifier/LArOnlineID.h"
-
-//#include <math.h>
-//#include <unistd.h>
-#include <vector>
-
-#include "LArRawEvent/LArFebErrorSummary.h"
-
-LArPedestalBuilder::LArPedestalBuilder(const std::string& name, ISvcLocator* pSvcLocator) 
-  : AthAlgorithm(name, pSvcLocator),
-    m_onlineHelper(0),
-    m_event_counter(0),
-    m_fatalFebErrorPattern(0xffff)
-{
-  declareProperty("KeyList",         m_keylist);
-  declareProperty("PedestalKey",     m_pedContName="LArPedestal");
-  declareProperty("GroupingType",    m_groupingType="ExtendedFeedThrough"); 
-}
-
-LArPedestalBuilder::~LArPedestalBuilder()
-{}
-
-StatusCode LArPedestalBuilder::initialize()
-{
-  StatusCode sc;
-  ATH_MSG_INFO( ">>> Initialize" );
-
-  //m_mean.resize(1);
-  //m_rms.resize(1);  
-  
-  sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID");
-  if (sc.isFailure()) {
-    ATH_MSG_ERROR( "Could not get LArOnlineID helper !" );
-    return StatusCode::FAILURE;
-  }
-  
-
-
- // m_fullFolderName="/lar/"+m_folderName+"/LArPedestal";
- if (!m_keylist.size()) // Not key list given
-   {m_keylist.push_back("HIGH");
-    m_keylist.push_back("MEDIUM");
-    m_keylist.push_back("LOW");
-    m_keylist.push_back("FREE"); //For H6....
-   }
-
- //m_pedestal.setGroupingType(LArConditionsContainerBase::SingleGroup);
-
- m_accu.setGroupingType(LArConditionsContainerBase::SingleGroup);
- ATH_CHECK ( m_accu.initialize() );
-
- return StatusCode::SUCCESS;
-}
-
-
-//---------------------------------------------------------------------------
-StatusCode LArPedestalBuilder::execute()
-//---------------------------------------------------------------------------
-{
-  ++m_event_counter;
-  if (m_keylist.size()==0) {
-    ATH_MSG_ERROR( "Key list is empty! No containers processed!" );
-    return StatusCode::FAILURE;
-  } 
-  
-  
-  const LArFebErrorSummary* febErrSum=NULL;
-  if (evtStore()->contains<LArFebErrorSummary>("LArFebErrorSummary")) {
-    ATH_CHECK( evtStore()->retrieve(febErrSum) );
-  }
-  else
-    if (m_event_counter==1)
-      ATH_MSG_WARNING( "No FebErrorSummaryObject found! Feb errors not checked!" );
- 
-
-
-
-
-  const LArAccumulatedDigitContainer* container;
-  
-  //Outermost loop goes over all gains (different containers).
-  for (const std::string& key : m_keylist) {
-    
-    StatusCode sc= evtStore()->retrieve(container,key);
-    if (sc.isFailure() || !container) {
-      ATH_MSG_DEBUG("Cannot read LArAccumulatedDigitContainer from StoreGate! key=" << key);
-      return StatusCode::SUCCESS; 
-    }
-    
-    // check that container is not empty
-    if(container->size()==0 ) {
-      ATH_MSG_DEBUG("LArAccumulatedDigitContainer (key=" << key << ") is empty ");
-      continue;
-    }
-    
-    HWIdentifier  lastFailedFEB(0);
-    //Inner loop goes over the cells.
-    for (const LArAccumulatedDigit* dg : *container) {  //Loop over all cells
-      if (dg->nTrigger()==0) continue; //Don't care about empty digits
-      const HWIdentifier chid=dg->hardwareID();
-      const HWIdentifier febid=m_onlineHelper->feb_Id(chid);
-      if (febErrSum) {
-	const uint16_t febErrs=febErrSum->feb_error(febid);
-	if (febErrs & m_fatalFebErrorPattern) {
-	  if (febid!=lastFailedFEB) {
-	    lastFailedFEB=febid;
-	    ATH_MSG_ERROR( "Event " << m_event_counter << " Feb " <<  m_onlineHelper->channel_name(febid) 
-		<< " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." );
-	  }
-	  continue;
-	} //end if fatal feb error
-      }//end if check feb error summary
-
-      const CaloGain::CaloGain gain=dg->gain();
-
-      LArAccumulatedDigit& accDg=m_accu.get(chid,gain);
-      if (!accDg.setAddSubStep(*dg)) 
-	ATH_MSG_ERROR( "Failed to accumulate sub-steps! Inconsistent number of ADC samples" );
-    } //end loop over input container
-  }//end loop over keys
-  return StatusCode::SUCCESS;
-}
-
-
-
- StatusCode LArPedestalBuilder::stop() {
-  // Create the LArPedestalComplete object
-  auto larPedestalComplete = std::make_unique<LArPedestalComplete>();
-  // Initialize LArPedestalComplete 
-  ATH_CHECK( larPedestalComplete->setGroupingType(m_groupingType,msg()) );
-  ATH_CHECK( larPedestalComplete->initialize() );
-
-
-  int n_zero,n_min, n_max, n_cur;
-  n_zero=0; n_max=n_min=-1;
-  unsigned NPedestal=0;
-  //Loop over gains
-  for (unsigned k=0;k<(int)CaloGain::LARNGAIN;k++) {
-    CaloGain::CaloGain gain=(CaloGain::CaloGain)k;
-    //Loop over cells
-    ACCU::ConditionsMapIterator cell_it=m_accu.begin(gain);
-    ACCU::ConditionsMapIterator cell_it_e=m_accu.end(gain);
-    if (cell_it==cell_it_e) continue; //No data for this gain
-    for (;cell_it!=cell_it_e;cell_it++) {
-      const LArAccumulatedDigit& dg=*cell_it;
-      n_cur = dg.nTrigger();
-      if(n_cur==0) { n_zero++; continue; }
-
-      HWIdentifier chid = cell_it.channelId();
-     
-      
-      if(n_cur<n_min || n_min<0) n_min=n_cur;
-      if(n_cur>n_max || n_max<0) n_max=n_cur;
-      
-      // Fill the data class with pedestal and rms values
-      larPedestalComplete->set(chid,gain,dg.mean(),dg.RMS());
-      NPedestal++;
-    }//end loop over all cells
-
-    ATH_MSG_DEBUG( "Gain " << gain << " Number of cells with 0 events to compute pedestal: " <<  n_zero );
-    ATH_MSG_DEBUG( "Gain " << gain << " Minimum number of events*samples to compute pedestal: " <<  n_min );
-    ATH_MSG_DEBUG( "Gain " << gain << " Maximum number of events*samples to compute pedestal: " <<  n_max );
-  }// End loop over all containers
-  
-  //ATH_MSG_INFO( " Summary : Number of cells with a pedestal value computed : " << larPedestalComplete->totalNumberOfConditions()  );
-  ATH_MSG_INFO( " Summary : Number of cells with a pedestal value computed : " << NPedestal  );
-  ATH_MSG_INFO( " Summary : Number of Barrel PS cells side A or C (connected+unconnected):   3904+ 192 =  4096 " );
-  ATH_MSG_INFO( " Summary : Number of Barrel    cells side A or C (connected+unconnected):  50944+2304 = 53248 " );
-  ATH_MSG_INFO( " Summary : Number of EMEC      cells side A or C (connected+unconnected):  31872+3456 = 35328 " );
-  ATH_MSG_INFO( " Summary : Number of HEC       cells side A or C (connected+unconnected):   2816+ 256 =  3072 " );
-  ATH_MSG_INFO( " Summary : Number of FCAL      cells side A or C (connected+unconnected):   1762+  30 =  1792 " );
-    
-  // Record LArPedestalComplete
-  ATH_CHECK( detStore()->record(std::move(larPedestalComplete),m_pedContName) );
-  
-  return StatusCode::SUCCESS;
-}
-
diff --git a/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx b/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx
index 5015bcdd1615..f010037968ad 100644
--- a/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx
@@ -1,6 +1,5 @@
 #include "LArCalibUtils/LArAutoCorrMaker.h"
 #include "LArCalibUtils/LArAutoCorrExtrapolate.h"
-#include "LArCalibUtils/LArAutoCorrBuilder.h"
 #include "LArCalibUtils/LArAutoCorrDecoderTool.h"
 #include "LArCalibUtils/LArCalibDigitMaker.h"
 #include "LArCalibUtils/LArCaliWaveAverage.h"
@@ -15,7 +14,6 @@
 #include "LArCalibUtils/LArOFCAlg.h"
 #include "LArCalibUtils/LArPedestalInPhysicsMaker.h"
 #include "LArCalibUtils/LArPedestalMaker.h"
-#include "LArCalibUtils/LArPedestalBuilder.h"
 #include "LArCalibUtils/LArPhysWaveBuilder.h"
 #include "LArCalibUtils/LArPhysWaveShifter.h"
 #include "LArCalibUtils/LArPhysWaveTool.h"
@@ -62,7 +60,6 @@ typedef LArCalibCopyAlg<LArTdriftComplete> LArTdriftCompleteCopyAlg;
 
 DECLARE_COMPONENT( LArAutoCorrMaker )
 DECLARE_COMPONENT( LArAutoCorrExtrapolate )
-DECLARE_COMPONENT( LArAutoCorrBuilder )
 DECLARE_COMPONENT( LArCalibDigitMaker )
 DECLARE_COMPONENT( LArCaliWaveAverage )
 DECLARE_COMPONENT( LArCaliWaveBuilder )
@@ -74,7 +71,6 @@ DECLARE_COMPONENT( LArMasterWaveBuilder )
 DECLARE_COMPONENT( LArOFCAlg )
 DECLARE_COMPONENT( LArPedestalInPhysicsMaker )
 DECLARE_COMPONENT( LArPedestalMaker )
-DECLARE_COMPONENT( LArPedestalBuilder )
 DECLARE_COMPONENT( LArPedestalAutoCorrBuilder )
 DECLARE_COMPONENT( LArPhysWaveBuilder )
 DECLARE_COMPONENT( LArPhysWaveShifter )
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_DigitAccumulator_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_DigitAccumulator_jobOptions.py
deleted file mode 100644
index 9a34211b959d..000000000000
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_DigitAccumulator_jobOptions.py
+++ /dev/null
@@ -1,378 +0,0 @@
-from future import standard_library
-standard_library.install_aliases()
-import subprocess
-
-###############################################################################
-#
-# <Sandrine.Laplace@lapp.in2p3.fr>
-#
-# Example jobOptions to reconstruction one or more pedestal runs from  data
-#         using accumulated pedestals
-# Flags:
-#  - Pedestal: run LArPedestalBuilder that reads the DSP LArAccumulatedDigits
-#              dump corresponding Pedestals and LArAccumulatedDigits (key: gain) into ntuple
-#  - AutoCorr: run LArAutorCorrBuilder that reads the DSP LArAccumulatedDigits
-#              dump corresponding AutoCorr and (same than above) LArAccumulatedDigits into ntuple
-#  - Accumulator: run LArDigitsAccumulator to crosscheck DSP computation
-#              dump corresponding LArAccumulatedDigits (key: gain+AccuDigOff)
-#                                                                             
-###############################################################################
-
-include("LArCalibProcessing/LArCalib_Flags.py")
-include("LArCalibProcessing/GetInputFiles.py")
-
-#######################################################
-#                Run properties
-#######################################################
-
-if not 'SubDet' in dir():
-   SubDet = "Barrel"
-   
-if not 'RunNumberList' in dir():
-   RunNumberList = [ 26924 ]
-
-if not 'FilePrefix' in dir():
-     FilePrefix = "daq.Pedestal"   
-   
-if not 'InputDir' in dir():
-   InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2008"
-   
-if not 'Partition' in dir():
-   if (SubDet=='EndCap'):
-      Partition      = "EB-EC*"
-   else:
-      Partition      = "EB-EMB*"     
-
-if not 'FullFileName' in dir():
-   Trigger = "*"+Partition
-   FullFileName =[]
-   for RunNumber in RunNumberList :
-       FullFileName+=GetInputFilesFromTokens(InputDir,RunNumber,FilePrefix,Trigger)
-
-if not 'GainList' in dir():
-   GainList = [ "HIGH" ]
-
-if not 'KeyOutputAccum' in dir():  
-   KeyOutputAccum    = "AccuDigOff"
-
-if not 'GainListAccum' in dir():
-   GainListAccum =[]
-   for i in GainList:
-      newKey=i+KeyOutputAccum
-      GainListAccum.append(newKey)
-      printfunc ("GainListAccum = ",GainListAccum)
-
-if not 'GroupingType' in dir():
-   GroupingType = "ExtendedSubDetector"
-
-if not 'ChannelSelection' in dir():
-   # read all
-   ChannelSelection = " "
-   ## example to read only cool for Barrel C : Strips->Back
-   #ChannelSelection = "<channelSelection>0,3:34</channelSelection>"   
-
-from string import *
-def DBConnectionFile(sqlitefile):
-   return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2"
-
-
-#######################################################
-#                Monitoring properties
-#######################################################
-
-if not 'doMonitoring' in dir():
-   doMonitoring = False
-
-if not 'doLArCalibDataQuality' in dir():
-   doLArCalibDataQuality = False
-
-if not 'online' in dir():
-   online = False
-   
-#######################################################
-#       Pedestal and AutoCorrelation  properties
-#######################################################
-
-if not 'Pedestal' in dir():
-   Pedestal = True
-   
-if not 'AutoCorr' in dir():
-   AutoCorr = True
-
-if not 'Accumulator' in dir():
-   Accumulator = True
-
-if not 'EventsRef' in dir():
-   EventsRef     = 10
-   
-if not 'NSigma' in dir():
-   NSigma = 5
-
-if not 'NSamples' in dir():
-   NSamples = 7   
-   
-if not 'WhichSample' in dir():
-   WhichSample = 0
-
-#######################################################
-#      Pedestal and AutoCorrelation  output name
-#######################################################
-
-if not 'WriteNtuple' in dir():
-   WriteNtuple = LArCalib_Flags.WriteNtuple
-
-if not 'WritePoolFile' in dir():
-   WritePoolFile = LArCalib_Flags.WritePoolFile
-
-if not 'WriteIOV' in dir():
-   WriteIOV = LArCalib_Flags.WriteIOV
-
-if not 'IOVBegin' in dir():
-   IOVBegin = RunNumberList[0]
-   
-if not 'IOVEnd' in dir():
-   IOVEnd = LArCalib_Flags.IOVEnd
-
-if not 'DBConnectionCOOL' in dir():  
-   DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;"   
-
-if not 'OutputPedAutoCorrRootFileDir' in dir():
-   OutputPedAutoCorrRootFileDir  = subprocess.getoutput("pwd")
-   
-if not 'OutputPedPoolFileDir' in dir():
-   OutputPedPoolFileDir  = subprocess.getoutput("pwd")
-
-if not 'PedLArCalibFolderTag' in dir():
-   PedLArCalibFolderTag = LArCalib_Flags.tagSuffix 
-   
-if not 'OutputAutoCorrPoolFileDir' in dir():
-   OutputAutoCorrPoolFileDir  = subprocess.getoutput("pwd")
-
-if not 'OutputDB' in dir():
-   OutputDB = LArCalib_Flags.OutputDB
-
-if 'OutputSQLiteFile' in dir():
-   OutputDB = DBConnectionFile(OutputSQLiteFile)   
-
-if not 'KeyOutputAC' in dir():  
-   KeyOutputAC      = "LArAutoCorr" 
-
-if not 'KeyOutputPed' in dir():  
-   KeyOutputPed      = "Pedestal" # need Pedestal to merge with oracle, LArPedestal doesn't work
-
-if not 'BaseFileNamePed' in dir():
-   BaseFileNamePed = "LArPedestal"
-
-if not 'BaseFileNameAutoCorr' in dir():
-   BaseFileNameAutoCorr = "LArAutoCorr"
-
-if not 'BaseFileNameAccum' in dir():
-   BaseFileNameAccum = "LArAccumulatedDigits"
-
-for RunNumber in RunNumberList :
-   if Pedestal :
-      BaseFileNamePedAutoCorr  = BaseFileNamePed + "_"
-      
-   if AutoCorr :
-      if Pedestal :
-         BaseFileNamePedAutoCorr = BaseFileNamePedAutoCorr + BaseFileNameAutoCorr + "_"
-      else :   
-         BaseFileNamePedAutoCorr = BaseFileNameAutoCorr + "_"
-
-   if Accumulator :
-      BaseFileNamePedAutoCorr = BaseFileNameAccum + "_"
-
-   BaseFileNamePedAutoCorr = BaseFileNamePedAutoCorr + str(RunNumber)+"_"+Partition.replace("*","") 
-   BaseFileNamePed = BaseFileNamePed + "_" + str(RunNumber)+"_"+Partition.replace("*","") 
-   BaseFileNameAutoCorr = BaseFileNameAutoCorr + "_" + str(RunNumber)+"_"+Partition.replace("*","")
-   
-if not 'OutputPedAutoCorrRootFileName' in dir():
-   OutputPedAutoCorrRootFileName  = BaseFileNamePedAutoCorr+ ".root"
-    
-if not 'OutputAutoCorrPoolFileName' in dir():
-   OutputAutoCorrPoolFileName  = BaseFileNameAutoCorr + ".pool.root"
-
-if not 'OutputPedPoolFileName' in dir():
-   OutputPedPoolFileName  = BaseFileNamePed + ".pool.root"
-
-if not 'OutputObjectSpecPed' in dir():
-   OutputObjectSpecPed = "LArPedestalComplete#"+KeyOutputPed+"#"+LArCalib_Flags.LArPedestalFolder
-   OutputTagSpecPed=LArCalibFolderTag(LArCalib_Flags.LArPedestalFolder,PedLArCalibFolderTag)
-
-if not 'OutputObjectSpecAutoCorr' in dir():
-   OutputObjectSpecAutoCorr = "LArAutoCorrComplete#"+KeyOutputAC+"#"+LArCalib_Flags.LArAutoCorrFolder
-   OutputTagSpecAutoCorr=LArCalibFolderTag(LArCalib_Flags.LArAutoCorrFolder,PedLArCalibFolderTag)   
-
-#######################################################################################
-# print summary
-#######################################################################################
-
-PedestalAutoCorrLog = logging.getLogger( "PedestalAutoCorrLog" )
-PedestalAutoCorrLog.info( " ======================================================== " )
-PedestalAutoCorrLog.info( " ***           LAr Pedestal/AutoCorr summary          *** " )
-PedestalAutoCorrLog.info( " ======================================================== " )
-PedestalAutoCorrLog.info( " RunNumber                         = "+str(RunNumberList) )
-PedestalAutoCorrLog.info( " SubDetector                       = "+SubDet )
-PedestalAutoCorrLog.info( " Partition                         = "+Partition )
-PedestalAutoCorrLog.info( " Type                              = "+str(FilePrefix.strip().split('.',9)[1]) )
-PedestalAutoCorrLog.info( " LArGain                           = "+str(GainList) )
-for i in range(len(FullFileName)):
-   PedestalAutoCorrLog.info( " FullFileName                      = "+FullFileName[i] )
-PedestalAutoCorrLog.info( " PedLArCalibFolderTag              = "+PedLArCalibFolderTag )
-PedestalAutoCorrLog.info( " OutputPedAutoCorrRootFullFileName = "+OutputPedAutoCorrRootFileDir + "/" + OutputPedAutoCorrRootFileName )
-PedestalAutoCorrLog.info( " OutputPedPoolFullFileName         = "+OutputPedPoolFileDir + "/" + OutputPedPoolFileName )
-PedestalAutoCorrLog.info( " OutputAutoCorrPoolFullFileName    = "+OutputAutoCorrPoolFileDir + "/" + OutputAutoCorrPoolFileName )
-PedestalAutoCorrLog.info( " OutputObjectSpecPed               = "+OutputObjectSpecPed )
-PedestalAutoCorrLog.info( " OutputTagSpecPed                  = "+OutputTagSpecPed )
-PedestalAutoCorrLog.info( " OutputObjectSpecAutoCorr          = "+OutputObjectSpecAutoCorr )
-PedestalAutoCorrLog.info( " OutputTagSpecAutoCorr             = "+OutputTagSpecAutoCorr )
-PedestalAutoCorrLog.info( " IOVBegin                          = "+str(IOVBegin) )
-PedestalAutoCorrLog.info( " IOVEnd                            = "+str(IOVEnd) )
-PedestalAutoCorrLog.info( " LArCalibOutputDB                  = "+OutputDB )
-PedestalAutoCorrLog.info( " ======================================================== " )
-
-#######################################################################################
-include ("LArConditionsCommon/LArMinimalSetup.py")
-
-#
-# Provides ByteStreamInputSvc name of the data file to process in the offline context
-#
-
-## get a handle to the default top-level algorithm sequence
-from AthenaCommon.AlgSequence import AlgSequence 
-topSequence = AlgSequence()
-
-## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc
-from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc)
-
-## define the DB Gobal Tag :
-svcMgr.IOVDbSvc.GlobalTag   = LArCalib_Flags.globalFlagDB
-try:
-   svcMgr.IOVDbSvc.DBInstance=""
-except: 
-   pass
-
-theByteStreamInputSvc=svcMgr.ByteStreamInputSvc
-if not 'FullFileName' in dir():
-   PedestalAutoCorrLog.info( "No FullFileName! Please give a FullFileName list")
-   theApp.exit(-1)
-else :   
-   svcMgr.EventSelector.Input=FullFileName
-
-from LArByteStream.LArByteStreamConf import LArRodDecoder
-svcMgr.ToolSvc += LArRodDecoder()
-theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc
-theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"]
-theByteStreamAddressProviderSvc.TypeNames += ["LArDigitContainer/HIGH"]
-
-theByteStreamAddressProviderSvc.TypeNames += ["LArAccumulatedDigitContainer/HIGH"]
-
-#######################################################
-#                                                     #
-#      Pedestal run reconstruction                    #
-#                                                     #
-#######################################################
-
-
-if Pedestal :
-
-   from LArCalibUtils.LArCalibUtilsConf import LArPedestalBuilder
-   LArPedestalBuilder=LArPedestalBuilder("LArPedestalBuilder")
-   LArPedestalBuilder.KeyList      = GainList
-   LArPedestalBuilder.KeyOutput    = KeyOutputPed
-   LArPedestalBuilder.GroupingType = GroupingType
-
-   topSequence += LArPedestalBuilder
-
-if AutoCorr :
-   from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrBuilder
-   LArAutoCorrBuilder=LArAutoCorrBuilder("LArAutoCorrBuilder")
-   LArAutoCorrBuilder.KeyList      = GainList
-   LArAutoCorrBuilder.KeyOutput    = KeyOutputAC
-   LArAutoCorrBuilder.GroupingType = GroupingType
-   
-   topSequence += LArAutoCorrBuilder
-
-if Accumulator :
-   from LArROD.LArRODConf import LArDigitsAccumulator
-   LArDigitsAccumulator=LArDigitsAccumulator("LArDigitsAccumulator")
-   LArDigitsAccumulator.KeyList = GainList
-   LArDigitsAccumulator.LArAccuDigitContainerName=KeyOutputAccum
-
-   topSequence += LArDigitsAccumulator
-   
-######################################################################
-#                                                                    #
-#                          Output                                    #
-#                                                                    #
-######################################################################
-
-
-if ( WriteNtuple ) :
-   
-   if Pedestal :
-      from LArCalibTools.LArCalibToolsConf import LArPedestals2Ntuple
-      LArPedestals2Ntuple = LArPedestals2Ntuple("LArPedestals2Ntuple")
-      LArPedestals2Ntuple.ContainerKey = KeyOutputPed
-      
-      topSequence += LArPedestals2Ntuple
-
-   if AutoCorr :
-      from LArCalibTools.LArCalibToolsConf import LArAutoCorr2Ntuple
-      LArAutoCorr2Ntuple = LArAutoCorr2Ntuple( "LArAutoCorr2Ntuple" )
-      LArAutoCorr2Ntuple.Nsamples     = NSamples
-      LArAutoCorr2Ntuple.ContainerKey = KeyOutputAC
-      
-      topSequence += LArAutoCorr2Ntuple
-
-   if Pedestal or AutoCorr:
-      from LArCalibTools.LArCalibToolsConf import LArAccumulatedDigits2Ntuple
-      for i in GainList:
-         NtupleName="NtupleDSP"+i
-         NtupleDSP = LArAccumulatedDigits2Ntuple( NtupleName )
-         NtupleDSP.NSamples     = NSamples
-         NtupleDSP.ContainerKey = i
-
-         topSequence += NtupleDSP
-
-         printfunc (NtupleDSP)
-
-   if Accumulator :
-      from LArCalibTools.LArCalibToolsConf import LArAccumulatedDigits2Ntuple
-      for i in GainListAccum:
-         NtupleName="NtupleOff"+i
-         NtupleOff = LArAccumulatedDigits2Ntuple( NtupleName )
-         NtupleOff.NSamples     = NSamples
-         NtupleOff.ContainerKey = i
-
-         topSequence += NtupleOff
-
-         printfunc (NtupleOff)
-
-   theApp.HistogramPersistency = "ROOT"
-   from GaudiSvc.GaudiSvcConf import NTupleSvc
-   if os.path.exists(OutputPedAutoCorrRootFileDir + "/" + OutputPedAutoCorrRootFileName): 
-      os.remove(OutputPedAutoCorrRootFileDir + "/" + OutputPedAutoCorrRootFileName)
-   svcMgr += NTupleSvc()
-   svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputPedAutoCorrRootFileDir + "/" + OutputPedAutoCorrRootFileName+"' OPT='NEW'" ]
-
-
-
-###########################################################################
-
-svcMgr.MessageSvc.OutputLevel  = WARNING
-svcMgr.MessageSvc.defaultLimit = 10000
-svcMgr.MessageSvc.Format       = "% F%20W%S%7W%R%T %0W%M"
-
-svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO)
-
-from AthenaCommon.AppMgr import theAuditorSvc
-from AthenaCommon.ConfigurableDb import getConfigurable
-theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING)
-theApp.AuditAlgorithms=True
-theAuditorSvc += getConfigurable("ChronoAuditor")()
-theAuditorSvc += getConfigurable("NameAuditor")()
-svcMgr.ChronoStatSvc.OutputLevel  = INFO
-
-###########################################################################
- 
-- 
GitLab


From 678f06850c3393432a238ef27c90b5e392c9e7fd Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Thu, 23 Sep 2021 10:53:11 +0200
Subject: [PATCH 278/347] TrigT1CTMonitoring: remove online monitoring config
 and cleanup

The `isOnline` specific CTP monitoring configuration is definitely
broken and likely not used. Just remove all code and print an error
message. Also delete some other obsolete files.
---
 .../RecExCond/share/RecExCommon_flags.py      |   4 -
 .../TrigT1/TrigT1CTMonitoring/CMakeLists.txt  |   1 -
 .../python/TrigT1CTMonitoringConfig.py        |  35 -----
 .../TrigT1CTMonitoring/share/CTPFlags.py      |   6 -
 ...MonitoringJobOptions_forRecExCommission.py | 131 +-----------------
 5 files changed, 6 insertions(+), 171 deletions(-)
 delete mode 100644 Trigger/TrigT1/TrigT1CTMonitoring/python/TrigT1CTMonitoringConfig.py
 delete mode 100644 Trigger/TrigT1/TrigT1CTMonitoring/share/CTPFlags.py

diff --git a/Reconstruction/RecExample/RecExCond/share/RecExCommon_flags.py b/Reconstruction/RecExample/RecExCond/share/RecExCommon_flags.py
index 6b1b99e7cc05..3d9111ce9e2e 100755
--- a/Reconstruction/RecExample/RecExCond/share/RecExCommon_flags.py
+++ b/Reconstruction/RecExample/RecExCond/share/RecExCommon_flags.py
@@ -673,10 +673,6 @@ if rec.Commissioning():
        from MuonCnvExample.MuonCalibFlags import muonCalibFlags
 
                
-   from AthenaMonitoring.DQMonFlags import DQMonFlags
-   if rec.doESD() and DQMonFlags.doCTPMon() and rec.doTrigger():
-      include("TrigT1CTMonitoring/CTPFlags.py")
-
    # FIXME obsolete flags (should be removed)!!!
    # ------------------------------------
    # import GlobalFlags from RecExCommon
diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/CMakeLists.txt b/Trigger/TrigT1/TrigT1CTMonitoring/CMakeLists.txt
index ca80d051d4cf..09190a553f85 100644
--- a/Trigger/TrigT1/TrigT1CTMonitoring/CMakeLists.txt
+++ b/Trigger/TrigT1/TrigT1CTMonitoring/CMakeLists.txt
@@ -15,6 +15,5 @@ atlas_add_component( TrigT1CTMonitoring
    LINK_LIBRARIES ${COOL_LIBRARIES} ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaMonitoringLib AthenaPoolUtilities CoraCool xAODEventInfo GaudiKernel LWHists MuonDigitContainer MuonRDO MuonTrigCoinData TrigConfData TrigConfInterfaces TrigConfL1Data TrigT1CaloEventLib TrigT1Interfaces TrigT1Result )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_joboptions( share/*.py )
 atlas_install_scripts( scripts/*.py )
diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/python/TrigT1CTMonitoringConfig.py b/Trigger/TrigT1/TrigT1CTMonitoring/python/TrigT1CTMonitoringConfig.py
deleted file mode 100644
index 3c22b021ad05..000000000000
--- a/Trigger/TrigT1/TrigT1CTMonitoring/python/TrigT1CTMonitoringConfig.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-## get a handle to the ApplicationManager
-from AthenaCommon.AppMgr import theApp
-## get a handle to the default top-level algorithm sequence
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-## get a handle to the ServiceManager
-from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-#---------------------------------------------------------------
-# CTP / MuCTPI bytestream conversion
-#---------------------------------------------------------------
-
-if not hasattr( svcMgr, "THistSvc" ):
-  from GaudiSvc.GaudiSvcConf import THistSvc
-  svcMgr += THistSvc()
-#svcMgr.THistSvc.Output = ["file1 DATAFILE='HistFile.root' OPT='RECREATE'"];
-
-if not hasattr( theApp.Dlls, "RootHistCnv" ):
-  theApp.Dlls += [ "RootHistCnv" ]
-  theApp.HistogramPersistency = "ROOT"
-
-if not hasattr( svcMgr, "THistSvc" ):
-  from GaudiSvc.GaudiSvcConf import THistSvc
-  svcMgr += THistSvc()
-#svcMgr.THistSvc.Output = ["file1 DATAFILE='HistFile.root' OPT='RECREATE'"];
-
-if not hasattr( theApp.Dlls, "RootHistCnv" ):
-  theApp.Dlls += [ "RootHistCnv" ]
-  theApp.HistogramPersistency = "ROOT"
-
-# if not hasattr( topSequence, "TrigT1CTMonitoring__BSMonitoring" ):
-#   from TrigT1CTMonitoring.TrigT1CTMonitoringConf import TrigT1CTMonitoring__BSMonitoring
-#   CTMonAlg = TrigT1CTMonitoring__BSMonitoring()
-#   topSequence += CTMonAlg
diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/share/CTPFlags.py b/Trigger/TrigT1/TrigT1CTMonitoring/share/CTPFlags.py
deleted file mode 100644
index a55979e53e0b..000000000000
--- a/Trigger/TrigT1/TrigT1CTMonitoring/share/CTPFlags.py
+++ /dev/null
@@ -1,6 +0,0 @@
-include.block("TrigT1CTMonitoring/CTPFlags.py")
-class CTPFlags:
-   doCTRIO=True
-   doCTRDO=True
-   doMuRIO=True
-   doMuRDO=True
diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py
index bae11c6e370a..5a06966af3aa 100644
--- a/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py
+++ b/Trigger/TrigT1/TrigT1CTMonitoring/share/TrigT1CTMonitoringJobOptions_forRecExCommission.py
@@ -19,7 +19,8 @@ from AthenaCommon.Logging import logging
 ctpmonlog = logging.getLogger("CTPMonitoringSetup")
 
 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-from AthenaCommon.Constants import *
+from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
+from RecExConfig.RecFlags import rec
 
 LHCFillStateAvailable=False
 UsedFillStateCoolFolderName="/LHC/DCS/FILLSTATE"
@@ -44,130 +45,13 @@ topSequence = AlgSequence()
 #---------------------------------------------------------------
 # Central-Trigger Monitoring
 #---------------------------------------------------------------
-from TrigT1CTMonitoring.TrigT1CTMonitoringConfig import *
-## get a handle on the ToolSvc
-from AthenaCommon.AppMgr import ToolSvc as toolSvc
 from TrigT1CTMonitoring.TrigT1CTMonitoringConf import TrigT1CTMonitoring__BSMonitoring as BSMon
 from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
 
 #-----------ONLINE CODE---------------------
 if athenaCommonFlags.isOnline():
-    ctpmonlog.info("Setting up CTP/MUCTPI BS monitoring for online")
-    #from TrigServices.TrigServicesConf import TrigMonTHistSvc
-    #THistSvc = TrigMonTHistSvc("THistSvc") 
-    #svcMgr += THistSvc 
-    doHist=True
-    InputDir = "."
-    OutputDir="."
-    FilePreFix = [ "MonTest"]
-    RootHistFileName = 'HistFile.root'
-    
-    ## add an AthenaMonManager algorithm to the list of algorithms to be ran
-    if not hasattr(topSequence,"PrimaryManager"):
-        topSequence += AthenaMonManager( "PrimaryManager" )
-    ## AthenaMonManager is the Algorithm that manages many classes inheriting
-    ## from ManagedMonitorToolBase
-    CTmonMan = topSequence.PrimaryManager
-
-    theApp.Dlls += [ "TrigT1CTMonitoring" ]
-    
-    CTmonMan.AthenaMonTools += [ "TrigT1CTMonitoring__BSMonitoring/BSMon" ]
-
-    ## FILEKEY must match that given to THistSvc
-    CTmonMan.FileKey = "GLOBAL"
-
-    DetDescrVersion="ATLAS-DC3-05" # 11.0.42 files 
-    AllAlgs = False # if false, all algorithms are switched off by defaults 
-
-
-    from AthenaCommon.GlobalFlags import GlobalFlags
-    GlobalFlags.DataSource.set_data()
-    GlobalFlags.InputFormat.set_bytestream()
-    GlobalFlags.DetGeo.set_atlas()
-    
-    from AthenaCommon.DetFlags import DetFlags
-    
-    DetFlags.detdescr.all_setOn()
-    DetFlags.geometry.all_setOn()
-    DetFlags.ID_setOff()
-    DetFlags.Calo_setOff() 
-    DetFlags.Truth_setOff()
-    #switch on/off detectors
-
-    DetFlags.Muon_setOn()
-    #DetFlags.Muon_setOff()
-
-    DetFlags.LVL1_setOn()
-    DetFlags.pileup.all_setOff()
-    DetFlags.simulate.all_setOff()
-    DetFlags.digitize.all_setOff()
-    DetFlags.makeRIO.all_setOff()
-    DetFlags.writeBS.all_setOff()
-    DetFlags.readRDOBS.all_setOff()
-    DetFlags.readRIOBS.all_setOff()
-    DetFlags.readRIOPool.all_setOff()
-    DetFlags.writeRIOPool.all_setOff()
-    DetFlags.writeRDOPool.all_setOff()
-    DetFlags.readRDOBS.LVL1_setOn()
-    DetFlags.readRIOBS.LVL1_setOn()
-    DetFlags.Print()
-    GlobalFlags.Print()
-    
-    #--------------------------------------------------------------
-    # GeoModel stuff:
-    #--------------------------------------------------------------
-    include( "AtlasGeoModel/SetGeometryVersion.py" )
-    include( "AtlasGeoModel/GeoModelInit.py" )
-
-    #--------------------------------------------------------------
-    # 
-    #--------------------------------------------------------------
-    include( "AmdcAth/AmdcAth_jobOptions.py" )
-    include( "AtlasGeoModel/MuonGeoModel.py" )
-
-    # Cabling and geometry of muon detectors
-    from RPCgeometry.RPCgeometryConfig import RPCgeometryConfig
-    from RPCcabling.RPCcablingConfig import RPCcablingConfig
-    RPCcablingSvc = RPCcablingConfig()
-    RPCcablingSvc.ConfFileName = "LVL1conf.data"
-    RPCcablingSvc.CorrFileName = "LVL1corr.data"
-    
-    from MDTcabling.MDTcablingConfig import MDTcablingConfig
-    MDTcablingSvc = MDTcablingConfig()
-    MDTcablingSvc.RODfile    = "RODmap.data"
-    from TGCcabling.TGCcablingConfig import TGCcablingConfig
-    
-    CTmonMan.Environment = "online"
-    CTmonMan.ManualDataTypeSetup = False
-    CTmonMan.DataType            = "cosmics"
-    CTmonMan.ManualRunLBSetup    = False
-    CTmonMan.Run                 = 1
-    CTmonMan.LumiBlock           = 1
-    
-    #---------------------------------------------------------------
-    # LVL1 configuration
-    #---------------------------------------------------------------
-    ctpmonlog.info("will setup LVL1ConfigSvc and add instance to ServiceMgr")
-    from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc
-    LVL1ConfigSvc = LVL1ConfigSvc('LVL1ConfigSvc')
-    LVL1ConfigSvc.ConfigSource = "XML"
-    LVL1ConfigSvc.XMLFile = "L1MenuM5.xml"
-    LVL1ConfigSvc.CreateLegacyObjects = True
-    LVL1ConfigSvc.DumpTTVmap = False
-    svcMgr += LVL1ConfigSvc
-    theApp.CreateSvc += [ "TrigConf::LVL1ConfigSvc/LVL1ConfigSvc" ]
-
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    svcMgr.ToolSvc += BSMon( ProcessMuctpiData=True,
-                            ProcessMuctpiDataRIO=True,
-                            ProcessCTPData=True,
-                            ProcessRoIBResult=True,
-                            InclusiveTriggerThresholds=True,
-                            FillStateCoolFolderName=UsedFillStateCoolFolderName )
-
-    printfunc (topSequence)
-    printfunc (svcMgr)
-
+    # fwinkl 09/2021: removed online-specific code as it was certainly broken and likely unused
+    ctpmonlog.error("Setting up CTP/MUCTPI BS monitoring for online currently not supported")
 
 #-----------OFFLINE CODE---------------------
 else:
@@ -183,10 +67,9 @@ else:
         #svcMgr.DSConfigSvc.readLVL1Thr=True
         #svcMgr.DSConfigSvc.readLVL1BG=True
 
-        from AthenaConfiguration.AllConfigFlags import ConfigFlags
         # Wrap everything in a sequence which will force algs to execute in order, even in MT mode
         from AthenaCommon.AlgSequence import AthSequencer
-        CTPMonSeq=CfgMgr.AthSequencer('CTPMonSeq')
+        CTPMonSeq=AthSequencer('CTPMonSeq')
 
         from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import L1MuctpiPhase1_on_Data
         CTPMonSeq += L1MuctpiPhase1_on_Data()
@@ -209,7 +92,7 @@ else:
         try:
             CTPMonSeq.CTPSimulation.HistPath = histbase
         except AttributeError as ex:
-            printfunc (ex," ignore for now")
+            print (ex," ignore for now")
             import traceback
             traceback.print_exc()
 
@@ -221,8 +104,6 @@ else:
                             DataType            = DQMonFlags.monManDataType() )
     CTPMonSeq += monMan
 
-    theApp.Dlls += [ "TrigT1CTMonitoring" ]
-    
     # check if global muons are on
     if not rec.doMuon:
         if 'IS_SIMULATION' not in metadata['eventTypes']:
-- 
GitLab


From c837254434e603f802f55dd0d4451e96e4b70891 Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <m.hodgkinson@sheffield.ac.uk>
Date: Thu, 23 Sep 2021 12:38:43 +0200
Subject: [PATCH 279/347] Update conditions tag to fix ATLASSIM-5413.

---
 .../RecExample/RecJobTransformTests/test/test_mc20e_13TeV.sh    | 2 +-
 .../test/test_mc20e_13TeV_MultipleThreads.sh                    | 2 +-
 .../RecJobTransformTests/test/test_mc20e_13TeV_PhysValAll.sh    | 2 +-
 .../test/test_mc20e_13TeV_PhysValExample.sh                     | 2 +-
 .../test/test_mc20e_13TeV_chainRecoPhysVal.sh                   | 2 +-
 .../RecJobTransformTests/test/test_mc20e_nopileup_13TeV.sh      | 2 +-
 .../test/test_mc20e_nopileup_13TeV_MultipleThreads.sh           | 2 +-
 .../test/test_mc20e_nopileup_stdcmalloc_13TeV.sh                | 2 +-
 .../test_mc20e_nopileup_stdcmalloc_13TeV_MultipleThreads.sh     | 2 +-
 .../RecJobTransformTests/test/test_mc20e_trigsplit_13TeV.sh     | 2 +-
 .../test/test_mc20e_trigsplit_13TeV_MultipleThreads.sh          | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV.sh
index 506cff790d96..d60b5e3f2f24 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV.sh
@@ -10,7 +10,7 @@
 unset ATHENA_CORE_NUMBER
 unset ATHENA_PROC_NUMBER
 
-Reco_tf.py --AMI=r12806 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputRDO_BKGFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20e_presampling.2k.latest.RDO.pool.root --maxEvents=500 --imf False --athenaopts "RAWtoESD:--threads=1" "ESDtoAOD:--threads=1" --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --AMI=r12806 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputRDO_BKGFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20e_presampling.2k.latest.RDO.pool.root --maxEvents=500 --imf False --athenaopts "RAWtoESD:--threads=1" "ESDtoAOD:--threads=1" --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 
 RES=$?
 echo "art-result: $RES Reco"
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_MultipleThreads.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_MultipleThreads.sh
index 3e036373c861..c5f26a6de71d 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_MultipleThreads.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_MultipleThreads.sh
@@ -10,7 +10,7 @@
 unset ATHENA_CORE_NUMBER
 unset ATHENA_PROC_NUMBER
 
-Reco_tf.py --AMI=r12806 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputRDO_BKGFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20e_presampling.2k.latest.RDO.pool.root  --maxEvents=500 --imf False --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --AMI=r12806 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputRDO_BKGFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20e_presampling.2k.latest.RDO.pool.root  --maxEvents=500 --imf False --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 
 RES=$?
 echo "art-result: $RES Reco"
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_PhysValAll.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_PhysValAll.sh
index 52d9b392e08b..eed0f60ed22d 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_PhysValAll.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_PhysValAll.sh
@@ -6,6 +6,6 @@
 # art-include: master/Athena
 
 export TRF_ECHO=True;
-Reco_tf.py --inputAODFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.recon.AOD.e4993_s3227_r12649/myAOD.pool.root --outputNTUP_PHYSVALFile physval.root  --validationFlags 'doExample,doPFlow_FlowElements,doTau,doEgamma,doBtag,doZee,doTopoCluster,doMuon' --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --inputAODFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.recon.AOD.e4993_s3227_r12649/myAOD.pool.root --outputNTUP_PHYSVALFile physval.root  --validationFlags 'doExample,doPFlow_FlowElements,doTau,doEgamma,doBtag,doZee,doTopoCluster,doMuon' --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 RES=$?
 echo "art-result: $RES Reco"
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_PhysValExample.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_PhysValExample.sh
index 27b5c04d2435..4fcbdad75678 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_PhysValExample.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_PhysValExample.sh
@@ -6,6 +6,6 @@
 # art-include: master/Athena
 
 export TRF_ECHO=True;
-Reco_tf.py --inputAODFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.recon.AOD.e4993_s3227_r12649/myAOD.pool.root  --outputNTUP_PHYSVALFile physval.root  --validationFlags doExample --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --inputAODFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.recon.AOD.e4993_s3227_r12649/myAOD.pool.root  --outputNTUP_PHYSVALFile physval.root  --validationFlags doExample --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 RES=$?
 echo "art-result: $RES Reco"
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_chainRecoPhysVal.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_chainRecoPhysVal.sh
index 5c9f383b90b0..340e14ea0d47 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_chainRecoPhysVal.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_13TeV_chainRecoPhysVal.sh
@@ -10,7 +10,7 @@
 unset ATHENA_CORE_NUMBER
 unset ATHENA_PROC_NUMBER
 
-Reco_tf.py --AMI=r12806 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputRDO_BKGFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20e_presampling.2k.latest.RDO.pool.root --maxEvents=500 --imf False --athenaopts "RAWtoESD:--threads=1" "ESDtoAOD:--threads=1" --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --AMI=r12806 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputRDO_BKGFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20e_presampling.2k.latest.RDO.pool.root --maxEvents=500 --imf False --athenaopts "RAWtoESD:--threads=1" "ESDtoAOD:--threads=1" --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 
 RES=$?
 echo "art-result: $RES Reco"
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_13TeV.sh
index 68e751f4a1fc..1960e21eebad 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_13TeV.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_13TeV.sh
@@ -10,6 +10,6 @@
 unset ATHENA_CORE_NUMBER
 unset ATHENA_PROC_NUMBER
 
-Reco_tf.py --AMI=r12898 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500 --imf False  --athenaopts "RAWtoESD:--threads=1" "ESDtoAOD:--threads=1" --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --AMI=r12898 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500 --imf False  --athenaopts "RAWtoESD:--threads=1" "ESDtoAOD:--threads=1" --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 RES=$?
 echo "art-result: $RES Reco"
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_13TeV_MultipleThreads.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_13TeV_MultipleThreads.sh
index ebb314e22594..ab6168835a8b 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_13TeV_MultipleThreads.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_13TeV_MultipleThreads.sh
@@ -10,6 +10,6 @@
 unset ATHENA_CORE_NUMBER
 unset ATHENA_PROC_NUMBER
 
-Reco_tf.py --AMI=r12898 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root  --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500  --imf False --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --AMI=r12898 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root  --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500  --imf False --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 RES=$?
 echo "art-result: $RES Reco"
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_stdcmalloc_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_stdcmalloc_13TeV.sh
index 86e7dadcf3dd..02a32e4353a2 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_stdcmalloc_13TeV.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_stdcmalloc_13TeV.sh
@@ -10,6 +10,6 @@
 unset ATHENA_CORE_NUMBER
 unset ATHENA_PROC_NUMBER
 
-Reco_tf.py --AMI=r12898 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500 --imf False --athenaopts "all:--stdcmalloc" "RAWtoESD:--threads=1" "ESDtoAOD:--threads=1" --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --AMI=r12898 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500 --imf False --athenaopts "all:--stdcmalloc" "RAWtoESD:--threads=1" "ESDtoAOD:--threads=1" --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 RES=$?
 echo "art-result: $RES Reco"
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_stdcmalloc_13TeV_MultipleThreads.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_stdcmalloc_13TeV_MultipleThreads.sh
index b6211bedb053..7b7b9db72df7 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_stdcmalloc_13TeV_MultipleThreads.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_nopileup_stdcmalloc_13TeV_MultipleThreads.sh
@@ -10,6 +10,6 @@
 unset ATHENA_CORE_NUMBER
 unset ATHENA_PROC_NUMBER
 
-Reco_tf.py --AMI=r12898 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500 --imf False --athenaopts "all:--stdcmalloc" --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --AMI=r12898 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1  --maxEvents=500 --imf False --athenaopts "all:--stdcmalloc" --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 RES=$?
 echo "art-result: $RES Reco"
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_trigsplit_13TeV.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_trigsplit_13TeV.sh
index 1f88623c0c10..eb5972b3dc8f 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_trigsplit_13TeV.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_trigsplit_13TeV.sh
@@ -10,6 +10,6 @@
 unset ATHENA_CORE_NUMBER
 unset ATHENA_PROC_NUMBER
 
-Reco_tf.py --AMI=r12806 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputRDO_BKGFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20e_presampling.2k.latest.RDO.pool.root --maxEvents=500  --imf False --steering RAWtoESD:in-RDO RAWtoESD:in-BS RAWtoESD:in+RDO_TRIG --athenaopts "RAWtoESD:--threads=1" "ESDtoAOD:--threads=1" --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --AMI=r12806 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputRDO_BKGFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20e_presampling.2k.latest.RDO.pool.root --maxEvents=500  --imf False --steering RAWtoESD:in-RDO RAWtoESD:in-BS RAWtoESD:in+RDO_TRIG --athenaopts "RAWtoESD:--threads=1" "ESDtoAOD:--threads=1" --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 RES=$?
 echo "art-result: $RES Reco"
diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_trigsplit_13TeV_MultipleThreads.sh b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_trigsplit_13TeV_MultipleThreads.sh
index 7208f8aff9a9..53f042df5742 100755
--- a/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_trigsplit_13TeV_MultipleThreads.sh
+++ b/Reconstruction/RecExample/RecJobTransformTests/test/test_mc20e_trigsplit_13TeV_MultipleThreads.sh
@@ -10,6 +10,6 @@
 unset ATHENA_CORE_NUMBER
 unset ATHENA_PROC_NUMBER
 
-Reco_tf.py --AMI=r12806 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputRDO_BKGFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20e_presampling.2k.latest.RDO.pool.root --maxEvents=500  --imf False --steering RAWtoESD:in-RDO RAWtoESD:in-BS RAWtoESD:in+RDO_TRIG --conditionsTag="OFLCOND-MC16-SDR-RUN2-08"
+Reco_tf.py --AMI=r12806 --outputRDOFile=myRDO.pool.root --outputAODFile=myAOD.pool.root --outputESDFile=myESD.pool.root --inputHITSFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecJobTransformTests/mc16_13TeV/valid1/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s3227/HITS.12560240._000287.pool.root.1 --inputRDO_BKGFile=/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/OverlayTests/PresampledPileUp/22.0/Run2/large/mc20e_presampling.2k.latest.RDO.pool.root --maxEvents=500  --imf False --steering RAWtoESD:in-RDO RAWtoESD:in-BS RAWtoESD:in+RDO_TRIG --conditionsTag="OFLCOND-MC16-SDR-RUN2-09"
 RES=$?
 echo "art-result: $RES Reco"
-- 
GitLab


From 4c22a11dfc62808e7d87fd00da2271572b110482 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Thu, 23 Sep 2021 13:06:56 +0200
Subject: [PATCH 280/347] egammaRecBuilder can work with any type of clusters,
 not just topo although this is the default. Make this clean in the namings

---
 .../egamma/egammaAlgs/python/egammaRecBuilder.py          | 2 +-
 .../egamma/egammaAlgs/python/egammaRecBuilderConfig.py    | 2 +-
 Reconstruction/egamma/egammaAlgs/src/egammaRecBuilder.cxx | 6 +++---
 Reconstruction/egamma/egammaAlgs/src/egammaRecBuilder.h   | 8 ++++----
 .../Electron/PrecisionElectronRecoSequences.py            | 2 +-
 .../Electron/PrecisionElectronRecoSequences_GSF.py        | 2 +-
 .../Electron/PrecisionElectronRecoSequences_LRT.py        | 2 +-
 .../HLTMenuConfig/Electron/TrigElectronFactories.py       | 2 +-
 .../python/HLTMenuConfig/Electron/generateElectron.py     | 2 +-
 .../HLTMenuConfig/Photon/PrecisionPhotonRecoSequences.py  | 2 +-
 .../python/HLTMenuConfig/Photon/TrigPhotonFactories.py    | 2 +-
 11 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/Reconstruction/egamma/egammaAlgs/python/egammaRecBuilder.py b/Reconstruction/egamma/egammaAlgs/python/egammaRecBuilder.py
index fd9078a89935..12f4289b4c15 100644
--- a/Reconstruction/egamma/egammaAlgs/python/egammaRecBuilder.py
+++ b/Reconstruction/egamma/egammaAlgs/python/egammaRecBuilder.py
@@ -15,7 +15,7 @@ from egammaTools.egammaToolsFactories import \
 egammaRecBuilder = AlgFactory(
     egammaAlgsConf.egammaRecBuilder,
     name='egammaRecBuilder',
-    InputTopoClusterContainerName=jobproperties.egammaRecFlags.egammaTopoClusterCollection(),
+    InputClusterContainerName=jobproperties.egammaRecFlags.egammaTopoClusterCollection(),
     egammaRecContainer=egammaKeys.EgammaRecKey(),
     # Builder tools
     TrackMatchBuilderTool=EMTrackMatchBuilder,
diff --git a/Reconstruction/egamma/egammaAlgs/python/egammaRecBuilderConfig.py b/Reconstruction/egamma/egammaAlgs/python/egammaRecBuilderConfig.py
index f7ab862c60c9..f5f6b76bc767 100644
--- a/Reconstruction/egamma/egammaAlgs/python/egammaRecBuilderConfig.py
+++ b/Reconstruction/egamma/egammaAlgs/python/egammaRecBuilderConfig.py
@@ -35,7 +35,7 @@ def egammaRecBuilderCfg(
         "egammaRecContainer",
         flags.Egamma.Keys.Internal.EgammaRecs)
     kwargs.setdefault(
-        "InputTopoClusterContainerName",
+        "InputClusterContainerName",
         flags.Egamma.Keys.Internal.EgammaTopoClusters)
 
     egrecAlg = egammaRecBuilder(name, **kwargs)
diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaRecBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaRecBuilder.cxx
index 079ce1f62f09..52b0721e89bf 100644
--- a/Reconstruction/egamma/egammaAlgs/src/egammaRecBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/egammaRecBuilder.cxx
@@ -28,7 +28,7 @@ StatusCode
 egammaRecBuilder::initialize()
 {
   // First the data handle keys
-  ATH_CHECK(m_inputTopoClusterContainerKey.initialize());
+  ATH_CHECK(m_inputClusterContainerKey.initialize());
   ATH_CHECK(m_egammaRecContainerKey.initialize());
 
   // retrieve track match builder
@@ -86,13 +86,13 @@ egammaRecBuilder::execute(const EventContext& ctx) const
   ATH_MSG_DEBUG("Executing egammaRecBuilder");
 
   SG::ReadHandle<xAOD::CaloClusterContainer> topoclusters(
-    m_inputTopoClusterContainerKey, ctx);
+    m_inputClusterContainerKey, ctx);
 
   // validity check is only really needed for serial running. Remove when MT is
   // only way.
   if (!topoclusters.isValid()) {
     ATH_MSG_ERROR("Could not retrieve cluster container:"
-                  << m_inputTopoClusterContainerKey.key());
+                  << m_inputClusterContainerKey.key());
     return StatusCode::FAILURE;
   }
 
diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaRecBuilder.h b/Reconstruction/egamma/egammaAlgs/src/egammaRecBuilder.h
index 04011e96517c..45d837c483f6 100644
--- a/Reconstruction/egamma/egammaAlgs/src/egammaRecBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/egammaRecBuilder.h
@@ -24,7 +24,7 @@ class IEMConversionBuilder;
   @brief Produces the initial egammaRec objects as a step of the egamma supercluster algorithms.
 
   Input container:
-  - InputTopoClusterContainerName (default=egammaTopoCluster): topo cluster to be used to build
+  - InputClusterContainerName (default=egammaTopoCluster): topo cluster to be used to build
     the egammaRec
   Output container:
   - egammaRecContainer (default=EMTrackMatchBuilder)
@@ -33,7 +33,7 @@ class IEMConversionBuilder;
   - TrackMatchBuilderTool (default=EMTrackMatchBuilder)
   - ConversionBuilderTool (default=EMConversionBuilder)
 
-  The algorithm produces an egammaRec for each topo cluster where the matched tracks and vertices
+  The algorithm produces an egammaRec for each cluster where the matched tracks and vertices
   are linked. These two matchings are done depending on the flags doTrackMatching and doConversions,
   by default true.
   */
@@ -50,9 +50,9 @@ private:
   /** @brief retrieve ConversionBuilderTool (EMConversionBuilder) **/
   StatusCode RetrieveEMConversionBuilder();
   /** @brief Key for the topo cluster input collection */
-  SG::ReadHandleKey<xAOD::CaloClusterContainer> m_inputTopoClusterContainerKey{
+  SG::ReadHandleKey<xAOD::CaloClusterContainer> m_inputClusterContainerKey{
     this,
-    "InputTopoClusterContainerName",
+    "InputClusterContainerName",
     "egammaTopoCluster",
     "Name of input cluster container"
   };
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py
index c81ccf8b4dd0..d977b3308a2e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py
@@ -62,7 +62,7 @@ def precisionElectronRecoSequence(RoIs, ion=False):
     TrigEgammaRecAlgo = TrigEgammaRecElectron("TrigEgammaRecElectron_noGSF" + tag)
     thesequence += TrigEgammaRecAlgo
     TrigEgammaRecAlgo.TrackMatchBuilderTool = TrigEMTrackMatchBuilder
-    TrigEgammaRecAlgo.InputTopoClusterContainerName = caloClusters
+    TrigEgammaRecAlgo.InputClusterContainerName = caloClusters
 
     ## TrigElectronSuperClusterBuilder_noGSF ##
     TrigSuperElectronAlgo = TrigElectronSuperClusterBuilder("TrigElectronSuperClusterBuilder_noGSF" + tag)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences_GSF.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences_GSF.py
index 8a550cb2bdf5..229eca257ebd 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences_GSF.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences_GSF.py
@@ -69,7 +69,7 @@ def precisionElectronRecoSequence_GSF(RoIs):
     TrigEgammaRecAlgo_GSF = TrigEgammaRecElectron("TrigEgammaRecElectron_GSF")
     thesequence_GSF += TrigEgammaRecAlgo_GSF
     TrigEgammaRecAlgo_GSF.TrackMatchBuilderTool = TrigEMTrackMatchBuilder_GSF
-    TrigEgammaRecAlgo_GSF.InputTopoClusterContainerName = precisionCaloMenuDefs.precisionCaloClusters
+    TrigEgammaRecAlgo_GSF.InputClusterContainerName = precisionCaloMenuDefs.precisionCaloClusters
 
     ## TrigElectronSuperClusterBuilder_GSF ##
     TrigSuperElectronAlgo_GSF = TrigElectronSuperClusterBuilder("TrigElectronSuperClusterBuilder_GSF")
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences_LRT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences_LRT.py
index c8c31918e83a..4e3c73a9139b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences_LRT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences_LRT.py
@@ -57,7 +57,7 @@ def precisionElectronRecoSequence_LRT(RoIs):
     TrigEgammaRecAlgo = TrigEgammaRecElectron("TrigEgammaRecElectron_LRT")
     thesequence += TrigEgammaRecAlgo
     TrigEgammaRecAlgo.TrackMatchBuilderTool = TrigEMTrackMatchBuilder
-    TrigEgammaRecAlgo.InputTopoClusterContainerName = precisionCaloMenuDefs_LRT.precisionCaloClusters
+    TrigEgammaRecAlgo.InputClusterContainerName = precisionCaloMenuDefs_LRT.precisionCaloClusters
 
     ## TrigElectronSuperClusterBuilder_LRT ##
     TrigSuperElectronAlgo = TrigElectronSuperClusterBuilder("TrigElectronSuperClusterBuilder_LRT")
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py
index 7d6c477cbc41..ce44eac01466 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py
@@ -26,7 +26,7 @@ from egammaRec.Factories import AlgFactory, FcnWrapper
 """Configuring egammaRecBuilder """
 TrigEgammaRecElectron = AlgFactory( egammaAlgsConf.egammaRecBuilder,
                             name = 'TrigEgammaRecElectron',
-                            InputTopoClusterContainerName= "precisionCaloCluster",
+                            InputClusterContainerName= "precisionCaloCluster",
                             egammaRecContainer= TrigEgammaKeys.EgammaRecKey,
                             doConversions = False,
                             doAdd= False,
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
index 81ce36306fea..cc3272f392a0 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
@@ -174,7 +174,7 @@ def _precisionElectronSeq(flags, doIDperf=False):
     def TrigEgammaRecElectronCfg(flags, name='TrigEgammaRecElectron_noGSF'):
         acc = ComponentAccumulator()
         electronRec = CompFactory.egammaRecBuilder( name,
-                                                    InputTopoClusterContainerName= 'HLT_CaloEMClusters',
+                                                    InputClusterContainerName= 'HLT_CaloEMClusters',
                                                     egammaRecContainer= TrigEgammaKeys.EgammaRecKey,
                                                     doConversions = False,
                                                     TrackMatchBuilderTool = recoAcc.popToolsAndMerge(TrigEMTrackMatchBuilderToolCfg(flags)) )
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PrecisionPhotonRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PrecisionPhotonRecoSequences.py
index 160e34ad00bc..8ffae396e7f7 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PrecisionPhotonRecoSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PrecisionPhotonRecoSequences.py
@@ -41,7 +41,7 @@ def precisionPhotonRecoSequence(RoIs):
     # Add to the sequence the three steps:
     #  - TrigEgammaBuilder, TrigPhotonSuperClusters, TrigTopoEgammaPhotons
     TrigEgammaAlgo = TrigEgammaRecPhoton()
-    TrigEgammaAlgo.InputTopoClusterContainerName = precisionCaloMenuDefs.precisionCaloClusters
+    TrigEgammaAlgo.InputClusterContainerName = precisionCaloMenuDefs.precisionCaloClusters
     thesequence += TrigEgammaAlgo
 
     trigPhotonAlgo = TrigPhotonSuperClusterBuilder()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py
index 6072ad121737..ecb0a4165786 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py
@@ -30,7 +30,7 @@ from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloMenuSequences import precis
 # Factory for egamaRecBuilder/TrigEgammaRecPhoton
 TrigEgammaRecPhoton = AlgFactory( egammaAlgsConf.egammaRecBuilder,
         name = 'TrigEgammaRecPhoton' ,
-        InputTopoClusterContainerName = precisionCaloMenuDefs.precisionCaloClusters, # Use as input, the clusters made by precisionCalo
+        InputClusterContainerName = precisionCaloMenuDefs.precisionCaloClusters, # Use as input, the clusters made by precisionCalo
         egammaRecContainer=TrigEgammaKeys.EgammaRecKey,
         doTrackMatching = False,
         doConversions = False,
-- 
GitLab


From b9b28b35d3eb747e48f6de4f40329f68d72bbd85 Mon Sep 17 00:00:00 2001
From: Sebastien Rettie <sebastien.rettie@cern.ch>
Date: Thu, 23 Sep 2021 14:53:57 +0200
Subject: [PATCH 281/347] Implement track observer tool

---
 .../xAODTracking/TrackingPrimitives.h         |  56 +++
 Event/xAOD/xAODTrackingCnv/CMakeLists.txt     |   4 +-
 .../src/RecTrackParticleContainerCnvTool.cxx  |   7 +
 .../src/RecTrackParticleContainerCnvTool.h    |   5 +
 .../src/TrackCollectionCnvTool.cxx            |  66 +++
 .../src/TrackCollectionCnvTool.h              |   5 +
 .../src/TrackParticleCnvAlg.cxx               |  49 +-
 .../xAODTrackingCnv/src/TrackParticleCnvAlg.h |   8 +-
 .../IRecTrackParticleContainerCnvTool.h       |   5 +
 .../xAODTrackingCnv/ITrackCollectionCnvTool.h |   5 +
 .../python/InDetJobProperties.py              |   6 +
 .../InDetRecExample/python/InDetKeys.py       |  28 ++
 .../InDetRecExample/python/TrackingCommon.py  |  48 ++
 .../share/ConfiguredNewTrackingSiPattern.py   |  37 +-
 .../ConfiguredxAODTrackParticleCreation.py    |   4 +
 .../InDetRecExample/share/InDetxAODCreator.py |  42 +-
 .../InDetRecExample/share/WriteInDetAOD.py    |  12 +
 .../InDetRecExample/share/WriteInDetESD.py    |  10 +-
 .../CMakeLists.txt                            |   2 +-
 .../InDetAmbiTrackSelectionTool.h             |   3 +-
 .../InDetDenseEnvAmbiTrackSelectionTool.h     |  11 +-
 .../src/InDetAmbiTrackSelectionTool.cxx       |   5 +-
 .../InDetDenseEnvAmbiTrackSelectionTool.cxx   | 146 +++++-
 .../MuonAmbiTrackSelectionTool.h              |   3 +-
 .../src/MuonAmbiTrackSelectionTool.cxx        |   4 +-
 .../src/TrackStateOnSurfaceDecorator.cxx      | 116 ++---
 .../TrkTrack/TrkTrack/ObservedTracksMap.h     |  52 ++
 .../TrkAmbiguityProcessor/CMakeLists.txt      |   2 +-
 .../src/AmbiguityProcessorBase.cxx            |  54 +-
 .../src/AmbiguityProcessorBase.h              |   9 +-
 .../src/AmbiguityProcessorUtility.cxx         |   5 +
 .../src/AmbiguityProcessorUtility.h           |   2 +
 ...enseEnvironmentsAmbiguityProcessorTool.cxx |  48 +-
 .../DenseEnvironmentsAmbiguityProcessorTool.h |   7 +-
 ...nvironmentsAmbiguityScoreProcessorTool.cxx |  30 +-
 ...eEnvironmentsAmbiguityScoreProcessorTool.h |   4 +
 .../src/SimpleAmbiguityProcessorTool.cxx      |   8 +-
 .../TrkAmbiguityProcessor/src/TrackPtr.h      |  17 +-
 .../src/TrackSelectionProcessorTool.cxx       |   2 +-
 .../IAmbiTrackSelectionTool.h                 |   6 +-
 .../TrkValInterfaces/ITrkObserverTool.h       |  54 ++
 .../TrkValTools/TrkValTools/TrkObserverTool.h |  85 ++++
 .../TrkValTools/src/TrkObserverTool.cxx       | 460 ++++++++++++++++++
 .../src/components/TrkValTools_entries.cxx    |   3 +-
 .../TrigEvent/TrigBSExtraction/CMakeLists.txt |   2 +-
 45 files changed, 1374 insertions(+), 163 deletions(-)
 create mode 100644 Tracking/TrkEvent/TrkTrack/TrkTrack/ObservedTracksMap.h
 create mode 100644 Tracking/TrkValidation/TrkValInterfaces/TrkValInterfaces/ITrkObserverTool.h
 create mode 100644 Tracking/TrkValidation/TrkValTools/TrkValTools/TrkObserverTool.h
 create mode 100644 Tracking/TrkValidation/TrkValTools/src/TrkObserverTool.cxx

diff --git a/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h b/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h
index 00df71dd3bf1..8856872bf10c 100644
--- a/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h
+++ b/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h
@@ -429,6 +429,62 @@ namespace xAOD {
     numberOfMuonSummaryTypes       = 89
   };
 
+  // Enums for rejection locations
+  enum RejectionStep {
+    // Rejections within DenseEnvironmentsAmbiguityProcessorTool::solveTracks
+    solveTracks,
+    // Rejections within DenseEnvironmentsAmbiguityScoreProcessorTool::addNewTracks
+    addNewTracks,
+    // Rejections within AmbiguityProcessorBase::refitTrack
+    refitTrack,
+    // Rejections within AmbiguityProcessorBase::addTrack
+    addTrack,
+    // Rejections within InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep
+    decideWhichHitsToKeep,
+    // Rejections within InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack
+    getCleanedOutTrack
+  };
+  enum RejectionReason {
+    acceptedTrack,
+    // Reason for rejection within DenseEnvironmentsAmbiguityProcessorTool::solveTracks
+    stillBeingProcessed,
+    // Reason for rejection within DenseEnvironmentsAmbiguityScoreProcessorTool::addNewTracks
+    trackScoreZero,
+    duplicateTrack,
+    // Reason for rejection within AmbiguityProcessorBase::refitTrack
+    subtrackCreated,
+    refitFailed,
+    // Reason for rejection within AmbiguityProcessorBase::addTrack
+    bremRefitFailed,
+    bremRefitSubtrackCreated,
+    bremRefitTrackScoreZero,
+    refitTrackScoreZero,
+    // Reason for rejection within decideWhichHitsToKeep
+    TSOSRejectedHit,
+    TSOSOutlierShared,
+    pixelSplitButTooManyShared2Ptc,
+    pixelSplitButTooManyShared3Ptc,
+    tooManySharedRecoverable,
+    tooManySharedNonRecoverable,
+    sharedSCT,
+    sharedHitsBadChi2,
+    sharedHitsNotEnoughUniqueHits,
+    firstHitSharedAndPixIBL,
+    firstHitSharedAndExtraShared,
+    sharedHitsNotEnoughUniqueSiHits,
+    sharedIBLSharedWithNoIBLTrack,
+    sharedPixelSharedWithDifferentIBLTrack,
+    tooManySharedAfterIncreasingShared,
+    // Reason for rejection within getCleanedOutTrack
+    notEnoughSiHits,
+    notEnoughTRTHits,
+    notEnoughUniqueSiHits,
+    tooFewHits,
+    failedSubtrackCreation,
+    subtrackCreatedWithRecoveredShared,
+    other
+  };
+
   /// A convenience namespace to make the client code easier to understand
   namespace VxType {
     /// Vertex types
diff --git a/Event/xAOD/xAODTrackingCnv/CMakeLists.txt b/Event/xAOD/xAODTrackingCnv/CMakeLists.txt
index a093942c0072..4188808f18ba 100644
--- a/Event/xAOD/xAODTrackingCnv/CMakeLists.txt
+++ b/Event/xAOD/xAODTrackingCnv/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( xAODTrackingCnv )
@@ -30,7 +30,7 @@ else()
       LINK_LIBRARIES xAODTracking TrkTrack AthenaBaseComps AthenaKernel
       EventPrimitives GaudiKernel GeneratorObjects MCTruthClassifierLib Particle
       ParticleTruth TrkLinks TrkParticleBase TrkTruthData VxVertex
-      TrkToolInterfaces xAODCore xAODTrackingCnvLib
+      TrkToolInterfaces xAODCore xAODTrackingCnvLib TrkValInterfaces
       PRIVATE_LINK_LIBRARIES CxxUtils )
 
 endif()
diff --git a/Event/xAOD/xAODTrackingCnv/src/RecTrackParticleContainerCnvTool.cxx b/Event/xAOD/xAODTrackingCnv/src/RecTrackParticleContainerCnvTool.cxx
index 305419982c20..7a5cce76c488 100644
--- a/Event/xAOD/xAODTrackingCnv/src/RecTrackParticleContainerCnvTool.cxx
+++ b/Event/xAOD/xAODTrackingCnv/src/RecTrackParticleContainerCnvTool.cxx
@@ -61,6 +61,13 @@ namespace xAODMaker {
     return StatusCode::SUCCESS;    
   }
 
+  StatusCode RecTrackParticleContainerCnvTool::convertAndAugment( const Rec::TrackParticleContainer* aod,
+							xAOD::TrackParticleContainer* xaod, const ObservedTracksMap* trk_map ) const {
+    
+    ATH_MSG_DEBUG( "Sizes of containers before conversion: aod, xaod, trk_map: " << aod->size() << ", " << xaod->size() << ", "<< trk_map->size() );
+    ATH_MSG_DEBUG( "convertAndAugment should not be called using IRecTrackParticleContainerCnvTool!" );
+    return StatusCode::FAILURE;    
+  }
 
   xAOD::TrackParticle* RecTrackParticleContainerCnvTool::createParticle( xAOD::TrackParticleContainer* xaod, 
 									 const Rec::TrackParticleContainer* /**container*/, 
diff --git a/Event/xAOD/xAODTrackingCnv/src/RecTrackParticleContainerCnvTool.h b/Event/xAOD/xAODTrackingCnv/src/RecTrackParticleContainerCnvTool.h
index fae42e18a909..7c5c49194abd 100644
--- a/Event/xAOD/xAODTrackingCnv/src/RecTrackParticleContainerCnvTool.h
+++ b/Event/xAOD/xAODTrackingCnv/src/RecTrackParticleContainerCnvTool.h
@@ -17,6 +17,7 @@
 
 // Local include(s):
 #include "xAODTrackingCnv/IRecTrackParticleContainerCnvTool.h"
+#include "TrkValInterfaces/ITrkObserverTool.h"
 
 namespace xAODMaker {
 
@@ -35,6 +36,10 @@ namespace xAODMaker {
     virtual StatusCode convert( const Rec::TrackParticleContainer* aod,
 			       xAOD::TrackParticleContainer* xaod ) const override;
 
+    /// Function that fills an existing xAOD::TrackParticleContainer and augments track particles
+    virtual StatusCode convertAndAugment( const Rec::TrackParticleContainer* aod,
+						 xAOD::TrackParticleContainer* xaod, const ObservedTracksMap* trk_map ) const override;
+
     /// allow other algorithms to pass the tool in order to preserve initialisation
     virtual StatusCode setParticleCreatorTool(ToolHandle<Trk::ITrackParticleCreatorTool> *tool) override;
 
diff --git a/Event/xAOD/xAODTrackingCnv/src/TrackCollectionCnvTool.cxx b/Event/xAOD/xAODTrackingCnv/src/TrackCollectionCnvTool.cxx
index b82c2229e8a2..5fb1ad9b6f24 100644
--- a/Event/xAOD/xAODTrackingCnv/src/TrackCollectionCnvTool.cxx
+++ b/Event/xAOD/xAODTrackingCnv/src/TrackCollectionCnvTool.cxx
@@ -60,6 +60,72 @@ namespace xAODMaker {
     return StatusCode::SUCCESS;    
   }
 
+  StatusCode TrackCollectionCnvTool::convertAndAugment( const TrackCollection* aod,
+					      xAOD::TrackParticleContainer* xaod, const ObservedTracksMap* trk_map ) const {
+        
+    ATH_MSG_DEBUG( "convertAndAugment: Sizes of containers before conversion: aod, xaod: " << aod->size() << ", " << xaod->size() );
+    ATH_MSG_DEBUG( "convertAndAugment: Size of track map: " << trk_map->size() );
+    
+    TrackCollection::const_iterator itr = aod->begin();
+    TrackCollection::const_iterator end = aod->end();
+    ObservedTracksMap::const_iterator itrMap = trk_map->begin();
+
+    // Check size of track collection matches size of observed tracks map
+    if(aod->size() != trk_map->size()){
+      ATH_MSG_ERROR("convertAndAugment: Number of tracks different in collection to convert vs. observed tracks map: "<<aod->size()<<" vs. "<<trk_map->size());
+      return StatusCode::FAILURE;
+    }
+
+    for( ;itr!=end;++itr ) {
+      // Create the xAOD object:
+      if (!(*itr)) {
+        ATH_MSG_WARNING("convertAndAugment: WTaF? Empty element in container!");
+        continue;
+      }
+      xAOD::TrackParticle* particle = createParticle(*xaod, *aod, **itr);
+      if(!particle){
+        ATH_MSG_WARNING("convertAndAugment: Failed to create a TrackParticle");
+        itrMap++;
+        continue;
+      }
+      // Augment xAOD object with information from track map
+			particle->auxdecor<long int>("Id")                = (*itrMap).first;
+			particle->auxdecor<double>("score")               = std::get<1>((*itrMap).second);
+			particle->auxdecor<int>("rejectStep")             = std::get<2>((*itrMap).second);
+			particle->auxdecor<int>("rejectReason")           = std::get<3>((*itrMap).second);
+			particle->auxdecor<long int>("parentId")          = std::get<4>((*itrMap).second);
+			particle->auxdecor<int>("numPixelHoles")          = std::get<5>((*itrMap).second);
+			particle->auxdecor<int>("numSCTHoles")            = std::get<6>((*itrMap).second);
+			particle->auxdecor<int>("numSplitSharedPixel")    = std::get<7>((*itrMap).second);
+			particle->auxdecor<int>("numSplitSharedSCT")      = std::get<8>((*itrMap).second);
+			particle->auxdecor<int>("numSharedOrSplit")       = std::get<9>((*itrMap).second);
+			particle->auxdecor<int>("numSharedOrSplitPixels") = std::get<10>((*itrMap).second);
+			particle->auxdecor<int>("numShared")              = std::get<11>((*itrMap).second);
+			particle->auxdecor<int>("isPatternTrack")         = std::get<12>((*itrMap).second);
+			particle->auxdecor<int>("totalSiHits")            = std::get<13>((*itrMap).second);
+			particle->auxdecor<int>("inROI")                  = std::get<14>((*itrMap).second);
+			particle->auxdecor<int>("thishasblayer")          = std::get<15>((*itrMap).second);
+			particle->auxdecor<int>("hassharedblayer")        = std::get<16>((*itrMap).second);
+			particle->auxdecor<int>("hassharedpixel")         = std::get<17>((*itrMap).second);
+			particle->auxdecor<int>("firstisshared")          = std::get<18>((*itrMap).second);
+			particle->auxdecor<int>("numPixelDeadSensor")     = std::get<19>((*itrMap).second);
+			particle->auxdecor<int>("numSCTDeadSensor")       = std::get<20>((*itrMap).second);
+			particle->auxdecor<int>("numPixelHits")           = std::get<21>((*itrMap).second);
+			particle->auxdecor<int>("numSCTHits")             = std::get<22>((*itrMap).second);
+			particle->auxdecor<int>("numUnused")              = std::get<23>((*itrMap).second);
+			particle->auxdecor<int>("numTRT_Unused")          = std::get<24>((*itrMap).second);
+			particle->auxdecor<int>("numSCT_Unused")          = std::get<25>((*itrMap).second);
+			particle->auxdecor<int>("numPseudo")              = std::get<26>((*itrMap).second);
+			particle->auxdecor<float>("averageSplit1")        = std::get<27>((*itrMap).second);
+			particle->auxdecor<float>("averageSplit2")        = std::get<28>((*itrMap).second);
+			particle->auxdecor<int>("numWeightedShared")      = std::get<29>((*itrMap).second);
+			ATH_MSG_DEBUG("convertAndAugment: Augmenting TrackParticle with id "<<particle->auxdata<long int>("Id")<<" and rejectReason "<<particle->auxdata<int>("rejectReason")<<" (has chi2 = "<<particle->chiSquared()<<")");
+      itrMap++;
+    }
+    ATH_MSG_DEBUG( "convertAndAugment: Sizes of containers after conversion: aod, xaod: " << aod->size() << ", " << xaod->size() );
+    return StatusCode::SUCCESS;    
+  }
+
   xAOD::TrackParticle* TrackCollectionCnvTool::createParticle(xAOD::TrackParticleContainer& xaod,
 							      const TrackCollection& container,
 							      const Trk::Track& tp) const {
diff --git a/Event/xAOD/xAODTrackingCnv/src/TrackCollectionCnvTool.h b/Event/xAOD/xAODTrackingCnv/src/TrackCollectionCnvTool.h
index 5ae3eed4f02b..1b2c17db092b 100644
--- a/Event/xAOD/xAODTrackingCnv/src/TrackCollectionCnvTool.h
+++ b/Event/xAOD/xAODTrackingCnv/src/TrackCollectionCnvTool.h
@@ -17,6 +17,7 @@
 
 // Local include(s):
 #include "xAODTrackingCnv/ITrackCollectionCnvTool.h"
+#include "TrkValInterfaces/ITrkObserverTool.h"
 
 namespace xAODMaker {
 
@@ -35,6 +36,10 @@ namespace xAODMaker {
     virtual StatusCode convert( const TrackCollection* aod,
 			       xAOD::TrackParticleContainer* xaod ) const override;
     
+    /// Function that fills an existing xAOD::TrackParticleContainer and augments track particles
+    virtual StatusCode convertAndAugment( const TrackCollection* aod,
+				xAOD::TrackParticleContainer* xaod, const ObservedTracksMap* trk_map ) const override;
+
     /// allow other algorithms to pass the tool in order to preserve initialisation
     virtual StatusCode setParticleCreatorTool(ToolHandle<Trk::ITrackParticleCreatorTool> *tool) override;
 
diff --git a/Event/xAOD/xAODTrackingCnv/src/TrackParticleCnvAlg.cxx b/Event/xAOD/xAODTrackingCnv/src/TrackParticleCnvAlg.cxx
index a4f3de9a7208..92fdfc9d4376 100644
--- a/Event/xAOD/xAODTrackingCnv/src/TrackParticleCnvAlg.cxx
+++ b/Event/xAOD/xAODTrackingCnv/src/TrackParticleCnvAlg.cxx
@@ -59,6 +59,8 @@ TrackParticleCnvAlg::TrackParticleCnvAlg(const std::string& name,
                   m_RecTrackParticleContainerCnvTool);
   declareProperty("DoMonitoring", m_doMonitoring = false);
   declareProperty("TrackMonTool", m_trackMonitoringTool);
+  declareProperty("AugmentObservedTracks", m_augmentObservedTracks = false, "augment observed tracks");
+  declareProperty("TracksMapName", m_tracksMap, "name of observed tracks map saved in store");
 }
 
 StatusCode
@@ -97,6 +99,8 @@ TrackParticleCnvAlg::initialize()
   // Retrieve monitoring tool if provided
   ATH_CHECK(m_trackMonitoringTool.retrieve(DisableTool{ !m_doMonitoring }));
 
+  ATH_CHECK(m_tracksMap.initialize(m_augmentObservedTracks));
+
   // Return gracefully:
   return StatusCode::SUCCESS;
 }
@@ -110,6 +114,7 @@ TrackParticleCnvAlg::execute(const EventContext& ctx) const
   const xAODTruthParticleLinkVector* truthLinks = nullptr;
   const TrackParticleTruthCollection* aodTruth = nullptr;
   const TrackTruthCollection* trackTruth = nullptr;
+  const ObservedTracksMap* tracksMap = nullptr;
 
   // Retrieve the AOD particles:
   if (m_convertAODTrackParticles) {
@@ -169,9 +174,27 @@ TrackParticleCnvAlg::execute(const EventContext& ctx) const
     ATH_CHECK(
       wh_xaodout.record(std::make_unique<xAOD::TrackParticleContainer>(),
                         std::make_unique<xAOD::TrackParticleAuxContainer>()));
-    convert(
-      (*tracks), trackTruth, m_TrackCollectionCnvTool, wh_xaodout, truthLinks);
 
+    // Augment track particles with information from observer tool
+    if (m_augmentObservedTracks){
+      SG::ReadHandle<ObservedTracksMap> rh_tracksMap(m_tracksMap, ctx);
+      if (!rh_tracksMap.isValid()) {
+        ATH_MSG_ERROR(m_tracksMap.key() << " not found");
+        return StatusCode::FAILURE;
+      }
+      else {
+        tracksMap = rh_tracksMap.cptr();
+        ATH_MSG_VERBOSE("Got ObservedTracksMap with key " << m_tracksMap.key()
+                                                        << " found.");
+      }
+
+      convert(
+        (*tracks), trackTruth, m_TrackCollectionCnvTool, wh_xaodout, truthLinks, tracksMap);
+    }
+    else{
+      convert(
+        (*tracks), trackTruth, m_TrackCollectionCnvTool, wh_xaodout, truthLinks);
+    }
     // Monitor track parameters
     if (m_doMonitoring)
       m_trackMonitoringTool->monitor_tracks("Track", "Pass", *wh_xaodout);
@@ -242,19 +265,29 @@ TrackParticleCnvAlg::convert(
   const TRUTHCONT& truth,
   CONVTOOL& conv_tool,
   SG::WriteHandle<xAOD::TrackParticleContainer>& xaod,
-  const xAODTruthParticleLinkVector* truthLinkVec) const
+  const xAODTruthParticleLinkVector* truthLinkVec,
+  const ObservedTracksMap* obs_track_map /*=0*/) const
 {
   // Create the xAOD container and its auxiliary store:
 
   // convert the track containers separately with the converting tools that are
   // also used by TrigHLTtoxAODTool
   ATH_MSG_DEBUG("calling the converting tool for " << xaod.name());
-  if (conv_tool->convert(&container, xaod.ptr()).isFailure()) {
-    ATH_MSG_ERROR("Couldn't convert aod to xaod ("
-                  << xaod.name() << ") with the converting tool");
-    return -1;
+  // Augment track particles using track map if available
+  if (obs_track_map){
+    if (conv_tool->convertAndAugment(&container, xaod.ptr(), obs_track_map).isFailure()) {
+      ATH_MSG_ERROR("Couldn't convert and augment aod to xaod ("
+                    << xaod.name() << ") with the converting tool");
+      return -1;
+    }
+  }
+  else{
+    if (conv_tool->convert(&container, xaod.ptr()).isFailure()) {
+      ATH_MSG_ERROR("Couldn't convert aod to xaod ("
+                    << xaod.name() << ") with the converting tool");
+      return -1;
+    }
   }
-
   // Create the xAOD objects:
   xAOD::TrackParticleContainer::iterator itr_xaod = xaod->begin();
   xAOD::TrackParticleContainer::iterator end_xaod = xaod->end();
diff --git a/Event/xAOD/xAODTrackingCnv/src/TrackParticleCnvAlg.h b/Event/xAOD/xAODTrackingCnv/src/TrackParticleCnvAlg.h
index 39a5cf5deee7..af3d933061c6 100644
--- a/Event/xAOD/xAODTrackingCnv/src/TrackParticleCnvAlg.h
+++ b/Event/xAOD/xAODTrackingCnv/src/TrackParticleCnvAlg.h
@@ -23,6 +23,8 @@
 #include "Particle/TrackParticleContainer.h"
 #include "TrkTrack/TrackCollection.h"
 #include "xAODTracking/TrackParticle.h"
+#include "TrkValInterfaces/ITrkObserverTool.h"
+#include "AthenaKernel/SlotSpecificObj.h"
 
 // Local include(s):
 #include "xAODTrackingCnv/ITrackParticleMonitoring.h"
@@ -103,7 +105,9 @@ namespace xAODMaker {
     bool m_doMonitoring;
     ToolHandle< ITrackParticleMonitoring > m_trackMonitoringTool { this, "MonTool", "", "Tracking Monitoring tool" };
 
-
+    // Augment observed tracks with information from track observer tool map
+    bool m_augmentObservedTracks;
+    SG::ReadHandleKey<ObservedTracksMap> m_tracksMap;
 
     /// toggle on converting AOD track particles to xAOD
     bool m_convertAODTrackParticles;
@@ -112,7 +116,7 @@ namespace xAODMaker {
     bool m_convertTracks;
       
     template <typename CONT, typename TRUTHCONT, typename CONVTOOL>
-    int convert(const CONT&, const TRUTHCONT&, CONVTOOL& tool, SG::WriteHandle<xAOD::TrackParticleContainer>&, const xAODTruthParticleLinkVector*) const;
+    int convert(const CONT&, const TRUTHCONT&, CONVTOOL& tool, SG::WriteHandle<xAOD::TrackParticleContainer>&, const xAODTruthParticleLinkVector*, const ObservedTracksMap* obs_track_map = 0) const;
       
     inline xAOD::TrackParticle* createParticle(xAOD::TrackParticleContainer& xaod, const Rec::TrackParticleContainer& container, const Rec::TrackParticle& tp) ;
     inline xAOD::TrackParticle* createParticle( xAOD::TrackParticleContainer& xaod, const TrackCollection& container, const Trk::Track& tp) ;
diff --git a/Event/xAOD/xAODTrackingCnv/xAODTrackingCnv/IRecTrackParticleContainerCnvTool.h b/Event/xAOD/xAODTrackingCnv/xAODTrackingCnv/IRecTrackParticleContainerCnvTool.h
index b8980eb83c84..b499a83fe33f 100644
--- a/Event/xAOD/xAODTrackingCnv/xAODTrackingCnv/IRecTrackParticleContainerCnvTool.h
+++ b/Event/xAOD/xAODTrackingCnv/xAODTrackingCnv/IRecTrackParticleContainerCnvTool.h
@@ -14,6 +14,7 @@
 // EDM include(s):
 #include "xAODTracking/TrackParticleContainer.h"
 //#include "TrkTrack/TrackCollection.h"
+#include "TrkValInterfaces/ITrkObserverTool.h"
 
 // Forward declaration(s):
 namespace Rec {
@@ -39,6 +40,10 @@ namespace xAODMaker {
     virtual StatusCode convert( const Rec::TrackParticleContainer* aod,
 				xAOD::TrackParticleContainer* xaod ) const = 0;
 
+    /// Function that fills an existing xAOD::TrackParticleContainer and augments track particles
+    virtual StatusCode convertAndAugment( const Rec::TrackParticleContainer* aod,
+				xAOD::TrackParticleContainer* xaod, const ObservedTracksMap* trk_map ) const = 0;
+
     virtual StatusCode setParticleCreatorTool(ToolHandle<Trk::ITrackParticleCreatorTool> *tool) = 0;
     
     /// Gaudi interface definition
diff --git a/Event/xAOD/xAODTrackingCnv/xAODTrackingCnv/ITrackCollectionCnvTool.h b/Event/xAOD/xAODTrackingCnv/xAODTrackingCnv/ITrackCollectionCnvTool.h
index 1080366eccba..1c1e49eaefbd 100644
--- a/Event/xAOD/xAODTrackingCnv/xAODTrackingCnv/ITrackCollectionCnvTool.h
+++ b/Event/xAOD/xAODTrackingCnv/xAODTrackingCnv/ITrackCollectionCnvTool.h
@@ -16,6 +16,7 @@
 #include "TrkTrack/TrackCollection.h"
 // Forward declaration(s):
 //class TrackCollection; - no - typedef
+#include "TrkValInterfaces/ITrkObserverTool.h"
 
 namespace Trk {
   class ITrackParticleCreatorTool;
@@ -35,6 +36,10 @@ namespace xAODMaker {
     virtual StatusCode convert( const TrackCollection* aod,
 				xAOD::TrackParticleContainer* xaod ) const = 0;
 
+    /// Function that fills an existing xAOD::TrackParticleContainer and augments track particles
+    virtual StatusCode convertAndAugment( const TrackCollection* aod,
+				xAOD::TrackParticleContainer* xaod, const ObservedTracksMap* trk_map ) const = 0;
+
     virtual StatusCode setParticleCreatorTool(ToolHandle<Trk::ITrackParticleCreatorTool> *tool) = 0;
     
     /// Gaudi interface definition
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
index 0393f3b56c4f..705809ec2551 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
@@ -1186,6 +1186,11 @@ class doTTVADecos(InDetFlagsJobProperty):
   allowedTypes = ['bool']
   StoredValue  = True
 
+class doTIDE_AmbiTrackMonitoring(InDetFlagsJobProperty):
+    """run track monitoring for dense environments"""
+    statusOn     = True
+    allowedTypes = ['bool']
+    StoredValue  = False
 ## Decide whether to wrap the new configuration in the old.
 class useNewConfig(JobProperty):
     statusOn=True
@@ -2740,6 +2745,7 @@ _list_InDetJobProperties = [Enabled,
                             writeSeedValNtuple,
                             doTRTPIDNN,
                             doTTVADecos,
+                            doTIDE_AmbiTrackMonitoring,
                             useNewConfig
                            ]
 for j in _list_InDetJobProperties: 
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py
index dd0178ec3cb3..010f426d1d3d 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py
@@ -604,6 +604,24 @@ class PseudoTracksTruth(JobProperty):
     allowedTypes = ['str']
     StoredValue  = 'InDetPseudoTrackTruthCollection'
 
+class ObservedTracks(JobProperty):
+    """StoreGate key for tracks observed by track observer tool"""
+    statusOn     = True
+    allowedTypes = ['str']
+    StoredValue  = 'ObservedTracksCollection'
+
+class ObservedDetailedTracksTruth(JobProperty):
+    """StoreGate key for DetailedTracksTruth  (ObservedTracks)"""
+    statusOn     = True
+    allowedTypes = ['str']
+    StoredValue  = 'InDetObservedTrackDetailedTruth'
+
+class ObservedTracksTruth(JobProperty):
+    """StoreGate key for TracksTruth  (ObservedTracks)"""
+    statusOn     = True
+    allowedTypes = ['str']
+    StoredValue  = 'InDetObservedTrackTruthCollection'
+
 class SiSpSeededTracks(JobProperty):
     """ Storegate key for new-tracking SP seeded tracks"""
     statusOn     = True
@@ -944,6 +962,12 @@ class xAODPseudoTrackParticleContainer(JobProperty):
     allowedTypes = ['str']
     StoredValue = "InDetPseudoTrackParticles"
 
+class xAODObservedTrackParticleContainer(JobProperty):
+    """xAOD Observed TrackParticle"""
+    statusOn = True
+    allowedTypes = ['str']
+    StoredValue = "InDetObservedTrackParticles"
+
 class xAODPixelTrackParticleContainer(JobProperty):
     """xAOD PixelTrackParticle"""
     statusOn = True
@@ -1072,6 +1096,9 @@ jobproperties.InDetContainerKeys.add_JobProperty(RefittedTracksTruth)
 jobproperties.InDetContainerKeys.add_JobProperty(PseudoTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(PseudoDetailedTracksTruth)
 jobproperties.InDetContainerKeys.add_JobProperty(PseudoTracksTruth)
+jobproperties.InDetContainerKeys.add_JobProperty(ObservedTracks)
+jobproperties.InDetContainerKeys.add_JobProperty(ObservedDetailedTracksTruth)
+jobproperties.InDetContainerKeys.add_JobProperty(ObservedTracksTruth)
 jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededPixelTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededDisappearingTracks)
 jobproperties.InDetContainerKeys.add_JobProperty(SiSpSeededSCTTracks)
@@ -1143,6 +1170,7 @@ jobproperties.InDetContainerKeys.add_JobProperty(xAODForwardTrackParticleContain
 jobproperties.InDetContainerKeys.add_JobProperty(xAODLargeD0TrackParticleContainer)
 jobproperties.InDetContainerKeys.add_JobProperty(xAODLowBetaTrackParticleContainer)
 jobproperties.InDetContainerKeys.add_JobProperty(xAODPseudoTrackParticleContainer)
+jobproperties.InDetContainerKeys.add_JobProperty(xAODObservedTrackParticleContainer)
 jobproperties.InDetContainerKeys.add_JobProperty(xAODPixelTrackParticleContainer)
 jobproperties.InDetContainerKeys.add_JobProperty(xAODSCTTrackParticleContainer)
 jobproperties.InDetContainerKeys.add_JobProperty(xAODTRTTrackParticleContainer)
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
index bedfef9a2743..3f7dd159a461 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py
@@ -1676,3 +1676,51 @@ def getV0Tools(name='V0Tools', **kwargs) :
         kwargs=setDefaults(kwargs,Extrapolator = AtlasExtrapolator())
     from TrkVertexAnalysisUtils.TrkVertexAnalysisUtilsConf import Trk__V0Tools
     return Trk__V0Tools(the_name, **kwargs)
+
+def getInDetxAODParticleCreatorTool(prd_to_track_map=None, suffix="") :
+    from AthenaCommon.AppMgr import ToolSvc
+    from InDetRecExample.InDetJobProperties import InDetFlags
+    if hasattr(ToolSvc,'InDetxAODParticleCreatorTool'+suffix) :
+        return getattr(ToolSvc,'InDetxAODParticleCreatorTool'+suffix)
+
+    perigee_expression=InDetFlags.perigeeExpression()
+    # need to treat Vertex specifically because at the time of
+    # the track particle creation the primary vertex does not yet exist.
+    # The problem is solved by first creating track particles wrt. the beam line
+    # and correcting the parameters after the vertex finding.
+    if perigee_expression == 'Vertex' :
+        perigee_expression = 'BeamLine'
+
+    if prd_to_track_map is None :
+        track_summary_tool = getInDetTrackSummaryToolSharedHits()
+    else :
+        prop_args          = setDefaults({}, nameSuffix = suffix)
+        asso_tool          = getConstPRD_AssociationTool(**setDefaults(prop_args,
+                                                                                      PRDtoTrackMap = prd_to_track_map))
+        helper_tool        = getInDetSummaryHelperSharedHits(**setDefaults(prop_args,
+                                                                                          AssoTool = asso_tool) )
+        track_summary_tool = getInDetTrackSummaryToolSharedHits(**setDefaults(prop_args,
+                                                                                             InDetSummaryHelperTool=helper_tool))
+
+    from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
+    InDetxAODParticleCreatorTool = Trk__TrackParticleCreatorTool(name = "InDetxAODParticleCreatorTool"+suffix,
+                                                                 TrackToVertex           = getInDetTrackToVertexTool(),
+                                                                 TrackSummaryTool        = track_summary_tool,
+                                                                 BadClusterID            = InDetFlags.pixelClusterBadClusterID(),
+                                                                 KeepParameters          = True,
+                                                                 KeepFirstParameters     = InDetFlags.KeepFirstParameters(),
+                                                                 PerigeeExpression       = perigee_expression)
+
+    ToolSvc += InDetxAODParticleCreatorTool
+    return InDetxAODParticleCreatorTool
+
+@makePublicTool
+def getTrackObserverTool(name='TrackObserverTool', write_tracks = False, **kwargs) :
+    the_name = makeName( name, kwargs)
+    from InDetRecExample.InDetKeys import InDetKeys
+    from TrkValTools.TrkValToolsConf import Trk__TrkObserverTool
+    TrackObserverTool = Trk__TrkObserverTool(the_name, **kwargs)
+    if write_tracks:
+        TrackObserverTool.ObsTrackCollection = InDetKeys.ObservedTracks()
+        TrackObserverTool.ObsTrackCollectionMap = InDetKeys.ObservedTracks()+"Map"
+    return TrackObserverTool
\ No newline at end of file
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
index 98d1dac28a45..5025bb19b403 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
@@ -472,7 +472,14 @@ class  ConfiguredNewTrackingSiPattern:
            InDetAmbiTrackSelectionTool.minScoreShareTracks   = 0.0
            InDetAmbiTrackSelectionTool.minTRTHits            = 0
            InDetAmbiTrackSelectionTool.sharedProbCut         = 0.1
-        
+
+         if InDetFlags.doTIDE_AmbiTrackMonitoring() and InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardSLHCTracks" or
+                                                                                          NewTrackingCuts.mode() == "ForwardTracks" or
+                                                                                          NewTrackingCuts.mode() == "PixelPrdAssociation" or
+                                                                                          NewTrackingCuts.mode() == "DBM" or
+                                                                                          NewTrackingCuts.mode() == "PixelFourLayer" or
+                                                                                          NewTrackingCuts.mode() == "PixelThreeLayer"):
+           InDetAmbiTrackSelectionTool.ObserverTool = TrackingCommon.getTrackObserverTool()
          # if NewTrackingCuts.mode() == "ForwardTracks":
          #    InDetAmbiTrackSelectionTool.OutputLevel = VERBOSE
 
@@ -600,7 +607,16 @@ class  ConfiguredNewTrackingSiPattern:
 
          # if NewTrackingCuts.mode() == "ForwardTracks":
          #    InDetAmbiguityProcessor.OutputLevel = VERBOSE
-         
+         if InDetFlags.doTIDE_AmbiTrackMonitoring() and InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardSLHCTracks" or
+                                                                                          NewTrackingCuts.mode() == "ForwardTracks" or
+                                                                                          NewTrackingCuts.mode() == "PixelPrdAssociation" or
+                                                                                          NewTrackingCuts.mode() == "DBM" or
+                                                                                          NewTrackingCuts.mode() == "PixelFourLayer" or
+                                                                                          NewTrackingCuts.mode() == "PixelThreeLayer"):
+            InDetAmbiguityProcessor.ObserverTool = TrackingCommon.getTrackObserverTool()
+            InDetAmbiguityProcessor.ObserverToolWriter = TrackingCommon.getTrackObserverTool(name = 'TrackObserverToolWriter', write_tracks = True)
+            InDetAmbiguityScoreProcessor.ObserverTool = TrackingCommon.getTrackObserverTool()
+
          ToolSvc += InDetAmbiguityProcessor
          if (InDetFlags.doPrintConfigurables()):
             printfunc (InDetAmbiguityProcessor)
@@ -666,7 +682,22 @@ class  ConfiguredNewTrackingSiPattern:
                TrackCollectionTruthKeys += [ InDetTracksTruth.TracksTruth() ]
             else:
                TrackCollectionKeys      += [ self.__SiTrackCollection ]
-      
+
+         if InDetFlags.doTIDE_AmbiTrackMonitoring() and InDetFlags.doTIDE_Ambi() and not (NewTrackingCuts.mode() == "ForwardSLHCTracks" or
+                                                                                          NewTrackingCuts.mode() == "ForwardTracks" or
+                                                                                          NewTrackingCuts.mode() == "PixelPrdAssociation" or
+                                                                                          NewTrackingCuts.mode() == "DBM" or
+                                                                                          NewTrackingCuts.mode() == "PixelFourLayer" or
+                                                                                          NewTrackingCuts.mode() == "PixelThreeLayer"):
+           # add truth and trackParticles
+           include ("InDetRecExample/ConfiguredInDetTrackTruth.py")
+           InDetTracksTruth = ConfiguredInDetTrackTruth(InDetKeys.ObservedTracks(),
+                                                           InDetKeys.ObservedDetailedTracksTruth(),
+                                                           InDetKeys.ObservedTracksTruth())
+           include ("InDetRecExample/ConfiguredxAODTrackParticleCreation.py")
+           InDetxAOD = ConfiguredxAODTrackParticleCreation(InDetKeys.ObservedTracks(),
+                                                           InDetKeys.ObservedTracksTruth(),
+                                                           InDetKeys.xAODObservedTrackParticleContainer())
    def SiTrackCollection ( self ):
       try:
          return self.__SiTrackCollection
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredxAODTrackParticleCreation.py b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredxAODTrackParticleCreation.py
index 6e6e69745a71..9e7095e128a2 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredxAODTrackParticleCreation.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredxAODTrackParticleCreation.py
@@ -72,6 +72,10 @@ class ConfiguredxAODTrackParticleCreation:
          else:
             xAODTrackParticleCnvAlg.AddTruthLink = False
 
+         if InDetFlags.doTIDE_AmbiTrackMonitoring():
+             xAODTrackParticleCnvAlg.AugmentObservedTracks = True
+             xAODTrackParticleCnvAlg.TracksMapName = InDetKeys.ObservedTracks()+"Map"
+
          topSequence += xAODTrackParticleCnvAlg
          if (InDetFlags.doPrintConfigurables()):
             printfunc (xAODTrackParticleCnvAlg)
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
index 0f353bc5aa48..51b9811ede78 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
@@ -1,6 +1,6 @@
 from InDetRecExample.InDetJobProperties import InDetFlags
 from InDetRecExample.InDetKeys import InDetKeys
-from InDetRecExample.TrackingCommon import makePublicTool, makeName
+from InDetRecExample.TrackingCommon import getInDetxAODParticleCreatorTool, makePublicTool, makeName
 
 def getCollectionNameIfInFile(coll_type,coll_name) :
     from RecExConfig.AutoConfiguration import IsInInputFile
@@ -50,46 +50,6 @@ if InDetFlags.doSplitReco()  and is_mc:
     xAODTruthCnvPU.MetaObjectName = "TruthMetaData_PU" #output
     topSequence += xAODTruthCnvPU
 
-def getInDetxAODParticleCreatorTool(prd_to_track_map=None, suffix="") :
-    from AthenaCommon.AppMgr import ToolSvc
-    if hasattr(ToolSvc,'InDetxAODParticleCreatorTool'+suffix) :
-        return getattr(ToolSvc,'InDetxAODParticleCreatorTool')
-
-    _perigee_expression=InDetFlags.perigeeExpression()
-    # need to treat Vertex specifically because at the time of
-    # the track particle creation the primary vertex does not yet exist.
-    # The problem is solved by first creating track particles wrt. the beam line
-    # and correcting the parameters after the vertex finding.
-    if _perigee_expression == 'Vertex' :
-        _perigee_expression = 'BeamLine'
-
-    from InDetRecExample                import TrackingCommon
-    from InDetRecExample.TrackingCommon import setDefaults
-    if prd_to_track_map is None :
-        track_summary_tool = TrackingCommon.getInDetTrackSummaryToolSharedHits()
-    else :
-        prop_args          = setDefaults({}, nameSuffix = suffix)
-        asso_tool          = TrackingCommon.getConstPRD_AssociationTool(**setDefaults(prop_args,
-                                                                                      PRDtoTrackMap = prd_to_track_map))
-        helper_tool        = TrackingCommon.getInDetSummaryHelperSharedHits(**setDefaults(prop_args,
-                                                                                          AssoTool = asso_tool) )
-        track_summary_tool = TrackingCommon.getInDetTrackSummaryToolSharedHits(**setDefaults(prop_args,
-                                                                                             InDetSummaryHelperTool=helper_tool))
-
-    from TrkParticleCreator.TrkParticleCreatorConf import Trk__TrackParticleCreatorTool
-    InDetxAODParticleCreatorTool = Trk__TrackParticleCreatorTool(name = "InDetxAODParticleCreatorTool"+suffix,
-                                                                 TrackToVertex           = TrackingCommon.getInDetTrackToVertexTool(),
-                                                                 TrackSummaryTool        = track_summary_tool,
-                                                                 BadClusterID            = InDetFlags.pixelClusterBadClusterID(),
-                                                                 KeepParameters          = True,
-                                                                 KeepFirstParameters     = InDetFlags.KeepFirstParameters(),
-                                                                 PerigeeExpression       = _perigee_expression)
-
-    ToolSvc += InDetxAODParticleCreatorTool
-    if InDetFlags.doPrintConfigurables():
-        printfunc (InDetxAODParticleCreatorTool)
-    return InDetxAODParticleCreatorTool
-
 def getTrackCollectionCnvTool(prd_to_track_map=None, suffix="") :
     from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackCollectionCnvTool
     return xAODMaker__TrackCollectionCnvTool("TrackCollectionCnvTool"+suffix,
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
index 1b2b2cf3da5d..9ae6f6ce3055 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
@@ -73,6 +73,18 @@ if InDetFlags.doxAOD():
     if InDetFlags.doTruth(): 
       InDetAODList += ["TrackTruthCollection#"+InDetKeys.DBMTracks()+'TruthCollection'] 
       InDetAODList += ["DetailedTrackTruthCollection#"+InDetKeys.DBMTracks()+'DetailedTruth'] 
+  if InDetFlags.doPseudoTracking():
+    InDetAODList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODPseudoTrackParticleContainer()]
+    InDetAODList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODPseudoTrackParticleContainer()+'Aux.' + excludedAuxData]
+    if InDetFlags.doTruth():
+        InDetAODList += ["TrackTruthCollection#"+InDetKeys.PseudoTracksTruth()]
+        InDetAODList += ["DetailedTrackTruthCollection#"+InDetKeys.PseudoDetailedTracksTruth()]
+  if InDetFlags.doTIDE_Ambi():
+    InDetAODList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODObservedTrackParticleContainer()]
+    InDetAODList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODObservedTrackParticleContainer()+'Aux.' + excludedAuxData]
+    if InDetFlags.doTruth():
+      InDetAODList += ["TrackTruthCollection#"+InDetKeys.ObservedTracksTruth()]
+      InDetAODList += ["DetailedTrackTruthCollection#"+InDetKeys.ObservedDetailedTracksTruth()]
 
 # next is only for InDetRecExample stand alone! RecExCommon uses InDetAODList directly
 StreamAOD.ItemList += InDetAODList 
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
index 8bea0665f005..3822ea42f43d 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
@@ -79,7 +79,12 @@ if InDetFlags.doPseudoTracking():
    if InDetFlags.doTruth():
       InDetESDList += ["TrackTruthCollection#"+InDetKeys.PseudoTracks()+'TruthCollection']
       InDetESDList += ["DetailedTrackTruthCollection#"+InDetKeys.PseudoTracks()+'DetailedTruth']
-
+if InDetFlags.doTIDE_AmbiTrackMonitoring():
+   if InDetFlags.doWriteTracksToESD() or not InDetFlags.doxAOD():
+      InDetESDList+=["TrackCollection#"+InDetKeys.ObservedTracks()]
+   if InDetFlags.doTruth():
+      InDetESDList += ["TrackTruthCollection#"+InDetKeys.ObservedTracksTruth()]
+      InDetESDList += ["DetailedTrackTruthCollection#"+InDetKeys.ObservedDetailedTracksTruth()]
 if InDetFlags.doDBMstandalone() or InDetFlags.doDBM(): 
    if InDetFlags.doWriteTracksToESD() or InDetFlags.doDBMstandalone() or not InDetFlags.doxAOD() :
       InDetESDList+=["TrackCollection#"+InDetKeys.DBMTracks()] 
@@ -195,6 +200,9 @@ if InDetFlags.doxAOD():
   if InDetFlags.doPseudoTracking():
     InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODPseudoTrackParticleContainer()]
     InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODPseudoTrackParticleContainer()+'Aux.' + excludedAuxData]
+  if InDetFlags.doTIDE_AmbiTrackMonitoring():
+    InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODObservedTrackParticleContainer()]
+    InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODObservedTrackParticleContainer()+'Aux.' + excludedAuxData]
 # next is only for InDetRecExample stand alone! RecExCommon uses InDetESDList directly
 # added to InDetRec_all.py after include WriteInDetESD!
 #StreamESD.ItemList += InDetESDList
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/CMakeLists.txt
index 221d2fad0d98..f5f4fb243081 100644
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/CMakeLists.txt
@@ -14,4 +14,4 @@ atlas_add_component( InDetAmbiTrackSelectionTool
    TrkTrack TrkToolInterfaces AthContainers CxxUtils StoreGateLib
    InDetIdentifier InDetPrepRawData InDetRecToolInterfaces TrkDetElementBase TrkEventUtils
    TrkSurfaces TrkCaloClusterROI TrkMeasurementBase TrkPrepRawData
-   TrkPseudoMeasurementOnTrack TrkTrackSummary TrkParameters PixelGeoModelLib TrkFitterInterfaces)
+   TrkPseudoMeasurementOnTrack TrkTrackSummary TrkParameters PixelGeoModelLib TrkFitterInterfaces TrkValInterfaces)
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
index fbfed48bbd10..23f39a3d70e3 100755
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
@@ -60,7 +60,8 @@ namespace InDet
     virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack(const Trk::Track *track,
                                                             const Trk::TrackScore score,
                                                             Trk::ClusterSplitProbabilityContainer &splitProbContainer,
-                                                            Trk::PRDtoTrackMap &prd_to_track_map) const override;
+                                                            Trk::PRDtoTrackMap &prd_to_track_map,
+                                                            int trackId = -1, int subtrackId = -1) const override;
 
   private:
       
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
index a58099b05d2a..7cb6e19518c0 100644
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
@@ -25,6 +25,7 @@
 #include "TrkRIO_OnTrack/RIO_OnTrack.h"
 #include "TrkTrack/Track.h" //for use in the struct lessTrkTrack implementation in this header
 #include "TrkTrack/TrackStateOnSurface.h"
+#include "TrkValInterfaces/ITrkObserverTool.h"
 
 #include "TrkToolInterfaces/IPRDtoTrackMapTool.h"
 #include "TrkEventUtils/PRDtoTrackMap.h"
@@ -80,7 +81,9 @@ namespace InDet
     virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack(const Trk::Track *track,
                                                             const Trk::TrackScore score,
                                                             Trk::ClusterSplitProbabilityContainer &splitProbContainer,
-                                                            Trk::PRDtoTrackMap &prd_to_track_map) const override;
+                                                            Trk::PRDtoTrackMap &prd_to_track_map,
+                                                            int trackId,
+                                                            int subtrackId) const override;
 
   private:
     
@@ -337,7 +340,8 @@ namespace InDet
                                Trk::PRDtoTrackMap &prd_to_track_map,
                                TrackHitDetails& trackHitDetails,
                                TSoS_Details& tsosDetails,
-                               CacheEntry* ent) const;
+                               CacheEntry* ent,
+                               int trackId) const;
 
     /** Specific logic for identifing conversions with the goal 
      * of passing those tracks through to the final collection 
@@ -436,6 +440,9 @@ namespace InDet
     ToolHandle<Trk::IPRDtoTrackMapTool>         m_assoTool
          {this, "AssociationTool", "InDet::InDetPRDtoTrackMapToolGangedPixels" };
 
+    /**Observer tool      This tool is used to observe the tracks and their 'score' */
+    PublicToolHandle<Trk::ITrkObserverTool> m_observerTool{this, "TrackObserverTool", "", "track observer within ambiguity solver"};
+
     /** some cut values */
     IntegerProperty m_minHits{this, "minHits", 5, "Min Number of hits on track"};
     IntegerProperty m_minTRT_Hits{this, "minTRTHits", 0, "Min Number of TRT hits on track"};
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetAmbiTrackSelectionTool.cxx b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetAmbiTrackSelectionTool.cxx
index 3b3cf2797eac..d2ad786a2522 100755
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetAmbiTrackSelectionTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetAmbiTrackSelectionTool.cxx
@@ -70,7 +70,9 @@ StatusCode InDet::InDetAmbiTrackSelectionTool::finalize()
 std::tuple<Trk::Track*,bool> InDet::InDetAmbiTrackSelectionTool::getCleanedOutTrack(const Trk::Track *ptrTrack,
                                                                                     const Trk::TrackScore score,
                                                                                     Trk::ClusterSplitProbabilityContainer &splitProbContainer,
-                                                                                    Trk::PRDtoTrackMap &prd_to_track_map) const
+                                                                                    Trk::PRDtoTrackMap &prd_to_track_map,
+                                                                                    int trackId /* = -1*/,
+                                                                                    int subtrackId /* = -1*/) const
 {
   // flag if the track is ok (true) or needs cleaning (false)
   bool TrkCouldBeAccepted        = true;
@@ -104,6 +106,7 @@ std::tuple<Trk::Track*,bool> InDet::InDetAmbiTrackSelectionTool::getCleanedOutTr
   // get all TSOS the track
   const DataVector<const Trk::TrackStateOnSurface>* tsos = ptrTrack->trackStateOnSurfaces();
   ATH_MSG_DEBUG ("Study new Track "<< ptrTrack<<"\t , it has "<<tsos->size()<<"\t track states");
+  ATH_MSG_DEBUG ("trackId "<< trackId <<", subtrackId "<<subtrackId);  
 
   // is this a track from the pattern or a fitted track ?
   bool ispatterntrack = (ptrTrack->info().trackFitter()==Trk::TrackInfo::Unknown);
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetDenseEnvAmbiTrackSelectionTool.cxx b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetDenseEnvAmbiTrackSelectionTool.cxx
index e35f6777b72f..bacc070307eb 100644
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetDenseEnvAmbiTrackSelectionTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetDenseEnvAmbiTrackSelectionTool.cxx
@@ -38,6 +38,7 @@ InDet::InDetDenseEnvAmbiTrackSelectionTool::InDetDenseEnvAmbiTrackSelectionTool(
 :
 base_class(t,n,p)
 {
+  declareProperty("ObserverTool", m_observerTool, "track observer tool");
 }
 
 //================ Initialisation =================================================
@@ -67,6 +68,8 @@ StatusCode InDet::InDetDenseEnvAmbiTrackSelectionTool::initialize()
 
   ATH_CHECK(m_assoTool.retrieve());
 
+  ATH_CHECK(m_observerTool.retrieve(DisableTool{m_observerTool.empty()}));
+
   ATH_CHECK(m_inputHadClusterContainerName.initialize(m_useHClusSeed));
   ATH_CHECK(m_inputEmClusterContainerName.initialize(m_useEmClusSeed));
 
@@ -118,7 +121,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::newEvent(CacheEntry* ent) const
 std::tuple<Trk::Track*,bool> InDet::InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack(const Trk::Track *ptrTrack,
                                                                                             const Trk::TrackScore score,
                                                                                             Trk::ClusterSplitProbabilityContainer &splitProbContainer,
-                                                                                            Trk::PRDtoTrackMap &prd_to_track_map) const
+                                                                                            Trk::PRDtoTrackMap &prd_to_track_map,
+                                                                                            int trackId,
+                                                                                            int subtrackId) const
 {
 
   // Test to see if we have a new event
@@ -171,7 +176,7 @@ std::tuple<Trk::Track*,bool> InDet::InDetDenseEnvAmbiTrackSelectionTool::getClea
   //Decide which hits to keep
   //This is a major function which checks the usage of each hit on the candidate track
   ATH_MSG_DEBUG ("decideWhichHitsToKeep");
-  decideWhichHitsToKeep( ptrTrack,  score,  splitProbContainer, prd_to_track_map, trackHitDetails, tsosDetails, ent );
+  decideWhichHitsToKeep( ptrTrack,  score,  splitProbContainer, prd_to_track_map, trackHitDetails, tsosDetails, ent, trackId );
   
   ATH_MSG_DEBUG ("decideWhichHitsToKeep" << trackHitDetails.m_trkCouldBeAccepted );
   
@@ -200,9 +205,24 @@ std::tuple<Trk::Track*,bool> InDet::InDetDenseEnvAmbiTrackSelectionTool::getClea
   //
   //------------------------------------------------------------------------------------//
   bool passBasicCuts(true);
-  if( trackHitDetails.totalSiHits() < m_minHits )                 { passBasicCuts = false; }
-  if( trackHitDetails.m_numTRT_Unused < nCutTRT )                   { passBasicCuts = false; }
-  if( trackHitDetails.totalUniqueSiHits() < ent->m_minNotShared ) { passBasicCuts = false; }
+  if( trackHitDetails.totalSiHits() < m_minHits ) {
+    passBasicCuts = false;
+    if (m_observerTool.isEnabled()) {
+      m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::getCleanedOutTrack, xAOD::RejectionReason::notEnoughSiHits);
+    }
+  }
+  if( trackHitDetails.m_numTRT_Unused < nCutTRT ) {
+    passBasicCuts = false;
+    if (m_observerTool.isEnabled()) {
+      m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::getCleanedOutTrack, xAOD::RejectionReason::notEnoughTRTHits);
+    }
+  }
+  if( trackHitDetails.totalUniqueSiHits() < ent->m_minNotShared ) {
+    passBasicCuts = false;
+    if (m_observerTool.isEnabled()) {
+      m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::getCleanedOutTrack, xAOD::RejectionReason::notEnoughUniqueSiHits);
+    }
+  }
   if( !passBasicCuts ) {
     ATH_MSG_DEBUG ("reject track; failed basic cuts");
     return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track
@@ -259,6 +279,9 @@ std::tuple<Trk::Track*,bool> InDet::InDetDenseEnvAmbiTrackSelectionTool::getClea
       setPixelClusterSplitInformation( tsosDetails, splitProbContainer );
     }
 
+    if (m_observerTool.isEnabled()){
+      m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::getCleanedOutTrack, xAOD::RejectionReason::acceptedTrack);
+    }
     return std::make_tuple(static_cast<Trk::Track *>(nullptr),true); // keep input track
 
   }
@@ -269,6 +292,9 @@ std::tuple<Trk::Track*,bool> InDet::InDetDenseEnvAmbiTrackSelectionTool::getClea
     // catch, if this is cosmics, accept the incoming track
     if (m_cosmics) {
       ATH_MSG_DEBUG ("=> Cosmics, accept input track even with shared hits");
+      if (m_observerTool.isEnabled()){
+        m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::getCleanedOutTrack, xAOD::RejectionReason::acceptedTrack);
+      }
       return std::make_tuple(static_cast<Trk::Track *>(nullptr),true); // keep input track
     }
 
@@ -315,6 +341,9 @@ std::tuple<Trk::Track*,bool> InDet::InDetDenseEnvAmbiTrackSelectionTool::getClea
     if ( newTSOS.size() <= 3 ) {
       ATH_MSG_VERBOSE ("newTSOS.size(): "<<newTSOS.size() );
       ATH_MSG_DEBUG ("reject track; Too few hits, reject track with shared hits");
+      if (m_observerTool.isEnabled()){
+        m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::getCleanedOutTrack, xAOD::RejectionReason::tooFewHits);
+      }
       return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track
     }
 
@@ -327,6 +356,9 @@ std::tuple<Trk::Track*,bool> InDet::InDetDenseEnvAmbiTrackSelectionTool::getClea
         setPixelClusterSplitInformation( tsosDetails, splitProbContainer ); 
       }
       ATH_MSG_DEBUG ("reject track; maybe track was mark as rejected, but we recoverd it so no rejection");
+      if (m_observerTool.isEnabled()){
+        m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::getCleanedOutTrack, xAOD::RejectionReason::acceptedTrack);
+      }
       return std::make_tuple(static_cast<Trk::Track *>(nullptr),true); // keep input track
     } else {
       // ok, done, create subtrack
@@ -334,6 +366,9 @@ std::tuple<Trk::Track*,bool> InDet::InDetDenseEnvAmbiTrackSelectionTool::getClea
       if (!newTrack) {
         ATH_MSG_DEBUG ("=> Failed to create subtrack");
         ATH_MSG_DEBUG ("reject track; Failed to create subtrack");
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::getCleanedOutTrack, xAOD::RejectionReason::failedSubtrackCreation);
+        }
         return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track
       }
 
@@ -345,6 +380,10 @@ std::tuple<Trk::Track*,bool> InDet::InDetDenseEnvAmbiTrackSelectionTool::getClea
       newTrack->info().addPatternReco(ptrTrack->info()); 
 
       ATH_MSG_DEBUG ("=> Successfully created subtrack with shared hits recovered !");
+      if (m_observerTool.isEnabled()) {
+        m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::getCleanedOutTrack, xAOD::RejectionReason::subtrackCreatedWithRecoveredShared);
+        m_observerTool->addSubTrack(subtrackId, trackId, *newTrack);
+      }
       return std::make_tuple(newTrack,false); // create new, cleaned track and reject input track
     }
   }
@@ -352,6 +391,9 @@ std::tuple<Trk::Track*,bool> InDet::InDetDenseEnvAmbiTrackSelectionTool::getClea
   // if made it this far, junk the track
   ATH_MSG_DEBUG ("=> Track is recommended to be dropped");
   ATH_MSG_DEBUG ("reject track; other");
+  if (m_observerTool.isEnabled()){
+    m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::getCleanedOutTrack, xAOD::RejectionReason::other);
+  }
   return std::make_tuple(static_cast<Trk::Track *>(nullptr),false); // reject input track
 
 }
@@ -680,10 +722,11 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
     Trk::PRDtoTrackMap &prd_to_track_map,
     TrackHitDetails& trackHitDetails,
     TSoS_Details& tsosDetails,
-    CacheEntry* ent) const 
+    CacheEntry* ent,
+    int trackId) const 
 {
 
-  // Can the track can automatically be accpeted without further checks
+  // Can the track automatically be accepted without further checks
   trackHitDetails.m_trkCouldBeAccepted = true;
 
   // Does this track fall into an hadronic ROI?
@@ -728,6 +771,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
     // also shared TRT hits are rejected there
     if (tsosDetails.m_type[index] == RejectedHit) {  // only generic rejects at that point
       trackHitDetails.m_trkCouldBeAccepted = false; // we have to remove at least one PRD
+      if (m_observerTool.isEnabled()){
+        m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::TSOSRejectedHit);
+      }
       continue;
     }
 
@@ -762,6 +808,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
       if( tsosDetails.m_hitIsShared[index]>0 ) { // hit is used on another track
         ATH_MSG_VERBOSE( Form("---> Prd is outlier and shared, reject it. %d", index) );
         rejectHit(trackHitDetails, tsosDetails, index);
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::TSOSOutlierShared);
+        }
         continue;
       }
 
@@ -876,6 +925,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
         } else {
           ATH_MSG_VERBOSE ("---> Pixel split but shared between too many tracks -- will be removed from the track!!!");
           rejectHitOverUse(trackHitDetails, tsosDetails, index);
+          if (m_observerTool.isEnabled()){
+            m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::pixelSplitButTooManyShared2Ptc);
+          }
           continue;
         }
 
@@ -899,6 +951,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
         } else {
           ATH_MSG_VERBOSE ("---> Pixel split but shared between too many tracks -- will be removed from the track!!!");
           rejectHitOverUse(trackHitDetails, tsosDetails, index);
+          if (m_observerTool.isEnabled()){
+            m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::pixelSplitButTooManyShared3Ptc);
+          }
           continue;
         }
 
@@ -914,6 +969,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
       } else {
         ATH_MSG_DEBUG ("reject track; Too many hits shared - we have to remove at least one PRD");    
         rejectHitOverUse(trackHitDetails, tsosDetails, index);
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::tooManySharedRecoverable);
+        }
         continue; 
       }
     }// End Attempt to recover shared hits
@@ -924,7 +982,7 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
     }
 
     //For all other shared hits 
-    if ( tsosDetails.m_hitIsShared[index] < m_maxTracksPerPRD ){  // we do not allow to share with to many tracks
+    if ( tsosDetails.m_hitIsShared[index] < m_maxTracksPerPRD ){  // we do not allow to share with too many tracks
       ATH_MSG_VERBOSE ("---> Shared hit, but good track, let's enter hit in the list and try to keep it !");
       ATH_MSG_VERBOSE ("----- Index: "<< index << " Type: " << tsosDetails.m_detType[index]  << " splitprob1  " << tsosDetails.m_splitProb1[index]);
       addSharedHit(trackHitDetails, tsosDetails, index);
@@ -932,6 +990,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
     } else {
       ATH_MSG_DEBUG ("reject track; Too many hits shared - we have to remove at least one PRD");
       rejectHitOverUse(trackHitDetails, tsosDetails, index);
+      if (m_observerTool.isEnabled()){
+        m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::tooManySharedNonRecoverable);
+      }
       continue;     
     }
     ATH_MSG_ERROR("Reached end of TSOS loop without a decision." );
@@ -984,6 +1045,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
     for (unsigned int index( 0 );  index > tsosDetails.m_nTSoS; ++index ){    
       if ( tsosDetails.m_detType[index]==2 && tsosDetails.m_type[index] == SharedHit){
         rejectSharedHit(trackHitDetails, tsosDetails, index);
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::sharedSCT);
+        }
       }      
     }
   }
@@ -1003,6 +1067,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
       for (unsigned int index( 0 );  index > tsosDetails.m_nTSoS; ++index ){    
         if ( tsosDetails.m_type[index] != SharedHit ) { continue; }
         rejectSharedHit(trackHitDetails, tsosDetails, index);
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::sharedHitsBadChi2);
+        }
       }
     } // fails cut
   } // is not a pattern track and has shared hits
@@ -1044,6 +1111,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
       if (!otherPassMinUniqueHits) {
         ATH_MSG_DEBUG ("reject track; Tracks shared hits does not leave enough unique hits on accepted track");
         rejectSharedHitInvalid(trackHitDetails, tsosDetails, index);
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::sharedHitsNotEnoughUniqueHits);
+        }
         continue;
       }
 
@@ -1058,12 +1128,18 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
         if( (tsosDetails.m_detType[index] % 10 == 1) && firstMeasurement ) {
           ATH_MSG_DEBUG ("reject track; Tracks shared hits pushes accepted track above shared module limit");
           rejectSharedHitInvalid(trackHitDetails, tsosDetails, index);
+          if (m_observerTool.isEnabled()){
+            m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::firstHitSharedAndPixIBL);
+          }
           continue;
         }
         // if first pixel was shared (and this is not that hit)
         if( trackHitDetails.m_firstPixIsShared ) {
           ATH_MSG_DEBUG ("reject track; Tracks shared hits pushes accepted track above shared module limit");
           rejectSharedHitInvalid(trackHitDetails, tsosDetails, index);
+          if (m_observerTool.isEnabled()){
+            m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::firstHitSharedAndExtraShared);
+          }
           continue;
         }
 
@@ -1071,6 +1147,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
         // don't let track that look like this touch accepted tracks (new)
         if( trackHitDetails.totalPixelHits() < m_minPixHitAccepted ) { 
           rejectSharedHitInvalid(trackHitDetails, tsosDetails, index);
+          if (m_observerTool.isEnabled()){
+            m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::sharedHitsNotEnoughUniqueSiHits);
+          }
           continue;
         }
 
@@ -1083,24 +1162,33 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
       if( tsosDetails.m_detType[index] == 11 && !maxOtherHasIBL ) {
         ATH_MSG_VERBOSE ("---> Remove shared IBL as MaxShared accepted does not have an IBL hit");
         rejectSharedHit(trackHitDetails, tsosDetails, index);
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::sharedIBLSharedWithNoIBLTrack);
+        }
         continue;
       }
       // if this is pixel hit, and candidate does not match IBL content of MaxShared accepted, remove shared hit
       if(tsosDetails.m_detType[index] == 1 && (trackHitDetails.m_thisHasIBLHit != maxOtherHasIBL) ) {
         ATH_MSG_VERBOSE ("---> Only allow shared pixel if candidate and accepted have same IBL hit content");
         rejectSharedHit(trackHitDetails, tsosDetails, index);
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::sharedPixelSharedWithDifferentIBLTrack);
+        }
         continue;
       }
 
       // number of shared modules to be added to new sub-track
       // add shared hit to temporary counter
       newNumWeightedShared += (tsosDetails.m_detType[index]%10== 1 ? 2 : 1); // increase counter
-      // should remain beow the threshold 
+      // should remain below the threshold 
       if (newNumWeightedShared >= ent->m_maxSharedModules) {
         ATH_MSG_VERBOSE ("-> Too many share hits, dropping outer hit(s) " 
             << newNumWeightedShared << "\t" << ent->m_maxSharedModules);  
         newNumWeightedShared -= (tsosDetails.m_detType[index]%10== 1 ? 2 : 1); // decrease counter
         rejectSharedHit(trackHitDetails, tsosDetails, index);
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::decideWhichHitsToKeep, xAOD::RejectionReason::tooManySharedAfterIncreasingShared);
+        }
         continue;
       }
 
@@ -1130,7 +1218,45 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
   if (msgLvl(MSG::VERBOSE)){
     trackHitDetails.dumpInfo();
   }
-  
+
+  if (m_observerTool.isEnabled()){
+    // calculate average split probabilities
+    float splitProbAvg1 = -2;
+    if (!tsosDetails.m_splitProb1.empty()){
+      splitProbAvg1 = std::accumulate(tsosDetails.m_splitProb1.begin(), tsosDetails.m_splitProb1.end(), 0.0) / tsosDetails.m_splitProb1.size();
+    }
+    float splitProbAvg2 = -2;
+    if (!tsosDetails.m_splitProb2.empty()){
+      splitProbAvg2 = std::accumulate(tsosDetails.m_splitProb2.begin(), tsosDetails.m_splitProb2.end(), 0.0) / tsosDetails.m_splitProb2.size();
+    }
+    m_observerTool->updateHolesSharedHits(trackId,
+                                          trackHitDetails.m_numPixelHoles,
+                                          trackHitDetails.m_numSCTHoles,
+                                          trackHitDetails.m_numSplitSharedPix,
+                                          trackHitDetails.m_numSplitSharedSCT,
+                                          -2,
+                                          -2,
+                                          trackHitDetails.m_numShared,
+                                          trackHitDetails.m_isPatternTrack,
+                                          trackHitDetails.totalSiHits(),
+                                          trackHitDetails.m_passHadronicROI,
+                                          trackHitDetails.m_thisHasIBLHit,
+                                          trackHitDetails.m_hasSharedIBLHit,
+                                          trackHitDetails.m_hasSharedPixel,
+                                          trackHitDetails.m_firstPixIsShared,
+                                          trackHitDetails.m_numPixelDeadSensor,
+                                          trackHitDetails.m_numSCTDeadSensor,
+                                          trackHitDetails.m_numPixelHits,
+                                          trackHitDetails.m_numSCTHits,
+                                          trackHitDetails.m_numUnused,
+                                          trackHitDetails.m_numTRT_Unused,
+                                          trackHitDetails.m_numSCT_Unused,
+                                          trackHitDetails.m_numPseudo,
+                                          splitProbAvg1,
+                                          splitProbAvg2,
+                                          trackHitDetails.m_numWeightedShared);
+  }
+
   return;
 } // decideWhichHitsToKeep 
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/MuonAmbiTrackSelectionTool/MuonAmbiTrackSelectionTool.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/MuonAmbiTrackSelectionTool/MuonAmbiTrackSelectionTool.h
index a09ba844707d..bb1943a43cd3 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/MuonAmbiTrackSelectionTool/MuonAmbiTrackSelectionTool.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/MuonAmbiTrackSelectionTool/MuonAmbiTrackSelectionTool.h
@@ -44,7 +44,8 @@ class MuonAmbiTrackSelectionTool : virtual public Trk::IAmbiTrackSelectionTool,
 
     virtual std::tuple<Trk::Track *, bool> getCleanedOutTrack(const Trk::Track *track, const Trk::TrackScore score,
                                                               Trk::ClusterSplitProbabilityContainer &splitProbContainer,
-                                                              Trk::PRDtoTrackMap &prd_to_track_map) const override;
+                                                              Trk::PRDtoTrackMap &prd_to_track_map,
+                                                              int trackId = -1, int subtrackId = -1) const override;
 
   private:
     ToolHandle<Muon::MuonEDMPrinterTool> m_printer{
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/src/MuonAmbiTrackSelectionTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/src/MuonAmbiTrackSelectionTool.cxx
index 2fbb58fbf01c..16775583a33d 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/src/MuonAmbiTrackSelectionTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonAmbiTrackSelectionTool/src/MuonAmbiTrackSelectionTool.cxx
@@ -44,7 +44,8 @@ Muon::MuonAmbiTrackSelectionTool::initialize()
 std::tuple<Trk::Track *, bool>
 Muon::MuonAmbiTrackSelectionTool::getCleanedOutTrack(const Trk::Track *track, const Trk::TrackScore score,
                                                      [[maybe_unused]] Trk::ClusterSplitProbabilityContainer &splitProbContainer,
-                                                     Trk::PRDtoTrackMap &prd_to_track_map) const
+                                                     Trk::PRDtoTrackMap &prd_to_track_map,
+                                                     int trackId /*= -1*/, int subtrackId /*= -1*/) const
 {
     (void)score;  //@TODO unused ?
 
@@ -60,6 +61,7 @@ Muon::MuonAmbiTrackSelectionTool::getCleanedOutTrack(const Trk::Track *track, co
 
 
     ATH_MSG_VERBOSE("New Track " << m_printer->print(*track));
+    ATH_MSG_VERBOSE("trackId "<< trackId <<", subtrackId "<<subtrackId);  
 
     std::map<Muon::MuonStationIndex::StIndex, int> sharedPrecisionPerLayer;
     std::map<Muon::MuonStationIndex::StIndex, int> precisionPerLayer;
diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/src/TrackStateOnSurfaceDecorator.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/src/TrackStateOnSurfaceDecorator.cxx
index 1b7819046908..02d78734c203 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/src/TrackStateOnSurfaceDecorator.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/src/TrackStateOnSurfaceDecorator.cxx
@@ -347,68 +347,68 @@ namespace DerivationFramework {
         trackTRTFloatDecorators[kTRTusedHits_noHT_divByLDecor] (*track) = m_TRTdEdxTool->usedHits(trkTrack, false);
       }
 
-      // Track extrapolation
-      std::unique_ptr<const Trk::TrackParameters> perigee( m_extrapolator->extrapolate(*trkTrack,
-                                                                                       (trkTrack->perigeeParameters())->associatedSurface(),
-                                                                                       Trk::oppositeMomentum,
-                                                                                       true,
-                                                                                       Trk::pion,
-                                                                                       Trk::addNoise));
-
-      Trk::CylinderSurface cylSurfIBL(29.5,3000.0);
-      Trk::CylinderSurface cylSurfBL(50.5,3000.0);
-      Trk::CylinderSurface cylSurfL1(88.5,3000.0);
-      Trk::CylinderSurface cylSurfL2(122.5,3000.0);
-      std::unique_ptr<const Trk::TrackParameters> outputParamsIBL(m_extrapolator->extrapolate(*perigee,cylSurfIBL,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise));
-      std::unique_ptr<const Trk::TrackParameters> outputParamsBL(m_extrapolator->extrapolate(*perigee,cylSurfBL,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise));
-      std::unique_ptr<const Trk::TrackParameters> outputParamsL1(m_extrapolator->extrapolate(*perigee,cylSurfL1,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise));
-      std::unique_ptr<const Trk::TrackParameters> outputParamsL2(m_extrapolator->extrapolate(*perigee,cylSurfL2,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise));
-
-      if (outputParamsIBL.get()) {
-        trackPixFloatDecorators[kTrkIBLXDecor](*track) = outputParamsIBL->position().x();
-        trackPixFloatDecorators[kTrkIBLYDecor](*track) = outputParamsIBL->position().y();
-        trackPixFloatDecorators[kTrkIBLZDecor](*track) = outputParamsIBL->position().z();
-      }
-      else {
-         trackPixFloatDecorators[kTrkIBLXDecor](*track) = 0.0;
-         trackPixFloatDecorators[kTrkIBLYDecor](*track) = 0.0;
-         trackPixFloatDecorators[kTrkIBLZDecor](*track) = 0.0;
-      }
+      if ( trkTrack->perigeeParameters() ){
+        // Track extrapolation
+        std::unique_ptr<const Trk::TrackParameters> perigee( m_extrapolator->extrapolate(*trkTrack,
+                                                                                        (trkTrack->perigeeParameters())->associatedSurface(),
+                                                                                        Trk::oppositeMomentum,
+                                                                                        true,
+                                                                                        Trk::pion,
+                                                                                        Trk::addNoise));
+
+        Trk::CylinderSurface cylSurfIBL(29.5,3000.0);
+        Trk::CylinderSurface cylSurfBL(50.5,3000.0);
+        Trk::CylinderSurface cylSurfL1(88.5,3000.0);
+        Trk::CylinderSurface cylSurfL2(122.5,3000.0);
+        std::unique_ptr<const Trk::TrackParameters> outputParamsIBL(m_extrapolator->extrapolate(*perigee,cylSurfIBL,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise));
+        std::unique_ptr<const Trk::TrackParameters> outputParamsBL(m_extrapolator->extrapolate(*perigee,cylSurfBL,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise));
+        std::unique_ptr<const Trk::TrackParameters> outputParamsL1(m_extrapolator->extrapolate(*perigee,cylSurfL1,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise));
+        std::unique_ptr<const Trk::TrackParameters> outputParamsL2(m_extrapolator->extrapolate(*perigee,cylSurfL2,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise));
+
+        if (outputParamsIBL.get()) {
+          trackPixFloatDecorators[kTrkIBLXDecor](*track) = outputParamsIBL->position().x();
+          trackPixFloatDecorators[kTrkIBLYDecor](*track) = outputParamsIBL->position().y();
+          trackPixFloatDecorators[kTrkIBLZDecor](*track) = outputParamsIBL->position().z();
+        }
+        else {
+          trackPixFloatDecorators[kTrkIBLXDecor](*track) = 0.0;
+          trackPixFloatDecorators[kTrkIBLYDecor](*track) = 0.0;
+          trackPixFloatDecorators[kTrkIBLZDecor](*track) = 0.0;
+        }
 
-      if (outputParamsBL.get()) {
-        trackPixFloatDecorators[kTrkBLXDecor](*track) = outputParamsBL->position().x();
-        trackPixFloatDecorators[kTrkBLYDecor](*track) = outputParamsBL->position().y();
-        trackPixFloatDecorators[kTrkBLZDecor](*track) = outputParamsBL->position().z();
-      }
-      else {
-        trackPixFloatDecorators[kTrkBLXDecor](*track) = 0.0;
-        trackPixFloatDecorators[kTrkBLYDecor](*track) = 0.0;
-        trackPixFloatDecorators[kTrkBLZDecor](*track) = 0.0;
-      }
+        if (outputParamsBL.get()) {
+          trackPixFloatDecorators[kTrkBLXDecor](*track) = outputParamsBL->position().x();
+          trackPixFloatDecorators[kTrkBLYDecor](*track) = outputParamsBL->position().y();
+          trackPixFloatDecorators[kTrkBLZDecor](*track) = outputParamsBL->position().z();
+        }
+        else {
+          trackPixFloatDecorators[kTrkBLXDecor](*track) = 0.0;
+          trackPixFloatDecorators[kTrkBLYDecor](*track) = 0.0;
+          trackPixFloatDecorators[kTrkBLZDecor](*track) = 0.0;
+        }
 
-      if (outputParamsL1.get()) {
-        trackPixFloatDecorators[kTrkL1XDecor](*track) = outputParamsL1->position().x();
-        trackPixFloatDecorators[kTrkL1YDecor](*track) = outputParamsL1->position().y();
-        trackPixFloatDecorators[kTrkL1ZDecor](*track) = outputParamsL1->position().z();
-      }
-      else {
-        trackPixFloatDecorators[kTrkL1XDecor](*track) = 0.0;
-        trackPixFloatDecorators[kTrkL1YDecor](*track) = 0.0;
-        trackPixFloatDecorators[kTrkL1ZDecor](*track) = 0.0;
-      }
+        if (outputParamsL1.get()) {
+          trackPixFloatDecorators[kTrkL1XDecor](*track) = outputParamsL1->position().x();
+          trackPixFloatDecorators[kTrkL1YDecor](*track) = outputParamsL1->position().y();
+          trackPixFloatDecorators[kTrkL1ZDecor](*track) = outputParamsL1->position().z();
+        }
+        else {
+          trackPixFloatDecorators[kTrkL1XDecor](*track) = 0.0;
+          trackPixFloatDecorators[kTrkL1YDecor](*track) = 0.0;
+          trackPixFloatDecorators[kTrkL1ZDecor](*track) = 0.0;
+        }
 
-      if (outputParamsL2.get()) {
-        trackPixFloatDecorators[kTrkL2XDecor](*track) = outputParamsL2->position().x();
-        trackPixFloatDecorators[kTrkL2YDecor](*track) = outputParamsL2->position().y();
-        trackPixFloatDecorators[kTrkL2ZDecor](*track) = outputParamsL2->position().z();
-      }
-      else {
-        trackPixFloatDecorators[kTrkL2XDecor](*track) = 0.0;
-        trackPixFloatDecorators[kTrkL2YDecor](*track) = 0.0;
-        trackPixFloatDecorators[kTrkL2ZDecor](*track) = 0.0;
+        if (outputParamsL2.get()) {
+          trackPixFloatDecorators[kTrkL2XDecor](*track) = outputParamsL2->position().x();
+          trackPixFloatDecorators[kTrkL2YDecor](*track) = outputParamsL2->position().y();
+          trackPixFloatDecorators[kTrkL2ZDecor](*track) = outputParamsL2->position().z();
+        }
+        else {
+          trackPixFloatDecorators[kTrkL2XDecor](*track) = 0.0;
+          trackPixFloatDecorators[kTrkL2YDecor](*track) = 0.0;
+          trackPixFloatDecorators[kTrkL2ZDecor](*track) = 0.0;
+        }
       }
-
-
       // -- Add Track states to the current track, filtering on their type
       std::vector<const Trk::TrackStateOnSurface*> tsoss;
       for (const auto *const trackState: *(trkTrack->trackStateOnSurfaces())){
diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/ObservedTracksMap.h b/Tracking/TrkEvent/TrkTrack/TrkTrack/ObservedTracksMap.h
new file mode 100644
index 000000000000..5f856be519ff
--- /dev/null
+++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/ObservedTracksMap.h
@@ -0,0 +1,52 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+/***************************************************************************
+ CLASS_DEF for ObservedTracksMap used in TrkObserverTool
+ ------------------------------
+ ATLAS Collaboration
+ ***************************************************************************/
+
+#ifndef OBSERVEDTRACKSMAP_H
+#define OBSERVEDTRACKSMAP_H
+
+#include "xAODCore/CLASS_DEF.h"
+#include "xAODTracking/TrackingPrimitives.h"
+#include <map>
+
+typedef std::map< int, std::tuple< Trk::Track*, // unique ID, track object
+                        double, // score
+                        xAOD::RejectionStep, // rejection step
+                        xAOD::RejectionReason, // rejection reason
+                        int, // unique parentId
+                        int, // numPixelHoles
+                        int, // numSCTHoles
+                        int, // numSplitSharedPixel
+                        int, // numSplitSharedSCT
+                        int, // numSharedOrSplit
+                        int, // numSharedOrSplitPixels
+                        int, // numShared
+                        int, // isPatternTrack
+                        int, // totalSiHits
+                        int, // inROI
+                        int, // thishasblayer
+                        int, // hassharedblayer
+                        int, // hassharedpixel
+                        int, // firstisshared
+                        int, // numPixelDeadSensor
+                        int, // numSCTDeadSensor
+                        int, // numPixelHits
+                        int, // numSCTHits
+                        int, // numUnused
+                        int, // numTRT_Unused
+                        int, // numSCT_Unused
+                        int, // numPseudo
+                        float, // averageSplit1
+                        float, // averageSplit2
+                        int // numWeightedShared
+                        > > ObservedTracksMap;
+
+CLASS_DEF( ObservedTracksMap , 717976956 , 1 )
+
+#endif // OBSERVEDTRACKSMAP_H
\ No newline at end of file
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt b/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt
index a85c15f7c98d..3d9600815057 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt
@@ -18,4 +18,4 @@ atlas_add_component( TrkAmbiguityProcessor
                      src/TrackSelectionProcessorTool.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AthContainers AthenaBaseComps GaudiKernel InDetIdentifier InDetRecToolInterfaces InDetPrepRawData TrkEventPrimitives TrkEventUtils TrkParameters TrkRIO_OnTrack TrkTrack TrkTrackSummary TrkFitterInterfaces TrkToolInterfaces TrkExInterfaces )
+                     LINK_LIBRARIES ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} AthContainers AthenaBaseComps GaudiKernel InDetIdentifier InDetRecToolInterfaces InDetPrepRawData TrkEventPrimitives TrkEventUtils TrkParameters TrkRIO_OnTrack TrkTrack TrkTrackSummary TrkFitterInterfaces TrkToolInterfaces TrkExInterfaces TrkValInterfaces)
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorBase.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorBase.cxx
index e94440b6fd8b..fbe5865e9849 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorBase.cxx
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorBase.cxx
@@ -15,7 +15,8 @@ namespace Trk {
     m_etaBounds{0.8, 1.6, 2.5, 4.0}, 
     m_stat(m_etaBounds),
     m_scoringTool("Trk::TrackScoringTool/TrackScoringTool"){
-  }
+      declareProperty("ObserverTool", m_observerTool, "track observer tool");
+}
   //
   bool
   AmbiguityProcessorBase::shouldTryBremRecovery(const Trk::Track & track) const{
@@ -100,7 +101,7 @@ namespace Trk {
   }
   //
   Track * 
-  AmbiguityProcessorBase::refitTrack( const Trk::Track* track,Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat) const{
+  AmbiguityProcessorBase::refitTrack( const Trk::Track* track,Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat, int trackId, int subtrackId) const{
     std::unique_ptr<Trk::Track> newTrack;
     if (!m_suppressTrackFit){
       if (m_refitPrds) {
@@ -116,10 +117,17 @@ namespace Trk {
       newTrack = AmbiguityProcessor::createNewFitQualityTrack(*track);
     }
     if (newTrack) {
+      if (m_observerTool.isEnabled()){
+        m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::refitTrack, xAOD::RejectionReason::subtrackCreated);
+        m_observerTool->addSubTrack(subtrackId, trackId, *newTrack);
+      }
       ATH_MSG_DEBUG ("New track "<<newTrack.get()<<" successfully fitted from "<<track);
-    } else { 
+    } else {
+      if (m_observerTool.isEnabled()){
+        m_observerTool->rejectTrack(trackId, xAOD::RejectionStep::refitTrack, xAOD::RejectionReason::refitFailed);
+      }  
       ATH_MSG_DEBUG ("Fit failed !");
-    }  
+    }
     return newTrack.release();
   }
   //
@@ -128,7 +136,8 @@ namespace Trk {
                                                  TrackScoreMap &trackScoreTrackMap,
                                                  Trk::PRDtoTrackMap &prdToTrackMap,
                                                  std::vector<std::unique_ptr<const Trk::Track> >& trackDustbin,
-                                                 Counter &stat) const {
+                                                 Counter &stat,
+                                                 int parentTrackId) const {
     std::unique_ptr<Trk::Track> atrack(in_track);
     // compute score
     TrackScore score;
@@ -137,13 +146,21 @@ namespace Trk {
        m_trackSummaryTool->computeAndReplaceTrackSummary(*atrack,&prdToTrackMap,suppressHoleSearch);
     }
     score = m_scoringTool->score( *atrack, suppressHoleSearch );
+    if (m_observerTool.isEnabled()){
+      m_observerTool->updateScore(parentTrackId, static_cast<double>(score));
+    }
     // do we accept the track ?
     if (score!=0){
       ATH_MSG_DEBUG ("Track  ("<< atrack.get() <<") has score "<<score);
       // statistic
       stat.incrementCounterByRegion(CounterIndex::kNscoreOk,atrack.get());
       // add track to map, map is sorted small to big !
-      trackScoreTrackMap.emplace(-score, TrackPtr(atrack.release(), fitted));
+      if (m_observerTool.isEnabled()){
+        trackScoreTrackMap.emplace(-score, TrackPtr(atrack.release(), fitted, parentTrackId));
+      }
+      else{
+        trackScoreTrackMap.emplace(-score, TrackPtr(atrack.release(), fitted));
+      }
       return;
     }
     // do we try to recover the track ?
@@ -153,12 +170,20 @@ namespace Trk {
       auto bremTrack(doBremRefit(*atrack));
       if (!bremTrack){
         ATH_MSG_DEBUG ("Brem refit failed, drop track");
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(parentTrackId, xAOD::RejectionStep::addTrack, xAOD::RejectionReason::bremRefitFailed);
+        }
         // statistic
         stat.incrementCounterByRegion(CounterIndex::kNscoreZeroBremRefitFailed,atrack.get());
         stat.incrementCounterByRegion(CounterIndex::kNfailedFits,atrack.get());
         // clean up
         trackDustbin.push_back(std::move(atrack));
       } else {
+        int newTrackId = AmbiguityProcessor::getUid();
+        if (m_observerTool.isEnabled()){
+          m_observerTool->rejectTrack(parentTrackId, xAOD::RejectionStep::addTrack, xAOD::RejectionReason::bremRefitSubtrackCreated);
+          m_observerTool->addSubTrack(newTrackId, parentTrackId, *bremTrack);
+        }
         // statistic
         stat.incrementCounterByRegion(CounterIndex::kNgoodFits,bremTrack.get());
         // rerun score
@@ -166,6 +191,9 @@ namespace Trk {
           m_trackSummaryTool->computeAndReplaceTrackSummary(*bremTrack, &prdToTrackMap,suppressHoleSearch);
         }
         score = m_scoringTool->score( *bremTrack, suppressHoleSearch );
+        if (m_observerTool.isEnabled()){
+          m_observerTool->updateScore(newTrackId, static_cast<double>(score));
+        }
         //put original track in the bin, ready to preserve a new Brem track
         trackDustbin.push_back(std::move(atrack) );
         // do we accept the track ?
@@ -174,16 +202,28 @@ namespace Trk {
           // statistics
           stat.incrementCounterByRegion(CounterIndex::kNscoreZeroBremRefit,bremTrack.get());
           // add track to map, map is sorted small to big !
-          trackScoreTrackMap.emplace(-score, TrackPtr(bremTrack.release(), fitted) );
+          if (m_observerTool.isEnabled()){
+            m_observerTool->addSubTrack(newTrackId, parentTrackId, *bremTrack);
+            trackScoreTrackMap.emplace(-score, TrackPtr(bremTrack.release(), fitted, newTrackId) );
+          }
+          else{
+            trackScoreTrackMap.emplace(-score, TrackPtr(bremTrack.release(), fitted) );
+          }
           return;
         } else {
           ATH_MSG_DEBUG ("Brem refit gave still track score zero, reject it");
+          if (m_observerTool.isEnabled()){
+            m_observerTool->rejectTrack(newTrackId, xAOD::RejectionStep::addTrack, xAOD::RejectionReason::bremRefitTrackScoreZero);
+          }
           // statistic
           stat.incrementCounterByRegion(CounterIndex::kNscoreZeroBremRefitScoreZero,bremTrack.get());
         }
       }
     } else {
       ATH_MSG_DEBUG ("Track score is zero, reject it");
+      if (m_observerTool.isEnabled()){
+        m_observerTool->rejectTrack(parentTrackId, xAOD::RejectionStep::addTrack, xAOD::RejectionReason::refitTrackScoreZero);
+      }
       // statistic
       stat.incrementCounterByRegion(CounterIndex::kNscoreZero,atrack.get());
       trackDustbin.push_back(std::move(atrack));
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorBase.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorBase.h
index 9c41f16cb465..7598c27a5c2d 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorBase.h
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorBase.h
@@ -14,6 +14,8 @@
 #include "TrackPtr.h"
 #include "TrkEventPrimitives/TrackScore.h"
 #include "TrkEventUtils/ClusterSplitProbabilityContainer.h"
+#include "TrkValInterfaces/ITrkObserverTool.h"
+#include "AmbiguityProcessorUtility.h"
 
 #include <vector>
 #include <map> //multimap
@@ -73,7 +75,7 @@ namespace Trk {
     
     /** refit track */
     Track * 
-    refitTrack( const Trk::Track* track,Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat) const;
+    refitTrack( const Trk::Track* track,Trk::PRDtoTrackMap &prdToTrackMap, Counter &stat, int trackId, int subtrackId) const;
                        
     //refit PRD
     virtual Trk::Track* 
@@ -92,7 +94,8 @@ namespace Trk {
              TrackScoreMap &trackScoreTrackMap,
              Trk::PRDtoTrackMap &prdToTrackMap,
              std::vector<std::unique_ptr<const Trk::Track> >& trackDustbin,
-             Counter &stat) const;
+             Counter &stat,
+             int parentTrackId) const;
                                                  
     const TrackParameters *
     getTrackParameters(const Trk::Track* track) const;
@@ -124,6 +127,8 @@ namespace Trk {
        This tool is used to 'score' the tracks, i.e. to quantify what a good track is.
        @todo The actual tool that is used should be configured through job options*/
     ToolHandle<ITrackScoringTool> m_scoringTool;
+    /**Observer tool      This tool is used to observe the tracks and their 'score' */
+    PublicToolHandle<Trk::ITrkObserverTool> m_observerTool{this, "TrackObserverTool", "", "track observer within ambiguity solver"};
     ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"};
 
   private:
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorUtility.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorUtility.cxx
index 290c09097899..a216c2f615b5 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorUtility.cxx
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorUtility.cxx
@@ -56,5 +56,10 @@ namespace AmbiguityProcessor{
     info.addPatternReco(newInfo); 
     return std::make_unique<Trk::Track>(info, std::move(vecTsos), fq);
   }
+  //
+  int getUid() {
+    static std::atomic<std::uint32_t> uid { 0 };
+    return ++uid;
+  }
 
 }
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorUtility.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorUtility.h
index 94bec981350d..feea48cf798d 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorUtility.h
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/AmbiguityProcessorUtility.h
@@ -36,6 +36,8 @@ namespace AmbiguityProcessor{
   float calculateFitQuality(const Trk::Track & track);
   //create a track from a new FitQuality object looping over track-state-on-surfaces to calculate
   std::unique_ptr<Trk::Track> createNewFitQualityTrack(const Trk::Track & track);
+  //generate unique id for track (used in track observer tool)
+  int getUid();
 }//namespace
 
 #endif
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx
index d5b6543fad4f..551efe98f400 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx
@@ -63,6 +63,8 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::DenseEnvironmentsAmbiguityProcesso
   declareProperty("caloSeededBrem"       , m_caloSeededBrem     = false);
   declareProperty("pTminBrem"            , m_pTminBrem          = 1000.);
   declareProperty("etaBounds"            , m_etaBounds,"eta intervals for internal monitoring");
+  declareProperty("ObserverTool"         , m_observerTool, "track observer tool");
+  declareProperty("ObserverToolWriter"   , m_observerToolWriter, "track observer tool writer");
 
 }
 //==================================================================================================
@@ -95,6 +97,9 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::initialize(){
   Trk::ParticleSwitcher particleSwitch;
   m_particleHypothesis = particleSwitch.particle[m_matEffects];
 
+  ATH_CHECK(m_observerTool.retrieve(DisableTool{m_observerTool.empty()}));
+  ATH_CHECK(m_observerToolWriter.retrieve(DisableTool{m_observerToolWriter.empty()}));
+
   // brem fitting enabled ?
   if (m_tryBremFit)
     ATH_MSG_INFO( "Try brem fit and recovery for electron like tracks." );
@@ -134,6 +139,7 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::statistics(){
 const TrackCollection* 
 Trk::DenseEnvironmentsAmbiguityProcessorTool::process(const TracksScores *trackScoreTrackMap) const{
   if (!trackScoreTrackMap) return nullptr;
+  const EventContext& ctx = Gaudi::Hive::currentContext();
   // clear prdAssociationTool via selection tool
   // @TODO remove :
   std::unique_ptr<Trk::PRDtoTrackMap> prdToTrackMap( m_assoTool->createPRDtoTrackMap() );
@@ -159,6 +165,21 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::process(const TracksScores *trackS
         m_stat += stat;
      }
   }
+
+  if (m_observerTool.isEnabled() && m_observerToolWriter.isEnabled()){
+    // Sanity check
+    ATH_MSG_DEBUG("Saving observed tracks to store");
+    unsigned int nFinalTracks = m_observerToolWriter->saveTracksToStore(ctx, m_observerTool->getTrackMap(ctx));
+    if (finalTracks){
+      if (nFinalTracks != finalTracks->size()){
+        ATH_MSG_ERROR("Track observer recorded different number of final tracks: "<<nFinalTracks<<" vs. "<<finalTracks->size());
+      }
+      else {
+        ATH_MSG_DEBUG("Track observer recorded "<<nFinalTracks<<" final tracks");
+      }
+    }
+  }
+
   return finalTracks;
 }
 
@@ -172,7 +193,17 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::solveTracks(const TracksScores &tr
                                                                Counter &stat) const{
   TrackScoreMap scoreTrackFitflagMap;
   for(const std::pair< const Trk::Track *, float> &scoreTrack: trackScoreTrackMap){
-     scoreTrackFitflagMap.emplace(scoreTrack.second, TrackPtr(scoreTrack.first) );
+     if (m_observerTool.isEnabled()){
+       int input_track_uid = AmbiguityProcessor::getUid();
+       m_observerTool->addInputTrack(input_track_uid, *scoreTrack.first);
+       m_observerTool->updateTrackMap(input_track_uid, static_cast<double>(scoreTrack.second), xAOD::RejectionStep::solveTracks, xAOD::RejectionReason::stillBeingProcessed);
+       int map_track_uid = AmbiguityProcessor::getUid();
+       scoreTrackFitflagMap.emplace(scoreTrack.second, TrackPtr(scoreTrack.first, map_track_uid) );
+       m_observerTool->addSubTrack(map_track_uid, input_track_uid, *scoreTrack.first);
+     }
+     else{
+       scoreTrackFitflagMap.emplace(scoreTrack.second, TrackPtr(scoreTrack.first) );
+     }
      stat.incrementCounterByRegion(CounterIndex::kNcandidates,scoreTrack.first);
   }
   const EventContext& ctx = Gaudi::Hive::currentContext();
@@ -182,13 +213,15 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::solveTracks(const TracksScores &tr
   while ( !scoreTrackFitflagMap.empty() ){
     // get current best candidate 
     TrackScoreMap::iterator itnext = scoreTrackFitflagMap.begin();
-    TrackPtr atrack( std::move(itnext->second) );
+    int uid = itnext->second.getUid();
+    TrackPtr atrack( std::move(itnext->second), uid );
     float ascore =  itnext->first;
     scoreTrackFitflagMap.erase(itnext);
     // clean it out to make sure not to many shared hits
     ATH_MSG_DEBUG ("--- Trying next track "<<atrack.track()<<"\t with score "<<-ascore);
     std::unique_ptr<Trk::Track> cleanedTrack;
-    const auto &[cleanedTrack_tmp, keepOriginal] = m_selectionTool->getCleanedOutTrack( atrack.track() , -ascore, *splitProbContainer, prdToTrackMap);
+    int cleanedTrack_uid = AmbiguityProcessor::getUid();
+    const auto &[cleanedTrack_tmp, keepOriginal] = m_selectionTool->getCleanedOutTrack( atrack.track() , -ascore, *splitProbContainer, prdToTrackMap, uid, cleanedTrack_uid);
     cleanedTrack.reset(cleanedTrack_tmp);
     ATH_MSG_DEBUG ("--- cleaned next track "<< cleanedTrack.get());
     // cleaned track is input track and fitted
@@ -207,14 +240,15 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::solveTracks(const TracksScores &tr
       finalTracks.push_back( atrack.release() );
     } else if ( keepOriginal){
       // track can be kept as is, but is not yet fitted
-      ATH_MSG_DEBUG ("Good track("<< atrack.track() << ") but need to fit this track first, score, add it into map again and retry ! ");
-      Trk::Track * pRefittedTrack = refitTrack(atrack.track(),prdToTrackMap, stat);
+      ATH_MSG_DEBUG ("Good track ("<< atrack.track() << ") but need to fit this track first, score, add it into map again and retry ! ");
+      int refittedTrack_uid = AmbiguityProcessor::getUid();
+      Trk::Track * pRefittedTrack = refitTrack(atrack.track(),prdToTrackMap, stat, uid, refittedTrack_uid);
       if(pRefittedTrack) {
         /// If we want to keep the holes from before the refit (instead of triggering a new search), 
         /// copy over the existing summary to prevent a new hole search.
         /// Not done in default tracking, only relevant when using holes from pattern recognition. 
         if (m_keepHolesFromBeforeFit && atrack.track()->trackSummary()) pRefittedTrack->setTrackSummary(std::make_unique<Trk::TrackSummary>(*atrack.track()->trackSummary()));
-        addTrack( pRefittedTrack, true , scoreTrackFitflagMap, prdToTrackMap, trackDustbin, stat);
+        addTrack( pRefittedTrack, true , scoreTrackFitflagMap, prdToTrackMap, trackDustbin, stat, refittedTrack_uid);
       }
       // remove original copy, but delay removal since some pointer to it or its constituents may still be in used
       if (atrack.newTrack()) {
@@ -224,7 +258,7 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::solveTracks(const TracksScores &tr
       ATH_MSG_DEBUG ("Candidate excluded, add subtrack to map. Track "<<cleanedTrack.get());
       stat.incrementCounterByRegion(CounterIndex::kNsubTrack,cleanedTrack.get());
       // for this case clenedTrack is a new created object.
-      addTrack(cleanedTrack.release(), false, scoreTrackFitflagMap, prdToTrackMap, trackDustbin, stat);
+      addTrack(cleanedTrack.release(), false, scoreTrackFitflagMap, prdToTrackMap, trackDustbin, stat, cleanedTrack_uid);
       // remove original copy, but delay removal since some pointer to it or its constituents may still be in used
       if (atrack.newTrack()) {
          trackDustbin.emplace_back(atrack.release() );
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h
index fd1430279019..63763ef45c53 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h
@@ -9,6 +9,7 @@
 #include "TrkFitterInterfaces/ITrackFitter.h"
 #include "TrkToolInterfaces/IAmbiTrackSelectionTool.h"
 #include "InDetPrepRawData/PixelGangedClusterAmbiguities.h"
+#include "TrkValInterfaces/ITrkObserverTool.h"
 
 #include "TrkToolInterfaces/IPRDtoTrackMapTool.h"
 #include "TrkEventUtils/PRDtoTrackMap.h"
@@ -106,11 +107,15 @@ namespace Trk {
         which are removed are made */
     ToolHandle<IAmbiTrackSelectionTool> m_selectionTool;
 
+    /**Observer tool      This tool is used to observe the tracks and their 'score' */
+    PublicToolHandle<Trk::ITrkObserverTool> m_observerTool{this, "TrackObserverTool", "", "track observer within ambiguity solver"};
+    PublicToolHandle<Trk::ITrkObserverTool> m_observerToolWriter{this, "TrackObserverToolWriter", "", "track observer writer within ambiguity solver"};
+
     bool m_rejectInvalidTracks{};
     /// If enabled, this flag will make the tool restore the hole information from the input track after a refit. 
     /// This is used when we want to use holes from the pattern recognition instead of repeating the hole search
     /// Off by default
-    BooleanProperty m_keepHolesFromBeforeFit{this,"KeepHolesFromBeforeRefit",false,"Restore hole information from input tracks after refit"}; 
+    BooleanProperty m_keepHolesFromBeforeFit{this,"KeepHolesFromBeforeRefit",false,"Restore hole information from input tracks after refit"};
   };
   
   inline std::unique_ptr<Trk::Track>
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx
index 30e245bbe621..dcb2217f0570 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.cxx
@@ -41,6 +41,7 @@ Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::DenseEnvironmentsAmbiguitySco
   declareProperty("sharedProbCut"        , m_sharedProbCut           = 0.3);
   declareProperty("sharedProbCut2"       , m_sharedProbCut2          = 0.3);
   declareProperty("etaBounds"            , m_etaBounds,"eta intervals for internal monitoring");
+  declareProperty("ObserverTool"         , m_observerTool, "track observer tool");
 
 }
 //==================================================================================================
@@ -64,6 +65,8 @@ Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::initialize(){
   ATH_CHECK( m_splitClusterMapKey_last.initialize(!m_splitClusterMapKey_last.key().empty()) );
   ATH_CHECK( m_splitClusterMapKey.initialize(!m_splitClusterMapKey.key().empty()) );
 
+  ATH_CHECK(m_observerTool.retrieve(DisableTool{m_observerTool.empty()}));
+
   if (m_etaBounds.size() != Counter::nRegions) {
      ATH_MSG_FATAL("There must be exactly " << (Counter::nRegions) << " eta bounds but "
                    << m_etaBounds.size() << " are set." );
@@ -173,6 +176,9 @@ Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::addNewTracks(const TrackColle
   ATH_MSG_DEBUG ("Number of tracks at Input: "<<tracks.size());
   const std::array<ScoreCategory, 3> categoryMapping {ScoreCategory::kNcandScoreZero, ScoreCategory::kNcandDouble, ScoreCategory::kNaccept};
   constexpr bool dropDuplicateTracks{true};
+  int nZeroScore = 0;
+  int nDuplicates = 0;
+  int nToMap = 0;
   for(const Track* pThisTrack : tracks) {
     ATH_MSG_VERBOSE ("Processing track candidate "<<pThisTrack);
     stat.incrementCounterByRegion(ScoreCategory::kNcandidates,pThisTrack); // @TODO should go to the score processor
@@ -183,12 +189,33 @@ Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::addNewTracks(const TrackColle
     if (category == AmbiguityProcessor::TrackAccepted){
       ATH_MSG_VERBOSE ("Track  ("<< pThisTrack <<") has score "<<score);
       trackScoreTrackMap->push_back(std::make_pair(pThisTrack, -score));
+      if (m_observerTool.isEnabled()) {
+        nToMap++;
+      }
+    } else if (m_observerTool.isEnabled() && category == AmbiguityProcessor::ScoreIsZero){
+      int input_track_uid = AmbiguityProcessor::getUid();
+      m_observerTool->addInputTrack(input_track_uid, *pThisTrack);
+      m_observerTool->updateTrackMap(input_track_uid, static_cast<double>(score), xAOD::RejectionStep::addNewTracks, xAOD::RejectionReason::trackScoreZero);
+      nZeroScore++;
+    } else if (m_observerTool.isEnabled() && category == AmbiguityProcessor::TrackIsDuplicate){
+      int input_track_uid = AmbiguityProcessor::getUid();
+      m_observerTool->addInputTrack(input_track_uid, *pThisTrack);
+      m_observerTool->updateTrackMap(input_track_uid, static_cast<double>(score), xAOD::RejectionStep::addNewTracks, xAOD::RejectionReason::duplicateTrack);
+      nDuplicates++;
     }
   }
   {
      std::lock_guard<std::mutex> lock(m_statMutex);
      m_stat += stat;
   }
+  if (m_observerTool.isEnabled()){
+    if ((unsigned int) (nZeroScore+nDuplicates+nToMap) != tracks.size()){
+      ATH_MSG_ERROR("(nZeroScore+nDuplicates+nToMap) = "<<nZeroScore+nDuplicates+nToMap<<" but tracks.size() = "<<tracks.size());
+    }
+    else{
+      ATH_MSG_DEBUG("Track observer too sanity check passed!");
+    }
+  }
 }
 
 //==================================================================================================
@@ -239,7 +266,7 @@ Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::overlappingTracks(const Track
                                                                      Trk::PRDtoTrackMap &prdToTrackMap) const
 {
   const Trk::IPRDtoTrackMapTool *the_asso_tool = (m_assoToolNotGanged.isEnabled() ? &(*m_assoToolNotGanged) : &(*m_assoTool));
-  // Function currnetly does nothing useful expect for printout debug information
+  // Function currently does nothing useful except for printing debug information
   ATH_MSG_DEBUG ("Starting to resolve overlapping tracks");
   // Map to add all pixel clusters on track to
   std::map< const InDet::PixelCluster*, const Trk::TrackParameters* > setOfPixelClustersOnTrack;
@@ -360,4 +387,3 @@ Trk::DenseEnvironmentsAmbiguityScoreProcessorTool::dumpStat(MsgStream &out) cons
    out << std::setprecision(ss);
 }
 
-
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.h
index c2c66e81c31d..8d96ef17461f 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.h
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityScoreProcessorTool.h
@@ -12,6 +12,7 @@
 #include "TrkEventPrimitives/TrackScore.h"
 #include "TrkFitterInterfaces/ITrackFitter.h"
 #include "InDetPrepRawData/PixelGangedClusterAmbiguities.h"
+#include "TrkValInterfaces/ITrkObserverTool.h"
 
 //need to include the following, since its a typedef and can't be forward declared.
 #include "TrkTrack/TrackCollection.h"
@@ -102,6 +103,9 @@ namespace Trk {
       /** recalculate split prob tool **/
       ToolHandle<InDet::IPixelClusterSplitProbTool> m_splitProbTool; 
 
+      /**Observer tool      This tool is used to observe the tracks and their 'score' */
+      PublicToolHandle<Trk::ITrkObserverTool> m_observerTool{this, "TrackObserverTool", "", "track observer within ambiguity solver"};
+
       /** cluster split information generated by previous instances*/
       SG::ReadHandleKey<InDet::PixelGangedClusterAmbiguities>  m_splitClusterMapKey_last;
       
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx
index d72c5d69cce4..5a6e9b354a84 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx
@@ -213,7 +213,7 @@ Trk::SimpleAmbiguityProcessorTool::solveTracks(TrackScoreMap& trackScoreTrackMap
     // clean it out to make sure not to many shared hits
     ATH_MSG_VERBOSE ("--- Trying next track "<<atrack.track()<<"\t with score "<<-ascore);
     std::unique_ptr<Trk::Track> cleanedTrack;
-    auto [cleanedTrack_tmp,keep_orig] = m_selectionTool->getCleanedOutTrack( atrack.track() , -(ascore), *splitProbContainer, prdToTrackMap);
+    auto [cleanedTrack_tmp,keep_orig] = m_selectionTool->getCleanedOutTrack( atrack.track() , -(ascore), *splitProbContainer, prdToTrackMap, -1, -1);
     cleanedTrack.reset( cleanedTrack_tmp);
     // cleaned track is input track and fitted
     if (keep_orig && atrack.fitted() ){
@@ -230,9 +230,9 @@ Trk::SimpleAmbiguityProcessorTool::solveTracks(TrackScoreMap& trackScoreTrackMap
       // don't forget to drop track from map
       // track can be kept as is, but is not yet fitted
       ATH_MSG_DEBUG ("Good track, but need to fit this track first, score, add it into map again and retry !");
-      auto *pRefittedTrack = refitTrack(atrack.track(), prdToTrackMap, stat);
+      auto *pRefittedTrack = refitTrack(atrack.track(), prdToTrackMap, stat, -1, -1);
       if(pRefittedTrack) {
-         addTrack( pRefittedTrack, true , trackScoreTrackMap, prdToTrackMap, trackDustbin, stat);
+         addTrack( pRefittedTrack, true , trackScoreTrackMap, prdToTrackMap, trackDustbin, stat, -1);    
       }
       if (atrack.newTrack()) {
         trackDustbin.emplace_back(atrack.release());
@@ -249,7 +249,7 @@ Trk::SimpleAmbiguityProcessorTool::solveTracks(TrackScoreMap& trackScoreTrackMap
       // statistic
       stat.incrementCounterByRegion(CounterIndex::kNsubTrack,cleanedTrack.get());
       // track needs fitting !
-      addTrack( cleanedTrack.release(), false, trackScoreTrackMap, prdToTrackMap, trackDustbin, stat);
+      addTrack( cleanedTrack.release(), false, trackScoreTrackMap, prdToTrackMap, trackDustbin, stat, -1);
     } else {
       // track should be discarded
       ATH_MSG_DEBUG ("Track "<< atrack.track() << " is excluded, no subtrack, reject");
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackPtr.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackPtr.h
index b0d98ff04159..f3609b908af0 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackPtr.h
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackPtr.h
@@ -16,15 +16,24 @@ namespace Trk {
       TrackPtr &operator=(const TrackPtr &) = delete;
 
       // allow moving
-      TrackPtr( TrackPtr &&a) : m_track(a.m_track),m_owner(a.m_owner), m_fitted(a.m_fitted) {
+      TrackPtr( TrackPtr &&a) : m_track(a.m_track), m_uid(a.m_uid), m_owner(a.m_owner), m_fitted(a.m_fitted) {
          if (a.m_owner) {
             a.m_owner              = false;
             a.m_track.m_ownedTrack = nullptr;
          }
       }
 
-      TrackPtr( const Trk::Track *orig_track)       : m_owner(false), m_fitted(false)  { m_track.m_origTrack  = orig_track; }
-      TrackPtr( Trk::Track *new_track, bool fitted) : m_owner(true),  m_fitted(fitted) { m_track.m_ownedTrack = new_track;  }
+      TrackPtr( TrackPtr &&a, int uid) : m_track(a.m_track), m_uid(uid), m_owner(a.m_owner), m_fitted(a.m_fitted) {
+         if (a.m_owner) {
+            a.m_owner              = false;
+            a.m_track.m_ownedTrack = nullptr;
+         }
+      }
+
+      TrackPtr( const Trk::Track *orig_track)       : m_uid(-1), m_owner(false), m_fitted(false) { m_track.m_origTrack  = orig_track; }
+      TrackPtr( Trk::Track *new_track, bool fitted) : m_uid(-1), m_owner(true), m_fitted(fitted) { m_track.m_ownedTrack = new_track; }
+      TrackPtr( const Trk::Track *orig_track, int uid)       : m_uid(uid), m_owner(false), m_fitted(false)  { m_track.m_origTrack  = orig_track; }
+      TrackPtr( Trk::Track *new_track, bool fitted, int uid) : m_uid(uid), m_owner(true),  m_fitted(fitted) { m_track.m_ownedTrack = new_track; }
       ~TrackPtr() {
          if (m_owner) delete m_track.m_ownedTrack;
       }
@@ -66,12 +75,14 @@ namespace Trk {
       }
       bool fitted() const { return m_fitted; }
       void forceFitted() { m_fitted=true; }
+      int getUid() const { return m_uid; }
 
    private:
       union {
          Trk::Track *m_ownedTrack;
          const Trk::Track *m_origTrack;
       } m_track;
+      const int m_uid;
       bool m_owner;
       bool m_fitted;
    };
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackSelectionProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackSelectionProcessorTool.cxx
index b0cf1a70a181..eed80f592fb2 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackSelectionProcessorTool.cxx
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackSelectionProcessorTool.cxx
@@ -185,7 +185,7 @@ Trk::TrackSelectionProcessorTool::solveTracks(TrackScoreMap &trackScoreTrackMap,
     trackScoreTrackMap.erase(itnext);
     ATH_MSG_VERBOSE ("--- Trying next track "<<atrack.track()<<"\t with score "<<-ascore);
     std::unique_ptr<Trk::Track> cleanedTrack;
-    const auto &[cleanedTrack_tmp, keepOriginal]  = m_selectionTool->getCleanedOutTrack( atrack.track() , -(ascore), *splitProbContainer, prdToTrackMap);
+    const auto &[cleanedTrack_tmp, keepOriginal]  = m_selectionTool->getCleanedOutTrack( atrack.track() , -(ascore), *splitProbContainer, prdToTrackMap, -1, -1);
     cleanedTrack.reset(cleanedTrack_tmp);
     if (keepOriginal ){
       // track can be kept as identical to the input track
diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h
index 3e17ff471264..30446c1d19bf 100755
--- a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h
+++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IAmbiTrackSelectionTool.h
@@ -34,6 +34,8 @@ namespace Trk
         @param score the score tha twas given to the input track
         @param prd_to_track_map a map to identify shared hits.
         @param clusterSplitProbMap map which associates pixel cluster to cluster splitting probabilities.
+        @param trackId unique track identifier (used by track observer tool)
+        @param subtrackId unique track identifier for cleaned out track (used by track observer tool)
         @return tuple where the first element is a potiner to a new track or a nullptr and the second element is a flag which is set to false if the input track is to be rejected.
         The second element of the returned tuple is false if the input input track is to be rejected.
         The input track is rejected if it does not fulfil quality criteria or if a new cleaned track is created
@@ -43,7 +45,9 @@ namespace Trk
     virtual std::tuple<Trk::Track*,bool> getCleanedOutTrack(const Trk::Track *track,
                                                             const Trk::TrackScore score,
                                                             Trk::ClusterSplitProbabilityContainer &splitProbContainer,
-                                                            Trk::PRDtoTrackMap &prd_to_track_map) const =0;
+                                                            Trk::PRDtoTrackMap &prd_to_track_map,
+                                                            int trackId,
+                                                            int subtrackId) const =0;
   };
 
 } // end of namespace
diff --git a/Tracking/TrkValidation/TrkValInterfaces/TrkValInterfaces/ITrkObserverTool.h b/Tracking/TrkValidation/TrkValInterfaces/TrkValInterfaces/ITrkObserverTool.h
new file mode 100644
index 000000000000..5f35c431321d
--- /dev/null
+++ b/Tracking/TrkValidation/TrkValInterfaces/TrkValInterfaces/ITrkObserverTool.h
@@ -0,0 +1,54 @@
+///////////////////////// -*- C++ -*- /////////////////////////////
+
+/*
+	Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+// ITrkObserverTool.h 
+// Header file for class ITrkObserverTool
+// Author: C.Rauchegger <christoph.rauchegger@cern.ch>
+//
+// Tool to observe/monitor the track candiates during the 
+// whole ambiguity solving process
+/////////////////////////////////////////////////////////////////// 
+#ifndef TRK_ITRKOBSERVERTOOL_H
+#define TRK_ITRKOBSERVERTOOL_H
+
+// FrameWork includes
+#include "GaudiKernel/IAlgTool.h"
+#include "TrkTrack/TrackCollection.h"
+#include "xAODTracking/TrackingPrimitives.h"
+// data type of map for storing in cache
+#include "TrkTrack/ObservedTracksMap.h"
+
+// Forward declaration
+
+namespace Trk
+{
+	static const InterfaceID IID_ITrkObserverTool("Trk::ITrkObserverTool", 1, 0);
+
+	class ITrkObserverTool : virtual public IAlgTool { 
+		public: 
+			virtual ~ITrkObserverTool() {};
+			static const InterfaceID& interfaceID();
+
+			virtual void updateTrackMap(int uid, double score, xAOD::RejectionStep rejectStep, xAOD::RejectionReason rejectReason) const = 0;
+			virtual void updateScore(int uid, double score) const = 0;
+			virtual void rejectTrack(int uid, xAOD::RejectionStep rejectStep, xAOD::RejectionReason rejectReason) const = 0;
+			virtual void addInputTrack(int uid, const Trk::Track& track) const = 0;
+			virtual void addSubTrack(int track_uid, int parent_uid, const Trk::Track& track) const = 0;
+			virtual ObservedTracksMap* getTrackMap(const EventContext& ctx) const = 0;
+			virtual int saveTracksToStore(const EventContext& ctx, const ObservedTracksMap* trk_map) const = 0;
+			virtual void updateHolesSharedHits(int uid, int numPixelHoles, int numSCTHoles, int numSplitSharedPixel, int numSplitSharedSCT,
+				int numSharedOrSplit, int numSharedOrSplitPixels, int numShared, int isPatternTrack, int totalSiHits, int inROI, int hasIBLHit,
+				int hasSharedIBLHit, int hasSharedPixel, int firstPixIsShared, int numPixelDeadSensor, int numSCTDeadSensor, int numPixelHits,
+				int numSCTHits, int numUnused, int numTRT_Unused, int numSCT_Unused, int numPseudo, float averageSplit1, float averageSplit2,
+				int numWeightedShared) const = 0;
+	};
+
+	inline const InterfaceID& Trk::ITrkObserverTool::interfaceID() { 
+		return IID_ITrkObserverTool; 
+	}
+}
+
+#endif // TRK_ITRKOBSERVERTOOL_H
\ No newline at end of file
diff --git a/Tracking/TrkValidation/TrkValTools/TrkValTools/TrkObserverTool.h b/Tracking/TrkValidation/TrkValTools/TrkValTools/TrkObserverTool.h
new file mode 100644
index 000000000000..0e8717f42afa
--- /dev/null
+++ b/Tracking/TrkValidation/TrkValTools/TrkValTools/TrkObserverTool.h
@@ -0,0 +1,85 @@
+///////////////////////// -*- C++ -*- /////////////////////////////
+
+/*
+	Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+// TrkObserverTool.h 
+// Header file for class TrkObserverTool
+// Author: C.Rauchegger<christoph.rauchegger@cern.ch>
+/////////////////////////////////////////////////////////////////// 
+#ifndef TRK_TRKOBSERVERTOOL_H
+#define TRK_TRKOBSERVERTOOL_H
+
+// STL includes
+#include <string>
+
+// FrameWork includes
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "AthenaKernel/SlotSpecificObj.h"
+
+// TrkObserverInterface includes
+#include "TrkValInterfaces/ITrkObserverTool.h"
+
+//need to include the following, since its a typedef and can't be forward declared.
+#include "TrkTrack/TrackCollection.h"
+
+// Forward declaration
+
+// for creating xAOD with TrackParticle
+#include "xAODTracking/TrackParticleContainer.h"
+#include "xAODTracking/TrackParticleAuxContainer.h"
+#include "xAODTracking/TrackParticle.h"
+#include "TrkToolInterfaces/ITrackParticleCreatorTool.h"
+
+
+namespace Trk {
+
+	class ITrackParticleCreatorTool;
+
+	class TrkObserverTool : virtual public Trk::ITrkObserverTool, public :: AthAlgTool {
+		public:
+			TrkObserverTool(const std::string& type, const std::string& name, const IInterface* parent);
+			virtual ~TrkObserverTool();
+			// athena algtool's Hooks
+			virtual StatusCode initialize();
+			virtual StatusCode finalize();
+			// const methods
+			void updateTrackMap(int uid, double score, xAOD::RejectionStep rejectStep, xAOD::RejectionReason rejectReason) const;
+			void updateScore(int uid, double score) const;
+			void rejectTrack(int uid, xAOD::RejectionStep rejectStep, xAOD::RejectionReason rejectReason) const;
+			void addInputTrack(int uid, const Trk::Track& track) const;
+			void addSubTrack(int track_uid, int parent_uid, const Trk::Track& track) const;
+			ObservedTracksMap* getTrackMap(const EventContext& ctx) const;
+			int saveTracksToStore(const EventContext& ctx, const ObservedTracksMap* trk_map) const;
+			void updateHolesSharedHits(int uid, int numPixelHoles, int numSCTHoles, int numSplitSharedPixel, int numSplitSharedSCT,
+				int numSharedOrSplit, int numSharedOrSplitPixels, int numShared, int isPatternTrack, int totalSiHits, int inROI, int hasIBLHit,
+				int hasSharedIBLHit, int hasSharedPixel, int firstPixIsShared, int numPixelDeadSensor, int numSCTDeadSensor, int numPixelHits,
+				int numSCTHits, int numUnused, int numTRT_Unused, int numSCT_Unused, int numPseudo, float averageSplit1, float averageSplit2, int numWeightedShared) const;
+
+		private:
+			// name of the observed (saved) track collection
+		    SG::WriteHandleKey<TrackCollection> m_savedTracksWriteKey;
+		    SG::WriteHandleKey<ObservedTracksMap> m_savedTracksMapWriteKey;
+
+			mutable std::mutex m_mutex;
+			struct CacheEntry {
+				EventContext::ContextEvt_t m_evt{EventContext::INVALID_CONTEXT_EVT};
+				// map with observed tracks and information
+				ObservedTracksMap* 	m_observedTrkMap;
+			};
+			mutable SG::SlotSpecificObj<CacheEntry> m_cache ATLAS_THREAD_SAFE; // Guarded by m_mutex
+
+			void newEvent(CacheEntry* ent) const;
+			void dumpTrackMap(const ObservedTracksMap* trk_map) const;
+			std::string dumpRejection(xAOD::RejectionStep rejectStep, xAOD::RejectionReason rejectReason) const;
+			int getNFinalTracks(const ObservedTracksMap* trk_map) const;
+			int getNObservedTracks(const ObservedTracksMap* trk_map) const;
+			static std::map<xAOD::RejectionStep, std::string> m_rejectStep_descriptions;
+			static std::map<xAOD::RejectionReason, std::string> m_rejectReason_descriptions;
+	}; 
+}
+
+#endif // TRK_TRKOBSERVERTOOL_H
\ No newline at end of file
diff --git a/Tracking/TrkValidation/TrkValTools/src/TrkObserverTool.cxx b/Tracking/TrkValidation/TrkValTools/src/TrkObserverTool.cxx
new file mode 100644
index 000000000000..dede53f23bde
--- /dev/null
+++ b/Tracking/TrkValidation/TrkValTools/src/TrkObserverTool.cxx
@@ -0,0 +1,460 @@
+///////////////////////// -*- C++ -*- /////////////////////////////
+
+/*
+	Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+// TrkObserverTool.cxx 
+// Implementation file for class TrkObserverTool
+// Authors: C.Rauchegger<christoph.rauchegger@cern.ch> and 
+// 			S.Rettie<sebastien.rettie@cern.ch>
+
+// Description:
+//	This tool monitors a track candidate through the whole 
+//	ambiguity solving process
+//		(AmbiguityProcessorBase.cxx,
+//		 DenseEnvironmentsAmbiguityProcessorTool.cxx,
+//		 DenseEnvironmentsAmbiguityScoreProcessorTool.cxx,
+//		 InDetDenseEnvAmbiTrackSelectionTool.cxx).
+//	Every change (score, subtrack created, track rejected) is 
+//	recorded and in the end an xAOD output file is created.
+
+//	The output file contains all the tracks which occur during 
+//	the ambiguity solving (input tracks, final tracks, and only
+//	temporary tracks as well). The tracks in the file contain 
+//	all information the ambiguity solver has (pixel hits, SCT 
+//	hits, split hits, etc.) and additional information by the
+//	TrkObserverTool (uniqueId, parentId, score, rejection location).
+
+//	Every track has ONLY one "direct subtrack". But this subtrack
+//	can have another subtrack, ...
+
+// Each track is uniquely identified using a thread-safe
+// std::atomic<std::uint32_t> (defined in AmbiguityProcessorUtility.cxx),
+// which serves as Id for the tool. If a track has a parent, the unique 
+// Id of the parent is also saved by the tool. As the ambiguity processor
+// tools delete tracks, all tracks (including temporary tracks) are
+// saved to the tool's cache entry, i.e. an ObservedTracksMap object.
+
+// Two instances of the TrkObserverTool must be instantiated in order
+// to avoid data handle conflicts:
+// - Instance that does not initialize the data handles and 
+//	 is used throughout the ambiguity solving
+// - Instance that initializes the data handles and is only used
+// 	 to write out the observed tracks after the ambiguity solving
+//	 is done
+
+// Package includes
+#include "TrkValTools/TrkObserverTool.h"
+#include <sstream> 
+
+// FrameWork includes
+#include "GaudiKernel/IToolSvc.h"
+#include "TrkTrack/TrackCollection.h"
+
+/////////////////////////////////////////////////////////////////// 
+// Public methods: 
+/////////////////////////////////////////////////////////////////// 
+
+// Constructor
+////////////////
+Trk::TrkObserverTool::TrkObserverTool(const std::string& type, const std::string& name, const IInterface* parent)
+	: AthAlgTool(type, name, parent){
+			declareInterface< ITrkObserverTool >(this);
+			declareProperty("ObsTrackCollection", m_savedTracksWriteKey);
+			declareProperty("ObsTrackCollectionMap", m_savedTracksMapWriteKey);
+}
+
+// Destructor
+///////////////
+Trk::TrkObserverTool::~TrkObserverTool() {}
+
+// Athena algtool's Hooks
+////////////////////////////
+StatusCode Trk::TrkObserverTool::initialize() {
+	ATH_MSG_INFO("Initializing TrkObserverTool with name: " << name());
+	ATH_MSG_INFO("\tm_savedTracksWriteKey: " << m_savedTracksWriteKey.key());
+	ATH_MSG_INFO("\tm_savedTracksMapWriteKey: " << m_savedTracksMapWriteKey.key());
+	ATH_CHECK(AthAlgTool::initialize());
+	ATH_CHECK(m_savedTracksWriteKey.initialize(!m_savedTracksWriteKey.key().empty()));
+	ATH_CHECK(m_savedTracksMapWriteKey.initialize(!m_savedTracksMapWriteKey.key().empty()));
+	ATH_MSG_INFO("Initialized TrkObserverTool");
+	return StatusCode::SUCCESS;
+}
+
+StatusCode Trk::TrkObserverTool::finalize() {
+	ATH_MSG_INFO("Finalizing " << name() << "...");
+	return StatusCode::SUCCESS;
+}
+
+/////////////////////////////////////////////////////////////////// 
+// Const methods: 
+///////////////////////////////////////////////////////////////////
+void Trk::TrkObserverTool::newEvent(CacheEntry* ent) const {
+	ATH_MSG_DEBUG("Starting new event");
+	if (ent->m_observedTrkMap) {
+		ent->m_observedTrkMap->clear();
+		delete ent->m_observedTrkMap;
+	}
+	ent->m_observedTrkMap = new ObservedTracksMap;
+}
+
+void Trk::TrkObserverTool::updateTrackMap(int uid, double score, xAOD::RejectionStep rejectStep, xAOD::RejectionReason rejectReason) const {
+
+	ATH_MSG_DEBUG("updateTrackMap: track "<<uid);
+	// get event context and map from cache
+	const EventContext& ctx{Gaudi::Hive::currentContext()};
+	std::lock_guard<std::mutex> lock{m_mutex};
+	ObservedTracksMap* trk_map = getTrackMap(ctx);
+	// find track and update score
+	if ( trk_map->find(uid) == trk_map->end() ) {
+		// not found
+		ATH_MSG_WARNING("updateTrackMap: track << " << uid << " not found in observedTrkMap");
+	}
+	else {
+		// found
+		std::get<1>(trk_map->at(uid)) = score;
+		std::get<2>(trk_map->at(uid)) = rejectStep;
+		std::get<3>(trk_map->at(uid)) = rejectReason;
+		ATH_MSG_DEBUG("updateTrackMap: track "<<uid<<" with score, rejectStep, rejectReason: "<<score<<", "<<rejectStep<<", "<<rejectReason);
+	}
+}
+
+void Trk::TrkObserverTool::updateScore(int uid, double score) const {
+
+	ATH_MSG_DEBUG("updateScore: track "<<uid);
+	// get event context and map from cache
+	const EventContext& ctx{Gaudi::Hive::currentContext()};
+	std::lock_guard<std::mutex> lock{m_mutex};
+	ObservedTracksMap* trk_map = getTrackMap(ctx);
+	// find track and update score
+	if ( trk_map->find(uid) == trk_map->end() ) {
+		// not found
+		ATH_MSG_WARNING("updateScore: track << " << uid << " not found in observedTrkMap");
+	}
+	else {
+		// found
+		std::get<1>(trk_map->at(uid)) = score;
+		ATH_MSG_DEBUG("updateScore: track "<<uid<<" with score "<<score);
+	}
+}
+
+void Trk::TrkObserverTool::rejectTrack(int uid, xAOD::RejectionStep rejectStep, xAOD::RejectionReason rejectReason) const {
+
+	ATH_MSG_DEBUG("rejectTrack: track "<<uid);
+	// get event context and map from cache
+	const EventContext& ctx{Gaudi::Hive::currentContext()};
+	std::lock_guard<std::mutex> lock{m_mutex};
+	ObservedTracksMap* trk_map = getTrackMap(ctx);
+	// find track and update rejection location
+	if ( trk_map->find(uid) == trk_map->end() ) {
+		// not found
+		ATH_MSG_WARNING("rejectTrack: track "<<uid<<" not found in observedTrkMap");
+	}
+	else {
+		// found
+		std::get<2>(trk_map->at(uid)) = rejectStep;
+		std::get<3>(trk_map->at(uid)) = rejectReason;
+		ATH_MSG_DEBUG("rejectTrack: track "<<uid<<" with rejection in "<<dumpRejection(rejectStep, rejectReason));
+	}
+}
+
+void Trk::TrkObserverTool::addInputTrack(int uid, const Trk::Track& track) const {
+
+	ATH_MSG_DEBUG("addInputTrack: track "<<uid);
+	// test to see if we have a new event
+	const EventContext& ctx{Gaudi::Hive::currentContext()};
+	std::lock_guard<std::mutex> lock{m_mutex};
+	CacheEntry* ent{m_cache.get(ctx)};
+	if (ent->m_evt!=ctx.evt()) {
+		// New event in this slot
+		newEvent(ent);
+		ent->m_evt = ctx.evt();
+	}
+	// add input track to cache map
+	Trk::Track* copiedTrack = new Trk::Track(track);
+	ent->m_observedTrkMap->insert( std::make_pair(uid, std::make_tuple(copiedTrack, // Id, track
+											 -1, // score
+											 xAOD::RejectionStep::solveTracks, // rejection step
+											 xAOD::RejectionReason::acceptedTrack, // rejection reason
+											 0, // unique parentId
+											 // holes/shared/split hits information (-2 means not filled yet)
+											 -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2.0f, -2.0f, -2)));
+}
+
+void Trk::TrkObserverTool::addSubTrack(int track_uid, int parent_uid, const Trk::Track& track) const {
+
+	ATH_MSG_DEBUG("addSubTrack: subtrack "<<track_uid);
+	// get event context and map from cache
+	const EventContext& ctx{Gaudi::Hive::currentContext()};
+	std::lock_guard<std::mutex> lock{m_mutex};
+	ObservedTracksMap* trk_map = getTrackMap(ctx);
+
+	// deep copy of the track (because some subtracks get deleted), information has to be available later
+	Trk::Track* copiedTrack = new Trk::Track(track);
+	// get score and rejection step from parent element
+	double score = -1;
+	xAOD::RejectionStep rejectStep = xAOD::RejectionStep::solveTracks;
+	if ( trk_map->find(parent_uid) == trk_map->end() ) {
+		// not found
+		ATH_MSG_WARNING("addSubTrack: parent " << parent_uid << " not found in observedTrkMap");
+	}
+	else {
+		// found
+		score = std::get<1>(trk_map->at(parent_uid));
+		rejectStep = std::get<2>(trk_map->at(parent_uid));
+		ATH_MSG_DEBUG("addSubTrack: track "<<track_uid<<" with parent "<<parent_uid<<", score "<<score);
+	}
+	// add subtrack to cache map
+	trk_map->insert( std::make_pair(track_uid, std::make_tuple(copiedTrack, // Id, track
+											 score, // score
+											 rejectStep, // rejection step
+											 xAOD::RejectionReason::acceptedTrack, // rejection reason
+											 parent_uid, // unique parentId
+											 // holes/shared/split hits information (-2 means not filled yet)
+											 -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2.0f, -2.0f, -2)));
+}
+
+ObservedTracksMap* Trk::TrkObserverTool::getTrackMap(const EventContext& ctx) const {
+
+	ATH_MSG_DEBUG("Get track map from cache");
+	// get cache
+	CacheEntry* ent{m_cache.get(ctx)};
+	// sanity check
+	if (ent->m_evt!=ctx.evt()) { 
+		ATH_MSG_ERROR("Different event context in getTrackMap!!");
+	}
+	return ent->m_observedTrkMap;
+}
+
+int Trk::TrkObserverTool::saveTracksToStore(const EventContext& ctx, const ObservedTracksMap* trk_map) const {
+
+	std::lock_guard<std::mutex> lock{m_mutex};
+	// Save tracks and map to store
+	ATH_MSG_INFO ("saveTracksToStore: Recording "<<trk_map->size() << " observed track candidates to event store");
+	ATH_MSG_DEBUG("\tm_savedTracksWriteKey: "<<m_savedTracksWriteKey.key());
+	ATH_MSG_DEBUG("\tm_savedTracksMapWriteKey: "<<m_savedTracksMapWriteKey.key());
+
+	SG::WriteHandle<TrackCollection> wh_tracks{m_savedTracksWriteKey, ctx};
+	SG::WriteHandle<ObservedTracksMap> wh_tracksMap{m_savedTracksMapWriteKey, ctx};
+
+	// Tracks write handle
+	StatusCode sc = wh_tracks.record(std::make_unique<TrackCollection>());
+	if (sc.isFailure()) {
+		ATH_MSG_ERROR("saveTracksToStore: Could not record input tracks: "<<m_savedTracksWriteKey.key());
+	}
+	else {
+		ATH_MSG_INFO("saveTracksToStore: Recorded empty container for input tracks to: "<<m_savedTracksWriteKey.key());
+	}
+	if (!wh_tracks.isValid()) {
+		ATH_MSG_DEBUG ("saveTracksToStore: Invalid key: "<<m_savedTracksWriteKey.key());
+	}
+	else {
+		ATH_MSG_DEBUG ("saveTracksToStore: Valid key: "<<m_savedTracksWriteKey.key());
+	}
+
+	// Tracks map write handle
+	sc = wh_tracksMap.record(std::make_unique<ObservedTracksMap>());
+	if (sc.isFailure()) {
+		ATH_MSG_ERROR("saveTracksToStore: Could not record tracks map: "<<m_savedTracksMapWriteKey.key());
+	}
+	else {
+		ATH_MSG_INFO("saveTracksToStore: Recorded empty container for tracks map to: "<<m_savedTracksMapWriteKey.key());
+	}
+	if (!wh_tracksMap.isValid()) {
+		ATH_MSG_DEBUG ("saveTracksToStore: Invalid key: "<<m_savedTracksMapWriteKey.key());
+	}
+	else {
+		ATH_MSG_DEBUG ("saveTracksToStore: Valid key: "<<m_savedTracksMapWriteKey.key());
+	}
+
+	for (auto& itrMap : *trk_map) {
+		ATH_MSG_DEBUG("saveTracksToStore: Writing track with id "<<itrMap.first<<" and rejection reason "<<std::get<3>(itrMap.second));
+		wh_tracks->push_back(std::get<0>(itrMap.second));
+		wh_tracksMap->insert(std::make_pair(itrMap.first, itrMap.second));
+	}
+
+	ATH_MSG_DEBUG("saveTracksToStore: Pushed "<<wh_tracks->size()<<" observed tracks to store");
+	ATH_MSG_DEBUG("saveTracksToStore: Pushed "<<wh_tracksMap->size()<<" pairs to track map in store");
+	// Keep track of "good" tracks as a sanity check
+	int nFinalTracks = getNFinalTracks(trk_map);
+	ATH_MSG_DEBUG ("saveTracksToStore: Number of RejectionReason = acceptedTrack (should equal final tracks): " << nFinalTracks);
+	return nFinalTracks;
+}
+
+void Trk::TrkObserverTool::updateHolesSharedHits(int uid, int numPixelHoles, int numSCTHoles, int numSplitSharedPixel, int numSplitSharedSCT,
+		int numSharedOrSplit, int numSharedOrSplitPixels, int numShared, int isPatternTrack, int totalSiHits, int inROI, int hasIBLHit,
+		int hasSharedIBLHit, int hasSharedPixel, int firstPixIsShared, int numPixelDeadSensor, int numSCTDeadSensor, int numPixelHits,
+		int numSCTHits, int numUnused, int numTRT_Unused, int numSCT_Unused, int numPseudo, float averageSplit1, float averageSplit2, int numWeightedShared) const {
+
+	ATH_MSG_DEBUG("updateHolesSharedHits: track "<<uid);
+	// get event context and map from cache
+	const EventContext& ctx{Gaudi::Hive::currentContext()};
+	std::lock_guard<std::mutex> lock{m_mutex};
+	ObservedTracksMap* trk_map = getTrackMap(ctx);
+
+	// find track and update rejection location
+	if ( trk_map->find(uid) == trk_map->end() ) {
+		// not found
+		ATH_MSG_WARNING("updateHolesSharedHits: track "<<uid<<" not found in observedTrkMap");
+	}
+	else {
+		// found
+		std::get<5>(trk_map->at(uid))  = numPixelHoles;	
+		std::get<6>(trk_map->at(uid))  = numSCTHoles;	
+		std::get<7>(trk_map->at(uid))  = numSplitSharedPixel; // Number of Pixel clusters comptaible with being split that are also shared
+		std::get<8>(trk_map->at(uid))  = numSplitSharedSCT; // Number of SCT clusters comptaible with being split that are also shared
+		std::get<9>(trk_map->at(uid))  = numSharedOrSplit; // Number of split + shared clusters
+		std::get<10>(trk_map->at(uid)) = numSharedOrSplitPixels; // Number of pixel clusters that are either split or shared
+		std::get<11>(trk_map->at(uid)) = numShared; // Number of shared hits on track
+		std::get<12>(trk_map->at(uid)) = isPatternTrack; // Pattern Track or Fitted track
+		std::get<13>(trk_map->at(uid)) = totalSiHits; // totalSiHits
+		std::get<14>(trk_map->at(uid)) = inROI;
+		std::get<15>(trk_map->at(uid)) = hasIBLHit;
+		std::get<16>(trk_map->at(uid)) = hasSharedIBLHit;
+		std::get<17>(trk_map->at(uid)) = hasSharedPixel;
+		std::get<18>(trk_map->at(uid)) = firstPixIsShared;
+		std::get<19>(trk_map->at(uid)) = numPixelDeadSensor;
+		std::get<20>(trk_map->at(uid)) = numSCTDeadSensor;
+		std::get<21>(trk_map->at(uid)) = numPixelHits;
+		std::get<22>(trk_map->at(uid)) = numSCTHits;
+		std::get<23>(trk_map->at(uid)) = numUnused;
+		std::get<24>(trk_map->at(uid)) = numTRT_Unused;
+		std::get<25>(trk_map->at(uid)) = numSCT_Unused;
+		std::get<26>(trk_map->at(uid)) = numPseudo;
+		std::get<27>(trk_map->at(uid)) = averageSplit1;
+		std::get<28>(trk_map->at(uid)) = averageSplit2;
+		std::get<29>(trk_map->at(uid)) = numWeightedShared;
+		ATH_MSG_DEBUG("updateHolesSharedHits: track "<<uid<<" with totalSiHits "<<totalSiHits);
+	}
+}
+
+void Trk::TrkObserverTool::dumpTrackMap(const ObservedTracksMap* trk_map) const {
+
+	// prints out/dumps all entries in m_observedTrkMap
+
+	std::lock_guard<std::mutex> lock{m_mutex};
+
+	ATH_MSG_INFO ("Dump observedTrkMap (size = " << getNObservedTracks(trk_map) << ")");
+	for (auto& itrMap : *trk_map) {
+		ATH_MSG_DEBUG("Id: " << itrMap.first);
+		ATH_MSG_DEBUG("\tscore:                  " << std::get<1>(itrMap.second));
+		ATH_MSG_DEBUG("\trejectStep:             " << std::get<2>(itrMap.second));
+		ATH_MSG_DEBUG("\trejectReason:           " << std::get<3>(itrMap.second));
+		ATH_MSG_DEBUG("\tparentId:               " << std::get<4>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumPixelHoles:          " << std::get<5>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumSCTHoles:            " << std::get<6>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumSplitSharedPixel:    " << std::get<7>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumSplitSharedSCT:      " << std::get<8>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumSharedOrSplit:       " << std::get<9>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumSharedOrSplitPixels: " << std::get<10>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumShared:              " << std::get<11>(itrMap.second));
+		ATH_MSG_DEBUG("\tisPatternTrack:         " << std::get<12>(itrMap.second));
+		ATH_MSG_DEBUG("\ttotalSiHits:            " << std::get<13>(itrMap.second));
+		ATH_MSG_DEBUG("\tinROI:                  " << std::get<14>(itrMap.second));
+		ATH_MSG_DEBUG("\thasIBLHit:      	     " << std::get<15>(itrMap.second));
+		ATH_MSG_DEBUG("\thasSharedIBLHit:        " << std::get<16>(itrMap.second));
+		ATH_MSG_DEBUG("\thasSharedPixel:         " << std::get<17>(itrMap.second));
+		ATH_MSG_DEBUG("\tfirstPixIsShared:       " << std::get<18>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumPixelDeadSensor:     " << std::get<19>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumSCTDeadSensor:       " << std::get<20>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumPixelHits:           " << std::get<21>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumSCTHits:             " << std::get<22>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumUnused:              " << std::get<23>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumTRT_Unused:          " << std::get<24>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumSCT_Unused:          " << std::get<25>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumPseudo:              " << std::get<26>(itrMap.second));
+		ATH_MSG_DEBUG("\taverageSplit1:          " << std::get<27>(itrMap.second));
+		ATH_MSG_DEBUG("\taverageSplit2:          " << std::get<28>(itrMap.second));
+		ATH_MSG_DEBUG("\tnumWeightedShared:      " << std::get<29>(itrMap.second));
+	}
+	ATH_MSG_DEBUG("Number of RejectionReason = acceptedTrack (should equal final tracks): " << getNFinalTracks(trk_map));
+}
+
+std::string Trk::TrkObserverTool::dumpRejection(xAOD::RejectionStep rejectStep, xAOD::RejectionReason rejectReason) const {
+	// Generate rejection description
+	std::string rejection_step = "";
+	std::string rejection_reason = "";
+	std::string rejection_description = "";
+	if ( m_rejectStep_descriptions.find(rejectStep) == m_rejectStep_descriptions.end() ) {
+		// not found
+		rejection_step = "REJECTION STEP DESCRIPTION NOT FOUND: " + std::to_string(rejectStep);
+	}
+	else {
+		// found
+		rejection_step = m_rejectStep_descriptions[rejectStep];
+	}
+	if ( m_rejectReason_descriptions.find(rejectReason) == m_rejectReason_descriptions.end() ) {
+		// not found
+		rejection_reason = "REJECTION REASON DESCRIPTION NOT FOUND: " + std::to_string(rejectReason);
+	}
+	else {
+		// found
+		rejection_reason = m_rejectReason_descriptions[rejectReason];
+	}
+	rejection_description = rejection_step + " (" + rejection_reason + ")";
+	return rejection_description;
+}
+
+int Trk::TrkObserverTool::getNFinalTracks(const ObservedTracksMap* trk_map) const {
+	// counts the tracks which did not get rejected (this number should equal finalTracks)
+	int nFinalTracks = 0;
+	for (auto& itrMap : *trk_map) {
+		if (std::get<3>(itrMap.second) == xAOD::RejectionReason::acceptedTrack) nFinalTracks++;
+	}
+	return nFinalTracks;
+}
+
+int Trk::TrkObserverTool::getNObservedTracks(const ObservedTracksMap* trk_map) const {
+	// check the number of tracks in the observer tool map
+	return trk_map->size();
+}
+
+std::map<xAOD::RejectionStep, std::string> Trk::TrkObserverTool::m_rejectStep_descriptions = {
+	{xAOD::RejectionStep::addNewTracks, "DenseEnvironmentsAmbiguityScoreProcessorTool::addNewTracks"},
+	{xAOD::RejectionStep::refitTrack, "AmbiguityProcessorBase::refitTrack"},
+	{xAOD::RejectionStep::addTrack, "AmbiguityProcessorBase::addTrack"},
+	{xAOD::RejectionStep::decideWhichHitsToKeep, "InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep"},
+	{xAOD::RejectionStep::getCleanedOutTrack, "InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack"}
+};
+
+std::map<xAOD::RejectionReason, std::string> Trk::TrkObserverTool::m_rejectReason_descriptions = {
+	{xAOD::RejectionReason::acceptedTrack, "not actually a rejection; accepted track"},
+	// Reason for rejection within DenseEnvironmentsAmbiguityProcessorTool::solveTracks
+	{xAOD::RejectionReason::stillBeingProcessed, "not actually a rejection; track still being processed"},
+	// Reason for rejection within DenseEnvironmentsAmbiguityScoreProcessorTool::addNewTracks
+	{xAOD::RejectionReason::trackScoreZero, "track score is zero"},
+	{xAOD::RejectionReason::duplicateTrack, "duplicate track"},
+	// Reason for rejection within AmbiguityProcessorBase::refitTrack
+	{xAOD::RejectionReason::subtrackCreated, "not actually a rejection; refit successful, new subtrack created"},
+	{xAOD::RejectionReason::refitFailed, "refit failed"},
+	// Reason for rejection within AmbiguityProcessorBase::addTrack
+	{xAOD::RejectionReason::bremRefitFailed, "brem refit failed"},
+	{xAOD::RejectionReason::bremRefitSubtrackCreated, "not actually a rejection; brem refit successful, new subtrack created"},
+	{xAOD::RejectionReason::bremRefitTrackScoreZero, "brem refit still gave track score zero"},
+	{xAOD::RejectionReason::refitTrackScoreZero, "refit track score 0"},
+	// Reason for rejection within decideWhichHitsToKeep
+	{xAOD::RejectionReason::TSOSRejectedHit, "TSOS of type RejectedHit"},
+	{xAOD::RejectionReason::TSOSOutlierShared, "TSOS of type Outlier and shared"},
+	{xAOD::RejectionReason::pixelSplitButTooManyShared2Ptc, "pixel split but shared between too many tracks (2 particle cluster)"},
+	{xAOD::RejectionReason::pixelSplitButTooManyShared3Ptc, "pixel split but shared between too many tracks (3+ particle cluster)"},
+	{xAOD::RejectionReason::tooManySharedRecoverable, "too many shared hits (recoverable shared hits)"},
+	{xAOD::RejectionReason::tooManySharedNonRecoverable, "too many shared hits (all other non-recoverable shared hits)"},
+	{xAOD::RejectionReason::sharedSCT, "shared SCT hits when we don't really have enough to share"},
+	{xAOD::RejectionReason::sharedHitsBadChi2, "shared hits cause a bad chi2 track"},
+	{xAOD::RejectionReason::sharedHitsNotEnoughUniqueHits, "shared hits does not leave enough unique hits on accepted track"},
+	{xAOD::RejectionReason::firstHitSharedAndPixIBL, "first hit is shared and either IBL or pixel"},
+	{xAOD::RejectionReason::firstHitSharedAndExtraShared, "track with first hit shared had additional shared hit"},
+	{xAOD::RejectionReason::sharedHitsNotEnoughUniqueSiHits, "shared hits does not leave enough Si hits on accepted track"},
+	{xAOD::RejectionReason::sharedIBLSharedWithNoIBLTrack, "shared IBL hit is shared with accepted track that does not have an IBL hit"},
+	{xAOD::RejectionReason::sharedPixelSharedWithDifferentIBLTrack, "shared pixel hit is shared with accepted track that has different IBL hit content"},
+	{xAOD::RejectionReason::tooManySharedAfterIncreasingShared, "too many shared hits after increasing shared hits"},
+	// Reason for rejection within getCleanedOutTrack
+	{xAOD::RejectionReason::notEnoughSiHits, "not enough Si hits"},
+	{xAOD::RejectionReason::notEnoughTRTHits, "not enough TRT hits"},
+	{xAOD::RejectionReason::notEnoughUniqueSiHits, "not enough unique Si hits"},
+	{xAOD::RejectionReason::tooFewHits, "too few hits, reject track with shared hits"},
+	{xAOD::RejectionReason::failedSubtrackCreation, "failed to create subtrack"},
+	{xAOD::RejectionReason::subtrackCreatedWithRecoveredShared, "created subtrack with recovered shared hits"},
+	{xAOD::RejectionReason::other, "other"}
+};
\ No newline at end of file
diff --git a/Tracking/TrkValidation/TrkValTools/src/components/TrkValTools_entries.cxx b/Tracking/TrkValidation/TrkValTools/src/components/TrkValTools_entries.cxx
index af00c6e50a02..76565e7e2022 100644
--- a/Tracking/TrkValidation/TrkValTools/src/components/TrkValTools_entries.cxx
+++ b/Tracking/TrkValidation/TrkValTools/src/components/TrkValTools_entries.cxx
@@ -20,6 +20,7 @@
 #include "TrkValTools/GenParticleJetFinder.h"
 #include "TrkValTools/EventPropertyNtupleTool.h"
 #include "TrkValTools/EventToTrackLinkNtupleTool.h"
+#include "TrkValTools/TrkObserverTool.h"
 
 DECLARE_COMPONENT( Trk::BasicValTrkParticleNtupleTool )
 DECLARE_COMPONENT( Trk::TrackInformationNtupleTool )
@@ -43,4 +44,4 @@ DECLARE_COMPONENT( Trk::GenParticleJetFinder )
 DECLARE_COMPONENT( Trk::JetTruthNtupleTool )
 DECLARE_COMPONENT( Trk::EventPropertyNtupleTool )
 DECLARE_COMPONENT( Trk::EventToTrackLinkNtupleTool )
-
+DECLARE_COMPONENT( Trk::TrkObserverTool )
diff --git a/Trigger/TrigEvent/TrigBSExtraction/CMakeLists.txt b/Trigger/TrigEvent/TrigBSExtraction/CMakeLists.txt
index c5c982f2b3e0..215df71eb4df 100644
--- a/Trigger/TrigEvent/TrigBSExtraction/CMakeLists.txt
+++ b/Trigger/TrigEvent/TrigBSExtraction/CMakeLists.txt
@@ -7,7 +7,7 @@ atlas_subdir( TrigBSExtraction )
 atlas_add_component( TrigBSExtraction
                      src/*.cxx
                      src/components/*.cxx
-                     LINK_LIBRARIES AthenaBaseComps CaloEvent GaudiKernel JetEvent Particle TrigCaloEvent TrigInDetEvent TrigMissingEtEvent TrigMuonEvent TrigNavigationLib TrigNavStructure TrigParticle TrigSerializeCnvSvcLib TrigSteeringEvent TrigStorageDefinitions TrkTrack egammaEvent tauEvent xAODBTagging xAODBTaggingCnvLib xAODCaloEvent xAODCaloEventCnvLib xAODEgamma xAODEgammaCnvLib xAODJet xAODJetCnvLib xAODMuon xAODTau xAODTauCnvLib xAODTracking xAODTrackingCnvLib xAODTrigBphys xAODTrigBphysCnvLib xAODTrigCalo xAODTrigCaloCnvLib xAODTrigMinBias xAODTrigMinBiasCnvLib xAODTrigMissingET xAODTrigMissingETCnvLib xAODTrigMuon xAODTrigMuonCnvLib xAODTrigger xAODTriggerCnvLib )
+                     LINK_LIBRARIES AthenaBaseComps CaloEvent GaudiKernel JetEvent Particle TrigCaloEvent TrigInDetEvent TrigMissingEtEvent TrigMuonEvent TrigNavigationLib TrigNavStructure TrigParticle TrigSerializeCnvSvcLib TrigSteeringEvent TrigStorageDefinitions TrkTrack egammaEvent tauEvent xAODBTagging xAODBTaggingCnvLib xAODCaloEvent xAODCaloEventCnvLib xAODEgamma xAODEgammaCnvLib xAODJet xAODJetCnvLib xAODMuon xAODTau xAODTauCnvLib xAODTracking xAODTrackingCnvLib xAODTrigBphys xAODTrigBphysCnvLib xAODTrigCalo xAODTrigCaloCnvLib xAODTrigMinBias xAODTrigMinBiasCnvLib xAODTrigMissingET xAODTrigMissingETCnvLib xAODTrigMuon xAODTrigMuonCnvLib xAODTrigger xAODTriggerCnvLib TrkValInterfaces )
 
 # Install files from the package:
 atlas_install_joboptions( share/*.py )
-- 
GitLab


From b62d6c710f90bb63e7aa0296af6ac25c315c62b5 Mon Sep 17 00:00:00 2001
From: Steven Schramm <steven.schramm@cern.ch>
Date: Thu, 23 Sep 2021 15:03:09 +0200
Subject: [PATCH 282/347] Switching TCC algorithm to use DetectorEta in r22

---
 .../TrackParticleClusterAssociationAlg.cxx    | 36 +++++++++++++++++--
 .../src/TrackParticleClusterAssociationAlg.h  |  6 ++++
 .../python/TrackCaloClusterConfig.py          | 11 +++---
 3 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.cxx b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.cxx
index c506ebdd1b00..c6e04a617a67 100644
--- a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.cxx
+++ b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.cxx
@@ -4,6 +4,7 @@
 
 #include "TrackParticleClusterAssociationAlg.h"
 
+#include "StoreGate/ReadDecorHandle.h"
 #include "StoreGate/WriteDecorHandle.h"
 
 #include "FourMomUtils/P4Helpers.h"
@@ -12,14 +13,23 @@
 
 
 TrackParticleClusterAssociationAlg::TrackParticleClusterAssociationAlg(const std::string& name, ISvcLocator* pSvcLocator):
-  AthAlgorithm(name,pSvcLocator) {  }
+  AthAlgorithm(name,pSvcLocator), m_doDetEta{false} {  }
 
 StatusCode TrackParticleClusterAssociationAlg::initialize()
 {
 
+  if (m_detectorEtaDecor.key().empty())
+      m_doDetEta = false;
+  else
+  {
+      m_doDetEta = true;
+      m_detectorEtaDecor = m_caloClusters.key() + "." + m_detectorEtaDecor.key();
+  }
+  
   ATH_CHECK( m_caloExtKey.initialize() );
   ATH_CHECK( m_trackParticleCollectionHandle.initialize() );
   ATH_CHECK( m_caloClusters.initialize() );
+  ATH_CHECK( m_detectorEtaDecor.initialize(m_doDetEta) );
   ATH_CHECK( m_assocClustersDecor.initialize() );
 
   ATH_CHECK(m_caloEntryParsDecor.initialize( !m_caloEntryParsDecor.empty() ) );
@@ -51,7 +61,17 @@ StatusCode TrackParticleClusterAssociationAlg::execute()
     cl->retrieveMoment(xAOD::CaloCluster::SECOND_R,rad);
     double cent;
     cl->retrieveMoment(xAOD::CaloCluster::CENTER_MAG,cent);
-    double sigmaWidth = atan(sqrt(rad)/cent)*cosh(cl->eta());
+    
+    float cl_eta {99};
+    if (m_doDetEta)
+    {
+        SG::ReadDecorHandle<xAOD::CaloClusterContainer, float> detEta(m_detectorEtaDecor);
+        cl_eta = detEta(*cl);
+    }
+    else
+        cl_eta = cl->eta();
+    
+    double sigmaWidth = atan(sqrt(rad)/cent)*cosh(cl_eta);
     sig_dec(*cl) = sigmaWidth;
   }
 
@@ -151,7 +171,17 @@ std::vector<const xAOD::CaloCluster* > TrackParticleClusterAssociationAlg::assoc
   for(const xAOD::CaloCluster * cl : allClusters){
 
     float dPhi = P4Helpers::deltaPhi( cl->phi(), phi);
-    float dEta = cl->eta()-eta;
+    
+    float cl_eta {99};
+    if (m_doDetEta)
+    {
+        SG::ReadDecorHandle<xAOD::CaloClusterContainer, float> detEta(m_detectorEtaDecor);
+        cl_eta = detEta(*cl);
+    }
+    else
+        cl_eta = cl->eta();
+
+    float dEta = cl_eta - eta;
     float dr2  = dPhi*dPhi+ dEta*dEta;
     float dr2Cut = dr2Cut0;
     
diff --git a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.h b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.h
index 8399686db448..c18c73350dcd 100644
--- a/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.h
+++ b/Reconstruction/RecoAlgs/TrackParticleAssociationAlgs/src/TrackParticleClusterAssociationAlg.h
@@ -8,6 +8,7 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/ReadDecorHandleKey.h"
 #include "StoreGate/WriteHandleKey.h"
 #include "StoreGate/WriteDecorHandleKey.h"
 
@@ -60,6 +61,11 @@ class TrackParticleClusterAssociationAlg : public AthAlgorithm
   SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackParticleCollectionHandle {this,"TrackParticleContainerName",  "InDetTrackParticles", "input tracks" };
   SG::ReadHandleKey<xAOD::CaloClusterContainer> m_caloClusters {this, "CaloClusterLocation", "CaloCalTopoClusters","input calo clusters"};
 
+  // Whether or not to use the DetectorEta attribute of the clusters, which is important if the input cluster container has had the origin correction applied
+  // Default assumes no origin correction, must be configured if desired
+  SG::ReadDecorHandleKey<xAOD::CaloClusterContainer> m_detectorEtaDecor { this, "DetectorEtaName", "", "Decoration for CaloCluster DetectorEta" };
+  bool m_doDetEta;
+
   // vertex handling
   SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContHandle {this, "VertexContainerName", "", "if empty all tracks will be decorated. if not only those corresponding to the PV[0] will."};
   ToolHandle<CP::ITrackVertexAssociationTool> m_trackvertexassoTool {this, "TrackVertexAssoTool", "" };
diff --git a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/python/TrackCaloClusterConfig.py b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/python/TrackCaloClusterConfig.py
index b8f7dc7a3dcd..789b1e06f1d8 100644
--- a/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/python/TrackCaloClusterConfig.py
+++ b/Reconstruction/TrackCaloClusterRec/TrackCaloClusterRecTools/python/TrackCaloClusterConfig.py
@@ -104,7 +104,7 @@ def getDecorationKeyFunc(trackParticleName, assocPostfix):
     """Simple helper returning a function to build decoration keys """
     return lambda d : trackParticleName+'.'+d+assocPostfix
 
-def setupTrackCaloAssoc(configFlags, caloClusterName="CaloCalTopoClusters",trackParticleName="InDetTrackParticles", assocPostfix = "TCC", onlyPV0Tracks=False):
+def setupTrackCaloAssoc(configFlags, caloClusterName="CaloCalTopoClusters",detectorEtaName="default",trackParticleName="InDetTrackParticles", assocPostfix = "TCC", onlyPV0Tracks=False):
     """ Schedule a TrackParticleClusterAssociationAlg in the top sequence, taking as input clusters and tracks defined 
     by the keys caloClusterName and trackParticleName.
 
@@ -133,6 +133,7 @@ def setupTrackCaloAssoc(configFlags, caloClusterName="CaloCalTopoClusters",track
         PtCut = 400.,
         CaloExtensionName = "ParticleCaloExtension",
         CaloClusterLocation = caloClusterName,
+        DetectorEtaName = detectorEtaName if detectorEtaName.lower() != "default" else ("DetectorEta" if "Origin" in caloClusterName else ""),
         TrackVertexAssoTool=setupTrackVertexAssocTool(), # will associate trks from PV0 only
         VertexContainerName = "PrimaryVertices" if onlyPV0Tracks else "",
         AssociatedClusterDecorKey = decorKey("AssoClusters"),
@@ -144,7 +145,7 @@ def setupTrackCaloAssoc(configFlags, caloClusterName="CaloCalTopoClusters",track
     return components
 
     
-def runTCCReconstruction(configFlags, caloClusterName="CaloCalTopoClusters",trackParticleName="InDetTrackParticles",
+def runTCCReconstruction(configFlags, caloClusterName="CaloCalTopoClusters", detectorEtaName = "default", trackParticleName="InDetTrackParticles",
                          assocPostfix="TCC", doCombined=False, doNeutral=True, doCharged=False, outputTCCName="TrackCaloClusters"):
     """Create a TrackCaloCluster collection from clusters and tracks (caloClusterName and trackParticleName). 
     Depending on options, the collection contains combined, neutral and/or charged TCC.
@@ -161,7 +162,7 @@ def runTCCReconstruction(configFlags, caloClusterName="CaloCalTopoClusters",trac
     components = ComponentAccumulator()    
     
     components.merge(
-        setupTrackCaloAssoc(configFlags, caloClusterName, trackParticleName, assocPostfix, onlyPV0Tracks=False)
+        setupTrackCaloAssoc(configFlags, caloClusterName, detectorEtaName, trackParticleName, assocPostfix, onlyPV0Tracks=False)
     )
 
     
@@ -242,7 +243,7 @@ def runTCCReconstruction(configFlags, caloClusterName="CaloCalTopoClusters",trac
     return components
 
 
-def runUFOReconstruction( constits, configFlags, caloClusterName="CaloCalTopoClusters", trackParticleName="InDetTrackParticles",
+def runUFOReconstruction( constits, configFlags, caloClusterName="CaloCalTopoClusters", detectorEtaName = "default", trackParticleName="InDetTrackParticles",
                          assocPostfix="TCC", ):
     """Create a TrackCaloCluster collection from PFlow and tracks (PFO retrieved from PFOPrefix and tracks directly from trackParticleName). 
     This functions schedules 2 UFO specific algs : 
@@ -258,7 +259,7 @@ def runUFOReconstruction( constits, configFlags, caloClusterName="CaloCalTopoClu
     
     
     components.merge(
-        setupTrackCaloAssoc(configFlags, caloClusterName, trackParticleName, assocPostfix, onlyPV0Tracks=True)
+        setupTrackCaloAssoc(configFlags, caloClusterName, detectorEtaName, trackParticleName, assocPostfix, onlyPV0Tracks=True)
     )
 
         
-- 
GitLab


From 53afaf4aa339a6c4b2baddb5c29cbdcffd2eae09 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Thu, 23 Sep 2021 15:05:47 +0200
Subject: [PATCH 283/347] Fix a leak in TileHitVecToCntTool

---
 .../TileSimAlgs/TileHitVecToCntTool.h         | 14 ++++----
 .../TileSimAlgs/src/TileHitVecToCntTool.cxx   | 35 +++++++++----------
 2 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h
index ad0ad6516da3..7a0b5d1e6a76 100644
--- a/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.h
+++ b/TileCalorimeter/TileSimAlgs/TileSimAlgs/TileHitVecToCntTool.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
 */
 
 //**************************************************************************
@@ -32,6 +32,7 @@
 #include "TileIdentifier/TileFragHash.h"
 #include "TileSimEvent/TileHitVector.h"
 #include "TileEvent/TileHitContainer.h"
+#include "TileEvent/TileHitNonConstContainer.h"
 #include "TileConditions/TileCablingSvc.h"
 
 // Athena includes
@@ -53,7 +54,6 @@ class TileID;
 class TileTBID;
 class TileHit;
 class TileInfo;
-class TileHitNonConstContainer;
 class TileDetDescrManager;
 class Identifier;
 class TileCablingService;
@@ -96,10 +96,10 @@ private:
   StatusCode createContainers();
   void processHitVectorForOverlay(const TileHitVector* inputHits, int& nHit, double& eHitTot);
   void processHitVectorForPileUp(const TileHitVector* inputHits, double SubEvtTimOffset, int& nHit, double& eHitTot, bool isSignal = false);
-  void processHitVectorWithoutPileUp(const TileHitVector* inputHits, int& nHit, double& eHitTot, TileHitNonConstContainer* &hitCont, CLHEP::HepRandomEngine * engine);
+  void processHitVectorWithoutPileUp(const TileHitVector* inputHits, int& nHit, double& eHitTot, TileHitNonConstContainer* hitCont, CLHEP::HepRandomEngine * engine);
   double applyPhotoStatistics(double energy, Identifier pmt_id, CLHEP::HepRandomEngine * engine);    //!< Method to apply photostatistics effect
-  void findAndMergeE1(TileHitCollection* coll, int frag_id, TileHitNonConstContainer* &hitCont);
-  void findAndMergeMBTS(TileHitCollection* coll, int frag_id, TileHitNonConstContainer* &hitCont);
+  void findAndMergeE1(TileHitCollection* coll, int frag_id, TileHitNonConstContainer* hitCont);
+  void findAndMergeMBTS(TileHitCollection* coll, int frag_id, TileHitNonConstContainer* hitCont);
 
 
   Gaudi::Property<bool> m_onlyUseContainerName{this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};
@@ -156,8 +156,8 @@ private:
 
   std::vector<TileHit*> m_allHits;           //!< vector for all TileHits
   std::vector<TileHit*> m_allHits_DigiHSTruth;           //!< vector for all TileHits
-  TileHitNonConstContainer* m_hits{};          //!< pointer to hits container
-  TileHitNonConstContainer* m_hits_DigiHSTruth{};   //!< pointer to hits container
+  std::unique_ptr<TileHitNonConstContainer> m_hits{};          //!< pointer to hits container
+  std::unique_ptr<TileHitNonConstContainer> m_hits_DigiHSTruth{};   //!< pointer to hits container
 
   int m_mbtsOffset{0};                           //<! index of first MBTS hit in m_allHits vector
   static const int N_SIDE = 2;
diff --git a/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx b/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx
index b1be9fd12c45..791ccd4c65ea 100644
--- a/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx
+++ b/TileCalorimeter/TileSimAlgs/src/TileHitVecToCntTool.cxx
@@ -12,7 +12,6 @@
 #include "TileSimAlgs/TileHitVecToCntTool.h"
 #include "TileIdentifier/TileHWID.h"
 #include "TileDetDescr/TileDetDescrManager.h"
-#include "TileEvent/TileHitNonConstContainer.h"
 #include "TileConditions/TileInfo.h"
 #include "TileConditions/TileCablingService.h"
 
@@ -284,7 +283,7 @@ StatusCode TileHitVecToCntTool::createContainers() {
   ATH_MSG_VERBOSE("TileHitVecToCntTool createContainers started");
 
   if (m_pileUp) {
-    m_hits = new TileHitNonConstContainer(SG::VIEW_ELEMENTS);
+    m_hits = std::make_unique<TileHitNonConstContainer>(SG::VIEW_ELEMENTS);
     std::vector<TileHit *>::iterator iHit = m_allHits.begin();
     std::vector<TileHit *>::iterator lastHit = m_allHits.end();
     for (; iHit != lastHit; ++iHit) {
@@ -293,7 +292,7 @@ StatusCode TileHitVecToCntTool::createContainers() {
     }
 
     if(m_doDigiTruth){
-      m_hits_DigiHSTruth = new TileHitNonConstContainer(SG::OWN_ELEMENTS);
+      m_hits_DigiHSTruth = std::make_unique<TileHitNonConstContainer>(SG::OWN_ELEMENTS);
       iHit = m_allHits_DigiHSTruth.begin();
       lastHit = m_allHits_DigiHSTruth.end();
       for (; iHit != lastHit; ++iHit) {
@@ -304,8 +303,8 @@ StatusCode TileHitVecToCntTool::createContainers() {
       }
     }
   } else {
-    m_hits = new TileHitNonConstContainer(SG::OWN_ELEMENTS);
-    if(m_doDigiTruth) m_hits_DigiHSTruth = new TileHitNonConstContainer(SG::OWN_ELEMENTS);
+    m_hits = std::make_unique<TileHitNonConstContainer>(SG::OWN_ELEMENTS);
+    if(m_doDigiTruth) m_hits_DigiHSTruth = std::make_unique<TileHitNonConstContainer>(SG::OWN_ELEMENTS);
 
   }
 
@@ -505,7 +504,7 @@ void TileHitVecToCntTool::processHitVectorForPileUp(const TileHitVector* inputHi
   return;
 }
 
-void TileHitVecToCntTool::processHitVectorWithoutPileUp(const TileHitVector* inputHits, int& nHit, double& eHitTot, TileHitNonConstContainer* &hitCont, CLHEP::HepRandomEngine * engine) {
+void TileHitVecToCntTool::processHitVectorWithoutPileUp(const TileHitVector* inputHits, int& nHit, double& eHitTot, TileHitNonConstContainer* hitCont, CLHEP::HepRandomEngine * engine) {
 
   TileHitVecConstIterator inpItr = inputHits->begin();
   TileHitVecConstIterator end = inputHits->end();
@@ -757,8 +756,8 @@ StatusCode TileHitVecToCntTool::processBunchXing(int bunchXing
 	  ATH_MSG_ERROR(" Tile Hit container not found for event key " << hitVectorName);
 	}
 
-	this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits, engine);
-        if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits_DigiHSTruth, engine);
+	this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits.get(), engine);
+        if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits_DigiHSTruth.get(), engine);
       } // to pile-up or not
 
     } // end of the loop over different input hitVectorNames (normal hits and MBTS hits)
@@ -798,7 +797,7 @@ StatusCode TileHitVecToCntTool::processAllSubEvents(const EventContext& ctx) {
       // get HitVector for this subevent
       ATH_MSG_DEBUG(" New HitCont.  TimeOffset=" << SubEvtTimeOffset << ", size =" << inputHits->size());
       this->processHitVectorForOverlay(inputHits.cptr(), nHit, eHitTot);
-      if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits.cptr(), nHit, eHitTot, m_hits_DigiHSTruth, engine);
+      if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits.cptr(), nHit, eHitTot, m_hits_DigiHSTruth.get(), engine);
     }
     ATH_CHECK(this->mergeEvent(ctx));
     return StatusCode::SUCCESS;
@@ -829,7 +828,7 @@ StatusCode TileHitVecToCntTool::processAllSubEvents(const EventContext& ctx) {
             const TileHitVector* inputHits = &(*(iCont->second));
             ATH_MSG_DEBUG(" New HitCont.  TimeOffset=" << SubEvtTimeOffset << ", size =" << inputHits->size());
             this->processHitVectorForOverlay(inputHits, nHit, eHitTot);
-            if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits_DigiHSTruth, engine);
+            if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits, nHit, eHitTot, m_hits_DigiHSTruth.get(), engine);
           }
         }
       } else if (m_pileUp) {  // pileup code
@@ -855,8 +854,8 @@ StatusCode TileHitVecToCntTool::processAllSubEvents(const EventContext& ctx) {
         ATH_MSG_WARNING("Hit Vector "<< hitVectorName << " not found in StoreGate");
         continue; // continue to the next hit vector
       }
-      this->processHitVectorWithoutPileUp(inputHits.cptr(), nHit, eHitTot, m_hits, engine);
-      if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits.cptr(), nHit, eHitTot, m_hits_DigiHSTruth, engine);
+      this->processHitVectorWithoutPileUp(inputHits.cptr(), nHit, eHitTot, m_hits.get(), engine);
+      if(m_doDigiTruth) this->processHitVectorWithoutPileUp(inputHits.cptr(), nHit, eHitTot, m_hits_DigiHSTruth.get(), engine);
     }
 
   } // end of the loop over different input hitVectorNames (normal hits and MBTS hits)
@@ -910,8 +909,8 @@ StatusCode TileHitVecToCntTool::mergeEvent(const EventContext& ctx) {
       int frag_id = coll->identify();
       IdentifierHash frag_hash = m_fragHashFunc(frag_id);
       if (m_E1merged[frag_hash])
-        findAndMergeE1(coll.get(), frag_id, m_hits);
-      else if (m_MBTSmerged[frag_hash]) findAndMergeMBTS(coll.get(), frag_id, m_hits);
+        findAndMergeE1(coll.get(), frag_id, m_hits.get());
+      else if (m_MBTSmerged[frag_hash]) findAndMergeMBTS(coll.get(), frag_id, m_hits.get());
     }
     if(m_doDigiTruth){
       TileHitNonConstContainer::iterator collIt = m_hits_DigiHSTruth->begin();
@@ -920,8 +919,8 @@ StatusCode TileHitVecToCntTool::mergeEvent(const EventContext& ctx) {
       for (; collIt != endcollIt; ++collIt) {
         int frag_id = (*collIt)->identify();
         IdentifierHash frag_hash = m_fragHashFunc(frag_id);
-        if (m_E1merged[frag_hash]) findAndMergeE1((*collIt).get(), frag_id, m_hits_DigiHSTruth);
-        else if (m_MBTSmerged[frag_hash]) findAndMergeMBTS((*collIt).get(), frag_id, m_hits_DigiHSTruth);
+        if (m_E1merged[frag_hash]) findAndMergeE1((*collIt).get(), frag_id, m_hits_DigiHSTruth.get());
+        else if (m_MBTSmerged[frag_hash]) findAndMergeMBTS((*collIt).get(), frag_id, m_hits_DigiHSTruth.get());
       }
     }
   }
@@ -1115,7 +1114,7 @@ double TileHitVecToCntTool::applyPhotoStatistics(double energy, Identifier pmt_i
 }
 
 
-void TileHitVecToCntTool::findAndMergeE1(TileHitCollection* coll, int frag_id, TileHitNonConstContainer* &hitCont) {
+void TileHitVecToCntTool::findAndMergeE1(TileHitCollection* coll, int frag_id, TileHitNonConstContainer* hitCont) {
   int module = frag_id & 0x3F;
 
   TileHitCollection::iterator hitIt = coll->begin();
@@ -1168,7 +1167,7 @@ void TileHitVecToCntTool::findAndMergeE1(TileHitCollection* coll, int frag_id, T
 }
 
 
-void TileHitVecToCntTool::findAndMergeMBTS(TileHitCollection* coll, int frag_id, TileHitNonConstContainer* &hitCont) {
+void TileHitVecToCntTool::findAndMergeMBTS(TileHitCollection* coll, int frag_id, TileHitNonConstContainer* hitCont) {
   int module = frag_id & 0x3F;
 
   TileHitCollection::iterator hitIt = coll->begin();
-- 
GitLab


From de27033116bef02509997ae8dc824790b0dc3016 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Thu, 23 Sep 2021 15:08:36 +0200
Subject: [PATCH 284/347] Fix a minor leak in TRT_SimDriftTimeTool

---
 .../TRT_Digitization/src/TRT_SimDriftTimeTool.cxx      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRT_SimDriftTimeTool.cxx b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRT_SimDriftTimeTool.cxx
index 2be2a6b43401..aaa065071a23 100644
--- a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRT_SimDriftTimeTool.cxx
+++ b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRT_SimDriftTimeTool.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
 */
 
 ////////////////////////////////////
@@ -71,10 +71,10 @@ StatusCode TRT_SimDriftTimeTool::initialize()
   /////////////////////////////////////////////////////
   /////////////////////////////////////////////////////
 
-  std::vector<ITRT_DriftTimeData*> pDTData;
-  pDTData.push_back(new TRT_BarrelDriftTimeData(m_digversion,0)); // Xe straws
-  pDTData.push_back(new TRT_BarrelDriftTimeData(m_digversion,1)); // Kr straws
-  pDTData.push_back(new TRT_BarrelDriftTimeData(m_digversion,2)); // Ar straws
+  std::vector<std::unique_ptr<ITRT_DriftTimeData>> pDTData;
+  pDTData.emplace_back(std::make_unique<TRT_BarrelDriftTimeData>(m_digversion,0)); // Xe straws
+  pDTData.emplace_back(std::make_unique<TRT_BarrelDriftTimeData>(m_digversion,1)); // Kr straws
+  pDTData.emplace_back(std::make_unique<TRT_BarrelDriftTimeData>(m_digversion,2)); // Ar straws
 
   /////////////////////////////////////////////////////
   /////////////////////////////////////////////////////
-- 
GitLab


From 1932cd7dd01f95348ffdf87a63bf2db7a7c3a662 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Thu, 23 Sep 2021 15:15:07 +0200
Subject: [PATCH 285/347] Fix a leak in FEI4SimTool

---
 .../PixelDigitization/src/FEI3SimTool.cxx         |  8 ++------
 .../PixelDigitization/src/FEI4SimTool.cxx         | 15 +++++++--------
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx
index 6a262f6a4489..2f243f410ee0 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx
@@ -178,9 +178,7 @@ void FEI3SimTool::process(SiChargedDiodeCollection& chargedDiodes, PixelRDO_Coll
 
     // Front-End simulation
     if (bunch >= 0 && bunch < moduleData->getNumberOfBCID(barrel_ec, layerIndex)) {
-      Pixel1RawData* p_rdo = new Pixel1RawData(id_readout, nToT, bunch, 0, bunch);
-      rdoCollection.push_back(p_rdo);
-      p_rdo = nullptr;
+      rdoCollection.push_back(new Pixel1RawData(id_readout, nToT, bunch, 0, bunch));
     }
 
     // Duplication mechanism for FEI3 small hits :
@@ -191,9 +189,7 @@ void FEI3SimTool::process(SiChargedDiodeCollection& chargedDiodes, PixelRDO_Coll
       }
 
       if (smallHitChk && bunch > 0 && bunch <= moduleData->getNumberOfBCID(barrel_ec, layerIndex)) {
-        Pixel1RawData* p_rdo = new Pixel1RawData(id_readout, nToT, bunch - 1, 0, bunch - 1);
-        rdoCollection.push_back(p_rdo);
-        p_rdo = nullptr;
+        rdoCollection.push_back(new Pixel1RawData(id_readout, nToT, bunch - 1, 0, bunch - 1));
       }
     }
   }
diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx
index 1cc63919f226..616f5803e324 100644
--- a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx
+++ b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx
@@ -48,7 +48,7 @@ void FEI4SimTool::process(SiChargedDiodeCollection& chargedDiodes, PixelRDO_Coll
   int maxFEI4SmallHit = 2;
   int overflowToT = moduleData->getFEI4OverflowToT(barrel_ec, layerIndex);
 
-  std::vector<Pixel1RawData*> p_rdo_small_fei4;
+  std::vector<std::unique_ptr<Pixel1RawData>> p_rdo_small_fei4;
   int nSmallHitsFEI4 = 0;
   std::vector<int> row, col;
   const int maxRow = p_design->rowsPerCircuit();
@@ -169,18 +169,17 @@ void FEI4SimTool::process(SiChargedDiodeCollection& chargedDiodes, PixelRDO_Coll
 
     // Front-End simulation
     if (bunch >= 0 && bunch < moduleData->getNumberOfBCID(barrel_ec, layerIndex)) {
-      Pixel1RawData* p_rdo = new Pixel1RawData(id_readout, nToT, bunch, 0, bunch);
+      auto p_rdo = std::make_unique<Pixel1RawData>(id_readout, nToT, bunch, 0, bunch);
       if (nToT > maxFEI4SmallHit) {
-        rdoCollection.push_back(p_rdo);
+        rdoCollection.push_back(p_rdo.release());
         FEI4Map[iirow][iicol] = 2; //Flag for "big hits"
       } else {
-        p_rdo_small_fei4.push_back(p_rdo);
+        p_rdo_small_fei4.push_back(std::move(p_rdo));
         row.push_back(iirow);
         col.push_back(iicol);
         FEI4Map[iirow][iicol] = 1; //Flag for low hits
         nSmallHitsFEI4++;
       }
-      p_rdo = nullptr;
     }
   }
 
@@ -198,7 +197,7 @@ void FEI4SimTool::process(SiChargedDiodeCollection& chargedDiodes, PixelRDO_Coll
             "rowBig = " << rowBigHit << " colBig = " << colBigHit << " Map Content = " <<
               FEI4Map[rowBigHit][colBigHit]);
           if (FEI4Map[rowBigHit][colBigHit] == 2 && !recorded) {
-            rdoCollection.push_back(p_rdo_small_fei4[ismall]);
+            rdoCollection.push_back(p_rdo_small_fei4[ismall].release());
             recorded = true;
           }
         }
@@ -207,13 +206,13 @@ void FEI4SimTool::process(SiChargedDiodeCollection& chargedDiodes, PixelRDO_Coll
       // Second case: Record small hits which are phi-neighbours with a big hit:
       if (!recorded && row[ismall] < maxRow - 1) {
         if (FEI4Map[row[ismall] + 1][col[ismall]] == 2) {
-          rdoCollection.push_back(p_rdo_small_fei4[ismall]);
+          rdoCollection.push_back(p_rdo_small_fei4[ismall].release());
           recorded = true;
         }
       }
       if (!recorded && row[ismall] != 0) {
         if (FEI4Map[row[ismall] - 1][col[ismall]] == 2) {
-          rdoCollection.push_back(p_rdo_small_fei4[ismall]);
+          rdoCollection.push_back(p_rdo_small_fei4[ismall].release());
           recorded = true;
         }
       }
-- 
GitLab


From 4c1f7f15ffd2587ee705f9ce00b9cb831df9fa00 Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Thu, 23 Sep 2021 15:17:43 +0200
Subject: [PATCH 286/347] CA-base configuration of LAr Ramp Run processing

---
 .../python/LArCalibConfigFlags.py             |   4 +-
 .../python/LArCalib_BadChannelConfig.py       |   2 +-
 .../python/LArCalib_RampConfig.py             | 169 ++++++++++++++++++
 .../python/LArStripsXtalkCorrConfig.py        |   4 +-
 .../LArRecUtils/src/LArOFPeakRecoTool.cxx     |   2 +-
 5 files changed, 177 insertions(+), 4 deletions(-)
 create mode 100644 LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RampConfig.py

diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
index 8ae18a2b8194..c937da2da63f 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
@@ -4,7 +4,7 @@ def addLArCalibFlags(flags):
     
     flags.Input.isMC=False
     flags.addFlag("LArCalib.isSC",False)
-    flags.addFlag("LArCalib.BadChannelDB","COOLOFL_LAR/COMP200")
+    flags.addFlag("LArCalib.BadChannelDB","COOLOFL_LAR")
     flags.addFlag("LArCalib.BadChannelTag","-UPD3-00")
 
     #Folders:
@@ -36,6 +36,8 @@ def addLArCalibFlags(flags):
 
     flags.addFlag("LArCalib.doValidation",True)
 
+    flags.addFlag("LArCalib.CorrectBadChannels",True)
+
     #Flags to find the input files/databases
     flags.addFlag("LArCalib.Input.Dir",".")
     flags.addFlag("LArCalib.Input.RunNumbers",[])
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_BadChannelConfig.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_BadChannelConfig.py
index 00fe13e1fb79..6f02910eea57 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_BadChannelConfig.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_BadChannelConfig.py
@@ -15,7 +15,7 @@ def LArCalibBadChannelCfg(flags):
     foldername="/LAR/BadChannelsOfl/BadChannels"
     foldertag="".join(foldername.split("/"))+flags.LArCalib.BadChannelTag
 
-    result.merge(addFolders(flags,foldername+"<tag>"+foldertag+"</tag><db>"+flags.LArCalib.BadChannelDB+"</db>",
+    result.merge(addFolders(flags,foldername+"<tag>"+foldertag+"</tag>",flags.LArCalib.BadChannelDB,
                             className="CondAttrListCollection"))
 
     theLArBadChannelCondAlgo=LArBadChannelCondAlg(ReadKey=foldername)
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RampConfig.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RampConfig.py
new file mode 100644
index 000000000000..456b9e5c6eb9
--- /dev/null
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RampConfig.py
@@ -0,0 +1,169 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentFactory import CompFactory 
+from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+
+def LArRampCfg(flags):
+
+    #Get basic services and cond-algos
+    from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg
+    result=LArCalibBaseCfg(flags)
+
+    #Calibration runs are taken in fixed gain. 
+    #The SG key of the digit-container is name of the gain
+    gainStrMap={0:"HIGH",1:"MEDIUM",2:"LOW"}
+    digKey=gainStrMap[flags.LArCalib.Gain]
+
+    from LArCalibProcessing.utils import FolderTagResolver
+    FolderTagResolver._globalTag=flags.LArCalib.GlobalTag
+    tagResolver=FolderTagResolver()
+    pedestalTag=tagResolver.getFolderTag(flags.LArCalib.Pedestal.Folder)
+    caliOFCTag=tagResolver.getFolderTag(flags.LArCalib.OFCCali.Folder)
+
+    rampTag=tagResolver.getFolderTag(flags.LArCalib.Ramp.Folder)
+    del tagResolver
+    
+    print("pedestalTag",pedestalTag)
+    print("rampTag",rampTag)
+
+
+    from IOVDbSvc.IOVDbSvcConfig import addFolders
+    result.merge(addFolders(flags,flags.LArCalib.Pedestal.Folder,detDb=flags.LArCalib.Input.Database, tag=pedestalTag, className="LArPedestalComplete"))
+    result.merge(addFolders(flags,flags.LArCalib.OFCCali.Folder,detDb=flags.LArCalib.Input.Database, tag=caliOFCTag))
+    
+
+    result.addEventAlgo(CompFactory.LArRawCalibDataReadingAlg(LArAccCalibDigitKey=digKey,
+                                                              LArFebHeaderKey="LArFebHeader",
+                                                              PosNegPreselection=flags.LArCalib.Preselection.Side,
+                                                              BEPreselection=flags.LArCalib.Preselection.BEC,
+                                                              FTNumPreselection=flags.LArCalib.Preselection.FT))
+    
+    from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
+    result.merge(LArFebErrorSummaryMakerCfg(flags))
+    result.getEventAlgo("LArFebErrorSummaryMaker").CheckAllFEB=False
+
+
+    if flags.LArCalib.Input.SubDet == "EM":
+        from LArCalibProcessing.LArStripsXtalkCorrConfig import LArStripsXtalkCorrCfg
+        result.merge(LArStripsXtalkCorrCfg(flags,[digKey,]))
+    
+    
+        theLArCalibShortCorrector = CompFactory.LArCalibShortCorrector(KeyList = [digKey,])
+        result.addEventAlgo(theLArCalibShortCorrector)
+
+
+
+
+    theLArRampBuilder = CompFactory.LArRampBuilder()
+    theLArRampBuilder.KeyList      = [digKey,]
+    theLArRampBuilder.SubtractDac0 = False
+    theLArRampBuilder.ProblemsToMask=["deadCalib","deadReadout","deadPhys","almostDead","short"]
+
+    theLArRampBuilder.RecoType = "OF"
+    theLArRampBuilder.PeakOFTool=CompFactory.LArOFPeakRecoTool(UseShape = False,OutputLevel=2)
+
+    theLArRampBuilder.DAC0         = 4294967294
+    theLArRampBuilder.StoreRawRamp = True
+    theLArRampBuilder.StoreRecRamp = True
+    theLArRampBuilder.Polynom      = 1    
+    theLArRampBuilder.RampRange    = 3600 # Check on the raw data ADC sample before ped subtraction and pulse reconstruction to include point in fit
+    theLArRampBuilder.correctBias  = False
+    theLArRampBuilder.ConsecutiveADCs = 0
+    theLArRampBuilder.minDAC = 10      # minimum DAC value to use in fit
+    theLArRampBuilder.KeyOutput = "LArRamp"
+    theLArRampBuilder.DeadChannelCut = -9999
+    theLArRampBuilder.GroupingType = flags.LArCalib.GroupingType
+    theLArRampBuilder.LongNtuple = False
+
+    theLArRampBuilder.isSC = flags.LArCalib.isSC
+
+    if flags.LArCalib.Input.SubDet == "HEC":
+        theLArRampBuilder.isHEC = flags.LArCalib.SubDet=="HEC"
+        theLArRampBuilder.HECKey = "LArHEC_PAmap"
+   
+    
+    result.addEventAlgo(theLArRampBuilder)
+
+
+    # Bad-channel patching 
+    if flags.LArCalib.CorrectBadChannels:
+        LArRampPatcher=CompFactory.getComp("LArCalibPatchingAlg<LArRampComplete>")
+        theLArRampPatcher=LArRampPatcher("LArRampPatcher")
+        theLArRampPatcher.ContainerKey="LArRamp"
+        theLArRampPatcher.PatchMethod="PhiAverage"
+   
+        theLArRampPatcher.ProblemsToPatch=["deadCalib","deadReadout","deadPhys","almostDead","short"]
+        theLArRampPatcher.UseCorrChannels=False      
+        result.addEventAlgo(theLArRampPatcher)
+
+
+
+
+    #ROOT ntuple writing:
+    rootfile=flags.LArCalib.Output.ROOTFile
+    if rootfile != "":
+        result.addEventAlgo(CompFactory.LArRamps2Ntuple(ContainerKey = ["LArRamp"+digKey], #for RawRamp
+                                                        AddFEBTempInfo = False,
+                                                        RawRamp = True,
+                                                        SaveAllSamples =  True,
+                                                    ))
+
+        import os
+        if os.path.exists(rootfile):
+            os.remove(rootfile)
+        result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
+        result.setAppProperty("HistogramPersistency","ROOT")
+        pass # end if ROOT ntuple writing
+
+
+
+
+    #Output (POOL + sqlite) file writing:
+    from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
+    result.merge(OutputConditionsAlgCfg(flags,
+                                        outputFile=flags.LArCalib.Output.POOLFile,
+                                        ObjectList=["LArRampComplete#LArRamp#"+flags.LArCalib.Ramp.Folder,],
+                                        IOVTagList=[rampTag,]
+                                    ))
+
+    #RegistrationSvc    
+    result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False))
+
+
+    result.getService("IOVDbSvc").DBInstance=""
+
+    return result
+
+
+if __name__ == "__main__":
+
+
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from LArCalibProcessing.LArCalibConfigFlags import addLArCalibFlags
+    addLArCalibFlags(ConfigFlags)
+
+
+    ConfigFlags.LArCalib.Input.Dir = "/scratch/wlampl/calib21/Sept10"
+    ConfigFlags.LArCalib.Input.Type="calibration_LArElec-Ramp"
+    ConfigFlags.LArCalib.Input.RunNumbers=[401351,]
+    ConfigFlags.LArCalib.Input.Database="db.sqlite"
+    ConfigFlags.LArCalib.Input.SubDet="EM"
+    ConfigFlags.Input.Files=ConfigFlags.LArCalib.Input.Files
+    ConfigFlags.LArCalib.Preselection.BEC=[1]
+    ConfigFlags.LArCalib.Preselection.Side=[0]
+    ConfigFlags.LArCalib.BadChannelDB="/afs/cern.ch/user/l/larcalib/w0/data/WorkingDirectory/00401338_00401349_00401351_EndCap-EMB-EMEC_HIGH_40_21.0.20_1/poolFiles/SnapshotBadChannel_00401338_00401349_00401351_EB-EMECA.db"
+    ConfigFlags.LArCalib.BadChannelTag="-RUN2-UPD3-00"
+    ConfigFlags.LArCalib.Output.ROOTFile="larramp.root"
+
+    ConfigFlags.IOVDb.DBConnection="sqlite://;schema=output.sqlite;dbname=CONDDBR2"
+    ConfigFlags.IOVDb.GlobalTag="LARCALIB-RUN2-02"
+    #ConfigFlags.Exec.OutputLevel=1
+    print ("Input files to be processed:")
+    for f in ConfigFlags.Input.Files:
+        print (f)
+
+    cfg=MainServicesCfg(ConfigFlags)
+    cfg.merge(LArRampCfg(ConfigFlags))
+
+    print("Start running...")
+    cfg.run()
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArStripsXtalkCorrConfig.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArStripsXtalkCorrConfig.py
index 147c3c68edf2..1b9907884800 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArStripsXtalkCorrConfig.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArStripsXtalkCorrConfig.py
@@ -14,7 +14,9 @@ def LArStripsXtalkCorrCfg(flags,KeyList):
     theLArStripsCrossTalkCorrector.KeyList = KeyList
     theLArStripsCrossTalkCorrector.ADCsaturation = 4095
     theLArStripsCrossTalkCorrector.NoXtalkCorr=["deadReadout","deadPhys","deadCalib","almostDead"]
-    theLArStripsCrossTalkCorrector.DontUseForXtalkCorr=["short","peculiarCalibrationLine", "deadReadout", "deadPhys"]
+    #Note: The old-style config for ramp runs does not include 'deadPhys' in the DontUseForXtalkCorr list, 
+    #      while the old-style calib of delay runs does contain it. I assueme a mistake in the old config
+    theLArStripsCrossTalkCorrector.DontUseForXtalkCorr=["short","peculiarCalibrationLine", "deadReadout", "deadPhys"] 
     theLArStripsCrossTalkCorrector.AcceptableDifference=25.0 #in per-cent
     #theLArStripsCrossTalkCorrector.PedestalKey="LArPedestal"
     result.addEventAlgo(theLArStripsCrossTalkCorrector)
diff --git a/LArCalorimeter/LArRecUtils/src/LArOFPeakRecoTool.cxx b/LArCalorimeter/LArRecUtils/src/LArOFPeakRecoTool.cxx
index fa475919b67f..fdccbf203673 100644
--- a/LArCalorimeter/LArRecUtils/src/LArOFPeakRecoTool.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArOFPeakRecoTool.cxx
@@ -181,7 +181,7 @@ LArOFIterResults LArOFPeakRecoTool::peak(const std::vector<float>& samples, // r
 
   //some sanity check on the OFCs
   if ( ofcSize == 0 || this_OFC_b.size() == 0 ) {
-    ATH_MSG_DEBUG("OFC not found for channel " << m_lar_on_id->channel_name(chID));
+    ATH_MSG_DEBUG("OFC not found for channel " << m_lar_on_id->channel_name(chID) << ", gain=" << usedGain << ", delayIdx=" << delayIdx);
     return result;
   }
 
-- 
GitLab


From 13554c9d057d00b3569b6e8e474ef4a1e7edbb5b Mon Sep 17 00:00:00 2001
From: Cecilia Tosciri <cecilia.tosciri@cern.ch>
Date: Thu, 23 Sep 2021 15:23:26 +0200
Subject: [PATCH 287/347] Modify the gFEX Sim and SysSim Tools to save TOBs in
 different output containers

---
 .../L1CaloFEXSim/L1CaloFEXSim/gFEXDriver.h    |   3 +-
 .../L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h       |  17 ++-
 .../L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h    |  40 ++++-
 .../L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx |   6 +-
 .../L1CaloFEXSim/src/gFEXJwoJAlgo.cxx         |   1 -
 .../L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx    |  40 +++--
 .../L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx | 137 ++++++++++++++++--
 .../L1CaloFEXToolInterfaces/IgFEXSim.h        |  10 +-
 .../L1CaloFEXToolInterfaces/IgFEXSysSim.h     |  10 +-
 9 files changed, 223 insertions(+), 41 deletions(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXDriver.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXDriver.h
index cfce43f895aa..e6f0c861e616 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXDriver.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXDriver.h
@@ -19,6 +19,7 @@
 #include "CaloIdentifier/CaloCell_SuperCell_ID.h"
 #include "L1CaloFEXSim/gFEXOutputCollection.h"
 #include "xAODTrigger/gFexJetRoIContainer.h"
+#include "xAODTrigger/gFexGlobalRoIContainer.h"
 
 class CaloIdManager;
 
@@ -46,8 +47,6 @@ class gFEXDriver : public AthAlgorithm
   //Declare that gFEXDriver class will read an object of type CaloCellContainer, xAOD::gFexJetRoIContainer, xAOD::gFexGlobalRoIContainer
   SG::ReadHandleKey<CaloCellContainer> m_scellsCollectionSGKey {this, "SCell", "SCell", "SCell"};
 
-  SG::ReadHandleKey<xAOD::gFexJetRoIContainer> m_gJetEDMKey {this, "gJetEDM", "L1_gJetRoI", "Reading container of gFEXJetRoIs"};
-
   ToolHandle<IgTowerBuilder> m_gTowerBuilderTool {this, "gTowerBuilderTool", "LVL1::gTowerBuilder", "Tool that builds gTowers for simulation"};
   ToolHandle<IgSuperCellTowerMapper> m_gSuperCellTowerMapperTool {this, "gSuperCellTowerMapperTool", "LVL1::gSuperCellTowerMapper", "Tool that maps supercells to gTowers"};
   ToolHandle<IgFEXSysSim> m_gFEXSysSimTool {this, "gFEXSysSimTool", "LVL1::gFEXSysSim", "Tool that creates the gFEX System Simulation"};
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h
index d778ba6b9826..39be69e1513e 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSim.h
@@ -55,7 +55,14 @@ namespace LVL1 {
 
     virtual std::vector<uint32_t> getgJetTOBs() const override;
 
-    virtual std::vector<uint32_t> getgGlobalTOBs() const override;
+    virtual std::vector<uint32_t> getgScalarEJwojTOBs() const override;
+ 
+    virtual std::vector<uint32_t> getgMETComponentsJwojTOBs() const override;
+
+    virtual std::vector<uint32_t> getgMHTComponentsJwojTOBs() const override;
+
+    virtual std::vector<uint32_t> getgMSTComponentsJwojTOBs() const override;
+
 
     /** Internal data */
   private:
@@ -70,7 +77,13 @@ namespace LVL1 {
 
     std::vector<uint32_t>  m_gJetTobWords;
 
-    std::vector<uint32_t>  m_gGlobalTobWords;
+    std::vector<uint32_t>  m_gScalarEJwojTobWords;
+
+    std::vector<uint32_t>  m_gMETComponentsJwojTobWords;
+
+    std::vector<uint32_t>  m_gMHTComponentsJwojTobWords;
+
+    std::vector<uint32_t>  m_gMSTComponentsJwojTobWords;
 
 
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h
index 4be59907783a..c208026ccb32 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/gFEXSysSim.h
@@ -60,7 +60,14 @@ namespace LVL1 {
 
     virtual StatusCode fillgJetEDM(uint32_t tobWord) override ;
 
-    virtual StatusCode fillgGlobalEDM(uint32_t tobWord) override ;
+    virtual StatusCode fillgScalarEJwojEDM(uint32_t tobWord) override ;
+
+    virtual StatusCode fillgMETComponentsJwojEDM(uint32_t tobWord) override ;
+
+    virtual StatusCode fillgMHTComponentsJwojEDM(uint32_t tobWord) override ;
+
+    virtual StatusCode fillgMSTComponentsJwojEDM(uint32_t tobWord) override ;
+
 
     /** Internal data */
   private:
@@ -73,8 +80,17 @@ namespace LVL1 {
     std::unique_ptr< xAOD::gFexJetRoIContainer > m_gJetContainer;
     std::unique_ptr< xAOD::gFexJetRoIAuxContainer > m_gJetAuxContainer;
 
-    std::unique_ptr< xAOD::gFexGlobalRoIContainer > m_gGlobalContainer;
-    std::unique_ptr< xAOD::gFexGlobalRoIAuxContainer > m_gGlobalAuxContainer;
+    std::unique_ptr< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojContainer;
+    std::unique_ptr< xAOD::gFexGlobalRoIAuxContainer > m_gScalarEJwojAuxContainer;
+
+    std::unique_ptr< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojContainer;
+    std::unique_ptr< xAOD::gFexGlobalRoIAuxContainer > m_gMETComponentsJwojAuxContainer;
+
+    std::unique_ptr< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojContainer;
+    std::unique_ptr< xAOD::gFexGlobalRoIAuxContainer > m_gMHTComponentsJwojAuxContainer;
+
+    std::unique_ptr< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojContainer;
+    std::unique_ptr< xAOD::gFexGlobalRoIAuxContainer > m_gMSTComponentsJwojAuxContainer;
 
 
     std::vector<gFEXSim*> m_gFEXCollection;
@@ -84,13 +100,25 @@ namespace LVL1 {
     SG::ReadHandleKey<LVL1::gTowerContainer> m_gTowerContainerSGKey {this, "MyGTowers", "gTowerContainer", "Input container for gTowers"};
     SG::ReadHandleKey<CaloCellContainer> m_scellsCollectionSGKey {this, "SCell", "SCell", "SCell"};
 
-    SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetOutKey {this,"Key_gFexJetOutputContainer","L1_gJetRoI","Output gFexJet container"};
-    SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gFexGlobalOutKey {this,"Key_gFexGlobalOutputContainer","L1_gJetRoI","Output gFexGlobal container"};
+    SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoOutKey {this,"Key_gFexRhoOutputContainer","L1_gFexRhoRoI","Output gFexRho (energy density) container"};
+    SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockOutKey {this,"Key_gFexSRJetOutputContainer","L1_gFexSRJetRoI","Output gFexBlock (small-R jet) container"};
+    SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetOutKey {this,"Key_gFexLRJetOutputContainer","L1_gFexLRJetRoI","Output gFexJet (large-R jet) container"};
+    
+    SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojOutKey {this,"Key_gScalarEJwojOutputContainer","L1_gScalarEJwoj","Output Scalar MET and SumET (from Jets without Jets algo) container"};
+    SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojOutKey {this,"Key_gMETComponentsJwojOutputContainer","L1_gMETComponentsJwoj","Output total MET components (from Jets without Jets algo) container"};
+    SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojOutKey {this,"Key_gMHTComponentsJwojOutputContainer","L1_gMHTComponentsJwoj","Output hard MET components (from Jets without Jets algo) container"};
+    SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojOutKey {this,"Key_gMSTComponentsJwojOutputContainer","L1_gMSTComponentsJwoj","Output soft MET components (from Jets without Jets algo) container"};
+
+
 
     std::vector<uint32_t>  m_allgRhoTobs;
     std::vector<uint32_t>  m_allgBlockTobs;
     std::vector<uint32_t>  m_allgJetTobs;
-    std::vector<uint32_t>  m_allgGlobalTobs;
+
+    std::vector<uint32_t>  m_allgScalarEJwojTobs;
+    std::vector<uint32_t>  m_allgMETComponentsJwojTobs;
+    std::vector<uint32_t>  m_allgMHTComponentsJwojTobs;
+    std::vector<uint32_t>  m_allgMSTComponentsJwojTobs;
 
   };
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx
index bee5625655ad..e677fc31ee0d 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXDriver.cxx
@@ -19,6 +19,9 @@
 #include "xAODTrigger/gFexJetRoI.h"
 #include "xAODTrigger/gFexJetRoIContainer.h"
 
+#include "xAODTrigger/gFexGlobalRoI.h"
+#include "xAODTrigger/gFexGlobalRoIContainer.h"
+
 #include <cassert>
 #include "SGTools/TestStore.h"
 
@@ -62,9 +65,6 @@ StatusCode gFEXDriver::initialize()
 
   ATH_CHECK( m_gTowerContainerSGKey.initialize() );
 
-  ATH_CHECK( m_gJetEDMKey.initialize() );
-
-  ATH_CHECK( m_gFEXOutputCollectionSGKey.initialize() );
 
   return StatusCode::SUCCESS;
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx
index 5fc418980c68..7dccdf7bc2b3 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXJwoJAlgo.cxx
@@ -8,7 +8,6 @@
 //     email                : cecilia.tosciri@cern.ch
 //***************************************************************************
 
-#define _USE_MATH_DEFINES
 #include <cmath>
 #include <vector>
 
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
index 38013afcae06..5cafff7bf6b7 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSim.cxx
@@ -48,6 +48,7 @@ namespace LVL1 {
    StatusCode gFEXSim::initialize(){
       ATH_CHECK( m_gFEXFPGA_Tool.retrieve() );
       ATH_CHECK( m_gFEXJetAlgoTool.retrieve() );
+      ATH_CHECK( m_gFEXJwoJAlgoTool.retrieve() );
       return StatusCode::SUCCESS;
    }
 
@@ -157,7 +158,7 @@ StatusCode gFEXSim::executegFEXSim(gTowersIDs tmp_gTowersIDs_subset){
    std::array<uint32_t, 7> BTOB1_dat = {0};
    std::array<uint32_t, 7> BTOB2_dat = {0};
 
-   // Retrieve the gFEXJetAlgoTool
+   // Use the gFEXJetAlgoTool
 
    // Pass the energy matrices to the algo tool, and run the algorithms
    auto tobs_v = m_gFEXJetAlgoTool->largeRfinder(Atwr, Btwr, CNtwr, CPtwr,
@@ -190,8 +191,7 @@ StatusCode gFEXSim::executegFEXSim(gTowersIDs tmp_gTowersIDs_subset){
    m_gJetTobWords[3] = BTOB2_dat[3];//leading gJet in FPGA B, eta bins (6--11)
 
 
-   // Retrieve the gFEXJetAlgoTool
-   ATH_CHECK( m_gFEXJwoJAlgoTool.retrieve() );
+   // Use the gFEXJetAlgoTool
    std::array<uint32_t, 4> outTOB = {0};
 
    m_gFEXJwoJAlgoTool->setAlgoConstant(FEXAlgoSpaceDefs::aFPGA_A, FEXAlgoSpaceDefs::bFPGA_A,
@@ -200,13 +200,17 @@ StatusCode gFEXSim::executegFEXSim(gTowersIDs tmp_gTowersIDs_subset){
 
    auto global_tobs = m_gFEXJwoJAlgoTool->jwojAlgo(Atwr, Btwr, outTOB);
 
-   m_gGlobalTobWords.resize(4);
+   m_gScalarEJwojTobWords.resize(1);
+   m_gMETComponentsJwojTobWords.resize(1);
+   m_gMHTComponentsJwojTobWords.resize(1);
+   m_gMSTComponentsJwojTobWords.resize(1);
+
 
    //Placing the global TOBs into a dedicated array
-   m_gGlobalTobWords[0] = outTOB[0];//
-   m_gGlobalTobWords[1] = outTOB[1];//
-   m_gGlobalTobWords[2] = outTOB[2];//
-   m_gGlobalTobWords[3] = outTOB[3];//
+   m_gScalarEJwojTobWords[0] = outTOB[0];//
+   m_gMETComponentsJwojTobWords[0] = outTOB[1];//
+   m_gMHTComponentsJwojTobWords[0] = outTOB[2];//
+   m_gMSTComponentsJwojTobWords[0] = outTOB[3];//
 
    gFEXOutputCollection* gFEXOutputs;
    ATH_CHECK(evtStore()->retrieve(gFEXOutputs, "gFEXOutputCollection"));
@@ -255,10 +259,26 @@ std::vector<uint32_t> gFEXSim::getgJetTOBs() const
   return m_gJetTobWords;
 }
 
-std::vector<uint32_t> gFEXSim::getgGlobalTOBs() const
+std::vector<uint32_t> gFEXSim::getgScalarEJwojTOBs() const
+{
+  return m_gScalarEJwojTobWords;
+}
+
+std::vector<uint32_t> gFEXSim::getgMETComponentsJwojTOBs() const
 {
-  return m_gGlobalTobWords;
+  return m_gMETComponentsJwojTobWords;
 }
 
+std::vector<uint32_t> gFEXSim::getgMHTComponentsJwojTOBs() const
+{
+  return m_gMHTComponentsJwojTobWords;
+}
+
+std::vector<uint32_t> gFEXSim::getgMSTComponentsJwojTOBs() const
+{
+  return m_gMSTComponentsJwojTobWords;
+}
+
+
 
 } // end of namespace bracket
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
index 40728c9fe851..e6b4e9d67ae1 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/gFEXSysSim.cxx
@@ -42,8 +42,22 @@ namespace LVL1 {
 
       ATH_CHECK( m_gFEXSimTool.retrieve() );
 
+      ATH_CHECK(m_gFexRhoOutKey.initialize()); 
+
+      ATH_CHECK(m_gFexBlockOutKey.initialize());      
+
       ATH_CHECK(m_gFexJetOutKey.initialize());
 
+      ATH_CHECK(m_gScalarEJwojOutKey.initialize());
+
+      ATH_CHECK(m_gMETComponentsJwojOutKey.initialize());
+
+      ATH_CHECK(m_gMHTComponentsJwojOutKey.initialize());
+      
+      ATH_CHECK(m_gMSTComponentsJwojOutKey.initialize());
+
+   
+
       return StatusCode::SUCCESS;
    }
 
@@ -65,7 +79,7 @@ namespace LVL1 {
 
    StatusCode gFEXSysSim::execute()   {
 
-      SG::ReadHandle<LVL1::gTowerContainer> this_gTowerContainer(m_gTowerContainerSGKey/*,ctx*/);
+      SG::ReadHandle<LVL1::gTowerContainer> this_gTowerContainer(m_gTowerContainerSGKey);
       if(!this_gTowerContainer.isValid()){
          ATH_MSG_FATAL("Could not retrieve gTowerContainer " << m_gTowerContainerSGKey.key());
          return StatusCode::FAILURE;
@@ -75,7 +89,10 @@ namespace LVL1 {
       m_allgRhoTobs.clear();
       m_allgBlockTobs.clear();
       m_allgJetTobs.clear();
-      m_allgGlobalTobs.clear();
+      m_allgScalarEJwojTobs.clear();
+      m_allgMETComponentsJwojTobs.clear();
+      m_allgMHTComponentsJwojTobs.clear();
+      m_allgMSTComponentsJwojTobs.clear();
 
 
       // int centralNphi = 32;
@@ -205,13 +222,19 @@ namespace LVL1 {
       }
 
       ATH_CHECK(m_gFEXSimTool->executegFEXSim(tmp_gTowersIDs_subset));
+      
       m_allgRhoTobs = m_gFEXSimTool->getgRhoTOBs();
       m_allgBlockTobs = m_gFEXSimTool->getgBlockTOBs();
       m_allgJetTobs = m_gFEXSimTool->getgJetTOBs();
-      m_allgGlobalTobs = m_gFEXSimTool->getgGlobalTOBs();
-      m_gFEXSimTool->reset();
+       
+      m_allgScalarEJwojTobs = m_gFEXSimTool->getgScalarEJwojTOBs();
+      m_allgMETComponentsJwojTobs = m_gFEXSimTool->getgMETComponentsJwojTOBs();
+      m_allgMHTComponentsJwojTobs = m_gFEXSimTool->getgMHTComponentsJwojTOBs();
+      m_allgMSTComponentsJwojTobs = m_gFEXSimTool->getgMSTComponentsJwojTOBs();
 
+      m_gFEXSimTool->reset();
 
+      //Makes containers for different gFEX Jet objects
       m_gRhoContainer = std::make_unique<xAOD::gFexJetRoIContainer> ();
       m_gRhoAuxContainer = std::make_unique<xAOD::gFexJetRoIAuxContainer> ();
       m_gRhoContainer->setStore(m_gRhoAuxContainer.get());
@@ -224,9 +247,24 @@ namespace LVL1 {
       m_gJetAuxContainer = std::make_unique<xAOD::gFexJetRoIAuxContainer> ();
       m_gJetContainer->setStore(m_gJetAuxContainer.get());
 
-      m_gGlobalContainer = std::make_unique<xAOD::gFexGlobalRoIContainer> ();
-      m_gGlobalAuxContainer = std::make_unique<xAOD::gFexGlobalRoIAuxContainer> ();
-      m_gGlobalContainer->setStore(m_gGlobalAuxContainer.get());
+      //Makes containers for different gFEX Global objects
+      m_gScalarEJwojContainer = std::make_unique<xAOD::gFexGlobalRoIContainer> ();
+      m_gScalarEJwojAuxContainer = std::make_unique<xAOD::gFexGlobalRoIAuxContainer> ();
+      m_gScalarEJwojContainer->setStore(m_gScalarEJwojAuxContainer.get());
+
+      m_gMETComponentsJwojContainer = std::make_unique<xAOD::gFexGlobalRoIContainer> ();
+      m_gMETComponentsJwojAuxContainer = std::make_unique<xAOD::gFexGlobalRoIAuxContainer> ();
+      m_gMETComponentsJwojContainer->setStore(m_gMETComponentsJwojAuxContainer.get());
+
+      m_gMHTComponentsJwojContainer = std::make_unique<xAOD::gFexGlobalRoIContainer> ();
+      m_gMHTComponentsJwojAuxContainer = std::make_unique<xAOD::gFexGlobalRoIAuxContainer> ();
+      m_gMHTComponentsJwojContainer->setStore(m_gMHTComponentsJwojAuxContainer.get());
+
+      m_gMSTComponentsJwojContainer = std::make_unique<xAOD::gFexGlobalRoIContainer> ();
+      m_gMSTComponentsJwojAuxContainer = std::make_unique<xAOD::gFexGlobalRoIAuxContainer> ();
+      m_gMSTComponentsJwojContainer->setStore(m_gMSTComponentsJwojAuxContainer.get());
+
+      
 
       //iterate over all gRho Tobs and fill EDM with them
       for(auto &tob : m_allgRhoTobs){
@@ -241,16 +279,59 @@ namespace LVL1 {
       for(auto &tob : m_allgJetTobs){
          ATH_CHECK(fillgJetEDM(tob));
       }
-      //iterate over all Global Tobs and fill EDM with them
-      for(auto &tob : m_allgGlobalTobs){
-         ATH_CHECK(fillgGlobalEDM(tob));
+
+
+      //iterate over all JwoJ scalar energy Tobs and fill EDM with them (should be only one)
+      for(auto &tob : m_allgScalarEJwojTobs){
+         ATH_CHECK(fillgScalarEJwojEDM(tob));
+      }
+      //iterate over all JwoJ METcomponents Tobs and fill EDM with them (should be only one)
+      for(auto &tob : m_allgMETComponentsJwojTobs){
+         ATH_CHECK(fillgMETComponentsJwojEDM(tob));
       }
+      //iterate over all JwoJ MHTcomponents Tobs and fill EDM with them (should be only one)
+      for(auto &tob : m_allgMHTComponentsJwojTobs){
+         ATH_CHECK(fillgMHTComponentsJwojEDM(tob));
+      }
+      //iterate over all JwoJ MSTcomponents Tobs and fill EDM with them (should be only one)
+      for(auto &tob : m_allgMSTComponentsJwojTobs){
+         ATH_CHECK(fillgMSTComponentsJwojEDM(tob));
+      }
+
+      
 
-      SG::WriteHandle<xAOD::gFexJetRoIContainer> outputgFexJetHandle(m_gFexJetOutKey/*, ctx*/);
+
+
+      SG::WriteHandle<xAOD::gFexJetRoIContainer> outputgFexRhoHandle(m_gFexRhoOutKey);
+      ATH_MSG_DEBUG("   write: " << outputgFexRhoHandle.key() << " = " << "..." );
+      ATH_CHECK(outputgFexRhoHandle.record(std::move(m_gRhoContainer),std::move(m_gRhoAuxContainer)));
+
+      SG::WriteHandle<xAOD::gFexJetRoIContainer> outputgFexBlockHandle(m_gFexBlockOutKey);
+      ATH_MSG_DEBUG("   write: " << outputgFexBlockHandle.key() << " = " << "..." );
+      ATH_CHECK(outputgFexBlockHandle.record(std::move(m_gBlockContainer),std::move(m_gBlockAuxContainer)));
+
+      SG::WriteHandle<xAOD::gFexJetRoIContainer> outputgFexJetHandle(m_gFexJetOutKey);
       ATH_MSG_DEBUG("   write: " << outputgFexJetHandle.key() << " = " << "..." );
       ATH_CHECK(outputgFexJetHandle.record(std::move(m_gJetContainer),std::move(m_gJetAuxContainer)));
 
-       return StatusCode::SUCCESS;
+
+      SG::WriteHandle<xAOD::gFexGlobalRoIContainer> outputgScalarEJwojHandle(m_gScalarEJwojOutKey);
+      ATH_MSG_DEBUG("   write: " << outputgScalarEJwojHandle.key() << " = " << "..." );
+      ATH_CHECK(outputgScalarEJwojHandle.record(std::move(m_gScalarEJwojContainer),std::move(m_gScalarEJwojAuxContainer)));
+
+      SG::WriteHandle<xAOD::gFexGlobalRoIContainer> outputgMETComponentsJwojHandle(m_gMETComponentsJwojOutKey);
+      ATH_MSG_DEBUG("   write: " << outputgMETComponentsJwojHandle.key() << " = " << "..." );
+      ATH_CHECK(outputgMETComponentsJwojHandle.record(std::move(m_gMETComponentsJwojContainer),std::move(m_gMETComponentsJwojAuxContainer)));
+
+      SG::WriteHandle<xAOD::gFexGlobalRoIContainer> outputgMHTComponentsJwojHandle(m_gMHTComponentsJwojOutKey);
+      ATH_MSG_DEBUG("   write: " << outputgMHTComponentsJwojHandle.key() << " = " << "..." );
+      ATH_CHECK(outputgMHTComponentsJwojHandle.record(std::move(m_gMHTComponentsJwojContainer),std::move(m_gMHTComponentsJwojAuxContainer)));
+
+      SG::WriteHandle<xAOD::gFexGlobalRoIContainer> outputgMSTComponentsJwojHandle(m_gMSTComponentsJwojOutKey);
+      ATH_MSG_DEBUG("   write: " << outputgMSTComponentsJwojHandle.key() << " = " << "..." );
+      ATH_CHECK(outputgMSTComponentsJwojHandle.record(std::move(m_gMSTComponentsJwojContainer),std::move(m_gMSTComponentsJwojAuxContainer)));
+
+      return StatusCode::SUCCESS;
    }
 
    StatusCode gFEXSysSim::fillgRhoEDM(uint32_t tobWord){
@@ -280,14 +361,40 @@ namespace LVL1 {
       return StatusCode::SUCCESS;
    }
 
-   StatusCode gFEXSysSim::fillgGlobalEDM(uint32_t tobWord){
+   StatusCode gFEXSysSim::fillgMETComponentsJwojEDM(uint32_t tobWord){
+
+      std::unique_ptr<xAOD::gFexGlobalRoI> myEDM (new xAOD::gFexGlobalRoI());
+      m_gMETComponentsJwojContainer->push_back(std::move(myEDM));
+      m_gMETComponentsJwojContainer->back()->initialize(tobWord);
+
+      return StatusCode::SUCCESS;
+   }
+
+   StatusCode gFEXSysSim::fillgMHTComponentsJwojEDM(uint32_t tobWord){
 
       std::unique_ptr<xAOD::gFexGlobalRoI> myEDM (new xAOD::gFexGlobalRoI());
-      m_gGlobalContainer->push_back(std::move(myEDM));
-      m_gGlobalContainer->back()->initialize(tobWord);
+      m_gMHTComponentsJwojContainer->push_back(std::move(myEDM));
+      m_gMHTComponentsJwojContainer->back()->initialize(tobWord);
 
       return StatusCode::SUCCESS;
    }
 
+   StatusCode gFEXSysSim::fillgMSTComponentsJwojEDM(uint32_t tobWord){
+
+      std::unique_ptr<xAOD::gFexGlobalRoI> myEDM (new xAOD::gFexGlobalRoI());
+      m_gMSTComponentsJwojContainer->push_back(std::move(myEDM));
+      m_gMSTComponentsJwojContainer->back()->initialize(tobWord);
+
+      return StatusCode::SUCCESS;
+   }
+
+   StatusCode gFEXSysSim::fillgScalarEJwojEDM(uint32_t tobWord){
+
+      std::unique_ptr<xAOD::gFexGlobalRoI> myEDM (new xAOD::gFexGlobalRoI());
+      m_gScalarEJwojContainer->push_back(std::move(myEDM));
+      m_gScalarEJwojContainer->back()->initialize(tobWord);
+
+      return StatusCode::SUCCESS;
+   }
 
 } // end of namespace bracket
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSim.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSim.h
index 38c70ed13c27..2d59d33c3e90 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSim.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSim.h
@@ -36,7 +36,15 @@ Interface definition for gFEXSim
 
     virtual std::vector<uint32_t> getgJetTOBs() const =0;
 
-    virtual std::vector<uint32_t> getgGlobalTOBs() const =0;
+    virtual std::vector<uint32_t> getgScalarEJwojTOBs() const =0;
+ 
+    virtual std::vector<uint32_t> getgMETComponentsJwojTOBs() const =0;
+
+    virtual std::vector<uint32_t> getgMHTComponentsJwojTOBs() const =0;
+
+    virtual std::vector<uint32_t> getgMSTComponentsJwojTOBs() const =0;
+
+
 
   private:
 
diff --git a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSysSim.h b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSysSim.h
index 24c9469abd6e..4d23327accd7 100644
--- a/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSysSim.h
+++ b/Trigger/TrigT1/L1CaloFEXToolInterfaces/L1CaloFEXToolInterfaces/IgFEXSysSim.h
@@ -33,7 +33,15 @@ Interface definition for gFEXSysSim
 
     virtual StatusCode fillgJetEDM(uint32_t tobWord) = 0;
 
-    virtual StatusCode fillgGlobalEDM(uint32_t tobWord) = 0;
+    virtual StatusCode fillgScalarEJwojEDM(uint32_t tobWord) = 0;
+
+    virtual StatusCode fillgMETComponentsJwojEDM(uint32_t tobWord) = 0;
+
+    virtual StatusCode fillgMHTComponentsJwojEDM(uint32_t tobWord) = 0;
+
+    virtual StatusCode fillgMSTComponentsJwojEDM(uint32_t tobWord) = 0;
+
+
 
   private:
 
-- 
GitLab


From 2d7e4d432c4853f40e6d77c561abac310b0bca1f Mon Sep 17 00:00:00 2001
From: Peter Van Gemmeren <peter.van.gemmeren@cern.ch>
Date: Thu, 23 Sep 2021 15:25:07 +0200
Subject: [PATCH 288/347] Adding two new attributes for specifying basket size
 maximum and minimum.

---
 .../APR/RootStorageSvc/src/RootDatabase.cpp   | 78 +++++++++++++++----
 .../APR/RootStorageSvc/src/RootDatabase.h     |  4 +
 2 files changed, 67 insertions(+), 15 deletions(-)

diff --git a/Database/APR/RootStorageSvc/src/RootDatabase.cpp b/Database/APR/RootStorageSvc/src/RootDatabase.cpp
index e70034f4c391..3695957c4ebe 100644
--- a/Database/APR/RootStorageSvc/src/RootDatabase.cpp
+++ b/Database/APR/RootStorageSvc/src/RootDatabase.cpp
@@ -29,8 +29,8 @@
 #include "TFile.h"
 #include "TFileCacheWrite.h"
 #include "TTree.h"
-#include "TSystem.h"
 #include "TTreeCache.h"
+#include "TSystem.h"
 
 using namespace pool;
 using namespace std;
@@ -44,6 +44,8 @@ RootDatabase::RootDatabase() :
         m_defSplitLevel(99),
         m_defAutoSave(16*1024*1024),
         m_defBufferSize(16*1024),
+        m_maxBufferSize(16*1024*1024),
+        m_minBufferEntries(-1),
         m_defWritePolicy(TObject::kOverwrite),   // On write create new versions
         m_branchOffsetTabLen(0),
         m_defTreeCacheLearnEvents(-1),
@@ -422,14 +424,6 @@ DbStatus RootDatabase::getOption(DbOption& opt)  const   {
       else if ( !strcasecmp(n, "DEFAULT_WRITEPOLICY") )   // int
         return opt._setValue(int(m_defWritePolicy));
       break;
-    case 'N':
-      //if ( !strcasecmp(n,"NFREE") )                     // int
-      //  return opt._setValue(int(m_file->GetNfree()));
-      if ( !m_file )
-        return Error;
-      else if ( !strcasecmp(n,"NKEYS") )                  // int
-        return opt._setValue(int(m_file->GetNkeys()));
-      break;
     case 'F':
       if ( !m_file )
         return Error;
@@ -455,28 +449,40 @@ DbStatus RootDatabase::getOption(DbOption& opt)  const   {
     case 'G':
       if ( !m_file )
         return Error;
-      else if ( !strcasecmp(n,"GET_OBJECT") )  {         // void*
+      else if ( !strcasecmp(n,"GET_OBJECT") )  {          // void*
         const char* key = "";
         opt._getValue(key);
         return opt._setValue((void*)m_file->Get(key));
       }
       break;
     case 'I':
-      if ( !strcasecmp(n,"IOBYTES_WRITTEN") )      // int
+      if ( !strcasecmp(n,"IOBYTES_WRITTEN") )             // int
         return opt._setValue((long long int)(byteCount(WRITE_COUNTER)));
-      else if ( !strcasecmp(n,"IOBYTES_READ") )         // int
+      else if ( !strcasecmp(n,"IOBYTES_READ") )           // int
         return opt._setValue((long long int)(byteCount(READ_COUNTER)));
       break;
+    case 'M':
+      if ( !strcasecmp(n, "MAXIMUM_BUFFERSIZE") )         // int
+        return opt._setValue(int(m_maxBufferSize));
+      else if ( !strcasecmp(n, "MINIMUM_BUFFERENTRIES") ) // int
+        return opt._setValue(int(m_minBufferEntries));
+      break;
+    case 'N':
+      if ( !m_file )
+        return Error;
+      else if ( !strcasecmp(n,"NKEYS") )                  // int
+        return opt._setValue(int(m_file->GetNkeys()));
+      break;
     case 'R':
       if ( !m_file )
         return Error;
-      else if ( !strcasecmp(n,"READ_CALLS") )        // int
+      else if ( !strcasecmp(n,"READ_CALLS") )             // int
         return opt._setValue(int(m_file->GetReadCalls()));
       break;
     case 'T':
       if( !strcasecmp(n+5,"BRANCH_OFFSETTAB_LEN") )  {
         return opt._setValue(int(m_branchOffsetTabLen));
-      } else if( !strcasecmp(n,"TFILE") )  {                  // void*
+      } else if( !strcasecmp(n,"TFILE") )  {              // void*
           return opt._setValue((void*)m_file);
       } else if( !strcasecmp(n+5,"MAX_SIZE") )  {
           return opt._setValue((long long int)TTree::GetMaxTreeSize());
@@ -584,6 +590,12 @@ DbStatus RootDatabase::setOption(const DbOption& opt)  {
         return Success;
       }
       break;
+    case 'M':
+      if ( !strcasecmp(n, "MAXIMUM_BUFFERSIZE") )         // int
+        return opt._getValue(m_maxBufferSize);
+      else if ( !strcasecmp(n, "MINIMUM_BUFFERENTRIES") ) // int
+        return opt._getValue(m_minBufferEntries);
+      break;
     case 'P':
       if ( !m_file )
         return Error;
@@ -803,7 +815,25 @@ void RootDatabase::registerBranchContainer(RootTreeContainer* cont)
 DbStatus RootDatabase::transAct(Transaction::Action action)
 {
    // process flush to write file
-   if( action == Transaction::TRANSACT_FLUSH && m_file != nullptr && m_file->IsWritable()) m_file->Write();
+   if( action == Transaction::TRANSACT_FLUSH && m_file != nullptr && m_file->IsWritable()) {
+      m_file->Write();
+      // check all TTrees, if Branch baskets are below max
+      for( map< TTree*, ContainerSet_t >::iterator treeIt = m_containersInTree.begin(),
+              mapEnd = m_containersInTree.end(); treeIt != mapEnd; ++treeIt ) {
+         TTree *tree = treeIt->first;
+         TIter next(tree->GetListOfBranches());
+         TBranch * b = nullptr;
+         while((b = (TBranch*)next())){
+            if (b->GetBasketSize() > m_maxBufferSize) {
+               DbPrint log( m_file->GetName() );
+               log << DbPrintLvl::Debug << b->GetName() << " Basket size = " << b->GetBasketSize()
+                   << " reduced to " << m_maxBufferSize
+                   << DbPrint::endmsg;
+               b->SetBasketSize(m_maxBufferSize);
+            }
+         }
+      }
+   }
    // process commits only
    if( action != Transaction::TRANSACT_COMMIT )
       return Success;
@@ -850,6 +880,24 @@ DbStatus RootDatabase::transAct(Transaction::Action action)
          }
       }
    }
+
+   for( map< TTree*, ContainerSet_t >::iterator treeIt = m_containersInTree.begin(),
+           mapEnd = m_containersInTree.end(); treeIt != mapEnd; ++treeIt ) {
+      TTree *tree = treeIt->first;
+      if( tree->GetEntries() == m_minBufferEntries ) {
+         TIter next(tree->GetListOfBranches());
+         TBranch * b = nullptr;
+         while((b = (TBranch*)next())){
+            if (b->GetBasketSize() < b->GetTotalSize()) {
+               DbPrint log( m_file->GetName() );
+               log << DbPrintLvl::Debug << b->GetName() << " Initial basket size = " << b->GetBasketSize()
+                   << " increased to " << b->GetBasketSize() * (1 + int(b->GetTotalSize()/b->GetBasketSize()))
+                   << DbPrint::endmsg;
+               b->SetBasketSize(b->GetBasketSize() * (1 + int(b->GetTotalSize()/b->GetBasketSize())));
+            }
+         }
+      }
+   }
    return Success;
 }
 
diff --git a/Database/APR/RootStorageSvc/src/RootDatabase.h b/Database/APR/RootStorageSvc/src/RootDatabase.h
index 07b7517a4aa9..e2898c1e75d3 100644
--- a/Database/APR/RootStorageSvc/src/RootDatabase.h
+++ b/Database/APR/RootStorageSvc/src/RootDatabase.h
@@ -60,6 +60,10 @@ namespace pool  {
     int           m_defAutoSave;
     /// Default buffer size parameter for Branches
     int           m_defBufferSize;
+    /// Maximum buffer size parameter for Branches
+    int           m_maxBufferSize;
+    /// Minimum buffer entries parameter for Branches
+    int           m_minBufferEntries;
     /// Default policy mode for keyed objects
     int           m_defWritePolicy;
     /// Offset table length for branches
-- 
GitLab


From 060dbed778fea439cd2b73359acc57b4348f8e20 Mon Sep 17 00:00:00 2001
From: Minlin Wu <minlin.wu@cern.ch>
Date: Thu, 23 Sep 2021 15:26:23 +0200
Subject: [PATCH 289/347] MuonPRDTest: Update the digit and reco DCube
 histograms

---
 .../MuonPRDTest/scripts/DCubeHistograms.py    | 292 ++++++++++++++++--
 .../createDCubeDigitHistograms_withSel.py     |  59 +++-
 .../createDCubeRecoHistograms_withSel.py      | 114 +++++++
 .../MuonPRDTest/src/NSWPRDValAlg.h            |   2 +-
 4 files changed, 429 insertions(+), 38 deletions(-)
 create mode 100644 MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/createDCubeRecoHistograms_withSel.py

diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/DCubeHistograms.py b/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/DCubeHistograms.py
index 8712bdf35ac0..539aa2996dee 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/DCubeHistograms.py
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/DCubeHistograms.py
@@ -39,7 +39,7 @@ class MyHistoFiller(object):
     mdtGlobalP = ROOT.TH1F("mdtGlobalP","mdtGlobalP;MDT_hitGlobalPositionP",100,-3.6,3.6)
     mdtTube = ROOT.TH1F("mdtTube","mdtTube;MDT_Sim_tube",100,0,110)  
     #############################################################################
-    # CSCs Sim Histograms
+    # CSC Sim Histograms
     cscStationEta = ROOT.TH1F("cscStationEta","cscStationEta;CSC_stationEta",4,-3,1)
     cscStationPhi = ROOT.TH1F("cscStationPhi","cscStationPhi;CSC_stationPhi",9,0,9)
     cscGlobalX = ROOT.TH1F("cscGlobalX","cscGlobalX;CSC_hitGlobalPositionX",100,-1400,2200)
@@ -54,15 +54,51 @@ class MyHistoFiller(object):
     CSCDigitWireLayer = ROOT.TH1F("CSCDigitWireLayer","CSCDigitWireLayer;Digits_CSC_wireLayer",5,0,5)
     CSCDigitGasGap = ROOT.TH1F("CSCDigitGasGap","CSCDigitGasGap;Digits_CSC_gas_gap",4,0,4)
     CSCDigitChannel = ROOT.TH1F("CSCDigitChannel","CSCDigitChannel;Digits_CSC_channel",100,0,200)
-    CSCDigitTruthBarcode = ROOT.TH1F("CSCDigitTruthBarcode","CSCDigitTruthBarcode;Digits_CSC_truth_barcode",100,0,210000)
-    CSCDigitTruthlocalPosX = ROOT.TH1F("CSCDigitTruthlocalPosX","CSCDigitTruthlocalPosX;Digits_CSC_truth_localPosX",100,-110000,10000)
-    CSCDigitTruthlocalPosY = ROOT.TH1F("CSCDigitTruthlocalPosY","CSCDigitTruthlocalPosY;Digits_CSC_truth_localPosY",100,-110000,10000)
-    CSCDigitTruthglobalPosX = ROOT.TH1F("CSCDigitTruthglobalPosX","CSCDigitTruthglobalPosX;Digits_CSC_truth_globalPosX",100,-170000,170000)
-    CSCDigitTruthglobalPosY = ROOT.TH1F("CSCDigitTruthglobalPosY","CSCDigitTruthglobalPosY;Digits_CSC_truth_globalPosY",100,-170000,170000)
-    CSCDigitTruthglobalPosZ = ROOT.TH1F("CSCDigitTruthglobalPosZ","CSCDigitTruthglobalPosZ;Digits_CSC_truth_globalPosZ",100,-30000,-6500)
-    CSCDigitTruthCharge = ROOT.TH1F("CSCDigitTruthCharge","CSCDigitTruthCharge;Digits_CSC_truth_charge",100,0,2200)
+    CSCDigitlocalPosX = ROOT.TH1F("CSCDigitlocalPosX","CSCDigitlocalPosX;Digits_CSC_localPosX",100,0,100)
+    CSCDigitlocalPosY = ROOT.TH1F("CSCDigitlocalPosY","CSCDigitlocalPosY;Digits_CSC_localPosY",100,0,100)
+    CSCDigitglobalPosX = ROOT.TH1F("CSCDigitglobalPosX","CSCDigitglobalPosX;Digits_CSC_globalPosX",100,-1600,1600)
+    CSCDigitglobalPosY = ROOT.TH1F("CSCDigitglobalPosY","CSCDigitglobalPosY;Digits_CSC_globalPosY",100,-1600,1600)
+    CSCDigitglobalPosZ = ROOT.TH1F("CSCDigitglobalPosZ","CSCDigitglobalPosZ;Digits_CSC_globalPosZ",100,-8000,-7000)
+    # CSC SDO Histograms
+    CSCSDOStationEta = ROOT.TH1F("CSCSDOStationEta","CSCSDOStationEta;SDO_CSC_stationEta",4,-3,1)
+    CSCSDOStationPhi = ROOT.TH1F("CSCSDOStationPhi","CSCSDOStationPhi;SDO_CSC_stationPhi",9,0,9)
+    CSCSDOChamberLayer = ROOT.TH1F("CSCSDOChamberLayer","CSCSDOChamberLayer;SDO_CSC_chamberLayer",4,0,4)
+    CSCSDOWireLayer = ROOT.TH1F("CSCSDOWireLayer","CSCSDOWireLayer;SDO_CSC_wireLayer",5,0,5)
+    CSCSDOStrip = ROOT.TH1F("CSCSDOStrip","CSCSDOStrip;SDO_CSC_strip",100,0,200) 
+    CSCSDOBarcode = ROOT.TH1F("CSCSDOBarcode","CSCSDOBarcode;SDO_CSC_barcode",100,0,250000) 
+    CSCSDOGlobalX = ROOT.TH1F("CSCSDOGlobalX","CSCSDOGlobalX;SDO_CSC_globalPosX",100,-2000,2000)
+    CSCSDOGlobalY = ROOT.TH1F("CSCSDOGlobalY","CSCSDOGlobalY;SDO_CSC_globalPosY",100,-2000,2000)
+    CSCSDOGlobalZ = ROOT.TH1F("CSCSDOGlobalZ","CSCSDOGlobalZ;SDO_CSC_globalPosZ",100,-8000,8000)
+    CSCSDOLocalX = ROOT.TH1F("CSCSDOLocalX","CSCSDOLocalX;SDO_CSC_localPosX",100,-1000,1000)
+    CSCSDOLocalY = ROOT.TH1F("CSCSDOLocalY","CSCSDOLocalY;SDO_CSC_localPosY",100,-1000,1000)
+    # CSC RDO Histograms
+    CSCRDOStationEta = ROOT.TH1F("CSCRDOStationEta","CSCRDOStationEta;RDO_CSC_stationEta",4,-3,1)
+    CSCRDOStationPhi = ROOT.TH1F("CSCRDOStationPhi","CSCRDOStationPhi;RDO_CSC_stationPhi",9,0,9)
+    CSCRDOChamberLayer = ROOT.TH1F("CSCRDOChamberLayer","CSCRDOChamberLayer;RDO_CSC_chamberLayer",4,0,4)
+    CSCRDOWireLayer = ROOT.TH1F("CSCRDOWireLayer","CSCRDOWireLayer;RDO_CSC_wireLayer",5,0,5)
+    CSCRDOStrip = ROOT.TH1F("CSCRDOStrip","CSCRDOStrip;RDO_CSC_strip",100,0,200) 
+    CSCRDOmeasurePhi = ROOT.TH1F("CSCRDOmeasurePhi","CSCRDOmeasurePhi;RDO_CSC_measurePhi",2,0,2) 
+    CSCRDOTime = ROOT.TH1F("CSCRDOTime","CSCRDOTime;RDO_CSC_time",4,-2,2) 
+    CSCRDOGlobalX = ROOT.TH1F("CSCRDOGlobalX","CSCRDOGlobalX;RDO_CSC_globalPosX",100,-2500,2500)
+    CSCRDOGlobalY = ROOT.TH1F("CSCRDOGlobalY","CSCRDOGlobalY;RDO_CSC_globalPosY",100,-2500,2500)
+    CSCRDOGlobalZ = ROOT.TH1F("CSCRDOGlobalZ","CSCRDOGlobalZ;RDO_CSC_globalPosZ",100,-8000,8000)
+    CSCRDOLocalX = ROOT.TH1F("CSCRDOLocalX","CSCRDOLocalX;RDO_CSC_localPosX",100,-1000,1000)
+    CSCRDOLocalY = ROOT.TH1F("CSCRDOLocalY","CSCRDOLocalY;RDO_CSC_localPosY",100,-1000,1000)
+    # CSC PRD Histograms
+    CSCPRDStationEta = ROOT.TH1F("CSCPRDStationEta","CSCPRDStationEta;PRD_CSC_stationEta",4,-3,1)
+    CSCPRDStationPhi = ROOT.TH1F("CSCPRDStationPhi","CSCPRDStationPhi;PRD_CSC_stationPhi",9,0,9)
+    CSCPRDChamberLayer = ROOT.TH1F("CSCPRDChamberLayer","CSCPRDChamberLayer;PRD_CSC_chamberLayer",4,0,4)
+    CSCPRDWireLayer = ROOT.TH1F("CSCPRDWireLayer","CSCPRDWireLayer;PRD_CSC_wireLayer",5,0,5)
+    CSCPRDStrip = ROOT.TH1F("CSCPRDStrip","CSCPRDStrip;PRD_CSC_strip",100,0,200) 
+    CSCPRDmeasurePhi = ROOT.TH1F("CSCPRDmeasurePhi","CSCPRDmeasurePhi;PRD_CSC_measurePhi",2,0,2) 
+    CSCPRDTime = ROOT.TH1F("CSCPRDTime","CSCPRDTime;PRD_CSC_time",100,-100,1000)
+    CSCPRDCharge = ROOT.TH1F("CSCPRDCharge","CSCPRDCharge;PRD_CSC_charge",100,0,10000000)
+    CSCPRDGlobalX = ROOT.TH1F("CSCPRDGlobalX","CSCPRDGlobalX;PRD_CSC_globalPosX",100,-2500,2500)
+    CSCPRDGlobalY = ROOT.TH1F("CSCPRDGlobalY","CSCPRDGlobalY;PRD_CSC_globalPosY",100,-2500,2500)
+    CSCPRDGlobalZ = ROOT.TH1F("CSCPRDGlobalZ","CSCPRDGlobalZ;PRD_CSC_globalPosZ",100,-8000,8000)
+    CSCPRDLocalX = ROOT.TH1F("CSCPRDLocalX","CSCPRDLocalX;PRD_CSC_localPosX",100,-1000,1000)
     #############################################################################  
-    # TGCs Sim Histograms
+    # TGC Sim Histograms
     tgcLocalX = ROOT.TH1F("tgcLocalX","tgcLocalX;TGC_hitLocalPositionX",100,-1.5,1.5)
     tgcLocalY = ROOT.TH1F("tgcLocalY","tgcLocalY;TGC_hitLocalPositionY",100,-800,800)
     tgcLocalZ = ROOT.TH1F("tgcLocalZ","tgcLocalZ;TGC_hitLocalPositionZ",100,-1200,1200)
@@ -84,7 +120,41 @@ class MyHistoFiller(object):
     TGCDigitlocalY = ROOT.TH1F("TGCDigitlocalY","TGCDigitlocalY;Digits_TGC_localPosY",100,-12000,1000)
     TGCDigitglobalX = ROOT.TH1F("TGCDigitglobalX","TGCDigitglobalX;Digits_TGC_globalPosX",100,-12000,12000)
     TGCDigitglobalY = ROOT.TH1F("TGCDigitglobalY","TGCDigitglobalY;Digits_TGC_globalPosY",100,-12000,12000)
-    TGCDigitglobalZ = ROOT.TH1F("TGCDigitglobalZ","TGCDigitglobalZ;Digits_TGC_globalPosZ",100,18000,18000)
+    TGCDigitglobalZ = ROOT.TH1F("TGCDigitglobalZ","TGCDigitglobalZ;Digits_TGC_globalPosZ",100,-18000,18000)
+    # TGC SDO Histograms
+    TGCSDOStationEta = ROOT.TH1F("TGCSDOStationEta","TGCSDOStationEta;SDO_TGC_stationEta",12,-6,6)
+    TGCSDOStationPhi = ROOT.TH1F("TGCSDOStationPhi","TGCSDOStationPhi;SDO_TGC_stationPhi",50,0,50)
+    TGCSDOGasgap = ROOT.TH1F("TGCSDOGasgap","TGCSDOGasgap;SDO_TGC_gas_gap",4,0,4)
+    TGCSDOChannel = ROOT.TH1F("TGCSDOChannel","TGCSDOChannel;SDO_TGC_channel",100,0,140)
+    TGCSDOisStrip = ROOT.TH1F("TGCSDOisStrip","TGCSDOisStrip;SDO_TGC_isStrip",2,0,2) 
+    TGCSDOWord = ROOT.TH1F("TGCSDOWord","TGCSDOWord;SDO_TGC_word",4,-2,2) 
+    TGCSDOBarcode = ROOT.TH1F("TGCSDOBarcode","TGCSDOBarcode;SDO_TGC_barcode",100,0,10500) 
+    TGCSDOGlobalX = ROOT.TH1F("TGCSDOGlobalX","TGCSDOGlobalX;SDO_TGC_globalPosX",100,-15000,15000)
+    TGCSDOGlobalY = ROOT.TH1F("TGCSDOGlobalY","TGCSDOGlobalY;SDO_TGC_globalPosY",100,-15000,15000)
+    TGCSDOGlobalZ = ROOT.TH1F("TGCSDOGlobalZ","TGCSDOGlobalZ;SDO_TGC_globalPosZ",100,-20000,20000)
+    TGCSDOLocalX = ROOT.TH1F("TGCSDOLocalX","TGCSDOLocalX;SDO_TGC_localPosX",100,0,100)
+    TGCSDOLocalY = ROOT.TH1F("TGCSDOLocalY","TGCSDOLocalY;SDO_TGC_localPosY",100,0,100)
+    TGCSDOGlotime = ROOT.TH1F("TGCSDOGlotime","TGCSDOGlotime;SDO_TGC_global_time",100,0,100)
+    # TGC RDO Histograms
+    TGCRDOStationEta = ROOT.TH1F("TGCRDOStationEta","TGCRDOStationEta;RDO_TGC_stationEta",12,-6,6)
+    TGCRDOStationPhi = ROOT.TH1F("TGCRDOStationPhi","TGCRDOStationPhi;RDO_TGC_stationPhi",50,0,50)
+    TGCRDOGasgap = ROOT.TH1F("TGCRDOGasgap","TGCRDOGasgap;RDO_TGC_gas_gap",3,0,3)
+    TGCRDOChannel = ROOT.TH1F("TGCRDOChannel","TGCRDOChannel;RDO_TGC_channel",3,0,3)
+    TGCRDOisStrip = ROOT.TH1F("TGCRDOisStrip","TGCRDOisStrip;RDO_TGC_isStrip",4,-2,2) 
+    TGCRDOGlobalX = ROOT.TH1F("TGCRDOGlobalX","TGCRDOGlobalX;RDO_TGC_globalPosX",100,-10000,10000)
+    TGCRDOGlobalY = ROOT.TH1F("TGCRDOGlobalY","TGCRDOGlobalY;RDO_TGC_globalPosY",100,-10000,10000)
+    TGCRDOGlobalZ = ROOT.TH1F("TGCRDOGlobalZ","TGCRDOGlobalZ;RDO_TGC_globalPosZ",100,-16000,16000)
+    TGCRDOLocalX = ROOT.TH1F("TGCRDOLocalX","TGCRDOLocalX;RDO_TGC_localPosX",100,-1200,-400)
+    # TGC PRD Histograms
+    TGCPRDStationEta = ROOT.TH1F("TGCPRDStationEta","TGCPRDStationEta;PRD_TGC_stationEta",12,-6,6)
+    TGCPRDStationPhi = ROOT.TH1F("TGCPRDStationPhi","TGCPRDStationPhi;PRD_TGC_stationPhi",50,0,50)
+    TGCPRDGasgap = ROOT.TH1F("TGCPRDGasgap","TGCPRDGasgap;PRD_TGC_gas_gap",4,0,4)
+    TGCPRDChannel = ROOT.TH1F("TGCPRDChannel","TGCPRDChannel;PRD_TGC_channel",100,0,150)
+    TGCPRDisStrip = ROOT.TH1F("TGCPRDisStrip","TGCPRDisStrip;PRD_TGC_isStrip",2,0,2) 
+    TGCPRDGlobalX = ROOT.TH1F("TGCPRDGlobalX","TGCPRDGlobalX;PRD_TGC_globalPosX",100,-15000,15000)
+    TGCPRDGlobalY = ROOT.TH1F("TGCPRDGlobalY","TGCPRDGlobalY;PRD_TGC_globalPosY",100,-15000,15000)
+    TGCPRDGlobalZ = ROOT.TH1F("TGCPRDGlobalZ","TGCPRDGlobalZ;PRD_TGC_globalPosZ",100,-18000,18000)
+    TGCPRDLocalX = ROOT.TH1F("TGCPRDLocalX","TGCPRDLocalX;PRD_TGC_localPosX",100,-1500,1500)
     #############################################################################
     # MMs
     mmGlobalX = ROOT.TH1F("mmGlobalX","mmGlobalX;MM_hitGlobalPositionX",100,-5000,3000)
@@ -175,13 +245,61 @@ class MyHistoFiller(object):
                 MyHistoFiller.CSCDigitWireLayer.Fill(TTree.Digits_CSC_wireLayer[n])
                 MyHistoFiller.CSCDigitGasGap.Fill(TTree.Digits_CSC_gas_gap[n])
                 MyHistoFiller.CSCDigitChannel.Fill(TTree.Digits_CSC_channel[n])
-                MyHistoFiller.CSCDigitTruthBarcode.Fill(TTree.Digits_CSC_truth_barcode[n])
-                MyHistoFiller.CSCDigitTruthlocalPosX.Fill(TTree.Digits_CSC_truth_localPosX[n])
-                MyHistoFiller.CSCDigitTruthlocalPosY.Fill(TTree.Digits_CSC_truth_localPosY[n])
-                MyHistoFiller.CSCDigitTruthglobalPosX.Fill(TTree.Digits_CSC_truth_globalPosX[n])
-                MyHistoFiller.CSCDigitTruthglobalPosY.Fill(TTree.Digits_CSC_truth_globalPosY[n])
-                MyHistoFiller.CSCDigitTruthglobalPosZ.Fill(TTree.Digits_CSC_truth_globalPosZ[n])
-                MyHistoFiller.CSCDigitTruthCharge.Fill(TTree.Digits_CSC_truth_charge[n])
+                MyHistoFiller.CSCDigitlocalPosX.Fill(TTree.Digits_CSC_localPosX[n])
+                MyHistoFiller.CSCDigitlocalPosY.Fill(TTree.Digits_CSC_localPosY[n])
+                MyHistoFiller.CSCDigitglobalPosX.Fill(TTree.Digits_CSC_globalPosX[n])
+                MyHistoFiller.CSCDigitglobalPosY.Fill(TTree.Digits_CSC_globalPosY[n])
+                MyHistoFiller.CSCDigitglobalPosZ.Fill(TTree.Digits_CSC_globalPosZ[n])
+
+        if self.__chamber_name == "CSC_SDO":
+            if not (self.__eta_sel(TTree) and self.__sector_sel(TTree)):
+                return
+            else:
+                MyHistoFiller.CSCSDOStationEta.Fill(TTree.SDO_CSC_stationEta[n])
+                MyHistoFiller.CSCSDOStationPhi.Fill(TTree.SDO_CSC_stationPhi[n])
+                MyHistoFiller.CSCSDOChamberLayer.Fill(TTree.SDO_CSC_chamberLayer[n])
+                MyHistoFiller.CSCSDOWireLayer.Fill(TTree.SDO_CSC_wireLayer[n])
+                MyHistoFiller.CSCSDOStrip.Fill(TTree.SDO_CSC_strip[n])
+                MyHistoFiller.CSCSDOBarcode.Fill(TTree.SDO_CSC_barcode[n])
+                MyHistoFiller.CSCSDOGlobalX.Fill(TTree.SDO_CSC_globalPosX[n])
+                MyHistoFiller.CSCSDOGlobalY.Fill(TTree.SDO_CSC_globalPosY[n])
+                MyHistoFiller.CSCSDOGlobalZ.Fill(TTree.SDO_CSC_globalPosZ[n])
+                MyHistoFiller.CSCSDOLocalX.Fill(TTree.SDO_CSC_localPosX[n])
+                MyHistoFiller.CSCSDOLocalY.Fill(TTree.SDO_CSC_localPosY[n])
+
+        if self.__chamber_name == "CSC_RDO":
+            if not (self.__eta_sel(TTree) and self.__sector_sel(TTree)):
+                return
+            else:
+                MyHistoFiller.CSCRDOStationEta.Fill(TTree.RDO_CSC_StationEta[n])
+                MyHistoFiller.CSCRDOStationPhi.Fill(TTree.RDO_CSC_StationPhi[n])
+                MyHistoFiller.CSCRDOChamberLayer.Fill(TTree.RDO_CSC_chamberLayer[n])
+                MyHistoFiller.CSCRDOWireLayer.Fill(TTree.RDO_CSC_wireLayer[n])
+                MyHistoFiller.CSCRDOStrip.Fill(TTree.RDO_CSC_strip[n])
+                MyHistoFiller.CSCRDOmeasurePhi.Fill(TTree.RDO_CSC_measurePhi[n])
+                MyHistoFiller.CSCRDOTime.Fill(TTree.RDO_CSC_time[n])
+                MyHistoFiller.CSCRDOGlobalX.Fill(TTree.RDO_CSC_globalPosX[n])
+                MyHistoFiller.CSCRDOGlobalY.Fill(TTree.RDO_CSC_globalPosY[n])
+                MyHistoFiller.CSCRDOGlobalZ.Fill(TTree.RDO_CSC_globalPosZ[n])
+                MyHistoFiller.CSCRDOLocalX.Fill(TTree.RDO_CSC_localPosX[n])
+                MyHistoFiller.CSCRDOLocalY.Fill(TTree.RDO_CSC_localPosY[n])
+                
+        if self.__chamber_name == "CSC_PRD":
+            if not (self.__eta_sel(TTree) and self.__sector_sel(TTree)):
+                return
+            else:
+                MyHistoFiller.CSCPRDStationEta.Fill(TTree.PRD_CSC_stationEta[n])
+                MyHistoFiller.CSCPRDStationPhi.Fill(TTree.PRD_CSC_stationPhi[n])
+                MyHistoFiller.CSCPRDChamberLayer.Fill(TTree.PRD_CSC_chlayer[n])
+                MyHistoFiller.CSCPRDWireLayer.Fill(TTree.PRD_CSC_wlayer[n])
+                MyHistoFiller.CSCPRDStrip.Fill(TTree.PRD_CSC_strip[n])
+                MyHistoFiller.CSCPRDmeasurePhi.Fill(TTree.PRD_CSC_measuresPhi[n])
+                MyHistoFiller.CSCPRDTime.Fill(TTree.PRD_CSC_time[n])
+                MyHistoFiller.CSCPRDCharge.Fill(TTree.PRD_CSC_charge[n])
+                MyHistoFiller.CSCPRDGlobalX.Fill(TTree.PRD_CSC_globalPosX[n])
+                MyHistoFiller.CSCPRDGlobalY.Fill(TTree.PRD_CSC_globalPosY[n])
+                MyHistoFiller.CSCPRDGlobalZ.Fill(TTree.PRD_CSC_globalPosZ[n])
+                MyHistoFiller.CSCPRDLocalX.Fill(TTree.PRD_CSC_localPosX[n])
 
         if self.__chamber_name == "TGC_Sim":
             if not (self.__eta_sel(TTree) and self.__sector_sel(TTree)):
@@ -213,6 +331,52 @@ class MyHistoFiller(object):
                 MyHistoFiller.TGCDigitglobalX.Fill(TTree.Digits_TGC_globalPosX[n])
                 MyHistoFiller.TGCDigitglobalY.Fill(TTree.Digits_TGC_globalPosY[n])
                 MyHistoFiller.TGCDigitglobalZ.Fill(TTree.Digits_TGC_globalPosZ[n])
+                
+        if self.__chamber_name == "TGC_SDO":
+            if not (self.__eta_sel(TTree) and self.__sector_sel(TTree)):
+                return
+            else:
+                MyHistoFiller.TGCSDOStationEta.Fill(TTree.SDO_TGC_stationEta[n])
+                MyHistoFiller.TGCSDOStationPhi.Fill(TTree.SDO_TGC_stationPhi[n])
+                MyHistoFiller.TGCSDOGasgap.Fill(TTree.SDO_TGC_gas_gap[n])
+                MyHistoFiller.TGCSDOChannel.Fill(TTree.SDO_TGC_channel[n])
+                MyHistoFiller.TGCSDOisStrip.Fill(TTree.SDO_TGC_isStrip[n])
+                MyHistoFiller.TGCSDOWord.Fill(TTree.SDO_TGC_word[n])
+                MyHistoFiller.TGCSDOBarcode.Fill(TTree.SDO_TGC_barcode[n])
+                MyHistoFiller.TGCSDOGlobalX.Fill(TTree.SDO_TGC_globalPosX[n])
+                MyHistoFiller.TGCSDOGlobalY.Fill(TTree.SDO_TGC_globalPosY[n])
+                MyHistoFiller.TGCSDOGlobalZ.Fill(TTree.SDO_TGC_globalPosZ[n])
+                MyHistoFiller.TGCSDOLocalX.Fill(TTree.SDO_TGC_localPosX[n])
+                MyHistoFiller.TGCSDOLocalY.Fill(TTree.SDO_TGC_localPosY[n])
+                MyHistoFiller.TGCSDOGlotime.Fill(TTree.SDO_TGC_global_time[n])
+                
+        if self.__chamber_name == "TGC_RDO":
+            if not (self.__eta_sel(TTree) and self.__sector_sel(TTree)):
+                return
+            else:
+                MyHistoFiller.TGCRDOStationEta.Fill(TTree.RDO_TGC_stationEta[n])
+                MyHistoFiller.TGCRDOStationPhi.Fill(TTree.RDO_TGC_stationPhi[n])
+                MyHistoFiller.TGCRDOGasgap.Fill(TTree.RDO_TGC_gas_gap[n])
+                MyHistoFiller.TGCRDOChannel.Fill(TTree.RDO_TGC_channel[n])
+                MyHistoFiller.TGCRDOisStrip.Fill(TTree.RDO_TGC_isStrip[n])
+                MyHistoFiller.TGCRDOGlobalX.Fill(TTree.RDO_TGC_globalPosX[n])
+                MyHistoFiller.TGCRDOGlobalY.Fill(TTree.RDO_TGC_globalPosY[n])
+                MyHistoFiller.TGCRDOGlobalZ.Fill(TTree.RDO_TGC_globalPosZ[n])
+                MyHistoFiller.TGCRDOLocalX.Fill(TTree.RDO_TGC_localPosX[n])
+
+        if self.__chamber_name == "TGC_PRD":
+            if not (self.__eta_sel(TTree) and self.__sector_sel(TTree)):
+                return
+            else:
+                MyHistoFiller.TGCPRDStationEta.Fill(TTree.PRD_TGC_stationEta[n])
+                MyHistoFiller.TGCPRDStationPhi.Fill(TTree.PRD_TGC_stationPhi[n])
+                MyHistoFiller.TGCPRDGasgap.Fill(TTree.PRD_TGC_gasGap[n])
+                MyHistoFiller.TGCPRDChannel.Fill(TTree.PRD_TGC_channel[n])
+                MyHistoFiller.TGCPRDisStrip.Fill(TTree.PRD_TGC_isStrip[n])
+                MyHistoFiller.TGCPRDGlobalX.Fill(TTree.PRD_TGC_globalPosX[n])
+                MyHistoFiller.TGCPRDGlobalY.Fill(TTree.PRD_TGC_globalPosY[n])
+                MyHistoFiller.TGCPRDGlobalZ.Fill(TTree.PRD_TGC_globalPosZ[n])
+                MyHistoFiller.TGCPRDLocalX.Fill(TTree.PRD_TGC_localPosX[n])
 
         if self.__chamber_name == "MM":
             if not (self.__eta_sel(TTree) and self.__sector_sel(TTree)):
@@ -273,6 +437,7 @@ class MyHistoFiller(object):
             outdir.WriteTObject(MyHistoFiller.mdtGlobalP, MyHistoFiller.mdtGlobalP.GetName())
             outdir.WriteTObject(MyHistoFiller.mdtTube, MyHistoFiller.mdtTube.GetName())
 
+
         if self.__chamber_name == "CSC_Sim":
             outdir.WriteTObject(MyHistoFiller.cscStationEta, MyHistoFiller.cscStationEta.GetName())
             outdir.WriteTObject(MyHistoFiller.cscStationPhi, MyHistoFiller.cscStationPhi.GetName())
@@ -289,13 +454,53 @@ class MyHistoFiller(object):
             outdir.WriteTObject(MyHistoFiller.CSCDigitWireLayer, MyHistoFiller.CSCDigitWireLayer.GetName())
             outdir.WriteTObject(MyHistoFiller.CSCDigitGasGap, MyHistoFiller.CSCDigitGasGap.GetName())
             outdir.WriteTObject(MyHistoFiller.CSCDigitChannel, MyHistoFiller.CSCDigitChannel.GetName())
-            outdir.WriteTObject(MyHistoFiller.CSCDigitTruthBarcode, MyHistoFiller.CSCDigitTruthBarcode.GetName())
-            outdir.WriteTObject(MyHistoFiller.CSCDigitTruthlocalPosX, MyHistoFiller.CSCDigitTruthlocalPosX.GetName())
-            outdir.WriteTObject(MyHistoFiller.CSCDigitTruthlocalPosY, MyHistoFiller.CSCDigitTruthlocalPosY.GetName())
-            outdir.WriteTObject(MyHistoFiller.CSCDigitTruthglobalPosX, MyHistoFiller.CSCDigitTruthglobalPosX.GetName())
-            outdir.WriteTObject(MyHistoFiller.CSCDigitTruthglobalPosY, MyHistoFiller.CSCDigitTruthglobalPosY.GetName())
-            outdir.WriteTObject(MyHistoFiller.CSCDigitTruthglobalPosZ, MyHistoFiller.CSCDigitTruthglobalPosZ.GetName())
-            outdir.WriteTObject(MyHistoFiller.CSCDigitTruthCharge, MyHistoFiller.CSCDigitTruthCharge.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCDigitlocalPosX, MyHistoFiller.CSCDigitlocalPosX.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCDigitlocalPosY, MyHistoFiller.CSCDigitlocalPosY.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCDigitglobalPosX, MyHistoFiller.CSCDigitglobalPosX.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCDigitglobalPosY, MyHistoFiller.CSCDigitglobalPosY.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCDigitglobalPosZ, MyHistoFiller.CSCDigitglobalPosZ.GetName())
+            
+        if self.__chamber_name == "CSC_SDO":
+            outdir.WriteTObject(MyHistoFiller.CSCSDOStationEta, MyHistoFiller.CSCSDOStationEta.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCSDOStationPhi, MyHistoFiller.CSCSDOStationPhi.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCSDOChamberLayer, MyHistoFiller.CSCSDOChamberLayer.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCSDOWireLayer, MyHistoFiller.CSCSDOWireLayer.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCSDOStrip, MyHistoFiller.CSCSDOStrip.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCSDOBarcode, MyHistoFiller.CSCSDOBarcode.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCSDOGlobalX, MyHistoFiller.CSCSDOGlobalX.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCSDOGlobalY, MyHistoFiller.CSCSDOGlobalY.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCSDOGlobalZ, MyHistoFiller.CSCSDOGlobalZ.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCSDOLocalX, MyHistoFiller.CSCSDOLocalX.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCSDOLocalY, MyHistoFiller.CSCSDOLocalY.GetName())
+            
+        if self.__chamber_name == "CSC_RDO":
+            outdir.WriteTObject(MyHistoFiller.CSCRDOStationEta, MyHistoFiller.CSCRDOStationEta.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOStationPhi, MyHistoFiller.CSCRDOStationPhi.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOChamberLayer, MyHistoFiller.CSCRDOChamberLayer.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOWireLayer, MyHistoFiller.CSCRDOWireLayer.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOStrip, MyHistoFiller.CSCRDOStrip.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOmeasurePhi, MyHistoFiller.CSCRDOmeasurePhi.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOTime, MyHistoFiller.CSCRDOTime.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOGlobalX, MyHistoFiller.CSCRDOGlobalX.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOGlobalY, MyHistoFiller.CSCRDOGlobalY.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOGlobalZ, MyHistoFiller.CSCRDOGlobalZ.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOLocalX, MyHistoFiller.CSCRDOLocalX.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCRDOLocalY, MyHistoFiller.CSCRDOLocalY.GetName())
+
+        if self.__chamber_name == "CSC_PRD":
+            outdir.WriteTObject(MyHistoFiller.CSCPRDStationEta, MyHistoFiller.CSCPRDStationEta.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDStationPhi, MyHistoFiller.CSCPRDStationPhi.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDChamberLayer, MyHistoFiller.CSCPRDChamberLayer.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDWireLayer, MyHistoFiller.CSCPRDWireLayer.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDStrip, MyHistoFiller.CSCPRDStrip.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDmeasurePhi, MyHistoFiller.CSCPRDmeasurePhi.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDTime, MyHistoFiller.CSCPRDTime.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDCharge, MyHistoFiller.CSCPRDCharge.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDGlobalX, MyHistoFiller.CSCPRDGlobalX.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDGlobalY, MyHistoFiller.CSCPRDGlobalY.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDGlobalZ, MyHistoFiller.CSCPRDGlobalZ.GetName())
+            outdir.WriteTObject(MyHistoFiller.CSCPRDLocalX, MyHistoFiller.CSCPRDLocalX.GetName())
+
 
         if self.__chamber_name == "TGC_Sim":
             outdir.WriteTObject(MyHistoFiller.tgcLocalX, MyHistoFiller.tgcLocalX.GetName())
@@ -321,7 +526,44 @@ class MyHistoFiller(object):
             outdir.WriteTObject(MyHistoFiller.TGCDigitglobalX, MyHistoFiller.TGCDigitglobalX.GetName())
             outdir.WriteTObject(MyHistoFiller.TGCDigitglobalY, MyHistoFiller.TGCDigitglobalY.GetName())
             outdir.WriteTObject(MyHistoFiller.TGCDigitglobalZ, MyHistoFiller.TGCDigitglobalZ.GetName())
-        
+            
+        if self.__chamber_name == "TGC_SDO":
+            outdir.WriteTObject(MyHistoFiller.TGCSDOStationEta, MyHistoFiller.TGCSDOStationEta.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOStationPhi, MyHistoFiller.TGCSDOStationPhi.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOGasgap, MyHistoFiller.TGCSDOGasgap.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOChannel, MyHistoFiller.TGCSDOChannel.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOisStrip, MyHistoFiller.TGCSDOisStrip.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOWord, MyHistoFiller.TGCSDOWord.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOBarcode, MyHistoFiller.TGCSDOBarcode.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOGlobalX, MyHistoFiller.TGCSDOGlobalX.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOGlobalY, MyHistoFiller.TGCSDOGlobalY.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOGlobalZ, MyHistoFiller.TGCSDOGlobalZ.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOLocalX, MyHistoFiller.TGCSDOLocalX.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOLocalY, MyHistoFiller.TGCSDOLocalY.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCSDOGlotime, MyHistoFiller.TGCSDOGlotime.GetName())
+            
+        if self.__chamber_name == "TGC_RDO":
+            outdir.WriteTObject(MyHistoFiller.TGCRDOStationEta, MyHistoFiller.TGCRDOStationEta.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCRDOStationPhi, MyHistoFiller.TGCRDOStationPhi.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCRDOGasgap, MyHistoFiller.TGCRDOGasgap.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCRDOChannel, MyHistoFiller.TGCRDOChannel.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCRDOisStrip, MyHistoFiller.TGCRDOisStrip.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCRDOGlobalX, MyHistoFiller.TGCRDOGlobalX.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCRDOGlobalY, MyHistoFiller.TGCRDOGlobalY.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCRDOGlobalZ, MyHistoFiller.TGCRDOGlobalZ.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCRDOLocalX, MyHistoFiller.TGCRDOLocalX.GetName())
+
+        if self.__chamber_name == "TGC_PRD":
+            outdir.WriteTObject(MyHistoFiller.TGCPRDStationEta, MyHistoFiller.TGCPRDStationEta.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCPRDStationPhi, MyHistoFiller.TGCPRDStationPhi.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCPRDGasgap, MyHistoFiller.TGCPRDGasgap.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCPRDChannel, MyHistoFiller.TGCPRDChannel.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCPRDisStrip, MyHistoFiller.TGCPRDisStrip.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCPRDGlobalX, MyHistoFiller.TGCPRDGlobalX.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCPRDGlobalY, MyHistoFiller.TGCPRDGlobalY.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCPRDGlobalZ, MyHistoFiller.TGCPRDGlobalZ.GetName())
+            outdir.WriteTObject(MyHistoFiller.TGCPRDLocalX, MyHistoFiller.TGCPRDLocalX.GetName())
+       
 
         if self.__chamber_name == "MM":
             outdir.WriteTObject(MyHistoFiller.mmGlobalX, MyHistoFiller.mmGlobalX.GetName())
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/createDCubeDigitHistograms_withSel.py b/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/createDCubeDigitHistograms_withSel.py
index a35db0ab119b..ddd48a2c944f 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/createDCubeDigitHistograms_withSel.py
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/createDCubeDigitHistograms_withSel.py
@@ -7,7 +7,7 @@ import math
 from DCubeHistograms import MyHistoFiller
 
 if __name__ == "__main__":
-    parser = argparse.ArgumentParser(prog='createDCubeSimHistograms', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+    parser = argparse.ArgumentParser(prog='createDCubeDigitHistograms', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
     parser.add_argument('-i', '--inputFile', help='choose input ROOT file', default='NSWPRDValAlg.digi.ntuple.root', type=str)
     parser.add_argument('-o', '--outputFile', help='choose output ROOT file', default='NSWPRDValAlg.digi.dcube.root', type=str)
     parser.add_argument('--doCSC', help='turn off CSC if using Run4 input ROOT file', default=False, action='store_true')
@@ -63,8 +63,13 @@ if __name__ == "__main__":
     #Filling
     for i in range(inputTree.GetEntries()):
         inputTree.GetEntry(i)
-        cschists = []
-        tgchists = []
+        cscDigitHists = []
+        cscSDOHists = []
+        cscRDOHists = []
+        tgcDigitHists = []
+        tgcSDOHists = []
+        tgcRDOHists = []
+
 
         # CSCs
         if Options.doCSC == True:
@@ -80,9 +85,19 @@ if __name__ == "__main__":
             else:
                 csc_sector_sel = lambda s: s.Digits_CSC_stationPhi[ncscDigit] == CSC_sector
 
-            for ncscDigit in range(0,len(inputTree.Digits_CSC_truth_localPosX)):
-                cschists += [MyHistoFiller( chamber_name = "CSC_Digit", eta_sel = csc_eta_sel, sector_sel = csc_sector_sel )]
-                cschists[ncscDigit].fill(inputTree, ncscDigit)
+            for ncscDigit in range(0,len(inputTree.Digits_CSC_localPosX)):
+                cscDigitHists += [MyHistoFiller( chamber_name = "CSC_Digit", eta_sel = csc_eta_sel, sector_sel = csc_sector_sel )]
+                cscDigitHists[ncscDigit].fill(inputTree, ncscDigit)
+
+            for ncscSDO in range(0,len(inputTree.SDO_CSC_localPosX)):
+                cscSDOHists += [MyHistoFiller( chamber_name = "CSC_SDO", eta_sel = csc_eta_sel, sector_sel = csc_sector_sel )]
+                cscSDOHists[ncscSDO].fill(inputTree, ncscSDO)
+                
+            for ncscRDO in range(0,len(inputTree.RDO_CSC_localPosX)):
+                cscRDOHists += [MyHistoFiller( chamber_name = "CSC_RDO", eta_sel = csc_eta_sel, sector_sel = csc_sector_sel )]
+                cscRDOHists[ncscRDO].fill(inputTree, ncscRDO)
+                
+
                 
         # TGCs
         if TGC_eta == "positive":
@@ -98,14 +113,34 @@ if __name__ == "__main__":
             tgc_sector_sel = lambda s: s.Digits_TGC_stationPhi[ntgcDigit] == TGC_sector
 
         for ntgcDigit in range(0,len(inputTree.Digits_TGC_localPosX)):
-            tgchists += [MyHistoFiller( chamber_name = "TGC_Digit", eta_sel = tgc_eta_sel, sector_sel = tgc_sector_sel )]
-            tgchists[ntgcDigit].fill(inputTree, ntgcDigit)
+            tgcDigitHists += [MyHistoFiller( chamber_name = "TGC_Digit", eta_sel = tgc_eta_sel, sector_sel = tgc_sector_sel )]
+            tgcDigitHists[ntgcDigit].fill(inputTree, ntgcDigit)
+            
+        for ntgcSDO in range(0,len(inputTree.SDO_TGC_localPosX)):
+            tgcSDOHists += [MyHistoFiller( chamber_name = "TGC_SDO", eta_sel = tgc_eta_sel, sector_sel = tgc_sector_sel )]
+            tgcSDOHists[ntgcSDO].fill(inputTree, ntgcSDO)
+            
+        for ntgcRDO in range(0,len(inputTree.RDO_TGC_localPosX)):
+            tgcRDOHists += [MyHistoFiller( chamber_name = "TGC_RDO", eta_sel = tgc_eta_sel, sector_sel = tgc_sector_sel )]
+            tgcRDOHists[ntgcRDO].fill(inputTree, ntgcRDO)
 
     #Writing
     if Options.doCSC == True:
-        cschist = MyHistoFiller( chamber_name = "CSC_Digit", eta_sel = None, sector_sel = None )
-        cschist.write(ODir)
+        cscDigitHist = MyHistoFiller( chamber_name = "CSC_Digit", eta_sel = None, sector_sel = None )
+        cscDigitHist.write(ODir)
+        
+        cscSDOHist = MyHistoFiller( chamber_name = "CSC_SDO", eta_sel = None, sector_sel = None )
+        cscSDOHist.write(ODir)
+        
+        cscRDOHist = MyHistoFiller( chamber_name = "CSC_RDO", eta_sel = None, sector_sel = None )
+        cscRDOHist.write(ODir)
+    
+    tgcDigitHist = MyHistoFiller( chamber_name = "TGC_Digit", eta_sel = None, sector_sel = None )
+    tgcDigitHist.write(ODir)
+    
+    tgcSDOHist = MyHistoFiller( chamber_name = "TGC_SDO", eta_sel = None, sector_sel = None )
+    tgcSDOHist.write(ODir)
     
-    tgchist = MyHistoFiller( chamber_name = "TGC_Digit", eta_sel = None, sector_sel = None )
-    tgchist.write(ODir)
+    tgcRDOHist = MyHistoFiller( chamber_name = "TGC_RDO", eta_sel = None, sector_sel = None )
+    tgcRDOHist.write(ODir)
     
\ No newline at end of file
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/createDCubeRecoHistograms_withSel.py b/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/createDCubeRecoHistograms_withSel.py
new file mode 100644
index 000000000000..a883dc90011d
--- /dev/null
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/scripts/createDCubeRecoHistograms_withSel.py
@@ -0,0 +1,114 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+# this script can be used to create DCube histograms from the output ntuples of NSWPRDValAlg
+
+import os, sys, ROOT, argparse
+import math
+from DCubeHistograms import MyHistoFiller
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser(prog='createDCubeRecoHistograms', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+    parser.add_argument('-i', '--inputFile', help='choose input ROOT file', default='NSWPRDValAlg.reco.ntuple.root', type=str)
+    parser.add_argument('-o', '--outputFile', help='choose output ROOT file', default='NSWPRDValAlg.reco.dcube.root', type=str)
+    parser.add_argument('--doCSC', help='turn off CSC if using Run4 input ROOT file', default=True, action='store_true')
+    parser.add_argument('--CSCsel', help='Choose eta_sector selections for CSC, e.g. positive_1 for positive eta and sector 1, None_None for no selection', default='None_None', type=str)
+    parser.add_argument('--TGCsel', help='Choose eta_sector selections for TGC, e.g. positive_1 for positive eta and sector 1, None_None for no selection', default='None_None', type=str)
+
+    Options = parser.parse_args()
+
+    ROOT.gROOT.SetBatch(True)
+
+    if not os.path.exists(Options.inputFile):
+        print ('ERROR: File %s does not exist'%Options.inputFile)
+        sys.exit(1)
+
+    inputFile = ROOT.TFile(Options.inputFile, "READ")
+    if not inputFile:
+        print ('ERROR: Failed to open file %s'%Options.inputFile)
+        sys.exit(1)
+    inputTree = inputFile.Get("NSWValTree")
+    if not inputTree:
+        print ('ERROR: NSWValTree does not exist in file %s'%Options.inputFile)
+        sys.exit(1)
+
+    nEntries = inputTree.GetEntries()
+    if nEntries==0:
+        print ('ERROR: NSWValTree of file %s has 0 entries'%Options.inputFile)
+        sys.exit(1)
+
+    outputFile = ROOT.TFile(Options.outputFile, "RECREATE")
+    if not outputFile:
+        print ('ERROR: Failed to open file %s'%Options.outputFile)
+        sys.exit(1)
+
+    outputFile.cd()
+    outputFile.mkdir("reconstruction/")
+    ODir = outputFile.GetDirectory("reconstruction/")
+    ODir.cd()
+    
+    CSCselections = Options.CSCsel.split("_")
+    CSC_eta = CSCselections[0]
+    if CSCselections[1] != "None":
+        CSC_sector = int (CSCselections[1])
+    else:
+        CSC_sector = CSCselections[1]
+        
+    TGCselections = Options.TGCsel.split("_")
+    TGC_eta = TGCselections[0]
+    if TGCselections[1] != "None":
+        TGC_sector = int (TGCselections[1])
+    else:
+        TGC_sector = TGCselections[1]
+        
+    #Filling
+    for i in range(inputTree.GetEntries()):
+        inputTree.GetEntry(i)
+        cscPRDHists = []
+        tgcPRDHists = []
+
+        # CSCs
+        if Options.doCSC == True:
+            if CSC_eta == "positive":
+                csc_eta_sel = lambda t: t.PRD_CSC_stationEta[ncscPRD] >= 0
+            elif CSC_eta == "negative":
+                csc_eta_sel = lambda t: t.PRD_CSC_stationEta[ncscPRD] < 0
+            else:
+                csc_eta_sel = lambda t: t.PRD_CSC_stationEta[ncscPRD] < 9
+
+            if CSC_sector == "None":
+                csc_sector_sel = lambda s: s.PRD_CSC_stationPhi[ncscPRD] < 10
+            else:
+                csc_sector_sel = lambda s: s.PRD_CSC_stationPhi[ncscPRD] == CSC_sector
+
+            for ncscPRD in range(0,len(inputTree.PRD_CSC_localPosX)):
+                cscPRDHists += [MyHistoFiller( chamber_name = "CSC_PRD", eta_sel = csc_eta_sel, sector_sel = csc_sector_sel )]
+                cscPRDHists[ncscPRD].fill(inputTree, ncscPRD)
+                
+
+                
+        # TGCs
+        if TGC_eta == "positive":
+            tgc_eta_sel = lambda t: t.PRD_TGC_stationEta[ntgcPRD] >= 0
+        elif TGC_eta == "negative":
+            tgc_eta_sel = lambda t: t.PRD_TGC_stationEta[ntgcPRD] < 0
+        else:
+            tgc_eta_sel = lambda t: t.PRD_TGC_stationEta[ntgcPRD] < 9
+
+        if TGC_sector == "None":
+            tgc_sector_sel = lambda s: s.PRD_TGC_stationPhi[ntgcPRD] < 51
+        else:
+            tgc_sector_sel = lambda s: s.PRD_TGC_stationPhi[ntgcPRD] == TGC_sector
+            
+        for ntgcPRD in range(0,len(inputTree.PRD_TGC_localPosX)):
+            tgcPRDHists += [MyHistoFiller( chamber_name = "TGC_PRD", eta_sel = tgc_eta_sel, sector_sel = tgc_sector_sel )]
+            tgcPRDHists[ntgcPRD].fill(inputTree, ntgcPRD)
+
+
+    #Writing
+    if Options.doCSC == True:
+        cscPRDHist = MyHistoFiller( chamber_name = "CSC_PRD", eta_sel = None, sector_sel = None )
+        cscPRDHist.write(ODir)
+    
+    tgcPRDHist = MyHistoFiller( chamber_name = "TGC_PRD", eta_sel = None, sector_sel = None )
+    tgcPRDHist.write(ODir)
+    
\ No newline at end of file
diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h
index 0089d7461b83..71e0bc6af411 100644
--- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h
+++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/NSWPRDValAlg.h
@@ -146,7 +146,7 @@ class NSWPRDValAlg: public AthAlgorithm
   Gaudi::Property<std::string> m_TGC_SDOContainerName{this, "TGC_SDOContainerName", "TGC_SDO" };
   Gaudi::Property<std::string> m_TGC_DigitContainerName{this, "TGC_DigitContainerName","TGC_DIGITS"  };
   Gaudi::Property<std::string> m_TGC_RDOContainerName{this,"TGC_RDOContainerName", "TGCRDO" };
-  Gaudi::Property<std::string> m_TGC_PRDContainerName{this, "TGC_PRDContainerName","TGCPRD" };
+  Gaudi::Property<std::string> m_TGC_PRDContainerName{this, "TGC_PRDContainerName","TGC_Measurements" };
 
   // Matching algorithm
  
-- 
GitLab


From d509600b2aeebb85569b63f9d70cc8411291b73e Mon Sep 17 00:00:00 2001
From: Tim Martin <Tim.Martin@cern.ch>
Date: Thu, 23 Sep 2021 15:32:40 +0200
Subject: [PATCH 290/347] Properly qualify default tool and service instances

---
 .../TrigDecisionTool/TrigDecisionTool/TrigDecisionTool.h      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/TrigDecisionTool.h b/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/TrigDecisionTool.h
index f3e1e3d77dea..1cf2aeb77c7b 100755
--- a/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/TrigDecisionTool.h
+++ b/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/TrigDecisionTool.h
@@ -118,12 +118,12 @@ namespace Trig {
     #if !defined(XAOD_STANDALONE) && !defined(XAOD_ANALYSIS) // Athena: Do not set a Config Tool by default (this tool is not thread safe, the service should be used in Athena)
     ToolHandle<TrigConf::ITrigConfigTool> m_configTool{this, "ConfigTool", ""}; 
     #else // AnalysisBase: Do set a Config Tool by default for analysis convienience 
-    ToolHandle<TrigConf::ITrigConfigTool> m_configTool{this, "ConfigTool", "TrigConf::xAODConfigTool"};
+    ToolHandle<TrigConf::ITrigConfigTool> m_configTool{this, "ConfigTool", "TrigConf::xAODConfigTool/xAODConfigTool"};
     #endif
 
     //full Athena
     #if !defined(XAOD_STANDALONE) && !defined(XAOD_ANALYSIS)
-    ServiceHandle<TrigConf::ITrigConfigSvc> m_configSvc{this, "TrigConfigSvc", "TrigConf::xAODConfigSvc"};    //!< trigger configuration service handle
+    ServiceHandle<TrigConf::ITrigConfigSvc> m_configSvc{this, "TrigConfigSvc", "TrigConf::xAODConfigSvc/xAODConfigSvc"};    //!< trigger configuration service handle
     ToolHandle<HLT::Navigation> m_fullNavigation{this, "Navigation", "HLT::Navigation/Navigation"};
 
     Gaudi::Property<bool> m_useOldEventInfoDecisionFormat {this, "UseOldEventInfoDecisionFormat", false,
-- 
GitLab


From fbf77cce2faec60aacba7b479a30b2dc966bab21 Mon Sep 17 00:00:00 2001
From: Andrew Mehta <andrew.mehta@cern.ch>
Date: Thu, 23 Sep 2021 15:41:34 +0200
Subject: [PATCH 291/347] Update version.txt

---
 Projects/AnalysisBase/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/AnalysisBase/version.txt b/Projects/AnalysisBase/version.txt
index 0225b4b60b12..2e33542fbc0f 100644
--- a/Projects/AnalysisBase/version.txt
+++ b/Projects/AnalysisBase/version.txt
@@ -1 +1 @@
-22.2.43
+22.2.44
-- 
GitLab


From 7bcaafce0fd092ccafd5043421914d6bb4fa9b8a Mon Sep 17 00:00:00 2001
From: Andrew Mehta <andrew.mehta@cern.ch>
Date: Thu, 23 Sep 2021 15:42:39 +0200
Subject: [PATCH 292/347] Update version.txt

---
 Projects/AthAnalysis/version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Projects/AthAnalysis/version.txt b/Projects/AthAnalysis/version.txt
index 0225b4b60b12..2e33542fbc0f 100644
--- a/Projects/AthAnalysis/version.txt
+++ b/Projects/AthAnalysis/version.txt
@@ -1 +1 @@
-22.2.43
+22.2.44
-- 
GitLab


From d830f25fbab59d1d5dc70c9d6540227a982775c3 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Thu, 23 Sep 2021 17:01:54 +0200
Subject: [PATCH 293/347] InDetReadoutGeometry+SCT_ConditionsAlgorithms:
 SiDetectorElementCollection should have mixed conditions.

---
 .../src/SCT_DetectorElementCondAlg.cxx                      | 6 +++++-
 .../InDetReadoutGeometry/SiDetectorElementCollection.h      | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DetectorElementCondAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DetectorElementCondAlg.cxx
index 71e32561880c..8dc7f623ac57 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DetectorElementCondAlg.cxx
+++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_DetectorElementCondAlg.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 "SCT_DetectorElementCondAlg.h"
@@ -8,6 +8,7 @@
 #include "InDetReadoutGeometry/SiDetectorElement.h"
 #include "TrkGeometry/Layer.h"
 #include "TrkSurfaces/Surface.h"
+#include "AthenaKernel/IOVInfiniteRange.h"
 
 #include <map>
 
@@ -75,6 +76,9 @@ StatusCode SCT_DetectorElementCondAlg::execute(const EventContext& ctx) const
     return StatusCode::FAILURE;
   }
 
+  // Make sure we make a mixed IOV.
+  writeHandle.addDependency (IOVInfiniteRange::infiniteMixed());
+  
   // Add dependency
   writeHandle.addDependency(readHandle);
   // Additional dependencies for IOV range to limit lifetime to TrackingGeometry lifetime
diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElementCollection.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElementCollection.h
index 3dc612481b30..8261a05f0280 100755
--- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElementCollection.h
+++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiDetectorElementCollection.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
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -38,6 +38,6 @@ namespace InDetDD {
 #include "AthenaKernel/CLASS_DEF.h"
 CLASS_DEF( InDetDD::SiDetectorElementCollection , 1330395642 , 1 )
 #include "AthenaKernel/CondCont.h"
-CONDCONT_DEF( InDetDD::SiDetectorElementCollection, 1098715294 );
+CONDCONT_MIXED_DEF( InDetDD::SiDetectorElementCollection, 1098715294 );
 
 #endif // INDETREADOUTGEOMETRY_SIDETECTORELEMENTCOLLECTION_H
-- 
GitLab


From d45392927742d9f2af4678a430399a70487ee652 Mon Sep 17 00:00:00 2001
From: Debottam Bakshi Gupta <debottam.bakshi.gupta@cern.ch>
Date: Thu, 23 Sep 2021 17:03:13 +0200
Subject: [PATCH 294/347] Switching off use of cached eventViews

---
 .../ITrigEgammaPrecisionTrackingHypoTool.h    |  10 +-
 .../TrigEgammaPrecisionTrackingHypoAlg.cxx    |  52 +++-
 .../src/TrigEgammaPrecisionTrackingHypoAlg.h  |   2 +-
 .../src/EventViewCreatorAlgorithm.cxx         |   2 +-
 .../ViewAlgs/src/EventViewCreatorAlgorithm.h  |   4 +
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 256 +++++++++---------
 .../share/ref_v1Dev_decodeBS_build.ref        |  38 +--
 .../TrigEDMConfig/python/TriggerEDMRun3.py    |   2 +-
 .../Egamma/PrecisionCaloMenuSequences.py      |   1 +
 .../Egamma/PrecisionCaloMenuSequences_LRT.py  |   1 +
 .../Egamma/PrecisionTrackingMenuSequences.py  |  34 +--
 .../PrecisionTrackingMenuSequences_LRT.py     |   9 +-
 .../Electron/PrecisionTrackingSequences.py    |   4 +-
 .../PrecisionTrackingSequences_LRT.py         |   4 +-
 .../Electron/generateElectron.py              |   2 +-
 15 files changed, 228 insertions(+), 193 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/ITrigEgammaPrecisionTrackingHypoTool.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/ITrigEgammaPrecisionTrackingHypoTool.h
index f3d54ccbf89a..968c772c63db 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/ITrigEgammaPrecisionTrackingHypoTool.h
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/ITrigEgammaPrecisionTrackingHypoTool.h
@@ -6,7 +6,7 @@
 
 #include "GaudiKernel/IAlgTool.h"
 #include "TrigCompositeUtils/TrigCompositeUtils.h"
-
+#include "xAODCaloEvent/CaloCluster.h"
 
 /**
  * @class Base for tools doing precision Tracking Hypo selection
@@ -22,13 +22,15 @@ class ITrigEgammaPrecisionTrackingHypoTool
     virtual ~ITrigEgammaPrecisionTrackingHypoTool(){}
 
     struct ClusterInfo {
-      ClusterInfo( TrigCompositeUtils::Decision* d, const TrigCompositeUtils::Decision* previousDecision )
-        : decision( d ), 
-        previousDecisionIDs( TrigCompositeUtils::decisionIDs( previousDecision ).begin(), 
+      ClusterInfo( TrigCompositeUtils::Decision* d, const xAOD::CaloCluster_v1* c, const TrigCompositeUtils::Decision* previousDecision )
+        : decision( d ),
+          cluster( c ),
+          previousDecisionIDs( TrigCompositeUtils::decisionIDs( previousDecision ).begin(), 
                              TrigCompositeUtils::decisionIDs( previousDecision ).end() )
       {}
     
       TrigCompositeUtils::Decision* decision;
+      const xAOD::CaloCluster_v1* cluster;
       const TrigCompositeUtils::DecisionIDContainer previousDecisionIDs;
     };
   
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionTrackingHypoAlg.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionTrackingHypoAlg.cxx
index 7a51e79b0f2c..db9c1c050b8e 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionTrackingHypoAlg.cxx
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionTrackingHypoAlg.cxx
@@ -17,8 +17,10 @@ TrigEgammaPrecisionTrackingHypoAlg::TrigEgammaPrecisionTrackingHypoAlg( const st
 
 
 StatusCode TrigEgammaPrecisionTrackingHypoAlg::initialize() {
+
+  ATH_CHECK( m_clustersKey.initialize() );
   ATH_CHECK( m_hypoTools.retrieve() );
-  
+  renounce( m_clustersKey );
   return StatusCode::SUCCESS;
 }
 
@@ -27,34 +29,60 @@ StatusCode TrigEgammaPrecisionTrackingHypoAlg::execute( const EventContext& cont
   auto previousDecisionsHandle = SG::makeHandle( decisionInput(), context );
   ATH_CHECK( previousDecisionsHandle.isValid() );
   ATH_MSG_DEBUG( "Running with "<< previousDecisionsHandle->size() <<" previous decisions");
-
-
+  ATH_MSG_DEBUG( "m_clustersKey: "<<m_clustersKey);
+  
   // new decisions
 
   // new output decisions
   SG::WriteHandle<TCU::DecisionContainer> outputHandle = TCU::createAndStore(decisionOutput(), context );
   TCU::DecisionContainer* outputDecision = outputHandle.ptr();
-
+ 
   // input for decision
   std::vector<ITrigEgammaPrecisionTrackingHypoTool::ClusterInfo> toolInput;
 
   // loop over previous decisions
   size_t counter=0;
   for ( const TCU::Decision* previousDecision: *previousDecisionsHandle ) {
-  
-    const auto featureEL = TCU::findLink<xAOD::CaloClusterContainer>( previousDecision, TCU::featureString() );
-    ATH_CHECK(featureEL.isValid());
-    auto d = TCU::newDecisionIn( outputDecision, TCU::hypoAlgNodeName() );
-    d->setObjectLink<xAOD::CaloClusterContainer>( TCU::featureString(),  featureEL.link );
+
+    std::vector< TCU::LinkInfo<ViewContainer> > previousViews = TCU::findLinks<ViewContainer>( previousDecision, TCU::viewString() );
+    ATH_CHECK( previousViews.size() >= 2);
+    const ElementLink<ViewContainer> viewEL = previousViews.at(1).link;
+    ATH_MSG_DEBUG( "viewEL.dataID(): "<<viewEL.dataID());
+    ATH_CHECK( viewEL.isValid() );
+    auto clusterHandle = ViewHelper::makeHandle( *(viewEL), m_clustersKey, context);
     
-    TCU::linkToPrevious( d, decisionInput().key(), counter );
-    toolInput.emplace_back( d, previousDecision );   
+    ATH_CHECK( clusterHandle.isValid() );
+    ATH_MSG_DEBUG ( "Cluster handle size: " << clusterHandle->size() << "..." );
+    // Loop over the clusterHandles
+    size_t validclusters=0;
+    for (size_t cl=0; cl< clusterHandle->size(); cl++){
+	{
+	    auto el = ViewHelper::makeLink( *(viewEL), clusterHandle, cl );
+	    
+            ATH_MSG_DEBUG ( "Checking el.isValid()...");
+	    if( !el.isValid() ) {
+		ATH_MSG_DEBUG ( "ClusterHandle in position " << cl << " -> invalid ElemntLink!. Skipping...");
+	    }
+	    ATH_CHECK(el.isValid());
+
+	    ATH_MSG_DEBUG ( "ClusterHandle in position " << cl << " processing...");
+	    auto d = TCU::newDecisionIn( outputDecision, TCU::hypoAlgNodeName() );
+	    d->setObjectLink( TCU::featureString(),  el );
+	    TCU::linkToPrevious( d, decisionInput().key(), counter );
+	    toolInput.emplace_back( d, clusterHandle.cptr()->at(cl), previousDecision );
+	    validclusters++;
+
 
-    ATH_MSG_DEBUG( "previous decision to new decision " << counter << " for roi " );
+	}
+    }
+
+    ATH_MSG_DEBUG( "Clusters with valid links: " << validclusters );
+    
     counter++;
 
   }
 
+
   ATH_MSG_DEBUG( "Found "<<toolInput.size()<<" inputs to tools");
 
    
diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionTrackingHypoAlg.h b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionTrackingHypoAlg.h
index 89b91bfb5d80..2b13d1a77320 100644
--- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionTrackingHypoAlg.h
+++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEgammaPrecisionTrackingHypoAlg.h
@@ -22,7 +22,7 @@ class TrigEgammaPrecisionTrackingHypoAlg : public ::HypoBase {
 
   private: 
     ToolHandleArray< ITrigEgammaPrecisionTrackingHypoTool > m_hypoTools { this, "HypoTools", {}, "Hypo tools" };
-      
+    SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clustersKey { this, "CaloClusters", "CaloClusters", "CaloClusters in previous views" };       
 
 }; 
 
diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx
index dcf58121d064..9051f3ca0dd5 100644
--- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx
+++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.cxx
@@ -168,7 +168,7 @@ StatusCode EventViewCreatorAlgorithm::execute( const EventContext& context ) con
 }
 
 bool EventViewCreatorAlgorithm::checkCache(const DecisionContainer* cachedViews, const Decision* outputDecision, size_t& cachedIndex) const {
-  if (cachedViews == nullptr) {
+  if (cachedViews == nullptr or m_cacheDisabled) {
     return false; // No cached input configured, which is fine.
   }
   return matchInCollection(cachedViews, outputDecision, cachedIndex);
diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h
index 8dc77e270090..649fd5d6403f 100644
--- a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h
+++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithm.h
@@ -104,6 +104,10 @@ class EventViewCreatorAlgorithm : public ::InputMakerBase
     Gaudi::Property< bool > m_placeJetInView { this, "PlaceJetInView", false, 
       "Jet slice specific option. Place Jet inside newly spawned View instance. See also InViewJets" };
 
+    //switch off the use of cached EventViews
+     Gaudi::Property< bool > m_cacheDisabled { this, "CacheDisabled", false,
+      "Set whether cached EventViews are to be accessed" };
+
     // TODO. In the next iteration, start to use this. Remove "_PROPERTY" which is there to catch against algs with identical properties
     SG::WriteHandleKey< xAOD::JetContainer > m_inViewJets {this,"InViewJets","", 
       "Name with which the Jet should be inserted into the views"};
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 281632ff5015..748d81c1aeeb 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -64,7 +64,7 @@ HLT_2e5_lhmedium_j70_0eta320_j50_0eta490_j0_DJMASS900j50_L1MJJ-500-NFF:
     0: 8
     1: 19
     2: 5
-    3: 4
+    3: 7
     4: 1
 HLT_2e5_lhvloose_bBeeM6000_L12EM3:
   eventCount: 0
@@ -77,7 +77,7 @@ HLT_2e5_lhvloose_bBeeM6000_L12EM3:
     0: 50
     1: 104
     2: 14
-    3: 10
+    3: 25
     4: 3
 HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
   eventCount: 0
@@ -90,7 +90,7 @@ HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
     0: 18
     1: 50
     2: 4
-    3: 2
+    3: 9
 HLT_2g10_loose_mu20_L1MU14FCH:
   eventCount: 0
   stepCounts:
@@ -1691,7 +1691,7 @@ HLT_e10_lhmedium_ivarloose_j70_0eta320_j50_0eta490_j0_DJMASS900j50_L1MJJ-500-NFF
     0: 2
     1: 7
     2: 2
-    3: 2
+    3: 4
     4: 1
 HLT_e10_lhvloose_L1EM7:
   eventCount: 7
@@ -1705,7 +1705,7 @@ HLT_e10_lhvloose_L1EM7:
     0: 16
     1: 50
     2: 11
-    3: 11
+    3: 23
     4: 8
 HLT_e120_etcut_L1EM22VHI:
   eventCount: 2
@@ -1718,7 +1718,7 @@ HLT_e120_etcut_L1EM22VHI:
     0: 5
     1: 39
     2: 5
-    3: 5
+    3: 8
 HLT_e120_lhvloose_L1EM22VHI:
   eventCount: 1
   stepCounts:
@@ -1756,7 +1756,7 @@ HLT_e140_lhloose_noringer_L1EM22VHI:
     0: 3
     1: 31
     2: 3
-    3: 3
+    3: 6
 HLT_e14_lhtight_e4_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
 HLT_e14_lhtight_e4_etcut_Jpsiee_L1JPSI-1M5-EM12:
@@ -1783,7 +1783,7 @@ HLT_e15_lhvloose_L1EM10VH:
     0: 11
     1: 19
     2: 7
-    3: 7
+    3: 16
     4: 7
 HLT_e17_lhloose_mu14_L1EM15VH_MU8F:
   eventCount: 2
@@ -1801,7 +1801,7 @@ HLT_e17_lhloose_mu14_L1EM15VH_MU8F:
     0: 5
     1: 9
     2: 5
-    3: 5
+    3: 7
     4: 5
     5: 5
     6: 2
@@ -1825,7 +1825,7 @@ HLT_e17_lhmedium_ivarloose_tau25_medium1_tracktwo_03dRAB_L1EM15VHI_2TAU12IM_4J12
     0: 4
     1: 6
     2: 4
-    3: 4
+    3: 6
     4: 4
     5: 12
     6: 12
@@ -1850,7 +1850,7 @@ HLT_e17_lhmedium_ivarloose_tau25_mediumRNN_tracktwoMVABDT_03dRAB_L1EM15VHI_2TAU1
     0: 4
     1: 6
     2: 4
-    3: 4
+    3: 6
     4: 4
     5: 12
     6: 12
@@ -1874,7 +1874,7 @@ HLT_e17_lhmedium_ivarloose_tau25_mediumRNN_tracktwoMVA_03dRAB_L1EM15VHI_2TAU12IM
     0: 4
     1: 6
     2: 4
-    3: 4
+    3: 6
     4: 4
     5: 12
     6: 12
@@ -1898,7 +1898,7 @@ HLT_e17_lhmedium_tau25_mediumRNN_tracktwoMVABDT_xe50_cell_03dRAB_L1EM15VHI_2TAU1
     0: 2
     1: 2
     2: 2
-    3: 2
+    3: 3
     4: 2
     5: 7
     6: 7
@@ -1923,7 +1923,7 @@ HLT_e17_lhmedium_tau25_mediumRNN_tracktwoMVA_xe50_cell_03dRAB_L1EM15VHI_2TAU12IM
     0: 2
     1: 2
     2: 2
-    3: 2
+    3: 3
     4: 2
     5: 7
     6: 7
@@ -1943,7 +1943,7 @@ HLT_e20_lhloose_L1EM7:
     0: 7
     1: 11
     2: 6
-    3: 6
+    3: 9
     4: 6
 HLT_e20_lhloose_L1EM7_AFP_A_AND_C:
   eventCount: 0
@@ -1963,7 +1963,7 @@ HLT_e20_lhvloose_L1EM15VH:
     0: 7
     1: 11
     2: 6
-    3: 6
+    3: 9
     4: 6
 HLT_e24_lhmedium_g12_loose_g12_loose_02dRAB_02dRAC_L1EM20VH_3EM10VH:
   eventCount: 0
@@ -1975,7 +1975,7 @@ HLT_e24_lhmedium_g12_loose_g12_loose_02dRAB_02dRAC_L1EM20VH_3EM10VH:
     0: 31
     1: 21
     2: 19
-    3: 8
+    3: 9
 HLT_e24_lhmedium_g25_medium_02dRAB_L12EM20VH:
   eventCount: 1
   stepCounts:
@@ -1988,7 +1988,7 @@ HLT_e24_lhmedium_g25_medium_02dRAB_L12EM20VH:
     0: 14
     1: 7
     2: 7
-    3: 5
+    3: 6
     4: 1
 HLT_e24_lhmedium_ivarloose_tau20_medium1_tracktwo_03dRAB_L1EM22VHI:
   eventCount: 3
@@ -2008,7 +2008,7 @@ HLT_e24_lhmedium_ivarloose_tau20_medium1_tracktwo_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 20
     6: 20
@@ -2033,7 +2033,7 @@ HLT_e24_lhmedium_ivarloose_tau20_mediumRNN_tracktwoMVABDT_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 22
     6: 22
@@ -2057,7 +2057,7 @@ HLT_e24_lhmedium_ivarloose_tau20_mediumRNN_tracktwoMVA_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 22
     6: 22
@@ -2078,7 +2078,7 @@ HLT_e24_lhmedium_mu8noL1_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 3
     6: 3
@@ -2094,7 +2094,7 @@ HLT_e24_lhtight_ivarloose_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e24_lhvloose_2e12_lhvloose_L1EM20VH_3EM10VH:
   eventCount: 0
@@ -2107,7 +2107,7 @@ HLT_e24_lhvloose_2e12_lhvloose_L1EM20VH_3EM10VH:
     0: 8
     1: 4
     2: 4
-    3: 4
+    3: 7
     4: 3
 HLT_e250_etcut_L1EM22VHI:
   eventCount: 1
@@ -2120,7 +2120,7 @@ HLT_e250_etcut_L1EM22VHI:
     0: 2
     1: 27
     2: 2
-    3: 2
+    3: 5
 HLT_e25_mergedtight_g35_medium_Heg_02dRAB_L12EM20VH:
   eventCount: 0
   stepCounts:
@@ -2132,7 +2132,7 @@ HLT_e25_mergedtight_g35_medium_Heg_02dRAB_L12EM20VH:
     0: 22
     1: 70
     2: 22
-    3: 15
+    3: 31
     4: 3
 HLT_e26_dnnloose_L1EM22VHI:
   eventCount: 5
@@ -2146,7 +2146,7 @@ HLT_e26_dnnloose_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e26_dnnmedium_L1EM22VHI:
   eventCount: 4
@@ -2160,7 +2160,7 @@ HLT_e26_dnnmedium_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 4
 HLT_e26_dnntight_L1EM22VHI:
   eventCount: 4
@@ -2174,7 +2174,7 @@ HLT_e26_dnntight_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 4
 HLT_e26_gsf_dnntight_ivarloose_L1EM22VHI:
   eventCount: 4
@@ -2188,7 +2188,7 @@ HLT_e26_gsf_dnntight_ivarloose_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 4
 HLT_e26_gsf_lhtight_ivarloose_L1EM22VHI:
   eventCount: 5
@@ -2202,7 +2202,7 @@ HLT_e26_gsf_lhtight_ivarloose_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e26_idperf_gsf_tight_L1EM22VHI:
   eventCount: 5
@@ -2216,7 +2216,7 @@ HLT_e26_idperf_gsf_tight_L1EM22VHI:
     0: 6
     1: 6
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e26_idperf_loose_L1EM24VHI:
   eventCount: 5
@@ -2230,7 +2230,7 @@ HLT_e26_idperf_loose_L1EM24VHI:
     0: 6
     1: 6
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e26_idperf_loose_lrtloose_L1EM22VHI:
   eventCount: 5
@@ -2244,7 +2244,7 @@ HLT_e26_idperf_loose_lrtloose_L1EM22VHI:
     0: 6
     1: 6
     2: 5
-    3: 5
+    3: 25
     4: 5
 HLT_e26_idperf_tight_L1EM22VHI:
   eventCount: 5
@@ -2258,7 +2258,7 @@ HLT_e26_idperf_tight_L1EM22VHI:
     0: 6
     1: 6
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e26_lhloose_nopix_lrttight_L1EM22VHI:
   eventCount: 0
@@ -2271,7 +2271,7 @@ HLT_e26_lhloose_nopix_lrttight_L1EM22VHI:
     0: 6
     1: 2
     2: 2
-    3: 2
+    3: 9
 HLT_e26_lhloose_nopix_lrttight_probe_g25_medium_L1EM20VH:
   eventCount: 0
 HLT_e26_lhmedium_mu8noL1_L1EM22VHI:
@@ -2288,7 +2288,7 @@ HLT_e26_lhmedium_mu8noL1_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 3
     6: 3
@@ -2303,7 +2303,7 @@ HLT_e26_lhmedium_nopix_lrttight_L1EM22VHI:
     0: 6
     1: 2
     2: 2
-    3: 2
+    3: 9
 HLT_e26_lhtight_L1EM22VHI:
   eventCount: 5
   stepCounts:
@@ -2316,7 +2316,7 @@ HLT_e26_lhtight_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e26_lhtight_e15_etcut_50invmAB130_L1EM22VHI:
   eventCount: 4
@@ -2330,7 +2330,7 @@ HLT_e26_lhtight_e15_etcut_50invmAB130_L1EM22VHI:
     0: 34
     1: 87
     2: 23
-    3: 19
+    3: 42
     4: 4
 HLT_e26_lhtight_e15_etcut_L1EM22VHI:
   eventCount: 4
@@ -2344,7 +2344,7 @@ HLT_e26_lhtight_e15_etcut_L1EM22VHI:
     0: 34
     1: 87
     2: 23
-    3: 19
+    3: 42
     4: 4
 HLT_e26_lhtight_e15_etcut_Zee_L1EM22VHI:
   eventCount: 4
@@ -2358,7 +2358,7 @@ HLT_e26_lhtight_e15_etcut_Zee_L1EM22VHI:
     0: 34
     1: 87
     2: 23
-    3: 19
+    3: 42
     4: 4
 HLT_e26_lhtight_e15_etcut_idperf_Zee_L1EM22VHI:
   eventCount: 4
@@ -2372,7 +2372,7 @@ HLT_e26_lhtight_e15_etcut_idperf_Zee_L1EM22VHI:
     0: 34
     1: 26
     2: 23
-    3: 19
+    3: 42
     4: 4
 HLT_e26_lhtight_e15_etcut_probe_50invmAB130_L1EM22VHI:
   eventCount: 4
@@ -2390,12 +2390,12 @@ HLT_e26_lhtight_e15_etcut_probe_50invmAB130_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 18
     6: 74
     7: 17
-    8: 15
+    8: 36
 HLT_e26_lhtight_ivarloose_2j20_0eta290_020jvt_pf_ftf_boffperf_L1EM22VHI:
   eventCount: 5
   stepCounts:
@@ -2411,7 +2411,7 @@ HLT_e26_lhtight_ivarloose_2j20_0eta290_020jvt_pf_ftf_boffperf_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 5
     6: 31
@@ -2428,7 +2428,7 @@ HLT_e26_lhtight_ivarloose_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e26_lhtight_ivarloose_L1eEM22M:
   eventCount: 0
@@ -2451,12 +2451,12 @@ HLT_e26_lhtight_ivarloose_e12_lhvloose_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 7
     6: 3
     7: 3
-    8: 3
+    8: 5
     9: 2
 HLT_e26_lhtight_ivarloose_e14_etcut_probe_L1EM22VHI:
   eventCount: 4
@@ -2474,12 +2474,12 @@ HLT_e26_lhtight_ivarloose_e14_etcut_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 18
     6: 74
     7: 20
-    8: 17
+    8: 41
 HLT_e26_lhtight_ivarloose_e14_lhtight_noringer_probe_L1EM22VHI:
   eventCount: 0
   stepCounts:
@@ -2490,19 +2490,19 @@ HLT_e26_lhtight_ivarloose_e14_lhtight_noringer_probe_L1EM22VHI:
     4: 5
     5: 3
     6: 3
-    7: 2
-    8: 2
+    7: 3
+    8: 3
   stepFeatures:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 11
     6: 19
     7: 6
-    8: 5
-    9: 2
+    8: 11
+    9: 3
 HLT_e26_lhtight_ivarloose_e14_lhtight_probe_L1EM22VHI:
   eventCount: 0
   stepCounts:
@@ -2513,15 +2513,19 @@ HLT_e26_lhtight_ivarloose_e14_lhtight_probe_L1EM22VHI:
     4: 5
     5: 1
     6: 1
+    7: 1
+    8: 1
   stepFeatures:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 7
     6: 3
     7: 1
+    8: 2
+    9: 1
 HLT_e26_lhtight_ivarloose_e15_etcut_idperf_probe_L1EM22VHI:
   eventCount: 4
   stepCounts:
@@ -2538,12 +2542,12 @@ HLT_e26_lhtight_ivarloose_e15_etcut_idperf_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 18
     6: 17
     7: 17
-    8: 15
+    8: 36
 HLT_e26_lhtight_ivarloose_e15_etcut_probe_L1EM22VHI:
   eventCount: 4
   stepCounts:
@@ -2560,12 +2564,12 @@ HLT_e26_lhtight_ivarloose_e15_etcut_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 18
     6: 74
     7: 17
-    8: 15
+    8: 36
 HLT_e26_lhtight_ivarloose_e17_lhvloose_probe_L1EM22VHI:
   eventCount: 0
   stepCounts:
@@ -2578,7 +2582,7 @@ HLT_e26_lhtight_ivarloose_e17_lhvloose_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 5
 HLT_e26_lhtight_ivarloose_e20_lhtight_ivarloose_probe_L1EM22VHI:
@@ -2593,7 +2597,7 @@ HLT_e26_lhtight_ivarloose_e20_lhtight_ivarloose_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 5
 HLT_e26_lhtight_ivarloose_e24_lhvloose_probe_L1EM22VHI:
@@ -2608,7 +2612,7 @@ HLT_e26_lhtight_ivarloose_e24_lhvloose_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 5
 HLT_e26_lhtight_ivarloose_e26_lhloose_nopix_lrttight_probe_L1EM22VHI:
@@ -2623,7 +2627,7 @@ HLT_e26_lhtight_ivarloose_e26_lhloose_nopix_lrttight_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 5
 HLT_e26_lhtight_ivarloose_e26_lhtight_probe_L1EM22VHI:
@@ -2638,7 +2642,7 @@ HLT_e26_lhtight_ivarloose_e26_lhtight_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 5
 HLT_e26_lhtight_ivarloose_e4_etcut_probe_L1EM22VHI:
@@ -2657,12 +2661,12 @@ HLT_e26_lhtight_ivarloose_e4_etcut_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 49
     6: 151
     7: 80
-    8: 41
+    8: 118
 HLT_e26_lhtight_ivarloose_e5_lhtight_noringer_probe_L1EM22VHI:
   eventCount: 1
   stepCounts:
@@ -2680,12 +2684,12 @@ HLT_e26_lhtight_ivarloose_e5_lhtight_noringer_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 23
     6: 69
     7: 22
-    8: 18
+    8: 40
     9: 6
 HLT_e26_lhtight_ivarloose_e5_lhtight_probe_L1EM22VHI:
   eventCount: 1
@@ -2697,22 +2701,22 @@ HLT_e26_lhtight_ivarloose_e5_lhtight_probe_L1EM22VHI:
     4: 5
     5: 5
     6: 4
-    7: 2
-    8: 2
+    7: 4
+    8: 4
     9: 1
   stepFeatures:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 18
     6: 26
     7: 10
-    8: 8
-    9: 3
+    8: 18
+    9: 5
 HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:
-  eventCount: 3
+  eventCount: 5
   stepCounts:
     0: 6
     1: 6
@@ -2721,20 +2725,20 @@ HLT_e26_lhtight_ivarloose_e5_lhvloose_idperf_probe_L1EM22VHI:
     4: 5
     5: 5
     6: 5
-    7: 3
-    8: 3
-    9: 3
+    7: 5
+    8: 5
+    9: 5
   stepFeatures:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 19
     6: 16
     7: 12
-    8: 10
-    9: 10
+    8: 23
+    9: 12
 HLT_e26_lhtight_ivarloose_e5_lhvloose_nopix_lrtloose_idperf_probe_L1EM22VHI:
   eventCount: 5
   stepCounts:
@@ -2752,12 +2756,12 @@ HLT_e26_lhtight_ivarloose_e5_lhvloose_nopix_lrtloose_idperf_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 19
     6: 19
     7: 11
-    8: 11
+    8: 59
     9: 11
 HLT_e26_lhtight_ivarloose_e9_etcut_probe_L1EM22VHI:
   eventCount: 5
@@ -2775,12 +2779,12 @@ HLT_e26_lhtight_ivarloose_e9_etcut_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 22
     6: 96
     7: 31
-    8: 22
+    8: 57
 HLT_e26_lhtight_ivarloose_e9_lhtight_noringer_probe_L1EM22VHI:
   eventCount: 1
   stepCounts:
@@ -2798,12 +2802,12 @@ HLT_e26_lhtight_ivarloose_e9_lhtight_noringer_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 16
     6: 57
     7: 17
-    8: 16
+    8: 37
     9: 6
 HLT_e26_lhtight_ivarloose_e9_lhtight_probe_L1EM22VHI:
   eventCount: 1
@@ -2822,12 +2826,12 @@ HLT_e26_lhtight_ivarloose_e9_lhtight_probe_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 8
     6: 10
     7: 5
-    8: 5
+    8: 9
     9: 3
 HLT_e26_lhtight_ivarloose_noringer_L1EM22VHI:
   eventCount: 5
@@ -2841,7 +2845,7 @@ HLT_e26_lhtight_ivarloose_noringer_L1EM22VHI:
     0: 7
     1: 15
     2: 7
-    3: 7
+    3: 13
     4: 5
 HLT_e26_lhtight_ivarloose_tau100_mediumRNN_tracktwoLLP_03dRAB_L1EM22VHI:
   eventCount: 0
@@ -2949,7 +2953,7 @@ HLT_e26_lhtight_ivarloose_tau20_mediumRNN_tracktwoMVABDT_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 22
     6: 22
@@ -2973,7 +2977,7 @@ HLT_e26_lhtight_ivarloose_tau20_mediumRNN_tracktwoMVA_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 22
     6: 22
@@ -2997,7 +3001,7 @@ HLT_e26_lhtight_ivarloose_tau25_mediumRNN_tracktwoMVABDT_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 13
     6: 13
@@ -3021,7 +3025,7 @@ HLT_e26_lhtight_ivarloose_tau25_mediumRNN_tracktwoMVA_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 13
     6: 13
@@ -3045,7 +3049,7 @@ HLT_e26_lhtight_ivarloose_tau35_mediumRNN_tracktwoMVABDT_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 11
     6: 11
@@ -3069,7 +3073,7 @@ HLT_e26_lhtight_ivarloose_tau35_mediumRNN_tracktwoMVA_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 11
     6: 11
@@ -3093,7 +3097,7 @@ HLT_e26_lhtight_ivarloose_tau40_mediumRNN_tracktwoMVABDT_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 11
     6: 11
@@ -3117,7 +3121,7 @@ HLT_e26_lhtight_ivarloose_tau40_mediumRNN_tracktwoMVA_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 11
     6: 11
@@ -3140,7 +3144,7 @@ HLT_e26_lhtight_ivarloose_tau60_mediumRNN_tracktwoLLP_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 6
     6: 6
@@ -3163,7 +3167,7 @@ HLT_e26_lhtight_ivarloose_tau60_mediumRNN_tracktwoMVABDT_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 6
     6: 6
@@ -3186,7 +3190,7 @@ HLT_e26_lhtight_ivarloose_tau60_mediumRNN_tracktwoMVA_03dRAB_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 6
     6: 6
@@ -3274,7 +3278,7 @@ HLT_e26_lhtight_ivarmedium_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e26_lhtight_ivartight_L1EM22VHI:
   eventCount: 5
@@ -3288,7 +3292,7 @@ HLT_e26_lhtight_ivartight_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e28_idperf_loose_L1EM24VHI:
   eventCount: 5
@@ -3302,7 +3306,7 @@ HLT_e28_idperf_loose_L1EM24VHI:
     0: 6
     1: 6
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e28_lhmedium_mu8noL1_L1EM24VHI:
   eventCount: 3
@@ -3318,7 +3322,7 @@ HLT_e28_lhmedium_mu8noL1_L1EM24VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
     5: 3
     6: 3
@@ -3333,7 +3337,7 @@ HLT_e300_etcut_L1EM22VHI:
     0: 1
     1: 13
     2: 1
-    3: 1
+    3: 2
 HLT_e300_etcut_L1eEM22M:
   eventCount: 1
   stepCounts:
@@ -3345,7 +3349,7 @@ HLT_e300_etcut_L1eEM22M:
     0: 1
     1: 13
     2: 1
-    3: 1
+    3: 2
 HLT_e30_lhvloose_L1EM22VHI:
   eventCount: 5
   stepCounts:
@@ -3358,7 +3362,7 @@ HLT_e30_lhvloose_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e40_lhvloose_L1EM22VHI:
   eventCount: 5
@@ -3372,7 +3376,7 @@ HLT_e40_lhvloose_L1EM22VHI:
     0: 6
     1: 10
     2: 5
-    3: 5
+    3: 8
     4: 5
 HLT_e50_etcut_L1EM22VHI:
   eventCount: 6
@@ -3385,7 +3389,7 @@ HLT_e50_etcut_L1EM22VHI:
     0: 12
     1: 79
     2: 11
-    3: 11
+    3: 28
 HLT_e5_dnnloose_L1EM3:
   eventCount: 7
   stepCounts:
@@ -3398,7 +3402,7 @@ HLT_e5_dnnloose_L1EM3:
     0: 48
     1: 92
     2: 25
-    3: 23
+    3: 54
     4: 7
 HLT_e5_dnnmedium_L1EM3:
   eventCount: 6
@@ -3412,7 +3416,7 @@ HLT_e5_dnnmedium_L1EM3:
     0: 48
     1: 89
     2: 25
-    3: 23
+    3: 54
     4: 6
 HLT_e5_dnntight_L1EM3:
   eventCount: 6
@@ -3426,7 +3430,7 @@ HLT_e5_dnntight_L1EM3:
     0: 47
     1: 85
     2: 24
-    3: 22
+    3: 51
     4: 6
 HLT_e5_etcut_L1eEM3:
   eventCount: 18
@@ -3439,7 +3443,7 @@ HLT_e5_etcut_L1eEM3:
     0: 138
     1: 437
     2: 207
-    3: 94
+    3: 269
 HLT_e5_idperf_gsf_tight_L1EM3:
   eventCount: 13
   stepCounts:
@@ -3452,7 +3456,7 @@ HLT_e5_idperf_gsf_tight_L1EM3:
     0: 47
     1: 42
     2: 24
-    3: 22
+    3: 51
     4: 22
 HLT_e5_idperf_loose_L1EM3:
   eventCount: 13
@@ -3466,7 +3470,7 @@ HLT_e5_idperf_loose_L1EM3:
     0: 48
     1: 43
     2: 25
-    3: 23
+    3: 54
     4: 23
 HLT_e5_idperf_loose_lrtloose_L1EM3:
   eventCount: 15
@@ -3480,7 +3484,7 @@ HLT_e5_idperf_loose_lrtloose_L1EM3:
     0: 48
     1: 48
     2: 25
-    3: 24
+    3: 150
     4: 24
 HLT_e5_idperf_medium_L1EM3:
   eventCount: 13
@@ -3494,7 +3498,7 @@ HLT_e5_idperf_medium_L1EM3:
     0: 48
     1: 43
     2: 25
-    3: 23
+    3: 54
     4: 23
 HLT_e5_idperf_tight_L1EM3:
   eventCount: 13
@@ -3508,7 +3512,7 @@ HLT_e5_idperf_tight_L1EM3:
     0: 47
     1: 42
     2: 24
-    3: 22
+    3: 51
     4: 22
 HLT_e5_lhtight_e14_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
@@ -3545,7 +3549,7 @@ HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
     0: 16
     1: 50
     2: 18
-    3: 15
+    3: 41
     4: 9
 HLT_e5_lhvloose_j70_0eta320_j50_0eta490_j0_DJMASS1000j50_xe50_tcpufit_L1MJJ-500-NFF:
   eventCount: 0
@@ -3559,7 +3563,7 @@ HLT_e5_lhvloose_j70_0eta320_j50_0eta490_j0_DJMASS1000j50_xe50_tcpufit_L1MJJ-500-
     0: 9
     1: 22
     2: 5
-    3: 5
+    3: 10
     4: 2
 HLT_e5_lhvloose_nopix_lrtloose_idperf_probe_g25_medium_L1EM20VH:
   eventCount: 0
@@ -3661,7 +3665,7 @@ HLT_e60_lhmedium_noringer_L1EM22VHI:
     0: 4
     1: 10
     2: 4
-    3: 4
+    3: 7
     4: 2
 HLT_e60_lhvloose_L1EM22VHI:
   eventCount: 2
@@ -3709,7 +3713,7 @@ HLT_e7_lhmedium_mu24_L1MU14FCH:
     0: 9
     1: 17
     2: 4
-    3: 4
+    3: 15
     4: 3
     5: 3
     6: 1
@@ -3754,7 +3758,7 @@ HLT_e9_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
     0: 16
     1: 50
     2: 11
-    3: 11
+    3: 23
     4: 8
 HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
   eventCount: 0
@@ -3780,7 +3784,7 @@ HLT_e9_lhvloose_mu20_mu8noL1_L1MU14FCH:
     0: 5
     1: 14
     2: 3
-    3: 3
+    3: 10
     4: 3
     5: 3
     6: 1
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 9910211be1b0..fb6cc5864b69 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -33,7 +33,7 @@ HLT_2e5_lhvloose_bBeeM6000_L12EM3:
     0: 47
     1: 49
     2: 4
-    3: 4
+    3: 5
 HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
   eventCount: 0
   stepCounts:
@@ -653,7 +653,7 @@ HLT_e10_lhvloose_L1EM7:
     0: 8
     1: 17
     2: 2
-    3: 2
+    3: 3
 HLT_e120_etcut_L1EM22VHI:
   eventCount: 0
 HLT_e120_lhvloose_L1EM22VHI:
@@ -917,7 +917,7 @@ HLT_e5_dnnloose_L1EM3:
     0: 47
     1: 62
     2: 13
-    3: 12
+    3: 16
 HLT_e5_dnnmedium_L1EM3:
   eventCount: 0
   stepCounts:
@@ -929,7 +929,7 @@ HLT_e5_dnnmedium_L1EM3:
     0: 48
     1: 62
     2: 13
-    3: 12
+    3: 16
 HLT_e5_dnntight_L1EM3:
   eventCount: 0
   stepCounts:
@@ -941,7 +941,7 @@ HLT_e5_dnntight_L1EM3:
     0: 41
     1: 51
     2: 10
-    3: 9
+    3: 12
 HLT_e5_etcut_L1eEM3:
   eventCount: 28
   stepCounts:
@@ -953,7 +953,7 @@ HLT_e5_etcut_L1eEM3:
     0: 139
     1: 154
     2: 102
-    3: 72
+    3: 137
 HLT_e5_idperf_gsf_tight_L1EM3:
   eventCount: 11
   stepCounts:
@@ -966,7 +966,7 @@ HLT_e5_idperf_gsf_tight_L1EM3:
     0: 41
     1: 30
     2: 14
-    3: 13
+    3: 18
     4: 13
 HLT_e5_idperf_loose_L1EM3:
   eventCount: 13
@@ -980,7 +980,7 @@ HLT_e5_idperf_loose_L1EM3:
     0: 47
     1: 35
     2: 17
-    3: 16
+    3: 22
     4: 16
 HLT_e5_idperf_loose_lrtloose_L1EM3:
   eventCount: 15
@@ -994,7 +994,7 @@ HLT_e5_idperf_loose_lrtloose_L1EM3:
     0: 47
     1: 46
     2: 21
-    3: 20
+    3: 86
     4: 20
 HLT_e5_idperf_medium_L1EM3:
   eventCount: 13
@@ -1008,7 +1008,7 @@ HLT_e5_idperf_medium_L1EM3:
     0: 48
     1: 36
     2: 17
-    3: 16
+    3: 22
     4: 16
 HLT_e5_idperf_tight_L1EM3:
   eventCount: 11
@@ -1022,7 +1022,7 @@ HLT_e5_idperf_tight_L1EM3:
     0: 41
     1: 30
     2: 14
-    3: 13
+    3: 18
     4: 13
 HLT_e5_lhtight_e14_etcut_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
@@ -1081,7 +1081,7 @@ HLT_e5_lhtight_noringer_e14_etcut_1invmAB5_L1JPSI-1M5-EM12:
     0: 4
     1: 11
     2: 2
-    3: 2
+    3: 6
 HLT_e5_lhtight_noringer_e14_etcut_Jpsiee_L1JPSI-1M5-EM12:
   eventCount: 0
   stepCounts:
@@ -1093,7 +1093,7 @@ HLT_e5_lhtight_noringer_e14_etcut_Jpsiee_L1JPSI-1M5-EM12:
     0: 4
     1: 11
     2: 2
-    3: 2
+    3: 6
 HLT_e5_lhtight_noringer_e14_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
   eventCount: 0
   stepCounts:
@@ -1105,7 +1105,7 @@ HLT_e5_lhtight_noringer_e14_etcut_probe_1invmAB5_L1JPSI-1M5-EM12:
     0: 3
     1: 4
     2: 1
-    3: 1
+    3: 3
 HLT_e5_lhtight_noringer_e9_etcut_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
   stepCounts:
@@ -1117,7 +1117,7 @@ HLT_e5_lhtight_noringer_e9_etcut_1invmAB5_L1JPSI-1M5-EM7:
     0: 6
     1: 11
     2: 4
-    3: 2
+    3: 6
 HLT_e5_lhtight_noringer_e9_etcut_Jpsiee_L1JPSI-1M5-EM7:
   eventCount: 0
   stepCounts:
@@ -1129,7 +1129,7 @@ HLT_e5_lhtight_noringer_e9_etcut_Jpsiee_L1JPSI-1M5-EM7:
     0: 6
     1: 11
     2: 4
-    3: 2
+    3: 6
 HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
   stepCounts:
@@ -1141,7 +1141,7 @@ HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
     0: 5
     1: 8
     2: 2
-    3: 2
+    3: 8
 HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
   eventCount: 0
   stepCounts:
@@ -1153,7 +1153,7 @@ HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
     0: 9
     1: 19
     2: 6
-    3: 5
+    3: 7
 HLT_e5_lhvloose_j70_0eta320_j50_0eta490_j0_DJMASS1000j50_xe50_tcpufit_L1MJJ-500-NFF:
   eventCount: 0
 HLT_e5_lhvloose_nopix_lrtloose_idperf_probe_g25_medium_L1EM20VH:
@@ -1217,7 +1217,7 @@ HLT_e9_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
     0: 7
     1: 16
     2: 2
-    3: 2
+    3: 3
 HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
   eventCount: 0
   stepFeatures:
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index cec1ebad8146..f11025c7574a 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -276,7 +276,7 @@ TriggerHLTListRun3 = [
     ('xAOD::TrackParticleContainer#HLT_IDTrack_ElecLRT_FTF',        'BS ESD AODFULL', 'Egamma', 'inViews:EMElectronViews_LRT'),
     ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_ElecLRT_FTFAux.', 'BS ESD AODFULL', 'Egamma'),
 
-    ('xAOD::TrackParticleContainer#HLT_IDTrack_Electron_IDTrig',        'BS ESD AODFULL', 'Egamma', 'inViews:precisionEtcutViews'),
+    ('xAOD::TrackParticleContainer#HLT_IDTrack_Electron_IDTrig',        'BS ESD AODFULL', 'Egamma', 'inViews:precisionTrackingViews'),
     ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_Electron_IDTrigAux.', 'BS ESD AODFULL', 'Egamma'),
 
     ('xAOD::TrackParticleContainer#HLT_IDTrack_ElecLRT_IDTrig',        'BS ESD AODFULL', 'Egamma', 'inViews:precisionTrackViews_LRT'),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionCaloMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionCaloMenuSequences.py
index 4e4c2dba15cd..441cc288cdd6 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionCaloMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionCaloMenuSequences.py
@@ -39,6 +39,7 @@ def precisionCaloSequence(ConfigFlags, ion=False):
     precisionCaloViewsMaker.InViewRoIs = InViewRoIs
     precisionCaloViewsMaker.Views = tag(ion) + 'Views'
     precisionCaloViewsMaker.RequireParentView = True
+    precisionCaloViewsMaker.CacheDisabled = True
 
     # reco sequence
     from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloRecoSequences import precisionCaloRecoSequence
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionCaloMenuSequences_LRT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionCaloMenuSequences_LRT.py
index 72ee86024b3e..b2490ab5d152 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionCaloMenuSequences_LRT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionCaloMenuSequences_LRT.py
@@ -30,6 +30,7 @@ def precisionCaloSequence_LRT(ConfigFlags):
     precisionCaloViewsMaker.InViewRoIs = InViewRoIs
     precisionCaloViewsMaker.Views = "precisionCaloViews_LRT"
     precisionCaloViewsMaker.RequireParentView = True
+    precisionCaloViewsMaker.CacheDisabled = True
 
     # reco sequence
     from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloRecoSequences import precisionCaloRecoSequence_LRT
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingMenuSequences.py
index f7efe26fd395..2332cd2cab2d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingMenuSequences.py
@@ -9,36 +9,34 @@ from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFr
 from AthenaCommon.CFElements import parOR, seqAND
 from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm
 from DecisionHandling.DecisionHandlingConf import ViewCreatorPreviousROITool
-
+from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloMenuSequences import precisionCaloMenuDefs
 
 def tag(ion):
-    return 'precision' + ('HI' if ion is True else '') + 'Etcut'
+    return 'precision' + ('HI' if ion is True else '') + 'Tracking'
 
 
 def precisionTrackingSequence(ConfigFlags, ion=False):
     """ fourth step:  precision electron....."""
-    InViewRoIs = "precisionEtcut"
+    InViewRoIs = "precisionTracking"
     # EVCreator:
-    precisionEtcutViewsMaker = EventViewCreatorAlgorithm("IM" + tag(ion))
-    precisionEtcutViewsMaker.RoIsLink = "initialRoI" # Merge inputs based on their initial L1 ROI
-    precisionEtcutViewsMaker.RoITool = ViewCreatorPreviousROITool()
-    precisionEtcutViewsMaker.InViewRoIs = InViewRoIs
-    precisionEtcutViewsMaker.Views = tag(ion) + "Views"
-    precisionEtcutViewsMaker.ViewFallThrough = True
-    precisionEtcutViewsMaker.RequireParentView = True
-
-    from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloMenuSequences import precisionCaloMenuDefs
+    precisionTrackingViewsMaker = EventViewCreatorAlgorithm("IM" + tag(ion))
+    precisionTrackingViewsMaker.RoIsLink = "initialRoI" # Merge inputs based on their initial L1 ROI
+    precisionTrackingViewsMaker.RoITool = ViewCreatorPreviousROITool()
+    precisionTrackingViewsMaker.InViewRoIs = InViewRoIs
+    precisionTrackingViewsMaker.Views = tag(ion) + "Views"
+    precisionTrackingViewsMaker.ViewFallThrough = True
+    precisionTrackingViewsMaker.RequireParentView = True
     
     # calling precision tracking
     from TriggerMenuMT.HLTMenuConfig.Electron.PrecisionTrackingSequences import precisionTracking
-    precisionTrackInViewSequence, trackparticles = precisionTracking(InViewRoIs, precisionCaloMenuDefs.caloClusters(ion), ion)
+    precisionTrackInViewSequence, trackparticles = precisionTracking(InViewRoIs, ion)
 
-    precisionEtcutInViewAlgs = parOR(tag(ion) + "InViewAlgs", [precisionTrackInViewSequence])
-    precisionEtcutViewsMaker.ViewNodeName = tag(ion) + "InViewAlgs"
+    precisionTrackingInViewAlgs = parOR(tag(ion) + "InViewAlgs", [precisionTrackInViewSequence])
+    precisionTrackingViewsMaker.ViewNodeName = tag(ion) + "InViewAlgs"
 
     # connect EVC and reco
-    theSequence = seqAND(tag(ion) + "Sequence", [precisionEtcutViewsMaker, precisionEtcutInViewAlgs] )
-    return (theSequence,precisionEtcutViewsMaker,precisionCaloMenuDefs.caloClusters(ion),trackparticles)
+    theSequence = seqAND(tag(ion) + "Sequence", [precisionTrackingViewsMaker, precisionTrackingInViewAlgs] )
+    return (theSequence,precisionTrackingViewsMaker,precisionCaloMenuDefs.caloClusters(ion),trackparticles)
 
 
 def precisionTrackingMenuSequence(name, is_probe_leg=False, ion=False):
@@ -47,9 +45,11 @@ def precisionTrackingMenuSequence(name, is_probe_leg=False, ion=False):
 
     #Hypo
     from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionTrackingHypoAlg
+
     from TrigEgammaHypo.TrigEgammaPrecisionTrackingHypoTool import TrigEgammaPrecisionTrackingHypoToolFromDict
 
     thePrecisionTrackingHypo = TrigEgammaPrecisionTrackingHypoAlg(name + tag(ion) + "Hypo")
+    thePrecisionTrackingHypo.CaloClusters = precisionCaloMenuDefs.caloClusters(ion)
 
     return MenuSequence( Sequence    = sequence,
                          Maker       = precisionTrackingViewsMaker, 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingMenuSequences_LRT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingMenuSequences_LRT.py
index 8f8d553731a7..80ca2a508f66 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingMenuSequences_LRT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/PrecisionTrackingMenuSequences_LRT.py
@@ -9,7 +9,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFr
 from AthenaCommon.CFElements import parOR, seqAND
 from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm
 from DecisionHandling.DecisionHandlingConf import ViewCreatorPreviousROITool
-
+from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloMenuSequences_LRT import precisionCaloMenuDefs_LRT
 
 def precisionTrackSequence_LRT(ConfigFlags):
     """ fourth step:  precision electron....."""
@@ -22,12 +22,10 @@ def precisionTrackSequence_LRT(ConfigFlags):
     precisionTrackViewsMaker.Views = "precisionTrackViews_LRT"
     precisionTrackViewsMaker.ViewFallThrough = True
     precisionTrackViewsMaker.RequireParentView = True
-
-    from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloMenuSequences_LRT import precisionCaloMenuDefs_LRT
     
     # calling precision tracking
     from TriggerMenuMT.HLTMenuConfig.Electron.PrecisionTrackingSequences_LRT import precisionTracking_LRT
-    precisionTrackInViewSequence, trackparticles = precisionTracking_LRT(InViewRoIs, precisionCaloMenuDefs_LRT.precisionCaloClusters)
+    precisionTrackInViewSequence, trackparticles = precisionTracking_LRT(InViewRoIs)
     
     precisionTrackInViewAlgs = parOR("precisionTrackInViewAlgs_LRT", [precisionTrackInViewSequence])
     precisionTrackViewsMaker.ViewNodeName = "precisionTrackInViewAlgs_LRT"    
@@ -44,7 +42,8 @@ def precisionTrackingMenuSequence_LRT(name, is_probe_leg=False):
     from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionTrackingHypoAlg
     from TrigEgammaHypo.TrigEgammaPrecisionTrackingHypoTool import TrigEgammaPrecisionTrackingHypoToolFromDict
 
-    thePrecisionTrackingHypo = TrigEgammaPrecisionTrackingHypoAlg(name+"precisionEtcutHypo_LRT")
+    thePrecisionTrackingHypo = TrigEgammaPrecisionTrackingHypoAlg(name+"precisionTrackingHypo_LRT")
+    thePrecisionTrackingHypo.CaloClusters = precisionCaloMenuDefs_LRT.precisionCaloClusters
 
     return MenuSequence( Sequence    = sequence,
                          Maker       = precisionTrackViewsMaker, 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionTrackingSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionTrackingSequences.py
index f639e35d525e..3f861a046ecd 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionTrackingSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionTrackingSequences.py
@@ -9,11 +9,10 @@ import AthenaCommon.CfgMgr as CfgMgr
 #logging
 from AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
-#from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloSequenceSetup import precisionCaloMenuDefs
 
 from TriggerMenuMT.HLTMenuConfig.Egamma.EgammaDefs import TrigEgammaKeys
 
-def precisionTracking(RoIs, precisionCaloClusters, ion=False):
+def precisionTracking(RoIs, ion=False):
 ## Taking Fast Track information computed in 2nd step ##
 
     IDTrigConfig = TrigEgammaKeys.IDTrigConfig
@@ -24,7 +23,6 @@ def precisionTracking(RoIs, precisionCaloClusters, ion=False):
     ViewVerifyTrk = CfgMgr.AthViews__ViewDataVerifier("FastTrackViewDataVerifier" + tag)
     
     ViewVerifyTrk.DataObjects = [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+' + RoIs ),
-                                 ( 'xAOD::CaloClusterContainer' , 'StoreGateSvc+' + precisionCaloClusters ),
                                  ( 'CaloCellContainer' , 'StoreGateSvc+CaloCells' ),
                                  ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.averageInteractionsPerCrossing' ),
                                  ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_FlaggedCondData_TRIG' )]
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionTrackingSequences_LRT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionTrackingSequences_LRT.py
index 8d43c866ca60..493c26265581 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionTrackingSequences_LRT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionTrackingSequences_LRT.py
@@ -9,11 +9,10 @@ import AthenaCommon.CfgMgr as CfgMgr
 #logging
 from AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
-#from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloSequenceSetup_LRT import precisionCaloMenuDefs_LRT
 
 from TriggerMenuMT.HLTMenuConfig.Egamma.EgammaDefs import TrigEgammaKeys_LRT
 
-def precisionTracking_LRT(RoIs, precisionCaloClusters):
+def precisionTracking_LRT(RoIs):
 ## Taking Fast Track information computed in 2nd step ##
     
     IDTrigConfig = TrigEgammaKeys_LRT.IDTrigConfig_LRT
@@ -22,7 +21,6 @@ def precisionTracking_LRT(RoIs, precisionCaloClusters):
     ViewVerifyTrk = CfgMgr.AthViews__ViewDataVerifier("FastTrackViewDataVerifier_LRT")
     
     ViewVerifyTrk.DataObjects = [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+' + RoIs ),
-                                 ( 'xAOD::CaloClusterContainer' , 'StoreGateSvc+' + precisionCaloClusters ),
                                  ( 'CaloCellContainer' , 'StoreGateSvc+CaloCells' ),
                                  ( 'SG::AuxElement' , 'StoreGateSvc+EventInfo.averageInteractionsPerCrossing' ),
                                  ( 'IDCInDetBSErrContainer' , 'StoreGateSvc+SCT_FlaggedCondData_TRIG' )]
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
index 81ce36306fea..07639db2011d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
@@ -128,7 +128,7 @@ def _precisionTrackingSeq(flags):
 
     selAcc.mergeReco(precisionInDetReco)
     from TrigEgammaHypo.TrigEgammaPrecisionTrackingHypoTool import TrigEgammaPrecisionTrackingHypoToolFromDict
-    hypoAlg = CompFactory.TrigEgammaPrecisionTrackingHypoAlg('ElectronprecisionEtcutHypo')
+    hypoAlg = CompFactory.TrigEgammaPrecisionTrackingHypoAlg('ElectronprecisionTrackingHypo', CaloClusters='HLT_CaloEMClusters')
     selAcc.addHypoAlgo(hypoAlg)
     menuSequence = MenuSequenceCA(selAcc,
                                   HypoToolGen=TrigEgammaPrecisionTrackingHypoToolFromDict)
-- 
GitLab


From 911d41d9ebf1e423e51333e449519a45f6ff7280 Mon Sep 17 00:00:00 2001
From: Sarka Todorova <todorova@cern.ch>
Date: Thu, 23 Sep 2021 17:06:40 +0200
Subject: [PATCH 295/347] adjust minbias histogram ranges

---
 .../python/TrigInDetTrackingMonitoring.py     | 27 ++++++++++++-------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/Trigger/TrigTools/TrigInDetMonitoringTools/python/TrigInDetTrackingMonitoring.py b/Trigger/TrigTools/TrigInDetMonitoringTools/python/TrigInDetTrackingMonitoring.py
index 68e4da910cd5..ea520fc015fd 100644
--- a/Trigger/TrigTools/TrigInDetMonitoringTools/python/TrigInDetTrackingMonitoring.py
+++ b/Trigger/TrigTools/TrigInDetMonitoringTools/python/TrigInDetTrackingMonitoring.py
@@ -17,30 +17,39 @@ class TrigInDetTrackCnvMonitoring(GenericMonitoringTool):
 
        #TODO need to revisit binning with higher stats
 
-        self.defineHistogram('TrackPtPass', path='EXPERT', type='TH1F',
+        if  name.find('minBias') != -1  or  name.find('MinBias') != -1: 
+            self.defineHistogram('TrackPtPass', path='EXPERT', type='TH1F',
+                                             title="Acc. Track Pt; p_{t} [GeV]; Number of tracks",
+                                             xbins=200, xmin=0, xmax=20)
+            self.defineHistogram('TrackQPtPass', path='EXPERT', type='TH1F',
+                                             title="Acc. Track q*Pt; q*pt [GeV]; Number of tracks",
+                                             xbins=400, xmin=-40, xmax=40)
+        else:
+            self.defineHistogram('TrackPtPass', path='EXPERT', type='TH1F',
                                              title="Acc. Track Pt; p_{t} [GeV]; Number of tracks",
                                              xbins=200, xmin=0, xmax=1000)
-        self.defineHistogram('TrackQPtPass', path='EXPERT', type='TH1F',
+            self.defineHistogram('TrackQPtPass', path='EXPERT', type='TH1F',
                                              title="Acc. Track q*Pt; q*pt [GeV]; Number of tracks",
                                              xbins=400, xmin=-1000, xmax=1000)
+        #
         self.defineHistogram('TrackQOverPPass',path='EXPERT', type='TH1F',
-                                             title="Acc. Track q/p; q/p; Number of tracks",
-                                             xbins=1000, xmin=-500., xmax=500.0)
+                                             title="Acc. Track q/p; q/p [GeV^{-1}]; Number of tracks",
+                                             xbins=1000, xmin=-10., xmax=10.0)
         self.defineHistogram('TrackEtaPass', path='EXPERT', type='TH1F',
                                              title="Acc. Track Eta; #eta; Number of tracks",
                                              xbins=50, xmin=-2.5, xmax=2.5)
         self.defineHistogram('TrackPhiPass', path='EXPERT', type='TH1F',
                                              title="Acc. Track Phi; #phi; Number of tracks",
-                                             xbins=70, xmin=-3.5, xmax=3.5)
+                                             xbins=64, xmin=-3.2, xmax=3.2)
         self.defineHistogram('TrackThetaPass', path='EXPERT', type='TH1F',
                                              title="Acc. Track Theta; #theta; Number of tracks",
-                                             xbins=70, xmin=-3.5, xmax=3.5)
+                                             xbins=64, xmin=0., xmax=3.2)
         self.defineHistogram('TrackZ0Pass', path='EXPERT', type='TH1F',
                                              title="Acc. Track Z0; Track z0 [mm]; Number of tracks",
-                                             xbins=400, xmin=-400.0, xmax=400.0)
+                                             xbins=300, xmin=-300.0, xmax=300.0)
         self.defineHistogram('TrackD0Pass', path='EXPERT', type='TH1F',
                                              title="Acc. Track D0; Track d0 [mm]; Number of tracks",
-                                             xbins=400, xmin=-400.0, xmax=400.0)
+                                             xbins=300, xmin=-300.0, xmax=300.0)
         #self.defineHistogram('TrackZ0errPass', path='EXPERT', type='TH1F',
         #                                     title="Acc. Track Z0err; Track z0 error [mm]; Number of tracks",
         #                                     xbins=100, xmin=0., xmax=5.)
@@ -69,6 +78,6 @@ class TrigInDetTrackCnvMonitoring(GenericMonitoringTool):
         # Track counting
         self.defineHistogram('TrackCountingPass', path='EXPERT', type='TH1I',
                                              title="Track Counting; Number of tracks per event; Count",
-                                             xbins=50, xmin=0, xmax=200)
+                                             xbins=300, xmin=-0.5, xmax=299.5)
 
 
-- 
GitLab


From 1b8ad812863e27bb90a14c7bef70bc9aade2088c Mon Sep 17 00:00:00 2001
From: Thomas Strebler <thomas.strebler@cern.ch>
Date: Thu, 23 Sep 2021 17:08:41 +0200
Subject: [PATCH 296/347] Update InDetPhysValMonitoringConfig.py

---
 .../python/InDetPhysValMonitoringConfig.py                    | 2 +-
 .../InDetPhysValMonitoring/scripts/runIDPVM.py                | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py
index b1afdf4eb977..7e3cba8f1b6e 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py
@@ -123,7 +123,7 @@ def InDetPhysValMonitoringToolCfg(flags, **kwargs):
         kwargs.setdefault("JetContainerName", '')
         kwargs.setdefault("FillTrackInJetPlots", False)
         kwargs.setdefault("FillTrackInBJetPlots", False)
-        kwargs.setdefault("FillTruthToRecoNtuple ", False)
+        kwargs.setdefault("FillTruthToRecoNtuple", False)
 
     if flags.Detector.GeometryITk:
         #Disable vertex container for now
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py
index 386681d103bb..7e4102b61bfb 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py
@@ -52,10 +52,6 @@ acc = MainServicesCfg(ConfigFlags)
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 acc.merge(PoolReadCfg(ConfigFlags))
 
-if ConfigFlags.Detector.GeometryITk:
-    #Temporary
-    ConfigFlags.TrackingGeometry.MaterialSource = 'Input'
-
 ConfigFlags.lock()
 
 from InDetPhysValMonitoring.InDetPhysValMonitoringConfig import InDetPhysValMonitoringCfg
-- 
GitLab


From c472e698ef01a594067e2d00bf54fc3afe79e42e Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <m.hodgkinson@sheffield.ac.uk>
Date: Thu, 23 Sep 2021 17:45:42 +0200
Subject: [PATCH 297/347] Updates to pflow new style config

---
 Reconstruction/eflowRec/python/PFCfg.py       |  9 ++---
 .../eflowRec/python/PFConfigFlags.py          |  3 +-
 .../eflowRec/python/PFRun3Config.py           | 34 ++++++++++++++++---
 3 files changed, 36 insertions(+), 10 deletions(-)

diff --git a/Reconstruction/eflowRec/python/PFCfg.py b/Reconstruction/eflowRec/python/PFCfg.py
index 6af98670c965..ac11b821b1d0 100644
--- a/Reconstruction/eflowRec/python/PFCfg.py
+++ b/Reconstruction/eflowRec/python/PFCfg.py
@@ -54,8 +54,8 @@ def getPFCellLevelSubtractionTool(inputFlags,toolName):
     PFCellLevelSubtractionToolFactory = CompFactory.PFCellLevelSubtractionTool
     PFCellLevelSubtractionTool = PFCellLevelSubtractionToolFactory(toolName)
 
-    eflowCellEOverPTool_mc12_JetETMiss = CompFactory.eflowCellEOverPTool_mc12_JetETMiss
-    PFCellLevelSubtractionTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_JetETMiss()
+    eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
+    PFCellLevelSubtractionTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss()
 
     if(inputFlags.PF.EOverPMode):
         PFCellLevelSubtractionTool.CalcEOverP = True
@@ -68,6 +68,7 @@ def getPFCellLevelSubtractionTool(inputFlags,toolName):
     else:
         PFCellLevelSubtractionTool.PFTrackClusterMatchingTool = getPFTrackClusterMatchingTool(inputFlags,1.64,"EtaPhiSquareSignificance","GeomCenterEtaPhi","CalObjBldMatchingTool")
 
+    PFCellLevelSubtractionTool.PFTrackClusterMatchingTool_015 = getPFTrackClusterMatchingTool(inputFlags,0.15,"EtaPhiSquareDistance","PlainEtaPhi","MatchingTool_Pull_015")
     PFCellLevelSubtractionTool.PFTrackClusterMatchingTool_02 = getPFTrackClusterMatchingTool(inputFlags,0.2,"EtaPhiSquareDistance","PlainEtaPhi","MatchingTool_Pull_02")
 
     return PFCellLevelSubtractionTool
@@ -76,8 +77,8 @@ def getPFRecoverSplitShowersTool(inputFlags,toolName):
     PFRecoverSplitShowersToolFactory = CompFactory.PFRecoverSplitShowersTool
     PFRecoverSplitShowersTool = PFRecoverSplitShowersToolFactory(toolName)
 
-    eflowCellEOverPTool_mc12_JetETMiss = CompFactory.eflowCellEOverPTool_mc12_JetETMiss
-    PFRecoverSplitShowersTool.eflowCellEOverPTool = eflowCellEOverPTool_mc12_JetETMiss("eflowCellEOverPTool_mc12_JetETMiss_Recover")
+    eflowCellEOverPTool_Run2_mc20_JetETMiss = CompFactory.eflowCellEOverPTool_Run2_mc20_JetETMiss
+    PFRecoverSplitShowersTool.eflowCellEOverPTool = eflowCellEOverPTool_Run2_mc20_JetETMiss("eflowCellEOverPTool_Run2_mc20_JetETMiss_Recover")
 
     PFRecoverSplitShowersTool.RecoverIsolatedTracks = inputFlags.PF.recoverIsolatedTracks
 
diff --git a/Reconstruction/eflowRec/python/PFConfigFlags.py b/Reconstruction/eflowRec/python/PFConfigFlags.py
index c5cfda288513..dd5a54a53c2a 100644
--- a/Reconstruction/eflowRec/python/PFConfigFlags.py
+++ b/Reconstruction/eflowRec/python/PFConfigFlags.py
@@ -11,7 +11,8 @@ def createPFConfigFlags():
     pfConfigFlags.addFlag("PF.useCalibHitTruthClusterMoments",False) #This defines whether we calculate the calibration hit moments - only possible on if running from special calibraiton hit ESD samples.
     pfConfigFlags.addFlag("PF.recoverIsolatedTracks",False) #Defines whether we should apply the split shower recovery algorithm on isolated tracks
     pfConfigFlags.addFlag("PF.useUpdated2015ChargedShowerSubtraction",True) #Toggle whether to use updated 2015 charged shower subtraction, which disables the shower subtraction in high calorimeter energy density regions  
-    pfConfigFlags.addFlag("PF.useElPhotMuLinks",True)
+    pfConfigFlags.addFlag("PF.useElPhotLinks",True)
+    pfConfigFlags.addFlag("PF.useMuLinks",True)
     pfConfigFlags.addFlag("PF.useOldPFO",False)
     
     return pfConfigFlags
diff --git a/Reconstruction/eflowRec/python/PFRun3Config.py b/Reconstruction/eflowRec/python/PFRun3Config.py
index d7dd5d544899..371f40e46962 100644
--- a/Reconstruction/eflowRec/python/PFRun3Config.py
+++ b/Reconstruction/eflowRec/python/PFRun3Config.py
@@ -9,7 +9,7 @@ def getOfflinePFAlgorithm(inputFlags):
     PFAlgorithm = PFAlgorithm("PFAlgorithm")
 
     from eflowRec.PFCfg import getPFClusterSelectorTool
-    PFAlgorithm.PFClusterSelectorTool = getPFClusterSelectorTool("CaloTopoClusters","CaloCalTopoClusters","PFClusterSelectorTool")
+    PFAlgorithm.PFClusterSelectorTool = getPFClusterSelectorTool("CaloTopoClusters","CaloCalTopoClusters","PFClusterSelectorTool")    
 
     from eflowRec.PFCfg import getPFCellLevelSubtractionTool
     PFAlgorithm.SubtractionToolList = [getPFCellLevelSubtractionTool(inputFlags,"PFCellLevelSubtractionTool")]
@@ -146,10 +146,34 @@ def PFCfg(inputFlags,**kwargs):
     result.addEventAlgo(getChargedFlowElementCreatorAlgorithm(inputFlags,""))
     result.addEventAlgo(getNeutralFlowElementCreatorAlgorithm(inputFlags,""))
 
-    if(inputFlags.PF.useElPhotMuLinks):
-        from eflowRec.PFCfg import getMuonFlowElementAssocAlgorithm,getEGamFlowElementAssocAlgorithm
-        result.addEventAlgo(getMuonFlowElementAssocAlgorithm(inputFlags))
+    #Currently we do not have egamma reco in the run 3 config and hence there are no electrons/photons if not running from ESD or AOD
+    if(inputFlags.PF.useElPhotLinks and inputFlags.Input.Format == "POOL" ):
+        from eflowRec.PFCfg import getEGamFlowElementAssocAlgorithm        
         result.addEventAlgo(getEGamFlowElementAssocAlgorithm(inputFlags))
+    
+    #Currently we do not have muon reco in the run 3 config and hence there are no muons if not running from ESD or AOD
+    if(inputFlags.PF.useMuLinks and inputFlags.Input.Format == "POOL" ):
+        from eflowRec.PFCfg import getMuonFlowElementAssocAlgorithm
+        result.addEventAlgo(getMuonFlowElementAssocAlgorithm(inputFlags))
+
+    from OutputStreamAthenaPool.OutputStreamConfig import addToAOD, addToESD
+    toESDAndAOD = ""
+    if(inputFlags.PF.EOverPMode):
+      toESDAndAOD = [f"xAOD::FlowElementContainer#EOverPChargedParticleFlowObjects",f"xAOD::FlowElementAuxContainer#EOverPChargedParticleFlowObjectsAux."]
+      toESDAndAOD += [f"xAOD::FlowElementContainer#EOverPNeutralParticleFlowObjects",f"xAOD::FlowElementAuxContainer#EOverPNeutralParticleFlowObjectsAux."]
+    else:
+      toESDAndAOD = [f"xAOD::FlowElementContainer#JetETMissChargedParticleFlowObjects", f"xAOD::FlowElementAuxContainer#JetETMissChargedParticleFlowObjectsAux."]
+      toESDAndAOD += [f"xAOD::FlowElementContainer#JetETMissNeutralParticleFlowObjects",f"xAOD::FlowElementAuxContainer#JetETMissNeutralParticleFlowObjectsAux.-FEShowerSubtractedClusterLink."]
+      toESDAndAOD += [f"xAOD::FlowElementContainer#JetETMissLCNeutralParticleFlowObjects",f"xAOD::ShallowAuxContainer#JetETMissLCNeutralParticleFlowObjectsAux."]
+
+    #PFlow requires electrons, photons, muons and taus in order to have valid links to them. So lets add these objects to the AOD and ESD
+    toESDAndAOD += [f"xAOD::ElectronContainer#Electrons",f"xAOD::ElectronAuxContainer#ElectronsAux."]
+    toESDAndAOD += [f"xAOD::PhotonContainer#Photons",f"xAOD::PhotonAuxContainer#PhotonsAux."]
+    toESDAndAOD += [f"xAOD::MuonContainer#Muons",f"xAOD::MuonAuxContainer#MuonsAux."]
+    toESDAndAOD += [f"xAOD::TauJetContainer#TauJets",f"xAOD::TauJetAuxContainer#TauJetsAux."]
+  
+    result.merge(addToESD(inputFlags, toESDAndAOD))
+    result.merge(addToAOD(inputFlags, toESDAndAOD))
 
     return result
 
@@ -177,6 +201,6 @@ if __name__=="__main__":
 
     list_remaps=ListRemaps()
     for mapping in list_remaps:
-        cfg.merge(mapping)
+        cfg.merge(mapping)    
 
     cfg.run()
-- 
GitLab


From 7af820a6813047099fdb6d6e7241fcce784dcad0 Mon Sep 17 00:00:00 2001
From: Siarhei Harkusha <Siarhei.Harkusha@cern.ch>
Date: Thu, 23 Sep 2021 17:38:14 +0200
Subject: [PATCH 298/347] TileMonitoring: Use new binning for histograms in
 laser LG and HG

Tile monitoring histograms produced for laser calibration runs
have been modified by Tibor to use new binning in low and high gains
(non-uniform bin width in the case of high gain).

Final calibration units has been made configurable via JO,
and default units have been changed also
(CesiumPicoCoulombs for physics runs and PicoCoulombs for others).
---
 .../TileMonitoring/TilePaterMonTool.h         | 13 +++--
 .../TileMonitoring/TileRawChannelMonTool.h    |  2 +
 .../TileMonitoring/src/TilePaterMonTool.cxx   | 11 ++++
 .../src/TileRawChannelMonTool.cxx             | 52 +++++++++++++++----
 4 files changed, 64 insertions(+), 14 deletions(-)

diff --git a/TileCalorimeter/TileMonitoring/TileMonitoring/TilePaterMonTool.h b/TileCalorimeter/TileMonitoring/TileMonitoring/TilePaterMonTool.h
index da2a4e784e66..f70817c0711e 100644
--- a/TileCalorimeter/TileMonitoring/TileMonitoring/TilePaterMonTool.h
+++ b/TileCalorimeter/TileMonitoring/TileMonitoring/TilePaterMonTool.h
@@ -66,14 +66,14 @@ class TilePaterMonTool: public ManagedMonitorToolBase
 
 protected:
 /// Implicit version of book1D 
-  TH1D* book1D(const std::string& nam, const std::string& tit, 
+  TH1D* book1D(const std::string& nam, const std::string& tit,
                int nx, double xmin, double xmax) 
   { 
     return book1D(m_path, nam, tit, nx, xmin, xmax); 
   }
 
 /// Implicit version of book2D 
-  TH2D* book2D(const std::string& nam, const std::string& tit, 
+  TH2D* book2D(const std::string& nam, const std::string& tit,
                int nx, double xmin, double xmax, 
                int ny, double ymin, double ymax)
  {
@@ -100,6 +100,11 @@ protected:
                Interval_t interval = run, MgmtAttr_t attribute = ATTRIB_MANAGED,
                std::string trigChain = "", std::string mergeAlgo = "");
 
+  TH1S* book1Sx(std::string dir, std::string nam, std::string tit,
+               int nx, const Double_t *xlgbins,
+               Interval_t interval = run, MgmtAttr_t attribute = ATTRIB_MANAGED,
+               std::string trigChain = "", std::string mergeAlgo = "");
+
   TH1C* book1C(std::string dir, std::string nam, std::string tit, 
                int nx, double xmin, double xmax,
                Interval_t interval = run, MgmtAttr_t attribute = ATTRIB_MANAGED,
@@ -205,12 +210,12 @@ protected:
   using ManagedMonitorToolBase::regGraph;
 
   template <typename T>
-  void regHist(const std::string& subDir, T* hist, 
+  void regHist(const std::string& subDir, T* hist,
                Interval_t interval = run, MgmtAttr_t attribute = ATTRIB_MANAGED, 
                std::string trigChain = "", std::string mergeAlgo = "" );
 
   template <typename T>
-  void regGraph(const std::string& subDir, T* graph, 
+  void regGraph(const std::string& subDir, T* graph,
                 Interval_t interval = run, MgmtAttr_t attribute = ATTRIB_MANAGED, 
                 std::string trigChain = "", std::string mergeAlgo = "" );
   
diff --git a/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelMonTool.h b/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelMonTool.h
index f79a9f4684e4..e52ef8673a3e 100644
--- a/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelMonTool.h
+++ b/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelMonTool.h
@@ -64,6 +64,7 @@ class TileRawChannelMonTool: public TilePaterMonTool {
 
     bool m_bookAll;
     bool m_book2D;
+    bool m_overlaphists;
     int m_runType;
     std::string m_contName;
     std::string m_contNameDSP;
@@ -170,6 +171,7 @@ class TileRawChannelMonTool: public TilePaterMonTool {
     const TileInfo* m_tileInfo;
     bool m_is12bit;
     SG::ReadHandleKey<TileDQstatus> m_DQstatusKey;
+    int m_intCalibUnit;
 };
 
 #endif
diff --git a/TileCalorimeter/TileMonitoring/src/TilePaterMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TilePaterMonTool.cxx
index a17126cae70e..3ceed64524bf 100644
--- a/TileCalorimeter/TileMonitoring/src/TilePaterMonTool.cxx
+++ b/TileCalorimeter/TileMonitoring/src/TilePaterMonTool.cxx
@@ -176,6 +176,17 @@ TH1S * TilePaterMonTool::book1S(std::string subdir, std::string nam, std::string
   return hist;
 }
 
+TH1S * TilePaterMonTool::book1Sx(std::string subdir, std::string nam, std::string tit,
+                                int nx, const Double_t *xlgbins,
+                                Interval_t interval, MgmtAttr_t attribute,
+                                std::string trigChain, std::string mergeAlgo)
+{
+
+  TH1S* hist = new TH1S(TString(nam), TString(tit), nx, xlgbins);
+  regHist(subdir, hist, interval, attribute, trigChain, mergeAlgo);
+  return hist;
+}
+
 TH1I* TilePaterMonTool::book1I(std::string subdir, std::string nam, std::string tit,
                                  int nx, double xmin, double xmax,
                                  Interval_t interval, MgmtAttr_t attribute,
diff --git a/TileCalorimeter/TileMonitoring/src/TileRawChannelMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TileRawChannelMonTool.cxx
index b1b714954716..982abee17b35 100644
--- a/TileCalorimeter/TileMonitoring/src/TileRawChannelMonTool.cxx
+++ b/TileCalorimeter/TileMonitoring/src/TileRawChannelMonTool.cxx
@@ -54,6 +54,7 @@ TileRawChannelMonTool::TileRawChannelMonTool(const std::string & type, const std
   declareInterface<IMonitorToolBase>(this);
 
   declareProperty("bookAllDrawers", m_bookAll = false);
+  declareProperty("overlaphists", m_overlaphists = false);
   declareProperty("book2D", m_book2D = true);
 
   // run type 1 - phys, 2 - las, 4 - ped, 8 - cis
@@ -79,6 +80,7 @@ TileRawChannelMonTool::TileRawChannelMonTool(const std::string & type, const std
   declareProperty("MinAmpForCorrectedTime", m_minAmpForCorrectedTime = 0.5);
   declareProperty("TileInfoName", m_infoName = "TileInfo");
   declareProperty("TileDQstatus", m_DQstatusKey = "TileDQstatus");
+  declareProperty("CalibUnit", m_intCalibUnit = (int)TileRawChannelUnit::Invalid);
 }
 
 /*---------------------------------------------------------*/
@@ -123,10 +125,16 @@ StatusCode TileRawChannelMonTool::bookHists()
     msg(MSG::DEBUG) << "Using base path " << m_path << endmsg;
   }
 
-  if ((m_runType == LasRun) || (m_runType == PhysRun) || (m_runType == LedRun)) {
-    m_calibUnit = TileRawChannelUnit::CesiumPicoCoulombs;
-  } else
-    m_calibUnit = TileRawChannelUnit::PicoCoulombs;
+  if (m_intCalibUnit>=0 && m_intCalibUnit<=3) {
+    m_calibUnit = (TileRawChannelUnit::UNIT)m_intCalibUnit;
+  }
+  if (m_calibUnit == TileRawChannelUnit::Invalid) {
+    if (m_runType == PhysRun) {
+      m_calibUnit = TileRawChannelUnit::CesiumPicoCoulombs;
+    } else {
+      m_calibUnit = TileRawChannelUnit::PicoCoulombs;
+    }
+  }
 
   if (m_bookAll) {
     for (int ros = 1; ros < 5; ++ros) {
@@ -214,9 +222,9 @@ void TileRawChannelMonTool::bookHists(int ros, int drawer)
         if (m_book2D) {
           std::string Hist2DName[4] = { "_amp_vs_q_100", "_amp_vs_q_5", "_time_vs_time_100", "_time_vs_time_5" };
           std::string Hist2DTitle[4] = { " amp vs charge 100 pF", " amp vs charge 5 pF", " time vs time 100 pF", " time vs time 5 pF" };
-	  float factor_charge = m_is12bit ? 2. : 1.;
-	  float factor_adc    = m_is12bit ? 4. : 1.;
-	  // Below, static_cast<float> is used to avoid warnings from -Wnarrowing
+          float factor_charge = m_is12bit ? 2. : 1.;
+          float factor_adc    = m_is12bit ? 4. : 1.;
+          // Below, static_cast<float> is used to avoid warnings from -Wnarrowing
           float LowX_low2D[4] = { -4., -0.5, -0.25, -0.25 };
           float HighX_low2D[4] = { 804., 50.5, 25.25, 25.25 };
           float LowX_hi2D[4] = { static_cast<float>(-0.0625 * factor_charge), static_cast<float>(-0.0625 * factor_charge), -0.25, -0.25 };
@@ -276,10 +284,27 @@ void TileRawChannelMonTool::bookHists(int ros, int drawer)
         } else {
           switch (gn) {
             case 0: // low gain
-              m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 1101, -50.5, 1050.5));
+              if (m_overlaphists) {
+                const Int_t nlg1 = 49;
+                const Int_t nlg2 = 500;
+                const Int_t nlg3 = 1027;
+                Double_t xlgbin[nlg1 + nlg2 + nlg3 + 1];
+                for(Int_t i = 0; i <= nlg1; ++i)
+                  xlgbin[i] = -50.5+1.0*i;
+                for(Int_t i = 1; i <= nlg2; ++i)
+                  xlgbin[i + nlg1] = -1.5 + 0.05 * i;
+                for(Int_t i = 1; i <= nlg3; ++i)
+                  xlgbin[i + nlg1 + nlg2] = 23.5 + 1.0 * i;
+                m_data->m_hist1[ros][drawer][ch][gn].push_back(book1Sx(subDir, histName, histTitle, nlg1 + nlg2 + nlg3, xlgbin));
+              } else {
+                m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 1101, -50.5, 1050.5));
+              }
               break;
             case 1: // high gain
-              m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 826, -1.01, 15.51));
+              if (m_overlaphists)
+                m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 500, -1.5, 23.5));
+              else
+                m_data->m_hist1[ros][drawer][ch][gn].push_back(book1S(subDir, histName, histTitle, 826, -1.01, 15.51));
               break;
             default: // single gain mode
               if (m_runType == PhysRun) {
@@ -1153,7 +1178,14 @@ StatusCode TileRawChannelMonTool::fillSummaryHistograms()
               //Lukas
 
               if (m_data->m_hist1[ros][drawer][ch][adc][0]->GetEntries() > 0) {
-                m_data->m_hist1[ros][drawer][ch][adc][0]->Fit("g", "NQ");
+                if (adc == 0 && m_overlaphists) { // We have for LB histograms with variable-width bins, not suitable for a fit
+                  TH1S *h4fit=new TH1S(*(m_data->m_hist1[ros][drawer][ch][adc][0]));
+                  h4fit->Scale(1,"width");
+                  h4fit->Fit("g", "NQ");
+                  delete(h4fit);
+                } else {
+                  m_data->m_hist1[ros][drawer][ch][adc][0]->Fit("g", "NQ");
+                }
                 Sigma = fit_gaus->GetParameter(2);
                 ErrS = fit_gaus->GetParError(2);
               }
-- 
GitLab


From 2738653f136e2e3236bacc49f792050de1cc05c2 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Thu, 23 Sep 2021 19:06:22 +0200
Subject: [PATCH 299/347] TrigConf: remove support for XML menus

Remove support for reading XML trigger menus. Delete all related code
and the `XMLMenuFile` from the ConfigSvc. Also delete the obsolete
`TrigConf2COOLApp` and `TrigConfConsistencyChecker` applications.

Relates to ATR-23102.
---
 .../TrigConfStorage/CMakeLists.txt            |   10 +-
 .../TrigConfStorage/ConfigurationCheck.h      |   67 -
 .../TrigConfStorage/XMLHLTFrameLoader.h       |   68 -
 .../TrigConfStorage/XMLLoader.h               |   72 -
 .../TrigConfStorage/XMLStorageMgr.h           |  100 -
 .../src/ConfigurationCheck.cxx                | 1898 -----------------
 .../TrigConfStorage/src/XMLBoostHelper.cxx    |  120 --
 .../TrigConfStorage/src/XMLBoostHelper.h      |   37 -
 .../src/XMLBunchGroupLoader.cxx               |   31 -
 .../TrigConfStorage/src/XMLBunchGroupLoader.h |   35 -
 .../src/XMLBunchGroupSetLoader.cxx            |   35 -
 .../src/XMLBunchGroupSetLoader.h              |   37 -
 .../src/XMLCTPConfigLoader.cxx                |  119 --
 .../TrigConfStorage/src/XMLCTPConfigLoader.h  |   27 -
 .../src/XMLCTPConfigOnlineLoader.cxx          |    5 -
 .../src/XMLCTPConfigOnlineLoader.h            |   17 -
 .../TrigConfStorage/src/XMLCTPFilesLoader.cxx |   42 -
 .../TrigConfStorage/src/XMLCTPFilesLoader.h   |   46 -
 .../TrigConfStorage/src/XMLCaloInfoLoader.cxx |  161 --
 .../TrigConfStorage/src/XMLCaloInfoLoader.h   |   33 -
 .../src/XMLCaloSinCosLoader.cxx               |   13 -
 .../TrigConfStorage/src/XMLCaloSinCosLoader.h |   32 -
 .../TrigConfStorage/src/XMLDeadTimeLoader.cxx |   35 -
 .../TrigConfStorage/src/XMLDeadTimeLoader.h   |   27 -
 .../TrigConfStorage/src/XMLHLTFrameLoader.cxx |  236 --
 .../TrigConfStorage/src/XMLHLTFrameLoader.h   |   50 -
 .../src/XMLJobOptionTableLoader.cxx           |    9 -
 .../src/XMLJobOptionTableLoader.h             |   33 -
 .../src/XMLL1TopoMenuLoader.cxx               |   34 -
 .../TrigConfStorage/src/XMLL1TopoMenuLoader.h |   25 -
 .../TrigConfStorage/src/XMLLoader.cxx         |   76 -
 .../TrigConfStorage/src/XMLLutCamLoader.cxx   |   44 -
 .../TrigConfStorage/src/XMLLutCamLoader.h     |   44 -
 .../src/XMLMasterTableLoader.cxx              |   48 -
 .../src/XMLMasterTableLoader.h                |   36 -
 .../TrigConfStorage/src/XMLMenuLoader.cxx     |  145 --
 .../TrigConfStorage/src/XMLMenuLoader.h       |   68 -
 .../TrigConfStorage/src/XMLMuctpiLoader.cxx   |   33 -
 .../TrigConfStorage/src/XMLMuctpiLoader.h     |   32 -
 .../src/XMLPrescaleSetLoader.cxx              |   69 -
 .../src/XMLPrescaleSetLoader.h                |   29 -
 .../src/XMLPrescaledClockLoader.cxx           |   24 -
 .../src/XMLPrescaledClockLoader.h             |   33 -
 .../src/XMLPrioritySetLoader.cxx              |   40 -
 .../src/XMLPrioritySetLoader.h                |   32 -
 .../TrigConfStorage/src/XMLRandomLoader.cxx   |   36 -
 .../TrigConfStorage/src/XMLRandomLoader.h     |   33 -
 .../TrigConfStorage/src/XMLStorageMgr.cxx     |  328 ---
 .../src/XMLThresholdConfigLoader.cxx          |   56 -
 .../src/XMLThresholdConfigLoader.h            |   46 -
 .../src/XMLThresholdMonitorLoader.cxx         |    9 -
 .../src/XMLThresholdMonitorLoader.h           |   33 -
 .../src/XMLTriggerThresholdLoader.cxx         |   68 -
 .../src/XMLTriggerThresholdLoader.h           |   27 -
 .../src/XMLTriggerThresholdValueLoader.cxx    |   50 -
 .../src/XMLTriggerThresholdValueLoader.h      |   30 -
 .../TrigConfStorage/src/test/2COOLApp.cxx     | 1128 ----------
 .../src/test/ConsistencyChecker.cxx           |  646 ------
 .../TrigConfStorage/src/test/CoolFix.cxx      |    4 +-
 .../TrigConfStorage/src/test/Helper.h         |   65 -
 .../TrigConfStorage/src/test/ReadWrite.cxx    |  136 +-
 .../TrigConfigSvc/python/TrigConfigSvcCfg.py  |    6 -
 .../python/TrigConfigSvcConfig.py             |   93 +-
 .../TrigConfigSvc/src/ConfigSvcBase.cxx       |   22 +-
 .../TrigConfigSvc/src/ConfigSvcBase.h         |    3 +-
 .../TrigConfigSvc/src/HLTConfigSvc.cxx        |    7 +-
 .../TrigConfigSvc/src/LVL1ConfigSvc.cxx       |   25 +-
 .../share/RunTrigCostAnalysis.py              |    1 -
 .../share/RunEBWeightsComputation.py          |    3 +-
 69 files changed, 31 insertions(+), 7031 deletions(-)
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/ConfigurationCheck.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLHLTFrameLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLStorageMgr.h
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLBoostHelper.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLBoostHelper.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupSetLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupSetLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigOnlineLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigOnlineLoader.h
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPFilesLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPFilesLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloInfoLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloInfoLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloSinCosLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloSinCosLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLDeadTimeLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLDeadTimeLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLHLTFrameLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLHLTFrameLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLJobOptionTableLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLJobOptionTableLoader.h
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLL1TopoMenuLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLL1TopoMenuLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLLoader.cxx
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLLutCamLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLLutCamLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLMasterTableLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLMasterTableLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLMenuLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLMenuLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLMuctpiLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLMuctpiLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaleSetLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaleSetLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaledClockLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaledClockLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrioritySetLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrioritySetLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLRandomLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLRandomLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLStorageMgr.cxx
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.h
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdMonitorLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdMonitorLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdValueLoader.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdValueLoader.h
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/test/2COOLApp.cxx
 delete mode 100755 Trigger/TrigConfiguration/TrigConfStorage/src/test/ConsistencyChecker.cxx
 delete mode 100644 Trigger/TrigConfiguration/TrigConfStorage/src/test/Helper.h

diff --git a/Trigger/TrigConfiguration/TrigConfStorage/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfStorage/CMakeLists.txt
index 41e241be0533..e1367c4f4ccc 100644
--- a/Trigger/TrigConfiguration/TrigConfStorage/CMakeLists.txt
+++ b/Trigger/TrigConfiguration/TrigConfStorage/CMakeLists.txt
@@ -4,7 +4,7 @@
 atlas_subdir( TrigConfStorage )
 
 # External dependencies:
-find_package( Boost COMPONENTS filesystem thread system regex )
+find_package( Boost COMPONENTS regex )
 find_package( COOL COMPONENTS CoolKernel CoolApplication )
 find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( tdaq-common )
@@ -18,14 +18,6 @@ atlas_add_library( TrigConfStorage
                    LINK_LIBRARIES ${Boost_LIBRARIES} ${COOL_LIBRARIES} TrigConfBase TrigConfHLTData TrigConfL1Data
                    PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} TrigConfJobOptData L1TopoConfig )
 
-atlas_add_executable( TrigConf2COOLApp
-                      src/test/2COOLApp.cxx
-                      LINK_LIBRARIES TrigConfStorage )
-
-atlas_add_executable( TrigConfConsistencyChecker
-                      src/test/ConsistencyChecker.cxx
-                      LINK_LIBRARIES TrigConfStorage )
-
 if( NOT XAOD_STANDALONE )
    atlas_add_executable( TrigConfReadWrite
                          src/test/ReadWrite.cxx src/test/Run2toRun3ConvertersL1.cxx src/test/Run2toRun3ConvertersHLT.cxx
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/ConfigurationCheck.h b/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/ConfigurationCheck.h
deleted file mode 100644
index 4b01058a4620..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/ConfigurationCheck.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_ConfigurationCheck
-#define TrigConf_ConfigurationCheck
-
-#include <vector>
-#include "TrigConfHLTData/HLTFrame.h"
-#include "TrigConfL1Data/CTPConfig.h"
-
-
-
-namespace TrigConf {
-   class TrigConfTest {
-   public:
-
-      typedef std::vector<std::string> Exc_t;
-
-      enum Severity { INFO, WARNING, ERROR };
-  
-      TrigConfTest(const std::string& name, const std::string& description="", Severity s = ERROR ); 
-      virtual ~TrigConfTest() {} 
-
-      std::string name() const { return m_name; }   //!< test name
-
-      void enable(bool b) { m_enabled = b; }  
-      bool enabled() const { return m_enabled; }
-
-      bool code() const; //!< if check severity is ERROR and test failed returns true, in all other cases false
-      std::string severity() const;
-
-      void run( const Exc_t& exceptions );       //!< runs the test if is enabled
-      bool status() const;    //!< returns true is test is disabled or enabled and passed
-      std::string description() const { return m_description; }  //!< detailed explanation of the test
-      std::string error() const { return m_error; }    //!< detailed explanation of the problem
-
-      void setCTP(TrigConf::CTPConfig* ctp) { m_ctp = ctp; }
-      void setHLT(TrigConf::HLTFrame* hlt) { m_hlt = hlt; }
-
-      protected:
-         virtual bool isok() const;
-         virtual void execute(const Exc_t& exceptions) = 0;
-         TrigConf::CTPConfig* m_ctp;
-         TrigConf::HLTFrame* m_hlt;
-         std::string m_error;  //!< error description if any
-
-      private:
-         std::string m_name;
-         std::string m_description;  //!< error description if any
-         bool        m_enabled;  
-         Severity    m_severity;  //!< test importance
-      };
-
-   class ConfigurationCheck {
-   public:
-      ConfigurationCheck(TrigConf::CTPConfig* ctp, TrigConf::HLTFrame* hlt);
-      ~ConfigurationCheck();
-
-      std::vector<TrigConfTest*>& tests() { return m_tests; } //!< test accessor
-   private:
-      std::vector<TrigConfTest*> m_tests; //!< all test collection
-   };
-} // EOF NS
-/////////////////////////////////////////////////////////////////////////////
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLHLTFrameLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLHLTFrameLoader.h
deleted file mode 100755
index 4ae6ded55896..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLHLTFrameLoader.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/////////////////////////////////////////////////////////////////////
-//
-// NAME:     XMLHLTFrameLoader.h
-// PACKAGE:  TrigConfStorage
-//
-// AUTHORs:  Johannes Haller (CERN) [Johannes.Haller@cern.ch]
-//           Andreas Hoecker (CERN) [Andreas.Hocker@cern.ch]
-//
-// CREATED:  10-Jan.-2006
-//
-// PURPOSE:
-//
-//////////////////////////////////////////////////////////////////////
-
-#ifndef TRIGCONFXMLHLTFRAMELOADER
-#define TRIGCONFXMLHLTFRAMELOADER
-
-#include "TrigConfStorage/IHLTFrameLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-#include <string>
-#include <vector>
-
-namespace TrigConf {
-
-   class IStorageMgr;
-   class HLTFrame;
-
-   /**@brief TriggerDB loader of the HLT menu*/
-   class XMLHLTFrameLoader : virtual public IHLTFrameLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param hltDoc pointer to DOM document containing the hlt menu
-       */
-      XMLHLTFrameLoader( XMLStorageMgr& sm, value_type* pt )
-         : IHLTFrameLoader(), XMLLoader(sm, pt)
-      {};
-
-      /**@brief destructor*/
-      virtual ~XMLHLTFrameLoader( void ) {};
-
-      virtual bool load( HLTFrame& frame);
-
-
-   private:
-      /**unique identifier for trigger element*/
-      int    stringToId  ( std::string );
-      std::string stringFromId( int    );
-
-      bool buildHLTChainList   (  HLTFrame& );
-      bool buildHLTSequenceList(  HLTFrame& );
-
-
-      void parseItemLine( std::string theString, std::string theSeparator, std::vector<std::string>& list );
-
-      // unique identifier for trigger element
-      // this is unnecessary for DB configuration, where each TE has a DB id
-      std::vector<std::pair<int,std::string> > m_idstrTable;
-
-   };
-}
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLLoader.h
deleted file mode 100755
index fca814d3a0e1..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLLoader.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConfXMLLoader
-#define TrigConfXMLLoader
-
-#include "TrigConfStorage/ILoader.h"
-#include "TrigConfStorage/XMLStorageMgr.h"
-#include "boost/property_tree/ptree.hpp"
-#include "TrigConfBase/TrigConfMessaging.h"
-
-namespace TrigConf {
-
-   //class XMLStorageMgr;
-
-   typedef boost::property_tree::ptree ptree;
-   typedef boost::property_tree::ptree::value_type value_type;
-
-   /**@brief Base class for loaders of XML based configurations*/
-   class XMLLoader : public TrigConfMessaging, 
-                     virtual public ILoader
-   {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param data is a ptree
-       */
-      explicit XMLLoader( XMLStorageMgr& sm, const value_type* data );
-
-      explicit XMLLoader( const std::string& name, XMLStorageMgr& sm, const value_type* data );
-
-      /**@brief destructor*/
-      virtual ~XMLLoader(){};
-
-      /**@brief sets the internal pointer to the DOM (XML) node*/
-      void setPtree(const value_type* data) { m_data = data; }
-
-      virtual void setLevel(MSGTC::Level lvl);
-      MSGTC::Level outputLevel() const { return msg().level(); }
-
-      virtual int verbose() const { return m_verbose; }
-      virtual void setVerbose(int v) { m_verbose=v; }
-
-   protected:
-
-      bool is_a(const std::string& elementtag) const;
-
-      const std::string & key() const;
-      const ptree & pt() const;
-
-   private:
-      int m_verbose { 1 };
-
-   public:
-      typedef enum  {ALL, CTP, CTPOnl, HLT, COOLL1, COOLHLT, L1Simu} ENV;
-      static        ENV getEnv()    { return m_env; }
-      static void   setEnv(ENV env) { m_env = env;  }
-
-   protected:
-      XMLStorageMgr&                   m_storageMgr; ///< reference to the storage manager
-      const value_type*                      m_data;       ///< pointer to the XML node
-
-   private:
-      static ENV m_env;
-   };
-
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLStorageMgr.h b/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLStorageMgr.h
deleted file mode 100755
index 05f73dac9cee..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/TrigConfStorage/XMLStorageMgr.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLStorageMgr
-#define TrigConf_XMLStorageMgr
-
-#include "TrigConfBase/TrigConfMessaging.h"
-#include "TrigConfStorage/StorageMgrBase.h"
-#include "TrigConfStorage/IStorageMgr.h"
-
-#include <string>
-#include <memory>
-
-#include <boost/property_tree/ptree_fwd.hpp>
-
-namespace TrigConf {
-
-   /**@brief XML Storage Manager, controls the different loader classes
-      for XML access and the XML nodes*/
-   class XMLStorageMgr : public StorageMgrBase, public TrigConfMessaging, virtual public IStorageMgr {
-   public:
-    
-      /**@brief constructor to specify variable list of input files
-       * 
-       * @param files menu file names (random order allowed, maximum one per level L1Topo, L1, HLT)
-       */
-      XMLStorageMgr( const std::vector<std::string>& files );
-     
-      /**@brief destructor*/
-      virtual ~XMLStorageMgr();
-
-      // setting log level of all loaders
-      void setLevel(MSGTC::Level lvl);
-
-      // provide CTP and L1 version to be accessible by all the L1 loaders
-      void setCTPVersion(unsigned int v) { m_ctpVersion = v; }
-      void setL1Version(unsigned int v) { m_l1Version = v; }
-      unsigned int ctpVersion() const { return m_ctpVersion; }
-      unsigned int l1Version() const { return m_l1Version; }
-
-
-      // Mandatory interface implementation
-      virtual IL1TopoMenuLoader&             l1topoMenuLoader();
-      virtual IMasterTableLoader&            masterTableLoader();
-      virtual IMenuLoader&                   menuLoader();
-      virtual IMuctpiLoader&                 muctpiLoader();
-      virtual IDeadTimeLoader&               deadTimeLoader();
-      virtual IPrescaledClockLoader&         prescaledClockLoader();
-      virtual IRandomLoader&                 randomLoader();
-      virtual IThresholdConfigLoader&        thresholdConfigLoader();
-      virtual ITriggerThresholdLoader&       triggerThresholdLoader();
-      virtual ITriggerThresholdValueLoader&  triggerThresholdValueLoader();
-      virtual IThresholdMonitorLoader&       thresholdMonitorLoader();
-      virtual ICTPFilesLoader&               ctpFilesLoader();
-      virtual ICaloJetInputLoader&           caloJetInputLoader();
-      virtual ICaloSinCosLoader&             caloSinCosLoader();
-      virtual ICaloInfoLoader&               caloInfoLoader();
-      virtual ILutCamLoader&                 lutcamLoader();
-      virtual IPrescaleSetLoader&            prescaleSetLoader();
-      virtual IPrioritySetLoader&            prioritySetLoader();
-      virtual IBunchGroupLoader&             bunchGroupLoader();
-      virtual IBunchGroupSetLoader&          bunchGroupSetLoader();
-      virtual ICTPConfigLoader&              ctpConfigLoader();
-      virtual ICTPConfigLoader&              ctpConfigOnlineLoader();
-      virtual IHLTFrameLoader&               hltFrameLoader();
-      virtual IJobOptionTableLoader&         jobOptionTableLoader();
-
-
-      bool hasL1Topo() const { return m_runL1Topo; }
-      bool hasLVL1() const { return m_runLVL1; }
-      bool hasHLT() const { return m_runHLT; }
-
-      std::string m_cs = "";
-
-      // xml files
-      std::string m_xmlL1TopoFile = "";
-      std::string m_xmlL1File = "";
-      std::string m_xmlHLTFile = "";
-
-   private:
-
-
-
-
-      void Init(const std::vector<std::string>& files = std::vector<std::string>());
-
-      // allow also for running only LVL1 or only HLT
-      bool m_runL1Topo = false;
-      bool m_runLVL1 = false;
-      bool m_runHLT = false;
-
-      //std::unique_ptr<boost::property_tree::ptree> m_l1topomenu;
-      boost::property_tree::ptree * m_l1topomenu = { nullptr };
-      boost::property_tree::ptree * m_l1menu = { nullptr };
-      boost::property_tree::ptree * m_hltmenu = { nullptr };
-
-   };
-}
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx
deleted file mode 100644
index e76b0262caec..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/ConfigurationCheck.cxx
+++ /dev/null
@@ -1,1898 +0,0 @@
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
- * Menu consistency checks
- */
-
-#include <set>
-#include <map>
-#include <iterator>
-#include <algorithm>
-#include "boost/lexical_cast.hpp"
-#include "boost/regex.hpp"
-
-#include "TrigConfL1Data/Menu.h"
-#include "TrigConfL1Data/ThresholdConfig.h"
-#include "TrigConfL1Data/TriggerItem.h"
-#include "TrigConfL1Data/TriggerThreshold.h"
-#include "TrigConfL1Data/TriggerThresholdValue.h"
-#include "TrigConfL1Data/JetThresholdValue.h"
-#include "TrigConfL1Data/ClusterThresholdValue.h"
-#include "TrigConfStorage/ConfigurationCheck.h"
-#include "TrigConfHLTData/HLTSignature.h"
-#include "TrigConfHLTData/HLTTriggerElement.h"
-#include "TrigConfHLTData/HLTSequence.h"
-#include "TrigConfHLTData/HLTStreamTag.h"
-#include "TrigConfHLTData/HLTChainList.h"
-#include "TrigConfHLTData/HLTSequenceList.h"
-#include "TrigConfHLTData/HLTChain.h"
-#include "TrigConfHLTData/HLTUtils.h"
-#include "TrigConfL1Data/HelperFunctions.h"
-
-#include <iostream>
-
-using namespace std;
-
-TrigConf::TrigConfTest::TrigConfTest(const std::string& name, const std::string& description, Severity s ) 
-  : m_ctp(0), m_hlt(0), m_error(""), m_name(name), m_description(description), m_enabled(true), m_severity(s) {}
-
-void TrigConf::TrigConfTest::run(const Exc_t& exceptions) { 
-  if (m_enabled) execute(exceptions); 
-}
-
-bool TrigConf::TrigConfTest::status() const { 
-  return (m_enabled ? isok() : true); 
-}
-
-bool TrigConf::TrigConfTest::code() const {
-  return !status() && m_severity >= ERROR;
-}
-
-std::string TrigConf::TrigConfTest::severity() const {
-   switch(m_severity) {
-   case INFO:  return "INFO";
-   case WARNING: return "WARNING";
-   case ERROR: return "ERROR";
-   } 
-   return "";
-}
-
-bool TrigConf::TrigConfTest::isok() const {
-   return m_error.size() == 0;
-}
-
-namespace TrigConf {
-   bool matches_any(const std::vector<boost::regex>& exc_regex, const string& s) {
-      for(const boost::regex& e: exc_regex ) {
-         if(regex_match(s, e)) return true;
-      }
-      return false;
-   }
-
-   vector<boost::regex>
-   buildExcRec(const TrigConfTest::Exc_t& exceptions) {
-      vector<boost::regex> exc_regex;
-      for(const string& exc: exceptions ) {
-         exc_regex.push_back(boost::regex(exc+"$"));
-      }
-      return exc_regex;
-  }
-}
-
-using namespace TrigConf;
-
-///////////////////////// NUMBER AND RANGE OF CPT ITEMS   /////////////////////////
-class NumberOfCTPItemsTest : public TrigConfTest {
-public:
-  NumberOfCTPItemsTest() 
-    : TrigConfTest("NumberOfCTPItem", "Less than 256 items, CTP id less than 256"), 
-      m_itemsNumber(0),
-      m_highestCTPNumber(0)
-  {}
-  
-  virtual void execute(const Exc_t& ) {
-     if ( ! m_ctp ) return;
-
-     m_itemsNumber = m_ctp->menu().itemVector().size();
-     for ( int i = 0; i < m_itemsNumber; i++ )
-        m_highestCTPNumber = std::max<int>(m_ctp->menu().itemVector()[i]->ctpId(), m_highestCTPNumber);
-     if( m_itemsNumber > 512 ) 
-        m_error += "More than 512 items in Lvl1 menu. ";
-     if( m_highestCTPNumber >= 512 ) 
-        m_error += "Some items have CTP ID>=512.";
-  }
-  
-private:
-  int m_itemsNumber;
-  int m_highestCTPNumber;
-};
-
-
-///////////////////////// NAMING CONVENTION FOR CHAINS   /////////////////////////
-class ChainsNamingConventionTest : public TrigConfTest {
-public:
-  ChainsNamingConventionTest() 
-    : TrigConfTest("ChainsNamingConvention", "Chain names must start with <level>_"),
-      m_offending("")
-  {}
-  
-  virtual void execute(const Exc_t&) {
-     if ( ! m_hlt ) return;
-    
-     for( const TrigConf::HLTChain* ch : m_hlt->getHLTChainList() ) {
-        if ( ch->chain_name().find(ch->level()+"_") != 0 ) // of the level is not a prefix for the chain and it is not right 
-           m_offending += ch->chain_name()+"("+ch->level()+") ";
-     }
-     if(m_offending.size()!=0)
-        m_error = " Offending chains and their levels " + m_offending;
-  }
-  
-private:
-  std::string m_offending;
-};
-
-///////////////////////// NAMING CONVENTION FOR TRIGGER ELEMENTS   /////////////////////////
-class TENamingConventionTest : public TrigConfTest {
-public:
-   TENamingConventionTest() 
-      : TrigConfTest("TENamingConvention", "Output TE names must start with <level>_"),
-        m_offending("")
-   {}
-
-   bool isExplicitTE(const std::string& teName) {
-      for( const TrigConf::HLTChain* c : m_hlt->getHLTChainList() )
-         for( const TrigConf::HLTSignature* s : c->signatureList() )
-            for( const TrigConf::HLTTriggerElement* te : s->outputTEs() )
-               if(te->name() ==  teName) return true;
-      return false;
-   }
-
-  
-   virtual void execute(const Exc_t&) {
-      if ( ! m_hlt ) return;
-     
-      for(const TrigConf::HLTSequence* seq : m_hlt->getHLTSequenceList()) {
-         const std::string& tename = seq->outputTE()->name();
-        
-         if( ( tename.compare(0, 2, "L2") != 0 ) &&
-             ( tename.compare(0, 2, "EF") != 0 ) &&
-             ( tename.compare(0, 3, "HLT") != 0 ) ) {
-            // name of output TE does not start with L2 nor EF
-            //          if(!isExplicitTE(tename))
-            //            m_offending += tename + ", ";
-            m_offending += tename + ", ";
-         }
-      }
-     
-      if(m_offending.size()!=0)
-         m_error = " Offending trigger elements " + m_offending;
-   }
-   
-private:
-   std::string m_offending;
-};
-
-
-///////////////////////// Max lenght of TRIGGER ELEMENTS name  /////////////////////////
-class TENameLengthTest : public TrigConfTest {
-public:
-
-  TENameLengthTest() 
-      : TrigConfTest("TENameLength", "Max length of TE name must be less than 100 characters"),
-        m_offending("")
-  {}
-  
-   virtual void execute(const Exc_t&) {
-      if ( ! m_hlt ) return;
-
-      const unsigned int maxTElength = 100;
-     
-      for(const TrigConf::HLTSequence* seq : m_hlt->getHLTSequenceList()) {
-         const std::string& tename = seq->outputTE()->name();
-
-	 if (tename.length() > maxTElength )
-	   m_offending += tename + ", ";
-	 
-      }	 
-	 
-      if(m_offending.size()!=0)
-	m_error = " Following Trigger elements are too long [more than 100 characters long]: " + m_offending;
-   }
-  
-private:
-   std::string m_offending;
-};
-
-
-/////////////// CHECK WHETHER ALL SIGNATURES IN A GROUP ARE CONNECTED BY COMMON TEs //////////////////
-////// ALL OUTPUT TEs OF A SIGNATURE ARE THE FINAL TE OF THE CHAIN OR THE INPTUT OF ANOTHER SIGNATURE   ///
-////// CHECK ALSO CHANGE OF MULTIPLICITY BETWEEN SIGNATURES
-
-struct multi_sign{
-  unsigned int multiplicity;
-  std::string  name;
-};
-
-class SignaturesConnectedTest : public TrigConfTest {
-public:
-   SignaturesConnectedTest() 
-      : TrigConfTest("SignaturesConnectedTest","Signatures in the chain should be connected", INFO)  {}
-  
-   virtual void execute(const Exc_t&) {
-      if ( ! m_hlt ) return;
-
-      for(TrigConf::HLTChain* ch : m_hlt->getHLTChainList() ) {
-    
-         std::vector<struct multi_sign> nextinputTEcount; // input of each sign output
-
-         bool isLastSignature = true;
-         for( auto i = ch->signatureList().rbegin(); i != ch->signatureList().rend(); ++i ) {
-
-            TrigConf::HLTSignature* sig = *i;
-
-            std::vector<struct multi_sign> outputTEcount;
-            createSignMultiplicity(sig->outputTEs(), outputTEcount);
-	
-            for( multi_sign outputMultiCount : outputTEcount) {
-               bool connected = false;
-               for( multi_sign inputMultiCount : nextinputTEcount ) {
-                  // don't check for multiplicity changes, since ComboAlgo's can change multiplicity
-                  //if( (inputMultiCount.name == outputMultiCount.name) && (inputMultiCount.multiplicity == outputMultiCount.multiplicity)){
-                  if( inputMultiCount.name == outputMultiCount.name ){ 
-                     connected=true; //this output is the input of the next signature
-                     break;
-                  }
-               }
-
-               if ( !connected ) {
-                  if ( ! isLastSignature ){ // if is not the last signature in the chain
-                     m_message +=  ch->chain_name() + "(TE: " + outputMultiCount.name +"),  " ;
-                  }
-                  nextinputTEcount.push_back(outputMultiCount); //add also itself for multiplicity != 1
-                  recursivelyFindInputTE(outputMultiCount, nextinputTEcount); 	  	 	    
-               }
-            }
-            isLastSignature = false;
-         }
-      }
-      if( m_message.size()!=0 ) m_error = "These chains are not connected or change multiplicity: " + m_message;
-      return;
-   }
-
-
-   // recursively find the input TEs given the outputTE, looping over sequences, and add them to the vector of string
-   // return false if no input is found 
-   bool recursivelyFindInputTE( const struct multi_sign & outputtename,std::vector<struct multi_sign>& inputtenames ) {
-      const TrigConf::HLTSequence* seq = m_hlt->getHLTSequenceList().getSequence(outputtename.name); 
-      if(!seq) return false;
-      bool status = true;
-
-      //make multi_list for inputs inside the sequence!
-      std::vector<struct multi_sign> seq_input;
-      createSignMultiplicity(seq->inputTEs(), seq_input);
-      for( unsigned int i =0; i< seq_input.size(); i++){
-         // multipl. n. of. inputs times n. of seqeunces required
-         seq_input[i].multiplicity = seq_input[i].multiplicity *outputtename.multiplicity; 
-         bool newo=true;
-         for( unsigned int gi =0; gi< inputtenames.size(); gi++){
-            if ( inputtenames[gi].name == seq_input[i].name ){
-               inputtenames[gi].multiplicity++;
-               newo=false;
-               break;
-            }
-         }
-         if(newo){
-            inputtenames.push_back(seq_input[i]);     
-         }
-         status |= recursivelyFindInputTE(seq_input[i] ,inputtenames ); 
-      }
-      return status;
-   }
-
-   // creates a vector of (TE-name, multiplicity)
-   void createSignMultiplicity(std::vector<TrigConf::HLTTriggerElement*> TElist, std::vector<struct multi_sign>& Multilist) {
-      for ( TrigConf::HLTTriggerElement* te : TElist ) {
-         bool newo=true;
-         // find TE-name in multiList and increment count
-         for( multi_sign ms : Multilist ){ 
-            if (te->name() == ms.name ){ 
-               ms.multiplicity++;
-               newo=false;
-               break;
-            }
-         }
-         // TE-name not found, add new counter
-         if(newo){
-            struct multi_sign ms;
-            ms.name = te->name();
-            ms.multiplicity = 1;
-            Multilist.push_back(ms);
-         }
-      }
-      return;
-   }
-
-private:
-   std::string m_message;
-};
-
-
-///////////////////////// CHAIN NAMES UNIQUE IN MENU   /////////////////////////
-class ChainsNamingUniqueTest : public TrigConfTest {
-public:
-  ChainsNamingUniqueTest() 
-    : TrigConfTest("ChainsNamingUnique", "Chain names must be unique"), m_repeated("")  {}
-
-  virtual void execute(const Exc_t&) {
-     if ( ! m_hlt ) return;
-
-     std::set<std::string> chains;    
-
-     for (const HLTChain* ch : m_hlt->getHLTChainList()) {
-        if(chains.count(ch->chain_name())>0)
-           m_repeated += ch->chain_name()+", ";
-        else 
-           chains.insert( ch->chain_name() );
-     }
-     if(m_repeated.size()>0)
-        m_error = "The following chain names appear multiple times: " + m_repeated;
-  }
-
-private:
-  std::string m_repeated;
-};
-
-
-///////////////////////// CHAIN COUNTERS UNIQUE IN LEVEL   /////////////////////////
-class ChainsCountersUniqueTest : public TrigConfTest {
-public:
-  ChainsCountersUniqueTest() 
-    : TrigConfTest("ChainsCountersUnique", "Chain counters must be unique"),
-      m_repeatedl2(""),
-      m_repeatedef("")
-   {}
-
-  virtual void execute(const Exc_t&) {
-
-     if ( ! m_hlt ) return;
-
-     std::set<int> l2counters;    
-     std::set<int> efcounters;    
-
-     for(const HLTChain* ch : m_hlt->getHLTChainList()) {
-        std::set<int>& counters = ch->level()=="L2"?l2counters:efcounters;
-        if(counters.count(ch->chain_counter())>0) {
-           std::string& rep = ch->level()=="L2"?m_repeatedl2:m_repeatedef;
-           rep += boost::lexical_cast<std::string,int>(ch->chain_counter())+", ";
-        } else 
-           counters.insert( ch->chain_counter() );
-     }
-     if( (m_repeatedl2.size() + m_repeatedef.size())>0)
-        m_error = "The following chain counters appear multiple times in L2: " + m_repeatedl2 + "\n, and these in EF: " + m_repeatedef;
-  }
-
-private:
-  std::string m_repeatedl2;
-  std::string m_repeatedef;
-};
-
-
-
-///////////////////////// CHAIN COUNTER RANGE   /////////////////////////
-class ChainsCounterRangeTest : public TrigConfTest {
-public:
-   ChainsCounterRangeTest() 
-      : TrigConfTest("ChainsCounterRange", "Chain counter within [1..8095]"),
-        m_offending("")
-   {}
-
-   virtual void execute(const Exc_t&) {
-      if ( ! m_hlt ) return;
-   
-      for(const HLTChain* ch : m_hlt->getHLTChainList()) {
-         if ( ch->chain_counter() > 0x1fff  || ch->chain_counter() < 1 ) 
-            m_offending += ch->chain_name()+ "[" + boost::lexical_cast<std::string,int>(ch->chain_counter()) + "], ";
-      }
-      if(m_offending.size()>0)
-         m_error = "Chains with counter outside [1..8095]: " + m_offending;
-   }
-   
-private:
-  std::string m_offending;
-};
-
-
-//////////////////////// AT LEAST ONE TRIGGER TYPE AND ONE STREAM TAG FOR EACH CHAIN   /////////////////////////
-class StreamTagPresentTest : public TrigConfTest {
-public:
-  StreamTagPresentTest() 
-    : TrigConfTest("StreamTagPresent", "Chain must go into at least one stream unprescaled"), m_offending("")  {}
-
-  virtual void execute(const Exc_t&) {
-     if ( ! m_hlt ) return;
-    
-     for(const HLTChain* ch : m_hlt->getHLTChainList()) {
-        if ( ch->streams().size() == 0 ) {
-           m_offending += ch->chain_name()+" (no stream), ";
-           continue;
-        }
-        // need at least one unprescaled stream
-        int pt1streams = 0;
-        for(const HLTStreamTag *s : ch->streams()) {
-           if ( s->prescale() == 1 ) pt1streams++;
-           if ( s->type() == "physics" && s->prescale() != 1) m_offending += ch->chain_name() +" has phsycsis stream:" + s->stream() + " prescaled, ";
-        }
-        if ( pt1streams == 0 )
-           m_offending += ch->chain_name()+" (no unprescaled stream), ";
-     }
-     if(m_offending.size()>0)
-        m_error = "Chains with stream settings problems: " + m_offending;
-  }
-
-private:
-  std::string m_offending;
-};
-
-
-//////////////////////// AT LEAST ONE GROUP IS DEFINED FOR EACH CHAIN   /////////////////////////
-class GroupPresentTest : public TrigConfTest {
-public:
-  GroupPresentTest() 
-    : TrigConfTest("GroupPresent", "Chains should belong to a group", WARNING),
-      m_offending("")
-  {}
-
-  virtual void execute(const Exc_t&) {
-     if ( ! m_hlt ) return;
-     for(TrigConf::HLTChain* ch : m_hlt->getHLTChainList() ) {
-        if ( ch->groups().empty() ) 
-           m_offending += ch->chain_name() + ", ";
-     }
-     m_error = "Chains without a Group: " + m_offending;
-  }
-
-  virtual bool isok() const {
-    return m_offending.size()==0;
-  }
-
-private:
-  std::string m_offending;
-};
-
-//////////////////////// AT LEAST ONE BANDWIDTH GROUP IS DEFINED FOR EACH CHAIN   /////////////////////////
-class BWGroupPresentTest : public TrigConfTest {
-public:
-  BWGroupPresentTest() 
-    : TrigConfTest("BWGroupPresent", "Chains should belong to a BW group", INFO),
-      m_offending("")
-  {}
-
-  virtual void execute(const Exc_t& exceptions) {
-     if ( ! m_hlt ) return;
-
-     std::vector<boost::regex> exc_regex = buildExcRec(exceptions);
-
-     for(TrigConf::HLTChain* ch : m_hlt->getHLTChainList() ) {
-        if( matches_any(exc_regex, ch->chain_name()) ) continue; // excempt
-      
-        bool bwgroup=false;
-        for( const string& it : ch->groups()) {
-           if ( it.compare(0, 3, "BW:") == 0 ) { bwgroup=true; break; }
-        }
-        if(!bwgroup)
-           m_offending += ch->chain_name() + ", ";
-     }
-     m_error = "Chains without a BW Group: " + m_offending;
-  }
-
-  virtual bool isok() const {
-    return m_offending.size()==0;
-  }
-
-private:
-  std::string m_offending;
-};
-
-
-
-//////////////////////// UNIQUE SIGNATURE COUNTER [1,N]  /////////////////////////
-class UniqueSignatureCountTest : public TrigConfTest {
-public:
-  UniqueSignatureCountTest() 
-    : TrigConfTest("SignatureCountOrder", "Ascending signature counters"), m_offending("")  {}
-
-  virtual void execute(const Exc_t&) {
-     if ( ! m_hlt ) return;
-     for (TrigConf::HLTChain* ch : m_hlt->getHLTChainList() ) {
-        int previousSigCounter = -1;
-        for(const TrigConf::HLTSignature* sig : ch->signatureList()) {
-           int currentCounter = sig->signature_counter();
-           if ( currentCounter <= previousSigCounter ) {
-              m_offending += ch->chain_name() + ", ";
-              break;
-           }
-           previousSigCounter = currentCounter; 	
-        }
-     }
-     if(m_offending.size()>0)
-        m_error = "Chains with out-of-order signature counts: " + m_offending;
-  }
-
-private:
-  std::string m_offending;
-};
-
-class NonEmptySignature : public TrigConfTest {
-public:
-  NonEmptySignature()
-    : TrigConfTest("NonEmptySignature", "List of trigger elements in signature not empty"), m_offending(""){}
-  virtual void execute(const Exc_t&) {
-     if (!m_hlt) return;
-
-     for(const TrigConf::HLTChain* chain : m_hlt->getHLTChainList() ) {
-        for(const TrigConf::HLTSignature* sig : chain->signatureList() ) {
-           if (sig->outputTEs().empty()) {
-              m_offending += chain->chain_name() + ", ";
-           }
-        }
-     }
-     if(! m_offending.empty() ) {
-        m_error = "Chains with empty signatures: " + m_offending; 
-     }
-    
-  }    
-private:
-  std::string m_offending;
-};
-
-
-//////////////////////// check inputs to L2 and EF  /////////////////////////
-class LowerLevelMatchingTest : public TrigConfTest {
-public:
-  LowerLevelMatchingTest() 
-    : TrigConfTest("LowerLevelMatching", "Chains seeds must exist"),
-      m_chains(""),
-      m_chainsEF("")
-  {}
-  
-  virtual void execute(const Exc_t&) {
-     if ( ! m_hlt ) return;
-
-     std::set<std::string> l2Chains;    
-     std::set<std::string> l1items;
-
-     for(const HLTChain* ch : m_hlt->getHLTChainList())
-        if ( ch->level() == "L2" ) l2Chains.insert( ch->chain_name() );
-     
-     if ( m_ctp ) {
-        int itemsCount = m_ctp->menu().itemVector().size();
-        for ( int i = 0 ; i < itemsCount; ++i ) {
-           TriggerItem* item = m_ctp->menu().itemVector()[i];
-           l1items.insert(item->name());
-        }
-     }
-     //copy(l1items.begin(),l1items.end(),std::ostream_iterator<std::string>(std::cout, " | "));
-  
-     // loop egain for all HLT chains and check if they use non-existing seeds
-
-     for(const HLTChain* ch : m_hlt->getHLTChainList()) {
-        if(!m_ctp && ( ch->level_enum() == L2 || ch->level_enum() == HLT) ) continue; // if there is no L1 info, we can't check the L2 or HLT chains for input
-        const std::string& lcn = ch->lower_chain_name();
-        if ( lcn == "" ) continue;  // unseeded chains are fine
-        const std::set<std::string>& lower = ch->level() == "EF"?l2Chains:l1items;
-        if (lcn.find(',')!=std::string::npos) {
-           std::vector<std::string> singleItems = TrigConf::split(lcn, ",");
-           for(std::vector<std::string>::iterator itit = singleItems.begin(); itit!=singleItems.end(); ++itit) {
-              std::string l1seed = *itit;
-              TrigConf::strip(l1seed);
-              if ( lower.count(l1seed) == 0 )
-                 m_chains += ch->chain_name() + "(missing seed " + l1seed + "), ";
-           }
-
-           if(ch->level() == "EF" && singleItems.size() != 1) {
-              m_chainsEF += ch->chain_name() + "(multiple L2 seeds " + lcn + "), ";
-           }
-
-        } else {
-           if ( lower.count(lcn) == 0 )
-              m_chains += ch->chain_name() + "(missing seed " + lcn + "), ";
-        }
-     }
-
-     if(m_chains.size()!=0)
-        m_error = "The following chains have non-existing lower chain or item: " + m_chains;
-
-     if(m_chainsEF.size()!=0)
-        m_error += "The following chains have multiple L2 inputs: " + m_chainsEF;
-  }
-  
-private:
-  std::string m_chains;
-  std::string m_chainsEF;
-};
-
-// USAGE OF ALL LVL1 ITEMS AS PREREQUISITE TO AN HLT CHAIN, AND ALL L2 CHAINS TO AN EF CHAIN //
-class LowerLevelUsedTest : public TrigConfTest {
-public:
-   LowerLevelUsedTest(int level) 
-      : TrigConfTest((level==1?"SeedingL2":"SeedingEF"), (level==1?"Check for L1 items not used by L2":"Check for L2 chains not used by EF"), INFO),
-        m_chains(""),
-        m_items(""),
-        m_level(level)
-   {}
-  
-   virtual void execute(const Exc_t& exceptions) {
-      if ( ! m_hlt ) return;
-    
-      std::set<std::string> chainsSeedingEF;
-      std::set<std::string> itemsSeedingL2;
-
-      for(const HLTChain* ch: m_hlt->getHLTChainList() ) {
-
-         const std::string& lcn = ch->lower_chain_name();
-         if ( lcn == "" ) continue; // unseeded chains
-         std::set<std::string>& seeds = ch->level() == "EF"?chainsSeedingEF:itemsSeedingL2;
-         if (lcn.find(',')!=std::string::npos) {
-            std::vector<std::string> singleItems = TrigConf::split(lcn, ",");
-
-            for(string itemname : singleItems ) {
-               TrigConf::strip(itemname);
-               seeds.insert( itemname );
-            }
-
-         } else {
-            seeds.insert( lcn );
-         }
-      }
-
-      //std::copy(itemsSeedingL2.begin(), itemsSeedingL2.end(), std::ostream_iterator<std::string>(std::cout," "));
-
-      std::vector<boost::regex> exc_regex;
-      for(const string& exc : exceptions ) {
-         exc_regex.push_back(boost::regex(exc+"$"));
-      }
-
-      if(m_level==2) {
-         for(const TrigConf::HLTChain* ch : m_hlt->getHLTChainList() ) {
-            if (ch->level() == "EF") continue;
-            if (ch->level() == "HLT") continue;
-	 
-            // check for excempt chains
-            bool chain_is_excempt = false;
-            for(const boost::regex& e : exc_regex ) {
-               if(regex_match(ch->chain_name(), e)) {
-                  chain_is_excempt = true;
-                  break;
-               }
-            }
-            if(chain_is_excempt) continue;
-	  
-            if( chainsSeedingEF.count( ch->chain_name())==0 ) {
-               if(m_chains!="") m_chains += ", ";
-               m_chains += ch->chain_name();
-            }
-         }
-         if(m_chains.size()>0){
-            m_error = "L2 chains not seeding EF: " + m_chains;
-         }
-      }
-     
-     
-      if ( m_ctp && m_level==1 ) {
-       
-         for(TriggerItem* item: m_ctp->menu().itemVector() ) {
-
-            // check for exceptions
-            bool item_is_excempt = false;
-            for(const boost::regex& e : exc_regex ) {
-               if(regex_match(item->name(), e)) {
-                  item_is_excempt = true;
-                  break;
-               }
-            }
-            if(item_is_excempt) continue;
-
-            if ( itemsSeedingL2.count(item->name()) == 0 ) {
-               if (m_items!="") m_items += ", ";
-               m_items += item->name();
-            }
-         }
-         if(m_items.size()>0){	  
-            m_error = "CTP items not seeding L2/HLT chains: " + m_items;
-         }
-      }
-   }
-  
-private:
-   std::string m_chains;
-   std::string m_items;
-   int m_level;
-};
-
-
-
-#define INITTHR(THR) \
-    unsigned int THR = THR##_max; \
-    string THR##List  = "";
-
-#define SUBTHR(THR) \
-   if(thr->type()==L1DataDef::THR##Type()) { \
-         THR--; \
-         THR##List += thr->name() + ", "; \
-   } else
-
-#define CHECKTHR(THR) \
-   if(THR!=0) m_missingThresholds += L1DataDef::THR##Type() + ", "
-
-#define ERRORTHR(THR) \
-   if(THR>0) m_error += "\n [" + THR##List + "] (required are " + char(char('0')+THR##_max/10) + char(char('0')+THR##_max%10) + ")"
-
-
-
-// All L1Calo thresholds must be defined, even if not used
-class L1CaloThrDef : public TrigConfTest {
-public:
-   L1CaloThrDef() 
-      : TrigConfTest("L1CaloDefined", "Check if all L1 calo thresholds are defined", INFO),
-        m_missingThresholds("")
-   {}
-
-  
-   virtual void execute(const Exc_t&) {
-      if ( !m_ctp ) return;
-
-      int l1Version = m_ctp->menu().thresholdConfig().l1Version();
-      
-      L1DataDef::setMaxThresholdsFromL1Version(l1Version);
-      //L1DataDef::printMaxThresholds();
-      
-      unsigned int em_max  = L1DataDef::typeConfig(L1DataDef::EM).max;  
-      unsigned int tau_max = L1DataDef::typeConfig(L1DataDef::TAU).max;
-      unsigned int jet_max = L1DataDef::typeConfig(L1DataDef::JET).max;
-      unsigned int jf_max  = L1DataDef::typeConfig(L1DataDef::JF).max; //max_JF_Threshold_Number();
-      unsigned int jb_max  = L1DataDef::typeConfig(L1DataDef::JB).max; //ymax_JB_Threshold_Number();
-      unsigned int te_max  = L1DataDef::typeConfig(L1DataDef::TE).max; //max_TE_Threshold_Number();
-      unsigned int xe_max  = L1DataDef::typeConfig(L1DataDef::XE).max; //max_XE_Threshold_Number();
-      unsigned int je_max  = L1DataDef::typeConfig(L1DataDef::JE).max; //max_JE_Threshold_Number();
-      unsigned int xs_max  = L1DataDef::typeConfig(L1DataDef::XS).max; //max_XS_Threshold_Number();
-      INITTHR(em)
-         INITTHR(tau)
-         INITTHR(jet)
-         INITTHR(jf)
-         INITTHR(jb)
-	INITTHR(te)
-         INITTHR(xe)
-         INITTHR(je)
-         INITTHR(xs)
-        
-	for(const TrigConf::TriggerThreshold* thr : m_ctp->menu().thresholdConfig().thresholdVector() ) {
-	  SUBTHR(em)
-            SUBTHR(tau)
-            SUBTHR(jet)
-            SUBTHR(jf)
-            SUBTHR(jb)
-            SUBTHR(te)
-            SUBTHR(xe)
-            SUBTHR(je)
-            SUBTHR(xs) {};
-      }
-      
-
-      CHECKTHR(em);
-      CHECKTHR(tau);
-      CHECKTHR(jet);
-      CHECKTHR(jf);
-      CHECKTHR(jb);
-      CHECKTHR(te);
-      CHECKTHR(xe);
-      CHECKTHR(je);
-      CHECKTHR(xs);
-
-      if(m_missingThresholds.size()>0) {
-         m_error = "L1 calo thresholds that are not complete: " + m_missingThresholds;
-         ERRORTHR(em);
-         ERRORTHR(tau);
-         ERRORTHR(jet);
-         ERRORTHR(jf);
-         ERRORTHR(jb);
-	 ERRORTHR(te); //for now disabled
-         ERRORTHR(xe);
-         ERRORTHR(je);
-         ERRORTHR(xs);
-      }
-   }
-  
-private:
-   std::string m_missingThresholds;
-};
-
-
-#define INIT_THRMAP(THR) \
-  thr_map[L1DataDef::THR##Type()] = std::vector<string>(THR##_max);   \
-  thr_map_frep[L1DataDef::THR##Type()] = std::vector<int>(THR##_max); \
-  thr_count[L1DataDef::THR##Type()] = 0;                              \
-  typeName.insert(L1DataDef::THR##Type());                            
-
-// All L1Calo thresholds must be defined, even if not used
-class L1CaloThrOrder : public TrigConfTest {
-public:
-  L1CaloThrOrder() 
-     : TrigConfTest("L1CaloThrOrder", "Check if all L1 calo thresholds are in the correct order", ERROR)
-  {}
-
-  
-  virtual void execute(const Exc_t&) {
-     if ( !m_ctp ) return;
-
-     unsigned int em_max  = L1DataDef::max_EM_Threshold_Number();  // this is actually em+tau
-     unsigned int tau_max = L1DataDef::max_TAU_Threshold_Number();
-     unsigned int jet_max = L1DataDef::typeConfig(L1DataDef::JET).max;
-     unsigned int jf_max  = L1DataDef::max_JF_Threshold_Number();
-     unsigned int jb_max  = L1DataDef::max_JB_Threshold_Number();
-     unsigned int te_max  = L1DataDef::max_TE_Threshold_Number();
-     unsigned int xe_max  = L1DataDef::max_XE_Threshold_Number();
-     unsigned int je_max  = L1DataDef::max_JE_Threshold_Number();
-     unsigned int xs_max  = L1DataDef::max_XS_Threshold_Number();
-
-     std::map<string, std::vector<string> > thr_map;
-     std::map<string, std::vector<int> > thr_map_frep;
-     std::map<string, int > thr_count;
-     std::set<string> typeName;
-
-     INIT_THRMAP(em);
-     INIT_THRMAP(tau);
-     INIT_THRMAP(jet);
-     INIT_THRMAP(jf);
-     INIT_THRMAP(jb);
-     INIT_THRMAP(te);
-     INIT_THRMAP(xe);
-     INIT_THRMAP(je);
-     INIT_THRMAP(xs);
-
-     boost::regex e("(\\D+)(\\d+)([_.[:alpha:]0-9]*)");
-     boost::cmatch matches;  // cmatch = match_results<const char*>
-
-     // calculate threshold rank
-     for(const TrigConf::TriggerThreshold* thr : m_ctp->menu().thresholdConfig().thresholdVector() ) {
-        if(typeName.find(thr->type()) == typeName.end()) continue; // only l1 calo
-
-        int i = -1;
-        if(boost::regex_match(thr->name().c_str(), matches, e)) {
-           i = 10*boost::lexical_cast<int,std::string>(string(matches[2].first, matches[2].second));  // the value
-           string extra(matches[3].first, matches[3].second); // extra arg like HV or I
-           if(thr->type()!=L1DataDef::jetType()) { // for jet in HI menu this doesn't work because of the order J5_win8, J5_win6, J5, J10,...
-              i += matches[3].second-matches[3].first;
-           } 
-        } else {
-           cout << thr->name() << " does not match pattern " << std::endl;
-        }
-        thr_map[thr->type()][thr->mapping()] = thr->name();
-        thr_map_frep[thr->type()][thr->mapping()] = i;
-        thr_count[thr->type()] = thr_count[thr->type()] + 1;
-     }
-
-     for(size_t i(0);i<thr_map[L1DataDef::tauType()].size();i++) {
-        thr_map[L1DataDef::emType()].pop_back();
-        thr_map_frep[L1DataDef::emType()].pop_back();
-     }
-
-     for(string thrname : typeName ) {
-        // check the vector
-        bool ordered = true;
-        int pre_v = 0;
-        for(int i=0; i<thr_count[thrname]; i++ ) {
-           int v = thr_map_frep[thrname][i];
-           if(v<pre_v) { ordered=false; break; }
-           pre_v = v;
-        }
-        if( ! ordered ) {
-//            std::cout << "Unordered: " << thrname << ": ";
-//            std::copy(thr_map[thrname].begin(), thr_map[thrname].end(), std::ostream_iterator<std::string>(std::cout,", "));
-//            std::cout << std::endl;
-
-           if(m_error.size()==0) m_error = "Some calo threshold types are out of order: ";
-           m_error += "\n" + thrname + ": ";
-           for(string thresh : thr_map[thrname]) { m_error += thresh + ", "; }
-
-        }
-     }
-
-  }
-  
-private:
-};
-
-
-
-
-///////////////// ALL TE'S OF A SIGNATURE MUST HAVE A PRODUCING SEQUENCE //////////////////
-
-class SignaturesProducibleTest : public TrigConfTest {
-public:
-  SignaturesProducibleTest() 
-    : TrigConfTest("SignaturesProducible","Sequences for all steps must exist")  {}
-  
-  virtual void execute(const Exc_t&) {
-     if ( ! m_hlt ) return;
-    
-     std::set<std::string> teOutFromSeq;
-
-     // find all output TE's from the SequenceList
-     for(const HLTSequence* seq : m_hlt->getHLTSequenceList())
-        teOutFromSeq.insert( seq->outputTE()->name());
-     
-     for(const HLTChain* ch : m_hlt->getHLTChainList()) {
-        for ( unsigned int s = 0; s < ch->signatureList().size(); s++ ) {
-           HLTSignature* sig = ch->signatureList()[s];
-           for ( unsigned int t = 0; t < sig->outputTEs().size(); ++t ) {
-              if ( teOutFromSeq.count(sig->outputTEs()[t]->name()) == 0 )
-                 m_chains += ch->chain_name()+" (step "+boost::lexical_cast<std::string,int>(sig->signature_counter())+"): "+sig->outputTEs()[t]->name()+", ";
-           }
-        }
-     }
-     if(m_chains.size()>0)
-        m_error = "Chains with signatures that can't be produced due to missing sequence: ";// + m_chains;
-  }
-
-  private:
-  std::string m_chains;
-};
-
-
-
-////////////////////////////// UNIQUE OUTPUT TE //////////////////////////////
-class SequenceOutputUniqueTest : public TrigConfTest {
-public:
-   SequenceOutputUniqueTest() 
-      : TrigConfTest("SequenceOutputUnique", "Sequence output TE's must be unique")  {}
-  
-   virtual void execute(const Exc_t&) {
-      if ( ! m_hlt ) return;
-
-      std::set<std::string> teOutFromSeq;
-
-      for(const HLTSequence* seq : m_hlt->getHLTSequenceList()) {
-         if ( teOutFromSeq.count( seq->outputTE()->name() ) == 0 ) 
-            teOutFromSeq.insert( seq->outputTE()->name());
-         else {
-            if(m_tes!="") m_tes += ", ";
-            m_tes += seq->outputTE()->name();
-         }
-      }
-      if(m_tes.size()>0)
-         m_error = "TE's produced by more than one sequence: " + m_tes;
-   }
-
-private:
-   std::string m_tes;
-};
-
-
-//////////////// INPUT TE'S OF USED SEQUENCES MUST BE OUTPUT TE OF ANOTHER SEQUENCE  /////////////////
-class SequenceInputProducibleTest : public TrigConfTest {
-public:
-  SequenceInputProducibleTest() 
-    : TrigConfTest("SequenceInputProducible", "All input TE's must be produced")  {}
-  
-  virtual void execute(const Exc_t&) {
-     if ( !m_hlt || !m_ctp ) return;
-    
-     std::set<std::string> teOut;      // TE's that are output of any sequence in the sequence list
-     std::set<std::string> teInForSeq; // TE's that are input to any sequence in the sequence list
-    
-     // find all output and input TE's from the SequenceList
-     for(HLTSequence* seq : m_hlt->getHLTSequenceList()) {
-        teOut.insert( seq->outputTE()->name());
-        for(const TrigConf::HLTTriggerElement* te : seq->inputTEs())
-           if(te->name()!="") teInForSeq.insert( te->name());
-     }
-
-     // add the threshold names to the output TE's
-     for( TriggerThreshold* thr : m_ctp->menu().thresholdConfig().thresholdVector() )
-        teOut.insert( thr->name() );
-
-     // check if all inputs are mentioned in outputs
-     for(const string& inTE : teInForSeq) {
-        if ( teOut.count(inTE) == 0) { // input does not appear ( empty string is excepted )
-           cout << "Not found as output ------------------: "  << inTE << endl;
-           m_tes += inTE + ", ";
-        }
-     }
-     if(m_tes.size() != 0)
-        m_error = " The following input TEs don't appear as output TE: " + m_tes;
-
-  }
-
-private:
-  std::string m_tes;
-};
-
-
-
-///////////////////////// TEs used by EF chains are produced by corresponding L2 chain or come from L1 /////////////////////////
-class EFTEsFromSeedingL2ChainsTest : public TrigConfTest {
-public:
-  EFTEsFromSeedingL2ChainsTest()
-    : TrigConfTest("EFTEsFromL2", "EF input TEs produced by corresponding L2 chain or be L1 ROI")
-  {}
-  virtual void execute(const Exc_t&) {
-     if ( !m_hlt || !m_ctp ) return;
-
-     std::map<std::string, const TrigConf::HLTChain*> chainsMap;
-     for(const HLTChain* ch : m_hlt->getHLTChainList()) {
-        chainsMap[ch->lower_chain_name()] = ch;
-     }
-
-     std::map<std::string, const TrigConf::HLTSequence*> sequencesMap;
-     for(const HLTSequence* seq : m_hlt->getHLTSequenceList()) {
-        sequencesMap[seq->outputTE()->name()] = seq;
-     }
-
-
-     std::set<std::string> l1thresholds;
-     for(std::vector<TriggerThreshold*>::const_iterator thrIt = m_ctp->menu().thresholdConfig().thresholdVector().begin();
-         thrIt != m_ctp->menu().thresholdConfig().thresholdVector().end(); ++thrIt)
-        l1thresholds.insert((*thrIt)->name());
-
-
-     for(const HLTChain* ch : m_hlt->getHLTChainList()) {
-        if (ch->level() == "L2") // this is EF check
-           continue;
-        if (ch->lower_chain_name() == "") // skip unseeded
-           continue;
-        const TrigConf::HLTChain* efchain = ch;
-        const TrigConf::HLTChain* l2chain = chainsMap[efchain->lower_chain_name()];
-        std::set<std::string> l2tes = HLTTEUtils::allTEsProducedInL2Chain(*l2chain, m_hlt->getHLTSequenceList());
-        std::set<std::string> eftes = HLTTEUtils::allTEsProducedInEFChain(*efchain, m_hlt->getHLTSequenceList(), l2tes);
-
-        std::set<std::string> efinputTEs;
-        std::set<std::string>::const_iterator te;
-
-        for (te = eftes.begin(); te != eftes.end(); ++te) {	
-           // find input
-           const TrigConf::HLTSequence* s = sequencesMap[*te];	
-           // and complain if it is not there (or it is not L1 threshold)
-           if ( s == 0 || l1thresholds.find(*te) == l1thresholds.end()) {
-              m_error += " missing sequence for TE: " + *te + " ";
-              continue;
-           }
-           for ( unsigned int t = 0; t < s->inputTEs().size(); ++t ) {
-              std::string name = s->inputTEs()[t]->name();
-              if( name == "" ) 
-                 continue;
-              if ( eftes.find(name) == eftes.end())
-                 efinputTEs.insert(name);
-           }
-        } 
-      
-        // ugh, all above is 3 lines in python
-        for ( te = efinputTEs.begin(); te != efinputTEs.end(); ++te ) {
-           if ( l2tes.find(*te) == l2tes.end() &&  l1thresholds.find(*te) == l1thresholds.end() ) {
-              m_error += "Chain: "+efchain->chain_name()+"  TE: "+ (*te) + " " ;
-           }
-        }
-     }
-  }
-
-};
-
-///////////////////////// LVL1 ITEMS AND'ED WITH BGRP0 /////////////////////////
-class BGRP0Test : public TrigConfTest {
-public:
-  BGRP0Test() 
-    : TrigConfTest("BGRP0Test", "All Level 1 Items must be AND'ed with BGRP0"),
-      m_offending("")
-  {}
-
-  void checkForBG0inTop(const TriggerItemNode * const  node, bool& found) const
-  {
-    // BGRP0 must be in top AND in the logic
-    if(node==0 || node->type()==TriggerItemNode::OR || node->type()==TriggerItemNode::NOT) return;
-    if(node->type()==TriggerItemNode::OBJ &&
-       node->isInternalTrigger() &&
-       node->internalTriggerType() == L1DataDef::BGRP &&
-       node->internalTriggerNumber() == 0
-       ) {
-      found = true;
-      return;
-    }
-    for(TriggerItemNode *child : node->children())
-       checkForBG0inTop(child, found);
-  }
-
-  virtual void execute(const Exc_t&) {
-     if ( !m_ctp ) return;
-     for(TriggerItem* trItem : m_ctp->menu().items() ) {
-        if(trItem->name().find("L1_BGRP")==0) continue; // the 8 BGRP_X triggers are special
-        bool found = false;
-        checkForBG0inTop(trItem->topNode(),found);
-        if(!found) {
-           if(m_offending!="") m_offending += ", ";
-           m_offending += trItem->name();
-        }
-     }
-     if(m_offending.size()!=0)
-        m_error = "Items that are not correctly AND'ed with BGRP0: " + m_offending;
-  }
-  
-private:
-  std::string m_offending;
-};
-
-///////////////////////// The seeding btween L2 and L1 is consistent /////////////////////////
-class ThrSeqMismatch : public TrigConfTest {
-public:
-   ThrSeqMismatch() 
-      : TrigConfTest("ThrSeqMismatch", "Sequences of chains must seed from TEs used to make L1 item", WARNING)
-   {}
-   
-   typedef std::pair<boost::regex,boost::regex> ExpPair_t;
-   
-   virtual void execute(const Exc_t& exceptions) {
-      using std::set; using std::string; using std::map;
-      if ( !m_hlt || !m_ctp ) return;
-
-
-      string roibased_thresholds(" FJET JF JB EM TAU MUON XE TE XS JE JET CALREQ ");
-
-      
-      vector<boost::regex> exc_regex;
-      vector<ExpPair_t> exc_regex_withinput;
-   
-      boost::regex pattern("([^-]*)(?:->(.*))?$");
-      boost::cmatch matchgroup;  // cmatch = match_results<const char*>
-      for(const string& s: exceptions ) {
-         if(regex_match(s.c_str(), matchgroup, pattern) ) {
-            string chainPattern(matchgroup[1].first, matchgroup[1].second);
-            if(matchgroup[2].second-matchgroup[2].first==0) {
-               exc_regex.push_back(boost::regex(chainPattern+"$"));
-            } else {
-               string inputPattern(matchgroup[2].first, matchgroup[2].second);
-               exc_regex_withinput.push_back(ExpPair_t(boost::regex(chainPattern+"$"),boost::regex(inputPattern+"$") ));
-            }
-         }
-      }
-
-      for( HLTChain* ch: m_hlt->getHLTChainList() ) {
-
-         if( ch->level()=="EF" ) continue; // chains we do not care about in this check
-         if( ch->lower_chain_name() == "") continue; // unseeded
-         if( ch->lower_chain_name().find(',') != string::npos) continue; // multi seeded 
-
-         if( matches_any(exc_regex, ch->chain_name()) ) continue; // listed in exception
-
-
-         vector<boost::regex> input_exps;
-         for(ExpPair_t exps: exc_regex_withinput)
-            if(regex_match(ch->chain_name(), exps.first))
-               input_exps.push_back(exps.second);
-      
-
-         // these are the TEs that the L2 chain needs from L1
-         set<string> needed_tes;
-         {
-            set<string> produced_tes = HLTTEUtils::allTEsProducedInL2Chain( *ch, m_hlt->getHLTSequenceList());
-      
-            set<string> input_tes    = HLTTEUtils::inputTEs(produced_tes, m_hlt->getHLTSequenceList());
-
-            set_difference( input_tes.begin(), input_tes.end(),
-                            produced_tes.begin(), produced_tes.end(), 
-                            inserter(needed_tes, needed_tes.begin()));
-         }
-
-        
-         // the notProducedInChain should be L1
-         // now we need the L1 thresholds per item
-         const TriggerItem* item = m_ctp->menu().item(ch->lower_chain_name());
-         if ( ! item )
-            continue; // other check should grab this
-
-
-         set<string> item_tes; // thresholds provided by input item
-         vector<TriggerThreshold*> thresholds;
-         item->topNode()->getAllThresholds(thresholds); 
-         for(TriggerThreshold* t: thresholds) {
-            //if ( roibased_thresholds.find(" "+t->type()+" ") != string::npos )
-            item_tes.insert(t->name());	  
-         }
-      
-         // we can now check if the two sets (needed and comming from L1) are the same
-         set<string> missing_tes;
-         std::set_difference( needed_tes.begin(), needed_tes.end(),
-                              item_tes.begin(), item_tes.end(), 
-                              std::inserter(missing_tes, missing_tes.begin()));
-
-
-         // special treatment 1) for XE and XS triggers: seeding a chain of L1_XE<N> provides XE<M> thresholds for M<=N
-         int max_xe_provided = 0;
-         int max_xs_provided = 0;
-         int max_J_provided = 0;
-         int max_mu_provided = 0;
-         boost::regex eXE("XE(\\d+)");
-         boost::regex eXS("XS(\\d+)");
-         boost::regex eJ("J(\\d+)");
-         boost::regex eMU("MU(\\d+)");
-         boost::cmatch matchRes;  // cmatch = match_results<const char*>
-         for(string providedTE : item_tes) { // find the maximum provided threshold
-            if( boost::regex_match(providedTE.c_str(),matchRes,eXE)) {
-               int thrVal = boost::lexical_cast<int,std::string>(string(matchRes[1].first, matchRes[1].second));
-               if(thrVal>max_xe_provided) max_xe_provided = thrVal;
-            }
-            if( boost::regex_match(providedTE.c_str(),matchRes,eXS)) {
-               int thrVal = boost::lexical_cast<int,std::string>(string(matchRes[1].first, matchRes[1].second));
-               if(thrVal>max_xs_provided) max_xs_provided = thrVal;
-            }
-            if( boost::regex_match(providedTE.c_str(),matchRes,eJ)) {
-               int thrVal = boost::lexical_cast<int,std::string>(string(matchRes[1].first, matchRes[1].second));
-               if(thrVal>max_J_provided) max_J_provided = thrVal;
-            }
-            if( boost::regex_match(providedTE.c_str(),matchRes,eMU)) {
-               int thrVal = boost::lexical_cast<int,std::string>(string(matchRes[1].first, matchRes[1].second));
-               if(thrVal>max_mu_provided) max_mu_provided = thrVal;
-            }
-         }
-
-         //std::cout << "\n" << ch->chain_name() << " <-- " << ch->lower_chain_name() << ": XEmax" << max_xe_provided << " XSmax" << max_xs_provided << "  Jmax=" << max_J_provided << "  MUmax=" << max_mu_provided << std::endl;
-
-         // special treatment 2) for XS triggers: seeding a chain of L1_XS<N> provides XE10 and XS15
-         for(string providedTE : item_tes) { // find the maximum provided threshold
-            if( boost::regex_match(providedTE.c_str(),eXS)) {
-               if(10>max_xe_provided) max_xe_provided = 10;
-               if(15>max_xs_provided) max_xs_provided = 15;
-            }
-         }
-
-         boost::regex eJE("JE(\\d+)");
-         for(string providedTE : item_tes) { // find the maximum provided threshold
-            if( boost::regex_match(providedTE.c_str(),eJE)) {
-               if(10>max_J_provided) max_J_provided = 10;
-            }
-         }
-
-
-
-
-         if(missing_tes.size()>0) {
-            set<string> tmp_missing_tes;
-            for(string missingTE : missing_tes) {
-               if( boost::regex_match(missingTE.c_str(),matchRes,eXE)) {
-                  int thrVal = boost::lexical_cast<int,std::string>(string(matchRes[1].first, matchRes[1].second));
-                  if(thrVal>max_xe_provided) {
-                     tmp_missing_tes.insert(missingTE);
-                  }
-               } else if( boost::regex_match(missingTE.c_str(),matchRes,eXS)) {
-                  int thrVal = boost::lexical_cast<int,std::string>(string(matchRes[1].first, matchRes[1].second));
-                  if(thrVal>max_xs_provided) {
-                     tmp_missing_tes.insert(missingTE);
-                  }
-               } else if( boost::regex_match(missingTE.c_str(),matchRes,eJ)) {
-                  int thrVal = boost::lexical_cast<int,std::string>(string(matchRes[1].first, matchRes[1].second));
-                  if(thrVal>max_J_provided) {
-                     tmp_missing_tes.insert(missingTE);
-                  }
-               } else if( boost::regex_match(missingTE.c_str(),matchRes,eMU)) {
-                  int thrVal = boost::lexical_cast<int,std::string>(string(matchRes[1].first, matchRes[1].second));
-                  if(thrVal>max_mu_provided) {
-                     tmp_missing_tes.insert(missingTE);
-                  }
-               } else {
-                  tmp_missing_tes.insert(missingTE);
-               }
-            }
-            missing_tes = tmp_missing_tes;
-         }
-
-
-         // remove exceptions
-         if(input_exps.size()>0) {
-            set<string> tmp_missing_tes;
-            for(string te : missing_tes) {
-               if(! matches_any(input_exps, te)) { // no exception
-                  tmp_missing_tes.insert(te);
-               }
-            }
-            missing_tes = tmp_missing_tes;
-         } 
-
-
-         if ( ! missing_tes.empty() ) {
-	
-            // skip known exceptions
-//             if (  exceptions.find(ch->chain_name()) != exceptions.end() ) {
-//                continue;
-//             }
-            m_error +=  "\n                                  " + severity() + " chain " + ch->chain_name() + " seeded by " + item->name() +" - thresholds needed:";
-            for(const string& th : needed_tes ) {
-               m_error += " "+th; 	  
-            }
-            m_error += ", thresholds from L1 seed:";
-            for( const string& th : item_tes ) {
-               m_error += " "+th; 	  
-            }
-            m_error += ", hence missing: "; // + boost::lexical_cast<string,unsigned int>(missing_tes.size());
-            for( const string& th : missing_tes ) {
-               m_error += " "+th;
-            }
-	
-         }
-      }
-   }
-};
-
-///////////////////////// CHECK THAT RECURSIVE RUNNING DOES NOT CROSS THE LEVEL (DOES NOT REQURE L2 SEQUENCES TO RUN AT EF) /////////////////////////
-class CrossLevelAlgSeeding : public TrigConfTest {
-public:
-  CrossLevelAlgSeeding() 
-    : TrigConfTest("CrossLevelAlgSeeding", "Check that recursive running does not cross levels"),
-      m_offending("")
-  {}
-  
-  virtual void execute(const Exc_t&) {
-     using std::set; using std::string;
-     if ( !m_hlt || !m_ctp ) return;
-
-     // Set of all output TE's produced at L2
-     set<std::string> l1thresholds;
-     for(std::vector<TriggerThreshold*>::const_iterator thrIt = m_ctp->menu().thresholdConfig().getThresholdVector().begin();
-         thrIt != m_ctp->menu().thresholdConfig().getThresholdVector().end(); ++thrIt)
-        l1thresholds.insert((*thrIt)->name());
-
-
-     set<std::string> outputTEsAllL2Chains = HLTTEUtils::allTEsProducedInL2( *m_hlt );
-
-     // loop over chains
-     for(const HLTChain* ch : m_hlt->getHLTChainList()) {
-        if( ch->level()=="L2" ) continue;
-        if( ch->lower_chain_name()=="" ) continue;
-
-        // set of all TE's produced in the EF chain (including the recursively produced TE's)
-        set<std::string> outputTEsEFChain = HLTTEUtils::allTEsProducedInEFChain( *ch, m_hlt->getHLTSequenceList(), outputTEsAllL2Chains);
-
-        // set of corresponding input TE's
-        set<std::string> inputTEsEFChain = HLTTEUtils::inputTEs( outputTEsEFChain, m_hlt->getHLTSequenceList() );
-
-        // remove the unseeded algorithms
-        inputTEsEFChain.erase("");
-
-        // input TE's not produced in this chain
-        set<string> notProducedInEFChain;
-        std::set_difference( inputTEsEFChain.begin(), inputTEsEFChain.end(),
-                             outputTEsEFChain.begin(), outputTEsEFChain.end(), 
-                             std::inserter(notProducedInEFChain,notProducedInEFChain.begin()));
-
-
-        // corresponding L2 chain
-        const TrigConf::HLTChain* lowerch = m_hlt->getHLTChainList().chain(ch->lower_chain_name());
-        set<std::string> outputTEsL2Chain = HLTTEUtils::allTEsProducedInL2Chain( *lowerch, m_hlt->getHLTSequenceList() );
-        set<string> notProducedInL2Chain;
-        std::set_difference( notProducedInEFChain.begin(), notProducedInEFChain.end(),
-                             outputTEsL2Chain.begin(), outputTEsL2Chain.end(), 
-                             std::inserter(notProducedInL2Chain,notProducedInL2Chain.begin()));
-
-        set<string> notProducedInL1Either;
-        std::set_difference( notProducedInL2Chain.begin(), notProducedInL2Chain.end(),
-                             l1thresholds.begin(), l1thresholds.end(), 
-                             std::inserter(notProducedInL1Either,notProducedInL1Either.begin()));
-
-
-        if ( notProducedInL1Either.size()!=0 ) {
-           if(m_offending!="") m_offending += ", ";
-           m_offending += ch->chain_name() + "(requires ";
-           for(set<string>::iterator teIt = notProducedInL1Either.begin(); teIt != notProducedInL1Either.end(); ++teIt) {
-              m_offending += (*teIt);
-              m_offending += ")";
-           }
-        }
-     }
-     if(m_offending.size()!=0)
-        m_error = "EF chains that recursively call L2 sequences: " + m_offending;
-  }
-  
-private:
-  std::string m_offending;
-};
-
-//////////////////////////////////////// CHECK THAT CTP IDS ARE NOT USED TWICE //////////////////////////////
-class CTPCountersUnique : public TrigConfTest {
-public:
-  CTPCountersUnique() 
-    : TrigConfTest("CTPCountersUnique", "The CPT ID is not reused by the items"),
-      m_offending("")
-  {}
-  
-  virtual void execute(const Exc_t&) {
-     if ( ! m_ctp ) return;
-
-     unsigned int itemsNumber = m_ctp->menu().itemVector().size();
-     std::map<int, std::string> id_to_name;
-    
-     for ( unsigned int i = 0; i < itemsNumber; i++ ) {
-        std::map<int, std::string>::const_iterator found = id_to_name.find(m_ctp->menu().itemVector()[i]->ctpId());
-        if ( found != id_to_name.end() ) {
-           // we have gor offender
-           m_offending += " "+m_ctp->menu().itemVector()[i]->name()+"&"+found->second;
-        }
-        id_to_name[m_ctp->menu().itemVector()[i]->ctpId()] = m_ctp->menu().itemVector()[i]->name();
-     }
-    
-     if( ! m_offending.empty() ) {
-        m_error = "Found L1 items using the same CTP ID:"+m_offending;
-     }
-  }
-private:
-  std::string m_offending;
-};
-
-/////////////////////////// SYMETRIC 1. ETA CUT 2. PRESENCE IN FORWARD/BACKWARD JETS ///////////////////////////
-class FJBJThresholdSymetric : public TrigConfTest {
-public:
-  FJBJThresholdSymetric() 
-    : TrigConfTest("FJBJThresholdSymetric", "FJ/BJ thresholds symetric in eta")
-  {}
-  virtual void execute(const Exc_t&) {
-     if ( ! m_ctp ) return;
-    
-     std::map<std::string, TrigConf::TriggerThreshold*> forward_jets;
-     std::map<std::string, TrigConf::TriggerThreshold*> backward_jets;
-
-     // pick the thresholds
-     std::vector<TrigConf::TriggerThreshold*>::const_iterator i;     
-     const std::vector<TrigConf::TriggerThreshold*>& th = m_ctp->menu().thresholdVector(); // thresholdConfig()->getJfThresholdPointer();    
-
-    
-
-     for ( i = th.begin(); i != th.end(); ++i ) {
-        if ("JF" == (*i)->type())
-           forward_jets[(*i)->name()] = *i;
-        //      (*i)->print("");
-     }
-
-     //th = m_ctp->menu().thresholdConfig()->getJbThresholdPointer();
-
-     for ( i = th.begin(); i != th.end(); ++i ) {
-        if ("JB" == (*i)->type())
-           backward_jets[(*i)->name()] = *i;
-        // (*i)->print("");
-     }
-
-     if ( forward_jets.size() != backward_jets.size() ) {
-        m_error = "Different number of JF from JB";
-        return;
-     }
-
-     std::map<std::string, TrigConf::TriggerThreshold*>::const_iterator f,b;
-     for ( f = forward_jets.begin(); f != forward_jets.end(); ++f ) {
-        // find corresponding backward threshold
-        std::string bname("JB"+f->first.substr(2));
-        b = backward_jets.find( bname );
-        if ( b == backward_jets.end() ) {
-           m_error = "Forward Jet Threshold "+f->first + " has no corresponding Backward Jet Threshold " + bname;
-           return;
-        }
-        //      std::cerr << "Checking " << b->first << " " << f->first << std::endl;
-        // get first threshold values
-        unsigned fsz = f->second->thresholdValueVector().size();
-        unsigned bsz = b->second->thresholdValueVector().size();
-        if ( bsz != fsz || bsz != 2 ) {
-           m_offending += " ThresholdValues number wrong (not equal or != 2): " +f->first +" " +b->first;
-           return;
-        }
-        // the eta values in the first TriggerThresholdValue shoud be identical
-        const TrigConf::JetThresholdValue* fv_prio1 = dynamic_cast<const TrigConf::JetThresholdValue*>(f->second->thresholdValueVector()[0]);
-        const TrigConf::JetThresholdValue* bv_prio1 = dynamic_cast<const TrigConf::JetThresholdValue*>(b->second->thresholdValueVector()[0]);
-        const TrigConf::JetThresholdValue* fv_prio2 = dynamic_cast<const TrigConf::JetThresholdValue*>(f->second->thresholdValueVector()[1]);
-        const TrigConf::JetThresholdValue* bv_prio2 = dynamic_cast<const TrigConf::JetThresholdValue*>(b->second->thresholdValueVector()[1]);
-
-      
-        if(fv_prio1 && fv_prio2 && bv_prio1 && bv_prio2) {
-           if(fv_prio1->priority()>fv_prio2->priority()) {
-              const TrigConf::JetThresholdValue* tmp = fv_prio1; fv_prio1 = fv_prio2; fv_prio2 = tmp;
-           }
-           if(bv_prio1->priority()>bv_prio2->priority()) {
-              const TrigConf::JetThresholdValue* tmp = bv_prio1; bv_prio1 = bv_prio2; bv_prio2 = tmp;
-           }
-
-           if ( fv_prio1->etamin() != bv_prio1->etamin() || fv_prio1->etamax() != bv_prio1->etamax() ) {
-              m_offending += f->first +"/" +b->first + " (";
-              if (fv_prio1->etamin() != bv_prio1->etamin())
-                 m_offending += "min: " + boost::lexical_cast<std::string>(fv_prio1->etamin()) + "!=" + boost::lexical_cast<std::string>(bv_prio1->etamin()) + " ";
-              if (fv_prio1->etamax() != bv_prio1->etamax())
-                 m_offending += "max: " + boost::lexical_cast<std::string>(fv_prio1->etamax()) + "!=" + boost::lexical_cast<std::string>(bv_prio1->etamax()) + " ";
-              m_offending += "), ";
-              continue;
-           }
-        }
-
-
-        if (fv_prio2!=nullptr && bv_prio2!=nullptr) {
-           if ( fv_prio2->etamin() != -1* bv_prio2->etamax() || fv_prio2->etamax() != -1*bv_prio2->etamin() ) {
-              m_offending += " " +f->first +"/" +b->first + " "
-                 + boost::lexical_cast<std::string>(fv_prio2->etamin()) + "!=-1*" +  boost::lexical_cast<std::string>(fv_prio2->etamin()) +" or "
-                 + boost::lexical_cast<std::string>(fv_prio2->etamax()) + "!=-1*" +  boost::lexical_cast<std::string>(bv_prio2->etamin());
-           }
-        }
-     }
-    
-     if ( !m_offending.empty())
-        m_error = "The eta symmetry is violated by thresholds: " +m_offending;
-    
-  }
-private:
-  std::string m_offending;
-};
-
-////////////////////////// CHECK IF FORWARD & BACKWARD JETS ARE ALWAYS USED IN PAIRS /////////////////////////////
-class FJBJThrsholdsUsedInPairs : public TrigConfTest {
-public:
-  FJBJThrsholdsUsedInPairs()
-    : TrigConfTest("FJBJThrsholdsUsedInPairs", "FJ and BJ always used in pairs")
-  {}
-  virtual void execute(const Exc_t&) {
-     if ( ! m_ctp ) return;
-
-     std::string offending;
-
-     for( TriggerItem* item : m_ctp->menu().itemVector() ) {
-        std::vector<TrigConf::TriggerThreshold*> thresholds; 
-        item->topNode()->getAllThresholds(thresholds);
-        // filter thresholds to contain forward and backward only
-        std::vector<std::string> forward; 
-        std::vector<std::string> backward; 
-        for(TrigConf::TriggerThreshold* t : thresholds) {
-           if ("FJ" == t->type())
-              forward.push_back(t->name());
-           if ("BJ" == t->type())
-              backward.push_back(t->name());
-        }
-      
-        if ( ! (forward == backward) ) {
-           offending += item->name();
-        }
-     } // EOF loop over items
-
-     if ( !offending.empty() )
-        m_error = "FJ/BJ used not symetrically in items: " +offending;
-  }
-};
-
-//////////////////////////////////////// SYMETRIC ETA CUT IN FORWARD/BACKWARD JETS //////////////////////////////
-class CoherentPrescales : public TrigConfTest {
-public: 
-  CoherentPrescales() 
-    : TrigConfTest("CoherentPrescales", "Coherent Prescales correctly configured")
-  {}
-  virtual void execute(const Exc_t& exceptions) {
-     if ( ! m_hlt ) return;
-     typedef std::map<std::string, std::vector<const TrigConf::HLTChain*> > map_t;
-     map_t chains;
-     std::string offending;
-
-     std::vector<boost::regex> exc_regex = buildExcRec(exceptions);
-
-     for(const TrigConf::HLTChain * ch : m_hlt->getHLTChainList() ) {
-        unsigned int cnt = 0;
-        for( const std::string& gr :  ch->groups() ) {
-           if (gr.find("CPS:") != std::string::npos ) {
-              cnt += 1;
-              chains[gr].push_back(ch);
-           }
-        }
-        if (cnt > 1 ) {
-           offending += " only one CPS grp. for chain: " + ch->chain_name();
-        }
-     }
-     // now we have map of chain group to chains
-     // check 1 all chains are from the same level (to avoid confusion)
-     for(map_t::value_type& cpsgr : chains) {
-        std::string level = cpsgr.second[0]->level();
-        std::string item =  cpsgr.second[0]->lower_chain_name();
-        for(const TrigConf::HLTChain * ch : cpsgr.second) {
-           if ( ch->level() != level )
-              offending += " wrong trigger level: "+ch->chain_name();
-	
-           if ( ch->lower_chain_name() != item) 
-              offending += " wrong seed: "+ch->chain_name();
-
-           if ( (ch->lower_chain_name().find(",") != std::string::npos)
-                && matches_any(exc_regex, ch->chain_name()) )  // complain about CPS on multiseeded chains unless it is explicitelly marked OK
-              offending += " multi seeded chain can not use CPS: " + ch->chain_name();
-        }
-     }
-     if ( ! offending.empty() ) {
-        m_error += offending;
-     }
-  }
-};
-
-
-//////////////////////////////////////// SYMETRIC ETA CUT IN FORWARD/BACKWARD JETS //////////////////////////////
-class OverlappingThrValues : public TrigConfTest {
-public: 
-   OverlappingThrValues() 
-      : TrigConfTest("OverlappingThrValues", "Overlapping values for L1 threshold must have different priority")
-   {}
-
-   struct priobox_t {
-      priobox_t(): etamin(0), etamax(0), phimin(0), phimax(0), priority(0)
-      {};
-      priobox_t(int etamin_, int etamax_, int phimin_, int phimax_, int priority_):
-         etamin(etamin_),
-         etamax(etamax_),
-         phimin(phimin_),
-         phimax(phimax_),
-         priority(priority_)
-      {};
-      int etamin, etamax, phimin, phimax, priority;
-      bool overlaps(const priobox_t& other) const {
-         if(etamax<=other.etamin || 
-            etamin>=other.etamax ||
-            phimax<=other.phimin || 
-            phimin>=other.phimax) return false;
-         return true;
-      }
-      string s_etamin() { return boost::lexical_cast<std::string>(etamin); }
-      string s_etamax() { return boost::lexical_cast<std::string>(etamax); }
-      string s_phimin() { return boost::lexical_cast<std::string>(phimin); }
-      string s_phimax() { return boost::lexical_cast<std::string>(phimax); }
-      string s_priority() { return boost::lexical_cast<std::string>(priority); }
-   };
-
-   std::vector<priobox_t> m_boxes;
-
-
-   bool overlapsWithSamePriority(const priobox_t& box, priobox_t& overlap) {
-      for(priobox_t b : m_boxes) {
-         if(box.overlaps(b) && box.priority==b.priority) {
-            overlap = b;
-            return true; 
-         }
-      }
-      return false;
-   }
-
-   virtual void execute(const Exc_t& /*exceptions*/) {
-      if ( ! m_ctp ) return;
-      
-      std::string offending("");
-      //std::vector<boost::regex> exc_regex = buildExcRec(exceptions);
-
-      for(const TrigConf::TriggerThreshold* thr :
-              m_ctp->menu().thresholdConfig().getThresholdVector() ) {
-         int cntGlobalValues(0);
-         m_boxes.clear();
-         for( const TrigConf::TriggerThresholdValue* thrVal :  thr->thresholdValueVector() ) {
-            priobox_t b;
-            const TrigConf::JetThresholdValue* jetThrVal = dynamic_cast<const TrigConf::JetThresholdValue*>(thrVal);
-            if(jetThrVal!=0) {
-               b = priobox_t(jetThrVal->etamin(),jetThrVal->etamax(), 
-                             jetThrVal->phimin(), jetThrVal->phimax(),
-                             jetThrVal->priority());
-            } else {
-               const TrigConf::ClusterThresholdValue* clusterThrVal = dynamic_cast<const TrigConf::ClusterThresholdValue*>(thrVal);
-               if(clusterThrVal!=0) {
-                  b = priobox_t(clusterThrVal->etamin(),clusterThrVal->etamax(), 
-                                clusterThrVal->phimin(), clusterThrVal->phimax(),
-                                clusterThrVal->priority());
-               } else {
-                  cntGlobalValues += 1;
-                  continue;
-               }
-            }
-            priobox_t obox;
-            bool overlaps = overlapsWithSamePriority(b,obox);
-            if(overlaps)
-               offending +=  "\n                                  " + severity() + " threshold " + thr->name() 
-                  + " has overlapping values: ("+b.s_etamin()+"-"+b.s_etamax()+","+b.s_phimin()+"-"+b.s_phimax()
-                  + ") has same priority " + b.s_priority()
-                  + " as ("+obox.s_etamin()+"-"+obox.s_etamax()+","+obox.s_phimin()+"-"+obox.s_phimax() +")";
-            
-            m_boxes.push_back(b);
-         }
-      }
-      if ( ! offending.empty() ) {
-         m_error += "Found overlapping threshold values" + offending;
-      }
-   }
-};
-
-
-// Check L1 name < 400 character
-class L1SeedLenghtTest : public TrigConfTest {
-public:
-  L1SeedLenghtTest() 
-    : TrigConfTest("Testing the lenght of the L1 Seed"),
-      m_chains("")
-  {}
-  
-  virtual void execute(const Exc_t&) {
-    if ( ! m_hlt ) return;
-    
-    std::set<std::string> l2Chains;    
-    std::set<std::string> l1items;
-    
-    for(const HLTChain* ch : m_hlt->getHLTChainList()) {      
-      const std::string& lcn = ch->lower_chain_name();
-      if ( lcn == "" ) continue;  // unseeded chains are fine
-      if (lcn.size()> 4000.){     
-	m_chains += ch->chain_name() + ", ";
-      }
-      
-      if(m_chains.size()!=0)
-	m_error = "The following chains have a L1 Item that is too long: " + m_chains;
-      
-    }
-  }
-private:
-  std::string m_chains;
-};
-
-
-
-//////////////////////////////////////// CHECK NO L1CALO ITEM HAS THRESHOLD LOWER THAN IN MINTOBPT ////////////////////////////////////////
-class MinTOBPtCheck : public TrigConfTest {
-public:
-   MinTOBPtCheck()
-      : TrigConfTest("MinimumTOBPtCheck", "Check if all L1Calo items have threshold above MinTOBPt value", WARNING),
-        m_belowMinTOBpt("")
-   {}
-
-
-   virtual void execute(const Exc_t&) {
-     if ( !m_ctp ) return;
-
-     const TrigConf::CaloInfo caloinfo = m_ctp->menu().thresholdConfig().caloInfo();
-
-     unsigned int em_min  = caloinfo.minTobEM().ptmin;
-     unsigned int tau_min  = caloinfo.minTobTau().ptmin;
-     unsigned int Jsmall_min  = caloinfo.minTobJetSmall().ptmin;
-     unsigned int Jlarge_min  = caloinfo.minTobJetLarge().ptmin;
-
-     for(const TrigConf::TriggerThreshold* thr : m_ctp->menu().thresholdConfig().thresholdVector() ) {
-       if(thr->type() == "EM" || thr->type() == "TAU" || thr->type() == "JET"){
-
-         for( const TrigConf::TriggerThresholdValue* thrVal :  thr->thresholdValueVector() ) {
-
-	   if(thr->type() == "EM" && thrVal->ptcut() < em_min) m_belowMinTOBpt += thr->name() + ", ";
-	   if(thr->type() == "TAU" && thrVal->ptcut() < tau_min) m_belowMinTOBpt += thr->name() + ", ";
-
-	   if(thr->type() == "JET"){
-	     const TrigConf::JetThresholdValue* jetThrVal = dynamic_cast<const TrigConf::JetThresholdValue*>(thrVal);
-
-	     if(jetThrVal->windowSizeAsString() == "LARGE" && thrVal->ptcut() < Jlarge_min) m_belowMinTOBpt += thr->name() + ", ";
-	     if(jetThrVal->windowSizeAsString() == "SMALL" && thrVal->ptcut() < Jsmall_min) m_belowMinTOBpt += thr->name() + ", ";
-	   }
-	 }
-       }
-     }
-
-
-      if(m_belowMinTOBpt.size()>0) {
-         m_error = "L1 calo thresholds that are below the MinTOBPt: " + m_belowMinTOBpt;
-      }
-   }
-
-private:
-   std::string m_belowMinTOBpt;
-};
-
-
-
-
-//////////////////////////////////////// CHECK ALL PEB CHAINS GO INTO A CALIBRATION STREAM ////////////////////////////////////////
-class PEBCalibCheck : public TrigConfTest {
-public:
-  PEBCalibCheck()
-    : TrigConfTest("PEBCalibrationStream", "All streams with PEB must be of type calibration or monitoring", WARNING),
-      m_nonCalibPEB("")
-  {}
-
-  virtual void execute(const Exc_t&) {
-    if ( ! m_hlt ) return;
-
-
-    // find all sequences using PEB with the corresponding output TE
-    std::set<std::string> teOutFromSeq;
-
-    for (const TrigConf::HLTSequence* seq : m_hlt->getHLTSequenceList()) {
-      const std::vector<std::string>& algolist = seq->algorithms();
-
-      for( std::string algoname : algolist ){
-
-	if( algoname.find("TrigSubDetListWriter")!= std::string::npos || algoname.find("TrigROBListWriter")!= std::string::npos || algoname.find("ScoutingStreamWriter")!= std::string::npos){
-	  const std::string& tename = seq->outputTE()->name();
-
-          teOutFromSeq.insert( tename);
-
-	  //	  m_nonCalibPEB += algoname + ": " + tename + ", ";
-	}
-      }
-    }
-
-    //loop over chains comparing signature output TEs to PEB TEs
-    for(const HLTChain* ch : m_hlt->getHLTChainList()) {
-      for ( unsigned int s = 0; s < ch->signatureList().size(); s++ ) {
-	HLTSignature* sig = ch->signatureList()[s];
-	for ( unsigned int t = 0; t < sig->outputTEs().size(); ++t ) {
-	  if ( teOutFromSeq.count(sig->outputTEs()[t]->name()) != 0 ){
-
-	    for(const HLTStreamTag *s : ch->streams()) {
-
-	      //	      m_nonCalibPEB += ch->chain_name() + " stream type: " + s->type() + ", ";
-	      if ( s->type() != "calibration" && s->type() != "monitoring" )  m_nonCalibPEB += ch->chain_name() + ", stream: " + s->stream() + ", stream type: " + s->type() + ", ";
-	    }
-	  }
-
-	}
-      }
-    }
-
-    if(m_nonCalibPEB.size()>0) {
-      m_error = "Streams that use PEB but are not of type 'calibration':  " + m_nonCalibPEB;
-    }
-  }
-
-private:
-   std::string m_nonCalibPEB;
-};
-
-
-
-
-
-
-// set of tests
-ConfigurationCheck::ConfigurationCheck(TrigConf::CTPConfig* ctp, TrigConf::HLTFrame* hlt) {
-  m_tests.push_back(new NumberOfCTPItemsTest());
-  m_tests.push_back(new CTPCountersUnique());
-  m_tests.push_back(new ChainsNamingConventionTest());
-  m_tests.push_back(new TENamingConventionTest());
-  m_tests.push_back(new TENameLengthTest());
-  m_tests.push_back(new ChainsNamingUniqueTest());
-  m_tests.push_back(new ChainsCountersUniqueTest());
-  m_tests.push_back(new ChainsCounterRangeTest());
-  m_tests.push_back(new StreamTagPresentTest());
-  m_tests.push_back(new GroupPresentTest());
-  m_tests.push_back(new BWGroupPresentTest());
-  m_tests.push_back(new UniqueSignatureCountTest());
-  m_tests.push_back(new NonEmptySignature());
-  m_tests.push_back(new LowerLevelMatchingTest());
-  m_tests.push_back(new LowerLevelUsedTest(2));
-  m_tests.push_back(new LowerLevelUsedTest(1));
-  m_tests.push_back(new SignaturesProducibleTest());
-  m_tests.push_back(new SequenceOutputUniqueTest());
-  m_tests.push_back(new SequenceInputProducibleTest());
-  m_tests.push_back(new BGRP0Test());
-  m_tests.push_back(new EFTEsFromSeedingL2ChainsTest());
-  //m_tests.push_back(new CrossLevelAlgSeeding());
-  //m_tests.push_back(new FJBJThresholdSymetric());
-  m_tests.push_back(new FJBJThrsholdsUsedInPairs());
-  //m_tests.push_back(new ThrSeqMismatch()); //CB temp commented out (ATR-10063)
-  m_tests.push_back(new CoherentPrescales());
-  m_tests.push_back(new L1CaloThrDef());
-  //m_tests.push_back(new L1CaloThrOrder()); //CB 23.05.2014: disabled for now, need to check with L1Calo about eta items order
-  m_tests.push_back(new OverlappingThrValues());
-
-  m_tests.push_back(new L1SeedLenghtTest());
-  //m_tests.push_back(new SignaturesConnectedTest());
-
-  m_tests.push_back(new MinTOBPtCheck());
-  m_tests.push_back(new PEBCalibCheck());
-
-  std::vector<TrigConfTest*>::iterator testIt;
-  for ( testIt = m_tests.begin(); 
-	testIt != m_tests.end(); ++testIt ) {
-    (*testIt)->setCTP(ctp);
-    (*testIt)->setHLT(hlt);
-  }
-}
-
-// destructor
-ConfigurationCheck::~ConfigurationCheck() {
-
-   for (TrigConfTest* tct : m_tests) {
-     delete tct;
-   }
-   m_tests.clear();
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBoostHelper.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBoostHelper.cxx
deleted file mode 100644
index 524dab43605b..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBoostHelper.cxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <iostream>
-#include "./XMLBoostHelper.h"
-#include <boost/algorithm/string/trim.hpp>
-
-using namespace std;
-using namespace boost::property_tree;
-
-
-ptree
-TrigConf::getAttributes(const boost::property_tree::ptree& pt) {
-   return pt.get_child("<xmlattr>", boost::property_tree::ptree());
-}
-
-bool
-TrigConf::readAttribute(const boost::property_tree::ptree& pt, const char* attrname, int& value) {
-   string path = string("<xmlattr>.") + attrname;
-   try {
-      value = pt.get<int>(path);
-   }
-   catch(const ptree_bad_path&) {
-      return false;
-   }
-   catch(const ptree_bad_data& e) {
-      cerr << "Attribute '" << attrname << "' is not an int value: " << e.data<string>() << endl;
-      throw;
-   }
-   return true;
-}
-
-bool
-TrigConf::readAttribute(const boost::property_tree::ptree& pt, const char* attrname, unsigned int& value) {
-   string path = string("<xmlattr>.") + attrname;
-   try {
-      value = pt.get<unsigned int>(path);
-   }
-   catch(const ptree_bad_path&) {
-      return false;
-   }
-   catch(const ptree_bad_data& e) {
-      cerr << "Attribute '" << attrname << "' is not an int value: " << e.data<string>() << endl;
-      throw;
-   }
-   return true;
-}
-
-bool
-TrigConf::readAttribute(const boost::property_tree::ptree& pt, const char* attrname, float& value) {
-   string path = string("<xmlattr>.") + attrname;
-   try {
-      value = pt.get<float>(path);
-   }
-   catch(const ptree_bad_path&) { 
-      return false;
-   }
-   catch(const ptree_bad_data& e) {
-      cerr << "Attribute '" << attrname << "' is not a float value: " << e.data<string>() << endl;
-      throw;
-   }
-   return true;
-}
-
-bool
-TrigConf::readAttribute(const boost::property_tree::ptree& pt, const char* attrname, std::string& value) {
-   string path = string("<xmlattr>.") + attrname;
-   try {
-      value = pt.get<string>(path);
-   }
-   catch(const ptree_bad_path&) {
-      return false;
-   }
-   catch(const ptree_bad_data& e) {
-      cerr << "Attribute '" << attrname << "' is not an string value: " << e.data<string>() << endl;
-      throw;
-   }
-   return true;
-}
-
-bool
-TrigConf::readAttribute(const boost::property_tree::ptree& pt, const char* attrname, bool& value) {
-   string path = string("<xmlattr>.") + attrname;
-   try {
-      string x = pt.get<string>(path);
-      value = 
-         ( x == "1" ) ||
-         ( x == "t" ) ||
-         ( x == "T" ) ||
-         ( x == "y" ) ||
-         ( x == "Y" ) ||
-         ( x == "true" ) ||
-         ( x == "True" ) ||
-         ( x == "yes" ) ||
-         ( x == "YES" );
-   }
-   catch(const ptree_bad_path&) { return false; }
-
-   return true;
-}
-
-
-bool
-TrigConf::getTextContent(const boost::property_tree::ptree& pt, int& value) {
-   value = pt.get_value<int>();
-   return true;
-}
-
-bool
-TrigConf::getTextContent(const boost::property_tree::ptree& pt, float& value) {
-   value = pt.get_value<float>();
-   return true;
-}
-
-bool
-TrigConf::getTextContent(const boost::property_tree::ptree& pt, std::string& value) {
-   value = boost::algorithm::trim_copy(pt.get_value<string>());
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBoostHelper.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBoostHelper.h
deleted file mode 100644
index 15b3ddd39b56..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBoostHelper.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLBoostHelper
-#define TrigConf_XMLBoostHelper
-
-#include <boost/property_tree/xml_parser.hpp>
-#include <boost/property_tree/ptree.hpp>
-
-#include <string>
-
-namespace TrigConf {
-
-   boost::property_tree::ptree getAttributes(const boost::property_tree::ptree& pt);
-
-   bool readAttribute(const boost::property_tree::ptree& pt, const char* attrname, int& value);
-
-   bool readAttribute(const boost::property_tree::ptree& pt, const char* attrname, unsigned int& value);
-
-   bool readAttribute(const boost::property_tree::ptree& pt, const char* attrname, float& value);
-
-   bool readAttribute(const boost::property_tree::ptree& pt, const char* attrname, std::string& value);
-
-   bool readAttribute(const boost::property_tree::ptree& pt, const char* attrname, bool& value);
-
-   bool getTextContent(const boost::property_tree::ptree& pt, int& value);
-
-   bool getTextContent(const boost::property_tree::ptree& pt, float& value);
-
-   bool getTextContent(const boost::property_tree::ptree& pt, std::string& value);
-}
-
-
-
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupLoader.cxx
deleted file mode 100755
index d54a32d873d9..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupLoader.cxx
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLBunchGroupLoader.h"
-#include "./XMLBoostHelper.h"
-
-#include "TrigConfL1Data/BunchGroupSet.h"
-
-bool
-TrigConf::XMLBunchGroupLoader::load( BunchGroup& bunchgroup ) {
-
-   if ( !is_a("BunchGroup") ) return false;
-
-   bunchgroup.clear();
-
-   int ival(0);
-   std::string strval("");
-
-   if( readAttribute(pt(), "id", ival) )              bunchgroup.setId(ival);
-   if( readAttribute(pt(), "name", strval) )          bunchgroup.setName(strval);
-   if( readAttribute(pt(), "version", ival) )         bunchgroup.setVersion(ival);
-   if( readAttribute(pt(), "internalNumber", ival) )  bunchgroup.setInternalNumber(ival);
-   if( readAttribute(pt(), "menuPartition", ival) )   bunchgroup.setPartition(ival);
-
-   // get bunches
-   for(const ptree::value_type& v : pt())
-      if( readAttribute(v.second, "bunchNumber", ival) ) bunchgroup.addBunch(ival);
-
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupLoader.h
deleted file mode 100644
index 142bf34267c6..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupLoader.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-
-#ifndef TrigConf_XMLBunchGroupLoader
-#define TrigConf_XMLBunchGroupLoader
-
-#include "TrigConfStorage/IBunchGroupLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 bunch group configuration*/
-   class XMLBunchGroupLoader : virtual public IBunchGroupLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param node pointer to the ptree
-       */
-      XMLBunchGroupLoader(XMLStorageMgr& sm, ptree::value_type* pt)
-         : XMLLoader("XMLBunchGroupLoader", sm, pt) {};
-    
-      /**@brief destructor*/
-      virtual ~XMLBunchGroupLoader(){};
-
-      virtual bool load( BunchGroup& data);
-   };
-
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupSetLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupSetLoader.cxx
deleted file mode 100755
index 1b682cb2dc9c..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupSetLoader.cxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLBunchGroupSetLoader.h"
-#include "./XMLBunchGroupLoader.h"
-#include "./XMLBoostHelper.h"
-
-#include "TrigConfL1Data/BunchGroupSet.h"
-
-bool
-TrigConf::XMLBunchGroupSetLoader::load( BunchGroupSet& bunchgroupset ) {
-
-   if ( !is_a("BunchGroupSet") ) { return false; }
-
-   int ival(0);
-   std::string strval("");
-
-   if( readAttribute(pt(), "id", ival) )              bunchgroupset.setId(ival);
-   if( readAttribute(pt(), "name", strval) )          bunchgroupset.setName(strval);
-   if( readAttribute(pt(), "menuPartition", ival) )   bunchgroupset.setMenuPartition(ival);
-   if( readAttribute(pt(), "version", ival) )         bunchgroupset.setVersion(ival);
-
-   XMLBunchGroupLoader* bgldr = new XMLBunchGroupLoader(m_storageMgr, 0);
-   BunchGroup bg;
-   for(value_type v : pt()) {
-      if(v.first=="<xmlattr>") continue;
-      bgldr->setPtree(&v);
-      bgldr->load(bg);
-      bunchgroupset.addBunchGroup(bg); // adds a copy
-   }
-   delete bgldr;
-   return true;
-}
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupSetLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupSetLoader.h
deleted file mode 100644
index 2e1e0b82d5d3..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLBunchGroupSetLoader.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-
-#ifndef TrigConf_XMLBunchGroupSetLoader
-#define TrigConf_XMLBunchGroupSetLoader
-/*
-  XMLBunchGroupSetLoader.h
-*/
-#include "TrigConfStorage/IBunchGroupSetLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 bunch group set configuration*/
-   class XMLBunchGroupSetLoader : public XMLLoader, virtual public IBunchGroupSetLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param node pointer to DOM node
-       */
-      XMLBunchGroupSetLoader(XMLStorageMgr& sm, const ptree::value_type* pt) : 
-         XMLLoader("XMLBunchGroupSetLoader", sm, pt) {};
-
-      /**@brief destructor*/
-      virtual ~XMLBunchGroupSetLoader(){};
-
-      virtual bool load( BunchGroupSet& data);
-   };
-
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigLoader.cxx
deleted file mode 100755
index 971003c60a55..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigLoader.cxx
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-#include "./XMLBoostHelper.h"
-#include "./XMLCTPConfigLoader.h"
-#include "./XMLMenuLoader.h"
-#include "./XMLPrescaleSetLoader.h"
-#include "./XMLBunchGroupSetLoader.h"
-#include "./XMLDeadTimeLoader.h"
-#include "./XMLRandomLoader.h"
-#include "./XMLPrescaledClockLoader.h"
-#include "./XMLPrioritySetLoader.h"
-
-#include "TrigConfL1Data/L1DataDef.h"
-#include "TrigConfL1Data/CTPConfig.h"
-#include "TrigConfL1Data/Menu.h"
-#include "TrigConfL1Data/PrescaleSet.h"
-#include "TrigConfL1Data/BunchGroupSet.h"
-#include "TrigConfL1Data/DeadTime.h"
-#include "TrigConfL1Data/Random.h"
-#include "TrigConfL1Data/PrescaledClock.h"
-#include "TrigConfL1Data/Muctpi.h"
-
-using namespace std;
-
-bool
-TrigConf::XMLCTPConfigLoader::load( CTPConfig& ctpc ) {
-
-   if ( !is_a("LVL1Config") ) return false;
-
-   int ival;
-   string sval;
-   if( readAttribute(pt(), "name", sval) ) ctpc.setName(sval);
-   TRG_MSG_INFO("Loading CTP Configuration" << ctpc.name() );
-
-   if( readAttribute(pt(), "id", ival) )          ctpc.setId(ival);
-   if( readAttribute(pt(), "ctpVersion", ival) )  ctpc.setCTPVersion(ival);
-   if( readAttribute(pt(), "l1Version", ival) )   ctpc.setL1Version(ival);
-   TRG_MSG_INFO("CTP version " << ctpc.ctpVersion());
-   TRG_MSG_INFO("L1  version " << ctpc.l1Version());
-
-   TRG_MSG_INFO("Adapting the threshold limits to L1 version " << ctpc.l1Version());
-   L1DataDef::setMaxThresholdsFromL1Version( ctpc.l1Version() );
-   if(outputLevel()<=MSGTC::DEBUG)
-      L1DataDef::printMaxThresholds();
-
-   m_storageMgr.setCTPVersion(ctpc.ctpVersion());
-   m_storageMgr.setL1Version(ctpc.l1Version());
-
-
-   if (XMLLoader::getEnv() == XMLLoader::ALL    ||
-       XMLLoader::getEnv() == XMLLoader::CTP) {
-      IMenuLoader& menuldr = m_storageMgr.menuLoader();
-      menuldr.setLevel(outputLevel());
-      menuldr.load( ctpc.menu() );
-
-      if(ctpc.l1Version()==0) {
-         ctpc.menu().thresholdConfig().attributeThresholdNumbers();
-      }
-
-
-   } // ENV
-
-   // prescales
-   XMLPrescaleSetLoader& pss_ldr = dynamic_cast<XMLPrescaleSetLoader&>(m_storageMgr.prescaleSetLoader());
-   std::pair < ptree::const_assoc_iterator, ptree::const_assoc_iterator> prescaleSets = pt().equal_range("PrescaleSet");
-   ctpc.clearPrescaleSets();
-   for (ptree::const_assoc_iterator it = prescaleSets.first; it != prescaleSets.second ; ++it) {
-      PrescaleSet ps;
-      pss_ldr.setPtree( &*it );
-      pss_ldr.load(ps);
-      ctpc.setPrescaleSet(ps);
-   }
-
-   BunchGroupSet bgs;
-   IBunchGroupSetLoader& bgsldr = m_storageMgr.bunchGroupSetLoader();
-   bgsldr.setLevel(outputLevel());
-   bgsldr.load(bgs);
-   ctpc.setBunchGroupSet(bgs);
-
-   DeadTime dt;
-   m_storageMgr.deadTimeLoader().load(dt);
-   ctpc.setDeadTime(dt);
-
-   Random r;
-   m_storageMgr.randomLoader().load(r);
-   ctpc.setRandom(r);
-
-   PrescaledClock psc;
-   m_storageMgr.prescaledClockLoader().load(psc);
-   ctpc.setPrescaledClock(psc);
-
-   if (XMLLoader::getEnv() == XMLLoader::ALL    ||
-       XMLLoader::getEnv() == XMLLoader::CTPOnl) {
-      PrioritySet priority_set;
-      bool load_success = m_storageMgr.prioritySetLoader().load(priority_set);
-      if(load_success) {
-         ctpc.setPrioritySet(priority_set);
-         for(unsigned int ctpid=0; ctpid<priority_set.priorities().size(); ctpid++) {
-            TriggerItem *item = ctpc.menu().item(ctpid);
-            if(item!=0) {
-               string oldprio = priority_set.priorities()[ctpid];
-               if(oldprio=="HIGH") {
-                  item->setComplexDeadtime(0);
-               } else {
-                  item->setComplexDeadtime(1);
-               }
-            }
-         }
-      }
-
-   } // ENV
-
-   return true;
-
-}
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigLoader.h
deleted file mode 100644
index 0045a1272ef5..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigLoader.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLCTPConfigLoader
-#define TrigConf_XMLCTPConfigLoader
-
-#include "TrigConfStorage/ICTPConfigLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   class XMLCTPConfigLoader : virtual public ICTPConfigLoader, public XMLLoader {
-   public:
-
-      XMLCTPConfigLoader(XMLStorageMgr& sm, const ptree::value_type* pt) :
-         XMLLoader("XMLCTPConfigLoader", sm, pt) {};
-
-      /**@brief destructor*/
-      virtual ~XMLCTPConfigLoader(){};
-
-      virtual bool load( CTPConfig& data);
-   };
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigOnlineLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigOnlineLoader.cxx
deleted file mode 100755
index adb79f2af94a..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigOnlineLoader.cxx
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLCTPConfigOnlineLoader.h"
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigOnlineLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigOnlineLoader.h
deleted file mode 100644
index 0675fa7bc5ca..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPConfigOnlineLoader.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLCTPConfigOnlineLoader
-#define TrigConf_XMLCTPConfigOnlineLoader
-
-#include "./XMLCTPConfigLoader.h"
-
-namespace TrigConf {
-
-  typedef XMLCTPConfigLoader XMLCTPConfigOnlineLoader;
-
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPFilesLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPFilesLoader.cxx
deleted file mode 100644
index ecac0c6c8d7d..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPFilesLoader.cxx
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLCTPFilesLoader.h"
-#include "TrigConfL1Data/CTPFiles.h"
-#include <fstream>
-#include <iostream>
-
-#include <typeinfo>
-#include <cstring>
-
-bool TrigConf::XMLCTPFilesLoader::load(CTPFiles& ctpFiles) {
-   char line[1024];
-   std::vector<u_int> ctpcoreLUT(CTPFiles::ALL_CTPCORELUT_SIZE);
-   std::vector<u_int> ctpcoreCAM(CTPFiles::ALL_CTPCORECAM_SIZE);
-   int n=0;
-      
-   std::ifstream in(m_ctpcoreCAMFile.c_str());
-   while (!in.eof() && in.getline(line, 1024)) {
-      if (std::strlen(line)>0) line[std::strlen(line)-1] = '\0';
-      if (std::strlen(line)==0) continue;
-      sscanf(line, "0x%x", &ctpcoreCAM[n]);
-   }
-   msg() << "N ctpcoreCAM = " << n << std::endl;
-   in.close();
-   ctpFiles.setCtpcoreCAM(ctpcoreCAM);
-      
-   in.open(m_ctpcoreLUTFile.c_str());
-   while (!in.eof() && in.getline(line, 1024)) {
-      if (std::strlen(line)>0) line[std::strlen(line)-1] = '\0';
-      if (std::strlen(line)==0) continue;
-      sscanf(line, "0x%x", &ctpcoreLUT[n]);
-   }
-   msg() << "N ctpcoreLUT = " << n << std::endl;
-   in.close();
-   ctpFiles.setCtpcoreLUT(ctpcoreLUT);
-    
-      
-   return true;
-} 
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPFilesLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPFilesLoader.h
deleted file mode 100644
index 5dedfc44c412..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCTPFilesLoader.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLCTPFilesLoader
-#define TrigConf_XMLCTPFilesLoader
-/*
-  XMLCTPFilesLoader.h
-*/
-#include "TrigConfStorage/ICTPFilesLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-#include <string>
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 LUT and CAM tables*/
-   class XMLCTPFilesLoader : virtual public ICTPFilesLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param lut reference to string representation of the LUT table
-       * @param cam reference to string representation of the CAM table
-       */
-      XMLCTPFilesLoader(XMLStorageMgr& sm, const std::string& ctpcoreLUT,
-                        const std::string& ctpcoreCAM)
-         : ILoader(),
-           XMLLoader("XMLCTPFilesLoader", sm,0), 
-           m_ctpcoreLUTFile(ctpcoreLUT),
-           m_ctpcoreCAMFile(ctpcoreCAM)
-      {};
-
-      /**@brief destructor*/
-      virtual ~XMLCTPFilesLoader() {}
-
-      virtual bool load( CTPFiles& data);
-    
-      std::string m_ctpcoreLUTFile;
-      std::string m_ctpcoreCAMFile;
-
-   };
-
-}
-
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloInfoLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloInfoLoader.cxx
deleted file mode 100755
index ffd278abd575..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloInfoLoader.cxx
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLCaloInfoLoader.h"
-#include "./XMLCaloSinCosLoader.h"
-#include "./XMLBoostHelper.h"
-#include "TrigConfL1Data/CaloInfo.h"
-#include "TrigConfL1Data/CaloSinCos.h"
-
-#include <map>
-#include <sstream>
-#include <vector>
-#include <iostream>
-#include <typeinfo>
-
-using namespace std;
-
-bool
-TrigConf::XMLCaloInfoLoader::load(CaloInfo& caloinfo) {
-
-   if( !is_a("CaloInfo") ) return false;
-
-   caloinfo.clear();
-
-   int ival=0;
-   float fval=0;
-   string strval="";
-
-   if(  readAttribute(pt(), "name", strval) )           caloinfo.setName(strval);
-   if(  readAttribute(pt(), "version", ival) )          caloinfo.setVersion(ival);
-   if(  readAttribute(pt(), "global_scale", fval) )     caloinfo.setGlobalScale(fval);
-   if(  readAttribute(pt(), "global_em_scale", fval) )  caloinfo.setGlobalEmScale(fval);
-   if(  readAttribute(pt(), "global_jet_scale", fval) ) caloinfo.setGlobalJetScale(fval);
-
-
-   // jet weights
-   vector<int> vals(12, 0);
-   for(value_type v : pt()) {
-
-      if(v.first!="JetWeight") continue;
-
-      int num;
-      if( !readAttribute(v.second, "num", num) ) continue;
-
-      if ( num < 1 || num > 12) {
-         TRG_MSG_WARNING("JetWeight's attribute num must be between 1 and 12, but tried to add " << num << ". ==> Ignore");
-         continue;
-      }
-
-      // in the new style the weight is an attribute, in the old it is text
-      if( !readAttribute(v.second, "weight", ival) ) {
-         getTextContent(v.second,ival);
-      }
-      
-      if (vals[num-1] != 0) {
-         TRG_MSG_WARNING( "JetWeight " << num << " was already set to "
-                          << vals[num-1] << " and now trying to set it to " 
-                          << ival << ". ==> Keep the old value");
-         continue;
-      }
-      vals[num-1] = ival;
-   }
-
-   for(int w : vals)
-      caloinfo.addJetWeight(w);
-
-   // read the parameters for Minimum TOB PT
-   for(value_type v : pt()) {
-
-      if(v.first != "MinimumTOBPt") continue;
-
-      string thrtype;
-      MinTOBPt mintob;
-
-      readAttribute(v.second, "thrtype",  thrtype);
-      readAttribute(v.second, "ptmin",  mintob.ptmin);
-
-      if(thrtype=="EM") {
-         caloinfo.setMinTobEM(mintob);
-      } else if(thrtype=="TAU") {
-         caloinfo.setMinTobTau(mintob);
-      } else {
-         unsigned int windowsize;
-         readAttribute(v.second, "window", windowsize);
-         if(thrtype=="JETS") {
-            caloinfo.setMinTobJetSmall(mintob);
-            caloinfo.setJetWindowSizeSmall(windowsize);
-         } else {
-            caloinfo.setMinTobJetLarge(mintob);            
-            caloinfo.setJetWindowSizeLarge(windowsize);
-         }
-      }
-   }
-
-
-
-   // read the parameters for MET signifance
-   ptree::const_assoc_iterator metsig = pt().find("METSignificance");
-   if( metsig != pt().not_found() ) {
-      int xsSigmaScale(0), xsSigmaOffset(0), xeMin(0), xeMax(0), teSqrtMin(0), teSqrtMax(0);
-      readAttribute(metsig->second, "xsSigmaScale",  xsSigmaScale);
-      readAttribute(metsig->second, "xsSigmaOffset", xsSigmaOffset);
-      readAttribute(metsig->second, "xeMin",         xeMin);
-      readAttribute(metsig->second, "xeMax",         xeMax);
-      readAttribute(metsig->second, "teSqrtMin",     teSqrtMin);
-      readAttribute(metsig->second, "teSqrtMax",     teSqrtMax);
-      caloinfo.metSigParam().setValues(xsSigmaScale, xsSigmaOffset, xeMin, xeMax, teSqrtMin, teSqrtMax);
-   }
-
-
-   std::string isothrtype(""); 
-
-   for (value_type v: pt()) {
-
-      if ( v.first != "Isolation" ) continue;
-
-      //Give thrtype the actual value, v.second.
-      readAttribute(v.second, "thrtype", isothrtype );
-       
-      // Loop over all children. This actually retrieves "<xmlattr>" and "Parametrization".
-      for(value_type top: v.second) {
-         
-         if (top.first != "Parametrization") continue;
-         
-         IsolationParam param;
-  
-         // assign values to the actual parameters
-         param.setThrType(isothrtype);
-         readAttribute(top.second, "isobit"    , ival ); param.setIsobit(ival);
-         readAttribute(top.second, "offset"    , ival ); param.setOffset(ival); 
-         readAttribute(top.second, "slope"     , ival ); param.setSlope(ival);
-         readAttribute(top.second, "mincut"    , ival ); param.setMincut(ival);
-         readAttribute(top.second, "upperlimit", ival ); param.setUpperlimit(ival);
-         readAttribute(top.second, "etamin"    , ival ); param.setEtamin(ival);
-         readAttribute(top.second, "etamax"    , ival ); param.setEtamax(ival);
-         readAttribute(top.second, "priority"  , ival ); param.setPriority(ival);
-         param.setIsDefined();
-         caloinfo.setIsolation(isothrtype, param.isobit(), param);
-
-      }
-                
-   }
-   //caloinfo.print();
-
-
-   // read the CaloSinCos parameters
-   ptree::const_assoc_iterator sincos = pt().find("CaloSinCos");
-   if(sincos != pt().not_found()) {
-      CaloSinCos csc;
-      XMLCaloSinCosLoader cscldr(m_storageMgr, 0);
-      for(value_type v : sincos->second) {
-         if(v.first=="<xmlattr>") continue;
-         cscldr.setPtree(&v);
-         cscldr.load(csc);
-         caloinfo.addCaloSinCos(csc);
-      }
-   }
-
-   return true;  
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloInfoLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloInfoLoader.h
deleted file mode 100644
index cc65ba0386fc..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloInfoLoader.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-
-
-#ifndef TrigConf_XMLCaloInfoLoader
-#define TrigConf_XMLCaloInfoLoader 
-
-#include "TrigConfStorage/ICaloInfoLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 calorimeter trigger configuration*/
-   class XMLCaloInfoLoader : virtual public ICaloInfoLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param node pointer to DOM node
-       */
-      XMLCaloInfoLoader(XMLStorageMgr& sm, const ptree::value_type* pt)
-         : ICaloInfoLoader(), XMLLoader("XMLCaloInfoLoader", sm, pt) {};
-
-      /**@brief destructor*/
-      virtual ~XMLCaloInfoLoader(){};
-
-      virtual bool load( CaloInfo& data);
-   };
-}
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloSinCosLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloSinCosLoader.cxx
deleted file mode 100755
index 4ea67e39081e..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloSinCosLoader.cxx
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLCaloSinCosLoader.h"
-#include "TrigConfL1Data/CaloSinCos.h"
-
-bool
-TrigConf::XMLCaloSinCosLoader::load(CaloSinCos&) {
-
-   // not used any longer - Joerg
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloSinCosLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloSinCosLoader.h
deleted file mode 100644
index 8346c9bc487f..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLCaloSinCosLoader.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLCaloSinCosLoader
-#define TrigConf_XMLCaloSinCosLoader 
-
-#include "TrigConfStorage/ICaloSinCosLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 calorimeter sin and cos
-      configuration*/
-   class XMLCaloSinCosLoader : virtual public ICaloSinCosLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param node pointer to DOM node
-       */
-      XMLCaloSinCosLoader(XMLStorageMgr& sm, value_type* pt = 0) :
-         ICaloSinCosLoader(), XMLLoader("XMLCaloSinCosLoader", sm, pt) {};
-
-      /**@brief destructor*/
-      virtual ~XMLCaloSinCosLoader(){};
-
-      virtual bool load( CaloSinCos& data);
-   };
-}
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLDeadTimeLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLDeadTimeLoader.cxx
deleted file mode 100755
index 222c91ed40c5..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLDeadTimeLoader.cxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLDeadTimeLoader.h"
-#include "./XMLBoostHelper.h"
-
-#include "TrigConfL1Data/DeadTime.h"
-
-bool
-TrigConf::XMLDeadTimeLoader::load(DeadTime& deadtime) {
-
-   if( key() == "" ) // no Deadtime element in XML file (removed in Run2)
-      return true;
-
-   if ( !is_a("Deadtime") ) { 
-      return false;
-   }
-
-   int ival(0);
-   std::string strval("");
-
-   if( readAttribute(pt(), "id", ival) )              deadtime.setId(ival);
-   if( readAttribute(pt(), "name", strval) )          deadtime.setName(strval);
-   if( readAttribute(pt(), "version", ival) )         deadtime.setVersion(ival);
-   if( readAttribute(pt(), "simple", ival) )          deadtime.setSimple(ival);
-   if( readAttribute(pt(), "complex1_level", ival) )  deadtime.setComplex1Level(ival);
-   if( readAttribute(pt(), "complex1_rate",  ival) )  deadtime.setComplex1Rate(ival);
-   if( readAttribute(pt(), "complex2_level", ival) )  deadtime.setComplex2Level(ival);
-   if( readAttribute(pt(), "complex2_rate",  ival) )  deadtime.setComplex2Rate(ival);
-
-   return true;
-}
-
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLDeadTimeLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLDeadTimeLoader.h
deleted file mode 100644
index d5ef2759767e..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLDeadTimeLoader.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLDeadTimeLoader
-#define TrigConf_XMLDeadTimeLoader
-
-#include "TrigConfStorage/IDeadTimeLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   class XMLDeadTimeLoader : virtual public IDeadTimeLoader, public XMLLoader {
-   public:
-
-      XMLDeadTimeLoader(XMLStorageMgr& sm, const ptree::value_type* pt) : 
-         XMLLoader("XMLDeadTimeLoader", sm, pt) {};
-
-      virtual ~XMLDeadTimeLoader(){};
-
-      virtual bool load( DeadTime& data);
-   };
-
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLHLTFrameLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLHLTFrameLoader.cxx
deleted file mode 100755
index 2b58dfbb9822..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLHLTFrameLoader.cxx
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLBoostHelper.h"
-#include "./XMLHLTFrameLoader.h"
-
-#include "TrigConfHLTData/HLTSequence.h"
-#include "TrigConfHLTData/HLTSignature.h"
-#include "TrigConfHLTData/HLTTriggerElement.h"
-#include "TrigConfHLTData/HLTTriggerType.h"
-#include "TrigConfHLTData/HLTStreamTag.h"
-#include "TrigConfHLTData/HLTFrame.h"
-#include "TrigConfHLTData/HLTChain.h"
-#include "TrigConfHLTData/HLTChainList.h"
-#include "TrigConfHLTData/HLTSequenceList.h"
-#include "TrigConfHLTData/HLTUtils.h"
-#include "TrigConfHLTData/HLTPrescaleSet.h"
-#include "TrigConfHLTData/HLTPrescale.h"
-
-#include "boost/algorithm/string.hpp"
-#include "boost/algorithm/string/replace.hpp"
-
-#include <sstream>
-#include <iostream>
-
-using namespace std;
-
-bool
-TrigConf::XMLHLTFrameLoader::load( HLTFrame& frame ) {
-
-   if ( !is_a("HLT_MENU") ) return false;
-
-   TRG_MSG_INFO("Start loading the HLT menu in mode " << (frame.mergedHLT() ? "MERGED" : "UNMERGED")  );
-
-   frame.clear();
-
-   frame.setName(m_data->second.get<string>("<xmlattr>.menu_name",""));
-   
-   buildHLTSequenceList( frame );
-   
-   buildHLTChainList( frame );
-   
-   // fill prescale set from the HLT chains
-   std::string strval("");
-   HLTPrescaleSet* pss = frame.thePrescaleSetCollection().setPrescaleSet( new HLTPrescaleSet() );
-   if( readAttribute(m_data->second, "prescale_set_name", strval) ) pss->setName(strval);
-   
-   for(const HLTChain* ch : frame.getHLTChainList())
-      pss->setPrescale( ch->prescales(), ch->chain_counter(), str2lvl(ch->level()) );
-
-   return true;
-}
-
-
-void
-TrigConf::XMLHLTFrameLoader::buildHLTChainList( HLTFrame& frame ) {
-
-   int ival(0);
-   float fval(0);
-   bool bval(false);
-   std::string strval("");
-
-
-   ptree sl = m_data->second.get_child("CHAIN_LIST",ptree());
-   pair<ptree::const_assoc_iterator, ptree::const_assoc_iterator> r = sl.equal_range("CHAIN");
-   for(ptree::const_assoc_iterator i = r.first; i != r.second; ++i) {
-
-      HLTChain* aChain = new HLTChain();
-      HLTPrescale& ps = aChain->prescales();
-
-      if( readAttribute(i->second, "chain_name", strval) )               aChain->set_chain_name( strval );
-      if( readAttribute(i->second, "chain_counter", ival) )              aChain->set_chain_counter( ival );
-      if( readAttribute(i->second, "lower_chain_name", strval) )         aChain->set_lower_chain_name( strval );
-      if( readAttribute(i->second, "level", strval) )                    aChain->set_level( strval );
-      if( readAttribute(i->second, "prescale", fval) )                   aChain->set_prescale( fval );
-      if( readAttribute(i->second, "pass_through", fval) )               aChain->set_pass_through( fval );
-      if( readAttribute(i->second, "rerun_prescale", fval))              ps.setRerunPrescale("1",fval);
-      if( readAttribute(i->second, "EBstep", ival) )                     aChain->set_EB_after_step( ival );
-
-
-      ptree prescales = i->second.get_child("PRESCALES", ptree());
-      // information in <PRESCALES> overwrites the chain attributes
-      if( readAttribute(prescales, "prescale", fval) )                   aChain->set_prescale( fval );
-      if( readAttribute(prescales, "pass_through", fval) )               aChain->set_pass_through( fval );
-      // -------- find the signatures/TriggerTypes/StreamingTags etc  in the chain -------------------------------
-      for(const ptree::value_type& v : prescales ) {
-         if( readAttribute(v.second, "target", strval) &&
-             readAttribute(v.second, "prescale", fval) )
-            ps.setRerunPrescale( strval, fval );
-      }
-
-      for(const ptree::value_type& v : i->second.get_child("TRIGGERTYPE_LIST") ) {
-         HLTTriggerType* aTT = new HLTTriggerType();
-         if( readAttribute(v.second, "bit", ival) ) aTT->set_bit( ival );
-         aChain->triggerTypeList().push_back( aTT );
-      }
-
-      for(const ptree::value_type& v : i->second.get_child("STREAMTAG_LIST") ) {
-         HLTStreamTag* aST = new HLTStreamTag();
-         if( readAttribute(v.second, "stream", strval) ) aST->set_stream( strval );
-         if( readAttribute(v.second, "type", strval) )   aST->set_type( strval );
-         if( readAttribute(v.second, "obeyLB", bval) ) aST->set_obeyLB( bval );
-         if( readAttribute(v.second, "prescale", fval) ) aST->set_prescale( fval );
-         aChain->addStream(aST);
-      }
-
-      for(const ptree::value_type& v : i->second.get_child("GROUP_LIST") ) {
-         if( readAttribute(v.second, "name", strval) ) aChain->addGroup( strval );
-      }
-
-      for(const ptree::value_type& v : i->second.get_child("SIGNATURE_LIST") ) {
-         HLTSignature* aSig = new HLTSignature();
-         if( readAttribute(v.second, "signature_counter", ival) ) aSig->set_signature_counter( ival );
-         if( readAttribute(v.second, "logic", ival) )             aSig->set_logic( ival );
-         for(const ptree::value_type& vte : v.second ) {
-            if( readAttribute(vte.second, "te_name", strval) )
-               aSig->outputTEs().push_back( new HLTTriggerElement( stringToId( strval ), strval ) );
-         }
-         aChain->signatureList().push_back( aSig );
-      }
-
-      aChain->createSignatureLabels();
-
-      // add to target's list
-      frame.theHLTChainList().addHLTChain( aChain );
-   }
-
-   // assert that we don't have a mixed menu
-   bool foundL2EFChain(false);
-   bool foundHLTChain(false);
-   for( const TrigConf::HLTChain* chain : frame.getHLTChainList() ) {
-      if(chain->level_enum() == TrigConf::HLT) {
-         foundHLTChain = true;
-      } else {
-         foundL2EFChain = true;
-      }
-   }
-   bool foundMixedMenu = foundL2EFChain && foundHLTChain;
-   if(foundMixedMenu) {
-      TRG_MSG_FATAL("Found mixed (L2/EF and HLT) menu, which I can't deal with");
-      return;
-   }
-
-   // merge chainlist if needed
-   if( frame.mergedHLT() ) {
-      bool needMerging(false);
-      for( const TrigConf::HLTChain* chain : frame.getHLTChainList() ) {
-         if(chain->level_enum() != TrigConf::HLT)
-            needMerging = true;
-      }
-
-      if(needMerging) {
-         TRG_MSG_DEBUG("Call merging of " << frame.getHLTChainList().size() << " L2 and EF chains");
-         HLTTEUtils::mergeHLTChainList2(frame);
-      }
-   }
-
-   TRG_MSG_INFO("Loaded " << frame.getHLTChainList().size() << " chains");
-
-   //   std::cout<<"FPP: XMLHLTFrameLoader::load HLTFrame.mergedHLT() is " << nfTarget.mergedHLT() <<" and chainlist size is "<< nfTarget.getHLTChainList().chains() <<std::endl;
-
-}
-
-
-void
-TrigConf::XMLHLTFrameLoader::buildHLTSequenceList( HLTFrame& frame ) {
-
-   ptree sl = m_data->second.get_child("SEQUENCE_LIST",ptree());
-   pair<ptree::const_assoc_iterator, ptree::const_assoc_iterator> r = sl.equal_range("SEQUENCE");
-   for(ptree::const_assoc_iterator i = r.first; i != r.second; ++i) {
-
-      HLTSequence* aSeq = new HLTSequence();
-
-      string inputTE = i->second.get<string>("<xmlattr>.input");
-      std::vector<string> iTEs;
-      boost::split(iTEs, inputTE, boost::is_any_of(" "));
-      std::vector<HLTTriggerElement*> inputTEs;
-      for(const string& te : iTEs)
-         if(te!="")
-            inputTEs.push_back( new HLTTriggerElement( stringToId( te ), te ) );
-      aSeq->set_inputTEs( inputTEs );
-      
-      string algo = i->second.get<string>("<xmlattr>.algorithm");
-      boost::split(aSeq->algorithms(), algo, boost::is_any_of(" "));
-
-      string outputTE = i->second.get<string>("<xmlattr>.output");
-      aSeq->set_outputTE( new HLTTriggerElement( stringToId( outputTE ), outputTE ) );
-
-
-      string topoStart = i->second.get<string>("<xmlattr>.topo_start_from","");
-      if( topoStart != "") {
-         HLTTriggerElement* topoStartTE = new HLTTriggerElement( stringToId(topoStart), topoStart );
-         aSeq->set_topoStartTE( topoStartTE );
-      }
-
-      frame.theHLTSequenceList().addHLTSequence( aSeq );
-   }
-
-   TRG_MSG_INFO("Loaded " << frame.getHLTSequenceList().size() << " sequences");
-
-}
-
-int TrigConf::XMLHLTFrameLoader::stringToId( const string& theTE ) {
-   // create unique string for TE
-
-   // search if TE already in list (don't fill TE twice !)
-   for (const auto& p : m_idstrTable) {
-      if (theTE == p.second) return p.first;
-   }
-
-   // not found: attribute identifier and add to list
-   int id = -1;
-
-   // this convention is inherited from old TrigConfig package (Frame.cxx)
-   if      (theTE == "EMROI"  ) id = 0;
-   else if (theTE == "MUONROI") id = 1;
-   else if (theTE == "JETROI" ) id = 2;
-   else if (theTE == "TAUROI" ) id = 3;
-   else                         id = m_idstrTable.size() + 10;
-
-   m_idstrTable.push_back( std::pair<int,string>( id, theTE ) );
-
-   return id;
-}
-
-string TrigConf::XMLHLTFrameLoader::stringFromId( int theID ) {
-   // create unique string for TE
-
-   // search if TE already in list (don't fill TE twice !)
-   for (const auto& p : m_idstrTable) {
-      if (theID == p.first) return p.second;
-   }
-
-   return "";
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLHLTFrameLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLHLTFrameLoader.h
deleted file mode 100644
index 0bc6e50d7dc8..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLHLTFrameLoader.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLHLTFrameLoader
-#define TrigConf_XMLHLTFrameLoader
-
-#include "TrigConfStorage/IHLTFrameLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-#include <string>
-#include <vector>
-
-namespace TrigConf {
-   class XMLStorageMgr;
-   class HLTFrame;
-
-   /**@brief TriggerDB loader of the HLT menu*/
-   class XMLHLTFrameLoader : virtual public IHLTFrameLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param hltDoc pointer to DOM document containing the hlt menu
-       */
-      XMLHLTFrameLoader( XMLStorageMgr& sm, const ptree::value_type* pt ) :
-         XMLLoader("XMLHLTFrameLoader", sm, pt)
-      {};
-
-      /**@brief destructor*/
-      virtual ~XMLHLTFrameLoader( void ) {};
-
-      virtual bool load( HLTFrame& frame);
-
-   private:
-      /**unique identifier for trigger element*/
-      int         stringToId  ( const std::string& );
-      std::string stringFromId( int );
-
-      void buildHLTChainList   ( HLTFrame& );
-      void buildHLTSequenceList( HLTFrame& );
-
-      // unique identifier for trigger element
-      // this is unnecessary for DB configuration, where each TE has a DB id
-      std::vector<std::pair<int,std::string> > m_idstrTable;
-
-   };
-}
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLJobOptionTableLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLJobOptionTableLoader.cxx
deleted file mode 100755
index 34c5dd47d40a..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLJobOptionTableLoader.cxx
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLJobOptionTableLoader.h"
-
-bool TrigConf::XMLJobOptionTableLoader::load(JobOptionTable&) {
-  return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLJobOptionTableLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLJobOptionTableLoader.h
deleted file mode 100644
index bd1f3c0f9247..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLJobOptionTableLoader.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLJobOptionTableLoader
-#define TrigConf_XMLJobOptionTableLoader
-
-#include "TrigConfStorage/IJobOptionTableLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the HLT job options*/
-   class XMLJobOptionTableLoader : virtual public IJobOptionTableLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param node pointer to DOM node
-       */
-      XMLJobOptionTableLoader(XMLStorageMgr& sm, const ptree::value_type* pt) :
-         IJobOptionTableLoader(), XMLLoader("XMLJobOptionTableLoader", sm, pt) {};
-
-      /**@brief destructor*/
-      virtual ~XMLJobOptionTableLoader(){};
-
-      bool load( JobOptionTable& jot );
-   };
-
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLL1TopoMenuLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLL1TopoMenuLoader.cxx
deleted file mode 100644
index a111d20b0708..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLL1TopoMenuLoader.cxx
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLL1TopoMenuLoader.h"
-#include "L1TopoConfig/L1TopoXMLParser.h"
-
-#include <utility>
-
-using namespace std;
-using namespace TrigConf;
-
-bool
-XMLL1TopoMenuLoader::load( TXC::L1TopoMenu& menu ) {
-   
-   if ( !is_a("TOPO_MENU") ) return false;
-
-   try {
-      TXC::L1TopoXMLParser parser;
-      
-      parser.setConfiguration(pt());
-
-      parser.parseConfiguration();
-
-      menu = parser.takeMenu();
-
-      
-   }
-   catch(std::exception & e) {
-      TRG_MSG_ERROR("Caught exception from the topo menu parser, no topo menu will be available! Exception message: " << e.what());
-   }
-
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLL1TopoMenuLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLL1TopoMenuLoader.h
deleted file mode 100644
index 0128fd3be1c3..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLL1TopoMenuLoader.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLL1TopoMenuLoader
-#define TrigConf_XMLL1TopoMenuLoader
-
-#include "TrigConfStorage/IL1TopoMenuLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-   class XMLL1TopoMenuLoader : virtual public IL1TopoMenuLoader, public XMLLoader {
-   public:
-      XMLL1TopoMenuLoader( XMLStorageMgr& sm, const ptree::value_type* pt ) :
-         XMLLoader("XMLL1TopoMenuLoader", sm, pt)
-      {};
-
-      virtual ~XMLL1TopoMenuLoader() {};
-
-      virtual bool load( TXC::L1TopoMenu& menu );
-
-   };
-}
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLLoader.cxx
deleted file mode 100755
index 48fc10fa9be9..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLLoader.cxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TrigConfStorage/XMLLoader.h"
-
-using namespace std;
-using namespace TrigConf;
-
-XMLLoader::ENV
-XMLLoader::m_env = XMLLoader::ALL;
-
-XMLLoader::XMLLoader( const std::string& name, 
-                      XMLStorageMgr& sm, 
-                      const ptree::value_type* data ) : 
-   TrigConfMessaging( name ),
-   m_storageMgr( sm ),
-   m_data( data )
-{
-   setLevel( sm.msg().level() );
-}
-
-
-XMLLoader::XMLLoader( XMLStorageMgr& sm,
-                      const ptree::value_type* data ) : 
-   XMLLoader("XMLLoader", sm, data)
-{}
-
-
-void
-XMLLoader::setLevel(MSGTC::Level lvl) {
-   msg().setLevel(lvl);
-
-   switch(lvl) {
-   case MSGTC::ALWAYS: m_verbose = 5; break;
-   case MSGTC::VERBOSE: m_verbose = 4; break;
-   case MSGTC::DEBUG: m_verbose = 3; break;
-   case MSGTC::INFO: m_verbose = 2; break;
-   case MSGTC::WARNING:
-   case MSGTC::ERROR:
-   case MSGTC::FATAL: m_verbose = 0; break;
-   default: m_verbose = 0;
-   }
-}
-
-bool
-XMLLoader::is_a(const string& elementtag) const {
-   if(m_data == 0) {
-      TRG_MSG_ERROR("Can't load, ptree is NULL");
-      return false;
-   }
-   if( m_data->first != elementtag ) {
-      TRG_MSG_ERROR("Can't load, ptree is not a '" << elementtag <<"', but a '" << m_data->first << "'.");
-      return false;
-   }
-   return true;
-}
-
-
-const boost::property_tree::ptree & 
-XMLLoader::pt() const {
-   if(m_data==0) {
-      static ptree pt;
-      return pt;
-   }
-   return m_data->second;
-}
-
-const string & 
-XMLLoader::key() const {
-   if(m_data==0) {
-      static string k("");
-      return k;
-   }
-   return m_data->first;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLLutCamLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLLutCamLoader.cxx
deleted file mode 100755
index 3e538e165d8a..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLLutCamLoader.cxx
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLLutCamLoader.h"
-#include <fstream>
-#include <iostream>
-
-#include <typeinfo>
-#include <cstring>
-
-bool TrigConf::XMLLutCamLoader::load(LutCam& lutcam) {
-
-   char line[1024];
-   u_int lut[LutCam::ALL_LUT_SIZE];
-   u_int cam[LutCam::ALL_CAM_SIZE];
-   int n;
-      
-   std::ifstream in(m_camFile.c_str());
-   n = 0;
-   while (!in.eof() && in.getline(line, 1024)) {
-      if (std::strlen(line)>0) line[std::strlen(line)-1] = '\0';
-      if (std::strlen(line)==0) continue;
-      sscanf(line, "0x%x", &cam[n]);
-      n ++;
-   }
-   msg() << "N cam = " << n << std::endl;
-   in.close();
-   lutcam.setCam(cam, n);
-      
-   in.open(m_lutFile.c_str());
-   n = 0;
-   while (!in.eof() && in.getline(line, 1024)) {
-      if (std::strlen(line)>0) line[std::strlen(line)-1] = '\0';
-      if (std::strlen(line)==0) continue;
-      sscanf(line, "0x%x", &lut[n]);
-      n ++;
-   }
-   msg() << "N lut = " << n << std::endl;
-   in.close();
-   lutcam.setLut(lut, n);
-      
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLLutCamLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLLutCamLoader.h
deleted file mode 100644
index b2b44f9b9db8..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLLutCamLoader.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLLutCamLoader
-#define TrigConf_XMLLutCamLoader
-
-#include "TrigConfStorage/ILutCamLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-#include <string>
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 LUT and CAM tables*/
-   class XMLLutCamLoader : virtual public ILutCamLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param lut reference to string representation of the LUT table
-       * @param cam reference to string representation of the CAM table
-       */
-      XMLLutCamLoader(XMLStorageMgr& sm, const std::string& lut,
-                      const std::string& cam) : 
-         ILutCamLoader(),
-         XMLLoader("XMLLutCamLoader", sm, 0),
-         m_lutFile(lut),
-         m_camFile(cam)
-      {};
-     
-      /**@brief destructor*/
-      virtual ~XMLLutCamLoader() {}
-
-      virtual bool load( LutCam& data);
-    
-      std::string m_lutFile;
-      std::string m_camFile;
-
-   };
-
-}
-
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMasterTableLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMasterTableLoader.cxx
deleted file mode 100755
index f9d12d05b38d..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMasterTableLoader.cxx
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include <typeinfo>
-
-#include "./XMLMasterTableLoader.h"
-#include "./XMLBoostHelper.h"
-
-#include "TrigConfStorage/IThresholdConfigLoader.h"
-#include "TrigConfStorage/ICTPConfigLoader.h"
-#include "TrigConfStorage/IMuctpiLoader.h"
-
-#include "TrigConfL1Data/ThresholdConfig.h"
-#include "TrigConfL1Data/CTPConfig.h"
-#include "TrigConfL1Data/Muctpi.h"
-#include "L1TopoConfig/L1TopoMenu.h"
-
-using namespace std;
-
-bool TrigConf::XMLMasterTableLoader::load(ThresholdConfig& thrcfg) {
-
-   IThresholdConfigLoader& thrLoader = m_storageMgr.thresholdConfigLoader();
-   thrLoader.setLevel(outputLevel());
-   return thrLoader.load(thrcfg);
-}
-
-bool TrigConf::XMLMasterTableLoader::load(CTPConfig& ctpc) {
-   std::string menuname("L1Name");
-   readAttribute(pt(), "name", menuname);
-   ctpc.setName(menuname);
-
-   ICTPConfigLoader& ctpLoader = m_storageMgr.ctpConfigLoader();
-   ctpLoader.setLevel(outputLevel());
-   return ctpLoader.load(ctpc);
-}
-
-bool TrigConf::XMLMasterTableLoader::load(Muctpi& m) {
-   IMuctpiLoader& muctpiLoader = m_storageMgr.muctpiLoader();
-   muctpiLoader.setLevel(outputLevel());
-   return muctpiLoader.load(m);
-}
-
-bool TrigConf::XMLMasterTableLoader::load(TXC::L1TopoMenu& l1topo) {
-   IL1TopoMenuLoader& l1topoLoader = m_storageMgr.l1topoMenuLoader();
-   l1topoLoader.setLevel(outputLevel());
-   return l1topoLoader.load(l1topo);
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMasterTableLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMasterTableLoader.h
deleted file mode 100644
index c652787d7723..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMasterTableLoader.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLMasterTableLoader
-#define TrigConf_XMLMasterTableLoader
-
-#include "TrigConfStorage/IMasterTableLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 trigger configuration*/
-   class XMLMasterTableLoader : public IMasterTableLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param node pointer to DOM node
-       */
-      XMLMasterTableLoader(XMLStorageMgr& sm, const ptree::value_type* pt) :
-         IMasterTableLoader(), XMLLoader("XMLMasterTableLoader", sm, pt) {};
-
-      /**@brief destructor*/
-      ~XMLMasterTableLoader(){};
-
-      bool load(ThresholdConfig& thrcfg);
-      bool load(CTPConfig& ctpc);
-      bool load(Muctpi& muctpi);
-      bool load(TXC::L1TopoMenu& l1topo);
-   };
-
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMenuLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMenuLoader.cxx
deleted file mode 100755
index aed8b5903fb6..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMenuLoader.cxx
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLMenuLoader.h"
-#include "./XMLThresholdConfigLoader.h"
-#include "./XMLBoostHelper.h"
-
-#include "TrigConfL1Data/TriggerItem.h"
-#include "TrigConfL1Data/L1DataDef.h"
-#include "TrigConfL1Data/Menu.h"
-#include "TrigConfL1Data/ThresholdConfig.h"
-#include "TrigConfL1Data/HelperFunctions.h"
-
-#include <iostream>
-#include <string>
-
-#include "boost/algorithm/string.hpp"
-
-using namespace std;
-
-bool
-TrigConf::XMLMenuLoader::load(Menu& menu) {
-
-   if ( !is_a("TriggerMenu") ) return false;
-
-   int ival(0);
-   std::string sval("");
-
-   if( readAttribute(pt(), "id", ival) )      menu.setId(ival);
-   if( readAttribute(pt(), "name", sval) )    menu.setName(sval);
-   if( readAttribute(pt(), "version", ival) ) menu.setVersion(ival);
-
-   // need to load thresholds first because they are used for item building
-   IThresholdConfigLoader& thrcfgloader = m_storageMgr.thresholdConfigLoader();
-   thrcfgloader.setLevel(outputLevel());
-   thrcfgloader.load( menu.thresholdConfig() );
-   TRG_MSG_INFO("Number of thresholds in the menu: " << menu.thresholdConfig().size());
-
-   for(value_type v: pt()) {
-      if(v.first != "TriggerItem") continue;
-      TriggerItem * item = new TriggerItem();
-      if( readAttribute(v.second, "id", ival) )               item->setId(ival);
-      if( readAttribute(v.second, "name", sval) )             item->setName(sval);
-      if( readAttribute(v.second, "version", ival) )          item->setVersion(ival);
-      if( readAttribute(v.second, "complex_deadtime", ival) ) item->setComplexDeadtime(ival);
-      if( readAttribute(v.second, "partition", ival) )        item->setPartition(ival);
-      if( readAttribute(v.second, "definition", sval) )       item->setDefinition(sval);
-      if( readAttribute(v.second, "ctpid", ival) )            item->setCtpId(ival);
-      if( readAttribute(v.second, "trigger_type", sval) )     item->setTriggerType( TrigConf::bin2uint(sval) );
-      if( readAttribute(v.second, "monitor", sval) )          {
-         const short TBP = 0x1;
-         const short TAP = 0x2;
-         const short TAV = 0x4;
-         
-
-         unsigned short monMask = 0;
-         vector<string> monLfHf;
-         boost::split(monLfHf, sval, boost::is_any_of(":|"));
-         //copy(monLfHf.begin(),monLfHf.end(), ostream_iterator<string>(cout,"\n") );
-
-         if(monLfHf.size()==4 && monLfHf[0]=="LF" && monLfHf[2]=="HF" && monLfHf[1].size()==3 && monLfHf[3].size()==3) {
-            // LF
-            if( monLfHf[1][2]=='1' )  monMask |= TBP;
-            if( monLfHf[1][1]=='1' )  monMask |= TAP;
-            if( monLfHf[1][0]=='1' )  monMask |= TAV;
-            // HF
-            if( monLfHf[3][2]=='1' )  monMask |= TBP << 3;
-            if( monLfHf[3][1]=='1' )  monMask |= TAP << 3;
-            if( monLfHf[3][0]=='1' )  monMask |= TAV << 3;
-         } else {
-            // this is for the temporary solution
-            if(sval.find("TBP") != string::npos) monMask |= TBP;
-            if(sval.find("TAP") != string::npos) monMask |= TAP;
-            if(sval.find("TAV") != string::npos) monMask |= TAV;
-         }
-         item->setMonitor( monMask );
-      }
-
-      for(value_type top: v.second) {
-         if(top.first=="AND" || top.first=="InternalTrigger" || top.first=="TriggerCondition") {
-            // most times it is and AND of multiple conditions, except L1_BGRPx items
-            TriggerItemNode* trig_node = readNode(top, menu.thresholdConfig().thresholdVector());
-            item->setTopNode(trig_node);
-            break;
-         }
-      }
-
-      menu.addTriggerItem(item);
-   }
-   TRG_MSG_INFO("Number of items in the menu: " << menu.itemVector().size());
-
-   return true;
-}
-
-
-TrigConf::TriggerItemNode*
-TrigConf::XMLMenuLoader::readNode(const ptree::value_type& pt,
-                                  const std::vector<TriggerThreshold*>& thr_vec) {
-
-   string node_name = pt.first;
-   TriggerItemNode::NodeType node_type = TriggerItemNode::typeFromString(node_name);
-   TriggerItemNode* trig_node = new TriggerItemNode(node_type);
-
-   if(node_type != TriggerItemNode::OBJ) {
-      // AND, OR, NOT -> add all children
-      for(value_type v: pt.second) {
-         if(v.first=="<xmlattr>") continue;
-         trig_node->addChild( readNode(v, thr_vec) );
-      }
-   } else {
-      // object (triggerthreshold or internal trigger)
-      if (node_name == "TriggerCondition") {
-         std::string thr_name("");
-         int mult(0);
-         readAttribute(pt.second,"triggerthreshold", thr_name);
-         readAttribute(pt.second,"multi", mult);
-         if (thr_name != "") {
-            TriggerThreshold* trig_thr = findThreshold(thr_name, thr_vec);
-            if (trig_thr) {
-               trig_node->setTriggerThreshold(trig_thr);
-               trig_node->setMultiplicity(mult);
-            } else {
-               msg() << "XMLMenuLoader:               ERROR cannot find threshold " << thr_name << std::endl;
-            }
-         } else {
-            msg() << "XMLMenuLoader:               ERROR TriggerCondition without threshold " << std::endl;
-         }
-      } else if (node_name == "InternalTrigger") {
-         std::string thr_name("");
-         readAttribute(pt.second, "name", thr_name);
-         trig_node->setInternalTrigger(thr_name);
-      }
-   }
-   return trig_node;
-}
-
-TrigConf::TriggerThreshold* 
-TrigConf::XMLMenuLoader::findThreshold(const std::string& name, 
-                                       const std::vector<TriggerThreshold*>& thr_vec) {
-   for(TriggerThreshold *p: thr_vec)
-      if ( p->name() == name) return p;
-   return 0;
-}
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMenuLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMenuLoader.h
deleted file mode 100644
index d692e75a2453..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMenuLoader.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLMenuLoader
-#define TrigConf_XMLMenuLoader
-
-#include "TrigConfStorage/IMenuLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-#include "TrigConfL1Data/TriggerItemNode.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 trigger menu configuration*/
-   class XMLMenuLoader : virtual public IMenuLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param node pointer to DOM node
-       */
-      XMLMenuLoader(XMLStorageMgr& sm, const ptree::value_type* pt) :
-         IMenuLoader(), XMLLoader("XMLMenuLoader", sm, pt) {};
-
-      /**@brief destructor*/
-      virtual ~XMLMenuLoader(){};
-
-      virtual bool load( Menu& data);
-
-   protected:
-
-      /**@brief builds a trigger item from a given DOM node and attaches
-       * it to the item hierarchy. 
-       *
-       * @param dom_node DOM (XML) node that contains the information
-       * for the trigger item
-       * 
-       * @param parent parent trigger item to which the new one will be
-       * linked
-       * 
-       * @param thr_vec reference to the vector of existing trigger thresholds
-       * 
-       * Note that this function calls itself recursively to build the
-       * hierarchy of trigger items
-       *
-       * @returns pointer to the newly created @c TriggerItem
-       */
-      TriggerItemNode* readNode(const value_type& pt, 
-                                const std::vector<TriggerThreshold*>& thr_vec);
-
-      /**@brief finds a trigger threshold by name
-       *
-       * @param name name of the trigger threshold to look for
-       *
-       * @param thr_vec vector of trigger thresholds to be searched
-       *
-       * @returns pointer to the @c TriggerThreshold object found or 0
-       * if there is non
-       */
-      TriggerThreshold* findThreshold(const std::string& name, 
-                                      const std::vector<TriggerThreshold*>& thr_vec);
-
-   };
-
-}
-
-#endif 
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMuctpiLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMuctpiLoader.cxx
deleted file mode 100755
index f49e83c033c8..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMuctpiLoader.cxx
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLMuctpiLoader.h"
-#include "./XMLBoostHelper.h"
-
-bool
-TrigConf::XMLMuctpiLoader::load( Muctpi& muctpi ) {
-
-   if( ! is_a("MuctpiInfo") ) return false;
-
-   msg() << "XMLMuctpiLoader started loading data." << std::endl;
-
-   int ival(0);
-   std::string strval("");
-
-   if( readAttribute(pt(), "name", strval) )   muctpi.setName(strval);
-   if( readAttribute(pt(), "id", ival) )       muctpi.setId(ival);
-   if( readAttribute(pt(), "version", ival) )  muctpi.setVersion(ival);
-   if( readAttribute(pt(), "low_pt", ival) )   muctpi.setLowptThreshold( ival );
-   if( readAttribute(pt(), "high_pt", ival) )  muctpi.setHighptThreshold( ival );
-   if( readAttribute(pt(), "max_cand", ival) ) muctpi.setMaxCand( ival );
-   for(value_type v : pt()) {
-      if( v.first == "low_pt"   && getTextContent(v.second, ival) ) muctpi.setLowptThreshold( ival );
-      if( v.first == "high_pt"  && getTextContent(v.second, ival) ) muctpi.setHighptThreshold( ival );
-      if( v.first == "max_cand" && getTextContent(v.second, ival) ) muctpi.setMaxCand( ival );
-   }
-
-
-   return true;
-}
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMuctpiLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMuctpiLoader.h
deleted file mode 100644
index dd9909e8e321..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLMuctpiLoader.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLMuctpiLoader
-#define TrigConf_XMLMuctpiLoader 
-
-#include "TrigConfStorage/IMuctpiLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 muon hardware configuration*/
-   class XMLMuctpiLoader : virtual public IMuctpiLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param pt = pair<key,ptree> 
-       */
-      XMLMuctpiLoader( XMLStorageMgr& sm, const ptree::value_type* pt) :
-         IMuctpiLoader(), XMLLoader("XMLMuctpiLoader", sm, pt) {};
-
-      /**@brief destructor*/
-      virtual ~XMLMuctpiLoader(){};
-
-      virtual bool load( Muctpi& data);
-   };
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaleSetLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaleSetLoader.cxx
deleted file mode 100755
index 376d7f5f79ac..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaleSetLoader.cxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLPrescaleSetLoader.h"
-#include "./XMLBoostHelper.h"
-
-#include "TrigConfL1Data/L1PSNumber.h"
-#include "TrigConfL1Data/PrescaleSet.h"
-
-#include <sstream>
-
-using namespace std;
-using namespace TrigConf;
-
-bool
-TrigConf::XMLPrescaleSetLoader::load(PrescaleSet& ps) {
-
-   if ( ! is_a("PrescaleSet") ) return false;
-
-   int ctpid(0),maxctpid(0);
-   for(value_type v: pt()) {
-      if ( readAttribute(v.second, "ctpid", ctpid) )
-         maxctpid = max(maxctpid, ctpid);
-   }
-   ps.resize(maxctpid+1);
-
-   int ival = 0;
-   string sval("");
-   readAttribute(pt(), "id",      ival); ps.setId(ival);
-   readAttribute(pt(), "name",    sval); ps.setName(sval);
-   readAttribute(pt(), "version", ival); ps.setVersion(ival);
-   if( readAttribute(pt(), "menuPartition", ival) ) ps.setPartition(ival);
-   if( readAttribute(pt(), "type", sval) )          ps.setType(sval);
-
-   bool newStyle(false); // means cuts are given
-
-   // list of prescales
-   for(value_type v: pt()) {
-
-      int ctpid(-1);
-      if( ! readAttribute(v.second, "ctpid", ctpid) )
-         continue;
-
-      int nn(-1), mm(0), dd(0);
-      string scut("");
-      float prescale = -1;
-      if ( readAttribute(v.second, "n", nn) && readAttribute(v.second, "m", mm) && readAttribute(v.second, "d", dd) ) { // fractional prescale - run 1
-         int64_t prescale64bit = L1PSNumber::encodeNMD(nn, mm, dd);
-         prescale = L1PSNumber(prescale64bit).getFloatPrescale();
-         ps.setPrescale(ctpid, prescale);
-      } else if( readAttribute(v.second, "cut", scut) ) { // new style contains 'cut' and 'value' as attributes
-         int cut;
-         stringstream ss;
-         ss << hex << scut;
-         ss >> cut;
-         ps.setCut(ctpid, cut);
-         newStyle = true;
-      } else if( readAttribute(v.second, "ps", prescale) ) { // new style contains 'cut' and 'value' as attributes
-         ps.setPrescale(ctpid, prescale);
-      } else if( getTextContent(v.second, prescale) ) {
-         ps.setPrescale(ctpid, prescale);
-      }
-   }
-
-   ps.setNewPrescaleStyle(newStyle);
-
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaleSetLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaleSetLoader.h
deleted file mode 100644
index 5ce30b198781..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaleSetLoader.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLPrescaleSetLoader
-#define TrigConf_XMLPrescaleSetLoader 
-
-#include "TrigConfStorage/IPrescaleSetLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 prescale set*/
-   class XMLPrescaleSetLoader : virtual public IPrescaleSetLoader, public XMLLoader {
-   public:
-
-      XMLPrescaleSetLoader( XMLStorageMgr& sm, const ptree::value_type* pt) : 
-         IPrescaleSetLoader(), XMLLoader( "XMLPrescaleSetLoader", sm, pt)
-      {}
-
-      /**@brief destructor*/
-      virtual ~XMLPrescaleSetLoader(){};
-
-      virtual bool load( PrescaleSet& data);
-   };
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaledClockLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaledClockLoader.cxx
deleted file mode 100755
index 5a0be295816c..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaledClockLoader.cxx
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLPrescaledClockLoader.h"
-#include "./XMLBoostHelper.h"
-#include "TrigConfL1Data/PrescaledClock.h"
-
-using namespace std;
-
-bool TrigConf::XMLPrescaledClockLoader::load(PrescaledClock& psc) {
-   if( ! is_a("PrescaledClock") ) return false;
-
-   int ival(0);
-   string strval("");
-
-   if( readAttribute(pt(), "id", ival) )      psc.setId(ival);
-   if( readAttribute(pt(), "name", strval) )  psc.setName(strval);
-   if( readAttribute(pt(), "version", ival) ) psc.setVersion(ival);
-   if( readAttribute(pt(), "clock1", ival) )  psc.setClock1(ival);
-   if( readAttribute(pt(), "clock2", ival) )  psc.setClock2(ival);
-
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaledClockLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaledClockLoader.h
deleted file mode 100644
index 7e18e310b8c8..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrescaledClockLoader.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLPrescaledClockLoader
-#define TrigConf_XMLPrescaledClockLoader
-
-#include "TrigConfStorage/IPrescaledClockLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 prescaled clock trigger configuration*/
-   class XMLPrescaledClockLoader : virtual public IPrescaledClockLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param node pointer to DOM node
-       */
-      XMLPrescaledClockLoader(XMLStorageMgr& sm, const ptree::value_type* pt) : 
-         XMLLoader("XMLPrescaledClockLoader", sm, pt) {}
-
-      /**@brief destructor*/
-      virtual ~XMLPrescaledClockLoader(){};
-
-      virtual bool load( PrescaledClock& data);
-   };
-
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrioritySetLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrioritySetLoader.cxx
deleted file mode 100755
index e380c5a7ab6b..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrioritySetLoader.cxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLPrioritySetLoader.h"
-#include "./XMLBoostHelper.h"
-#include "TrigConfL1Data/PrioritySet.h"
-
-bool
-TrigConf::XMLPrioritySetLoader::load( PrioritySet& ps) {
-
-   if( key() == "" ) // no PrioritySet in XML file (moved to Lvl1Item in Run2)
-      return false;
-
-   if( ! is_a("PrioritySet") ) return false;
-
-   int ival(0);
-   std::string strval("");
-
-   if( readAttribute(pt(), "name", strval) )  ps.setName(strval);
-   if( readAttribute(pt(), "id", ival) )      ps.setId(ival);
-
-   int ctpid(-1);
-   const int max_priorities = 256;
-   std::string priorities[max_priorities];
-   for (int i=0; i<max_priorities; ++i)
-      priorities[i] = "LOW";
-
-   for(value_type v : pt()) {
-      if(v.first!="Priority") continue;
-      std::string ti_priority = "LOW";
-      if( readAttribute(v.second, "ctpid", ctpid) && ctpid >= 0 && ctpid<max_priorities) {
-         if( readAttribute(v.second, "priority", ti_priority) || getTextContent(v.second, ti_priority) ) // either attribute or text
-            priorities[ctpid] = ti_priority;
-      }
-   }
-
-   ps.setPriorities(priorities, max_priorities);
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrioritySetLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrioritySetLoader.h
deleted file mode 100644
index 85bbe6b2cd78..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLPrioritySetLoader.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLPrioritySetLoader
-#define TrigConf_XMLPrioritySetLoader 
-
-#include "TrigConfStorage/IPrioritySetLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 item priority configuration*/
-   class XMLPrioritySetLoader : virtual public IPrioritySetLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param node pointer to DOM node
-       */
-      XMLPrioritySetLoader( XMLStorageMgr& sm, const ptree::value_type* pt)
-         : IPrioritySetLoader(), XMLLoader("XMLPrioritySetLoader", sm, pt) {}
-    
-      /**@brief destructor*/
-      virtual ~XMLPrioritySetLoader(){};
-
-      virtual bool load( PrioritySet& data);
-   };
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLRandomLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLRandomLoader.cxx
deleted file mode 100755
index 0f2c272e1597..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLRandomLoader.cxx
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLRandomLoader.h"
-#include "./XMLBoostHelper.h"
-#include "TrigConfL1Data/Random.h"
-
-using namespace std;
-
-bool TrigConf::XMLRandomLoader::load(Random& random) {
-
-   if( ! is_a("Random") ) return false;
-
-   int ival(0);
-   string sval("");
-   
-   if( readAttribute(pt(), "id", ival) )      random.setId(ival);
-   if( readAttribute(pt(), "name", sval) )    random.setName(sval);
-   if( readAttribute(pt(), "version", ival) ) random.setVersion(ival);
-   if( readAttribute(pt(), "rate1", ival) )   random.setRate1(ival);
-   if( readAttribute(pt(), "rate2", ival) )   random.setRate2(ival);
-
-   // new style
-   if( readAttribute(pt(), "name0", sval) )   random.setRndmName(0, sval);
-   if( readAttribute(pt(), "name1", sval) )   random.setRndmName(1, sval);
-   if( readAttribute(pt(), "name2", sval) )   random.setRndmName(2, sval);
-   if( readAttribute(pt(), "name3", sval) )   random.setRndmName(3, sval);
-
-   if( readAttribute(pt(), "cut0", ival) )   random.setCut(0, ival);
-   if( readAttribute(pt(), "cut1", ival) )   random.setCut(1, ival);
-   if( readAttribute(pt(), "cut2", ival) )   random.setCut(2, ival);
-   if( readAttribute(pt(), "cut3", ival) )   random.setCut(3, ival);
-
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLRandomLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLRandomLoader.h
deleted file mode 100644
index 32c57a66c469..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLRandomLoader.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLRandomLoader
-#define TrigConf_XMLRandomLoader
-
-#include "TrigConfStorage/IRandomLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   /**@brief TriggerDB loader of the LVL1 random trigger configuration*/
-   class XMLRandomLoader : virtual public IRandomLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       * @param node pointer to DOM node
-       */
-      XMLRandomLoader(XMLStorageMgr& sm, const ptree::value_type* pt) : 
-         IRandomLoader(), XMLLoader("XMLRandomLoader", sm, pt) {}
-    
-      /**@brief destructor*/
-      virtual ~XMLRandomLoader(){};    
-
-      virtual bool load( Random& data);
-   };
-
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLStorageMgr.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLStorageMgr.cxx
deleted file mode 100755
index 613e5c54732f..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLStorageMgr.cxx
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "TrigConfStorage/XMLStorageMgr.h"
-
-#include "./XMLHLTFrameLoader.h"
-#include "./XMLJobOptionTableLoader.h"
-#include "./XMLMasterTableLoader.h"
-#include "./XMLMenuLoader.h"
-#include "./XMLMuctpiLoader.h"
-#include "./XMLDeadTimeLoader.h"
-#include "./XMLPrescaledClockLoader.h"
-#include "./XMLRandomLoader.h"
-#include "./XMLThresholdConfigLoader.h"
-#include "./XMLPrescaleSetLoader.h"
-#include "./XMLPrioritySetLoader.h"
-#include "./XMLBunchGroupLoader.h"
-#include "./XMLBunchGroupSetLoader.h"
-#include "./XMLCTPConfigLoader.h"
-#include "./XMLCTPConfigOnlineLoader.h"
-#include "./XMLTriggerThresholdLoader.h"
-#include "./XMLTriggerThresholdValueLoader.h"
-#include "./CaloJetInputLoader.h"
-#include "./CaloSinCosLoader.h"
-#include "./CaloInfoLoader.h"
-#include "./XMLLutCamLoader.h"
-#include "./XMLCTPFilesLoader.h"
-#include "./XMLThresholdMonitorLoader.h"
-#include "./XMLCaloSinCosLoader.h"
-#include "./XMLCaloInfoLoader.h"
-#include "./XMLL1TopoMenuLoader.h"
-
-#include <iostream>
-
-#include <boost/property_tree/xml_parser.hpp>
-#include <boost/property_tree/ptree.hpp>
-
-using namespace std;
-using namespace TrigConf;
-using namespace boost::property_tree;
-
-
-namespace {
-   // function the returns pointer to menu and the corresponding top level tag, if among the list
-   ptree* GetTreeAndType(const string& filename, string& menutype) {
-      ptree * menu = new ptree();
-      menutype="";
-      read_xml<ptree>(filename, *menu);
-      for(string x: {"TOPO_MENU", "LVL1Config", "HLT_MENU"})
-         if(menu->find(x) != menu->not_found()) {
-            menutype = x;
-            return menu;
-         }
-      delete menu;
-      return nullptr;
-   }
-}
-
-
-XMLStorageMgr::XMLStorageMgr( const std::vector<std::string>& files ) :
-   TrigConfMessaging("XMLStorageMgr"),
-   m_l1topomenu(new ptree()),
-   m_l1menu(new ptree()),
-   m_hltmenu(new ptree())
-{
-   string menutype("");
-
-   for(const string & filename: files) {
-      string menutype = "";
-      ptree* menu = GetTreeAndType(filename, menutype);
-      if(menutype=="TOPO_MENU") {
-         TRG_MSG_INFO("Using " << filename << " as L1Topo menu");
-         delete m_l1topomenu;
-         m_l1topomenu = menu;
-         m_xmlL1TopoFile = filename;
-         m_runL1Topo = true;
-      } else if(menutype=="LVL1Config") {
-         TRG_MSG_INFO("Using " << filename << " as L1 menu");
-         delete m_l1menu;
-         m_l1menu = menu;
-         m_xmlL1File = filename;
-         m_runLVL1 = true;
-      } else if(menutype=="HLT_MENU") {
-         TRG_MSG_INFO("Using " << filename << " as HLT menu");
-         delete m_hltmenu;
-         m_hltmenu = menu;
-         m_xmlHLTFile = filename;
-         m_runHLT = true;
-      }
-   }
-
-   m_cs = m_xmlL1File; // have to check why we still need this
-}
-
-
-TrigConf::XMLStorageMgr::~XMLStorageMgr() {
-   delete m_l1topomenu;
-   delete m_l1menu;
-   delete m_hltmenu;
-}
-
-
-// setting log level of all loaders and itself
-void
-XMLStorageMgr::setLevel(MSGTC::Level lvl) {
-   msg().setLevel(lvl);
-}
-
-template<class I, class L>
-I & CreateLoader( I * & loader, XMLStorageMgr* mgr, const ptree* menu, const std::string & path) {
-   if( loader == nullptr && menu != nullptr ) {
-
-      ptree::path_type p(path);
-
-      const ptree * subtree = menu; // subtree is the current tree in the walk
-
-      auto it = ptree::const_assoc_iterator{ subtree->not_found() }; // iterator for finding the tag
-
-      while( ! p.empty() ) {
-         const string & tag = p.reduce();
-         it = subtree->find( tag );
-         if( it == subtree->not_found() ) {
-            break;
-         } else {
-            subtree = & it->second;
-         }
-      }
-      loader = new L( *mgr, it == subtree->not_found() ? 0 : &*it );
-   }
-   return * loader;
-}
-
-
-IL1TopoMenuLoader&
-XMLStorageMgr::l1topoMenuLoader() {
-
-   return CreateLoader<IL1TopoMenuLoader, XMLL1TopoMenuLoader> ( m_l1topoMenuLoader, this, m_l1topomenu, "TOPO_MENU" );
-
-}
-
-
-IMasterTableLoader& XMLStorageMgr::masterTableLoader() {
-
-   return CreateLoader<IMasterTableLoader, XMLMasterTableLoader> ( m_masterTableLoader, this, m_l1menu, "LVL1Config" );
-
-}
-
-
-IMenuLoader& XMLStorageMgr::menuLoader() {
-
-   return CreateLoader<IMenuLoader, XMLMenuLoader> ( m_menuLoader, this, m_l1menu, "LVL1Config.TriggerMenu" );
-
-   //    XMLMenuLoader & xmlml = dynamic_cast<XMLMenuLoader &>(ml);
-   //    xmlml.setMonitoringPtree(m_l1menu, "LVL1Config.TriggerMenu");
-}
-
-IMuctpiLoader& XMLStorageMgr::muctpiLoader() {
-
-   return CreateLoader<IMuctpiLoader, XMLMuctpiLoader> ( m_muctpiLoader, this, m_l1menu, "LVL1Config.MuctpiInfo" );
-
-}
-
-IPrescaleSetLoader& XMLStorageMgr::prescaleSetLoader() {
-
-   return CreateLoader<IPrescaleSetLoader, XMLPrescaleSetLoader> ( m_prescaleSetLoader, this, m_l1menu, "LVL1Config.PrescaleSet" );
-
-}
-
-IPrioritySetLoader& XMLStorageMgr::prioritySetLoader() {
-
-   return CreateLoader<IPrioritySetLoader, XMLPrioritySetLoader> ( m_prioritySetLoader, this, m_l1menu, "LVL1Config.PrioritySet" );
-
-}
-
-IDeadTimeLoader& XMLStorageMgr::deadTimeLoader() {
-
-   return CreateLoader<IDeadTimeLoader, XMLDeadTimeLoader> ( m_deadTimeLoader, this, m_l1menu, "LVL1Config.Deadtime" );
-
-}
-
-
-IBunchGroupLoader& XMLStorageMgr::bunchGroupLoader() {
-   if( ! m_bunchGroupLoader ) m_bunchGroupLoader = new XMLBunchGroupLoader(*this, 0);
-   return *m_bunchGroupLoader;
-}
-
-
-IBunchGroupSetLoader& XMLStorageMgr::bunchGroupSetLoader() {
-
-   return CreateLoader<IBunchGroupSetLoader, XMLBunchGroupSetLoader> ( m_bunchGroupSetLoader, this, m_l1menu, "LVL1Config.BunchGroupSet" );
-
-}
-
-
-IPrescaledClockLoader& XMLStorageMgr::prescaledClockLoader() {
-
-   return CreateLoader<IPrescaledClockLoader, XMLPrescaledClockLoader> ( m_prescaledClockLoader, this, m_l1menu, "LVL1Config.PrescaledClock" );
-
-}
-
-
-IRandomLoader& XMLStorageMgr::randomLoader() {
-
-   return CreateLoader<IRandomLoader, XMLRandomLoader> ( m_randomLoader, this, m_l1menu, "LVL1Config.Random" );
-
-}
-
-
-IThresholdConfigLoader& XMLStorageMgr::thresholdConfigLoader() {
-
-   return CreateLoader<IThresholdConfigLoader, XMLThresholdConfigLoader> ( m_thresholdConfigLoader, this, m_l1menu, "LVL1Config.TriggerThresholdList" );
-
-}
-
-
-ITriggerThresholdLoader& XMLStorageMgr::triggerThresholdLoader() {
-
-   if( ! m_triggerThresholdLoader ) m_triggerThresholdLoader = new XMLTriggerThresholdLoader(*this);
-   return *m_triggerThresholdLoader;
-
-}
-
-
-ICTPConfigLoader& XMLStorageMgr::ctpConfigLoader() {
-
-   return CreateLoader<ICTPConfigLoader, XMLCTPConfigLoader> ( m_ctpConfigLoader, this, m_l1menu, "LVL1Config" );
-
-}
-
-
-ICTPConfigLoader& XMLStorageMgr::ctpConfigOnlineLoader() {
-
-   return ctpConfigLoader();
-
-}
-
-
-ITriggerThresholdValueLoader& XMLStorageMgr::triggerThresholdValueLoader() {
-
-   if( ! m_triggerThresholdValueLoader ) m_triggerThresholdValueLoader = new XMLTriggerThresholdValueLoader(*this);
-   return *m_triggerThresholdValueLoader;
-
-}
-
-
-ICaloJetInputLoader& XMLStorageMgr::caloJetInputLoader() {
-
-   if( ! m_caloJetInputLoader ) m_caloJetInputLoader = 0; // new XMLCaloJetInputLoader( *this );
-   return *m_caloJetInputLoader;
-
-}
-
-
-ICaloSinCosLoader& XMLStorageMgr::caloSinCosLoader() {
-
-   if( ! m_caloSinCosLoader ) m_caloSinCosLoader = new XMLCaloSinCosLoader(*this);
-   return *m_caloSinCosLoader;
-
-}
-
-
-ICaloInfoLoader& XMLStorageMgr::caloInfoLoader() {
-
-   return CreateLoader<ICaloInfoLoader, XMLCaloInfoLoader> ( m_caloInfoLoader, this, m_l1menu, "LVL1Config.CaloInfo" );
-
-}
-
-
-ILutCamLoader& XMLStorageMgr::lutcamLoader() {
-   if(! m_lutCamLoader) {
-      std::string::size_type pos1 = m_cs.find_first_of(".xml");
-      std::string::size_type nlen = 0;
-      if (pos1 != std::string::npos) nlen = m_cs.length() - pos1;
-      std::string lutFile = m_cs.replace(pos1, nlen, ".lut");
-      std::string camFile = m_cs.replace(pos1, nlen, ".cam");
-
-      msg() << "Source XML file " << m_cs << std::endl;
-      msg() << "LUT file set to " << lutFile << std::endl;
-      msg() << "CAM file set to " << camFile << std::endl;
-
-      m_lutCamLoader = new XMLLutCamLoader(*this, lutFile, camFile);
-   }
-   return *m_lutCamLoader;
-}
-
-
-ICTPFilesLoader& XMLStorageMgr::ctpFilesLoader() {
-
-   if(! m_ctpFilesLoader) {
-      std::string::size_type pos1 = m_cs.find_first_of(".xml");
-      std::string::size_type nlen = 0;
-      if (pos1 != std::string::npos) nlen = m_cs.length() - pos1;
-      std::string lutFile = m_cs.replace(pos1, nlen, ".lut");
-      std::string camFile = m_cs.replace(pos1, nlen, ".cam");
-
-      msg() << "Source XML file " << m_cs << std::endl;
-      msg() << "LUT file set to " << lutFile << std::endl;
-      msg() << "CAM file set to " << camFile << std::endl;
-
-      m_ctpFilesLoader = new XMLCTPFilesLoader(*this, lutFile, camFile);
-   }
-   return *m_ctpFilesLoader;
-
-}
-
-
-IThresholdMonitorLoader& XMLStorageMgr::thresholdMonitorLoader() {
-
-   if(! m_thresholdMonitorLoader) m_thresholdMonitorLoader = new XMLThresholdMonitorLoader( *this );			
-   return *m_thresholdMonitorLoader;
-
-}
-
-
-IHLTFrameLoader& XMLStorageMgr::hltFrameLoader() {
-
-   return CreateLoader<IHLTFrameLoader, XMLHLTFrameLoader> ( m_HLTFrameLoader, this, m_hltmenu, "HLT_MENU" );
-
-}
-
-
-IJobOptionTableLoader& XMLStorageMgr::jobOptionTableLoader() {
-
-   return CreateLoader<IJobOptionTableLoader, XMLJobOptionTableLoader> ( m_jobOptionTableLoader, this, 0, "SETUP" );
-
-}
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.cxx
deleted file mode 100755
index 7ce0d5be9b9c..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.cxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLThresholdConfigLoader.h"
-#include "./XMLTriggerThresholdLoader.h"
-#include "./XMLBoostHelper.h"
-
-#include "TrigConfStorage/XMLStorageMgr.h"
-#include "TrigConfL1Data/ThresholdConfig.h"
-#include "TrigConfL1Data/TriggerThreshold.h"
-#include "TrigConfL1Data/CaloInfo.h"
-
-using namespace std;
-using namespace TrigConf;
-
-
-XMLThresholdConfigLoader::XMLThresholdConfigLoader( XMLStorageMgr& sm, const ptree::value_type* pt ) : 
-   XMLLoader("XMLThresholdConfigLoader", sm, pt)
-{}
-
-
-bool
-XMLThresholdConfigLoader::load( ThresholdConfig& thrcfg ) {
-
-   if ( ! is_a("TriggerThresholdList") ) return false;
-
-   TRG_MSG_DEBUG("Loading ThresholdConfig object")
-
-   // Get the thresholds
-   XMLTriggerThresholdLoader* thr_ldr = new XMLTriggerThresholdLoader(m_storageMgr);
-   thr_ldr->setLevel(outputLevel());
-   for(value_type v: pt() ) {
-      thr_ldr->setPtree(&v);
-      TriggerThreshold* thr = new TriggerThreshold();
-      if (thr_ldr->load(*thr)) {
-         TRG_MSG_DEBUG("Adding trigger threshold " << *thr << "(type " << thr->ttype() << ", mapping " << thr->mapping() << ")")
-         thrcfg.addTriggerThreshold(thr);
-      }
-   }
-   delete thr_ldr;
-
-   // Read CaloInfo
-   ICaloInfoLoader& ci_loader = m_storageMgr.caloInfoLoader();
-   ci_loader.setLevel(outputLevel());
-   CaloInfo ci;
-   if ( ci_loader.load(ci) ) {
-      thrcfg.setCaloInfo(ci);
-      TriggerThresholdValue::setCaloInfo(ci);
-   } else {
-      TRG_MSG_ERROR("reading CaloInfo");
-   }
-
-   return true;
-}
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.h
deleted file mode 100644
index 45f9718bb4fa..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdConfigLoader.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/////////////////////////////////////////////////////////////////////
-//                                                     
-//NAME:     XMLThresholdConfigLoader.h 
-//PACKAGE:  TrigConfStorage
-//
-//AUTHOR:   J.Haller (CERN)	Johannes.Haller@cern.ch 
-//CREATED:  31. Oct. 2005
-//                                  
-//PURPOSE:
-//
-//
-//////////////////////////////////////////////////////////////////////
-#ifndef TrigConf_XMLThresholdConfigLoader
-#define TrigConf_XMLThresholdConfigLoader
-
-#include "TrigConfStorage/IThresholdConfigLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-  
-   /**@brief TriggerDB loader of the LVL1 trigger threshold configuration*/
-   class XMLThresholdConfigLoader : virtual public IThresholdConfigLoader, 
-                                    public XMLLoader {
-   public:
-
-      /**@brief constructor
-       *
-       * @param sm reference to storage manager
-       *
-       * @param node pointer to DOM node
-       */
-      XMLThresholdConfigLoader( XMLStorageMgr& sm, const ptree::value_type* pt );
-
-      /**@brief destructor*/
-      virtual ~XMLThresholdConfigLoader(){};
-
-      virtual bool load( ThresholdConfig& data);
-   };
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdMonitorLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdMonitorLoader.cxx
deleted file mode 100644
index 3c6f222d1ac0..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdMonitorLoader.cxx
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLThresholdMonitorLoader.h"
-
-bool TrigConf::XMLThresholdMonitorLoader::load(ThresholdMonitor&) {
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdMonitorLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdMonitorLoader.h
deleted file mode 100644
index beee6cda1d01..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLThresholdMonitorLoader.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLThresholdMonitorLoader
-#define TrigConf_XMLThresholdMonitorLoader
-/*
-  XMLCTPFilesLoader.h
-*/
-#include "TrigConfStorage/IThresholdMonitorLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-#include <string>
-
-namespace TrigConf {
-
-   /**@brief Dummy XML loader */
-   class XMLThresholdMonitorLoader : virtual public IThresholdMonitorLoader, public XMLLoader {
-   public:
-
-      /**@brief constructor
-       * @param sm reference to storage manager
-       */
-      XMLThresholdMonitorLoader(XMLStorageMgr& sm) :
-         XMLLoader("XMLThresholdMonitorLoader", sm, 0) {};
-      virtual ~XMLThresholdMonitorLoader() {}
-
-      virtual bool load( ThresholdMonitor& data);
-   };
-
-}
-
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdLoader.cxx
deleted file mode 100755
index 256e1f1395b1..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdLoader.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLTriggerThresholdLoader.h"
-#include "./XMLTriggerThresholdValueLoader.h"
-#include "./XMLBoostHelper.h"
-
-#include "TrigConfStorage/XMLStorageMgr.h"
-
-#include "TrigConfL1Data/TriggerThreshold.h"
-#include "TrigConfL1Data/TriggerThresholdValue.h"
-#include "TrigConfL1Data/L1DataDef.h"
-
-#include <string>
-#include <iostream>
-
-using namespace std;
-
-bool
-TrigConf::XMLTriggerThresholdLoader::load(TriggerThreshold& thr) {
-
-   if (!is_a("TriggerThreshold")) return false;
-
-   bool bval(false);
-   std::string sval(""), type(""), name("");
-   int ival(0);
-
-   if( readAttribute( pt(), "id",         ival) )  thr.setId(ival);
-   if( readAttribute( pt(), "version",    ival) )  thr.setVersion(ival);
-   if( readAttribute( pt(), "name",       name) )  thr.setName(name);
-   if( readAttribute( pt(), "version",    ival) )  thr.setVersion(ival);
-   if( readAttribute( pt(), "type",       type) )  thr.setType(type);
-   if( readAttribute( pt(), "seed",       sval) )  thr.setZBSeedingThresholdName(sval);
-   if( readAttribute( pt(), "seed_multi", ival) )  thr.setZBSeedingThresholdMulti(ival);
-   if( readAttribute( pt(), "bcdelay",    ival) )  thr.setBCDelay(ival);
-   if( readAttribute( pt(), "mapping",    ival) )  thr.setMapping(ival);
-   if( readAttribute( pt(), "active",     bval) )  thr.setActive(bval);
-   if( readAttribute( pt(), "input",      sval) )  thr.setInput(sval);
-   if( readAttribute( pt(), "bitnum",     ival) )  thr.setBitnum(ival);
-   
-   // <TriggerThresholdValue>'s
-   XMLTriggerThresholdValueLoader& thrvldr = dynamic_cast<XMLTriggerThresholdValueLoader&>(m_storageMgr.triggerThresholdValueLoader());
-   for(value_type v : pt()) {
-      if(v.first != "TriggerThresholdValue" ) continue;
-      thrvldr.setPtree(&v);
-      TriggerThresholdValue* thrv = TriggerThreshold::createThresholdValue(type);
-      thrvldr.load(*thrv);
-      thr.addThresholdValue(thrv);
-   }
-
-   // <Cable>
-   ptree::const_assoc_iterator cable = pt().find("Cable");
-   if (cable != pt().not_found()) {
-      if(readAttribute(cable->second, "name",      sval)) thr.setCableName(sval);
-      if(readAttribute(cable->second, "ctpin",     sval)) thr.setCableCtpin(sval);
-      if(readAttribute(cable->second, "input",     sval)) thr.setCableCtpin(sval);
-      if(readAttribute(cable->second, "connector", sval)) thr.setCableConnector(sval);
-      // <Signal>
-      ptree::const_assoc_iterator signal = cable->second.find("Signal");
-      if( signal != cable->second.not_found()) {
-         if(readAttribute(signal->second, "range_begin", ival)) thr.setCableStart(ival);
-         if(readAttribute(signal->second, "range_end",   ival)) thr.setCableEnd(ival);
-         if(readAttribute(signal->second, "clock",       ival)) thr.setClock(ival);
-      }
-   }
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdLoader.h
deleted file mode 100644
index 4ffde418da5b..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdLoader.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLTriggerThresholdLoader
-#define TrigConf_XMLTriggerThresholdLoader
-
-#include "TrigConfStorage/ITriggerThresholdLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-namespace TrigConf {
-
-   class XMLTriggerThresholdLoader : virtual public ITriggerThresholdLoader, public XMLLoader {
-   public:
-      
-      XMLTriggerThresholdLoader(XMLStorageMgr& sm, value_type* pt = 0) : 
-         XMLLoader("XMLTriggerThresholdLoader", sm, pt)
-      {};
-
-      virtual ~XMLTriggerThresholdLoader(){};
-      
-      virtual bool load( TriggerThreshold& data);
-   };
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdValueLoader.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdValueLoader.cxx
deleted file mode 100755
index 71c21837afdf..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdValueLoader.cxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "./XMLTriggerThresholdValueLoader.h"
-#include "./XMLBoostHelper.h"
-
-#include "TrigConfL1Data/ClusterThresholdValue.h"
-#include "TrigConfL1Data/L1DataDef.h"
-#include "TrigConfL1Data/HelperFunctions.h"
-
-#include <iostream>
-
-using namespace std;
-
-bool
-TrigConf::XMLTriggerThresholdValueLoader::load(TriggerThresholdValue& thrv) {
-
-   if( ! is_a("TriggerThresholdValue") ) return false;
-
-   string sval(""), type("");
-   int    ival(0);
-   float  fval(0);
-   
-   if( readAttribute(pt(), "id", ival) )            thrv.setId(ival);                        
-   if( readAttribute(pt(), "name", sval) )          thrv.setName(sval);      
-   if( readAttribute(pt(), "version", ival) )       thrv.setVersion(ival);
-   if( readAttribute(pt(), "thresholdval", fval) )  thrv.setPtcut(fval);      
-   if( readAttribute(pt(), "type", type) )          thrv.setType(type);      
-   if( readAttribute(pt(), "priority", fval) )      thrv.setPriority(fval);
-   if( readAttribute(pt(), "window", ival) )        thrv.setWindow(ival);
-   if( readAttribute(pt(), "etamin", ival) )        thrv.setEtaMin(ival);
-   if( readAttribute(pt(), "etamax", ival) )        thrv.setEtaMax(ival);
-   if( readAttribute(pt(), "phimin", ival) )        thrv.setPhiMin(ival);
-   if( readAttribute(pt(), "phimax", ival) )        thrv.setPhiMax(ival);                
-   
-   if (type == L1DataDef::emType() || type == L1DataDef::tauType() || type == "EM_TAU") {
-      ClusterThresholdValue& cluthrval = dynamic_cast<ClusterThresholdValue&>(thrv);
-      if( readAttribute(pt(), "em_isolation", fval) )  cluthrval.setEmIsolation(fval);   
-      if( readAttribute(pt(), "had_isolation", fval) ) cluthrval.setHadIsolation(fval); 
-      if( readAttribute(pt(), "had_veto", fval) )      cluthrval.setHadVeto(fval);           
-
-      if( readAttribute(pt(), "isobits", sval ) ) {
-         cluthrval.setIsolationMask( TrigConf::bin2uint(sval) );
-         cluthrval.setUseIsolationMask();
-      }
-   }
-
-   return true;
-}
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdValueLoader.h b/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdValueLoader.h
deleted file mode 100644
index 2d5abf61fbc9..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/XMLTriggerThresholdValueLoader.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConf_XMLTriggerThresholdValueLoader
-#define TrigConf_XMLTriggerThresholdValueLoader
-
-#include "TrigConfStorage/ITriggerThresholdValueLoader.h"
-#include "TrigConfStorage/XMLLoader.h"
-
-#include <string>
-
-namespace TrigConf {
-
-  /**@brief TriggerDB loader of the LVL1 trigger threshold values*/
-  class XMLTriggerThresholdValueLoader : virtual public ITriggerThresholdValueLoader, public XMLLoader {
-  public:
-
-    XMLTriggerThresholdValueLoader(XMLStorageMgr& sm, value_type* pt = 0) :
-       XMLLoader("XMLTriggerThresholdValueLoader", sm, pt) {};
-
-    virtual ~XMLTriggerThresholdValueLoader(){};
-
-    virtual bool load( TriggerThresholdValue& data);
-
-  };
-
-}
-
-#endif
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/test/2COOLApp.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/test/2COOLApp.cxx
deleted file mode 100755
index 663e6d92109d..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/test/2COOLApp.cxx
+++ /dev/null
@@ -1,1128 +0,0 @@
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-/////////////////////////////////////////////////////////////////////
-//                                                     
-//NAME:     TrigConf2COOLApp.cpp 
-//PACKAGE:  TrigConfStorage
-//                                                     
-//AUTHOR:   J.Stelzer (CERN)	Joerg.Stelzer@cern.ch 
-//CREATED:  07. Jan. 2005
-//                                                     
-//PURPOSE: 
-//
-// This standalone application is designed to write the trigger
-// configuration (L1+HLT) for a given run/LB to the COOL database.
-// The information can be read from either xml files (intented for
-// Monte Carlo production) or from the TriggerDB in online running.
-//
-// Online running: The application has to be called at the beginning
-// of a new run. In addition L1 prescales can be written at LB block
-// boundaries. The information is retrieved from the TriggerDB. The
-// application is called by the Run Control.
-//
-// MC production: There are no LBs in MC production, the application
-// is called only at the beginning of the production job. The
-// information is retrieved from XML files or from the TriggerDB
-// depending on wether the simulation uses the TriggerDB or not.
-//
-//////////////////////////////////////////////////////////////////////
-
-
-// TODO for Joerg: add the bunchgroupset key, like the prescale key, and
-// load the bunchgroupset separately; then call BG write functions
-
-#include "TrigConfL1Data/HelperFunctions.h"
-#include "TrigConfL1Data/CTPConfig.h"
-
-#include "TrigConfStorage/StorageMgr.h"
-#include "TrigConfStorage/XMLStorageMgr.h"
-
-
-#include "TrigConfStorage/TrigConfCoolWriter.h"
-
-#include "TrigConfStorage/IStorageMgr.h"
-#include "TrigConfStorage/IHLTFrameLoader.h"
-
-#include "TrigConfL1Data/Menu.h"
-
-#include "TrigConfHLTData/HLTFrame.h"
-#include "TrigConfHLTData/HLTPrescaleSet.h"
-
-#include "CoolKernel/DatabaseId.h"
-#include "CoolKernel/Exception.h"
-#include "CoolKernel/IDatabaseSvc.h"
-#include "CoolKernel/IDatabase.h"
-#include "CoolKernel/IFolder.h"
-#include "CoolKernel/IObject.h"
-
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <memory>
-#include <ctime>
-#include <map>
-#include <vector>
-#include <sys/stat.h> 
-
-using namespace std;
-
-class TrigConfError {
-public:
-   TrigConfError(const std::string& s, uint c) : what(s), code(c) {};
-   ~TrigConfError(){};
-   std::string what;
-   uint code;
-};
-
-string
-findInPath(const std::string& filename, const string & path) {
-   struct stat file_stat;
-   string fullname = path + "/" + filename;
-   if (stat (fullname.c_str(), &file_stat) == 0) return fullname;
-   return "";
-}
-
-std::vector<std::string> splitpath(const std::string& line, std::string del=":")
-{
-   std::vector<std::string> res;
-   std::string::size_type old_pos = 0, pos = line.find(del,0);
-   while( pos != std::string::npos ) {
-      res.push_back(line.substr(old_pos,pos-old_pos));
-      old_pos = pos + del.size();
-      pos = line.find(del, old_pos);
-   }
-   // last entry
-   if (old_pos < line.size())
-      res.push_back(line.substr(old_pos,line.size()-old_pos));
-   return res;
-}
-
-std::string pathresolve(const std::string& filename, const std::string & searchpath) {
-   std::string fullname = findInPath(filename,".");
-   if( fullname != "" ) { return fullname; }
-   std::vector<std::string> listofpaths = splitpath(searchpath);
-   for (const std::string& path : listofpaths) {
-      fullname = findInPath(filename,path);
-      if( fullname != "" ) { return fullname; }      
-   }
-   return "";
-}
-
-std::string xmlpathresolve(const std::string& filename) {
-
-   // if path starts with '/' then it is absolute
-   if (!filename.empty() && filename[0] =='/') return filename;
-
-   std::string xmlpath = ::getenv("XMLPATH");
-   if(filename.find('/')==std::string::npos) {
-      // if there is no "/" in the filename we try to things
-      std::string fullname = pathresolve(filename, xmlpath);
-      if(fullname == "")
-         fullname = pathresolve("TriggerMenuXML/"+filename, xmlpath);
-      return fullname;
-   } else {
-      return pathresolve(filename, xmlpath);
-   }
-}
-
-template <class T>
-bool from_string(T& t, const std::string& s, std::ios_base& (*f)(std::ios_base&)) {
-  std::istringstream iss(s);
-  return !(iss >> f >> t).fail();
-}
-
-int convertStringToInt(const std::string & s) {
-  int theInt;
-  if(from_string<int>(theInt, s, std::fixed)) return theInt; // std::hex also possible
-  throw TrigConfError(std::string("Could not convert to integer: ")+s, 1);
-}
-
-float convertStringToFloat(const std::string & s) {
-  float theFloat;
-  if(from_string<float>(theFloat, s, std::dec)) return theFloat;
-  throw TrigConfError(std::string("Could not convert to float: ")+s, 1);
-}
-
-std::string test_cool_connection = "oracle://devdb;schema=atltrig;dbname=COOLTEST;user=atltrig;password=trigconf2007";
-
-// ================================================================================
-//
-// The following arguments must or can be given to the application:
-//
-// Mandatory:
-//
-// -e|--env         onl|sim|cre            Running environment
-//                                         onl  -  online
-//                                         sim  -  simulation
-//                                         cre  -  create COOL schema 
-// ================================================================================
-
-
-// --------------------------------------------------------------------------------
-// printhelp
-// --------------------------------------------------------------------------------
-void printhelp(std::ostream & o, std::ostream& (*lineend) ( std::ostream& os )) {
-  o << "================================================================================" << lineend;
-  o << "| The program needs to be run with the following specifications:" << lineend;
-  o << "| TrigConf2CoolApp.exe <arguments>" << lineend << lineend;
-  o << "| where the arguments are (*-required):" << lineend;
-  o << "| --------------------------------------------------------------------------------" << lineend;
-  o << "| " << lineend;
-  o << "| " << lineend;
-  o << "|   -e|--env         <string>     * Running environment [write|sim|read|create]" << lineend;
-  o << "|                                   write         -  writing info into COOL" << lineend;
-  o << "|                                   writel1       -  writing L1 info only into COOL" << lineend;
-  o << "|                                   writehlt      -  writing HLT info only into COOL" << lineend;
-  o << "|                                   read          -  reading info from COOL (for debugging)" << lineend;
-  o << "|                                   sim           -  simulation" << lineend;
-  o << "|                                   create        -  create COOL schema" << lineend;
-  o << "|                                   printschema   -  print COOL schema" << lineend;
-  o << "|                                   schemaversion -  print COOL schema version" << lineend;
-  o << "|   --log            <string>     * name of the log file" << lineend;
-  o << "| " << lineend;                    
-  o << "| Create new schema" << lineend;   
-  o << "| -----------------" << lineend;   
-  o << "|   --cooldb         <string>     * COOL DB, format: 'oracle://<server>;schema=<schema>;dbname=<DBNAME>;user=<user>;password=<pw>'" << lineend;
-  o << "|                                   test value: " << test_cool_connection << lineend;
-  o << "|   --schemaversion  <int>          schema version (default will be used if not specified - recommended)" << lineend;
-  o << "| " << lineend;                    
-  o << "| Print schema/schemaversion" << lineend;   
-  o << "| --------------------------" << lineend;   
-  o << "|   --cooldb         <string>     * COOL DB, format: 'oracle://<server>;schema=<schema>;dbname=<DBNAME>;user=<user>;password=<pw>'" << lineend;
-  o << "|                                   test value: " << test_cool_connection << lineend;
-  o << "| " << lineend;                    
-  o << "| Write to COOL" << lineend;      
-  o << "| -------------" << lineend;      
-  o << "|   --cooldb          <string>    * COOL DB, format: 'oracle://<server>;schema=<schema>;dbname=<DBNAME>;user=<user>;password=<pw>'" << lineend;
-  o << "|                                   test value: " << test_cool_connection << lineend;
-  o << "|   --run             <string>    * Run number, string that can be interpreted as single int or range, or list of either ('14-16,23,30-31')" << lineend;
-  o << "| From the TriggerDB" << lineend;      
-  o << "|   --trigdb          <string>    * Trigger DB" << lineend;
-  o << "|   --usefrontier                   uses frontier instead of oracle (disables sqlite)" << lineend;
-  o << "|   --configkey       <int>         Trigger configuration key" << lineend;
-  o << "|   --prescalekeylvl1 <int>         Trigger Lvl1 prescale configuration key" << lineend;
-  o << "|   --prescalekeyhlt  <int>         Trigger HLT prescale configuration key [if set to 0 the HLT configuration will not be written]" << lineend;
-  o << "|   --bgkey           <int>         Trigger bunchgroup configuration key" << lineend;
-  o << "|   --level           <string>      Trigger level [lvl1|hlt]" << lineend;
-  o << "|   --lumiblock       <int>         Luminosity block (if specified, only Lvl1 prescales are written)" << lineend;
-  o << "|   --restrictToFolders <string>    Komma-separated list of folders, if specified, only those folders are written" << lineend;
-  o << "| From xml" << lineend;
-  o << "|   --lvl1config      <string>      xml file containing the LVL1 configuration (including prescales)" << lineend;
-  o << "|   --hltmenu         <string>      xml file containing the HLT menu (including prescales)" << lineend;
-  o << "|   --run             <int>         Run number" << lineend;
-  o << "|   --infiov                        can be used if you don't have a runnumber" << lineend;
-  o << "| " << lineend;
-  o << "| Read from COOL" << lineend;      
-  o << "| --------------" << lineend;      
-  o << "|   --cooldb          <string>    * COOL DB, format: 'oracle://<server>;schema=<schema>;dbname=<DBNAME>;user=<user>;password=<pw>'" << lineend;
-  o << "|                                   e.g.: COOLONL_TRIGGER/COMP200" << lineend;
-  o << "|                                   test value: " << test_cool_connection << lineend;
-  o << "|   --run             <int>       * Run number" << lineend;
-  o << "|   --xml             <string>    * Write xml file" << lineend;
-  o << "| " << lineend;                    
-  o << "| ================================================================================" << lineend;
-}
-
-class JobConfig {
-public:
-  enum ETriggerLevel { NONE = 0, LVL1 = 1, HLT = 2, BOTH = 3 };
-
-  JobConfig() :
-    m_test(false),
-    m_coolConnection(""),
-    m_triggerDBConnection(""),
-    m_useFrontier(false),
-    m_triggerRunRanges(), // to superseed run number
-    m_triggerLumiblock(0),
-    m_triggerConfigKey(-1),
-    m_triggerHltPsConfigKey(-1),
-    m_triggerLvl1PsConfigKey(-1),
-    m_triggerLvl1BgKey(1),
-    m_triggerLevel(NONE),
-    m_triggerLVL1XML(""),
-    m_triggerHltMenuXML(""),
-    m_logfileName(""),
-    m_infIOV(false),
-    m_writeXML(""),
-    m_newSchemaVersion(0),
-    m_exclusiveFolders()
-  {}
-
-  ~JobConfig(){}
-
-  bool CreateDBSchema() { return m_environment.find("create") != std::string::npos; }
-  bool DropDBSchema() { return m_environment.find("drop") != std::string::npos; }
-  bool PrintDBSchema() { return m_environment.find("printschema") != std::string::npos; }
-  bool PrintSchemaVersion() { return m_environment.find("schemaversion") != std::string::npos; }
-  bool WriteConfiguration() { return m_environment.find("write") != std::string::npos; }
-  bool ReadConfiguration() { return m_environment.find("read") != std::string::npos; }
-  void AddEnvironment(const std::string & e) { 
-    if(m_environment.size()>0) m_environment.append(" ");
-    m_environment.append(e);
-  }
-
-  ETriggerLevel WriteLevel() { 
-    if(m_environment.find("writel1") != std::string::npos) return LVL1;
-    if(m_environment.find("writehlt") != std::string::npos) return HLT;
-    if(m_environment.find("write") != std::string::npos) return BOTH;
-    return NONE;
-  }
-  bool UseTestDefaults() const { return m_test; }
-  void SetUseTestDefaults(bool x=true) { m_test = x; }
-
-  bool UseInfIOV() const { return m_infIOV; }
-  void SetUseInfIOV(bool x=true) { m_infIOV = x; }
-
-  void SetCoolConnection(const std::string & x) { m_coolConnection = x; }
-  std::string CoolConnection() const {
-    if(UseTestDefaults()) return test_cool_connection;
-    return m_coolConnection;
-  }
-
-  void SetTriggerDbConnection(const std::string & x) { m_triggerDBConnection = x; }
-  std::string TriggerDbConnection() const {
-     return m_triggerDBConnection;
-  }
-
-  void SetUseFrontier(bool useFrontier = true) { m_useFrontier = useFrontier; } 
-  bool UseFrontier() const { 
-    return m_useFrontier; 
-  } 
-
-  void SetTriggerRunRanges(const std::string & runs) {
-    std::vector<std::string> runRangeList = splitpath(runs, ",");
-    for (const std::string& rr : runRangeList) {
-      std::vector<std::string> startend = splitpath(rr, "-");
-      unsigned int first = (unsigned int)convertStringToInt(startend[0]);
-      unsigned int last  = (unsigned int)startend.size()==1?first:convertStringToInt(startend[1]);
-      m_triggerRunRanges.push_back(std::pair<unsigned int,unsigned int>(first,last));
-    }
-  }
-  const std::vector<std::pair<unsigned int,unsigned int> >& RunRanges() const { return m_triggerRunRanges; }
-
-  void SetTriggerLumiblockNumber(int x) { m_triggerLumiblock = x; }
-  int LumiblockNumber() const {
-    if(UseTestDefaults() && m_triggerLumiblock==-1) return 0;
-    return m_triggerLumiblock;
-  }
-
-  void SetTriggerConfigKey(int x) { m_triggerConfigKey = x; }
-  int ConfigKey() const {
-    if(UseTestDefaults() && m_triggerConfigKey==-1) return 1;
-    return m_triggerConfigKey;
-  }
-
-  void SetTriggerHltPsConfigKey(int x) { m_triggerHltPsConfigKey = x; }
-  int HltPsConfigKey() const {
-    if(UseTestDefaults() && m_triggerHltPsConfigKey==-1) return 1;
-    return m_triggerHltPsConfigKey;
-  }
-
-  void SetTriggerLvl1PsConfigKey(int x) { m_triggerLvl1PsConfigKey = x; }
-  int Lvl1PsConfigKey() const {
-    if(UseTestDefaults() && m_triggerLvl1PsConfigKey==-1) return 1;
-    return m_triggerLvl1PsConfigKey;
-  }
-
-  void SetTriggerLvl1BunchGroupKey(int x) { m_triggerLvl1BgKey = x; }
-  int BunchGroupKey() const {
-    return m_triggerLvl1BgKey;
-  }
-  
-
-  void SetTriggerLevel(enum ETriggerLevel x) { m_triggerLevel = x; }
-  enum ETriggerLevel TriggerLevel() const {
-    if(UseTestDefaults()) return HLT;
-    return m_triggerLevel;
-  }
-
-  bool UseXML() { return (HltMenuXML() != "") || (LVL1XML() != ""); }
-  void SetTriggerHltMenuXML(const std::string & x) { m_triggerHltMenuXML = x; }
-  const std::string & HltMenuXML() const { return m_triggerHltMenuXML; }
-
-  void SetTriggerLVL1XML(const std::string & x) { m_triggerLVL1XML = x; }
-  const std::string & LVL1XML() const { return m_triggerLVL1XML; }
-
-  void SetLogfileName(const std::string & fn) { m_logfileName = fn; }
-  const std::string & LogfileName() const { return m_logfileName; }
-
-  void SetNewSchemaVersion(int sv) { m_newSchemaVersion = sv; }
-  int NewSchemaVersion() const { return m_newSchemaVersion; }
-
-  void SetWriteXML(const std::string& s) { m_writeXML = s; }
-  const std::string& WriteXML() const { return m_writeXML; }
-
-  void AddWriteFolder(const std::string& s) { m_exclusiveFolders.push_back(s); }
-	const std::vector<std::string>& ListOfWriteFolders() const { return m_exclusiveFolders; }
-	
-  void CheckForCompleteSetup();
-
-  //void PrintCompleteSetup(MsgStream & log);
-  void PrintCompleteSetup(std::ostream & log, std::ostream& (*lineend) ( std::ostream& os ));
-
- private:
-  bool               m_test;
-
-  std::string        m_environment;
-  std::string        m_coolConnection;
-  std::string        m_triggerDBConnection;  
-  bool               m_useFrontier;
-  std::vector<std::pair<unsigned int,unsigned int> > m_triggerRunRanges;
-  int                m_triggerLumiblock; 
-  int                m_triggerConfigKey; 
-  int                m_triggerHltPsConfigKey;
-  int                m_triggerLvl1PsConfigKey;
-  unsigned int       m_triggerLvl1BgKey;
-  enum ETriggerLevel m_triggerLevel;  
-  std::string        m_triggerLVL1XML;
-  std::string        m_triggerHltMenuXML;
-  std::string        m_logfileName;
-  bool               m_infIOV;
-  std::string        m_writeXML;
-  int                m_newSchemaVersion;
-  std::vector<std::string> m_exclusiveFolders;
-
-} gConfig;
-
-
-void JobConfig::CheckForCompleteSetup() {
-  // check if a complete setup has been specified and that the options
-  // are consistent 
-
-  // environment parameter
-  if(!CreateDBSchema() && !WriteConfiguration() && !ReadConfiguration() && !PrintDBSchema() && !PrintSchemaVersion() && !DropDBSchema()) {
-    throw TrigConfError(std::string("Incomplete setup, no running environment specified"), 2); // incomplete setup: code 2
-  }  
-
-  if( CoolConnection() == "" ) {
-    throw TrigConfError(std::string("No COOL DB connection string specified, use option '--cooldb'"), 2); // incomplete setup: code 2
-  }  
-
-  if(WriteConfiguration()) {
-    if(UseXML()) {
-      // XML -> COOL
-      if( RunRanges().size()==0 && !UseInfIOV() && CoolConnection() != "none" )
-        throw TrigConfError(std::string("No RunNumber specified, use option '--run'"), 2); // incomplete setup: code 2
-      if( (HltMenuXML()=="") || (LVL1XML()=="") )
-        throw TrigConfError(std::string("Both, LVL1 and HLT xml need to be specified"), 2); // incomplete setup: code 2
-    } else {
-      // DB -> COOL
-      if( TriggerDbConnection()=="" )
-        throw TrigConfError(std::string("No TriggerDB connection string specified, use option '--trigdb'"), 2); // incomplete setup: code 2
-
-      if( ConfigKey()<0 )
-        throw TrigConfError(std::string("No config key specified, use option '--configkey'"), 2); // incomplete setup: code 2
-      if( HltPsConfigKey()<0 ) // if it is equal 0 then HLT menu will not be written
-        throw TrigConfError(std::string("No HLT prescale configuration key specified, use option '--prescalekeyhlt'"), 2); // incomplete setup: code 2
-      if(m_environment!="writehlt") {
-        if( Lvl1PsConfigKey()<0 ) // if it is equal 0 then L1 prescales (nor keys) will be written
-          throw TrigConfError(std::string("No LVL1 prescale configuration key specified, use option '--prescalekeylvl1'"), 2); // incomplete setup: code 2
-      }
-
-    }
-  }
-  if(ReadConfiguration()) {
-    // if we read the configuration from the database
-    if( RunRanges().size()==0)
-      throw TrigConfError(std::string("No RunNumber specified, use option '--run'"), 2); // incomplete setup: code 2
-  }
-
-}
-
-
-//void JobConfig::PrintCompleteSetup(MsgStream & log) {
-void JobConfig::PrintCompleteSetup(std::ostream & log, std::ostream& (*lineend) ( std::ostream& os ) ) {
-  // check if a complete setup has been specified and that the options
-  // are consistent 
-  log << "========================================" << lineend;
-  log << "JOB SETUP:" << lineend
-      << "----------" << lineend;	
-
-  if(CreateDBSchema()) {
-    log << "Will create schema!" << lineend;
-    log << "COOL connection: " << CoolConnection() << lineend;
-    log << "Version (0-default): " << NewSchemaVersion() << lineend;
-  }  
-
-  if(PrintDBSchema()) {
-    log << "Will print schema!" << lineend;
-    log << "COOL connection: " << CoolConnection() << lineend;
-  }  
-
-  if(PrintSchemaVersion()) {
-    log << "Will print schema version!" << lineend;
-    log << "COOL connection: " << CoolConnection() << lineend;
-  }  
-
-  if( WriteConfiguration() ) {
-    log << "Will write configuration from " << (UseXML()?"XML":"the TriggerDB") << " to COOL!" << lineend;
-    log << "COOL connection     : " << CoolConnection() << lineend;
-    log << "Write level         : " << WriteLevel() << lineend;
-    if(UseXML()) {
-      if(UseInfIOV()) {
-        log << "Run number        : infinity" << lineend;
-      } else {
-        log << "Run numbers         : ";
-        std::vector<std::pair<unsigned int,unsigned int> >::const_iterator rrIt = RunRanges().begin();
-        std::vector<std::pair<unsigned int,unsigned int> >::const_iterator rrItEnd = RunRanges().end();
-        for(;rrIt!=rrItEnd; ++rrIt) {
-          if(rrIt != RunRanges().begin()) log << ", ";
-          int first = (*rrIt).first;
-          int last = (*rrIt).second;
-          if(first==last) {
-            log << first;
-          } else {
-            log << first << "-" << last;
-          }
-        }
-        log << lineend;
-      }
-      log << "LVL1 configuration: " << LVL1XML() << lineend;      
-      log << "HLT configuration : " << HltMenuXML() << lineend;      
-    } else {
-      log << "TriggerDB connection: " << TriggerDbConnection() << lineend;
-      log << "   configuration key: " << ConfigKey() << lineend;
-      log << "   HLT prescale key : " << HltPsConfigKey() << lineend;
-      log << "   Lvl1 prescale key: " << Lvl1PsConfigKey() << lineend;
-      log << "   Bunchgroup key   : " << BunchGroupKey() << lineend;
-      log << "Run numbers       : ";
-      std::vector<std::pair<unsigned int,unsigned int> >::const_iterator rrIt = RunRanges().begin();
-      std::vector<std::pair<unsigned int,unsigned int> >::const_iterator rrItEnd = RunRanges().end();
-      for(;rrIt!=rrItEnd; ++rrIt) {
-        if(rrIt != RunRanges().begin()) log << ", ";
-        int first = (*rrIt).first;
-        int last = (*rrIt).second;
-        if(first==last) {
-          log << first;
-        } else {
-          log << first << "-" << last;
-        }
-      }
-      log << lineend;
-      log << "Lumiblock number    : " << LumiblockNumber() << lineend;
-    } 
-		if(ListOfWriteFolders().size()>0) {
-      log << "Writing will be restricted to the following folders:" << lineend;
-      for (const std::string& wf : ListOfWriteFolders()) {
-        log << "  " << wf << lineend;
-      }
-		}
-  }
-
-  if( ReadConfiguration() ) {
-    log << "Will read configuration from COOL!" << lineend;
-    log << "Run number          : " << RunRanges()[0].first << lineend;
-    log << "Lumiblock number    : " << LumiblockNumber() << lineend;
-    log << "Writing of XML file : " << WriteXML() << lineend;
-  }  
-  log << "========================================" << lineend;
-
-}
-
-
-
-
-// --------------------------------------------------------------------------------
-// parseProgramOptions
-// --------------------------------------------------------------------------------
-void parseProgramOptions(int argc, char* argv[]) {
-
-  // building the option map
-  std::string currentPar("");
-	std::string listofUnknownParameters = "";
-
-  for(int i=1; i<argc; i++) {
-    std::string currInput(argv[i]);
-    int fchar = currInput.find_first_not_of('-');
-    std::string stripped = currInput.substr(fchar);
-    bool isParam = (fchar!=0); // string starts with a '-', so it is a parameter name
-
-    if(isParam) { 
-      if(stripped=="e" || stripped=="env" ) { currentPar = "environment"; continue; }
-      if(stripped=="cooldb" )               { currentPar = "cooldb"; continue; }
-      if(stripped=="trigdb" )               { currentPar = "trigdb"; continue; }
-      if(stripped=="run" )                  { currentPar = "runnumber"; continue; }
-      if(stripped=="lumiblock" )            { currentPar = "lumiblock"; continue; }
-      if(stripped=="configkey" )            { currentPar = "configkey"; continue; }
-      if(stripped=="prescalekeyhlt" )       { currentPar = "hltpskey"; continue; }
-      if(stripped=="prescalekeylvl1" )      { currentPar = "lvl1pskey"; continue; }
-      if(stripped=="level" )                { currentPar = "triggerlevel"; continue; }
-      if(stripped=="log" )                  { currentPar = "logfile"; continue; }
-      if(stripped=="hltmenu" )              { currentPar = "hltmenu"; continue; }
-      if(stripped=="lvl1config" )           { currentPar = "lvl1config"; continue; }
-      if(stripped=="bgkey" )                { currentPar = "bgkey"; continue; }
-      if(stripped=="infiov" )               { currentPar = ""; gConfig.SetUseInfIOV(); continue; }
-      if(stripped=="test" )                 { currentPar = ""; gConfig.SetUseTestDefaults(); continue; }
-      if(stripped=="usefrontier" )          { currentPar = ""; gConfig.SetUseFrontier(); continue; } 
-      if(stripped=="schemaversion" )        { currentPar = "schemaversion"; continue; }
-      if(stripped=="xml" )                  { currentPar = "writexml"; continue; }
-      if(stripped=="restrictToFolders" )    { currentPar = "restrictToFolders"; continue; }
-
-      listofUnknownParameters += " " + stripped;
-
-    } else { // string starts with a character other than '-', so it is a parameter value
-
-      if(currentPar == "environment")  { gConfig.AddEnvironment(stripped); continue; }
-      if(currentPar == "cooldb")       { gConfig.SetCoolConnection(stripped); continue; }
-      if(currentPar == "trigdb")       { gConfig.SetTriggerDbConnection(stripped); continue; }
-      if(currentPar == "runnumber")    { gConfig.SetTriggerRunRanges(stripped); continue; }
-      if(currentPar == "lumiblock")    { gConfig.SetTriggerLumiblockNumber(convertStringToInt(stripped)); continue; }
-      if(currentPar == "configkey")    { gConfig.SetTriggerConfigKey(convertStringToInt(stripped)); continue; }
-      if(currentPar == "hltpskey")     { gConfig.SetTriggerHltPsConfigKey(convertStringToInt(stripped)); continue; }
-      if(currentPar == "lvl1pskey")    { gConfig.SetTriggerLvl1PsConfigKey(convertStringToInt(stripped)); continue; }
-      if(currentPar == "bgkey")        { gConfig.SetTriggerLvl1BunchGroupKey(convertStringToInt(stripped)); continue; }
-      if(currentPar == "triggerlevel") { gConfig.SetTriggerLevel(stripped=="lvl1"?JobConfig::LVL1:JobConfig::HLT); continue; }
-      if(currentPar == "logfile")      { gConfig.SetLogfileName(stripped); continue; }
-      if(currentPar == "hltmenu")      { gConfig.SetTriggerHltMenuXML(stripped); continue; }
-      if(currentPar == "lvl1config")   { gConfig.SetTriggerLVL1XML(stripped); continue; }
-      if(currentPar == "schemaversion"){ gConfig.SetNewSchemaVersion(convertStringToInt(stripped)); continue; }
-      if(currentPar == "writexml")     { gConfig.SetWriteXML(stripped); continue; }
-      if(currentPar == "restrictToFolders") { gConfig.AddWriteFolder(stripped); continue; }
-    }
-  }
-
-  if(listofUnknownParameters!="")
-      throw TrigConfError(std::string("Unknown parameter: ")+listofUnknownParameters, 1); // throw error of unknown parameter: code 1
-
-}
-
-
-
-
-int main( int argc, char* argv[] ) {
-  
-   //  MSG::NIL = 0,
-   //  MSG::VERBOSE,
-   //  MSG::DEBUG,
-   //  MSG::INFO,
-   //  MSG::WARNING,
-   //  MSG::ERROR,
-   //  MSG::FATAL,
-   //  MSG::ALWAYS,
-   //  MSG::NUM_LEVELS
-
-   //  MsgStream log(0,"TrigConf2COOL"); log.report(int(MSG::INFO));// log.format("% F%48W%S%7W%R%T %0W%M")
-
-   // ========================================
-   // Getting the program parameters
-   // ========================================
-   std::ofstream *outf(0), *errf(0);
-   try {
-      parseProgramOptions(argc, argv);
-   }
-   catch(TrigConfError & e) {
-      if(gConfig.LogfileName() != "") {
-         std::string outfn = gConfig.LogfileName()+".out";
-         std::string errfn = gConfig.LogfileName()+".err";
-         outf = new std::ofstream(outfn.c_str());
-         errf = new std::ofstream(errfn.c_str());
-      }
-      //std::ostream & log = (outf==0?std::cout:*outf);
-      std::ostream & logerr = (outf==0?std::cerr:*errf);
-      logerr << std::endl << "===> Error in the option parsing: " << e.what << std::endl << std::endl;
-      printhelp(logerr, std::endl);
-      if(outf) outf->close();
-      if(errf) errf->close();
-      return e.code;
-   }
-
-   if(gConfig.LogfileName() != "") {
-      std::string outfn = gConfig.LogfileName()+".out";
-      std::string errfn = gConfig.LogfileName()+".err";
-      outf = new std::ofstream(outfn.c_str());
-      errf = new std::ofstream(errfn.c_str());
-   }
-   std::ostream & log = (outf==0?std::cout:*outf);
-   std::ostream & logerr = (outf==0?std::cerr:*errf);
-  
-   std::ostream& (*lineend) ( std::ostream& os ) = &std::endl;
-   //std::ostream& endl ( std::ostream& os ); 
-
-
-   try {
-      gConfig.CheckForCompleteSetup();
-   }
-   catch(TrigConfError & e) {
-      logerr << lineend << "===> Error in the option specification: " << e.what << lineend << lineend;
-      printhelp(log, lineend);
-      if(outf) outf->close();
-      if(errf) errf->close();
-      return e.code;
-   }
-  
-   gConfig.PrintCompleteSetup(log, lineend);
-  
-   // ========================================
-   // DROPPING a schema from the COOL db (DO NOT USE ON THE ONLINE COOL DATABASE !!!!!)
-   // ========================================
-//    if(gConfig.DropDBSchema()) {
-//       try {
-//          if( gConfig.CoolConnection().find("atonr") == std::string::npos &&
-//              gConfig.CoolConnection().find("ATONR") == std::string::npos ) {
-//             TrigConf::TrigConfCoolWriter coolWriter(gConfig.CoolConnection());
-//             coolWriter.recreateSchema();
-//          }
-//       }
-//       catch(std::exception & e) {
-//          log << e.what() << lineend;
-//          if(outf) outf->close();
-//          if(errf) errf->close();
-//          return 1;
-//       }
-//    }
-
-   // ========================================
-   // CREATING a new schema on the COOL db
-   // ========================================
-   if(gConfig.CreateDBSchema()) {
-      try {
-         TrigConf::TrigConfCoolWriter coolWriter(gConfig.CoolConnection());
-         coolWriter.createSchema(gConfig.NewSchemaVersion());
-      }
-      catch(std::exception & e) {
-         log << e.what() << lineend;
-         if(outf) outf->close();
-         if(errf) errf->close();
-         return 1;
-      }
-   }
-  
-   // ========================================
-   // PRINT the schema in the COOL db
-   // ========================================
-   if(gConfig.PrintDBSchema()) {
-      try {      
-         TrigConf::TrigConfCoolWriter coolWriter(gConfig.CoolConnection());
-         coolWriter.printSchema(log);
-      }
-      catch(std::exception & e) {
-         log << e.what() << lineend;
-         if(outf) outf->close();
-         if(errf) errf->close();
-         return 1;
-      }
-   }
-
-   // ========================================
-   // PRINT the schema version of the COOL db
-   // ========================================
-   if(gConfig.PrintSchemaVersion()) {
-      try {      
-         TrigConf::TrigConfCoolWriter coolWriter(gConfig.CoolConnection());
-         coolWriter.printSchemaVersion(log);
-      }
-      catch(std::exception & e) {
-         log << e.what() << lineend;
-         if(outf) outf->close();
-         if(errf) errf->close();
-         return 1;
-      }
-   }
-
-
-
-
-   // ========================================
-   //
-   // DB,XML -> COOL 
-   //
-   // WRITING information into the COOL db
-   // ========================================
-   if(gConfig.WriteConfiguration()) {
-      if(!gConfig.UseXML()) {
-         //
-         // DB -> COOL
-         //
-         std::vector<std::pair<unsigned int,unsigned int> > infinity; infinity.push_back(std::pair<unsigned int,unsigned int>(0x80000000,0x80000000));
-         
-         // setup the connection to the TriggerDB
-         unsigned int masterConfigKey = (unsigned int)gConfig.ConfigKey();       // the configuration key for the HLT menu
-         unsigned int lvlPrescaleKey  = (unsigned int)gConfig.Lvl1PsConfigKey(); // the configuration key for the LVL1 prescales
-         unsigned int hltPrescaleKey  = (unsigned int)gConfig.HltPsConfigKey();  // the configuration key for the HLT prescales
-         unsigned int bgKey           = (unsigned int)gConfig.BunchGroupKey();  // the configuration key for the HLT prescales
-         const std::vector<std::pair<unsigned int,unsigned int> >& runRanges = gConfig.UseInfIOV()?infinity:gConfig.RunRanges();  // the run range list
-         unsigned int lumiblockNumber = (unsigned int)gConfig.LumiblockNumber(); // the lumiblock number
-         std::string  configSource = gConfig.TriggerDbConnection();
-
-         std::vector<std::string> csv = TrigConf::split(configSource, ";");
-         std::string user = "";
-         std::string passwd = "";
-         for (const std::string& s : csv) {
-            if( s.compare(0, 4, "user")==0 ) user=TrigConf::split(s, "=")[1];
-            if( s.compare(0, 6, "passwd")==0 ) passwd=TrigConf::split(s, "=")[1];
-         }
-      
-         try {
-            std::unique_ptr< TrigConf::IStorageMgr > sm = 
-               std::unique_ptr< TrigConf::IStorageMgr >(new TrigConf::StorageMgr(csv[0],user,passwd,log));
-
-            // setup the coolWriter
-            TrigConf::TrigConfCoolWriter coolWriter(gConfig.CoolConnection(),log);
-            for (const std::string& wf : gConfig.ListOfWriteFolders()) {
-               coolWriter.addWriteFolder(wf);
-            }
-											
-            if( lumiblockNumber == 0 ) { // write runwise configuration information
-
-               TrigConf::ThresholdConfig thrcfg;
-               TrigConf::PrescaleSet lvl1ps;
-               TrigConf::CTPConfig ctpc;
-               TrigConf::CaloInfo ci;
-
-               log << lineend
-                   << "Loading information from Trigger DB" << lineend
-                   << "===================================" << lineend
-                   << lineend;
-
-               //get the LVL1 trigger information
-               //log << "Retrieving Lvl1 threshold configuration" << lineend;
-               //thrcfg.setSuperMasterTableId(masterConfigKey);
-               //sm->masterTableLoader().load(thrcfg);
-               //thrcfg.print();
-      
-               if(gConfig.WriteLevel() & JobConfig::LVL1) {
-                  log << "Retrieving Lvl1 CTP configuration" << lineend;
-                  log << "NB: BG set is hardcoded to 1 so better make sure its in the DB!" << lineend;
-                  ctpc.setSuperMasterTableId(masterConfigKey);
-                  ctpc.setPrescaleSetId(lvlPrescaleKey);
-                  ctpc.setBunchGroupSetId(bgKey);
-                  sm->masterTableLoader().load(ctpc);
-               }
-
-               // get the HLT trigger information
-               TrigConf::HLTFrame hltFrame;
-               if(hltPrescaleKey>0) {
-                  log << "Retrieving HLT menu configuration ("<<masterConfigKey<<") and prescale set ("<<hltPrescaleKey<<")" << lineend;
-                  hltFrame.setSMK(masterConfigKey);
-                  hltFrame.thePrescaleSetCollection().set_prescale_key_to_load(hltPrescaleKey);
-                  sm->hltFrameLoader().load( hltFrame );
-                  //hltFrame.print();
-               }
-
-               log << lineend
-                   << "Writing information to COOL" << lineend
-                   << "===========================" << lineend
-                   << lineend;
-
-               if(hltPrescaleKey>0) {
-                  coolWriter.writeRunPayload(runRanges,
-                                             masterConfigKey,
-                                             hltPrescaleKey,
-                                             thrcfg,
-                                             ctpc,
-                                             ci,
-                                             hltFrame,
-                                             configSource);
-
-                  //                   TrigConf::HLTPrescaleSet *hltpss = hltFrame.chains().extractPrescaleSet();
-                  //                   coolWriter.writeHltPrescalePayload( runRanges, *hltpss);
-                  //                   delete hltpss;
-               } else {
-                  coolWriter.writeL1MenuPayload(runRanges,ctpc.menu());
-               }
-
-               
-//                if(gConfig.WriteLevel() & JobConfig::LVL1) {
-//                  if(lvlPrescaleKey>0) {
-//                    coolWriter.writeL1PrescalePayload(runRanges,
-//                                                      lvlPrescaleKey,
-//                                                      lvl1ps);
-//                  }
-//                }
-
-
-            } else { // write lumiblock-wise information (prescales only)
-
-               log << lineend
-                   << "Loading information from TriggerDB" << lineend
-                   << "==================================" << lineend
-                   << lineend;
-
-               TrigConf::PrescaleSet lvl1ps;
-               if(gConfig.WriteLevel() & JobConfig::LVL1) {
-                 log << "Retrieving Lvl1 prescale set from the TriggerDB" << lineend;
-                 lvl1ps.setId(lvlPrescaleKey);
-                 sm->prescaleSetLoader().load(lvl1ps);
-                 lvl1ps.print();
-               }
-
-               unique_ptr<TrigConf::HLTPrescaleSet> hltpss;
-               if(gConfig.WriteLevel() & JobConfig::HLT) {
-                 if(hltPrescaleKey>0) {
-                   log << "Retrieving HLT menu configuration ("<<masterConfigKey<<") and prescale set ("<<hltPrescaleKey<<")" << lineend;
-                   TrigConf::HLTFrame hltFrame;
-                   hltFrame.setSMK(masterConfigKey);
-                   hltFrame.thePrescaleSetCollection().set_prescale_key_to_load(hltPrescaleKey);
-                   sm->hltFrameLoader().load( hltFrame );
-                   hltpss = unique_ptr<TrigConf::HLTPrescaleSet>(hltFrame.getHLTChainList().extractPrescaleSet());
-                   cout << endl << *hltpss << endl;
-                 }
-               }
-
-               unsigned int runNumber = runRanges[0].first; // need to think about this
-               
-               log << lineend
-                   << "Writing information to COOL" << lineend
-                   << "===========================" << lineend
-                   << lineend;
-               
-               // write the payload
-               if(gConfig.WriteLevel() & JobConfig::LVL1) {
-                 coolWriter.writeL1PrescalePayload(runNumber,
-                                                   lumiblockNumber,
-                                                   lvlPrescaleKey,
-                                                   lvl1ps);
-               }
-               if(gConfig.WriteLevel() & JobConfig::HLT) {
-                 if(hltPrescaleKey>0) {
-                   coolWriter.writeHltPrescalePayload( runNumber,
-                                                       lumiblockNumber,
-                                                       *hltpss.get());
-                 }
-               }
-            }
-         }
-         catch(TrigConfError & e) {
-            log << e.what << lineend;
-            printhelp(log, lineend);
-            if(outf) outf->close();
-            if(errf) errf->close();
-            return e.code;
-         }
-         catch(std::exception & e) {
-            log << "Caught std::exception: " << e.what() << lineend;
-            if(outf) outf->close();
-            if(errf) errf->close();
-            return 1;
-         }
-      } else {
-
-         //
-         // XML -> COOL
-         //
-         if(gConfig.CoolConnection()!="none") {
-            
-            try {
-
-               std::vector<std::pair<unsigned int,unsigned int> > infinity; infinity.push_back(std::pair<unsigned int,unsigned int>(0x80000000,0x80000000));
-
-               const std::vector<std::pair<unsigned int,unsigned int> >& runRanges = gConfig.UseInfIOV()?infinity:gConfig.RunRanges(); // the run range list
-
-               //unsigned int lumiblockNumber = 0;                                       // the lumiblock number (in MC the LB is 0)
-               std::string  lvl1ConfigXml   = xmlpathresolve(gConfig.LVL1XML()); // the LVL1 configuration xml file
-               std::string  hltMenuXml      = xmlpathresolve(gConfig.HltMenuXML()); // the HLT menu xml file
-               std::string  configSource    = gConfig.LVL1XML() + " and " + gConfig.HltMenuXML();
-
-               if( lvl1ConfigXml == "" ) throw TrigConfError("ERROR: LVL1 menu file " + gConfig.LVL1XML() + " not found",10);
-               if( hltMenuXml == "" ) throw TrigConfError("ERROR: HLT menu file " + gConfig.HltMenuXML() + " not found",10);
-
-               // dummy values that don't make sense when reading from xml
-               unsigned int masterConfigKey = 0;       // the configuration key for the HLT menu
-               unsigned int lvlPrescaleKey  = 0; // the configuration key for the LVL1 prescales
-               unsigned int hltPrescaleKey  = 0;  // the configuration key for the HLT prescales
-
-               std::unique_ptr< TrigConf::IStorageMgr > sm = 
-                  std::unique_ptr< TrigConf::IStorageMgr >(new TrigConf::XMLStorageMgr( {lvl1ConfigXml, hltMenuXml} ));
-        
-               // setup the coolWriter
-               TrigConf::TrigConfCoolWriter * coolWriter = new TrigConf::TrigConfCoolWriter(gConfig.CoolConnection(),log);
-
-               TrigConf::ThresholdConfig thrcfg;
-
-               TrigConf::CaloInfo ci;
-               log << "Retrieving CaloInfo configuration from " << lvl1ConfigXml << lineend;
-               sm->caloInfoLoader().load(ci);
-      
-               TrigConf::CTPConfig ctpc;
-               log << "Retrieving Lvl1 CTP configuration from " << lvl1ConfigXml << lineend;
-               sm->masterTableLoader().load(ctpc);
-               ctpc.menu().setCaloInfo(ci);
-               ci.print();
-               //ctpc.print();
-
-               // get the HLT trigger information
-               log << "Retrieving HLT menu configuration and prescale set from " << hltMenuXml << lineend;
-               TrigConf::HLTFrame hltFrame;
-               sm->hltFrameLoader().load( hltFrame );
-               //hltFrame.print();
-
-               // write the payload
-               coolWriter->writeRunPayload(runRanges,
-                                           masterConfigKey,
-                                           hltPrescaleKey,
-                                           thrcfg,
-                                           ctpc,
-                                           ci,
-                                           hltFrame,
-                                           configSource);
-
-               unique_ptr<TrigConf::HLTPrescaleSet> hltpss(hltFrame.getHLTChainList().extractPrescaleSet());
-               coolWriter->writeHltPrescalePayload( runRanges, *hltpss.get());
-               
-               log << "Retrieving Lvl1 prescale set from " << lvl1ConfigXml << lineend;
-               TrigConf::PrescaleSet lvl1ps;
-               lvl1ps.setId(lvlPrescaleKey);
-               sm->prescaleSetLoader().load(lvl1ps);
-               //lvl1ps.print();
-               
-               // write the payload
-//                if(runRanges.size()==1 && runRanges[0].first==runRanges[0].second) {
-//                   coolWriter->writeL1PrescalePayload(runRanges[0].first,
-//                                                      lumiblockNumber,
-//                                                      lvlPrescaleKey,
-//                                                      lvl1ps);
-//                } else {
-                  coolWriter->writeL1PrescalePayload(runRanges,
-                                                     lvlPrescaleKey,
-                                                     lvl1ps);
-//                }
-
-            }
-            catch(TrigConfError & e) {
-               log << e.what << lineend;
-               if(e.code<10) printhelp(log, lineend);
-               if(outf) outf->close();
-               if(errf) errf->close();
-               return e.code;
-            }
-            catch(std::exception & e) {
-               log << "Caught std::exception: " << e.what() << lineend;
-               if(outf) outf->close();
-               if(errf) errf->close();
-               return 1;
-            }
-         }
-      }
-      
-
-      if(outf) outf->close();
-      if(errf) errf->close();
-      return 0;
-   }
-
-
-
-
-   // ========================================
-   // READING information from the COOL DB for
-   // a certain run and print
-   // ========================================
-   if(gConfig.ReadConfiguration()) {
-
-      try {
-
-
-         // the run number
-         unsigned int runNumber       = gConfig.RunRanges()[0].first;       
-         unsigned int lumiblockNumber = (unsigned int)gConfig.LumiblockNumber(); // the lumiblock number
-
-         // setup the coolReader
-         TrigConf::TrigConfCoolWriter coolReader(gConfig.CoolConnection());
-         
-         if( lumiblockNumber == 0 ) { // read runwise configuration information
-
-            TrigConf::CTPConfig ctpc;
-
-            // the LVL1 menu information
-            log << "Retrieving Lvl1 menu configuration from cool" << lineend;
-            coolReader.readL1Menu( runNumber, ctpc );
-
-            // read the prescales
-            log << "Retrieving Lvl1 prescale set from cool" << lineend;
-            TrigConf::PrescaleSet * psSet = new TrigConf::PrescaleSet;
-            unsigned int lvl1PrescaleKey(0);
-            coolReader.readL1PrescalePayload(runNumber,lumiblockNumber,lvl1PrescaleKey,*psSet);             
-
-            log << "Retrieving Lvl1 bunchgroups from cool" << lineend;
-            // read the bunchgroups information
-            TrigConf::BunchGroupSet bgs;
-            int bgKey;
-            coolReader.readL1BunchGroupLBPayload( runNumber, lumiblockNumber, bgKey, bgs);
-
-            ctpc.setPrescaleSet(*psSet);
-            ctpc.setBunchGroupSet(bgs);
-            ctpc.setBunchGroupSetId(bgKey);
-            //ctpc.print();
-
-            TrigConf::CaloInfo ci;
-
-
-
-
-            if(gConfig.WriteXML()!="") {
-               std::string l1menuxml = "L1Menu_" + gConfig.WriteXML() + ".xml";
-               std::ofstream xmlfile;
-               xmlfile.open (l1menuxml.c_str());
-               xmlfile << "<?xml version=\"1.0\" ?>" << endl;
-               xmlfile << "<!-- File is auto-generated from the TrigDB -->" << endl;
-               xmlfile << "<LVL1Config name=\"lumi1E31\">" << endl;
-               ctpc.writeXML(xmlfile,1,2);
-               xmlfile << "</LVL1Config>" << endl;
-               xmlfile.close();
-            }
-
-            // the HLT trigger information
-            TrigConf::HLTFrame hltFrame;
-            unsigned int masterConfigKey(0);
-            unsigned int hltPrescaleKey(0);
-            std::string  configSource("");
-
-            log << "Retrieving HLT Menu from cool" << lineend;
-            // read the payload
-            coolReader.readRunPayload(runNumber,
-                                      hltFrame,
-                                      masterConfigKey,
-                                      hltPrescaleKey,
-                                      configSource );
-
-
-            if(coolReader.HLTPrescaleFolderExists()) {
-               TrigConf::HLTPrescaleSet *hltpss = new TrigConf::HLTPrescaleSet();
-               coolReader.readHltPrescalePayload( runNumber, lumiblockNumber, *hltpss);
-               hltFrame.thePrescaleSetCollection().setPrescaleSet(hltpss); // frame takes ownership of hltpss
-            }
-
-            log << "Configuration source:" << lineend;
-            log << "---------------------" << lineend;
-            log << configSource << lineend;
-            log << lineend;
-            log << "Configuration keys:" << lineend;
-            log << "-------------------" << lineend;
-            log << "   Master        : " << masterConfigKey << lineend;
-            log << "   HLT Prescale  : " << hltPrescaleKey << lineend;
-            // hltFrame.print();
-            if(gConfig.WriteXML()!="") {
-               std::string hltmenuxml = "HLTMenu_" + gConfig.WriteXML() + ".xml";
-               std::ofstream xmlfile;
-               xmlfile.open (hltmenuxml.c_str());
-               xmlfile << "<?xml version=\"1.0\" ?>" << endl;
-               xmlfile << "<!-- File is auto-generated from the TrigDB -->" << endl;
-               xmlfile << "<HLT_MENU>" << endl;
-               hltFrame.writeXML(xmlfile);
-               xmlfile << "</HLT_MENU>" << endl;
-               xmlfile.close();
-            }
-
-         }
-      }
-      catch(TrigConfError & e) {
-         log << e.what << lineend;
-         printhelp(log, lineend);
-         if(outf) outf->close();
-         return e.code;
-      }
-      catch(std::exception & e) {
-         log << "Caught std::exception: " << e.what() << lineend;
-         if(outf) outf->close();
-         return 1;
-      }
-      if(outf) outf->close();
-      return 0;
-   }
-
-   if(outf) outf->close();
-   return 0;
-}
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/test/ConsistencyChecker.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/test/ConsistencyChecker.cxx
deleted file mode 100755
index 985e9ae4db3d..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/test/ConsistencyChecker.cxx
+++ /dev/null
@@ -1,646 +0,0 @@
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-/////////////////////////////////////////////////////////////////////
-//                                                     
-//NAME:     TrigConfConsistencyChecker.cxx 
-//PACKAGE:  TrigConfStorage
-//                                                     
-//AUTHORs:  J.Stelzer (CERN)	  Joerg.Stelzer@cern.ch 
-//          T.Bold (CERN)	      Tomasz.Bold@cern.ch 
-//CREATED:  29. July 2007
-//                                                     
-//PURPOSE: 
-//
-// This standalone application is designed to read the trigger
-// configuration (L1+HLT) from various sources and check its consistency.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "../XMLBoostHelper.h"
-
-
-#include <iostream>
-#include <iomanip>
-#include <string>
-#include <memory>
-#include <ctime>
-#include <map>
-#include <sys/stat.h> 
-#include <set>
-
-#include "boost/lexical_cast.hpp"
-#include "boost/regex.hpp"
-
-#include "TrigConfStorage/StorageMgr.h"
-#include "TrigConfStorage/XMLStorageMgr.h"
-#include "TrigConfStorage/TrigConfCoolWriter.h"
-
-#include "TrigConfL1Data/L1DataDef.h"
-
-#include "TrigConfStorage/IStorageMgr.h"
-#include "TrigConfStorage/IHLTFrameLoader.h"
-#include "TrigConfHLTData/HLTFrame.h"
-#include "TrigConfHLTData/HLTChainList.h"
-
-#include "TrigConfStorage/ConfigurationCheck.h"
-
-
-using namespace std;
-using namespace TrigConf;
-using namespace boost::property_tree;
-
-std::string findInPath(const std::string& filename, const std::string & path) {
-   struct stat file_stat;
-   std::string fullname = path + "/" + filename;
-   if (stat (fullname.c_str(), &file_stat) == 0) return fullname;
-   return "";
-}
-
-std::vector<std::string> splitpath(std::string line, std::string del=":")
-{
-  std::vector<std::string> res;
-  std::string::size_type old_pos = 0, pos = line.find(del,0);
-  while( pos != std::string::npos ) {
-    res.push_back(line.substr(old_pos,pos-old_pos));
-    old_pos = pos + del.size();
-    pos = line.find(del, old_pos);
-  }
-  // last entry
-  if (old_pos < line.size())
-    res.push_back(line.substr(old_pos,line.size()-old_pos));
-  return res;
-}
-
-std::string pathresolve(const std::string& filename, const std::string & searchpath) {
-   std::string fullname = findInPath(filename,".");
-   if( fullname != "" ) { return fullname; }
-   std::vector<std::string> listofpaths = splitpath(searchpath);
-   for (const std::string& path : listofpaths) {
-      fullname = findInPath(filename,path);
-      if( fullname != "" ) { return fullname; }      
-   }
-   return "";
-}
-
-std::string xmlpathresolve(const std::string& filename) {
-   // if path starts with '/' then it is absolute
-   if (!filename.empty() && filename[0] == '/') return filename;
-
-   std::string xmlpath = ::getenv("XMLPATH");
-   if(filename.find('/')==std::string::npos) {
-      // if there is no "/" in the filename we try to things
-      std::string fullname = pathresolve(filename, xmlpath);
-      if(fullname == "")
-         fullname = pathresolve("TriggerMenuXML/"+filename, xmlpath);
-      return fullname;
-   } else {
-      return pathresolve(filename, xmlpath);
-   }
-}
-
-
-
-// --------------------------------------------------------------------------------
-// printhelp
-// --------------------------------------------------------------------------------
-void printhelp(std::ostream & o) {
-  o << "================================================================================" << std::endl;
-  o << "| The program needs to be run with the following specifications:" << std::endl;
-  o << "| TrigConf2CoolApp.exe <arguments>" << std::endl << std::endl;
-  o << "| where the arguments are ( * required ):" << std::endl;
-  o << "| ------------------------------------------------------------------------------" << std::endl;
-  o << "| " << std::endl;
-  o << "| " << std::endl;
-  o << "| Input sources [in order of precedence xml, triggerdb, cooldb]" << std::endl;   
-  o << "| -------------------------------------------------------------" << std::endl;   
-  o << "|   --lvl1xml         <string>      LVL1 XML configuration files" << std::endl;
-  o << "|   --hltxml          <string>      HLT XML configuration files" << std::endl;
-  o << "| " << std::endl;                    
-  o << "|   --trigdb          [<string>]    Trigger DB (e.g. TRIGGERDB or 'oracle://ATLR;')" << std::endl;
-  o << "|                                   online TRIGGERDB taken if connection omitted" << std::endl;
-  o << "|   --keys            <int int>     Trigger configuration keys (two arguments smk, hlt-psk)" << std::endl;
-  o << "| " << std::endl;                    
-  o << "|   --cool            [<string>]    read from COOL, format: 'oracle://<server>;schema=<schema>;dbname=<DBNAME>;user=<user>;password=<pw>'" << std::endl;
-  o << "|                                   online COOL taken if connection omitted" << std::endl;
-  o << "|   --run             <int>         Run number" << std::endl;
-  o << "| " << std::endl;                    
-  o << "|   --listtests                     Lists available test" << std::endl; 
-  o << "| " << std::endl;
-  o << "|   --disable         <string>      Disable certain test (this option can be repeated)" << std::endl; 
-  o << "| " << std::endl;
-  o << "|   --verbose         <int>         Verbosity: 0-silent, 1-basic, 2-detailed, 3-debug, 4-printCTP, 5-printHLT" << std::endl; 
-  o << "| " << std::endl;
-  o << "|   --silenceseverity               if set, the severity output is suppressed [only if you want to fool NICOS]" << std::endl; 
-  o << "| " << std::endl;
-  o << "|   --exceptions      <string>      file with exceptions i.e. failed tests which should be ignored. The " << std::endl; 
-  o << "| " << std::endl;
-  o << "|   --help                          this output" << std::endl; 
-  o << "| " << std::endl;
-  o << "================================================================================" << std::endl;
-}
-
-class TrigConfError {
-public:
-   TrigConfError(const std::string& s, uint c) : what(s), code(c) {};
-   ~TrigConfError(){};
-   std::string what;
-   uint code;
-};
-
-
-class JobConfig {
-public:
-   enum ETriggerLevel { LVL1 = 0, HLT = 1, NONE = 2 };
-
-   JobConfig() :
-      m_coolConnection(""),
-      m_triggerDBConnection(""),
-      m_triggerRunNumber(-1),
-      m_triggerConfigKey(),
-      m_triggerLvl1MenuXML(""),
-      m_triggerHltMenuXML(""),
-      m_silenceSeverity(false),
-      m_help(false),
-      m_verbose(0)
-   {}
-
-   ~JobConfig(){}
-
-   bool UseLVL1()      const { return UseLVL1XML() || UseTriggerDB() || UseCOOL(); }
-   bool UseHLT()       const { return UseHLTXML()  || UseTriggerDB() || UseCOOL(); }
-   bool UseLVL1XML()   const { return Lvl1MenuXML() != ""; }
-   bool UseHLTXML()    const { return HltMenuXML() != ""; }
-   bool UseCOOL()      const { return CoolConnection() != "" && RunNumber()>=0; }
-   bool UseTriggerDB() const { return TriggerDbConnection() != "" && ( ConfigKey().size()>0 || UseCOOL()); }
-   std::string LVL1Source() const { 
-      return UseLVL1XML()?Lvl1MenuXML():UseTriggerDB()?TriggerDbConnection():CoolConnection()+", run "+boost::lexical_cast<std::string,int>(RunNumber());
-   }
-   std::string HLTSource()  const {
-      return UseHLTXML()?HltMenuXML():UseTriggerDB()?TriggerDbConnection():CoolConnection()+", run "+boost::lexical_cast<std::string,int>(RunNumber());
-   }
-
-   void SetHelp(bool x=true) { m_help = x; }
-   bool Help() const { return m_help; }
-
-   void SetCoolConnection(const std::string & x) { m_coolConnection = x; }
-   std::string CoolConnection() const { return m_coolConnection; }
-
-   void SetTriggerDbConnection(const std::string & x) { m_triggerDBConnection = x; }
-   std::string TriggerDbConnection() const { return m_triggerDBConnection; }
-
-   void SetTriggerRunNumber(int x) { m_triggerRunNumber = x; }
-   int RunNumber() const { return m_triggerRunNumber; }
-
-   void AddTriggerConfigKey(int x) { m_triggerConfigKey.push_back(x); }
-   const std::vector<int>& ConfigKey() const { return m_triggerConfigKey; }
-
-   void SetHltMenuXML(const std::string & x) { m_triggerHltMenuXML = x; }
-   const std::string & HltMenuXML() const { return m_triggerHltMenuXML; }
-
-   void SetLvl1MenuXML(const std::string & x) { m_triggerLvl1MenuXML = x; }
-   const std::string & Lvl1MenuXML() const { return m_triggerLvl1MenuXML; }
-
-   void DisableTest(const std::string& test) { m_disabledTests.insert(test); }
-   std::set<std::string>& DisabledTests() { return m_disabledTests; }
-
-   void SetSilenceSeverity(bool silence=true) { m_silenceSeverity = silence; }
-   bool SilenceSeverity() { return true; } //m_silenceSeverity; }
-
-   void SetVerbose(unsigned int v = 1) { m_verbose=v; }
-   unsigned int Verbose() { return m_verbose; }
-
-  void SetExceptionsFileName(const std::string& name) { m_exceptionsFileName = name; }
-  const std::string& ExceptionsFileName() const { return m_exceptionsFileName; }
-
-
-   void CheckForCompleteSetup();
-  
-   void PrintCompleteSetup(std::ostream & log);
-
-private:
-   std::string           m_coolConnection;
-   std::string           m_triggerDBConnection;  
-   int                   m_triggerRunNumber; 
-   std::vector<int>      m_triggerConfigKey; 
-   std::string           m_triggerLvl1MenuXML;
-   std::string           m_triggerHltMenuXML;
-   std::set<std::string> m_disabledTests;
-   bool                  m_silenceSeverity;
-   bool                  m_help;
-   unsigned int          m_verbose;
-   std::string           m_exceptionsFileName;
-   
-} gConfig;
-
-
-void JobConfig::CheckForCompleteSetup() {
-  // check if a complete setup has been specified and that the options
-  // are consistent 
-
-  // environment parameter
-  if(!UseHLT() && !UseLVL1())
-    throw TrigConfError(std::string("No checks will be performed since no configuration source was specified"), 2);
-
-  if( UseTriggerDB() && (ConfigKey().size()!=2 || ConfigKey()[0]==0 || ConfigKey()[1]==0) )
-    throw TrigConfError(std::string("Two configuration keys (SMK, HLT PSK) must be specified and not zero"), 2);
-
-}
-
-
-
-template <class T>
-bool from_string(T& t, const std::string& s, std::ios_base& (*f)(std::ios_base&)) {
-  std::istringstream iss(s);
-  return !(iss >> f >> t).fail();
-}
-
-int convertStringToInt(const std::string & s) {
-  int theInt;
-  if(from_string<int>(theInt, s, std::fixed)) return theInt; // std::hex also possible
-  throw TrigConfError(std::string("Could not convert to integer: ")+s, 1);
-}
-
-float convertStringToFloat(const std::string & s) {
-  float theFloat;
-  if(from_string<float>(theFloat, s, std::dec)) return theFloat;
-  throw TrigConfError(std::string("Could not convert to float: ")+s, 1);
-}
-
-
-// --------------------------------------------------------------------------------
-// parseProgramOptions
-// --------------------------------------------------------------------------------
-void parseProgramOptions(int argc, char* argv[]) {
-
-  // building the option map
-  std::string currentPar("");
-  for(int i=1; i<argc; i++) {
-    std::string currInput(argv[i]);
-    int fchar = currInput.find_first_not_of('-');
-    std::string stripped = currInput.substr(fchar);
-    bool isParam = (fchar!=0); // string starts with a '-', so it is a parameter name
-
-    if(isParam) { 
-      if(stripped=="help" )                 { gConfig.SetHelp(); currentPar = ""; continue; }
-      if(stripped=="cool" )                 { currentPar = "cool"; gConfig.SetCoolConnection("COOLONL_TRIGGER/COMP200"); continue; }
-      if(stripped=="trigdb" )               { currentPar = "trigdb"; gConfig.SetTriggerDbConnection("TRIGGERDB"); continue; }
-      if(stripped=="run" )                  { currentPar = "runnumber"; continue; }
-      if(stripped=="keys" )                 { currentPar = "configkey"; continue; }
-      if(stripped=="lvl1xml" )              { currentPar = "lvl1xml"; continue; }
-      if(stripped=="hltxml" )               { currentPar = "hltxml"; continue; }
-      if(stripped=="disable" )              { currentPar = "disable"; continue; }
-      if(stripped=="silenceseverity" )      { gConfig.SetSilenceSeverity(); currentPar = ""; continue; }
-      if(stripped=="verbose" )              { currentPar = "verbose"; continue; }
-      if(stripped=="exceptions" )           { currentPar = "exceptions"; continue; }
-      
-      throw TrigConfError(std::string("Unknown parameter ")+stripped, 1); // throw error of unknown parameter: code 1
-
-    } else { // string starts with a character other than '-', so it is a parameter value
-
-      if(currentPar=="") throw TrigConfError(std::string("No value expected, but found: ")+stripped, 1); // throw error of unknown value: code 1
-
-      if(currentPar == "cool")         { gConfig.SetCoolConnection(stripped); continue; }
-      if(currentPar == "trigdb")       { gConfig.SetTriggerDbConnection(stripped); continue; }
-      if(currentPar == "runnumber")    { gConfig.SetTriggerRunNumber(convertStringToInt(stripped)); continue; }
-      if(currentPar == "configkey")    { gConfig.AddTriggerConfigKey(convertStringToInt(stripped)); continue; }
-      if(currentPar == "lvl1xml")      { gConfig.SetLvl1MenuXML(xmlpathresolve(stripped)); continue; }
-      if(currentPar == "hltxml")       { gConfig.SetHltMenuXML(xmlpathresolve(stripped)); continue; }
-      if(currentPar == "disable")      { gConfig.DisableTest(stripped); continue; }
-      if(currentPar == "verbose")      { gConfig.SetVerbose(convertStringToInt(stripped)); continue; }
-      if(currentPar == "exceptions")   { gConfig.SetExceptionsFileName(xmlpathresolve(stripped)); continue; }
-    }
-  }
-}
-
-
-void JobConfig::PrintCompleteSetup(std::ostream & log) {
-  // check if a complete setup has been specified and that the options
-  // are consistent 
-  std::string prefix("TrigConfConsistencyChecker:       INFO ");
-  log << prefix << "============================================================" << std::endl;
-  if(UseLVL1() && UseHLT()) {
-    log << prefix << "Consistency checks will be performed on LVL 1 and HLT configuration" << std::endl;
-  } else if(UseLVL1()) {
-    log << prefix << "Consistency checks will be performed on LVL 1 only" << std::endl;
-  } else {
-    log << prefix << "Consistency checks will be performed on HLT only" << std::endl;
-  }
-  if(UseLVL1())
-    log << prefix << "LVL 1 source : " << LVL1Source() << std::endl;
-  if(UseHLT())
-    log << prefix << "HLT source   : " << HLTSource() << std::endl;
-  log << prefix << "Exceptions   : " << ExceptionsFileName() << std::endl;
-  log << prefix << "============================================================" << std::endl;
-
-}
-
-
-typedef std::pair<std::string,std::string> Key_t;
-typedef std::map< Key_t, std::vector<std::string> > ExcMap_t;
-typedef std::pair< const Key_t, std::vector<std::string> > ExcMapPair_t;
-
-namespace {
-   void parseExceptionsFile( const std::string& filename, std::map< Key_t, std::vector<std::string> >& exc, std::ostream & log ) {
-
-      log << "TrigConfConsistencyChecker:       INFO Loading exceptions file " << filename << std::endl;
-
-      try {
-         ptree doc;
-         read_xml<ptree>(filename, doc);
-
-         for(const ptree::value_type& v: doc.get_child("exceptions")) {
- 
-            string testname(""), menu("");
-            TrigConf::readAttribute(v.second, "name", testname);
-            TrigConf::readAttribute(v.second, "menu", menu);
-            
-            Key_t key = Key_t(testname,menu);
-            vector<string>& exceptions_v = exc[key];
-            
-            for(ptree::value_type ex: v.second) {
-               if(ex.first=="<xmlattr>") continue;
-               string excCh("");
-               TrigConf::readAttribute(ex.second, "name", excCh);
-               exceptions_v.push_back(excCh);
-            }
-         }
-
-      }
-      catch (const exception& ex) {
-         log << "TrigConfConsistencyChecker:       Exception occured while parsing exceptions xml file: " << ex.what() << endl; 
-         throw;
-      }
-
-      if(gConfig.Verbose()>=1 && gConfig.Verbose()<=3) {
-         for(const ExcMapPair_t& e: exc) {
-            log << "TrigConfConsistencyChecker:       INFO In the test '" << e.first.first << "' for menu '" << e.first.second << "' skipping:\n";
-            for(const string& s: e.second ) {
-               log << "TrigConfConsistencyChecker:                         " << s << endl;
-            }
-         }
-      } else {
-         log << "TrigConfConsistencyChecker:       INFO Found exceptions for tests ";
-         for(ExcMapPair_t e: exc) {
-            log << e.first.first;
-            if(e.first.second.size()!=0) log << "(menu: " << e.first.second << ")";
-            log << ", ";
-         }
-         log << endl;
-      }
-   }
-}
-
-std::vector<string>
-getExceptions(const ExcMap_t& exc, const string& testname, const string& l1menu, const string& hltmenu) {
-   std::vector<string> combined;
-   for(ExcMapPair_t e: exc) {
-      if(e.first.first!=testname) continue;
-      if(e.first.second.size()==0) {
-         copy(e.second.begin(), e.second.end(), inserter(combined, combined.begin()));
-         continue;
-      }
-      if(e.first.second.size()==0) {
-         copy(e.second.begin(), e.second.end(), inserter(combined, combined.begin()));
-         continue;
-      }
-      boost::regex regexp(e.first.second+"$");
-      if(regex_match(l1menu, regexp) || regex_match(hltmenu, regexp)) {
-         copy(e.second.begin(), e.second.end(), inserter(combined, combined.begin()));
-         continue;
-      }
-   }
-   return combined;
-}
-
-
-
-
-
-
-
-
-int main( int argc, char* argv[] ) {
-
-   //  MSG::NIL = 0,
-   //  MSG::VERBOSE,
-   //  MSG::DEBUG,
-   //  MSG::INFO,
-   //  MSG::WARNING,
-   //  MSG::ERROR,
-   //  MSG::FATAL,
-   //  MSG::ALWAYS,
-   //  MSG::NUM_LEVELS
-
-   std::ostream& log( std::cout );
-   for(int i=0; i<argc; i++)
-      log << " " << argv[i];
-   log << std::endl;
-
-   // ========================================
-   // Getting the program parameters
-   // ========================================
-   try {
-      parseProgramOptions(argc, argv);
-      if(gConfig.Help()) {
-         printhelp(std::cout);
-         return 0;
-      }
-      gConfig.CheckForCompleteSetup();
-   }
-   catch(TrigConfError & e) {
-      log << std::endl << "TrigConfConsistencyChecker:       ERROR error in the option specification: " << e.what << std::endl << std::endl;
-      printhelp(log);
-      return e.code;
-   }
-
-
-   gConfig.PrintCompleteSetup(log);
-
-   // ========================================
-   // Reading the LVL1 configuration information 
-   // ========================================
-   TrigConf::CTPConfig* ctpc(0);
-   if(gConfig.UseLVL1()) {
-
-      try {
-      bool newcabling = true;
-      if(newcabling) {
-         TrigConf::L1DataDef::setNewJEP3Cabling();
-         log << "TrigConfConsistencyChecker:       INFO Using new XS cabling (8TE, 8XE, 8XS)" << std::endl;
-      } else {
-         TrigConf::L1DataDef::setOldJEP3Cabling();
-         log << "TrigConfConsistencyChecker:       INFO Using old XS cabling (4TE, 8XE, 0XS)" << std::endl;
-      }
-
-
-      ctpc = new TrigConf::CTPConfig();
-      if(gConfig.UseLVL1XML()) {
-         log << "TrigConfConsistencyChecker:       INFO Loading L1 configuration" << std::endl;        
-
-         try {      
-            std::unique_ptr< TrigConf::IStorageMgr > sm(new TrigConf::XMLStorageMgr( {gConfig.Lvl1MenuXML()} ));
-            sm->masterTableLoader().setVerbose(gConfig.Verbose()<4?gConfig.Verbose():0);
-            sm->masterTableLoader().load(*ctpc);
-         }
-         catch(std::exception & e) {
-            log << e.what() << std::endl;
-            return 1;
-         }
-      } else if(gConfig.UseCOOL()) {
-         try {
-            uint runNumber = (uint)gConfig.RunNumber();
-            log << "TrigConfConsistencyChecker:       INFO Retrieving Lvl1 menu configuration from cool" << std::endl;
-            TrigConf::TrigConfCoolWriter coolReader(gConfig.CoolConnection());
-            coolReader.readL1Menu(runNumber, *ctpc);
-         }
-         catch(std::exception & e) {
-            log << e.what() << std::endl;
-            return 1;
-         }
-      } else if(gConfig.UseTriggerDB()) {
-         try {
-            TrigConf::IStorageMgr * sm = new TrigConf::StorageMgr(gConfig.TriggerDbConnection());
-            uint masterConfigKey = (uint)gConfig.ConfigKey()[0];
-      
-            log << "TrigConfConsistencyChecker:       INFO Retrieving Lvl1 CTP configuration" << std::endl;
-            ctpc->setSuperMasterTableId(masterConfigKey);
-            sm->masterTableLoader().setVerbose(gConfig.Verbose()<4?gConfig.Verbose():0);
-            sm->masterTableLoader().load(*ctpc);
-
-            delete sm;
-         }
-         catch(std::exception & e) {
-            log << e.what() << std::endl;
-            return 1;
-         }
-      }
-      if(gConfig.Verbose()==4)
-         ctpc->print();
-      }
-      catch(...) {
-         log << "TrigConfConsistencyChecker:       ERROR while retrieving Lvl1 CTP configuration, will abort" << std::endl;
-         return 1;
-      }
-   }
-
-   // ========================================
-   // Reading the HLT configuration information 
-   // ========================================
-   TrigConf::HLTFrame* hltFrame(0);
-   if(gConfig.UseHLT()) {
-      try {
-         hltFrame = new TrigConf::HLTFrame();
-         if(gConfig.UseHLTXML()) {
-            log << "TrigConfConsistencyChecker:       INFO Loading HLT configuration" << std::endl;        
-            try {      
-               std::unique_ptr< TrigConf::IStorageMgr > sm(new TrigConf::XMLStorageMgr( { gConfig.HltMenuXML() } ));
-               sm->hltFrameLoader().setVerbose(gConfig.Verbose()<4?gConfig.Verbose():0);
-               sm->hltFrameLoader().load( *hltFrame );
-            }
-            catch(std::exception & e) {
-               log << e.what() << std::endl;
-               return 1;
-            }
-         } else {
-            if(gConfig.UseCOOL()) {
-               try {
-                  log << "TrigConfConsistencyChecker:       INFO Retrieving HLT configuration from cool" << std::endl;
-                  uint runNumber = (uint)gConfig.RunNumber();
-                  TrigConf::TrigConfCoolWriter coolReader(gConfig.CoolConnection());
-                  uint        masterConfigKey(0);
-                  uint        hltPrescaleKey(0);
-                  std::string configSource("");
-
-                  // read the payload
-                  coolReader.readRunPayload(runNumber,
-                                            *hltFrame,
-                                            masterConfigKey,
-                                            hltPrescaleKey,
-                                            configSource );
-                  log << "TrigConfConsistencyChecker:       INFO SMK " << masterConfigKey << ", HLT PSK " << hltPrescaleKey << std::endl;
-
-               }
-               catch(std::exception & e) {
-                  log << e.what() << std::endl;
-                  return 1;
-               }
-            }
-            if(gConfig.UseTriggerDB()) {
-               try {
-                  std::unique_ptr< TrigConf::IStorageMgr > sm = 
-                     std::unique_ptr< TrigConf::IStorageMgr >(new TrigConf::StorageMgr(gConfig.TriggerDbConnection()));
-                  log << "TrigConfConsistencyChecker:       Retrieving HLT menu configuration" << std::endl;
-                  hltFrame->setSMK(gConfig.ConfigKey()[0]);
-                  hltFrame->thePrescaleSetCollection().set_prescale_key_to_load(gConfig.ConfigKey()[1]);
-                  sm->hltFrameLoader().setVerbose(gConfig.Verbose()<4?gConfig.Verbose():0);
-                  sm->hltFrameLoader().load( *hltFrame );
-               }
-               catch(std::exception & e) {
-                  log << e.what() << std::endl;
-                  return 1;
-               }
-            }
-            if(gConfig.Verbose()==5)
-               hltFrame->print();
-         }
-      }
-      catch(...) {
-         log << "TrigConfConsistencyChecker:       ERROR while retrieving HLT menu configuration, will abort" << std::endl;
-         return 1;
-      }
-   }
-
-   // read false positives file
-   ExcMap_t exceptions_map;
-   if ( ! gConfig.ExceptionsFileName().empty()) {
-      try {
-         parseExceptionsFile(gConfig.ExceptionsFileName(), exceptions_map, log);
-      }
-      catch(...) {
-         log << "TrigConfConsistencyChecker:       ERROR while retrieving exceptions, will abort" << std::endl;
-         return 1;
-      }
-   }
-
-   // ################################################################################
-   // ###
-   // ### configuring tests i.e. place them in the map name -> ptr to class doing it
-   // ###
-   // ################################################################################
-  
-   TrigConf::ConfigurationCheck mt ( ctpc, hltFrame );
-
-   int returnCode = 0;
-
-   log << "TrigConfConsistencyChecker:       Starting tests" << std::endl;        
-
-   for( TrigConfTest* T: mt.tests() ) {
-
-      if ( gConfig.DisabledTests().count( T->name() ) != 0 ) T->enable(false);
-
-      std::string l1name = ctpc?ctpc->name():"";
-      std::string hltname = hltFrame?hltFrame->name():"";
-      T->run(getExceptions(exceptions_map, T->name(), l1name, hltname));
-
-      log << "TrigConfConsistencyChecker:       REGTEST  " 
-          << std::setw(25) << std::left << T->name() 
-          << "[" << std::setw(65) << std::left << T->description() << "]"
-          << " => " << (T->status() ? "PASSED" : "NOT PASSED");
-
-      if ( ! T->status() )
-         log << std::endl 
-	   //<< "TrigConfConsistencyChecker:       " << ((gConfig.SilenceSeverity() && T->code())?"WARNING":T->severity()) << " " << T->error();
-	     << "TrigConfConsistencyChecker:       " << T->severity() << " " << T->error();
-      log << std::endl;
-
-      returnCode = std::max<int>(returnCode,T->code());
-   }
-
-   delete ctpc;
-   delete hltFrame;
-
-   return returnCode;  
-}
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/test/CoolFix.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/test/CoolFix.cxx
index df4d2af37174..77454e12dc96 100644
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/test/CoolFix.cxx
+++ b/Trigger/TrigConfiguration/TrigConfStorage/src/test/CoolFix.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
 */
 
 /////////////////////////////////////////////////////////////////////
@@ -18,8 +18,6 @@
 //
 //////////////////////////////////////////////////////////////////////
 
-#include "./Helper.h"
-
 #include "TrigConfBase/MsgStream.h"
 
 #include "TrigConfStorage/DBLoader.h"
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/test/Helper.h b/Trigger/TrigConfiguration/TrigConfStorage/src/test/Helper.h
deleted file mode 100644
index d7743344ec7b..000000000000
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/test/Helper.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TrigConfStorage_Helper
-#define TrigConfStorage_Helper
-
-#include <string>
-#include <vector>
-#include <sys/stat.h> 
-
-#include "CoolKernel/IDatabaseSvc.h"
-
-
-std::string findInPath(const std::string& filename, const std::string & path) {
-   struct stat file_stat;
-   std::string fullname = path + "/" + filename;
-   if (stat (fullname.c_str(), &file_stat) == 0) return fullname;
-   return "";
-}
-
-std::vector<std::string> splitpath(std::string line, std::string del=":")
-{
-  std::vector<std::string> res;
-  std::string::size_type old_pos = 0, pos = line.find(del,0);
-  while( pos != std::string::npos ) {
-    res.push_back(line.substr(old_pos,pos-old_pos));
-    old_pos = pos + del.size();
-    pos = line.find(del, old_pos);
-  }
-  // last entry
-  if (old_pos < line.size())
-    res.push_back(line.substr(old_pos,line.size()-old_pos));
-  return res;
-}
-
-std::string pathresolve(const std::string& filename, const std::string & searchpath) {
-   std::string fullname = findInPath(filename,".");
-   if( fullname != "" ) { return fullname; }
-   std::vector<std::string> listofpaths = splitpath(searchpath);
-   for (const std::string& path : listofpaths) {
-      fullname = findInPath(filename,path);
-      if( fullname != "" ) { return fullname; }      
-   }
-   return "";
-}
-
-std::string xmlpathresolve(const std::string& filename) {
-   // if path starts with '/' then it is absolute
-   if( !filename.empty() && filename[0] == '/' ) return filename;
-
-   std::string xmlpath = ::getenv("XMLPATH");
-   if(filename.find('/')==std::string::npos) {
-      // if there is no "/" in the filename we try to things
-      std::string fullname = pathresolve(filename, xmlpath);
-      if(fullname == "")
-         fullname = pathresolve("TriggerMenuXML/"+filename, xmlpath);
-      return fullname;
-   } else {
-      return pathresolve(filename, xmlpath);
-   }
-}
-
-#endif
-
diff --git a/Trigger/TrigConfiguration/TrigConfStorage/src/test/ReadWrite.cxx b/Trigger/TrigConfiguration/TrigConfStorage/src/test/ReadWrite.cxx
index b77b86c6e15a..b91d8472789d 100644
--- a/Trigger/TrigConfiguration/TrigConfStorage/src/test/ReadWrite.cxx
+++ b/Trigger/TrigConfiguration/TrigConfStorage/src/test/ReadWrite.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
 */
 
 /////////////////////////////////////////////////////////////////////
@@ -13,17 +13,14 @@
 // PURPOSE:
 //
 // This standalone application is designed to read and write the
-// trigger configuration (L1+HLT) from DB,XML,COOL and to XML or COOL
+// trigger configuration (L1+HLT) from DB,COOL and to COOL
 // for test purposes
 //
 //////////////////////////////////////////////////////////////////////
 
-#include "./Helper.h"
-
 #include "TrigConfBase/MsgStream.h"
 
 #include "TrigConfStorage/StorageMgr.h"
-#include "TrigConfStorage/XMLStorageMgr.h"
 #include "TrigConfStorage/DBLoader.h"
 #include "TrigConfStorage/IStorageMgr.h"
 #include "TrigConfStorage/IHLTFrameLoader.h"
@@ -72,7 +69,7 @@ void printhelp(std::ostream & o, std::ostream& (*lineend) ( std::ostream& os ))
    o << "[Global options]\n";
    o << "  -i|--input        input [input [input]]             ... source of configuration, format see below (mandatory)\n";
    o << "  -2|--comp         input [input [input]]             ... source of a second configuration for comparison\n";
-   o << "  -o|--output xml|r3json|cool [output[;cooldb]] [run] ... output format, name (for cool optional run number)\n";
+   o << "  -o|--output r3json|cool [output[;cooldb]] [run] ... output format, name (for cool optional run number)\n";
    o << "                                                      ... absolute output file name must contain '/', cooldb can be appended COMP200|OFLP200\n";
    o << "  -v|--loglevel     <string>                          ... log level [NIL, VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL, ALWAYS]\n";
    o << "  -l|--log          <string>                          ... name of a log file\n";
@@ -83,7 +80,6 @@ void printhelp(std::ostream & o, std::ostream& (*lineend) ( std::ostream& os ))
    o << "  --nomerge                                           ... internally don't merge L2 and EF (by default merge is enabled)\n";
    o << "\n\n";
    o << "Input can be specified the following\n";
-   o << "  -i [l1menu.xml] [hltmenu2.xml]                                    ... to read L1 and/or HLT menu from XML [file names must end with '.xml'\n";
    o << "  -i <TRIGDB_ALIAS>|<TRIGDB_connection> smk[,l1psk,hltpsk,bgsk]     ... to read the menu from a trigger db via alias or explicit connection specification (ORACLE or SQlite)\n";
    o << "  -i <COOLDB_ALIAS>|<COOLDB_connection>|cool.db run[,lb]            ... to read the menu from COOL for a certain run and possibly LB [file names must end with '.db']\n";
    o << "\n";
@@ -95,10 +91,7 @@ void printhelp(std::ostream & o, std::ostream& (*lineend) ( std::ostream& os ))
    o << "Input for comparison can be specified the same way, using the '-2' or '--comp' option\n";
    o << "\n";
    o << "\n";
-   o << "Output formats can be xml or cool. In case a second input is specified for comparison, the output will be on screen or an xml file with the differences\n";
-   o << "  -o xml [<test>]                                 ... will produce LVL1config_test.xml and/or HLTconfig_test.xml. When\n";
-   o << "                                                      comparing two menus this will produce Diff_test.xml. In this case the\n";
-   o << "                                                      specification of '-o test' is sufficient\n";
+   o << "Output formats can be json or cool. In case a second input is specified for comparison, the output will be on screen or an xml file with the differences\n";
    o << "  -o r3json [<test>]                              ... will produce Run 3 config files L1PrescalesSet[_<test>].json, BunchGroups[_<test>].json, L1Menu[_<test>].json, HLTPrescalesSet[_<test>].json, and HLTMenu[_<test>].json\n";
    o << "  -o cool                                         ... will produce trig_cool.db with cool db instance CONDBR2 and infinite IOV\n";
    o << "  -o cool 200000                                  ... will produce trig_cool.db with cool db instance CONDBR2 and run number 200000\n";
@@ -124,9 +117,6 @@ public:
    string       db{""}, db2{""};
    vector<unsigned int> keys, keys2; // smk[,l1key[,hltkey[,bgkey]]]
    string       outBase {""};
-   string       l1xmlOutFile { "LVL1Config.xml" };
-   string       l1topoOutFile { "L1TopoConfig.xml" };
-   string       hltxmlOutFile { "HLTConfig.xml" };
 
    string       l1JsonOutFile {"L1Menu.json"};
    string       bgkJsonOutFile {"BunchGroups.json"};
@@ -163,12 +153,6 @@ public:
 
 
 namespace {
-   bool endswith(const std::string& str, const std::string& sub) {
-      if(str.size()<sub.size())
-         return false;
-      return (str.compare(str.size()-sub.size(),sub.size(),sub) == 0);
-   }
-
    bool startswith(const std::string& str, const std::string& sub) {
       if(str.size()<sub.size())
          return false;
@@ -218,8 +202,8 @@ JobConfig::parseProgramOptions(int argc, char* argv[]) {
          if(currentPar == "i" || currentPar == "input")     { inpar.push_back(stripped); continue; }
          if(currentPar == "2" || currentPar == "comp")      { inpar2.push_back(stripped); continue; }
          if(currentPar == "o" || currentPar == "output")    {
-            if(outpar.size()==0 && stripped != "xml" && stripped != "r3json" && stripped != "cool") {
-               error.push_back("Unknown output type: " + stripped + ". Must be either xml, json or cool, optionally followed by a base string for the output file name");
+            if(outpar.size()==0 && stripped != "r3json" && stripped != "cool") {
+               error.push_back("Unknown output type: " + stripped + ". Must be either json or cool, optionally followed by a base string for the output file name");
             } else {
                outpar.push_back(stripped);
             }
@@ -250,10 +234,7 @@ JobConfig::parseProgramOptions(int argc, char* argv[]) {
 
 
    // parse the input
-   if( (inpar.size()==1 && endswith(inpar[0],".xml")) ||
-       (inpar.size()==2 && endswith(inpar[0],".xml") && endswith(inpar[1],".xml")) ) {
-      input = XML;
-   } else if( inpar.size()>=1 && inpar[0].find(".db") != string::npos ) {
+   if( inpar.size()>=1 && inpar[0].find(".db") != string::npos ) {
       // sqlite file
       input = COOL;
       vector<string> ksv;
@@ -283,16 +264,9 @@ JobConfig::parseProgramOptions(int argc, char* argv[]) {
       };
    }
 
-   if( (inpar2.size()==1 && endswith(inpar2[0],".xml")) ||
-       (inpar2.size()==2 && endswith(inpar2[1],".xml") && endswith(inpar2[1],".xml")) ) {
-      input2 = XML;
-   }
-
    // parse the output
    for(const string& o: outpar) {
-      if ( o=="xml") {
-         output |= XML;
-      } else if ( o=="r3json" ) {
+      if ( o=="r3json" ) {
          output |= JSON;
       } else if ( o=="cool" ) {
          output |= COOL;
@@ -318,10 +292,6 @@ JobConfig::parseProgramOptions(int argc, char* argv[]) {
          }
          coolOutputConnection = "sqlite://;schema="+outfile+";dbname="+dbname;
       } else {
-         l1xmlOutFile  = "LVL1config_" + outBase + ".xml";
-         l1topoOutFile = "L1TopoConfig_" + outBase + ".xml";
-         hltxmlOutFile = "HLTconfig_" + outBase + ".xml";
-
          l1JsonOutFile = "L1Menu_" + outBase + ".json";
          bgkJsonOutFile = "BunchGroups_" + outBase + ".json";
          l1PSJsonOutFile = "L1PrescaleSet_" + outBase + ".json";
@@ -355,9 +325,9 @@ string JobConfig::CheckForCompleteSetup() {
 void
 JobConfig::PrintSetup(std::ostream & log, std::ostream& (*lineend) ( std::ostream& os ) ) {
    log << "========================================" << lineend;
-   log << "JOB SETUP: " << (input==DB?"DB":(input==COOL?"COOL":"XML"));
+   log << "JOB SETUP: " << (input==DB?"DB":"COOL");
    if(output!=UNDEF)
-      log << " --> " << (output==COOL?"COOL":"XML");
+      log << " --> " << (output==COOL?"COOL":"JSON");
    log << lineend;
    log << "----------" << lineend;
    log << "   Input               : ";
@@ -370,7 +340,6 @@ JobConfig::PrintSetup(std::ostream & log, std::ostream& (*lineend) ( std::ostrea
    }
    if( output != UNDEF ) {
       log << "   Output              : ";
-      if( output&XML )  log << l1xmlOutFile << ", " << l1topoOutFile << ", " << hltxmlOutFile;
       if( output&COOL ) {
          log << coolOutputConnection;
          if(coolOutputRunNr==0) { log << ", infinite IOV"; } else { log << ", run nr " << coolOutputRunNr; }
@@ -487,37 +456,6 @@ int main( int argc, char* argv[] ) {
          log << "Did not load MCK from DB as MCK is 0 or no MCK is linked";
       }
 
-
-   }
-   /*------------------
-    * from XML
-    *-----------------*/
-   else if (gConfig.input == JobConfig::XML) {
-      unique_ptr<XMLStorageMgr> sm( gConfig.inpar.size()==1 ?
-                                    new XMLStorageMgr( { xmlpathresolve(gConfig.inpar[0]) } ) :
-                                    new XMLStorageMgr( { xmlpathresolve(gConfig.inpar[0]), xmlpathresolve(gConfig.inpar[1]) } )
-                                    );
-
-      sm->setLevel(MSGTC::VERBOSE);
-
-      if(sm->hasLVL1()) {
-         ctpc = new CTPConfig();
-         log << "Retrieving Lvl1 CTP configuration from " << sm->m_xmlL1File << lineend;
-         //         DBLoader::setEnv(DBLoader::CTP);
-         sm->masterTableLoader().setLevel(gConfig.outputlevel);
-         sm->masterTableLoader().load(*ctpc);
-         sm->masterTableLoader().load(ctpc->muCTPi());
-         log << "Done reading " << sm->m_xmlL1File << lineend;
-
-      }
-      if(sm->hasHLT()) {
-         hltFrame = new HLTFrame();
-         hltFrame->setMergedHLT(gConfig.merge);
-         log << "Retrieving HLT menu from " << sm->m_xmlHLTFile << lineend;
-         sm->hltFrameLoader().setLevel(gConfig.outputlevel);
-         sm->hltFrameLoader().load( *hltFrame );
-         log << "Done reading " << sm->m_xmlHLTFile << lineend;
-      }
    }
    /*------------------
     * from COOL
@@ -601,32 +539,6 @@ int main( int argc, char* argv[] ) {
             hltFrame2->thePrescaleSetCollection().set_prescale_key_to_load( gConfig.getKey2(2) );
          sm->hltFrameLoader().load( *hltFrame2 );
          delete sm;
-      }
-      /*------------------
-       * from XML
-       *-----------------*/
-      else if (gConfig.input2 == JobConfig::XML) {
-         unique_ptr<XMLStorageMgr> sm( gConfig.inpar2.size()==1 ?
-                                       new XMLStorageMgr( { xmlpathresolve(gConfig.inpar2[0]) } ) :
-                                       new XMLStorageMgr( { xmlpathresolve(gConfig.inpar2[0]),xmlpathresolve(gConfig.inpar2[1]) } ) );
-
-         if(sm->hasLVL1()) {
-            ctpc2 = new CTPConfig();
-            log << "Retrieving Lvl1 CTP configuration from " << sm->m_xmlL1File << lineend;
-            DBLoader::setEnv(DBLoader::CTP);
-            sm->masterTableLoader().load(*ctpc2);
-            sm->masterTableLoader().load( ctpc2->muCTPi() );
-            log << "Done reading " << sm->m_xmlL1File << lineend;
-         }
-
-         if(sm->hasHLT()) {
-            hltFrame2 = new HLTFrame();
-            hltFrame2->setMergedHLT(gConfig.merge);
-            log << "Retrieving HLT menu from " << sm->m_xmlHLTFile << lineend;
-            sm->hltFrameLoader().load( *hltFrame2 );
-            log << "Done reading " << sm->m_xmlHLTFile << lineend;
-         }
-
       } else if (gConfig.input2 == JobConfig::COOL) {
          /*------------------
           * from COOL
@@ -656,30 +568,6 @@ int main( int argc, char* argv[] ) {
    // ========================================
    // Writing
    // ========================================
-   if ( (gConfig.output & JobConfig::XML) != 0 ) {
-      /*------------------
-       * to XML
-       *-----------------*/
-
-      if(ctpc) {
-         log << "TrigConfReadWrite:                Writing LVL1 menu " << gConfig.l1xmlOutFile << lineend;
-         ctpc->writeXML(gConfig.l1xmlOutFile, 2);
-      }
-
-      if(hltFrame) {
-         std::ofstream xmlfile;
-         xmlfile.open(gConfig.hltxmlOutFile);
-         log << "TrigConfReadWrite:                Writing HLT menu " << gConfig.hltxmlOutFile << lineend;
-         hltFrame->writeXML(xmlfile);
-         xmlfile.close();
-      }
-
-      if(l1tm) {
-         log << "TrigConfReadWrite:                Writing L1 TopoMenu " << gConfig.l1topoOutFile << lineend;
-         l1tm->writeXML(gConfig.l1topoOutFile);
-      }
-
-   }
    if ( (gConfig.output & JobConfig::JSON) != 0 ) {
       /*------------------
        * to JSON
@@ -741,10 +629,6 @@ int main( int argc, char* argv[] ) {
       sm->jobOptionTableLoader().setLevel(gConfig.outputlevel);
       sm->jobOptionTableLoader().load( jot );
       if(gConfig.printlevel>0) jot.print();
-      if ( (gConfig.output & JobConfig::XML) != 0 ) {
-         jot.writeToFile( string("HLTSetup_"+gConfig.outBase+".xml").c_str() );
-      }
-
    }
 
 }
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py
index 34074da4533d..fc6349304e13 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcCfg.py
@@ -96,7 +96,6 @@ def getHLTPrescaleFolderName():
 # L1 Json file name 
 def getL1MenuFileName(flags):
     l1MenuFileName = 'L1Menu_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json'
-    l1MenuFileName = l1MenuFileName.replace(".xml",".json").replace("LVL1config", "L1Menu")
     l1MenuFileName = l1MenuFileName.replace("_newJO","")
     return l1MenuFileName
 
@@ -104,7 +103,6 @@ def getL1MenuFileName(flags):
 # HLT Json file name 
 def getHLTMenuFileName( flags ):
     hltMenuFileName = 'HLTMenu_'+flags.Trigger.triggerMenuSetup+'_'+flags.Trigger.menuVersion+'.json'
-    hltMenuFileName = hltMenuFileName.replace(".xml",".json").replace("HLTconfig", "HLTMenu").replace("HLTmenu", "HLTMenu")
     hltMenuFileName = hltMenuFileName.replace("_newJO","")
     return hltMenuFileName
 
@@ -222,14 +220,10 @@ def HLTConfigSvcCfg( flags ):
     hltConfigSvc = TrigConf__HLTConfigSvc("HLTConfigSvc")
 
     if cfg["SOURCE"] == "FILE":
-        hltXMLFile = "None"
         hltConfigSvc.ConfigSource = "none"
-        hltConfigSvc.XMLMenuFile = hltXMLFile
         hltConfigSvc.InputType = "file"
         hltJsonFileName = getHLTMenuFileName( flags )
         hltConfigSvc.JsonFileName = hltJsonFileName
-        # TODO revisit if needed    
-        log.info( "Configured HLTConfigSvc with run 2 style input file : %s", hltXMLFile  )
         log.info( "Configured HLTConfigSvc with InputType='file' and JsonFileName=%s", hltJsonFileName )
     elif cfg["SOURCE"] == "DB":
         hltConfigSvc.ConfigSource = "none"
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py
index 8447a41c9574..6859f828c005 100755
--- a/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/python/TrigConfigSvcConfig.py
@@ -5,55 +5,6 @@ from TrigConfigSvc.TrigConfigSvcConf import (TrigConf__LVL1ConfigSvc,
                                              TrigConf__DSConfigSvc,
                                              TrigConf__TrigConfigSvc)
 
-from os.path import exists, join, abspath
-
-from AthenaCommon.Logging import logging  # loads logger
-from PyUtils.Decorators import memoize
-
-@memoize
-def findFileInXMLPATH(filename):
-    """ Use XMLPATH to find files (cache result through memoize decorator)"""
-
-    if filename=="NONE":
-        return filename
-
-    filename = str(filename)
-
-    mlog = logging.getLogger("TrigConfigSvcConfig.py")
-    mlog.debug("Searching XML config file for HLT")
-    if filename.find('./') == 0: ## this expected to be local file, name starts from ./
-        return filename
-    else:
-        mlog.debug("Nonlocal XML config file for HLT")
-        from os import environ
-        ## even if ./ not as file name prefix look first in PWD
-        if exists(filename):
-            mlog.info(filename+" XML configuration file taken from working directory")
-            return filename
-
-        ## search XMLPATH path
-        if 'XMLPATH' not in environ: ## XMLPATH is not known ... no search is performed
-            mlog.info("XML file: "+filename + " not found and XMLPATH not given" )
-            return filename
-
-        xmlpath = environ['XMLPATH']
-        paths = xmlpath.split(":")
-        for path in paths:
-
-            test = join(path, filename)
-            if exists(test):
-                mlog.info("Found XML file: " + abspath(test))
-                return abspath(test)
-
-            test = join(path, "TriggerMenuMT",filename)
-            if exists(test):
-                mlog.info("Found XML file: " + abspath(test))
-                return abspath(test)
-
-        return filename
-
-
-
 class HLTConfigSvc( TrigConf__HLTConfigSvc ):
     #__slots__ = []
     def __init__( self, name="HLTConfigSvc" ):
@@ -68,17 +19,6 @@ class LVL1ConfigSvc ( TrigConf__LVL1ConfigSvc ):
     def __init__( self, name="LVL1ConfigSvc" ):
         super( LVL1ConfigSvc, self ).__init__( name )
 
-    @property
-    def XMLFile(self):
-        '''The xml file name for backward compatibility with old property name'''
-        return  self.XMLMenuFile
-
-    @XMLFile.setter
-    def XMLFile(self, xmlfile):
-        log = logging.getLogger("LVL1ConfigSvc")
-        log.warning( "LVL1ConfigSvc property XMLFile will soon be deprecated. Please use XMLMenuFile instead" )
-        self.XMLMenuFile = xmlfile
-
     def setDefaults(self, handle):
         pass
 
@@ -109,8 +49,6 @@ class TrigConfigSvc( TrigConf__TrigConfigSvc ):
 # svc.InitialiseSvc()
 #
 # after InitialiseSvc() is called, the state is fixed
-# possible states are: ds, xml
-
 
 class SetupTrigConfigSvc(object):
     """ A python singleton class for configuring the trigger configuration services"""
@@ -120,21 +58,16 @@ class SetupTrigConfigSvc(object):
 
         def __init__(self):
             """
-            state == xml -> read the trigger configuration from 2 xml files, one for L1, one for HLT
             stats == ds  -> read the trigger configuration from the detector store = esd header
             state == none -> service is not directly serving the run3 configuration
             """
-            self.states = ["xml"]
-            self.allowedStates = set(['none','xml','ds'])
+            self.states = ['none']
+            self.allowedStates = set(['none','ds'])
             self.initialised = False
 
             from AthenaCommon.Logging import logging
             self.mlog = logging.getLogger("TrigConfigSvcConfig.py")
 
-            # svc properties:
-            self.hltXmlFile = 'HLT_XML_FILE_NOT_SET'
-            self.l1XmlFile  = 'L1_XML_FILE_NOT_SET'
-
 
         def SetStates(self, state):
             if self.initialised:
@@ -159,28 +92,6 @@ class SetupTrigConfigSvc(object):
             from AthenaCommon.AppMgr import ServiceMgr
 
             self.mlog.info( "initialising TrigConfigSvc using state %s", self.states )
-            if 'xml' in self.states:
-                from TriggerJobOpts.TriggerFlags import TriggerFlags
-
-
-                if TriggerFlags.doHLT() or TriggerFlags.configForStartup()=='HLToffline':
-                    self.mlog.info( "setup HLTConfigSvc and add instance to ServiceMgr (xml file="+self.hltXmlFile+")" )
-                    hlt = HLTConfigSvc("HLTConfigSvc")
-                    hlt.XMLMenuFile = self.hltXmlFile
-                    hlt.doMergedHLT = TriggerFlags.doHLT()
-                    ServiceMgr += hlt
-                else:
-                    self.mlog.info( "Will not setup HLTConfigSvc, since doHLT() is False" )
-                    self.states[self.states.index("xml")] = "xmll1"
-
-                self.mlog.info("setup LVL1 ConfigSvc and add instance to ServiceMgr")
-                self.mlog.info("xml file = %s", self.l1XmlFile)
-
-                l1 = LVL1ConfigSvc("LVL1ConfigSvc")
-                l1.XMLMenuFile = self.l1XmlFile
-                ServiceMgr += l1
-
-
             if 'ds' in self.states:
 
                 self.mlog.info( "setup DSConfigSvc and add instance to ServiceMgr" )
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx
index 7b9a35f0b44e..4e040cb6d546 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.cxx
@@ -6,7 +6,6 @@
 #include "TrigConfBase/TrigDBConnectionConfig.h"
 #include "TrigConfStorage/IStorageMgr.h"
 #include "TrigConfStorage/StorageMgr.h"
-#include "TrigConfStorage/XMLStorageMgr.h"
 
 #include "PathResolver/PathResolver.h"
 
@@ -29,9 +28,7 @@ ConfigSvcBase::~ConfigSvcBase()
 void
 ConfigSvcBase::declareCommonProperties() {
    declareProperty( "ConfigSource",     m_configSourceString,
-                    "Source of trigger configuration; can be \"XML\", \"MySQL\", \"Oracle\", \"DBLookup\", or \"none\"");
-   declareProperty( "XMLMenuFile",      m_xmlFile,
-                    "XML file containing the trigger configuration.");
+                    "Source of trigger configuration; can be \"MySQL\", \"Oracle\", \"DBLookup\", or \"none\"");
    declareProperty( "DBServer",         m_dbServer,
                     "Database server to use.");
    declareProperty( "DBUser",           m_dbUser,
@@ -61,7 +58,6 @@ ConfigSvcBase::initialize ATLAS_NOT_THREAD_SAFE () {
 
    if (s == "none") {
       ATH_MSG_INFO("Old style menu has been disabled");
-      m_xmlFile = "";
    } else if(s != "xml") {
       TrigDBConnectionConfig::DBType dbtype(TrigDBConnectionConfig::DBLookup);
       if (s == "oracle") { dbtype = TrigDBConnectionConfig::Oracle; }
@@ -80,9 +76,7 @@ ConfigSvcBase::initialize ATLAS_NOT_THREAD_SAFE () {
    }
 
    ATH_MSG_INFO("    ConfigSource        = " << m_configSourceString);
-   if(m_dbconfig==nullptr) {
-      ATH_MSG_INFO("    XMLMenuFile         = " << m_xmlFile);
-   } else {
+   if(m_dbconfig!=nullptr) {
       ATH_MSG_INFO("    DB Server           = " << m_dbServer);
       ATH_MSG_INFO("    DB User             = " << m_dbUser);
       ATH_MSG_INFO("    DB Table            = " << m_dbTable);
@@ -117,18 +111,6 @@ ConfigSvcBase::initStorageMgr() {
       sm->setConnectionTimeout( 0 );
 
       m_storageMgr = sm;
-   } else {
-      if (m_xmlFile == "") {
-         ATH_MSG_ERROR("If you need the configuration and ConfigSource is 'XML', you need to specify a menu xml file");
-         return StatusCode::FAILURE;
-      }
-      std::string resolvedXMLfile(m_xmlFile);
-      if( boost::algorithm::ends_with(m_xmlFile, ".xml") && ! boost::algorithm::starts_with(m_xmlFile, "./")  ) {
-         resolvedXMLfile = PathResolver::find_file( m_xmlFile, "XMLPATH" );
-      }
-      ATH_MSG_INFO("Unresolved XML file: " << m_xmlFile);
-      ATH_MSG_INFO("Resolved XML file: " << resolvedXMLfile);
-      m_storageMgr = new XMLStorageMgr( { resolvedXMLfile } );
    }
    return StatusCode::SUCCESS;
 }
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.h b/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.h
index a7a895b2fd6d..edd75ce9e036 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.h
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/ConfigSvcBase.h
@@ -33,8 +33,7 @@ namespace TrigConf {
    protected:
 
       // properties
-      std::string        m_configSourceString { "XML" };
-      std::string        m_xmlFile { "NONE" };
+      std::string        m_configSourceString { "none" };
       std::string        m_dbServer { "" };
       std::string        m_dbUser { "" };
       std::string        m_dbPassword { "" };
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx
index d14342b688ab..7df3d934b574 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/HLTConfigSvc.cxx
@@ -122,9 +122,8 @@ HLTConfigSvc::initialize ATLAS_NOT_THREAD_SAFE() {
 
    ATH_CHECK(ConfigSvcBase::initialize());
 
-   std::string xmlFile(boost::to_lower_copy(m_xmlFile)); // lower case
-   if( !fromDB() and (xmlFile=="none" or xmlFile == "")) {
-      ATH_MSG_INFO("xml file set to NONE, will not load old-style HLT Menu");
+   if( !fromDB() ) {
+      ATH_MSG_INFO("will not load old-style HLT Menu");
       return StatusCode::SUCCESS;
    }
 
@@ -219,7 +218,7 @@ TrigConf::HLTConfigSvc::start() {
 
    ATH_MSG_INFO("HLTConfigSvc::start");
 
-   if( ! fromDB() ) // xml config
+   if( ! fromDB() )
       return StatusCode::SUCCESS;
 
    // also load the prescale set for the initial HLT PSK into the PrescaleSetCollection
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx
index 4e1f6fdb2411..b7bbe2046471 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/LVL1ConfigSvc.cxx
@@ -163,7 +163,6 @@ TrigConf::LVL1ConfigSvc::initializeRun2StyleMenu() {
 
    if ( m_configSourceString == "none" ) {
       ATH_MSG_INFO("Run 2 style menu has been disabled");
-      m_xmlFile = "";
       return StatusCode::SUCCESS;
    } else if( m_configSourceString != "xml") {
       TrigDBConnectionConfig::DBType dbtype(TrigDBConnectionConfig::DBLookup);
@@ -181,22 +180,18 @@ TrigConf::LVL1ConfigSvc::initializeRun2StyleMenu() {
    ATH_MSG_INFO("Run 2 style menu");
    ATH_MSG_INFO("    Run 2 config source  = " << m_configSourceString);
    if( m_configSourceString != "none" ) {
-      if( m_configSourceString == "xml" ) {
-         ATH_MSG_INFO("    Run 2 Input file     = " << m_xmlFile);
-      } else {
-         ATH_MSG_INFO("    Run 2 DB Server      = " << m_dbServer);
-         ATH_MSG_INFO("    Run 2 DB User        = " << m_dbUser);
-         ATH_MSG_INFO("    Run 2 DB Table       = " << m_dbTable);
-         ATH_MSG_INFO("    Run 2 DB connection  = " << m_dbconfig->toString());
-         ATH_MSG_INFO("    Run 2 SMK            = " << m_dbSMKey);
-         ATH_MSG_INFO("    Run 2 L1 PSK         = " << m_prescaleSetID);
-         ATH_MSG_INFO("    Run 2 BGSK           = " << m_bunchgroupSetID);
-         ATH_MSG_INFO("    UseFrontier          = " << m_useFrontier.value());
-      }
+      ATH_MSG_INFO("    Run 2 DB Server      = " << m_dbServer);
+      ATH_MSG_INFO("    Run 2 DB User        = " << m_dbUser);
+      ATH_MSG_INFO("    Run 2 DB Table       = " << m_dbTable);
+      ATH_MSG_INFO("    Run 2 DB connection  = " << m_dbconfig->toString());
+      ATH_MSG_INFO("    Run 2 SMK            = " << m_dbSMKey);
+      ATH_MSG_INFO("    Run 2 L1 PSK         = " << m_prescaleSetID);
+      ATH_MSG_INFO("    Run 2 BGSK           = " << m_bunchgroupSetID);
+      ATH_MSG_INFO("    UseFrontier          = " << m_useFrontier.value());
    }
 
-   if( m_dbconfig==nullptr && m_xmlFile=="NONE" ) {
-      ATH_MSG_INFO("xml file set to NONE, will not load LVL1 Menu");
+   if( m_dbconfig==nullptr ) {
+      ATH_MSG_INFO("will not load legacy LVL1 Menu");
    } else {
       CHECK( loadRun2StyleMenu() );
    }
diff --git a/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py b/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py
index b397a8f00f61..52e4ccc6c3ac 100755
--- a/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py
+++ b/Trigger/TrigCost/TrigCostAnalysis/share/RunTrigCostAnalysis.py
@@ -133,7 +133,6 @@ def hltConfigSvcCfg(flags, smk, dbAlias):
     log.debug("Reading HLTMenu from file {0}".format(menuFile))
 
     hltConfigSvc.InputType = "file"
-    hltConfigSvc.XMLMenuFile = "None"
     hltConfigSvc.JsonFileName = menuFile
   elif smk and dbAlias:
     log.debug("Reading HLTMenu from database {0} {1}".format(smk, dbAlias))
diff --git a/Trigger/TrigMonitoring/TrigCostMonitor/share/RunEBWeightsComputation.py b/Trigger/TrigMonitoring/TrigCostMonitor/share/RunEBWeightsComputation.py
index ee697305f4c7..7c2003f66a2a 100755
--- a/Trigger/TrigMonitoring/TrigCostMonitor/share/RunEBWeightsComputation.py
+++ b/Trigger/TrigMonitoring/TrigCostMonitor/share/RunEBWeightsComputation.py
@@ -30,7 +30,6 @@ def hltConfigSvcCfg(menuFile):
     hltConfigSvc = CompFactory.getComp("TrigConf::HLTConfigSvc")("HLTConfigSvc")
     hltConfigSvc.ConfigSource = "None"
     hltConfigSvc.InputType = "file"
-    hltConfigSvc.XMLMenuFile = "None"
     hltConfigSvc.JsonFileName = menuFile
 
     acc.addService(hltConfigSvc, False, True)
@@ -150,4 +149,4 @@ if __name__=='__main__':
     cfg.printConfig(withDetails=False) # set True for exhaustive info
 
     sc = cfg.run(args.maxEvents, args.loglevel)
-    sys.exit(0 if sc.isSuccess() else 1)
\ No newline at end of file
+    sys.exit(0 if sc.isSuccess() else 1)
-- 
GitLab


From 84f0304d1de248ae42970b979bde16b96c676817 Mon Sep 17 00:00:00 2001
From: Iskander Ibragimov <iskander.ibragimov@cern.ch>
Date: Thu, 23 Sep 2021 20:05:41 +0200
Subject: [PATCH 300/347] Pixel Monitoring: change naming of pixel barrel
 layers

---
 .../python/PixelAthMonitoringBase.py           |  6 +++---
 .../src/PixelAthMonitoringBase.cxx             | 18 +++++++++---------
 .../src/PixelAthMonitoringBase.h               |  2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthMonitoringBase.py b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthMonitoringBase.py
index b783d9fdac02..096a4ab21dba 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthMonitoringBase.py
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/python/PixelAthMonitoringBase.py
@@ -24,7 +24,7 @@ NumPP0sEC       = 24
 btxt     = ";eta index of module"
 sbtxt    = ";shifted eta index of module"
 ditxt    = ";disk number"
-layers   = ["ECA","ECC","B0","B1","B2","IBL"]
+layers   = ["ECA","ECC","BLayer","Layer1","Layer2","IBL"]
 xbinsl   = [    3,    3,  13,  13,  13,   32]
 xminsl   = [ -0.5, -0.5,-6.5,-6.5,-6.5,-16.5]
 ybinsl   = [   48,   48,  22,  38,  52,   14]
@@ -46,10 +46,10 @@ errbminsy= [    0,    0,   0,   0,   0,    0]
 errbbsizy= [    1,    1,   1,   1,   1,    1]
 errtbinsy= [    7,    7,   7,   7,   7,    7]
 
-pp0layers= ["ECA","ECC","B0","B1","B2","IBLA","IBLC"]
+pp0layers= ["ECA","ECC","BLayer","Layer1","Layer2","IBLA","IBLC"]
 pp0xbins = [   24,   24,  22,  38,  52,   14,     14]
 
-fei3layers= ["ECA","ECC","B0","B1","B2"]
+fei3layers= ["ECA","ECC","BLayer","Layer1","Layer2"]
 fei4layers= ["IBL"]
 
 lumitext  = ";lumi block"
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.cxx
index b51c37f6c89b..17bbd29d47dc 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.cxx
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.cxx
@@ -113,7 +113,7 @@ void PixelAthMonitoringBase::fill2DProfLayerAccum(const VecAccumulator2DMap& acc
 }
 
 ///
-/// filling 1DProf per-lumi per-layer histograms ["ECA","ECC","B0","B1","B2","IBL"]
+/// filling 1DProf per-lumi per-layer histograms ["ECA","ECC","BLayer","Layer1","Layer2","IBL"]
 ///
 void PixelAthMonitoringBase::fill1DProfLumiLayers(const std::string& prof1Dname, int lumiblock, float* values,
                                                   int nlayers) const {
@@ -136,7 +136,7 @@ void PixelAthMonitoringBase::fill1DProfLumiLayers(const std::string& prof1Dname,
 //////////////////////////////////////////////
 
 ///
-/// filling 2DProf per-lumi per-layer histograms ["ECA","ECC","B0","B1","B2","IBL"]
+/// filling 2DProf per-lumi per-layer histograms ["ECA","ECC","BLayer","Layer1","Layer2","IBL"]
 ///
 void PixelAthMonitoringBase::fill2DProfLumiLayers(const std::string& prof2Dname, int lumiblock,
                                                   float(*values)[PixLayers::COUNT], const int* nCategories) const {
@@ -159,7 +159,7 @@ void PixelAthMonitoringBase::fill2DProfLumiLayers(const std::string& prof2Dname,
 
 
 ///
-/// filling 1DProfile per-pp0(ROD) histograms for ["ECA","ECC","B0","B1","B2","IBLA","IBLC"]
+/// filling 1DProfile per-pp0(ROD) histograms for ["ECA","ECC","BLayer","Layer1","Layer2","IBLA","IBLC"]
 ///
 void PixelAthMonitoringBase::fillFromArrays(const std::string& namePP0, AccumulatorArrays& pixarrays,
                                             const std::string& name2DMap) const {
@@ -214,8 +214,8 @@ void PixelAthMonitoringBase::fillFromArrays(const std::string& namePP0, Accumula
       auto valp = Monitored::Scalar<float>(valvarp, pixarrays.B0[a][b]);
       auto valm = Monitored::Scalar<float>(valvarm, pixarrays.B0[a][b] * weightPix);
       if (pixarrays.B0[a][b] > -1) {
-        fill("B0", pospp0x, valp);
-        if (!fillPP0only) fill("B0", posx, posy, valm);
+        fill("BLayer", pospp0x, valp);
+        if (!fillPP0only) fill("BLayer", posx, posy, valm);
       }
     }
     for (unsigned int a = 0; a < PixMon::kNumStavesL1; ++a) {
@@ -224,8 +224,8 @@ void PixelAthMonitoringBase::fillFromArrays(const std::string& namePP0, Accumula
       auto valp = Monitored::Scalar<float>(valvarp, pixarrays.B1[a][b]);
       auto valm = Monitored::Scalar<float>(valvarm, pixarrays.B1[a][b] * weightPix);
       if (pixarrays.B1[a][b] > -1) {
-        fill("B1", pospp0x, valp);
-        if (!fillPP0only) fill("B1", posx, posy, valm);
+        fill("Layer1", pospp0x, valp);
+        if (!fillPP0only) fill("Layer1", posx, posy, valm);
       }
     }
     for (unsigned int a = 0; a < PixMon::kNumStavesL2; ++a) {
@@ -234,8 +234,8 @@ void PixelAthMonitoringBase::fillFromArrays(const std::string& namePP0, Accumula
       auto valp = Monitored::Scalar<float>(valvarp, pixarrays.B2[a][b]);
       auto valm = Monitored::Scalar<float>(valvarm, pixarrays.B2[a][b] * weightPix);
       if (pixarrays.B2[a][b] > -1) {
-        fill("B2", pospp0x, valp);
-        if (!fillPP0only) fill("B2", posx, posy, valm);
+        fill("Layer2", pospp0x, valp);
+        if (!fillPP0only) fill("Layer2", posx, posy, valm);
       }
     }
   }
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.h b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.h
index b1c5c317303b..efc69e85470b 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.h
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelAthMonitoringBase.h
@@ -25,7 +25,7 @@ public:
   };
 };
 const std::string pixLayersLabel[PixLayers::COUNT] = {
-  "ECA", "ECC", "B0", "B1", "B2", "IBL"
+  "ECA", "ECC", "BLayer", "Layer1", "Layer2", "IBL"
 };
 const float inv_nmod_per_layer[PixLayers::COUNT] = {
   1. / 144., 1. / 144., 1. / 286., 1. / 494., 1. / 676., 1. / 448.
-- 
GitLab


From de654ad6b06cd466507fb012d305a17f7ef9e22e Mon Sep 17 00:00:00 2001
From: Noemi Calace <noemi.calace@cern.ch>
Date: Thu, 23 Sep 2021 20:06:38 +0200
Subject: [PATCH 301/347] Building ITk tracking geometry via condition algs

---
 .../SiLayerBuilderCond.h                      |  23 +-
 .../StagedTrackingGeometryBuilderCond.h       |  31 +-
 .../src/SiLayerBuilderCond.cxx                | 472 +++++++++++++-----
 .../src/StagedTrackingGeometryBuilderCond.cxx | 306 ++++++++++--
 .../AtlasTrackingGeometryCondAlgConfig.py     | 214 +++++++-
 .../python/AtlasExtrapolationEngineConfig.py  |   9 +-
 .../TrkDetDescrAlgs/MaterialMapping.h         |   1 -
 .../TrkDetDescrAlgs/MaterialValidation.h      |   1 -
 .../python/TrkDetDescrAlgsConfig.py           |   2 +-
 .../scripts/RunMaterialMappingITk.py          |   2 +-
 .../scripts/RunMaterialValidationITk.py       |   2 +-
 .../IGeometryBuilderCond.h                    |  37 +-
 .../TrkExEngine/ExtrapolationEngine.h         |   1 -
 .../TrkExEngine/StaticNavigationEngine.h      |   1 -
 .../TrkExUnitTests/CMakeLists.txt             |   2 +
 .../python/TrkExUnitTestsConfig.py            |  96 ++++
 .../TrkExUnitTests/scripts/RunExEngineTest.py |  70 +++
 .../scripts/RunExEngineTestITk.py             |  78 +++
 .../share/TrkExUnitTestConfig.py              | 132 -----
 .../share/TrkExUnitTestITkConfig.py           | 147 ------
 20 files changed, 1143 insertions(+), 484 deletions(-)
 create mode 100644 Tracking/TrkExtrapolation/TrkExUnitTests/python/TrkExUnitTestsConfig.py
 create mode 100644 Tracking/TrkExtrapolation/TrkExUnitTests/scripts/RunExEngineTest.py
 create mode 100644 Tracking/TrkExtrapolation/TrkExUnitTests/scripts/RunExEngineTestITk.py
 delete mode 100644 Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestConfig.py
 delete mode 100644 Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestITkConfig.py

diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilderCond.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilderCond.h
index 54d0d1e41f6c..914877d1831b 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilderCond.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/SiLayerBuilderCond.h
@@ -58,10 +58,6 @@ namespace InDet {
      It performs an automated detector if an equidistant or non-equidistant binning
      is to be used for the barrel case.
      
-     There is an option to run in split mode for multiple pixel systems of different 
-     layer / endcap dimensions. In such a case, a cache is filled at the first time 
-     running for the pixel system of greater dimensions and just return in the second pass.
-
      @author Andreas.Salzburger@cern.ch
     */
   class ATLAS_NOT_THREAD_SAFE SiLayerBuilderCond : // static member variables are used.
@@ -98,6 +94,10 @@ namespace InDet {
       
       /** create the disc layers, if no vector is given, then it's the first pass, else it's the DBM for the Pixels */
       std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > createDiscLayers(const EventContext& ctx, std::vector<const Trk::DiscLayer* >* dLayers = nullptr) const;
+      
+      /** create the disc layers, it is dedicated to ITk implementation of the endcap rings.
+       * Used for ITk specific case. */
+      std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > createRingLayers(const EventContext& ctx) const;
         
       const Trk::BinnedLayerMaterial barrelLayerMaterial(double r, double hz) const;  //!< helper method to construct barrel material
       const Trk::BinnedLayerMaterial endcapLayerMaterial(double rMin, double rMax) const; //!< helper method to construct endcap material
@@ -121,7 +121,6 @@ namespace InDet {
       double                                         m_barrelEnvelope;                 //!< envelope around rMin/rMax
       double                                         m_barrelEdbTolerance;             //!< tolerance in percent how much the bin sizes can change
 
-      bool                                           m_endcapRingLayout;               //!< will not synchronise the rMin/rMax
       std::vector<double>                            m_endcapAdditionalLayerPosZ;      //!< Create additional endcaps at these z positions
       std::vector<int>                               m_endcapAdditionalLayerType;      //!< material layer 1 - navigation layer 0 ( for volume adjustment )
       size_t                                         m_endcapLayerBinsR;               //!< Barrel bins for the material in r
@@ -131,17 +130,15 @@ namespace InDet {
                                                      
       std::string                                    m_identification;                  //!< string identification  
       
-      int                                            m_splitMode;                       //!< Check for the split mode : -1 | 0 | 1 
-      double                                         m_splitTolerance;                  //!< difference in layer half length to provoke the split
-
-      static double                                  s_splitRadius;                     //!< Split radius for multiple pixel systems
-      static std::vector<const Trk::CylinderLayer*>  s_splitCylinderLayers;             //!< cached SLHC/split cylinder layers for projective layout
-      static std::vector<const Trk::DiscLayer*>      s_splitDiscLayers;                 //!< cached SLHC/split disc layers for projective layout
-      static EventIDRange                            s_splitIOVRange;                      //!< store range of splitLayers
-                                                     
       bool                                           m_runGeometryValidation;           //!< run the validation of the geometry ( no empty bins)
       SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCT_ReadKey{this, "SCT_ReadKey", "SCT_DetectorElementCollection", "Key of output SiDetectorElementCollection for SCT"};
       SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_PixelReadKey{this, "PixelReadKey", "PixelDetectorElementCollection", "Key of output SiDetectorElementCollection for Pixel"};
+      
+       std::vector<int>                              m_layerIndicesBarrel; //!< indices to be used for layer creation (used for ITk specific case)
+       std::vector<int>                              m_layerIndicesEndcap; //!< indices to be used for layer creation (used for ITk specific case)
+       bool                                          m_useRingLayout;      //!< to enable creation of rings for ITk pixel geometry (used for ITk specific case)
+       bool                                          m_addMoreSurfaces   ;              //!< to add additional surfaces to the SCT_OverlapDescriptor (used for ITk specific case)
+      
             
                       
   };
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
index 27695f6d4ae0..9459b4680e4f 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h
@@ -213,9 +213,14 @@ namespace InDet {
 
       /** helper method needed for the Ring layout */
       void checkForInsert(std::vector<double>& radii, double radius) const;
+      void checkForInsert(double rmin, double rmax, std::vector<std::pair<double, double>>& radii) const;
+      
+      /** Private helper method for merging of rings with z-overlap */
+      std::vector<const Trk::Layer*> checkZoverlap(std::vector<const Trk::Layer*>& lays) const; 
+      const Trk::Layer* mergeDiscLayers(std::vector<const Trk::Layer*>& dlays) const;
 
       // helper tools for the geometry building
-      ToolHandleArray<Trk::ILayerProviderCond>           m_layerProviders;          //!< Helper Tools for the Layer creation, includes beam pipe builder   
+      ToolHandleArray<Trk::ILayerProviderCond>       m_layerProviders;          //!< Helper Tools for the Layer creation, includes beam pipe builder   
       ToolHandle<Trk::ITrackingVolumeCreator>        m_trackingVolumeCreator;   //!< Helper Tool to create TrackingVolumes
       ToolHandle<Trk::ILayerArrayCreator>            m_layerArrayCreator;       //!< Helper Tool to create BinnedArrays
 
@@ -262,6 +267,30 @@ namespace InDet {
       // re-sort
       std::sort(radii.begin(),radii.end());   
   }
+  
+  inline void StagedTrackingGeometryBuilderCond::checkForInsert(double rmin, double rmax, std::vector<std::pair<double, double>>& radii) const {
+
+    // range into non-overlapping layers
+
+    if (!radii.size()) radii.push_back(std::pair<double,double>(rmin,rmax));
+    
+    unsigned int ir=0;
+    while ( ir != radii.size() && rmin > radii[ir].second ) ir++;
+
+    if (ir==radii.size()) radii.push_back(std::pair<double,double>(rmin,rmax));
+    // insert ?
+    else if (rmax<radii[ir].first) radii.insert(radii.begin()+ir,std::pair<double,double>(rmin,rmax));
+    // overlaps
+    else {
+      // resolve low edge
+      if (rmin<radii[ir].first) radii[ir].first=rmin;
+      // resolve upper edge
+      unsigned int imerge = ir;
+      while (imerge<radii.size()-1 && rmax>radii[imerge+1].first) imerge++;
+      radii[ir].second = rmax > radii[imerge].second ? rmax : radii[imerge].second;
+      if (imerge>ir) radii.erase(radii.begin()+ir+1,radii.begin()+imerge);       
+    }
+  }
 
 
 } // end of namespace
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx
index 942fcd43f53f..9b9eadb9a084 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/SiLayerBuilderCond.cxx
@@ -46,11 +46,6 @@
 // STL
 #include <map>
 
-std::vector<const Trk::CylinderLayer*> InDet::SiLayerBuilderCond::s_splitCylinderLayers;
-std::vector<const Trk::DiscLayer*>     InDet::SiLayerBuilderCond::s_splitDiscLayers;
-EventIDRange                           InDet::SiLayerBuilderCond::s_splitIOVRange;
-double InDet::SiLayerBuilderCond::s_splitRadius = 0.;
-    
 // constructor
 InDet::SiLayerBuilderCond::SiLayerBuilderCond(const std::string& t, const std::string& n, const IInterface* p) :
   AthAlgTool(t,n,p),
@@ -64,15 +59,14 @@ InDet::SiLayerBuilderCond::SiLayerBuilderCond(const std::string& t, const std::s
   m_barrelLayerBinsPhi(1),
   m_barrelEnvelope(0.1),
   m_barrelEdbTolerance(0.05),
-  m_endcapRingLayout(false),
   m_endcapLayerBinsR(100),
   m_endcapLayerBinsPhi(1),
   m_endcapEnvelope(0.1),
   m_endcapComplexRingBinning(true),
   m_identification("Pixel"),
-  m_splitMode(0),
-  m_splitTolerance(10.),   
-  m_runGeometryValidation(true)
+  m_runGeometryValidation(true),
+  m_useRingLayout(false),
+  m_addMoreSurfaces(false)
 {
   declareInterface<Trk::ILayerBuilderCond>(this);
   // general steering
@@ -87,7 +81,6 @@ InDet::SiLayerBuilderCond::SiLayerBuilderCond(const std::string& t, const std::s
   declareProperty("BarrelEnvelope"                   , m_barrelEnvelope);
   declareProperty("BarrelEdbTolerance"               , m_barrelEdbTolerance);
   // For the Active Endcap Material
-  declareProperty("EndcapRingLayout"                 , m_endcapRingLayout);
   declareProperty("EndcapAdditionalLayerPositionsZ"  , m_endcapAdditionalLayerPosZ);
   declareProperty("EndcapAdditionalLayerType"        , m_endcapAdditionalLayerType);
   declareProperty("EndcapLayerBinsR"                 , m_endcapLayerBinsR);
@@ -96,11 +89,15 @@ InDet::SiLayerBuilderCond::SiLayerBuilderCond(const std::string& t, const std::s
   declareProperty("EndcapComplexRingBinning"         , m_endcapComplexRingBinning);
   // identification
   declareProperty("Identification"                   , m_identification);
-  // split mode for multiple pixel systems (upgrade)
-  declareProperty("SplitMode"                        , m_splitMode);
-  declareProperty("SplitTolerance"                   , m_splitTolerance);      
   // Validation
   declareProperty("GeometryValidation"               , m_runGeometryValidation);
+  // for building sublayers for the tracking geometry (used for ITk pixel geometry)
+  declareProperty("LayerIndicesBarrel"               , m_layerIndicesBarrel);
+  declareProperty("LayerIndicesEndcap"               , m_layerIndicesEndcap);
+  // enables building of rings instead of discs
+  declareProperty("UseRingLayout"                    , m_useRingLayout);
+  // For OverlapDescriptor settings
+  declareProperty("AddMoreSurfaces"                  , m_addMoreSurfaces);
 }
 
 // destructor
@@ -174,19 +171,6 @@ SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> InDet::SiLayerBuilderCo
 std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::SiLayerBuilderCond::cylindricalLayers(const EventContext& ctx) const
 {
 
-  // split mode 2nd part return the already built layers 
-  if (m_splitMode && !s_splitCylinderLayers.empty() ){
-      ATH_MSG_DEBUG( "[ Split mode/ Part 2 ] Returning " << s_splitCylinderLayers.size() << " cylinder layers." );
-      ATH_MSG_VERBOSE( "                       Split radius was set to " << s_splitRadius );
-      std::vector<const Trk::CylinderLayer*>* splitCylinderLayers = dressCylinderLayers(s_splitCylinderLayers);
-      s_splitCylinderLayers.clear();
-      return std::make_pair(s_splitIOVRange, splitCylinderLayers); 
-  } else if (m_splitMode){
-      ATH_MSG_DEBUG( "[ Split mode/ Part 1 ] Initializing." );
-      s_splitRadius = m_splitMode < 0 ? 10e10 : 0.;
-  }
-  
-
   // sanity check for ID Helper
   if (!m_pixIdHelper && !m_sctIdHelper){
     ATH_MSG_ERROR("Neither Pixel nor SCT Detector Manager or ID Helper could be retrieved - giving up.");
@@ -204,16 +188,14 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si
   for (int i = 0; i < siNumerology.numLayers(); i++)
        if (siNumerology.useLayer(i)) barrelLayers++;
   
-
+  if (not m_layerIndicesBarrel.empty())
+    barrelLayers = m_layerIndicesBarrel.size();
+  
   // screen output
   ATH_MSG_DEBUG( "Configured to build " << barrelLayers << " (active) barrel layers (out of " << siNumerology.numLayers() << " )" );
   if (!m_barrelAdditionalLayerR.empty())
       ATH_MSG_DEBUG( "Additionally " <<  m_barrelAdditionalLayerR.size() << " material layers will be built.");  
       
-  // split mode for SLHC setup
-  if (m_splitMode)
-      ATH_MSG_DEBUG( "[ Split mode ] Some layers may be cached." );
-        
   // for barrels (the statistics for ordering the modules)
   std::vector<double>                                               layerRadius(barrelLayers,0.);
   std::vector<double>                                               layerRmin(barrelLayers,10e10);
@@ -247,21 +229,28 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si
   for (; sidetIter != readCdo->end(); ++sidetIter){
      // Barrel check
      if ((*sidetIter) && (*sidetIter)->isBarrel()){
-       // unit test
-       ++barrelModules;
        // get the identifier
        Identifier    currentId((*sidetIter)->identify());
-       int currentlayer = m_pixIdHelper ? m_pixIdHelper->layer_disk(currentId) : m_sctIdHelper->layer_disk(currentId);
+       int currentlayerIndex = m_pixIdHelper ? m_pixIdHelper->layer_disk(currentId) : m_sctIdHelper->layer_disk(currentId);
+       if (not m_layerIndicesBarrel.empty()) {
+         if (std::find(m_layerIndicesBarrel.begin(), m_layerIndicesBarrel.end(), currentlayerIndex) == m_layerIndicesBarrel.end())
+           continue;
+       }
+       // unit test
+       ++barrelModules;
        //skip the layer if it is chosen to be switched off
-       if ( !m_siMgr->numerology().useLayer(currentlayer) ) continue;
+       if ( !m_siMgr->numerology().useLayer(currentlayerIndex) ) continue;
+       // get layer index considering possible offset
+       int currentlayer = m_layerIndicesBarrel.empty() ? 
+                          currentlayerIndex : (currentlayerIndex-m_layerIndicesBarrel.at(0));
        // (A) Determination of phi / eta sectors  ---------------------------------------------------
        // only do the exercise if it hasn't been done already 
        if (layerPhiSectors[currentlayer] == 0){                        
           ATH_MSG_VERBOSE("Pre-processing Elements from Layer (id from idHelper): " << currentlayer );      
           // set number of phiSectors
-          layerPhiSectors[currentlayer] = m_siMgr->numerology().numPhiModulesForLayer(currentlayer);
+          layerPhiSectors[currentlayer] = m_siMgr->numerology().numPhiModulesForLayer(currentlayerIndex);
           // set number of etaSectors
-          layerZsectors[currentlayer] = m_siMgr->numerology().numEtaModulesForLayer(currentlayer);
+          layerZsectors[currentlayer] = m_siMgr->numerology().numEtaModulesForLayer(currentlayerIndex);
           // get the HalfLength of the Layer
           const InDetDD::SiDetectorElement* countPtr = (*sidetIter);
           // needed for the complex z binning if activated
@@ -289,7 +278,6 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si
            
            // complex z binning mode
            layerZboundaries[currentlayer] = zboundaries;
-           // chose which one to register for the split mode (SLHC)
            layerHalfLength[currentlayer] =  layerMinZ[currentlayer]*layerMinZ[currentlayer] > layerMaxZ[currentlayer]*layerMaxZ[currentlayer] ?
                fabs(layerMinZ[currentlayer]) : layerMaxZ[currentlayer];
            // get the haflength of the layer
@@ -313,10 +301,6 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si
        }
        takeSmaller( layerRmin[currentlayer], currentRmin );
        takeBigger(  layerRmax[currentlayer], currentRmax );
-
-       // handle the split mode
-       if (m_splitMode > 0) takeBigger(s_splitRadius, layerRadius[currentlayer]);
-       else if (m_splitMode < 0) takeSmaller (s_splitRadius, layerRadius[currentlayer]);
            
        // fill the Surface vector
        Amg::Vector3D orderPosition((*sidetIter)->center());
@@ -351,8 +335,6 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si
   for (auto& layerRadiusIter : layerRadius) {
                   
       Trk::CylinderLayer* activeLayer   = nullptr;
-      double currentLayerRadius         = 10e10;
-      bool splitDone                    = false;
       // non-equidistant binning used ? auto-detection 
       bool nonEquidistantBinning = false;
       {
@@ -441,21 +423,9 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si
          }
       }
 
-      // dynamic layer extend and splitDone check (split mode need the dynamic extend !)
+      // dynamic layer extend
       currentLayerExtend = layerHalfLength[layerCounter];
       
-      // check if split has been done
-      // split mode < 0 : compare to maxHalfLength
-      // split mode > 0 : compare to minHalflength
-      double compareHalfLengthZ = m_splitMode < 0 ? maxHalflengthZ : minHalflengthZ;
-      
-      splitDone = m_splitMode && fabs(layerHalfLength[layerCounter]-compareHalfLengthZ) > m_splitTolerance;
-      if (m_splitMode){
-           ATH_MSG_DEBUG( "[ Split mode / part 1 ] Layer Halflength determined as: " << layerHalfLength[layerCounter]);
-           ATH_MSG_DEBUG( "                               while minHalflengthZ is: " << minHalflengthZ );
-           ATH_MSG_DEBUG( "                                     -> consequence is: " << (splitDone ? "store for iteration 2" : "build") );
-       }
-      
       // dynamic layer extend determined by the sensitive layer dimensions
       layerRadius[layerCounter] = 0.5*(layerRmax[layerCounter] + layerRmin[layerCounter]);
       layerThickness[layerCounter] = layerRmax[layerCounter] - layerRmin[layerCounter];
@@ -489,10 +459,8 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si
       Trk::OverlapDescriptor* olDescriptor = nullptr;
       if (m_pixelCase)
           olDescriptor = new InDet::PixelOverlapDescriptor;
-      else olDescriptor = new  InDet::SCT_OverlapDescriptor;
-      // for eventual use with the passive layer
-      currentLayerRadius = layerRadius[layerCounter];
-
+      else olDescriptor = new  InDet::SCT_OverlapDescriptor(m_addMoreSurfaces);
+      
       // construct the layer (finally)
       activeLayer = new Trk::CylinderLayer(new Trk::CylinderBounds(layerRadius[layerCounter],currentLayerExtend),
                                            currentBinnedArray,
@@ -503,20 +471,11 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si
       const std::vector<const Trk::Surface*>& layerSurfaces     = currentBinnedArray->arrayObjects();
       registerSurfacesToLayer(layerSurfaces,*activeLayer);
 
-      // (3) register the layers --- either in the split vector or in the return vector 
-      if (splitDone) {
-          ATH_MSG_DEBUG( "[ Split mode / Part 1 ] Layer cached for Part 2" );
-          s_splitIOVRange = readHandle.getRange();
-          s_splitCylinderLayers.push_back(activeLayer);   
-          // get the split radius to the smallest one possible
-          if (m_splitMode > 0) takeSmaller( s_splitRadius, currentLayerRadius);
-          ATH_MSG_DEBUG("[ Split mode / part 1 ] Split radius (temproarily) set to : " << s_splitRadius );
-       } else {
-          if (m_splitMode < 0) takeBigger ( s_splitRadius, currentLayerRadius );
-          cylinderDetectionLayers.push_back(activeLayer);
-       } 
-       // increase the layer counter --- it is built
-       ++layerCounter;            
+      // (3) register the layers
+      cylinderDetectionLayers.push_back(activeLayer);
+       
+      // increase the layer counter --- it is built
+      ++layerCounter;            
 
   } // layer construction
   // --------------------------- enf of detection layer construction loop ----------------------------------
@@ -531,9 +490,6 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si
   if ( barrelModules-sumCheckBarrelModules )
      ATH_MSG_WARNING( barrelModules-sumCheckBarrelModules << " Modules not registered properly in binned array." );       
 
-  if (m_splitMode)
-     ATH_MSG_DEBUG("[ Split mode / part 1 ] Split radius determined as : " << s_splitRadius );
-
   ATH_MSG_DEBUG("Returning " << cylinderLayers->size() << " cylinder layers.");
   EventIDRange range = readHandle.getRange();
   std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> cylinderLayersPair = std::make_pair(range,cylinderLayers);
@@ -543,15 +499,6 @@ std::pair<EventIDRange, const std::vector<const Trk::CylinderLayer*>*> InDet::Si
 /** LayerBuilder interface method - returning Endcap-like layers */
 std::pair<EventIDRange, const std::vector<const Trk::DiscLayer*>*> InDet::SiLayerBuilderCond::discLayers(const EventContext& ctx) const
 {
- 
-  // TODO: remove s_splitDiscLayers cache to make threadsafe. ignored for now as is only for ITk
-  // split mode 2nd 
-  if (m_splitMode && !s_splitDiscLayers.empty() ){
-    ATH_MSG_DEBUG( "[ Split mode/ Part 2 ] Returning " << s_splitDiscLayers.size() << " disc layers." );
-    std::vector<const Trk::DiscLayer*>* splitDiscs = new std::vector<const Trk::DiscLayer*>(s_splitDiscLayers);
-    s_splitDiscLayers.clear();
-    return std::make_pair(s_splitIOVRange, splitDiscs); 
-  }
   // sanity check for ID Helper
   if (!m_pixIdHelper && !m_sctIdHelper){
        ATH_MSG_ERROR("Neither Pixel nor SCT Detector Manager or ID Helper could be retrieved - giving up.");
@@ -562,7 +509,7 @@ std::pair<EventIDRange, const std::vector<const Trk::DiscLayer*>*> InDet::SiLaye
 
   // check for DBMS
   int nDBMLayers = m_siMgr->numerology().numEndcapsDBM();
-  if (!nDBMLayers) return createDiscLayers(ctx);
+  if (!nDBMLayers) return ((m_pixelCase and m_useRingLayout) ? createRingLayers(ctx) : createDiscLayers(ctx));
   
   ATH_MSG_DEBUG( "Found " << m_siMgr->numerology().numEndcapsDBM() << " DBM layers active, building first ECs, then DBMS");
   std::pair<EventIDRange, std::vector<const Trk::DiscLayer*>*>  ecLayers = createDiscLayers(ctx);
@@ -601,9 +548,6 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu
      ATH_MSG_DEBUG( "Configured to build " << endcapLayers << " *2 disc-like layers  (+ additional support layers)." );
   }
  
-  if (m_splitMode) 
-      ATH_MSG_DEBUG( "[ Split mode ] Some layers may bee cached." );
-
   // prepare the vectors
   std::vector<double>                                     discZmin(2*endcapLayers,10e10);
   std::vector<double>                                     discZmax(2*endcapLayers,-10e10);
@@ -907,20 +851,16 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu
         }
         sumCheckEndcapModules +=  dsumCheckSurfaces;   
            
-        // force same size for material collection - may be refined later
-        double rMin = (m_splitMode || m_endcapRingLayout) ? discRmin[discCounter] : minRmin;
-        double rMax = (m_splitMode || m_endcapRingLayout) ? discRmax[discCounter] : maxRmax;
-       
         ATH_MSG_DEBUG( "  -> With Rmin/Rmax (corr) :  " << minRmin << " / " << maxRmax );
        
-       // get the layer material from the helper method
-        const Trk::LayerMaterialProperties& layerMaterial = endcapLayerMaterial(rMin,rMax);
+        // get the layer material from the helper method
+        const Trk::LayerMaterialProperties& layerMaterial = endcapLayerMaterial(minRmin,maxRmax);
 
         // position & bounds of the active Layer
         Amg::Transform3D activeLayerTransform ;
         activeLayerTransform = Amg::Translation3D(0.,0.,discZpos[discCounter]);
        
-        Trk::DiscBounds* activeLayerBounds    = new Trk::DiscBounds(rMin,rMax);
+        Trk::DiscBounds* activeLayerBounds    = new Trk::DiscBounds(minRmin,maxRmax);
         // prepare the right overlap descriptor       
         Trk::OverlapDescriptor* olDescriptor = nullptr;
         if (m_pixelCase)
@@ -950,21 +890,7 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu
         // register the layer to the surfaces --- if necessary to the other sie as well
         const std::vector<const Trk::Surface*>& layerSurfaces     = currentBinnedArray->arrayObjects();
         registerSurfacesToLayer(layerSurfaces,*activeLayer);
-        if (m_splitMode){
-            ATH_MSG_DEBUG( "[ Split mode ] Checking if this layer needs to be cached." );
-            s_splitIOVRange = readHandle.getRange();
-            if (m_splitMode < 0 && rMin > s_splitRadius){
-                ATH_MSG_VERBOSE( "            Split mode is negative and rMin > splitRadius (" << rMin  << " > " << s_splitRadius << ").");
-                ATH_MSG_VERBOSE( "            -> Caching this disk.");
-                s_splitDiscLayers.push_back(activeLayer);
-            }
-            else if (m_splitMode > 0 && rMax < s_splitRadius){
-                ATH_MSG_VERBOSE( "            Split mode is positive and rMax < splitRadius (" << rMax  << " < " << s_splitRadius << ").");
-                ATH_MSG_VERBOSE( "            -> Caching this disk.");
-                s_splitDiscLayers.push_back(activeLayer);
-            }
-        } else 
-            discLayers->push_back(activeLayer);
+        discLayers->push_back(activeLayer);
        // increase the disc counter by one
        ++discCounter;
        if (weOwnSingleBinUtils){
@@ -1057,7 +983,319 @@ std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBu
   return std::make_pair(range, discLayers);
 }
 
+/** LayerBuilder interface method - returning ring-like layers */
+/** this is ITk pixel specific and doesn't include DBM modules */
+std::pair<EventIDRange, std::vector< const Trk::DiscLayer* >* > InDet::SiLayerBuilderCond::createRingLayers(const EventContext& ctx) const {
+ 
+  // get general layout
+  SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> readHandle = retrieveSiDetElements(ctx);
+  if(*readHandle == nullptr){
+    EventIDRange range = IOVInfiniteRange::infiniteMixed();
+    return std::pair<EventIDRange, std::vector<const Trk::DiscLayer*>*>(range,nullptr);
+  }
+    
+  // save way to estimate the number of barrels
+  unsigned int endcapLayers = 0;
+  for (int i = 0; i < m_siMgr->numerology().numDiskLayers(); i++) {
+    if (not m_layerIndicesEndcap.empty() and 
+      std::find(m_layerIndicesEndcap.begin(), m_layerIndicesEndcap.end(), i)==m_layerIndicesEndcap.end() ) continue;
+    if (m_siMgr->numerology().useDiskLayer(i)) {
+      endcapLayers+=m_siMgr->numerology().numDisksForLayer(i);
+    }
+  }
+  
+  ATH_MSG_DEBUG( "Configured to build " << endcapLayers << " *2 disc-like layers  (+ additional support layers)." );
 
+  // prepare the vectors
+  std::vector<double>                                     discZmin(2*endcapLayers,10e10);
+  std::vector<double>                                     discZmax(2*endcapLayers,-10e10);
+  std::vector<double>                                     discZpos(2*endcapLayers,0.);
+  std::vector<double>                                     discRmin(2*endcapLayers,10e10);
+  std::vector<double>                                     discRmax(2*endcapLayers,0);
+  std::vector<double>                                     discThickness(2*endcapLayers,0.);  
+  std::vector<int>                                        discPhiSectors(2*endcapLayers,-1);
+  std::vector<double>                                     discPhiMin(2*endcapLayers,10e10);
+  std::vector<double>                                     discPhiMax(2*endcapLayers,-10e10);
+  std::vector< std::vector<Trk::SurfaceOrderPosition> >   discSurfaces(2*endcapLayers, std::vector<Trk::SurfaceOrderPosition>());  
+    
+  // let's make sure the discs are ordered in z: that's the z / map index
+  std::map< double, int>                                  discZposLayerIndex;  
+   
+  int endcapModules = 0;
+  int sumCheckEndcapModules = 0;
+  unsigned int currentdisk  = 0;
+  unsigned int currentring  = 0;
+  unsigned int currentlayer = 0;
+  
+  // [-A-] ------------------------ first LOOP over Detector Elements of sensitive layers -------------------------------                 
+  // -- get the missing dimensions by loop over DetElements
+  const InDetDD::SiDetectorElementCollection* readCdo{*readHandle};
+  InDetDD::SiDetectorElementCollection::const_iterator sidetIter = readCdo->begin();  
+  for (; sidetIter != readCdo->end(); ++sidetIter){
+     // take it - if 
+     // a) you have a detector element ... protection
+     // b) the detector element is EC
+     if ( (*sidetIter) && (*sidetIter)->isEndcap() ){     
+        // get the identifier & calculate current layer and current disk from it     
+        Identifier    currentId((*sidetIter)->identify());
+        currentring  = m_pixIdHelper->layer_disk(currentId);
+        if (not m_layerIndicesEndcap.empty() and std::find(m_layerIndicesEndcap.begin(), m_layerIndicesEndcap.end(), currentring) == m_layerIndicesEndcap.end())
+          continue;
+        
+        double currentZ = (*sidetIter)->center().z();
+        currentdisk = (unsigned int)m_pixIdHelper->eta_module(currentId);
+        currentlayer = currentdisk;
+        for (unsigned int i = 0; i < currentring; i++) {
+          if (not m_layerIndicesEndcap.empty() and 
+            std::find(m_layerIndicesEndcap.begin(), m_layerIndicesEndcap.end(), i)==m_layerIndicesEndcap.end() ) continue;
+          if (m_siMgr->numerology().useDiskLayer(i)) {
+            currentlayer+=m_siMgr->numerology().numDisksForLayer(i);
+          }
+        }
+        // parse all z positions for the mean value of the discs
+        currentlayer += currentZ > 0. ? endcapLayers : 0;
+        
+        // increase the counter of endcap modules
+        endcapModules++;
+        
+        takeSmallerBigger(discZmin[currentlayer],discZmax[currentlayer],currentZ);
+
+        // set the disc Rmin / Rmax  
+        double currentRmin = (*sidetIter)->rMin();
+        double currentRmax = (*sidetIter)->rMax();
+        
+        // the current phi 
+        double currentPhi = (*sidetIter)->center().phi();
+        takeSmaller(discRmin[currentlayer],currentRmin);
+        takeBigger( discRmax[currentlayer],currentRmax);       
+        
+        //fill the number of phi sectors for the different rings
+        if (discPhiSectors[currentlayer]<0){
+          ATH_MSG_VERBOSE("Pre-processing Elements from Disk/Layer (id from idHelper): " << currentring << "/" << currentdisk );
+          // get the number of phi sectors
+          unsigned int phiSectorsRing = m_siMgr->numerology().numPhiModulesForLayerDisk(currentring, currentdisk);
+          ATH_MSG_VERBOSE("--> has " << phiSectorsRing << " phi sectors");
+          discPhiSectors[currentlayer]=phiSectorsRing;
+        }
+//         we take the phi / r binning only from the closer to IP module 
+        // take phi-min and phimax
+        takeSmaller(discPhiMin[currentlayer],currentPhi);
+        takeBigger(discPhiMax[currentlayer],currentPhi);
+        
+        const InDetDD::SiDetectorElement* detElement = (*sidetIter);
+        // get the center position
+        const Amg::Vector3D& orderPosition = detElement->center();
+        // register the chosen side in the object array
+        Trk::SharedObject<const Trk::Surface> sharedSurface(&(detElement->surface()), Trk::do_not_delete<const Trk::Surface>);
+        Trk::SurfaceOrderPosition surfaceOrder(sharedSurface, orderPosition);
+        discSurfaces[currentlayer].push_back(surfaceOrder);
+        
+     } else if (!(*sidetIter))
+        ATH_MSG_WARNING("nullptr to Endcap module given by SCT_DetectorManager! Please check db & dict.xml");
+  } // DetElement loop 
+
+  ATH_MSG_VERBOSE("Estimating the average z position and the radius for each disk.");
+  // get the average z-position per layer & estimate thes thickness
+  for (unsigned int iec=0; iec<2*endcapLayers; ++iec){
+    // average it out
+    discZpos[iec]        = 0.5 * (discZmin[iec] + discZmax[iec]);
+    discThickness[iec]   = std::abs(discZmax[iec]-discZmin[iec]);
+    // make the map z / index
+    discZposLayerIndex.insert(std::make_pair(discZpos[iec],iec));
+  }
+      
+  // [-B-] ------------------------ Construction of the layers -----------------------------------
+  // construct the layers
+  std::vector< const Trk::DiscLayer* >* discLayers = new std::vector< const Trk::DiscLayer* >;
+  std::vector<double>::iterator discZposIter = discZpos.begin();
+  int discCounter = 0;
+                                              
+  for ( ; discZposIter != discZpos.end(); ++discZposIter){
+    // dynamic estimation 1: estimate the layer thickness dynamically
+    double thickness = discThickness[discCounter]+m_endcapEnvelope;       
+    
+    // screen output           
+    ATH_MSG_DEBUG( "Building a DiscLayer with single R sectors. " );
+    ATH_MSG_DEBUG( "  -> At Z - Position      :  " << discZpos[discCounter] );
+    ATH_MSG_DEBUG( "  -> With Thickness       :  " << thickness   << " i- ncludes envelope tolerance : " << m_endcapEnvelope );
+    ATH_MSG_DEBUG( "  -> With Rmin/Rmax (est) :  " << discRmin[discCounter] << " / " << discRmax[discCounter] );
+    
+    // prepare the binned array, it can be with one to several rings            
+    Trk::BinnedArray<Trk::Surface>* currentBinnedArray = nullptr;
+    
+    double halfPhiStep = M_PI/discPhiSectors[discCounter];
+    // protection in case phi value was fluctuating around 0 or M_PI in parsing
+    if (std::abs(discPhiMin[discCounter]+discPhiMax[discCounter])< halfPhiStep && std::abs(discPhiMin[discCounter]) < 0.5*halfPhiStep ){
+      ATH_MSG_VERBOSE("Detected module fluctuation around +/- M_PI, correcting for it.");
+      ATH_MSG_VERBOSE("    [0 - ] min phi / max phi detected  : "  << discPhiMin[discCounter] << " / " <<discPhiMax[discCounter]);
+      discPhiMin[discCounter] += 2*halfPhiStep;
+    }
+    
+    // prepare min phi and max phi & eventually a sub stepvalue
+    ATH_MSG_VERBOSE("    [1 - ] min phi / max phi detected  : " << discPhiMin[discCounter] << " / " << discPhiMax[discCounter] );
+    double minPhiCorrected = discPhiMin[discCounter]-halfPhiStep;
+    double maxPhiCorrected = discPhiMax[discCounter]+halfPhiStep;
+    // catch if the minPhi falls below M_PI
+    if (minPhiCorrected < -M_PI){
+      minPhiCorrected += 2*halfPhiStep;
+      maxPhiCorrected += 2*halfPhiStep;
+    }
+    
+    ATH_MSG_VERBOSE("    min phi / max phi corrected : " << minPhiCorrected << " / " << maxPhiCorrected );
+    ATH_MSG_VERBOSE("Constructing a one-dimensional BinnedArray with phiMin / phiMax (bins) = " 
+                     << minPhiCorrected << " / " << maxPhiCorrected
+                     << " (" << discPhiSectors[discCounter] << ")");
+    
+    Trk::BinUtility* currentBinUtility = new Trk::BinUtility(discPhiSectors[discCounter],
+                                                             minPhiCorrected,
+                                                             maxPhiCorrected,
+                                                             Trk::closed,
+                                                             Trk::binPhi);
+    
+    // a one-dimensional BinnedArray is sufficient
+    currentBinnedArray = new Trk::BinnedArray1D<Trk::Surface>(discSurfaces[discCounter],currentBinUtility);
+    
+    int discSurfacesNum = (discSurfaces[discCounter]).size();
+    ATH_MSG_DEBUG( "Constructed BinnedArray for DiscLayer with "<< discSurfacesNum << " SubSurfaces." );
+
+    // always run the geometry validation to catch flaws
+        
+    // checking for :
+    //   - empty surface bins
+    //   - doubly filled bins
+    std::map< const Trk::Surface*,Amg::Vector3D > uniqueSurfaceMap;
+    std::map< const Trk::Surface*,Amg::Vector3D >::iterator usmIter = uniqueSurfaceMap.end();
+    // check the registered surfaces in the binned array
+    const std::vector<const Trk::Surface*>& arraySurfaces = currentBinnedArray->arrayObjects();
+    size_t dsumCheckSurfaces = 0;
+    double lastPhi = 0.;
+    for (const auto & asurfIter : arraySurfaces){
+      if ( asurfIter ) {
+        ++dsumCheckSurfaces;
+        usmIter = uniqueSurfaceMap.find(asurfIter);
+        lastPhi = asurfIter->center().phi();
+        if ( usmIter != uniqueSurfaceMap.end() )
+          ATH_MSG_WARNING("Non-unique surface found with eta/phi = " << asurfIter->center().eta() << " / " << asurfIter->center().phi());
+        else uniqueSurfaceMap[asurfIter] = asurfIter->center();
+      } else 
+        ATH_MSG_WARNING("Zero-pointer in array detected in this ring, last valid phi value was = " << lastPhi);
+    }
+    sumCheckEndcapModules +=  dsumCheckSurfaces;   
+    
+    ATH_MSG_DEBUG( "  -> With Rmin/Rmax :  " << discRmin[discCounter] << " / " << discRmax[discCounter] );
+    
+    // get the layer material from the helper method
+    const Trk::LayerMaterialProperties& layerMaterial = endcapLayerMaterial(discRmin[discCounter],discRmax[discCounter]);
+
+    // position & bounds of the active Layer
+    Amg::Transform3D  activeLayerTransform;
+    activeLayerTransform = Amg::Translation3D(0.,0.,discZpos[discCounter]);
+    
+    Trk::DiscBounds* activeLayerBounds    = new Trk::DiscBounds(discRmin[discCounter],discRmax[discCounter]);
+    std::vector<Trk::BinUtility*>* binUtils = new std::vector<Trk::BinUtility*>;
+    // prepare the right overlap descriptor       
+    Trk::OverlapDescriptor* olDescriptor = new  InDet::DiscOverlapDescriptor(currentBinnedArray, binUtils, true);
+        
+    // layer creation; deletes currentBinnedArray in baseclass 'Layer' upon destruction
+    // activeLayerTransform deleted in 'Surface' baseclass
+    Trk::DiscLayer* activeLayer = new Trk::DiscLayer(activeLayerTransform,
+                                                     activeLayerBounds,
+                                                     currentBinnedArray,
+                                                     layerMaterial,
+                                                     thickness,
+                                                     olDescriptor);
+    // register the layer to the surfaces --- if necessary to the other sie as well
+    const std::vector<const Trk::Surface*>& layerSurfaces     = currentBinnedArray->arrayObjects();
+    registerSurfacesToLayer(layerSurfaces,*activeLayer);
+    discLayers->push_back(activeLayer);
+    // increase the disc counter by one
+    ++discCounter;
+  }  
+
+  ATH_MSG_DEBUG( endcapModules << " Endcap Modules parsed for Disc Layer dimensions." );
+  ATH_MSG_DEBUG( sumCheckEndcapModules << " Endcap Modules filled in Disc Layer Arrays." );
+  if ( endcapModules-sumCheckEndcapModules )
+    ATH_MSG_WARNING( endcapModules-sumCheckEndcapModules << " Modules not registered properly in binned array." );       
+
+ 
+  // sort the vector
+  Trk::DiscLayerSorterZ zSorter;
+  std::vector<const Trk::DiscLayer*>::iterator sortIter = discLayers->begin();
+  std::vector<const Trk::DiscLayer*>::iterator sortEnd   = discLayers->end(); 
+  std::sort(sortIter, sortEnd, zSorter);
+ 
+  // if there are additional layers to be built - never build for the DBM loop
+  if (!m_endcapAdditionalLayerPosZ.empty()){
+    // sort also the additional layer z positions
+    auto addLayerIter     = m_endcapAdditionalLayerPosZ.begin();
+    auto addLayerIterEnd  = m_endcapAdditionalLayerPosZ.end();
+    auto addLayerTypeIter = m_endcapAdditionalLayerType.begin();
+    // reassign the iterators
+    sortIter = discLayers->begin();
+    sortEnd   = discLayers->end();
+    // get the last rmin / rmax
+    double lastRmin = 0.;
+    double lastRmax = 0.;
+    // build the additional layers -------------------------------------------
+    for ( ; sortIter != sortEnd || addLayerIter != addLayerIterEnd; ){
+      // cache befor last parameters are overwritten 
+      double layerRmin       = lastRmin;
+      double layerRmax       = lastRmax;
+      double layerZposition   = 0.; 
+      // check if the z-position is smaller than the 
+      if ( sortIter != sortEnd){
+        // get the current z position to guarantee a symmetrical setup
+        layerZposition = (*sortIter)->surfaceRepresentation().center().z();
+        // get the bounds for the rMin / rMax setting
+        const Trk::DiscBounds* currentBounds = dynamic_cast<const Trk::DiscBounds*>(&((*sortIter)->surfaceRepresentation().bounds()));
+        lastRmin = currentBounds ? currentBounds->rMin() : 0.;
+        lastRmax = currentBounds ? currentBounds->rMax() : 0.;
+        ++sortIter;           
+      }
+      if ( addLayerIter != addLayerIterEnd){
+        // symmetric setup around 0.
+        double rMin = layerZposition > 0. ? layerRmin : lastRmin;
+        double rMax = layerZposition > 0. ? layerRmax : lastRmax;
+        // the passive layer
+        Trk::DiscLayer* passiveLayer = nullptr;
+        // passive layer creation
+        Amg::Transform3D passiveDiscTransf = Amg::Transform3D(Amg::Translation3D(0., 0., *addLayerIter));
+        if (*addLayerTypeIter) {
+          ATH_MSG_DEBUG("Building an additional DiscLayer w/o sensitive modules at");
+          // create the material and the passive layer
+          const Trk::LayerMaterialProperties& passiveLayerMaterial = endcapLayerMaterial(rMin, rMax);
+          passiveLayer = new Trk::DiscLayer(passiveDiscTransf,
+                                            new Trk::DiscBounds(rMin, rMax),
+                                            passiveLayerMaterial,
+                                            1. * Gaudi::Units::mm);
+        } else {
+          passiveLayer = new Trk::DiscLayer(passiveDiscTransf, 
+                                            new Trk::DiscBounds(rMin, rMax), 
+                                            nullptr);
+        }
+        ATH_MSG_DEBUG( "  -> At Z - Position       :  " << *addLayerIter );
+        ATH_MSG_DEBUG( "  -> With Rmin/Rmax (corr) :  " << rMin << " / " << rMax );
+         
+        // increase the iterator and push back the new layer
+        ++addLayerIter; 
+        discLayers->push_back(passiveLayer);
+      }
+    } // the additional layers are build ------------------------------------
+    
+    // another round of sorting needed after adding the passive layers
+    sortIter = discLayers->begin();
+    sortEnd   = discLayers->end(); 
+    std::sort(sortIter, sortEnd, zSorter);
+  }
+
+  ATH_MSG_DEBUG("Returning: " << discLayers->size() << " disk-like layers to the volume builder");
+  for (const auto& dl : (*discLayers)){
+    ATH_MSG_VERBOSE(" ----> Disk layer located at : " << dl->surfaceRepresentation().center().z());
+  }
+ 
+  EventIDRange range = readHandle.getRange();
+  return std::make_pair(range, discLayers);
+}
 
 std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilderCond::dressCylinderLayers(const std::vector< const Trk::CylinderLayer* >& detectionLayers ) const {
 
@@ -1075,14 +1313,6 @@ std::vector< const Trk::CylinderLayer* >* InDet::SiLayerBuilderCond::dressCylind
         double cylLayerExtend     = 0;
         for ( ; addLayerIter != addLayerIterEnd && addLayerTypeIter != addLayerTypeIterEnd; ) {
             // build the passive layer if it is smaller the current cylLayerIter - or if it is the last one 
-            if ( m_splitMode && !s_splitCylinderLayers.empty() ){
-                ATH_MSG_DEBUG("Called in split mode with split radius = " << s_splitRadius );
-                ATH_MSG_DEBUG("[- X -] Skipping additional layer " );
-                ATH_MSG_DEBUG( "  -> With Radius     :  " << *addLayerIter   );       
-                // increase the additional layer radii
-                ++addLayerIter; ++addLayerTypeIter; 
-                continue;
-            }
             if  ( cylLayerIter == cylLayerIterEnd || (*addLayerIter) < (*cylLayerIter)->bounds().r() ){
               cylLayerExtend = (cylLayerIter == cylLayerIterEnd) ? cylLayerExtend : (*cylLayerIter)->bounds().halflengthZ() ;  
               if ( (*addLayerTypeIter) ) {
diff --git a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
index fcf58061ca1e..928d101bd60c 100644
--- a/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
+++ b/InnerDetector/InDetDetDescr/InDetTrackingGeometry/src/StagedTrackingGeometryBuilderCond.cxx
@@ -8,14 +8,18 @@
 
 // InDet
 #include "InDetTrackingGeometry/StagedTrackingGeometryBuilderCond.h"
+#include "InDetTrackingGeometry/DiscOverlapDescriptor.h"
+#include "InDetReadoutGeometry/SiDetectorElement.h"
 // EnvelopeDefinitionService
 #include "SubDetectorEnvelopes/IEnvelopeDefSvc.h"
 // Trk interfaces
+#include "TrkDetDescrInterfaces/ILayerBuilderCond.h"
 #include "TrkDetDescrInterfaces/ILayerProviderCond.h"
 #include "TrkDetDescrInterfaces/ITrackingVolumeCreator.h"
 #include "TrkDetDescrInterfaces/ILayerArrayCreator.h"
 // Trk Geometry stuff
 #include "TrkDetDescrUtils/BinnedArray.h"
+#include "TrkDetDescrUtils/BinnedArray1D1D.h"
 #include "TrkVolumes/VolumeBounds.h"
 #include "TrkVolumes/CylinderVolumeBounds.h"
 #include "TrkGeometry/TrackingVolume.h"
@@ -69,6 +73,8 @@ InDet::StagedTrackingGeometryBuilderCond::StagedTrackingGeometryBuilderCond(cons
   // force robust layer indexing  
   declareProperty("IndexStaticLayers",                m_indexStaticLayers);
   declareProperty("CheckForRingLayout",               m_checkForRingLayout);
+  // minimal radial distance between rings to allow a split
+  declareProperty("MinimalRadialGapForVolumeSplit",   m_ringTolerance);
   // volume namespace & contaienr name
   declareProperty("VolumeNamespace",                  m_namespace); 
   declareProperty("ExitVolumeName",                   m_exitVolume);
@@ -477,24 +483,50 @@ bool InDet::StagedTrackingGeometryBuilderCond::setupFitsCache(LayerSetup& layerS
 }
  
 bool InDet::StagedTrackingGeometryBuilderCond::ringLayout(const std::vector<const Trk::Layer*>& layers, std::vector<double>& rmins, std::vector<double>& rmaxs) const {
-    // get the maximum extent in z
-    ATH_MSG_INFO("Checking for Ring layout ... ");
-    for (const auto & ring : layers){
-        // Surface
-        const Trk::Surface&     ringSurface = ring->surfaceRepresentation(); 
-        const Trk::DiscBounds*  ringBounds  = dynamic_cast<const Trk::DiscBounds*>(&(ringSurface.bounds()));
-        if (ringBounds){
-            // get the main parameters
-            double zpos         = ringSurface.center().z();
-            double rMin         = ringBounds->rMin();
-            double rMax         = ringBounds->rMax();
-            // take and check
-            checkForInsert(rmins,rMin);
-            checkForInsert(rmaxs,rMax);
-            ATH_MSG_INFO(" -> Ring at z-position " << zpos << " - with rMin/rMax = " << rMin << "/" << rMax );
-        }
+  // get the maximum extent in z
+  std::vector<std::pair<double,double>> radii;
+  ATH_MSG_DEBUG("Checking for Ring layout ... ");
+  for (auto& ring : layers) {
+    // Surface
+    const Trk::Surface&     ringSurface = ring->surfaceRepresentation(); 
+    const Trk::DiscBounds*  ringBounds  = dynamic_cast<const Trk::DiscBounds*>(&(ringSurface.bounds()));
+    if (ringBounds){
+      // get the main parameters
+      double zpos         = ringSurface.center().z();
+      double rMin         = ringBounds->rMin();
+      double rMax         = ringBounds->rMax();
+      // take and check the couple rmin/rmax
+      checkForInsert(rMin, rMax, radii);
+      ATH_MSG_DEBUG(" -> Ring at z-position " << zpos << " - with rMin/rMax = " << rMin << "/" << rMax );
     }
-    return (rmins.size() > 1 );
+  }
+  
+  // you need a post processing of the (rmin,rmax) in order to fit z-overlapping disks in the same ring
+  std::vector<std::pair<double,double>> tmpradii;
+  
+  for (auto& rs: radii) {
+    bool found = false;
+    for (auto& tmprs: tmpradii) {
+      if ((rs.first<tmprs.second and rs.second>tmprs.first) ) {
+        tmprs.first  = std::min(tmprs.first ,rs.first );
+        tmprs.second = std::max(tmprs.second,rs.second);
+        found = true;
+        break;
+      }
+    }
+    if (found) continue;
+    tmpradii.push_back(rs);
+  }
+   
+  // now you fill rmin and rmax
+  rmins.clear(); rmaxs.clear();
+  for (auto& r: tmpradii) {
+    rmins.push_back(r.first);
+    rmaxs.push_back(r.second);
+  }
+   
+  //add rmin and rmax
+  return (rmins.size() > 1 );
 }                                              
  
  
@@ -536,36 +568,70 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::createTrack
                 if (dring) groupedDiscs[rPos].push_back(dring);
             }
         }
-        // we are now grouped in cylinder rings per volume
-        for (int idset = 0; idset < int(groupedDiscs.size()); idset++){
-            // always keep the boundaries in mind for the radial extend
-            double crmin = idset ? ringRmaxa[idset-1]+m_layerEnvelopeCover : innerRadius;
-            double crmax = ringRmaxa[idset]+m_layerEnvelopeCover;
-	    if(idset==int(groupedDiscs.size())-1 && !doAdjustOuterRadius) crmax = outerRadius; 
-            // now create the sub volume
-            std::string ringVolumeName = volumeName+"Ring"+boost::lexical_cast<std::string>(idset);
-            const Trk::TrackingVolume* ringVolume = m_trackingVolumeCreator->createTrackingVolume(groupedDiscs[idset],
-                                                                                                  *m_materialProperties,
-                                                                                                  crmin,crmax,
-                                                                                                  zMin,zMax,
-                                                                                                  ringVolumeName,
-                                                                                                  binningType);
-             // push back into the 
-             ringVolumes.push_back(ringVolume);
+      // layer merging may be needed 
+      std::vector< std::vector< const Trk::Layer*> > mergedLayers;
+      std::vector< float > mergedRmax;
+      std::vector< std::vector< int > > merge;
+      std::vector<int> laySet(1,0); merge.push_back(laySet);
+      double rCurr = ringRmaxa[0];
+      mergedRmax.push_back(rCurr);
+      for (int idset = 1; idset < int(groupedDiscs.size()); idset++){
+        if (ringRmins[idset]<=rCurr + m_ringTolerance) {
+          merge.back().push_back(idset);
+          if (ringRmaxa[idset]>mergedRmax.back()) mergedRmax.back()=ringRmaxa[idset]; 
+        } else {
+          merge.push_back(std::vector<int>(1,idset));
+          mergedRmax.push_back(ringRmaxa[idset]);
         }
-        // set the outer radius
-        if(doAdjustOuterRadius) outerRadius = ringRmaxa[ringRmaxa.size()-1]+m_layerEnvelopeCover;
-        //
-        ATH_MSG_INFO("      -> adjusting the outer radius to the last ring at " << outerRadius );
-        ATH_MSG_INFO("      -> created " << ringVolumes.size() << " ring volumes for Volume '" << volumeName << "'.");
-        // create the tiple container
+        rCurr = ringRmaxa[idset];
+      } 
+      for ( auto layset : merge ) {
+        std::vector<const Trk::Layer*> ringSet;
+        for ( auto lay : layset ) {
+          for ( auto ring : groupedDiscs[lay]) {
+            float zPos = ring->surfaceRepresentation().center().z();
+            if (!ringSet.size() || zPos>ringSet.back()->surfaceRepresentation().center().z()) ringSet.push_back(ring);
+            else {
+              std::vector<const Trk::Layer*>::iterator lit = ringSet.begin();
+              while (lit!=ringSet.end() && zPos>(*lit)->surfaceRepresentation().center().z()) lit++;
+              ringSet.insert(lit,ring);  
+            }   
+          }
+        } 
+        // rings ordered in z : resolve overlap
+        mergedLayers.push_back(checkZoverlap(ringSet));
+      }
+      // we are now grouped in cylinder rings per volume
+      for (int idset = 0; idset < int(mergedLayers.size()); idset++){
+        // always keep the boundaries in mind for the radial extend
+        double crmin = idset ? mergedRmax[idset-1]+m_layerEnvelopeCover : innerRadius;
+        double crmax = mergedRmax[idset]+m_layerEnvelopeCover;
+        if(idset==int(mergedLayers.size())-1 && !doAdjustOuterRadius) crmax = outerRadius; 
+        // now create the sub volume
+        std::string ringVolumeName = volumeName+"Ring"+std::to_string(idset);
+        const Trk::TrackingVolume* ringVolume = m_trackingVolumeCreator->createTrackingVolume(mergedLayers[idset],
+                                                                                              *m_materialProperties,
+                                                                                              crmin,crmax,
+                                                                                              zMin,zMax,
+                                                                                              ringVolumeName,
+                                                                                              binningType);
+        // push back into the 
+        ringVolumes.push_back(ringVolume);
+      }
+      // set the outer radius
+      if(doAdjustOuterRadius) outerRadius = ringRmaxa[ringRmaxa.size()-1]+m_layerEnvelopeCover;
+      //
+      ATH_MSG_INFO("      -> adjusting the outer radius to the last ring at " << outerRadius );
+      ATH_MSG_INFO("      -> created " << ringVolumes.size() << " ring volumes for Volume '" << volumeName << "'.");
+      // create the tiple container
+      if (ringVolumes.size()==1)
+        return ringVolumes.at(0);
+      else 
         return m_trackingVolumeCreator->createContainerTrackingVolume(ringVolumes,
                                                                       *m_materialProperties,
                                                                       volumeName,
                                                                       m_buildBoundaryLayers,
                                                                       m_replaceJointBoundaries);
-        
-        
     } else 
         return m_trackingVolumeCreator->createTrackingVolume(layers,
                                                              *m_materialProperties,
@@ -714,3 +780,161 @@ const Trk::TrackingVolume* InDet::StagedTrackingGeometryBuilderCond::packVolumeT
                                                                 m_replaceJointBoundaries);
    return tripleContainer;
 }
+
+std::vector<const Trk::Layer*> InDet::StagedTrackingGeometryBuilderCond::checkZoverlap(std::vector<const Trk::Layer*>& lays) const 
+{
+  // look for layers to merge if they overlap in z
+  
+  // caching the layers with locations in z
+  std::map < float , std::vector<const Trk::Layer*> > locationAndLayers;
+  
+  // loop on the layers and save the location:
+  // if one layer location is compatible with 
+  // another one (considering the layer thickness)
+  // then the two layers have to be merged
+  for (auto lay : lays) {
+    float zpos= lay->surfaceRepresentation().center().z();
+    float thick = 0.5*lay->thickness(); 
+    
+    bool foundZoverlap = false;
+    for (auto& singlePosLayer : locationAndLayers) {
+      if (abs(zpos - singlePosLayer.first) < thick) {
+        singlePosLayer.second.push_back(lay);
+        foundZoverlap = true;
+        break;
+      }
+    }
+    
+    // if no overlap is found, a new location (with corresponding layer)
+    // has to be added to the map
+    if (not foundZoverlap) {
+      locationAndLayers[zpos] = std::vector<const Trk::Layer*>();
+      locationAndLayers[zpos].push_back(lay);
+    }       
+  }
+  
+  // If the number of final layers decreases, 
+  // merging is detected and discs need to be merged.
+  // The new merged layers are returned instead of the initial ones.
+  if (lays.size()>locationAndLayers.size()) {
+    std::vector<const Trk::Layer*> mergedDiscLayers;
+    for (auto& singlePosLayer : locationAndLayers) {      
+      const Trk::Layer* nd = mergeDiscLayers(singlePosLayer.second);
+      if (nd) mergedDiscLayers.push_back(nd); 
+      else {
+        ATH_MSG_WARNING("radial merge of rings failed, return the input layer set");
+        return lays;
+      }
+    }
+    return mergedDiscLayers;
+  } 
+  
+  return lays;
+  
+}
+
+const Trk::Layer* InDet::StagedTrackingGeometryBuilderCond::mergeDiscLayers (std::vector<const Trk::Layer*>& inputDiscs) const {
+
+  // if a single layer is input, no need for merging.
+  // Returning the layer
+  if (inputDiscs.size()==1)
+    return inputDiscs.at(0);
+ 
+  // on the input, disc layers overlapping in thickness : merge to a new DiscLayer
+  std::pair<float,float> zb(1.e5,-1.e5);
+  // order discs in radius
+  std::vector< std::pair<float,float> > rbounds; std::vector<size_t> discOrder;
+  size_t id=0;
+  for ( auto  lay : inputDiscs ) {
+    zb.first = fmin( zb.first, lay->surfaceRepresentation().center().z()-0.5*lay->thickness());
+    zb.second = fmax( zb.second, lay->surfaceRepresentation().center().z()+0.5*lay->thickness());
+    const Trk::DiscBounds* db = dynamic_cast<const Trk::DiscBounds*>(&(lay->surfaceRepresentation().bounds()));
+    if (!db) {
+      ATH_MSG_WARNING("attempt to merge non-disc layers, bailing out");
+      return 0;    
+    }
+    float r = db->rMin();
+    if (!rbounds.size() ||  r>rbounds.back().first) {
+      rbounds.push_back(std::pair<float,float> (r,db->rMax()));  
+      discOrder.push_back(id);
+    } else {
+      int ir=rbounds.size()-1;
+      while (ir>=0) {
+        if ( r>rbounds[ir].first ) break; 
+        ir--;
+      }
+      rbounds.insert(rbounds.begin()+ir+1,std::pair<float,float> (r,db->rMax()));  
+      discOrder.insert(discOrder.begin()+ir+1,id);           
+    }
+    id++;
+  }
+  
+  std::vector<float> rsteps; std::vector<const Trk::Surface*> surfs; 
+  std::vector<Trk::BinUtility*>* binUtils=new std::vector<Trk::BinUtility*>(); 
+  rsteps.push_back(rbounds[0].first);
+  for (unsigned int id=0; id<discOrder.size(); id++) {
+    unsigned int index=discOrder[id];
+    const Trk::SurfaceArray* surfArray = inputDiscs[index]->surfaceArray();    
+    if (surfArray) {
+      if (surfArray->binUtility()->binningValue()!=Trk::binPhi) {
+        ATH_MSG_WARNING("attempt to merge 2D disc arrays, bailing out");
+        return 0;
+      }
+      binUtils->push_back(surfArray->binUtility()->clone());
+      if (id+1<discOrder.size()) rsteps.push_back( 0.5*(rbounds[id].second+rbounds[id+1].first));
+      const std::vector<const Trk::Surface*> ringSurf =surfArray->arrayObjects();
+      surfs.insert(surfs.end(),ringSurf.begin(),ringSurf.end());
+            
+    }  
+  }
+  rsteps.push_back(rbounds.back().second);
+
+  std::vector< std::pair< Trk::SharedObject<const Trk::Surface>, Amg::Vector3D >  > surfaces;
+  for ( auto  sf : surfs ) {
+    Trk::SharedObject<const Trk::Surface> sharedSurface(sf,Trk::do_not_delete<const Trk::Surface>);
+    std::pair< Trk::SharedObject<const Trk::Surface>, Amg::Vector3D >  surfaceOrder(sharedSurface, sf->center());
+    surfaces.push_back(surfaceOrder);
+  }
+
+  // create merged binned array
+  // a two-dimensional BinnedArray is needed ; takes possession of binUtils and
+  // will delete it on destruction.
+  Trk::BinnedArray<Trk::Surface>* mergeBA = new Trk::BinnedArray1D1D<Trk::Surface>(surfaces,new Trk::BinUtility(rsteps,Trk::open,Trk::binR),binUtils);
+
+  //DiscOverlapDescriptor takes possession of clonedBinUtils, will delete it on destruction.
+  // but *does not* manage mergeBA.      
+  std::vector<Trk::BinUtility*>* clonedBinUtils = new std::vector<Trk::BinUtility*>();
+  for (auto bu : *binUtils) clonedBinUtils->push_back(bu->clone());
+  Trk::OverlapDescriptor* olDescriptor = new InDet::DiscOverlapDescriptor(mergeBA,clonedBinUtils,true);
+    
+  // position & bounds of the disc layer
+  double disc_thickness = std::fabs(zb.second-zb.first);
+  double disc_pos = (zb.first+zb.second)*0.5;
+
+  Amg::Transform3D transf;
+  transf = Amg::Translation3D(0.,0.,disc_pos);
+
+  // create disc layer
+  // layer creation; deletes mergeBA in baseclass 'Layer' upon destruction
+  const Trk::DiscLayer* layer = new Trk::DiscLayer(transf,
+                                                   new Trk::DiscBounds(rsteps.front(),rsteps.back()),
+                                                   mergeBA,
+                                                   // get the layer material from the first merged layer
+                                                   *(inputDiscs[0]->layerMaterialProperties()),
+                                                   disc_thickness,
+                                                   olDescriptor); 
+  
+   // register the layer to the surfaces 
+   const std::vector<const Trk::Surface*>& layerSurfaces     = mergeBA->arrayObjects();
+   for (auto sf : layerSurfaces) {
+     const InDetDD::SiDetectorElement* detElement = dynamic_cast<const InDetDD::SiDetectorElement*>(sf->associatedDetectorElement());
+     const std::vector<const Trk::Surface*>& allSurfacesVector = detElement->surfaces();
+     for (auto subsf : allSurfacesVector)  
+       Trk::IGeometryBuilderCond::associateLayer(*layer, const_cast<Trk::Surface&>(*subsf));
+   }
+   
+   for (auto disc : inputDiscs)   delete disc;      // cleanup
+
+   return layer; 
+
+}
diff --git a/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlgConfig.py b/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlgConfig.py
index d046c58fc567..8b5fb55b389d 100644
--- a/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlgConfig.py
+++ b/Tracking/TrkConditions/TrackingGeometryCondAlg/python/AtlasTrackingGeometryCondAlgConfig.py
@@ -12,23 +12,34 @@ from GaudiKernel.GaudiHandles import PrivateToolHandleArray
 # It is based on: https://gitlab.cern.ch/atlas/athena/blob/master/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py#L112
 
 def _setupCondDB(flags, CoolDataBaseFolder, quiet=True):
+  
     result=ComponentAccumulator()
     
     # the tag names
     materialTagBase = 'AtlasLayerMat_v'
-    version = 21
+    version = 21 
     sub_version = ''
     
-    AtlasMaterialTag = materialTagBase+str(version)+sub_version+'_'
-    cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>'
+    AtlasMaterialTag = materialTagBase+str(version)+sub_version
+    if flags.Detector.GeometryITk:
+      AtlasMaterialTag = flags.ITk.trackingGeometry.materialTag+str(flags.ITk.trackingGeometry.version)
+    cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'_/GeoAtlas</tag>'
 
+    if flags.Detector.GeometryITk and flags.ITk.trackingGeometry.loadLocalDbForMaterialMaps:
+        DataBaseName=flags.ITk.trackingGeometry.localDatabaseName
+        
+        from IOVDbSvc.IOVDbSvcConfig import addFolders
+        result.merge(addFolders(flags,"/GLOBAL/TrackingGeo/LayerMaterialITK",detDb=DataBaseName, tag=AtlasMaterialTag))
+        cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'</tag>'
+    
     # if not quiet:
     #   print('[ TrackingGeometrySvc ]     base material tag : ' + AtlasMaterialTag)
     #   print('[ TrackingGeometrySvc ]     translated to COOL: ' + cfolder)
 
     # load the right folders
-    result.merge( addFoldersSplitOnline(flags,'GLOBAL',[cfolder],[cfolder],splitMC=True,
-                                        className = 'Trk::LayerMaterialMap') )
+    result.merge( addFoldersSplitOnline(flags,'GLOBAL',[cfolder],[cfolder],
+                                        splitMC=True,className='Trk::LayerMaterialMap') )
+    
     return result
     
 def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, namePrefix='', nameSuffix='',setLayerAssociation = True, buildTrtStrawLayers = False):
@@ -209,7 +220,187 @@ def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc,
                                                 # Probably they should just be dropped, but I leave this comment for the moment so reviewers can have a think as well.
                                                 
                                                 # Barrel Entry layers (in old config) etc were removed in 323990adfce581a635ae1809fd2ecc6a093a704c (!)
+
+def _getITkTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, namePrefix='', nameSuffix='', setLayerAssociation = True):
+  # Based on https://gitlab.cern.ch/atlas/athena/blob/master/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilder.py
+  # A lot of comments below are to help people understand differences from the above, in case we need to revert some simplifications I made
+  # i.e. this is far from complete, but is better than what was there before.
   
+  # beampipe       
+  from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
+  result.merge(BeamPipeGeometryCfg(flags))
+  InDet__BeamPipeBuilder=CompFactory.InDet.BeamPipeBuilderCond
+  beamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix+'BeamPipeBuilder'+nameSuffix)
+  beamPipeBuilder.BeamPipeMaterialBinsZ = flags.ITk.trackingGeometry.beampipeMatZbins
+  result.addPublicTool(beamPipeBuilder)
+  BeamPipeBinning = 2  
+  
+  Trk__LayerProvider=CompFactory.Trk.LayerProviderCond
+  beamPipeProvider = Trk__LayerProvider(name=namePrefix+'BeamPipeProvider'+nameSuffix)
+  beamPipeProvider.LayerBuilder = beamPipeBuilder
+  result.addPublicTool(beamPipeProvider)  
+  
+  layerProviders = [beamPipeProvider]
+  binnings_barrel = [BeamPipeBinning]
+  binnings_endcap = [BeamPipeBinning]   
+  colors          = [2]
+  
+  # Pixel
+  if flags.Detector.GeometryITkPixel:
+    InDet__SiLayerBuilder=CompFactory.InDet.SiLayerBuilderCond
+    PixelLayerBuilderInner = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilderInner'+nameSuffix)
+    PixelLayerBuilderInner.PixelCase            = True
+    PixelLayerBuilderInner.Identification       = 'ITkPixelInner'
+    PixelLayerBuilderInner.SiDetManagerLocation = 'ITkPixel'
+    PixelLayerBuilderInner.PixelReadKey         = 'ITkPixelDetectorElementCollection'
+    PixelLayerBuilderInner.SCT_ReadKey          = 'ITkStripDetectorElementCollection'
+    PixelLayerBuilderInner.LayerIndicesBarrel   = [0,1]
+    PixelLayerBuilderInner.LayerIndicesEndcap   = [0,1,2]
+    PixelLayerBuilderInner.UseRingLayout=True
+    # Pixel barrel specifications
+    PixelLayerBuilderInner.BarrelLayerBinsZ     = flags.ITk.trackingGeometry.pixelBarrelMatZbins
+    PixelLayerBuilderInner.BarrelLayerBinsPhi   = flags.ITk.trackingGeometry.pixelBarrelMatPhiBins
+    PixelLayerBuilderInner.EndcapLayerBinsR     = flags.ITk.trackingGeometry.pixelEndcapMatRbins
+    PixelLayerBuilderInner.EndcapLayerBinsPhi   = flags.ITk.trackingGeometry.pixelEndcapMatPhiBins
+    
+    # set the layer association
+    PixelLayerBuilderInner.SetLayerAssociation  = setLayerAssociation
+
+    # the binning type of the layers   a
+    PixelLayerBinning = 2
+    # add it to tool service
+    result.addPublicTool(PixelLayerBuilderInner)
+    
+    pixelProviderInner = Trk__LayerProvider(name=namePrefix+'PixelProviderInner'+nameSuffix)
+    pixelProviderInner.LayerBuilder = PixelLayerBuilderInner
+    result.addPublicTool(pixelProviderInner)
+    # put them to the caches
+    layerProviders  += [pixelProviderInner]
+    binnings_barrel += [ PixelLayerBinning ]
+    binnings_endcap += [ PixelLayerBinning ]
+    colors          += [ 3 ]
+    
+    PixelLayerBuilderOuter = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilderOuter'+nameSuffix)
+    PixelLayerBuilderOuter.PixelCase            = True
+    PixelLayerBuilderOuter.Identification       = 'ITkPixelOuter'
+    PixelLayerBuilderOuter.SiDetManagerLocation = 'ITkPixel'
+    PixelLayerBuilderOuter.PixelReadKey         = 'ITkPixelDetectorElementCollection'
+    PixelLayerBuilderOuter.SCT_ReadKey          = 'ITkStripDetectorElementCollection'
+    PixelLayerBuilderOuter.LayerIndicesBarrel   = [2,3,4]
+    PixelLayerBuilderOuter.LayerIndicesEndcap   = [3,4,5,6,7,8]
+    PixelLayerBuilderOuter.UseRingLayout=True
+    # Pixel barrel specifications
+    PixelLayerBuilderOuter.BarrelLayerBinsZ     = flags.ITk.trackingGeometry.pixelBarrelMatZbins
+    PixelLayerBuilderOuter.BarrelLayerBinsPhi   = flags.ITk.trackingGeometry.pixelBarrelMatPhiBins
+    PixelLayerBuilderOuter.EndcapLayerBinsR     = flags.ITk.trackingGeometry.pixelEndcapMatRbins
+    PixelLayerBuilderOuter.EndcapLayerBinsPhi   = flags.ITk.trackingGeometry.pixelEndcapMatPhiBins
+    
+    # set the layer association
+    PixelLayerBuilderOuter.SetLayerAssociation  = setLayerAssociation
+
+    # the binning type of the layers   a
+    PixelLayerBinning = 2
+    # add it to tool service
+    result.addPublicTool(PixelLayerBuilderOuter)
+    
+    pixelProviderOuter = Trk__LayerProvider(name=namePrefix+'PixelProviderOuter'+nameSuffix)
+    pixelProviderOuter.LayerBuilder = PixelLayerBuilderOuter
+    result.addPublicTool(pixelProviderOuter)
+    # put them to the caches
+    layerProviders  += [pixelProviderOuter]
+    binnings_barrel += [ PixelLayerBinning ]
+    binnings_endcap += [ PixelLayerBinning ]
+    colors          += [ 3 ]
+
+  if flags.Detector.GeometryITkStrip:
+    # SCT building
+    SCT_LayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder'+nameSuffix)
+    SCT_LayerBuilder.PixelCase                       = False
+    SCT_LayerBuilder.Identification                  = 'ITkStrip'
+    SCT_LayerBuilder.SiDetManagerLocation            = 'ITkStrip'
+    SCT_LayerBuilder.PixelReadKey                    = 'ITkPixelDetectorElementCollection'
+    SCT_LayerBuilder.SCT_ReadKey                     = 'ITkStripDetectorElementCollection'
+    SCT_LayerBuilder.AddMoreSurfaces                 = True
+    # additionall layers - handle with care !
+    SCT_LayerBuilder.BarrelLayerBinsZ                = flags.ITk.trackingGeometry.stripBarrelMatZbins
+    SCT_LayerBuilder.BarrelLayerBinsPhi              = flags.ITk.trackingGeometry.stripBarrelMatPhiBins
+    SCT_LayerBuilder.EndcapLayerBinsR                = flags.ITk.trackingGeometry.stripEndcapMatRbins
+    SCT_LayerBuilder.EndcapLayerBinsPhi              = flags.ITk.trackingGeometry.stripEndcapMatPhiBins
+    # set the layer association                   
+    SCT_LayerBuilder.SetLayerAssociation             = setLayerAssociation        
+    # the binning type of the layer     
+    SCT_LayerBinning = 2
+    # SCT -> ToolSvc                             
+    result.addPublicTool(SCT_LayerBuilder)
+    
+    stripProvider = Trk__LayerProvider(name=namePrefix+'StripProvider'+nameSuffix)
+    stripProvider.LayerBuilder = SCT_LayerBuilder
+    result.addPublicTool(stripProvider)
+    
+    # put them to the caches
+    layerProviders  += [stripProvider]
+    binnings_barrel += [ SCT_LayerBinning ]
+    binnings_endcap += [ SCT_LayerBinning ]
+    colors          += [ 4 ]
+  
+  # helpers for the InDetTrackingGeometry Builder : layer array creator
+  Trk__LayerArrayCreator=CompFactory.Trk.LayerArrayCreator
+  InDetLayerArrayCreator = Trk__LayerArrayCreator(name = 'InDetLayerArrayCreator')
+  InDetLayerArrayCreator.EmptyLayerMode           = 2 # deletes empty material layers from arrays
+  # add to ToolSvc
+  result.addPublicTool(InDetLayerArrayCreator)  
+
+  # helpers for the InDetTrackingGeometry Builder : volume array creator
+  Trk__TrackingVolumeArrayCreator= CompFactory.Trk.TrackingVolumeArrayCreator
+  InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(name = 'InDetTrackingVolumeArrayCreator')
+  # add to ToolSvc
+  result.addPublicTool(InDetTrackingVolumeArrayCreator)  
+
+  # helpers for the InDetTrackingGeometry Builder : tracking volume helper for gluing
+  Trk__TrackingVolumeHelper=CompFactory.Trk.TrackingVolumeHelper
+  InDetTrackingVolumeHelper                             = Trk__TrackingVolumeHelper(name ='InDetTrackingVolumeHelper')
+  InDetTrackingVolumeHelper.BarrelLayerBinsZ   = flags.ITk.trackingGeometry.passiveBarrelMatZbins
+  InDetTrackingVolumeHelper.BarrelLayerBinsPhi = flags.ITk.trackingGeometry.passiveBarrelMatPhiBins
+  InDetTrackingVolumeHelper.EndcapLayerBinsR   = flags.ITk.trackingGeometry.passiveEndcapMatRbins
+  InDetTrackingVolumeHelper.EndcapLayerBinsPhi = flags.ITk.trackingGeometry.passiveEndcapMatPhiBins
+    
+  # the material bins - assume defaults
+  # add to ToolSvc
+  result.addPublicTool(InDetTrackingVolumeHelper)  
+  
+  # helpers for the InDetTrackingGeometry Builder : cylinder volume creator
+  Trk__CylinderVolumeCreator=CompFactory.Trk.CylinderVolumeCreator
+  InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = 'InDetCylinderVolumeCreator')
+  # give it the layer array creator
+  InDetCylinderVolumeCreator.LayerArrayCreator = InDetLayerArrayCreator
+  InDetCylinderVolumeCreator.TrackingVolumeArrayCreator = InDetTrackingVolumeArrayCreator
+  InDetCylinderVolumeCreator.TrackingVolumeHelper       = InDetTrackingVolumeHelper
+  InDetCylinderVolumeCreator.PassiveLayerBinsRZ   = flags.ITk.trackingGeometry.passiveBarrelMatZbins
+  InDetCylinderVolumeCreator.PassiveLayerBinsPhi  = flags.ITk.trackingGeometry.passiveBarrelMatPhiBins
+        
+  # specifiy the binning, passive layers, entry layers - assume defaults
+  # add to ToolSvc
+  result.addPublicTool(InDetCylinderVolumeCreator)  
+  
+  if (namePrefix+name+nameSuffix).find('CondCond')>=0 :
+      raise Exception('Invalid name composition %s + %s + %s ' % (namePrefix,name,nameSuffix))
+  
+  # the tracking geometry builder
+  InDet__StagedTrackingGeometryBuilder=CompFactory.InDet.StagedTrackingGeometryBuilderCond
+  return InDet__StagedTrackingGeometryBuilder(namePrefix+name+nameSuffix,
+                                              LayerBuilders     = layerProviders,
+                                              LayerBinningTypeCenter    = binnings_barrel,
+                                              LayerBinningTypeEndcap    = binnings_endcap,
+                                              ColorCodes                = colors,
+                                              EnvelopeDefinitionSvc     = envelopeDefinitionSvc,
+                                              TrackingVolumeCreator     = InDetCylinderVolumeCreator,
+                                              LayerArrayCreator         = InDetLayerArrayCreator,
+                                              CheckForRingLayout        = True,
+                                              MinimalRadialGapForVolumeSplit = flags.ITk.trackingGeometry.minimalRadialGapForVolumeSplit,                                              
+                                              ReplaceAllJointBoundaries = True,
+                                              BuildBoundaryLayers=True,
+                                              ExitVolumeName='InDet::Containers::InnerDetector')
+
 # Replaces https://gitlab.cern.ch/atlas/athena/blob/master/Calorimeter/CaloTrackingGeometry/python/ConfiguredCaloTrackingGeometryBuilder.py
 def _getCaloTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, trackingVolumeHelper, namePrefix='',nameSuffix=''):
   # The following replaces LArCalorimeter/LArTrackingGeometry/python/ConfiguredLArVolumeBuilder.py
@@ -274,6 +465,15 @@ def TrackingGeometryCondAlgCfg( flags , name = 'AtlasTrackingGeometryCondAlg', d
       
       atlas_geometry_builder.InDetTrackingGeometryBuilder = inDetTrackingGeometryBuilder
       
+    elif flags.Detector.GeometryITk:
+      inDetTrackingGeometryBuilder = _getITkTrackingGeometryBuilder(name ='InDetTrackingGeometryBuilder', 
+                                                                    flags=flags, 
+                                                                    result=result,
+                                                                    envelopeDefinitionSvc=atlas_env_def_service,
+                                                                    namePrefix=namePrefix,
+                                                                    nameSuffix=nameSuffix)
+      atlas_geometry_builder.InDetTrackingGeometryBuilder = inDetTrackingGeometryBuilder
+      
     if flags.Detector.GeometryCalo:
       Trk__CylinderVolumeCreator=CompFactory.Trk.CylinderVolumeCreator
       caloVolumeCreator = Trk__CylinderVolumeCreator(namePrefix+"CaloVolumeCreator"+nameSuffix)
@@ -323,9 +523,11 @@ def TrackingGeometryCondAlgCfg( flags , name = 'AtlasTrackingGeometryCondAlg', d
     
     if flags.TrackingGeometry.MaterialSource == 'COOL':
        CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialV2' # Was from TrkDetFlags.MaterialStoreGateKey()
+       if flags.Detector.GeometryITk:
+         CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialITK'
        # the material provider
        Trk__LayerMaterialProvider=CompFactory.Trk.LayerMaterialProvider
-       atlasMaterialProvider = Trk__LayerMaterialProvider('AtlasMaterialProvider', LayerMaterialMapName=CoolDataBaseFolder)
+       atlasMaterialProvider = Trk__LayerMaterialProvider('AtlasMaterialProvider', LayerMaterialMapName=CoolDataBaseFolder, LayerMaterialMapKey=CoolDataBaseFolder)
        atlas_geometry_processors += [ atlasMaterialProvider ]
 
        # Setup DBs
diff --git a/Tracking/TrkConfig/python/AtlasExtrapolationEngineConfig.py b/Tracking/TrkConfig/python/AtlasExtrapolationEngineConfig.py
index 84c33176574b..a1369984ec3a 100644
--- a/Tracking/TrkConfig/python/AtlasExtrapolationEngineConfig.py
+++ b/Tracking/TrkConfig/python/AtlasExtrapolationEngineConfig.py
@@ -60,7 +60,8 @@ def AtlasExtrapolationEngineCfg( flags, name = 'Extrapolation', nameprefix='Atla
     # give the tools it needs 
     staticNavigator.PropagationEngine        = staticPropagator
     staticNavigator.MaterialEffectsEngine    = materialEffectsEngine
-    staticNavigator.TrackingGeometrySvc         = geom_svc
+    if not use_tracking_geometry_cond_alg :
+      staticNavigator.TrackingGeometrySvc         = geom_svc
     staticNavigator.TrackingGeometryReadKey     = geom_cond_key        
     # Geometry name
     # configure output formatting               
@@ -86,11 +87,13 @@ def AtlasExtrapolationEngineCfg( flags, name = 'Extrapolation', nameprefix='Atla
     extrapolator = ExEngine(name=nameprefix+'Extrapolation',
                       ExtrapolationEngines   = [ staticExtrapolator ], 
                       PropagationEngine      = staticPropagator, 
-                      NavigationEngine       = staticNavigator, 
-                      TrackingGeometrySvc    = geom_svc, 
+                      NavigationEngine       = staticNavigator,
                       TrackingGeometryReadKey = geom_cond_key,
                       OutputPrefix           = '[ME] - ', 
                       OutputPostfix          = ' - ')
+    if not use_tracking_geometry_cond_alg :
+      extrapolator.TrackingGeometrySvc         = geom_svc
+      
     result.addPublicTool(extrapolator, primary=True)
     return result
 
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialMapping.h b/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialMapping.h
index ab803dd50ca7..3d3f7977e87d 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialMapping.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialMapping.h
@@ -8,7 +8,6 @@
 
 #ifndef TRKDETDESCRALGS_MATERIALMAPPING_H
 #define TRKDETDESCRALGS_MATERIALMAPPING_H
-#define LEGACY_TRKGEOM
 
 // Athena & Gaudi includes
 #include "AthenaBaseComps/AthAlgorithm.h"
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialValidation.h b/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialValidation.h
index 0da48192283e..bbd9c4d15e68 100755
--- a/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialValidation.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/TrkDetDescrAlgs/MaterialValidation.h
@@ -8,7 +8,6 @@
 
 #ifndef TRKDETDESCRALGS_MATERIALVALIDATION_H
 #define TRKDETDESCRALGS_MATERIALVALIDATION_H
-#define LEGACY_TRKGEOM
 
 // Gaudi includes
 #include "AthenaBaseComps/AthAlgorithm.h"
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/python/TrkDetDescrAlgsConfig.py b/Tracking/TrkDetDescr/TrkDetDescrAlgs/python/TrkDetDescrAlgsConfig.py
index dfb7f27d9fc3..028f74bd8641 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrAlgs/python/TrkDetDescrAlgsConfig.py
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/python/TrkDetDescrAlgsConfig.py
@@ -81,7 +81,7 @@ def ITkMaterialMappingCfg(flags, name="ITkMaterialMapping", **kwargs):
   result.merge(OutputConditionsAlgCfg(flags, name = "CondAlg_Material",
                                       outputFile="AtlasLayerMaterial.pool.root",
                                       ObjectList=['Trk::LayerMaterialMap#'+LayerMaterialDirectory+LayerMaterialName],
-                                      WriteIOV=True,IOVTagList=[flags.ITk.trackingGeometry.materialTag] ))
+                                      WriteIOV=True,IOVTagList=[flags.ITk.trackingGeometry.materialTag+str(flags.ITk.trackingGeometry.version)] ))
   
   result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = True))
   
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialMappingITk.py b/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialMappingITk.py
index 3af26e28265b..610a438406e0 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialMappingITk.py
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialMappingITk.py
@@ -59,7 +59,7 @@ if os.path.exists('./PoolFileCatalog.xml') :
 ConfigFlags.Input.isMC             = True
 
 if args.localgeo:
-  configFlags.GeoModel.useLocalGeometry = True
+  ConfigFlags.GeoModel.useLocalGeometry = True
   
 from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
 detectors = args.detectors if 'detectors' in args and args.detectors else ['ITkPixel', 'ITkStrip']
diff --git a/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialValidationITk.py b/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialValidationITk.py
index 38c1610bc4b4..2dfea523a6a0 100644
--- a/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialValidationITk.py
+++ b/Tracking/TrkDetDescr/TrkDetDescrAlgs/scripts/RunMaterialValidationITk.py
@@ -41,7 +41,7 @@ print()
 ConfigFlags.Input.isMC             = True
 
 if args.localgeo:
-  configFlags.GeoModel.useLocalGeometry = True
+  ConfigFlags.GeoModel.useLocalGeometry = True
   
 from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
 detectors = args.detectors if 'detectors' in args and args.detectors else ['ITkPixel', 'ITkStrip']
diff --git a/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/IGeometryBuilderCond.h b/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/IGeometryBuilderCond.h
index bc267f9a7adc..6ed288cda37a 100755
--- a/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/IGeometryBuilderCond.h
+++ b/Tracking/TrkDetDescr/TrkDetDescrInterfaces/TrkDetDescrInterfaces/IGeometryBuilderCond.h
@@ -1,7 +1,7 @@
-/*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-*/
-
+/*
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+*/
+
 ///////////////////////////////////////////////////////////////////
 // IGeometryBuilderCond.hm (c) ATLAS Detector software
 ///////////////////////////////////////////////////////////////////
@@ -11,19 +11,22 @@
 
 // Gaudi
 #include "GaudiKernel/IAlgTool.h"
-#include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/EventContext.h"
 // Trk - enum
 #include "TrkDetDescrUtils/GeometrySignature.h"
+#include "TrkSurfaces/Surface.h"
+
 // STL
 #include <vector>
-
-#include "CxxUtils/checker_macros.h"
 
-class EventIDRange;
+#include "CxxUtils/checker_macros.h"
+
+class EventIDRange;
 namespace Trk {
 
   class TrackingGeometry;
   class TrackingVolume;
+  class Layer;
 
   /** Interface ID for IGeometryBuilderConds*/  
   static const InterfaceID IID_IGeometryBuilderCond("IGeometryBuilderCond", 1, 0);
@@ -50,17 +53,25 @@ namespace Trk {
       static const InterfaceID& interfaceID() { return IID_IGeometryBuilderCond; }
 
       /** TrackingGeometry Interface methode -
-       *   - Event context
-       *   - pair with EventIDRange and corresponding TrackingVolume, from which
-       *     we retrieve the volume to wrap the TrackingGeometry around. If
-       *     TrackingGeometry is nullptr, range should be infinite (so
-       *     intersecting with another range has no effect)
+       *   - Event context
+       *   - pair with EventIDRange and corresponding TrackingVolume, from which
+       *     we retrieve the volume to wrap the TrackingGeometry around. If
+       *     TrackingGeometry is nullptr, range should be infinite (so
+       *     intersecting with another range has no effect)
        */
       virtual std::pair<EventIDRange, const TrackingGeometry*> trackingGeometry ATLAS_NOT_THREAD_SAFE (const EventContext& ctx, std::pair<EventIDRange, const Trk::TrackingVolume*> tVolPair) const = 0;
 
       /** The unique signature */
       virtual GeometrySignature geometrySignature() const = 0;
       
+    protected:
+      /** Protected method to register the Layer to the Surface */
+      void associateLayer(const Layer& lay, Surface& sf) const
+      {
+        sf.associateLayer(lay);
+      }
+    
+      
   };
 
 } // end of namespace
diff --git a/Tracking/TrkExtrapolation/TrkExEngine/TrkExEngine/ExtrapolationEngine.h b/Tracking/TrkExtrapolation/TrkExEngine/TrkExEngine/ExtrapolationEngine.h
index 12ef0163ceba..42438d36c3bc 100644
--- a/Tracking/TrkExtrapolation/TrkExEngine/TrkExEngine/ExtrapolationEngine.h
+++ b/Tracking/TrkExtrapolation/TrkExEngine/TrkExEngine/ExtrapolationEngine.h
@@ -8,7 +8,6 @@
 
 #ifndef TRKEXINTERFACES_EXTRAPOLATIONENGINE_H
 #define TRKEXINTERFACES_EXTRAPOLATIONENGINE_H
-#define LEGACY_TRKGEOM
 
 // Gaudi
 #include "AthenaBaseComps/AthAlgTool.h"
diff --git a/Tracking/TrkExtrapolation/TrkExEngine/TrkExEngine/StaticNavigationEngine.h b/Tracking/TrkExtrapolation/TrkExEngine/TrkExEngine/StaticNavigationEngine.h
index 0ee74633da98..97ea152a163c 100644
--- a/Tracking/TrkExtrapolation/TrkExEngine/TrkExEngine/StaticNavigationEngine.h
+++ b/Tracking/TrkExtrapolation/TrkExEngine/TrkExEngine/StaticNavigationEngine.h
@@ -8,7 +8,6 @@
 
 #ifndef TRKEXENGINE_STATICNAVIGATIONENGINE_H
 #define TRKEXENGINE_STATICNAVIGATIONENGINE_H
-#define LEGACY_TRKGEOM
 
 // Gaudi
 #include "AthenaBaseComps/AthAlgTool.h"
diff --git a/Tracking/TrkExtrapolation/TrkExUnitTests/CMakeLists.txt b/Tracking/TrkExtrapolation/TrkExUnitTests/CMakeLists.txt
index 7e77ac6331dd..36595854a126 100644
--- a/Tracking/TrkExtrapolation/TrkExUnitTests/CMakeLists.txt
+++ b/Tracking/TrkExtrapolation/TrkExUnitTests/CMakeLists.txt
@@ -12,3 +12,5 @@ atlas_add_component( TrkExUnitTests
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AtlasDetDescr GeoPrimitives Identifier HGTD_Identifier InDetReadoutGeometry GaudiKernel InDetIdentifier TrkGeometry TrkEventPrimitives TrkNeutralParameters TrkParameters TrkExInterfaces TrkExUtils TrkValInterfaces )
+
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
diff --git a/Tracking/TrkExtrapolation/TrkExUnitTests/python/TrkExUnitTestsConfig.py b/Tracking/TrkExtrapolation/TrkExUnitTests/python/TrkExUnitTestsConfig.py
new file mode 100644
index 000000000000..df993d7e301b
--- /dev/null
+++ b/Tracking/TrkExtrapolation/TrkExUnitTests/python/TrkExUnitTestsConfig.py
@@ -0,0 +1,96 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+"""Define methods to configure TrkExUnitTest"""
+
+def PositionMomentumWriterCfg(configFlags, name="PositionMomentumWriter", **kwargs) :
+  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator 
+  from AthenaConfiguration.ComponentFactory import CompFactory
+
+  result = ComponentAccumulator()
+
+  Trk__PositionMomentumWriter = CompFactory.Trk.PositionMomentumWriter
+  posMomWriter = Trk__PositionMomentumWriter(name, **kwargs)
+  result.addPublicTool(posMomWriter)
+  #result.setPrivateTools(posMomWriter)
+  return result, posMomWriter
+
+def ExtrapolationEngineTestCfg(configFlags, name = "ExtrapolationEngineTest", **kwargs ) :
+  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator 
+  from AthenaConfiguration.ComponentFactory import CompFactory
+  
+  result=ComponentAccumulator()  
+  
+  from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg     
+  result.merge(InDetGeometryCfg(configFlags))
+  
+  from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
+  result.merge(BeamPipeGeometryCfg(configFlags))
+  
+  from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
+  result.merge(TrackingGeometrySvcCfg(configFlags))
+  
+  histSvc = CompFactory.THistSvc(Output = ["val DATAFILE='ExtrapolationEngineTest.root' TYPE='ROOT' OPT='RECREATE'"])
+  result.addService( histSvc )    
+    
+  from AtlasGeoModel.GeoModelConfig import GeoModelCfg
+  gmsAcc = GeoModelCfg(configFlags)
+  result.merge(gmsAcc)
+
+  from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
+  extrapAcc = AtlasExtrapolationEngineCfg(configFlags)
+  extrapolationEngine = extrapAcc.getPrimary()
+  result.merge(extrapAcc)
+  kwargs["ExtrapolationEngine"] = extrapolationEngine
+
+  posMomAcc, posMomWriter = PositionMomentumWriterCfg(configFlags)
+  result.merge(posMomAcc)
+  kwargs.setdefault('PositionMomentumWriter', posMomWriter)
+     
+  Trk__ExtrapolationEngineTest = CompFactory.Trk.ExtrapolationEngineTest
+  extrapolationTest = Trk__ExtrapolationEngineTest(name, **kwargs)
+  result.addEventAlgo(extrapolationTest)
+  
+  return result
+
+def ExtrapolationEngineTestITkCfg(configFlags, name = "ExtrapolationEngineTest", **kwargs ) :
+  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator 
+  from AthenaConfiguration.ComponentFactory import CompFactory
+  
+  result=ComponentAccumulator()  
+  
+  from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelGeometryCfg
+  itkPixel = ITkPixelGeometryCfg(configFlags)
+  result.merge(itkPixel)
+  
+  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripGeometryCfg
+  itkStrip = ITkStripGeometryCfg(configFlags)
+  result.merge(itkStrip)
+  
+  from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
+  result.merge(BeamPipeGeometryCfg(configFlags))
+  
+  from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
+  result.merge(TrackingGeometrySvcCfg(configFlags))
+  
+  histSvc = CompFactory.THistSvc(Output = ["val DATAFILE='ExtrapolationEngineTestITk.root' TYPE='ROOT' OPT='RECREATE'"])
+  result.addService( histSvc )
+  
+  from AtlasGeoModel.GeoModelConfig import GeoModelCfg
+  gmsAcc = GeoModelCfg(configFlags)
+  result.merge(gmsAcc)
+
+  from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
+  extrapAcc = AtlasExtrapolationEngineCfg(configFlags)
+  extrapolationEngine = extrapAcc.getPrimary()
+  result.merge(extrapAcc)
+  kwargs["ExtrapolationEngine"] = extrapolationEngine
+
+  posMomAcc, posMomWriter = PositionMomentumWriterCfg(configFlags)
+  result.merge(posMomAcc)
+  kwargs.setdefault('PositionMomentumWriter', posMomWriter)
+     
+  Trk__ExtrapolationEngineTest = CompFactory.Trk.ExtrapolationEngineTest
+  extrapolationTest = Trk__ExtrapolationEngineTest(name, **kwargs)
+  result.addEventAlgo(extrapolationTest)
+  
+  return result
diff --git a/Tracking/TrkExtrapolation/TrkExUnitTests/scripts/RunExEngineTest.py b/Tracking/TrkExtrapolation/TrkExUnitTests/scripts/RunExEngineTest.py
new file mode 100644
index 000000000000..d28a17d25b21
--- /dev/null
+++ b/Tracking/TrkExtrapolation/TrkExUnitTests/scripts/RunExEngineTest.py
@@ -0,0 +1,70 @@
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator 
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+from AthenaConfiguration.MainServicesConfig import MainServicesCfg    
+from AthenaCommon.Configurable import Configurable
+from AthenaCommon.Logging import log
+
+Configurable.configurableRun3Behavior = True
+
+## Just enable ID for the moment.
+ConfigFlags.Input.isMC             = True
+ConfigFlags.Beam.Type = ''    
+
+ConfigFlags.IOVDb.GlobalTag        = "OFLCOND-SIM-00-00-00"    
+ConfigFlags.GeoModel.AtlasVersion  = "ATLAS-R2-2016-01-00-01"
+ConfigFlags.Detector.GeometryBpipe = True
+ConfigFlags.Detector.GeometryID    = True
+ConfigFlags.Detector.GeometryPixel = True
+ConfigFlags.Detector.GeometrySCT   = True
+
+ConfigFlags.Detector.GeometryTRT   = False
+ConfigFlags.Detector.GeometryCalo  = False
+ConfigFlags.Detector.GeometryMuon  = False
+
+# This should run serially for the moment.
+ConfigFlags.Concurrency.NumThreads = 1
+ConfigFlags.Concurrency.NumConcurrentEvents = 1
+
+log.debug('Lock config flags now.')
+ConfigFlags.lock()
+
+log.debug('dumping config flags now.')
+ConfigFlags.dump()
+
+cfg=MainServicesCfg(ConfigFlags)    
+
+from TrkExUnitTests.TrkExUnitTestsConfig import ExtrapolationEngineTestCfg
+topoAcc=ExtrapolationEngineTestCfg(ConfigFlags,
+                                   NumberOfTestsPerEvent   = 100,
+                                   # parameters mode: 0 - neutral tracks, 1 - charged particles 
+                                   ParametersMode          = 1,
+                                   # do the full test backwards as well            
+                                   BackExtrapolation       = False,
+                                   # Smear the production vertex - standard primary vertex paramters
+                                   SmearOrigin             = True,
+                                   SimgaOriginD0           = 2./3.,
+                                   SimgaOriginZ0           = 50.,
+                                   # pT range for testing
+                                   PtMin                   = 1000,
+                                   PtMax                   = 1000,
+                                   # The test range in Eta                      
+                                   EtaMin                  =  -3.,
+                                   EtaMax                  =   3.,
+                                   # Configure how you wanna run                  
+                                   CollectSensitive        = True,
+                                   CollectPassive          = True,
+                                   CollectBoundary         = True,
+                                   CollectMaterial         = True,
+                                   UseHGTD                 = False,
+                                   # the path limit to test                        
+                                   PathLimit               = -1.,
+                                   )
+cfg.merge(topoAcc)
+
+cfg.printConfig()
+
+cfg.run(10)
+f=open("ExtrapolationEngineTestConfig.pkl","wb")
+cfg.store(f)
+f.close()
diff --git a/Tracking/TrkExtrapolation/TrkExUnitTests/scripts/RunExEngineTestITk.py b/Tracking/TrkExtrapolation/TrkExUnitTests/scripts/RunExEngineTestITk.py
new file mode 100644
index 000000000000..6dfe50fa921c
--- /dev/null
+++ b/Tracking/TrkExtrapolation/TrkExUnitTests/scripts/RunExEngineTestITk.py
@@ -0,0 +1,78 @@
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator 
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+from AthenaConfiguration.MainServicesConfig import MainServicesCfg    
+from AthenaCommon.Configurable import Configurable
+from AthenaCommon.Logging import log
+
+Configurable.configurableRun3Behavior = True
+
+## Just enable ID for the moment.
+ConfigFlags.Input.isMC             = True
+
+ConfigFlags.GeoModel.useLocalGeometry = False
+detectors = [
+  "ITkPixel",
+  "ITkStrip",
+  "Bpipe"
+]
+
+from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
+setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
+
+ConfigFlags.GeoModel.AtlasVersion = "ATLAS-P2-ITK-24-00-00"
+ConfigFlags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
+ConfigFlags.GeoModel.Align.Dynamic = False
+#ConfigFlags.TrackingGeometry.MaterialSource = "Input"
+ConfigFlags.Beam.Type =''
+
+ConfigFlags.Detector.GeometryCalo = False
+ConfigFlags.Detector.GeometryMuon = False
+
+# This should run serially for the moment.
+ConfigFlags.Concurrency.NumThreads = 1
+ConfigFlags.Concurrency.NumConcurrentEvents = 1
+
+log.debug('Lock config flags now.')
+ConfigFlags.lock()
+
+log.debug('dumping config flags now.')
+ConfigFlags.dump()
+
+cfg=MainServicesCfg(ConfigFlags)    
+
+from TrkExUnitTests.TrkExUnitTestsConfig import ExtrapolationEngineTestITkCfg
+topoAcc=ExtrapolationEngineTestITkCfg(ConfigFlags,
+                                      NumberOfTestsPerEvent   = 100,
+                                      # parameters mode: 0 - neutral tracks, 1 - charged particles 
+                                      ParametersMode          = 1,
+                                      # do the full test backwards as well            
+                                      BackExtrapolation       = False,
+                                      # Smear the production vertex - standard primary vertex paramters
+                                      SmearOrigin             = True,
+                                      SimgaOriginD0           = 2./3.,
+                                      SimgaOriginZ0           = 50.,
+                                      # pT range for testing
+                                      PtMin                   = 1000,
+                                      PtMax                   = 1000,
+                                      # The test range in Eta                      
+                                      EtaMin                  =  -5.,
+                                      EtaMax                  =   5.,
+                                      # Configure how you wanna run                  
+                                      CollectSensitive        = True,
+                                      CollectPassive          = True,
+                                      CollectBoundary         = True,
+                                      CollectMaterial         = True,
+                                      UseHGTD                 = False,
+                                      # the path limit to test                        
+                                      PathLimit               = -1.,
+                                      )
+
+cfg.merge(topoAcc)
+
+cfg.printConfig()
+
+cfg.run(10)
+f=open("ExtrapolationEngineTestConfig.pkl","wb")
+cfg.store(f)
+f.close()
diff --git a/Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestConfig.py b/Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestConfig.py
deleted file mode 100644
index ff92c7beb202..000000000000
--- a/Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestConfig.py
+++ /dev/null
@@ -1,132 +0,0 @@
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator 
-from AthenaConfiguration.ComponentFactory import CompFactory
-
-
-def PositionMomentumWriterCfg(configFlags, name="PositionMomentumWriter", **kwargs) :
-  result = ComponentAccumulator()
-
-  Trk__PositionMomentumWriter = CompFactory.Trk.PositionMomentumWriter
-  posMomWriter = Trk__PositionMomentumWriter(name, **kwargs)
-  result.addPublicTool(posMomWriter)
-  #result.setPrivateTools(posMomWriter)
-  return result, posMomWriter
-
-def ExtrapolationEngineTestCfg(configFlags, name = "ExtrapolationEngineTest", **kwargs ) :
-  result=ComponentAccumulator()  
-  
-  from AtlasGeoModel.GeoModelConfig import GeoModelCfg
-  gmsAcc = GeoModelCfg(configFlags)
-  result.merge(gmsAcc)
-
-  #from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
-  #kwargs["ExtrapolationEngine"] = result.popToolsAndMerge(AtlasExtrapolationEngineCfg(configFlags, nameprefix=''))
-  
-  from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
-  extrapAcc = AtlasExtrapolationEngineCfg(configFlags)
-  extrapolationEngine = extrapAcc.getPrimary()
-  result.merge(extrapAcc)
-  kwargs["ExtrapolationEngine"] = extrapolationEngine
-
-  posMomAcc, posMomWriter = PositionMomentumWriterCfg(configFlags)
-  result.merge(posMomAcc)
-  kwargs.setdefault('PositionMomentumWriter', posMomWriter)
-     
-  Trk__ExtrapolationEngineTest = CompFactory.Trk.ExtrapolationEngineTest
-  extrapolationTest = Trk__ExtrapolationEngineTest(name, **kwargs)
-  result.addEventAlgo(extrapolationTest)
-  
-  return result
-
-if __name__=="__main__":
-    from AthenaCommon.Configurable import Configurable
-    from AthenaCommon.Logging import log
-    from AthenaCommon.Constants import VERBOSE
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg    
-    
-    Configurable.configurableRun3Behavior = True
-    
-    ## Just enable ID for the moment.
-    ConfigFlags.Input.isMC             = True
-    ConfigFlags.Beam.Type = ''    
-    
-    ConfigFlags.IOVDb.GlobalTag        = "OFLCOND-SIM-00-00-00"    
-    ConfigFlags.GeoModel.AtlasVersion  = "ATLAS-R2-2016-01-00-01"
-    ConfigFlags.Detector.GeometryBpipe = True
-    ConfigFlags.Detector.GeometryID    = True
-    ConfigFlags.Detector.GeometryPixel = True
-    ConfigFlags.Detector.GeometrySCT   = True
-    
-    ConfigFlags.Detector.GeometryTRT   = False
-    ConfigFlags.Detector.GeometryCalo  = False
-    ConfigFlags.Detector.GeometryMuon  = False
-    #ConfigFlags.TrackingGeometry.MaterialSource = "Input"
-    
-    # This should run serially for the moment.
-    ConfigFlags.Concurrency.NumThreads = 1
-    ConfigFlags.Concurrency.NumConcurrentEvents = 1
-    
-    log.debug('Lock config flags now.')
-    ConfigFlags.lock()
-    
-    log.debug('dumping config flags now.')
-    ConfigFlags.dump()
-
-    cfg=MainServicesCfg(ConfigFlags)
-    from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg     
-    cfg.merge(InDetGeometryCfg(ConfigFlags))
-    
-    from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
-    cfg.merge(BeamPipeGeometryCfg(ConfigFlags))
-    
-    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
-    cfg.merge(TrackingGeometrySvcCfg(ConfigFlags))
-    
-    histSvc = CompFactory.THistSvc(Output = ["val DATAFILE='ExtrapolationEngineTest.root' TYPE='ROOT' OPT='RECREATE'"])
-    histSvc.OutputLevel=VERBOSE
-    cfg.addService( histSvc )
-    
-    topoAcc=ExtrapolationEngineTestCfg(ConfigFlags,
-                                       NumberOfTestsPerEvent   = 100,
-                                       # parameters mode: 0 - neutral tracks, 1 - charged particles 
-                                       ParametersMode          = 1,
-                                       # do the full test backwards as well            
-                                       BackExtrapolation       = False,
-                                       # Smear the production vertex - standard primary vertex paramters
-                                       SmearOrigin             = False,
-                                       SimgaOriginD0           = 2./3.,
-                                       SimgaOriginZ0           = 50.,
-                                       SmearFlatOriginZ0       = False,
-                                       Z0Min                   = -150.,
-                                       Z0Max                   =  150.,
-                                       Z0Values                = [-150., 0., 150.],
-                                       SmearFlatOriginD0       = False,
-                                       D0Min                   = -2.0,
-                                       D0Max                   =  2.0,
-                                       # pT range for testing
-                                       PtMin                   = 1000,
-                                       PtMax                   = 1000,
-                                       # The test range in Eta                      
-                                       EtaMin                  =  -3.,
-                                       EtaMax                  =   3.,
-                                       #EtaMin                  =  -2.0
-                                       #EtaMax                  =   2.0
-                                       #PhiMin                  =  -0.5
-                                       #PhiMax                  =   0.5
-                                       # Configure how you wanna run                  
-                                       CollectSensitive        = True,
-                                       CollectPassive          = True,
-                                       CollectBoundary         = True,
-                                       CollectMaterial         = True,
-                                       UseHGTD                 = False,
-                                       # the path limit to test                        
-                                       PathLimit               = -1.,
-                                       )
-    cfg.merge(topoAcc)
-    
-    cfg.printConfig()
-
-    cfg.run(10)
-    f=open("ExtrapolationEngineTestConfig.pkl","wb")
-    cfg.store(f)
-    f.close()
diff --git a/Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestITkConfig.py b/Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestITkConfig.py
deleted file mode 100644
index 4a7aebbfb484..000000000000
--- a/Tracking/TrkExtrapolation/TrkExUnitTests/share/TrkExUnitTestITkConfig.py
+++ /dev/null
@@ -1,147 +0,0 @@
-# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator 
-from AthenaConfiguration.ComponentFactory import CompFactory
-
-
-def PositionMomentumWriterCfg(configFlags, name="PositionMomentumWriter", **kwargs) :
-  result = ComponentAccumulator()
-
-  Trk__PositionMomentumWriter = CompFactory.Trk.PositionMomentumWriter
-  posMomWriter = Trk__PositionMomentumWriter(name, **kwargs)
-  result.addPublicTool(posMomWriter)
-  #result.setPrivateTools(posMomWriter)
-  return result, posMomWriter
-
-def ExtrapolationEngineTestCfg(configFlags, name = "ExtrapolationEngineTest", **kwargs ) :
-  result=ComponentAccumulator()  
-  
-  from AtlasGeoModel.GeoModelConfig import GeoModelCfg
-  gmsAcc = GeoModelCfg(configFlags)
-  result.merge(gmsAcc)
-
-  #from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
-  #kwargs["ExtrapolationEngine"] = result.popToolsAndMerge(AtlasExtrapolationEngineCfg(configFlags, nameprefix=''))
-  
-  from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
-  extrapAcc = AtlasExtrapolationEngineCfg(configFlags)
-  extrapolationEngine = extrapAcc.getPrimary()
-  result.merge(extrapAcc)
-  kwargs["ExtrapolationEngine"] = extrapolationEngine
-
-  posMomAcc, posMomWriter = PositionMomentumWriterCfg(configFlags)
-  result.merge(posMomAcc)
-  kwargs.setdefault('PositionMomentumWriter', posMomWriter)
-     
-  Trk__ExtrapolationEngineTest = CompFactory.Trk.ExtrapolationEngineTest
-  extrapolationTest = Trk__ExtrapolationEngineTest(name, **kwargs)
-  result.addEventAlgo(extrapolationTest)
-  
-  return result
-
-if __name__=="__main__":
-    from AthenaCommon.Configurable import Configurable
-    from AthenaCommon.Logging import log
-    from AthenaCommon.Constants import VERBOSE
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    
-    Configurable.configurableRun3Behavior = True
-    
-    ## Just enable ID for the moment.
-    ConfigFlags.Input.isMC             = True
-    
-    ConfigFlags.GeoModel.useLocalGeometry = True
-    detectors = [
-      "ITkPixel",
-      "ITkStrip"
-    ]
-    
-    from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
-    setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
-
-    ConfigFlags.GeoModel.AtlasVersion = "ATLAS-P2-ITK-24-00-00"
-    ConfigFlags.IOVDb.GlobalTag = "OFLCOND-SIM-00-00-00"
-    ConfigFlags.GeoModel.Align.Dynamic = False
-    ConfigFlags.TrackingGeometry.MaterialSource = "Input"
-    ConfigFlags.Beam.Type =''
-    
-    ConfigFlags.Detector.GeometryCalo  = False
-    ConfigFlags.Detector.GeometryMuon  = False
-    
-    # This should run serially for the moment.
-    ConfigFlags.Concurrency.NumThreads = 1
-    ConfigFlags.Concurrency.NumConcurrentEvents = 1
-    
-    log.debug('Lock config flags now.')
-    ConfigFlags.lock()
-    
-    log.debug('dumping config flags now.')
-    ConfigFlags.dump()
-
-    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
-    cfg=MainServicesCfg(ConfigFlags)
-    
-    from AthenaConfiguration.ComponentFactory import CompFactory
-    
-    from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelGeometryCfg
-    itkPixel = ITkPixelGeometryCfg(ConfigFlags)
-    cfg.merge(itkPixel)
-    
-    from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripGeometryCfg
-    itkStrip = ITkStripGeometryCfg(ConfigFlags)
-    cfg.merge(itkStrip)
-    
-    from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
-    cfg.merge(BeamPipeGeometryCfg(ConfigFlags))
-    
-    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
-    cfg.merge(TrackingGeometrySvcCfg(ConfigFlags))
-    
-    histSvc = CompFactory.THistSvc(Output = ["val DATAFILE='ExtrapolationEngineTest.root' TYPE='ROOT' OPT='RECREATE'"])
-    histSvc.OutputLevel=VERBOSE
-    cfg.addService( histSvc )
-    
-    topoAcc=ExtrapolationEngineTestCfg(ConfigFlags,
-                                       NumberOfTestsPerEvent   = 100,
-                                       # parameters mode: 0 - neutral tracks, 1 - charged particles 
-                                       ParametersMode          = 1,
-                                       # do the full test backwards as well            
-                                       BackExtrapolation       = False,
-                                       # Smear the production vertex - standard primary vertex paramters
-                                       SmearOrigin             = False,
-                                       SimgaOriginD0           = 2./3.,
-                                       SimgaOriginZ0           = 50.,
-                                       SmearFlatOriginZ0       = False,
-                                       Z0Min                   = -150.,
-                                       Z0Max                   =  150.,
-                                       Z0Values                = [-150., 0., 150.],
-                                       SmearFlatOriginD0       = False,
-                                       D0Min                   = -2.0,
-                                       D0Max                   =  2.0,
-                                       # pT range for testing
-                                       PtMin                   = 1000,
-                                       PtMax                   = 1000,
-                                       # The test range in Eta                      
-                                       EtaMin                  =  -5.,
-                                       EtaMax                  =   5.,
-                                       #EtaMin                  =  -2.0
-                                       #EtaMax                  =   2.0
-                                       #PhiMin                  =  -0.5
-                                       #PhiMax                  =   0.5
-                                       # Configure how you wanna run                  
-                                       CollectSensitive        = True,
-                                       CollectPassive          = True,
-                                       CollectBoundary         = True,
-                                       CollectMaterial         = True,
-                                       UseHGTD                 = False,
-                                       # the path limit to test                        
-                                       PathLimit               = -1.,
-                                       )
-    cfg.merge(topoAcc)
-    
-    #vp1 = CompFactory.VP1Alg() 
-    #cfg.addEventAlgo(vp1)
-
-    cfg.run(1000)
-    f=open("ExtrapolationEngineTestConfig.pkl","wb")
-    cfg.store(f)
-    f.close()
-- 
GitLab


From 906f760aa5d01625aeef3435a7087d6ff6edfbeb Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Thu, 23 Sep 2021 20:07:37 +0200
Subject: [PATCH 302/347] Modernization of LArRampBuilder algorithm

---
 .../LArCalibUtils/src/LArRampBuilder.cxx      | 122 ++++--------------
 .../{LArCalibUtils => src}/LArRampBuilder.h   |  84 ++++++------
 .../src/components/LArCalibUtils_entries.cxx  |   2 +-
 .../share/LArCalib_Ramp_jobOptions.py         |   3 -
 4 files changed, 67 insertions(+), 144 deletions(-)
 rename LArCalorimeter/LArCalibUtils/{LArCalibUtils => src}/LArRampBuilder.h (56%)

diff --git a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx
index d5698b5dec90..bfd582018d99 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx
@@ -2,9 +2,8 @@
   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
-#include "LArCalibUtils/LArRampBuilder.h"
+#include "LArRampBuilder.h"
 #include "LArRawEvent/LArFebErrorSummary.h"
-#include "LArCalibTriggerAccumulator.h"
 #include "LArRawConditions/LArRampComplete.h"
 
 
@@ -17,61 +16,6 @@
 #include <fstream>
 
 
-#include "LArRawConditions/LArConditionsContainerDB.h"
-
-LArRampBuilder::LArRampBuilder(const std::string& name, ISvcLocator* pSvcLocator)
-  : AthAlgorithm(name, pSvcLocator),
-    m_peakParabolaTool("LArParabolaPeakRecoTool"),
-    m_peakShapeTool("LArShapePeakRecoTool"),
-    m_peakOFTool(this),
-    m_event_counter(0),
-    m_recoType(OF),
-    m_onlineHelper(),
-    m_emId(0),
-    m_groupingType("ExtendedFeedThrough"),
-    m_dd_rinj(0),m_iterate(false)
-{
-  declareProperty("KeyList",         m_keylist);
-  declareProperty("KeyOutput",       m_keyoutput="LArRamp");
-  declareProperty("SubtractDac0",    m_dac0sub=true);
-  declareProperty("StoreRawRamp",    m_saveRawRamp=false);
-  declareProperty("StoreRecRamp",    m_saveRecRamp=true);
-  declareProperty("Polynom",         m_degree=1);
-  declareProperty("RampRange",       m_maxADC=0);
-  declareProperty("doSatSlope",      m_satSlope=true);
-  declareProperty("ConsecutiveADCs", m_consADC=50);
-  declareProperty("RecoType",        m_recoTypeProp=std::string("OF")) ;
-  declareProperty("correctBias",     m_correctBias=false);
-  declareProperty("ShapeMethodDAC",  m_shapeMethodDAC=400);
-  declareProperty("DAC0",            m_DAC0=0); 
-  declareProperty("LongNtuple",      m_longNtuple=false);
-  declareProperty("WithIntercept",   m_withIntercept=true);
-  declareProperty("minDAC",          m_minDAC=0);
-  declareProperty("GroupingType",    m_groupingType);
-  declareProperty("DelayShift",      m_delayShift=23); //Only for OF peak reco
-  declareProperty("PeakOFTool",      m_peakOFTool); 
-  declareProperty("isSC",            m_isSC=false);
-  declareProperty("isHEC",           m_ishec=false);
-  declareProperty("HECKey",          m_hec_key="");
-  declareProperty("CorrectBadChannels",  m_doBadChannelMask = false);
-  declareProperty("Iterate",         m_iterate = false);
-
-  int defaultDeadChannelCut;
-  if (m_dac0sub)
-    defaultDeadChannelCut=300;
-  else
-    defaultDeadChannelCut=1300;
-  declareProperty("DeadChannelCut",m_DeadChannelCut=defaultDeadChannelCut);
-  m_delay=-1;
-  m_ipassShape = 0; // temporary
-  m_ipassPedestal = 0; // temporary
-  m_ramps=NULL; 
-  m_fatalFebErrorPattern=0xffff;
-}
-
-LArRampBuilder::~LArRampBuilder() 
-{}
-
 StatusCode LArRampBuilder::initialize()
 {
   StatusCode sc;
@@ -108,18 +52,10 @@ StatusCode LArRampBuilder::initialize()
   ATH_CHECK(m_bcContKey.initialize(m_doBadChannelMask));
   ATH_CHECK(m_bcMask.buildBitMask(m_problemsToMask,msg()));
 
-  m_ramps=new LArConditionsContainer<ACCRAMP>();
-  //FIXME: Thats probably nonsenes, these raw ramps aren't written to COOL
-  sc=m_ramps->setGroupingType(m_groupingType,msg()); 
-  if (sc.isFailure()) {
-    ATH_MSG_ERROR( "Failed to set groupingType for intermediate LArRamps object" );
-    return sc;
-  }
-  sc=m_ramps->initialize(); 
-  if (sc.isFailure()) {
-    ATH_MSG_ERROR( "Failed initialize intermediate LArRamps object" );
-    return sc;
-  }
+  //Intermediate ramp object (DAC/ADC pairs)
+  m_ramps=std::make_unique<LArConditionsContainer<ACCRAMP> >();
+  m_ramps->setGroupingType(LArConditionsContainerBase::SingleGroup); 
+  ATH_CHECK(m_ramps->initialize()); 
   
   chooseRecoMode() ;
   m_event_counter=0;
@@ -168,7 +104,8 @@ void LArRampBuilder::chooseRecoMode()  {
       }
       
     }
-    
+    m_peakShapeTool.disable();
+    m_peakOFTool.disable();
     // Shape reconstruction
   } else if (m_recoTypeProp == std::string("Shape") ) {
     m_recoType=SHAPE;
@@ -178,7 +115,8 @@ void LArRampBuilder::chooseRecoMode()  {
       return;
     }
     ATH_MSG_DEBUG("LArShapePeakRecoTool retrieved with success!");
-    
+    m_peakParabolaTool.disable();
+    m_peakOFTool.disable();
     // OFC recontruction 
   } else if ( m_recoTypeProp == std::string("OF") ) {
     m_recoType=OF;
@@ -187,6 +125,8 @@ void LArRampBuilder::chooseRecoMode()  {
       return;
     }
     ATH_MSG_DEBUG("LArOFPeakRecoTool retrieved with success!");
+    m_peakShapeTool.disable();
+    m_peakParabolaTool.disable();
   }
 }
 
@@ -456,23 +396,12 @@ StatusCode LArRampBuilder::stop()
 
   StatusCode sc;
   //Create transient ramp object (to be filled later) (one object for all gains)
-  LArRampComplete* larRampComplete;
+  std::unique_ptr<LArRampComplete> larRampComplete;
   if (m_saveRecRamp){
-    larRampComplete=new LArRampComplete();
-    sc=larRampComplete->setGroupingType(m_groupingType,msg());
-    if (sc.isFailure()) {
-      ATH_MSG_ERROR( "Failed to set groupingType for LArRampComplete object");
-      return sc;
-    }
-    sc=larRampComplete->initialize(); 
-    if (sc.isFailure()) {
-      ATH_MSG_ERROR( "Failed initialize LArRampComplete object");
-      return sc;
-    }
-    
+    larRampComplete=std::make_unique<LArRampComplete>();
+    ATH_CHECK(larRampComplete->setGroupingType(m_groupingType,msg()));
+    ATH_CHECK(larRampComplete->initialize());
   }
-  else
-    larRampComplete=NULL;
   
   const LArOnOffIdMapping* cabling(0);
   if( m_isSC ){
@@ -710,11 +639,7 @@ StatusCode LArRampBuilder::stop()
 	ramppoint.iMaxSample = iMaxADC;
 	ramppoint.TimeMax    = timepeak;
 	
-	// resize samples to 0 if dont want to make large ntuple
-	if(!m_longNtuple){
-	  ramppoint.Samples.resize(0);
-	  ramppoint.RMS.resize(0);
-	}
+	
 	// only add to rawramp non saturing points (using rawdata information)
 	if( (dac_it->first>= m_minDAC) &&  ramppoint.ADC > -998 
 	    && ((m_maxADC <= 0) || (MaxADC < m_maxADC)) ) {
@@ -804,16 +729,18 @@ StatusCode LArRampBuilder::stop()
     ATH_MSG_INFO( " Summary : Number of HEC       cells side A or C (connected+unconnected):   2816+ 256 =  3072 ");
     ATH_MSG_INFO( " Summary : Number of FCAL      cells side A or C (connected+unconnected):   1762+  30 =  1792 ");
 
-    sc=detStore()->record(larRampComplete,m_keyoutput);
+
+    const auto *rampPtr=larRampComplete.get(); //Remember ptr for symlink
+    sc=detStore()->record(std::move(larRampComplete),m_keyoutput);
     if (sc.isFailure()) {
       ATH_MSG_ERROR( "Failed to record LArRampComplete object");
     }
-    sc=detStore()->symLink(larRampComplete, (ILArRamp*)larRampComplete);
+    sc=detStore()->symLink(rampPtr, (const ILArRamp*)rampPtr);
     if (sc.isFailure()) {
       ATH_MSG_ERROR( "Failed to symlink LArRawRamp object");
     }
   }
-  delete m_ramps;//Not needed any more. Free memory.
+  m_ramps.reset();//Not needed any more. Free memory.
   ATH_MSG_INFO( "LArRampBuilder has finished.");
   return StatusCode::SUCCESS;
 }// end finalize-method.
@@ -857,8 +784,9 @@ StatusCode LArRampBuilder::rampfit(unsigned deg, const std::vector<LArRawRamp::R
   }
   vSat.push_back(satpoint);
   
-  if (!m_withIntercept) 
+  if (!m_withIntercept) {
     deg--;
+  }
   bool isgood=true;
   if(m_doBadChannelMask && m_bcMask.cellShouldBeMasked(bcCont,chid)) isgood=false;
   if (deg>linRange) {
@@ -871,7 +799,7 @@ StatusCode LArRampBuilder::rampfit(unsigned deg, const std::vector<LArRawRamp::R
     return StatusCode::FAILURE;
   }
   
-  if (data[linRange-1].DAC>0 && data[linRange-1].ADC<m_DeadChannelCut && data[linRange-1].ADC!=-999.) {
+  if (data[linRange-1].DAC>0 && data[linRange-1].ADC<m_deadChannelCut && data[linRange-1].ADC!=-999.) {
     ATH_MSG_ERROR( "DAC= " << data[linRange-1].DAC << " yields ADC= " << data[linRange-1].ADC 
 	   << ". Dead channel?" );
     return StatusCode::FAILURE;
@@ -906,7 +834,7 @@ StatusCode LArRampBuilder::rampfit(unsigned deg, const std::vector<LArRawRamp::R
 	      // all DAC points (same noise). The 100. scale factor is
 	      // there to guarantee the same results with respect to
 	      // previous fits withour errors (having usually 100
-	      // triggers), because of poternaitl numerical
+	      // triggers), because of potential numerical
 	      // differences when inverting the fit matrix even if
 	      // errors are all the same.
 	    if (m_withIntercept) {    
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.h
similarity index 56%
rename from LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h
rename to LArCalorimeter/LArCalibUtils/src/LArRampBuilder.h
index 33912650484f..e7dd34d0082c 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h
+++ b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.h
@@ -48,10 +48,12 @@
 #include "LArRecConditions/LArBadChannelMask.h"
 
 #include "LArRecConditions/LArCalibLineMapping.h"
-#include "CaloDetDescr/ICaloSuperCellIDTool.h"
+
+#include "LArCalibTriggerAccumulator.h"
 #include <vector>
 #include <string>
 #include <map>
+#include <memory>
 
 
 class LArOnlineID_Base;
@@ -61,8 +63,8 @@ class LArRampBuilder : public AthAlgorithm//, public IIncidentListener
 {
  
 public:
-  LArRampBuilder(const std::string & name, ISvcLocator * pSvcLocator);
-  ~LArRampBuilder();
+  using AthAlgorithm::AthAlgorithm;
+  ~LArRampBuilder() {};
 
   //standard algorithm methods
   StatusCode initialize();
@@ -86,17 +88,17 @@ private:
 		     const HWIdentifier chid, const LArOnOffIdMapping* cabling,
 		     const LArBadChannelCont* bcCont);
 
-  LArConditionsContainer<ACCRAMP>* m_ramps;
+  std::unique_ptr<LArConditionsContainer<ACCRAMP> > m_ramps;
 
 
-  ToolHandle<LArParabolaPeakRecoTool> m_peakParabolaTool;
-  ToolHandle<LArShapePeakRecoTool>    m_peakShapeTool;
-  ToolHandle<LArOFPeakRecoTool>       m_peakOFTool;
+  PublicToolHandle<LArParabolaPeakRecoTool> m_peakParabolaTool{this,"LArParabolaPeakRecoTool","LArParabolaPeakRecoTool"};
+  PublicToolHandle<LArShapePeakRecoTool>    m_peakShapeTool{this,"LArShapePeakRecoTool","LArShapePeakRecoTool"};
+  ToolHandle<LArOFPeakRecoTool>       m_peakOFTool{this,"PeakOFTool","LArOFPeakRecoTool"};
 
-  unsigned m_event_counter; 
-  int m_delay;
-  int m_ipassShape; 
-  int m_ipassPedestal; 
+  unsigned m_event_counter=0; 
+  int m_delay=-1;
+  int m_ipassShape=0; 
+  int m_ipassPedestal=0; 
 
   std::vector< std::vector< std::vector< std::vector<double> > > >m_CaliWaves;
  // vector (gain) of vector(HashCell) of vector (DAC) of DACs
@@ -107,52 +109,48 @@ private:
 
   std::vector<float> m_thePedestal;    
 
-  std::string m_recoTypeProp; // ( "Parabola", "Shape" or "OF" ) 
+  
   
   enum recoType {PARABOLA,SHAPE,OF};  
-  recoType m_recoType;
+  recoType m_recoType{OF};
 
 
   //Algorithm-Properties:
-  std::vector<std::string> m_keylist;//, m_keylistproperty;
-  std::string m_keyoutput;
+  Gaudi::Property<std::vector<std::string> > m_keylist{this, "KeyList",{},"List if input SG keys"};
+  Gaudi::Property<std::string> m_keyoutput{this,"KeyOutput","LArRamp","SG Key of output object"};
     
-  IntegerProperty m_degree;
-  IntegerProperty m_maxADC;
-  IntegerProperty m_consADC;
-  bool m_dac0sub, m_saveRawRamp,m_saveRecRamp, m_longNtuple, m_satSlope;
-  UnsignedIntegerProperty m_minDAC;
-
-  int m_DeadChannelCut;
-  int m_shapeMethodDAC;
-  unsigned int m_DAC0;
-
-  bool m_correctBias;
-  bool m_withIntercept;
-  float m_delayShift;
-  //  hashID     sample
-  std::vector<std::vector<short> > m_adc0;
-
-  bool m_doBadChannelMask;
+  IntegerProperty m_degree{this,"Polynom",1,"Degree of ramp-polynom"};
+  IntegerProperty m_maxADC{this,"RampRange",0,"Ignore ADC values higher than this (0: do nothing)"};
+  BooleanProperty m_dac0sub{this,"SubtractDac0",true,"Take first DAC value as pedestal"};
+  UnsignedIntegerProperty m_DAC0{this,"DAC0",0,"DAC value considered DAC0"};
+  BooleanProperty m_saveRawRamp{this,"StoreRawRamp",false,"Save raw ramp obj in SG"};
+  BooleanProperty m_saveRecRamp{this,"StoreRecRamp",true,"Save reconstructed ramp obj in SG"};
+  BooleanProperty m_satSlope{this,"doSatSlope","Ignore points subject to saturation"};
+  UnsignedIntegerProperty m_minDAC{this,"minDAC",0,"Ignore DAC values smaller that this"};
+  StringProperty m_recoTypeProp{this,"RecoType","OF","One of 'Parabola', 'Shape' or 'OF'"}; 
+  IntegerProperty m_deadChannelCut{this,"DeadChannelCut",1300,"Complain about channels with max-ADC below this value"};
+  BooleanProperty m_correctBias{this,"correctBias",false,"For Parabola method: Correction yes/no"};
+  BooleanProperty m_withIntercept{this,"WithIntercept",true,"False: Force fit to go through 0/0"};
+  FloatProperty m_delayShift{this,"DelayShift",23};  //Only for OF peak reco
+  
+  Gaudi::Property<bool> m_doBadChannelMask{this,"IgnoreBadChannels",true,"Don't complain about known bad channels"};
   LArBadChannelMask m_bcMask;
   SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"};
   Gaudi::Property<std::vector<std::string> > m_problemsToMask{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"};
- 
-  
+  Gaudi::Property<std::string> m_groupingType{this,"GroupingType","ExtendedFeedThrough","Grouping of the output conditions-container"};
+  Gaudi::Property<std::string> m_hec_key{this,"HECKey","","SG Key of injection-resistor obj used for HEC Ramps"};
 
-  const LArOnlineID_Base* m_onlineHelper;
-  const LArEM_Base_ID* m_emId;
+  const LArOnlineID_Base* m_onlineHelper=nullptr;
+  const LArEM_Base_ID* m_emId=nullptr;
 
-  // Grouping type
-  std::string m_groupingType;
 
   const DataHandle<ILArRinj> m_dd_rinj;
-  std::string m_hec_key;
-  bool        m_isSC;
-  bool        m_ishec;
-  bool        m_iterate;
+  
+  Gaudi::Property<bool>  m_isSC{this,"isSC",false,"Processing SC data yes/no"};
+  Gaudi::Property<bool>  m_ishec{this,"isHEC",false,"Processing HEC data yes/no"};
+  Gaudi::Property<bool>  m_iterate{this,"Iterate",false,"Iterative OF peak reco"};
 
-  uint16_t m_fatalFebErrorPattern;
+  uint16_t m_fatalFebErrorPattern=0xffff;
 
 };
 
diff --git a/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx b/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx
index 5015bcdd1615..f61e231c24f1 100644
--- a/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/components/LArCalibUtils_entries.cxx
@@ -20,7 +20,7 @@
 #include "LArCalibUtils/LArPhysWaveShifter.h"
 #include "LArCalibUtils/LArPhysWaveTool.h"
 #include "LArCalibUtils/LArPhysWaveHECTool.h"
-#include "LArCalibUtils/LArRampBuilder.h"
+#include "../LArRampBuilder.h"
 #include "LArCalibUtils/LArRTMParamExtractor.h"
 #include "LArCalibUtils/LArStripsCrossTalkCorrector.h"
 #include "LArCalibUtils/LArTCMFitterTool.h"
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py
index 2ec7d31a3644..48e4775e3e38 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py
@@ -622,14 +622,11 @@ theLArRampBuilder.Polynom      = 1
 theLArRampBuilder.RampRange    = RampRangeValue # Check on the raw data ADC sample before ped subtraction
                                                 # and pulse reconstruction to include point in fit
 theLArRampBuilder.correctBias  = CorrectBias
-theLArRampBuilder.ConsecutiveADCs = 0;
 theLArRampBuilder.minDAC = 10      # minimum DAC value to use in fit
 theLArRampBuilder.KeyOutput = KeyOutput
 theLArRampBuilder.DeadChannelCut = -9999
 theLArRampBuilder.GroupingType = GroupingType
 
-theLArRampBuilder.LongNtuple = SaveAllSamples
-
 theLArRampBuilder.isSC = SuperCells
 
 if ( isHEC ) :
-- 
GitLab


From d76d8c0056da8b04d8be58cbf4f1e4821f4ce2bf Mon Sep 17 00:00:00 2001
From: Benjamin Philip Kerridge <benjamin.kerridge@cern.ch>
Date: Thu, 23 Sep 2021 20:51:37 +0200
Subject: [PATCH 303/347] Fix ART test following the removal of fslrt_L1All

---
 .../TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat    | 6 +++---
 .../TrigInDetValidation/python/TrigInDetArtSteps.py         | 2 +-
 .../TrigInDetValidation/share/comparitor.json               | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
index 83543fecf5be..9902c363ffe6 100644
--- a/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
+++ b/Trigger/TrigAnalysis/TrigInDetAnalysisUser/share/TIDAdata-chains-run3.dat
@@ -57,9 +57,9 @@ testChains = {
 
     "HLT_mb_sptrk_L1RD0_FILLED:HLT_IDTrack_MinBias_IDTrig",
 
-    "HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FSLRT_FTF;DTE",
-    "HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FS_FTF;DTE",
-    "HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FSLRT_IDTrig;DTE",
+    "HLT_unconvtrk0_fslrt_L1J100:HLT_IDTrack_FSLRT_FTF;DTE",
+    "HLT_unconvtrk0_fslrt_L1J100:HLT_IDTrack_FS_FTF;DTE",
+    "HLT_unconvtrk0_fslrt_L1J100:HLT_IDTrack_FSLRT_IDTrig;DTE",
 
     "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_FTF",
     "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_IDTrig",
diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index 9148da57d520..82ae78215c41 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -82,7 +82,7 @@ class TrigInDetReco(ExecStep):
                 chains += "'HLT_mu6_idperf_L1MU5VF',"
                 flags += 'doMuonSlice=True;'
             if (i=='FSLRT') :
-                chains += "'HLT_unconvtrk0_fslrt_L1All',"
+                chains += "'HLT_unconvtrk0_fslrt_L1J100',"
                 flags  += 'doUnconventionalTrackingSlice=True;'
             if (i=='muon') :
                 chains += "'HLT_mu6_idperf_L1MU5VF',"
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
index 33c1ab48b303..ce15b7aa6038 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/comparitor.json
@@ -66,10 +66,10 @@
         "chains" : "HLT_mb_sptrk_L1RD0_FILLED:HLT_IDTrack_MinBias_IDTrig"
     },
     "L2FSLRT":{
-        "chains" : "HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FSLRT_FTF_DTE  HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FS_FTF_DTE"
+        "chains" : "HLT_unconvtrk0_fslrt_L1J100:HLT_IDTrack_FSLRT_FTF_DTE  HLT_unconvtrk0_fslrt_L1J100:HLT_IDTrack_FS_FTF_DTE"
     },
     "EFFSLRT":{
-        "chains" : "HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FSLRT_FTF_DTE  HLT_unconvtrk0_fslrt_L1All:HLT_IDTrack_FSLRT_IDTrig_DTE"
+        "chains" : "HLT_unconvtrk0_fslrt_L1J100:HLT_IDTrack_FSLRT_FTF_DTE  HLT_unconvtrk0_fslrt_L1J100:HLT_IDTrack_FSLRT_IDTrig_DTE"
     },
     "L2bphys":{ 
 	"chains" : "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_FTF"
-- 
GitLab


From d788768cb76980cacc8e563a17c75dd913be54de Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 21 May 2021 12:21:46 -0400
Subject: [PATCH 304/347] MuonCondInterface: Enable thread-safety checking.

Enable thread-safety checking.
---
 .../MuonCondInterface/ATLAS_CHECK_THREAD_SAFETY                  | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ATLAS_CHECK_THREAD_SAFETY

diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ATLAS_CHECK_THREAD_SAFETY b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..698ab13a6727
--- /dev/null
+++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondInterface/MuonCondInterface
-- 
GitLab


From 2be73b66588404e3d18b61c472f67c2050009fd6 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 17 Sep 2021 15:02:29 -0400
Subject: [PATCH 305/347] TRTMonitoringRun3: cmake fixes

Clean up external package dependencies.
---
 InnerDetector/InDetMonitoring/TRTMonitoringRun3/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/CMakeLists.txt b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/CMakeLists.txt
index 80f48d09090a..a2eaa348c038 100644
--- a/InnerDetector/InDetMonitoring/TRTMonitoringRun3/CMakeLists.txt
+++ b/InnerDetector/InDetMonitoring/TRTMonitoringRun3/CMakeLists.txt
@@ -5,11 +5,12 @@
 
 # Declare the package name:
 atlas_subdir( TRTMonitoringRun3 )
+find_package( ROOT )
                   
 atlas_add_component( TRTMonitoringRun3
                      src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} ${GEOMODELCORE_INCLUDE_DIRS}
+                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                      LINK_LIBRARIES AthenaMonitoringLib TrkToolInterfaces CommissionEvent TRT_DriftFunctionToolLib TRT_ConditionsServicesLib MagFieldInterfaces InDetByteStreamErrors InDetRIO_OnTrack
                      )
                    
-- 
GitLab


From f1e58146785469b5bd21b7802b5e1b17887e97a2 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 15 Sep 2021 09:16:15 -0400
Subject: [PATCH 306/347] L1TopoInterfaces: Fix cppcheck warnings.

Pass strings by const reference, not by value.
---
 .../L1Topo/L1TopoInterfaces/L1TopoInterfaces/ConfigurableAlg.h  | 2 +-
 Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/ConfigurableAlg.h b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/ConfigurableAlg.h
index 32f514acfce7..174f3931ecae 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/ConfigurableAlg.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/ConfigurableAlg.h
@@ -117,7 +117,7 @@ namespace TCS {
 
       void fillHist2D(const std::string & histName, double x, double y);
       
-      bool isocut(const std::string threshold, const unsigned int bit);
+      bool isocut(const std::string& threshold, const unsigned int bit);
       
       bool isocut(const unsigned int threshold, const unsigned int bit);
    private:
diff --git a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx
index e824d9d2fb13..34e974cb9826 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/ConfigurableAlg.cxx
@@ -379,7 +379,7 @@ std::string ConfigurableAlg::ToString(const int val)
 }
 
 bool
-ConfigurableAlg::isocut(const std::string threshold, const unsigned int bit) {
+ConfigurableAlg::isocut(const std::string& threshold, const unsigned int bit) {
   unsigned int value = 0;
   if (threshold == "None") {value = 0;}
   else if (threshold == "Loose") {value = 1;}
-- 
GitLab


From 4afed698a23a84104b9e73d7357f2bd0de87d762 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Fri, 24 Sep 2021 09:33:06 +0200
Subject: [PATCH 307/347] LArCalibJoO (old-style): Fix bad-channel folder name

---
 .../share/LArCalib_Delay_OFC_splitter_jobOptions.py           | 4 ++--
 .../LArCalibProcessing/share/LArCalib_Patching_jobOptions.py  | 4 ++--
 .../share/LArCalib_PedestalAutoCorr_jobOptions.py             | 4 ++--
 .../share/LArCalib_PhysWavePredictorAndShifter_jobOptions.py  | 4 ++--
 .../LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py
index e46a499f5e69..cfdf0a6ed19e 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py
@@ -532,8 +532,8 @@ include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py")
 from IOVDbSvc.CondDB import conddb
 PoolFileList     = []
 
-BadChannelsFolder="/LAR/BadChannels/BadChannels"
-MissingFEBsFolder="/LAR/BadChannels/MissingFEBs"
+BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels"
+MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs"
 
 if not 'InputBadChannelSQLiteFile' in dir():
    DelayLog.info( "Read Bad Channels from Oracle DB")
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py
index f7705e41e01a..84832633f9df 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py
@@ -104,8 +104,8 @@ from AtlasGeoModel import SetupRecoGeometry
 #Get identifier mapping (needed by LArConditionsContainer)
 include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" )
 
-conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannels/BadChannels</key>")
-conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>")
+conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannelsOfl/BadChannels</key>")
+conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannelsOfl/MissingFEBs</key>")
 svcMgr.IOVDbSvc.GlobalTag=globaltag
 try:
    svcMgr.IOVDbSvc.DBInstance=""
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PedestalAutoCorr_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PedestalAutoCorr_jobOptions.py
index 62dce70e3ce9..dd920c816c30 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PedestalAutoCorr_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PedestalAutoCorr_jobOptions.py
@@ -377,9 +377,9 @@ else:
 from IOVDbSvc.CondDB import conddb
 
 if 'BadChannelsFolder' not in dir():
-   BadChannelsFolder="/LAR/BadChannels/BadChannels"
+   BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels"
 if 'MissingFEBsFolder' not in dir():
-   MissingFEBsFolder="/LAR/BadChannels/MissingFEBs"
+   MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs"
 
 
 if ( ReadBadChannelFromCOOL ):      
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWavePredictorAndShifter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWavePredictorAndShifter_jobOptions.py
index 7b49c0494002..be694042ea82 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWavePredictorAndShifter_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PhysWavePredictorAndShifter_jobOptions.py
@@ -440,9 +440,9 @@ else :
    PhysWaveLog.info( "Read Bad Channels from SQLite file") 
 
 if 'BadChannelsFolder' not in dir():
-   BadChannelsFolder="/LAR/BadChannels/BadChannels"
+   BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels"
 if 'MissingFEBsFolder' not in dir():
-   MissingFEBsFolder="/LAR/BadChannels/MissingFEBs"
+   MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs"
 
 
 if 'BadChannelsLArCalibFolderTag' in dir() :
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py
index 7a9ac2630320..87d6a538d0dd 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py
@@ -469,9 +469,9 @@ PoolFileList = []
 ## Bad Channel   
 
 if 'BadChannelsFolder' not in dir():
-   BadChannelsFolder="/LAR/BadChannels/BadChannels"
+   BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels"
 if 'MissingFEBsFolder' not in dir():
-   MissingFEBsFolder="/LAR/BadChannels/MissingFEBs"
+   MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs"
 
 if not 'InputBadChannelSQLiteFile' in dir():
    RTMParamsLog.info( "Read Bad Channels from Oracle DB")
-- 
GitLab


From e78d45b37eb38fc619608c11ea45426f76a049e5 Mon Sep 17 00:00:00 2001
From: Mark Hodgkinson <m.hodgkinson@sheffield.ac.uk>
Date: Fri, 24 Sep 2021 10:46:00 +0200
Subject: [PATCH 308/347] Update RecJobTransforms unit test to remove setting
 of flag that no longer exists.

---
 Reconstruction/RecJobTransforms/test/test_new_jo_raw_reco.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Reconstruction/RecJobTransforms/test/test_new_jo_raw_reco.sh b/Reconstruction/RecJobTransforms/test/test_new_jo_raw_reco.sh
index 7abe19f09363..e53a4d128a6c 100755
--- a/Reconstruction/RecJobTransforms/test/test_new_jo_raw_reco.sh
+++ b/Reconstruction/RecJobTransforms/test/test_new_jo_raw_reco.sh
@@ -2,7 +2,7 @@
 
 
 # run the test
-python -m RecJobTransforms.RecoSteering "PF.useElPhotMuLinks=False" --RAW 2>&1 > reco.log
+python -m RecJobTransforms.RecoSteering  --RAW 2>&1 > reco.log
 export testStatus=$?
 if [[ $testStatus -ne 0 ]]
     then
-- 
GitLab


From 235868adf31c5ea5a6bff8628663feace52921b7 Mon Sep 17 00:00:00 2001
From: Nicholas Styles <nicholas.styles@desy.de>
Date: Fri, 24 Sep 2021 15:09:44 +0200
Subject: [PATCH 309/347] fix for ITk pixel conditions following MR 46680

---
 .../src/PixelDetectorElementCondAlg.cxx                       | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.cxx
index 8399889e4069..5fee720126b9 100644
--- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.cxx
+++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDetectorElementCondAlg.cxx
@@ -8,6 +8,7 @@
 #include "InDetReadoutGeometry/SiDetectorElement.h"
 #include "TrkGeometry/Layer.h"
 #include "TrkSurfaces/Surface.h"
+#include "AthenaKernel/IOVInfiniteRange.h"
 
 #include <map>
 
@@ -75,6 +76,9 @@ StatusCode PixelDetectorElementCondAlg::execute(const EventContext& ctx) const
     ATH_MSG_FATAL("Null pointer to the read conditions object of " << m_readKey.key());
     return StatusCode::FAILURE;
   }
+  
+  // Make sure we make a mixed IOV.
+  writeHandle.addDependency (IOVInfiniteRange::infiniteMixed());
 
   // Add dependency for IOV range
   writeHandle.addDependency(readHandle);
-- 
GitLab


From 66445c758a04bcb9294e2d3331a0e026cb16f878 Mon Sep 17 00:00:00 2001
From: "Ewelina.Maria.Lobodzinska" <ewelina.maria.lobodzinska@cern.ch>
Date: Fri, 24 Sep 2021 15:51:51 +0200
Subject: [PATCH 310/347] EvgenJobTransforms: fix the cointing of LHE events -
 as done in https://gitlab.cern.ch/atlas/athena/-/merge_requests/46579

---
 Generators/EvgenJobTransforms/share/skel.GENtoEVGEN.py | 4 ++--
 Generators/EvgenJobTransforms/share/skel.GENtoTXT.py   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Generators/EvgenJobTransforms/share/skel.GENtoEVGEN.py b/Generators/EvgenJobTransforms/share/skel.GENtoEVGEN.py
index c29ea6657650..c523e5d718be 100644
--- a/Generators/EvgenJobTransforms/share/skel.GENtoEVGEN.py
+++ b/Generators/EvgenJobTransforms/share/skel.GENtoEVGEN.py
@@ -750,8 +750,8 @@ if hasattr(runArgs, "outputTXTFile"):
     # counting the number of events in LHE output
     count_ev = 0
     with open(eventsFile) as f:
-        lines = f.read()
-        count_ev = lines.count('/event')
+        for line in f:
+           count_ev += line.count('/event')
     printfunc("MetaData: %s = %s" % ("Number of produced LHE events ", count_ev))
 elif hasattr(runArgs, "inputGeneratorFile"):
     # counting the number of events in LHE output
diff --git a/Generators/EvgenJobTransforms/share/skel.GENtoTXT.py b/Generators/EvgenJobTransforms/share/skel.GENtoTXT.py
index 1f3d2fb387d2..6c244d78a9a3 100644
--- a/Generators/EvgenJobTransforms/share/skel.GENtoTXT.py
+++ b/Generators/EvgenJobTransforms/share/skel.GENtoTXT.py
@@ -654,8 +654,8 @@ def _checkattr(attr, required=False):
 # counting the number of events in LHE output
 count_ev = 0
 with open(eventsFile) as f:
-    contents = f.read()
-    count_ev = contents.count("/event")
+    for line in f:
+       count_ev += line.count('/event')
     
 evgenLog.info('Requested output events = '+str(count_ev))
 printfunc("MetaData: %s = %s" % ("Number of produced LHE events ", count_ev))
-- 
GitLab


From c60773119c051b68b08744f250de4e918b6d03e3 Mon Sep 17 00:00:00 2001
From: Paul Gessinger-Befurt <paul.gessinger@cern.ch>
Date: Fri, 24 Sep 2021 16:18:07 +0200
Subject: [PATCH 311/347] ACTS tracking geometry for ITk

---
 .../src/PixelGmxInterface.cxx                 |   8 +-
 .../StripStereoAnnulusDesign.h                |  23 +
 .../src/StripGmxInterface.cxx                 |  10 +-
 .../ActsGeometry/ActsDetectorElement.h        | 108 +--
 .../ActsGeometry/ActsExtrapolationTool.h      |   1 +
 .../ActsGeometry/ActsLayerBuilder.h           |  25 +-
 .../ActsGeometry/ActsTrackingGeometrySvc.h    |  10 +-
 Tracking/Acts/ActsGeometry/CMakeLists.txt     |   1 +
 .../ActsGeometry/python/ActsGeometryConfig.py |  32 +-
 .../share/ActsExtrapolationAlg.py             |  20 +-
 Tracking/Acts/ActsGeometry/share/ITkTest.py   |  74 ++
 .../src/ActsATLASConverterTool.cxx            |   3 +-
 .../ActsGeometry/src/ActsDetectorElement.cxx  | 335 ++++----
 .../ActsGeometry/src/ActsLayerBuilder.cxx     | 695 +++++++++++-----
 .../src/ActsStrawLayerBuilder.cxx             |   4 +-
 .../src/ActsTrackingGeometrySvc.cxx           | 787 ++++++++++--------
 .../ActsWriteTrackingGeometryTransforms.cxx   |  11 +-
 .../ActsTrkFitting/src/ActsKalmanFitter.cxx   |   8 +-
 18 files changed, 1321 insertions(+), 834 deletions(-)
 create mode 100755 Tracking/Acts/ActsGeometry/share/ITkTest.py

diff --git a/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelGmxInterface.cxx b/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelGmxInterface.cxx
index 66fd2d83aea8..a70922526c3d 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelGmxInterface.cxx
+++ b/InnerDetector/InDetDetDescr/PixelGeoModelXml/src/PixelGmxInterface.cxx
@@ -212,7 +212,13 @@ void PixelGmxInterface::addSensor(std::string typeName,
   //
   // Create the detector element and add to the DetectorManager
   //
-  const InDetDD::SiDetectorDesign *design = m_detectorManager->getDesign(m_geometryMap[typeName]);
+  auto it = m_geometryMap.find(typeName);
+  if(it == m_geometryMap.end()) {
+    ATH_MSG_ERROR("addSensor: Error: Readout sensor type " << typeName << " not found.");
+    throw std::runtime_error("readout sensor type " + typeName + " not found.");
+  }
+  const InDetDD::SiDetectorDesign *design = m_detectorManager->getDesign(it->second);
+  ATH_MSG_VERBOSE("Adding sensor with design: " << typeName << " " << design);
   if (design == nullptr) {
     ATH_MSG_ERROR("addSensor: Error: Readout sensor type " << typeName << " not found.");
     throw std::runtime_error("readout sensor type " + typeName + " not found.");
diff --git a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h
index 708a3b79154a..74fc5aa57087 100644
--- a/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h
+++ b/InnerDetector/InDetDetDescr/SCT_ReadoutGeometry/SCT_ReadoutGeometry/StripStereoAnnulusDesign.h
@@ -204,6 +204,11 @@ StripStereoAnnulusDesign(const SiDetectorDesign::Axis &stripDirection,
     double pitch(const SiCellId &cellId) const;
     double stripLength(const SiCellId &cellId) const;
 
+    double minR() const;
+    double maxR() const;
+    double phiWidth() const;
+    double stereo() const;
+
     // Give upper and lower boundaries, and length, of dead area
     double deadAreaUpperBoundary() const;
     double deadAreaLowerBoundary() const;
@@ -301,6 +306,24 @@ inline SiReadoutCellId StripStereoAnnulusDesign::readoutIdOfCell(const SiCellId
     return SiReadoutCellId(strip, row);
 }
 
+
+inline double StripStereoAnnulusDesign::minR() const {
+    return m_stripStartRadius[0];
+}
+
+inline double StripStereoAnnulusDesign::maxR() const {
+    return m_stripEndRadius.back();
+}
+
+
+inline double StripStereoAnnulusDesign::phiWidth() const {
+    return m_nStrips[0] * m_pitch[0];
+}
+
+inline double StripStereoAnnulusDesign::stereo() const {
+    return m_stereo;
+}
+
 inline int StripStereoAnnulusDesign::row(int stripId1Dim) const {
 
   //This method is scheduled for deletion
diff --git a/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx b/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx
index adcb499e4f01..36cf8541f083 100644
--- a/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx
+++ b/InnerDetector/InDetDetDescr/StripGeoModelXml/src/StripGmxInterface.cxx
@@ -479,11 +479,12 @@ void StripGmxInterface::addSplitSensor(std::string typeName,
     splitTypeName += "_" + std::to_string(updatedIndex["side"]);
   }
 
-  const InDetDD::SiDetectorDesign *design = m_geometryMap[splitTypeName];
-  if (design == nullptr) {
+  auto it = m_geometryMap.find(splitTypeName);
+  if(it == m_geometryMap.end() || it->second == nullptr) {
     ATH_MSG_ERROR("addSplitSensor: Error: Readout sensor type " << typeName << " not found.");
     throw std::runtime_error("readout sensor type " + typeName + " not found.");
   }
+  const InDetDD::SiDetectorDesign *design = it->second;
 
   m_detectorManager->addDetectorElement(new InDetDD::SiDetectorElement(id, design, fpv, m_commonItems));
 
@@ -540,11 +541,12 @@ void StripGmxInterface::addSensor(std::string typeName,
   //
   // Create the detector element and add to the DetectorManager
   //
-  const InDetDD::SiDetectorDesign *design = m_geometryMap[typeName];
-  if (design == nullptr) {
+  auto it = m_geometryMap.find(typeName);
+  if(it == m_geometryMap.end() || it->second == nullptr) {
     ATH_MSG_ERROR("addSensor: Error: Readout sensor type " << typeName << " not found.");
     throw std::runtime_error("readout sensor type " + typeName + " not found.");
   }
+  const InDetDD::SiDetectorDesign *design = it->second;
 
   m_detectorManager->addDetectorElement(new InDetDD::SiDetectorElement(id, design, fpv, m_commonItems));
 
diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsDetectorElement.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsDetectorElement.h
index 7984804aa183..0c83470b123c 100644
--- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsDetectorElement.h
+++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsDetectorElement.h
@@ -5,30 +5,28 @@
 #ifndef ACTSGEOMETRY_ACTSDETECTORELEMENT_H
 #define ACTSGEOMETRY_ACTSDETECTORELEMENT_H
 
-//Amg Eigen plugin includes
+// Amg Eigen plugin includes
 #include "EventPrimitives/EventPrimitives.h"
 #include "GeoPrimitives/GeoPrimitives.h"
 
 // ATHENA INCLUDES
 
-#include "TRT_ReadoutGeometry/TRT_BaseElement.h"
-#include "InDetReadoutGeometry/SiDetectorElement.h"
 #include "InDetIdentifier/PixelID.h"
 #include "InDetIdentifier/SCT_ID.h"
+#include "InDetReadoutGeometry/SiDetectorElement.h"
+#include "TRT_ReadoutGeometry/TRT_BaseElement.h"
+#include "TrkSurfaces/AnnulusBounds.h"
 
 // ACTS
 #include "Acts/Geometry/DetectorElementBase.hpp"
 #include "Acts/Geometry/GeometryContext.hpp"
 
 // STL
-#include <mutex>
 #include <iostream>
-
-// BOOST
-#include <boost/variant.hpp>
+#include <mutex>
 
 namespace Acts {
-  class SurfaceBounds;
+class SurfaceBounds;
 }
 
 class ActsTrackingGeometrySvc;
@@ -38,96 +36,53 @@ class IdentityHelper;
 
 /// @class ActsDetectorElement
 ///
-class ActsDetectorElement : public Acts::DetectorElementBase
-{
-  using DetElemVariant = boost::variant<const InDetDD::SiDetectorElement*, const InDetDD::TRT_BaseElement*>;
+class ActsDetectorElement : public Acts::DetectorElementBase {
 public:
-  enum class Subdetector { Pixel, SCT, TRT, Size };
-
-  ActsDetectorElement(const InDetDD::SiDetectorElement* detElem);
+  ActsDetectorElement(const InDetDD::SiDetectorElement &detElem);
 
   /// Constructor for a straw surface.
   /// @param transform Transform to the straw system
-  ActsDetectorElement(const Acts::Transform3& trf,
-                      const InDetDD::TRT_BaseElement* detElem,
-                      const Identifier& id // we need explicit ID here b/c of straws
-                      );
+  ActsDetectorElement(
+      const Acts::Transform3 &trf, const InDetDD::TRT_BaseElement &detElem,
+      const Identifier &id // we need explicit ID here b/c of straws
+  );
 
   ///  Destructor
   virtual ~ActsDetectorElement() {}
 
   /// Identifier
-  Identifier
-  identify() const;
+  Identifier identify() const;
 
   /// Return local to global transform associated with this identifier
-  
-  void
-  storeTransform(ActsAlignmentStore* gas) const;
+
+  void storeTransform(ActsAlignmentStore *gas) const;
   virtual const Acts::Transform3 &
   transform(const Acts::GeometryContext &gctx) const final override;
 
-
   /// Return surface associated with this identifier, which should come from the
-  virtual const Acts::Surface&
-  surface() const final override;
+  virtual const Acts::Surface &surface() const final override;
 
-  /// Return a shared pointer on the ATLAS surface associated with this identifier,
-  const Trk::Surface&
-  atlasSurface() const;
+  /// Return a shared pointer on the ATLAS surface associated with this
+  /// identifier,
+  const Trk::Surface &atlasSurface() const;
 
   /// Returns the thickness of the module
-  virtual double
-  thickness() const final override;
-
-  // optimize this, it doesn't ever change so can be saved on construction
-  Subdetector getSubdetector() const {
-    if(m_detElement.which() == 1) {
-      return Subdetector::TRT;
-    }
-
-    // this should be Pixel or SCT
-    const auto& de = *boost::get<const InDetDD::SiDetectorElement*>(m_detElement);
-    if(de.isPixel()) {
-      return Subdetector::Pixel;
-    }
-    else {
-      return Subdetector::SCT;
-    }
-  }
+  virtual double thickness() const final override;
 
   IdentityHelper identityHelper() const;
 
-
-private:
-  
   /// Returns default transform. For TRT this is static and set in constructor.
-  /// For silicon detectors it is calulated from GM, and stored. Thus the method 
+  /// For silicon detectors it is calulated from GM, and stored. Thus the method
   /// is not const. The store is mutexed.
-  const Acts::Transform3&
-  getDefaultTransformMutexed() const;
-
-  struct IdVisitor : public boost::static_visitor<Identifier>
-  {
-    explicit IdVisitor(const Identifier& id) : m_explicitIdentifier(id) {}
-
-    Identifier operator()(const InDetDD::SiDetectorElement* detElem) const
-    {
-      return detElem->identify(); // easy, det element has identifier
-    }
-
-    Identifier operator()(const InDetDD::TRT_BaseElement*) const
-    {
-      // we got the identifier in constructrion, because it identifies
-      // the STRAW
-      return m_explicitIdentifier;
-    }
+  const Acts::Transform3 &getDefaultTransformMutexed() const;
 
-    Identifier m_explicitIdentifier;
-  };
+  /// Returns the underllying GeoModel detectorelement that this one
+  /// is based on.
+  const GeoVDetectorElement *upstreamDetectorElement() const;
 
+private:
   /// Detector element as variant
-  DetElemVariant m_detElement;
+  const GeoVDetectorElement *m_detElement;
   /// Boundaries of the detector element
   std::shared_ptr<const Acts::SurfaceBounds> m_bounds;
   ///  Thickness of this detector element
@@ -139,14 +94,11 @@ private:
   // this is pretty much only used single threaded, so
   // the mutex does not hurt
   mutable std::mutex m_cacheMutex;
-  mutable std::shared_ptr<const Acts::Transform3> m_defTransform;
-
-  Identifier m_explicitIdentifier;
-
-  // this is threadsafe!
-  //mutable Gaudi::Hive::ContextSpecificData<Acts::Transform3> m_ctxSpecificTransform;
+  mutable std::optional<Acts::Transform3> m_defTransform;
 
+  Acts::Transform3 m_extraTransform{Acts::Transform3::Identity()};
 
+  Identifier m_explicitIdentifier;
 };
 
 #endif
diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h
index 1f3d35a14c51..05233d031e2b 100644
--- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h
+++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsExtrapolationTool.h
@@ -6,6 +6,7 @@
 #define ACTSGEOMETRY_ACTSEXTRAPOLATIONTOOL_H
 
 // ATHENA
+#include "GeoPrimitives/GeoPrimitives.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/IInterface.h"
 #include "GaudiKernel/ServiceHandle.h"
diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsLayerBuilder.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsLayerBuilder.h
index 9e1de50e238a..ab14d3d2babb 100644
--- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsLayerBuilder.h
+++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsLayerBuilder.h
@@ -31,6 +31,10 @@ class LayerCreator;
 class ActsLayerBuilder : public Acts::ILayerBuilder
 {
 public:
+  enum class Mode {
+    Undefined, Pixel, SCT, TRT, ITkPixelInner, ITkPixelOuter, ITkStrip,
+  };
+
   using ElementVector
       = std::vector<std::shared_ptr<const ActsDetectorElement>>;
 
@@ -41,8 +45,7 @@ public:
   {
     /// string based identification
     std::string                          configurationName = "undefined";
-    ActsDetectorElement::Subdetector subdetector
-        = ActsDetectorElement::Subdetector::Pixel;
+    Mode mode = Mode::Undefined;
     const InDetDD::SiDetectorManager*   mng;
     std::shared_ptr<const Acts::LayerCreator> layerCreator = nullptr;
     /// the binning type of the contained surfaces in phi
@@ -58,6 +61,8 @@ public:
 
     std::pair<size_t, size_t> endcapMaterialBins = {20, 5};
     std::pair<size_t, size_t> barrelMaterialBins = {10, 10};
+
+    bool objDebugOutput = false;
   };
 
   /// Constructor
@@ -65,12 +70,7 @@ public:
   /// @param logger the local logging instance
   ActsLayerBuilder(const Config&                cfg,
                        std::unique_ptr<const Acts::Logger> logger
-                       = Acts::getDefaultLogger("GMLayBldr", Acts::Logging::INFO))
-    : m_logger(std::move(logger))
-  {
-    // std::cout << "GMLB construct" << std::endl;
-    m_cfg = cfg;
-  }
+                       = Acts::getDefaultLogger("GMLayBldr", Acts::Logging::INFO));
 
   /// Destructor
   ~ActsLayerBuilder() {}
@@ -84,6 +84,7 @@ public:
   const Acts::LayerVector
   positiveLayers(const Acts::GeometryContext& gctx) const override;
 
+
   /// Name identification
   // const std::string&
   // identification() const final;
@@ -139,7 +140,13 @@ private:
   // @param layers is goint to be filled
   // @param type is the indication which ones to build -1 | 0 | 1
   void
-  buildLayers(const Acts::GeometryContext& gctx, Acts::LayerVector& layersOutput, int type = 0);
+  buildBarrel(const Acts::GeometryContext& gctx, Acts::LayerVector& layersOutput);
+
+  void
+  buildEndcap(const Acts::GeometryContext& gctx, Acts::LayerVector& layersOutput, int type = 0);
+
 };
 
+std::ostream& operator<<(std::ostream& os, const ActsLayerBuilder::Mode& mode);
+
 #endif
diff --git a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsTrackingGeometrySvc.h b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsTrackingGeometrySvc.h
index b9c5d4b4ef55..f7d6eacf2573 100644
--- a/Tracking/Acts/ActsGeometry/ActsGeometry/ActsTrackingGeometrySvc.h
+++ b/Tracking/Acts/ActsGeometry/ActsGeometry/ActsTrackingGeometrySvc.h
@@ -13,6 +13,7 @@
 // PACKAGE
 #include "ActsGeometryInterfaces/IActsTrackingGeometrySvc.h"
 #include "ActsGeometryInterfaces/IActsTrackingVolumeBuilder.h"
+#include "ActsGeometry/ActsLayerBuilder.h"
 
 // STL
 #include <map>
@@ -60,8 +61,12 @@ public:
   getNominalAlignmentStore() const override;
 
 private:
+  ActsLayerBuilder::Config
+  makeLayerBuilderConfig(const InDetDD::InDetDetectorManager* manager);
+
   std::shared_ptr<const Acts::ILayerBuilder>
-  makeLayerBuilder(const InDetDD::InDetDetectorManager* manager);
+  makeStrawLayerBuilder(const InDetDD::InDetDetectorManager* manager);
+
 
   std::shared_ptr<Acts::TrackingVolume>
   makeSCTTRTAssembly(const Acts::GeometryContext& gctx, const Acts::ILayerBuilder& sct_lb,
@@ -72,6 +77,8 @@ private:
   const InDetDD::SiDetectorManager* p_pixelManager;
   const InDetDD::SiDetectorManager* p_SCTManager;
   const InDetDD::TRT_DetectorManager* p_TRTManager;
+  const InDetDD::SiDetectorManager* p_ITkPixelManager;
+  const InDetDD::SiDetectorManager* p_ITkStripManager;
 
   std::shared_ptr<std::vector<std::shared_ptr<const ActsDetectorElement>>> m_elementStore;
   std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry;
@@ -81,6 +88,7 @@ private:
   std::unique_ptr<const ActsAlignmentStore> m_nominalAlignmentStore{nullptr};
 
   Gaudi::Property<bool> m_useMaterialMap{this, "UseMaterialMap", false, ""};
+  Gaudi::Property<bool> m_objDebugOutput{this, "ObjDebugOutput", false, ""};
   Gaudi::Property<std::string> m_materialMapInputFile{this, "MaterialMapInputFile", "", ""};
   Gaudi::Property<std::vector<size_t>> m_barrelMaterialBins{this, "BarrelMaterialBins", {10, 10}};
   Gaudi::Property<std::vector<size_t>> m_endcapMaterialBins{this, "EndcapMaterialBins", {5, 20}};
diff --git a/Tracking/Acts/ActsGeometry/CMakeLists.txt b/Tracking/Acts/ActsGeometry/CMakeLists.txt
index 1b3a337f357a..d0963d06a818 100755
--- a/Tracking/Acts/ActsGeometry/CMakeLists.txt
+++ b/Tracking/Acts/ActsGeometry/CMakeLists.txt
@@ -41,6 +41,7 @@ atlas_add_library( ActsGeometryLib
                    PRIVATE_LINK_LIBRARIES
                    StoreGateLib
                    TRT_ReadoutGeometry
+                   SCT_ReadoutGeometry
                    TrkGeometry
                    TrkSurfaces
                    TrkFitterUtils
diff --git a/Tracking/Acts/ActsGeometry/python/ActsGeometryConfig.py b/Tracking/Acts/ActsGeometry/python/ActsGeometryConfig.py
index 447da6ed4a56..655bc88e0c79 100644
--- a/Tracking/Acts/ActsGeometry/python/ActsGeometryConfig.py
+++ b/Tracking/Acts/ActsGeometry/python/ActsGeometryConfig.py
@@ -3,7 +3,7 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 
 
-def ActsTrackingGeometrySvcCfg(configFlags, name = "ActsTrackingGeometrySvc" ) :
+def ActsTrackingGeometrySvcCfg(configFlags, name = "ActsTrackingGeometrySvc", **kwargs) :
   result = ComponentAccumulator()
   
   Acts_ActsTrackingGeometrySvc = CompFactory.ActsTrackingGeometrySvc
@@ -16,13 +16,18 @@ def ActsTrackingGeometrySvcCfg(configFlags, name = "ActsTrackingGeometrySvc" ) :
     subDetectors += ["TRT"]
   if configFlags.Detector.GeometryCalo:
     subDetectors += ["Calo"]
-
     # need to configure calo geometry, otherwise we get a crash
     from LArGeoAlgsNV.LArGMConfig import LArGMCfg
     result.merge(LArGMCfg(configFlags))
     from TileGeoModel.TileGMConfig import TileGMCfg
     result.merge(TileGMCfg(configFlags))
 
+  if configFlags.Detector.GeometryITkPixel:
+    subDetectors += ["ITkPixel"]
+  if configFlags.Detector.GeometryITkStrip:
+    subDetectors += ["ITkStrip"]
+
+
   idSub = [sd in subDetectors for sd in ("Pixel", "SCT", "TRT")]
   if any(idSub):
     # ANY of the ID subdetectors are on => we require GM sources
@@ -35,10 +40,7 @@ def ActsTrackingGeometrySvcCfg(configFlags, name = "ActsTrackingGeometrySvc" ) :
       from AthenaCommon.Logging import log
       log.warning("ConfigFlags indicate %s should be built. Not all ID subdetectors are set, but I'll set all of them up to capture the extra setup happening here.", ", ".join(subDetectors))
       
-  actsTrackingGeometrySvc = Acts_ActsTrackingGeometrySvc(name, BuildSubDetectors=subDetectors)
-
-
-  actsTrackingGeometrySvc = Acts_ActsTrackingGeometrySvc(name, BuildSubDetectors=subDetectors)
+  actsTrackingGeometrySvc = Acts_ActsTrackingGeometrySvc(name, BuildSubDetectors=subDetectors, **kwargs)
 
   if configFlags.TrackingGeometry.MaterialSource == "Input":
     actsTrackingGeometrySvc.UseMaterialMap = True
@@ -200,3 +202,21 @@ def ActsObjWriterToolCfg(name= "ActsObjWriterTool", **kwargs) :
 
   result.addPublicTool(ActsObjWriterTool, primary=True)
   return result
+
+
+def ActsExtrapolationAlgCfg(configFlags, name = "ActsExtrapolationAlg", **kwargs):
+  result = ComponentAccumulator()
+
+  if "ExtrapolationTool" not in kwargs:
+    extrapTool = ActsExtrapolationToolCfg(configFlags)
+    kwargs["ExtrapolationTool"] = extrapTool.getPrimary()
+    result.merge(extrapTool)
+
+  propStepWriterSvc = ActsPropStepRootWriterSvcCfg(configFlags)
+  result.merge(propStepWriterSvc)
+
+  ActsExtrapolationAlg = CompFactory.ActsExtrapolationAlg
+  alg = ActsExtrapolationAlg(name, **kwargs)
+  result.addEventAlgo(alg)
+
+  return result
\ No newline at end of file
diff --git a/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py b/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py
index 5df264b388ba..a54938751eb5 100644
--- a/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py
+++ b/Tracking/Acts/ActsGeometry/share/ActsExtrapolationAlg.py
@@ -10,25 +10,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
 
-from ActsGeometry.ActsGeometryConfig import ActsExtrapolationToolCfg
-from ActsGeometry.ActsGeometryConfig import ActsAlignmentCondAlgCfg, ActsPropStepRootWriterSvcCfg
-
-def ActsExtrapolationAlgCfg(configFlags, name = "ActsExtrapolationAlg", **kwargs):
-  result = ComponentAccumulator()
-
-  if "ExtrapolationTool" not in kwargs:
-    extrapTool = ActsExtrapolationToolCfg(configFlags)
-    kwargs["ExtrapolationTool"] = extrapTool.getPrimary()
-    result.merge(extrapTool)
-
-  propStepWriterSvc = ActsPropStepRootWriterSvcCfg(configFlags)
-  result.merge(propStepWriterSvc)
-
-  ActsExtrapolationAlg = CompFactory.ActsExtrapolationAlg
-  alg = ActsExtrapolationAlg(name, **kwargs)
-  result.addEventAlgo(alg)
-
-  return result
+from ActsGeometry.ActsGeometryConfig import ActsAlignmentCondAlgCfg, ActsPropStepRootWriterSvcCfg, ActsExtrapolationAlgCfg, ActsExtrapolationToolCfg
 
 if "__main__" == __name__:
   from AthenaCommon.Configurable import Configurable
diff --git a/Tracking/Acts/ActsGeometry/share/ITkTest.py b/Tracking/Acts/ActsGeometry/share/ITkTest.py
new file mode 100755
index 000000000000..3ae2a077ac4e
--- /dev/null
+++ b/Tracking/Acts/ActsGeometry/share/ITkTest.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+"""Run ACTS geometry construction for ITk
+
+Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaCommon.Configurable import Configurable
+from AthenaConfiguration.AllConfigFlags import ConfigFlags
+
+# Set up logging and new style config
+Configurable.configurableRun3Behavior = True
+
+ConfigFlags.GeoModel.useLocalGeometry = True
+
+detectors = [
+    "ITkPixel",
+    "ITkStrip"
+]
+
+from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
+setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True)
+
+from AthenaConfiguration.Enums import ProductionStep
+ConfigFlags.Common.ProductionStep = ProductionStep.Simulation
+ConfigFlags.GeoModel.AtlasVersion = "ATLAS-P2-ITK-24-00-00"
+ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-14"
+ConfigFlags.GeoModel.Align.Dynamic = False
+ConfigFlags.Input.Files = ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1']
+
+ConfigFlags.Concurrency.NumThreads = 64
+ConfigFlags.Concurrency.NumConcurrentEvents = 64
+
+ConfigFlags.lock()
+
+from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+acc = MainServicesCfg(ConfigFlags)
+from AthenaConfiguration.ComponentFactory import CompFactory
+
+
+from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelGeometryCfg
+itkPixel = ITkPixelGeometryCfg(ConfigFlags)
+acc.merge(itkPixel)
+
+from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripGeometryCfg
+itkStrip = ITkStripGeometryCfg(ConfigFlags)
+acc.merge(itkStrip)
+
+from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
+acc.merge(BeamPipeGeometryCfg(ConfigFlags))
+
+from ActsGeometry.ActsGeometryConfig import ActsAlignmentCondAlgCfg, ActsPropStepRootWriterSvcCfg, ActsExtrapolationAlgCfg, ActsExtrapolationToolCfg, ActsTrackingGeometrySvcCfg
+
+from ActsGeometry.ActsGeometryConfig import NominalAlignmentCondAlgCfg
+acc.merge(NominalAlignmentCondAlgCfg(ConfigFlags))
+
+from AthenaCommon.Constants import INFO, VERBOSE
+tgSvc = ActsTrackingGeometrySvcCfg(ConfigFlags, 
+                                   OutputLevel=VERBOSE, 
+                                   ObjDebugOutput=True)
+acc.merge(tgSvc)
+
+alg = ActsExtrapolationAlgCfg(ConfigFlags,
+                              OutputLevel=INFO,
+                              NParticlesPerEvent = int(100),
+                              WritePropStep = True,
+                              EtaRange = [-5, 5],
+                              PtRange = [20, 100])
+
+acc.merge(alg)
+
+acc.printConfig()
+
+
+
+acc.run(200)
diff --git a/Tracking/Acts/ActsGeometry/src/ActsATLASConverterTool.cxx b/Tracking/Acts/ActsGeometry/src/ActsATLASConverterTool.cxx
index 43dd14611d7e..34451e009c5a 100644
--- a/Tracking/Acts/ActsGeometry/src/ActsATLASConverterTool.cxx
+++ b/Tracking/Acts/ActsGeometry/src/ActsATLASConverterTool.cxx
@@ -56,7 +56,8 @@ ActsATLASConverterTool::initialize()
     {
       const auto* actsElement = dynamic_cast<const ActsDetectorElement*>(surface->associatedDetectorElement());
       // Conversion from Acts to ATLAS surface impossible for the TRT so the TRT surface are not sure in this map
-      if(actsElement && actsElement->getSubdetector() != ActsDetectorElement::Subdetector::TRT 
+      bool isTRT = (dynamic_cast<const InDetDD::TRT_BaseElement*>(actsElement->upstreamDetectorElement()) != nullptr);
+      if(actsElement && !isTRT
                      && m_actsSurfaceMap.find(actsElement->identify()) == m_actsSurfaceMap.end()){
         m_actsSurfaceMap.insert(std::pair<Identifier, const Acts::Surface &>(actsElement->identify(), *surface));
       }
diff --git a/Tracking/Acts/ActsGeometry/src/ActsDetectorElement.cxx b/Tracking/Acts/ActsGeometry/src/ActsDetectorElement.cxx
index ece8cdc08164..cdd6ed9e10ee 100644
--- a/Tracking/Acts/ActsGeometry/src/ActsDetectorElement.cxx
+++ b/Tracking/Acts/ActsGeometry/src/ActsDetectorElement.cxx
@@ -5,28 +5,36 @@
 #include "ActsGeometry/ActsDetectorElement.h"
 
 // ATHENA
-#include "TRT_ReadoutGeometry/TRT_EndcapElement.h"
-#include "TRT_ReadoutGeometry/TRT_BarrelElement.h"
 #include "ActsInterop/IdentityHelper.h"
+#include "GeoPrimitives/CLHEPtoEigenConverter.h"
+#include "GeoPrimitives/GeoPrimitives.h"
+#include "SCT_ReadoutGeometry/StripBoxDesign.h"
+#include "SCT_ReadoutGeometry/StripStereoAnnulusDesign.h"
+#include "TRT_ReadoutGeometry/TRT_BarrelElement.h"
+#include "TRT_ReadoutGeometry/TRT_EndcapElement.h"
+#include "TrkSurfaces/AnnulusBounds.h"
 #include "TrkSurfaces/RectangleBounds.h"
 #include "TrkSurfaces/Surface.h"
 #include "TrkSurfaces/SurfaceBounds.h"
 #include "TrkSurfaces/TrapezoidBounds.h"
-#include "GeoPrimitives/CLHEPtoEigenConverter.h"
 
 // PACKAGE
-#include "ActsGeometry/ActsTrackingGeometrySvc.h"
 #include "ActsGeometry/ActsAlignmentStore.h"
 #include "ActsGeometry/ActsGeometryContext.h"
+#include "ActsGeometry/ActsTrackingGeometrySvc.h"
 
 // ACTS
-#include "Acts/Surfaces/StrawSurface.hpp"
+#include "Acts/Definitions/Units.hpp"
+#include "Acts/Geometry/GeometryContext.hpp"
+#include "Acts/Surfaces/AnnulusBounds.hpp"
+#include "Acts/Surfaces/DiscSurface.hpp"
 #include "Acts/Surfaces/LineBounds.hpp"
 #include "Acts/Surfaces/PlaneSurface.hpp"
 #include "Acts/Surfaces/RectangleBounds.hpp"
+#include "Acts/Surfaces/StrawSurface.hpp"
 #include "Acts/Surfaces/TrapezoidBounds.hpp"
-#include "Acts/Geometry/GeometryContext.hpp"
-#include "Acts/Definitions/Units.hpp"
+#include "Acts/Visualization/ObjVisualization3D.hpp"
+#include "Acts/Visualization/PlyVisualization3D.hpp"
 
 // STL
 #include <mutex>
@@ -35,237 +43,274 @@
 #include <boost/variant.hpp>
 #include <boost/variant/get.hpp>
 
-
-using Acts::Transform3;
 using Acts::Surface;
+using Acts::Transform3;
 
 using namespace Acts::UnitLiterals;
 
 constexpr double length_unit = 1_mm;
 
 ActsDetectorElement::ActsDetectorElement(
-    const InDetDD::SiDetectorElement* detElem)
-{
-  m_detElement = detElem;
+    const InDetDD::SiDetectorElement &detElem) {
+  m_detElement = &detElem;
 
-  //auto center     = detElem->center();
-  auto boundsType = detElem->bounds().type();
+  auto boundsType = detElem.bounds().type();
 
   // thickness
-  m_thickness = detElem->thickness();
+  m_thickness = detElem.thickness();
 
   if (boundsType == Trk::SurfaceBounds::Rectangle) {
 
-    const InDetDD::SiDetectorDesign &design = detElem->design();
-    double hlX = design.width()/2. * length_unit;
-    double hlY = design.length()/2. * length_unit;
+    const InDetDD::SiDetectorDesign &design = detElem.design();
+    double hlX = design.width() / 2. * length_unit;
+    double hlY = design.length() / 2. * length_unit;
 
-    auto rectangleBounds = std::make_shared<const Acts::RectangleBounds>(
-        hlX, hlY);
+    auto rectangleBounds =
+        std::make_shared<const Acts::RectangleBounds>(hlX, hlY);
 
     m_bounds = rectangleBounds;
 
-    m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(rectangleBounds, *this);
+    if (const auto *bd = dynamic_cast<const InDetDD::StripBoxDesign *>(&design);
+        bd != nullptr) {
+      // extra shift for split row modules
+      m_extraTransform = Acts::Transform3::Identity() *
+                         Acts::AngleAxis3{-M_PI / 2., Acts::Vector3::UnitZ()} *
+                         bd->moduleShift() *
+                         Acts::AngleAxis3{M_PI / 2., Acts::Vector3::UnitZ()};
+    }
 
-  } else if (boundsType == Trk::SurfaceBounds::Trapezoid) {
+    m_surface =
+        Acts::Surface::makeShared<Acts::PlaneSurface>(rectangleBounds, *this);
 
-    std::string shapeString = detElem->getMaterialGeom()->getLogVol()->getShape()->type();
-    //std::cout << __FUNCTION__ << "tapezoid, GeoLogVol -> shape says: " << shapeString << std::endl;
+  } else if (boundsType == Trk::SurfaceBounds::Trapezoid) {
 
-    const InDetDD::SiDetectorDesign &design = detElem->design();
+    const InDetDD::SiDetectorDesign &design = detElem.design();
 
-    double minHlX = design.minWidth()/2. * length_unit;
-    double maxHlX = design.maxWidth()/2. * length_unit;
-    double hlY    = design.length()/2. * length_unit;
+    double minHlX = design.minWidth() / 2. * length_unit;
+    double maxHlX = design.maxWidth() / 2. * length_unit;
+    double hlY = design.length() / 2. * length_unit;
 
-    auto trapezoidBounds = std::make_shared<const Acts::TrapezoidBounds>(
-        minHlX, maxHlX, hlY);
+    auto trapezoidBounds =
+        std::make_shared<const Acts::TrapezoidBounds>(minHlX, maxHlX, hlY);
 
     m_bounds = trapezoidBounds;
 
-    m_surface = Acts::Surface::makeShared<Acts::PlaneSurface>(trapezoidBounds, *this);
+    m_surface =
+        Acts::Surface::makeShared<Acts::PlaneSurface>(trapezoidBounds, *this);
+
+  } else if (boundsType == Trk::SurfaceBounds::Annulus) {
+
+    const InDetDD::SiDetectorDesign &design = detElem.design();
+    const auto *annulus =
+        dynamic_cast<const InDetDD::StripStereoAnnulusDesign *>(&design);
+    if (annulus == nullptr) {
+      throw std::domain_error("ActsDetectorElement got inconsistent surface");
+    }
+
+    double phi = annulus->phiWidth();
+    double phiS = annulus->stereo();
+    double R = annulus->waferCentreR();
+    double maxR = annulus->maxR();
+    double minR = annulus->minR();
+
+    double phiAvg =
+        0; // phiAvg is the bounds-internal local rotation. We don't want one
+
+    // // phi is the total opening angle, set up symmetric phi bounds
+    double phiMax = phi / 2.;
+    double phiMin = -phiMax;
+
+    // // need to rotate pi/2 to reproduce ABXY orientation, phiS so that phi=0
+    // is center and symmetric
+    double phiShift = M_PI / 2. - phiS;
+
+    Amg::Vector2D originStripXYRotated(R * (1 - std::cos(phiS)),
+                                       R * std::sin(-phiS));
+
+    auto annulusBounds = std::make_shared<Acts::AnnulusBounds>(
+        minR, maxR, phiMin, phiMax, originStripXYRotated, phiAvg);
+    m_bounds = annulusBounds;
+
+    m_surface =
+        Acts::Surface::makeShared<Acts::DiscSurface>(annulusBounds, *this);
+
+    Amg::Vector2D origin2D = annulusBounds->moduleOrigin();
+    Amg::Translation3D transl(Amg::Vector3D(origin2D.x(), origin2D.y(), 0));
+    Amg::Rotation3D rot(Amg::AngleAxis3D(-phiShift, Amg::Vector3D::UnitZ()));
+    Amg::Transform3D originTrf;
+    originTrf = transl * rot;
+    m_extraTransform = originTrf.inverse();
 
   } else {
-    throw std::domain_error("ActsDetectorElement does not support this surface type");
+    std::cout << boundsType << std::endl;
+    throw std::domain_error(
+        "ActsDetectorElement does not support this surface type");
   }
 }
 
 ActsDetectorElement::ActsDetectorElement(
-    const Acts::Transform3& trf,
-    const InDetDD::TRT_BaseElement* detElem,
-    const Identifier& id)
-{
-  m_detElement = detElem;
-  m_defTransform = std::make_shared<const Acts::Transform3>(trf);
+    const Acts::Transform3 &trf, const InDetDD::TRT_BaseElement &detElem,
+    const Identifier &id) {
+  m_detElement = &detElem;
+  m_defTransform = trf;
   m_explicitIdentifier = id;
 
   // we know this is a straw
-  double length = detElem->strawLength()*0.5 * length_unit;
+  double length = detElem.strawLength() * 0.5 * length_unit;
 
   // we need to find the radius
-  auto ecElem = dynamic_cast<const InDetDD::TRT_EndcapElement*>(detElem);
-  auto brlElem = dynamic_cast<const InDetDD::TRT_BarrelElement*>(detElem);
+  auto ecElem = dynamic_cast<const InDetDD::TRT_EndcapElement *>(&detElem);
+  auto brlElem = dynamic_cast<const InDetDD::TRT_BarrelElement *>(&detElem);
   double innerTubeRadius{0.};
   if (ecElem) {
     innerTubeRadius = ecElem->getDescriptor()->innerTubeRadius() * length_unit;
-  }
-  else {
-    if (brlElem){
-      innerTubeRadius = brlElem->getDescriptor()->innerTubeRadius() * length_unit;
+  } else {
+    if (brlElem) {
+      innerTubeRadius =
+          brlElem->getDescriptor()->innerTubeRadius() * length_unit;
     } else {
-      throw std::runtime_error("Cannot get tube radius for element in ActsDetectorElement c'tor");
+      throw std::runtime_error(
+          "Cannot get tube radius for element in ActsDetectorElement c'tor");
     }
   }
 
-  auto lineBounds = std::make_shared<const Acts::LineBounds>(innerTubeRadius, length);
+  auto lineBounds =
+      std::make_shared<const Acts::LineBounds>(innerTubeRadius, length);
   m_bounds = lineBounds;
 
   m_surface = Acts::Surface::makeShared<Acts::StrawSurface>(lineBounds, *this);
 }
 
-IdentityHelper
-ActsDetectorElement::identityHelper() const
-{
-  size_t which = m_detElement.which();
-  if (which == 0) {
-    return IdentityHelper(boost::get<const InDetDD::SiDetectorElement*>(m_detElement));
+IdentityHelper ActsDetectorElement::identityHelper() const {
+  if (const auto *detElem =
+          dynamic_cast<const InDetDD::SiDetectorElement *>(m_detElement);
+      detElem != nullptr) {
+    return IdentityHelper(detElem);
   } else {
     throw std::domain_error("Cannot get IdentityHelper for TRT element");
   }
 }
 
-const Acts::Transform3&
-ActsDetectorElement::transform(const Acts::GeometryContext& anygctx) const
-{
+const Acts::Transform3 &
+ActsDetectorElement::transform(const Acts::GeometryContext &anygctx) const {
   // any cast to known context type
-  const ActsGeometryContext* gctx = anygctx.get<const ActsGeometryContext*>();
+  const ActsGeometryContext *gctx = anygctx.get<const ActsGeometryContext *>();
 
-  // This is needed for initial geometry construction. At that point, we don't have a
-  // consistent view of the geometry yet, and thus we can't populate an alignment store
-  // at that time.
+  // This is needed for initial geometry construction. At that point, we don't
+  // have a consistent view of the geometry yet, and thus we can't populate an
+  // alignment store at that time.
   if (gctx->construction) {
     // this should only happen at initialize (1 thread, but mutex anyway)
     return getDefaultTransformMutexed();
   }
 
   // unpack the alignment store from the context
-  const ActsAlignmentStore* alignmentStore = gctx->alignmentStore;
+  const ActsAlignmentStore *alignmentStore = gctx->alignmentStore;
   // no GAS, is this initialization?
   assert(alignmentStore != nullptr);
 
   // get the correct cached transform
   // units should be fine here since we converted at construction
-  const Acts::Transform3* cachedTrf = alignmentStore->getTransform(this);
+  const Acts::Transform3 *cachedTrf = alignmentStore->getTransform(this);
 
   assert(cachedTrf != nullptr);
 
   return *cachedTrf;
 }
 
-void
-ActsDetectorElement::storeTransform(ActsAlignmentStore* gas) const
-{
-  struct get_transform : public boost::static_visitor<Acts::Transform3>
-  {
-    get_transform(ActsAlignmentStore* gas2, const Acts::Transform3* trtTrf)
-      : m_store(gas2), m_trtTrf(trtTrf) {}
-
-    Acts::Transform3 operator()(const InDetDD::SiDetectorElement* detElem) const
-    {
-      Amg::Transform3D g2l
-        = detElem->getMaterialGeom()->getAbsoluteTransform(m_store)
-        * Amg::CLHEPTransformToEigen(detElem->recoToHitTransform());
-
-      // need to make sure translation has correct units
-      g2l.translation() *= length_unit;
-
-      return g2l;
-    }
-
-    Acts::Transform3 operator()(const InDetDD::TRT_BaseElement*) const
-    {
-      return *m_trtTrf;
-    }
-
-    ActsAlignmentStore* m_store;
-    const Acts::Transform3* m_trtTrf;
-  };
-
-  Acts::Transform3 trf
-    = boost::apply_visitor(get_transform(gas, m_defTransform.get()), m_detElement);
+void ActsDetectorElement::storeTransform(ActsAlignmentStore *gas) const {
+  Amg::Transform3D trf;
+  if (const auto *detElem =
+          dynamic_cast<const InDetDD::SiDetectorElement *>(m_detElement);
+      detElem != nullptr) {
+    Amg::Transform3D l2g =
+        detElem->getMaterialGeom()->getAbsoluteTransform(gas) *
+        Amg::CLHEPTransformToEigen(detElem->recoToHitTransform());
+
+    // need to make sure translation has correct units
+    l2g.translation() *= 1.0 / CLHEP::mm * length_unit;
+
+    l2g = l2g * m_extraTransform;
+
+    trf = l2g;
+  } else if (const auto *detElem =
+                 dynamic_cast<const InDetDD::TRT_BaseElement *>(m_detElement);
+             detElem != nullptr) {
+    // So far: NO ALIGNMENT for the ACTS TRT version. Default transform set in
+    // constructor, should be safe to access without mutex.
+    trf = *m_defTransform;
+  } else {
+    throw std::runtime_error{"Unknown detector element type"};
+  }
 
   gas->setTransform(this, trf);
   if (gas->getTransform(this) == nullptr) {
-    throw std::runtime_error("Detector element was unable to store transform in GAS");
+    throw std::runtime_error(
+        "Detector element was unable to store transform in GAS");
   }
-
 }
 
-const Acts::Transform3&
-ActsDetectorElement::getDefaultTransformMutexed() const
-{
-  struct get_default_transform : public boost::static_visitor<Acts::Transform3>
-  {
-    get_default_transform(const Acts::Transform3* trtTrf) : m_trtTrf(trtTrf) {}
-
-    Acts::Transform3 operator()(const InDetDD::SiDetectorElement* detElem) const
-    {
-      Amg::Transform3D g2l
-        = detElem->getMaterialGeom()->getDefAbsoluteTransform()
-        * Amg::CLHEPTransformToEigen(detElem->recoToHitTransform());
-
-      // need to make sure translation has correct units
-      g2l.translation() *= length_unit;
-
-      return g2l;
-    }
-
-    Acts::Transform3 operator()(const InDetDD::TRT_BaseElement*) const
-    {
-      return *m_trtTrf;
-    }
-
-    const Acts::Transform3* m_trtTrf;
-  };
-
+const Acts::Transform3 &
+ActsDetectorElement::getDefaultTransformMutexed() const {
   std::lock_guard<std::mutex> guard(m_cacheMutex);
   if (m_defTransform) {
     return *m_defTransform;
   }
   // transform not yet set
-  m_defTransform
-    = std::make_shared<const Acts::Transform3>(
-        boost::apply_visitor(get_default_transform(m_defTransform.get()), m_detElement));
+  if (const auto *detElem =
+          dynamic_cast<const InDetDD::SiDetectorElement *>(m_detElement);
+      detElem != nullptr) {
+    Amg::Transform3D l2g =
+        detElem->getMaterialGeom()->getDefAbsoluteTransform() *
+        Amg::CLHEPTransformToEigen(detElem->recoToHitTransform());
+
+    l2g.translation() *= 1.0 / CLHEP::mm * length_unit;
+
+    l2g = l2g * m_extraTransform;
+
+    m_defTransform = l2g;
+  } else if (const auto *detElem =
+                 dynamic_cast<const InDetDD::TRT_BaseElement *>(m_detElement);
+             detElem != nullptr) {
+    throw std::logic_error{
+        "TRT transform should have been set in the constructor"};
+  } else {
+    throw std::runtime_error{"Unknown detector element type"};
+  }
 
   return *m_defTransform;
 }
 
-const Acts::Surface&
-ActsDetectorElement::surface() const
-{
+const Acts::Surface &ActsDetectorElement::surface() const {
   return (*m_surface);
 }
 
-const Trk::Surface&
-ActsDetectorElement::atlasSurface() const
-{
-  size_t which = m_detElement.which();
-  if (which == 0) {
-    return (boost::get<const InDetDD::SiDetectorElement *>(m_detElement))->surface();
-  }
-   else {
+const Trk::Surface &ActsDetectorElement::atlasSurface() const {
+  if (const auto *detElem =
+          dynamic_cast<const InDetDD::SiDetectorElement *>(m_detElement);
+      detElem != nullptr) {
+    return detElem->surface();
+  } else {
     throw std::domain_error("Cannot get surface for TRT element");
   }
 }
 
-double
-ActsDetectorElement::thickness() const
-{
-  return m_thickness;
-}
+double ActsDetectorElement::thickness() const { return m_thickness; }
 
-Identifier
-ActsDetectorElement::identify() const
-{
-  return boost::apply_visitor(IdVisitor(m_explicitIdentifier), m_detElement);
+Identifier ActsDetectorElement::identify() const {
+  if (const auto *detElem =
+          dynamic_cast<const InDetDD::SiDetectorElement *>(m_detElement);
+      detElem != nullptr) {
+    return detElem->identify();
+  } else if (dynamic_cast<const InDetDD::TRT_BaseElement *>(m_detElement) !=
+             nullptr) {
+    return m_explicitIdentifier;
+  } else {
+    throw std::runtime_error{"Unknown detector element type"};
+  }
 }
+
+const GeoVDetectorElement *
+ActsDetectorElement::upstreamDetectorElement() const {
+  return m_detElement;
+}
\ No newline at end of file
diff --git a/Tracking/Acts/ActsGeometry/src/ActsLayerBuilder.cxx b/Tracking/Acts/ActsGeometry/src/ActsLayerBuilder.cxx
index ae761115a4b1..0379f600df9f 100644
--- a/Tracking/Acts/ActsGeometry/src/ActsLayerBuilder.cxx
+++ b/Tracking/Acts/ActsGeometry/src/ActsLayerBuilder.cxx
@@ -11,325 +11,562 @@
 #include "ActsInterop/IdentityHelper.h"
 
 // ACTS
+#include "Acts/Definitions/Algebra.hpp"
+#include "Acts/Definitions/Units.hpp"
+#include "Acts/Geometry/ApproachDescriptor.hpp"
+#include "Acts/Geometry/GenericApproachDescriptor.hpp"
+#include "Acts/Geometry/GeometryContext.hpp"
+#include "Acts/Geometry/LayerCreator.hpp"
+#include "Acts/Geometry/ProtoLayer.hpp"
 #include "Acts/Material/ProtoSurfaceMaterial.hpp"
 #include "Acts/Surfaces/CylinderSurface.hpp"
 #include "Acts/Surfaces/DiscSurface.hpp"
-#include "Acts/Geometry/GenericApproachDescriptor.hpp"
-#include "Acts/Geometry/ApproachDescriptor.hpp"
-#include "Acts/Geometry/ProtoLayer.hpp"
-#include "Acts/Geometry/LayerCreator.hpp"
-#include "Acts/Definitions/Algebra.hpp"
-#include "Acts/Geometry/GeometryContext.hpp"
-#include "Acts/Definitions/Units.hpp"
 #include "Acts/Utilities/BinningType.hpp"
+#include "Acts/Surfaces/AnnulusBounds.hpp"
+
+#include "Acts/Visualization/GeometryView3D.hpp"
+#include "Acts/Visualization/ObjVisualization3D.hpp"
 
+#include <iterator>
+#include <unordered_map>
 
 using Acts::Surface;
 using Acts::Transform3;
 using Acts::Translation3;
 
-
 using namespace Acts::UnitLiterals;
 
-const Acts::LayerVector
-ActsLayerBuilder::negativeLayers(const Acts::GeometryContext& gctx) const
+ActsLayerBuilder::ActsLayerBuilder(const Config&                cfg,
+                      std::unique_ptr<const Acts::Logger> logger)
+  : m_logger(std::move(logger))
 {
+  m_cfg = cfg;
+  if(m_cfg.mode == Mode::Undefined) {
+    throw std::invalid_argument("ALB mode is undefined");
+  }
+}
+
+const Acts::LayerVector
+ActsLayerBuilder::negativeLayers(const Acts::GeometryContext &gctx) const {
   ACTS_VERBOSE("Building negative layers");
   // @todo Remove this hack once the m_elementStore mess is sorted out
-  auto        mutableThis = const_cast<ActsLayerBuilder*>(this);
+  auto mutableThis = const_cast<ActsLayerBuilder *>(this);
   Acts::LayerVector nVector;
-  mutableThis->buildLayers(gctx, nVector, -1);
+  mutableThis->buildEndcap(gctx, nVector, -1);
   return nVector;
 }
 
 const Acts::LayerVector
-ActsLayerBuilder::centralLayers(const Acts::GeometryContext& gctx) const
-{
+ActsLayerBuilder::centralLayers(const Acts::GeometryContext &gctx) const {
   ACTS_VERBOSE("Building central layers");
   // @todo Remove this hack once the m_elementStore mess is sorted out
-  auto        mutableThis = const_cast<ActsLayerBuilder*>(this);
+  auto mutableThis = const_cast<ActsLayerBuilder *>(this);
   Acts::LayerVector cVector;
-  mutableThis->buildLayers(gctx, cVector, 0);
+  mutableThis->buildBarrel(gctx, cVector);
   return cVector;
 }
 
 const Acts::LayerVector
-ActsLayerBuilder::positiveLayers(const Acts::GeometryContext& gctx) const
-{
+ActsLayerBuilder::positiveLayers(const Acts::GeometryContext &gctx) const {
   ACTS_VERBOSE("Building positive layers");
   // @todo Remove this hack once the m_elementStore mess is sorted out
-  auto        mutableThis = const_cast<ActsLayerBuilder*>(this);
+  auto mutableThis = const_cast<ActsLayerBuilder *>(this);
   Acts::LayerVector pVector;
-  mutableThis->buildLayers(gctx, pVector, 1);
+  mutableThis->buildEndcap(gctx, pVector, 1);
   return pVector;
-
 }
 
 std::vector<std::shared_ptr<const ActsDetectorElement>>
-ActsLayerBuilder::getDetectorElements() const
-{
-  auto siDetMng = static_cast<const InDetDD::SiDetectorManager*>(m_cfg.mng);
+ActsLayerBuilder::getDetectorElements() const {
+  ACTS_VERBOSE("Retrieving detector elements from detector manager");
+  if (m_cfg.mng == nullptr) {
+    ACTS_ERROR("Manager is null");
+    throw std::runtime_error{"Detector manager is null"};
+  }
+  auto siDetMng = static_cast<const InDetDD::SiDetectorManager *>(m_cfg.mng);
+  ACTS_VERBOSE("Detector manager has "
+               << std::distance(siDetMng->getDetectorElementBegin(),
+                                siDetMng->getDetectorElementEnd())
+               << " elements");
 
   std::vector<std::shared_ptr<const ActsDetectorElement>> elements;
 
   InDetDD::SiDetectorElementCollection::const_iterator iter;
   for (iter = siDetMng->getDetectorElementBegin();
-      iter != siDetMng->getDetectorElementEnd();
-      ++iter) {
-    const InDetDD::SiDetectorElement* siDetElement = *iter;
+       iter != siDetMng->getDetectorElementEnd(); ++iter) {
+    const InDetDD::SiDetectorElement *siDetElement =
+        dynamic_cast<InDetDD::SiDetectorElement *>(*iter);
+    if (siDetElement == nullptr) {
+      ACTS_ERROR("Detector element was nullptr");
+      throw std::runtime_error{"Corrupt detector element collection"};
+    }
     elements.push_back(
-        std::make_shared<const ActsDetectorElement>(
-          siDetElement));
+        std::make_shared<const ActsDetectorElement>(*siDetElement));
   }
+  ACTS_VERBOSE("Retrieved " << elements.size() << " elements");
 
   return elements;
 }
 
-void
-ActsLayerBuilder::buildLayers(const Acts::GeometryContext& gctx,
-    Acts::LayerVector& layersOutput, int type)
-{
-
-  std::vector<std::shared_ptr<const ActsDetectorElement>> elements = getDetectorElements();
+void ActsLayerBuilder::buildBarrel(const Acts::GeometryContext &gctx,
+                                   Acts::LayerVector &layersOutput) {
 
+  ACTS_VERBOSE("Build layers: BARREL");
+  std::vector<std::shared_ptr<const ActsDetectorElement>> elements =
+      getDetectorElements();
 
-  std::map<std::pair<int, int>, std::vector<std::shared_ptr<const Surface>>> layers;
+  std::map<int, std::vector<std::shared_ptr<const Acts::Surface>>> layers{};
 
   for (const auto &element : elements) {
 
     IdentityHelper id = element->identityHelper();
+    if (id.bec() != 0)
+      continue;
 
-    // wrong subdetector
-    // want barrel but not barrel
-    if (type == 0 && id.bec() != 0) continue;
-    // want endcap but is barrel
-    if (type != 0 && id.bec() == 0) continue;
-    // want endcap, but wrong side
-    if (type != 0 && type * id.bec() < 0) continue;
+    if(m_cfg.mode == Mode::ITkPixelInner) {
+      if(id.layer_disk() >= 2) continue;
+    }
+    if(m_cfg.mode == Mode::ITkPixelOuter) {
+      if(id.layer_disk() <= 1) continue;
+    }
 
     m_cfg.elementStore->push_back(element);
 
-    // const PixelID* idhlp = dynamic_cast<const
-    // PixelID*>(siDetElement->getIdHelper());
-    // int layer_disk = idhlp->layer_disk(siDetElement->identify());
-    // int eta_module = idhlp->eta_module(siDetElement->identify());
-
-    // std::cout << "SELECTED: ";
-    // std::cout << element->bec() << " ";
-    // std::cout << "(" << element->layer_disk() << " " << layer_disk << ") ";
-    // std::cout << "(" << element->eta_module() << " " << eta_module << ") ";
-    // std::cout << element->phi_module() << " ";
-    // std::cout << "Z = " << element->surface().center().z() << std::endl;
-
     int elementLayer;
     elementLayer = id.layer_disk();
 
-    std::pair<int, int> layerKey(elementLayer, id.bec());
+    layers[elementLayer].push_back(element->surface().getSharedPtr());
+  }
 
-    if (layers.count(layerKey) == 0) {
-      // layer not set yet
-      layers.insert(std::make_pair(layerKey, std::vector<std::shared_ptr<const Surface>>()));
-    }
+  // // @TODO: Exclude BCM, should happen via separate detector manager
 
-    // push into correct layer
-    layers.at(layerKey).push_back(element->surface().getSharedPtr());
+  if (m_cfg.objDebugOutput) {
+    std::string lab;
+    for (auto &[key, layerSurfaces] : layers) {
 
-  }
+      std::stringstream name;
 
-  // @TODO: Maybe exclude BLM (BCM?)
 
-  ACTS_VERBOSE("Found " << layers.size() << " layers");
+
+      name << "obj/" << m_cfg.mode << "_brl_" << std::setfill('0') << std::setw(2)
+          << std::to_string(key) + "_bec"
+          << ".obj";
+
+      std::ofstream ofs{name.str()};
+      Acts::ObjVisualization3D vis{};
+      Acts::ViewConfig vc = Acts::s_viewSensitive;
+      vc.nSegments = 200;
+      for (const auto &surface : layerSurfaces) {
+        Acts::GeometryView3D::drawSurface(vis, *surface, gctx,
+                                          Acts::Transform3::Identity(), vc);
+      }
+
+      vis.write(ofs);
+    }
+  }
+
+  ACTS_VERBOSE("Found " << layers.size() << " barrel layers");
   // pre loop for more concise output. only do if we actually print it
-  if(logger().doPrint(Acts::Logging::VERBOSE)) {
+  if (logger().doPrint(Acts::Logging::VERBOSE)) {
     size_t n = 1;
-    for (const auto& layerPair : layers) {
-      const std::vector<std::shared_ptr<const Surface>>& layerSurfaces = layerPair.second;
-      auto key = layerPair.first;
-      Acts::ProtoLayer pl(gctx, layerSurfaces);
-      ACTS_VERBOSE("Layer #" << n << " with layerKey: ("
-          << key.first << ", " << key.second << ")");
-      if (type == 0) {  // BARREL
-        ACTS_VERBOSE(" -> at rMin / rMax: " << pl.min(Acts::binR) << " / " << pl.max(Acts::binR));
-        ACTS_VERBOSE("    -> at zMin / zMax: " << pl.min(Acts::binZ) << " / " << pl.max(Acts::binZ));
-      }
-      else {
-        ACTS_VERBOSE(" -> at zMin / zMax: " << pl.min(Acts::binZ) << " / " << pl.max(Acts::binZ));
-        ACTS_VERBOSE("    -> at rMin / rMax: " << pl.min(Acts::binR) << " / " << pl.max(Acts::binR));
-      }
+    for (const auto &[key, surfaces] : layers) {
+      Acts::ProtoLayer pl(gctx, surfaces);
+      ACTS_VERBOSE("Layer #" << n << " with layerKey: (" << key << ")");
+      ACTS_VERBOSE(" -> at rMin / rMax: " << pl.min(Acts::binR) << " / "
+                                          << pl.max(Acts::binR));
+      ACTS_VERBOSE("    -> at zMin / zMax: " << pl.min(Acts::binZ) << " / "
+                                             << pl.max(Acts::binZ));
 
       n++;
     }
   }
 
-  for (const auto& layerPair : layers) {
+  for (const auto &[key, surfaces] : layers) {
 
     std::unique_ptr<Acts::ApproachDescriptor> approachDescriptor = nullptr;
     std::shared_ptr<const Acts::ProtoSurfaceMaterial> materialProxy = nullptr;
 
-    // use ref here, copy later
-    const std::vector<std::shared_ptr<const Surface>>& layerSurfaces = layerPair.second;
+    // layers and extent are determined, build actual layer
+    Acts::ProtoLayer pl(gctx, surfaces);
+    pl.envelope[Acts::binR] = std::make_pair(2_mm, 2_mm);
+    pl.envelope[Acts::binZ] = std::make_pair(2_mm, 2_mm);
+
+    double layerZ = pl.medium(Acts::binZ, true);
+    double layerHalfZ = 0.5 * pl.range(Acts::binZ);
+
+    Acts::Transform3 transform(Translation3(0., 0., -layerZ));
+    // set up approach descriptor
+
+    std::shared_ptr<Acts::CylinderSurface> innerBoundary =
+        Acts::Surface::makeShared<Acts::CylinderSurface>(
+            transform, pl.min(Acts::binR), layerHalfZ);
+
+    std::shared_ptr<Acts::CylinderSurface> outerBoundary =
+        Acts::Surface::makeShared<Acts::CylinderSurface>(
+            transform, pl.max(Acts::binR), layerHalfZ);
+
+    std::shared_ptr<Acts::CylinderSurface> centralSurface =
+        Acts::Surface::makeShared<Acts::CylinderSurface>(
+            transform, (pl.min(Acts::binR) + pl.max(Acts::binR)) / 2.,
+            layerHalfZ);
+
+    size_t binsPhi = m_cfg.barrelMaterialBins.first;
+    size_t binsZ = m_cfg.barrelMaterialBins.second;
+
+    Acts::BinUtility materialBinUtil(binsPhi, -M_PI, M_PI, Acts::closed,
+                                     Acts::binPhi);
+    materialBinUtil += Acts::BinUtility(binsZ, -layerHalfZ, layerHalfZ,
+                                        Acts::open, Acts::binZ, transform);
+
+    materialProxy =
+        std::make_shared<const Acts::ProtoSurfaceMaterial>(materialBinUtil);
+
+    ACTS_VERBOSE("[L] Layer is marked to carry support material on Surface ( "
+                 "inner=0 / center=1 / outer=2 ) : "
+                 << "inner");
+    ACTS_VERBOSE("with binning: [" << binsPhi << ", " << binsZ << "]");
+
+    ACTS_VERBOSE("Created ApproachSurfaces for cylinder layer at:");
+    ACTS_VERBOSE(" - inner:   R=" << pl.min(Acts::binR));
+    ACTS_VERBOSE(" - central: R=" << (pl.min(Acts::binR) + pl.max(Acts::binR)) /
+                                         2.);
+    ACTS_VERBOSE(" - outer:   R=" << pl.max(Acts::binR));
+
+    // set material on inner
+    innerBoundary->assignSurfaceMaterial(materialProxy);
+
+    std::vector<std::shared_ptr<const Acts::Surface>> aSurfaces;
+    aSurfaces.push_back(std::move(innerBoundary));
+    aSurfaces.push_back(std::move(centralSurface));
+    aSurfaces.push_back(std::move(outerBoundary));
+
+    approachDescriptor =
+        std::make_unique<Acts::GenericApproachDescriptor>(std::move(aSurfaces));
+
+    std::shared_ptr<Acts::Layer> layer;
+    if(m_cfg.mode == Mode::ITkStrip) {
+      // @TODO: This needs to be fixed!
+      size_t nBinsPhi = 1;
+      size_t nBinsZ = 1;
+      layer = m_cfg.layerCreator->cylinderLayer(
+          gctx, surfaces, nBinsPhi, nBinsZ, pl, transform,
+          std::move(approachDescriptor));
+      }
+    else {
+      layer = m_cfg.layerCreator->cylinderLayer(
+          gctx, surfaces, Acts::equidistant, Acts::equidistant, pl, transform,
+          std::move(approachDescriptor));
+    }
 
-    if (type == 0) {  // BARREL
-      // layers and extent are determined, build actual layer
-      Acts::ProtoLayer pl(gctx, layerSurfaces);
-      pl.envelope[Acts::binR] = std::make_pair(0_mm, 0_mm);
-      pl.envelope[Acts::binZ] = std::make_pair(20_mm, 20_mm);
+    layersOutput.push_back(layer);
+  }
+}
+
+void ActsLayerBuilder::buildEndcap(const Acts::GeometryContext &gctx,
+                                   Acts::LayerVector &layersOutput, int type) {
+
+  ACTS_VERBOSE("Build layers: " << (type < 0 ? "NEGATIVE" : "POSITIVE")
+                                << " ENDCAP");
+  std::vector<std::shared_ptr<const ActsDetectorElement>> elements =
+      getDetectorElements();
+  std::map<std::tuple<int, int, int>, std::vector<const Acts::Surface *>>
+      initialLayers{};
+
+  for (const auto &element : elements) {
+
+    IdentityHelper id = element->identityHelper();
+    if (id.bec() * type <= 0) {
+      continue;
+    }
+
+    if(m_cfg.mode == Mode::ITkPixelInner) {
+      if(id.layer_disk() >= 3) continue;
+    }
+    if(m_cfg.mode == Mode::ITkPixelOuter) {
+      if(id.layer_disk() <= 2) continue;
+    }
+
+    m_cfg.elementStore->push_back(element);
+
+    std::tuple<int, int, int> key{id.bec(), id.layer_disk(), id.eta_module()};
+
+    initialLayers[key].push_back(&element->surface());
+  }
+
+  ACTS_VERBOSE("Found " << initialLayers.size() << " "
+                        << (type < 0 ? "NEGATIVE" : "POSITIVE")
+                        << " ENDCAP inital layers");
+
+  std::vector<Acts::ProtoLayer> protoLayers;
+  protoLayers.reserve(initialLayers.size());
 
-      double binPosZ   = 0.5 * (pl.min(Acts::binZ) + pl.max(Acts::binZ));
-      double envZShift = 0.5 * (-pl.envelope[Acts::binZ].first + pl.envelope[Acts::binZ].second);
-      double layerZ    = binPosZ + envZShift;
-      double layerHalfZ
-        = std::abs(pl.max(Acts::binZ) + pl.envelope[Acts::binZ].second - layerZ);
+  for (const auto &[key, surfaces] : initialLayers) {
+    auto &pl = protoLayers.emplace_back(gctx, surfaces);
+    pl.envelope[Acts::binR] = std::make_pair(2_mm, 2_mm);
+    pl.envelope[Acts::binZ] = std::make_pair(2_mm, 2_mm);
+  }
+
+  // sort proto layers by their medium z position
+  std::sort(protoLayers.begin(), protoLayers.end(),
+            [type](const Acts::ProtoLayer &a, const Acts::ProtoLayer &b) {
+              double midA = (a.min(Acts::binZ) + a.max(Acts::binZ)) / 2.0;
+              double midB = (b.min(Acts::binZ) + b.max(Acts::binZ)) / 2.0;
+              if (type < 0) {
+                return midA < midB;
+              } else {
+                return midA > midB;
+              }
+            });
+
+  auto plPrintZ = [](const auto &pl) -> std::string {
+    std::stringstream ss;
+    double zMid = (pl.min(Acts::binZ) + pl.max(Acts::binZ)) / 2.0;
+    ss << " < " << pl.min(Acts::binZ) << " | " << zMid << " | "
+       << pl.max(Acts::binZ) << " > ";
+    return ss.str();
+  };
+  if (logger().doPrint(Acts::Logging::VERBOSE)) {
+    for (const auto &pl : protoLayers) {
+
+      ACTS_VERBOSE(" -> at < zMin | zMid | zMax >: " << plPrintZ(pl));
+
+      ACTS_VERBOSE("    -> at rMin / rMax: " << pl.min(Acts::binR) << " / "
+                                             << pl.max(Acts::binR));
+    }
+  }
 
-      Acts::Transform3 transform(Translation3(0., 0., -layerZ));
-      // set up approach descriptor
+  std::vector<Acts::ProtoLayer> mergedProtoLayers;
+  mergedProtoLayers.push_back(protoLayers.front());
+
+  std::vector<const Acts::Surface *> surfaces;
+  for (size_t i = 1; i < protoLayers.size(); i++) {
+    auto &pl = protoLayers[i];
+    auto &pl_prev = mergedProtoLayers.back();
+    // do they intersect?
+    ACTS_VERBOSE("Compare: " << plPrintZ(pl_prev) << " and " << plPrintZ(pl));
+    bool overlap = (pl.min(Acts::binZ) <= pl_prev.max(Acts::binZ) &&
+                    pl.max(Acts::binZ) >= pl_prev.min(Acts::binZ));
+    ACTS_VERBOSE(" -> overlap? " << (overlap ? "yes" : "no"));
+    if (overlap) {
+      ACTS_VERBOSE(" ===> merging");
+      surfaces.clear();
+      surfaces.reserve(pl.surfaces().size() + pl_prev.surfaces().size());
+      surfaces.insert(surfaces.end(), pl.surfaces().begin(),
+                      pl.surfaces().end());
+      surfaces.insert(surfaces.end(), pl_prev.surfaces().begin(),
+                      pl_prev.surfaces().end());
+      mergedProtoLayers.pop_back();
+      auto &new_pl = mergedProtoLayers.emplace_back(gctx, std::move(surfaces));
+      new_pl.envelope[Acts::binR] = pl.envelope[Acts::binR];
+      new_pl.envelope[Acts::binZ] = pl.envelope[Acts::binZ];
+    } else {
+      mergedProtoLayers.push_back(std::move(pl));
+    }
+  }
 
-      std::shared_ptr<Acts::CylinderSurface> innerBoundary
-        = Acts::Surface::makeShared<Acts::CylinderSurface>(transform, pl.min(Acts::binR), layerHalfZ);
+  ACTS_VERBOSE("" << mergedProtoLayers.size() << " "
+                  << (type < 0 ? "NEGATIVE" : "POSITIVE")
+                  << " ENDCAP layers remain after merging");
 
-      std::shared_ptr<Acts::CylinderSurface> outerBoundary
-        = Acts::Surface::makeShared<Acts::CylinderSurface>(transform, pl.max(Acts::binR), layerHalfZ);
+  for (size_t i = 0; i < mergedProtoLayers.size(); i++) {
 
-      std::shared_ptr<Acts::CylinderSurface> centralSurface
-        = Acts::Surface::makeShared<Acts::CylinderSurface>(transform, (pl.min(Acts::binR) + pl.max(Acts::binR))/2., layerHalfZ);
+    std::stringstream ss;
+    ss << "obj/" << m_cfg.mode << "_" << (type < 0 ? "neg" : "pos") << "_disk_" << std::setfill('0')
+       << std::setw(2) << i << ".obj";
 
-      size_t binsPhi = m_cfg.barrelMaterialBins.first;
-      size_t binsZ = m_cfg.barrelMaterialBins.second;
+    std::ofstream ofs{ss.str()};
+    Acts::ObjVisualization3D vis{};
+    Acts::ViewConfig vc = Acts::s_viewSensitive;
+    vc.nSegments = 200;
+    for (const auto &surface : mergedProtoLayers[i].surfaces()) {
+      Acts::GeometryView3D::drawSurface(vis, *surface, gctx,
+                                        Acts::Transform3::Identity(), vc);
 
-      Acts::BinUtility materialBinUtil(
-          binsPhi, -M_PI, M_PI, Acts::closed, Acts::binPhi);
-      materialBinUtil += Acts::BinUtility(
-            binsZ, -layerHalfZ, layerHalfZ, Acts::open, Acts::binZ, transform);
-
-      materialProxy
-        = std::make_shared<const Acts::ProtoSurfaceMaterial>(materialBinUtil);
-
-      ACTS_VERBOSE("[L] Layer is marked to carry support material on Surface ( "
-          "inner=0 / center=1 / outer=2 ) : " << "inner");
-      ACTS_VERBOSE("with binning: [" << binsPhi << ", " << binsZ << "]");
-
-      ACTS_VERBOSE("Created ApproachSurfaces for cylinder layer at:");
-      ACTS_VERBOSE(" - inner:   R=" << pl.min(Acts::binR));
-      ACTS_VERBOSE(" - central: R=" << (pl.min(Acts::binR) + pl.max(Acts::binR))/2.);
-      ACTS_VERBOSE(" - outer:   R=" << pl.max(Acts::binR));
-
-      // set material on inner
-      // @TODO: make this configurable somehow
-      innerBoundary->assignSurfaceMaterial(materialProxy);
-
-      std::vector<std::shared_ptr<const Acts::Surface>> aSurfaces;
-      aSurfaces.push_back(std::move(innerBoundary));
-      aSurfaces.push_back(std::move(centralSurface));
-      aSurfaces.push_back(std::move(outerBoundary));
-
-      approachDescriptor
-        = std::make_unique<Acts::GenericApproachDescriptor>(std::move(aSurfaces));
-
-      auto layer = m_cfg.layerCreator->cylinderLayer(gctx,
-                                                     layerSurfaces,
-                                                     Acts::equidistant,
-                                                     Acts::equidistant,
-                                                     pl,
-                                                     transform,
-                                                     std::move(approachDescriptor));
-
-      layersOutput.push_back(layer);
-    } else {  // ENDCAP
-      Acts::ProtoLayer pl(gctx, layerSurfaces);
-      pl.envelope[Acts::binR] = std::make_pair(0_mm, 0_mm);
-      pl.envelope[Acts::binZ] = std::make_pair(10_mm, 10_mm);
-
-      // copied from layercreator
-      double layerZ
-        = 0.5 * (pl.min(Acts::binZ) - pl.envelope[Acts::binZ].first + pl.max(Acts::binZ)
-            + pl.envelope[Acts::binZ].second);
-      double layerThickness = (pl.max(Acts::binZ) - pl.min(Acts::binZ))
-        + pl.envelope[Acts::binZ].first + pl.envelope[Acts::binZ].second;
-
-      double layerZInner = layerZ - layerThickness/2.;
-      double layerZOuter = layerZ + layerThickness/2.;
-
-      if (std::abs(layerZInner) > std::abs(layerZOuter)) std::swap(layerZInner, layerZOuter);
-
-        Acts::Transform3 transformNominal(Translation3(0., 0., layerZ));
-        Acts::Transform3 transformInner(Translation3(0., 0., layerZInner));
-        Acts::Transform3 transformOuter(Translation3(0., 0., layerZOuter));
-
-        std::shared_ptr<Acts::DiscSurface> innerBoundary = Acts::Surface::makeShared<Acts::DiscSurface>(transformInner, pl.min(Acts::binR), pl.max(Acts::binR));
-
-        std::shared_ptr<Acts::DiscSurface> nominalSurface = Acts::Surface::makeShared<Acts::DiscSurface>(transformNominal, pl.min(Acts::binR), pl.max(Acts::binR));
-
-        std::shared_ptr<Acts::DiscSurface> outerBoundary = Acts::Surface::makeShared<Acts::DiscSurface>(transformOuter, pl.min(Acts::binR), pl.max(Acts::binR));
-
-        size_t matBinsPhi = m_cfg.endcapMaterialBins.first;
-        size_t matBinsR = m_cfg.endcapMaterialBins.second;
-
-        Acts::BinUtility materialBinUtil(
-            matBinsPhi, -M_PI, M_PI, Acts::closed, Acts::binPhi);
-        materialBinUtil += Acts::BinUtility(
-            matBinsR, pl.min(Acts::binR), pl.max(Acts::binR), Acts::open, Acts::binR, transformNominal);
-
-        materialProxy = std::make_shared<const Acts::ProtoSurfaceMaterial>(materialBinUtil);
-
-        ACTS_VERBOSE("[L] Layer is marked to carry support material on Surface ( "
-                     "inner=0 / center=1 / outer=2 ) : "
-                     << "inner");
-        ACTS_VERBOSE("with binning: [" << matBinsPhi << ", " << matBinsR << "]");
-
-        ACTS_VERBOSE("Created ApproachSurfaces for disc layer at:");
-        ACTS_VERBOSE(" - inner:   Z=" << layerZInner);
-        ACTS_VERBOSE(" - central: Z=" << layerZ);
-        ACTS_VERBOSE(" - outer:   Z=" << layerZOuter);
-
-        // set material on inner
-        // @TODO: make this configurable somehow
-        innerBoundary->assignSurfaceMaterial(materialProxy);
-
-        int nModPhi = std::numeric_limits<int>::max();
-        int nModR = 0;
-
-        // want to figure out bins in phi
-        for (const auto &srf : layerSurfaces)
-        {
-          auto elm = dynamic_cast<const ActsDetectorElement *>(srf->associatedDetectorElement());
-          if (elm)
-          {
-            auto id = elm->identityHelper();
-            int phi_mod_max = id.phi_module_max();
-            int eta_mod_max = id.eta_module_max();
-            nModPhi = std::min(nModPhi, phi_mod_max + 1);
-            nModR = eta_mod_max + 1;
-          }
+    }
+
+    vis.write(ofs);
+  }
+
+
+
+  std::vector<std::shared_ptr<const Surface>> ownedSurfaces;
+  for (const auto &pl : mergedProtoLayers) {
+
+    std::unique_ptr<Acts::ApproachDescriptor> approachDescriptor = nullptr;
+    std::shared_ptr<const Acts::ProtoSurfaceMaterial> materialProxy = nullptr;
+
+    double layerZ = pl.medium(Acts::binZ);
+    double layerHalfZ = 0.5 * pl.range(Acts::binZ);
+    double layerThickness = pl.range(Acts::binZ);
+
+    double layerZInner = layerZ - layerHalfZ;
+    double layerZOuter = layerZ + layerHalfZ;
+
+    if (std::abs(layerZInner) > std::abs(layerZOuter))
+      std::swap(layerZInner, layerZOuter);
+
+    std::vector<std::shared_ptr<const Acts::Surface>> aSurfaces;
+
+    Acts::Transform3 transformNominal(Translation3(0., 0., layerZ));
+    Acts::Transform3 transformInner(Translation3(0., 0., layerZInner));
+    Acts::Transform3 transformOuter(Translation3(0., 0., layerZOuter));
+
+    std::shared_ptr<Acts::DiscSurface> innerBoundary =
+      Acts::Surface::makeShared<Acts::DiscSurface>(
+        transformInner, pl.min(Acts::binR), pl.max(Acts::binR));
+    aSurfaces.push_back(innerBoundary);
+
+    std::shared_ptr<Acts::DiscSurface> nominalSurface =
+      Acts::Surface::makeShared<Acts::DiscSurface>(
+        transformNominal, pl.min(Acts::binR), pl.max(Acts::binR));
+    aSurfaces.push_back(nominalSurface);
+
+    std::shared_ptr<Acts::DiscSurface> outerBoundary =
+      Acts::Surface::makeShared<Acts::DiscSurface>(
+        transformOuter, pl.min(Acts::binR), pl.max(Acts::binR));
+    aSurfaces.push_back(outerBoundary);
+
+    if(layerThickness > 2_mm) {
+      ACTS_VERBOSE("Wide disc layer ("<< layerThickness << ") => adding cylinder like approach surfaces");
+      Acts::Transform3 trf{Translation3{0, 0, layerZ}};
+      auto cylinderInner = 
+        Acts::Surface::makeShared<Acts::CylinderSurface>(
+          trf, pl.min(Acts::binR), layerHalfZ);
+        aSurfaces.push_back(cylinderInner);
+
+      auto cylinderOuter = 
+        Acts::Surface::makeShared<Acts::CylinderSurface>(
+          trf, pl.max(Acts::binR), layerHalfZ);
+        aSurfaces.push_back(cylinderOuter);
+    }
+
+
+    size_t matBinsPhi = m_cfg.endcapMaterialBins.first;
+    size_t matBinsR = m_cfg.endcapMaterialBins.second;
+
+    Acts::BinUtility materialBinUtil(matBinsPhi, -M_PI, M_PI, Acts::closed,
+                                     Acts::binPhi);
+    materialBinUtil +=
+        Acts::BinUtility(matBinsR, pl.min(Acts::binR), pl.max(Acts::binR),
+                         Acts::open, Acts::binR, transformNominal);
+
+    materialProxy =
+        std::make_shared<const Acts::ProtoSurfaceMaterial>(materialBinUtil);
+
+    ACTS_VERBOSE("[L] Layer is marked to carry support material on Surface ( "
+                 "inner=0 / center=1 / outer=2 ) : "
+                 << "inner");
+    ACTS_VERBOSE("with binning: [" << matBinsPhi << ", " << matBinsR << "]");
+
+    ACTS_VERBOSE("Created ApproachSurfaces for disc layer at:");
+    ACTS_VERBOSE(" - inner:   Z=" << layerZInner);
+    ACTS_VERBOSE(" - central: Z=" << layerZ);
+    ACTS_VERBOSE(" - outer:   Z=" << layerZOuter);
+
+    // set material on inner
+    innerBoundary->assignSurfaceMaterial(materialProxy);
+
+
+    // std::set<int> ringIds;
+    bool isITk = m_cfg.mode == Mode::ITkPixelInner ||
+                 m_cfg.mode == Mode::ITkPixelOuter ||
+                 m_cfg.mode == Mode::ITkStrip;
+
+    std::map<int, std::set<int>> phiModuleByRing;
+
+    // want to figure out bins in phi
+    for (const auto &srf : pl.surfaces()) {
+      auto elm = dynamic_cast<const ActsDetectorElement *>(
+          srf->associatedDetectorElement());
+      if (elm) {
+        auto id = elm->identityHelper();
+        int ring_number;
+        if(m_cfg.mode == Mode::ITkStrip || !isITk) {
+          ring_number = id.eta_module();
+        }
+        else {
+          ring_number = id.layer_disk();
+        }
+        phiModuleByRing[ring_number].insert(id.phi_module());
       }
+    }
+    size_t nModPhi = std::numeric_limits<size_t>::max();
+    for(const auto& [ring, phiModules] : phiModuleByRing) {
+      nModPhi = std::min(nModPhi, phiModules.size());
+    }
 
-      ACTS_VERBOSE("Identifier reports: " << nModPhi << " is lowest for " << nModR << " r-rings");
+    size_t nModR = phiModuleByRing.size();
 
-      // the modules in the innermost r-rings are exactly shifted by one half module width
-      // since it's the same number of modules, this gives binning trouble. Reduce bins
-      // by half: about 2 module pairs should be in each bin. This should be fine.
+    ACTS_VERBOSE("Identifier reports: " << nModPhi << " is lowest for " << nModR
+                                        << " r-rings");
+
+    size_t nBinsPhi = nModPhi;
+    size_t nBinsR = nModR;
+    if(!isITk) {
+      // In the ID, the modules in the innermost r-rings are exactly shifted by
+      // one half module width since it's the same number of modules, this gives
+      // binning trouble. Reduce bins by half: about 2 module pairs should be in
+      // each bin. This should be fine.
       // @TODO: evaluate
-      size_t nBinsPhi = nModPhi/2.;
-      size_t nBinsR = nModR;
+      nBinsPhi /= 2.0;
+    }
+    if(m_cfg.mode == Mode::ITkStrip) {
+      // @FIXME: ACTS surface binning for disc surfaces is currently not working
+      // correctly, see:
+      //         https://github.com/acts-project/acts/issues/851. 
+      // Use a single bin as a workaround.
+      nBinsR = 1;
+      nBinsPhi = 1;
+    }
 
-      ACTS_VERBOSE("Creating r x phi binned layer with " << nBinsR << " x " << nBinsPhi << " bins");
+    ACTS_VERBOSE("Creating r x phi binned layer with " << nBinsR << " x "
+                                                       << nBinsPhi << " bins");
 
-      std::vector<std::shared_ptr<const Acts::Surface>> aSurfaces;
-      aSurfaces.push_back(std::move(innerBoundary));
-      aSurfaces.push_back(std::move(nominalSurface));
-      aSurfaces.push_back(std::move(outerBoundary));
 
-      approachDescriptor
-        = std::make_unique<Acts::GenericApproachDescriptor>(aSurfaces);
+    approachDescriptor =
+        std::make_unique<Acts::GenericApproachDescriptor>(aSurfaces);
 
-      auto layer = m_cfg.layerCreator->discLayer(gctx,
-                                                 layerSurfaces,
-                                                 nBinsR,
-                                                 nBinsPhi,
-                                                 pl,
-                                                 transformNominal,
-                                                 std::move(approachDescriptor));
+    // get ownership of pl surfaces
+    ownedSurfaces.clear();
+    ownedSurfaces.reserve(pl.surfaces().size());
+    std::transform(pl.surfaces().begin(), pl.surfaces().end(),
+                   std::back_inserter(ownedSurfaces),
+                   [](const auto &s) { return s->getSharedPtr(); });
 
-      layersOutput.push_back(layer);
-    }
+    auto layer = m_cfg.layerCreator->discLayer(gctx, ownedSurfaces, nBinsR,
+                                               nBinsPhi, pl, transformNominal,
+                                               std::move(approachDescriptor));
+
+    layersOutput.push_back(layer);
   }
 }
+
+std::ostream& operator<<(std::ostream& os, const ActsLayerBuilder::Mode& mode) {
+
+  using Mode = ActsLayerBuilder::Mode;
+  switch(mode) {
+    case Mode::Undefined: 
+      os << "Undefined";
+      break;
+    case Mode::Pixel: 
+      os << "Pixel";
+      break;
+    case Mode::SCT: 
+      os << "SCT";
+      break;
+    case Mode::TRT: 
+      os << "TRT";
+      break;
+    case Mode::ITkPixelInner: 
+      os << "ITkPixelInner";
+      break;
+    case Mode::ITkPixelOuter: 
+      os << "ITkPixelOuter";
+      break;
+    case Mode::ITkStrip: 
+      os << "ITkStrip";
+      break;
+  }
+
+  return os;
+}
\ No newline at end of file
diff --git a/Tracking/Acts/ActsGeometry/src/ActsStrawLayerBuilder.cxx b/Tracking/Acts/ActsGeometry/src/ActsStrawLayerBuilder.cxx
index 408a07f71395..43dc951b753a 100644
--- a/Tracking/Acts/ActsGeometry/src/ActsStrawLayerBuilder.cxx
+++ b/Tracking/Acts/ActsGeometry/src/ActsStrawLayerBuilder.cxx
@@ -120,7 +120,7 @@ ActsStrawLayerBuilder::centralLayers(const Acts::GeometryContext& gctx)
                                                     istraw);
 
             auto elem = std::make_shared<const ActsDetectorElement>(
-                trf, brlElem, straw_id);
+                trf, *brlElem, straw_id);
 
             m_cfg.elementStore->push_back(elem);
 
@@ -221,7 +221,7 @@ ActsStrawLayerBuilder::endcapLayers(const Acts::GeometryContext& gctx, int side)
 
 
           auto elem = std::make_shared<const ActsDetectorElement>(
-              trf, ecElem, straw_id);
+              trf, *ecElem, straw_id);
 
           m_cfg.elementStore->push_back(elem);
 
diff --git a/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometrySvc.cxx b/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometrySvc.cxx
index 3a8eb1fff9f1..fee64a5d2b1b 100644
--- a/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometrySvc.cxx
+++ b/Tracking/Acts/ActsGeometry/src/ActsTrackingGeometrySvc.cxx
@@ -5,99 +5,112 @@
 #include "ActsGeometry/ActsTrackingGeometrySvc.h"
 
 // ATHENA
-#include "InDetReadoutGeometry/SiDetectorManager.h"
-#include "TRT_ReadoutGeometry/TRT_DetectorManager.h"
-#include "StoreGate/StoreGateSvc.h"
 #include "GaudiKernel/EventContext.h"
+#include "GeoPrimitives/GeoPrimitives.h"
 #include "InDetIdentifier/TRT_ID.h"
+#include "InDetReadoutGeometry/SiDetectorManager.h"
+#include "StoreGate/StoreGateSvc.h"
+#include "TRT_ReadoutGeometry/TRT_DetectorManager.h"
 
 // ACTS
-#include "Acts/Geometry/TrackingGeometry.hpp"
-#include "Acts/Geometry/TrackingVolume.hpp"
+#include "Acts/ActsVersion.hpp"
+#include "Acts/Geometry/CylinderVolumeBounds.hpp"
+#include "Acts/Geometry/CylinderVolumeBuilder.hpp"
+#include "Acts/Geometry/CylinderVolumeHelper.hpp"
 #include "Acts/Geometry/ITrackingVolumeBuilder.hpp"
 #include "Acts/Geometry/LayerArrayCreator.hpp"
-#include "Acts/Geometry/SurfaceArrayCreator.hpp"
 #include "Acts/Geometry/LayerCreator.hpp"
-#include "Acts/Geometry/TrackingVolumeArrayCreator.hpp"
-#include "Acts/Geometry/CylinderVolumeHelper.hpp"
+#include "Acts/Geometry/SurfaceArrayCreator.hpp"
+#include "Acts/Geometry/TrackingGeometry.hpp"
 #include "Acts/Geometry/TrackingGeometryBuilder.hpp"
-#include "Acts/Geometry/CylinderVolumeBuilder.hpp"
-#include "Acts/Geometry/CylinderVolumeBounds.hpp"
-#include <Acts/Plugins/Json/MaterialMapJsonConverter.hpp>
-#include <Acts/Plugins/Json/JsonMaterialDecorator.hpp>
+#include "Acts/Geometry/TrackingVolume.hpp"
+#include "Acts/Geometry/TrackingVolumeArrayCreator.hpp"
 #include "Acts/Utilities/Logger.hpp"
-#include "Acts/ActsVersion.hpp"
+#include "Acts/Definitions/Units.hpp"
+#include <Acts/Plugins/Json/JsonMaterialDecorator.hpp>
+#include <Acts/Plugins/Json/MaterialMapJsonConverter.hpp>
 
 // PACKAGE
+#include "ActsGeometry/ActsAlignmentStore.h"
+#include "ActsGeometry/ActsDetectorElement.h"
+#include "ActsGeometry/ActsGeometryContext.h"
 #include "ActsGeometry/ActsLayerBuilder.h"
 #include "ActsGeometry/ActsStrawLayerBuilder.h"
-#include "ActsGeometry/ActsDetectorElement.h"
 #include "ActsInterop/IdentityHelper.h"
 #include "ActsInterop/Logger.h"
-#include "ActsGeometry/ActsAlignmentStore.h"
-#include "ActsGeometry/ActsGeometryContext.h"
 
+using namespace Acts::UnitLiterals;
 
-ActsTrackingGeometrySvc::ActsTrackingGeometrySvc(const std::string& name, ISvcLocator* svc)
-   : base_class(name,svc),
-   m_detStore("StoreGateSvc/DetectorStore", name)
-{
-  m_elementStore = std::make_shared<std::vector<std::shared_ptr<const ActsDetectorElement>>>();
+ActsTrackingGeometrySvc::ActsTrackingGeometrySvc(const std::string &name,
+                                                 ISvcLocator *svc)
+    : base_class(name, svc), m_detStore("StoreGateSvc/DetectorStore", name) {
+  m_elementStore = std::make_shared<
+      std::vector<std::shared_ptr<const ActsDetectorElement>>>();
 }
 
-StatusCode
-ActsTrackingGeometrySvc::initialize()
-{
+StatusCode ActsTrackingGeometrySvc::initialize() {
   ATH_MSG_INFO(name() << " is initializing");
 
-  // FIXME: ActsCaloTrackingVolumeBuilder holds ReadHandle to CaloDetDescrManager.
-  // Hopefully this service is never called before that object is available.
+  // FIXME: ActsCaloTrackingVolumeBuilder holds ReadHandle to
+  // CaloDetDescrManager. Hopefully this service is never called before that
+  // object is available.
   m_autoRetrieveTools = false;
   m_checkToolDeps = false;
 
-  ATH_MSG_INFO("Acts version is: v" << Acts::VersionMajor << "."
-                                    << Acts::VersionMinor << "."
-                                    << Acts::VersionPatch
-                                    << " [" << Acts::CommitHash << "]");
-
-  ATH_CHECK ( m_detStore->retrieve(p_pixelManager, "Pixel") );
-  ATH_CHECK ( m_detStore->retrieve(p_SCTManager, "SCT") );
-  ATH_CHECK ( m_detStore->retrieve(p_TRTManager, "TRT") );
+  ATH_MSG_INFO("ACTS version is: v"
+               << Acts::VersionMajor << "." << Acts::VersionMinor << "."
+               << Acts::VersionPatch << " [" << Acts::CommitHash << "]");
 
-  if (m_detStore->retrieve(m_TRT_idHelper, "TRT_ID").isFailure()) {
-    msg(MSG::ERROR) << "Could not retrieve TRT ID Helper" << endmsg;
+  // load which subdetectors to build from property
+  std::set<std::string> buildSubdet(m_buildSubdetectors.begin(),
+                                    m_buildSubdetectors.end());
+  ATH_MSG_INFO("Configured to build " << buildSubdet.size()
+                                      << " subdetectors:");
+  for (const auto &s : buildSubdet) {
+    ATH_MSG_INFO(" - " << s);
   }
 
+  ATH_MSG_DEBUG("Loading detector manager(s)");
+  if (buildSubdet.find("Pixel") != buildSubdet.end()) {
+    ATH_CHECK(m_detStore->retrieve(p_pixelManager, "Pixel"));
+  }
+  if (buildSubdet.find("SCT") != buildSubdet.end()) {
+    ATH_CHECK(m_detStore->retrieve(p_SCTManager, "SCT"));
+  }
+  if (buildSubdet.find("TRT") != buildSubdet.end()) {
+    ATH_CHECK(m_detStore->retrieve(p_TRTManager, "TRT"));
+    ATH_CHECK(m_detStore->retrieve(m_TRT_idHelper, "TRT_ID"));
+  }
+  if (buildSubdet.find("ITkPixel") != buildSubdet.end()) {
+    ATH_CHECK(m_detStore->retrieve(p_ITkPixelManager, "ITkPixel"));
+  }
+  if (buildSubdet.find("ITkStrip") != buildSubdet.end()) {
+    ATH_CHECK(m_detStore->retrieve(p_ITkStripManager, "ITkStrip"));
+  }
 
+  ATH_MSG_DEBUG("Setting up ACTS geometry helpers");
 
   Acts::LayerArrayCreator::Config lacCfg;
   auto layerArrayCreator = std::make_shared<const Acts::LayerArrayCreator>(
       lacCfg, makeActsAthenaLogger(this, "LayArrCrtr", "ActsTGSvc"));
 
   Acts::TrackingVolumeArrayCreator::Config tvcCfg;
-  auto trackingVolumeArrayCreator
-      = std::make_shared<const Acts::TrackingVolumeArrayCreator>(
+  auto trackingVolumeArrayCreator =
+      std::make_shared<const Acts::TrackingVolumeArrayCreator>(
           tvcCfg, makeActsAthenaLogger(this, "TrkVolArrCrtr", "ActsTGSvc"));
 
   Acts::CylinderVolumeHelper::Config cvhConfig;
-  cvhConfig.layerArrayCreator          = layerArrayCreator;
+  cvhConfig.layerArrayCreator = layerArrayCreator;
   cvhConfig.trackingVolumeArrayCreator = trackingVolumeArrayCreator;
 
-  auto cylinderVolumeHelper
-    = std::make_shared<const Acts::CylinderVolumeHelper>(
-        cvhConfig, makeActsAthenaLogger(this, "CylVolHlpr", "ActsTGSvc"));
-
-  // load which subdetectors to build from property
-  std::set<std::string> buildSubdet(m_buildSubdetectors.begin(), m_buildSubdetectors.end());
-  ATH_MSG_INFO("Configured to build:");
-  for(const auto& s : buildSubdet) {
-    ATH_MSG_INFO(" - " << s);
-  }
+  auto cylinderVolumeHelper =
+      std::make_shared<const Acts::CylinderVolumeHelper>(
+          cvhConfig, makeActsAthenaLogger(this, "CylVolHlpr", "ActsTGSvc"));
 
   Acts::TrackingGeometryBuilder::Config tgbConfig;
-  tgbConfig.trackingVolumeHelper   = cylinderVolumeHelper;
+  tgbConfig.trackingVolumeHelper = cylinderVolumeHelper;
 
-  if(m_useMaterialMap){
+  if (m_useMaterialMap) {
     std::shared_ptr<const Acts::IMaterialDecorator> matDeco = nullptr;
     std::string matFile = m_materialMapInputFile;
     if (matFile.find(".json") != std::string::npos) {
@@ -108,119 +121,214 @@ ActsTrackingGeometrySvc::initialize()
           jsonGeoConvConfig, m_materialMapInputFile, Acts::Logging::INFO);
     }
     tgbConfig.materialDecorator = matDeco;
-  }  
+  }
+
+  // default geometry context, this is nominal
+  ActsGeometryContext constructionContext;
+  constructionContext.construction = true;
 
   try {
     // PIXEL
-    if(buildSubdet.count("Pixel") > 0) {
-      tgbConfig.trackingVolumeBuilders.push_back([&](
-            const auto & gctx, const auto& inner, const auto&) {
-          auto lb = makeLayerBuilder(p_pixelManager);
-          Acts::CylinderVolumeBuilder::Config cvbConfig;
-          cvbConfig.layerEnvelopeR = {5, 5};
-          cvbConfig.layerEnvelopeZ       = 2;
-          cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
-          cvbConfig.volumeSignature      = 0;
-          cvbConfig.volumeName           = "Pixel";
-          cvbConfig.layerBuilder         = lb;
-          cvbConfig.buildToRadiusZero = true;
-
-          Acts::CylinderVolumeBuilder cvb(cvbConfig,
-              makeActsAthenaLogger(this, "CylVolBldr", "ActsTGSvc"));
-
-          return cvb.trackingVolume(gctx, inner);
+    if (buildSubdet.count("Pixel") > 0) {
+      tgbConfig.trackingVolumeBuilders.push_back([&](const auto &gctx,
+                                                     const auto &inner,
+                                                     const auto &) {
+        auto cfg = makeLayerBuilderConfig(p_pixelManager);
+        cfg.mode = ActsLayerBuilder::Mode::Pixel;
+        auto lb = std::make_shared<ActsLayerBuilder>(
+            cfg, makeActsAthenaLogger(this, "PixelGMSLayBldr", "ActsTGSvc"));
+        Acts::CylinderVolumeBuilder::Config cvbConfig;
+        cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
+        cvbConfig.layerEnvelopeZ = 1_mm;
+        cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
+        cvbConfig.volumeSignature = 0;
+        cvbConfig.volumeName = "Pixel";
+        cvbConfig.layerBuilder = lb;
+        cvbConfig.buildToRadiusZero = true;
+
+        Acts::CylinderVolumeBuilder cvb(
+            cvbConfig, makeActsAthenaLogger(this, "CylVolBldr", "ActsTGSvc"));
+
+        return cvb.trackingVolume(gctx, inner);
       });
     }
-    
+
+    // ITK PIXEL
+    if (buildSubdet.count("ITkPixel") > 0) {
+      tgbConfig.trackingVolumeBuilders.push_back(
+          [&](const auto &gctx, const auto &inner, const auto &) {
+            auto cfg = makeLayerBuilderConfig(p_ITkPixelManager);
+            cfg.mode = ActsLayerBuilder::Mode::ITkPixelInner;
+            cfg.objDebugOutput = m_objDebugOutput;
+            auto lb = std::make_shared<ActsLayerBuilder>(
+                cfg, makeActsAthenaLogger(this, "ITkPxInLb", "ActsTGSvc"));
+
+            Acts::CylinderVolumeBuilder::Config cvbConfig;
+            cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
+            cvbConfig.layerEnvelopeZ = 1_mm;
+            cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
+            cvbConfig.volumeSignature = 0;
+            cvbConfig.volumeName = "ITkPixelInner";
+            cvbConfig.layerBuilder = lb;
+            cvbConfig.buildToRadiusZero = true;
+
+            Acts::CylinderVolumeBuilder cvb(
+                cvbConfig,
+                makeActsAthenaLogger(this, "CylVolBldr", "ActsTGSvc"));
+
+            return cvb.trackingVolume(gctx, inner);
+          });
+
+      tgbConfig.trackingVolumeBuilders.push_back(
+          [&](const auto &gctx, const auto &inner, const auto &) {
+            auto cfg = makeLayerBuilderConfig(p_ITkPixelManager);
+            cfg.mode = ActsLayerBuilder::Mode::ITkPixelOuter;
+            cfg.objDebugOutput = m_objDebugOutput;
+            auto lb = std::make_shared<ActsLayerBuilder>(
+                cfg, makeActsAthenaLogger(this, "ITkPxOtLb", "ActsTGSvc"));
+
+            Acts::CylinderVolumeBuilder::Config cvbConfig;
+            cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
+            cvbConfig.layerEnvelopeZ = 1_mm;
+            cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
+            cvbConfig.volumeSignature = 0;
+            cvbConfig.volumeName = "ITkPixelOuter";
+            cvbConfig.layerBuilder = lb;
+            cvbConfig.buildToRadiusZero = false;
+
+            Acts::CylinderVolumeBuilder cvb(
+                cvbConfig,
+                makeActsAthenaLogger(this, "CylVolBldr", "ActsTGSvc"));
+
+            return cvb.trackingVolume(gctx, inner);
+          });
+    }
+
+    // ITK STRIP
+    if (buildSubdet.count("ITkStrip") > 0) {
+      tgbConfig.trackingVolumeBuilders.push_back(
+          [&](const auto &gctx, const auto &inner, const auto &) {
+            auto cfg = makeLayerBuilderConfig(p_ITkStripManager);
+            cfg.mode = ActsLayerBuilder::Mode::ITkStrip;
+            cfg.objDebugOutput = m_objDebugOutput;
+            auto lb = std::make_shared<ActsLayerBuilder>(
+                cfg, makeActsAthenaLogger(this, "ITkStripLB", "ActsTGSvc"));
+
+            Acts::CylinderVolumeBuilder::Config cvbConfig;
+            cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
+            cvbConfig.layerEnvelopeZ = 1_mm;
+            cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
+            cvbConfig.volumeSignature = 0;
+            cvbConfig.volumeName = "ITkStrip";
+            cvbConfig.layerBuilder = lb;
+            cvbConfig.buildToRadiusZero = buildSubdet.count("ITkPixel") == 0;
+
+            Acts::CylinderVolumeBuilder cvb(
+                cvbConfig,
+                makeActsAthenaLogger(this, "CylVolBldr", "ActsTGSvc"));
+
+            return cvb.trackingVolume(gctx, inner);
+          });
+    }
+
     bool buildSCT = buildSubdet.count("SCT") > 0;
     bool buildTRT = buildSubdet.count("TRT") > 0;
 
-    if(buildSCT && buildTRT) {
+    if (buildSCT && buildTRT) {
       // building both we need to take care
-      tgbConfig.trackingVolumeBuilders.push_back([&](
-            const auto& gctx, const auto& inner, const auto&) {
-          auto sct_lb = makeLayerBuilder(p_SCTManager);
-          auto trt_lb = makeLayerBuilder(p_TRTManager);
+      tgbConfig.trackingVolumeBuilders.push_back(
+          [&](const auto &gctx, const auto &inner, const auto &) {
+            auto cfg = makeLayerBuilderConfig(p_SCTManager);
+            cfg.mode = ActsLayerBuilder::Mode::SCT;
+            auto sct_lb = std::make_shared<ActsLayerBuilder>(
+                cfg, makeActsAthenaLogger(this, "SCTGMSLayBldr", "ActsTGSvc"));
 
-          return makeSCTTRTAssembly(gctx, *sct_lb, *trt_lb, *cylinderVolumeHelper, inner);
-        });
+            auto trt_lb = makeStrawLayerBuilder(p_TRTManager);
 
+            return makeSCTTRTAssembly(gctx, *sct_lb, *trt_lb,
+                                      *cylinderVolumeHelper, inner);
+          });
 
     } else if (buildSCT) {
-      tgbConfig.trackingVolumeBuilders.push_back([&](
-            const auto& gctx, const auto& inner, const auto&) {
-          auto lb = makeLayerBuilder(p_SCTManager);
-
-          Acts::CylinderVolumeBuilder::Config cvbConfig;
-          cvbConfig.layerEnvelopeR = {5, 5};
-          cvbConfig.layerEnvelopeZ       = 2;
-          cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
-          cvbConfig.volumeSignature      = 0;
-          cvbConfig.volumeName           = "SCT";
-          cvbConfig.layerBuilder         = lb;
-          cvbConfig.buildToRadiusZero = false;
-
-          Acts::CylinderVolumeBuilder cvb(cvbConfig,
-              makeActsAthenaLogger(this, "SCTCylVolBldr", "ActsTGSvc"));
-
-          return cvb.trackingVolume(gctx, inner);
-        });
+      tgbConfig.trackingVolumeBuilders.push_back(
+          [&](const auto &gctx, const auto &inner, const auto &) {
+            auto lbCfg = makeLayerBuilderConfig(p_SCTManager);
+            lbCfg.mode = ActsLayerBuilder::Mode::SCT;
+            auto lb = std::make_shared<ActsLayerBuilder>(
+                lbCfg,
+                makeActsAthenaLogger(this, "SCTGMSLayBldr", "ActsTGSvc"));
+
+            Acts::CylinderVolumeBuilder::Config cvbConfig;
+            cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
+            cvbConfig.layerEnvelopeZ = 2_mm;
+            cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
+            cvbConfig.volumeSignature = 0;
+            cvbConfig.volumeName = "SCT";
+            cvbConfig.layerBuilder = lb;
+            cvbConfig.buildToRadiusZero = false;
+
+            Acts::CylinderVolumeBuilder cvb(
+                cvbConfig,
+                makeActsAthenaLogger(this, "SCTCylVolBldr", "ActsTGSvc"));
+
+            return cvb.trackingVolume(gctx, inner);
+          });
     } else if (buildTRT) {
-      tgbConfig.trackingVolumeBuilders.push_back([&](
-            const auto& gctx, const auto& inner, const auto&) {
-          auto lb = makeLayerBuilder(p_TRTManager);
-          Acts::CylinderVolumeBuilder::Config cvbConfig;
-          cvbConfig.layerEnvelopeR = {5, 5};
-          cvbConfig.layerEnvelopeZ       = 2;
-          cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
-          cvbConfig.volumeSignature      = 0;
-          cvbConfig.volumeName           = "TRT";
-          cvbConfig.layerBuilder         = lb;
-          cvbConfig.buildToRadiusZero = false;
-
-          Acts::CylinderVolumeBuilder cvb(cvbConfig,
-              makeActsAthenaLogger(this, "TRTCylVolBldr", "ActsTGSvc"));
-
-          return cvb.trackingVolume(gctx, inner);
-        });
+      tgbConfig.trackingVolumeBuilders.push_back(
+          [&](const auto &gctx, const auto &inner, const auto &) {
+            auto lb = makeStrawLayerBuilder(p_TRTManager);
+            Acts::CylinderVolumeBuilder::Config cvbConfig;
+            cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
+            cvbConfig.layerEnvelopeZ = 2_mm;
+            cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
+            cvbConfig.volumeSignature = 0;
+            cvbConfig.volumeName = "TRT";
+            cvbConfig.layerBuilder = lb;
+            cvbConfig.buildToRadiusZero = false;
+
+            Acts::CylinderVolumeBuilder cvb(
+                cvbConfig,
+                makeActsAthenaLogger(this, "TRTCylVolBldr", "ActsTGSvc"));
+
+            return cvb.trackingVolume(gctx, inner);
+          });
     }
 
     // Calo
-    if(buildSubdet.count("Calo") > 0) {
-      tgbConfig.trackingVolumeBuilders.push_back([&](
-            const auto& gctx, const auto& inner, const auto&) {
-          return m_caloVolumeBuilder->trackingVolume(gctx, inner, nullptr);
-      });
+    if (buildSubdet.count("Calo") > 0) {
+      tgbConfig.trackingVolumeBuilders.push_back(
+          [&](const auto &gctx, const auto &inner, const auto &) {
+            return m_caloVolumeBuilder->trackingVolume(gctx, inner, nullptr);
+          });
     }
-  }
-  catch (const std::exception& e) {
+  } catch (const std::exception &e) {
     ATH_MSG_ERROR("Encountered error when building Acts tracking geometry");
     ATH_MSG_ERROR(e.what());
     return StatusCode::FAILURE;
   }
 
-
-  auto trackingGeometryBuilder
-      = std::make_shared<const Acts::TrackingGeometryBuilder>(tgbConfig,
-          makeActsAthenaLogger(this, "TrkGeomBldr", "ActsTGSvc"));
-
-
-  // default geometry context, this is nominal
-  ActsGeometryContext constructionContext;
-  constructionContext.construction = true;
+  auto trackingGeometryBuilder =
+      std::make_shared<const Acts::TrackingGeometryBuilder>(
+          tgbConfig, makeActsAthenaLogger(this, "TrkGeomBldr", "ActsTGSvc"));
 
   ATH_MSG_VERBOSE("Begin building process");
-  m_trackingGeometry = trackingGeometryBuilder
-    ->trackingGeometry(constructionContext.context());
+  m_trackingGeometry =
+      trackingGeometryBuilder->trackingGeometry(constructionContext.context());
   ATH_MSG_VERBOSE("Building process completed");
 
+  if (!m_trackingGeometry) {
+    ATH_MSG_ERROR("No ACTS tracking geometry was built. Cannot proceeed");
+    return StatusCode::FAILURE;
+  }
+
   ATH_MSG_VERBOSE("Building nominal alignment store");
-  ActsAlignmentStore* nominalAlignmentStore = new ActsAlignmentStore();
+  ActsAlignmentStore *nominalAlignmentStore = new ActsAlignmentStore();
 
   populateAlignmentStore(nominalAlignmentStore);
 
   // manage ownership
-  m_nominalAlignmentStore = std::unique_ptr<const ActsAlignmentStore>(nominalAlignmentStore);
+  m_nominalAlignmentStore =
+      std::unique_ptr<const ActsAlignmentStore>(nominalAlignmentStore);
 
   ATH_MSG_INFO("Acts TrackingGeometry construction completed");
 
@@ -234,159 +342,153 @@ ActsTrackingGeometrySvc::trackingGeometry() {
   return m_trackingGeometry;
 }
 
-std::shared_ptr<const Acts::ILayerBuilder> 
-ActsTrackingGeometrySvc::makeLayerBuilder(const InDetDD::InDetDetectorManager* manager)
-{
-  std::string managerName = manager->getName();
-
-  std::shared_ptr<const Acts::ILayerBuilder> gmLayerBuilder;
-  if (manager->getName() == "TRT") {
-    auto matcher = [](const Acts::GeometryContext& /*gctx*/, Acts::BinningValue /*bValue*/, const Acts::Surface* /*aS*/,
-                      const Acts::Surface* /*bS*/) -> bool {
-      return false;
-    };
-
-    Acts::SurfaceArrayCreator::Config sacCfg;
-    sacCfg.surfaceMatcher = matcher;
-    sacCfg.doPhiBinningOptimization = false;
-
-    auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(
-        sacCfg,
-        makeActsAthenaLogger(this, managerName+"SrfArrCrtr", "ActsTGSvc"));
-    Acts::LayerCreator::Config lcCfg;
-    lcCfg.surfaceArrayCreator = surfaceArrayCreator;
-    auto layerCreator = std::make_shared<Acts::LayerCreator>(
-        lcCfg, makeActsAthenaLogger(this, managerName+"LayCrtr", "ActsTGSvc"));
-
-    ActsStrawLayerBuilder::Config cfg;
-    cfg.mng = static_cast<const InDetDD::TRT_DetectorManager*>(manager);
-    cfg.elementStore = m_elementStore;
-    cfg.layerCreator = layerCreator;
-    cfg.idHelper = m_TRT_idHelper;
-    gmLayerBuilder = std::make_shared<const ActsStrawLayerBuilder>(cfg,
-      makeActsAthenaLogger(this, managerName+"GMSLayBldr", "ActsTGSvc"));
-
-    //gmLayerBuilder->centralLayers();
-    //gmLayerBuilder->negativeLayers();
-    //gmLayerBuilder->positiveLayers();
-  }
-  else {
-    auto matcher = [](const Acts::GeometryContext& /*gctx*/, Acts::BinningValue bValue,
-                      const Acts::Surface* aS, const Acts::Surface* bS) -> bool {
-
-      auto a = dynamic_cast<const ActsDetectorElement*>(aS->associatedDetectorElement());
-      auto b = dynamic_cast<const ActsDetectorElement*>(bS->associatedDetectorElement());
-      if ((not a) or (not b)){
-        throw std::runtime_error("Cast of surface associated element to ActsDetectorElement failed in ActsTrackingGeometrySvc::makeVolumeBuilder");
-      }
-
-      IdentityHelper idA = a->identityHelper();
-      IdentityHelper idB = b->identityHelper();
-
-      // check if same bec
-      // can't be same if not
-      if(idA.bec() != idB.bec()) return false;
-
-      if (bValue == Acts::binPhi) {
-        //std::cout << idA.phi_module() << " <-> " << idB.phi_module() << std::endl;
-        return idA.phi_module() == idB.phi_module();
-      }
-
-      if (bValue == Acts::binZ) {
-        return (idA.eta_module() == idB.eta_module())
-               && (idA.layer_disk() == idB.layer_disk())
-               && (idA.bec() == idB.bec());
-      }
-
-      if (bValue == Acts::binR) {
-        return (idA.eta_module() == idB.eta_module())
-               && (idA.layer_disk() == idB.layer_disk())
-               && (idB.bec() == idA.bec());
-      }
-
-      return false;
-    };
+std::shared_ptr<const Acts::ILayerBuilder>
+ActsTrackingGeometrySvc::makeStrawLayerBuilder(
+    const InDetDD::InDetDetectorManager *manager) {
 
-    Acts::SurfaceArrayCreator::Config sacCfg;
-    sacCfg.surfaceMatcher = matcher;
+  std::string managerName = manager->getName();
+  auto matcher = [](const Acts::GeometryContext & /*gctx*/,
+                    Acts::BinningValue /*bValue*/, const Acts::Surface * /*aS*/,
+                    const Acts::Surface *
+                    /*bS*/) -> bool { return false; };
+
+  Acts::SurfaceArrayCreator::Config sacCfg;
+  sacCfg.surfaceMatcher = matcher;
+  sacCfg.doPhiBinningOptimization = false;
+
+  auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(
+      sacCfg,
+      makeActsAthenaLogger(this, managerName + "SrfArrCrtr", "ActsTGSvc"));
+  Acts::LayerCreator::Config lcCfg;
+  lcCfg.surfaceArrayCreator = surfaceArrayCreator;
+  auto layerCreator = std::make_shared<Acts::LayerCreator>(
+      lcCfg, makeActsAthenaLogger(this, managerName + "LayCrtr", "ActsTGSvc"));
+
+  ActsStrawLayerBuilder::Config cfg;
+  cfg.mng = static_cast<const InDetDD::TRT_DetectorManager *>(manager);
+  cfg.elementStore = m_elementStore;
+  cfg.layerCreator = layerCreator;
+  cfg.idHelper = m_TRT_idHelper;
+  return std::make_shared<const ActsStrawLayerBuilder>(
+      cfg, makeActsAthenaLogger(this, managerName + "GMSLayBldr", "ActsTGSvc"));
+}
 
-    auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(
-        sacCfg,
-        makeActsAthenaLogger(this, managerName+"SrfArrCrtr", "ActsTGSvc"));
-    Acts::LayerCreator::Config lcCfg;
-    lcCfg.surfaceArrayCreator = surfaceArrayCreator;
-    auto layerCreator = std::make_shared<Acts::LayerCreator>(
-        lcCfg, makeActsAthenaLogger(this, managerName+"LayCrtr", "ActsTGSvc"));
+ActsLayerBuilder::Config ActsTrackingGeometrySvc::makeLayerBuilderConfig(
+    const InDetDD::InDetDetectorManager *manager) {
+  std::string managerName = manager->getName();
 
+  std::shared_ptr<const Acts::ILayerBuilder> gmLayerBuilder;
+  auto matcher = [](const Acts::GeometryContext & /*gctx*/,
+                    Acts::BinningValue bValue, const Acts::Surface *aS,
+                    const Acts::Surface *bS) -> bool {
+    auto a = dynamic_cast<const ActsDetectorElement *>(
+        aS->associatedDetectorElement());
+    auto b = dynamic_cast<const ActsDetectorElement *>(
+        bS->associatedDetectorElement());
+    if ((not a) or (not b)) {
+      throw std::runtime_error(
+          "Cast of surface associated element to ActsDetectorElement failed "
+          "in ActsTrackingGeometrySvc::makeVolumeBuilder");
+    }
 
+    IdentityHelper idA = a->identityHelper();
+    IdentityHelper idB = b->identityHelper();
 
-    ActsLayerBuilder::Config cfg;
+    // check if same bec
+    // can't be same if not
+    if (idA.bec() != idB.bec())
+      return false;
 
-    if(managerName == "Pixel") {
-      cfg.subdetector = ActsDetectorElement::Subdetector::Pixel;
-    }
-    else {
-      cfg.subdetector = ActsDetectorElement::Subdetector::SCT;
+    if (bValue == Acts::binPhi) {
+      // std::cout << idA.phi_module() << " <-> " << idB.phi_module() <<
+      // std::endl;
+      return idA.phi_module() == idB.phi_module();
     }
 
-    // set bins from configuration
-    if (m_barrelMaterialBins.size() != 2) {
-      throw std::invalid_argument("Number of barrel material bin counts != 2");
+    if (bValue == Acts::binZ) {
+      return (idA.eta_module() == idB.eta_module()) &&
+             (idA.layer_disk() == idB.layer_disk()) && (idA.bec() == idB.bec());
     }
-    std::vector<size_t> brlBins(m_barrelMaterialBins);
-    cfg.barrelMaterialBins = {brlBins.at(0),
-                              brlBins.at(1)};
 
-    if (m_endcapMaterialBins.size() != 2) {
-      throw std::invalid_argument("Number of endcap material bin counts != 2");
+    if (bValue == Acts::binR) {
+      return (idA.eta_module() == idB.eta_module()) &&
+             (idA.layer_disk() == idB.layer_disk()) && (idB.bec() == idA.bec());
     }
-    std::vector<size_t> ecBins(m_endcapMaterialBins);
-    cfg.endcapMaterialBins = {ecBins.at(0),
-                              ecBins.at(1)};
 
-    cfg.mng = static_cast<const InDetDD::SiDetectorManager*>(manager);
-    // use class member element store
-    cfg.elementStore = m_elementStore;
-    cfg.layerCreator = layerCreator;
+    return false;
+  };
+
+  Acts::SurfaceArrayCreator::Config sacCfg;
+  sacCfg.surfaceMatcher = matcher;
 
-    gmLayerBuilder = std::make_shared<const ActsLayerBuilder>(cfg,
-      makeActsAthenaLogger(this, managerName+"GMLayBldr", "ActsTGSvc"));
+  auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(
+      sacCfg,
+      makeActsAthenaLogger(this, managerName + "SrfArrCrtr", "ActsTGSvc"));
+  Acts::LayerCreator::Config lcCfg;
+  lcCfg.surfaceArrayCreator = surfaceArrayCreator;
+  auto layerCreator = std::make_shared<Acts::LayerCreator>(
+      lcCfg, makeActsAthenaLogger(this, managerName + "LayCrtr", "ActsTGSvc"));
+
+  ActsLayerBuilder::Config cfg;
+
+  // set bins from configuration
+  if (m_barrelMaterialBins.size() != 2) {
+    throw std::invalid_argument("Number of barrel material bin counts != 2");
   }
+  std::vector<size_t> brlBins(m_barrelMaterialBins);
+  cfg.barrelMaterialBins = {brlBins.at(0), brlBins.at(1)};
 
+  if (m_endcapMaterialBins.size() != 2) {
+    throw std::invalid_argument("Number of endcap material bin counts != 2");
+  }
+  std::vector<size_t> ecBins(m_endcapMaterialBins);
+  cfg.endcapMaterialBins = {ecBins.at(0), ecBins.at(1)};
 
-  return gmLayerBuilder;
+  cfg.mng = static_cast<const InDetDD::SiDetectorManager *>(manager);
+  // use class member element store
+  cfg.elementStore = m_elementStore;
+  cfg.layerCreator = layerCreator;
 
+  // gmLayerBuilder = std::make_shared<const ActsLayerBuilder>(
+  //     cfg, makeActsAthenaLogger(this, managerName + "GMLayBldr",
+  //     "ActsTGSvc"));
 
+  // return gmLayerBuilder;
+  return cfg;
 }
 
-
 std::shared_ptr<Acts::TrackingVolume>
-ActsTrackingGeometrySvc::makeSCTTRTAssembly(const Acts::GeometryContext& gctx, 
-    const Acts::ILayerBuilder& sct_lb, const Acts::ILayerBuilder& trt_lb, 
-    const Acts::CylinderVolumeHelper& cvh, const std::shared_ptr<const Acts::TrackingVolume>& pixel) {
+ActsTrackingGeometrySvc::makeSCTTRTAssembly(
+    const Acts::GeometryContext &gctx, const Acts::ILayerBuilder &sct_lb,
+    const Acts::ILayerBuilder &trt_lb, const Acts::CylinderVolumeHelper &cvh,
+    const std::shared_ptr<const Acts::TrackingVolume> &pixel) {
 
   Acts::CylinderVolumeBuilder::Config cvbCfg;
-  Acts::CylinderVolumeBuilder cvb(cvbCfg, makeActsAthenaLogger(this, "SCTTRTCVB", "ActsTGSvc"));
+  Acts::CylinderVolumeBuilder cvb(
+      cvbCfg, makeActsAthenaLogger(this, "SCTTRTCVB", "ActsTGSvc"));
 
   ATH_MSG_VERBOSE("Making SCT negative layers: ");
-  Acts::VolumeConfig sctNegEC = cvb.analyzeContent(gctx, sct_lb.negativeLayers(gctx), {});
+  Acts::VolumeConfig sctNegEC =
+      cvb.analyzeContent(gctx, sct_lb.negativeLayers(gctx), {});
   ATH_MSG_VERBOSE("Making SCT positive layers: ");
-  Acts::VolumeConfig sctPosEC = cvb.analyzeContent(gctx, sct_lb.positiveLayers(gctx), {});
+  Acts::VolumeConfig sctPosEC =
+      cvb.analyzeContent(gctx, sct_lb.positiveLayers(gctx), {});
   ATH_MSG_VERBOSE("Making SCT central layers: ");
-  Acts::VolumeConfig sctBrl = cvb.analyzeContent(gctx, sct_lb.centralLayers(gctx), {});
-
+  Acts::VolumeConfig sctBrl =
+      cvb.analyzeContent(gctx, sct_lb.centralLayers(gctx), {});
 
   ATH_MSG_VERBOSE("Making TRT negative layers: ");
-  Acts::VolumeConfig trtNegEC = cvb.analyzeContent(gctx, trt_lb.negativeLayers(gctx), {});
+  Acts::VolumeConfig trtNegEC =
+      cvb.analyzeContent(gctx, trt_lb.negativeLayers(gctx), {});
   ATH_MSG_VERBOSE("Making TRT positive layers: ");
-  Acts::VolumeConfig trtPosEC = cvb.analyzeContent(gctx, trt_lb.positiveLayers(gctx), {});
+  Acts::VolumeConfig trtPosEC =
+      cvb.analyzeContent(gctx, trt_lb.positiveLayers(gctx), {});
   ATH_MSG_VERBOSE("Making TRT central layers: ");
-  Acts::VolumeConfig trtBrl = cvb.analyzeContent(gctx, trt_lb.centralLayers(gctx), {});
-  
+  Acts::VolumeConfig trtBrl =
+      cvb.analyzeContent(gctx, trt_lb.centralLayers(gctx), {});
 
-  
   // synchronize trt
-    
+
   double absZMinEC = std::min(std::abs(trtNegEC.zMax), std::abs(trtPosEC.zMin));
   double absZMaxEC = std::max(std::abs(trtNegEC.zMin), std::abs(trtPosEC.zMax));
 
@@ -394,36 +496,46 @@ ActsTrackingGeometrySvc::makeSCTTRTAssembly(const Acts::GeometryContext& gctx,
   trtNegEC.zMax = -absZMinEC;
   trtPosEC.zMin = absZMinEC;
   trtPosEC.zMax = absZMaxEC;
-  
+
   using CVBBV = Acts::CylinderVolumeBounds::BoundValues;
 
   // if pixel is present, shrink SCT volumes in R
-  if(pixel) {
+  if (pixel) {
     ATH_MSG_VERBOSE("Shrinking SCT to fit around Pixel");
-    auto pixelBounds = dynamic_cast<const Acts::CylinderVolumeBounds*>(&pixel->volumeBounds());
+    auto pixelBounds = dynamic_cast<const Acts::CylinderVolumeBounds *>(
+        &pixel->volumeBounds());
     sctNegEC.rMin = pixelBounds->get(CVBBV::eMaxR);
     sctPosEC.rMin = pixelBounds->get(CVBBV::eMaxR);
     sctBrl.rMin = pixelBounds->get(CVBBV::eMaxR);
-  }
-  else {
+  } else {
     ATH_MSG_VERBOSE("Pixel is not configured, not wrapping");
   }
 
-
   ATH_MSG_VERBOSE("SCT Volume Configuration:");
-  ATH_MSG_VERBOSE("- SCT::NegativeEndcap: " << sctNegEC.layers.size() << " layers, "  << sctNegEC.toString());
-  ATH_MSG_VERBOSE("- SCT::Barrel: " << sctBrl.layers.size() << " layers, "  << sctBrl.toString());
-  ATH_MSG_VERBOSE("- SCT::PositiveEncap: " << sctPosEC.layers.size() << " layers, "  << sctPosEC.toString());
+  ATH_MSG_VERBOSE("- SCT::NegativeEndcap: " << sctNegEC.layers.size()
+                                            << " layers, "
+                                            << sctNegEC.toString());
+  ATH_MSG_VERBOSE("- SCT::Barrel: " << sctBrl.layers.size() << " layers, "
+                                    << sctBrl.toString());
+  ATH_MSG_VERBOSE("- SCT::PositiveEncap: " << sctPosEC.layers.size()
+                                           << " layers, "
+                                           << sctPosEC.toString());
 
   ATH_MSG_VERBOSE("TRT Volume Configuration:");
-  ATH_MSG_VERBOSE("- TRT::NegativeEndcap: " << trtNegEC.layers.size() << " layers, " << trtNegEC.toString());
-  ATH_MSG_VERBOSE("- TRT::Barrel: " << trtBrl.layers.size() << " layers, " << trtBrl.toString());
-  ATH_MSG_VERBOSE("- TRT::PositiveEncap: " << trtPosEC.layers.size() << " layers, " << trtPosEC.toString());
-
-  // harmonize SCT BRL <-> EC, normally the CVB does this, but we're skipping that
-  sctBrl.zMax = (sctBrl.zMax + sctPosEC.zMin)/2.;
+  ATH_MSG_VERBOSE("- TRT::NegativeEndcap: " << trtNegEC.layers.size()
+                                            << " layers, "
+                                            << trtNegEC.toString());
+  ATH_MSG_VERBOSE("- TRT::Barrel: " << trtBrl.layers.size() << " layers, "
+                                    << trtBrl.toString());
+  ATH_MSG_VERBOSE("- TRT::PositiveEncap: " << trtPosEC.layers.size()
+                                           << " layers, "
+                                           << trtPosEC.toString());
+
+  // harmonize SCT BRL <-> EC, normally the CVB does this, but we're skipping
+  // that
+  sctBrl.zMax = (sctBrl.zMax + sctPosEC.zMin) / 2.;
   sctBrl.zMin = -sctBrl.zMax;
-  
+
   // and now harmonize everything
   // inflate TRT Barrel to match SCT
   trtBrl.zMin = sctBrl.zMin;
@@ -450,97 +562,106 @@ ActsTrackingGeometrySvc::makeSCTTRTAssembly(const Acts::GeometryContext& gctx,
 
   ATH_MSG_VERBOSE("Dimensions after synchronization between SCT and TRT");
   ATH_MSG_VERBOSE("SCT Volume Configuration:");
-  ATH_MSG_VERBOSE("- SCT::NegativeEndcap: " << sctNegEC.layers.size() << " layers, "  << sctNegEC.toString());
-  ATH_MSG_VERBOSE("- SCT::Barrel: " << sctBrl.layers.size() << " layers, "  << sctBrl.toString());
-  ATH_MSG_VERBOSE("- SCT::PositiveEncap: " << sctPosEC.layers.size() << " layers, "  << sctPosEC.toString());
+  ATH_MSG_VERBOSE("- SCT::NegativeEndcap: " << sctNegEC.layers.size()
+                                            << " layers, "
+                                            << sctNegEC.toString());
+  ATH_MSG_VERBOSE("- SCT::Barrel: " << sctBrl.layers.size() << " layers, "
+                                    << sctBrl.toString());
+  ATH_MSG_VERBOSE("- SCT::PositiveEncap: " << sctPosEC.layers.size()
+                                           << " layers, "
+                                           << sctPosEC.toString());
 
   ATH_MSG_VERBOSE("TRT Volume Configuration:");
-  ATH_MSG_VERBOSE("- TRT::NegativeEndcap: " << trtNegEC.layers.size() << " layers, " << trtNegEC.toString());
-  ATH_MSG_VERBOSE("- TRT::Barrel: " << trtBrl.layers.size() << " layers, " << trtBrl.toString());
-  ATH_MSG_VERBOSE("- TRT::PositiveEncap: " << trtPosEC.layers.size() << " layers, " << trtPosEC.toString());
-
-
-  auto makeTVol = [&](const auto& vConf, const auto& name) {
-    return cvh.createTrackingVolume(gctx, 
-                                    vConf.layers,
-                                    {},
+  ATH_MSG_VERBOSE("- TRT::NegativeEndcap: " << trtNegEC.layers.size()
+                                            << " layers, "
+                                            << trtNegEC.toString());
+  ATH_MSG_VERBOSE("- TRT::Barrel: " << trtBrl.layers.size() << " layers, "
+                                    << trtBrl.toString());
+  ATH_MSG_VERBOSE("- TRT::PositiveEncap: " << trtPosEC.layers.size()
+                                           << " layers, "
+                                           << trtPosEC.toString());
+
+  auto makeTVol = [&](const auto &vConf, const auto &name) {
+    return cvh.createTrackingVolume(gctx, vConf.layers, {},
                                     nullptr, // no material
-                                    vConf.rMin,
-                                    vConf.rMax,
-                                    vConf.zMin,
-                                    vConf.zMax,
-                                    name
-                                    );
+                                    vConf.rMin, vConf.rMax, vConf.zMin,
+                                    vConf.zMax, name);
   };
 
   // now turn them into actual TrackingVolumes
   auto tvSctNegEC = makeTVol(sctNegEC, "SCT::NegativeEndcap");
-  auto tvSctBrl   = makeTVol(sctBrl, "SCT::Barrel");
+  auto tvSctBrl = makeTVol(sctBrl, "SCT::Barrel");
   auto tvSctPosEC = makeTVol(sctPosEC, "SCT::PositiveEndcap");
 
   auto tvTrtNegEC = makeTVol(trtNegEC, "TRT::NegativeEndcap");
-  auto tvTrtBrl   = makeTVol(trtBrl, "TRT::Barrel");
+  auto tvTrtBrl = makeTVol(trtBrl, "TRT::Barrel");
   auto tvTrtPosEC = makeTVol(trtPosEC, "TRT::PositiveEndcap");
 
   // combine the endcaps and the barrels, respetively
-  auto negEC = cvh.createContainerTrackingVolume(gctx, {tvSctNegEC, tvTrtNegEC});
-  auto posEC = cvh.createContainerTrackingVolume(gctx, {tvSctPosEC, tvTrtPosEC});
+  auto negEC =
+      cvh.createContainerTrackingVolume(gctx, {tvSctNegEC, tvTrtNegEC});
+  auto posEC =
+      cvh.createContainerTrackingVolume(gctx, {tvSctPosEC, tvTrtPosEC});
   auto barrel = cvh.createContainerTrackingVolume(gctx, {tvSctBrl, tvTrtBrl});
 
   // and now combine all of those into one container for the assembly
 
-  auto container = cvh.createContainerTrackingVolume(gctx, {negEC, barrel, posEC});
-
-  // if pixel is present, add positive and negative gap volumes so we can wrap it all
-  if(pixel) {
-    auto containerBounds = dynamic_cast<const Acts::CylinderVolumeBounds*>(&container->volumeBounds());
-    auto pixelBounds = dynamic_cast<const Acts::CylinderVolumeBounds*>(&pixel->volumeBounds());
-  std::vector<std::shared_ptr<Acts::TrackingVolume>> noVolumes;
-  
-    auto posGap = cvh.createGapTrackingVolume(gctx, 
-                                              noVolumes,
-                                              nullptr, // no material,
-                                              pixelBounds->get(CVBBV::eMinR),
-                                              pixelBounds->get(CVBBV::eMaxR),
-                                              pixelBounds->get(CVBBV::eHalfLengthZ),
-                                              containerBounds->get(CVBBV::eHalfLengthZ),
-                                              0, // material layers,
-                                              true, // cylinder
-                                              "Pixel::PositiveGap");
-    auto negGap = cvh.createGapTrackingVolume(gctx,
-                                              noVolumes,
-                                              nullptr, // no material,
-                                              pixelBounds->get(CVBBV::eMinR),
-                                              pixelBounds->get(CVBBV::eMaxR),
-                                              -containerBounds->get(CVBBV::eHalfLengthZ),
-                                              -pixelBounds->get(CVBBV::eHalfLengthZ),
-                                              0, // material layers,
-                                              true, // cylinder
-                                              "Pixel::NegativeGap");
-
-    auto pixelContainer = cvh.createContainerTrackingVolume(gctx, {negGap, pixel, posGap});
+  auto container =
+      cvh.createContainerTrackingVolume(gctx, {negEC, barrel, posEC});
+
+  // if pixel is present, add positive and negative gap volumes so we can wrap
+  // it all
+  if (pixel) {
+    auto containerBounds = dynamic_cast<const Acts::CylinderVolumeBounds *>(
+        &container->volumeBounds());
+    auto pixelBounds = dynamic_cast<const Acts::CylinderVolumeBounds *>(
+        &pixel->volumeBounds());
+    std::vector<std::shared_ptr<Acts::TrackingVolume>> noVolumes;
+
+    auto posGap = cvh.createGapTrackingVolume(
+        gctx, noVolumes,
+        nullptr, // no material,
+        pixelBounds->get(CVBBV::eMinR), pixelBounds->get(CVBBV::eMaxR),
+        pixelBounds->get(CVBBV::eHalfLengthZ),
+        containerBounds->get(CVBBV::eHalfLengthZ),
+        0,    // material layers,
+        true, // cylinder
+        "Pixel::PositiveGap");
+    auto negGap = cvh.createGapTrackingVolume(
+        gctx, noVolumes,
+        nullptr, // no material,
+        pixelBounds->get(CVBBV::eMinR), pixelBounds->get(CVBBV::eMaxR),
+        -containerBounds->get(CVBBV::eHalfLengthZ),
+        -pixelBounds->get(CVBBV::eHalfLengthZ),
+        0,    // material layers,
+        true, // cylinder
+        "Pixel::NegativeGap");
+
+    auto pixelContainer =
+        cvh.createContainerTrackingVolume(gctx, {negGap, pixel, posGap});
     // and now create one container that contains Pixel+SCT+TRT
-    container = cvh.createContainerTrackingVolume(gctx, {pixelContainer, container});
+    container =
+        cvh.createContainerTrackingVolume(gctx, {pixelContainer, container});
   }
 
-
   return container;
 }
 
-void
-ActsTrackingGeometrySvc::populateAlignmentStore(ActsAlignmentStore *store) const
-{
-  // populate the alignment store with all detector elements
-  m_trackingGeometry->visitSurfaces(
-    [store](const Acts::Surface* srf) {
-    const Acts::DetectorElementBase* detElem = srf->associatedDetectorElement();
-    const auto* gmde = dynamic_cast<const ActsDetectorElement*>(detElem);
+void ActsTrackingGeometrySvc::populateAlignmentStore(
+    ActsAlignmentStore *store) const {
+  ATH_MSG_DEBUG("Populate the alignment store with all detector elements");
+  size_t nElements = 0;
+  m_trackingGeometry->visitSurfaces([store,
+                                     &nElements](const Acts::Surface *srf) {
+    const Acts::DetectorElementBase *detElem = srf->associatedDetectorElement();
+    const auto *gmde = dynamic_cast<const ActsDetectorElement *>(detElem);
     gmde->storeTransform(store);
+    nElements++;
   });
+  ATH_MSG_DEBUG("Populated with " << nElements << " elements");
 }
 
-const ActsAlignmentStore*
-ActsTrackingGeometrySvc::getNominalAlignmentStore() const
-{
+const ActsAlignmentStore *
+ActsTrackingGeometrySvc::getNominalAlignmentStore() const {
   return m_nominalAlignmentStore.get();
 }
diff --git a/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometryTransforms.cxx b/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometryTransforms.cxx
index 5dd1dce5c830..ae94ba7e1cab 100644
--- a/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometryTransforms.cxx
+++ b/Tracking/Acts/ActsGeometry/src/ActsWriteTrackingGeometryTransforms.cxx
@@ -55,10 +55,15 @@ StatusCode ActsWriteTrackingGeometryTransforms::execute() {
     const Acts::DetectorElementBase *detElem = srf->associatedDetectorElement();
     const auto *gmde = static_cast<const ActsDetectorElement *>(detElem);
 
-    if(gmde->getSubdetector() == ActsDetectorElement::Subdetector::TRT) {
+    if(dynamic_cast<const InDetDD::TRT_BaseElement*>(gmde->upstreamDetectorElement()) != nullptr) { 
       return;
     }
 
+    const auto side = dynamic_cast<const InDetDD::SiDetectorElement*>(gmde->upstreamDetectorElement());
+    if(side == nullptr) {
+      throw std::runtime_error{"Not TRT but not Si either"}; // this shouldn't happen
+    }
+
     gid geoID = srf->geometryId();
     os << geoID.volume() << ";";
     os << geoID.boundary() << ";";
@@ -68,10 +73,10 @@ StatusCode ActsWriteTrackingGeometryTransforms::execute() {
 
     os << ctx.eventID().event_number() << ";";
 
-    if(gmde->getSubdetector() == ActsDetectorElement::Subdetector::Pixel) {
+    if(side->isPixel()) {
       os << 0;
     }
-    else if(gmde->getSubdetector() == ActsDetectorElement::Subdetector::SCT) {
+    else if(side->isSCT()) {
       os << 1;
     }
 
diff --git a/Tracking/Acts/ActsTrkFitting/src/ActsKalmanFitter.cxx b/Tracking/Acts/ActsTrkFitting/src/ActsKalmanFitter.cxx
index bc46108a10ac..c038f57fe884 100755
--- a/Tracking/Acts/ActsTrkFitting/src/ActsKalmanFitter.cxx
+++ b/Tracking/Acts/ActsTrkFitting/src/ActsKalmanFitter.cxx
@@ -429,7 +429,9 @@ ActsKalmanFitter::makeTrack(const EventContext& ctx, Acts::GeometryContext& tgCo
       auto flag = state.typeFlags();
       if (state.referenceSurface().associatedDetectorElement() != nullptr) {
         const auto* actsElement = dynamic_cast<const ActsDetectorElement*>(state.referenceSurface().associatedDetectorElement());
-        if (actsElement != nullptr && actsElement->getSubdetector() != ActsDetectorElement::Subdetector::TRT){
+        if (actsElement != nullptr 
+            && dynamic_cast<const InDetDD::TRT_BaseElement*>(actsElement->upstreamDetectorElement()) == nullptr) {
+          const auto* detElem = dynamic_cast<const InDetDD::SiDetectorElement*>(actsElement->upstreamDetectorElement());
           // We need to determine the type of state 
           std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
           const Trk::TrackParameters *parm;
@@ -444,10 +446,10 @@ ActsKalmanFitter::makeTrack(const EventContext& ctx, Acts::GeometryContext& tgCo
             
             // Check if this is a hole, a dead sensors or a state outside the sensor boundary
             if(boundaryCheck == Trk::BoundaryCheckResult::DeadElement){
-              if (actsElement->getSubdetector() == ActsDetectorElement::Subdetector::Pixel){
+              if (detElem->isPixel()) {
                 ++numberOfDeadPixel;
               }
-              else if (actsElement->getSubdetector() == ActsDetectorElement::Subdetector::SCT){
+              else if (detElem->isSCT()) {
                 ++numberOfDeadSCT;
               }
               // Dead sensors states are not stored              
-- 
GitLab


From 17ec2c47a19c0d4c2dc12002125d5d46a727f21e Mon Sep 17 00:00:00 2001
From: Anil Sonay <anil.sonay@cern.ch>
Date: Fri, 24 Sep 2021 17:04:25 +0200
Subject: [PATCH 312/347] Adding L1Topo jJet TOBs into menu

---
 .../L1TopoSimulation/src/JetInputProviderFEX.cxx | 16 ++++++++--------
 .../python/L1/Config/TopoAlgoDef.py              | 10 +++++-----
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/JetInputProviderFEX.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/JetInputProviderFEX.cxx
index 1b0f839894a8..fa79f90a5335 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/JetInputProviderFEX.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/JetInputProviderFEX.cxx
@@ -69,7 +69,7 @@ JetInputProviderFEX::handle(const Incident& incident) {
    replace( histPath.begin(), histPath.end(), '.', '/'); 
 
    //jJet
-   auto hjJetPt = std::make_unique<TH1I>( "jJetTOBPt", "jJet TOB Pt", 40, 0, 200);
+   auto hjJetPt = std::make_unique<TH1I>( "jJetTOBPt", "jJet TOB Pt", 100, 0, 500);
    hjJetPt->SetXTitle("p_{T}");
 
    auto hjJetEtaPhi = std::make_unique<TH2I>( "jJetTOBPhiEta", "jJet TOB Location", 220, -110, 110, 128, 0, 128);
@@ -92,7 +92,7 @@ JetInputProviderFEX::handle(const Incident& incident) {
    }
 
    //jLargeRJet
-   auto hjLargeRJetPt = std::make_unique<TH1I>( "jLargeRJetTOBPt", "jLargeRJet TOB Pt", 80, 0, 400);
+   auto hjLargeRJetPt = std::make_unique<TH1I>( "jLargeRJetTOBPt", "jLargeRJet TOB Pt", 100, 0, 2000);
    hjLargeRJetPt->SetXTitle("p_{T}");
 
    auto hjLargeRJetEtaPhi = std::make_unique<TH2I>( "jLargeRJetTOBPhiEta", "jLargeRJet TOB Location", 220, -110, 110, 128, 0, 128);
@@ -173,14 +173,14 @@ JetInputProviderFEX::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const {
     ATH_MSG_DEBUG( "EDM jFEX jTau Number: " 
 		   << +jFexRoI->jFexNumber() // returns an 8 bit unsigned integer referring to the jFEX number 
 		   << " et: " 
-		   << jFexRoI->et() // returns the et value of the jet in 200 MeV unit
+		   << jFexRoI->et() // returns the et value of the jet in MeV unit
 		   << " eta: "
 		   << jFexRoI->globalEta() // returns a floating point global eta (will be at full precision 0.025, but currently only at 0.1)
 		   << " phi: "
 		   << jFexRoI->globalPhi() // returns a floating point global phi
 		   );
        
-    unsigned int Et = jFexRoI->et()*2; //Convert Et to 100 MeV unit
+    unsigned int Et = jFexRoI->et()/100.; //Convert Et to 100 MeV unit
     // Eta and phi is local coordinates, need to switch with global coordinates.
     double phi = jFexRoI->globalPhi()/10.;
     double eta = jFexRoI->globalEta()/10.;
@@ -206,14 +206,14 @@ JetInputProviderFEX::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const {
     ATH_MSG_DEBUG( "EDM jFex JJet Number: " 
 		   << +jFexRoI->jFexNumber() // returns an 8 bit unsigned integer referring to the jFEX number 
 		   << " et: " 
-		   << jFexRoI->et() // returns the et value of the jet in 200 MeV unit
+		   << jFexRoI->et() // returns the et value of the jet in MeV unit
 		   << " eta: "
 		   << jFexRoI->globalEta() // returns a floating point global eta (will be at full precision 0.025, but currently only at 0.1)
 		   << " phi: "
 		   << jFexRoI->globalPhi() // returns a floating point global phi
 		   );
     
-    unsigned int Et = jFexRoI->et()*2; //Convert Et to 100 MeV unit
+    unsigned int Et = jFexRoI->et()/100.; //Convert Et to 100 MeV unit
     // Eta and phi is local coordinates, need to switch with global coordinates.
     double phi = jFexRoI->globalPhi()/10.;
     double eta = jFexRoI->globalEta()/10.;
@@ -239,14 +239,14 @@ JetInputProviderFEX::fillTopoInputEvent(TCS::TopoInputEvent& inputEvent) const {
     ATH_MSG_DEBUG( "EDM jFex jJet Number: " 
 		   << +jFexRoI->jFexNumber() // returns an 8 bit unsigned integer referring to the jFEX number 
 		   << " et: " 
-		   << jFexRoI->et() // returns the et value of the jet in 200 MeV unit
+		   << jFexRoI->et() // returns the et value of the jet in MeV unit
 		   << " eta: "
 		   << jFexRoI->globalEta() // returns a floating point global eta (will be at full precision 0.025, but currently only at 0.1)
 		   << " phi: "
 		   << jFexRoI->globalPhi() // returns a floating point global phi
 		   );
 
-    unsigned int Et = jFexRoI->et()*2; //Convert Et to 100 MeV unit
+    unsigned int Et = jFexRoI->et()/100.; //Convert Et to 100 MeV unit
     // Eta and phi is local coordinates, need to switch with global coordinates.
     double phi = jFexRoI->globalPhi()/10.;
     double eta = jFexRoI->globalEta()/10.;
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
index fa001fd0875c..da038600e55e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDef.py
@@ -193,7 +193,7 @@ class TopoAlgoDef:
             elif jet_type=='FjJ':
                 mineta =     31*_eta_conversion
                 minet =      15*_et_conversion
-            alg = AlgConf.JetSelect( name = jet_type+'ab', inputs = 'JetTobArray', outputs = jet_type+'ab' )
+            alg = AlgConf.jJetSelect( name = jet_type+'ab', inputs = 'jJetTobs', outputs = jet_type+'ab' )
             alg.addgeneric('InputWidth', HW.InputWidthJET)
             alg.addgeneric('OutputWidth', HW.OutputWidthSelectJET)
             alg.addvariable('MinET', minet)
@@ -202,14 +202,14 @@ class TopoAlgoDef:
             tm.registerTopoAlgo(alg)
 
         #input list needed for ATR-18824 (TODO: to be replaced by fwd jEM)
-        alg = AlgConf.JetSort( name = 'FjJjs23ETA49', inputs = 'JetTobArray', outputs = 'FjJjs23ETA49')
+        alg = AlgConf.jJetSort( name = 'FjJjs23ETA49', inputs = 'jJetTobs', outputs = 'FjJjs23ETA49')
         alg.addgeneric('InputWidth',  HW.InputWidthJET)
         alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
         alg.addvariable('MinEta', 23*_eta_conversion)
         alg.addvariable('MaxEta', 49*_eta_conversion)
         tm.registerTopoAlgo(alg)
 
-        alg = AlgConf.JetSort( name = 'CjJsETA21', inputs = 'JetTobArray', outputs = 'CjJsETA21')
+        alg = AlgConf.jJetSort( name = 'CjJsETA21', inputs = 'jJetTobs', outputs = 'CjJsETA21')
         alg.addgeneric('InputWidth',  HW.InputWidthJET)
         alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
         alg.addvariable('MinEta',  0*_eta_conversion)
@@ -226,7 +226,7 @@ class TopoAlgoDef:
                 jetabseta =   26*_eta_conversion
             elif jet_type=='FjJ':
                 mineta =      31*_eta_conversion
-            alg = AlgConf.JetSort( name = jet_type+'s', inputs = 'JetTobArray', outputs = jet_type+'s' )
+            alg = AlgConf.jJetSort( name = jet_type+'s', inputs = 'jJetTobs', outputs = jet_type+'s' )
             alg.addgeneric('InputWidth',  HW.InputWidthJET)
             alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
             alg.addvariable('MinEta', mineta)
@@ -239,7 +239,7 @@ class TopoAlgoDef:
                 jetabseta =   31*_eta_conversion
             elif jet_type=='CjJ':
                 jetabseta =   26*_eta_conversion
-            alg = AlgConf.JetSort( name = jet_type+'s', inputs = 'JetTobArray', outputs = jet_type+'s' )
+            alg = AlgConf.jJetSort( name = jet_type+'s', inputs = 'jJetTobs', outputs = jet_type+'s' )
             alg.addgeneric('InputWidth',  HW.InputWidthJET)
             alg.addgeneric('OutputWidth', HW.OutputWidthSortJET )
             alg.addvariable('MinEta', 0*_eta_conversion)
-- 
GitLab


From 213296a7a243508aebf303139f99d3669882f7a5 Mon Sep 17 00:00:00 2001
From: Vakhtang Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Fri, 24 Sep 2021 17:08:58 +0200
Subject: [PATCH 313/347] Introduced CaloAlignCondAlg

---
 .../CaloAlignmentAlgs/CMakeLists.txt          |  10 +
 .../src/CaloAlignCondAlg.cxx                  |  73 ++
 .../CaloAlignmentAlgs/src/CaloAlignCondAlg.h  |  54 ++
 .../components/CaloAlignmentAlgs_entries.cxx  |   3 +
 .../CaloDetDescr/CaloDetDescrManager.h        |   3 +-
 Calorimeter/CaloDetDescrUtils/CMakeLists.txt  |   3 +-
 .../src/CaloDetDescrBuilder.cxx               | 197 +++--
 Calorimeter/CaloUtils/CMakeLists.txt          |   2 +-
 .../CaloUtils/share/CaloTowerStore_test.ref   |   1 +
 .../Rt_override_CONDBR2-BLKPA-2015-12.py      |   2 +-
 .../share/Rt_override_OFLCOND-MC15c-SDR-11.py |   2 +-
 .../share/Rt_override_OFLCOND-MC16-SDR-23.py  |   2 +-
 .../share/Rt_override_OFLCOND-MC16-SDR-26.py  |   2 +-
 ...verride_OFLCOND-MC16-SDR-26_folders100M.py |   2 +-
 .../share/Rt_override_OFLCOND-MC16-SDR-27.py  |   2 +-
 .../LArCafJobs/share/LArReadCells_overlay.py  |   2 +-
 .../share/LArCellDeadOTXCorr_test.ref         |   2 +
 .../python/LArAlignable.py                    |   2 +
 .../TestLArDetDescr/TestCaloDDE.h             |  77 --
 .../TestLArDetDescr/src/TestCaloDDE.cxx       | 824 +++++++++---------
 .../TestLArDetDescr/src/TestCaloDDE.h         |  72 ++
 .../components/TestLArDetDescr_entries.cxx    |   2 +-
 .../LArGeoCode/src/LArAlignHelper.cxx         |  17 +-
 .../share/LArFCalTowerBuilderTool.ref         |   1 +
 .../share/LArConditionsTest.ref               |   1 +
 .../share/LArConditionsTestReadNoReg.ref      |   1 +
 .../share/LArConditionsTestWriteNoReg.ref     |   1 +
 .../share/TileCellBuilderFromHit_test.ref     |   1 +
 .../share/TileCellBuilder_test.ref            |   1 +
 .../share/TileDQstatusAlg_test.ref            |   1 +
 .../share/TileDQstatusTool_test.ref           |   1 +
 .../share/TileRawChannelBuilder_test.ref      |   1 +
 .../TileBeamElemContByteStreamCnv_test.ref    |   3 +-
 .../TileDigitsContByteStreamCnv_test.ref      |   3 +-
 .../share/TileL2ContByteStreamCnv_test.ref    |   3 +-
 .../share/TileLaserObjByteStreamCnv_test.ref  |   3 +-
 .../share/TileMuRcvContByteStreamCnv_test.ref |   3 +-
 .../TileRawChannelContByteStreamCnv_test.ref  |   3 +-
 38 files changed, 817 insertions(+), 566 deletions(-)
 create mode 100644 Calorimeter/CaloAlignment/CaloAlignmentAlgs/CMakeLists.txt
 create mode 100644 Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.cxx
 create mode 100644 Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.h
 create mode 100644 Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/components/CaloAlignmentAlgs_entries.cxx
 delete mode 100755 LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloDDE.h
 create mode 100755 LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.h

diff --git a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/CMakeLists.txt b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/CMakeLists.txt
new file mode 100644
index 000000000000..ae42c874df3c
--- /dev/null
+++ b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+# Declare the package name:
+atlas_subdir( CaloAlignmentAlgs )
+
+atlas_add_component( CaloAlignmentAlgs
+                     src/*.cxx 
+		     src/components/*.cxx
+                     LINK_LIBRARIES GaudiKernel AthenaBaseComps AthenaKernel GeoModelUtilities CaloConditions CaloDetDescrLib CaloDetDescrUtils )
+
diff --git a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.cxx b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.cxx
new file mode 100644
index 000000000000..5b7249c9a587
--- /dev/null
+++ b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.cxx
@@ -0,0 +1,73 @@
+/*
+   Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "CaloAlignCondAlg.h"
+
+#include "CaloDetDescrUtils/CaloDetDescrBuilder.h"
+#include "AthenaKernel/getMessageSvc.h"
+
+#include <memory>
+
+StatusCode CaloAlignCondAlg::initialize()
+{
+  ATH_MSG_DEBUG("initialize " << name());
+
+  ATH_CHECK(m_condSvc.retrieve());
+  ATH_CHECK(m_readKeyGeoAlign.initialize());
+  ATH_CHECK(m_readKeyCellPosShift.initialize());
+  ATH_CHECK(m_writeKey.initialize());
+
+  // Register Write Cond Handle
+  if(m_condSvc->regHandle(this, m_writeKey).isFailure()) {
+    ATH_MSG_ERROR("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode CaloAlignCondAlg::execute(const EventContext& ctx) const
+{
+  // ____________ Construct Write Cond Handle and check its validity ____________
+  SG::WriteCondHandle<CaloDetDescrManager> writeHandle{m_writeKey,ctx};
+  if (writeHandle.isValid()) {
+    ATH_MSG_DEBUG("Found valid write handle");
+    return StatusCode::SUCCESS;
+  }
+  
+  // ____________ Get Read Cond Objects ____________
+  // 1. GeoAlignmentStore
+  SG::ReadCondHandle<GeoAlignmentStore> readHandleGeoAlign{m_readKeyGeoAlign,ctx};
+  const GeoAlignmentStore* readCdoGeoAlign{*readHandleGeoAlign};
+  if(!readCdoGeoAlign) {
+    ATH_MSG_ERROR("Null pointer to the read conditions object of type GeoAlignmentStore");
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_DEBUG("Retrieved GeoAlignmentStore object form the Condition Store");
+
+  writeHandle.addDependency(readHandleGeoAlign);
+
+  // 2. CaloCellPositionShift
+  SG::ReadCondHandle<CaloRec::CaloCellPositionShift> readHandleCellPosShift{m_readKeyCellPosShift,ctx};
+  const CaloRec::CaloCellPositionShift* readCdoCellPosShift{*readHandleCellPosShift};
+  if(!readCdoCellPosShift) {
+    ATH_MSG_ERROR("Null pointer to the read conditions object of type CaloRec::CaloCellPositionShift");
+    return StatusCode::FAILURE;
+  }
+  ATH_MSG_DEBUG("Retrieved CaloRec::CaloCellPositionShift object form the Condition Store");
+
+  writeHandle.addDependency(readHandleCellPosShift);
+
+  // ____________ Build new CaloDetDescrManager _________________
+  std::unique_ptr<CaloDetDescrManager> caloMgr = buildCaloDetDescr(serviceLocator()
+								   , Athena::getMessageSvc()
+								   , readCdoGeoAlign
+								   , readCdoCellPosShift);
+
+  ATH_CHECK(writeHandle.record(std::move(caloMgr)));
+  ATH_MSG_INFO("recorded new CaloDetDescr Manager condition object with key " << writeHandle.key() 
+	       << " and range " << writeHandle.getRange());
+
+  return StatusCode::SUCCESS;
+}
diff --git a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.h b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.h
new file mode 100644
index 000000000000..599c06b25cba
--- /dev/null
+++ b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.h
@@ -0,0 +1,54 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef CALOALIGNMENTALGS_CALOALIGNCONDALG_H
+#define CALOALIGNMENTALGS_CALOALIGNCONDALG_H
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/WriteCondHandleKey.h"
+#include "GaudiKernel/ICondSvc.h"
+
+#include "GeoModelUtilities/GeoAlignmentStore.h"
+#include "CaloConditions/CaloCellPositionShift.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
+
+/**
+ * @class CaloAlignCondAlg
+ *
+ * @brief Condition Algorithm for making CaloDetDescrManager condition object
+ *
+ **/
+
+class CaloAlignCondAlg final : public AthReentrantAlgorithm
+{
+ public:
+  using AthReentrantAlgorithm::AthReentrantAlgorithm;
+  virtual ~CaloAlignCondAlg() = default;
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute(const EventContext& ctx) const override;
+  virtual StatusCode finalize() override {return StatusCode::SUCCESS;};
+
+ private:
+  SG::ReadCondHandleKey<GeoAlignmentStore>  m_readKeyGeoAlign {this
+      , "LArAlignmentStore"
+      , "LArAlignmentStore"
+      , "SG key of the GeoAlignmentStore for LAr" };
+
+  SG::ReadCondHandleKey<CaloRec::CaloCellPositionShift> m_readKeyCellPosShift {this
+      , "CaloCellPositionShiftFolder"
+      , "LArCellPositionShift"
+      , "SG key of the CaloCellPositionShift" };
+
+  SG::WriteCondHandleKey<CaloDetDescrManager>  m_writeKey {this
+      , "CaloDetDescrManager"
+      , "CaloDetDescrManager"
+      , "SG key of the resulting CaloDetDescrManager" };
+
+  ServiceHandle<ICondSvc> m_condSvc{this, "CondSvc", "CondSvc"};
+
+};
+
+#endif
diff --git a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/components/CaloAlignmentAlgs_entries.cxx b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/components/CaloAlignmentAlgs_entries.cxx
new file mode 100644
index 000000000000..70dea40d86b3
--- /dev/null
+++ b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/components/CaloAlignmentAlgs_entries.cxx
@@ -0,0 +1,3 @@
+#include "../CaloAlignCondAlg.h"
+
+DECLARE_COMPONENT( CaloAlignCondAlg )
diff --git a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrManager.h b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrManager.h
index 79a51a0eb3e5..83338fa26d56 100755
--- a/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrManager.h
+++ b/Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrManager.h
@@ -15,6 +15,7 @@
 #define CALODETDESCR_CALODETDESCRMANAGER_H
 
 #include "AthenaKernel/CLASS_DEF.h"
+#include "AthenaKernel/CondCont.h"
 #include "CaloIdentifier/CaloCell_ID.h"
 #include "CaloDetDescr/CaloConstIteratorAdaptor.h"
 #include "boost/range/iterator_range.hpp"
@@ -479,7 +480,7 @@ public:
 };
 
 CLASS_DEF( CaloDetDescrManager , 4548337 , 1 )
-
+CONDCONT_DEF( CaloDetDescrManager , 206559529 );
 
 class CaloSuperCellDetDescrManager
   : public CaloDetDescrManager_Base
diff --git a/Calorimeter/CaloDetDescrUtils/CMakeLists.txt b/Calorimeter/CaloDetDescrUtils/CMakeLists.txt
index 0a31db4c47c6..00596b2a668c 100644
--- a/Calorimeter/CaloDetDescrUtils/CMakeLists.txt
+++ b/Calorimeter/CaloDetDescrUtils/CMakeLists.txt
@@ -7,4 +7,5 @@ atlas_subdir( CaloDetDescrUtils )
 atlas_add_library( CaloDetDescrUtils
 		   src/*.cxx
 		   PUBLIC_HEADERS CaloDetDescrUtils
-		   PRIVATE_LINK_LIBRARIES GaudiKernel CaloIdentifier GeoModelUtilities LArReadoutGeometry TileDetDescr StoreGateLib RDBAccessSvcLib )
+		   PRIVATE_LINK_LIBRARIES GaudiKernel CaloIdentifier CaloConditions GeoModelUtilities
+		                          LArReadoutGeometry TileDetDescr StoreGateLib RDBAccessSvcLib )
diff --git a/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx b/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx
index 521076a4a80d..b908294b12e4 100644
--- a/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx
+++ b/Calorimeter/CaloDetDescrUtils/src/CaloDetDescrBuilder.cxx
@@ -13,6 +13,8 @@
 #include "CaloDetDescr/CaloDescriptors.h"
 #include "CaloDetDescr/CaloDetDescrElementContainer.h"
 
+#include "CaloConditions/CaloCellPositionShift.h"
+
 #include "LArReadoutGeometry/LArDetectorManager.h"
 
 #include "LArReadoutGeometry/EMBCell.h"
@@ -44,7 +46,7 @@
 std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 						       , IMessageSvc* msgSvc
 						       , const GeoAlignmentStore* geoAlignStore
-						       , const CaloRec::CaloCellPositionShift* /*cellPosShift*/)
+						       , const CaloRec::CaloCellPositionShift* cellPosShift)
 {
   MsgStream log(msgSvc, "buildCaloDetDescr"); 
 
@@ -80,16 +82,10 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
   // geometry layout
   caloMgr->set_lar_geometry(cellVol.layout());
 
-  //unsigned int idhash;
-  IdentifierHash min;
-  IdentifierHash max;
-
   const LArEM_ID* em_id = caloId_mgr->getEM_ID();
   const LArHEC_ID* hec_id = caloId_mgr->getHEC_ID();
   const LArFCAL_ID* fcal_id = caloId_mgr->getFCAL_ID();
 
-  // Create Calo Detector Elements
-
   // Check whether we are working with Test Beam geometry
   bool isTestBeam = false;
   const LArDetectorManager* larMgr{nullptr};
@@ -101,11 +97,19 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
     isTestBeam = larMgr->isTestBeam();
   }
 
+  // Get minimal value for Hash ID - needed to retrieve sagging information
+  IdentifierHash minHash,maxHash;
+  cell_id->calo_cell_hash_range(CaloCell_ID::LAREM,minHash,maxHash);
+
+  // Two objects needed to pass sagging info to updateAlignment() methods
+  CaloElementPositionShift elementPosShift;
+  CaloRec::CaloCellPositionShift::size_type posShiftInd;
+
   // ****************************************************************
   // **                   --- --- EMB --- ---                      **
   // ****************************************************************
 
-  // --- Retrieve Emec Detector Manager
+  // --- Retrieve EMB Detector Manager
   const EMBDetectorManager* embManager{nullptr};
   status = detStore->retrieve(embManager);
   if(status.isFailure()) {
@@ -115,13 +119,13 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
     //         --- --- Iterate over EMB regions and cells --- ---
     EMBDetectorManager::DetectorRegionConstIterator embregIt;
 
-    for (embregIt=embManager->beginDetectorRegion(); embregIt!=embManager->endDetectorRegion(); embregIt++) {
+    for (embregIt=embManager->beginDetectorRegion(); embregIt!=embManager->endDetectorRegion(); ++embregIt) {
       const EMBDetectorRegion *embRegion = *embregIt;
 
-      // *** ***  Create descriptor for this region *** ***
-      // Region identifier.
-      // Do some mapping between LArReadoutGeometry and CaloID
+      // _________ Create descriptor for this region _________
 
+      // Build region identifier.
+      // Do some mapping between LArReadoutGeometry and CaloID
       int barrel_ec = 0;
       switch(embRegion->getEndcapIndex()) {
       case EMBDetectorRegion::NEG:
@@ -156,14 +160,11 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 
       std::vector<double> depth_in;
       std::vector<double> depth_out;
+      // __________________________________________________________
 
-      // *** ***  Create descriptor for this region *** ***
-
-      //
-      //            *** *** *** Iterate over cells *** *** ***
-      //
-      for (unsigned int iPhi=embRegion->beginPhiIndex();iPhi<embRegion->endPhiIndex();iPhi++) {
-	for (unsigned int iEta=embRegion->beginEtaIndex();iEta<embRegion->endEtaIndex();iEta++) {
+      // _________ Create EMB detector elements _________
+      for (unsigned int iPhi=embRegion->beginPhiIndex(); iPhi<embRegion->endPhiIndex(); ++iPhi) {
+	for (unsigned int iEta=embRegion->beginEtaIndex(); iEta<embRegion->endEtaIndex(); ++iEta) {
 	  EMBCellConstLink cellPtr = embRegion->getEMBCell(iEta,iPhi);
 
 	  // build hash identifier for this cell
@@ -173,7 +174,13 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 						, iEta
 						, iPhi);
 
-	  // Create the element and store it
+	  // Create new element and store it
+	  if(cellPosShift) {
+            posShiftInd = cell_id->calo_cell_hash(chanId) - minHash;
+            elementPosShift.dx = cellPosShift->deltaX(posShiftInd);
+            elementPosShift.dy = cellPosShift->deltaY(posShiftInd);
+            elementPosShift.dz = cellPosShift->deltaZ(posShiftInd);
+          }
 	  EMBDetectorElement* embElement = new EMBDetectorElement(em_id->channel_hash(chanId)
 								  , 0
 								  , 0
@@ -181,10 +188,18 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 								  , cellPtr
 								  , embRegion
 								  , isTestBeam
-								  , geoAlignStore);
-	  if(iPhi==embRegion->beginPhiIndex()) {
-	    phi_min = embElement->phi() - 0.5*embElement->dphi();
-	  }
+								  , geoAlignStore
+								  , cellPosShift ? &elementPosShift : nullptr);
+	  if(cellPosShift) {
+            if(iPhi==0 && (iEta==0||iEta==1)) {
+              phi_min = embElement->phi() - 0.5*embElement->dphi();
+            }
+          }
+          else {
+            if(iPhi==embRegion->beginPhiIndex()) {
+              phi_min = embElement->phi() - 0.5*embElement->dphi();
+            }
+          }
 
 	  // cell volume
 	  embElement->set_volume(cellVol.CellVolume(chanId));
@@ -213,7 +228,7 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 	  }
 	} // Eta loop
       } // Phi loop
-      //            *** *** *** Iterate over cells *** *** ***
+      // _____________________________________________________________
 
       double eta_min = (embRegion->getSamplingIndex()==1 && embRegion->getRegionIndex()==0)
 	? embRegion->getDescriptor()->getEtaBinning().getStart() - embRegion->getDescriptor()->getEtaBinning().getDelta()
@@ -240,9 +255,18 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
       // 'alignable' values
       embDescr->setLArRegMin(reg_min);
       embDescr->setLArRegMax(reg_max);
-      embDescr->setLArEtaMin(eta_min);
       embDescr->setLArPhiMin(phi_min);
-
+      if(cellPosShift) {
+        if(embRegion->getEndcapIndex()==EMBDetectorRegion::NEG) {
+          embDescr->setLArEtaMin(-reg_max);
+        }
+        else {
+          embDescr->setLArEtaMin(reg_min);
+        }
+      }
+      else {
+        embDescr->setLArEtaMin(eta_min);
+      }
     }// Region loop
   } // if EMB manager has been retrieved
 
@@ -264,11 +288,12 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
     //         --- --- Iterate over EMEC regions and cells --- ---
     EMECDetectorManager::DetectorRegionConstIterator emecregIt;
 
-    for (emecregIt=emecManager->beginDetectorRegion(); emecregIt!=emecManager->endDetectorRegion(); emecregIt++) {
+    for (emecregIt=emecManager->beginDetectorRegion(); emecregIt!=emecManager->endDetectorRegion(); ++emecregIt) {
       const EMECDetectorRegion *emecRegion = *emecregIt;
 
-      // *** ***  Create descriptor for this region *** ***
-      // Region identifier.
+      // _________ Create descriptor for this region _________
+
+      // Build Region identifier.
       // Do some mapping between LArReadoutGeometry and CaloID
       EMECDetectorRegion::DetectorSide endcapInd = emecRegion->getEndcapIndex();
 
@@ -319,13 +344,11 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 
       std::vector<double> depth_in;
       std::vector<double> depth_out;
-      // *** ***  Create descriptor for this region *** ***
+      // _____________________________________________________________
 
-      //
-      //            *** *** *** Iterate over cells *** *** ***
-      //
-      for (unsigned int iPhi=emecRegion->beginPhiIndex();iPhi<emecRegion->endPhiIndex();iPhi++) {
-	for (unsigned int iEta=emecRegion->beginEtaIndex();iEta<emecRegion->endEtaIndex();iEta++) {
+      // _________ Create EMEC detector elements _________
+      for (unsigned int iPhi=emecRegion->beginPhiIndex(); iPhi<emecRegion->endPhiIndex(); ++iPhi) {
+	for (unsigned int iEta=emecRegion->beginEtaIndex(); iEta<emecRegion->endEtaIndex(); ++iEta) {
 	  EMECCellConstLink cellPtr = emecRegion->getEMECCell(iEta,iPhi);
 
 	  Identifier chanId = em_id->channel_id(barrel_ec
@@ -334,7 +357,13 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 						, iEta
 						, iPhi);
 
-	  // Create the element and store it
+	  // Create new element and store it
+	  if(cellPosShift) {
+            posShiftInd = cell_id->calo_cell_hash(chanId) - minHash;
+            elementPosShift.dx = cellPosShift->deltaX(posShiftInd);
+            elementPosShift.dy = cellPosShift->deltaY(posShiftInd);
+            elementPosShift.dz = cellPosShift->deltaZ(posShiftInd);
+          }
 	  EMECDetectorElement* emecElement = new EMECDetectorElement(em_id->channel_hash(chanId)
 								     , 0
 								     , 0
@@ -342,8 +371,10 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 								     , cellPtr
 								     , emecRegion
 								     , isTestBeam
-								     , geoAlignStore);
-	  if(iPhi==emecRegion->beginPhiIndex()) {
+								     , geoAlignStore
+								     , cellPosShift ? &elementPosShift : nullptr);
+	  if((cellPosShift && iPhi==0)
+	     ||(!cellPosShift && iPhi==emecRegion->beginPhiIndex())) {
 	    phi_min = emecElement->phi() - 0.5*emecElement->dphi();
 	  }
 
@@ -373,7 +404,7 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 	  }
 	} // Eta loop
       } // Phi loop
-      //            *** *** *** Iterate over cells *** *** ***
+      // ____________________________________________________________________
 
       double eta_min = emecRegion->getDescriptor()->getEtaBinning().getStart();
       double eta_max = emecRegion->getDescriptor()->getEtaBinning().getEnd();
@@ -397,8 +428,18 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
       // 'alignable' values
       emecDescr->setLArRegMin(reg_min);
       emecDescr->setLArRegMax(reg_max);
-      emecDescr->setLArEtaMin(eta_min);
       emecDescr->setLArPhiMin(phi_min);
+      if(cellPosShift) {
+        if(emecRegion->getEndcapIndex()==EMECDetectorRegion::NEG) {
+          emecDescr->setLArEtaMin(-reg_max);
+        }
+        else {
+          emecDescr->setLArEtaMin(reg_min);
+        }
+      }
+      else {
+        emecDescr->setLArEtaMin(eta_min);
+      }
     }// Region loop
   }// if EMEC manager has been retrieved
 
@@ -421,11 +462,12 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
     //         --- --- Iterate over HEC regions and cells --- ---
     HECDetectorManager::DetectorRegionConstIterator hecregIt;
 
-    for (hecregIt=hecManager->beginDetectorRegion(); hecregIt!=hecManager->endDetectorRegion(); hecregIt++) {
+    for (hecregIt=hecManager->beginDetectorRegion(); hecregIt!=hecManager->endDetectorRegion(); ++hecregIt) {
       const HECDetectorRegion *hecregion = *hecregIt;
 
-      // *** ***  Create descriptor for this region *** ***
-      // Region identifier.
+      // _________ Create descriptor for this region _________
+
+      // Build Region identifier.
       // Do some mapping between LArReadoutGeometry and CaloID
       HECDetectorRegion::DetectorSide endcapInd = hecregion->getEndcapIndex();
       int pos_neg = endcapInd==HECDetectorRegion::NEG ? -2 : 2;
@@ -452,12 +494,11 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 
       std::vector<double> depth_in;
       std::vector<double> depth_out;
+      // _____________________________________________________________
 
-      //
-      //            *** *** *** Iterate over cells *** *** ***
-      //
-      for (unsigned int iPhi=hecregion->beginPhiIndex();iPhi<hecregion->endPhiIndex();iPhi++) {
-	for (unsigned int iEta=hecregion->beginEtaIndex();iEta<hecregion->endEtaIndex();iEta++)	{
+      // _________ Create HEC detector elements _________
+      for (unsigned int iPhi=hecregion->beginPhiIndex(); iPhi<hecregion->endPhiIndex(); ++iPhi) {
+	for (unsigned int iEta=hecregion->beginEtaIndex(); iEta<hecregion->endEtaIndex(); ++iEta) {
 	  HECCellConstLink cellPtr = hecregion->getHECCell(iEta,iPhi);
 	  // build hash identifier for this cell
 	  // Do some mapping between LArReadoutGeometry and CaloID
@@ -470,6 +511,12 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 						   , iPhi);
 
 	    // Create the element and store it
+	    if(cellPosShift) {
+              posShiftInd = cell_id->calo_cell_hash(chanId) - minHash;
+              elementPosShift.dx = cellPosShift->deltaX(posShiftInd);
+              elementPosShift.dy = cellPosShift->deltaY(posShiftInd);
+              elementPosShift.dz = cellPosShift->deltaZ(posShiftInd);
+            }
 	    HECDetectorElement* hecElement = new HECDetectorElement(hec_id->channel_hash(chanId)
 								    , 0
 								    , 0
@@ -477,10 +524,13 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 								    , cellPtr
 								    , hecregion
 								    , isTestBeam
-								    , geoAlignStore);
-	    if(iPhi==hecregion->beginPhiIndex()) {
-	      phi_min = hecElement->phi() - 0.5*hecElement->dphi();
-	    }
+								    , geoAlignStore
+								    , cellPosShift ? &elementPosShift : nullptr);
+
+	    if((cellPosShift && iPhi==0)
+               || (!cellPosShift && iPhi==hecregion->beginPhiIndex())) {
+              phi_min = hecElement->phi() - 0.5*hecElement->dphi();
+            }
 
 	    // cell volume
 	    hecElement->set_volume(cellVol.CellVolume(chanId));
@@ -534,8 +584,19 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
       // 'alignable' values
       hecDescr->setLArRegMin(reg_min);
       hecDescr->setLArRegMax(reg_max);
-      hecDescr->setLArEtaMin(eta_min);
       hecDescr->setLArPhiMin(phi_min);
+      if(cellPosShift) {
+        if(hecregion->getEndcapIndex()==HECDetectorRegion::NEG) {
+          hecDescr->setLArEtaMin(-reg_max);
+        }
+        else {
+          hecDescr->setLArEtaMin(reg_min);
+        }
+      }
+      else {
+        hecDescr->setLArEtaMin(eta_min);
+      }
+
     }// Region loop
   } // if HEC manager has been retrieved
 
@@ -558,11 +619,12 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
     //         --- --- Iterate over FCAL modules and tiles --- ---
     FCALDetectorManager::ConstIterator fcalmodIt;
 
-    for (fcalmodIt=fcalManager->beginFCAL(); fcalmodIt!=fcalManager->endFCAL(); fcalmodIt++) {
+    for (fcalmodIt=fcalManager->beginFCAL(); fcalmodIt!=fcalManager->endFCAL(); ++fcalmodIt) {
       const FCALModule* fcalmodule = *fcalmodIt;
 
-      // *** ***  Create descriptor for this module *** ***
-      // Module identifier.
+      // _________ Create descriptor for this module _________
+
+      // Build module identifier.
       // Do some mapping between LArReadoutGeometry and CaloID
 
       FCALModule::Endcap endcapInd = fcalmodule->getEndcapIndex();
@@ -590,17 +652,22 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 
       std::vector<double> depth_in;
       std::vector<double> depth_out;
+      // ___________________________________________________________
 
-      //
-      //            *** *** *** Iterate over cells *** *** ***
-      //
+      // _________ Create FCAL detector elements _________
       FCALModule::ConstIterator fcaltileIt;
-      for (fcaltileIt=fcalmodule->beginTiles();fcaltileIt!=fcalmodule->endTiles();fcaltileIt++) {
+      for (fcaltileIt=fcalmodule->beginTiles(); fcaltileIt!=fcalmodule->endTiles(); ++fcaltileIt) {
 	Identifier chanId = fcal_id->channel_id(pos_neg
 						, (int)fcalmodule->getModuleIndex()
 						, fcaltileIt->getIndexJ()   // eta
 						, fcaltileIt->getIndexI());  // phi
 
+	if(cellPosShift) {
+          posShiftInd = cell_id->calo_cell_hash(chanId) - minHash;
+          elementPosShift.dx = cellPosShift->deltaX(posShiftInd);
+          elementPosShift.dy = cellPosShift->deltaY(posShiftInd);
+          elementPosShift.dz = cellPosShift->deltaZ(posShiftInd);
+        }
 	FCALDetectorElement* fcalElement = new FCALDetectorElement(fcal_id->channel_hash(chanId)
 								   , 0
 								   , 0
@@ -608,7 +675,8 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
 								   , &(*fcaltileIt)
 								   , fcalmodule
 								   , isTestBeam
-								   , geoAlignStore);
+								   , geoAlignStore
+								   , cellPosShift ? &elementPosShift : nullptr);
 	// calculate cell volume
 	double tubeSpacing = cellVol.getFcalTubeSpacing((int)fcalmodule->getModuleIndex());
 	unsigned int numTubes = fcaltileIt->getNumTubes();
@@ -684,8 +752,9 @@ std::unique_ptr<CaloDetDescrManager> buildCaloDetDescr(ISvcLocator* svcLocator
   }
   else {
     log << MSG::DEBUG << " Found the TileDetDescrManager " << endmsg;
-    cell_id->calo_cell_hash_range((int)CaloCell_ID::TILE,min,max);
-    for(unsigned int idhash=0; idhash < max-min; idhash++) {
+    cell_id->calo_cell_hash_range((int)CaloCell_ID::TILE,minHash,maxHash);
+    unsigned idHashMax = maxHash-minHash;
+    for(unsigned int idhash=0; idhash < idHashMax; ++idhash) {
       CaloDetDescrElement* newelt = tile_mgr->get_cell_element(idhash);
       if(newelt) {
 	caloMgr->add(newelt);
diff --git a/Calorimeter/CaloUtils/CMakeLists.txt b/Calorimeter/CaloUtils/CMakeLists.txt
index 9ddd5c3e55d6..721203a80b95 100644
--- a/Calorimeter/CaloUtils/CMakeLists.txt
+++ b/Calorimeter/CaloUtils/CMakeLists.txt
@@ -60,7 +60,7 @@ atlas_add_test( CaloTowerStore_test
 atlas_add_test( CaloTowerBuilderTool_test
    SCRIPT test/CaloTowerBuilderTool_test.sh
    LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment|IOVDbSvc +INFO|INFO Initializing"
-   ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-15"
+   ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-16"
    PROPERTIES TIMEOUT 500 )
 
 atlas_add_test( ToolWithConstants_test
diff --git a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
index 324df2d878a8..10c6f613c6b6 100644
--- a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
+++ b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref
@@ -255,6 +255,7 @@ AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 0 events p
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[0,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[0,t:0,l:0] - [INVALID]}
 test1
 AthenaEventLoopMgr   INFO   ===>>>  done processing event #1, run #1 1 events processed so far  <<<===
 /cvmfs/atlas-co...   INFO Database being retired...
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py
index da704d780dde..c0f5f6e2eefb 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_CONDBR2-BLKPA-2015-12.py
@@ -11,7 +11,7 @@ conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,f
 
 #from Guillaume
 conddb.blockFolder("/LAR/LArCellPositionShift");
-conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True); 
+conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True,className="CaloRec::CaloCellPositionShift");
 conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/4samples1phase","LARElecCalibOflShapeRTM4samples1phase-RUN2-UPD4-00")
 conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecCalibOflOFCPhysWaveRTM4samples1phase-RUN2-UPD4-00")
 svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"]
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC15c-SDR-11.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC15c-SDR-11.py
index c11cb6e0e0cf..8a6deb519947 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC15c-SDR-11.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC15c-SDR-11.py
@@ -11,7 +11,7 @@ conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,f
 
 #from Guillaume
 conddb.blockFolder("/LAR/LArCellPositionShift");
-conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True); 
+conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True,className="CaloRec::CaloCellPositionShift");
 conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/4samples1phase","LARElecCalibOflShapeRTM4samples1phase-RUN2-UPD4-00")
 conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecCalibOflOFCPhysWaveRTM4samples1phase-RUN2-UPD4-00")
 svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"]
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-23.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-23.py
index b3151045d17e..6d125207e5a9 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-23.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-23.py
@@ -11,7 +11,7 @@ conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,f
 
 #from Guillaume
 conddb.blockFolder("/LAR/LArCellPositionShift");
-conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True); 
+conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True,className="CaloRec::CaloCellPositionShift");
 conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/4samples1phase","LARElecCalibOflShapeRTM4samples1phase-RUN2-UPD4-00")
 conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecCalibOflOFCPhysWaveRTM4samples1phase-RUN2-UPD4-00")
 svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"]
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py
index 75fe998cb29a..6fb455e8cc21 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26.py
@@ -11,7 +11,7 @@ conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,f
 
 #from Guillaume
 conddb.blockFolder("/LAR/LArCellPositionShift");
-conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True); 
+conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True,className="CaloRec::CaloCellPositionShift");
 conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/4samples1phase","LARElecCalibOflShapeRTM4samples1phase-RUN2-UPD4-00")
 conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecCalibOflOFCPhysWaveRTM4samples1phase-RUN2-UPD4-00")
 svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"]
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py
index 4c8667b36c62..4dd84ed693a1 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-26_folders100M.py
@@ -11,7 +11,7 @@ conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,f
 
 #from Guillaume
 conddb.blockFolder("/LAR/LArCellPositionShift");
-conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True); 
+conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True,className="CaloRec::CaloCellPositionShift");
 conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/4samples1phase","LARElecCalibOflShapeRTM4samples1phase-RUN2-UPD4-00")
 conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecCalibOflOFCPhysWaveRTM4samples1phase-RUN2-UPD4-00")
 svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"]
diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-27.py b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-27.py
index 0834ff148d46..189e7d89dd71 100644
--- a/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-27.py
+++ b/Event/EventOverlay/EventOverlayJobTransforms/share/Rt_override_OFLCOND-MC16-SDR-27.py
@@ -11,7 +11,7 @@ conddb.addFolderWithTag("MDT_OFL","/MDT/RTBLOB","MDTRT_Sim-04-BLOB",force=True,f
 
 #from Guillaume
 conddb.blockFolder("/LAR/LArCellPositionShift");
-conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True); 
+conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True,className="CaloRec::CaloCellPositionShift");
 conddb.addOverride("/LAR/ElecCalibOfl/Shape/RTM/4samples1phase","LARElecCalibOflShapeRTM4samples1phase-RUN2-UPD4-00")
 conddb.addOverride("/LAR/ElecCalibOfl/OFC/PhysWave/RTM/4samples1phase","LARElecCalibOflOFCPhysWaveRTM4samples1phase-RUN2-UPD4-00")
 svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+"/cvmfs/atlas-condb.cern.ch/repo/conditions/poolcond/PoolFileCatalog.xml"]
diff --git a/LArCalorimeter/LArCafJobs/share/LArReadCells_overlay.py b/LArCalorimeter/LArCafJobs/share/LArReadCells_overlay.py
index 6c7cd5f4ac65..9ed0b973d958 100644
--- a/LArCalorimeter/LArCafJobs/share/LArReadCells_overlay.py
+++ b/LArCalorimeter/LArCafJobs/share/LArReadCells_overlay.py
@@ -70,7 +70,7 @@ from AtlasGeoModel import GeoModelInit
 
 from IOVDbSvc.CondDB import conddb
 conddb.blockFolder("/LAR/LArCellPositionShift")
-conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True) 
+conddb.addFolderWithTag("LAR_OFL","/LAR/LArCellPositionShift","LArCellPositionShift-ideal",force=True,forceMC=True,className="CaloRec::CaloCellPositionShift")
 
 include( "CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py" )
 include( "LArDetDescr/LArDetDescr_joboptions.py" )
diff --git a/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref b/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
index 20d762754505..aabe0b6588e6 100644
--- a/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
+++ b/LArCalorimeter/LArCellRec/share/LArCellDeadOTXCorr_test.ref
@@ -427,6 +427,8 @@ Domain[ROOT_All]     INFO                           /cvmfs/atlas-condb.cern.ch/r
 RootDatabase.open    INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000027.gen.COND/cond09_mc.000027.gen.COND._0001.pool.root File version:52600
 /cvmfs/atlas-co...   INFO Database being retired...
 Domain[ROOT_All]     INFO ->  Deaccess DbDatabase   READ      [ROOT_All] 303FCBD8-653E-DD11-ABBD-000423D99862
+ of type TileDetDescrManager(CLID 2941)
+buildCaloDetDescr WARNING Could not get the TileDetectorManager. No Calo Elements will be built for Tile
 LArOnOffMappingAlg   INFO Done reading online/offline identifier mapping
 LArOnOffMappingAlg   INFO Found 195072 online identifier and 182468 offline identifier. 12604 disconnected channels.
 LArOnOffMappingAlg   INFO recorded new LArOnOffIdMap with range {[0,l:0] - [INVALID]} into Conditions Store
diff --git a/LArCalorimeter/LArExample/LArConditionsCommon/python/LArAlignable.py b/LArCalorimeter/LArExample/LArConditionsCommon/python/LArAlignable.py
index 5c4d54427146..160ede31994f 100755
--- a/LArCalorimeter/LArExample/LArConditionsCommon/python/LArAlignable.py
+++ b/LArCalorimeter/LArExample/LArConditionsCommon/python/LArAlignable.py
@@ -27,3 +27,5 @@ if activateCondAlgs:
   if not hasattr(condSeq,"LArAlignCondAlg"):
     from LArAlignmentAlgs.LArAlignmentAlgsConf import LArAlignCondAlg
     condSeq += LArAlignCondAlg("LArAlignCondAlg")
+    from CaloAlignmentAlgs.CaloAlignmentAlgsConf import CaloAlignCondAlg
+    condSeq += CaloAlignCondAlg("CaloAlignCondAlg")
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloDDE.h b/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloDDE.h
deleted file mode 100755
index b65c42611a20..000000000000
--- a/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloDDE.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TESTLARDETDESCR_TESTCALODDE_H
-#define TESTLARDETDESCR_TESTCALODDE_H
-
-/********************************************************************
-
-NAME:     TestCaloDDE.h 
-PACKAGE:  offline/LArCalorimeter/LArExample/TestLArDetDescr
-
-AUTHORS:  Claire Adam-Bourdarios
-CREATED:  Feb 2003
-
-PURPOSE:  provide example to retreive CaloDetDescr manager and
-          elements from StoreGate and test them.
-
-********************************************************************/
-// INCLUDE HEADER FILES:
-#include "AthenaBaseComps/AthAlgorithm.h"
-
-class CaloIdManager;
-class CaloDetDescrManager;
-#include "CaloIdentifier/CaloCell_ID.h"
-class ICaloRecoMaterialTool;
-class ICaloRecoSimpleGeomTool;
-class CaloPhiRange;
-
-class TestCaloDDE : public AthAlgorithm
-{
- public:
-
-  // constructor 
-  TestCaloDDE(const std::string& name, ISvcLocator* pSvcLocator);
-  // destructor 
-  virtual ~TestCaloDDE();
-
-  virtual StatusCode initialize();
-  virtual StatusCode finalize();
-  virtual StatusCode execute();
-
-  void print_subcalo(CaloCell_ID::CaloSample sample);
-  void print_eta_line(int phi_num, bool em, bool hec, bool fcal);
-  void print_phi_line(int eta_num, bool em, bool hec, bool fcal);
-  void print_elt_HW(bool em, bool hec, bool fcal);
-  void try_zone();
-  void try_each_descr_zone();
-  void try_zone(double eta, double deta, double phi, double dphi, int sampling_or_module);
-  void read_volumes();
-  void where_am_I(double eta, double phi);
-  void update();
-  void print_edges_via_CaloSample(CaloCell_ID::CaloSample sample, double eta, double phi );
-  void print_edges_via_SubCalo(CaloCell_ID::CaloSample sample, double eta, double phi );
-  void print_edges_via_CaloSample();
-  void print_edges_via_SubCalo();
-
- protected:
-  
-  const CaloIdManager*  m_calo_id_man;
-  const CaloDetDescrManager*  m_calo_dd_man;
-
-  // Simplified geometry :
-  ICaloRecoMaterialTool* m_lar_mat;
-  ICaloRecoSimpleGeomTool* m_lar_simplegeom;
-};
-
-#endif
-
-//end of TESTLARDETDESCR_TESTCALODDE 
-
-
-
-
-
-
-
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.cxx b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.cxx
index 7f52574a3d14..be05449c9f2f 100755
--- a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.cxx
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.cxx
@@ -3,27 +3,25 @@
 */
 
 // INCLUDE HEADER FILES:
-#include "TestLArDetDescr/TestCaloDDE.h"
+#include "TestCaloDDE.h"
 
-// Athena related 
 #include "GaudiKernel/MsgStream.h"
 #include "Gaudi/Property.h"
-#include <algorithm>
 #include "StoreGate/StoreGateSvc.h"
 #include "CLHEP/Units/SystemOfUnits.h"
 #include "CLHEP/Geometry/Transform3D.h"
 
-// specific :
 #include "CaloIdentifier/LArID.h"
 #include "CaloIdentifier/CaloIdManager.h"
 
 #include "CaloDetDescr/CaloSubdetNames.h"
-#include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloDetDescr/CaloDetDescriptor.h"
 #include "CaloDetDescr/ICaloRecoMaterialTool.h"
 #include "CaloDetDescr/ICaloRecoSimpleGeomTool.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "CaloGeoHelpers/CaloPhiRange.h"
+
+#include <algorithm>
 #include <cmath>
 
 #include "boost/io/ios_state.hpp"
@@ -31,30 +29,26 @@
 using HepGeom::Transform3D;
 using HepGeom::RotateZ3D;
 
-// -------------------------------------------------------------
-// Constructor 
-// -------------------------------------------------------------
-TestCaloDDE::TestCaloDDE(const std::string& name, 
-				   ISvcLocator* pSvcLocator): 
-  AthAlgorithm(name, pSvcLocator),
-  m_calo_id_man(0),
-  m_calo_dd_man(0),
-  m_lar_mat(0),
-  m_lar_simplegeom(0)
+TestCaloDDE::TestCaloDDE(const std::string& name
+			 , ISvcLocator* pSvcLocator)
+  : AthAlgorithm(name, pSvcLocator)
 {}
 
-// DESTRUCTOR:
 TestCaloDDE::~TestCaloDDE()
-{  }
+{}
 
-// INITIALIZE:
 StatusCode TestCaloDDE::initialize()
 {
   ATH_CHECK( detStore()->retrieve(m_calo_id_man) );
   ATH_MSG_DEBUG ( "Successfully retrieved CaloIdManager from DetectorStore" );
   
-  ATH_CHECK( detStore()->retrieve(m_calo_dd_man) );
-  ATH_MSG_DEBUG ( "Successfully retrieved CaloDetDescrManager from DetectorStore" );
+  if(m_useCondStore) {
+    ATH_CHECK(m_readCondKey.initialize());
+  }
+  else {
+    ATH_CHECK( detStore()->retrieve(m_calo_dd_man) );
+    ATH_MSG_DEBUG ( "Successfully retrieved CaloDetDescrManager from DetectorStore" );
+  }
 
   return StatusCode::SUCCESS;
 }
@@ -68,41 +62,52 @@ StatusCode TestCaloDDE::finalize()
 // EXECUTE:
 StatusCode TestCaloDDE::execute()
 {  
-  ATH_MSG_INFO ( "Executing TestCaloDDE with geometry : " 
-                 << m_calo_dd_man->lar_geometry());
+  const CaloDetDescrManager* caloDDMan{nullptr};
+  if(m_useCondStore) {
+    SG::ReadCondHandle<CaloDetDescrManager> readCondHandle{m_readCondKey};
+    caloDDMan = *readCondHandle;
+    if(!caloDDMan) {
+      ATH_MSG_FATAL("Failed to get CaloDetDescrManager from Condition Store");
+      return StatusCode::FAILURE;
+    }
+  }
+  else {
+    caloDDMan = m_calo_dd_man;
+  }
+
+  ATH_MSG_INFO ( "Executing TestCaloDDE with geometry : " << caloDDMan->lar_geometry());
 
   CaloPhiRange range;
   range.print(); 
 
   // Print Regions and/or CaloDDE :
 
-  //update();
   //if(m_lar_simplegeom) m_lar_simplegeom->print();
 
-  print_eta_line( 1, true, true, true);
-  //print_phi_line( 56, true, false, false);
+  print_eta_line( 1, true, true, true, caloDDMan);
+  //print_phi_line( 56, true, false, false, caloDDMan);
 
-  //print_edges_via_SubCalo();
-  //print_edges_via_CaloSample();
+  //print_edges_via_SubCalo(caloDDMan);
+  //print_edges_via_CaloSample(caloDDMan);
 
-  //  try_each_descr_zone();
-  //  try_zone();
+  //try_each_descr_zone(caloDDMan);
+  //try_zone(caloDDMan);
 
-  //print_elt_HW( true, true, true);
+  // print_elt_HW( true, true, true, caloDDMan);
 
-  /*
-  CaloCell_ID::CaloSample sample = CaloCell_ID::PreSamplerB;
-  print_subcalo( sample );
-
-  sample = CaloCell_ID::EMB1;
-  print_subcalo( sample );
-  sample = CaloCell_ID::EMB2;
-  print_subcalo( sample );
-  sample = CaloCell_ID::EMB3;
-  print_subcalo( sample );
-  */
 
-  //read_volumes();
+  // CaloCell_ID::CaloSample sample = CaloCell_ID::PreSamplerB;
+  // print_subcalo( sample,caloDDMan );
+
+  // sample = CaloCell_ID::EMB1;
+  // print_subcalo( sample,caloDDMan );
+  // sample = CaloCell_ID::EMB2;
+  // print_subcalo( sample,caloDDMan );
+  // sample = CaloCell_ID::EMB3;
+  // print_subcalo( sample,caloDDMan );
+
+
+  // read_volumes(caloDDMan);
 
   /*
   float min =  (float)toto.phi_min();
@@ -142,7 +147,8 @@ StatusCode TestCaloDDE::execute()
 }
 
 void
-TestCaloDDE::print_subcalo( CaloCell_ID::CaloSample sample )
+TestCaloDDE::print_subcalo(CaloCell_ID::CaloSample sample
+			   , const CaloDetDescrManager* caloDDMan)
 {
   ATH_MSG_INFO ( " printing CaloDDE characteristics " );
 
@@ -153,12 +159,12 @@ TestCaloDDE::print_subcalo( CaloCell_ID::CaloSample sample )
   double eta = 0.437500;
   double phi = 0.;
 
-  m_calo_dd_man->decode_sample (subcalo, barrel, sampling_or_module, sample);
+  caloDDMan->decode_sample (subcalo, barrel, sampling_or_module, sample);
 
   std::cout << " CaloCell_ID::CaloSample " << sample << " eta " << eta << " phi " << phi << std::endl;
 
   const CaloDetDescrElement* dde =
-   m_calo_dd_man->get_element(subcalo,sampling_or_module,barrel,eta,phi);
+   caloDDMan->get_element(subcalo,sampling_or_module,barrel,eta,phi);
 
   std::cout << " = subcalo " << subcalo << " barrel " << barrel 
 	    << " sampling_or_module " << sampling_or_module
@@ -172,7 +178,11 @@ TestCaloDDE::print_subcalo( CaloCell_ID::CaloSample sample )
 }
 
 void
-TestCaloDDE::print_eta_line(int phi_num, bool em, bool hec, bool fcal)
+TestCaloDDE::print_eta_line(int phi_num
+			    , bool em
+			    , bool hec
+			    , bool fcal
+			    , const CaloDetDescrManager* caloDDMan)
 {
   boost::io::ios_base_all_saver coutsave (std::cout);
 
@@ -205,7 +215,7 @@ TestCaloDDE::print_eta_line(int phi_num, bool em, bool hec, bool fcal)
       idcalohash = help_all->calo_cell_hash (sub_calo_num, idhash);
       id = help_em->channel_id(idhash);
 
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloDDMan->get_element(idcalohash); 
       if ( !newelt ) std::cout << "missing em element" 
 			       << i << std::endl;
       
@@ -244,7 +254,7 @@ TestCaloDDE::print_eta_line(int phi_num, bool em, bool hec, bool fcal)
       
       id = help_hec->channel_id(idhash);
       
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloDDMan->get_element(idcalohash); 
       if ( !newelt ) 
 	std::cout << "missing hec element" 
 		  << idhash << std::endl;
@@ -277,7 +287,7 @@ TestCaloDDE::print_eta_line(int phi_num, bool em, bool hec, bool fcal)
       idcalohash = help_all->calo_cell_hash (sub_calo_num, idhash);
       id = help_fcal->channel_id(idhash);
 
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloDDMan->get_element(idcalohash); 
       if ( !newelt ) std::cout << "missing fcal element" 
 			       << i << std::endl;
 
@@ -302,7 +312,11 @@ TestCaloDDE::print_eta_line(int phi_num, bool em, bool hec, bool fcal)
 }
 
 void
-TestCaloDDE::print_phi_line(int eta_num, bool em, bool hec, bool fcal)
+TestCaloDDE::print_phi_line(int eta_num
+			    , bool em
+			    , bool hec
+			    , bool fcal
+			    , const CaloDetDescrManager* caloDDMan)
 {
   boost::io::ios_base_all_saver coutsave (std::cout);
 
@@ -335,7 +349,7 @@ TestCaloDDE::print_phi_line(int eta_num, bool em, bool hec, bool fcal)
       idcalohash = help_all->calo_cell_hash (sub_calo_num, idhash);
       id = help_em->channel_id(idhash);
 
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloDDMan->get_element(idcalohash); 
       if ( !newelt ) std::cout << "missing em element" 
 			       << i << std::endl;
       
@@ -371,7 +385,7 @@ TestCaloDDE::print_phi_line(int eta_num, bool em, bool hec, bool fcal)
       
       id = help_hec->channel_id(idhash);
       
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloDDMan->get_element(idcalohash); 
       if ( !newelt ) 
 	std::cout << "missing hec element" 
 		  << idhash << std::endl;
@@ -404,7 +418,7 @@ TestCaloDDE::print_phi_line(int eta_num, bool em, bool hec, bool fcal)
       idcalohash = help_all->calo_cell_hash (sub_calo_num, idhash);
       id = help_fcal->channel_id(idhash);
 
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloDDMan->get_element(idcalohash); 
       if ( !newelt ) std::cout << "missing fcal element" 
 			       << i << std::endl;
 
@@ -428,7 +442,10 @@ TestCaloDDE::print_phi_line(int eta_num, bool em, bool hec, bool fcal)
 }
 
 void
-TestCaloDDE::print_elt_HW(bool em, bool hec, bool fcal)
+TestCaloDDE::print_elt_HW(bool em
+			  , bool hec
+			  , bool fcal
+			  , const CaloDetDescrManager* caloDDMan)
 {
   boost::io::ios_base_all_saver coutsave (std::cout);
 
@@ -463,7 +480,7 @@ TestCaloDDE::print_elt_HW(bool em, bool hec, bool fcal)
       idcalohash = help_all->calo_cell_hash (sub_calo_num, idhash);
       id = help_em->channel_id(idhash);
 
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloDDMan->get_element(idcalohash); 
       if ( !newelt ) std::cout << "missing em element" 
 			       << i << std::endl;
       
@@ -472,7 +489,7 @@ TestCaloDDE::print_elt_HW(bool em, bool hec, bool fcal)
 		  << "calo-hash=" << (unsigned int) idcalohash 
 		  << " sub-hash=" << i << " region: "
 		  << help_em->sampling(id)<< " " 
-		  << help_em->region(id)
+		  << help_em->region(id) 
 		  << std::endl;
 		  }
       
@@ -491,13 +508,12 @@ TestCaloDDE::print_elt_HW(bool em, bool hec, bool fcal)
       
       id = help_hec->channel_id(idhash);
       
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloDDMan->get_element(idcalohash); 
       if ( !newelt ) 
 	std::cout << "missing hec element" 
 		  << idhash << std::endl;
       
       else if ( hec && help_hec->phi(id) == phi_num && newelt->eta() >=0) { 
-	
 	std::cout  << std::setw(9) << std::setprecision(4) 
 		   << "calo-hash=" << (unsigned int) idcalohash 
 		   << " sub-hash=" << i << " region: "
@@ -519,14 +535,13 @@ TestCaloDDE::print_elt_HW(bool em, bool hec, bool fcal)
       idcalohash = help_all->calo_cell_hash (sub_calo_num, idhash);
       id = help_fcal->channel_id(idhash);
 
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloDDMan->get_element(idcalohash); 
       if ( !newelt ) std::cout << "missing fcal element" 
 			       << i << std::endl;
 
       else if (fcal && help_fcal->phi(id) == 
 	       phi_num && help_fcal->pos_neg(id) >=0) { 
 
-	
      	std::cout  << std::setw(9) << std::setprecision(4) 
 		   << "calo-hash=" << (unsigned int) idcalohash 
 		  << " sub-hash=" << i << " region: "
@@ -536,10 +551,11 @@ TestCaloDDE::print_elt_HW(bool em, bool hec, bool fcal)
       }
 
     }
+
 }
 
 void
-TestCaloDDE::try_zone()
+TestCaloDDE::try_zone(const CaloDetDescrManager* caloDDMan)
 {
 
   ATH_MSG_INFO ( "Executing TestCaloDDE : try_zone " );
@@ -559,7 +575,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " Negative EMB : should find = 192 strips " );
   ATH_MSG_INFO ( " ------------------------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
 
   eta = 1.;
@@ -572,7 +588,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " Positive EMB : should find = 192 strips " );
   ATH_MSG_INFO ( " ------------------------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
 
   eta = -1.;
@@ -585,7 +601,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " Negative EMB : should find = 72 middle " );
   ATH_MSG_INFO ( " ------------------------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
 
   eta = 1.;
@@ -598,7 +614,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " Positive EMB : should find = 72 middle " );
   ATH_MSG_INFO ( " ------------------------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
 
   eta = -1.;
@@ -611,7 +627,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " Negative EMB : should find = 36 back " );
   ATH_MSG_INFO ( " ------------------------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
 
   eta = 1.;
@@ -624,7 +640,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " Positive EMB : should find = 36 back " );
   ATH_MSG_INFO ( " ------------------------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
 
   // -----------------------------------------------------------
@@ -639,7 +655,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " Negative EMEC : should find 3* ( 15 + 23 ) = 114 strips " );
   ATH_MSG_INFO ( " ------------------------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
 
   eta = 1.81035;
@@ -653,7 +669,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " Positive EMEC : should find 3 * ( 32 + 25 ) = 171 strips " );
   ATH_MSG_INFO ( " -------------------------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
 
   eta = 0.;
@@ -668,7 +684,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " should find 3 * ( 31 + 31 ) = 186 strips " );
   ATH_MSG_INFO ( " ---------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
 
   eta = 1.4;
@@ -683,7 +699,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " where : 9 = 4 EMB2 + 1 barrel-end + 1 emec-begin + 3 EMEC2 " );
   ATH_MSG_INFO ( " ---------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
   ATH_MSG_INFO ( " " );
   ATH_MSG_INFO ( " " );
@@ -700,7 +716,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " where : 9 = 4 EMB2 + 1 barrel-end + 1 emec-begin + 3 EMEC2  " );
   ATH_MSG_INFO ( " ----------------------------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
   ATH_MSG_INFO ( " " );
   ATH_MSG_INFO ( " " );
@@ -718,7 +734,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " + 9 x ( 3 barrel-end, which has a different phi grannularity ) " );
   ATH_MSG_INFO ( " ---------------------------------------- " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
   ATH_MSG_INFO ( " " );
   ATH_MSG_INFO ( " " );
@@ -735,7 +751,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " 3 x ( 3 EMB3 + 2 EMEC3 )            " );
   ATH_MSG_INFO ( " ----------------------------------  " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
   ATH_MSG_INFO ( " " );
   ATH_MSG_INFO ( " " );
@@ -754,7 +770,7 @@ TestCaloDDE::try_zone()
   ATH_MSG_INFO ( " 5 in phi ( 4 ~ -pi, 1 ~ +pi ) x  5 EMB2  " );
   ATH_MSG_INFO ( " ---------------------------------------  " );
   ATH_MSG_INFO ( " " );
-  try_zone(eta, deta, phi, dphi, sampling_or_module);
+  try_zone(eta, deta, phi, dphi, sampling_or_module,caloDDMan);
   ATH_MSG_INFO ( " " );
   ATH_MSG_INFO ( " " );
   ATH_MSG_INFO ( " " );
@@ -763,7 +779,7 @@ TestCaloDDE::try_zone()
 
 
 void
-TestCaloDDE::try_each_descr_zone()
+TestCaloDDE::try_each_descr_zone(const CaloDetDescrManager* caloDDMan)
 {
   ATH_MSG_INFO( "" );
   ATH_MSG_INFO ( "Executing TestCaloDDE : try_zone for each descriptor " );
@@ -794,7 +810,7 @@ TestCaloDDE::try_each_descr_zone()
   std::cout << std::endl;
   std::cout << std::endl;
 
-  for (const CaloDetDescriptor* descr : m_calo_dd_man->calo_descriptors_range())
+  for (const CaloDetDescriptor* descr : caloDDMan->calo_descriptors_range())
     {
       if ( num == em_nb || num == (em_nb+hec_nb) || num == (em_nb+hec_nb+fcal_nb)
 	   || num == (em_nb+hec_nb+fcal_nb+tile_nb) ) 
@@ -828,7 +844,7 @@ TestCaloDDE::try_each_descr_zone()
 		  << " CaloSample " << descr->getSampling(0)
 		  << std::endl;
 	
-	m_calo_dd_man->cellsInZone(eta_min,eta_max,phi_min,phi_max,descr,cell_list);
+	caloDDMan->cellsInZone(eta_min,eta_max,phi_min,phi_max,descr,cell_list);
 	std::cout << " ==> found :" << cell_list.size() << " cells  " ;
 	if( cell_list.size() != 10 && cell_list.size() != 8 ) std::cout << " <----- ??? " ;      
 	std::cout << std::endl;
@@ -842,7 +858,12 @@ TestCaloDDE::try_each_descr_zone()
 }
 
 void
-TestCaloDDE::try_zone(double eta, double deta, double phi, double dphi, int sampling_or_module)
+TestCaloDDE::try_zone(double eta
+		      , double deta
+		      , double phi
+		      , double dphi
+		      , int sampling_or_module
+		      , const CaloDetDescrManager* caloDDMan)
 {
 
   ATH_MSG_INFO( "" );
@@ -873,13 +894,13 @@ TestCaloDDE::try_zone(double eta, double deta, double phi, double dphi, int samp
 	    << " sampling_or_module " << sampling_or_module
 	    << std::endl;
 
-  m_calo_dd_man->cellsInZone(eta_min,eta_max,phi_min,phi_max,
+  caloDDMan->cellsInZone(eta_min,eta_max,phi_min,phi_max,
 		     CaloCell_ID::LAREM,sampling_or_module,cell_list);
   //			    CaloCell_ID::LAREM,cell_list);
   //		cell_list );
 
   
-  //m_calo_dd_man->cellsInZone(eta,phi,5,5,CaloCell_ID::LAREM,
+  //caloDDMan->cellsInZone(eta,phi,5,5,CaloCell_ID::LAREM,
   //			     sampling_or_module,barrel,cell_list);
 
   std::cout << " ==> with Calo found :" << cell_list.size() 
@@ -889,7 +910,7 @@ TestCaloDDE::try_zone(double eta, double deta, double phi, double dphi, int samp
     {
       idhash = cell_list[i];
       id = help_em->channel_id(idhash);
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idhash); 
+      const CaloDetDescrElement* newelt = caloDDMan->get_element(idhash); 
       if ( !newelt ) std::cout << "  missing element" 
 			       << i << std::endl;
       /*
@@ -909,7 +930,9 @@ TestCaloDDE::try_zone(double eta, double deta, double phi, double dphi, int samp
 }
 
 void
-TestCaloDDE::where_am_I(double eta, double phi)
+TestCaloDDE::where_am_I(double eta
+			, double phi
+			, const CaloDetDescrManager* caloDDMan)
 {
   
   ATH_MSG_INFO ( "Executing TestCaloDDE : where am I ? eta, phi = " 
@@ -919,7 +942,7 @@ TestCaloDDE::where_am_I(double eta, double phi)
   const CaloDetDescriptor* descr;
 
   for (int nlay = 0 ; nlay<4; nlay++) {
-    descr = m_calo_dd_man->
+    descr = caloDDMan->
       get_descriptor(CaloCell_ID::LAREM,nlay,barrel,eta,phi);
     if(descr) std::cout << "barrel EM layer " <<  nlay 
 			<< std::endl;
@@ -928,20 +951,20 @@ TestCaloDDE::where_am_I(double eta, double phi)
   barrel = false;
 
   for (int nlay = 0 ; nlay<4; nlay++) {
-    descr = m_calo_dd_man->
+    descr = caloDDMan->
       get_descriptor(CaloCell_ID::LAREM,nlay,barrel,eta,phi);
     if(descr) std::cout << "endcap EM layer " <<  nlay 
 			<< std::endl;
   }
 
   for (int nlay = 0 ; nlay<4; nlay++) {
-    descr = m_calo_dd_man->
+    descr = caloDDMan->
       get_descriptor(CaloCell_ID::LARHEC,barrel,nlay,eta,phi);
     if(descr)  std::cout << "HEC layer " <<  nlay 
 			 << std::endl;
   }
   for (int nlay = 0 ; nlay<4; nlay++) {
-    descr = m_calo_dd_man->
+    descr = caloDDMan->
       get_descriptor(CaloCell_ID::LARFCAL,barrel,nlay,eta,phi);
     if(descr)  std::cout << "FCAL layer " <<  nlay 
 			 << std::endl;
@@ -950,7 +973,7 @@ TestCaloDDE::where_am_I(double eta, double phi)
 }
 
 void
-TestCaloDDE::read_volumes()
+TestCaloDDE::read_volumes(const CaloDetDescrManager* caloDDMan)
 {
   ATH_MSG_INFO ( "Executing TestCaloDDE : read_volumes " );
 
@@ -958,21 +981,17 @@ TestCaloDDE::read_volumes()
 
   
   std::cout << " subCaloHash = " << (unsigned int)caloHashId << " -------> got it !";
-  const CaloDetDescrElement* dde = m_calo_dd_man->get_element(caloHashId);
+  const CaloDetDescrElement* dde = caloDDMan->get_element(caloHashId);
   if (dde) 
     std::cout << dde->volume();
   std::cout << std::endl;
 }
 
-void
-TestCaloDDE::update()
-{
-  [[maybe_unused]]
-  Transform3D delta =  RotateZ3D(0.01);
-}
-
 void 
-TestCaloDDE::print_edges_via_SubCalo( CaloCell_ID::CaloSample sample, double eta, double phi )
+TestCaloDDE::print_edges_via_SubCalo(CaloCell_ID::CaloSample sample
+				     , double eta
+				     , double phi 
+				     , const CaloDetDescrManager* caloDDMan)
 {
   const LArEM_ID*    help_em = m_calo_id_man->getEM_ID();
 
@@ -981,19 +1000,19 @@ TestCaloDDE::print_edges_via_SubCalo( CaloCell_ID::CaloSample sample, double eta
   int sampling_or_module;
 
   std::cout << std::endl;
-  m_calo_dd_man->decode_sample (subcalo, barrel, sampling_or_module, sample);
+  caloDDMan->decode_sample (subcalo, barrel, sampling_or_module, sample);
   std::cout << " subcalo " << subcalo << " barrel " << barrel << " sampling_or_module "
 	    << sampling_or_module << " eta " << eta << " phi " << phi << std::endl;
 
   const CaloDetDescriptor* reg = 
-    m_calo_dd_man->get_descriptor (subcalo,sampling_or_module,barrel,eta,phi);
+    caloDDMan->get_descriptor (subcalo,sampling_or_module,barrel,eta,phi);
   if (!reg)
     std::cout << " no region for that value !" << std::endl;
   else
     help_em->print(reg->identify());
 
   const CaloDetDescrElement* newelt = 
-    m_calo_dd_man->get_element(subcalo,sampling_or_module, barrel, eta, phi);
+    caloDDMan->get_element(subcalo,sampling_or_module, barrel, eta, phi);
 
   if (newelt) {
     boost::io::ios_base_all_saver coutsave (std::cout);
@@ -1022,193 +1041,196 @@ TestCaloDDE::print_edges_via_SubCalo( CaloCell_ID::CaloSample sample, double eta
 }
 
 void
-TestCaloDDE::print_edges_via_SubCalo()
+TestCaloDDE::print_edges_via_SubCalo(const CaloDetDescrManager* caloDDMan)
 {
 
 
   std::cout << std::endl;
   std::cout << " ------------ PS -------------- " << std::endl;
 
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.55, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.53, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.52, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.48, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.47, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -0.1, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB,  0., 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 1.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 0.1, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 0.002854, 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.49, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.52, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.79, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.8, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.81, 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 2.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 2.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 2.6, 0.);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.55, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.53, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.52, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.48, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.47, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, -0.1, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB,  0., 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 1.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 0.1, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerB, 0.002854, 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.49, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.52, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.79, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.8, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, -1.81, 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 2.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 2.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::PreSamplerE, 2.6, 0.,caloDDMan);
 
   std::cout << std::endl;
   std::cout << " ------------ Strips -------------- " << std::endl;
 
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.48, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.47, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.41, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.39, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, -0.1, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, -0.01, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1,  0., 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1,  0.01, 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, 1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, 1.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, 1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, 1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, 1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, 0.1, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB1, 0.002854, 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::EME1, -1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, -1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, -1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, -1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, -2.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, -2.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, -2.6, 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.49, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.505, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.51, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.515, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.795, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.799, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.8, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.801, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.805, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.81, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.815, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.82, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 2.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 2.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME1, 2.6, 0.);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.48, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.47, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.41, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.39, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, -1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, -0.1, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, -0.01, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1,  0., 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1,  0.01, 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, 1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, 1.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, 1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, 1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, 1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, 0.1, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB1, 0.002854, 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::EME1, -1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, -1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, -1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, -1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, -2.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, -2.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, -2.6, 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.49, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.505, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.51, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.515, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.795, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.799, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.8, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.801, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.805, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.81, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.815, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 1.82, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 2.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 2.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME1, 2.6, 0.,caloDDMan);
 
 
   std::cout << std::endl;
   std::cout << " ------------ Middle -------------- " << std::endl;
 
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, -1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, -1.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, -1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, -1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, -1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, -0.1, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2,  0., 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, 1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, 1.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, 1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, 1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, 1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, 0.1, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, 0.002854, 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::EME2, -1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, -1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, -1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, -1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, -2.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, -2.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, -2.6, 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::EME2, 1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, 1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, 1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, 1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, 2.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, 2.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME2, 2.6, 0.);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, -1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, -1.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, -1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, -1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, -1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, -0.1, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2,  0., 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, 1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, 1.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, 1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, 1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, 1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, 0.1, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, 0.002854, 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::EME2, -1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, -1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, -1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, -1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, -2.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, -2.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, -2.6, 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::EME2, 1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, 1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, 1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, 1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, 2.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, 2.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME2, 2.6, 0.,caloDDMan);
 
   std::cout << std::endl;
   std::cout << " ------------ Back -------------- " << std::endl;
 
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, -1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, -1.36, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, -1.35, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, -1.34, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, -1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, -0.1, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3,  0., 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, 1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, 1.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, 1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, 1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, 1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB3, 0.1, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EMB2, 0.002854, 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.49, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.505, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.51, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, -2.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, -2.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, -2.6, 0.);
-
-  print_edges_via_SubCalo(CaloCell_ID::EME3, 1.3, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, 1.4, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, 1.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, 1.6, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, 2.45, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, 2.5, 0.);
-  print_edges_via_SubCalo(CaloCell_ID::EME3, 2.6, 0.);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, -1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, -1.36, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, -1.35, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, -1.34, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, -1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, -0.1, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3,  0., 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, 1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, 1.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, 1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, 1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, 1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB3, 0.1, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EMB2, 0.002854, 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.49, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.505, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.51, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, -1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, -2.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, -2.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, -2.6, 0.,caloDDMan);
+
+  print_edges_via_SubCalo(CaloCell_ID::EME3, 1.3, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, 1.4, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, 1.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, 1.6, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, 2.45, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, 2.5, 0.,caloDDMan);
+  print_edges_via_SubCalo(CaloCell_ID::EME3, 2.6, 0.,caloDDMan);
 
 }
 
 void 
-TestCaloDDE::print_edges_via_CaloSample( CaloCell_ID::CaloSample sample, double eta, double phi )
+TestCaloDDE::print_edges_via_CaloSample(CaloCell_ID::CaloSample sample
+					, double eta
+					, double phi 
+					, const CaloDetDescrManager* caloDDMan)
 {
   const LArEM_ID*    help_em = m_calo_id_man->getEM_ID();
 
   std::cout << " CaloCell_ID::CaloSample " << sample << " eta " << eta << " phi " << phi << std::endl;
 
   const CaloDetDescriptor* reg = 
-    m_calo_dd_man->get_descriptor (sample,eta,phi);
+    caloDDMan->get_descriptor (sample,eta,phi);
   if (!reg)
     std::cout << " no region for that value !" << std::endl;
   else
     help_em->print(reg->identify());
 
   const CaloDetDescrElement* newelt = 
-    m_calo_dd_man->get_element(sample, eta, phi);
+    caloDDMan->get_element(sample, eta, phi);
 
   if (newelt) {
     boost::io::ios_base_all_saver coutsave (std::cout);
@@ -1237,173 +1259,173 @@ TestCaloDDE::print_edges_via_CaloSample( CaloCell_ID::CaloSample sample, double
 }
 
 void
-TestCaloDDE::print_edges_via_CaloSample()
+TestCaloDDE::print_edges_via_CaloSample(const CaloDetDescrManager* caloDDMan)
 {
 
 
   std::cout << std::endl;
   std::cout << " ------------ PS -------------- " << std::endl;
 
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.55, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.53, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.52, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.48, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.47, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -0.1, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB,  0., 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 1.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 0.1, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 0.002854, 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.49, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.52, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.79, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.8, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.81, 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 2.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 2.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 2.6, 0.);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.55, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.53, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.52, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.48, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.47, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, -0.1, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB,  0., 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 1.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 0.1, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerB, 0.002854, 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.49, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.52, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.79, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.8, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, -1.81, 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 2.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 2.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::PreSamplerE, 2.6, 0.,caloDDMan);
 
   std::cout << std::endl;
   std::cout << " ------------ Strips -------------- " << std::endl;
 
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.48, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.47, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.41, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.39, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, -0.1, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, -0.01, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1,  0., 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1,  0.01, 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, 1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, 1.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, 1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, 1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, 1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, 0.1, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB1, 0.002854, 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::EME1, -1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, -1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, -1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, -1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, -2.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, -2.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, -2.6, 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.49, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.505, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.51, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.515, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.795, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.799, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.8, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.801, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.805, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.81, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.815, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.82, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 2.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 2.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME1, 2.6, 0.);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.48, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.47, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.41, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.39, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, -1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, -0.1, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, -0.01, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1,  0., 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1,  0.01, 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, 1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, 1.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, 1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, 1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, 1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, 0.1, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB1, 0.002854, 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::EME1, -1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, -1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, -1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, -1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, -2.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, -2.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, -2.6, 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.49, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.505, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.51, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.515, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.795, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.799, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.8, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.801, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.805, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.81, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.815, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 1.82, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 2.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 2.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME1, 2.6, 0.,caloDDMan);
 
 
   std::cout << std::endl;
   std::cout << " ------------ Middle -------------- " << std::endl;
 
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, -1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, -1.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, -1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, -1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, -1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, -0.1, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2,  0., 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, 1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, 1.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, 1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, 1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, 1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, 0.1, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB2, 0.002854, 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::EME2, -1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, -1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, -1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, -1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, -2.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, -2.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, -2.6, 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::EME2, 1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, 1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, 1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, 1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, 2.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, 2.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME2, 2.6, 0.);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, -1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, -1.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, -1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, -1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, -1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, -0.1, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2,  0., 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, 1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, 1.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, 1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, 1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, 1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, 0.1, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB2, 0.002854, 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::EME2, -1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, -1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, -1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, -1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, -2.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, -2.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, -2.6, 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::EME2, 1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, 1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, 1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, 1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, 2.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, 2.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME2, 2.6, 0.,caloDDMan);
 
   std::cout << std::endl;
   std::cout << " ------------ Back -------------- " << std::endl;
 
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, -1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, -1.36, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, -1.35, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, -1.34, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, -1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, -0.1, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3,  0., 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, 1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, 1.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, 1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, 1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, 1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, 0.1, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EMB3, 0.002854, 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.49, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.505, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.51, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, -2.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, -2.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, -2.6, 0.);
-
-  print_edges_via_CaloSample(CaloCell_ID::EME3, 1.3, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, 1.4, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, 1.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, 1.6, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, 2.45, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, 2.5, 0.);
-  print_edges_via_CaloSample(CaloCell_ID::EME3, 2.6, 0.);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, -1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, -1.36, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, -1.35, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, -1.34, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, -1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, -0.1, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3,  0., 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, 1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, 1.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, 1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, 1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, 1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, 0.1, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EMB3, 0.002854, 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.49, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.505, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.51, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, -1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, -2.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, -2.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, -2.6, 0.,caloDDMan);
+
+  print_edges_via_CaloSample(CaloCell_ID::EME3, 1.3, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, 1.4, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, 1.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, 1.6, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, 2.45, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, 2.5, 0.,caloDDMan);
+  print_edges_via_CaloSample(CaloCell_ID::EME3, 2.6, 0.,caloDDMan);
 
 }
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.h b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.h
new file mode 100755
index 000000000000..e0decd0892ca
--- /dev/null
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloDDE.h
@@ -0,0 +1,72 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TESTLARDETDESCR_TESTCALODDE_H
+#define TESTLARDETDESCR_TESTCALODDE_H
+
+/**
+ * @file   TestCaloDDE.h 
+ *
+ * @author Claire Adam-Bourdarios
+ *
+ * @date   Feb 2003
+ *
+ * @brief  Example of retreiving CaloDetDescr manager either from
+ *           DetStore or from CondStore
+ */
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
+#include "CaloIdentifier/CaloCell_ID.h"
+#include "StoreGate/ReadCondHandleKey.h"
+
+class CaloIdManager;
+class ICaloRecoMaterialTool;
+class ICaloRecoSimpleGeomTool;
+class CaloPhiRange;
+
+class TestCaloDDE : public AthAlgorithm
+{
+ public:
+  TestCaloDDE(const std::string& name, ISvcLocator* pSvcLocator);
+  virtual ~TestCaloDDE();
+  
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+  virtual StatusCode execute() override;
+
+ private:
+  void print_subcalo(CaloCell_ID::CaloSample sample, const CaloDetDescrManager* caloDDMan);
+  void print_eta_line(int phi_num, bool em, bool hec, bool fcal, const CaloDetDescrManager* caloDDMan);
+  void print_phi_line(int eta_num, bool em, bool hec, bool fcal, const CaloDetDescrManager* caloDDMan);
+  void print_elt_HW(bool em, bool hec, bool fcal, const CaloDetDescrManager* caloDDMan);
+  void try_zone(const CaloDetDescrManager* caloDDMan);
+  void try_each_descr_zone(const CaloDetDescrManager* caloDDMan);
+  void try_zone(double eta, double deta, double phi, double dphi, int sampling_or_module, const CaloDetDescrManager* caloDDMan);
+  void read_volumes(const CaloDetDescrManager* caloDDMan);
+  void where_am_I(double eta, double phi, const CaloDetDescrManager* caloDDMan);
+  void print_edges_via_CaloSample(CaloCell_ID::CaloSample sample, double eta, double phi, const CaloDetDescrManager* caloDDMan);
+  void print_edges_via_SubCalo(CaloCell_ID::CaloSample sample, double eta, double phi, const CaloDetDescrManager* caloDDMan);
+  void print_edges_via_CaloSample(const CaloDetDescrManager* caloDDMan);
+  void print_edges_via_SubCalo(const CaloDetDescrManager* caloDDMan);
+  
+  const CaloIdManager*  m_calo_id_man{nullptr};
+  const CaloDetDescrManager*  m_calo_dd_man{nullptr};
+
+  // Simplified geometry :
+  ICaloRecoMaterialTool* m_lar_mat{nullptr};
+  ICaloRecoSimpleGeomTool* m_lar_simplegeom{nullptr};
+
+  BooleanProperty m_useCondStore { this
+      , "UseCondStore"
+      , true
+      , "Get CaloDetDescrManage from Condition Store. If FALSE, then use Detector Store"};
+
+  SG::ReadCondHandleKey<CaloDetDescrManager> m_readCondKey { this
+      , "CaloDetDescrManager"
+      , "CaloDetDescrManager"
+      , "SG Key for CaloDetDescrManager in the Condition Store" };
+};
+
+#endif
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/src/components/TestLArDetDescr_entries.cxx b/LArCalorimeter/LArExample/TestLArDetDescr/src/components/TestLArDetDescr_entries.cxx
index 2bc683dceefc..c58a60e36827 100644
--- a/LArCalorimeter/LArExample/TestLArDetDescr/src/components/TestLArDetDescr_entries.cxx
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/components/TestLArDetDescr_entries.cxx
@@ -1,4 +1,4 @@
-#include "TestLArDetDescr/TestCaloDDE.h"
+#include "../TestCaloDDE.h"
 #include "TestLArDetDescr/TestCaloGeom.h"
 #include "TestLArDetDescr/TestLArTT.h"
 #include "TestLArDetDescr/TestLArMaterial.h"
diff --git a/LArCalorimeter/LArGeoModel/LArGeoCode/src/LArAlignHelper.cxx b/LArCalorimeter/LArGeoModel/LArGeoCode/src/LArAlignHelper.cxx
index 1881de9df73a..f5cabf018cb1 100644
--- a/LArCalorimeter/LArGeoModel/LArGeoCode/src/LArAlignHelper.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoCode/src/LArAlignHelper.cxx
@@ -126,13 +126,16 @@ StatusCode LArAlignHelper::applyAlignments(const ServiceHandle<StoreGateSvc>& de
   } // Loop over Align Names
 
   // Fill the caches of Full Physical Volumes
-  for(const std::string& alignName : m_alignNames) {
-    if(detStore->contains<StoredPhysVol>(alignName)) {
-      StoredPhysVol* storedPV{nullptr};
-      if(detStore->retrieve(storedPV,alignName).isSuccess()) {
-	storedPV->getPhysVol()->getAbsoluteTransform(alignmentStore);
-	storedPV->getPhysVol()->getDefAbsoluteTransform(alignmentStore);
-      }
+  //
+  // !!! NB! The code assumes that StoredPhysVol-s are used only by LAr
+  //         This has been true ever since the StorePhysVol-s were invented.
+  //
+  for(const std::string& key : detStore->keys<StoredPhysVol>()) {
+    StoredPhysVol* storedPV = detStore->tryRetrieve<StoredPhysVol>(key);
+    ATH_MSG_DEBUG("Building position caches for StoredPhysVol :" << key);
+    if(storedPV) {
+      storedPV->getPhysVol()->getAbsoluteTransform(alignmentStore);
+      storedPV->getPhysVol()->getDefAbsoluteTransform(alignmentStore);
     }
   }
 
diff --git a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
index 19062382ec95..3ab4c8034a6d 100644
--- a/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
+++ b/LArCalorimeter/LArRecUtils/share/LArFCalTowerBuilderTool.ref
@@ -256,6 +256,7 @@ AthenaEventLoopMgr   INFO   ===>>>  start processing event #1, run #1 0 events p
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[0,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[0,t:0,l:0] - [INVALID]}
 test1
 towers
 0 1 1 0 
diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref
index 6a42730e8134..2e4170b04ab8 100644
--- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref
+++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTest.ref
@@ -316,6 +316,7 @@ IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[0,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[0,t:0,l:0] - [INVALID]}
 LArOnOffMappingAlg   INFO Done reading online/offline identifier mapping
 LArOnOffMappingAlg   INFO Found 195072 online identifier and 182468 offline identifier. 12604 disconnected channels.
 LArOnOffMappingAlg   INFO recorded new LArOnOffIdMap with range {[0,l:0] - [INVALID]} into Conditions Store
diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref
index cca5bbb998e3..0ce252e6f8e5 100644
--- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref
+++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestReadNoReg.ref
@@ -341,6 +341,7 @@ IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[0,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[0,t:0,l:0] - [INVALID]}
 LArOnOffMappingAlg   INFO Done reading online/offline identifier mapping
 LArOnOffMappingAlg   INFO Found 195072 online identifier and 182468 offline identifier. 12604 disconnected channels.
 LArOnOffMappingAlg   INFO recorded new LArOnOffIdMap with range {[0,l:0] - [INVALID]} into Conditions Store
diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref
index 10582ca7bbcc..3a796ff5a31e 100644
--- a/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref
+++ b/LArCalorimeter/LArTest/LArConditionsTest/share/LArConditionsTestWriteNoReg.ref
@@ -318,6 +318,7 @@ IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
 IOVDbSvc             INFO Opening COOL connection for COOLOFL_LAR/OFLP200
 IOVDbSvc             INFO Disconnecting from COOLOFL_LAR/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[0,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[0,t:0,l:0] - [INVALID]}
 LArOnOffMappingAlg   INFO Done reading online/offline identifier mapping
 LArOnOffMappingAlg   INFO Found 195072 online identifier and 182468 offline identifier. 12604 disconnected channels.
 LArOnOffMappingAlg   INFO recorded new LArOnOffIdMap with range {[0,l:0] - [INVALID]} into Conditions Store
diff --git a/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref b/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref
index a5ad105a8e95..d54438e3888d 100644
--- a/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileCellBuilderFromHit_test.ref
@@ -371,6 +371,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[0,l:0] - [177530,l:0]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[0,t:0,l:0] - [177530,l:0]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
diff --git a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref
index 4cdbe4bdbbac..0e83aa8c7662 100644
--- a/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileCellBuilder_test.ref
@@ -399,6 +399,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[0,l:0] - [177530,l:0]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[0,t:0,l:0] - [177530,l:0]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
diff --git a/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref b/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref
index 78f684fc3a12..113fbde39579 100644
--- a/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileDQstatusAlg_test.ref
@@ -382,6 +382,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[0,l:0] - [177530,l:0]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[0,t:0,l:0] - [177530,l:0]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
diff --git a/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref b/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref
index 5c35995271cd..b9220e152fc5 100644
--- a/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileDQstatusTool_test.ref
@@ -381,6 +381,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[0,l:0] - [177530,l:0]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[0,t:0,l:0] - [177530,l:0]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
diff --git a/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref b/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref
index 958c78f4c8dd..68d3dbcb2386 100644
--- a/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref
+++ b/TileCalorimeter/TileRecUtils/share/TileRawChannelBuilder_test.ref
@@ -390,6 +390,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[0,l:0] - [177530,l:0]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[0,t:0,l:0] - [177530,l:0]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref
index 7f3400f98d79..632a76b268be 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamCnv_test.ref
@@ -399,6 +399,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[177530,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[177530,t:0,l:0] - [INVALID]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
@@ -978,7 +979,7 @@ TileSampleNoiseCon...TileCondProxyCool_NoiseSample           0    INFO Creating
 TileTimingCondAlg.TileCondProxyCool_AdcOffset                0    INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
 ThreadPoolSvc                                                0    INFO no thread init tools attached
 AvalancheSchedulerSvc                                        0    INFO Activating scheduler in a separate thread
-AvalancheSchedulerSvc                                        0    INFO Found 15 algorithms
+AvalancheSchedulerSvc                                        0    INFO Found 16 algorithms
 AvalancheSchedulerSvc                                        0    INFO Will attribute the following unmet INPUT dependencies to "SGInputLoader/SGInputLoader" Algorithm
 AvalancheSchedulerSvc                                        0    INFO    o  ( 'TileBeamElemContainer' , 'StoreGateSvc+TileBeamElemCnt' )     required by Algorithm: 
 AvalancheSchedulerSvc                                        0    INFO        * TileBeamElemCntDumper
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref
index f90a19acaf88..85f2dcf4eaaa 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamCnv_test.ref
@@ -399,6 +399,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[177530,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[177530,t:0,l:0] - [INVALID]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
@@ -980,7 +981,7 @@ TileSampleNoiseCon...TileCondProxyCool_NoiseSample           0    INFO Creating
 TileTimingCondAlg.TileCondProxyCool_AdcOffset                0    INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
 ThreadPoolSvc                                                0    INFO no thread init tools attached
 AvalancheSchedulerSvc                                        0    INFO Activating scheduler in a separate thread
-AvalancheSchedulerSvc                                        0    INFO Found 16 algorithms
+AvalancheSchedulerSvc                                        0    INFO Found 17 algorithms
 AvalancheSchedulerSvc                                        0    INFO Will attribute the following unmet INPUT dependencies to "SGInputLoader/SGInputLoader" Algorithm
 AvalancheSchedulerSvc                                        0    INFO    o  ( 'TileDigitsContainer' , 'StoreGateSvc+MuRcvDigitsCnt' )     required by Algorithm: 
 AvalancheSchedulerSvc                                        0    INFO        * MuRcvDigitsCntDumper
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref
index 69e33589492d..d8b3323ad507 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamCnv_test.ref
@@ -399,6 +399,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[177530,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[177530,t:0,l:0] - [INVALID]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
@@ -979,7 +980,7 @@ TileSampleNoiseCon...TileCondProxyCool_NoiseSample           0    INFO Creating
 TileTimingCondAlg.TileCondProxyCool_AdcOffset                0    INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
 ThreadPoolSvc                                                0    INFO no thread init tools attached
 AvalancheSchedulerSvc                                        0    INFO Activating scheduler in a separate thread
-AvalancheSchedulerSvc                                        0    INFO Found 15 algorithms
+AvalancheSchedulerSvc                                        0    INFO Found 16 algorithms
 AvalancheSchedulerSvc                                        0    INFO Will attribute the following unmet INPUT dependencies to "SGInputLoader/SGInputLoader" Algorithm
 AvalancheSchedulerSvc                                        0    INFO    o  ( 'TileL2Container' , 'StoreGateSvc+TileL2Cnt' )     required by Algorithm: 
 AvalancheSchedulerSvc                                        0    INFO        * TileL2CntDumper
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref
index 3e11d019d361..26b40af40449 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamCnv_test.ref
@@ -398,6 +398,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[177530,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[177530,t:0,l:0] - [INVALID]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
@@ -976,7 +977,7 @@ TileSampleNoiseCon...TileCondProxyCool_NoiseSample           0    INFO Creating
 TileTimingCondAlg.TileCondProxyCool_AdcOffset                0    INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
 ThreadPoolSvc                                                0    INFO no thread init tools attached
 AvalancheSchedulerSvc                                        0    INFO Activating scheduler in a separate thread
-AvalancheSchedulerSvc                                        0    INFO Found 15 algorithms
+AvalancheSchedulerSvc                                        0    INFO Found 16 algorithms
 AvalancheSchedulerSvc                                        0    INFO Will attribute the following unmet INPUT dependencies to "SGInputLoader/SGInputLoader" Algorithm
 AvalancheSchedulerSvc                                        0    INFO    o  ( 'TileLaserObject' , 'StoreGateSvc+TileLaserObj' )     required by Algorithm: 
 AvalancheSchedulerSvc                                        0    INFO        * TileLaserObjectDumper
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref
index 801324481b41..dcccc5fd1675 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamCnv_test.ref
@@ -399,6 +399,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[177530,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[177530,t:0,l:0] - [INVALID]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
@@ -980,7 +981,7 @@ TileSampleNoiseCon...TileCondProxyCool_NoiseSample           0    INFO Creating
 TileTimingCondAlg.TileCondProxyCool_AdcOffset                0    INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
 ThreadPoolSvc                                                0    INFO no thread init tools attached
 AvalancheSchedulerSvc                                        0    INFO Activating scheduler in a separate thread
-AvalancheSchedulerSvc                                        0    INFO Found 15 algorithms
+AvalancheSchedulerSvc                                        0    INFO Found 16 algorithms
 AvalancheSchedulerSvc                                        0    INFO Will attribute the following unmet INPUT dependencies to "SGInputLoader/SGInputLoader" Algorithm
 AvalancheSchedulerSvc                                        0    INFO    o  ( 'TileMuonReceiverContainer' , 'StoreGateSvc+TileMuRcvCnt' )     required by Algorithm: 
 AvalancheSchedulerSvc                                        0    INFO        * TileMuonReceiverDumper
diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref
index a4584d006c83..eca4e071e70a 100644
--- a/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref
+++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamCnv_test.ref
@@ -399,6 +399,7 @@ IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02Stat
 IOVDbFolder          INFO HVS tag OFLCOND-RUN12-SDR-35 resolved to TileOfl02TimeChanneloffsetPhy-000-00 for folder /TILE/OFL02/TIME/CHANNELOFFSET/PHY
 IOVDbSvc             INFO Disconnecting from COOLOFL_TILE/OFLP200
 LArAlignCondAlg      INFO recorded new GeoAlignmentStore object for LAr with key LArAlignmentStore and range {[177530,l:0] - [INVALID]}
+CaloAlignCondAlg     INFO recorded new CaloDetDescr Manager condition object with key CaloDetDescrManager and range {[177530,t:0,l:0] - [INVALID]}
 TileBadChannels...   INFO Updating TileBchStatus::isBad() definition from DB
 TileBadChannels...   INFO Updating TileBchStatus::isNoisy() definition from DB
 TileBadChannels...   INFO No TileBchStatus::isNoGainL1() definition found in DB, using defaults
@@ -980,7 +981,7 @@ TileSampleNoiseCon...TileCondProxyCool_NoiseSample           0    INFO Creating
 TileTimingCondAlg.TileCondProxyCool_AdcOffset                0    INFO Creating TileCondProxyCool(TileTimingCondAlg.TileCondProxyCool_AdcOffset) for folder: "/TILE/OFL02/TIME/CHANNELOFFSET/PHY"
 ThreadPoolSvc                                                0    INFO no thread init tools attached
 AvalancheSchedulerSvc                                        0    INFO Activating scheduler in a separate thread
-AvalancheSchedulerSvc                                        0    INFO Found 16 algorithms
+AvalancheSchedulerSvc                                        0    INFO Found 17 algorithms
 AvalancheSchedulerSvc                                        0    INFO Will attribute the following unmet INPUT dependencies to "SGInputLoader/SGInputLoader" Algorithm
 AvalancheSchedulerSvc                                        0    INFO    o  ( 'TileRawChannelContainer' , 'StoreGateSvc+MuRcvRawChCnt' )     required by Algorithm: 
 AvalancheSchedulerSvc                                        0    INFO        * MuRcvRawChannelCntDumper
-- 
GitLab


From a56b2a5838d5650ec65743036e2b4ceca03a2e9b Mon Sep 17 00:00:00 2001
From: Daniele Zanzi <daniele.zanzi@cern.ch>
Date: Fri, 24 Sep 2021 17:24:20 +0200
Subject: [PATCH 314/347] Add capability to remap/remove L1 item/thresholds +
 addition of extra version of jXE (ATR-24037)

---
 .../TrigConfData/L1TopoAlgorithm.h            |  6 +++-
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    |  2 ++
 .../share/ref_v1Dev_decodeBS_build.ref        |  2 ++
 .../python/HLTMenuConfig/Menu/LS2_v1.py       |  3 ++
 .../python/L1/Base/L1MenuFlags.py             |  2 ++
 .../TriggerMenuMT/python/L1/Config/ItemDef.py |  1 +
 .../python/L1/Config/ThresholdDef.py          | 22 ++++++------
 .../L1/Config/TopoAlgoDefMultiplicity.py      |  4 ++-
 .../python/L1/Menu/MenuMapping.py             | 11 +++---
 .../python/L1/Menu/Menu_MC_pp_v8.py           |  7 ++--
 .../python/L1/Menu/Menu_MC_pp_v8_inputs.py    | 30 +++++++++++++++-
 .../python/L1/Menu/Menu_Physics_pp_v8.py      | 34 +++++++++++++++++++
 12 files changed, 102 insertions(+), 22 deletions(-)
 create mode 100644 Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_v8.py

diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h
index de316d6b40d1..58e525e42409 100644
--- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h
+++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1TopoAlgorithm.h
@@ -124,7 +124,9 @@ namespace TrigConf {
           gXE     = 7, 
           gXERHO  = 8, 
           gXEPUFIT = 9, 
-          gTE     = 10 };
+          gTE     = 10,
+          jXEPerf = 11, // Only for simulation studies!
+      };
 
       static std::string flavourIntToStr(const unsigned int flavInt){
           if(flavInt==int(FLAV::jXE))     return "jXE";
@@ -138,6 +140,7 @@ namespace TrigConf {
           if(flavInt==int(FLAV::gXERHO))  return "gXERHO";
           if(flavInt==int(FLAV::gXEPUFIT)) return "gXEPUFIT";
           if(flavInt==int(FLAV::gTE))     return "gTE";
+          if(flavInt==int(FLAV::jXEPerf))     return "jXEPerf";
           throw std::runtime_error("Flavour " + std::to_string(flavInt) + " for EnergyThreshold algorithm not recongnised!");
       };
       static unsigned int flavourStrToInt(const std::string & flavStr){
@@ -152,6 +155,7 @@ namespace TrigConf {
           if(flavStr=="gXERHO")  return int(FLAV::gXERHO);
           if(flavStr=="gXEPUFIT") return int(FLAV::gXEPUFIT);
           if(flavStr=="gTE")     return int(FLAV::gTE);
+          if(flavStr=="jXEPerf")     return int(FLAV::jXEPerf);
           throw std::runtime_error("Flavour " + flavStr + " for EnergyThreshold algorithm not recongnised!");
       };
 
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index 0e88d27d3698..a1e298695f04 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -9861,6 +9861,8 @@ HLT_noalg_L1jXE55:
   eventCount: 0
 HLT_noalg_L1jXEC50:
   eventCount: 0
+HLT_noalg_L1jXEPerf50:
+  eventCount: 0
 HLT_noalg_LArPEBCalib_L1LAR-ZEE:
   eventCount: 1
   stepCounts:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 4b4286137886..3a210656b56d 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -4025,6 +4025,8 @@ HLT_noalg_L1jXE55:
   eventCount: 0
 HLT_noalg_L1jXEC50:
   eventCount: 0
+HLT_noalg_L1jXEPerf50:
+  eventCount: 0
 HLT_noalg_LArPEBCalib_L1LAR-ZEE:
   eventCount: 0
 HLT_noalg_LArPEBCalib_L1RD0_BGRP11:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 24fa7bfbc0f5..ad3aaa7ab165 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -1378,6 +1378,9 @@ def setupMenu():
         ChainProp(name='HLT_noalg_L1jTEFWDA100',    l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
         ChainProp(name='HLT_noalg_L1jTEFWDC100',    l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
 
+        # ATR-24037
+        ChainProp(name='HLT_noalg_L1jXEPerf50',     l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=METPhaseIStreamersGroup),
+
     ]
 
     TriggerFlags.MonitorSlice.signatures   = TriggerFlags.MonitorSlice.signatures() + [
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py
index 8d50cb2ac757..981ed530f425 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/L1MenuFlags.py
@@ -47,6 +47,8 @@ class L1MenuFlagsCont(object):
         "prescales"               :  FlagArgs( dict, dict() ),
         "RemapThresholdsAsListed" :  FlagArgs( bool, False ),
         "CtpIdMap"                :  FlagArgs( dict, dict() ),
+        "ThresholdMap"            :  FlagArgs( dict, dict() ),
+        "ItemMap"                 :  FlagArgs( dict, dict() ),
     }
 
     def __setattr__(self, attr, value):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
index ada283f89266..e3d70ab815a6 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ItemDef.py
@@ -701,6 +701,7 @@ class ItemDef:
         MenuItem('L1_jXE300').setLogic( d.jXE300 & physcond).setTriggerType(TT.calo)
 
         MenuItem('L1_jXEC50' ).setLogic( d.jXEC50 & physcond).setTriggerType(TT.calo)
+        MenuItem('L1_jXEPerf50' ).setLogic( d.jXEPerf50 & physcond).setTriggerType(TT.calo)
 
         # phase1 TE
         MenuItem('L1_gTE50'      ).setLogic( d.gTE50 & physcond).setTriggerType(TT.calo)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py
index 22ba33e3a492..b131de63e1d0 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/ThresholdDef.py
@@ -108,23 +108,19 @@ class ThresholdDef:
         # eEM 
         for thrV in [3, 5, 8, 15, 20, 22]:
             #eEMThreshold('eEM%i' % thrV, 'eEM').addThrValue(thrV)
-            ThresholdDef.addVaryingThrValues( eEMThreshold(  'eEM%i'% thrV,  'eEM'), pt=thrV,  shift_set = 1 )
+            ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM%i'% thrV, 'eEM'), pt = thrV, shift_set = 1 )
 
         # L section (used to be VH in Run2)
-        ThresholdDef.addVaryingThrValues( eEMThreshold(  'eEM8L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=8,  shift_set = 1 ) 
-        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM10L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=10, shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM15L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=15, shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM20L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=20, shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM22L',  'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ),    pt=22, shift_set = 1 )
+        for thrV in [8,10,15,20,22]:
+            ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM%iL' % thrV, 'eEM').setIsolation( reta = "Loose", wstot = "Loose", rhad = "Loose" ), pt = thrV, shift_set = 1 )
 
         # M section (used to be VHI in Run2)
-        ThresholdDef.addVaryingThrValues( eEMThreshold(  'eEM8M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=8,  shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM15M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=15, shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM20M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=20, shift_set = 1 )
-        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM22M',  'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt=22, shift_set = 1 )
+        for thrV in [8,15,20,22]:
+            ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM%iM' % thrV, 'eEM').setIsolation( reta = "Medium", wstot = "Medium", rhad = "Medium" ), pt = thrV, shift_set = 1 )
 
         # T section (used to be VHIM in Run2)
-        ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM22T',  'eEM').setIsolation( reta = "Tight", wstot = "Tight", rhad = "Tight" ),    pt=22, shift_set = 1 )
+        for thrV in [22]:
+            ThresholdDef.addVaryingThrValues( eEMThreshold( 'eEM%iT' % thrV, 'eEM').setIsolation( reta = "Tight", wstot = "Tight", rhad = "Tight" ), pt= thrV, shift_set = 1 )
 
         # jEM
         for thrV in [15]:
@@ -194,6 +190,10 @@ class ThresholdDef:
         for thrV in [50]:
             XEThreshold('jXEC%i' % thrV, 'jXE').setXE(thrV)
 
+        # ATR-24037
+        for thrV in [50]:
+            XEThreshold('jXEPerf%i' % thrV, 'jXE').setXE(thrV)
+
         # jTE
         for thrV in [100,]:
             TEThreshold('jTE%i' % thrV, 'jTE').setTE(thrV)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py
index cd7875459e21..3c442317de57 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TopoAlgoDefMultiplicity.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 AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
@@ -143,6 +143,8 @@ class TopoAlgoDefMultiplicity(object):
 
             'jXEC50', 'jTE100', 'jTEC100', 'jTEFWD100', 'jTEFWDA100', 'jTEFWDC100', 
             'gTE50',
+
+            'jXEPerf50',
         ]
 
         for XE in XEThresholds:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/MenuMapping.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/MenuMapping.py
index 739f7a2e4b02..163616bbdc9d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/MenuMapping.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/MenuMapping.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
 
 """
 This map specifies with menu to load from TriggerMenuMT/python/L1/Menu
@@ -8,18 +8,17 @@ The resolved name is also being used in the L1/Config/ItemDef.py and L1/Config/T
 """
 
 menuMap = {
-    "Physics_pp_v7"        : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
-    "LS2_v1"               : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
-    "Physics_pp_run3_v1"   : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
+    "Physics_pp_run3_v1"   : ["Physics_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
+    "PhysicsP1_pp_run3_v1" : ["Physics_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
+    "Physics_pp_v8"        : ["Physics_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
     "MC_pp_run3_v1"        : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
     "MC_pp_v8"             : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
-    "Physics_pp_v8"        : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
     "Cosmic_run3_v1"       : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
     "Physics_HI_v4"        : ["MC_HI_v1","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
     "MC_HI_v4"             : ["MC_HI_v1","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
-    "PhysicsP1_pp_run3_v1" : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
     "PhysicsP1_HI_run3_v1" : ["MC_HI_v1","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
     "Dev_HI_run3_v1"       : ["MC_HI_v1","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
+    "LS2_v1"               : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
     "LS2_v1_Primary_prescale"           : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
     "LS2_v1_TriggerValidation_prescale" : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
     "LS2_v1_BulkMCProd_prescale"        : ["MC_pp_v8","MC_pp_v8_inputs","MC_pp_v8_inputs_legacy"],
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
index 34ba3365448e..e0676e0d4e23 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8.py
@@ -1,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
 #
 # Run this file in order to print out the empty slots
 
@@ -175,7 +175,10 @@ def defineMenu():
 
         'L1_jXE30', 'L1_jXE35', 'L1_jXE40', 'L1_jXE50', 'L1_jXE55', 'L1_jXE300', 
         'L1_jXEC50', 'L1_jTE100', 'L1_jTEC100', 'L1_jTEFWD100', 'L1_jTEFWDA100', 'L1_jTEFWDC100',
-                
+           
+        # ATR-24037 
+        'L1_jXEPerf50', 
+    
         # RNDM
         'L1_RD0_FILLED', 'L1_RD0_UNPAIRED_ISO',  'L1_RD0_EMPTY', 'L1_RD0_ABORTGAPNOTCALIB',
         'L1_RD0_FIRSTEMPTY', 'L1_RD0_BGRP11',
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
index edb8177f42f8..ddbaf0093461 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_MC_pp_v8_inputs.py
@@ -139,7 +139,7 @@ def defineInputsMenu():
 
             ('jXE30',1), ('jXE35',1), ('jXE40',1), ('jXE50',1), ('jXE55',1), ('jXE300',1),
             # test thresholds
-            ('jXEC50',1),
+            ('jXEC50',1), ('jXEPerf50',1),
             ('jTE100',1), ('jTEC100',1), ('jTEFWD100',1), ('jTEFWDA100',1), ('jTEFWDC100',1)
         ]
     })
@@ -385,3 +385,31 @@ def defineInputsMenu():
     L1MenuFlags.boards().update( ctpinBoards )  # CTPIN/Slot9 NIM1, NIM2, CALREQ
 
     L1MenuFlags.boards().update( alfaBoard )  # ALFA
+
+    #----------------------------------------------
+
+    def remapThresholds():
+        # remap thresholds. TODO: add checks in case the remap does not fulfill HW constraints?
+        for boardName, boardDef in L1MenuFlags.boards().items():
+            if "connectors" in boardDef:
+                for c in boardDef["connectors"]:
+                    if "thresholds" in c:
+                        thresholdsToRemove = []
+                        for thrIndex, thrName in enumerate(c["thresholds"]):
+                            nBits = 0
+                            if type(thrName)==tuple:
+                                (thrName,nBits) = thrName
+                            if thrName in L1MenuFlags.ThresholdMap():
+                                if (L1MenuFlags.ThresholdMap()[thrName] != ''):
+                                    if nBits > 0:
+                                        c["thresholds"][thrIndex] = (L1MenuFlags.ThresholdMap()[thrName],nBits)
+                                    else:
+                                        c["thresholds"][thrIndex] = L1MenuFlags.ThresholdMap()[thrName]
+                                else:
+                                    thresholdsToRemove.append(thrIndex) 
+                        for i in reversed(thresholdsToRemove):
+                            del c["thresholds"][i]
+          
+    #----------------------------------------------
+
+    remapThresholds()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_v8.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_v8.py
new file mode 100644
index 000000000000..ca4a61a0d64d
--- /dev/null
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Menu/Menu_Physics_pp_v8.py
@@ -0,0 +1,34 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+def defineMenu():
+
+    import TriggerMenuMT.L1.Menu.Menu_MC_pp_v8 as mc_menu
+    from TriggerMenuMT.L1.Base.L1MenuFlags import L1MenuFlags
+
+    mc_menu.defineMenu()
+
+    L1MenuFlags.ThresholdMap = {
+        # Do not use for L1Topo decision threshold!
+        'jXEPerf50' :'',
+    }
+
+    L1MenuFlags.ItemMap = {
+        'L1_jXEPerf50':'', 
+    } 
+
+    #----------------------------------------------
+    def remapItems():  
+        itemsToRemove = []
+        for itemIndex, itemName in enumerate(L1MenuFlags.items()):
+            if (itemName in L1MenuFlags.ItemMap()):
+                if (L1MenuFlags.ItemMap()[itemName] != ''):
+                    L1MenuFlags.items()[itemIndex] = L1MenuFlags.ItemMap()[itemName]                                                
+                else: 
+                    itemsToRemove.append(itemIndex)
+
+        for i in reversed(itemsToRemove):
+            del L1MenuFlags.items()[i]
+    #----------------------------------------------
+                                           
+    remapItems()
+
-- 
GitLab


From 0f6532283ff88d608c238cf365c3b283712f22bd Mon Sep 17 00:00:00 2001
From: Liaoshan Shi <liaoshan.shi@cern.ch>
Date: Fri, 24 Sep 2021 17:27:00 +0200
Subject: [PATCH 315/347] Online event display updates from M9 tests

---
 .../EventDisplaysOnline/python/EventUtils.py  | 27 ++++++++++---------
 .../python/OnlineEventDisplaysSvc.py          | 11 +++++---
 .../share/EventDisplay_jobOptions.py          |  4 +++
 3 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/graphics/EventDisplaysOnline/python/EventUtils.py b/graphics/EventDisplaysOnline/python/EventUtils.py
index 89f09777b939..f2cf52187e2b 100644
--- a/graphics/EventDisplaysOnline/python/EventUtils.py
+++ b/graphics/EventDisplaysOnline/python/EventUtils.py
@@ -5,13 +5,14 @@ import os, re, time
 # This method reads the files in the given directory, sorts them by run/event number,
 # finds atlantis and vp1 files belonging to the same event and returns a list of events
 # and their corresponing files: (event, run, atlantis, vp1)
-def getEventlist(msg, directory):
+# is removeunpaired=True, remove the files that do not form an atlanits-vp1 pair
+def getEventlist(msg, directory, removeunpaired):
 	filelist = []
 	files = os.listdir(directory)
 
 	# Build a list of files ordered by run/event number
 	for file in files:
-		matches = re.search(r'(?:JiveXML|vp1)_(\d+)_(\d+)(?:\.xml|_.+\.pool\.root)', file)
+		matches = re.search(r'(?:JiveXML|vp1)_(?:|r)(\d+)_(?:|ev)(\d+)(?:\.xml|_.+\.pool\.root)', file)
 
 		# Event file, add tot the list
 		if matches:
@@ -43,19 +44,19 @@ def getEventlist(msg, directory):
 
 	# Now loop through the files to form pairs
 	while i < numfiles-1:
-		#if filelist[i][0] != filelist[i+1][0] or filelist[i][1] != filelist[i+1][1]:
+		if removeunpaired and (filelist[i][0] != filelist[i+1][0] or filelist[i][1] != filelist[i+1][1]):
 
 			# Make sure that files without a partner (atlantis-vp1) are also removed
-		#	if i == 0:
-		#		msg.warning("One of the files is missing for run %s, event %s, removing the other as well." % (filelist[i][0], filelist[i][1]))
-		#		try:
-		#			os.unlink("%s/%s" % (directory, filelist[i][2]))
-		#		except OSError as err:
-		#			msg.warning("Could not remove '%s': %s" % (filelist[i][2], err))
+			if i == 0:
+				msg.warning("One of the files is missing for run %s, event %s, removing the other as well.", filelist[i][0], filelist[i][1])
+				try:
+					os.unlink("%s/%s" % (directory, filelist[i][2]))
+				except OSError as err:
+					msg.warning("Could not remove '%s': %s", filelist[i][2], err)
 
 			# Do not include such files in the list for atlas-live.cern.ch
-		#	i = i + 1
-		#else:
+			i = i + 1
+		else:
 			# Build list for atlas-live.cern.ch
 			evententry = filelist[i][0], filelist[i][1], filelist[i][2], filelist[i+1][2]
 			eventlist.append(evententry)
@@ -100,8 +101,8 @@ def writeEventlist(msg, directory, eventlist):
 		msg.warning("Could not rename event.%d to event.list: %s", pid, err)
 
 # Perform all of these in one command
-def cleanDirectory(msg, directory, maxevents):
-	eventlist = getEventlist(msg, directory)
+def cleanDirectory(msg, directory, maxevents, removeunpaired):
+	eventlist = getEventlist(msg, directory, removeunpaired)
 	if maxevents:
 		pruneEvents(msg, directory, maxevents, eventlist)
 	writeEventlist(msg, directory, eventlist)
diff --git a/graphics/EventDisplaysOnline/python/OnlineEventDisplaysSvc.py b/graphics/EventDisplaysOnline/python/OnlineEventDisplaysSvc.py
index 8a8d621eabed..d9c236542e5c 100644
--- a/graphics/EventDisplaysOnline/python/OnlineEventDisplaysSvc.py
+++ b/graphics/EventDisplaysOnline/python/OnlineEventDisplaysSvc.py
@@ -164,7 +164,8 @@ class OnlineEventDisplaysSvc( PyAthena.Svc ):
 			self.StreamToFileTool.getProperty('FileNamePrefix').setValue("%s/JiveXML" % self.directory)
 
 			# And also for the VP1 event producer algorithm
-			#self.VP1EventProducer.getProperty('DestinationDirectory').setValue(self.directory) # lshi June 22 2020
+			if self.VP1EventProducer:
+				self.VP1EventProducer.getProperty('DestinationDirectory').setValue(self.directory)
 		except Exception as err:
 			self.msg.error("Exception occured while setting job options: %s", err)
 			return StatusCode.Failure
@@ -175,9 +176,11 @@ class OnlineEventDisplaysSvc( PyAthena.Svc ):
 	def endEvent(self):
 		# Prune events and make index file for atlas-live.cern.ch
 		if self.directory:
-			# Hack for missing VP1 files, create an empty file to make cleanup/sync work
-			#open("%s/vp1_%d_%d_0.pool.root" % (self.directory, self.run, self.event), 'a').close()
-			EventUtils.cleanDirectory(self.msg, self.directory, self.maxevents)
+			# If VP1 event producer is missing, skip the pair check to make cleanup/sync work
+			if self.VP1EventProducer:
+				EventUtils.cleanDirectory(self.msg, self.directory, self.maxevents, removeunpaired=True)
+			else:
+				EventUtils.cleanDirectory(self.msg, self.directory, self.maxevents, removeunpaired=False)
 
 		# And cleanup the variables
 		self.run = 0
diff --git a/graphics/EventDisplaysOnline/share/EventDisplay_jobOptions.py b/graphics/EventDisplaysOnline/share/EventDisplay_jobOptions.py
index f5209113885b..c4d700d62321 100644
--- a/graphics/EventDisplaysOnline/share/EventDisplay_jobOptions.py
+++ b/graphics/EventDisplaysOnline/share/EventDisplay_jobOptions.py
@@ -42,6 +42,10 @@ streamLogic       = 'Or'#HAS TO BE OR AT ALL TIMES WHEN SPECIFYING A CERTAIN STR
 
 useAtlantisEmon   = False
 
+# Set a unique group name for ED jobs so that: Events are distributed between ED jobs with the same groupName
+# and shared between different (non ED) groups.
+groupName         = "EventDisplaysOnline"
+
 
 ## ------------------------------------------- flags set in: RecExOnline_emonsvc.py (from RecExOnline_jobOptions.py)                    
 publishName     = 'EventDisplays'
-- 
GitLab


From abc0c732844f80a457c57683f54d0770e255f5e9 Mon Sep 17 00:00:00 2001
From: Zvi Tarem <zvi.tarem@cern.ch>
Date: Fri, 24 Sep 2021 17:31:17 +0200
Subject: [PATCH 316/347] Create and fill an sTGC Pad Trigger RDO container in
 SG

---
 .../NSW_PadTriggerDataContainerCnv_p1.cxx     | 17 ++++--
 .../src/PadTrig_ROD_Decoder.cxx               | 43 +++++++-------
 .../MuonRDO/MuonRDO/NSW_PadTriggerData.h      | 23 ++++++--
 .../MuonRDO/NSW_PadTriggerDataContainer.h     |  3 +-
 .../MuonRDO/src/NSW_PadTriggerData.cxx        | 36 +++++++++--
 .../src/NSW_PadTriggerDataContainer.cxx       | 10 ++--
 Trigger/TrigT1/TrigT1NSW/share/NSWL1.py       |  6 +-
 .../TrigT1/TrigT1NSW/src/NSWL1Simulation.cxx  | 33 +++++++++--
 .../TrigT1/TrigT1NSW/src/NSWL1Simulation.h    |  7 ++-
 .../TrigT1NSWSimTools/PadTriggerAdapter.h     | 21 +++++++
 .../src/PadTriggerAdapter.cxx                 | 59 +++++++++++++++++++
 .../src/PadTriggerLookupTool.cxx              |  3 +
 12 files changed, 209 insertions(+), 52 deletions(-)
 create mode 100644 Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerAdapter.h
 create mode 100644 Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerAdapter.cxx

diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/NSW_PadTriggerDataContainerCnv_p1.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/NSW_PadTriggerDataContainerCnv_p1.cxx
index 1539f78b4549..8bd2eee4842c 100644
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/NSW_PadTriggerDataContainerCnv_p1.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/src/MuonRDO/NSW_PadTriggerDataContainerCnv_p1.cxx
@@ -9,8 +9,15 @@ void NSW_PadTriggerDataContainerCnv_p1::persToTrans(const NSW_PadTriggerDataCont
     for (const auto& pCollection : persistentObj->m_collections) {
         std::array<std::vector<uint16_t>, 3> persistent_hitlists{ pCollection.m_precedingHitlist, pCollection.m_currentHitlist, pCollection.m_followingHitlist };
         // Can initialize here with std::move(persistent_hitlists) and modify the transient constructor accordingly
-        auto tCollection = std::make_unique<NSW_PadTriggerData>(pCollection.m_identifierHash, pCollection.m_sectorID,
-            pCollection.m_sectorSize, pCollection.m_endcap, pCollection.m_BCID, pCollection.m_L1ID, persistent_hitlists);
+        auto tCollection = std::make_unique<NSW_PadTriggerData>(
+            pCollection.m_identifierHash,
+            pCollection.m_sectorID,
+            static_cast<NSW_PadTriggerData::SectorSize>(pCollection.m_sectorSize),
+            static_cast<NSW_PadTriggerData::Endcap>(pCollection.m_endcap),
+            pCollection.m_BCID,
+            pCollection.m_L1ID,
+            persistent_hitlists);
+
         tCollection->reserve(pCollection.m_segments.size());
         for (std::size_t i{}; i < pCollection.m_segments.size(); i++) {
             tCollection->push_back(m_segmentConverter.createTransient(&pCollection.m_segments.at(i), log));
@@ -31,14 +38,14 @@ void NSW_PadTriggerDataContainerCnv_p1::transToPers(const NSW_PadTriggerDataCont
     }
     persistentObj->m_collections.reserve(transientObj->size());
     // Iterate over collections
-    for (const Muon::NSW_PadTriggerData* tCollection : *transientObj) {
+    for (const auto& tCollection : *transientObj) {
         NSW_PadTriggerData_p1 pCollection{};
         pCollection.m_segments.reserve(tCollection->size());
 
         pCollection.m_identifierHash = tCollection->identifierHash();
         pCollection.m_sectorID = tCollection->sectorID();
-        pCollection.m_sectorSize = tCollection->sectorSize();
-        pCollection.m_endcap = tCollection->endcap();
+        pCollection.m_sectorSize = static_cast<uint8_t>(tCollection->sectorSize());
+        pCollection.m_endcap = static_cast<uint8_t>(tCollection->endcap());
         pCollection.m_BCID = tCollection->BCID();
         pCollection.m_L1ID = tCollection->L1ID();
         
diff --git a/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/PadTrig_ROD_Decoder.cxx b/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/PadTrig_ROD_Decoder.cxx
index 78599be7923b..a95752ff7623 100644
--- a/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/PadTrig_ROD_Decoder.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/PadTrig_ROD_Decoder.cxx
@@ -12,14 +12,14 @@ namespace Muon {
 
 //=====================================================================
 PadTrig_ROD_Decoder::PadTrig_ROD_Decoder(const std::string& type, const std::string& name, const IInterface* parent)
-: AthAlgTool(type, name, parent) 
+: AthAlgTool(type, name, parent)
 {
   declareInterface<IPadTrig_ROD_Decoder>(this);
 }
 
 
 //=====================================================================
-StatusCode PadTrig_ROD_Decoder::fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment& fragment, NSW_PadTriggerDataContainer& rdo) const 
+StatusCode PadTrig_ROD_Decoder::fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment& fragment, NSW_PadTriggerDataContainer& rdo) const
 {
   try {
     fragment.check();
@@ -27,7 +27,7 @@ StatusCode PadTrig_ROD_Decoder::fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE
     ATH_MSG_ERROR(ex.what());
     return StatusCode::FAILURE;
   }
-  
+
   eformat::helper::SourceIdentifier sourceID{fragment.rob_source_id()};
 
   // FIXME this hash calculation MUST be done in an IdHelper!
@@ -42,20 +42,20 @@ StatusCode PadTrig_ROD_Decoder::fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE
     ATH_MSG_ERROR("Collection ID " << hashID << " already found in RDO container, skipping");
     return StatusCode::FAILURE;
   }
-  
+
   OFFLINE_FRAGMENTS_NAMESPACE::PointerType data{};
   fragment.rod_data(data);
   if (!data) {
     ATH_MSG_WARNING("No data found for this ROBFragment, skipping");
     return StatusCode::FAILURE;
   }
-  
+
   // TODO better error handling?
   return parseBytestream(data, fragment.rod_ndata(), rdo, hashID);
 }
 
 //=====================================================================
-StatusCode PadTrig_ROD_Decoder::parseBytestream(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, std::size_t size, NSW_PadTriggerDataContainer& rdo, const IdentifierHash hashID) const 
+StatusCode PadTrig_ROD_Decoder::parseBytestream(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, std::size_t size, NSW_PadTriggerDataContainer& rdo, const IdentifierHash hashID) const
 {
   // Refer to:
   // https://espace.cern.ch/ATLAS-NSW-ELX/Shared%20Documents/Pad%20Trigger/PadTrig_Raw_Format.pdf
@@ -72,7 +72,7 @@ StatusCode PadTrig_ROD_Decoder::parseBytestream(OFFLINE_FRAGMENTS_NAMESPACE::Poi
     ATH_MSG_ERROR("Corrupted ROBFragment, skipping! Expected " << EXPECTED_SIZE << " words, got " << size);
     return StatusCode::FAILURE;
   }
-  
+
   const uint16_t bcid       = (extractByte(data, 2) >> 4 & 0xf) << 8 | extractByte(data, 3);
   const uint32_t l1id       = __builtin_bswap32(data[3]);
   const uint8_t  endcap     = (data[2] & (0b1 << 7)) ? 1 : 0; // 1 = Endcap A, 0 = Endcap C
@@ -98,11 +98,12 @@ StatusCode PadTrig_ROD_Decoder::parseBytestream(OFFLINE_FRAGMENTS_NAMESPACE::Poi
     if (observedHits != (hitMultiplicity & 0xfff)) {
       ATH_MSG_WARNING("Expected " << static_cast<uint32_t>(hitMultiplicity & 0xfff) << " set bits, observed " << observedHits);
     }
-    
+
     byteIndex += BITMAP_SIZE;
   }
-  
-  auto collection = new NSW_PadTriggerData{ hashID, sectorID, sectorSize, endcap, bcid, l1id, hitAddresses};
+
+  auto collection = new NSW_PadTriggerData{ hashID, sectorID, static_cast<NSW_PadTriggerData::SectorSize>(sectorSize),
+                                           static_cast<NSW_PadTriggerData::Endcap>(endcap), bcid, l1id, hitAddresses};
 
   // Status word length
   byteIndex += 2;
@@ -118,7 +119,7 @@ StatusCode PadTrig_ROD_Decoder::parseBytestream(OFFLINE_FRAGMENTS_NAMESPACE::Poi
 
 
 //=====================================================================
-std::vector<uint16_t> PadTrig_ROD_Decoder::parseBitmap(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, std::size_t byteIndex, std::size_t& hitCount, bool isSmallSector) const 
+std::vector<uint16_t> PadTrig_ROD_Decoder::parseBitmap(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, std::size_t byteIndex, std::size_t& hitCount, bool isSmallSector) const
 {
   std::vector<uint16_t> addressList{};
   constexpr std::size_t PFEB_COUNT = 24;
@@ -127,16 +128,16 @@ std::vector<uint16_t> PadTrig_ROD_Decoder::parseBitmap(OFFLINE_FRAGMENTS_NAMESPA
 
   size_t Nchannels{85}; // default value
   for (std::size_t pfeb{}; pfeb < PFEB_COUNT; pfeb++) {
-  
+
     // pFEBs are sent in reverse order: last pFEB (pFEB23) sent first
     auto& currentBitmap = bitmaps[PFEB_COUNT - pfeb - 1];
 
-    // Size of the current pFEB bitmap   
+    // Size of the current pFEB bitmap
     if (m_channelMapping) Nchannels = isSmallSector ? SMALL_PFEB_SIZES[PFEB_COUNT - pfeb - 1] : LARGE_PFEB_SIZES[PFEB_COUNT - pfeb - 1];
-    
+
     for (std::size_t channel{}; channel < Nchannels; channel++)
       currentBitmap.push_back(extractBit(data, byteIndex * 8 + (bitOffset + channel) + 8));
-    
+
     bitOffset += currentBitmap.size();
   }
 
@@ -161,7 +162,7 @@ std::vector<uint16_t> PadTrig_ROD_Decoder::parseBitmap(OFFLINE_FRAGMENTS_NAMESPA
       chOffset += bitmaps[pfeb].size();
       continue;
     }
-    
+
     for (std::size_t ch{}; ch < bitmaps[pfeb].size(); ch++) {
       if (bitmaps[pfeb][ch]) {
         // TODO The address is a simple running counter for now.
@@ -176,12 +177,12 @@ std::vector<uint16_t> PadTrig_ROD_Decoder::parseBitmap(OFFLINE_FRAGMENTS_NAMESPA
 
 
 //=====================================================================
-void PadTrig_ROD_Decoder::parseSegments(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, std::size_t byteIndex, NSW_PadTriggerData& collection) const 
+void PadTrig_ROD_Decoder::parseSegments(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, std::size_t byteIndex, NSW_PadTriggerData& collection) const
 {
   // Refer to:
   // https://espace.cern.ch/ATLAS-NSW-ELX/Shared%20Documents/Pad%20Trigger/Pad_to_TP_data_format.pdf
   // const uint16_t bcidAndFlags = extractByte(data, byteIndex) << 8 | extractByte(data, byteIndex + 1);
- 
+
   // TODO compare BCID with one found in header? Do something with flags?
   //const uint8_t flags = (bcidAndFlags & 0xf000) >> 12;
   //const uint16_t bcid = bcidAndFlags & 0xfff;
@@ -194,7 +195,7 @@ void PadTrig_ROD_Decoder::parseSegments(OFFLINE_FRAGMENTS_NAMESPACE::PointerType
     if (bandID == 0xff) {
       continue;
     }
-    
+
     // FIXME phiID currently bit-packed (6 bits * 4), should be 8 bits * 4?
     const uint8_t phiID = extractByte(data, byteIndex + 4 + i);
     const auto wedge0ActiveLayers = extractByte(data, byteIndex + 8);
@@ -210,7 +211,7 @@ void PadTrig_ROD_Decoder::parseSegments(OFFLINE_FRAGMENTS_NAMESPACE::PointerType
 
 
 //=====================================================================
-bool PadTrig_ROD_Decoder::extractBit(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, std::size_t index) const 
+bool PadTrig_ROD_Decoder::extractBit(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, std::size_t index) const
 {
   // Swap to big endian, as we're dealing with a contiguous bit vector
   const uint32_t word = __builtin_bswap32(data[index / 32]);
@@ -221,7 +222,7 @@ bool PadTrig_ROD_Decoder::extractBit(OFFLINE_FRAGMENTS_NAMESPACE::PointerType da
 
 
 //=====================================================================
-uint8_t PadTrig_ROD_Decoder::extractByte(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, std::size_t index) const 
+uint8_t PadTrig_ROD_Decoder::extractByte(OFFLINE_FRAGMENTS_NAMESPACE::PointerType data, std::size_t index) const
 {
   // Swap to big endian, so byte extracted will match the byte at the given index in the contiguous packet
   const uint32_t word = data[index / 4];
diff --git a/MuonSpectrometer/MuonRDO/MuonRDO/NSW_PadTriggerData.h b/MuonSpectrometer/MuonRDO/MuonRDO/NSW_PadTriggerData.h
index 30ecd4c35723..a1d17512d62a 100644
--- a/MuonSpectrometer/MuonRDO/MuonRDO/NSW_PadTriggerData.h
+++ b/MuonSpectrometer/MuonRDO/MuonRDO/NSW_PadTriggerData.h
@@ -14,26 +14,37 @@ namespace Muon {
 class NSW_PadTriggerData : public DataVector<NSW_PadTriggerSegment> {
 using hitlist_t = std::vector<uint16_t>;
 public:
-    NSW_PadTriggerData(IdentifierHash identifierHash, uint8_t sectorID, uint8_t sectorSize, uint8_t endcap,
+    enum class Endcap : uint8_t { C = 0, A = 1 };
+    enum class SectorSize : uint8_t { SMALL = 0, LARGE = 1 };
+
+    NSW_PadTriggerData(IdentifierHash identifierHash, uint8_t sectorID, SectorSize sectorSize, Endcap endcap,
         uint32_t BCID, uint32_t L1ID, const std::array<hitlist_t, 3>& hitlists);
     IdentifierHash identifierHash() const;
 
     std::string string() const;
 
     uint8_t sectorID() const noexcept;
-    uint8_t sectorSize() const noexcept;
-    uint8_t endcap() const noexcept;
+    SectorSize sectorSize() const noexcept;
+    Endcap endcap() const noexcept;
     uint32_t BCID() const noexcept;
     uint32_t L1ID() const noexcept;
+
+    void sectorID(uint8_t sectorID) noexcept;
+    void sectorSize(SectorSize sectorSize) noexcept;
+    void endcap(Endcap endcap) noexcept;
+    void BCID(uint32_t BCID) noexcept;
+    void L1ID(uint32_t L1ID) noexcept;
+    void hitlists(const std::array<hitlist_t, 3>& hitlists);
     const std::array<hitlist_t, 3>& hitlists() const;
 
     friend std::ostream& operator<<(std::ostream& stream, const NSW_PadTriggerData& rhs);
     friend MsgStream& operator<<(MsgStream& stream, const NSW_PadTriggerData& rhs);
+
 private:
     IdentifierHash m_identifierHash;
     uint8_t m_sectorID;
-    uint8_t m_sectorSize;
-    uint8_t m_endcap;
+    SectorSize m_sectorSize;
+    Endcap m_endcap;
     uint32_t m_BCID;
     uint32_t m_L1ID;
     // List of pad hits, in a 3BC window around the L1A BC
@@ -41,4 +52,4 @@ private:
 };
 } // namespace Muon
 
-#endif // MUONRDO_NSW_PADTRIGGERDATA
\ No newline at end of file
+#endif // MUONRDO_NSW_PADTRIGGERDATA
diff --git a/MuonSpectrometer/MuonRDO/MuonRDO/NSW_PadTriggerDataContainer.h b/MuonSpectrometer/MuonRDO/MuonRDO/NSW_PadTriggerDataContainer.h
index ac296b6f6a0e..ee76fb0cb8df 100644
--- a/MuonSpectrometer/MuonRDO/MuonRDO/NSW_PadTriggerDataContainer.h
+++ b/MuonSpectrometer/MuonRDO/MuonRDO/NSW_PadTriggerDataContainer.h
@@ -14,6 +14,7 @@
 namespace Muon {
 class NSW_PadTriggerDataContainer : public IdentifiableContainer<NSW_PadTriggerData> {
 public:
+    static constexpr std::size_t HASH_MAX{32};
     NSW_PadTriggerDataContainer();
     NSW_PadTriggerDataContainer(unsigned int hashMax);
     
@@ -29,4 +30,4 @@ public:
 
 CLASS_DEF( Muon::NSW_PadTriggerDataContainer , 1176278125 , 1 )
 
-#endif // MUONRDO_NSW_PADTRIGGERRAWDATACONTAINER
\ No newline at end of file
+#endif // MUONRDO_NSW_PADTRIGGERRAWDATACONTAINER
diff --git a/MuonSpectrometer/MuonRDO/src/NSW_PadTriggerData.cxx b/MuonSpectrometer/MuonRDO/src/NSW_PadTriggerData.cxx
index 99fc260c411a..1cc2f2359d6b 100644
--- a/MuonSpectrometer/MuonRDO/src/NSW_PadTriggerData.cxx
+++ b/MuonSpectrometer/MuonRDO/src/NSW_PadTriggerData.cxx
@@ -1,8 +1,8 @@
 #include "MuonRDO/NSW_PadTriggerData.h"
 
 namespace Muon {
-NSW_PadTriggerData::NSW_PadTriggerData(IdentifierHash identifierHash, uint8_t sectorID, uint8_t sectorSize,
-    uint8_t endcap, uint32_t BCID, uint32_t L1ID, const std::array<hitlist_t, 3>& hitlists)
+NSW_PadTriggerData::NSW_PadTriggerData(IdentifierHash identifierHash, uint8_t sectorID, SectorSize sectorSize,
+    Endcap endcap, uint32_t BCID, uint32_t L1ID, const std::array<hitlist_t, 3>& hitlists)
     : m_identifierHash(identifierHash), m_sectorID(sectorID), m_sectorSize(sectorSize), m_endcap(endcap), m_BCID(BCID),
         m_L1ID(L1ID), m_hitlists(hitlists) { }
 
@@ -20,11 +20,11 @@ uint8_t NSW_PadTriggerData::sectorID() const noexcept {
     return m_sectorID;
 }
 
-uint8_t NSW_PadTriggerData::sectorSize() const noexcept {
+NSW_PadTriggerData::SectorSize NSW_PadTriggerData::sectorSize() const noexcept {
     return m_sectorSize;
 }
 
-uint8_t NSW_PadTriggerData::endcap() const noexcept {
+NSW_PadTriggerData::Endcap NSW_PadTriggerData::endcap() const noexcept {
     return m_endcap;
 }
 
@@ -36,6 +36,32 @@ uint32_t NSW_PadTriggerData::L1ID() const noexcept {
     return m_L1ID;
 }
 
+void NSW_PadTriggerData::sectorID(uint8_t sectorID) noexcept {
+    m_sectorID = sectorID;
+}
+
+void NSW_PadTriggerData::sectorSize(NSW_PadTriggerData::SectorSize sectorSize) noexcept {
+    m_sectorSize = sectorSize;
+}
+
+void NSW_PadTriggerData::endcap(NSW_PadTriggerData::Endcap endcap) noexcept {
+    m_endcap = endcap;
+}
+
+void NSW_PadTriggerData::BCID(uint32_t BCID) noexcept {
+    m_BCID = BCID;
+}
+
+void NSW_PadTriggerData::L1ID(uint32_t L1ID) noexcept {
+    m_L1ID = L1ID;
+}
+
+void NSW_PadTriggerData::hitlists(const std::array<hitlist_t, 3>& hitlists) {
+    // Can be optimized w/ taking param by value - depends on use case
+    m_hitlists = hitlists;
+}
+
+
 const std::array<NSW_PadTriggerData::hitlist_t, 3>& NSW_PadTriggerData::hitlists() const {
     return m_hitlists;
 }
@@ -48,4 +74,4 @@ MsgStream& operator<<(MsgStream& stream, const NSW_PadTriggerData& rhs) {
     return stream << rhs.string();
 }
 
-} // namespace Muon
\ No newline at end of file
+} // namespace Muon
diff --git a/MuonSpectrometer/MuonRDO/src/NSW_PadTriggerDataContainer.cxx b/MuonSpectrometer/MuonRDO/src/NSW_PadTriggerDataContainer.cxx
index 4030d0697908..4628520d6c80 100644
--- a/MuonSpectrometer/MuonRDO/src/NSW_PadTriggerDataContainer.cxx
+++ b/MuonSpectrometer/MuonRDO/src/NSW_PadTriggerDataContainer.cxx
@@ -3,23 +3,23 @@
 namespace Muon {
 
 NSW_PadTriggerDataContainer::NSW_PadTriggerDataContainer()
-    : IdentifiableContainer<NSW_PadTriggerData>(0) { }
+    : IdentifiableContainer<NSW_PadTriggerData>(HASH_MAX) { }
 
-NSW_PadTriggerDataContainer::NSW_PadTriggerDataContainer(unsigned int hashMax) 
+NSW_PadTriggerDataContainer::NSW_PadTriggerDataContainer(unsigned int hashMax)
     : IdentifiableContainer<NSW_PadTriggerData>(hashMax) { }
-    
+
 const CLID& NSW_PadTriggerDataContainer::classID() {
     return ClassID_traits<NSW_PadTriggerDataContainer>::ID();
 }
 
 const CLID& NSW_PadTriggerDataContainer::clID() const {
-    return classID();    
+    return classID();
 }
 
 std::string NSW_PadTriggerDataContainer::string() const {
     std::stringstream sstream{};
     sstream << "Number of collections: " << numberOfCollections() << ". Contains collections: " << std::endl;
-    for (const auto* collection : *this) {
+    for (const auto& collection : *this) {
         sstream << collection->string() << std::endl;
     }
     return sstream.str();
diff --git a/Trigger/TrigT1/TrigT1NSW/share/NSWL1.py b/Trigger/TrigT1/TrigT1NSW/share/NSWL1.py
index 753b5e96e3d2..394d2dde9d07 100644
--- a/Trigger/TrigT1/TrigT1NSW/share/NSWL1.py
+++ b/Trigger/TrigT1/TrigT1NSW/share/NSWL1.py
@@ -29,10 +29,10 @@ else:
 ###################################################
 from AthenaCommon.DetFlags import DetFlags
 DetFlags.detdescr.Muon_setOn()
-DetFlags.sTGC_setOff()
+DetFlags.sTGC_setOn()
 DetFlags.Micromegas_setOn()
 DetFlags.digitize.Micromegas_setOn()
-DetFlags.digitize.sTGC_setOff()
+DetFlags.digitize.sTGC_setOn()
 DetFlags.Truth_setOn()
 DetFlags.Print()
 
@@ -55,7 +55,7 @@ svcMgr += Muon__MuonIdHelperSvc("MuonIdHelperSvc",HasCSC=MuonGeometryFlags.hasCS
 include('TrigT1NSW/TrigT1NSW_jobOptions.py')
 
 #Switch on and off trigger simulaton components sTGC / MicroMegas
-topSequence.NSWL1Simulation.DosTGC=False
+topSequence.NSWL1Simulation.DosTGC=True
 topSequence.NSWL1Simulation.UseLookup=False #use lookup table for the pad trigger
 topSequence.NSWL1Simulation.DoMM=True
 topSequence.NSWL1Simulation.DoMMDiamonds=True
diff --git a/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.cxx b/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.cxx
index e465f8a5bb62..8b6100dd61a5 100644
--- a/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.cxx
+++ b/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.cxx
@@ -41,7 +41,7 @@ namespace NSWL1 {
     declareProperty( "DoMM",         m_doMM         = true,  "Run data analysis for MM" );
     declareProperty( "DoMMDiamonds", m_doMMDiamonds = false, "Run data analysis for MM using Diamond Roads algorithm" );
     declareProperty( "DosTGC",       m_dosTGC       = false, "Run data analysis for sTGCs" );
-    
+
     // declare monitoring tools
     declareProperty( "AthenaMonTools",          m_monitors,           "List of monitoring tools to be run with this instance, if incorrect then tool is silently skipped.");
     declareProperty( "PadTdsTool",              m_pad_tds,            "Tool that simulates the functionalities of the PAD TDS");
@@ -54,12 +54,13 @@ namespace NSWL1 {
     declareProperty( "MMStripTdsTool",          m_mmstrip_tds,        "Tool that simulates the functionalities of the MM STRIP TDS");
     declareProperty( "MMTriggerTool",           m_mmtrigger,          "Tool that simulates the MM Trigger");
     declareProperty( "NSWTrigRDOContainerName", m_trigRdoContainer = "NSWTRGRDO"," Give a name to NSW trigger rdo container");
+    declareProperty( "PadTriggerRDOName",       m_padTriggerRdoKey = "NSWPADTRGRDO", "Name of the pad trigger RDO");
   }
 
 
   StatusCode NSWL1Simulation::initialize() {
     ATH_MSG_INFO( "initialize " << name() );
-    ATH_CHECK( m_trigRdoContainer.initialize() );    
+    ATH_CHECK( m_trigRdoContainer.initialize() );
     // Create an register the ntuple if requested, add branch for event and run number
     if ( m_doNtuple ) {
       ITHistSvc* tHistSvc;
@@ -91,8 +92,9 @@ namespace NSWL1 {
       ATH_CHECK(m_strip_tds.retrieve());
       //ATH_CHECK(m_strip_cluster.retrieve());
       //ATH_CHECK(m_strip_segment.retrieve());
+      ATH_CHECK(m_padTriggerRdoKey.initialize());
     }
-    
+
     if(m_doMM ){
       ATH_CHECK(m_mmtrigger.retrieve());
     }
@@ -134,11 +136,16 @@ namespace NSWL1 {
       else{
           ATH_CHECK( m_pad_trigger->compute_pad_triggers(pads, padTriggers) );
       }
-     
+
       ATH_CHECK( m_strip_tds->gather_strip_data(strips,padTriggers) );
       //ATH_CHECK( m_strip_cluster->cluster_strip_data(strips,clusters) );
       //ATH_CHECK( m_strip_segment->find_segments(clusters,trgContainer) );
-      
+
+      auto padTriggerRdoHandle = SG::makeHandle(m_padTriggerRdoKey);
+      auto padTriggerContainer = std::make_unique<Muon::NSW_PadTriggerDataContainer>();
+      ATH_CHECK(PadTriggerAdapter::fillContainer(padTriggerContainer, padTriggers, m_current_evt));
+      ATH_CHECK(padTriggerRdoHandle.record(std::move(padTriggerContainer)));
+
       auto rdohandle = SG::makeHandle( m_trigRdoContainer );
       ATH_CHECK( rdohandle.record( std::move(trgContainer)));
     }
@@ -152,6 +159,22 @@ namespace NSWL1 {
     }
     if (m_tree) m_tree->Fill();
 
+    // Dump content of the pad trigger collection
+    if (m_dosTGC)
+    {
+      const Muon::NSW_PadTriggerDataContainer* padTriggerContainer;
+      ATH_CHECK(evtStore()->retrieve(padTriggerContainer, m_padTriggerRdoKey.key()));
+      ATH_MSG_DEBUG("Pad Trigger Container size: " << padTriggerContainer->size());
+      for (const auto &padTriggerData : *padTriggerContainer)
+      {
+        ATH_MSG_DEBUG("  " << *padTriggerData);
+        for (const auto & padTriggerSegment : *padTriggerData)
+        {
+          ATH_MSG_DEBUG("    " << *padTriggerSegment);
+        }
+      }
+    }
+
     return StatusCode::SUCCESS;
   }
 
diff --git a/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.h b/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.h
index 119a2dc270be..7a50dd57c665 100644
--- a/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.h
+++ b/Trigger/TrigT1/TrigT1NSW/src/NSWL1Simulation.h
@@ -22,7 +22,12 @@
 #include "TrigT1NSWSimTools/IPadTriggerLogicTool.h"
 #include "TrigT1NSWSimTools/IPadTriggerLookupTool.h"
 
+#include "MuonRDO/NSW_PadTriggerDataContainer.h"
+#include "TrigT1NSWSimTools/PadTriggerAdapter.h"
+
 // Forward includes
+class StoreGateSvc;
+class IMonitorToolBase;
 class TTree;
 
 
@@ -93,7 +98,7 @@ namespace NSWL1 {
     
     protected:
     SG::WriteHandleKey<Muon::NSW_TrigRawDataContainer> m_trigRdoContainer;
-    
+    SG::WriteHandleKey<Muon::NSW_PadTriggerDataContainer> m_padTriggerRdoKey;
 
   };  // end of NSWL1Simulation class
 
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerAdapter.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerAdapter.h
new file mode 100644
index 000000000000..92951b66c372
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/PadTriggerAdapter.h
@@ -0,0 +1,21 @@
+#ifndef TRIGT1NSWSIMTOOLS_PADTRIGGERADAPTER_H
+#define TRIGT1NSWSIMTOOLS_PADTRIGGERADAPTER_H
+
+#include "MuonRDO/NSW_PadTriggerData.h"
+#include "MuonRDO/NSW_PadTriggerDataContainer.h"
+#include "MuonRDO/NSW_PadTriggerSegment.h"
+#include "TrigT1NSWSimTools/PadTrigger.h"
+
+namespace NSWL1{
+namespace PadTriggerAdapter {
+// Convert a single simulated pad trigger segment to the RDO version of a pad trigger segment.
+Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger& data);
+
+// Fill a pad trigger data container with data from a vector of pad trigger segments.
+// If the container isn't empty, new data is simply appended to it.
+StatusCode fillContainer(const std::unique_ptr<Muon::NSW_PadTriggerDataContainer>& out,
+    const std::vector<std::unique_ptr<NSWL1::PadTrigger>>& triggers, const uint32_t l1id);
+} // namespace NSWL1
+} // namespace PadTriggerAdapter
+
+#endif // TRIGT1NSWSIMTOOLS_PADTRIGGERADAPTER_H
\ No newline at end of file
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerAdapter.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerAdapter.cxx
new file mode 100644
index 000000000000..b95452e7a898
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerAdapter.cxx
@@ -0,0 +1,59 @@
+#include "TrigT1NSWSimTools/PadTriggerAdapter.h"
+
+namespace NSWL1 {
+namespace PadTriggerAdapter {
+Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger& data) {
+    return Muon::NSW_PadTriggerSegment{
+        static_cast<uint8_t>(data.bandId()),
+        static_cast<uint8_t>(data.phiId()),
+        {static_cast<uint8_t>(data.trgSelectedLayersInner().size()),
+        static_cast<uint8_t>(data.trgSelectedLayersOuter().size())}
+    };
+}
+
+// TODO should probably be a tool, and then we can retrieve event data from
+// evtStore
+StatusCode
+fillContainer(const std::unique_ptr<Muon::NSW_PadTriggerDataContainer> &out,
+              const std::vector<std::unique_ptr<NSWL1::PadTrigger>> &triggers,
+              const uint32_t l1id) {
+  using TriggerList = std::vector<const NSWL1::PadTrigger *>;
+  using TriggerMap = std::map<uint32_t, TriggerList>;
+  TriggerMap triggerMap;
+  // Filter by sector:
+  for (const auto &pt : triggers) {
+    // `sector` in range [0, 16)
+    auto sector = pt->triggerSectorNumber() - 1;
+    auto endcap = pt->sideId();
+    if (sector == -1 || endcap == -1) {
+      return StatusCode::FAILURE;
+    }
+    // Calculate hash, range [0, 32)
+    const uint32_t hash = 16 * endcap + sector;
+    auto it = triggerMap.find(hash);
+    if (it == triggerMap.end()) {
+        it = triggerMap.insert(std::make_pair(hash, TriggerList())).first;
+    }
+    it->second.push_back(pt.get());
+  }
+  for (const auto &item : triggerMap) {
+    uint32_t hash = item.first;
+    const TriggerList &triggerList = item.second;
+    auto pt = triggerList[0];
+    auto newCollection = new Muon::NSW_PadTriggerData(
+        hash, pt->sectorId(),
+        static_cast<Muon::NSW_PadTriggerData::SectorSize>(pt->isSmall() ? 0
+                                                                        : 1),
+        static_cast<Muon::NSW_PadTriggerData::Endcap>(pt->sideId()),
+        pt->bctag(), l1id, {});
+    if (out->addCollection(newCollection, hash).isFailure()) {
+      return StatusCode::FAILURE;
+    }
+    for (auto pt : triggerList)
+      newCollection->push_back(
+          std::make_unique<Muon::NSW_PadTriggerSegment>(segment(*pt)));
+  }
+  return StatusCode::SUCCESS;
+}
+} // namespace PadTriggerAdapter
+} // namespace NSWL1
diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLookupTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLookupTool.cxx
index e7b649fb5fc1..cc12d32fa5e3 100644
--- a/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLookupTool.cxx
+++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/PadTriggerLookupTool.cxx
@@ -141,6 +141,9 @@ StatusCode PadTriggerLookupTool::expandCoincidenceTable(){//There we append 3o4s
             int phiid=kv.second.second;
             for(const int& in : innerIndices ){
                 std::vector<int> pattern=kv.first;//copy
+                if(pattern.at(in)==nullPadNumber || pattern.at(in+4)==nullPadNumber){
+                    continue;
+                }
                 pattern.at(in)=nullPadNumber;
                 for(const int& out :outerIndices){
                     int thispattern=pattern.at(out);
-- 
GitLab


From 329c2443f10a87b8b90f3ebc45bc19a948a0ad4d Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Fri, 24 Sep 2021 17:38:34 +0200
Subject: [PATCH 317/347] LArGeoCode, etc: Thread-safety fixes for LArGeoCode.

---
 .../LArGeoAlgsNV/src/LArDetectorFactory.cxx   | 12 +++++---
 .../LArGeoAlgsNV/src/LArDetectorFactory.h     |  5 ++++
 .../src/LArDetectorFactoryLite.cxx            |  4 ---
 .../LArGeoAlgsNV/src/LArDetectorTool.cxx      |  8 ++---
 .../LArGeoBarrel/BarrelConstruction.h         |  4 +--
 .../LArGeoBarrel/BarrelCryostatConstruction.h |  9 ++++--
 .../BarrelPresamplerConstruction.h            | 12 ++++----
 .../LArGeoBarrel/src/BarrelConstruction.cxx   |  5 ++--
 .../src/BarrelCryostatConstruction.cxx        |  8 ++---
 .../src/BarrelPresamplerConstruction.cxx      |  8 +++--
 .../LArGeoCode/ATLAS_CHECK_THREAD_SAFETY      |  1 +
 .../LArGeoCode/VDetectorParameters.h          | 14 +++++----
 .../LArGeoCode/src/VDetectorParameters.cxx    | 29 +++++--------------
 .../TBBarrelCryostatConstruction.h            |  9 +++---
 .../src/TBBarrelCryostatConstruction.cxx      | 10 +++----
 .../LArGeoTBEC/src/LArDetectorFactoryTBEC.cxx |  7 ++---
 16 files changed, 72 insertions(+), 73 deletions(-)
 create mode 100644 LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/ATLAS_CHECK_THREAD_SAFETY

diff --git a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.cxx b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.cxx
index 519a496563fb..7944e94fd4d1 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.cxx
@@ -75,8 +75,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
   double projectivityDisplacement(0.);
 
   if(m_testbeam==0 || m_testbeam==1) {
-      VDetectorParameters* parameters =	new  LArGeo::RAL();
-      VDetectorParameters::SetInstance(parameters);
+      m_parameters = std::make_unique<LArGeo::RAL>();
 
       // Get access to the material manager:
 
@@ -132,7 +131,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
 	endcapCryostatConstruction.setFCALVisLimit(m_fcalVisLimit);
 
 	if(m_buildBarrel) {
-	  barrelEnvelope = barrelCryostatConstruction.GetEnvelope();
+	  barrelEnvelope = barrelCryostatConstruction.GetEnvelope(m_parameters.get());
 	}
 
 	if(m_buildEndcap) {
@@ -280,7 +279,7 @@ void LArGeo::LArDetectorFactory::create( GeoPhysVol* a_container )
 	tbbarrelCryostatConstruction.setBarrelSagging(m_barrelSagging);
 	tbbarrelCryostatConstruction.setBarrelCellVisLimit(m_barrelVisLimit);
 	
-	barrelEnvelope = tbbarrelCryostatConstruction.GetEnvelope();
+	barrelEnvelope = tbbarrelCryostatConstruction.GetEnvelope(m_parameters.get());
 	
 	a_container->add(new GeoNameTag("LAr"));
 	a_container->add(barrelEnvelope);
@@ -321,3 +320,8 @@ const LArDetectorManager* LArGeo::LArDetectorFactory::getDetectorManager() const
   return m_detectorManager;
 }
 
+std::unique_ptr<LArGeo::VDetectorParameters> LArGeo::LArDetectorFactory::moveParameters()
+{
+  return std::move (m_parameters);
+}
+
diff --git a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.h b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.h
index 9aa243320080..ae2e22580630 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactory.h
@@ -23,6 +23,7 @@ class StoreGateSvc;
 class LArHVManager;
 
 namespace LArGeo {
+  class VDetectorParameters;
 
   class LArDetectorFactory : public GeoVDetectorFactory  {
 
@@ -43,6 +44,8 @@ namespace LArGeo {
     // Access to the results:
     virtual const LArDetectorManager* getDetectorManager() const;
 
+    std::unique_ptr<LArGeo::VDetectorParameters> moveParameters();
+
 
     // Set parameters:
 
@@ -84,6 +87,8 @@ namespace LArGeo {
 
     bool                      m_activateFT;
     bool                      m_enableMBTS;
+
+    std::unique_ptr<VDetectorParameters> m_parameters;
   };
 
 } // namespace LArGeo
diff --git a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactoryLite.cxx b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactoryLite.cxx
index 1d3dcf1be623..98b7ae5adaaa 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactoryLite.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorFactoryLite.cxx
@@ -57,10 +57,6 @@ void LArGeo::LArDetectorFactoryLite::create(GeoPhysVol* world)
 
   std::string errorMessage{""};
 
-  // Instantiate VDetectorParameters (needed for some clients)
-  VDetectorParameters* parameters = new  LArGeo::RAL();
-  VDetectorParameters::SetInstance(parameters);
-
   if(LArGeo::buildFcalChannelMap(m_detStore,m_paramSvc,Athena::getMessageSvc()).isFailure()) {
     errorMessage="Failed to build FCAL Channel Map";
     ATH_MSG_FATAL(errorMessage);
diff --git a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorTool.cxx b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorTool.cxx
index f5aba80cd67f..7fe8cfba7597 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorTool.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/src/LArDetectorTool.cxx
@@ -71,8 +71,6 @@ LArDetectorToolNV::LArDetectorToolNV(const std::string& type
 
 LArDetectorToolNV::~LArDetectorToolNV()
 {
-  // Clean up detector parameters instantiated by the factory
-  LArGeo::VDetectorParameters::SetInstance(0);
 }
 
 StatusCode LArDetectorToolNV::create()
@@ -178,9 +176,9 @@ StatusCode LArDetectorToolNV::create()
 
     theLArFactory.create(world);
     m_manager = theLArFactory.getDetectorManager();
-    if(m_geometryConfig=="RECO") {
-      // Release RDB Recordsets if we are inside reco job
-      LArGeo::VDetectorParameters::SetInstance(0);
+    if(m_geometryConfig!="RECO") {
+      // Save RDB Recordsets if we are not inside reco job
+      LArGeo::VDetectorParameters::SetInstance(theLArFactory.moveParameters());
     }
   }
 
diff --git a/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelConstruction.h b/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelConstruction.h
index a2792e0303c2..00b4c61a3f51 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelConstruction.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelConstruction.h
@@ -19,7 +19,7 @@ namespace LArGeo {
   public:
 
     // Constructor;
-    BarrelConstruction(bool fullGeo);
+    BarrelConstruction(bool fullGeo, const VDetectorParameters* params);
 
     // Destructor:
     virtual ~BarrelConstruction();
@@ -45,7 +45,7 @@ namespace LArGeo {
     BarrelConstruction & operator= (const BarrelConstruction &);
     
     // Detector parameters ACCG, ACCA, ACMB, ACCO
-    LArGeo::VDetectorParameters* m_parameters;
+    const LArGeo::VDetectorParameters* m_parameters;
 
     bool                    m_A_SAGGING;
     int                     m_NVISLIM;
diff --git a/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelCryostatConstruction.h b/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelCryostatConstruction.h
index 3c12c33e9f9a..d1fee1765533 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelCryostatConstruction.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelCryostatConstruction.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
 */
 
 /**
@@ -17,11 +17,14 @@
 #include "GeoModelKernel/GeoFullPhysVol.h"
 class StoreGateSvc;
 
+
 namespace LArGeo {
+  class VDetectorParameters;
+
 
   /** @class LArGeo::BarrelCryostatConstruction
       @brief Builds GeoModel description of the LAr Electromagnetic Barrel.
-      Descriptions of the presampler and dad material in the crack region are
+      Descriptions of the presampler and dead material in the crack region are
       implemented in separate classes
    */
   class BarrelCryostatConstruction
@@ -32,7 +35,7 @@ namespace LArGeo {
     virtual ~BarrelCryostatConstruction();
 
     // Get the envelope containing this detector.
-    virtual GeoFullPhysVol* GetEnvelope();
+    virtual GeoFullPhysVol* GetEnvelope(const VDetectorParameters* params);
 
 
     void setBarrelSagging(bool flag)        {m_barrelSagging  = flag;}
diff --git a/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelPresamplerConstruction.h b/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelPresamplerConstruction.h
index 0e65a99eee97..4251db89d264 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelPresamplerConstruction.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoBarrel/LArGeoBarrel/BarrelPresamplerConstruction.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
 */
 
 /**
@@ -10,8 +10,8 @@
  * $Id: BarrelPresamplerConstruction.h,v 1.4 2009-02-10 16:49:47 tsulaia Exp $
  */
 
-#ifndef __BarrelPresamplerConstruction_H__
-#define __BarrelPresamplerConstruction_H__
+#ifndef LARGEOBARREL_BARRELPRESAMPLERCONSTRUCTION_H
+#define LARGEOBARREL_BARRELPRESAMPLERCONSTRUCTION_H
 
 #include "LArGeoCode/VDetectorParameters.h"
 #include "GeoModelKernel/GeoFullPhysVol.h"
@@ -29,7 +29,7 @@ namespace LArGeo {
   public:
 
     // Constructor;
-    BarrelPresamplerConstruction(bool fullGeo, int itb=0);
+    BarrelPresamplerConstruction(bool fullGeo, const VDetectorParameters* params, int itb=0);
 
     // Destructor:
     virtual ~BarrelPresamplerConstruction();
@@ -49,7 +49,7 @@ namespace LArGeo {
     BarrelPresamplerConstruction & operator= (const BarrelPresamplerConstruction &);
 
     // Detector parameters ACCG, ACCA, ACMB, ACCO
-    LArGeo::VDetectorParameters* m_parameters;
+    const LArGeo::VDetectorParameters* m_parameters;
     
     // volumes that are private member variables:
     GeoFullPhysVol*  m_psPhysicalPos;
@@ -62,4 +62,4 @@ namespace LArGeo {
 
 }  // namespace LArGeo
 
-#endif // __BarrelPresamplerConstruction_H__
+#endif // LARGEOBARREL_BARRELPRESAMPLERCONSTRUCTION_H
diff --git a/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelConstruction.cxx b/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelConstruction.cxx
index 877abb210742..9cfa63edaae6 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelConstruction.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelConstruction.cxx
@@ -103,8 +103,9 @@
 
 //===================constructor
 
-LArGeo::BarrelConstruction::BarrelConstruction(bool fullGeo)
-  :m_parameters(LArGeo::VDetectorParameters::GetInstance()),
+LArGeo::BarrelConstruction::BarrelConstruction(bool fullGeo,
+                                               const VDetectorParameters* params)
+  :m_parameters(params),
    m_A_SAGGING(false),
    m_NVISLIM(-1),
    m_ecamPhysicalPos(NULL),
diff --git a/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelCryostatConstruction.cxx b/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelCryostatConstruction.cxx
index 51de94fa4827..362fc807e888 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelCryostatConstruction.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelCryostatConstruction.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
 */
 
 // BarrelCryostatConstruction
@@ -84,7 +84,7 @@ LArGeo::BarrelCryostatConstruction::BarrelCryostatConstruction(
 LArGeo::BarrelCryostatConstruction::~BarrelCryostatConstruction() {}
 
 
-GeoFullPhysVol* LArGeo::BarrelCryostatConstruction::GetEnvelope()
+GeoFullPhysVol* LArGeo::BarrelCryostatConstruction::GetEnvelope(const VDetectorParameters* params)
 {
   if (m_cryoMotherPhysical) return m_cryoMotherPhysical;
 
@@ -881,7 +881,7 @@ GeoFullPhysVol* LArGeo::BarrelCryostatConstruction::GetEnvelope()
     // There are two placements: one for the z>0 section, one for the z<0 section.
 
 
-    BarrelConstruction barrelConstruction(m_fullGeo);
+    BarrelConstruction barrelConstruction(m_fullGeo, params);
     barrelConstruction.setBarrelSagging(m_barrelSagging);
     barrelConstruction.setBarrelCellVisLimit(m_barrelVisLimit);
 
@@ -977,7 +977,7 @@ GeoFullPhysVol* LArGeo::BarrelCryostatConstruction::GetEnvelope()
     // ----- Presampler ------
     double PresamplerMother_length = 1549.0*Gaudi::Units::mm;  // Copied from PresParameterDef.icc
     double presamplerShift = 3.*Gaudi::Units::mm;
-    BarrelPresamplerConstruction barrelPSConstruction(m_fullGeo);
+    BarrelPresamplerConstruction barrelPSConstruction(m_fullGeo, params);
 
     // The "envelope" determined by the EMB should be a GeoFullPhysVol.
     GeoFullPhysVol* barrelPSPosEnvelope = barrelPSConstruction.GetPositiveEnvelope();
diff --git a/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelPresamplerConstruction.cxx b/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelPresamplerConstruction.cxx
index a3e4deeeda58..a50b49df5006 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelPresamplerConstruction.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoBarrel/src/BarrelPresamplerConstruction.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
 */
 
 #include "LArGeoBarrel/BarrelPresamplerConstruction.h"
@@ -51,8 +51,10 @@
 #include "GeoGenericFunctions/FixedConstant.h"
 
 // Constructor;
-LArGeo::BarrelPresamplerConstruction ::BarrelPresamplerConstruction(bool fullGeo, int itb):
-  m_parameters(LArGeo::VDetectorParameters::GetInstance()),
+LArGeo::BarrelPresamplerConstruction ::BarrelPresamplerConstruction(bool fullGeo,
+                                                                    const VDetectorParameters* params,
+                                                                    int itb):
+  m_parameters(params),
   m_psPhysicalPos(NULL),
   m_psPhysicalNeg(NULL),
   m_fullGeo(fullGeo)
diff --git a/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/ATLAS_CHECK_THREAD_SAFETY b/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..eacb3c488b65
--- /dev/null
+++ b/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+LArCalorimeter/LArGeoModel/LArGeoCode
diff --git a/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/VDetectorParameters.h b/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/VDetectorParameters.h
index 92dc8af2ea17..fc5c1a7f6373 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/VDetectorParameters.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoCode/LArGeoCode/VDetectorParameters.h
@@ -16,9 +16,11 @@
 // are stored from the simulation's geometry and hit-calculation
 // routines.
 
-#ifndef __LArGeo_VDetectorParameters_h_
-#define __LArGeo_VDetectorParameters_h_
+#ifndef LARGEOCODE_VDETECTORPARAMETERS_H
+#define LARGEOCODE_VDETECTORPARAMETERS_H
 
+#include "CxxUtils/CachedUniquePtr.h"
+#include "CxxUtils/checker_macros.h"
 #include <string>
 #include <limits.h>
 
@@ -37,8 +39,8 @@ namespace LArGeo {
     // Thereafter, any routine in the simulation can use the result of
     // "GetInstance" to find out how to get its parameters.
 
-    static void SetInstance(VDetectorParameters*);
-    static VDetectorParameters* GetInstance();
+    static void SetInstance(std::unique_ptr<VDetectorParameters>);
+    static const VDetectorParameters* GetInstance();
 
     // This is the general access method for obtaining valued from
     // some source of detector parameters.  THe paramter is identified
@@ -59,10 +61,10 @@ namespace LArGeo {
     VDetectorParameters() {};
 
   private:
-    static VDetectorParameters* s_instance;
+    static CxxUtils::CachedUniquePtr<VDetectorParameters> s_instance ATLAS_THREAD_SAFE;
 
   };
 
 } // namespace LArGeo
 
-#endif // __LArGeo_VDetectorParameters_h_
+#endif // LARGEOCODE_VDETECTORPARAMETERS_H
diff --git a/LArCalorimeter/LArGeoModel/LArGeoCode/src/VDetectorParameters.cxx b/LArCalorimeter/LArGeoModel/LArGeoCode/src/VDetectorParameters.cxx
index f18a1546a748..074f4925b457 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoCode/src/VDetectorParameters.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoCode/src/VDetectorParameters.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
 */
 
 
@@ -19,33 +19,20 @@
 #include <stdlib.h>
 
 
-LArGeo::VDetectorParameters* LArGeo::VDetectorParameters::s_instance = 0;
+CxxUtils::CachedUniquePtr<LArGeo::VDetectorParameters> LArGeo::VDetectorParameters::s_instance;
 
-void LArGeo::VDetectorParameters::SetInstance(VDetectorParameters* p)
+void LArGeo::VDetectorParameters::SetInstance(std::unique_ptr<VDetectorParameters> p)
 {
-  if(s_instance!=0) {
-    /* -- Consider moving these printouts to MsgSvc
-    if(p==0) 
-      std::cerr << "LArGeo::VDetectorParameters::SetInstance warning: "
-		<< "database-parameter access objet is being deleted."
-		<< std::endl;
-    else
-      std::cerr << "LArGeo::VDetectorParameters::SetInstance warning: "
-		<< "database-parameter access object is being re-defined."
-		<< std::endl;
-    */
-    delete s_instance;
-  }
-
-  s_instance = p;
+  s_instance.set (std::move (p));
 }
 
-LArGeo::VDetectorParameters* LArGeo::VDetectorParameters::GetInstance()
+const LArGeo::VDetectorParameters* LArGeo::VDetectorParameters::GetInstance()
 {
-  if(s_instance==0)
+  const VDetectorParameters* p = s_instance.get();
+  if(p==0)
       std::cerr << "LArGeo::VDetectorParameters::GetInstance was called, but "
 		<< "the pointer to the detector-parameter access object is 0."
 		<< std::endl;
 
-  return s_instance;
+  return p;
 }
diff --git a/LArCalorimeter/LArGeoModel/LArGeoTBBarrel/LArGeoTBBarrel/TBBarrelCryostatConstruction.h b/LArCalorimeter/LArGeoModel/LArGeoTBBarrel/LArGeoTBBarrel/TBBarrelCryostatConstruction.h
index 0c953d032d0b..aa072614f312 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoTBBarrel/LArGeoTBBarrel/TBBarrelCryostatConstruction.h
+++ b/LArCalorimeter/LArGeoModel/LArGeoTBBarrel/LArGeoTBBarrel/TBBarrelCryostatConstruction.h
@@ -1,18 +1,19 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 // TBBarrelCryostatConstruction
 // returns an envelope that contains the H8 barrel cryostat
 //  and places inside the calorimeter module and the presampler
 
-#ifndef __TBBarrelCryostatConstruction_H__
-#define __TBBarrelCryostatConstruction_H__
+#ifndef LARGEOTBBARREL_TBBARRELCRYOSTATCONSTRUCTION_H
+#define LARGEOTBBARREL_TBBARRELCRYOSTATCONSTRUCTION_H
 
 #include "GeoModelKernel/GeoFullPhysVol.h"
 class StoreGateSvc;
 
 namespace LArGeo {
+  class VDetectorParameters;
 
   class TBBarrelCryostatConstruction
   {
@@ -21,7 +22,7 @@ namespace LArGeo {
    virtual ~TBBarrelCryostatConstruction();
 
    // get the envelope containing this detector
-   virtual GeoFullPhysVol* GetEnvelope();
+   virtual GeoFullPhysVol* GetEnvelope(const VDetectorParameters* params);
 
    void setBarrelSagging(bool flag) {_barrelSagging=flag;}
    void setBarrelCellVisLimit(int maxCell) {_barrelVisLimit = maxCell;}
diff --git a/LArCalorimeter/LArGeoModel/LArGeoTBBarrel/src/TBBarrelCryostatConstruction.cxx b/LArCalorimeter/LArGeoModel/LArGeoTBBarrel/src/TBBarrelCryostatConstruction.cxx
index 40938c4191dd..2ac76941440c 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoTBBarrel/src/TBBarrelCryostatConstruction.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoTBBarrel/src/TBBarrelCryostatConstruction.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
 */
 
 // TBBarrelCryostatConstruction
@@ -56,12 +56,12 @@ LArGeo::TBBarrelCryostatConstruction::TBBarrelCryostatConstruction():
 
 LArGeo::TBBarrelCryostatConstruction::~TBBarrelCryostatConstruction() {}
 
-GeoFullPhysVol* LArGeo::TBBarrelCryostatConstruction::GetEnvelope()
+GeoFullPhysVol* LArGeo::TBBarrelCryostatConstruction::GetEnvelope(const VDetectorParameters* params)
 {
 
   if (cryoMotherPhysical) return cryoMotherPhysical;
 
-// Get access to the matarial manager
+// Get access to the material manager
 
   ISvcLocator *svcLocator = Gaudi::svcLocator();
   IMessageSvc * msgSvc;
@@ -620,7 +620,7 @@ GeoFullPhysVol* LArGeo::TBBarrelCryostatConstruction::GetEnvelope()
 // --------------------------------------------------------------------
 
 #ifdef BUILD_LARMODULE
-    BarrelConstruction barrelConstruction(true); // full geometry
+       BarrelConstruction barrelConstruction(true, params); // full geometry
     barrelConstruction.setBarrelSagging(_barrelSagging);
     barrelConstruction.setBarrelCellVisLimit(_barrelVisLimit);
     GeoFullPhysVol* barrelEnvelope = barrelConstruction.GetPositiveEnvelope();
@@ -645,7 +645,7 @@ GeoFullPhysVol* LArGeo::TBBarrelCryostatConstruction::GetEnvelope()
 // Place the Presampler test module inside the LAr volume (moth_phys)
 // ------------------------------------------------------------------------
 #ifdef BUILD_PRESAMPLER
-     BarrelPresamplerConstruction barrelPSConstruction(1);
+     BarrelPresamplerConstruction barrelPSConstruction(1, params);
      GeoFullPhysVol* barrelPSEnvelope = barrelPSConstruction.GetPositiveEnvelope();
 // PS lenght = 2*1582.5
 // start should be a z=0 in Atlas  => z = -LAr_z_max/2.+Cryo_z0 in moth_phys
diff --git a/LArCalorimeter/LArGeoModel/LArGeoTBEC/src/LArDetectorFactoryTBEC.cxx b/LArCalorimeter/LArGeoModel/LArGeoTBEC/src/LArDetectorFactoryTBEC.cxx
index 073ac8b943e7..585e598a50d2 100755
--- a/LArCalorimeter/LArGeoModel/LArGeoTBEC/src/LArDetectorFactoryTBEC.cxx
+++ b/LArCalorimeter/LArGeoModel/LArGeoTBEC/src/LArDetectorFactoryTBEC.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
 */
 
 // LArDetectorFactory.cxx
@@ -49,9 +49,8 @@ LArGeo::LArDetectorFactoryTBEC::~LArDetectorFactoryTBEC()
 void LArGeo::LArDetectorFactoryTBEC::create( GeoPhysVol* a_container )
 {
 
-  // V.N :  Patch LAr materials
-  VDetectorParameters* parameters = (VDetectorParameters *) new  LArGeo::RAL();
-  VDetectorParameters::SetInstance(parameters);
+  // V.N :  Patch LAr materials ??? is this needed?
+  VDetectorParameters::SetInstance(std::make_unique<LArGeo::RAL>());
 
   EMECDetectorManager *emecDetectorManager = new EMECDetectorManager();
   
-- 
GitLab


From 991670a390aaeabda7edb83ffb140ea2f31bf469 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Fri, 24 Sep 2021 17:54:21 +0200
Subject: [PATCH 318/347] AGDDControl, etc: Remove use of current element
 statics.

---
 .../AGDD/AGDD2GeoSvc/src/AGDD2GeoSvc.cxx      |  90 +++++++-------
 .../AGDDControl/AGDDControl/IAGDDParser.h     |  19 +--
 .../AGDD/AGDDControl/AGDDControl/XMLHandler.h |  89 +++++++++-----
 .../AGDDControl/AGDDControl/XMLHandlerStore.h |   5 +-
 .../AGDDControl/AGDDControl/XercesParser.h    |  27 +++--
 .../AGDD/AGDDControl/src/AGDDController.cxx   |   4 +-
 .../AGDD/AGDDControl/src/XMLHandler.cxx       | 113 +++++++++++-------
 .../AGDD/AGDDControl/src/XMLHandlerStore.cxx  |   6 +-
 .../AGDD/AGDDControl/src/XercesParser.cxx     |  41 ++++---
 .../AGDDHandlers/AGDDHandlers/AGDDHandler.h   |   7 +-
 .../AGDDHandlers/AGDDHandlers/BoltHandler.h   |   9 +-
 .../AGDDHandlers/AGDDHandlers/IbeamHandler.h  |   9 +-
 .../AGDDHandlers/AGDDHandlers/UbeamHandler.h  |   9 +-
 .../AGDDHandlers/addmaterialHandler.h         |  11 +-
 .../AGDDHandlers/AGDDHandlers/aliasHandler.h  |   9 +-
 .../AGDDHandlers/AGDDHandlers/arrayHandler.h  |   9 +-
 .../AGDDHandlers/AGDDHandlers/boxHandler.h    |   9 +-
 .../AGDDHandlers/chamberPositionerHandler.h   |   9 +-
 .../AGDDHandlers/AGDDHandlers/colorHandler.h  |  10 +-
 .../AGDDHandlers/compositeHandler.h           |   9 +-
 .../AGDDHandlers/compositionHandler.h         |   9 +-
 .../AGDDHandlers/AGDDHandlers/consHandler.h   |   9 +-
 .../AGDDHandlers/defaultsHandler.h            |   9 +-
 .../AGDDHandlers/AGDDHandlers/elcylHandler.h  |   9 +-
 .../AGDDHandlers/elementHandler.h             |  10 +-
 .../AGDDHandlers/foreachHandler.h             |   9 +-
 .../AGDDHandlers/fractionmassHandler.h        |  12 +-
 .../AGDDHandlers/AGDDHandlers/gvxyHandler.h   |   9 +-
 .../AGDDHandlers/gvxy_pointHandler.h          |   8 +-
 .../AGDDHandlers/AGDDHandlers/gvxysxHandler.h |   9 +-
 .../AGDDHandlers/gvxysxyHandler.h             |   9 +-
 .../AGDDHandlers/AGDDHandlers/importHandler.h |   7 +-
 .../AGDDHandlers/intersectionHandler.h        |   9 +-
 .../AGDDHandlers/materialHandler.h            |  10 +-
 .../AGDDHandlers/materialsHandler.h           |   9 +-
 .../AGDDHandlers/mposPhiHandler.h             |  10 +-
 .../AGDDHandlers/mposWedgeHandler.h           |  10 +-
 .../AGDDHandlers/AGDDHandlers/msgHandler.h    |   8 +-
 .../AGDDHandlers/AGDDHandlers/natomsHandler.h |  12 +-
 .../AGDDHandlers/AGDDHandlers/pconHandler.h   |   9 +-
 .../AGDDHandlers/AGDDHandlers/pgonHandler.h   |   9 +-
 .../AGDDHandlers/polyplaneHandler.h           |   8 +-
 .../AGDDHandlers/posRPhiZHandler.h            |  10 +-
 .../AGDDHandlers/AGDDHandlers/posXYZHandler.h |   9 +-
 .../AGDDHandlers/AGDDHandlers/ringHandler.h   |   9 +-
 .../AGDDHandlers/sectionHandler.h             |  10 +-
 .../AGDDHandlers/AGDDHandlers/sectorHandler.h |   9 +-
 .../AGDDHandlers/AGDDHandlers/snakeHandler.h  |   9 +-
 .../AGDDHandlers/snake_pointHandler.h         |   8 +-
 .../AGDDHandlers/subtractionHandler.h         |   9 +-
 .../AGDDHandlers/AGDDHandlers/trdHandler.h    |   9 +-
 .../AGDDHandlers/AGDDHandlers/tubsHandler.h   |   9 +-
 .../AGDDHandlers/AGDDHandlers/unionHandler.h  |   9 +-
 .../AGDDHandlers/AGDDHandlers/varHandler.h    |   9 +-
 .../AGDDHandlers/versionHandler.h             |   9 +-
 .../AGDD/AGDDHandlers/src/AGDDHandler.cxx     |   7 +-
 .../AGDD/AGDDHandlers/src/BoltHandler.cxx     |  24 ++--
 .../AGDD/AGDDHandlers/src/IbeamHandler.cxx    |  26 ++--
 .../AGDD/AGDDHandlers/src/UbeamHandler.cxx    |  26 ++--
 .../AGDDHandlers/src/addmaterialHandler.cxx   |  11 +-
 .../AGDD/AGDDHandlers/src/aliasHandler.cxx    |  16 ++-
 .../AGDD/AGDDHandlers/src/arrayHandler.cxx    |  14 ++-
 .../AGDD/AGDDHandlers/src/boxHandler.cxx      |  18 +--
 .../src/chamberPositionerHandler.cxx          |  32 ++---
 .../AGDD/AGDDHandlers/src/colorHandler.cxx    |  22 ++--
 .../AGDDHandlers/src/compositeHandler.cxx     |  20 ++--
 .../AGDDHandlers/src/compositionHandler.cxx   |  20 ++--
 .../AGDD/AGDDHandlers/src/consHandler.cxx     |  20 ++--
 .../AGDD/AGDDHandlers/src/defaultsHandler.cxx |  11 +-
 .../AGDD/AGDDHandlers/src/elcylHandler.cxx    |  18 +--
 .../AGDD/AGDDHandlers/src/elementHandler.cxx  |  24 ++--
 .../AGDD/AGDDHandlers/src/foreachHandler.cxx  |  20 ++--
 .../AGDDHandlers/src/fractionmassHandler.cxx  |  11 +-
 .../AGDD/AGDDHandlers/src/gvxyHandler.cxx     |  22 ++--
 .../AGDDHandlers/src/gvxy_pointHandler.cxx    |  12 +-
 .../AGDD/AGDDHandlers/src/gvxysxHandler.cxx   |  26 ++--
 .../AGDD/AGDDHandlers/src/gvxysxyHandler.cxx  |  22 ++--
 .../AGDD/AGDDHandlers/src/importHandler.cxx   |  12 +-
 .../AGDDHandlers/src/intersectionHandler.cxx  |  25 ++--
 .../AGDD/AGDDHandlers/src/materialHandler.cxx |  20 ++--
 .../AGDDHandlers/src/materialsHandler.cxx     |   9 +-
 .../AGDD/AGDDHandlers/src/mposPhiHandler.cxx  |  28 +++--
 .../AGDDHandlers/src/mposWedgeHandler.cxx     |  18 +--
 .../AGDD/AGDDHandlers/src/msgHandler.cxx      |  16 ++-
 .../AGDD/AGDDHandlers/src/natomsHandler.cxx   |  11 +-
 .../AGDD/AGDDHandlers/src/pconHandler.cxx     |  26 ++--
 .../AGDD/AGDDHandlers/src/pgonHandler.cxx     |  28 +++--
 .../AGDDHandlers/src/polyplaneHandler.cxx     |  12 +-
 .../AGDD/AGDDHandlers/src/posRPhiZHandler.cxx |  18 +--
 .../AGDD/AGDDHandlers/src/posXYZHandler.cxx   |  18 +--
 .../AGDD/AGDDHandlers/src/ringHandler.cxx     |  11 +-
 .../AGDD/AGDDHandlers/src/sectionHandler.cxx  |  22 ++--
 .../AGDD/AGDDHandlers/src/sectorHandler.cxx   |  11 +-
 .../AGDD/AGDDHandlers/src/snakeHandler.cxx    |  22 ++--
 .../AGDDHandlers/src/snake_pointHandler.cxx   |  11 +-
 .../AGDDHandlers/src/subtractionHandler.cxx   |  25 ++--
 .../AGDD/AGDDHandlers/src/trdHandler.cxx      |  18 +--
 .../AGDD/AGDDHandlers/src/tubsHandler.cxx     |  20 ++--
 .../AGDD/AGDDHandlers/src/unionHandler.cxx    |  45 +++----
 .../AGDD/AGDDHandlers/src/varHandler.cxx      |  14 ++-
 .../AGDD/AGDDHandlers/src/versionHandler.cxx  |  15 ++-
 .../MuonAGDD/src/MuonAGDDToolHelper.cxx       |  18 +--
 .../MuonAGDDBase/micromegasHandler.h          |   9 +-
 .../MuonAGDDBase/mmSpacerHandler.h            |   9 +-
 .../MuonAGDDBase/mmSpacer_TechHandler.h       |   9 +-
 .../MuonAGDDBase/mm_TechHandler.h             |   9 +-
 .../MuonAGDDBase/mm_readoutHandler.h          |   9 +-
 .../MuonAGDDBase/muonStationHandler.h         |   9 +-
 .../MuonAGDDBase/MuonAGDDBase/sTGCHandler.h   |   9 +-
 .../MuonAGDDBase/sTGC_TechHandler.h           |   9 +-
 .../MuonAGDDBase/sTGC_readoutHandler.h        |   8 +-
 .../MuonAGDDBase/src/micromegasHandler.cxx    |  32 ++---
 .../MuonAGDDBase/src/mmSpacerHandler.cxx      |  22 ++--
 .../MuonAGDDBase/src/mmSpacer_TechHandler.cxx |  25 ++--
 .../MuonAGDDBase/src/mm_TechHandler.cxx       |  32 ++---
 .../MuonAGDDBase/src/mm_readoutHandler.cxx    |  57 ++++-----
 .../MuonAGDDBase/src/muonStationHandler.cxx   |  16 ++-
 .../MuonAGDDBase/src/sTGCHandler.cxx          |  42 ++++---
 .../MuonAGDDBase/src/sTGC_TechHandler.cxx     |  30 +++--
 .../MuonAGDDBase/src/sTGC_readoutHandler.cxx  |  79 ++++++------
 120 files changed, 1220 insertions(+), 905 deletions(-)

diff --git a/DetectorDescription/AGDD/AGDD2GeoSvc/src/AGDD2GeoSvc.cxx b/DetectorDescription/AGDD/AGDD2GeoSvc/src/AGDD2GeoSvc.cxx
index df046ac93dfe..4ca5601dfbea 100644
--- a/DetectorDescription/AGDD/AGDD2GeoSvc/src/AGDD2GeoSvc.cxx
+++ b/DetectorDescription/AGDD/AGDD2GeoSvc/src/AGDD2GeoSvc.cxx
@@ -41,58 +41,58 @@ AGDDtoGeoSvc::initialize()
 #include "AGDDHandlers/HandlerList.h"
 void AGDDtoGeoSvc::localInitialization()
 {
-	addHandler(new AGDDHandler("AGDD"));
-	addHandler(new BoltHandler("Bolt"));
-	addHandler(new IbeamHandler("Ibeam"));
-	addHandler(new UbeamHandler("Ubeam"));
-	addHandler(new addmaterialHandler("addmaterial"));
-	addHandler(new aliasHandler("alias"));
-	addHandler(new arrayHandler("array"));
-	addHandler(new boxHandler("box"));
-	addHandler(new colorHandler("color"));
+	addHandler(new AGDDHandler("AGDD", m_controller));
+	addHandler(new BoltHandler("Bolt", m_controller));
+	addHandler(new IbeamHandler("Ibeam", m_controller));
+	addHandler(new UbeamHandler("Ubeam", m_controller));
+	addHandler(new addmaterialHandler("addmaterial", m_controller));
+	addHandler(new aliasHandler("alias", m_controller));
+	addHandler(new arrayHandler("array", m_controller));
+	addHandler(new boxHandler("box", m_controller));
+	addHandler(new colorHandler("color", m_controller));
 	
-	addHandler(new compositeHandler("composite"));
-	addHandler(new compositionHandler("composition"));
-	addHandler(new consHandler("cons"));
-	addHandler(new defaultsHandler("defaults"));
-	addHandler(new elcylHandler("elcyl"));
-	addHandler(new elementHandler("element"));
-	addHandler(new foreachHandler("foreach"));
-	addHandler(new fractionmassHandler("fractionmass"));
-	addHandler(new gvxyHandler("gvxy"));
+	addHandler(new compositeHandler("composite", m_controller));
+	addHandler(new compositionHandler("composition", m_controller));
+	addHandler(new consHandler("cons", m_controller));
+	addHandler(new defaultsHandler("defaults", m_controller));
+	addHandler(new elcylHandler("elcyl", m_controller));
+	addHandler(new elementHandler("element", m_controller));
+	addHandler(new foreachHandler("foreach", m_controller));
+	addHandler(new fractionmassHandler("fractionmass", m_controller));
+	addHandler(new gvxyHandler("gvxy", m_controller));
 	
-	addHandler(new gvxysxHandler("gvxysx"));
-	addHandler(new gvxy_pointHandler("gvxy_point"));
-	addHandler(new gvxysxyHandler("gvxysxy"));
-	addHandler(new intersectionHandler("intersection"));
-	addHandler(new materialHandler("material"));
-	addHandler(new materialsHandler("materials"));
-	addHandler(new mposPhiHandler("mposPhi"));
-	addHandler(new mposWedgeHandler("mposWedge"));
+	addHandler(new gvxysxHandler("gvxysx", m_controller));
+	addHandler(new gvxy_pointHandler("gvxy_point", m_controller));
+	addHandler(new gvxysxyHandler("gvxysxy", m_controller));
+	addHandler(new intersectionHandler("intersection", m_controller));
+	addHandler(new materialHandler("material", m_controller));
+	addHandler(new materialsHandler("materials", m_controller));
+	addHandler(new mposPhiHandler("mposPhi", m_controller));
+	addHandler(new mposWedgeHandler("mposWedge", m_controller));
 	
-	addHandler(new msgHandler("msg"));
-	addHandler(new natomsHandler("natoms"));
-	addHandler(new pconHandler("pcon"));
-	addHandler(new pgonHandler("pgon"));
-	addHandler(new polyplaneHandler("polyplane"));
-	addHandler(new posRPhiZHandler("posRPhiZ"));
-	addHandler(new posXYZHandler("posXYZ"));
-	addHandler(new ringHandler("ring"));
+	addHandler(new msgHandler("msg", m_controller));
+	addHandler(new natomsHandler("natoms", m_controller));
+	addHandler(new pconHandler("pcon", m_controller));
+	addHandler(new pgonHandler("pgon", m_controller));
+	addHandler(new polyplaneHandler("polyplane", m_controller));
+	addHandler(new posRPhiZHandler("posRPhiZ", m_controller));
+	addHandler(new posXYZHandler("posXYZ", m_controller));
+	addHandler(new ringHandler("ring", m_controller));
 	
 	
-	addHandler(new sectionHandler("section"));
-	addHandler(new sectorHandler("sector"));
-	addHandler(new snakeHandler("snake"));
-	addHandler(new snake_pointHandler("snake_point"));
-	addHandler(new subtractionHandler("subtraction"));
-	addHandler(new trdHandler("trd"));
-	addHandler(new tubsHandler("tubs"));
-	addHandler(new unionHandler("union"));
-	addHandler(new varHandler("var"));
-	addHandler(new versionHandler("version"));
+	addHandler(new sectionHandler("section", m_controller));
+	addHandler(new sectorHandler("sector", m_controller));
+	addHandler(new snakeHandler("snake", m_controller));
+	addHandler(new snake_pointHandler("snake_point", m_controller));
+	addHandler(new subtractionHandler("subtraction", m_controller));
+	addHandler(new trdHandler("trd", m_controller));
+	addHandler(new tubsHandler("tubs", m_controller));
+	addHandler(new unionHandler("union", m_controller));
+	addHandler(new varHandler("var", m_controller));
+	addHandler(new versionHandler("version", m_controller));
 	addHandler(new importHandler("import", m_controller));
 	
-	addHandler(new chamberPositionerHandler("chamberPosition"));
+	addHandler(new chamberPositionerHandler("chamberPosition", m_controller));
 
 	AliasStore::GetAliasList()->AddAlias("Aluminium1","std::Aluminium");
 	AliasStore::GetAliasList()->AddAlias("Aluminium2","std::Aluminium");
diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDDParser.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDDParser.h
index 8e3d257624b9..7ee6a6f8d3c3 100644
--- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDDParser.h
+++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/IAGDDParser.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 IAGDDParser_H
@@ -8,17 +8,22 @@
 
 #include <string>
 
+class AGDDController;
+
+
 class IAGDDParser {
 public:
 	IAGDDParser():m_fileName("") {}
 	IAGDDParser(std::string s):m_fileName(s) {}
 	virtual ~IAGDDParser() {;}
-	virtual bool ParseFile(std::string)=0;
-	virtual bool ParseFileAndNavigate(std::string)=0;
-	virtual bool ParseString(std::string)=0;
-	virtual bool ParseStringAndNavigate(std::string)=0;
-	virtual bool WriteToFile(std::string)=0;
-	virtual void navigateTree()=0;
+	virtual bool ParseFile(const std::string&)=0;
+	virtual bool ParseFileAndNavigate(AGDDController& c,
+                                          const std::string&)=0;
+	virtual bool ParseString(const std::string&)=0;
+	virtual bool ParseStringAndNavigate(AGDDController& c,
+                                            const std::string&)=0;
+	virtual bool WriteToFile(const std::string&)=0;
+	virtual void navigateTree(AGDDController& c)=0;
 protected:
 	std::string m_fileName;
 };
diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/XMLHandler.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/XMLHandler.h
index 53a3e1950fba..fd43622ca32a 100644
--- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/XMLHandler.h
+++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/XMLHandler.h
@@ -1,27 +1,30 @@
 /*
-  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 XMLHandler_H
 #define XMLHandler_H
 
 #include <string>
+#include <vector>
 #include <xercesc/dom/DOM.hpp>
 
 #include "AGDDControl/ExpressionEvaluator.h"
 
 class XMLHandlerStore;
+class AGDDController;
 
 class XMLHandler {
 public:
-	XMLHandler(std::string n);
-	virtual ~XMLHandler() {}
+	XMLHandler(const std::string& n, AGDDController& c);
+  	virtual ~XMLHandler() {}
 	std::string GetName() {return m_name;}
-	virtual void ElementHandle()=0;
-	virtual void Handle(xercesc::DOMNode *t) 
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t)=0;
+        virtual void Handle(AGDDController& c,
+                            xercesc::DOMNode *t) 
 	{
-		SetCurrentElement(t);
-		ElementHandle();
+		ElementHandle(c, t);
 	}
 	void StopLoop(bool);
 	bool IsLoopToBeStopped();
@@ -29,28 +32,56 @@ protected:
 	std::string m_name;
 	bool m_stopLoop;
 
-	static xercesc::DOMNode *s_currentElement;
-	static void SetCurrentElement(xercesc::DOMNode *t) {s_currentElement=t;}
-	static xercesc::DOMNode *GetCurrentElement() {return s_currentElement;}
-	
-	bool isAttribute(const std::string) const;
+	bool isAttribute(const xercesc::DOMNode* t,
+                         const std::string&) const;
 
-	std::string getAttribute(const std::string, bool&) const;
-    std::string getAttributeAsString(const std::string) const;
-    double getAttributeAsDouble(const std::string) const;
-    int getAttributeAsInt(const std::string) const;
-    std::vector<double> getAttributeAsVector(const std::string) const;
-	std::vector<int> getAttributeAsIntVector(const std::string) const;
-	std::string getAttributeAsString(const std::string, bool&) const;
-	double getAttributeAsDouble(const std::string, bool&) const;
-	int getAttributeAsInt(const std::string, bool&) const;
-	std::vector<double> getAttributeAsVector(const std::string, bool&) const;
-    std::vector<int> getAttributeAsIntVector(const std::string, bool&) const;
-	std::string getAttributeAsString(const std::string, const std::string) const;
-	double getAttributeAsDouble(const std::string, const double) const;
-	int getAttributeAsInt(const std::string, const int) const;
-	std::vector<double> getAttributeAsVector(const std::string, const std::vector<double>) const;
-    std::vector<int> getAttributeAsIntVector(const std::string, const std::vector<int>) const;
+	std::string getAttribute(const xercesc::DOMNode* t,
+                                 const std::string&, bool&) const;
+        std::string getAttributeAsString(AGDDController& c,
+                                         const xercesc::DOMNode* t,
+                                         const std::string&) const;
+        double getAttributeAsDouble(AGDDController& c,
+                                    const xercesc::DOMNode* t,
+                                    const std::string&) const;
+        int getAttributeAsInt(AGDDController& c,
+                              const xercesc::DOMNode* t,
+                              const std::string&) const;
+        std::vector<double> getAttributeAsVector(AGDDController& c,
+                                                 const xercesc::DOMNode* t,
+                                                 const std::string&) const;
+	std::vector<int> getAttributeAsIntVector(AGDDController& c,
+                                                 const xercesc::DOMNode* t,
+                                                 const std::string&) const;
+	std::string getAttributeAsString(AGDDController& c,
+                                         const xercesc::DOMNode* t,
+                                         const std::string&, bool&) const;
+	double getAttributeAsDouble(AGDDController& c,
+                                    const xercesc::DOMNode* t,
+                                    const std::string&, bool&) const;
+	int getAttributeAsInt(AGDDController& c,
+                              const xercesc::DOMNode* t,
+                              const std::string&, bool&) const;
+	std::vector<double> getAttributeAsVector(AGDDController& c,
+                                                 const xercesc::DOMNode* t,
+                                                 const std::string&, bool&) const;
+        std::vector<int> getAttributeAsIntVector(AGDDController& c,
+                                                 const xercesc::DOMNode* t,
+                                                 const std::string&, bool&) const;
+	std::string getAttributeAsString(AGDDController& c,
+                                         const xercesc::DOMNode* t,
+                                         const std::string&, const std::string&) const;
+	double getAttributeAsDouble(AGDDController& c,
+                                    const xercesc::DOMNode* t,
+                                    const std::string&, const double) const;
+	int getAttributeAsInt(AGDDController& c,
+                              const xercesc::DOMNode* t,
+                              const std::string&, const int) const;
+	std::vector<double> getAttributeAsVector(AGDDController& c,
+                                                 const xercesc::DOMNode* t,
+                                                 const std::string&, const std::vector<double>&) const;
+        std::vector<int> getAttributeAsIntVector(AGDDController& c,
+                                                 const xercesc::DOMNode* t,
+                                                 const std::string&, const std::vector<int>&) const;
 	static bool s_printFlag;
 	
 	ExpressionEvaluator& Evaluator() const
@@ -59,7 +90,7 @@ protected:
 		return eval;	
 	}
 private:
-	void RegisterToStore();
+	void RegisterToStore(AGDDController& c);
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/XMLHandlerStore.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/XMLHandlerStore.h
index 429ab294860c..f4fc1e3b76cc 100644
--- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/XMLHandlerStore.h
+++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/XMLHandlerStore.h
@@ -1,11 +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 XMLHandlerStore_H
 #define XMLHandlerStore_H
 
 class XMLHandler;
+class AGDDController;
 
 #include <map>
 #include <string>
@@ -21,7 +22,7 @@ public:
 	static XMLHandlerStore* GetHandlerStore();
 	void RegisterHandler(XMLHandler*);
 	XMLHandler* GetHandler(xercesc::DOMNode *);
-	void Handle(xercesc::DOMNode *);
+	void Handle(AGDDController& c, xercesc::DOMNode *);
 private:
 	XMLHandlerStore();
 	static XMLHandlerStore *s_theStore;
diff --git a/DetectorDescription/AGDD/AGDDControl/AGDDControl/XercesParser.h b/DetectorDescription/AGDD/AGDDControl/AGDDControl/XercesParser.h
index 1e4a34febcfa..73655c9d1111 100644
--- a/DetectorDescription/AGDD/AGDDControl/AGDDControl/XercesParser.h
+++ b/DetectorDescription/AGDD/AGDDControl/AGDDControl/XercesParser.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 XercesParser_H
@@ -12,25 +12,26 @@
 #include <xercesc/dom/DOM.hpp>
 #include <xercesc/parsers/XercesDOMParser.hpp>
 
+class AGDDController;
+
 class XercesParser: public IAGDDParser {
 public:
     XercesParser();
-    XercesParser(std::string);
-    ~XercesParser();
-    bool ParseFile(std::string);
-    bool ParseFileAndNavigate(std::string);
-    bool ParseString(std::string);
-    bool ParseStringAndNavigate(std::string);
-    bool WriteToFile(std::string);
-    void navigateTree();
+    XercesParser(const std::string&);
+    virtual ~XercesParser();
+    virtual bool ParseFile(const std::string&) override;
+    virtual bool ParseFileAndNavigate(AGDDController& c,
+                                      const std::string&) override;
+    virtual bool ParseString(const std::string&) override;
+    virtual bool ParseStringAndNavigate(AGDDController& c,
+                                        const std::string&) override;
+    virtual bool WriteToFile(const std::string&) override;
+    virtual void navigateTree(AGDDController& c) override;
     static void elementLoop();
-    static void elementLoop(xercesc::DOMNode*);
+    static void elementLoop(AGDDController& c, xercesc::DOMNode*);
     static ExpressionEvaluator& Evaluator();
-    static xercesc::DOMNode* GetCurrentElement() {return s_currentElement;}
     bool Initialize();
     bool Finalize();
-protected:
-    static xercesc::DOMNode *s_currentElement;
 private:
     xercesc::DOMDocument *m_doc;
     xercesc::XercesDOMParser *m_parser;
diff --git a/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx b/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
index 1f4b24cc2c9d..b31ba3e01dd7 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/AGDDController.cxx
@@ -98,7 +98,7 @@ void AGDDController::ParseFiles()
 {
 	if (!m_theParser) m_theParser=new XercesParser;
 	for (unsigned int i=0;i<m_filesToParse.size();i++) {
-		if (!m_theParser->ParseFileAndNavigate(m_filesToParse[i])) throw std::runtime_error(Form("File: %s, Line: %d\nAGDDController::ParseFiles() - Could parse file %s.", __FILE__, __LINE__, m_filesToParse[i].c_str()));
+		if (!m_theParser->ParseFileAndNavigate(*this, m_filesToParse[i])) throw std::runtime_error(Form("File: %s, Line: %d\nAGDDController::ParseFiles() - Could parse file %s.", __FILE__, __LINE__, m_filesToParse[i].c_str()));
 	}
 }
 
@@ -132,7 +132,7 @@ void AGDDController::PrintSections() const
 void AGDDController::ParseString(const std::string& s)
 {
 	if (!m_theParser) m_theParser=new XercesParser;
-	m_theParser->ParseStringAndNavigate(s);
+	m_theParser->ParseStringAndNavigate(*this, s);
 }
 
 bool AGDDController::WriteAGDDtoDBFile(const std::string& s)
diff --git a/DetectorDescription/AGDD/AGDDControl/src/XMLHandler.cxx b/DetectorDescription/AGDD/AGDDControl/src/XMLHandler.cxx
index ac932770fbdd..bf36e0d2a617 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/XMLHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/XMLHandler.cxx
@@ -1,26 +1,27 @@
 /*
-  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 "AGDDControl/XMLHandler.h"
 #include "AGDDControl/XMLHandlerStore.h"
+#include "AGDDControl/AGDDController.h"
 
 #include <memory>
 #include <vector>
 
 using namespace xercesc;
 
-DOMNode* XMLHandler::s_currentElement=0;
 bool XMLHandler::s_printFlag=false;
 
-XMLHandler::XMLHandler(std::string n):m_name(n) 
+XMLHandler::XMLHandler(const std::string& n, AGDDController& c)
+  : m_name(n)
 {
 //    std::cout<< " creating new handler "<<n<<std::endl;
 	m_stopLoop=false;
-	RegisterToStore();
+	RegisterToStore(c);
 }
 
-void XMLHandler::RegisterToStore() 
+void XMLHandler::RegisterToStore(AGDDController& /*c*/)
 {
 	XMLHandlerStore::GetHandlerStore()->RegisterHandler(this);
 }
@@ -33,18 +34,20 @@ bool XMLHandler::IsLoopToBeStopped()
 {
 	return m_stopLoop;
 }
-bool XMLHandler::isAttribute(const std::string name) const
+bool XMLHandler::isAttribute(const xercesc::DOMNode* t,
+                             const std::string& name) const
 {
 	bool res;
-	std::string temp=getAttribute(name,res);
+	std::string temp=getAttribute(t, name,res);
 	return res;
 }
-std::string XMLHandler::getAttribute(const std::string name, bool& isPresent) const
+std::string XMLHandler::getAttribute(const xercesc::DOMNode* t,
+                                     const std::string& name, bool& isPresent) const
 {
 	std::string retValue="";
 	isPresent=false;
-	if (s_currentElement->hasAttributes()) {
-		DOMNamedNodeMap *pAttributes = s_currentElement->getAttributes();
+	if (t->hasAttributes()) {
+		DOMNamedNodeMap *pAttributes = t->getAttributes();
 		auto deleter = [&](XMLCh buf[]) { XMLString::release(&buf); };
 		std::unique_ptr<XMLCh[], decltype(deleter)> ptr(XMLString::transcode(name.c_str()), deleter);
 		DOMAttr *pAttributeNode = (DOMAttr*) pAttributes->getNamedItem(ptr.get());
@@ -64,36 +67,44 @@ std::string XMLHandler::getAttribute(const std::string name, bool& isPresent) co
 	}
 	return retValue;
 }
-std::string XMLHandler::getAttributeAsString(const std::string name) const
+std::string XMLHandler::getAttributeAsString(AGDDController& /*c*/,
+                                             const xercesc::DOMNode* t,
+                                             const std::string& name) const
 {
 	bool isPresent;
-	std::string temp=getAttribute(name,isPresent);
+	std::string temp=getAttribute(t, name,isPresent);
 	if (!isPresent) throw;
 	return temp;
 }
-double XMLHandler::getAttributeAsDouble(const std::string name) const
+double XMLHandler::getAttributeAsDouble(AGDDController& /*c*/,
+                                        const xercesc::DOMNode* t,
+                                        const std::string& name) const
 {
         double res=0.;
         bool isPresent;
-        std::string temp=getAttribute(name,isPresent);
+        std::string temp=getAttribute(t, name,isPresent);
 	if (!isPresent) throw;
         res=Evaluator().Eval(temp.c_str());
         return res;
 }
-int XMLHandler::getAttributeAsInt(const std::string name) const
+int XMLHandler::getAttributeAsInt(AGDDController& /*c*/,
+                                  const xercesc::DOMNode* t,
+                                  const std::string& name) const
 {
         int res=0;
         bool isPresent;
-        std::string temp=getAttribute(name,isPresent);
+        std::string temp=getAttribute(t, name,isPresent);
 	if (!isPresent) throw;
         res=Evaluator().Eval(temp.c_str());
         return res;
 }
-std::vector<double> XMLHandler::getAttributeAsVector(const std::string name) const
+std::vector<double> XMLHandler::getAttributeAsVector(AGDDController& /*c*/,
+                                                     const xercesc::DOMNode* t,
+                                                     const std::string& name) const
 {
 	bool isPresent;
         std::vector<double> vect;
-        std::string temp=getAttribute(name,isPresent);
+        std::string temp=getAttribute(t, name,isPresent);
         if (!isPresent) throw;
         std::vector<std::string> v=Evaluator().tokenize(";",temp);
         for (unsigned int i=0;i<v.size();i++)
@@ -103,11 +114,13 @@ std::vector<double> XMLHandler::getAttributeAsVector(const std::string name) con
         return vect;
 }
 
-std::vector<int> XMLHandler::getAttributeAsIntVector(const std::string name) const
+std::vector<int> XMLHandler::getAttributeAsIntVector(AGDDController& /*c*/,
+                                                     const xercesc::DOMNode* t,
+                                                     const std::string& name) const
 {
         bool isPresent;
         std::vector<int> vect;
-        std::string temp=getAttribute(name,isPresent);
+        std::string temp=getAttribute(t, name,isPresent);
         if (!isPresent) throw;
         std::vector<std::string> v=Evaluator().tokenize(";",temp);
         for (unsigned int i=0;i<v.size();i++)
@@ -117,35 +130,43 @@ std::vector<int> XMLHandler::getAttributeAsIntVector(const std::string name) con
         return vect;
 }
 
-std::string XMLHandler::getAttributeAsString(const std::string name, bool& isPresent) const
+std::string XMLHandler::getAttributeAsString(AGDDController& /*c*/,
+                                             const xercesc::DOMNode* t,
+                                             const std::string& name, bool& isPresent) const
 {
-        std::string temp=getAttribute(name,isPresent);
+        std::string temp=getAttribute(t, name,isPresent);
         return temp;
 } 
-double XMLHandler::getAttributeAsDouble(const std::string name, bool& isPresent) const
+double XMLHandler::getAttributeAsDouble(AGDDController& /*c*/,
+                                        const xercesc::DOMNode* t,
+                                        const std::string& name, bool& isPresent) const
 {
 	double res=0.;
-	std::string temp=getAttribute(name,isPresent);
+	std::string temp=getAttribute(t, name,isPresent);
 	if (isPresent) 
 	{
 		res=Evaluator().Eval(temp.c_str());
 	}
 	return res;
 }
-int XMLHandler::getAttributeAsInt(const std::string name, bool& isPresent) const
+int XMLHandler::getAttributeAsInt(AGDDController& /*c*/,
+                                  const xercesc::DOMNode* t,
+                                  const std::string& name, bool& isPresent) const
 {
 	int res=0;
-	std::string temp=getAttribute(name,isPresent);
+	std::string temp=getAttribute(t, name,isPresent);
 	if (isPresent) 
 	{
 		res=Evaluator().Eval(temp.c_str());
 	}
 	return res;
 }
-std::vector<double> XMLHandler::getAttributeAsVector(const std::string name, bool& isPresent) const
+std::vector<double> XMLHandler::getAttributeAsVector(AGDDController& /*c*/,
+                                                     const xercesc::DOMNode* t,
+                                                     const std::string& name, bool& isPresent) const
 {
 	std::vector<double> vect;
-	std::string temp=getAttribute(name,isPresent);
+	std::string temp=getAttribute(t, name,isPresent);
 	if (isPresent) 
 	{
 		std::vector<std::string> v=Evaluator().tokenize(";",temp);
@@ -157,10 +178,12 @@ std::vector<double> XMLHandler::getAttributeAsVector(const std::string name, boo
 	return vect;
 }
 
-std::vector<int> XMLHandler::getAttributeAsIntVector(const std::string name, bool& isPresent) const
+std::vector<int> XMLHandler::getAttributeAsIntVector(AGDDController& /*c*/,
+                                                     const xercesc::DOMNode* t,
+                                                     const std::string& name, bool& isPresent) const
 {
         std::vector<int> vect;
-        std::string temp=getAttribute(name,isPresent);
+        std::string temp=getAttribute(t, name,isPresent);
         if (isPresent)
         {
                 std::vector<std::string> v=Evaluator().tokenize(";",temp);
@@ -172,18 +195,22 @@ std::vector<int> XMLHandler::getAttributeAsIntVector(const std::string name, boo
         return vect;
 }
 
-std::string XMLHandler::getAttributeAsString(const std::string name, const std::string def) const
+std::string XMLHandler::getAttributeAsString(AGDDController& /*c*/,
+                                             const xercesc::DOMNode* t,
+                                             const std::string& name, const std::string& def) const
 {
 	bool isPresent;
-	std::string temp=getAttribute(name,isPresent);
+	std::string temp=getAttribute(t, name,isPresent);
 	if (isPresent) return temp;
 	else return def;
 }
-double XMLHandler::getAttributeAsDouble(const std::string name, const double def) const
+double XMLHandler::getAttributeAsDouble(AGDDController& /*c*/,
+                                        const xercesc::DOMNode* t,
+                                        const std::string& name, const double def) const
 {
 	bool isPresent;
 	double res=0.;
-	std::string temp=getAttribute(name,isPresent);
+	std::string temp=getAttribute(t, name,isPresent);
 	if (isPresent) 
 	{
 		res=Evaluator().Eval(temp.c_str());
@@ -191,11 +218,13 @@ double XMLHandler::getAttributeAsDouble(const std::string name, const double def
 	}
 	return def;
 }
-int XMLHandler::getAttributeAsInt(const std::string name, const int def) const
+int XMLHandler::getAttributeAsInt(AGDDController& /*c*/,
+                                  const xercesc::DOMNode* t,
+                                  const std::string& name, const int def) const
 {
 	bool isPresent;
 	int res=0;
-	std::string temp=getAttribute(name,isPresent);
+	std::string temp=getAttribute(t, name,isPresent);
 	if (isPresent) 
 	{
 		res=Evaluator().Eval(temp.c_str());
@@ -203,11 +232,13 @@ int XMLHandler::getAttributeAsInt(const std::string name, const int def) const
 	}
 	return def;
 }
-std::vector<double> XMLHandler::getAttributeAsVector(const std::string name, const std::vector<double> def) const
+std::vector<double> XMLHandler::getAttributeAsVector(AGDDController& /*c*/,
+                                                     const xercesc::DOMNode* t,
+                                                     const std::string& name, const std::vector<double>& def) const
 {
 	bool isPresent;
 	std::vector<double> vect;
-	std::string temp=getAttribute(name,isPresent);
+	std::string temp=getAttribute(t, name,isPresent);
 	if (isPresent) 
 	{
 		std::vector<std::string> v=Evaluator().tokenize(";",temp);
@@ -220,11 +251,13 @@ std::vector<double> XMLHandler::getAttributeAsVector(const std::string name, con
 	return def;
 }
 
-std::vector<int> XMLHandler::getAttributeAsIntVector(const std::string name, const std::vector<int> def) const
+std::vector<int> XMLHandler::getAttributeAsIntVector(AGDDController& /*c*/,
+                                                     const xercesc::DOMNode* t,
+                                                     const std::string& name, const std::vector<int>& def) const
 {
         bool isPresent;
         std::vector<int> vect;
-        std::string temp=getAttribute(name,isPresent);
+        std::string temp=getAttribute(t, name,isPresent);
         if (isPresent)
         {
                 std::vector<std::string> v=Evaluator().tokenize(";",temp);
diff --git a/DetectorDescription/AGDD/AGDDControl/src/XMLHandlerStore.cxx b/DetectorDescription/AGDD/AGDDControl/src/XMLHandlerStore.cxx
index 4bd91b83fdb5..a392938692d5 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/XMLHandlerStore.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/XMLHandlerStore.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 "AGDDControl/XMLHandlerStore.h"
@@ -30,13 +30,13 @@ void XMLHandlerStore::RegisterHandler(XMLHandler* handler)
 		(*this)[name]=handler;
 }
 
-void XMLHandlerStore::Handle(DOMNode *element)
+void XMLHandlerStore::Handle(AGDDController& c, DOMNode *element)
 {
 	char* temp=XMLString::transcode(element->getNodeName());
 	std::string name=temp;
 	XMLString::release(&temp);
 	if (this->find(name)!=this->end()) 
-		((*this)[name])->Handle(element);
+		((*this)[name])->Handle(c, element);
 	else
 		std::cout<<" Handler for "<<name<<" not found! continuing"<<std::endl;
 }
diff --git a/DetectorDescription/AGDD/AGDDControl/src/XercesParser.cxx b/DetectorDescription/AGDD/AGDDControl/src/XercesParser.cxx
index 20cd7d47a465..0d70a6940a07 100644
--- a/DetectorDescription/AGDD/AGDDControl/src/XercesParser.cxx
+++ b/DetectorDescription/AGDD/AGDDControl/src/XercesParser.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 "AGDDControl/XercesParser.h"
@@ -23,8 +23,6 @@
 
 using namespace xercesc;
 
-DOMNode* XercesParser::s_currentElement=0;
-
 XercesParser::~XercesParser()
 {
 	delete m_parser;
@@ -34,13 +32,13 @@ XercesParser::~XercesParser()
 
 XercesParser::XercesParser():IAGDDParser(),m_doc(0),m_parser(0),m_initialized(false) {}
 
-XercesParser::XercesParser(std::string s):IAGDDParser(s),m_doc(0),m_parser(0),m_initialized(false) {}
+XercesParser::XercesParser(const std::string& s):IAGDDParser(s),m_doc(0),m_parser(0),m_initialized(false) {}
 
-bool XercesParser::ParseFile(std::string s)
+bool XercesParser::ParseFile(const std::string& s_in)
 {
 	bool errorsOccured = false;
-    m_fileName=s;
-	s=PathResolver::find_file(s,"XMLPATH",PathResolver::RecursiveSearch);
+        m_fileName=s_in;
+        std::string s=PathResolver::find_file(s_in,"XMLPATH",PathResolver::RecursiveSearch);
 	if (s.empty()) {
 		MsgStream log(Athena::getMessageSvc(), "XercesParser");
 		log<<MSG::WARNING<<"ParseFile() - something wrong, could not find XML file "<<s<<endmsg;
@@ -88,14 +86,15 @@ bool XercesParser::ParseFile(std::string s)
 	}
     return errorsOccured;
 }
-bool XercesParser::ParseFileAndNavigate(std::string s)
+bool XercesParser::ParseFileAndNavigate(AGDDController& c,
+                                        const std::string& s)
 {
     bool errorOccured = ParseFile(s);
     if (errorOccured) return false;
-	navigateTree();
+	navigateTree(c);
 	return true;
 }
-bool XercesParser::ParseString(std::string s)
+bool XercesParser::ParseString(const std::string& s)
 {
 	const char* str=s.c_str();
 	static const char* memBufID="prodInfo";
@@ -139,14 +138,15 @@ bool XercesParser::ParseString(std::string s)
 	m_doc=m_parser->getDocument();
 	return errorsOccured;
 }
-bool XercesParser::ParseStringAndNavigate(std::string s)
+bool XercesParser::ParseStringAndNavigate(AGDDController& c,
+                                          const std::string& s)
 {
     bool errorOccured = ParseString(s);
-	if (!errorOccured) navigateTree();
-	return true;
+    if (!errorOccured) navigateTree(c);
+    return true;
 }
 
-bool XercesParser::WriteToFile(std::string s)
+bool XercesParser::WriteToFile(const std::string& s)
 {
 	XMLCh tempStr[100];
 	XMLString::transcode("LS 3.0 Core 2.0", tempStr, 99);
@@ -170,7 +170,7 @@ bool XercesParser::WriteToFile(std::string s)
 	return true;
 }
 
-void XercesParser::navigateTree()
+void XercesParser::navigateTree(AGDDController& c)
 {
     if (!m_doc) {
         MsgStream log(Athena::getMessageSvc(), "XercesParser");
@@ -180,13 +180,13 @@ void XercesParser::navigateTree()
     DOMNode* node = 0;
     node = dynamic_cast<DOMNode*>(m_doc->getDocumentElement());
     if( !node ) throw;
-    s_currentElement=node;
-    elementLoop(node);
+    elementLoop(c, node);
 }
 
 void XercesParser::elementLoop() {}
 
-void XercesParser::elementLoop(DOMNode *e)
+void XercesParser::elementLoop(AGDDController& c,
+                               DOMNode *e)
 {
 	if (!e) {
 		MsgStream log(Athena::getMessageSvc(), "XercesParser");
@@ -194,12 +194,11 @@ void XercesParser::elementLoop(DOMNode *e)
 		return;
 	}
 	if (!(e->getNodeType()==DOMNode::ELEMENT_NODE)) return;
-	s_currentElement=e;
 	XMLHandler *h=XMLHandlerStore::GetHandlerStore()->GetHandler(e);
 	bool stopLoop=false;
 	if (h)
 	{
-		h->Handle(e);
+		h->Handle(c, e);
 		stopLoop=h->IsLoopToBeStopped();
 	}
 	DOMNode *child;
@@ -212,7 +211,7 @@ void XercesParser::elementLoop(DOMNode *e)
 		for (child=e->getFirstChild();child!=0;child=child->getNextSibling())
 		{
 			if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-				elementLoop(child);
+				elementLoop(c, child);
 			}
 		}
 	}
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/AGDDHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/AGDDHandler.h
index 71fd2e807920..79f842a987bc 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/AGDDHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/AGDDHandler.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 AGDDHandler_H
@@ -10,8 +10,9 @@
 
 class AGDDHandler:public XMLHandler {
 public:
-	AGDDHandler(std::string);
-	void ElementHandle();
+	AGDDHandler(const std::string&, AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 
 };
 
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/BoltHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/BoltHandler.h
index 9ce071dc155a..a639588478bb 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/BoltHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/BoltHandler.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 BoltHandler_H
@@ -10,9 +10,10 @@
 
 class BoltHandler:public XMLHandler {
 public:
-	BoltHandler(std::string);
-	void ElementHandle();
-
+	BoltHandler(const std::string&,
+                    AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/IbeamHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/IbeamHandler.h
index 79dc1f9dfdb2..d852b8ee6dc4 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/IbeamHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/IbeamHandler.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 IbeamHandler_H
@@ -10,9 +10,10 @@
 
 class IbeamHandler:public XMLHandler {
 public:
-	IbeamHandler(std::string);
-	void ElementHandle();
-
+	IbeamHandler(const std::string&,
+                    AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/UbeamHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/UbeamHandler.h
index 897c930c1318..1f9af4d96289 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/UbeamHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/UbeamHandler.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 UbeamHandler_H
@@ -10,9 +10,10 @@
 
 class UbeamHandler:public XMLHandler {
 public:
-	UbeamHandler(std::string);
-	void ElementHandle();
-
+	UbeamHandler(const std::string&,
+                     AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/addmaterialHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/addmaterialHandler.h
index 97e65aa773b5..49265d1f843e 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/addmaterialHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/addmaterialHandler.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 addmaterialHandler_H
@@ -10,8 +10,13 @@
 
 class addmaterialHandler:public XMLHandler {
 public:
-	addmaterialHandler(std::string);
-	void ElementHandle();
+	addmaterialHandler(const std::string&,
+                           AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
+        std::vector<std::string> GetNames();
+private:
+        std::vector<std::string> m_names;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/aliasHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/aliasHandler.h
index 494e26ac9dc6..119519ddd5f6 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/aliasHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/aliasHandler.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 aliasHandler_H
@@ -10,9 +10,10 @@
 
 class aliasHandler:public XMLHandler {
 public:
-	aliasHandler(std::string);
-	void ElementHandle();
-
+	aliasHandler(const std::string&,
+                     AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/arrayHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/arrayHandler.h
index 00487b123ea2..21f12e171812 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/arrayHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/arrayHandler.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 arrayHandler_H
@@ -10,9 +10,10 @@
 
 class arrayHandler:public XMLHandler {
 public:
-	arrayHandler(std::string);
-	void ElementHandle();
-
+	arrayHandler(const std::string&,
+                     AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/boxHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/boxHandler.h
index 7dbdae760d03..c7b67abaeb0e 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/boxHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/boxHandler.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 boxHandler_H
@@ -10,9 +10,10 @@
 
 class boxHandler:public XMLHandler {
 public:
-	boxHandler(std::string);
-	void ElementHandle();
-
+	boxHandler(const std::string&,
+                   AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/chamberPositionerHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/chamberPositionerHandler.h
index fca280311ec7..e55e367008e4 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/chamberPositionerHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/chamberPositionerHandler.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 chamberPositionerHandler_H
@@ -11,9 +11,10 @@
 
 class chamberPositionerHandler:public XMLHandler {
 public:
-	chamberPositionerHandler(std::string);
-	void ElementHandle();
-
+        chamberPositionerHandler(const std::string&,
+                                 AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/colorHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/colorHandler.h
index 5a5df74b420f..f702491661f1 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/colorHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/colorHandler.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 colorHandler_H
@@ -12,10 +12,10 @@ class AGDDColor;
 
 class colorHandler:public XMLHandler {
 public:
-	colorHandler(std::string);
-	void ElementHandle();
-
-	AGDDColor *color;
+	colorHandler(const std::string&,
+                     AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/compositeHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/compositeHandler.h
index 07a403e36b69..c050f2f37ff3 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/compositeHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/compositeHandler.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 compositeHandler_H
@@ -10,9 +10,10 @@
 
 class compositeHandler:public XMLHandler {
 public:
-	compositeHandler(std::string);
-	void ElementHandle();
-
+	compositeHandler(const std::string&,
+                         AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/compositionHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/compositionHandler.h
index d257bfe640bf..88c7480a36f9 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/compositionHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/compositionHandler.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 compositionHandler_H
@@ -10,9 +10,10 @@
 
 class compositionHandler:public XMLHandler {
 public:
-	compositionHandler(std::string);
-	void ElementHandle();
-
+	compositionHandler(const std::string&,
+                           AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/consHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/consHandler.h
index e79bdcec85c8..a83cc7c76a01 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/consHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/consHandler.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 consHandler_H
@@ -10,9 +10,10 @@
 
 class consHandler:public XMLHandler {
 public:
-	consHandler(std::string);
-	void ElementHandle();
-
+	consHandler(const std::string&,
+                    AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/defaultsHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/defaultsHandler.h
index 80710707ab68..d71efd1be926 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/defaultsHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/defaultsHandler.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 defaultsHandler_H
@@ -10,9 +10,10 @@
 
 class defaultsHandler:public XMLHandler {
 public:
-	defaultsHandler(std::string);
-	void ElementHandle();
-
+	defaultsHandler(const std::string&,
+                        AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/elcylHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/elcylHandler.h
index 9c7a83ff08ed..bae361cd09b0 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/elcylHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/elcylHandler.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 elcylHandler_H
@@ -10,9 +10,10 @@
 
 class elcylHandler:public XMLHandler {
 public:
-	elcylHandler(std::string);
-	void ElementHandle();
-
+	elcylHandler(const std::string&,
+                     AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/elementHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/elementHandler.h
index fc722993e66d..cdcccc3d616e 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/elementHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/elementHandler.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 elementHandler_H
@@ -12,10 +12,10 @@ class AGDDMaterial;
 
 class elementHandler:public XMLHandler {
 public:
-	elementHandler(std::string);
-	void ElementHandle();
-
-	AGDDMaterial *mat;
+        elementHandler(const std::string&,
+                       AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/foreachHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/foreachHandler.h
index 031f5f8cff89..4a621cf87dc0 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/foreachHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/foreachHandler.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 foreachHandler_H
@@ -10,9 +10,10 @@
 
 class foreachHandler:public XMLHandler {
 public:
-	foreachHandler(std::string);
-	void ElementHandle();
-
+	foreachHandler(const std::string&,
+                       AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/fractionmassHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/fractionmassHandler.h
index dbfb978e30f2..923e9ff862c2 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/fractionmassHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/fractionmassHandler.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 fractionmassHandler_H
@@ -10,9 +10,13 @@
 
 class fractionmassHandler:public XMLHandler {
 public:
-	fractionmassHandler(std::string);
-	void ElementHandle();
-
+	fractionmassHandler(const std::string&,
+                            AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
+        std::vector<double> GetFractions();
+private:
+        std::vector<double> m_fractions;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxyHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxyHandler.h
index f4d04b355e14..a870fa2a52c2 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxyHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxyHandler.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 gvxyHandler_H
@@ -10,9 +10,10 @@
 
 class gvxyHandler:public XMLHandler {
 public:
-	gvxyHandler(std::string);
-	void ElementHandle();
-
+	gvxyHandler(const std::string&,
+                    AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxy_pointHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxy_pointHandler.h
index 38d507fed4a3..bf3ab30b771f 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxy_pointHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxy_pointHandler.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 gvxy_pointHandler_H
@@ -11,8 +11,10 @@
 
 class gvxy_pointHandler:public XMLHandler {
 public:
-	gvxy_pointHandler(std::string);
-	void ElementHandle();
+	gvxy_pointHandler(const std::string&,
+                          AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 	static TwoPoint CurrentTwoPoint() {return s_point;}
 private:
 	static TwoPoint s_point;
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxysxHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxysxHandler.h
index 47f96131b7c2..bc5557c7f3f7 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxysxHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxysxHandler.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 gvxysxHandler_H
@@ -10,9 +10,10 @@
 
 class gvxysxHandler:public XMLHandler {
 public:
-	gvxysxHandler(std::string);
-	void ElementHandle();
-
+	gvxysxHandler(const std::string&,
+                      AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxysxyHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxysxyHandler.h
index e7e65b406cb8..f9b572275c68 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxysxyHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/gvxysxyHandler.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 gvxysxyHandler_H
@@ -10,9 +10,10 @@
 
 class gvxysxyHandler:public XMLHandler {
 public:
-	gvxysxyHandler(std::string);
-	void ElementHandle();
-
+	gvxysxyHandler(const std::string&,
+                       AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/importHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/importHandler.h
index e527d329023e..09956df27f20 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/importHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/importHandler.h
@@ -13,10 +13,9 @@ class AGDDController;
 class importHandler:public XMLHandler {
 public:
         importHandler(const std::string&,
-                      AGDDController& controller);
-        virtual void ElementHandle() override;
-private:
-        AGDDController& m_controller;
+                      AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/intersectionHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/intersectionHandler.h
index 77e1e241e19a..7063f1ba6f02 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/intersectionHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/intersectionHandler.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 intersectionHandler_H
@@ -10,9 +10,10 @@
 
 class intersectionHandler:public XMLHandler {
 public:
-	intersectionHandler(std::string);
-	void ElementHandle();
-
+        intersectionHandler(const std::string&,
+                            AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/materialHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/materialHandler.h
index 94eadbbb075a..ee4ecbe95800 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/materialHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/materialHandler.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 materialHandler_H
@@ -11,10 +11,10 @@
 class AGDDMaterial;
 class materialHandler:public XMLHandler {
 public:
-	materialHandler(std::string);
-	void ElementHandle();
-
-	AGDDMaterial *mat;
+	materialHandler(const std::string&,
+                        AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/materialsHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/materialsHandler.h
index e499f46bacf8..3c6e1cf3fb8b 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/materialsHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/materialsHandler.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 materialsHandler_H
@@ -10,9 +10,10 @@
 
 class materialsHandler:public XMLHandler {
 public:
-	materialsHandler(std::string);
-	void ElementHandle();
-
+	materialsHandler(const std::string&,
+                         AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/mposPhiHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/mposPhiHandler.h
index 692cb42202aa..93693ad74f26 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/mposPhiHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/mposPhiHandler.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 mposPhiHandler_H
@@ -12,10 +12,10 @@ class AGDDPositioner;
 
 class mposPhiHandler:public XMLHandler {
 public:
-	mposPhiHandler(std::string);
-	void ElementHandle();
-
-	AGDDPositioner* p;
+        mposPhiHandler(const std::string&,
+                       AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/mposWedgeHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/mposWedgeHandler.h
index c73a7f6954f6..fd03d64ac230 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/mposWedgeHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/mposWedgeHandler.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 mposWedgeHandler_H
@@ -12,10 +12,10 @@ class AGDDPositioner;
 
 class mposWedgeHandler:public XMLHandler {
 public:
-	mposWedgeHandler(std::string);
-	void ElementHandle();
-
-	AGDDPositioner *p;
+        mposWedgeHandler(const std::string&,
+                         AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/msgHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/msgHandler.h
index e9400fc42a43..07c058347c2c 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/msgHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/msgHandler.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 msgHandler_H
@@ -10,8 +10,10 @@
 
 class msgHandler:public XMLHandler {
 public:
-	msgHandler(std::string);
-	void ElementHandle();
+	msgHandler(const std::string&,
+                   AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 
 };
 
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/natomsHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/natomsHandler.h
index b14a2130ab21..9d4ac865ea81 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/natomsHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/natomsHandler.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 natomsHandler_H
@@ -10,9 +10,13 @@
 
 class natomsHandler:public XMLHandler {
 public:
-	natomsHandler(std::string);
-	void ElementHandle();
-
+	natomsHandler(const std::string&,
+                      AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
+        std::vector<int> GetNatoms();
+private:
+        std::vector<int> m_natoms;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/pconHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/pconHandler.h
index 677112cfde0d..2bc4a06a83fc 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/pconHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/pconHandler.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 pconHandler_H
@@ -10,9 +10,10 @@
 
 class pconHandler:public XMLHandler {
 public:
-	pconHandler(std::string);
-	void ElementHandle();
-
+	pconHandler(const std::string&,
+                    AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/pgonHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/pgonHandler.h
index 8f861ca701fb..40bdb411fd25 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/pgonHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/pgonHandler.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 pgonHandler_H
@@ -10,9 +10,10 @@
 
 class pgonHandler:public XMLHandler {
 public:
-	pgonHandler(std::string);
-	void ElementHandle();
-
+	pgonHandler(const std::string&,
+                    AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/polyplaneHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/polyplaneHandler.h
index eccdb2c120d3..fbdc55ec1f1a 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/polyplaneHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/polyplaneHandler.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 polyplaneHandler_H
@@ -11,8 +11,10 @@
 
 class polyplaneHandler:public XMLHandler {
 public:
-	polyplaneHandler(std::string);
-	void ElementHandle();
+	polyplaneHandler(const std::string&,
+                         AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 	static Polyplane CurrentPolyplane() {return s_pPlane;}
 private:
 	static Polyplane s_pPlane;
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/posRPhiZHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/posRPhiZHandler.h
index 1cef435de60e..0a8c509af98a 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/posRPhiZHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/posRPhiZHandler.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 posRPhiZHandler_H
@@ -13,10 +13,10 @@ class AGDDPositioner;
 
 class posRPhiZHandler:public XMLHandler {
 public:
-	posRPhiZHandler(std::string);
-	void ElementHandle();
-
-	AGDDPositioner *p;
+        posRPhiZHandler(const std::string&,
+                        AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/posXYZHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/posXYZHandler.h
index 50b0a47be05b..21b57d375706 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/posXYZHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/posXYZHandler.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 posXYZHandler_H
@@ -11,9 +11,10 @@
 
 class posXYZHandler:public XMLHandler {
 public:
-	posXYZHandler(std::string);
-	void ElementHandle();
-
+        posXYZHandler(const std::string&,
+                      AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/ringHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/ringHandler.h
index 9ac88541a090..c2c886e1c18e 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/ringHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/ringHandler.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 ringHandler_H
@@ -10,9 +10,10 @@
 
 class ringHandler:public XMLHandler {
 public:
-	ringHandler(std::string);
-	void ElementHandle();
-
+	ringHandler(const std::string&,
+                    AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/sectionHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/sectionHandler.h
index 535366394590..49626d7cb914 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/sectionHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/sectionHandler.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 sectionHandler_H
@@ -12,10 +12,10 @@ class AGDDSection;
 
 class sectionHandler:public XMLHandler {
 public:
-	sectionHandler(std::string);
-	void ElementHandle();
-
-	AGDDSection *sect;
+	sectionHandler(const std::string&,
+                       AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/sectorHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/sectorHandler.h
index db53f7d6620c..f61ad77c9e5e 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/sectorHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/sectorHandler.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 sectorHandler_H
@@ -10,9 +10,10 @@
 
 class sectorHandler:public XMLHandler {
 public:
-	sectorHandler(std::string);
-	void ElementHandle();
-
+	sectorHandler(const std::string&,
+                      AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snakeHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snakeHandler.h
index be922d25b096..04cdfbebd46a 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snakeHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snakeHandler.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 snakeHandler_H
@@ -11,9 +11,10 @@
 
 class snakeHandler:public XMLHandler {
 public:
-	snakeHandler(std::string);
-	void ElementHandle();
-
+	snakeHandler(const std::string&,
+                     AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.h
index d80b989c6912..6a96ffb3dbe9 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/snake_pointHandler.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 snake_pointHandler_H
@@ -13,8 +13,10 @@
 
 class snake_pointHandler:public XMLHandler {
 public:
-	snake_pointHandler(std::string);
-	void ElementHandle();
+	snake_pointHandler(const std::string&,
+                           AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 	static GeoTrf::Vector3D CurrentPoint() {return s_point;}
 private:
 	static GeoTrf::Vector3D s_point;
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/subtractionHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/subtractionHandler.h
index e980618c3779..befe51af0fd2 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/subtractionHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/subtractionHandler.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 subtractionHandler_H
@@ -11,9 +11,10 @@
 
 class subtractionHandler:public XMLHandler {
 public:
-	subtractionHandler(std::string);
-	void ElementHandle();
-
+	subtractionHandler(const std::string&,
+                           AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/trdHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/trdHandler.h
index cb47623f3e70..d54683bc7d05 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/trdHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/trdHandler.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 trdHandler_H
@@ -11,9 +11,10 @@
 
 class trdHandler:public XMLHandler {
 public:
-	trdHandler(std::string);
-	void ElementHandle();
-
+	trdHandler(const std::string&,
+                   AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/tubsHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/tubsHandler.h
index 4626639d650d..b8defb6e3395 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/tubsHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/tubsHandler.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 tubsHandler_H
@@ -11,9 +11,10 @@
 
 class tubsHandler:public XMLHandler {
 public:
-	tubsHandler(std::string);
-	void ElementHandle();
-
+	tubsHandler(const std::string&,
+                    AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/unionHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/unionHandler.h
index dbaa79724a67..8885bfbd3846 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/unionHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/unionHandler.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 unionHandler_H
@@ -10,9 +10,10 @@
 
 class unionHandler:public XMLHandler {
 public:
-	unionHandler(std::string);
-	void ElementHandle();
-
+	unionHandler(const std::string&,
+                     AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/varHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/varHandler.h
index 41a79a149fc7..8a356665a954 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/varHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/varHandler.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 varHandler_H
@@ -10,9 +10,10 @@
 
 class varHandler:public XMLHandler {
 public:
-	varHandler(std::string);
-	void ElementHandle();
-
+	varHandler(const std::string&,
+                   AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/versionHandler.h b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/versionHandler.h
index 12107bd75008..8481ca18ac5b 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/versionHandler.h
+++ b/DetectorDescription/AGDD/AGDDHandlers/AGDDHandlers/versionHandler.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 versionHandler_H
@@ -10,9 +10,10 @@
 
 class versionHandler:public XMLHandler {
 public:
-	versionHandler(std::string);
-	void ElementHandle();
-
+	versionHandler(const std::string&,
+                       AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/AGDDHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/AGDDHandler.cxx
index 981679a44e91..8bd98fe99926 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/AGDDHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/AGDDHandler.cxx
@@ -1,14 +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 "AGDDHandlers/AGDDHandler.h"
 
-AGDDHandler::AGDDHandler(std::string s):XMLHandler(s)
+AGDDHandler::AGDDHandler(const std::string& s, AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void AGDDHandler::ElementHandle()
+void AGDDHandler::ElementHandle(AGDDController& /*c*/, xercesc::DOMNode */*t*/)
 {
 
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/BoltHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/BoltHandler.cxx
index 306aaf39d27e..3dd950830caa 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/BoltHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/BoltHandler.cxx
@@ -1,24 +1,28 @@
 /*
-  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 "AGDDHandlers/BoltHandler.h"
 #include "AGDDModel/AGDDBolt.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
-BoltHandler::BoltHandler(std::string s):XMLHandler(s)
+BoltHandler::BoltHandler(const std::string& s,
+                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void BoltHandler::ElementHandle()
+void BoltHandler::ElementHandle(AGDDController& c,
+                                xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name",res);
-	std::string material=getAttributeAsString("material",res);
-	double l=getAttributeAsDouble("length",res);
-	double d=getAttributeAsDouble("diameter",res);
-	double hd=getAttributeAsDouble("head_diameter",res);
-	double hl=getAttributeAsDouble("head_length",res);
+	std::string name=getAttributeAsString(c, t, "name",res);
+	std::string material=getAttributeAsString(c, t, "material",res);
+	double l=getAttributeAsDouble(c, t, "length",res);
+	double d=getAttributeAsDouble(c, t, "diameter",res);
+	double hd=getAttributeAsDouble(c, t, "head_diameter",res);
+	double hl=getAttributeAsDouble(c, t, "head_length",res);
 
 	AGDDBolt *b=new AGDDBolt(name);
 	b->SetMaterial(material);
@@ -27,7 +31,7 @@ void BoltHandler::ElementHandle()
 	b->SetDiameter(d);
 	b->SetHeadDiameter(hd);
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		b->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/IbeamHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/IbeamHandler.cxx
index 44ccb991d702..d31462883f93 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/IbeamHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/IbeamHandler.cxx
@@ -1,26 +1,30 @@
 /*
-  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 "AGDDHandlers/IbeamHandler.h"
 #include "AGDDModel/AGDDIbeam.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
-IbeamHandler::IbeamHandler(std::string s):XMLHandler(s)
+IbeamHandler::IbeamHandler(const std::string& s,
+                           AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void IbeamHandler::ElementHandle()
+void IbeamHandler::ElementHandle(AGDDController& c,
+                                 xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name",res);
-	std::string material=getAttributeAsString("material",res);
+	std::string name=getAttributeAsString(c, t, "name",res);
+	std::string material=getAttributeAsString(c, t, "material",res);
 
-	double l=getAttributeAsDouble("length",res);
-	double w=getAttributeAsDouble("width",res);
-	double sw=getAttributeAsDouble("small_width",res);
-	double h=getAttributeAsDouble("heigth",res);
-	double sh=getAttributeAsDouble("small_heigth",res);
+	double l=getAttributeAsDouble(c, t, "length",res);
+	double w=getAttributeAsDouble(c, t, "width",res);
+	double sw=getAttributeAsDouble(c, t, "small_width",res);
+	double h=getAttributeAsDouble(c, t, "heigth",res);
+	double sh=getAttributeAsDouble(c, t, "small_heigth",res);
 	
 	AGDDIbeam *b=new AGDDIbeam(name);
 	b->SetMaterial(material);
@@ -30,7 +34,7 @@ void IbeamHandler::ElementHandle()
 	b->SetHeigth(h);
 	b->SetSmallHeigth(sh);
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (!col.empty())
 		b->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/UbeamHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/UbeamHandler.cxx
index da2ba76f5fb8..70e02072bb8e 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/UbeamHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/UbeamHandler.cxx
@@ -1,28 +1,32 @@
 /*
-  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 "AGDDHandlers/UbeamHandler.h"
 #include "AGDDModel/AGDDUbeam.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-UbeamHandler::UbeamHandler(std::string s):XMLHandler(s)
+UbeamHandler::UbeamHandler(const std::string& s,
+                           AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for Ubeam"<<std::endl;
 }
 
-void UbeamHandler::ElementHandle()
+void UbeamHandler::ElementHandle(AGDDController& c,
+                                 xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name",res);
-	std::string material=getAttributeAsString("material",res);
+	std::string name=getAttributeAsString(c, t, "name",res);
+	std::string material=getAttributeAsString(c, t, "material",res);
 
-	double l=getAttributeAsDouble("length",res);
-	double w=getAttributeAsDouble("width",res);
-	double sw=getAttributeAsDouble("small_width",res);
-	double h=getAttributeAsDouble("heigth",res);
-	double sh=getAttributeAsDouble("small_heigth",res);
+	double l=getAttributeAsDouble(c, t, "length",res);
+	double w=getAttributeAsDouble(c, t, "width",res);
+	double sw=getAttributeAsDouble(c, t, "small_width",res);
+	double h=getAttributeAsDouble(c, t, "heigth",res);
+	double sh=getAttributeAsDouble(c, t, "small_heigth",res);
 	
 	AGDDUbeam *b=new AGDDUbeam(name);
 	b->SetMaterial(material);
@@ -32,7 +36,7 @@ void UbeamHandler::ElementHandle()
 	b->SetHeigth(h);
 	b->SetSmallHeigth(sh);
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (!col.empty())
 		b->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/addmaterialHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/addmaterialHandler.cxx
index 29229affd371..00de19cb4c75 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/addmaterialHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/addmaterialHandler.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 "AGDDHandlers/addmaterialHandler.h"
@@ -7,16 +7,19 @@
 #include "AGDDHandlers/globals.h"
 #include <iostream>
 
-addmaterialHandler::addmaterialHandler(std::string s):XMLHandler(s)
+addmaterialHandler::addmaterialHandler(const std::string& s,
+                                       AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for addmaterial"<<std::endl;
 }
 
-void addmaterialHandler::ElementHandle()
+void addmaterialHandler::ElementHandle(AGDDController& c,
+                                       xercesc::DOMNode *t)
 {
 //	std::cout<<"handling for addmaterial";
 
-	std::string material=getAttributeAsString("material");
+	std::string material=getAttributeAsString(c, t, "material");
 //	std::cout<<" material= "<<material<<std::endl;
 	
 	globals::addMaterial.names.push_back(material);
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/aliasHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/aliasHandler.cxx
index 32056c9455bd..8d8fd5843e4d 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/aliasHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/aliasHandler.cxx
@@ -1,20 +1,24 @@
 /*
-  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 "AGDDHandlers/aliasHandler.h"
 #include "AGDDControl/XMLHandler.h"
+#include "AGDDControl/AGDDController.h"
 #include "AGDDKernel/AliasStore.h"
 #include <iostream>
 
 
-aliasHandler::aliasHandler(std::string s):XMLHandler(s)
+aliasHandler::aliasHandler(const std::string& s,
+                           AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void aliasHandler::ElementHandle()
+void aliasHandler::ElementHandle(AGDDController& c,
+                                 xercesc::DOMNode *t)
 {
-	std::string name=getAttributeAsString("name");
-	std::string value=getAttributeAsString("standsFor");
-	AliasStore::GetAliasList()->AddAlias(name,value);
+	std::string name=getAttributeAsString(c, t, "name");
+	std::string value=getAttributeAsString(c, t, "standsFor");
+        AliasStore::GetAliasList()->AddAlias(name,value);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/arrayHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/arrayHandler.cxx
index 7dae83c7ec94..82c8031a03a5 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/arrayHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/arrayHandler.cxx
@@ -1,18 +1,22 @@
 /*
-  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 "AGDDHandlers/arrayHandler.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-arrayHandler::arrayHandler(std::string s):XMLHandler(s)
+arrayHandler::arrayHandler(const std::string& s,
+                           AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void arrayHandler::ElementHandle()
+void arrayHandler::ElementHandle(AGDDController& c,
+                                 xercesc::DOMNode *t)
 {
-	std::string name=getAttributeAsString("name");
-	std::vector<double> value=getAttributeAsVector("values");
+	std::string name=getAttributeAsString(c, t, "name");
+	std::vector<double> value=getAttributeAsVector(c, t, "values");
 	Evaluator().RegisterArray(name,value);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/boxHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/boxHandler.cxx
index fb448a7d8b68..01f446fb8c47 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/boxHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/boxHandler.cxx
@@ -1,32 +1,36 @@
 /*
-  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 "AGDDHandlers/boxHandler.h"
 #include "AGDDModel/AGDDBox.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-boxHandler::boxHandler(std::string s):XMLHandler(s)
+boxHandler::boxHandler(const std::string& s,
+                       AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void boxHandler::ElementHandle()
+void boxHandler::ElementHandle(AGDDController& c,
+                               xercesc::DOMNode *t)
 {
 //	std::cout<<"this is boxHandler"<<std::endl;
 	bool res;
-	std::string name=getAttributeAsString("name");
+	std::string name=getAttributeAsString(c, t, "name");
 //	std::cout<<"   name "<<name<<std::endl;
-	std::string material=getAttributeAsString("material");
+	std::string material=getAttributeAsString(c, t, "material");
 //	std::cout<<"   material "<<material<<std::endl;
-	std::vector<double> vvv=getAttributeAsVector("X_Y_Z");
+	std::vector<double> vvv=getAttributeAsVector(c, t, "X_Y_Z");
 
 	AGDDBox *b=new AGDDBox(name);
 	b->SetMaterial(material);
 	b->SetXYZ(vvv);
 //	std::cout<<"   dims "<<vvv[0]<<" "<<vvv[1]<<" "<<vvv[2]<<std::endl;
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		b->SetColor(col);
 //	std::cout<<" exiting boxHandler"<<std::endl;
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx
index 50ec56b22bcf..db5da7a0ba02 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/chamberPositionerHandler.cxx
@@ -1,24 +1,28 @@
 /*
-  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 "AGDDHandlers/chamberPositionerHandler.h"
 #include "AGDDKernel/AGDDDetectorStore.h"
 #include "AGDDKernel/AGDDDetectorPositioner.h"
 #include "AGDDKernel/AGDDDetector.h"
+#include "AGDDControl/AGDDController.h"
 #include "GeoModelKernel/Units.h"
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/getMessageSvc.h"
 
 #include <iostream>
 
-chamberPositionerHandler::chamberPositionerHandler(std::string s):XMLHandler(s)
+chamberPositionerHandler::chamberPositionerHandler(const std::string& s,
+                                                   AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void chamberPositionerHandler::ElementHandle()
+void chamberPositionerHandler::ElementHandle(AGDDController& c,
+                                             xercesc::DOMNode *t)
 {
-	std::string volume=getAttributeAsString("volume");
+	std::string volume=getAttributeAsString(c, t, "volume");
 
 	AGDDDetector* mCham=(AGDDDetectorStore::GetDetectorStore())->GetDetector(volume);
 	std::string subType;
@@ -31,18 +35,18 @@ void chamberPositionerHandler::ElementHandle()
 	else
 		subType=mCham->subType();
 	
-	double radius=getAttributeAsDouble("radius");
-	double zPos=getAttributeAsDouble("zPos");
+	double radius=getAttributeAsDouble(c, t, "radius");
+	double zPos=getAttributeAsDouble(c, t, "zPos");
 	
-	double phi0=getAttributeAsDouble("phi0",0.);
-	int iWedge=getAttributeAsInt("wedge_number",8);
+	double phi0=getAttributeAsDouble(c, t, "phi0",0.);
+	int iWedge=getAttributeAsInt(c, t, "wedge_number",8);
 	
-	std::string zLayout=getAttributeAsString("zLayout","Z_SYMMETRIC");
-	std::string type=getAttributeAsString("type","BARREL");
-	std::string chType=getAttributeAsString("chamberType");
-	std::string iSectors=getAttributeAsString("iSectors","11111111");
-	std::string detectorType=getAttributeAsString("detectorType","MDT");
-	int etaIndex=getAttributeAsInt("etaIndex",0);
+	std::string zLayout=getAttributeAsString(c, t, "zLayout","Z_SYMMETRIC");
+	std::string type=getAttributeAsString(c, t, "type","BARREL");
+	std::string chType=getAttributeAsString(c, t, "chamberType");
+	std::string iSectors=getAttributeAsString(c, t, "iSectors","11111111");
+	std::string detectorType=getAttributeAsString(c, t, "detectorType","MDT");
+	int etaIndex=getAttributeAsInt(c, t, "etaIndex",0);
 	
 	double dPhi=360./iWedge;
 	if (iSectors.size()!= (unsigned int) iWedge) throw;
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/colorHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/colorHandler.cxx
index 6eb9fb89ddd0..9a997924c960 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/colorHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/colorHandler.cxx
@@ -1,24 +1,28 @@
 /*
-  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 "AGDDHandlers/colorHandler.h"
 #include "AGDDModel/AGDDColor.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-colorHandler::colorHandler(std::string s):XMLHandler(s),color(0)
+colorHandler::colorHandler(const std::string& s,
+                           AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void colorHandler::ElementHandle()
+void colorHandler::ElementHandle(AGDDController& c,
+                                 xercesc::DOMNode *t)
 {
-	std::string name=getAttributeAsString("name");
+	std::string name=getAttributeAsString(c, t, "name");
 
-	double fred=getAttributeAsDouble("red");
-	double fgreen=getAttributeAsDouble("green");
-	double fblue=getAttributeAsDouble("blue");
+	double fred=getAttributeAsDouble(c, t, "red");
+	double fgreen=getAttributeAsDouble(c, t, "green");
+	double fblue=getAttributeAsDouble(c, t, "blue");
 	double falpha __attribute__((__unused__));
-	falpha=getAttributeAsDouble("alpha",0.);
-	color=new AGDDColor(name,fred,fgreen,fblue);
+	falpha=getAttributeAsDouble(c, t, "alpha",0.);
+	new AGDDColor(name,fred,fgreen,fblue);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/compositeHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/compositeHandler.cxx
index 86f9bf42592c..512a51ff0618 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/compositeHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/compositeHandler.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 "AGDDHandlers/compositeHandler.h"
@@ -12,26 +12,26 @@
 
 using namespace xercesc;
 
-compositeHandler::compositeHandler(std::string s):XMLHandler(s)
+compositeHandler::compositeHandler(const std::string& s,
+                                   AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void compositeHandler::ElementHandle()
+void compositeHandler::ElementHandle(AGDDController& c,
+                                     xercesc::DOMNode *t)
 {
 	globals::addMaterial.Clear();
-
-	std::string name=getAttributeAsString("name");
-	double density=getAttributeAsDouble("density");
+	std::string name=getAttributeAsString(c, t, "name");
+	double density=getAttributeAsDouble(c, t, "density");
 	StopLoop(true);
 	
 	DOMNode* child;
 
-	const DOMNode* cElement=XercesParser::GetCurrentElement();
-    for (child=cElement->getFirstChild();child!=0;child=child->getNextSibling())
+    for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
     {
         if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-        XercesParser::elementLoop(child);
-
+          XercesParser::elementLoop(c, child);
         }
     }
 	
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/compositionHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/compositionHandler.cxx
index 4706f22084e1..37eef83b207a 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/compositionHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/compositionHandler.cxx
@@ -1,10 +1,11 @@
 /*
-  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 "AGDDHandlers/compositionHandler.h"
 #include "AGDDModel/AGDDComposition.h"
 #include "AGDDControl/XercesParser.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 #include "AGDDKernel/AGDDPositioner.h"
 #include "AGDDKernel/AGDDPositionerStore.h"
@@ -13,17 +14,20 @@
 
 using namespace xercesc;
 
-compositionHandler::compositionHandler(std::string s):XMLHandler(s)
+compositionHandler::compositionHandler(const std::string& s,
+                                       AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void compositionHandler::ElementHandle()
+void compositionHandler::ElementHandle(AGDDController& c,
+                                       xercesc::DOMNode *t)
 {
-	std::string name=getAttributeAsString("name");
+	std::string name=getAttributeAsString(c, t, "name");
 //	if (msgLog().level()<=MSG::DEBUG)
 //	msgLog()<<MSG::DEBUG<<" Composition "<<name<<endmsg;
 	
-	AGDDComposition *c=new AGDDComposition(name);
+	AGDDComposition *cm=new AGDDComposition(name);
 	
 	AGDDPositionerStore* pS=AGDDPositionerStore::GetPositionerStore();
 	
@@ -32,10 +36,10 @@ void compositionHandler::ElementHandle()
 	
 	int before=pS->NrOfPositioners();
 	
-	for (child=XercesParser::GetCurrentElement()->getFirstChild();child!=0;child=child->getNextSibling())
+	for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
 	{
 		if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-			XercesParser::elementLoop(child);
+			XercesParser::elementLoop(c, child);
 		}
 	}
 	
@@ -44,7 +48,7 @@ void compositionHandler::ElementHandle()
 	{
 		AGDDPositioner *posit=pS->GetPositioner(i);
 		if (AGDDVolumeStore::GetVolumeStore()->Exist(posit->Volume()))
-			c->AddDaughter(posit);
+			cm->AddDaughter(posit);
 	}
 	
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/consHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/consHandler.cxx
index 1da1bca98a32..4a42e84109a0 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/consHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/consHandler.cxx
@@ -1,29 +1,33 @@
 /*
-  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 "AGDDHandlers/consHandler.h"
 #include "AGDDModel/AGDDCons.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-consHandler::consHandler(std::string s):XMLHandler(s)
+consHandler::consHandler(const std::string& s,
+                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void consHandler::ElementHandle()
+void consHandler::ElementHandle(AGDDController& c,
+                                xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name");
-	std::string material=getAttributeAsString("material");
-	std::vector<double> vvv=getAttributeAsVector("Rio1_Rio2_Z");
+	std::string name=getAttributeAsString(c, t, "name");
+	std::string material=getAttributeAsString(c, t, "material");
+	std::vector<double> vvv=getAttributeAsVector(c, t, "Rio1_Rio2_Z");
 	
 	AGDDCons *b=new AGDDCons(name);
 	b->SetMaterial(material);
 	b->SetRio_Z(vvv);
 	
 	vvv.clear();
-	vvv=getAttributeAsVector("profile",res);
+	vvv=getAttributeAsVector(c, t, "profile",res);
 	if (res)
 	{
 		b->SetProfile(vvv[0],vvv[1]);
@@ -31,7 +35,7 @@ void consHandler::ElementHandle()
 	else
 		b->SetProfile(0.,360.);
 
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		b->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/defaultsHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/defaultsHandler.cxx
index c44681577ba8..ef0887bef018 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/defaultsHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/defaultsHandler.cxx
@@ -1,18 +1,21 @@
 /*
-  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 "AGDDHandlers/defaultsHandler.h"
 
 #include <iostream>
 
-defaultsHandler::defaultsHandler(std::string s):XMLHandler(s)
+defaultsHandler::defaultsHandler(const std::string& s,
+                                 AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void defaultsHandler::ElementHandle()
+void defaultsHandler::ElementHandle(AGDDController& c,
+                                    xercesc::DOMNode *t)
 {
 	bool res;
 //	std::cout<<"handling for defaults";
-	std::string uLength=getAttributeAsString("unit_length",res);
+	std::string uLength=getAttributeAsString(c, t, "unit_length",res);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/elcylHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/elcylHandler.cxx
index da8ad6cfd6f3..b481894877b8 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/elcylHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/elcylHandler.cxx
@@ -1,30 +1,34 @@
 /*
-  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 "AGDDHandlers/elcylHandler.h"
 #include "AGDDModel/AGDDElcyl.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
 
-elcylHandler::elcylHandler(std::string s):XMLHandler(s)
+elcylHandler::elcylHandler(const std::string& s,
+                           AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for tubs"<<std::endl;
 }
 
-void elcylHandler::ElementHandle()
+void elcylHandler::ElementHandle(AGDDController& c,
+                                 xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name");
-	std::string material=getAttributeAsString("material");
-	std::vector<double> vvv=getAttributeAsVector("RXio_RYio_Z");
+	std::string name=getAttributeAsString(c, t, "name");
+	std::string material=getAttributeAsString(c, t, "material");
+	std::vector<double> vvv=getAttributeAsVector(c, t, "RXio_RYio_Z");
 
 	AGDDElcyl *v=new AGDDElcyl(name);
 	v->SetMaterial(material);
 	v->SetRXio_RYio_Z(vvv);
 		
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		v->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/elementHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/elementHandler.cxx
index c950e50ad003..06dd587c1238 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/elementHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/elementHandler.cxx
@@ -1,24 +1,28 @@
 /*
-  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 "AGDDHandlers/elementHandler.h"
 #include "AGDDModel/AGDDElement.h"
 #include "AGDDModel/AGDDMaterial.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-elementHandler::elementHandler(std::string s):XMLHandler(s),mat(0)
+elementHandler::elementHandler(const std::string& s,
+                               AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void elementHandler::ElementHandle()
+void elementHandler::ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t)
 {
-	std::string name=getAttributeAsString("name");
-	std::string symbol=getAttributeAsString("symbol");
-	double ca=getAttributeAsInt("aweight");
-	int cz=getAttributeAsInt("z");
-	double density=getAttributeAsDouble("density");
-	AGDDElement *el=new AGDDElement(name,symbol,cz,ca);
-	mat=new AGDDMaterial(name,el,density);
+	std::string name=getAttributeAsString(c, t, "name");
+	std::string symbol=getAttributeAsString(c, t, "symbol");
+	double ca=getAttributeAsInt(c, t, "aweight");
+	int cz=getAttributeAsInt(c, t, "z");
+	double density=getAttributeAsDouble(c, t, "density");
+        AGDDElement *el=new AGDDElement(name,symbol,cz,ca);
+        new AGDDMaterial(name,el,density);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/foreachHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/foreachHandler.cxx
index 05c3ab9ae0cd..3f92c776c43c 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/foreachHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/foreachHandler.cxx
@@ -1,28 +1,32 @@
 /*
-  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 "AGDDHandlers/foreachHandler.h"
 #include "AGDDControl/XercesParser.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
 using namespace xercesc;
 
-foreachHandler::foreachHandler(std::string s):XMLHandler(s)
+foreachHandler::foreachHandler(const std::string& s,
+                               AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for foreach"<<std::endl;
 }
 
-void foreachHandler::ElementHandle()
+void foreachHandler::ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t)
 {
-	std::string index=getAttributeAsString("index");
-	int ibegin=getAttributeAsInt("begin");
-	int iloops=getAttributeAsInt("loops");
+	std::string index=getAttributeAsString(c, t, "index");
+	int ibegin=getAttributeAsInt(c, t, "begin");
+	int iloops=getAttributeAsInt(c, t, "loops");
 	StopLoop(true);
 	Evaluator().RegisterVariable(index,ibegin);
 	
-	DOMNode *fChild=XercesParser::GetCurrentElement()->getFirstChild();
+	DOMNode *fChild=t->getFirstChild();
 	for (int i=ibegin;i<ibegin+iloops;i++)
 	{
 			
@@ -33,7 +37,7 @@ void foreachHandler::ElementHandle()
 			for (child=fChild;child!=0;child=child->getNextSibling())
 			{
 				if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-				XercesParser::elementLoop(child);
+                                  XercesParser::elementLoop(c, child);
 				}
 			}
 			
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/fractionmassHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/fractionmassHandler.cxx
index 3856f92f15aa..a454776cf1e9 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/fractionmassHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/fractionmassHandler.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 "AGDDHandlers/fractionmassHandler.h"
@@ -7,12 +7,15 @@
 #include "AGDDHandlers/globals.h"
 #include <iostream>
 
-fractionmassHandler::fractionmassHandler(std::string s):XMLHandler(s)
+fractionmassHandler::fractionmassHandler(const std::string& s,
+                                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void fractionmassHandler::ElementHandle()
+void fractionmassHandler::ElementHandle(AGDDController& c,
+                                        xercesc::DOMNode *t)
 {
-	double fractionmass=getAttributeAsDouble("fraction");
+	double fractionmass=getAttributeAsDouble(c, t, "fraction");
 	globals::addMaterial.fractions.push_back(fractionmass);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/gvxyHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/gvxyHandler.cxx
index 9f46d67012c7..64b89f672f58 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/gvxyHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/gvxyHandler.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 "AGDDHandlers/gvxyHandler.h"
@@ -10,16 +10,19 @@
 
 using namespace xercesc;
 
-gvxyHandler::gvxyHandler(std::string s):XMLHandler(s)
+gvxyHandler::gvxyHandler(const std::string& s,
+                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void gvxyHandler::ElementHandle()
+void gvxyHandler::ElementHandle(AGDDController& c,
+                                xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name");
-	std::string material=getAttributeAsString("material");
-	double dZ=getAttributeAsDouble("dZ");
+	std::string name=getAttributeAsString(c, t, "name");
+	std::string material=getAttributeAsString(c, t, "material");
+	double dZ=getAttributeAsDouble(c, t, "dZ");
 	
  	AGDDGvxy *vol=new AGDDGvxy(name);
  	vol->SetMaterial(material);
@@ -29,11 +32,10 @@ void gvxyHandler::ElementHandle()
 	StopLoop(true);	
 	
 	DOMNode *child;
-	DOMNode *cElement=XercesParser::GetCurrentElement();
-	for (child=cElement->getFirstChild();child!=0;child=child->getNextSibling())
+	for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
 	{
 		if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-			XercesParser::elementLoop(child);
+			XercesParser::elementLoop(c, child);
 			TwoPoint p=gvxy_pointHandler::CurrentTwoPoint();
 			points.push_back(p);
 		}
@@ -43,7 +45,7 @@ void gvxyHandler::ElementHandle()
 	for (int i=0;i<nPoints;i++)
 		vol->SetPoint(points[i]);
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		vol->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/gvxy_pointHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/gvxy_pointHandler.cxx
index f80d2c566165..9017fd38e8a0 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/gvxy_pointHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/gvxy_pointHandler.cxx
@@ -1,22 +1,26 @@
 /*
-  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 "AGDDHandlers/gvxy_pointHandler.h"
+#include "AGDDControl/AGDDController.h"
 #include "AGDDKernel/TwoPoint.h"
 #include <iostream>
 
 TwoPoint gvxy_pointHandler::s_point(0.,0.);
 
 
-gvxy_pointHandler::gvxy_pointHandler(std::string s):XMLHandler(s)
+gvxy_pointHandler::gvxy_pointHandler(const std::string& s,
+                                     AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for gvxy_point"<<std::endl;
 }
 
-void gvxy_pointHandler::ElementHandle()
+void gvxy_pointHandler::ElementHandle(AGDDController& c,
+                                      xercesc::DOMNode *t)
 {
-	std::vector<double> vvv=getAttributeAsVector("X_Y");
+	std::vector<double> vvv=getAttributeAsVector(c, t, "X_Y");
 	s_point.x(vvv[0]);
 	s_point.y(vvv[1]);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/gvxysxHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/gvxysxHandler.cxx
index 6f6f4b5b2a3c..d3adcc258c8f 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/gvxysxHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/gvxysxHandler.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 "AGDDHandlers/gvxysxHandler.h"
@@ -10,27 +10,30 @@
 
 using namespace xercesc;
 
-gvxysxHandler::gvxysxHandler(std::string s):XMLHandler(s)
+gvxysxHandler::gvxysxHandler(const std::string& s,
+                             AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for gvxysx"<<std::endl;
 }
 
-void gvxysxHandler::ElementHandle()
+void gvxysxHandler::ElementHandle(AGDDController& c,
+                                  xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name");
-	std::string material=getAttributeAsString("material");
-	double dZ=getAttributeAsDouble("dZ");
+	std::string name=getAttributeAsString(c, t, "name");
+	std::string material=getAttributeAsString(c, t, "material");
+	double dZ=getAttributeAsDouble(c, t, "dZ");
 	
 	AGDDGvxy *vol=new AGDDGvxy(name);
  	vol->SetMaterial(material);
  	vol->SetDz(dZ);
 	
-	std::vector<double> xvalues=getAttributeAsVector("X",res);
+	std::vector<double> xvalues=getAttributeAsVector(c, t, "X",res);
 	
 	if (res)
 	{
-		std::vector<double> yvalues=getAttributeAsVector("Y");
+		std::vector<double> yvalues=getAttributeAsVector(c, t, "Y");
 		
 		// check we have a consistent set of points
 		if(xvalues.size() != yvalues.size()) throw;
@@ -57,11 +60,10 @@ void gvxysxHandler::ElementHandle()
 		StopLoop(true);
 		
 		DOMNode *child;
-		DOMNode *cElement=XercesParser::GetCurrentElement();
-		for (child=cElement->getFirstChild();child!=0;child=child->getNextSibling())
+		for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
 		{
 			if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-				XercesParser::elementLoop(child);
+				XercesParser::elementLoop(c, child);
 				TwoPoint p=gvxy_pointHandler::CurrentTwoPoint();
 				points.push_back(p);
 			}
@@ -85,7 +87,7 @@ void gvxysxHandler::ElementHandle()
 		delete [] v;
 	}
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		vol->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/gvxysxyHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/gvxysxyHandler.cxx
index a0cb3e220faf..9c9a208b7517 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/gvxysxyHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/gvxysxyHandler.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 "AGDDHandlers/gvxysxyHandler.h"
@@ -10,17 +10,20 @@
 
 using namespace xercesc;
 
-gvxysxyHandler::gvxysxyHandler(std::string s):XMLHandler(s)
+gvxysxyHandler::gvxysxyHandler(const std::string& s,
+                               AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for gvxy"<<std::endl;
 }
 
-void gvxysxyHandler::ElementHandle()
+void gvxysxyHandler::ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name");
-	std::string material=getAttributeAsString("material");
-	double dZ=getAttributeAsDouble("dZ");
+	std::string name=getAttributeAsString(c, t, "name");
+	std::string material=getAttributeAsString(c, t, "material");
+	double dZ=getAttributeAsDouble(c, t, "dZ");
 	
  	AGDDGvxy *vol=new AGDDGvxy(name);
  	vol->SetMaterial(material);
@@ -31,11 +34,10 @@ void gvxysxyHandler::ElementHandle()
 	std::vector<TwoPoint> points;	
 	
 	DOMNode *child;
-	DOMNode *cElement=XercesParser::GetCurrentElement();
-	for (child=cElement->getFirstChild();child!=0;child=child->getNextSibling())
+	for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
 	{
 		if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-			XercesParser::elementLoop(child);
+			XercesParser::elementLoop(c, child);
 			TwoPoint p=gvxy_pointHandler::CurrentTwoPoint();
 			points.push_back(p);
 		}
@@ -61,7 +63,7 @@ void gvxysxyHandler::ElementHandle()
 		
 	delete[] v;
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		vol->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/importHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/importHandler.cxx
index 36c0f2680bd3..ff803721bda9 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/importHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/importHandler.cxx
@@ -10,15 +10,15 @@
 
 
 importHandler::importHandler(const std::string& s,
-                             AGDDController& controller)
-  : XMLHandler(s),
-    m_controller (controller)
+                             AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void importHandler::ElementHandle()
+void importHandler::ElementHandle(AGDDController& c,
+                                  xercesc::DOMNode *t)
 {
-	std::string filename=getAttributeAsString("filename");
+	std::string filename=getAttributeAsString(c, t, "filename");
 	std::cout<<" trying to parse file "<<filename<<std::endl;
-	m_controller.GetParser()->ParseFileAndNavigate(filename);
+	c.GetParser()->ParseFileAndNavigate(c, filename);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/intersectionHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/intersectionHandler.cxx
index 0f8e0258fd4b..1037d1a2aba4 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/intersectionHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/intersectionHandler.cxx
@@ -1,10 +1,11 @@
 /*
-  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 "AGDDHandlers/intersectionHandler.h"
 #include "AGDDModel/AGDDIntersection.h"
 #include "AGDDControl/XercesParser.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 #include "AGDDKernel/AGDDPositioner.h"
 #include "AGDDKernel/AGDDVolumeStore.h"
@@ -12,15 +13,18 @@
 
 using namespace xercesc;
 
-intersectionHandler::intersectionHandler(std::string s):XMLHandler(s)
+intersectionHandler::intersectionHandler(const std::string& s,
+                                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void intersectionHandler::ElementHandle()
+void intersectionHandler::ElementHandle(AGDDController& c,
+                                        xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name");
-	AGDDIntersection *c=new AGDDIntersection(name);
+	std::string name=getAttributeAsString(c, t, "name");
+	AGDDIntersection *is=new AGDDIntersection(name);
 	
 	AGDDPositionerStore* pS=AGDDPositionerStore::GetPositionerStore();
 	
@@ -30,11 +34,10 @@ void intersectionHandler::ElementHandle()
 
         int before=pS->NrOfPositioners();
 
-        const DOMNode* cElement=XercesParser::GetCurrentElement();
-        for (child=cElement->getFirstChild();child!=0;child=child->getNextSibling())
+        for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
         {
                if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-               XercesParser::elementLoop(child);
+                 XercesParser::elementLoop(c, child);
                }
         }
 	
@@ -43,10 +46,10 @@ void intersectionHandler::ElementHandle()
 	{
 		AGDDPositioner *posit=pS->GetPositioner(i);
 		if (AGDDVolumeStore::GetVolumeStore()->Exist(posit->Volume()))
-			c->AddDaughter(posit);
+			is->AddDaughter(posit);
 	}
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
-		c->SetColor(col);
+		is->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/materialHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/materialHandler.cxx
index 594e6a3d3e58..966beda928c4 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/materialHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/materialHandler.cxx
@@ -1,21 +1,25 @@
 /*
-  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 "AGDDHandlers/materialHandler.h"
 #include "AGDDModel/AGDDMaterial.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-materialHandler::materialHandler(std::string s):XMLHandler(s),mat(0)
+materialHandler::materialHandler(const std::string& s,
+                                 AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void materialHandler::ElementHandle()
+void materialHandler::ElementHandle(AGDDController& c,
+                                    xercesc::DOMNode *t)
 {
-	std::string name=getAttributeAsString("name");
-	double a=getAttributeAsDouble("a");
-	int z=getAttributeAsInt("z");
-	double density=getAttributeAsDouble("density");
-	mat=new AGDDMaterial(name,z,a,density);	
+	std::string name=getAttributeAsString(c, t, "name");
+	double a=getAttributeAsDouble(c, t, "a");
+	int z=getAttributeAsInt(c, t, "z");
+	double density=getAttributeAsDouble(c, t, "density");
+        new AGDDMaterial(name,z,a,density); 
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/materialsHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/materialsHandler.cxx
index 8c5206426034..0769226f608b 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/materialsHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/materialsHandler.cxx
@@ -1,16 +1,19 @@
 /*
-  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 "AGDDHandlers/materialsHandler.h"
 #include "AGDDModel/AGDDMaterialStore.h"
 #include <iostream>
 
-materialsHandler::materialsHandler(std::string s):XMLHandler(s)
+materialsHandler::materialsHandler(const std::string& s,
+                                   AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void materialsHandler::ElementHandle()
+void materialsHandler::ElementHandle(AGDDController& /*c*/,
+                                     xercesc::DOMNode */*t*/)
 {
 	
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx
index 2df718c06066..b45fe21a0078 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/mposPhiHandler.cxx
@@ -1,28 +1,32 @@
 /*
-  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 "AGDDHandlers/mposPhiHandler.h"
 #include "AGDDKernel/AGDDPositioner.h"
+#include "AGDDControl/AGDDController.h"
 #include "GeoModelKernel/Units.h"
 #include "GaudiKernel/MsgStream.h"
 #include "AthenaKernel/getMessageSvc.h"
 
 #include <iostream>
 
-mposPhiHandler::mposPhiHandler(std::string s):XMLHandler(s),p(0)
+mposPhiHandler::mposPhiHandler(const std::string& s,
+                               AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void mposPhiHandler::ElementHandle()
+void mposPhiHandler::ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t)
 {
 
 	bool res;
-	std::string volume=getAttributeAsString("volume");
-	int icopy=getAttributeAsInt("ncopy",0);
-	double phi0=getAttributeAsDouble("Phi0",res);
+	std::string volume=getAttributeAsString(c, t, "volume");
+	int icopy=getAttributeAsInt(c, t, "ncopy",0);
+	double phi0=getAttributeAsDouble(c, t, "Phi0",res);
 	if (!res) phi0=0;
-	double dphi=getAttributeAsDouble("dPhi",res);
+	double dphi=getAttributeAsDouble(c, t, "dPhi",res);
 	
 	if (!res) // dphi must be calculated 
 	{
@@ -37,12 +41,12 @@ void mposPhiHandler::ElementHandle()
 	}
 	bool impliedRot;
 	std::string s;
-	std::string iR=getAttributeAsString("impliedRot",impliedRot);
+	std::string iR=getAttributeAsString(c, t, "impliedRot",impliedRot);
 	if (impliedRot) s=iR;
-	double lateral_displacement=getAttributeAsDouble("S",res);
+	double lateral_displacement=getAttributeAsDouble(c, t, "S",res);
 	if (!res) lateral_displacement=0;
 
-	std::vector<double> vvv	= getAttributeAsVector("R_Z",res);
+	std::vector<double> vvv	= getAttributeAsVector(c, t, "R_Z",res);
 	double rad=0,zpos=0;
 	if (res)
 	{
@@ -52,7 +56,7 @@ void mposPhiHandler::ElementHandle()
 	
 	GeoTrf::Transform3D crot = GeoTrf::Transform3D::Identity();
 	
-	vvv=getAttributeAsVector("rot",res);
+	vvv=getAttributeAsVector(c, t, "rot",res);
 	if (res) 
 	{
 		crot = crot*GeoTrf::RotateZ3D(vvv[2]*GeoModelKernelUnits::degree)*GeoTrf::RotateY3D(vvv[1]*GeoModelKernelUnits::degree)*GeoTrf::RotateX3D(vvv[0]*GeoModelKernelUnits::degree);
@@ -71,6 +75,6 @@ void mposPhiHandler::ElementHandle()
 		if (s!="false"&&i>0) crot = GeoTrf::RotateZ3D(dphi*GeoModelKernelUnits::degree)*crot;
 		else if (s!="false"&&i==0) crot = GeoTrf::RotateZ3D(phi0*GeoModelKernelUnits::degree)*crot;
 
-		p=new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
+		new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 	}
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx
index e6ebb99cdaac..6968c2b2dc9f 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/mposWedgeHandler.cxx
@@ -1,24 +1,28 @@
 /*
-  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 "AGDDHandlers/mposWedgeHandler.h"
 #include "AGDDKernel/AGDDPositioner.h"
+#include "AGDDControl/AGDDController.h"
 #include "GeoModelKernel/Units.h"
 
 #include <iostream>
 #include <vector>
 
-mposWedgeHandler::mposWedgeHandler(std::string s):XMLHandler(s),p(0)
+mposWedgeHandler::mposWedgeHandler(const std::string& s,
+                                   AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void mposWedgeHandler::ElementHandle()
+void mposWedgeHandler::ElementHandle(AGDDController& c,
+                                     xercesc::DOMNode *t)
 {
 	bool res;
-	std::string volume=getAttributeAsString("volume",res);
-	int iWedge=getAttributeAsInt("wedge_number",8);
-	std::vector<double> iSectors=getAttributeAsVector("sectors",res);
+	std::string volume=getAttributeAsString(c, t, "volume",res);
+	int iWedge=getAttributeAsInt(c, t, "wedge_number",8);
+	std::vector<double> iSectors=getAttributeAsVector(c, t, "sectors",res);
 
 	double dWedge=360./iWedge;
 	
@@ -33,6 +37,6 @@ void mposWedgeHandler::ElementHandle()
 		double zpos=0;
 		GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos);
 
-		p=new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
+		new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 	}
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/msgHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/msgHandler.cxx
index 7614c3eb7c25..cd3620dbdee1 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/msgHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/msgHandler.cxx
@@ -1,23 +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 "AGDDHandlers/msgHandler.h"
+#include "AGDDControl/AGDDController.h"
 
 #include <iostream>
 
-msgHandler::msgHandler(std::string s):XMLHandler(s)
+msgHandler::msgHandler(const std::string& s,
+                       AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for msg"<<std::endl;
 }
 
-void msgHandler::ElementHandle()
+void msgHandler::ElementHandle(AGDDController& c,
+                               xercesc::DOMNode *t)
 {
 //	std::cout<<"handling for msg";
 	bool bres;
-	std::string text=getAttributeAsString("text",bres);
-	std::string expression=getAttributeAsString("expression",bres);
+	std::string text=getAttributeAsString(c, t, "text",bres);
+	std::string expression=getAttributeAsString(c, t, "expression",bres);
 	std::cout<<" msg: "<<text<<" expression="<<expression;
-	double res=getAttributeAsDouble("expression",bres);
+	double res=getAttributeAsDouble(c, t, "expression",bres);
 	std::cout<<" evaluates to "<<res<<std::endl;
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/natomsHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/natomsHandler.cxx
index f4220000cfd5..6ee5d34691fd 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/natomsHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/natomsHandler.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 "AGDDHandlers/natomsHandler.h"
@@ -7,13 +7,16 @@
 #include "AGDDHandlers/globals.h"
 #include <iostream>
 
-natomsHandler::natomsHandler(std::string s):XMLHandler(s)
+natomsHandler::natomsHandler(const std::string& s,
+                             AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void natomsHandler::ElementHandle()
+void natomsHandler::ElementHandle(AGDDController& c,
+                                  xercesc::DOMNode *t)
 {
 	bool res;
-	int natoms=getAttributeAsInt("n",res);
+	int natoms=getAttributeAsInt(c, t, "n",res);
 	globals::addMaterial.natoms.push_back(natoms);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/pconHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/pconHandler.cxx
index 94c0cbc5ee77..8c62430a7019 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/pconHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/pconHandler.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 "AGDDHandlers/pconHandler.h"
@@ -11,24 +11,27 @@
 
 using namespace xercesc;
 
-pconHandler::pconHandler(std::string s):XMLHandler(s)
+pconHandler::pconHandler(const std::string& s,
+                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void pconHandler::ElementHandle()
+void pconHandler::ElementHandle(AGDDController& c,
+                                xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name",res);
-	std::string material=getAttributeAsString("material",res);
+	std::string name=getAttributeAsString(c, t, "name",res);
+	std::string material=getAttributeAsString(c, t, "material",res);
 	
  	AGDDPcon *vol=new AGDDPcon(name);
  	vol->SetMaterial(material);
 
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		vol->SetColor(col);
 		
-	std::vector<double> vvv=getAttributeAsVector("profile",res);
+	std::vector<double> vvv=getAttributeAsVector(c, t, "profile",res);
 	if (res)
 		vol->SetProfile(vvv[0],vvv[1]);
 	else
@@ -37,13 +40,12 @@ void pconHandler::ElementHandle()
 	StopLoop(true);
 	DOMNode* child;
 
-	const DOMNode* cElement=XercesParser::GetCurrentElement();
-        for (child=cElement->getFirstChild();child!=0;child=child->getNextSibling())
+        for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
         {
                 if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-                XercesParser::elementLoop(child);
-		Polyplane p=polyplaneHandler::CurrentPolyplane();
-                vol->SetPlane(p.rin(),p.rou(),p.z());
+                  XercesParser::elementLoop(c, child);
+                  Polyplane p=polyplaneHandler::CurrentPolyplane();
+                  vol->SetPlane(p.rin(),p.rou(),p.z());
                 }
         }
 
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/pgonHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/pgonHandler.cxx
index b27aea44f190..2076c77c91e9 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/pgonHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/pgonHandler.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 "AGDDHandlers/pgonHandler.h"
@@ -10,28 +10,31 @@
 
 using namespace xercesc;
 
-pgonHandler::pgonHandler(std::string s):XMLHandler(s)
+pgonHandler::pgonHandler(const std::string& s,
+                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for pgon"<<std::endl;
 }
 
-void pgonHandler::ElementHandle()
+void pgonHandler::ElementHandle(AGDDController& c,
+                                xercesc::DOMNode *t)
 {
 //	std::cout<<"handling for pgon";
 	bool res;
-	std::string name=getAttributeAsString("name",res);
-	std::string material=getAttributeAsString("material",res);
-	int nbPhi=getAttributeAsInt("nbPhi",res);
+	std::string name=getAttributeAsString(c, t, "name",res);
+	std::string material=getAttributeAsString(c, t, "material",res);
+	int nbPhi=getAttributeAsInt(c, t, "nbPhi",res);
 	
  	AGDDPgon *vol=new AGDDPgon(name);
  	vol->SetMaterial(material);
 	vol->SetNbPhi(nbPhi);
 
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		vol->SetColor(col);
 		
-	std::vector<double> vvv=getAttributeAsVector("profile",res);
+	std::vector<double> vvv=getAttributeAsVector(c, t, "profile",res);
 	if (res)
 		vol->SetProfile(vvv[0],vvv[1]);
 	else
@@ -41,13 +44,12 @@ void pgonHandler::ElementHandle()
 
     DOMNode* child;
 
-    const DOMNode* cElement=XercesParser::GetCurrentElement();
-    for (child=cElement->getFirstChild();child!=0;child=child->getNextSibling())
+    for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
     {
         if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-        	XercesParser::elementLoop(child);
-            Polyplane p=polyplaneHandler::CurrentPolyplane();
-            vol->SetPlane(p.rin(),p.rou(),p.z());
+        	XercesParser::elementLoop(c, child);
+                Polyplane p=polyplaneHandler::CurrentPolyplane();
+                vol->SetPlane(p.rin(),p.rou(),p.z());
         }
     }
 
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/polyplaneHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/polyplaneHandler.cxx
index e0abf759a886..aa4520fef37f 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/polyplaneHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/polyplaneHandler.cxx
@@ -1,22 +1,26 @@
 /*
-  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 "AGDDHandlers/polyplaneHandler.h"
 #include "AGDDHandlers/Polyplane.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 Polyplane polyplaneHandler::s_pPlane(0.,0.,0.);
 
 
-polyplaneHandler::polyplaneHandler(std::string s):XMLHandler(s)
+polyplaneHandler::polyplaneHandler(const std::string& s,
+                                   AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void polyplaneHandler::ElementHandle()
+void polyplaneHandler::ElementHandle(AGDDController& c,
+                                     xercesc::DOMNode *t)
 {
 	bool res;
-	std::vector<double> vvv=getAttributeAsVector("Rio_Z",res);
+	std::vector<double> vvv=getAttributeAsVector(c, t, "Rio_Z",res);
 	s_pPlane.rin(vvv[0]);
 	s_pPlane.rou(vvv[1]);
 	s_pPlane.z(vvv[2]);
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx
index 2e76c3b625c1..76441dfb9df0 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/posRPhiZHandler.cxx
@@ -1,29 +1,33 @@
 /*
-  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 "AGDDHandlers/posRPhiZHandler.h"
+#include "AGDDControl/AGDDController.h"
 #include "AGDDKernel/AGDDPositioner.h"
 #include "GeoModelKernel/Units.h"
 
 #include <iostream>
 #include <vector>
 
-posRPhiZHandler::posRPhiZHandler(std::string s):XMLHandler(s),p(0)
+posRPhiZHandler::posRPhiZHandler(const std::string& s,
+                                 AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void posRPhiZHandler::ElementHandle()
+void posRPhiZHandler::ElementHandle(AGDDController& c,
+                                    xercesc::DOMNode *t)
 {
 	bool res=false;
-	std::string volume=getAttributeAsString("volume",res);
-	std::vector<double> vvv=getAttributeAsVector("R_Phi_Z",res);
+	std::string volume=getAttributeAsString(c, t, "volume",res);
+	std::vector<double> vvv=getAttributeAsVector(c, t, "R_Phi_Z",res);
 	double radius=vvv[0];
 	double phi=vvv[1];
 	double zpos=vvv[2];
 	GeoTrf::Transform3D crot = GeoTrf::Transform3D::Identity();
 
-        vvv=getAttributeAsVector("rot",res);
+        vvv=getAttributeAsVector(c, t, "rot",res);
         if (res) 
         {
                 crot = crot*GeoTrf::RotateZ3D(vvv[2]*GeoModelKernelUnits::degree)*GeoTrf::RotateY3D(vvv[1]*GeoModelKernelUnits::degree)*GeoTrf::RotateX3D(vvv[0]*GeoModelKernelUnits::degree);
@@ -34,5 +38,5 @@ void posRPhiZHandler::ElementHandle()
 	double y=radius*std::sin(phi*GeoModelKernelUnits::degree);
 	GeoTrf::Vector3D cvec=GeoTrf::Vector3D(x,y,zpos);
 
-	p=new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
+	new AGDDPositioner(volume,GeoTrf::Translation3D(cvec)*crot);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx
index bf926605eb4e..77a40f5b5b31 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/posXYZHandler.cxx
@@ -1,8 +1,9 @@
 /*
-  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 "AGDDHandlers/posXYZHandler.h"
+#include "AGDDControl/AGDDController.h"
 #include "AGDDKernel/AGDDPositioner.h"
 #include "AGDDHandlers/globals.h"
 #include "GeoModelKernel/Units.h"
@@ -11,17 +12,20 @@
 
 #include <iostream>
 
-posXYZHandler::posXYZHandler(std::string s):XMLHandler(s)
+posXYZHandler::posXYZHandler(const std::string& s,
+                             AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void posXYZHandler::ElementHandle()
+void posXYZHandler::ElementHandle(AGDDController& c,
+                                  xercesc::DOMNode *t)
 {
 	bool res=false;
 	bool posRet=false;
 	bool rotRet=false;
-	std::string volume=getAttributeAsString("volume",res);
-	std::string  sym=getAttributeAsString("sym",res);
+	std::string volume=getAttributeAsString(c, t, "volume",res);
+	std::string  sym=getAttributeAsString(c, t, "sym",res);
     if (res) {
         MsgStream log(Athena::getMessageSvc(),"posXYZHandler");
         log<<MSG::INFO<<"ElementHandle() - symmetry implemented for "<<volume<<endmsg;
@@ -29,9 +33,9 @@ void posXYZHandler::ElementHandle()
 	std::string sRot="";
 	GeoTrf::Vector3D cvec(0,0,0);
 	GeoTrf::Transform3D crot = GeoTrf::Transform3D::Identity();
-	std::vector<double> X_Y_Z=getAttributeAsVector("X_Y_Z",posRet);
+	std::vector<double> X_Y_Z=getAttributeAsVector(c, t, "X_Y_Z",posRet);
 	if (posRet) cvec =GeoTrf::Vector3D(X_Y_Z[0],X_Y_Z[1],X_Y_Z[2]);
-	std::vector<double> rot=getAttributeAsVector("rot",rotRet);
+	std::vector<double> rot=getAttributeAsVector(c, t, "rot",rotRet);
 	if (rotRet) crot = crot*GeoTrf::RotateZ3D(rot[2]*GeoModelKernelUnits::degree)*GeoTrf::RotateY3D(rot[1]*GeoModelKernelUnits::degree)*GeoTrf::RotateX3D(rot[0]*GeoModelKernelUnits::degree);
 	if (s_printFlag) {
 		MsgStream log(Athena::getMessageSvc(),"posXYZHandler");
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/ringHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/ringHandler.cxx
index c555e2a3bc69..78bed367a17a 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/ringHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/ringHandler.cxx
@@ -1,19 +1,22 @@
 /*
-  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 "AGDDHandlers/ringHandler.h"
 
 #include <iostream>
 
-ringHandler::ringHandler(std::string s):XMLHandler(s)
+ringHandler::ringHandler(const std::string& s,
+                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for ring"<<std::endl;
 }
 
-void ringHandler::ElementHandle()
+void ringHandler::ElementHandle(AGDDController& /*c*/,
+                                xercesc::DOMNode */*t*/)
 {
 //	std::cout<<"handling for ring";
 //	bool res;
-//	int i_ring=getAttributeAsInt("value",res);
+//	int i_ring=getAttributeAsInt(c, t, "value",res);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/sectionHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/sectionHandler.cxx
index ccdcbb551d1e..3b181e367f00 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/sectionHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/sectionHandler.cxx
@@ -1,26 +1,30 @@
 /*
-  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 "AGDDHandlers/sectionHandler.h"
+#include "AGDDControl/AGDDController.h"
 #include "AGDDKernel/AGDDSection.h"
 #include <iostream>
 
 
-sectionHandler::sectionHandler(std::string s):XMLHandler(s),sect(0)
+sectionHandler::sectionHandler(const std::string& s,
+                               AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for section"<<std::endl;
 }
 
-void sectionHandler::ElementHandle()
+void sectionHandler::ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name = getAttributeAsString("name",res);
-	std::string version = getAttributeAsString("version",res);
-	std::string date = getAttributeAsString("date",res);
-	std::string author = getAttributeAsString("author",res);
+	std::string name = getAttributeAsString(c, t, "name",res);
+	std::string version = getAttributeAsString(c, t, "version",res);
+	std::string date = getAttributeAsString(c, t, "date",res);
+	std::string author = getAttributeAsString(c, t, "author",res);
     std::string top="";
-	top=getAttributeAsString("top_volume",res);
+	top=getAttributeAsString(c, t, "top_volume",res);
 
-	sect=new AGDDSection(name,version,author,date,top,res);
+	new AGDDSection(name,version,author,date,top,res);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/sectorHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/sectorHandler.cxx
index e37c984c6a3b..df1fd0bd2246 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/sectorHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/sectorHandler.cxx
@@ -1,18 +1,21 @@
 /*
-  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 "AGDDHandlers/sectorHandler.h"
 #include <iostream>
 
-sectorHandler::sectorHandler(std::string s):XMLHandler(s)
+sectorHandler::sectorHandler(const std::string& s,
+                             AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for sector"<<std::endl;
 }
 
-void sectorHandler::ElementHandle()
+void sectorHandler::ElementHandle(AGDDController& /*c*/,
+                                  xercesc::DOMNode */*t*/)
 {
 //	std::cout<<"handling for sector";
 //	bool res;
-//	int i_sector=getAttributeAsInt("value",res);
+//	int i_sector=getAttributeAsInt(c, t, "value",res);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx
index 1be4ced7c705..ed2494b206d2 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/snakeHandler.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 "AGDDHandlers/snakeHandler.h"
@@ -12,16 +12,19 @@
 
 using namespace xercesc;
 
-snakeHandler::snakeHandler(std::string s):XMLHandler(s)
+snakeHandler::snakeHandler(const std::string& s,
+                           AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void snakeHandler::ElementHandle()
+void snakeHandler::ElementHandle(AGDDController& c,
+                                 xercesc::DOMNode *t)
 {
 	bool res=false;
-	std::string name=getAttributeAsString("name",res);
-	std::string material=getAttributeAsString("material",res);
-	double radius=getAttributeAsDouble("radius",res);
+	std::string name=getAttributeAsString(c, t, "name",res);
+	std::string material=getAttributeAsString(c, t, "material",res);
+	double radius=getAttributeAsDouble(c, t, "radius",res);
 	
 	std::vector<GeoTrf::Vector3D> points;
 	
@@ -32,11 +35,10 @@ void snakeHandler::ElementHandle()
 	StopLoop(true);
 	DOMNode* child;
 
-	const DOMNode* cElement=XercesParser::GetCurrentElement();
-    for (child=cElement->getFirstChild();child!=0;child=child->getNextSibling())
+    for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
     {
         if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-        XercesParser::elementLoop(child);
+                XercesParser::elementLoop(c, child);
 		GeoTrf::Vector3D p=snake_pointHandler::CurrentPoint();
 		points.push_back(p);
        }
@@ -46,7 +48,7 @@ void snakeHandler::ElementHandle()
 	for (int i=0;i<nPoints;i++)
 		vol->SetPoint(points[i]);
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t,"color",res);
 	if (res)
 		vol->SetColor(col);
 	
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx
index b452eda67f89..d9855e2ee61a 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/snake_pointHandler.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 "AGDDHandlers/snake_pointHandler.h"
@@ -8,13 +8,16 @@
 
 GeoTrf::Vector3D snake_pointHandler::s_point(GeoTrf::Vector3D::Identity());
 
-snake_pointHandler::snake_pointHandler(std::string s):XMLHandler(s)
+snake_pointHandler::snake_pointHandler(const std::string& s,
+                                       AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void snake_pointHandler::ElementHandle()
+void snake_pointHandler::ElementHandle(AGDDController& c,
+                                       xercesc::DOMNode *t)
 {
 	bool res=false;
-	std::vector<double> vvv=getAttributeAsVector("X_Y_Z",res);
+	std::vector<double> vvv=getAttributeAsVector(c, t, "X_Y_Z",res);
 	s_point = GeoTrf::Vector3D(vvv[0], vvv[1], vvv[2]);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/subtractionHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/subtractionHandler.cxx
index d23f90282449..67df25203bc7 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/subtractionHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/subtractionHandler.cxx
@@ -1,10 +1,11 @@
 /*
-  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 "AGDDHandlers/subtractionHandler.h"
 #include "AGDDControl/XercesParser.h"
 #include "AGDDModel/AGDDSubtraction.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 #include "AGDDKernel/AGDDPositioner.h"
 #include "AGDDKernel/AGDDVolumeStore.h"
@@ -12,16 +13,19 @@
 
 using namespace xercesc;
 
-subtractionHandler::subtractionHandler(std::string s):XMLHandler(s)
+subtractionHandler::subtractionHandler(const std::string& s,
+                                       AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for composition"<<std::endl;
 }
 
-void subtractionHandler::ElementHandle()
+void subtractionHandler::ElementHandle(AGDDController& c,
+                                       xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name",res);
-	AGDDSubtraction *c=new AGDDSubtraction(name);
+	std::string name=getAttributeAsString(c, t, "name",res);
+	AGDDSubtraction *s=new AGDDSubtraction(name);
 	
 	AGDDPositionerStore* pS=AGDDPositionerStore::GetPositionerStore();
 	
@@ -31,11 +35,10 @@ void subtractionHandler::ElementHandle()
 
         int before=pS->NrOfPositioners();
 
-        const DOMNode* cElement=XercesParser::GetCurrentElement();
-        for (child=cElement->getFirstChild();child!=0;child=child->getNextSibling())
+        for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
         {
                if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-               XercesParser::elementLoop(child);
+                 XercesParser::elementLoop(c, child);
                }
         }
 
@@ -44,10 +47,10 @@ void subtractionHandler::ElementHandle()
 	{
 		AGDDPositioner *posit=pS->GetPositioner(i);
 		if (AGDDVolumeStore::GetVolumeStore()->Exist(posit->Volume()))
-			c->AddDaughter(posit);
+			s->AddDaughter(posit);
 	}
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
-		c->SetColor(col);
+		s->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/trdHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/trdHandler.cxx
index 6929f4d5bf8e..f409c6c89481 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/trdHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/trdHandler.cxx
@@ -1,28 +1,32 @@
 /*
-  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 "AGDDHandlers/trdHandler.h"
+#include "AGDDControl/AGDDController.h"
 #include "AGDDModel/AGDDTrd.h"
 #include <iostream>
 
 
-trdHandler::trdHandler(std::string s):XMLHandler(s)
+trdHandler::trdHandler(const std::string& s,
+                       AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for trd"<<std::endl;
 }
 
-void trdHandler::ElementHandle()
+void trdHandler::ElementHandle(AGDDController& c,
+                               xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name",res);
-	std::string material=getAttributeAsString("material",res);
-	std::vector<double> vvv=getAttributeAsVector("Xmp_Ymp_Z",res);
+	std::string name=getAttributeAsString(c, t, "name",res);
+	std::string material=getAttributeAsString(c, t, "material",res);
+	std::vector<double> vvv=getAttributeAsVector(c, t, "Xmp_Ymp_Z",res);
 	AGDDTrd *b=new AGDDTrd(name);
 	b->SetMaterial(material);
 	b->SetXYZ(vvv);
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		b->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/tubsHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/tubsHandler.cxx
index d055dc3d3e6f..ab3c35e086be 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/tubsHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/tubsHandler.cxx
@@ -1,35 +1,39 @@
 /*
-  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 "AGDDHandlers/tubsHandler.h"
+#include "AGDDControl/AGDDController.h"
 #include "AGDDModel/AGDDTubs.h"
 #include <iostream>
 
 
 
-tubsHandler::tubsHandler(std::string s):XMLHandler(s)
+tubsHandler::tubsHandler(const std::string& s,
+                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for tubs"<<std::endl;
 }
 
-void tubsHandler::ElementHandle()
+void tubsHandler::ElementHandle(AGDDController& c,
+                                xercesc::DOMNode *t)
 {
 	bool res;
-	std::string name=getAttributeAsString("name",res);
-	std::string material=getAttributeAsString("material",res);
-	std::vector<double> vvv=getAttributeAsVector("Rio_Z",res);
+	std::string name=getAttributeAsString(c, t, "name",res);
+	std::string material=getAttributeAsString(c, t, "material",res);
+	std::vector<double> vvv=getAttributeAsVector(c, t, "Rio_Z",res);
 	AGDDTubs *v=new AGDDTubs(name);
 	v->SetMaterial(material);
 	v->SetRio_Z(vvv);
 	
-	vvv=getAttributeAsVector("profile",res);
+	vvv=getAttributeAsVector(c, t, "profile",res);
 	if (res)
 		v->SetProfile(vvv[0],vvv[1]);
 	else
 		v->SetProfile(0.,360.);
 		
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 
 	if (res)
 		v->SetColor(col);
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/unionHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/unionHandler.cxx
index 8c3e75735d94..31a1a34075f2 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/unionHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/unionHandler.cxx
@@ -1,9 +1,10 @@
 /*
-  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 "AGDDHandlers/unionHandler.h"
 #include "AGDDControl/XercesParser.h"
+#include "AGDDControl/AGDDController.h"
 #include "AGDDModel/AGDDUnion.h"
 #include <iostream>
 #include "AGDDKernel/AGDDPositioner.h"
@@ -12,43 +13,45 @@
 
 using namespace xercesc;
 
-unionHandler::unionHandler(std::string s):XMLHandler(s)
+unionHandler::unionHandler(const std::string& s,
+                           AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for composition"<<std::endl;
 }
 
-void unionHandler::ElementHandle()
+void unionHandler::ElementHandle(AGDDController& c,
+                                 xercesc::DOMNode *t)
 {
-	bool res;
-	std::string name=getAttributeAsString("name",res);
+        bool res;
+        std::string name=getAttributeAsString(c, t, "name",res);
 	
-	AGDDUnion *c=new AGDDUnion(name);
+        AGDDUnion *u=new AGDDUnion(name);
 	
-	AGDDPositionerStore* pS=AGDDPositionerStore::GetPositionerStore();
+        AGDDPositionerStore* pS=AGDDPositionerStore::GetPositionerStore();
 	
-	StopLoop(true);
+    StopLoop(true);
 
     DOMNode* child;
 
     int before=pS->NrOfPositioners();
 
-    const DOMNode* cElement=XercesParser::GetCurrentElement();
-    for (child=cElement->getFirstChild();child!=0;child=child->getNextSibling())
+    for (child=t->getFirstChild();child!=0;child=child->getNextSibling())
     {
         if (child->getNodeType()==DOMNode::ELEMENT_NODE) {
-        XercesParser::elementLoop(child);
+          XercesParser::elementLoop(c, child);
         }
     }
 	
-	int after=pS->NrOfPositioners();
-	for (int i=before;i<after;i++)
-	{
-		AGDDPositioner *posit=pS->GetPositioner(i);
-		if (AGDDVolumeStore::GetVolumeStore()->Exist(posit->Volume()))
-			c->AddDaughter(posit);
-	}
+    int after=pS->NrOfPositioners();
+    for (int i=before;i<after;i++)
+    {
+      AGDDPositioner *posit=pS->GetPositioner(i);
+      if (AGDDVolumeStore::GetVolumeStore()->Exist(posit->Volume()))
+        u->AddDaughter(posit);
+    }
 	
-	std::string col=getAttributeAsString("color",res);
-	if (res)
-		c->SetColor(col);
+    std::string col=getAttributeAsString(c, t, "color",res);
+    if (res)
+      u->SetColor(col);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/varHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/varHandler.cxx
index c0be834fc65a..55d064d822d2 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/varHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/varHandler.cxx
@@ -1,20 +1,24 @@
 /*
-  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 "AGDDHandlers/varHandler.h"
+#include "AGDDControl/AGDDController.h"
 #include "AGDDControl/XMLHandler.h"
 #include <iostream>
 
 
-varHandler::varHandler(std::string s):XMLHandler(s)
+varHandler::varHandler(const std::string& s,
+                       AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void varHandler::ElementHandle()
+void varHandler::ElementHandle(AGDDController& c,
+                               xercesc::DOMNode *t)
 {
 	bool bres;
-	std::string name=getAttributeAsString("name",bres);
-	double res=getAttributeAsDouble("value",bres);
+	std::string name=getAttributeAsString(c, t, "name",bres);
+	double res=getAttributeAsDouble(c, t, "value",bres);
 	Evaluator().RegisterConstant(name,res);
 }
diff --git a/DetectorDescription/AGDD/AGDDHandlers/src/versionHandler.cxx b/DetectorDescription/AGDD/AGDDHandlers/src/versionHandler.cxx
index e69e4f0359aa..e9ce8dbc0c11 100644
--- a/DetectorDescription/AGDD/AGDDHandlers/src/versionHandler.cxx
+++ b/DetectorDescription/AGDD/AGDDHandlers/src/versionHandler.cxx
@@ -1,21 +1,24 @@
 /*
-  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 "AGDDHandlers/versionHandler.h"
 
 #include <iostream>
 
-versionHandler::versionHandler(std::string s):XMLHandler(s)
+versionHandler::versionHandler(const std::string& s,
+                               AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void versionHandler::ElementHandle()
+void versionHandler::ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t)
 {
 	bool bres;
-	std::string fileName=getAttributeAsString("filename");
-	std::string version=getAttributeAsString("version");
-	std::string comment=getAttributeAsString("comment",bres);
+	std::string fileName=getAttributeAsString(c, t, "filename");
+	std::string version=getAttributeAsString(c, t, "version");
+	std::string comment=getAttributeAsString(c, t, "comment",bres);
 	std::cout<<" --->  File being parsed: "<<fileName<<" version: "<<version;
 	if (bres) std::cout<<" comment: "<<comment;
 	std::cout<<std::endl;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
index 2829393b9554..1fe97fd61991 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
@@ -154,14 +154,16 @@ void MuonAGDDToolHelper::SetNSWComponents()
     throw std::runtime_error(Form("File: %s, Line: %d\nMuonAGDDToolHelper::SetNSWComponents() - Could not retrieve %s from ServiceLocator", __FILE__, __LINE__, m_svcName.c_str()));
   }
 	
-  agddsvc->addHandler(new micromegasHandler("micromegas"));
-  agddsvc->addHandler(new mm_TechHandler("mm_Tech"));
-  agddsvc->addHandler(new sTGCHandler("sTGC"));
-  agddsvc->addHandler(new sTGC_readoutHandler("sTGC_readout"));
-  agddsvc->addHandler(new sTGC_TechHandler("sTGC_Tech"));
-  agddsvc->addHandler(new mmSpacerHandler("mmSpacer"));
-  agddsvc->addHandler(new mmSpacer_TechHandler("mmSpacer_Tech"));
-  agddsvc->addHandler(new mm_readoutHandler("mm_readout"));
+  IAGDDtoGeoSvc::LockedController c = agddsvc->getController();
+
+  agddsvc->addHandler(new micromegasHandler("micromegas", *c));
+  agddsvc->addHandler(new mm_TechHandler("mm_Tech", *c));
+  agddsvc->addHandler(new sTGCHandler("sTGC", *c));
+  agddsvc->addHandler(new sTGC_readoutHandler("sTGC_readout", *c));
+  agddsvc->addHandler(new sTGC_TechHandler("sTGC_Tech", *c));
+  agddsvc->addHandler(new mmSpacerHandler("mmSpacer", *c));
+  agddsvc->addHandler(new mmSpacer_TechHandler("mmSpacer_Tech", *c));
+  agddsvc->addHandler(new mm_readoutHandler("mm_readout", *c));
 }	
 
 void MuonAGDDToolHelper::setAGDDtoGeoSvcName(const std::string& name) {
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/micromegasHandler.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/micromegasHandler.h
index b814785d2876..a8f076d63388 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/micromegasHandler.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/micromegasHandler.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 micromegasHandler_H
@@ -10,9 +10,10 @@
 
 class micromegasHandler:public XMLHandler {
 public:
-	micromegasHandler(std::string);
-	void ElementHandle();
-
+        micromegasHandler(const std::string&,
+                          AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mmSpacerHandler.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mmSpacerHandler.h
index 7d45315a6499..c972803a9631 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mmSpacerHandler.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mmSpacerHandler.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 mmSpacerHandler_H
@@ -10,9 +10,10 @@
 
 class mmSpacerHandler:public XMLHandler {
 public:
-	mmSpacerHandler(std::string);
-	void ElementHandle();
-
+	mmSpacerHandler(const std::string&,
+                        AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mmSpacer_TechHandler.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mmSpacer_TechHandler.h
index 2f309154588e..a50b7d595f03 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mmSpacer_TechHandler.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mmSpacer_TechHandler.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 mmSpacer_TechHandler_H
@@ -10,9 +10,10 @@
 
 class mmSpacer_TechHandler:public XMLHandler {
 public:
-	mmSpacer_TechHandler(std::string);
-	void ElementHandle();
-
+	mmSpacer_TechHandler(const std::string&,
+                             AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mm_TechHandler.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mm_TechHandler.h
index 6dc41db6372b..f5f4d9341f0f 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mm_TechHandler.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mm_TechHandler.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 mm_TechHandler_H
@@ -10,9 +10,10 @@
 
 class mm_TechHandler:public XMLHandler {
 public:
-	mm_TechHandler(std::string);
-	void ElementHandle();
-
+	mm_TechHandler(const std::string&,
+                       AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mm_readoutHandler.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mm_readoutHandler.h
index d6f5abb450c3..9e2f8b337d44 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mm_readoutHandler.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/mm_readoutHandler.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 mm_readoutHandler_H
@@ -10,9 +10,10 @@
 
 class mm_readoutHandler:public XMLHandler {
 public:
-	mm_readoutHandler(std::string);
-	void ElementHandle();
-
+	mm_readoutHandler(const std::string&,
+                          AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/muonStationHandler.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/muonStationHandler.h
index 1260d265ae65..491e05372237 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/muonStationHandler.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/muonStationHandler.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 muonStationHandler_H
@@ -10,9 +10,10 @@
 
 class muonStationHandler:public XMLHandler {
 public:
-	muonStationHandler(std::string);
-	void ElementHandle();
-
+	muonStationHandler(const std::string&,
+                           AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGCHandler.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGCHandler.h
index a2182db0ff56..56d7835209f7 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGCHandler.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGCHandler.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 sTGCHandler_H
@@ -10,9 +10,10 @@
 
 class sTGCHandler:public XMLHandler {
 public:
-	sTGCHandler(std::string);
-	void ElementHandle();
-
+        sTGCHandler(const std::string&,
+                    AGDDController& c);
+        virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGC_TechHandler.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGC_TechHandler.h
index c510db2b5ccd..331da587a6fd 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGC_TechHandler.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGC_TechHandler.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 sTGC_TechHandler_H
@@ -10,9 +10,10 @@
 
 class sTGC_TechHandler:public XMLHandler {
 public:
-	sTGC_TechHandler(std::string);
-	void ElementHandle();
-
+	sTGC_TechHandler(const std::string&,
+                         AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGC_readoutHandler.h b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGC_readoutHandler.h
index 8b5042cd5c53..0e670bd54e9c 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGC_readoutHandler.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/MuonAGDDBase/sTGC_readoutHandler.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 sTGC_readoutHandler_H
@@ -10,8 +10,10 @@
 
 class sTGC_readoutHandler:public XMLHandler {
  public:
-	sTGC_readoutHandler(std::string);
-	void ElementHandle();
+	sTGC_readoutHandler(const std::string&,
+                            AGDDController& c);
+	virtual void ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t) override;
 };
 
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/micromegasHandler.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/micromegasHandler.cxx
index 971ec1535358..cb96ddd157a4 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/micromegasHandler.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/micromegasHandler.cxx
@@ -1,45 +1,49 @@
 /*
-  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 "MuonAGDDBase/micromegasHandler.h"
 #include "MuonAGDDBase/AGDDMicromegas.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-micromegasHandler::micromegasHandler(std::string s):XMLHandler(s)
+micromegasHandler::micromegasHandler(const std::string& s,
+                                     AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void micromegasHandler::ElementHandle()
+void micromegasHandler::ElementHandle(AGDDController& c,
+                                      xercesc::DOMNode *t)
 {
     
 //    std::cout<<" this is micromegasHandler::Handle"<<std::endl;
 
 	bool ret=true;
-	std::string name=getAttributeAsString("type",ret);
-	std::string sType=getAttributeAsString("subType",ret);
+	std::string name=getAttributeAsString(c, t, "type",ret);
+	std::string sType=getAttributeAsString(c, t, "subType",ret);
 	std::vector<double> vvv;
-	vvv.push_back(getAttributeAsDouble("sWidth",ret));
-	vvv.push_back(getAttributeAsDouble("lWidth",ret));
-	vvv.push_back(getAttributeAsDouble("Length",ret));
-	vvv.push_back(getAttributeAsDouble("Tck",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "sWidth",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "lWidth",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "Length",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "Tck",ret));
 	
-	std::string technology=getAttributeAsString("tech",ret);
+	std::string technology=getAttributeAsString(c, t, "tech",ret);
 	
 	AGDDMicromegas *b=new AGDDMicromegas(name);
 	b->SetXYZ(vvv);
 	b->subType(sType);
 	b->tech=technology;
 
-	double xf=getAttributeAsDouble("xFrame",0.);
+	double xf=getAttributeAsDouble(c, t, "xFrame",0.);
 	b->xFrame(xf);
-	double ysf=getAttributeAsDouble("ysFrame",0.);
+	double ysf=getAttributeAsDouble(c, t, "ysFrame",0.);
 	b->ysFrame(ysf);
-	double ylf=getAttributeAsDouble("ylFrame",0.);
+	double ylf=getAttributeAsDouble(c, t, "ylFrame",0.);
 	b->ylFrame(ylf);
 	
-//	std::string col=getAttributeAsString("color",ret);
+//	std::string col=getAttributeAsString(c, t, "color",ret);
 //	if (ret)
 //		b->SetColor(col);
 }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mmSpacerHandler.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mmSpacerHandler.cxx
index 59b0c5ef70e5..395759eee8f2 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mmSpacerHandler.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mmSpacerHandler.cxx
@@ -1,30 +1,34 @@
 /*
-  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 "MuonAGDDBase/mmSpacerHandler.h"
 #include "MuonAGDDBase/AGDDMMSpacer.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-mmSpacerHandler::mmSpacerHandler(std::string s):XMLHandler(s)
+mmSpacerHandler::mmSpacerHandler(const std::string& s,
+                                 AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void mmSpacerHandler::ElementHandle()
+void mmSpacerHandler::ElementHandle(AGDDController& c,
+                                    xercesc::DOMNode *t)
 {
     
 //    std::cout<<" this is mmSpacerHandler::Handle"<<std::endl;
 
 	bool ret=true;
-	std::string name=getAttributeAsString("type",ret);
+	std::string name=getAttributeAsString(c, t, "type",ret);
 	std::vector<double> vvv;
-	vvv.push_back(getAttributeAsDouble("sWidth",ret));
-	vvv.push_back(getAttributeAsDouble("lWidth",ret));
-	vvv.push_back(getAttributeAsDouble("Length",ret));
-	vvv.push_back(getAttributeAsDouble("Tck",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "sWidth",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "lWidth",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "Length",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "Tck",ret));
 	
-	std::string technology=getAttributeAsString("tech",ret);
+	std::string technology=getAttributeAsString(c, t, "tech",ret);
 	
 	AGDDMMSpacer *b=new AGDDMMSpacer(name);
 	b->SetXYZ(vvv);
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mmSpacer_TechHandler.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mmSpacer_TechHandler.cxx
index 67dbe4f443c8..69cda0433ebb 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mmSpacer_TechHandler.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mmSpacer_TechHandler.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 "MuonAGDDBase/mmSpacer_TechHandler.h"
@@ -7,33 +7,36 @@
 #include <iostream>
 
 
-mmSpacer_TechHandler::mmSpacer_TechHandler(std::string s):XMLHandler(s)
+mmSpacer_TechHandler::mmSpacer_TechHandler(const std::string& s,
+                                           AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void mmSpacer_TechHandler::ElementHandle()
+void mmSpacer_TechHandler::ElementHandle(AGDDController& c,
+                                         xercesc::DOMNode *t)
 {
     
 //    std::cout<<" this is mmSpacer_TechHandler::Handle"<<std::endl;
 
 	bool ret=true;
-	std::string name=getAttributeAsString("type",ret);
+	std::string name=getAttributeAsString(c, t, "type",ret);
 	
 	MuonGM::MMSpacer_Technology *tech=new MuonGM::MMSpacer_Technology(name);
 	
-	tech->thickness=getAttributeAsDouble("Tck",ret);
+	tech->thickness=getAttributeAsDouble(c, t, "Tck",ret);
 	
-	tech->lowZCutOuts=getAttributeAsInt("lowZCutOuts",ret);
+	tech->lowZCutOuts=getAttributeAsInt(c, t, "lowZCutOuts",ret);
 	if (ret) 
 	{	
-		tech->lowZCutOutWidth=getAttributeAsDouble("lowZCutOutWidth",ret);
-		tech->lowZCutOutDZ=getAttributeAsDouble("lowZCutOutDZ",ret);
+		tech->lowZCutOutWidth=getAttributeAsDouble(c, t, "lowZCutOutWidth",ret);
+		tech->lowZCutOutDZ=getAttributeAsDouble(c, t, "lowZCutOutDZ",ret);
 	}
-	tech->highZCutOuts=getAttributeAsInt("highZCutOuts",ret);
+	tech->highZCutOuts=getAttributeAsInt(c, t, "highZCutOuts",ret);
 	if (ret) 
 	{	
-		tech->highZCutOutWidth=getAttributeAsDouble("highZCutOutWidth",ret);	
-		tech->highZCutOutDZ=getAttributeAsDouble("highZCutOutDZ",ret);
+		tech->highZCutOutWidth=getAttributeAsDouble(c, t, "highZCutOutWidth",ret);	
+		tech->highZCutOutDZ=getAttributeAsDouble(c, t, "highZCutOutDZ",ret);
 	}
 
 }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mm_TechHandler.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mm_TechHandler.cxx
index 65d2a12ae9ef..91ffbdebf19f 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mm_TechHandler.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mm_TechHandler.cxx
@@ -1,48 +1,52 @@
 /*
-  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 "MuonAGDDBase/mm_TechHandler.h"
 #include "AGDDModel/AGDDParameterStore.h"
+#include "AGDDControl/AGDDController.h"
 #include "MuonAGDDDescription/MM_Technology.h"
 #include <iostream>
 
 
 
-mm_TechHandler::mm_TechHandler(std::string s):XMLHandler(s)
+mm_TechHandler::mm_TechHandler(const std::string& s,
+                               AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void mm_TechHandler::ElementHandle()
+void mm_TechHandler::ElementHandle(AGDDController& c,
+                                   xercesc::DOMNode *t)
 {
     
 //    std::cout<<" this is mm_TechHandler::Handle"<<std::endl;
 
 	bool ret=true;
-	std::string name=getAttributeAsString("type",ret);
+	std::string name=getAttributeAsString(c, t, "type",ret);
 	
 	MuonGM::MM_Technology *tech=new MuonGM::MM_Technology(name);
 	
-	tech->nlayers=getAttributeAsInt("nLayers",ret);
-	tech->thickness=getAttributeAsDouble("Tck",ret);
-	tech->gasThickness=getAttributeAsDouble("gasTck",ret);
-	tech->pcbThickness=getAttributeAsDouble("driftPcbTck",ret);
-	tech->roThickness=getAttributeAsDouble("ROPcbTck",ret);
+	tech->nlayers=getAttributeAsInt(c, t, "nLayers",ret);
+	tech->thickness=getAttributeAsDouble(c, t, "Tck",ret);
+	tech->gasThickness=getAttributeAsDouble(c, t, "gasTck",ret);
+	tech->pcbThickness=getAttributeAsDouble(c, t, "driftPcbTck",ret);
+	tech->roThickness=getAttributeAsDouble(c, t, "ROPcbTck",ret);
         
-	tech->f1Thickness=getAttributeAsDouble("f1",ret);
-        tech->f2Thickness=getAttributeAsDouble("f2",ret);
-	tech->f3Thickness=getAttributeAsDouble("f3",ret);
+	tech->f1Thickness=getAttributeAsDouble(c, t, "f1",ret);
+        tech->f2Thickness=getAttributeAsDouble(c, t, "f2",ret);
+	tech->f3Thickness=getAttributeAsDouble(c, t, "f3",ret);
 
        
 	
-	tech->geoLevel=getAttributeAsInt("geometryLevel",ret);
+	tech->geoLevel=getAttributeAsInt(c, t, "geometryLevel",ret);
 
 	if(AGDDParameterStore::GetParameterStore()->Exist(name)) {
 		std::cout << " parameters for technology " << name << " already registered" << std::endl;
 	}
 	else {
 		AGDDParameterBagMMTech* paraBag = new AGDDParameterBagMMTech();
-		paraBag->thickness = tech->gasThickness=getAttributeAsDouble("gasTck",ret);
+		paraBag->thickness = tech->gasThickness=getAttributeAsDouble(c, t, "gasTck",ret);
 		paraBag->pitchSS = 0.425; //small sector
 		paraBag->pitchLS = 0.445; //large sector
 		AGDDParameterStore::GetParameterStore()->RegisterParameterBag(name, paraBag);
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mm_readoutHandler.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mm_readoutHandler.cxx
index 84a2cbc2dfc6..e32e91c7f818 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mm_readoutHandler.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/mm_readoutHandler.cxx
@@ -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
 */
 
 #include "MuonAGDDBase/mm_readoutHandler.h"
@@ -7,86 +7,89 @@
 #include <iostream>
 
 
-mm_readoutHandler::mm_readoutHandler(std::string s):XMLHandler(s)
+mm_readoutHandler::mm_readoutHandler(const std::string& s,
+                                     AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void mm_readoutHandler::ElementHandle()
+void mm_readoutHandler::ElementHandle(AGDDController& c,
+                                      xercesc::DOMNode *t)
 {
     MMDetectorDescription* MM=MMDetectorDescription::GetCurrent();
     // std::cout<<" this is mm_readoutHandler::Handle"<<MM->GetName()<<std::endl;
 
     bool ret=true;
-    MM->roParameters.stripPitch            = getAttributeAsDouble    ("stripPitch", ret);
+    MM->roParameters.stripPitch            = getAttributeAsDouble    (c, t, "stripPitch", ret);
     if (! ret) std::cout << "WARNING: stripPitch is missing" << std::endl;
 
-    MM->roParameters.gasThickness          = getAttributeAsDouble    ("gasThickness", ret);
+    MM->roParameters.gasThickness          = getAttributeAsDouble    (c, t, "gasThickness", ret);
     if (! ret) std::cout << "WARNING: gasThickness is missing" << std::endl;
 
-    MM->roParameters.pcbThickness          = getAttributeAsDouble    ("pcbThickness", ret);
+    MM->roParameters.pcbThickness          = getAttributeAsDouble    (c, t, "pcbThickness", ret);
     if (! ret) std::cout << "WARNING: pcbThickness is missing" << std::endl;
 
-    MM->roParameters.driftThickness        = getAttributeAsDouble    ("driftThickness", ret);
+    MM->roParameters.driftThickness        = getAttributeAsDouble    (c, t, "driftThickness", ret);
     if (! ret) std::cout << "WARNING: driftThickness is missing" << std::endl;
 
-    MM->roParameters.stereoAngle           = getAttributeAsVector    ("stereoAngle", ret);
+    MM->roParameters.stereoAngle           = getAttributeAsVector    (c, t, "stereoAngle", ret);
     if (! ret) std::cout << "WARNING: stereoAngle is missing" << std::endl;
 
-    MM->roParameters.readoutSide           = getAttributeAsIntVector ("readoutSide", ret);
+    MM->roParameters.readoutSide           = getAttributeAsIntVector (c, t, "readoutSide", ret);
     if (! ret) std::cout << "WARNING: readoutSide is missing" << std::endl;
 
-    MM->roParameters.zpos                  = getAttributeAsDouble    ("zPos", ret);
+    MM->roParameters.zpos                  = getAttributeAsDouble    (c, t, "zPos", ret);
     if (! ret) std::cout << "WARNING: zPos is missing" << std::endl;
 
-    MM->roParameters.distanceFromZAxis     = getAttributeAsDouble    ("distanceFromZAxis", ret);
+    MM->roParameters.distanceFromZAxis     = getAttributeAsDouble    (c, t, "distanceFromZAxis", ret);
     if (! ret) std::cout << "WARNING: distanceFromZAxis is missing" << std::endl;
 
-    MM->roParameters.roLength              = getAttributeAsDouble    ("roLength", ret);
+    MM->roParameters.roLength              = getAttributeAsDouble    (c, t, "roLength", ret);
     if (! ret) std::cout << "WARNING: roLength is missing" << std::endl;
 
-    MM->roParameters.activeBottomLength           = getAttributeAsDouble    ("activeBottomLength", ret);
+    MM->roParameters.activeBottomLength           = getAttributeAsDouble    (c, t, "activeBottomLength", ret);
     if (! ret) std::cout << "WARNING: activeBottomLength is missing" << std::endl;
 
-    MM->roParameters.activeTopLength           = getAttributeAsDouble    ("activeTopLength", ret);
+    MM->roParameters.activeTopLength           = getAttributeAsDouble    (c, t, "activeTopLength", ret);
     if (! ret) std::cout << "WARNING: activeTopLength is missing" << std::endl;
 
-    MM->roParameters.activeH               = getAttributeAsDouble    ("activeH", ret);
+    MM->roParameters.activeH               = getAttributeAsDouble    (c, t, "activeH", ret);
     if (! ret) std::cout << "WARNING: activeH is missing" << std::endl;
 
-    MM->roParameters.minYPhiL               = getAttributeAsDouble    ("minYPhiL", ret);
+    MM->roParameters.minYPhiL               = getAttributeAsDouble    (c, t, "minYPhiL", ret);
     if (! ret) std::cout << "WARNING: minYPhiL is missing" << std::endl;
     
-    MM->roParameters.minYPhiR               = getAttributeAsDouble    ("minYPhiR", ret);
+    MM->roParameters.minYPhiR               = getAttributeAsDouble    (c, t, "minYPhiR", ret);
     if (! ret) std::cout << "WARNING: minYPhiR is missing" << std::endl;
 
-    MM->roParameters.maxYPhi               = getAttributeAsDouble    ("maxYPhi", ret);
+    MM->roParameters.maxYPhi               = getAttributeAsDouble    (c, t, "maxYPhi", ret);
     if (! ret) std::cout << "WARNING: maxYPhi is missing" << std::endl;
     
-    MM->roParameters.dlStereoBottom               = getAttributeAsDouble    ("dlStereoBottom", ret);
+    MM->roParameters.dlStereoBottom               = getAttributeAsDouble    (c, t, "dlStereoBottom", ret);
     if (! ret) std::cout << "WARNING: dlStereoBottom is missing" << std::endl;
     
-    MM->roParameters.dlStereoTop               = getAttributeAsDouble    ("dlStereoTop", ret);
+    MM->roParameters.dlStereoTop               = getAttributeAsDouble    (c, t, "dlStereoTop", ret);
     if (! ret) std::cout << "WARNING: dlStereoTop is missing" << std::endl;
     
-    MM->roParameters.nMissedTopEta               = getAttributeAsInt    ("nMissedTopEta", ret);
+    MM->roParameters.nMissedTopEta               = getAttributeAsInt    (c, t, "nMissedTopEta", ret);
     if (! ret) std::cout << "WARNING: nMissedTopEta is missing" << std::endl;
     
-    MM->roParameters.nMissedBottomEta               = getAttributeAsInt    ("nMissedBottomEta", ret);
+    MM->roParameters.nMissedBottomEta               = getAttributeAsInt    (c, t, "nMissedBottomEta", ret);
     if (! ret) std::cout << "WARNING: nMissedBottomEta is missing" << std::endl;
     
-    MM->roParameters.nMissedTopStereo               = getAttributeAsInt    ("nMissedTopStereo", ret);
+    MM->roParameters.nMissedTopStereo               = getAttributeAsInt    (c, t, "nMissedTopStereo", ret);
     if (! ret) std::cout << "WARNING: nMissedTopStereo is missing" << std::endl;
     
-    MM->roParameters.nMissedBottomStereo              = getAttributeAsInt    ("nMissedBottomStereo", ret);
+    MM->roParameters.nMissedBottomStereo              = getAttributeAsInt    (c, t, "nMissedBottomStereo", ret);
     if (! ret) std::cout << "WARNING: nMissedBottomStereo is missing" << std::endl;
     
-    MM->roParameters.nRoutedTop               = getAttributeAsInt    ("nRoutedTop", ret);
+    MM->roParameters.nRoutedTop               = getAttributeAsInt    (c, t, "nRoutedTop", ret);
     if (! ret) std::cout << "WARNING: nRoutedTop is missing" << std::endl;
     
-    MM->roParameters.nRoutedBottom               = getAttributeAsInt    ("nRoutedBottom", ret);
+    MM->roParameters.nRoutedBottom               = getAttributeAsInt    (c, t, "nRoutedBottom", ret);
     if (! ret) std::cout << "WARNING: nRoutedBottom is missing" << std::endl;
     
-    MM->roParameters.tStrips             = getAttributeAsInt    ("totalStrips", ret);
+    MM->roParameters.tStrips             = getAttributeAsInt    (c, t, "totalStrips", ret);
     if (! ret) std::cout << "WARNING: totalStrips is missing" << std::endl;
 
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/muonStationHandler.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/muonStationHandler.cxx
index 7f9e4df49d51..53428d074393 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/muonStationHandler.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/muonStationHandler.cxx
@@ -1,28 +1,32 @@
 /*
-  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 "MuonAGDDBase/muonStationHandler.h"
 #include "MuonAGDDBase/AGDDMuonStation.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-muonStationHandler::muonStationHandler(std::string s):XMLHandler(s)
+muonStationHandler::muonStationHandler(const std::string& s,
+                                       AGDDController& c)
+  : XMLHandler(s, c)
 {
 //	std::cout<<"Creating handler for trd"<<std::endl;
 }
 
-void muonStationHandler::ElementHandle()
+void muonStationHandler::ElementHandle(AGDDController& c,
+                                       xercesc::DOMNode *t)
 {
     
 //    std::cout<<" this is muonStationHandler::Handle"<<std::endl;
 	bool res;
-	std::string name=getAttributeAsString("type",res);
-	std::vector<double> vvv=getAttributeAsVector("sWidth_lWidth_Tck_Length",res);
+	std::string name=getAttributeAsString(c, t, "type",res);
+	std::vector<double> vvv=getAttributeAsVector(c, t, "sWidth_lWidth_Tck_Length",res);
 	AGDDMuonStation *b=new AGDDMuonStation(name);
 	b->SetXYZ(vvv);
 	
-	std::string col=getAttributeAsString("color",res);
+	std::string col=getAttributeAsString(c, t, "color",res);
 	if (res)
 		b->SetColor(col);
 }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGCHandler.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGCHandler.cxx
index 43b7ecb29648..6ee2a5aa67a9 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGCHandler.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGCHandler.cxx
@@ -1,50 +1,54 @@
 /*
-  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 "MuonAGDDBase/sTGCHandler.h"
 #include "MuonAGDDBase/AGDDsTGC.h"
+#include "AGDDControl/AGDDController.h"
 #include <iostream>
 
 
-sTGCHandler::sTGCHandler(std::string s):XMLHandler(s)
+sTGCHandler::sTGCHandler(const std::string& s,
+                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void sTGCHandler::ElementHandle()
+void sTGCHandler::ElementHandle(AGDDController& c,
+                                xercesc::DOMNode *t)
 {
     
 //    std::cout<<" this is sTGCHandler::Handle"<<std::endl;
 
 	bool ret=true;
-	std::string name=getAttributeAsString("type",ret);
-	std::string sType=getAttributeAsString("subType",ret);
+	std::string name=getAttributeAsString(c, t, "type",ret);
+	std::string sType=getAttributeAsString(c, t, "subType",ret);
 	std::vector<double> vvv;
-	vvv.push_back(getAttributeAsDouble("sWidth",ret));
-	vvv.push_back(getAttributeAsDouble("lWidth",ret));
-	vvv.push_back(getAttributeAsDouble("Length",ret));
-	vvv.push_back(getAttributeAsDouble("Tck",ret));
-	vvv.push_back(getAttributeAsDouble("yCutout",0.));
-	vvv.push_back(getAttributeAsDouble("stripPitch",0.));
-	vvv.push_back(getAttributeAsDouble("wirePitch",0.));
-	vvv.push_back(getAttributeAsDouble("stripWidth",0.));
-	vvv.push_back(getAttributeAsDouble("yCutoutCathode",0.));
+	vvv.push_back(getAttributeAsDouble(c, t, "sWidth",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "lWidth",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "Length",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "Tck",ret));
+	vvv.push_back(getAttributeAsDouble(c, t, "yCutout",0.));
+	vvv.push_back(getAttributeAsDouble(c, t, "stripPitch",0.));
+	vvv.push_back(getAttributeAsDouble(c, t, "wirePitch",0.));
+	vvv.push_back(getAttributeAsDouble(c, t, "stripWidth",0.));
+	vvv.push_back(getAttributeAsDouble(c, t, "yCutoutCathode",0.));
 	
-	//double ttt=getAttributeAsDouble("yCutout",0.);
+	//double ttt=getAttributeAsDouble(c, t, "yCutout",0.);
 	//std::cout<<"+++++++++++++++++++++++> yCutout "<<ttt<<std::endl;
 	
-	std::string technology=getAttributeAsString("tech",ret);
+	std::string technology=getAttributeAsString(c, t, "tech",ret);
 	
 	AGDDsTGC *b=new AGDDsTGC(name);
 	b->SetXYZ(vvv);
 	b->subType(sType);
 	b->tech=technology;
 	
-	double xf=getAttributeAsDouble("xFrame",0.);
+	double xf=getAttributeAsDouble(c, t, "xFrame",0.);
 	b->xFrame(xf);
-	double ysf=getAttributeAsDouble("ysFrame",0.);
+	double ysf=getAttributeAsDouble(c, t, "ysFrame",0.);
 	b->ysFrame(ysf);
-	double ylf=getAttributeAsDouble("ylFrame",0.);
+	double ylf=getAttributeAsDouble(c, t, "ylFrame",0.);
 	b->ylFrame(ylf);
 	
 }
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGC_TechHandler.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGC_TechHandler.cxx
index a1e421642b2c..021f7f12dfe8 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGC_TechHandler.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGC_TechHandler.cxx
@@ -1,47 +1,51 @@
 /*
-  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 "MuonAGDDBase/sTGC_TechHandler.h"
 #include "AGDDModel/AGDDParameterStore.h"
+#include "AGDDControl/AGDDController.h"
 #include "MuonAGDDDescription/sTGC_Technology.h"
 #include <iostream>
 
 
-sTGC_TechHandler::sTGC_TechHandler(std::string s):XMLHandler(s)
+sTGC_TechHandler::sTGC_TechHandler(const std::string& s,
+                                   AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void sTGC_TechHandler::ElementHandle()
+void sTGC_TechHandler::ElementHandle(AGDDController& c,
+                                     xercesc::DOMNode *t)
 {
     
 //    std::cout<<" this is sTGC_TechHandler::Handle"<<std::endl;
 
 	bool ret=true;
-	std::string name=getAttributeAsString("type",ret);
+	std::string name=getAttributeAsString(c, t, "type",ret);
 	
 	MuonGM::sTGC_Technology *tech=new MuonGM::sTGC_Technology(name);
 	
-	tech->nlayers=getAttributeAsInt("nLayers",ret);
-	tech->thickness=getAttributeAsDouble("Tck",ret);
-	tech->gasThickness=getAttributeAsDouble("gasTck",ret);
-    tech->pcbThickness=getAttributeAsDouble("pcbTck",ret);
+	tech->nlayers=getAttributeAsInt(c, t, "nLayers",ret);
+	tech->thickness=getAttributeAsDouble(c, t, "Tck",ret);
+	tech->gasThickness=getAttributeAsDouble(c, t, "gasTck",ret);
+    tech->pcbThickness=getAttributeAsDouble(c, t, "pcbTck",ret);
 
-    tech->f4Thickness=getAttributeAsDouble("f4",ret);
-    tech->f5Thickness=getAttributeAsDouble("f5",ret);
-    tech->f6Thickness=getAttributeAsDouble("f6",ret);
+    tech->f4Thickness=getAttributeAsDouble(c, t, "f4",ret);
+    tech->f5Thickness=getAttributeAsDouble(c, t, "f5",ret);
+    tech->f6Thickness=getAttributeAsDouble(c, t, "f6",ret);
 		
 	// std::cout<<" sTGC_Tech "<<name<<tech->nlayers<<" "<<tech->thickness<<" "<<tech->gasThickness<<" "<<tech->pcbThickness<<std::endl;
 
 	
-	tech->geoLevel=getAttributeAsInt("geometryLevel",ret);
+	tech->geoLevel=getAttributeAsInt(c, t, "geometryLevel",ret);
 		
 	if(AGDDParameterStore::GetParameterStore()->Exist(name)) {
 		std::cout << " parameters for technology " << name << " already registered" << std::endl;
 	}
 	else {
 		AGDDParameterBagsTGCTech* paraBag = new AGDDParameterBagsTGCTech();
-		paraBag->thickness = tech->gasThickness=getAttributeAsDouble("gasTck",ret);
+		paraBag->thickness = tech->gasThickness=getAttributeAsDouble(c, t, "gasTck",ret);
 		paraBag->stripPitch = 3.2; //eta
 		paraBag->wirePitch = 1.8; //phi
 		paraBag->stripWidth = 2.7; //eta
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGC_readoutHandler.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGC_readoutHandler.cxx
index acc5b16dfd81..e2cb66c73d24 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGC_readoutHandler.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDDBase/src/sTGC_readoutHandler.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 "MuonAGDDBase/sTGC_readoutHandler.h"
@@ -8,116 +8,119 @@
 #include <iostream>
 
 
-sTGC_readoutHandler::sTGC_readoutHandler(std::string s):XMLHandler(s)
+sTGC_readoutHandler::sTGC_readoutHandler(const std::string& s,
+                                         AGDDController& c)
+  : XMLHandler(s, c)
 {
 }
 
-void sTGC_readoutHandler::ElementHandle()
+void sTGC_readoutHandler::ElementHandle(AGDDController& c,
+                                        xercesc::DOMNode *t)
 {
     sTGCDetectorDescription* sTGC=sTGCDetectorDescription::GetCurrent();
     // std::cout<<" this is sTGC_readoutHandler::Handle"<<sTGC->GetName()<<std::endl;
 
     bool ret=true;
-    sTGC->roParameters.sPadWidth           = getAttributeAsDouble    ("sPadWidth", ret);
+    sTGC->roParameters.sPadWidth           = getAttributeAsDouble    (c, t, "sPadWidth", ret);
     if (! ret) std::cout << "WARNING: sPadWidth is missing" << std::endl;
 
-    sTGC->roParameters.lPadWidth           = getAttributeAsDouble    ("lPadWidth", ret);
+    sTGC->roParameters.lPadWidth           = getAttributeAsDouble    (c, t, "lPadWidth", ret);
     if (! ret) std::cout << "WARNING: lPadWidth is missing" << std::endl;
 
-    sTGC->roParameters.sStripWidth           = getAttributeAsDouble    ("sStripWidth", ret);
+    sTGC->roParameters.sStripWidth           = getAttributeAsDouble    (c, t, "sStripWidth", ret);
     if (! ret) std::cout << "WARNING: sStripWidth is missing" << std::endl;
 
-    sTGC->roParameters.lStripWidth           = getAttributeAsDouble    ("lStripWidth", ret);
+    sTGC->roParameters.lStripWidth           = getAttributeAsDouble    (c, t, "lStripWidth", ret);
     if (! ret) std::cout << "WARNING: lStripWidth is missing" << std::endl;
 
-    sTGC->roParameters.padH                = getAttributeAsVector    ("padH", ret);
+    sTGC->roParameters.padH                = getAttributeAsVector    (c, t, "padH", ret);
     if (! ret) std::cout << "WARNING: padH is missing" << std::endl; 
 
-    sTGC->roParameters.nPadPhi         = getAttributeAsIntVector ("nPadPhi", ret);
+    sTGC->roParameters.nPadPhi         = getAttributeAsIntVector (c, t, "nPadPhi", ret);
     if (! ret) { // Check for backwards compatibility
       std::cout << "INFO: nPadPhi is missing trying older format nPadX" << std::endl;
-      sTGC->roParameters.nPadPhi       = getAttributeAsIntVector ("nPadX", ret);
+      sTGC->roParameters.nPadPhi       = getAttributeAsIntVector (c, t, "nPadX", ret);
       if (! ret) std::cout << "WARNING: nPadX is missing" << std::endl;
     }
 
-    sTGC->roParameters.anglePadPhi            = getAttributeAsDouble    ("anglePadPhi", ret);
+    sTGC->roParameters.anglePadPhi            = getAttributeAsDouble    (c, t, "anglePadPhi", ret);
     if (! ret){
       std::cout << "INFO: anglePadPhi is missing trying older format anglePadX" << std::endl;
-      sTGC->roParameters.anglePadPhi            = getAttributeAsDouble    ("anglePadX", ret);
+      sTGC->roParameters.anglePadPhi            = getAttributeAsDouble    (c, t, "anglePadX", ret);
       if (! ret) std::cout << "WARNING: anglePadX is missing" << std::endl;
     }
 
-    sTGC->roParameters.firstPadPhiDivision_A = getAttributeAsVector    ("firstPadPhiDivision_A", ret);
-    sTGC->roParameters.firstPadPhiDivision_C         = getAttributeAsVector    ("firstPadPhiDivision_C", ret);
+    sTGC->roParameters.firstPadPhiDivision_A = getAttributeAsVector    (c, t, "firstPadPhiDivision_A", ret);
+    sTGC->roParameters.firstPadPhiDivision_C         = getAttributeAsVector    (c, t, "firstPadPhiDivision_C", ret);
     if (! ret){
       std::cout << "INFO: firstPadPhiDivision_C/A is missing trying older format firstPadPhi" << std::endl; 
-      sTGC->roParameters.firstPadPhiDivision_A        = getAttributeAsVector    ("firstPadPhi", ret);
-      sTGC->roParameters.firstPadPhiDivision_C        = getAttributeAsVector    ("firstPadPhi", ret);
+      sTGC->roParameters.firstPadPhiDivision_A        = getAttributeAsVector    (c, t, "firstPadPhi", ret);
+      sTGC->roParameters.firstPadPhiDivision_C        = getAttributeAsVector    (c, t, "firstPadPhi", ret);
       if (! ret) std::cout << "WARNING: firstPadPhi is missing" << std::endl;
     }
 
 
 
-      sTGC->roParameters.PadPhiShift_A = getAttributeAsVector    ("PadPhiShift_A", ret);
-      sTGC->roParameters.PadPhiShift_C = getAttributeAsVector    ("PadPhiShift_C", ret);
+      sTGC->roParameters.PadPhiShift_A = getAttributeAsVector    (c, t, "PadPhiShift_A", ret);
+      sTGC->roParameters.PadPhiShift_C = getAttributeAsVector    (c, t, "PadPhiShift_C", ret);
     if (! ret){
       std::cout << "INFO: PadPhiShift_C/A is missing trying older format firstPadPhi" << std::endl; 
-      sTGC->roParameters.PadPhiShift_A        = getAttributeAsVector    ("firstPadPhi", ret);
-      sTGC->roParameters.PadPhiShift_C        = getAttributeAsVector    ("firstPadPhi", ret);
+      sTGC->roParameters.PadPhiShift_A        = getAttributeAsVector    (c, t, "firstPadPhi", ret);
+      sTGC->roParameters.PadPhiShift_C        = getAttributeAsVector    (c, t, "firstPadPhi", ret);
       if (! ret) std::cout << "WARNING: firstPadPhi is missing" << std::endl;
     }
 
-    sTGC->roParameters.nPadH               = getAttributeAsVector    ("nPadH", ret);
+    sTGC->roParameters.nPadH               = getAttributeAsVector    (c, t, "nPadH", ret);
     if (! ret) std::cout << "WARNING: nPadH is missing" << std::endl;
 
-    sTGC->roParameters.firstPadH           = getAttributeAsVector    ("firstPadH", ret);
+    sTGC->roParameters.firstPadH           = getAttributeAsVector    (c, t, "firstPadH", ret);
     if (! ret) std::cout << "WARNING: firstPadH is missing" << std::endl;
 
-    sTGC->roParameters.firstPadRow         = getAttributeAsIntVector ("firstPadRow", ret);
+    sTGC->roParameters.firstPadRow         = getAttributeAsIntVector (c, t, "firstPadRow", ret);
     if (! ret) std::cout << "WARNING: firstPadRow is missing" << std::endl;
 
-    sTGC->roParameters.nWires              = getAttributeAsIntVector ("nWires", ret);
+    sTGC->roParameters.nWires              = getAttributeAsIntVector (c, t, "nWires", ret);
     if (! ret) std::cout << "WARNING: nWires is missing" << std::endl;
 
-    sTGC->roParameters.wireCutout          = getAttributeAsVector ("wireCutout", ret);
+    sTGC->roParameters.wireCutout          = getAttributeAsVector (c, t, "wireCutout", ret);
     if (! ret) std::cout << "WARNING: wireCutout is missing" << std::endl;
 
-    sTGC->roParameters.firstWire           = getAttributeAsVector    ("firstWire", ret);
+    sTGC->roParameters.firstWire           = getAttributeAsVector    (c, t, "firstWire", ret);
     if (! ret) std::cout << "WARNING: firstWire is missing" << std::endl;
 
-    sTGC->roParameters.wireGroupWidth      = getAttributeAsDouble    ("wireGroupWidth", ret);
+    sTGC->roParameters.wireGroupWidth      = getAttributeAsDouble    (c, t, "wireGroupWidth", ret);
     if (! ret) std::cout << "WARNING: wireGroupWidth is missing" << std::endl;
 
-    sTGC->roParameters.nStrips             = getAttributeAsInt       ("nStrips", ret);
+    sTGC->roParameters.nStrips             = getAttributeAsInt       (c, t, "nStrips", ret);
     if (! ret) std::cout << "WARNING: nStrips is missing" << std::endl;
 
-    sTGC->roParameters.firstTriggerBand    = getAttributeAsIntVector ("firstTriggerBand", ret);
+    sTGC->roParameters.firstTriggerBand    = getAttributeAsIntVector (c, t, "firstTriggerBand", ret);
     if (! ret) std::cout << "WARNING: firstTriggerBand is missing" << std::endl;
 
-    sTGC->roParameters.nTriggerBands       = getAttributeAsIntVector ("nTriggerBands", ret);
+    sTGC->roParameters.nTriggerBands       = getAttributeAsIntVector (c, t, "nTriggerBands", ret);
     if (! ret) std::cout << "WARNING: nTriggerBands is missing" << std::endl;
 
-    sTGC->roParameters.firstStripInTrigger = getAttributeAsIntVector ("firstStripInTrigger", ret);
+    sTGC->roParameters.firstStripInTrigger = getAttributeAsIntVector (c, t, "firstStripInTrigger", ret);
     if (! ret) std::cout << "WARNING: firstStripInTrigger is missing" << std::endl;
 
-    sTGC->roParameters.firstStripWidth     = getAttributeAsVector    ("firstStripWidth", ret);
+    sTGC->roParameters.firstStripWidth     = getAttributeAsVector    (c, t, "firstStripWidth", ret);
     if (! ret) std::cout << "WARNING: firstStripWidth is missing" << std::endl;
 
-    sTGC->roParameters.StripsInBandsLayer1 = getAttributeAsIntVector ("StripsInBandsLayer1", ret);
+    sTGC->roParameters.StripsInBandsLayer1 = getAttributeAsIntVector (c, t, "StripsInBandsLayer1", ret);
     if (! ret) std::cout << "WARNING: StripsInBandsLayer1 is missing" << std::endl;
 
-    sTGC->roParameters.StripsInBandsLayer2 = getAttributeAsIntVector ("StripsInBandsLayer2", ret);
+    sTGC->roParameters.StripsInBandsLayer2 = getAttributeAsIntVector (c, t, "StripsInBandsLayer2", ret);
     if (! ret) std::cout << "WARNING: StripsInBandsLayer2 is missing" << std::endl;
 
-    sTGC->roParameters.StripsInBandsLayer3 = getAttributeAsIntVector ("StripsInBandsLayer3", ret);
+    sTGC->roParameters.StripsInBandsLayer3 = getAttributeAsIntVector (c, t, "StripsInBandsLayer3", ret);
     if (! ret) std::cout << "WARNING: StripsInBandsLayer3 is missing" << std::endl;
 
-    sTGC->roParameters.StripsInBandsLayer4 = getAttributeAsIntVector ("StripsInBandsLayer4", ret);
+    sTGC->roParameters.StripsInBandsLayer4 = getAttributeAsIntVector (c, t, "StripsInBandsLayer4", ret);
     if (! ret) std::cout << "WARNING: StripsInBandsLayer4 is missing" << std::endl;
 
-    sTGC->roParameters.nWireGroups         = getAttributeAsIntVector ("nWireGroups", ret);
+    sTGC->roParameters.nWireGroups         = getAttributeAsIntVector (c, t, "nWireGroups", ret);
     if (! ret) std::cout << "WARNING: nWireGroups is missing" << std::endl;
 
-    sTGC->roParameters.firstWireGroup      = getAttributeAsIntVector ("firstWireGroup", ret);
+    sTGC->roParameters.firstWireGroup      = getAttributeAsIntVector (c, t, "firstWireGroup", ret);
     if (! ret) std::cout << "WARNING: firstWireGroup is missing" << std::endl;
 }
-- 
GitLab


From d5b54c4339b6e8ecd8f56ea6c520d4729a25f9f3 Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Fri, 24 Sep 2021 18:07:21 +0200
Subject: [PATCH 319/347] Moderinzation of LArRTMParamExtractor algorithm

---
 .../LArCalibUtils/LArRTMParamExtractor.h      | 22 +++--
 .../LArCalibUtils/LArWFParamTool.h            | 10 +--
 .../src/LArDeltaRespPredictor.cxx             |  3 +-
 .../src/LArRTMParamExtractor.cxx              | 81 +++++++------------
 .../LArCalibUtils/src/LArWFParamTool.cxx      |  8 +-
 5 files changed, 51 insertions(+), 73 deletions(-)

diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h
index d71e33114e83..c81f63a053a2 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h
@@ -27,8 +27,9 @@
 #include "LArCabling/LArOnOffIdMapping.h"
 #include "tbb/blocked_range.h"
 #include "LArRawConditions/LArWFParams.h"
+#include "LArRawConditions/LArCaliWave.h"
+#include <memory>
 
-class LArCaliWave;
 class LArWFParamTool;
 
 class LArRTMParamExtractor : public AthAlgorithm
@@ -90,17 +91,14 @@ class LArRTMParamExtractor : public AthAlgorithm
 
   class helperParams {
   public:
-    helperParams(const LArCaliWave* cw,
-		 LArCaliWave* os, LArCaliWave* rO0, LArCaliWave* rO1,
-		 const HWIdentifier id, const unsigned g) : 
-      caliWave(cw), omegaScan(os), resOscill0(rO0), resOscill1(rO1),
-      chid(id),gain(g) {};
-
-    const LArCaliWave* caliWave;  //Input object
-    LArCaliWave* omegaScan;       //optional output object
-    LArCaliWave* resOscill0;	  //optional output object		
-    LArCaliWave* resOscill1;      //optional output object
-    LArWFParams wfParams;         //Outut object
+    helperParams(const LArCaliWave* cw, const HWIdentifier id, const unsigned g) : 
+      caliWave(cw), chid(id),gain(g) {};
+
+    const LArCaliWave* caliWave;                  //Input object
+    std::optional<LArCaliWave> omegaScan;       //optional output object
+    std::optional<LArCaliWave> resOscill0;	  //optional output object		
+    std::optional<LArCaliWave> resOscill1;      //optional output object
+    LArWFParams wfParams;                         //Outut object
     HWIdentifier chid;
     unsigned gain;
     bool success=true;
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArWFParamTool.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArWFParamTool.h
index 516527c63f45..5fefc891646c 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArWFParamTool.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArWFParamTool.h
@@ -17,7 +17,7 @@
 #include "LArRawConditions/LArCaliWave.h"
 #include "LArRawConditions/LArWaveHelper.h" 
 #include "LArCabling/LArOnOffIdMapping.h"
-
+#include <optional>
 
 static const InterfaceID IID_LArWFParamTool("LArWFParamTool", 1 , 0); 
 
@@ -59,9 +59,9 @@ public:
 			      const CaloGain::CaloGain gain,
 			      LArWFParams& wfParams,
                               const LArOnOffIdMapping *cabling,
-			      LArCaliWave* omegaScan=NULL,
-			      LArCaliWave* resOscill0=NULL,
-			      LArCaliWave* resOscill1=NULL
+			      std::optional<LArCaliWave>& omegaScan,
+			      std::optional<LArCaliWave>& resOscill0,
+			      std::optional<LArCaliWave>& resOscill1
 			      ) const;
  
   
@@ -144,7 +144,7 @@ private:
   LArWave dstepRespDfstep (const LArWave& gCali, const double& fstep, const double& Tc) const ;
   double dstepCorrDfstep (const double t, const double& fstep, const double& Tc ) const ;
   LArWave dstepCorrDfstep(const LArWave& gCali, const double& fstep, const double& Tcal ) const ;
-  StatusCode RTM_Omega0(const LArWave& gCali, const HWIdentifier chid, LArWFParams& wfParams, const WaveTiming_t& wt, const LArOnOffIdMapping *cabling, LArCaliWave* omegaScan=NULL) const;
+  StatusCode RTM_Omega0(const LArWave& gCali, const HWIdentifier chid, LArWFParams& wfParams, const WaveTiming_t& wt, const LArOnOffIdMapping *cabling, std::optional<LArCaliWave>& omegaScan) const;
   StatusCode RTM_Taur(const LArWave& gCali, LArWFParams& wfParams, const WaveTiming_t& wt) const;
   double logChi2CosRespShaper (const double omega, const LArWave& gCali, const LArWFParams& wf, const waveRange_t& range) const;
   double logChi2InjRespRes (const double taur, const LArWave& gCali, const LArWFParams& wf, const waveRange_t& range ) const ;
diff --git a/LArCalorimeter/LArCalibUtils/src/LArDeltaRespPredictor.cxx b/LArCalorimeter/LArCalibUtils/src/LArDeltaRespPredictor.cxx
index a969f9ee55f9..06d87a98b2b9 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArDeltaRespPredictor.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArDeltaRespPredictor.cxx
@@ -94,10 +94,11 @@ StatusCode LArDeltaRespPredictor::stop()
 	if ( larCaliWave.getFlag() != LArWave::dac0 ) { // skip dac0 waves
 	  // Get the waveform parameters
           LArWFParams wfParams;
+          std::optional<LArCaliWave> nullwave;
           StatusCode sc = larWFParamTool->getLArWaveParams(larCaliWave,
                                                            itVec.channelId(),
                                                            (CaloGain::CaloGain)gain,
-                                                           wfParams, cabling);
+                                                           wfParams, cabling,nullwave,nullwave,nullwave);
           if (sc.isFailure()) { // bad parameters
             ATH_MSG_INFO ( "Bad parameters for channel " << 
                            (itVec.channelId()) );
diff --git a/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx b/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx
index 3150e057a28a..9908ba9cc470 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx
@@ -4,10 +4,6 @@
 
 #include "LArCalibUtils/LArRTMParamExtractor.h"
 
-#include "GaudiKernel/MsgStream.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "StoreGate/StoreGateSvc.h"
-
 #include "LArCalibUtils/LArWFParamTool.h"
 
 #include "LArRawConditions/LArCaliWaveContainer.h"
@@ -263,9 +259,9 @@ StatusCode LArRTMParamExtractor::stop()
 
   // create and initialize new complete objects
   // ------------------------------------------
-  LArCaliPulseParamsComplete* newCaliPulseParams = new LArCaliPulseParamsComplete() ;
+  std::unique_ptr<LArCaliPulseParamsComplete> newCaliPulseParams=std::make_unique<LArCaliPulseParamsComplete>() ;
 
-    sc=newCaliPulseParams->setGroupingType(m_groupingType,msg());
+  sc=newCaliPulseParams->setGroupingType(m_groupingType,msg());
   if (sc.isFailure()) {
     ATH_MSG_ERROR( "Failed to set groupingType for LArCaliPulseParams object" );
     return sc;
@@ -276,7 +272,7 @@ StatusCode LArRTMParamExtractor::stop()
     return sc;
   }
 
-  LArDetCellParamsComplete*   newDetCellParams   = new LArDetCellParamsComplete();
+  std::unique_ptr<LArDetCellParamsComplete> newDetCellParams   = std::make_unique<LArDetCellParamsComplete>();
   sc=newDetCellParams->setGroupingType(m_groupingType,msg());
   if (sc.isFailure()) {
     ATH_MSG_ERROR( "Failed to set groupingType for LArDetCellParamsComplete object" );
@@ -290,9 +286,9 @@ StatusCode LArRTMParamExtractor::stop()
 
   // needed for omega scan dump:
   // use LArCaliWave container to store frequency spectra
-  LArCaliWaveContainer* omegaScanContainer = NULL ;
+  std::unique_ptr<LArCaliWaveContainer> omegaScanContainer;
   if ( m_dumpOmegaScan ) {
-    omegaScanContainer = new LArCaliWaveContainer();
+    omegaScanContainer = std::make_unique<LArCaliWaveContainer>();
     sc=omegaScanContainer->setGroupingType(m_groupingType,msg());
     if (sc.isFailure()) {
       ATH_MSG_ERROR( "Failed to set groupingType for LArCaliWaveContainer object" );
@@ -306,11 +302,11 @@ StatusCode LArRTMParamExtractor::stop()
   }// end if m_dumpOmegaScan
 
   // needed for residual oscillation dump:
-  LArCaliWaveContainer* resOscillContainerBefore = NULL;
-  LArCaliWaveContainer* resOscillContainerAfter  = NULL;
+  std::unique_ptr<LArCaliWaveContainer> resOscillContainerBefore;
+  std::unique_ptr<LArCaliWaveContainer> resOscillContainerAfter;
   if ( m_dumpResOscill ) {
-    resOscillContainerBefore = new LArCaliWaveContainer();
-    resOscillContainerAfter  = new LArCaliWaveContainer();
+    resOscillContainerBefore = std::make_unique<LArCaliWaveContainer>();
+    resOscillContainerAfter  = std::make_unique<LArCaliWaveContainer>();
     if(resOscillContainerBefore->setGroupingType(m_groupingType,msg()).isFailure()) {
       ATH_MSG_ERROR( "Failed to set groupingType for LArCaliWaveContainer object" );
       return StatusCode::FAILURE;
@@ -331,8 +327,6 @@ StatusCode LArRTMParamExtractor::stop()
   }
 
   // needed for existence checks:
-  //static const LArCaliPulseParamsP emptyCaliPulse ;
-  //static const LArDetCellParamsP   emptyDetCell ;
   static const LArCaliPulseParamsComplete::LArCondObj emptyCaliPulse ;
   static const LArDetCellParamsComplete::LArCondObj   emptyDetCell ;
 
@@ -461,23 +455,10 @@ StatusCode LArRTMParamExtractor::stop()
 	  if ( nchannel < 100 || ( nchannel < 1000 && nchannel%100==0 ) || nchannel%1000==0 ) 
 	    ATH_MSG_INFO( "Ingesting calibration waveform number " << nchannel);
 
-	  LArCaliWave* omegaScan = NULL ;
-	  if ( omegaScanContainer ) {
-	    omegaScan = new LArCaliWave() ;
-	  }
-	  
-	  LArCaliWave* resOscill0 = NULL ;
-	  if ( resOscillContainerBefore ) {
-	    resOscill0 = new LArCaliWave() ;
-	  }
-	  
-	  LArCaliWave* resOscill1 = NULL ;
-	  if ( resOscillContainerAfter ) {
-	    resOscill1 = new LArCaliWave() ;
-	  }
-	  
-
-	  inputParams.emplace_back(&larCaliWave,omegaScan,resOscill0,resOscill1,chid,gain);
+	  inputParams.emplace_back(&larCaliWave,chid,gain);
+          if ( omegaScanContainer ) inputParams.back().omegaScan.emplace();
+          if ( resOscillContainerBefore ) inputParams.back().resOscill0.emplace();
+          if ( resOscillContainerAfter ) inputParams.back().resOscill1.emplace();
 	  LArWFParams& wfParams=inputParams.back().wfParams ;
 	  float retrievedParam ;
 
@@ -597,7 +578,7 @@ StatusCode LArRTMParamExtractor::stop()
   }
 
   //Loop over inputParams to collect output:
-  for (const helperParams& params : inputParams) {
+  for (helperParams& params : inputParams) {
     if (!params.success) { // bad parameters
       ATH_MSG_WARNING( "Bad parameters for channel " << onlineHelper->channel_name(params.chid) << MSG::dec 
 		       << " gain=" << params.gain << " DAC=" << params.caliWave->getDAC() ) ;
@@ -607,9 +588,6 @@ StatusCode LArRTMParamExtractor::stop()
     const HWIdentifier& chid=params.chid;
     const unsigned& gain=params.gain;
     const LArCaliWave& larCaliWave=*(params.caliWave);
-    const LArCaliWave* omegaScan = params.omegaScan; 
-    const LArCaliWave* resOscill0 = params.resOscill0;
-    const LArCaliWave* resOscill1 = params.resOscill1;
 
     ATH_MSG_VERBOSE( "parameters extracted for channel " << MSG::hex << chid << MSG::dec 
 		     << " gain=" << gain << " DAC=" << larCaliWave.getDAC() ) ;
@@ -640,8 +618,7 @@ StatusCode LArRTMParamExtractor::stop()
     // collect this omega scan
     if ( omegaScanContainer ) {
       LArCaliWaveContainer::LArCaliWaves& dacScans = omegaScanContainer->get(chid, gain);
-      dacScans.push_back( *omegaScan ) ;
-      delete omegaScan; omegaScan=0; //copied to caliwave container
+      dacScans.push_back( *params.omegaScan);
       ATH_MSG_VERBOSE( "omega scan added to container, channel=" << MSG::hex << chid << MSG::dec 
 		       << " gain=" << gain ) ;
     }
@@ -649,8 +626,7 @@ StatusCode LArRTMParamExtractor::stop()
     // collect this residual oscillation before Taur extraction
     if ( resOscillContainerBefore ) {
       LArCaliWaveContainer::LArCaliWaves& dacResOsc0 = resOscillContainerBefore->get(chid, gain);
-      dacResOsc0.push_back( *resOscill0 ) ;
-      delete resOscill0; resOscill0=0; //copied to caliwave container
+      dacResOsc0.push_back( *params.resOscill0) ;
       ATH_MSG_VERBOSE( "residual oscillation before Taur extraction added to container, channel=" << MSG::hex << chid << MSG::dec 
 		<< " gain=" << gain ) ;
     }
@@ -658,8 +634,7 @@ StatusCode LArRTMParamExtractor::stop()
     // collect this residual oscillation after Taur extraction
     if ( resOscillContainerAfter ) {
       LArCaliWaveContainer::LArCaliWaves& dacResOsc1 = resOscillContainerAfter->get(chid, gain);
-      dacResOsc1.push_back( *resOscill1 ) ;
-      delete resOscill1; resOscill1=0; //copied to caliwave container
+      dacResOsc1.push_back( *params.resOscill1 ) ;
       ATH_MSG_VERBOSE( "residual oscillation after Taur extraction added to container, channel=" << MSG::hex << chid << MSG::dec 
 		       << " gain=" << gain ) ;
     }
@@ -680,10 +655,12 @@ StatusCode LArRTMParamExtractor::stop()
   ATH_MSG_INFO( " Summary : Number of EMEC      cells side A or C (connected+unconnected):  31872+3456 = 35328 " );
   ATH_MSG_INFO( " Summary : Number of HEC       cells side A or C (connected+unconnected):   2816+ 256 =  3072 " );
   ATH_MSG_INFO( " Summary : Number of FCAL      cells side A or C (connected+unconnected):   1762+  30 =  1792 " );
-	  
+
+
   // record extracted LArCaliPulseParamsComplete to detStore
   ATH_MSG_INFO( "...recording LArCaliPulseParams into det.store, key=" << m_keyExtractedCaliPulse ) ;
-  if ( StatusCode::FAILURE == ( detStore()->record(newCaliPulseParams, m_keyExtractedCaliPulse ) ) ) {
+  const LArCaliPulseParamsComplete* paramsPtr=newCaliPulseParams.get(); // remember ptr for 
+  if ( StatusCode::FAILURE == ( detStore()->record(std::move(newCaliPulseParams), m_keyExtractedCaliPulse ) ) ) {
     ATH_MSG_ERROR( "Could not record LArCaliPulseParams into det.store!" ) ;
     return StatusCode::FAILURE ;
   }
@@ -691,7 +668,7 @@ StatusCode LArRTMParamExtractor::stop()
   // Symlink LArCaliPulseParamsComplete to ILArCaliPulseParams for further use
   ATH_MSG_DEBUG( "Trying to symlink ILArCaliPulseParams with LArCaliPulseParamsComplete...");
   ILArCaliPulseParams *larCaliPulseParams = NULL;
-  sc = detStore()->symLink(newCaliPulseParams,larCaliPulseParams);
+  sc = detStore()->symLink(paramsPtr,larCaliPulseParams);
   if (sc.isFailure()) {
     ATH_MSG_FATAL( "Could not symlink ILArCaliPulseParams with LArCaliPulseParamsComplete." );
     return StatusCode::FAILURE;
@@ -700,7 +677,8 @@ StatusCode LArRTMParamExtractor::stop()
 
   // record extracted LArDetCellParamsComplete to detStore
   ATH_MSG_INFO( "...recording LArDetCellParams into det.store, key=" << m_keyExtractedDetCell) ;
-  if ( StatusCode::FAILURE == ( detStore()->record(newDetCellParams, m_keyExtractedDetCell ) ) ) {
+  const LArDetCellParamsComplete* detcellPtr=newDetCellParams.get();
+  if ( StatusCode::FAILURE == ( detStore()->record(std::move(newDetCellParams), m_keyExtractedDetCell ) ) ) {
     ATH_MSG_ERROR( "Could not record LArDetCellParams into det.store!" ) ;
     return StatusCode::FAILURE ;
   }
@@ -708,7 +686,7 @@ StatusCode LArRTMParamExtractor::stop()
   // Symlink LArDetCellParamsComplete to ILArDetCellParams for further use
   ATH_MSG_DEBUG( "Trying to symlink ILArDetCellParams with LArDetCellParamsComplete...");
   ILArDetCellParams *lArDetCellParams = NULL;
-  sc = detStore()->symLink(newDetCellParams,lArDetCellParams);
+  sc = detStore()->symLink(detcellPtr,lArDetCellParams);
   if (sc.isFailure()) {
     ATH_MSG_FATAL( "Could not symlink ILArDetCellParams with LArDetCellParamsComplete." );
     return StatusCode::FAILURE;
@@ -717,7 +695,7 @@ StatusCode LArRTMParamExtractor::stop()
 
   if ( omegaScanContainer ) {
     ATH_MSG_INFO( "Recording omega scan container into det.store, key=" << m_omegaScanKey ) ;
-    if ( StatusCode::FAILURE == ( detStore()->record(omegaScanContainer, m_omegaScanKey ) ) ) {
+    if ( StatusCode::FAILURE == ( detStore()->record(std::move(omegaScanContainer), m_omegaScanKey ) ) ) {
       ATH_MSG_WARNING( "Could not record omega scan container into DetStore!" ) ;
       // return StatusCode::FAILURE ;
     }
@@ -725,7 +703,7 @@ StatusCode LArRTMParamExtractor::stop()
 
   if ( resOscillContainerBefore ) {
     ATH_MSG_INFO( "Recording residual oscillation (before Taur extraction) container into DetStore, key = " << m_resOscillKeyBefore ) ;
-    if ( StatusCode::FAILURE == ( detStore()->record(resOscillContainerBefore, m_resOscillKeyBefore ) ) ) {
+    if ( StatusCode::FAILURE == ( detStore()->record(std::move(resOscillContainerBefore), m_resOscillKeyBefore ) ) ) {
       ATH_MSG_WARNING( "Could not record residual oscillation (before Taur extraction) container into DetStore!" ) ;
       // return StatusCode::FAILURE ;
     }
@@ -733,7 +711,7 @@ StatusCode LArRTMParamExtractor::stop()
 
   if ( resOscillContainerAfter ) {
     ATH_MSG_INFO( "Recording residual oscillation (after Taur extraction) container into DetStore, key = " << m_resOscillKeyAfter ) ;
-    if ( StatusCode::FAILURE == ( detStore()->record(resOscillContainerAfter, m_resOscillKeyAfter ) ) ) {
+    if ( StatusCode::FAILURE == ( detStore()->record(std::move(resOscillContainerAfter), m_resOscillKeyAfter ) ) ) {
       ATH_MSG_WARNING( "Could not record residual oscillation (after Taur extraction) container into DetStore!" ) ;
       // return StatusCode::FAILURE ;
     }
@@ -756,7 +734,8 @@ void LArRTMParamExtractor::Looper::operator() (const tbb::blocked_range<size_t>&
 					     m_cabling,
 					     p.omegaScan,
 					     p.resOscill0,
-					     p.resOscill1 );	
+					     p.resOscill1
+                                             );	
 
     p.success=sc.isSuccess() ;
 
diff --git a/LArCalorimeter/LArCalibUtils/src/LArWFParamTool.cxx b/LArCalorimeter/LArCalibUtils/src/LArWFParamTool.cxx
index 1289b23925ae..b58de3e23f02 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArWFParamTool.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArWFParamTool.cxx
@@ -200,9 +200,9 @@ StatusCode LArWFParamTool::getLArWaveParams(const LArCaliWave& larCaliWave,
 					    const CaloGain::CaloGain gain,
                                             LArWFParams& wfParams,
                                             const LArOnOffIdMapping *cabling,
-					    LArCaliWave* omegaScanWave,
-					    LArCaliWave* resOscill0,
-					    LArCaliWave* resOscill1)  const
+					    std::optional<LArCaliWave>& omegaScanWave,
+					    std::optional<LArCaliWave>& resOscill0,
+					    std::optional<LArCaliWave>& resOscill1)  const
 {
 
 
@@ -424,7 +424,7 @@ LArWave LArWFParamTool::dstepCorrDfstep(const LArWave& gCali, const double& fste
   return w ;
 }
 
-StatusCode LArWFParamTool::RTM_Omega0(const LArWave& gCali, const HWIdentifier chid, LArWFParams& wfParams, const WaveTiming_t& wt, const LArOnOffIdMapping *cabling, LArCaliWave* omegaScanWave) const
+StatusCode LArWFParamTool::RTM_Omega0(const LArWave& gCali, const HWIdentifier chid, LArWFParams& wfParams, const WaveTiming_t& wt, const LArOnOffIdMapping *cabling, std::optional<LArCaliWave>& omegaScanWave) const
 {
   /*  begin of the COSINE RESPONSE analysis */
    
-- 
GitLab


From 1c8dbf61f0f619cc8b9a10fdc62293c3cf54a587 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Wed, 15 Sep 2021 09:40:52 -0400
Subject: [PATCH 320/347] GeneratorFilters: Suppress cppcheck warning.

Suppress a cppcheck false positive.
---
 Generators/GeneratorFilters/src/TTbarWToLeptonFilter.cxx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Generators/GeneratorFilters/src/TTbarWToLeptonFilter.cxx b/Generators/GeneratorFilters/src/TTbarWToLeptonFilter.cxx
index f6f239067e27..391b41d0fedc 100644
--- a/Generators/GeneratorFilters/src/TTbarWToLeptonFilter.cxx
+++ b/Generators/GeneratorFilters/src/TTbarWToLeptonFilter.cxx
@@ -156,6 +156,7 @@ StatusCode TTbarWToLeptonFilter::filterEvent() {
       HepMC::GenParticle * grandchild_mcpart = (*grandchild_mcpartItr);
 		  int grandchild_pid = grandchild_mcpart->pdg_id();
 
+                  // cppcheck-suppress shiftNegative; false positive!
 		  ATH_MSG_DEBUG("W (t/tbar) has " << mcpart_n_particles_out << " children and the pdg_id of the next is " << grandchild_pid);
 
 		  // Check if the W's child is W again. If yes, then move to its next decay vertex in a decay tree
-- 
GitLab


From 7edb2bbdce2a904c77a3629a6d9ab12ad91c7cd3 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 24 Sep 2021 15:36:39 +0200
Subject: [PATCH 321/347] LArCalibUtils: Fix clang warning.

Unused private data member.
---
 LArCalorimeter/LArCalibUtils/src/LArRampBuilder.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.h b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.h
index e7dd34d0082c..ef26cd140ecb 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.h
+++ b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.h
@@ -98,7 +98,6 @@ private:
   unsigned m_event_counter=0; 
   int m_delay=-1;
   int m_ipassShape=0; 
-  int m_ipassPedestal=0; 
 
   std::vector< std::vector< std::vector< std::vector<double> > > >m_CaliWaves;
  // vector (gain) of vector(HashCell) of vector (DAC) of DACs
-- 
GitLab


From bec2680ec87f088041b7eaff8f79e04001929566 Mon Sep 17 00:00:00 2001
From: Siarhei Harkusha <Siarhei.Harkusha@cern.ch>
Date: Fri, 24 Sep 2021 23:53:48 +0200
Subject: [PATCH 322/347] TileMonitoring: Update n%32 gain switch problem test
 for calibration runs

Test of n%32 gain switch problem for calibration runs has been updated
to change threshods (patch has been prepared by Tibor).
---
 .../TileMonitoring/src/TileDigitsMonTool.cxx  | 41 +++++++++++++------
 1 file changed, 28 insertions(+), 13 deletions(-)

diff --git a/TileCalorimeter/TileMonitoring/src/TileDigitsMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TileDigitsMonTool.cxx
index bf82ab9914b2..82e406e496d9 100644
--- a/TileCalorimeter/TileMonitoring/src/TileDigitsMonTool.cxx
+++ b/TileCalorimeter/TileMonitoring/src/TileDigitsMonTool.cxx
@@ -1513,26 +1513,27 @@ int TileDigitsMonTool::stuckBits_Amp2(TH1S * hist, TH1C *modhist, int gain, TH2C
     if ((ba0[b] == 0 || ba1[b] == 0) && bac[b] > 2 && (ba0[b] + ba1[b] >= bac[b] / 2 || ba0[b] + ba1[b] > 2)) {
       is_stack = 1;
       if (outhist != NULL) {
-	  sb_prob[sb_map[b]] = 100.;
+        sb_prob[sb_map[b]] = 1.;
       }
       if (stuck_probs != NULL)
-	stuck_probs[b] = ba0[b] == 0 ? 100u : 200u;
+        stuck_probs[b] = ba0[b] == 0 ? 100u : 200u;
       continue;
     }
     double bs1 = std::fabs(bs[b]) - sqrt(std::fabs(bs[b]));
     if (bs1 < 0.) bs1 = 0.;
     if ((bs1 > 0.5 * bc[b]) || (bc[b] > 7 && bs1 * 3 > bc[b])) is_stack = 1;
     if (outhist != NULL && bc[b] > 0) {
-      if (sb_prob[sb_map[b]] < 100. * bs1 / bc[b]) sb_prob[sb_map[b]] = 100. * bs1 / bc[b];
+      // if (sb_prob[sb_map[b]] < 100. * bs1 / bc[b]) sb_prob[sb_map[b]] = 100. * bs1 / bc[b];
+      sb_prob[sb_map[b]] = 1. - (1. - sb_prob[sb_map[b]]) * (1. - 1. * bs1 / bc[b]); // prod of probs. of not-stuck
     }
     if (stuck_probs != NULL)
     {
       stuck_probs[b] = (uint8_t) (100. * bs1 / bc[b]);
       if (bs[b] > 0)
       {
-	stuck_probs[b] += 100u;
-	if (stuck_probs[b] == 100u)
-	  stuck_probs[b] = 0u;
+        stuck_probs[b] += 100u;
+        if (stuck_probs[b] == 100u)
+          stuck_probs[b] = 0u;
       }
     }
   }
@@ -1540,14 +1541,16 @@ int TileDigitsMonTool::stuckBits_Amp2(TH1S * hist, TH1C *modhist, int gain, TH2C
       || (last_non0 == (m_i_ADCmax + 1) / 2 - 1 && hist->GetBinContent(last_non0) > 3)) {
     is_stack = 1;
     sb_prob[3] = 100.;
+    sb_prob[3] = 1.;
     if (stuck_probs != NULL)
       stuck_probs[9] = first_non0 >= 512 ? 200u : 100u;
   }
   if (outhist != NULL) {
-    outhist->Fill((double) ch, 0., sb_prob[0]);
-    outhist->Fill((double) ch, 1., sb_prob[1]);
-    outhist->Fill((double) ch, 2., sb_prob[2]);
-    outhist->Fill((double) ch, 3., sb_prob[3]);
+    outhist->Fill((double) ch, 0., 100. * sb_prob[0]);
+    outhist->Fill((double) ch, 1., 100. * sb_prob[1]);
+    outhist->Fill((double) ch, 2., 100. * sb_prob[2]);
+    outhist->Fill((double) ch, 3., 100. * sb_prob[3]);
+
     if (first_non0 >= saturation_limit)
       outhist->Fill((double) ch, 5., 100.);
     else if (last_non0 >= saturation_limit) {
@@ -1573,15 +1576,27 @@ int TileDigitsMonTool::stuckBits_Amp2(TH1S * hist, TH1C *modhist, int gain, TH2C
       if (frac > 99. && frac < 100.) frac = 99.;
       outhist->Fill((double) ch, 4., frac);
     }
+    double entries, empty_cut, full_cut;
     int mod32empty = 0;
     int mod32full = 0;
+    bool enough = false;
+    entries = modhist -> GetEntries();
+    empty_cut = entries < 4096. ? entries / (32 * 4) : 32.;
+    full_cut = entries / 32.;
+    if (full_cut > 126.)
+      full_cut = 126.;
+    if (full_cut - empty_cut < 1.)
+      full_cut = empty_cut + 1.;
+
     for (i = 1; i <= 32; ++i) {
-      if (modhist->GetBinContent(i) == 0)
+      if (modhist->GetBinContent(i) <= empty_cut)
         ++mod32empty;
-      else if (modhist->GetBinContent(i) > 20)
+      else if (modhist->GetBinContent(i) > full_cut)
         ++mod32full;
+      if (modhist->GetBinContent(i) > 64)
+       enough = true;
     }
-    if (mod32empty + mod32full == 32) //skip in the case of small number of events
+    if (mod32empty + mod32full == 32 || enough) //skip in the case of small number of events
       if (mod32empty != 0 && mod32full != 0) //some but not all n%32 positions have events
         outhist->Fill((double) ch, 6., mod32empty);
 
-- 
GitLab


From 781b8dd83dce52b5882f350fd08172fe6aea10c1 Mon Sep 17 00:00:00 2001
From: Siarhei Harkusha <Siarhei.Harkusha@cern.ch>
Date: Sat, 25 Sep 2021 01:42:48 +0200
Subject: [PATCH 323/347] TileRecEx: Update jO used for reconstruction of Tile
 calbiration runs

Path to look for Tile calibration run has been updated.

Parameter doTilePedDiffMon to monitor pedestal difference
between calculated pedestal in current run and one stored in DB.

Limits for saturation and zero tests have been configured
for high gain during monitoring of Tile digits.

New binning in low and high gains (non-uniform bin width in the case of high gain)
has been switched on for histograms produced for laser calibration runs.

Energy thresholds have been modified for minitoring of Tile cells
and timing histograms have been switched on.
---
 .../share/jobOptions_TileCalibRec.py          | 33 ++++++++++++-------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
index b2a756215389..f092cf7f9ece 100644
--- a/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
+++ b/TileCalorimeter/TileExample/TileRecEx/share/jobOptions_TileCalibRec.py
@@ -208,8 +208,10 @@ else:
                 Year = 2018
             elif RunNumber < 374260:
                 Year = 2019
-            else:
+            elif RunNumber < 387000:
                 Year = 2020
+            else:
+                Year = 2021
 
 
             if 'RunStream' in dir():
@@ -321,7 +323,7 @@ if not 'Version' in dir():
     Version = "0"
 
 if not 'OutputDirectory' in dir():
-    OutputDirectory = "/tmp/Reco-" + str(RunNumber) + "-" + Version + "/"
+    OutputDirectory = "/tmp/Reco-" + str(RunNumber) + "-" + Version
 
 system('mkdir -p %s' % (OutputDirectory))
 
@@ -367,6 +369,9 @@ if not 'TileL1CaloRun' in dir():
 TileLasPulse = TileLasRun
 TileCisPulse = (TileCisRun or TileMonoRun or TileRampRun or TileL1CaloRun)
 
+if not (TilePhysRun or TileL1CaloRun) and EvtMinNotSet in dir():
+    EvtMin = 1
+
 if not 'TilePhysTiming' in dir():
     TilePhysTiming = False
 
@@ -615,7 +620,7 @@ if not 'doCaloCell' in dir():
         doCaloCell = False
 
 if not 'TileD3PDSavePosition' in dir():
-    TileD3PDSavePosition = False
+    TileD3PDSavePosition = True
 
 if not 'TileFragIDsToIgnoreDMUErrors' in dir():
     # List of Tile module frag IDs for which ignore DMU errors
@@ -624,6 +629,9 @@ if not 'TileFragIDsToIgnoreDMUErrors' in dir():
     else:
         TileFragIDsToIgnoreDMUErrors = []
 
+if not 'doTilePedDiffMon' in dir():
+    doTilePedDiffMon = False  # Needed during maintanance campaign
+
 #---------------
 # end of options
 #---------------
@@ -1282,7 +1290,11 @@ if doTileMon:
                                                book2D          = b2d,
                                                runType         = runType,
                                                FragIDsToIgnoreDMUErrors = TileFragIDsToIgnoreDMUErrors,
-                                               FillPedestalDifference = True)
+                                               FillPedestalDifference = doTilePedDiffMon)
+
+        if not TileBiGainRun:
+            theTileDigitsMon.ZeroLimitHG = 2
+            theTileDigitsMon.SaturationLimitHG = 1022
 
         TileMon.AthenaMonTools += [ theTileDigitsMon ]
         printfunc (theTileDigitsMon)
@@ -1324,6 +1336,9 @@ if doTileMon:
         if useRODReco:
             theTileRawChannelMon.TileRawChannelContainerDSP = "TileRawChannelCnt"
 
+        if TileLasRun:
+            theTileRawChannelMon.overlaphists = True
+
         #theTileRawChannelMon.MinAmpForCorrectedTime = 0.1
 
         printfunc (theTileRawChannelMon)
@@ -1385,9 +1400,9 @@ if doTileMon:
                                              cellsContainerName = "AllCalo",
                                              histoPathBase      = "/Tile/Cell");
 
-            #theTileCellMon.energyThreshold = 300.
-            #theTileCellMon.energyThresholdForTime = 150.
-            #theTileCellMon.FillTimeHistograms = True
+            theTileCellMon.energyThreshold = 300.
+            theTileCellMon.energyThresholdForTime = 150.
+            theTileCellMon.FillTimeHistograms = True
             TileMon.AthenaMonTools += [ theTileCellMon ];
             printfunc (theTileCellMon)
 
@@ -1758,7 +1773,3 @@ if not 'db' in dir():
     from DBReplicaSvc.DBReplicaSvcConf import DBReplicaSvc
     svcMgr += DBReplicaSvc(UseCOOLSQLite=False)
 
-
-# Needed during maintanance campaign
-# if doTileMon and doTileMonDigi: ToolSvc.TileDigitsMon.FillPedestalDifference = False
-
-- 
GitLab


From 2f26592e20d0238bc813270af7f390514bad4cb1 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Mon, 27 Sep 2021 06:00:38 +0200
Subject: [PATCH 324/347] Several updates in the TestLArDetDescr package

1. Header files moved into the src directory
2. The clients of CaloDetDescrManager switched to reading it from Condition Store
3. Did a minor cleanup of the code
---
 .../TestLArDetDescr/TestLArTT.h               |  53 ------
 .../TestLArDetDescr/src/TestCaloGeom.cxx      | 167 +-----------------
 .../{TestLArDetDescr => src}/TestCaloGeom.h   |  29 ++-
 .../TestLArDetDescr/src/TestLArMaterial.cxx   |  23 ++-
 .../TestLArMaterial.h                         |  34 ++--
 .../TestLArDetDescr/src/TestLArTT.cxx         |  15 +-
 .../TestLArDetDescr/src/TestLArTT.h           |  49 +++++
 .../components/TestLArDetDescr_entries.cxx    |   6 +-
 8 files changed, 105 insertions(+), 271 deletions(-)
 delete mode 100755 LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestLArTT.h
 rename LArCalorimeter/LArExample/TestLArDetDescr/{TestLArDetDescr => src}/TestCaloGeom.h (50%)
 rename LArCalorimeter/LArExample/TestLArDetDescr/{TestLArDetDescr => src}/TestLArMaterial.h (53%)
 create mode 100755 LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArTT.h

diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestLArTT.h b/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestLArTT.h
deleted file mode 100755
index 140e66caa340..000000000000
--- a/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestLArTT.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TESTLARDETDESCR_TESTLARTT_H
-#define TESTLARDETDESCR_TESTLARTT_H
-
-/********************************************************************
-
-NAME:     TestLArTT.h 
-PACKAGE:  offline/LArCalorimeter/LArExample/TestLArDetDescr
-
-AUTHORS:  Claire Adam-Bourdarios
-CREATED:  Feb 2003
-
-PURPOSE:  provide example to retreive CaloTTDetDescr manager and
-          TTregions from StoreGate and test them.
-
-********************************************************************/
-// INCLUDE HEADER FILES:
-#include "AthenaBaseComps/AthAlgorithm.h"
-
-class CaloTTDescrManager;
-
-class TestLArTT : public AthAlgorithm
-{
- public:
-
-  // constructor 
-  TestLArTT(const std::string& name, ISvcLocator* pSvcLocator);
-  // destructor 
-  virtual ~TestLArTT();
-
-  virtual StatusCode initialize();
-  virtual StatusCode finalize();
-  virtual StatusCode execute();
-
-  void print_reg(bool em, bool hec, bool fcal, bool tile);
-
- protected:
-  const CaloTTDescrManager*  m_tt_man;
-};
-
-#endif
-
-//end of TESTLARDETDESCR_TESTLARTT 
-
-
-
-
-
-
-
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloGeom.cxx b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloGeom.cxx
index 8b723c037653..39ca07d80698 100755
--- a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloGeom.cxx
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloGeom.cxx
@@ -1,9 +1,9 @@
 /*
-  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 HEADER FILES:
-#include "TestLArDetDescr/TestCaloGeom.h"
+#include "TestCaloGeom.h"
 
 // Athena related 
 #include "GaudiKernel/MsgStream.h"
@@ -20,7 +20,6 @@
 
 // specific :
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "CaloGeoHelpers/CaloPhiRange.h"
 #include "CaloDetDescr/ICaloCoordinateTool.h"
@@ -31,9 +30,8 @@
 // Constructor 
 // -------------------------------------------------------------
 TestCaloGeom::TestCaloGeom(const std::string& name, 
-				   ISvcLocator* pSvcLocator): 
+			   ISvcLocator* pSvcLocator): 
   AthAlgorithm(name, pSvcLocator),
-  m_calo_dd_man(0),
   m_coord("TBCaloCoordinate")
 {}
 
@@ -44,7 +42,6 @@ TestCaloGeom::~TestCaloGeom()
 // INITIALIZE:
 StatusCode TestCaloGeom::initialize()
 {
-  m_calo_dd_man = CaloDetDescrManager::instance();
   ATH_CHECK( m_coord.retrieve() );
   return StatusCode::SUCCESS;
 }
@@ -69,164 +66,6 @@ StatusCode TestCaloGeom::execute()
   return StatusCode::SUCCESS;
 }
 
-void
-TestCaloGeom::print_elt(bool em, bool hec, bool fcal, bool tile)
-{
-  boost::io::ios_base_all_saver coutsave (std::cout);
-
-  ATH_MSG_INFO ( " printing CaloDDE characteristics " );
-
-  IdentifierHash idcalohash,hash_min,hash_max ;
-  Identifier id;
-
-  const CaloCell_ID* help_all = m_calo_dd_man->getCaloCell_ID();
-
-  //
-  // Now loop on CaloCell:
-  //
-
-  int phi_num = 1;
-
-  help_all->calo_cell_hash_range( (int) CaloCell_ID::LAREM ,
-				  hash_min, hash_max);
-
-  std::cout << " ---- EM hash range is " << hash_min << " to " 
-	    << hash_max << std::endl;
-
-  for ( unsigned int i = (unsigned int) hash_min ; 
-	i < (unsigned int) hash_max ; i++ )
-    {
-      idcalohash = (IdentifierHash) i;
-      id = help_all->cell_id(idcalohash);
-
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
-      if ( !newelt ) std::cout << "missing em element" 
-			       << i << std::endl;
-      
-      else if ( em && help_all->phi(id) == phi_num && newelt->eta() >=0) { 
-	double x_local =  newelt->x();
-	double y_local =  newelt->y();
-	double z_local =  newelt->z();
-	double x,y,z;
-     	std::cout  << std::setw(9) << std::setprecision(4) 
-		   << "calo-hash=" << i << " region: "
-		   << help_all->sampling(id)<< " " 
-		   << help_all->region(id)<< " "
-		   << " ieta= " <<  help_all->eta(id)
-		   << " " << newelt->eta()
-		   << " phi= " << newelt->phi()
-		   << " r= " << newelt->r()
-		   << std::endl;
-	
-	m_coord->local_to_ctb(x_local,y_local,z_local,x,y,z);
-	double r = sqrt ( x*x+y*y);
-	double bigr = sqrt ( x*x+y*y+z*z);
-	double eta_ctb =  -std::log((bigr-z)/r);
-     	std::cout  << std::setw(9) << std::setprecision(4) 
-		   << "new cell eta_ctb=" << eta_ctb
-		   << std::endl;
-      }
-    }
-
-
-  help_all->calo_cell_hash_range( (int) CaloCell_ID::LARHEC ,
-				  hash_min, hash_max);
-
-  std::cout << " ---- HEC hash range is " << hash_min << " to " 
-	    << hash_max << std::endl;
-
-  for ( unsigned int i = (unsigned int) hash_min ; 
-	i < (unsigned int) hash_max ; i++ )
-    {
-      idcalohash = (IdentifierHash) i;
-      id = help_all->cell_id(idcalohash);
-
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash);
-      if ( !newelt ) 
-	std::cout << "missing hec element" 
-		  << i << std::endl;
-      
-      else if ( hec && help_all->phi(id) == phi_num && newelt->eta() >=0) { 
-	  std::cout  << std::setw(9) << std::setprecision(4) 
-		  << "calo-hash=" << i << " region: "
-		    << help_all->sampling(id)<< " " 
-		    << help_all->region(id)<< " "
-		    << " ieta= " <<  help_all->eta(id)
-		    << " elt: " << newelt->eta()
-		    << " phi= " << newelt->phi()
-		  << " r= " << newelt->r()
-		    << std::endl;
-	}
-    }
-
-  help_all->calo_cell_hash_range( (int) CaloCell_ID::LARFCAL ,
-				  hash_min, hash_max);
-
-  std::cout << " ---- FCAL hash range is " << hash_min << " to " 
-	    << hash_max << std::endl;
-
-  for ( unsigned int i = (unsigned int) hash_min ; 
-	i < (unsigned int) hash_max ; i++ )
-    {
-      idcalohash = (IdentifierHash) i;
-      id = help_all->cell_id(idcalohash);
-
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
-      if ( !newelt ) std::cout << "missing fcal element" 
-			       << i << std::endl;
-
-      else if (fcal && help_all->phi(id) == phi_num && 
-	       help_all->pos_neg(id) >=0) { 
-
-	std::cout  << std::setw(9) << std::setprecision(4) 
-		   << "calo-hash=" << i << " region: "
-		  << help_all-> module(id)<< " " 
-		  << " ieta= " <<  help_all->eta(id)
-		  << " " << newelt->eta()
-		  << " phi= " << newelt->phi()
-		  << " x,y,z " << newelt->x()<< " " <<  newelt->y()
-		  << " " <<  newelt->z()
-		  << std::endl;
-
-      }
-
-    }
-
-  if (tile) {
-
-  help_all->calo_cell_hash_range( (int) CaloCell_ID::TILE ,
-				  hash_min, hash_max);
-
-  std::cout << " ---- Tile hash range is " << hash_min << " to " 
-	    << hash_max << std::endl;
-
-  for ( unsigned int i = (unsigned int) hash_min ; 
-	i < (unsigned int) hash_max ; i++ )
-    {
-      idcalohash = (IdentifierHash) i;
-      id = help_all->cell_id(idcalohash);
-
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
-      if ( !newelt ) std::cout << "missing Tile element" 
-			       << i << std::endl;
-
-      else if (tile && help_all->phi(id) == phi_num && 
-	       help_all->pos_neg(id) >=0) { 
-
-	std::cout  << std::setw(9) << std::setprecision(4) 
-		   << "calo-hash=" << i 
-		   << " ieta= " <<  help_all->eta(id)
-		   << " " << newelt->eta()
-		   << " phi= " << newelt->phi()
-		   << " x,y,z " << newelt->x()<< " " <<  newelt->y()
-		   << " " <<  newelt->z()
-		   << std::endl;
-
-      }
-    }
-  }
-}
-
 void
 TestCaloGeom::print_beam()
 {
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloGeom.h b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloGeom.h
similarity index 50%
rename from LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloGeom.h
rename to LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloGeom.h
index 1999eaa75edc..120d1bac7036 100755
--- a/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestCaloGeom.h
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestCaloGeom.h
@@ -1,26 +1,24 @@
 /*
-  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 TESTLARDETDESCR_TESTCALOGEOM_H
 #define TESTLARDETDESCR_TESTCALOGEOM_H
 
-/********************************************************************
+/**
+ *
+ * @file   TestCaloGeom.h 
+ * @author Claire Adam-Bourdarios
+ * @date   Sept 2004
+ *
+ * @brief  provide example to play with the H8 CTB geometry.
+ *
+ */
 
-NAME:     TestCaloGeom.h 
-PACKAGE:  offline/LArCalorimeter/LArExample/TestLArDetDescr
-
-AUTHORS:  Claire Adam-Bourdarios
-CREATED:  Sept 2004
-
-PURPOSE:  provide example to play with the H8 CTB geometry.
-
-********************************************************************/
 // INCLUDE HEADER FILES:
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "GaudiKernel/ToolHandle.h"
 
-class CaloDetDescrManager;
 class ICaloCoordinateTool;
 
 class TestCaloGeom : public AthAlgorithm
@@ -32,15 +30,14 @@ class TestCaloGeom : public AthAlgorithm
   // destructor 
   virtual ~TestCaloGeom();
 
-  virtual StatusCode initialize();
-  virtual StatusCode finalize();
-  virtual StatusCode execute();
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+  virtual StatusCode execute() override;
 
   void print_elt(bool em, bool hec, bool fcal, bool tile);
   void print_beam();
 
  protected:
-  const CaloDetDescrManager*  m_calo_dd_man;
   ToolHandle<ICaloCoordinateTool> m_coord;
 };
 
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArMaterial.cxx b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArMaterial.cxx
index 65184a941833..82bc38193bcc 100755
--- a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArMaterial.cxx
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArMaterial.cxx
@@ -3,7 +3,7 @@
 */
 
 // INCLUDE HEADER FILES:
-#include "TestLArDetDescr/TestLArMaterial.h"
+#include "TestLArMaterial.h"
 
 // Athena related 
 #include "Gaudi/Property.h"
@@ -19,7 +19,6 @@
 
 // specific :
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloDetDescr/CaloDetDescrElement.h"
 #include "CaloGeoHelpers/CaloPhiRange.h"
 #include "CaloDetDescr/ICaloRecoMaterialTool.h"
@@ -35,7 +34,6 @@
 TestLArMaterial::TestLArMaterial(const std::string& name, 
 				   ISvcLocator* pSvcLocator): 
   AthAlgorithm(name, pSvcLocator),
-  m_calo_dd_man(0),
   m_surfbuild(0),
   m_lar_names(0),
   m_lar_mat(0)
@@ -48,7 +46,7 @@ TestLArMaterial::~TestLArMaterial()
 // INITIALIZE:
 StatusCode TestLArMaterial::initialize()
 {
-  m_calo_dd_man = CaloDetDescrManager::instance();
+  ATH_CHECK(m_readCondKey.initialize());
   return StatusCode::SUCCESS;
 }
 
@@ -99,10 +97,17 @@ TestLArMaterial::print_elt(bool em, bool hec, bool fcal, bool tile)
 
   ATH_MSG_INFO ( " printing CaloDDE characteristics " );
 
+  SG::ReadCondHandle<CaloDetDescrManager> readCondHandle{m_readCondKey};
+  const CaloDetDescrManager* caloMgr = *readCondHandle;
+  if(!caloMgr) {
+    ATH_MSG_FATAL("Failed to get CaloDetDescrManager from Condition Store");
+    return;
+  }
+
   IdentifierHash idcalohash,hash_min,hash_max ;
   Identifier id;
 
-  const CaloCell_ID* help_all = m_calo_dd_man->getCaloCell_ID();
+  const CaloCell_ID* help_all = caloMgr->getCaloCell_ID();
 
   //
   // Now loop on CaloCell:
@@ -122,7 +127,7 @@ TestLArMaterial::print_elt(bool em, bool hec, bool fcal, bool tile)
       idcalohash = (IdentifierHash) i;
       id = help_all->cell_id(idcalohash);
 
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloMgr->get_element(idcalohash); 
       if ( !newelt ) std::cout << "missing em element" 
 			       << i << std::endl;
       
@@ -156,7 +161,7 @@ TestLArMaterial::print_elt(bool em, bool hec, bool fcal, bool tile)
       idcalohash = (IdentifierHash) i;
       id = help_all->cell_id(idcalohash);
 
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloMgr->get_element(idcalohash); 
       if ( !newelt ) 
 	std::cout << "missing hec element" 
 		  << i << std::endl;
@@ -186,7 +191,7 @@ TestLArMaterial::print_elt(bool em, bool hec, bool fcal, bool tile)
       idcalohash = (IdentifierHash) i;
       id = help_all->cell_id(idcalohash);
 
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloMgr->get_element(idcalohash); 
       if ( !newelt ) std::cout << "missing fcal element" 
 			       << i << std::endl;
 
@@ -221,7 +226,7 @@ TestLArMaterial::print_elt(bool em, bool hec, bool fcal, bool tile)
       idcalohash = (IdentifierHash) i;
       id = help_all->cell_id(idcalohash);
 
-      const CaloDetDescrElement* newelt = m_calo_dd_man->get_element(idcalohash); 
+      const CaloDetDescrElement* newelt = caloMgr->get_element(idcalohash); 
       if ( !newelt ) std::cout << "missing Tile element" 
 			       << i << std::endl;
 
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestLArMaterial.h b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArMaterial.h
similarity index 53%
rename from LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestLArMaterial.h
rename to LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArMaterial.h
index 5c6692245ab9..a110da9c7b00 100755
--- a/LArCalorimeter/LArExample/TestLArDetDescr/TestLArDetDescr/TestLArMaterial.h
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArMaterial.h
@@ -1,26 +1,24 @@
 /*
-  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 TESTLARDETDESCR_TESTLARMATERIAL_H
 #define TESTLARDETDESCR_TESTLARMATERIAL_H
 
-/********************************************************************
+/**
+ * @file   TestLArMaterial.h
+ * @author Claire Adam-Bourdarios
+ * @date   Sept 2004
+ * 
+ * @brief  provide example to play with the H8 CTB geometry.
+ */
 
-NAME:     TestLArMaterial.h 
-PACKAGE:  offline/LArCalorimeter/LArExample/TestLArDetDescr
-
-AUTHORS:  Claire Adam-Bourdarios
-CREATED:  Sept 2004
-
-PURPOSE:  provide example to play with the H8 CTB geometry.
-
-********************************************************************/
 // INCLUDE HEADER FILES:
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "CaloDetDescr/CaloSubdetNames.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
+#include "StoreGate/ReadCondHandleKey.h"
 
-class CaloDetDescrManager;
 class ICaloRecoMaterialTool;
 class ICaloSurfaceBuilder;
 
@@ -33,16 +31,20 @@ class TestLArMaterial : public AthAlgorithm
   // destructor 
   virtual ~TestLArMaterial();
 
-  virtual StatusCode initialize();
-  virtual StatusCode finalize();
-  virtual StatusCode execute();
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+  virtual StatusCode execute() override;
 
   void print_elt(bool em, bool hec, bool fcal, bool tile);
 
   void print_Layers();
 
  protected:
-  const CaloDetDescrManager*  m_calo_dd_man;
+  SG::ReadCondHandleKey<CaloDetDescrManager> m_readCondKey { this
+      , "CaloDetDescrManager"
+      , "CaloDetDescrManager"
+      , "SG Key for CaloDetDescrManager in the Condition Store" };
+
   ICaloSurfaceBuilder*   m_surfbuild;
   CaloSubdetNames* m_lar_names;
   ICaloRecoMaterialTool* m_lar_mat;
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArTT.cxx b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArTT.cxx
index 07eda3a9d188..6b175dca08bc 100755
--- a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArTT.cxx
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArTT.cxx
@@ -1,9 +1,9 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-20211 CERN for the benefit of the ATLAS collaboration
 */
 
 // INCLUDE HEADER FILES:
-#include "TestLArDetDescr/TestLArTT.h"
+#include "TestLArTT.h"
 
 // Athena related 
 #include "GaudiKernel/MsgStream.h"
@@ -13,21 +13,16 @@
 #include "CLHEP/Units/SystemOfUnits.h"
 
 // specific :
-#include "CaloDetDescr/CaloDetDescrManager.h"
 #include "CaloTTDetDescr/CaloTTDescrManager.h"
 #include "CaloTTDetDescr/CaloTTDescriptor.h"
 
-// looking for Volumes :
-//#include "LArDetDescr/ILArVolumeTool.h"
-//#include "GaudiKernel/IToolSvc.h"
-
 // -------------------------------------------------------------
 // Constructor 
 // -------------------------------------------------------------
 TestLArTT::TestLArTT(const std::string& name, 
 				   ISvcLocator* pSvcLocator): 
   AthAlgorithm(name, pSvcLocator),
-  m_tt_man(0)
+  m_tt_man(nullptr)
 {}
 
 // DESTRUCTOR:
@@ -51,13 +46,13 @@ StatusCode TestLArTT::finalize()
 // EXECUTE:
 StatusCode TestLArTT::execute()
 {  
-  print_reg( false, true, true, false );
+  print_reg();
   
   return StatusCode::SUCCESS;
 }
 
 void
-TestLArTT::print_reg(bool /*em*/, bool /*hec*/, bool /*fcal*/, bool /*tiles*/)
+TestLArTT::print_reg()
 {
   ATH_MSG_INFO ( "Executing TestLArTT" );
 
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArTT.h b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArTT.h
new file mode 100755
index 000000000000..4e22ff5fdd2b
--- /dev/null
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/TestLArTT.h
@@ -0,0 +1,49 @@
+/*
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TESTLARDETDESCR_TESTLARTT_H
+#define TESTLARDETDESCR_TESTLARTT_H
+
+/**
+ * @file   TestLArTT.h 
+ * @author Claire Adam-Bourdarios
+ * @date   Feb 2003
+ * @brief  provide example to retreive CaloTTDetDescr manager and
+ *         TTregions from StoreGate and test them.
+ */
+
+// INCLUDE HEADER FILES:
+#include "AthenaBaseComps/AthAlgorithm.h"
+
+class CaloTTDescrManager;
+
+class TestLArTT : public AthAlgorithm
+{
+ public:
+
+  // constructor 
+  TestLArTT(const std::string& name, ISvcLocator* pSvcLocator);
+  // destructor 
+  virtual ~TestLArTT();
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode finalize() override;
+  virtual StatusCode execute() override;
+
+  void print_reg();
+
+ protected:
+  const CaloTTDescrManager*  m_tt_man;
+};
+
+#endif
+
+//end of TESTLARDETDESCR_TESTLARTT 
+
+
+
+
+
+
+
diff --git a/LArCalorimeter/LArExample/TestLArDetDescr/src/components/TestLArDetDescr_entries.cxx b/LArCalorimeter/LArExample/TestLArDetDescr/src/components/TestLArDetDescr_entries.cxx
index c58a60e36827..c5aff032da7b 100644
--- a/LArCalorimeter/LArExample/TestLArDetDescr/src/components/TestLArDetDescr_entries.cxx
+++ b/LArCalorimeter/LArExample/TestLArDetDescr/src/components/TestLArDetDescr_entries.cxx
@@ -1,7 +1,7 @@
 #include "../TestCaloDDE.h"
-#include "TestLArDetDescr/TestCaloGeom.h"
-#include "TestLArDetDescr/TestLArTT.h"
-#include "TestLArDetDescr/TestLArMaterial.h"
+#include "../TestCaloGeom.h"
+#include "../TestLArTT.h"
+#include "../TestLArMaterial.h"
 
 DECLARE_COMPONENT( TestCaloDDE )
 DECLARE_COMPONENT( TestCaloGeom )
-- 
GitLab


From 8bc1f84d9e3fcabbd9597933131c3bdddf278519 Mon Sep 17 00:00:00 2001
From: Benjamin <benjamin.kerridge@cern.ch>
Date: Mon, 27 Sep 2021 09:36:50 +0200
Subject: [PATCH 325/347] add TIDAdata-run3-fslrt.dat to the job directory

---
 .../TrigInDetValidation/python/TrigInDetArtSteps.py              | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
index 82ae78215c41..2eb30317f850 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetArtSteps.py
@@ -234,6 +234,7 @@ class TrigInDetRdictStep(Step):
             os.system( 'get_files -data TIDAdata-run3-larged0.dat &> /dev/null' )
             os.system( 'get_files -data TIDAdata-run3-larged0-el.dat &> /dev/null' )
             os.system( 'get_files -data TIDAdata-run3-lrt.dat &> /dev/null' )
+            os.system( 'get_files -data TIDAdata-run3-fslrt.dat &> /dev/null' )
             os.system( 'get_files -data TIDAdata-run3-minbias.dat &> /dev/null' )
             os.system( 'get_files -data TIDAdata-run3-TnP.dat &> /dev/null' )
             os.system( 'get_files -data TIDAdata_cuts.dat &> /dev/null' )
-- 
GitLab


From 4a7571323d4bc11884c97388f6a759e57f89417a Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 27 Sep 2021 09:54:27 +0200
Subject: [PATCH 326/347] L1Topo: remove obsolete XML menu reading code

Remove all code and testing files related to the obsolete XML LVL1
format. Only JSON is supported in Run-3.
---
 .../TrigT1/L1Topo/L1TopoConfig/CMakeLists.txt |   7 -
 .../L1TopoConfig/L1TopoConfig/L1TopoMenu.h    |   5 +-
 .../L1TopoConfig/L1TopoXMLHelper.h            |  28 ---
 .../L1TopoConfig/L1TopoXMLParser.h            |  88 -------
 .../L1Topo/L1TopoConfig/Root/L1TopoMenu.cxx   |  92 +------
 .../L1TopoConfig/Root/L1TopoXMLHelper.cxx     |  97 --------
 .../L1TopoConfig/Root/L1TopoXMLParser.cxx     | 226 ------------------
 .../L1Topo/L1TopoConfig/data/testConfig.xml   |  30 ---
 .../L1Topo/L1TopoConfig/data/testConfig2.xml  |  84 -------
 .../L1Topo/L1TopoConfig/data/testConfig3.xml  |  88 -------
 .../L1Topo/L1TopoConfig/data/testConfig4e.xml | 133 -----------
 .../L1Topo/L1TopoConfig/data/testConfig5.xml  |  85 -------
 .../L1Topo/L1TopoConfig/data/testConfig6.xml  |  69 ------
 .../L1TopoConfig/src/test/TopoReader.cxx      |  37 ---
 .../L1TopoCoreSim/TopoSteering.h              |   4 +-
 .../L1TopoCoreSim/Root/TopoSteering.cxx       |  11 -
 .../Root/test/TopoStandAlone.cxx              |  85 -------
 .../L1TopoCoreSim/Root/test/TopoTest.cxx      |  83 -------
 .../L1TopoCoreSim/Root/test/inputEvents.txt   |  32 ---
 .../L1TopoCoreSim/src/test/TopoStandAlone.cxx |   1 -
 .../src/test/TopoTestSteeringConfig.cxx       |   5 +-
 .../share/L1TopoSimulationTest.py             |   8 +-
 .../src/test/L1TopoSimulationTest.cxx         |   6 +-
 .../src/test/L1TopoSimulationTest.h           |   1 -
 24 files changed, 10 insertions(+), 1295 deletions(-)
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoXMLHelper.h
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoXMLParser.h
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoXMLHelper.cxx
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoXMLParser.cxx
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig.xml
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig2.xml
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig3.xml
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig4e.xml
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig5.xml
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig6.xml
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoConfig/src/test/TopoReader.cxx
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/TopoStandAlone.cxx
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/TopoTest.cxx
 delete mode 100644 Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/inputEvents.txt

diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/CMakeLists.txt b/Trigger/TrigT1/L1Topo/L1TopoConfig/CMakeLists.txt
index 098bafc99823..fb6f27470274 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/CMakeLists.txt
+++ b/Trigger/TrigT1/L1Topo/L1TopoConfig/CMakeLists.txt
@@ -15,10 +15,3 @@ atlas_add_library( L1TopoConfig
                    INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
                    LINK_LIBRARIES TrigConfBase L1TopoCommon )
 
-atlas_add_executable( TrigConfTopoReader
-                      src/test/TopoReader.cxx
-                      LINK_LIBRARIES L1TopoConfig )
-
-# Install files from the package:
-atlas_install_xmls( data/*.xml )
-
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoMenu.h b/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoMenu.h
index 50854f4eea15..f3c0ad05845a 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoMenu.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoMenu.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 L1TOPOMENU_HPP
@@ -77,13 +77,10 @@ namespace TXC {
 
       L1TopoMenu& operator=(L1TopoMenu&& o) noexcept = default;
       
-      void writeXML(const std::string& xmlfile);
-
    private:
 
       L1TopoMenu& operator=(const L1TopoMenu&) {return *this;}
 
-      friend class L1TopoXMLParser;
       friend class TrigConf::L1TopoConfig;
       friend class TrigConf::L1TopoMenuLoader;
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoXMLHelper.h b/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoXMLHelper.h
deleted file mode 100644
index 34bcb1f67cb9..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoXMLHelper.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef L1TopoConfig_L1TopoXMLHelper
-#define L1TopoConfig_L1TopoXMLHelper
-
-#include "boost/property_tree/ptree.hpp"
-#include <string>
-
-
-namespace TXC {
-
-   bool hasAttribute(const boost::property_tree::ptree & tree, const std::string & attr);
-
-   std::string getAttribute(const boost::property_tree::ptree & tree, const std::string & attr);
-
-   std::string getAttribute(const boost::property_tree::ptree & tree, const std::string & attr, const std::string & defval);
-
-   unsigned int getUIntAttribute(const boost::property_tree::ptree & tree, const std::string & attr);
-
-   unsigned int getUIntAttribute(const boost::property_tree::ptree & tree, const std::string & attr, unsigned int defval);
-
-   void printAttributes(const boost::property_tree::ptree & tree);
-
-}
-
-#endif
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoXMLParser.h b/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoXMLParser.h
deleted file mode 100644
index 4e9bb1bdd715..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoXMLParser.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//--------------------------------
-// This is the L1TopoXMLParser class. It containts all the methods required to
-// parse the configuration XML. The parsed information is stored in a container  
-// class L1TopoConfigAlg. This container is sent to the TopoSteering and its contents 
-// are unloaded and used to configurate the decision algorithm.
-//-------------------------------
-
-#ifndef L1TOPOXMLPARSER_HPP
-#define L1TOPOXMLPARSER_HPP
-
-#include "TrigConfBase/TrigConfMessaging.h"
-
-#include "L1TopoConfig/L1TopoConfigAlg.h"
-#include "L1TopoConfig/L1TopoMenu.h"
-
-#include <iostream>
-#include <stdio.h>
-#include <vector>
-#include <string>
-
-// boost libraries
-#include <boost/property_tree/ptree.hpp>
-#include <boost/property_tree/xml_parser.hpp>
-
-namespace TXC {
-
-   class L1TopoXMLParser : public TrigConf::TrigConfMessaging {
-  
-   public:
-
-      //Constructor
-      L1TopoXMLParser();
-  
-      //Destructor
-      ~L1TopoXMLParser();
-
-      // print the parsed configuration
-      void printConfiguration() const;
-  
-      // set verbosity (level out output to screen)
-      // something like 3=high, 2=med, 1=low
-      void setVerbosity(int v) { m_verbosity=v; }
- 
-      // method to get a single algorithm from the parsed configuration file
-      const L1TopoConfigAlg& getAlgorithm(int i) const; 
-
-      // method to get a vector of all algorithms
-      const std::vector<L1TopoConfigAlg> & getAlgorithms() const;
-
-      // read input configuration and check for errors
-      void readConfiguration(const std::string & inputfile);
-
-      // read input configuration and check for errors
-      void setConfiguration(boost::property_tree::ptree topomenu) { m_menuPT = topomenu; }
-
-      // parse configuration and fill algorithm containers
-      void parseConfiguration();
-
-      const L1TopoMenu& menu() const { return m_menu; }
-
-      L1TopoMenu takeMenu() { 
-         return std::move(m_menu);
-      }
-
-   private:
-       
-      // methods to set parameters for menu objects
-      void setAlgoParameters(boost::property_tree::ptree menuElement, L1TopoConfigAlg &algo);
-      void setTopoConfigParameters(boost::property_tree::ptree menuElement);
-      void setOutputListParameters(boost::property_tree::ptree menuElement);
-      void setAlgoBits(boost::property_tree::ptree subsubElement, L1TopoConfigAlg &algo);
-
-      // input validation variables
-      bool m_isValidConfigurtion {false};
-      int  m_verbosity {0};
-  
-      // configuration variables
-      boost::property_tree::ptree m_menuPT;
-      L1TopoMenu m_menu;
-   };
-
-}
-
-#endif
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoMenu.cxx b/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoMenu.cxx
index 732ba03c8496..d57b6a43ad55 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoMenu.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoMenu.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 "L1TopoConfig/L1TopoMenu.h"
@@ -74,93 +74,3 @@ void TXC::L1TopoMenu::print() const {
    cout << m_outputlist << endl;
 
 }
-
-void TXC::L1TopoMenu::writeXML(const std::string& filename){
-   std::ofstream xmlfile;
-   xmlfile.open( filename );
-   xmlfile << "<?xml version=\"1.0\" ?>\n"
-        << "<TOPO_MENU menu_name=\"Topo_pp_vX\" menu_version=\"1\">\n"
-        << "  <!--File is generated by TriggerMenu-->\n"
-        << "  <!--No. L1Topo algos defined: " << m_outputlist.getOutputList().size() << "-->\n"
-        << "  <OutputList>\n";
-        for(auto& out : m_outputlist.getOutputList()) {
-           string triggerline = "";
-           const L1TopoConfigAlg & alg = algorithm( out.algoname() );
-           if(! alg.isDecAlg())
-              TCS_EXCEPTION("L1TopoMenu: output list contains an algorithm " << out.algoname() << " that is not an decision algorithm");
-           for (const string& outputname : alg.getOutputNames() ) {
-              if(triggerline != "") triggerline += ",";
-              triggerline += outputname;
-           }
-           xmlfile << "    <Output algname=\"" << out.algoname() << "\" triggerline=\"" << triggerline << "\" algoId=\"" << out.algoid() << "\" module=\"" << out.module() << "\" fpga=\"" << out.fpga() << "\" firstbit=\"" << out.firstbit() << "\" clock=\"" << out.clock() << "\"/>" << std::endl;
-        }
-        xmlfile << "  </OutputList>\n\n"
-                << "  <TopoConfig>\n";
-
-        for(auto &in : m_topoconfig.getTopoConfigs()){
-          xmlfile << "<Entry name=\"" << in.name << "\" value = \"" << in.value << "\"/>" << std::endl;
-        }
-        xmlfile << "  </TopoConfig>\n\n";
-
-        for(auto& in : m_algos) {
-          if(in.isDecAlg()) continue;
-          xmlfile << "  <SortAlgo type=\"" << in.type() << "\" name=\"" << in.name() << "\" output=\"" << in.output() << "\" algoId=\"" << in.algoID() << "\">" << std::endl;
-          xmlfile << "    <Fixed>" << std::endl;
-          for(auto& fin : in.getInputs()){
-             xmlfile << "      <Input name=\"" << fin.name << "\" value=\"" << fin.value << "\"/>" << std::endl;
-          }
-          for(auto& fin : in.getOutputs()){
-             xmlfile << "      <Output name=\"" << fin.name << "\" value=\"" << fin.value << "\"/>" << std::endl;
-          }
-          for(auto& fin : in.getFixedParameters()){
-             xmlfile << "      <Generic name=\"" << fin.name << "\" value=\"" << fin.value << "\"/>"<< std::endl;
-          }
-          xmlfile << "    </Fixed>" << std::endl;
-          xmlfile << "    <Variable>" << std::endl;
-          int i = 0;
-          for(auto& fin : in.getParameters()){
-             xmlfile << "      <Parameter pos=\"" << i++ << "\" name=\"" << fin.name << "\" value=\"" << fin.value << "\"/>"<< std::endl;
-          }
-          xmlfile << "    </Variable>" << std::endl;
-          xmlfile << "  </SortAlgo>\n" << std::endl;
-        }
-
-        for(auto& in : m_algos){
-          if(in.isSortAlg()) continue;
-          xmlfile << "  <DecisionAlgo type=\"" << in.type() << "\" name=\"" << in.name() << "\" algoId=\"" << in.algoID() << "\">" << std::endl;
-          xmlfile << "    <Fixed>" << std::endl;
-          int isize = in.getInputs().size();
-          for(auto& fin : in.getInputs()){
-              if(isize>1)
-                 xmlfile << "      <Input name=\"" << fin.name << "\" value=\"" << fin.value << "\" position=\"" << fin.position << "\"/>" << std::endl;
-               else
-                 xmlfile << "      <Input name=\"" << fin.name << "\" value=\"" << fin.value << "\"/>" << std::endl;
-          }
-          bool first=true;
-          for(auto& fin : in.getOutputs()){
-             if(first) {
-                xmlfile << "      <Output name=\"" << fin.name << "\" bits=\"" << in.getOutputs().size() << "\">" << std::endl;
-                first = false;
-             }
-             xmlfile << "        <Bit selection=\"" << fin.position << "\" name=\"" << fin.outname << "\"/>" << std::endl;
-          }
-          xmlfile << "      </Output>" << std::endl;
-          for(auto& fin : in.getFixedParameters()){
-             xmlfile << "      <Generic name=\"" << fin.name << "\" value=\"" << fin.value << "\"/>"<< std::endl;
-          }
-          xmlfile << "    </Fixed>" << std::endl;
-          xmlfile << "    <Variable>" << std::endl;
-          for(auto& fin : in.getParameters()){
-             if((int)fin.selection!=-1) 
-                xmlfile << "      <Parameter pos=\"" << fin.position << "\" name=\"" << fin.name << "\" selection=\"" << fin.selection << "\" value=\"" << fin.value << "\"/>"<< std::endl;
-             else 
-                xmlfile << "      <Parameter pos=\"" << fin.position << "\" name=\"" << fin.name << "\" value=\"" << fin.value << "\"/>"<< std::endl;
-          }
-          xmlfile << "    </Variable>" << std::endl;
-          xmlfile << "  </DecisionAlgo>\n" << std::endl;
-        }
-
-        xmlfile << "</TOPO_MENU>\n";
-        xmlfile.close();
-        return;
-}
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoXMLHelper.cxx b/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoXMLHelper.cxx
deleted file mode 100644
index 059480da6b96..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoXMLHelper.cxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "L1TopoCommon/Exception.h"
-#include "L1TopoConfig/L1TopoXMLHelper.h"
-#include <boost/lexical_cast.hpp>
-
-using namespace std;
-using boost::property_tree::ptree;
-
-void
-TXC::printAttributes(const ptree & tree) {
-  
-   // initialize attributes ptree 
-   ptree attributes = tree.get_child("<xmlattr>", ptree());
-  
-   // iterate through elements
-   for(const ptree::value_type & a: attributes) {
-      string attrName = a.first;
-      string attrVal = a.second.data();
-      cout << attrName << " : " << attrVal << endl;
-   }
-}
-
-bool
-TXC::hasAttribute(const ptree & tree, const string & attr) {
-
-   // initialize attributes ptree 
-   ptree attributes = tree.get_child("<xmlattr>", ptree());
-  
-   if(attributes.empty()) return false;
-  
-   for(const ptree::value_type &a: attributes) {
-      string attrName = a.first;
-      if(attrName == attr) {
-         return true;
-      }
-   }
-   return false;
-}
-
-
-namespace {
-   string
-   readAttribute(const ptree & tree, const string & attr) {
- 
-      // initialize attributes ptree 
-      ptree attributes = tree.get_child("<xmlattr>", ptree());
-  
-      // iterate through children
-      for(const ptree::value_type &a : attributes) {
-         if(a.first != attr) continue;
-         return a.second.data(); //a.second.data is the value!
-      }
-      return "";
-   }
-}
-
-
-std::string
-TXC::getAttribute(const ptree & tree, const string & attr) {
-   if( ! hasAttribute(tree, attr) ) {
-      TCS_EXCEPTION("getAttribute(): Attribute " << attr << " does not exist");
-   }
-   return readAttribute(tree,attr);
-}
-
-std::string
-TXC::getAttribute(const ptree & tree, const string & attr, const std::string & defval) {
-   if( ! hasAttribute(tree, attr) )
-      return defval;
-   return readAttribute(tree,attr);
-}
-
-
-unsigned int
-TXC::getUIntAttribute(const ptree & tree, const string & attr) {
-   if( ! hasAttribute(tree, attr) ) {
-      TCS_EXCEPTION("getUIntAttribute(): Attribute " << attr << " does not exist");
-   }
-   unsigned int ret_value{0};
-   try {
-   ret_value = boost::lexical_cast<unsigned int, string>(readAttribute(tree,attr));
-   }
-   catch(const boost::bad_lexical_cast & bc) {
-      TCS_EXCEPTION("getUIntAttribute(): Attribute '" << attr << "' is not an unsigned int (it is " << readAttribute(tree,attr) << ")");
-   }
-   return ret_value;
-}
-
-unsigned int
-TXC::getUIntAttribute(const ptree & tree, const string & attr, unsigned int defval) {
-   if( ! hasAttribute(tree, attr) )
-      return defval;
-   return boost::lexical_cast<unsigned int, string>(readAttribute(tree,attr));
-}
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoXMLParser.cxx b/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoXMLParser.cxx
deleted file mode 100644
index e7b9dc7dddae..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoXMLParser.cxx
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// L1Topo libraries
-#include "L1TopoConfig/L1TopoXMLParser.h"
-#include "L1TopoConfig/L1TopoConfigAlg.h"
-#include "L1TopoConfig/L1TopoConfigOutputList.h"
-#include "L1TopoConfig/L1TopoConfigGlobal.h"
-#include "L1TopoConfig/L1TopoMenu.h"
-#include "L1TopoConfig/L1TopoXMLHelper.h"
-#include "L1TopoCommon/Exception.h"
-
-// cpp libraries
-#include <iostream>
-#include <vector>
-#include <string>
-
-// boost libraries
-#include <boost/foreach.hpp>
-
-using namespace std;
-using namespace TXC;
-using boost::property_tree::ptree;
-
-namespace pt = boost::property_tree;
-
-
-L1TopoXMLParser::L1TopoXMLParser() :
-   TrigConfMessaging("L1TopoXMLParser")
-{}
-
-L1TopoXMLParser::~L1TopoXMLParser()
-{}
-
-
-void
-L1TopoXMLParser::printConfiguration() const {
-  cout << "************************** L1TopoXMLParser **********************" << endl;
-  m_menu.print();
-  cout << "*****************************************************************" << endl;
-}
-
-
-void
-L1TopoXMLParser::readConfiguration(const std::string & inputfile) {
-   // populate the ptree m_configuration with the structure of the xml input file
-   ptree inputTree;
-   read_xml(inputfile, inputTree); // 3 --> trim_whitespace
-
-   m_menuPT = inputTree.get_child("TOPO_MENU");
-
-   m_isValidConfigurtion = true;
-   TRG_MSG_INFO("Read " << inputfile << " successfully!");
-}
-
-
-void TXC::L1TopoXMLParser::parseConfiguration() {
-
-   m_menu.setName(getAttribute(m_menuPT,"menu_name"));
-   m_menu.setVersion(getAttribute(m_menuPT,"menu_version"));
-  
-   // iterate through elements of topomenu
-   for(const boost::property_tree::ptree::value_type &x: m_menuPT) {
-
-      string menuElementName = x.first;
-      if (menuElementName=="<xmlattr>" || menuElementName=="<xmlcomment>") continue;
-      ptree menuElement = x.second;
-
-      // get branch attributes
-      if( menuElementName=="OutputList" ) {
-
-         setOutputListParameters(menuElement);
-
-      } 
-
-      else if( menuElementName=="TopoConfig" ) {
-
-         setTopoConfigParameters(menuElement);
-
-      }
-
-      else if( menuElementName=="SortAlgo" ) {
-
-         TXC::L1TopoConfigAlg algo( getAttribute(menuElement,"name"), getAttribute(menuElement,"type") ); 
-         algo.setAlgKind( L1TopoConfigAlg::SORT );
-         setAlgoParameters( menuElement, algo );
-         algo.setAlgOutput( getAttribute(menuElement,"output") );
-         algo.setAlgoID( getUIntAttribute(menuElement, "algoId") );
-         m_menu.addAlgorithm(std::move(algo));
-
-      }
-
-      else if( menuElementName=="DecisionAlgo" ) {
-
-         L1TopoConfigAlg algo( getAttribute(menuElement,"name"), getAttribute(menuElement,"type") ); 
-         algo.setAlgKind( L1TopoConfigAlg::DECISION );
-         setAlgoParameters(menuElement, algo);
-         algo.setAlgoID( getUIntAttribute(menuElement, "algoId") );
-         m_menu.addAlgorithm(std::move(algo));
-
-      } else {
-         TRG_MSG_FATAL("Unknown element" << menuElementName);
-      }
-   }
-
-   m_menu.setTriggerList();
-
-   TRG_MSG_INFO("Parsing Successful!");
-
-   if(msg().level() <= TrigConf::MSGTC::INFO)
-      m_menu.print();
-
-}
-
-
-
-void TXC::L1TopoXMLParser::setTopoConfigParameters(ptree menuElement) {
-   for(const boost::property_tree::ptree::value_type &c: menuElement) {
-    
-      string configName = c.first;
-      if (configName=="<xmlattr>" || configName=="<xmlcomment>") continue;
-      ptree configElement = c.second;
-    
-      m_menu.m_topoconfig.addTopoConfigElement( TopoConfigElement(getAttribute(configElement,"name"), 
-                                                                  getAttribute(configElement,"value")));
-
-   }
-}
-
-void TXC::L1TopoXMLParser::setOutputListParameters(ptree menuElement) {
-   for(const boost::property_tree::ptree::value_type &o : menuElement) {
-
-      string outputName = o.first;
-      if (outputName=="<xmlattr>" || outputName=="<xmlcomment>") continue;
-      ptree outputElement = o.second;
-
-      m_menu.addL1TopoXMLOutput( OutputListElement(getAttribute(outputElement,"algname"),
-                                                   getUIntAttribute(outputElement,"algoId"),
-                                                   getUIntAttribute(outputElement,"module"),
-                                                   getUIntAttribute(outputElement,"fpga"),
-                                                   getUIntAttribute(outputElement,"clock"),
-                                                   getUIntAttribute(outputElement,"firstbit") ) );
-   }
-}
-
-
-void TXC::L1TopoXMLParser::setAlgoParameters(ptree menuElement, L1TopoConfigAlg &algo) {
-  
-   // iterate through elements of menu algorithms
-   for(const boost::property_tree::ptree::value_type &y: menuElement) {
-    
-      // initialize elements of menu algorithms
-      string subElementName = y.first;
-      if (subElementName=="<xmlattr>" || subElementName=="<xmlcomment>") continue;
-      ptree parameterGroup = y.second;
-
-      if(subElementName=="Fixed") {
-
-         for(boost::property_tree::ptree::value_type &z: parameterGroup) {
-	
-            string subsubElementName = z.first;
-            if (subsubElementName=="<xmlattr>" || subsubElementName=="<xmlcomment>") continue;
-            ptree subsubElement = z.second;
-	
-            if(subsubElementName=="Input") {
-               algo.addInput(getAttribute(subsubElement,"name"), 
-                             getAttribute(subsubElement,"value"), 
-                             getUIntAttribute(subsubElement,"position", 0));
-            }
-            if(subsubElementName=="Output") {
-               if(hasAttribute(subsubElement,"name") && 
-                  hasAttribute(subsubElement,"value")) {
-                  algo.addOutput(getAttribute(subsubElement,"name"), 
-                                 getAttribute(subsubElement,"value"), 
-                                 0, "", 0);
-               } else {
-                  setAlgoBits(subsubElement, algo);
-               }
-            }
-            if(subsubElementName=="Generic") {
-               algo.addFixedParameter( getAttribute(subsubElement,"name"), 
-                                       getAttribute(subsubElement,"value") );
-            }
-         }
-      }
-
-      if(subElementName=="Variable") {
-      
-         for(boost::property_tree::ptree::value_type &z : parameterGroup) {
-	
-            string subsubElementName = z.first;
-            if (subsubElementName=="<xmlattr>" || subsubElementName=="<xmlcomment>" ) continue;
-            ptree subsubElement = z.second;
-
-            if(subsubElementName=="Parameter") {
-               algo.addParameter(getAttribute(subsubElement,"name"), 
-                                 getAttribute(subsubElement,"value"), 
-                                 getUIntAttribute(subsubElement,"pos", 0), 
-                                 getUIntAttribute(subsubElement,"selection", 0) );
-            }
-         } // loop
-      } // var
-
-   } // end algo loop
-}
-
-
-
-void TXC::L1TopoXMLParser::setAlgoBits(ptree subsubElement, L1TopoConfigAlg &algo) {
-
-   for(boost::property_tree::ptree::value_type &b: subsubElement) {
-    
-      string subsubsubElementName = b.first;
-      if (subsubsubElementName=="<xmlattr>" || subsubsubElementName=="<xmlcomment>") continue;
-      ptree subsubsubElement = b.second;
-    
-      if(subsubsubElementName=="Bit") {
-         algo.addOutput(getAttribute(subsubElement,"name"), 
-                        "", 
-                        getUIntAttribute(subsubElement,"bits"),
-                        getAttribute(subsubsubElement,"name"),
-                        getUIntAttribute(subsubsubElement,"selection"));
-      }
-   }
-}
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig.xml b/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig.xml
deleted file mode 100644
index f076a8e4015a..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<TOPO_MENU menu_name="Topo_pp_vX" menu_version="v0.0">
-
-<TopoConfig NumberOfClusters="6" NumberOfJets="4"></TopoConfig>
-
-<SortAlgo type="ClusterSortingAlg" name="ClusterSort_EM_NoIso" output="SortedClusters_EM_NoIso">
-<Fixed outputWidth="NumberOfClusters"></Fixed>
-<Variable MinIsolation="0.0"></Variable>
-</SortAlgo>
-
-<SortAlgo type="JetSortingAlgSize1" name="ClusterSort_Jet_Size1" output="SortedJetsSize1">
-<Fixed outputWidth="NumberOfJets"></Fixed>
-<Variable MaxEta="5"></Variable>
-</SortAlgo>
-
-<SortAlgo type="JetSortingAlgSize2" name="ClusterSort_Jet_Size2" output="SortedJetsSize2">
-<Fixed Input="JetsSize2" OutputWidth="NumberOfJets"></Fixed>
-<Variable MaxEta="5"></Variable>
-</SortAlgo>
-
-<DecisionAlgo type="DeltaPhiLeading" name="ClusterDeltaPhi_12" algoId="0">
-<Fixed input1="SortedClusters_EM_NoIso" input2="SortedClusters_EM_NoIso" outputBits="1" aaaa="3" bbbb="3" cccc="3"></Fixed>
-<Variable minET="5" deltaPhiMin="12" deltaPhiMax="31" firstBit="0" numberLeading1="2" numberLeading2="2"></Variable>
-</DecisionAlgo>
-
-<DecisionAlgo type="DeltaPhiLeading" name="JetSize1DeltaPhi_12" algoId="1">
-<Fixed Input1="SortedJetSize1" Input2="SortedJetSize1" OutputBits="1"></Fixed>
-<Variable MinET="20" DeltaPhiMin="12" DeltaPhiMax="31" FirstBit="1" NumberLeading1="2" NumberLeading2="2"></Variable>
-</DecisionAlgo>
-
-</TOPO_MENU>
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig2.xml b/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig2.xml
deleted file mode 100644
index 9c56e5efa6a2..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig2.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<TOPO_MENU menu_name="Topo_pp_vX" menu_version="1">
-
-<OutputList>
-    <Output algname="ClusterDeltaPhi_12" algoId="0" firstbit="0">
-    <Output algname="JetSize1DeltaPhi_12" algoId="1" firstbit="2">
-</OutputList>
-
-<TopoConfig>
-    <Entry name="NumberOfClusters" value="6"/>
-    <Entry name="NumberOfJets" value="4"/>
-</TopoConfig>
-
-<SortAlgo type="ClusterSortingAlg" name="ClusterSort_EM_NoIso" output="SortedClusters_EM_NoIso">
-    <Fixed>
-        <Input ord="0" value="Cluster"/>
-        <Generic name="NumberOfClusters" value="6"/>
-    </Fixed>
-    <Variable>
-        <Parameter name="MinIsolation" value="0"/>
-        <Parameter name="MaxEta" value="34"/>
-    </Variable>
-</SortAlgo>
-
-<SortAlgo type="JetSortingAlgSize" name="ClusterSort_Jet_Size1" output="SortedJetsSize1">
-    <Fixed>
-        <Input ord="0" value="Jet"/>
-        <Generic name="NumberOfJets" value="5"/>
-        <Generic name="JetSize" value="1"/>
-    </Fixed>
-    <Variable>
-        <Parameter name="MaxEta" value="34"/>
-    </Variable>
-</SortAlgo>
-
-<SortAlgo type="JetSortingAlgSize" name="ClusterSort_Jet_Size2" output="SortedJetsSize2">
-    <Fixed>
-        <Input ord="0" value="Jet"/>
-        <Generic name="NumberOfJets" value="5"/>
-        <Generic name="JetSize" value="2"/>
-    </Fixed>
-    <Variable>
-        <Parameter name="MaxEta" value="34"/>
-    </Variable>
-</SortAlgo>
-
-<DecisionAlgo type="DeltaPhiLeading" name="ClusterDeltaPhi_12" algoId="0">
-    <Fixed>
-        <Input ord="0" value="SortedClusters_EM_NoIso"/>
-        <Input ord="1" value="SortedClusters_EM_NoIso"/>
-        <Output bits="2">
-            <Bit selection="0" name="ClusterDeltaPhi_Loose">
-            <Bit selection="1" name="ClusterDeltaPhi_Tight">
-        </Output>
-        <Generic name="aaa" value="3"/>
-    </Fixed>
-    <Variable>
-        <Parameter pos="0" name="minET" value="5"/>
-        <Parameter pos="1" name="deltaPhiMin" selection="0" value="12"/>
-        <Parameter pos="2" name="deltaPhiMax" selection="0" value="31"/>
-        <Parameter pos="3" name="deltaPhiMin" selection="1" value="22"/>
-        <Parameter pos="4" name="deltaPhiMax" selection="1" value="31"/>
-        <Parameter pos="5" name="numberLeading1" value="2"/>
-        <Parameter pos="6" name="numberLeading2" value="2"/>
-    </Variable>
-</DecisionAlgo>
-
-<DecisionAlgo type="DeltaPhiLeading" name="JetSize1DeltaPhi_12" algoId="1">
-    <Fixed>
-        <Input ord="1" value="SortedJetSize1"/>
-        <Input ord="2" value="SortedJetSize1"/>
-        <Output bits="1">
-            <Bit selection="0" name="JetDeltaPhi">
-        </Output>
-    </Fixed>
-    <Variable>
-        <Parameter name="MinET" value="5"/>
-        <Parameter name="DeltaPhiMin" selection="0" value="12"/>
-        <Parameter name="DeltaPhiMax" selection="0" value="31"/>
-        <Parameter name="NumberLeading1" value="2"/>
-        <Parameter name="NumberLeading2" value="2"/>
-    </Variable>
-</DecisionAlgo>
-
-</TOPO_MENU>
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig3.xml b/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig3.xml
deleted file mode 100644
index ca8b92512417..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig3.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<TOPO_MENU menu_name="Topo_pp_vX" menu_version="1">
-
-  <OutputList>
-    <Output algname="ClusterDeltaPhi_12" algoId="0" firstbit="0"/>
-    <Output algname="JetSize1DeltaPhi_12" algoId="1" firstbit="2"/>
-  </OutputList>
-  
-  <TopoConfig>
-    <Entry name="NumberOfClusters" value="6"/>
-    <Entry name="NumberOfJets" value="5"/>
-  </TopoConfig>
-  
-  <SortAlgo type="ClusterSortingAlg" name="ClusterSort_EM_NoIso" output="SortedClusters_EM_NoIso">
-    <Fixed>
-      <Input name="InputArr" value="ClusterIn"/>
-      <Output name="OutputArr" value="SortedClusters_EM_NoIso"/>
-      <Generic name="NumberOfClusters" value="6"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinIsolation" value="0"/>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
-  
-  <SortAlgo type="JetSortingAlg" name="ClusterSort_Jet_Size1" output="SortedJetsSize1">
-    <Fixed>
-      <Input name="InputArr" value="JetIn"/>
-      <Output name="OutputArr" value="SortedJetsSize1"/>
-      <Generic name="NumberOfJets" value="5"/>
-      <Generic name="JetSize" value="1"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
-  
-  <SortAlgo type="JetSortingAlg" name="ClusterSort_Jet_Size2" output="SortedJetsSize2">
-    <Fixed>
-      <Input name="InputArr" value="JetIn"/>
-      <Output name="OutputArr" value="SortedJetsSize2"/>
-      <Generic name="NumberOfJets" value="5"/>
-      <Generic name="JetSize" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
-  
-  <DecisionAlgo type="DeltaPhiLeading" name="ClusterDeltaPhi_12" algoId="0">
-    <Fixed>
-      <Input name="Tob1" value="SortedClusters_EM_NoIso" pos="0"/>
-      <Input name="Tob2" value="SortedClusters_EM_NoIso" pos="1"/>
-      <Output name="Results" bits="2">
-        <Bit selection="0" name="ClusterDeltaPhi_Loose"/>
-        <Bit selection="1" name="ClusterDeltaPhi_Tight"/>
-      </Output> 
-     <Generic name="MaxTob" value="6"/>
-      <Generic name="OutputBits" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter pos="0" name="minET" value="5"/>
-      <Parameter pos="1" name="deltaPhiMin" selection="0" value="12"/>
-      <Parameter pos="2" name="deltaPhiMax" selection="0" value="31"/>
-      <Parameter pos="3" name="deltaPhiMin" selection="1" value="22"/>
-      <Parameter pos="4" name="deltaPhiMax" selection="1" value="31"/>
-    </Variable>
-  </DecisionAlgo>
-  
-  <DecisionAlgo type="DeltaPhiIncl1" name="JetSize1DeltaPhiIncl_12" algoId="1">
-    <Fixed>
-      <Input name="Tob" value="SortedJetSize1"/>
-      <Output name="Results" bits="1">
-        <Bit selection="0" name="JetDeltaPhi"/>
-      </Output>
-      <Generic name="MaxTob" value="5"/>
-      <Generic name="OutputBits" value="1"/>
-    </Fixed>
-    <Variable>
-      <Parameter pos="0" name="MinET" value="5"/>
-      <Parameter pos="1" name="DeltaPhiMin" selection="0" value="12"/>
-      <Parameter pos="2" name="DeltaPhiMax" selection="0" value="31"/>
-    </Variable>
-  </DecisionAlgo>
-  
-</TOPO_MENU>
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig4e.xml b/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig4e.xml
deleted file mode 100644
index 749a89b986ad..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig4e.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-<TOPO_MENU menu_name="Topo_pp_vX" menu_version="1">
-
-  <OutputList>
-    <Output algname="ClusterDeltaPhi_12" algoId="0" firstbit="0"/>
-    <Output algname="ClusterDeltaEta_5" algoId="1" firstbit="5"/>
-    <Output algname="ClusterDeltaR_1" algoId="2" firstbit="10"/>
-    <Output algname="ClusterSumEt_10" algoId="3" firstbit="15"/>
-    <Output algname="JetsSize1DeltaPhi_12" algoId="4" firstbit="20"/>
-  </OutputList>
-  
-  <TopoConfig>
-    <Entry name="NumberOfClusters" value="8"/>
-    <Entry name="NumberOfJets" value="7"/>
-  </TopoConfig>
-  
-  <SortAlgo type="ClusterSortingAlg" name="ClusterSort_EM_NoIso" output="SortedClusters_EM_NoIso">
-    <Fixed>
-      <Input name="InputArr" value="Clusters"/>
-      <Output name="OutputArr" value="SortedClusters_EM_NoIso"/>
-      <Generic name="NumberOfClusters" value="8"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinIsolation" value="0"/>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
-
-  <SortAlgo type="JetSortingAlg" name="ClusterSort_Jet_Size1" output="SortedJetsSize1">
-    <Fixed>
-      <Input name="InputArr" value="JetsSize1"/>
-      <Output name="OutputArr" value="SortedJetsSize1"/>
-      <Generic name="NumberOfJetsSize1" value="7"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
-
-  <DecisionAlgo type="DeltaPhiLeading" name="ClusterDeltaPhi_12" algoId="0">
-    <Fixed>
-      <Input name="SortedClusters_EM_NoIso" value="SortedClusters_EM_NoIso" pos="0"/>
-      <Output name="Results" bits="2">
-        <Bit selection="0" name="ClusterDeltaPhi_Loose"/>
-        <Bit selection="1" name="ClusterDeltaPhi_Tight"/>
-      </Output> 
-     <Generic name="MaxTob" value="6"/>
-     <Generic name="OutputBits" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter pos="0" name="EtMin" value="12"/>
-      <Parameter pos="1" name="DeltaPhiMin" selection="0" value="0"/>
-      <Parameter pos="2" name="DeltaPhiMax" selection="0" value="63"/>
-    </Variable>
-  </DecisionAlgo>
-
-  <DecisionAlgo type="DeltaEtaLeading" name="ClusterDeltaEta_5" algoId="1">
-    <Fixed>
-      <Input name="SortedClusters_EM_NoIso" value="SortedClusters_EM_NoIso" pos="0"/>
-      <Output name="Results" bits="1">
-	<Bit selection="0" name="ClusterDeltaEta_Loose"/>
-      </Output>
-     <Generic name="MaxTob" value="6"/>
-      <Generic name="OutputBits" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter pos="0" name="EtMin" selection="0" value="1"/>
-      <Parameter pos="1" name="EtaMax" selection="0" value="30"/>
-      <Parameter pos="2" name="DeltaEtaMin" selection="0" value="1"/>
-      <Parameter pos="3" name="DeltaEtaMax" selection="0" value="30"/>
-    </Variable>
-  </DecisionAlgo>
-
-  <DecisionAlgo type="DeltaRLeading" name="ClusterDeltaR_1" algoId="2">
-    <Fixed>
-      <Input name="SortedClusters_EM_NoIso" value="SortedClusters_EM_NoIso" pos="0"/>
-      <Output name="Results" bits="1">
-        <Bit selection="0" name="ClusterDeltaR_Loose"/>
-      </Output>
-     <Generic name="MaxTob" value="6"/>
-      <Generic name="OutputBits" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter pos="0" name="DeltaR2Min" selection="0" value="1"/>
-      <Parameter pos="1" name="DeltaR2Max" selection="0" value="100"/>
-      <Parameter pos="2" name="DeltaPhiMin" selection="0" value="1"/>
-      <Parameter pos="3" name="DeltaPhiMax" selection="0" value="30"/>
-      <Parameter pos="4" name="DeltaEtaMin" selection="0" value="1"/>
-      <Parameter pos="5" name="DeltaEtaMax" selection="0" value="30"/>
-      <Parameter pos="6" name="EtMin" selection="0" value="1"/>
-      <Parameter pos="7" name="EtaMax" selection="0" value="100"/>
-    </Variable>
-  </DecisionAlgo>
-  
-  <DecisionAlgo type="SumEtLeading" name="ClusterSumEt_10" algoId="3">
-    <Fixed>
-      <Input name="SortedClusters_EM_NoIso" value="SortedClusters_EM_NoIso" pos="0"/>
-      <Output name="Results" bits="1">
-        <Bit selection="0" name="ClusterSumEt_Loose"/>
-      </Output>
-     <Generic name="MaxTob" value="6"/>
-      <Generic name="OutputBits" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter pos="0" name="EtMin" selection="0" value="1"/>
-      <Parameter pos="1" name="HtMin" selection="0" value="10"/>
-      <Parameter pos="2" name="EtaMax" selection="0" value="30"/>
-    </Variable>
-  </DecisionAlgo>
-
-
-
-
-  <DecisionAlgo type="DeltaPhiLeading" name="JetsSize1DeltaPhi_12" algoId="4">
-    <Fixed>
-      <Input name="SortedJetsSize1" value="SortedJetsSize1" pos="0"/>
-      <Output name="Results" bits="2">
-        <Bit selection="0" name="JetsSize1DeltaPhi_Loose"/>
-        <Bit selection="1" name="JetsSize1DeltaPhi_Tight"/>
-      </Output>
-     <Generic name="MaxTob" value="6"/>
-     <Generic name="OutputBits" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter pos="0" name="EtMin" value="12"/>
-      <Parameter pos="1" name="DeltaPhiMin" selection="0" value="0"/>
-      <Parameter pos="2" name="DeltaPhiMax" selection="0" value="63"/>
-    </Variable>
-  </DecisionAlgo>
-
-
-</TOPO_MENU>
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig5.xml b/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig5.xml
deleted file mode 100644
index 31a5b9d08986..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig5.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<TOPO_MENU menu_name="Topo_pp_vX" menu_version="1">
-
-  <OutputList>
-    <Output algname="ClusterDeltaPhi_1" algoId="1" firstbit="0"/>
-    <Output algname="ClusterDeltaEta_1" algoId="2" firstbit="2"/>
-  </OutputList>
-  
-  <TopoConfig>
-    <Entry name="NumberOfClusters" value="7"/>
-    <Entry name="NumberOfJets" value="0"/>
-  </TopoConfig>
-  
-  <SortAlgo type="ClusterSortingAlg" name="ClusterSort_EM_NoIso" output="SortedClusters_EM_NoIso">
-    <Fixed>
-      <Input name="InputArr" value="Clusters"/>
-      <Output name="SortedClusters" value="SortedClusters_EM_NoIso"/>
-      <Generic name="NumberOfClusters" value="6"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinIsolation" value="0"/>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
-  
-  <SortAlgo type="JetSortingAlg" name="ClusterSort_Jet_Size1" output="SortedJetsSize1">
-    <Fixed>
-      <Input name="InputArr" value="JetsSize1"/>
-      <Output name="OutputArr" value="SortedJetsSize1"/>
-      <Generic name="NumberOfJets" value="5"/>
-      <Generic name="JetSize" value="1"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
-  
-  <SortAlgo type="JetSortingAlg" name="ClusterSort_Jet_Size2" output="SortedJetsSize2">
-    <Fixed>
-      <Input name="InputArr" value="JetsSize2"/>
-      <Output name="OutputArr" value="SortedJetsSize2"/>
-      <Generic name="NumberOfJets" value="5"/>
-      <Generic name="JetSize" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
- 
-  <DecisionAlgo type="DeltaPhiLeading" name="ClusterDeltaPhi_1" algoId="1">
-    <Fixed>
-      <Input name="SortedClusters_EM_NoIso" value="SortedClusters_EM_NoIso" pos="0"/>
-      <Output name="Results" bits="1">
-        <Bit selection="0" name="ClusterDeltaPhi_Loose"/>
-      </Output>
-     <Generic name="MaxTob" value="6"/>
-      <Generic name="OutputBits" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter pos="0" name="EtMin" value="1"/>
-      <Parameter pos="1" name="DeltaPhiMin" selection="0" value="1"/>
-      <Parameter pos="2" name="DeltaPhiMax" selection="0" value="63"/>
-    </Variable>
-  </DecisionAlgo>
-  
-  <DecisionAlgo type="DeltaEtaLeading" name="ClusterDeltaEta_1" algoId="2">
-    <Fixed>
-      <Input name="SortedClusters_EM_NoIso" value="SortedClusters_EM_NoIso" pos="0"/>
-      <Output name="Results" bits="1">
-        <Bit selection="0" name="ClusterDeltaEta_Loose"/>
-      </Output>
-     <Generic name="MaxTob" value="6"/>
-      <Generic name="OutputBits" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter pos="0" name="EtMin" selection="0" value="1"/>
-      <Parameter pos="1" name="EtaMax" selection="0" value="5"/>
-      <Parameter pos="2" name="DeltaEtaMin" selection="0" value="1"/>
-      <Parameter pos="3" name="DeltaEtaMax" selection="0" value="5"/>
-    </Variable>
-  </DecisionAlgo>
-
-</TOPO_MENU>
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig6.xml b/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig6.xml
deleted file mode 100644
index fb6387e8fdb8..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/data/testConfig6.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<TOPO_MENU menu_name="Topo_pp_vX" menu_version="1">
-
-  <OutputList>
-    <Output algname="ClusterDeltaPhi_16" algoId="2" firstbit="4"/>
-  </OutputList>
-  
-  <TopoConfig>
-    <Entry name="NumberOfClusters" value="6"/>
-    <Entry name="NumberOfJets" value="5"/>
-  </TopoConfig>
-  
-  <SortAlgo type="ClusterSortingAlg" name="ClusterSort_EM_NoIso" output="SortedClusters_EM_NoIso">
-    <Fixed>
-      <Input name="InputArr" value="Clusters"/>
-      <Output name="SortedClusters" value="SortedClusters_EM_NoIso"/>
-      <Generic name="NumberOfClusters" value="6"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinIsolation" value="0"/>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
-  
-  <SortAlgo type="JetSortingAlg" name="ClusterSort_Jet_Size1" output="SortedJetsSize1">
-    <Fixed>
-      <Input name="InputArr" value="JetsSize1"/>
-      <Output name="OutputArr" value="SortedJetsSize1"/>
-      <Generic name="NumberOfJets" value="5"/>
-      <Generic name="JetSize" value="1"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
-  
-  <SortAlgo type="JetSortingAlg" name="ClusterSort_Jet_Size2" output="SortedJetsSize2">
-    <Fixed>
-      <Input name="InputArr" value="JetsSize2"/>
-      <Output name="OutputArr" value="SortedJetsSize2"/>
-      <Generic name="NumberOfJets" value="5"/>
-      <Generic name="JetSize" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter name="MinEta" value="0"/>
-      <Parameter name="MaxEta" value="63"/>
-    </Variable>
-  </SortAlgo>
- 
-  <DecisionAlgo type="DeltaPhiLeading" name="ClusterDeltaPhi_16" algoId="2">
-    <Fixed>
-      <Input name="SortedClusters_EM_NoIso" value="SortedClusters_EM_NoIso" pos="0"/>
-      <Output name="Results" bits="2">
-        <Bit selection="0" name="ClusterDeltaPhi_Loose"/>
-        <Bit selection="1" name="ClusterDeltaPhi_Looser"/>
-      </Output>
-     <Generic name="MaxTob" value="6"/>
-      <Generic name="OutputBits" value="2"/>
-    </Fixed>
-    <Variable>
-      <Parameter pos="66" name="EtMin" value="4"/>
-      <Parameter pos="11" name="DeltaPhiMin" selection="0" value="16"/>
-      <Parameter pos="22" name="DeltaPhiMax" selection="0" value="22"/>
-    </Variable>
-  </DecisionAlgo>
-  
-</TOPO_MENU>
-
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/src/test/TopoReader.cxx b/Trigger/TrigT1/L1Topo/L1TopoConfig/src/test/TopoReader.cxx
deleted file mode 100644
index c0a2c93300b5..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/src/test/TopoReader.cxx
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#include "L1TopoConfig/L1TopoXMLParser.h"
-#include "L1TopoConfig/L1TopoConfigAlg.h"
-
-#include <iostream>
-#include <string>
-
-using namespace std;
-using namespace TXC;
-
-void traitTests(){
-  static_assert(std::is_nothrow_move_constructible<L1TopoMenu>::value);
-  static_assert(std::is_nothrow_move_constructible<L1TopoConfigAlg>::value);
-  static_assert(std::is_nothrow_move_constructible<TXC::L1TopoConfigGlobal>::value);//TXC::L1TopoConfigOutputList
-  static_assert(std::is_nothrow_move_constructible<TXC::L1TopoConfigOutputList>::value);
-  static_assert(std::is_nothrow_move_constructible<TXC::TopoConfigElement>::value);
-}
-
-
-int main(int argc, char* argv[]) {
-   
-   if(argc!=2) {
-      cerr << "Configuration file missing!" << endl
-           << "Usage " << argv[0] << " <config.xml>" << endl;
-      return 1;
-   }
-  
-  TXC::L1TopoXMLParser L1TopoXMLParser;
-  L1TopoXMLParser.readConfiguration(argv[1]);
-  L1TopoXMLParser.parseConfiguration();
-  L1TopoXMLParser.printConfiguration();
-  
-  return 0;
-}
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/L1TopoCoreSim/TopoSteering.h b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/L1TopoCoreSim/TopoSteering.h
index 0c96ff5dfa6e..ebb20bc008ac 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/L1TopoCoreSim/TopoSteering.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/L1TopoCoreSim/TopoSteering.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 L1TopoCoreSim_TopoSteering
@@ -59,8 +59,6 @@ namespace TCS {
 
       // @brief: build the execution structure and parameterspace from
       // the configuration
-      StatusCode setupFromConfiguration(const TXC::L1TopoMenu& menu);
-
       StatusCode setupFromConfiguration(const TrigConf::L1Menu& l1menu);
 
       void setUseBitwise(bool useBitwise) { m_useBitwise = useBitwise; }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx
index 2e2a58389ef2..0af5b88ab6e6 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx
@@ -46,17 +46,6 @@ TopoSteering::~TopoSteering() {
    AlgFactory::destroy_instance();
 }
 
-TCS::StatusCode
-TopoSteering::setupFromConfiguration(const TXC::L1TopoMenu&){
-  
-  // Keep this method to avoid crashes. TO-DO: Switch menu loading in L1TopoSimulation.cxx
-  TRG_MSG_WARNING("Cannot configure simulation from XML. Use JSON format");
-
-  return TCS::StatusCode::SUCCESS;
-
-}
-
-
 TCS::StatusCode
 TopoSteering::setupFromConfiguration(const TrigConf::L1Menu& l1menu){
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/TopoStandAlone.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/TopoStandAlone.cxx
deleted file mode 100644
index d27535f9dba5..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/TopoStandAlone.cxx
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-//
-//  main.cpp
-//  TestTopo
-//
-//  Created by Joerg Stelzer on 11/10/12.
-//
-
-#include <iostream>
-
-#include "L1TopoCoreSim/TopoSteering.h"
-#include "L1TopoCoreSim/TopoASCIIReader.h"
-#include "L1TopoCoreSim/TopoInputEvent.h"
-#include "TrigConfL1TopoData/L1TopoConfigReader.h"
-
-using namespace std;
-
-int run(int argc/*argc*/, const char * argv[]/* * argv[]*/) {
-
-  // instantiate XML reader class
-  L1TopoConfigReader xmlReader;
-
-  // turn of xml reader print to screen comments
-  xmlReader.setVerbosity(0);
-  
-  // load in xml file
-  xmlReader.readConfigFile(argv[1]);
-
-  // print parsed result
-  //xmlReader.print();
-
-  // instantiate steering
-  TCS::TopoSteering steering;
-
-  // get parsed algos from reader and load them into the steering
-  steering.configureFromXML(xmlReader.getAlgos());
-  
-  //cout << endl << "         *** TOPO CONFIGURATION ***" << endl << endl;
-  //steering.printConfiguration(cout);
-  steering.reset();
-  
-  // instantiate ascii reader class
-  TCS::TopoASCIIReader asciiReader;
-
-  // disable print to screen
-  //asciiReader.setVerbosity(0);
-
-  // load ascii event file
-  asciiReader.inputFile(argv[2]);
-  
-  // check to see if file loaded properly
-  asciiReader.validateFile();
-  
-  TCS::TopoInputEvent & inputEvent = steering.inputEvent();
-  
-  asciiReader.setInputEvent(&inputEvent);
-  
-  // event loop: loop through events in ascii file
-  while(asciiReader.getNextEvent()){
-    //cout << endl << "         *** INPUT EVENT ***" << endl << endl << steering.inputEvent() << endl;
-    steering.executeEvent();
-    asciiReader.printEvent();
-    cout << steering.simulationResult() << endl;
-    steering.reset();
-  }
-  
-  asciiReader.printFileSummary();
-  
-  return 1;
-}
-
-
-
-
-int main(int argc, const char * argv[]) {
-  try {
-    return run(argc, argv);
-  }
-  catch(std::exception & e) {
-    cerr << "Caught exception: " << e.what() << endl;
-  }
-  return 1;
-};
-
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/TopoTest.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/TopoTest.cxx
deleted file mode 100644
index 9664af1d4041..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/TopoTest.cxx
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
-
-#include <iostream>
-
-#include "L1TopoCoreSim/ClusterSortingAlg.h"
-#include "L1TopoCoreSim/DeltaPhiLeading.h"
-#include "L1TopoCoreSim/ClusterTOB.h"
-#include "L1TopoCoreSim/ClusterTOBArray.h"
-#include "L1TopoCoreSim/TOBArray.h"
-#include "L1TopoCoreSim/AlgFactory.h"
-#include "L1TopoCoreSim/TopoSteering.h"
-
-#include "TrigConfL1TopoData/L1TopoConfigReader.h"
-
-using namespace std;
-
-int run(int argc/*argc*/, const char * argv[]/* * argv[]*/) {
-   
-   TCS::TopoSteering steering;
-
-   steering.setupMockConfiguration();
-   /*
-   L1TopoConfigReader xmlReader;
-   xmlReader.setVerbosity(1);
-   xmlReader.readConfigFile(argv[1]);
-   
-   xmlReader.print();
-
-   steering.configureFromXML(xmlReader.getAlgos());
-   */
-   cout << endl << "         *** TOPO CONFIGURATION ***" << endl << endl;
-
-   steering.printConfiguration(cout);
-
-   steering.reset();
-
-   TCS::TopoInputEvent & inputEvent = steering.inputEvent();
-   inputEvent.add( TCS::ClusterTOB(5, 1,   3,  -12) );
-   inputEvent.add( TCS::ClusterTOB(7, 1, -15,   0) );
-   inputEvent.add( TCS::ClusterTOB(2, 1,  31, -10) );
-   inputEvent.add( TCS::ClusterTOB(9, 1,   0,  12) );
-   inputEvent.add( TCS::ClusterTOB(4, 1,  -2,  6) );
-
-   inputEvent.add( TCS::JetTOB(5, 4,   3,  12) );
-   inputEvent.add( TCS::JetTOB(7, 6, -15,   0) );
-   inputEvent.add( TCS::JetTOB(2, 1,  31, -13) );
-   inputEvent.add( TCS::JetTOB(9, 8,   0,  -1) );
-   inputEvent.add( TCS::JetTOB(4, 3,  -2,  -4) );
-
-
-   cout << endl << "         *** INPUT EVENT ***" << endl << endl << steering.inputEvent() << endl;
-
-   cout << endl << "         *** EXECUTION ***" << endl << endl;
-
-
-
-   //   cout << "Going to execute" << endl;
-   steering.executeEvent();
-
-   //   cout << "Reporting simulation result" << endl;
-   cout << steering.simulationResult() << endl;
-
-   steering.printDebugInfo();
-
-   //   cout << "Resetting the steering" << endl;
-   steering.reset();
-
-   return 1;
-}
-
-
-
-
-int main(int argc, const char * argv[]) {
-  try {
-    return run(argc, argv);
-  }
-  catch(std::exception & e) {
-    cerr << "Caught exception: " << e.what() << endl;
-  }
-  return 1;
-};
-
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/inputEvents.txt b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/inputEvents.txt
deleted file mode 100644
index 97ecacb1da2f..000000000000
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/test/inputEvents.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-<begin_event>
-<cluster>
-10 1  5  6
-9  1  0  5
-7  1  0  2
-5  1  0  11
-4  1 -2  6
-3  1  1  1
-2  1  5  5
-<cluster>
-<jet>
-15 10  5   5
-12 18  0  -1
-7  7  -15  0
-5  5   3  12
-4  4  -2  -4
-2  2   31 -13
-<jet>
-<end_event>
-
-<begin_event>
-<jet>
-15 10  5   5
-12 18  0  -1
-7  7  -15  0
-5  5   3  12
-4  4  -2  -4
-2  2   31 -13
-<jet>
-<end_event>
-
-<end_file>
\ No newline at end of file
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx
index e577e1cec149..483ecac6250e 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx
@@ -10,7 +10,6 @@
 #include "TrigConfIO/JsonFileLoader.h"
 #include "TrigConfData/L1Menu.h"
 
-#include "L1TopoConfig/L1TopoXMLParser.h"
 #include "L1TopoCoreSim/TopoSteering.h"
 #include "L1TopoCoreSim/StandaloneL1TopoHistSvc.h"
 #include "L1TopoCoreSim/TopoASCIIReader.h"
diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoTestSteeringConfig.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoTestSteeringConfig.cxx
index 4f6a5ef50089..bf20c58f3e08 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoTestSteeringConfig.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoTestSteeringConfig.cxx
@@ -1,12 +1,11 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
-// test the loading of the topo menu xml and configuration of the topo steering
+// test the loading of the topo menu and configuration of the topo steering
 
 #include <iostream>
 
 #include "L1TopoCoreSim/TopoSteering.h"
-#include "L1TopoConfig/L1TopoXMLParser.h"
 
 #include "TrigConfIO/JsonFileLoader.h"
 #include "TrigConfData/L1Menu.h"
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py b/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py
index ada857a13518..faef01621051 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1TopoSimulationTest.py
@@ -1,16 +1,15 @@
 #!/bin/env python
 
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
-import os,psutil,sys
+import sys
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger('L1TopoSimulationTest.py')
          
-fmenu ,fTOBs = 'L1Topoconfig_MC_pp_v8_NewNaming.xml','eventdump_new.txt'
+fTOBs = 'eventdump_new.txt'
 fjson = 'L1Menu_LS2_v1_22.0.17.json'
 
-print ('File for menu :',fmenu)
 print ('File for menu (json):', fjson)
 print ('File for TOBs :',fTOBs)
    
@@ -62,7 +61,6 @@ from L1TopoSimulation.L1TopoSimulationTestConfig import L1TopoSimulationTest
 
 topSequence += L1TopoSimulationTest()
 topSequence.L1TopoSimulationTest.InputASCIIFile = fTOBs
-topSequence.L1TopoSimulationTest.InputXMLFile = fmenu
 topSequence.L1TopoSimulationTest.InputJSONFile = fjson
 
 
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/test/L1TopoSimulationTest.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/test/L1TopoSimulationTest.cxx
index 2a99152d37ba..8376df859f6b 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/test/L1TopoSimulationTest.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/test/L1TopoSimulationTest.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 "./L1TopoSimulationTest.h"
@@ -8,7 +8,6 @@
 #include "L1TopoCoreSim/TopoSteering.h"
 #include "L1TopoConfig/L1TopoMenu.h"
 #include "L1TopoEvent/TopoInputEvent.h"
-#include "L1TopoConfig/L1TopoXMLParser.h"
 #include "L1TopoInterfaces/IL1TopoHistSvc.h"
 
 #include "GaudiKernel/ITHistSvc.h"
@@ -27,7 +26,6 @@ LVL1::L1TopoSimulationTest::L1TopoSimulationTest(const std::string &name, ISvcLo
    m_OffhistSvc( "THistSvc/THistSvc", name),
    m_OfftopoSteering( unique_ptr<TCS::TopoSteering>(new TCS::TopoSteering()) )
 {
-   declareProperty( "InputXMLFile", m_OffinputXMLFile, "File name for menu XML");
    declareProperty( "InputJSONFile", m_OffinputJSONFile, "File name for menu JSON");
    declareProperty( "InputASCIIFile", m_OffinputASCIIFile, "File name for ASCII TOB vector");
    declareProperty( "HistSvc", m_OffhistSvc, "Histogramming service for L1Topo algorithms");
@@ -54,7 +52,7 @@ LVL1::L1TopoSimulationTest::initialize() {
 
   ATH_MSG_INFO("initialize");
 
-  if (m_OffinputXMLFile.empty() || m_OffinputJSONFile.empty()){
+  if (m_OffinputJSONFile.empty()){
     ATH_MSG_FATAL("No L1 Topo menu from JSON " << m_OffinputJSONFile);
     return StatusCode::FAILURE;
   }
diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/test/L1TopoSimulationTest.h b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/test/L1TopoSimulationTest.h
index 1d0b216cfe84..21b076df9ba9 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/test/L1TopoSimulationTest.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/test/L1TopoSimulationTest.h
@@ -51,7 +51,6 @@ namespace LVL1 {
 
     StringProperty  m_OffhistBaseDir; //! sets base dir for monitoring histograms
     StringProperty  m_OffinputASCIIFile { "" }; // input dump file
-    StringProperty  m_OffinputXMLFile { "" }; // XML file can be register in case of enabling the ASCII file read for validation purposes
     StringProperty  m_OffinputJSONFile { "" }; // JSON file for menu
 
     std::unique_ptr<TCS::TopoSteering>  m_OfftopoSteering; //!< the topo steering
-- 
GitLab


From 36738a8d1e79282cc006e4c21bd77565b5abef51 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 27 Sep 2021 09:57:35 +0200
Subject: [PATCH 327/347] AthenaConfiguration: Fix missing imports in
 OldFlags2NewFlags

Fix missing imports in `OldFlags2NewFlags` and add a unit test.

Also increase the timeout for a test that was seen to be timing out
in a debug build.
---
 Control/AthenaConfiguration/CMakeLists.txt    | 11 ++++++--
 .../python/AllConfigFlags.py                  |  2 --
 .../python/AutoConfigFlags.py                 |  2 +-
 .../python/OldFlags2NewFlags.py               | 28 +++++++++++++------
 4 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/Control/AthenaConfiguration/CMakeLists.txt b/Control/AthenaConfiguration/CMakeLists.txt
index c37844b43d38..3e20ae629810 100644
--- a/Control/AthenaConfiguration/CMakeLists.txt
+++ b/Control/AthenaConfiguration/CMakeLists.txt
@@ -51,9 +51,14 @@ if( NOT SIMULATIONBASE AND NOT GENERATIONBASE AND NOT XAOD_ANALYSIS )
 
     atlas_add_test( AllConfigFlagsTest
                     SCRIPT python -m AthenaConfiguration.AllConfigFlags
-                    POST_EXEC_SCRIPT nopost.sh )
-   atlas_add_test( ComponentAccumulatorTestReco
+                    POST_EXEC_SCRIPT nopost.sh
+                    PROPERTIES TIMEOUT 300  )
+
+    atlas_add_test( ComponentAccumulatorTestReco
                     SCRIPT python -m unittest -v AthenaConfiguration.ComponentAccumulatorTestReco
                     POST_EXEC_SCRIPT nopost.sh )
-                               
+
+    atlas_add_test( OldFlags2NewFlagsTest
+                    SCRIPT python -m AthenaConfiguration.OldFlags2NewFlags
+                    POST_EXEC_SCRIPT nopost.sh )
 endif()
diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py
index b39c26cfcb11..8d4a875b9341 100644
--- a/Control/AthenaConfiguration/python/AllConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AllConfigFlags.py
@@ -1,7 +1,5 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
-from __future__ import print_function
-
 from AthenaCommon.SystemOfUnits import TeV
 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
 from AthenaConfiguration.AutoConfigFlags import GetFileMD, getInitialTimeStampsFromRunNumbers, getRunToTimestampDict
diff --git a/Control/AthenaConfiguration/python/AutoConfigFlags.py b/Control/AthenaConfiguration/python/AutoConfigFlags.py
index 757e223903cf..3e01caa43610 100644
--- a/Control/AthenaConfiguration/python/AutoConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AutoConfigFlags.py
@@ -51,7 +51,7 @@ def GetFileMD(filenames):
     if filename not in _fileMetaData:
         if len(filenames)>1:
             msg.info("Multiple input files. Use the first one for auto-configuration")
-        msg.info("Obtaining metadata of auto-configuration by peeking into %s", filename)
+        msg.info("Obtaining metadata of auto-configuration by peeking into '%s'", filename)
         _fileMetaData[filename] = DynamicallyLoadMetadata(filename)
 
     return _fileMetaData[filename]
diff --git a/Control/AthenaConfiguration/python/OldFlags2NewFlags.py b/Control/AthenaConfiguration/python/OldFlags2NewFlags.py
index 3d20e4636560..f96dc81e0d1d 100644
--- a/Control/AthenaConfiguration/python/OldFlags2NewFlags.py
+++ b/Control/AthenaConfiguration/python/OldFlags2NewFlags.py
@@ -1,13 +1,22 @@
 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 def getNewConfigFlags():
+    """Create new ConfigFlags from old-style jobproperties. Usage:
+
+    from AthenaConfiguration.OldFlags2NewFlags import getNewConfigFlags
+    ConfigFlags = getNewConfigFlags()
+    """
+
     from AthenaConfiguration.AllConfigFlags import ConfigFlags
 
     # Import some old-style flags
     from AthenaCommon.DetFlags import DetFlags
-    from AthenaCommon.GlobalFlags import globalflags # noqa: F401
     from AthenaCommon.AthenaCommonFlags import jobproperties
+    import AthenaCommon.GlobalFlags      # noqa: F401
+    import AthenaCommon.BeamFlags        # noqa: F401
+    import AthenaCommon.ConcurrencyFlags # noqa: F401
     from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags
+    from AthenaMonitoring.DQMonFlags import DQMonFlags
 
     # Files and conditions
     if jobproperties.Global.InputFormat() == 'bytestream':
@@ -16,7 +25,7 @@ def getNewConfigFlags():
         ConfigFlags.Input.Files = jobproperties.AthenaCommonFlags.FilesInput.get_Value()
     ConfigFlags.IOVDb.GlobalTag = jobproperties.Global.ConditionsTag()
     ConfigFlags.Beam.BunchSpacing = jobproperties.Beam.bunchSpacing()
-    ConfigFlags.Output.HISTFileName = jobproperties.DQMonFlagsCont.histogramFile()
+    ConfigFlags.Output.HISTFileName = DQMonFlags.histogramFile()
     # Geometry - General
     ConfigFlags.GeoModel.AtlasVersion = jobproperties.Global.DetDescrVersion()
     ConfigFlags.GeoModel.Align.Dynamic = InDetGeometryFlags.useDynamicAlignFolders()
@@ -24,10 +33,8 @@ def getNewConfigFlags():
     ConfigFlags.Common.isOnline = jobproperties.AthenaCommonFlags.isOnline()
 
     # Concurrency
-    from AthenaCommon.ConcurrencyFlags import jobproperties as jp
-    ConfigFlags.Concurrency.NumProcs = jp.ConcurrencyFlags.NumProcs()
-    ConfigFlags.Concurrency.NumThreads = jp.ConcurrencyFlags.NumThreads()
-
+    ConfigFlags.Concurrency.NumProcs = jobproperties.ConcurrencyFlags.NumProcs()
+    ConfigFlags.Concurrency.NumThreads = jobproperties.ConcurrencyFlags.NumThreads()
 
     # Let's build a map whose key is new flagname, and whose value is old flagname.
     geom_flag_map = {}
@@ -65,7 +72,12 @@ def getNewConfigFlags():
         ConfigFlags._set('Detector.Enable'+flag, getattr(DetFlags.haveRIO,reco_flag_map[flag]+'_on')() )
 
     # miscellaneous settings
-    ConfigFlags.InDet.doTIDE_Ambi=jobproperties.InDetJobProperties.doTIDE_Ambi()
-    ConfigFlags.InDet.useDCS=jobproperties.InDetJobProperties.useDCS()
+    from InDetRecExample.InDetJobProperties import InDetFlags
+    ConfigFlags.InDet.doTIDE_Ambi = InDetFlags.doTIDE_Ambi()
+    ConfigFlags.InDet.useDCS = InDetFlags.useDCS()
 
     return ConfigFlags
+
+
+if __name__=="__main__":
+    ConfigFlags = getNewConfigFlags()
-- 
GitLab


From 7246ca440cd668d98224230ccfca66269bede306 Mon Sep 17 00:00:00 2001
From: Julie Kirk <Julie.Kirk@cern.ch>
Date: Mon, 27 Sep 2021 10:06:38 +0200
Subject: [PATCH 328/347] Update Bphysics chain names for ID trigger ART tests

---
 .../share/TrigInDetValidation_AODtoTrkNtuple.py               | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
index beb40ea60a21..3fb3d1ae373c 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_AODtoTrkNtuple.py
@@ -233,8 +233,8 @@ if ( True ) :
     "HLT_mb.*:HLT_IDTrack_MinBias_IDTrig",
     #"HLT_mb.*:HLT_IDTrack_MinBias_EFID"  #There are no tracks here
     
-    "HLT_2mu4_bBmumux_BsmumuPhi_L12MU4:HLT_IDTrack_Bmumux_FTF",
-    "HLT_2mu4_bBmumux_BsmumuPhi_L12MU4:HLT_IDTrack_Bmumux_IDTrig"
+    "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_FTF",
+    "HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V:HLT_IDTrack_Bmumux_IDTrig"
     
     ]
 
-- 
GitLab


From 20ece35ab8a64fbea9ffc12dc96e0b99e80c0f92 Mon Sep 17 00:00:00 2001
From: Alison Elliot <alison.elliot@cern.ch>
Date: Mon, 27 Sep 2021 10:14:47 +0200
Subject: [PATCH 329/347] fixing scale error in efex taus, and updating the
 counts

---
 .../L1CaloFEXSim/L1CaloFEXSim/eFEXFormTOBs.h  |  3 ++-
 .../L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx   | 22 +++++--------------
 .../L1CaloFEXSim/src/eFEXFormTOBs.cxx         | 19 +++++++++++-----
 .../share/ref_v1Dev_decodeBS_build.ref        | 14 ++++++------
 4 files changed, 28 insertions(+), 30 deletions(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXFormTOBs.h b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXFormTOBs.h
index f72cf814bf73..102f121f55aa 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXFormTOBs.h
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/L1CaloFEXSim/eFEXFormTOBs.h
@@ -38,7 +38,8 @@ namespace LVL1 {
 
     /** Internal data */
   private:
-
+    const unsigned int m_eFexStep = 25;
+    const unsigned int m_eFexTobStep = 100;
   };
 
 } // end of namespace
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
index 192414cfef5d..2da55681ebba 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx
@@ -99,9 +99,6 @@ StatusCode eFEXFPGA::execute(eFEXOutputCollection* inputOutputCollection){
 
   auto & thr_eEM = l1Menu->thrExtraInfo().eEM();
 
-  const unsigned int eFexstep = 25;
-  const unsigned int eFexTobstep = 100;
-
   for(int ieta = 1; ieta < 5; ieta++) {
     for(int iphi = 1; iphi < 9; iphi++) {
       int tobtable[3][3]={
@@ -122,13 +119,10 @@ StatusCode eFEXFPGA::execute(eFEXOutputCollection* inputOutputCollection){
       unsigned int ptMinToTopoCounts = 0;
       ptMinToTopoCounts = thr_eEM.ptMinToTopoCounts(); 
 
-      //returns a unsigned integer et value corresponding to the... eFEX EM cluster? in 1 MeV scale
+      //returns a unsigned integer et value corresponding to the... eFEX EM cluster in 25 MeV internal calculation scale
       unsigned int eEMTobEt = 0;
       eEMTobEt = m_eFEXegAlgoTool->getET();
-      
-      unsigned int eEMTobEtCounts = 0;
-      eEMTobEtCounts = eEMTobEt*eFexstep/eFexTobstep; //rescale from 25 MeV eFEX steps to 100 MeV for the TOB
-      
+            
       // thresholds from Trigger menu
       auto iso_loose  = thr_eEM.isolation(TrigConf::Selection::WP::LOOSE, ieta);
       auto iso_medium = thr_eEM.isolation(TrigConf::Selection::WP::MEDIUM, ieta);
@@ -178,8 +172,8 @@ StatusCode eFEXFPGA::execute(eFEXOutputCollection* inputOutputCollection){
       int phi_ind = iphi - 1;
 
       //form the egamma tob word
-      uint32_t tobword = m_eFEXFormTOBsTool->formEmTOBWord(m_id,eta_ind,phi_ind,RhadWP,WstotWP,RetaWP,seed,eEMTobEtCounts,ptMinToTopoCounts);
-      if ( (tobword != 0) && (eEMTobEtCounts != 0) ) m_emTobwords.push_back(tobword);
+      uint32_t tobword = m_eFEXFormTOBsTool->formEmTOBWord(m_id,eta_ind,phi_ind,RhadWP,WstotWP,RetaWP,seed,eEMTobEt,ptMinToTopoCounts);
+      if ( (tobword != 0) && (eEMTobEt != 0) ) m_emTobwords.push_back(tobword);
 
       std::unique_ptr<eFEXegTOB> tmp_tob = m_eFEXegAlgoTool->geteFEXegTOB();
       
@@ -219,8 +213,6 @@ StatusCode eFEXFPGA::execute(eFEXOutputCollection* inputOutputCollection){
   }
 
 
-  //ATH_CHECK(store())
-
   // --------------- TAU -------------
   for(int ieta = 1; ieta < 5; ieta++)
   {
@@ -237,16 +229,14 @@ StatusCode eFEXFPGA::execute(eFEXOutputCollection* inputOutputCollection){
 
       if (!m_eFEXtauAlgoTool->isCentralTowerSeed()){ continue; }
 
-      // Get Et of eFEX tau object in MeV
+      // Get Et of eFEX tau object in internal units (25 MeV)
       unsigned int eTauTobEt = 0;
       eTauTobEt = m_eFEXtauAlgoTool->getEt();
-      unsigned int eTauTobEtCounts = 0;
-      eTauTobEtCounts = eTauTobEt / eFexTobstep; // steps of 100 MeV for the TOB
 
       int eta_ind = ieta; // No need to offset eta index with new 0-5 convention
       int phi_ind = iphi - 1;
       
-      uint32_t tobword = m_eFEXFormTOBsTool->formTauTOBWord(m_id, eta_ind, phi_ind, eTauTobEtCounts);
+      uint32_t tobword = m_eFEXFormTOBsTool->formTauTOBWord(m_id, eta_ind, phi_ind, eTauTobEt);
       if ( tobword != 0 ) m_tauTobwords.push_back(tobword);
 
       // for plotting
diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFormTOBs.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFormTOBs.cxx
index b62d539d8166..91d6a6c3dc17 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFormTOBs.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFormTOBs.cxx
@@ -35,17 +35,21 @@ uint32_t eFEXFormTOBs::formTauTOBWord(int & fpga, int & eta, int & phi, unsigned
 {
   uint32_t tobWord = 0;
 
+  //rescale from 25 MeV eFEX steps to 100 MeV for the TOB
+  unsigned int etTob = 0;
+  etTob = et*m_eFexStep/m_eFexTobStep; 
+
   // Truncate at 12 bits, set to max value of 4095, 0xfff, or 111111111111
-  if (et > 0xfff) et = 0xfff;
+  if (etTob > 0xfff) etTob = 0xfff;
 
   // Create bare minimum tob word with et, eta, phi, and fpga index, bitshifted to the appropriate locations
-  tobWord = tobWord + (fpga << 30) + (eta << 27) + (phi << 24) + et;
+  tobWord = tobWord + (fpga << 30) + (eta << 27) + (phi << 24) + etTob;
 
   ATH_MSG_DEBUG("Tau tobword: " << std::bitset<32>(tobWord) );
 
   // Some arbitrary cut so that we're not flooded with tobs, to be taken from the Trigger menu in the future!
   unsigned int minEtThreshold = 30;
-  if (et < minEtThreshold) return 0;
+  if (etTob < minEtThreshold) return 0;
   else return tobWord;
 }
 
@@ -53,17 +57,20 @@ uint32_t eFEXFormTOBs::formEmTOBWord(int & fpga, int & eta, int & phi, unsigned
 {
   uint32_t tobWord = 0;
 
+  unsigned int etTob = 0;
+  etTob = et*m_eFexStep/m_eFexTobStep; //rescale from 25 MeV eFEX steps to 100 MeV for the TOB
+
   // Truncate at 12 bits, set to max value of 4095, 0xfff, or 111111111111
-  if (et > 0xfff) et = 0xfff;
+  if (etTob > 0xfff) etTob = 0xfff;
 
   // Create bare minimum tob word with et, eta, phi, and fpga index, bitshifted to the appropriate locations
-  tobWord = tobWord + (fpga << 30) + (eta << 27) + (phi << 24) + (rhad << 22) + (wstot << 20) + (reta << 18) + (seed << 16) + et;
+  tobWord = tobWord + (fpga << 30) + (eta << 27) + (phi << 24) + (rhad << 22) + (wstot << 20) + (reta << 18) + (seed << 16) + etTob;
 
   ATH_MSG_DEBUG("EM tobword: " << std::bitset<32>(tobWord) );
 
   // Some arbitrary cut so that we're not flooded with tobs, to be taken from the Trigger menu in the future!
   unsigned int minEtThreshold = ptMinTopo;
-  if (et < minEtThreshold) return 0;
+  if (etTob < minEtThreshold) return 0;
   else return tobWord;
 }
 
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 3a210656b56d..822feb89d49f 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -3904,23 +3904,23 @@ HLT_noalg_L1eEM8M:
 HLT_noalg_L1eTAU100:
   eventCount: 0
 HLT_noalg_L1eTAU12:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eTAU12L:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eTAU12M:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eTAU20:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eTAU25:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eTAU30H:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1eTAU40:
   eventCount: 0
 HLT_noalg_L1eTAU60:
   eventCount: 0
 HLT_noalg_L1eTAU8:
-  eventCount: 0
+  eventCount: 1
 HLT_noalg_L1gTE50:
   eventCount: 0
 HLT_noalg_L1gXE30:
-- 
GitLab


From 2b16bc2da7c537586730362e5784a59dab630ba7 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 27 Sep 2021 11:53:17 +0200
Subject: [PATCH 330/347] LArCalorimeter: migrate trigger configuration to
 ConfigFlags

Migrate some of the LAr job fragments to setup the trigger using the
"new" `ConfigFlags`. Very likely further fixes are needed as I was not
able to actually run any of these job options due to unrelated problems.
---
 LArCalorimeter/LArCafJobs/share/skeleton.LArNoise.py  | 10 +++++-----
 .../LArCafJobs/share/skeleton.LArNoise_fromraw.py     |  9 ---------
 .../LArCalibTools/share/LArPulseShapeRun.py           | 11 +++++------
 LArCalorimeter/LArMonitoring/share/LArReco_fromraw.py |  8 --------
 4 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise.py b/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise.py
index 2de5c8af4302..917fdd394faa 100644
--- a/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise.py
+++ b/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise.py
@@ -128,15 +128,15 @@ from RecExConfig.ObjKeyStore import objKeyStore
 from PyUtils.MetaReaderPeeker import convert_itemList
 objKeyStore.addManyTypesInputFile(convert_itemList(layout = '#join'))
 
-from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
-tf.readBS=False
-tf.doID=False
-
+# trigger configuration
+from AthenaConfiguration.OldFlags2NewFlags import getNewConfigFlags
+ConfigFlags = getNewConfigFlags()
+ConfigFlags.Trigger.readBS = False
+ConfigFlags.Trigger.doID = False
 
 from TriggerJobOpts.T0TriggerGetter import T0TriggerGetter
 triggerGetter = T0TriggerGetter()
 
-# trigger configuration
 #from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
 #cfg =  TriggerConfigGetter("ReadPool")
 
diff --git a/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise_fromraw.py b/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise_fromraw.py
index ecc73f950c80..453f01d8e8e4 100644
--- a/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise_fromraw.py
+++ b/LArCalorimeter/LArCafJobs/share/skeleton.LArNoise_fromraw.py
@@ -204,15 +204,6 @@ LArNoisyROSummaryGetter()
 if hasattr(runArgs,"outputNTUP_LARNOISEFile") or hasattr(runArgs,"outputNTUP_HECNOISEFile"):
    include("LArCellRec/LArTimeVetoAlg_jobOptions.py")
 
-   ####################
-   from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
-   tf.readBS.set_Value_and_Lock(True)
-   tf.doLVL1.set_Value_and_Lock(False)
-   tf.doHLT.set_Value_and_Lock(False)
-   tf.doL1Topo.set_Value_and_Lock(False)
-   tf.doID.set_Value_and_Lock(False)
-   tf.doMuon.set_Value_and_Lock(False)
-
    include("TriggerJobOpts/BStoESD_Tier0_HLTConfig_jobOptions.py")
 
    ## trigger configuration
diff --git a/LArCalorimeter/LArCalibTools/share/LArPulseShapeRun.py b/LArCalorimeter/LArCalibTools/share/LArPulseShapeRun.py
index d2fc807e3343..5e20879b75ab 100644
--- a/LArCalorimeter/LArCalibTools/share/LArPulseShapeRun.py
+++ b/LArCalorimeter/LArCalibTools/share/LArPulseShapeRun.py
@@ -14,8 +14,6 @@ if 'inputdb' not in dir():
    
 from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc)
 #import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector
-from string import split,join
-from time import time
 ## get a handle to the default top-level algorithm sequence
 from AthenaCommon.AlgSequence import AlgSequence 
 topSequence = AlgSequence()  
@@ -70,11 +68,12 @@ theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc
 theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"]
 theByteStreamAddressProviderSvc.TypeNames += [ "LArDigitContainer/FREE"   ]
 
-from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
-tf.readBS=True
-tf.doID=False
-
 # trigger configuration
+from AthenaConfiguration.OldFlags2NewFlags import getNewConfigFlags
+ConfigFlags = getNewConfigFlags()
+ConfigFlags.Trigger.readBS = True
+ConfigFlags.Trigger.doID = False
+
 from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
 cfg = TriggerConfigGetter()
 
diff --git a/LArCalorimeter/LArMonitoring/share/LArReco_fromraw.py b/LArCalorimeter/LArMonitoring/share/LArReco_fromraw.py
index d6312114eae5..098f8023ca53 100644
--- a/LArCalorimeter/LArMonitoring/share/LArReco_fromraw.py
+++ b/LArCalorimeter/LArMonitoring/share/LArReco_fromraw.py
@@ -152,14 +152,6 @@ include("LArCellRec/LArTimeVetoAlg_jobOptions.py")
 include("LArCellRec/LArCollisionTime_jobOptions.py")
 
 ####################
-from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
-tf.readBS.set_Value_and_Lock(True)
-tf.doLVL1.set_Value_and_Lock(False)
-tf.doHLT.set_Value_and_Lock(False)
-tf.doL1Topo.set_Value_and_Lock(False)
-tf.doID.set_Value_and_Lock(False)
-tf.doMuon.set_Value_and_Lock(False)
-
 include("TriggerJobOpts/BStoESD_Tier0_HLTConfig_jobOptions.py")
 
 #This tool is apparently instanciated by TrkDetElementSurface/ DetElementSurfaceCnv_p1.h
-- 
GitLab


From 4a37ecf9d37ef711a5c9de5838cf8019c3e45093 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 27 Sep 2021 12:03:25 +0200
Subject: [PATCH 331/347] TriggerFlags: migrate more flags to ConfigFlags

Migrate the following `TriggerFlags` to `ConfigFlags`:
- `doID`
- `doCalo`
- `doMuon`
- `doCaloOffsetCorrection`
- `readBS`
- `OnlineCondTag` (delete, was already migrated)
- `OnlineGeoTag` (delete, was already migrated)

Remove `doL1Topo` from both old and new flags as this was a left-over
from Run-2 commissioning.

Also remove some unused "Modifiers".
---
 .../scripts/chain.sh                          |  1 -
 .../python/TrigT2CaloCommonConfig.py          |  8 +-
 .../TrigT2CaloCommon/share/Calo.py            |  2 +-
 .../TrigT2CaloCommon/share/CaloRinger.py      |  2 +-
 .../share/testDataAccessService.py            |  2 +-
 .../DecisionHandling/python/TestUtils.py      |  6 +-
 .../HLTSeeding/python/HLTSeedingConfig.py     |  5 +-
 .../python/HLTTriggerResultGetter.py          |  9 +-
 .../TriggerJobOpts/python/Modifiers.py        | 83 ++-----------------
 .../python/TriggerConfigFlags.py              | 10 +--
 .../TriggerJobOpts/python/TriggerFlags.py     | 26 +-----
 .../BStoESD_Tier0_HLTConfig_jobOptions.py     |  2 +-
 .../share/TransientBS_DetFlags.py             |  5 +-
 .../TriggerJobOpts/share/runHLT_standalone.py |  6 +-
 14 files changed, 38 insertions(+), 129 deletions(-)

diff --git a/Event/EventOverlay/EventOverlayJobTransforms/scripts/chain.sh b/Event/EventOverlay/EventOverlayJobTransforms/scripts/chain.sh
index af73d194b4f9..e814c2c8e3af 100755
--- a/Event/EventOverlay/EventOverlayJobTransforms/scripts/chain.sh
+++ b/Event/EventOverlay/EventOverlayJobTransforms/scripts/chain.sh
@@ -38,7 +38,6 @@ if [ $doreco == 1 ]; then
 #domon="rec.doMonitoring=True;"
 #rdotrig="--outputRDO_TRIGFile testRTT.RDO_TRIG.pool.root --triggerConfig MCRECO:DBF:TRIGGERDBMC:2046,20,48 "
 aodout="--outputAODFile testRTT.AOD.pool.root"
-#trigflag="from TriggerJobOpts.TriggerFlags import TriggerFlags as TF; TF.doLVL1.set_Value_and_Lock(False); TF.doL1Topo.set_Value_and_Lock(False); TF.doLVL2.set_Value_and_Lock(True); TF.doEF.set_Value_and_Lock(True);"
 trigflag="from TriggerJobOpts.TriggerFlags import TriggerFlags as TF; TF.configForStartup.set_Value_and_Lock('HLToffline');"
 #dotrig="rec.doTrigger=True;"
 
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigT2CaloCommonConfig.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigT2CaloCommonConfig.py
index fda89ff5636b..301aff87cbb9 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigT2CaloCommonConfig.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/python/TrigT2CaloCommonConfig.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 TrigT2CaloCommon.TrigT2CaloCommonConf import TrigCaloDataAccessSvc as _TrigCaloDataAccessSvc
 
@@ -9,7 +9,7 @@ class TrigCaloDataAccessSvc(_TrigCaloDataAccessSvc):
         super(TrigCaloDataAccessSvc, self).__init__(name)
 
         from AthenaCommon.AppMgr import ServiceMgr as svcMgr
-        from TriggerJobOpts.TriggerFlags import TriggerFlags
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
         from AthenaCommon.GlobalFlags import globalflags
         from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
         from AthenaCommon.Logging import logging
@@ -28,10 +28,10 @@ class TrigCaloDataAccessSvc(_TrigCaloDataAccessSvc):
         condseq = AthSequencer('AthCondSeq')
         condseq.RegSelCondAlg_TTEM.RegSelLUT="ConditionStore+RegSelLUTCondData_TTEM"
 
-        if ( globalflags.DatabaseInstance == "COMP200" and TriggerFlags.doCaloOffsetCorrection() ) :
+        if ( globalflags.DatabaseInstance == "COMP200" and ConfigFlags.Trigger.calo.doOffsetCorrection ) :
             log.warning("Not possible to run BCID offset correction with COMP200")
         else:
-            if TriggerFlags.doCaloOffsetCorrection():
+            if ConfigFlags.Trigger.calo.doOffsetCorrection:
                 if globalflags.DataSource()=='data' and athenaCommonFlags.isOnline():
                     log.info('Enable HLT calo offset correction for data')
                     from IOVDbSvc.CondDB import conddb
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/Calo.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/Calo.py
index e41d26e2b75a..86c4d5305ec8 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/Calo.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/Calo.py
@@ -30,7 +30,7 @@ topSequence += HLTSeedingNoCtpForTesting("HLTSeedingNoCtpForTesting", OutputLeve
 steps = seqOR("HLTTop")
 topSequence += steps
 
-if TriggerFlags.doCalo:
+if ConfigFlags.Trigger.doCalo:
   if ( doHLTCaloTopo ) :
     from TrigT2CaloCommon.CaloDef import HLTFSTopoRecoSequence
     recosequence, caloclusters = HLTFSTopoRecoSequence("HLT_TestFSRoI")
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloRinger.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloRinger.py
index f8d2c0165ba7..90558f600789 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloRinger.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/CaloRinger.py
@@ -31,7 +31,7 @@ topSequence += HLTSeedingNoCtpForTesting("HLTSeedingNoCtpForTesting", OutputLeve
 steps = seqOR("HLTTop")
 topSequence += steps
 
-if TriggerFlags.doCalo:
+if ConfigFlags.Trigger.doCalo:
 
   if ( doHLTCaloTopo ) :
     from TrigT2CaloCommon.CaloDef import HLTFSTopoRecoSequence
diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/testDataAccessService.py b/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/testDataAccessService.py
index f38c942e6dcb..470318bc954a 100644
--- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/testDataAccessService.py
+++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/share/testDataAccessService.py
@@ -19,7 +19,7 @@ if globalflags.InputFormat.is_bytestream():
 # ----------------------------------------------------------------
 from AthenaCommon.AlgSequence import AthSequencer
 
-if TriggerFlags.doCalo:
+if ConfigFlags.Trigger.doCalo:
 
   if ( True ) :
      from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
diff --git a/Trigger/TrigSteer/DecisionHandling/python/TestUtils.py b/Trigger/TrigSteer/DecisionHandling/python/TestUtils.py
index f9e05fa500cd..47e994363231 100644
--- a/Trigger/TrigSteer/DecisionHandling/python/TestUtils.py
+++ b/Trigger/TrigSteer/DecisionHandling/python/TestUtils.py
@@ -25,7 +25,7 @@ class L1EmulationTest(HLTSeeding):
     def __init__(self, name='L1EmulationTest', *args, **kwargs):
         super(L1EmulationTest, self).__init__(name, *args, **kwargs)
 
-        from TriggerJobOpts.TriggerFlags import TriggerFlags
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
         from HLTSeeding.HLTSeedingConf import CTPUnpackingEmulationTool, RoIsUnpackingEmulationTool
 
         self.RoIBResult = ""
@@ -50,7 +50,7 @@ class L1EmulationTest(HLTSeeding):
         from HLTSeeding.HLTSeedingConfig import mapThresholdToL1RoICollection
 
         # EM unpacker
-        if TriggerFlags.doID() or TriggerFlags.doCalo():
+        if ConfigFlags.Trigger.doID or ConfigFlags.Trigger.doCalo:
             emUnpacker = RoIsUnpackingEmulationTool("EMRoIsUnpackingTool",
                                                     Decisions = "EMRoIDecisions",
                                                     OutputTrigRoIs = mapThresholdToL1RoICollection("EM"),
@@ -60,7 +60,7 @@ class L1EmulationTest(HLTSeeding):
 
 
         # MU unpacker
-        if TriggerFlags.doMuon():
+        if ConfigFlags.Trigger.doMuon:
             muUnpacker = RoIsUnpackingEmulationTool("MURoIsUnpackingTool",
                                                     Decisions = "MURoIDecisions",
                                                     OutputTrigRoIs = mapThresholdToL1RoICollection("MU"),
diff --git a/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py b/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py
index 5f302577c2a8..4aaa80fc4175 100644
--- a/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py
+++ b/Trigger/TrigSteer/HLTSeeding/python/HLTSeedingConfig.py
@@ -199,7 +199,6 @@ class HLTSeeding(CompFactory.HLTSeeding) :
     def __init__(self, name='HLTSeeding', *args, **kwargs):
         super(HLTSeeding, self).__init__(name, *args, **kwargs)
 
-        from TriggerJobOpts.TriggerFlags import TriggerFlags
         from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags
 
         # CTP unpacker
@@ -212,14 +211,14 @@ class HLTSeeding(CompFactory.HLTSeeding) :
                                             Decisions=mapThresholdToL1DecisionCollection("FSNOSEED"),
                                             OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("FSNOSEED") )) ]
         # EM unpacker
-        if TriggerFlags.doID() or TriggerFlags.doCalo():
+        if flags.Trigger.doID or flags.Trigger.doCalo:
             if flags.Trigger.enableL1CaloPhase1:
                 self.xAODRoIUnpackers += createCaloRoIUnpackers()
             if flags.Trigger.enableL1CaloLegacy:
                 self.RoIBRoIUnpackers += createLegacyCaloRoIUnpackers()
 
         # MU unpacker
-        if TriggerFlags.doMuon():
+        if flags.Trigger.doMuon:
             unpackers = createMuonRoIUnpackers(flags)
             if flags.Trigger.enableL1MuonPhase1:
                 self.xAODRoIUnpackers += unpackers
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerResultGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerResultGetter.py
index d768b74bde85..658ab891b7fd 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerResultGetter.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/HLTTriggerResultGetter.py
@@ -82,7 +82,6 @@ class ByteStreamUnpackGetterRun1or2(Configured):
         from AthenaCommon.AlgSequence import AlgSequence 
         topSequence = AlgSequence()
         
-        #if TriggerFlags.readBS():
         log.info( "TriggerFlags.dataTakingConditions: %s", TriggerFlags.dataTakingConditions() )
         # in MC this is always FullTrigger
         hasHLT = TriggerFlags.dataTakingConditions() in ('HltOnly', 'FullTrigger')
@@ -170,7 +169,7 @@ class TrigDecisionGetter(Configured):
         from TrigDecisionMaker.TrigDecisionMakerConfig import TrigDecisionMakerMT
         tdm = TrigDecisionMakerMT('TrigDecMakerMT')
 
-        if not TriggerFlags.readBS():
+        if not ConfigFlags.Trigger.readBS:
             # Construct trigger bits from HLTNav_summary instead of reading from BS
             from TrigOutputHandling.TrigOutputHandlingConf import TriggerBitsMakerTool
             tdm.BitsMakerTool = TriggerBitsMakerTool()
@@ -276,8 +275,8 @@ class HLTTriggerResultGetter(Configured):
             
         from AthenaCommon.AlgSequence import AlgSequence
         topSequence = AlgSequence()
-        log.info("BS unpacking (TF.readBS): %d", TriggerFlags.readBS() )
-        if TriggerFlags.readBS():
+        log.info("BS unpacking (ConfigFlags.Trigger.readBS): %d", ConfigFlags.Trigger.readBS )
+        if ConfigFlags.Trigger.readBS:
             if ConfigFlags.Trigger.EDMVersion == 1 or \
                ConfigFlags.Trigger.EDMVersion == 2:
                 bs = ByteStreamUnpackGetterRun1or2()  # noqa: F841
@@ -297,7 +296,7 @@ class HLTTriggerResultGetter(Configured):
             if rec.doTrigger() or TriggerFlags.doTriggerConfigOnly():
                 tdt = TrigDecisionGetterRun1or2()  # noqa: F841
         elif ConfigFlags.Trigger.EDMVersion >= 3:
-            if TriggerFlags.readBS():
+            if ConfigFlags.Trigger.readBS:
                 tdt = TrigDecisionGetter()  # noqa: F841
         else:
             raise RuntimeError("Invalid EDMVersion=%s " % ConfigFlags.Trigger.EDMVersion)
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
index bf12b93e663e..875a28c3377c 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/Modifiers.py
@@ -41,46 +41,6 @@ class _modifier:
 # Detector maps and conditions
 ###############################################################
 
-class streamingOnly(_modifier):
-    """
-    Turn off things not needed for streaming only setup
-    """
-    def preSetup(self):
-        from MuonRecExample.MuonRecFlags import muonRecFlags
-        muonRecFlags.doMDTs=False
-        muonRecFlags.doRPCs=False
-        muonRecFlags.doTGCs=False
-        TriggerFlags.doID=False
-        TriggerFlags.doCalo=False
-
-    def postSetup(self):
-        #remove MDT folders as one of them takes 10s to load
-        svcMgr.IOVDbSvc.Folders=[]
-        Folders=[]
-        for text in svcMgr.IOVDbSvc.Folders:
-            if text.find("/MDT")<0:
-                Folders+=[text]
-        svcMgr.IOVDbSvc.Folders=Folders
-
-        # There is no magnetic field service in this setup
-        if hasattr(svcMgr,'HltEventLoopMgr'):
-            svcMgr.HltEventLoopMgr.setMagFieldFromPtree = False
-
-class noID(_modifier):
-    """
-    Turning of ID - make sure no algorithm needs it!
-    """
-    def preSetup(self):
-        TriggerFlags.doID=False
-
-class noCalo(_modifier):
-    """
-    Turning of Calorimeter - make sure no algorithm needs it!
-    """
-    def preSetup(self):
-        TriggerFlags.doCalo=False
-
-
 class BunchSpacing25ns(_modifier):
     """
     ID (and other settings) related to 25ns bunch spacing
@@ -124,7 +84,8 @@ class useHLTMuonAlign(_modifier):
     Apply muon alignment
     """
     def postSetup(self):
-        if TriggerFlags.doHLT() and TriggerFlags.doMuon():
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
+        if ConfigFlags.Trigger.doHLT and ConfigFlags.Trigger.doMuon:
             from MuonRecExample import MuonAlignConfig  # noqa: F401
             #temporary hack to workaround DB problem - should not be needed any more
             folders=svcMgr.IOVDbSvc.Folders
@@ -142,7 +103,8 @@ class useRecentHLTMuonAlign(_modifier):
     Apply muon alignment
     """
     def postSetup(self):
-        if TriggerFlags.doHLT() and TriggerFlags.doMuon():
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
+        if ConfigFlags.Trigger.doHLT and ConfigFlags.Trigger.doMuon:
             from MuonRecExample import MuonAlignConfig  # noqa: F401
             folders=svcMgr.IOVDbSvc.Folders
             newFolders=[]
@@ -267,9 +229,10 @@ class noPileupNoise(_modifier):
     Disable pileup noise correction
     """
     def preSetup(self):
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
         from CaloTools.CaloNoiseFlags import jobproperties
         jobproperties.CaloNoiseFlags.FixedLuminosity.set_Value_and_Lock(0)
-        TriggerFlags.doCaloOffsetCorrection.set_Value_and_Lock(False)
+        ConfigFlags.Trigger.calo.doOffsetCorrection = False
 
 class usePileupNoiseMu8(_modifier):
     """
@@ -397,37 +360,6 @@ class forceAFPLinkNum(_modifier):
 # Algorithm modifiers
 ###############################################################
 
-class physicsZeroStreaming(_modifier):
-    """
-    set all physics chains to stream prescale 0 except streamer chains
-    """
-    def preSetup(self):
-        TriggerFlags.zero_stream_prescales=True
-
-class physicsPTmode(_modifier):
-    """
-    set all physics chains to PT=1 except streamer chains
-    """
-    def preSetup(self):
-        TriggerFlags.physics_pass_through=True
-
-class disableIBLInTracking(_modifier):
-    """
-    Turn off IBL in tracking algorithms (data still available for PEB etc)
-    """
-
-    def postSetup(self):
-        svcMgr.SpecialPixelMapSvc.MaskLayers = True
-        svcMgr.SpecialPixelMapSvc.LayersToMask = [0]
-
-
-class doMuonRoIDataAccess(_modifier):
-    """
-    Use RoI based decoding of muon system
-    """
-    def preSetup(self):
-        TriggerFlags.MuonSlice.doEFRoIDrivenAccess=True
-
 class rewriteLVL1(_modifier):
     """
     Write LVL1 results to ByteStream output, usually used together with rerunLVL1
@@ -481,7 +413,8 @@ class DisableMdtT0Fit(_modifier):
     Disable MDT T0 re-fit and use constants from COOL instead
     """
     def preSetup(self):
-        if TriggerFlags.doMuon():
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
+        if ConfigFlags.Trigger.doMuon:
             from MuonRecExample.MuonRecFlags import muonRecFlags
             muonRecFlags.doSegmentT0Fit.set_Value_and_Lock(False)
 
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
index d7aa39bbe2d0..6a4506deeab7 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
@@ -13,9 +13,6 @@ def createTriggerFlags():
     # enables L1 simulation
     flags.addFlag('Trigger.doLVL1', lambda prevFlags: prevFlags.Input.isMC)
 
-    # enables L1 topological trigger simulation
-    flags.addFlag('Trigger.doL1Topo', True )
-
     # need proper documentation
     flags.addFlag('Trigger.useRun1CaloEnergyScale', False)
 
@@ -103,6 +100,9 @@ def createTriggerFlags():
     flags.addFlag('Trigger.doEDMVersionConversion', False)
     flags.addFlag('Trigger.doConfigVersionConversion', True)
 
+    # Unpack trigger bytestream
+    flags.addFlag('Trigger.readBS', False)
+
     # Flag to control the scheduling of online Run 3 trigger navigation compactification into a single collection (uses slimming framework). 
     flags.addFlag('Trigger.doOnlineNavigationCompactification', True) 
 
@@ -114,13 +114,13 @@ def createTriggerFlags():
 
     # True if we have at least one input file, it is a POOL file, it has a metadata store, and the store has xAOD trigger configuration data
     # in either the run-2 or run-3 formats.
-    def TrigConfMeta(flags):
+    def _trigConfMeta(flags):
         from AthenaConfiguration.AutoConfigFlags import GetFileMD
         md = GetFileMD(flags.Input.Files) if any(flags.Input.Files) else {}
         return ("metadata_items" in md and any(('TriggerMenu' in key) for key in md["metadata_items"].keys()))
 
     # Flag to sense if trigger confioguration POOL metadata is available on the job's input
-    flags.addFlag('Trigger.InputContainsConfigMetadata', lambda prevFlags: TrigConfMeta(prevFlags))
+    flags.addFlag('Trigger.InputContainsConfigMetadata', lambda prevFlags: _trigConfMeta(prevFlags))
 
     # only enable services for analysis and BS -> ESD processing (we need better name)
     flags.addFlag('Trigger.doTriggerConfigOnly', False)
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
index e6123c73b554..7dda2f24ffc5 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
@@ -23,11 +23,6 @@ def bool_flag_with_default(name, val):
 
 default_true_flags = [
     "doLVL1", # run the LVL1 simulation (set to FALSE to read the LVL1 result from BS file)
-    "doL1Topo", # Run the L1 Topo simulation (set to FALSE to read the L1 Topo result from BS file)
-    "doID",  # if False, disable ID algos at LVL2 and EF """
-    "doCalo",  # if False, disable Calo algorithms at LVL2 & EF """
-    "doCaloOffsetCorrection",  # enable Calo pileup offset BCID correction """
-    "doMuon", # if FAlse, disable Muons, note: muons need input file containing digits"""
     "doNavigationSlimming",  # Enable the trigger navigation slimming"""
 ]
 
@@ -35,7 +30,6 @@ default_false_flags = [
     "useRun1CaloEnergyScale",
     "doTruth",
     "doTriggerConfigOnly",  # if True only the configuration services should be set, no algorithm """
-    "readBS",
     "readMenuFromTriggerDb", # define the TriggerDb to be the source of the LVL1 and HLT trigger menu
 ]
 
@@ -91,21 +85,6 @@ class ESDEDMSet(JobProperty):
 
 _flags.append(ESDEDMSet)
 
-class OnlineCondTag(JobProperty):
-    """ Default (online) HLT conditions tag """
-    statusOn=True
-    allowedType=['str']
-    StoredValue='CONDBR2-HLTP-2018-01'
-
-_flags.append(OnlineCondTag)
-
-class OnlineGeoTag(JobProperty):
-    """ Default (online) HLT geometry tag """
-    statusOn=True
-    allowedType=['str']
-    StoredValue='ATLAS-R2-2016-01-00-01'
-    
-_flags.append(OnlineGeoTag)
 
 # =========
 #
@@ -419,11 +398,12 @@ def sync_Trigger2Reco():
     from AthenaCommon.GlobalFlags  import globalflags
     from RecExConfig.RecFlags import rec
     
-    if  recAlgs.doTrigger() and rec.readRDO() and not globalflags.InputFormat()=='bytestream':
+    if recAlgs.doTrigger() and rec.readRDO() and not globalflags.InputFormat()=='bytestream':
         include( "TriggerJobOpts/TransientBS_DetFlags.py" )
 
     if globalflags.InputFormat() == 'bytestream':
-        TriggerFlags.readBS = True
+        from AthenaConfiguration.AllConfigFlags import ConfigFlags
+        ConfigFlags.Trigger.readBS = True
         TriggerFlags.doLVL1 = False
         TriggerFlags.doHLT   = False
 
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py b/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
index 8f69a71606ef..12a55043fbe8 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
@@ -35,7 +35,7 @@ if rec.doTrigger():
         from ByteStreamCnvSvcBase. ByteStreamCnvSvcBaseConf import ByteStreamAddressProviderSvc
         ServiceMgr += ByteStreamAddressProviderSvc()
 
-    tf.readBS=True
+    ConfigFlags.Trigger.readBS = True
     tf.doLVL1= False # needed to not rerun the trigger
     tf.doHLT= False # needed to not rerun the trigger
     if ConfigFlags.Trigger.EDMVersion >= 3:
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/TransientBS_DetFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/share/TransientBS_DetFlags.py
index d27dd7f1230e..2089695a8834 100755
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/TransientBS_DetFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/TransientBS_DetFlags.py
@@ -1,8 +1,7 @@
-# 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 AthenaCommon.DetFlags import DetFlags
 from RecExConfig.RecFlags import rec
-from TriggerJobOpts.TriggerFlags import TriggerFlags
 from AthenaCommon.GlobalFlags import jobproperties
 
 trtEnabled=DetFlags.detdescr.TRT_on()
@@ -33,7 +32,7 @@ if (not rec.readESD()) and jobproperties.Global.InputFormat() == "pool" and DetF
 #
 # Switch off direct formation of Cells from hits
 #    
-if not rec.readESD() and TriggerFlags.doCalo():
+if not rec.readESD():
     from AthenaCommon.Include import include
     include ("CaloRec/CaloCellMaker_config.py")
     CaloCellMakerFlags.doLArHitToCellDirect=False  # noqa: F821 old job options, flags from include above
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index c7971f5c7f00..2b1c30141179 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -273,9 +273,9 @@ else:           # More data modifiers
                      'enableSchedulerMon'
     ]
 
-TriggerFlags.doID = ConfigFlags.Trigger.doID = opt.doID
-TriggerFlags.doMuon = ConfigFlags.Trigger.doMuon = opt.doMuon
-TriggerFlags.doCalo = ConfigFlags.Trigger.doCalo = opt.doCalo
+ConfigFlags.Trigger.doID = opt.doID
+ConfigFlags.Trigger.doMuon = opt.doMuon
+ConfigFlags.Trigger.doCalo = opt.doCalo
 
 #-------------------------------------------------------------
 # Modifiers
-- 
GitLab


From 41db30572a9dd6fe1bb6b975baa46d84477e89c4 Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Mon, 27 Sep 2021 13:14:36 +0200
Subject: [PATCH 332/347] Reading specialConfig metadata in CA-based
 configurations

---
 .../python/AllConfigFlags.py                  |   3 +-
 .../python/AutoConfigFlags.py                 |  50 +++
 .../python/TRT_TR_ProcessConfigNew.py         |  10 +
 .../python/MDT_DigitizationConfig.py          |   4 +-
 .../python/DigitizationConfigFlags.py         |  36 --
 .../G4AtlasApps/python/SimConfigFlags.py      |   3 +-
 .../python/G4AtlasServicesConfigNew.py        |  16 +-
 .../Charginos/python/CharginosConfigNew.py    | 176 ++++++++
 .../python/ExtraParticlesConfigNew.py         |  16 +
 .../python/G4ExtraProcessesConfigNew.py       |  10 +
 .../Gauginos/python/GauginosConfigNew.py      |  30 ++
 .../Monopole/python/MonopoleConfigNew.py      | 204 +++++++++
 .../Quirks/python/QuirksConfigNew.py          |  68 +++
 .../RHadrons/python/RHadronsConfigNew.py      |  67 +++
 .../Sleptons/python/SleptonsConfigNew.py      | 422 ++++++++++++++++++
 .../python/G4StepLimitationConfigNew.py       |  10 +
 .../python/CommonSimulationSteering.py        |  15 +
 .../python/G4AtlasAlg_Skeleton.py             |   9 +-
 .../SimuJobTransforms/python/ISF_Skeleton.py  |   9 +-
 .../test_FullG4_DecayingCharginos_CGvsCA.sh   |  82 ++++
 ...st_FullG4_DecayingCharginos_busy_CGvsCA.sh |  82 ++++
 ...est_FullG4_DecayingLightSleptons_CGvsCA.sh |  82 ++++
 .../test_FullG4_DecayingNeutralinos_CGvsCA.sh |  82 ++++
 .../test/test_FullG4_DecayingStaus_CGvsCA.sh  |  82 ++++
 .../test_FullG4_StableCharginos_CGvsCA.sh     |  82 ++++
 .../test/test_FullG4_StableSleptons_CGvsCA.sh |  82 ++++
 Tools/PyUtils/python/MetaReader.py            |   3 +-
 27 files changed, 1687 insertions(+), 48 deletions(-)
 create mode 100644 InnerDetector/InDetSimUtils/TRT_TR_Process/python/TRT_TR_ProcessConfigNew.py
 create mode 100644 Simulation/G4Extensions/Charginos/python/CharginosConfigNew.py
 create mode 100644 Simulation/G4Extensions/ExtraParticles/python/ExtraParticlesConfigNew.py
 create mode 100644 Simulation/G4Extensions/G4ExtraProcesses/python/G4ExtraProcessesConfigNew.py
 create mode 100644 Simulation/G4Extensions/Gauginos/python/GauginosConfigNew.py
 create mode 100644 Simulation/G4Extensions/Monopole/python/MonopoleConfigNew.py
 create mode 100644 Simulation/G4Extensions/Quirks/python/QuirksConfigNew.py
 create mode 100644 Simulation/G4Extensions/RHadrons/python/RHadronsConfigNew.py
 create mode 100644 Simulation/G4Extensions/Sleptons/python/SleptonsConfigNew.py
 create mode 100644 Simulation/G4Utilities/G4StepLimitation/python/G4StepLimitationConfigNew.py
 create mode 100755 Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingCharginos_CGvsCA.sh
 create mode 100755 Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingCharginos_busy_CGvsCA.sh
 create mode 100755 Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingLightSleptons_CGvsCA.sh
 create mode 100755 Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingNeutralinos_CGvsCA.sh
 create mode 100755 Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingStaus_CGvsCA.sh
 create mode 100755 Simulation/Tests/SimExoticsTests/test/test_FullG4_StableCharginos_CGvsCA.sh
 create mode 100755 Simulation/Tests/SimExoticsTests/test/test_FullG4_StableSleptons_CGvsCA.sh

diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py
index b39c26cfcb11..c660f4aa85d4 100644
--- a/Control/AthenaConfiguration/python/AllConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AllConfigFlags.py
@@ -4,7 +4,7 @@ from __future__ import print_function
 
 from AthenaCommon.SystemOfUnits import TeV
 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
-from AthenaConfiguration.AutoConfigFlags import GetFileMD, getInitialTimeStampsFromRunNumbers, getRunToTimestampDict
+from AthenaConfiguration.AutoConfigFlags import GetFileMD, getInitialTimeStampsFromRunNumbers, getRunToTimestampDict, getSpecialConfigurationMetadata
 from AthenaConfiguration.Enums import ProductionStep
 from PyUtils.moduleExists import moduleExists
 
@@ -45,6 +45,7 @@ def _createCfgFlags():
     acf.addFlag('Input.ProjectName', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("project_name","data17_13TeV") ) # former global.ProjectName
     acf.addFlag('Input.Format', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("file_type","") ) # former global.InputFormat
     acf.addFlag('Input.ProcessingTags', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("processingTags","") ) # list of names of streams written to this file
+    acf.addFlag('Input.SpecialConfiguration', lambda prevFlags : getSpecialConfigurationMetadata(prevFlags.Input.Files))  # special Configuration options read from input file metadata
 
     def _inputCollections(inputFile):
         if not inputFile:
diff --git a/Control/AthenaConfiguration/python/AutoConfigFlags.py b/Control/AthenaConfiguration/python/AutoConfigFlags.py
index 757e223903cf..42e3975de906 100644
--- a/Control/AthenaConfiguration/python/AutoConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AutoConfigFlags.py
@@ -149,3 +149,53 @@ def getInitialTimeStampsFromRunNumbers(runNumbers):
     run2timestampDict =  getRunToTimestampDict()
     timeStamps = [run2timestampDict.get(runNumber,1) for runNumber in runNumbers] # Add protection here?
     return timeStamps
+
+
+def getSpecialConfigurationMetadata(inputFiles):
+    """Read in special simulation job option fragments based on metadata
+    passed by the evgen stage
+    """
+    specialConfigDict = dict()
+    legacyPreIncludeToCAPostInclude = { 'SimulationJobOptions/preInclude.AMSB.py' : 'Charginos.CharginosConfigNew.AMSB_Cfg',
+                                        'SimulationJobOptions/preInclude.Monopole.py' :  'Monopole.MonopoleConfigNew.MonopoleCfg',
+                                        'SimulationJobOptions/preInclude.Quirks.py' : 'Quirks.QuirksConfigNew.QuirksCfg',
+                                        'SimulationJobOptions/preInclude.SleptonsLLP.py' : 'Sleptons.SleptonsConfigNew.SleptonsLLPCfg',
+                                        'SimulationJobOptions/preInclude.GMSB.py' : 'Sleptons.SleptonsConfigNew.GMSB_Cfg',
+                                        'SimulationJobOptions/preInclude.Qball.py' : 'Monopole.MonopoleConfigNew.QballCfg',
+                                        'SimulationJobOptions/preInclude.RHadronsPythia8.py' : None, # FIXME
+                                        'SimulationJobOptions/preInclude.fcp.py' : 'Monopole.MonopoleConfigNew.fcpCfg' }
+    legacyPreIncludeToCAPreInclude = { 'SimulationJobOptions/preInclude.AMSB.py' : None,
+                                       'SimulationJobOptions/preInclude.Monopole.py' :  'Monopole.MonopoleConfigNew.MonopolePreInclude',
+                                       'SimulationJobOptions/preInclude.Quirks.py' : None,
+                                       'SimulationJobOptions/preInclude.SleptonsLLP.py' : None,
+                                       'SimulationJobOptions/preInclude.GMSB.py' : None,
+                                       'SimulationJobOptions/preInclude.Qball.py' : 'Monopole.MonopoleConfigNew.QballPreInclude',
+                                       'SimulationJobOptions/preInclude.RHadronsPythia8.py' : None, # FIXME
+                                       'SimulationJobOptions/preInclude.fcp.py' : 'Monopole.MonopoleConfigNew.fcpPreInclude' }
+    if len(inputFiles)>0:
+        from AthenaConfiguration.AutoConfigFlags import GetFileMD
+        specialConfigString = GetFileMD(inputFiles).get('specialConfiguration', '')
+        ## Parse the specialConfiguration string
+        ## Format is 'key1=value1;key2=value2;...'. or just '
+        spcitems = specialConfigString.split(";")
+        for spcitem in spcitems:
+            #print spcitem
+            ## Ignore empty or "NONE" substrings, e.g. from consecutive or trailing semicolons
+            if not spcitem or spcitem.upper() == "NONE":
+                continue
+            ## If not in key=value format, treat as v, with k="preInclude"
+            if "=" not in spcitem:
+                spcitem = "preInclude=" + spcitem
+            ## Handle k=v directives
+            k, v = spcitem.split("=")
+            if k == "preInclude" and v.endswith('.py'): # Translate old preIncludes into CA-based versions.
+                v1 = legacyPreIncludeToCAPreInclude[v]
+                if v1 is not None:
+                    specialConfigDict[k] = v1
+                v2 = legacyPreIncludeToCAPostInclude[v]
+                if v2 is not None:
+                    specialConfigDict['postInclude'] = v2
+            else:
+                specialConfigDict[k] = v
+    return specialConfigDict
+
diff --git a/InnerDetector/InDetSimUtils/TRT_TR_Process/python/TRT_TR_ProcessConfigNew.py b/InnerDetector/InDetSimUtils/TRT_TR_Process/python/TRT_TR_ProcessConfigNew.py
new file mode 100644
index 000000000000..1415ebd148f5
--- /dev/null
+++ b/InnerDetector/InDetSimUtils/TRT_TR_Process/python/TRT_TR_ProcessConfigNew.py
@@ -0,0 +1,10 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+
+def TRTPhysicsToolCfg(flags, name="TRTPhysicsTool", **kwargs):
+    result = ComponentAccumulator()
+    #Add any future configuration here
+    result.setPrivateTools(CompFactory.TRTPhysicsTool(name, **kwargs))
+    return result
diff --git a/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py b/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py
index 07fdbf54bd02..10fb49fa338e 100644
--- a/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MDT_DigitizationConfig.py
@@ -48,7 +48,7 @@ def RT_Relation_DB_DigiToolCfg(flags, name="RT_Relation_DB_DigiTool", **kwargs):
 def MDT_Response_DigiToolCfg(flags, name="MDT_Response_DigiTool",**kwargs):
     """Return a configured MDT_Response_DigiTool"""
     acc = ComponentAccumulator()
-    QballConfig = (flags.Digitization.SpecialConfiguration.get("MDT_QballConfig", "False") == "True")
+    QballConfig = (flags.Input.SpecialConfiguration.get("MDT_QballConfig", "False") == "True")
     kwargs.setdefault("DoQballGamma", QballConfig)
     MDT_Response_DigiTool = CompFactory.MDT_Response_DigiTool
     acc.setPrivateTools(MDT_Response_DigiTool(name, **kwargs))
@@ -68,7 +68,7 @@ def MDT_DigitizationToolCommonCfg(flags, name="MdtDigitizationTool", **kwargs):
     # "RT_Relation_DB_DigiTool" in jobproperties.Digitization.experimentalDigi() not migrated
     digiTool = acc.popToolsAndMerge(MDT_Response_DigiToolCfg(flags))
     kwargs.setdefault("DigitizationTool", digiTool)
-    QballConfig = (flags.Digitization.SpecialConfiguration.get("MDT_QballConfig") == "True")
+    QballConfig = (flags.Input.SpecialConfiguration.get("MDT_QballConfig", "False") == "True")
     kwargs.setdefault("DoQballCharge", QballConfig)
     if flags.Digitization.DoXingByXingPileUp:
         kwargs.setdefault("FirstXing", MDT_FirstXing())
diff --git a/Simulation/Digitization/python/DigitizationConfigFlags.py b/Simulation/Digitization/python/DigitizationConfigFlags.py
index ade5f68cdd5e..c9ac25302111 100644
--- a/Simulation/Digitization/python/DigitizationConfigFlags.py
+++ b/Simulation/Digitization/python/DigitizationConfigFlags.py
@@ -5,40 +5,6 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
 from AthenaConfiguration.AutoConfigFlags import GetFileMD
 from AthenaConfiguration.Enums import ProductionStep
-from AthenaCommon.Logging import log
-from PyUtils import AthFile
-
-
-def getSpecialConfiguration(flags):
-    """Return a dict of Special configuration as parsed from flags.Input.Files"""
-    if len(flags.Input.Files) > 1:
-        log.info("Multiple input files. Using the first for Digitization special configuration.")
-    log.info("Obtaining Digitization special configuration from %s", flags.Input.Files[0])
-    File = AthFile.fopen(flags.Input.Files[0])
-    # extract the special config list
-    tag_info = File.infos.get("tag_info", {})
-    SpecialCfg = tag_info.get("specialConfiguration", "").split(";")
-    # fill containers
-    preIncludes = []
-    out = {}
-    for KeyEqValue in SpecialCfg:
-        # Ignore empty or "NONE" substrings, e.g. from consecutive or trailing semicolons
-        if not KeyEqValue or KeyEqValue.upper() == "NONE":
-            continue
-        # If not in key=value format, treat as v, with k="preInclude"
-        if "=" not in KeyEqValue:
-            KeyEqValue = "preInclude=" + KeyEqValue
-        # Handle k=v directives
-        key, value = KeyEqValue.split("=")
-        if key == "preInclude":
-            preIncludes += value.split(",")
-        else:
-            out[key] = value
-    # FIXME includes not migrated
-    # from AthenaCommon.Include import include
-    # for inc in preIncludes:
-    #     include(inc)
-    return out
 
 
 def constBunchSpacingPattern(constBunchSpacing):
@@ -73,8 +39,6 @@ def createDigitizationCfgFlags():
     flags.addFlag("Digitization.DoInnerDetectorNoise", True)
     # Run pile-up digitization on one bunch crossing at a time?
     flags.addFlag("Digitization.DoXingByXingPileUp", False)
-    # Special configuration read from flags.Input.Files
-    flags.addFlag("Digitization.SpecialConfiguration", getSpecialConfiguration)
     # Run Calorimeter noise simulation
     flags.addFlag("Digitization.DoCaloNoise", True)
     # Compute and store DigiTruth information
diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
index b65b45fef5d4..136f06d7bfc9 100644
--- a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
+++ b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
@@ -52,7 +52,8 @@ def createSimConfigFlags():
             raise ValueError("Unknown G4 version")
         return version
 
-    scf.addFlag("Sim.G4Version", _check_G4_version)
+    scf.addFlag("Sim.G4Version", lambda prevFlags : _check_G4_version(prevFlags))
+
     scf.addFlag("Sim.PhysicsList", "FTFP_BERT_ATL")
     scf.addFlag("Sim.NeutronTimeCut", 150.) # Sets the value for the neutron out of time cut in G4
     scf.addFlag("Sim.NeutronEnergyCut", -1.) # Sets the value for the neutron energy cut in G4
diff --git a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfigNew.py b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfigNew.py
index 03bf6b2c0b6e..1afb52cade10 100644
--- a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfigNew.py
+++ b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfigNew.py
@@ -5,6 +5,10 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 
 DetectorGeometrySvc, G4AtlasSvc, G4GeometryNotifierSvc, PhysicsListSvc=CompFactory.getComps("DetectorGeometrySvc","G4AtlasSvc","G4GeometryNotifierSvc","PhysicsListSvc",)
 from G4AtlasTools.G4GeometryToolConfig import G4AtlasDetectorConstructionToolCfg
+from G4StepLimitation.G4StepLimitationConfigNew import G4StepLimitationToolCfg
+from ExtraParticles.ExtraParticlesConfigNew import ExtraParticlesPhysicsToolCfg
+from G4ExtraProcesses.G4ExtraProcessesConfigNew import G4EMProcessesPhysicsToolCfg
+from TRT_TR_Process.TRT_TR_ProcessConfigNew import TRTPhysicsToolCfg
 
 def DetectorGeometrySvcCfg(ConfigFlags, name="DetectorGeometrySvc", **kwargs):
     result = ComponentAccumulator()
@@ -34,17 +38,19 @@ def G4GeometryNotifierSvcCfg(ConfigFlags, name="G4GeometryNotifierSvc", **kwargs
 
 def PhysicsListSvcCfg(ConfigFlags, name="PhysicsListSvc", **kwargs):
     result = ComponentAccumulator()
-    G4StepLimitationTool = CompFactory.G4StepLimitationTool
-    PhysOptionList = [G4StepLimitationTool("G4StepLimitationTool")]
+    PhysOptionList = [ result.popToolsAndMerge(G4StepLimitationToolCfg(ConfigFlags)) ]
+    if 'QS' in ConfigFlags.Sim.ISF.Simulator or 'LongLived' in ConfigFlags.Sim.ISF.Simulator:
+        #Quasi stable particle simulation
+        PhysOptionList += [ result.popToolsAndMerge(ExtraParticlesPhysicsToolCfg(ConfigFlags)) ] # FIXME more configuration required in this method
+        PhysOptionList += [ result.popToolsAndMerge(G4EMProcessesPhysicsToolCfg(ConfigFlags)) ]
     #PhysOptionList += ConfigFlags.Sim.PhysicsOptions # FIXME Missing functionality
-    PhysDecaysList = []
     if ConfigFlags.Detector.GeometryTRT:
-        TRTPhysicsTool = CompFactory.TRTPhysicsTool
-        PhysOptionList +=[TRTPhysicsTool("TRTPhysicsTool")]
+        PhysOptionList +=[ result.popToolsAndMerge(TRTPhysicsToolCfg(ConfigFlags)) ]
     if ConfigFlags.Detector.GeometryLucid or ConfigFlags.Detector.GeometryAFP:
         LucidPhysicsTool = CompFactory.LucidPhysicsTool
         PhysOptionList +=[LucidPhysicsTool("LucidPhysicsTool")]
     kwargs.setdefault("PhysOption", PhysOptionList)
+    PhysDecaysList = []
     kwargs.setdefault("PhysicsDecay", PhysDecaysList)
     kwargs.setdefault("PhysicsList", ConfigFlags.Sim.PhysicsList)
     if 'PhysicsList' in kwargs:
diff --git a/Simulation/G4Extensions/Charginos/python/CharginosConfigNew.py b/Simulation/G4Extensions/Charginos/python/CharginosConfigNew.py
new file mode 100644
index 000000000000..3222b499b088
--- /dev/null
+++ b/Simulation/G4Extensions/Charginos/python/CharginosConfigNew.py
@@ -0,0 +1,176 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.AccumulatorCache import AccumulatorCache
+import shutil, re
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaCommon.SystemOfUnits import MeV, ns, GeV # noqa: F401
+from AthenaConfiguration.Enums import ProductionStep
+from ExtraParticles.PDGHelpers import getPDGTABLE
+from G4AtlasServices.G4AtlasServicesConfigNew import PhysicsListSvcCfg
+
+
+@AccumulatorCache
+def get_and_fix_PDGTABLE_AMSB(replace):
+
+    # Download generic PDGTABLE (overwrite existing one if it exists)
+    if getPDGTABLE('PDGTABLE.MeV'):
+        shutil.move('PDGTABLE.MeV', 'PDGTABLE.MeV.org')
+
+        # an example line to illustrate the fixed format, see PDGTABLE.MeV for more details
+        # M 1000022                          0.E+00         +0.0E+00 -0.0E+00 ~chi(0,1)     0
+
+        lines = open('PDGTABLE.MeV.org').readlines()
+        for pdgid,mass,name,charge in replace:
+            if not re.search(r'[MW]\s+'+str(pdgid)+r'\s+\S+', ''.join(lines)):
+                lines.append('M' + str(pdgid).rjust(8) +''.ljust(26) +
+                             ('%11.5E' % mass).ljust(15) +
+                             '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+                lines.append('W' + str(pdgid).rjust(8) +''.ljust(26) +
+                             '0.E+00'.ljust(15) + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+            else:
+                from past.builtins import xrange # Temporary workaround for python3 compatibility use range in CA-based config
+                for i in xrange(len(lines)):
+                    if re.search(r'M\s+'+str(pdgid)+r'\s+\S+', lines[i]):
+                        l = lines[i]
+                        lines[i] = l[0:35] + ('%11.5E' % mass).ljust(14) + l[49:]
+
+        update = open('PDGTABLE.MeV', 'w')
+        update.write(''.join(lines))
+        update.close()
+
+
+def CharginosPhysicsToolCfg(flags, name="CharginosPhysicsTool", **kwargs):
+    result = ComponentAccumulator()
+    # Example specialConfiguration: {'AMSBC1Mass': '1200.16*GeV', 'AMSBN1Mass': '1200.0*GeV', 'AMSBC1Lifetime': '0.2*ns'}
+    C1Mass = eval(flags.Input.SpecialConfiguration.get("AMSBC1Mass", None))
+    N1Mass = eval(flags.Input.SpecialConfiguration.get("AMSBN1Mass", None))
+    C1Lifetime = eval(flags.Input.SpecialConfiguration.get("AMSBC1Lifetime", "-1.0"))
+
+    kwargs.setdefault("CharginoPlusMass", C1Mass)
+    kwargs.setdefault("CharginoPlusStable",      (C1Lifetime < 0))
+    if not (C1Lifetime < 0):
+        kwargs.setdefault("CharginoPlusLifetime",    C1Lifetime)
+
+    kwargs.setdefault("CharginoMinusMass", C1Mass)
+    kwargs.setdefault("CharginoMinusStable",      (C1Lifetime < 0))
+    if not (C1Lifetime < 0):
+        kwargs.setdefault("CharginoMinusLifetime",    C1Lifetime)
+
+    kwargs.setdefault("NeutralinoMass",          N1Mass)
+
+    result.setPrivateTools(CompFactory.CharginosPhysicsTool(name, **kwargs))
+    return result
+
+
+def CharginoPlusToPiPlusNeutralinoCfg(flags, name="CharginoPlusToPiPlusNeutralino", **kwargs):
+    result = ComponentAccumulator()
+    C1ToPiBR = 1.0
+    C1ToEleBR = eval(flags.Input.SpecialConfiguration.get("AMSBC1ToEleBR", "-1.0"))
+    if C1ToEleBR > 0.0:
+        C1ToPiBR -= C1ToEleBR
+    C1ToMuBR = eval(flags.Input.SpecialConfiguration.get("AMSBC1ToMuBR", "-1.0"))
+    if C1ToMuBR > 0.0:
+        C1ToPiBR -= C1ToMuBR
+    kwargs.setdefault("ParticleName","s_chi_plus_1")
+    kwargs.setdefault("BR",C1ToPiBR) #Branching Ratio
+    kwargs.setdefault("Daughters","s_chi_0_1,pi+")
+    result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
+    return result
+
+
+def CharginoMinusToPiMinusNeutralinoCfg(flags, name="CharginoMinusToPiMinusNeutralino", **kwargs):
+    result = ComponentAccumulator()
+    C1ToPiBR = 1.0
+    C1ToEleBR = eval(flags.Input.SpecialConfiguration.get("AMSBC1ToEleBR", "-1.0"))
+    if C1ToEleBR > 0.0:
+        C1ToPiBR -= C1ToEleBR
+    C1ToMuBR = eval(flags.Input.SpecialConfiguration.get("AMSBC1ToMuBR", "-1.0"))
+    if C1ToMuBR > 0.0:
+        C1ToPiBR -= C1ToMuBR
+    kwargs.setdefault("ParticleName","s_chi_minus_1")
+    kwargs.setdefault("BR",C1ToPiBR) #Branching Ratio
+    kwargs.setdefault("Daughters","s_chi_0_1,pi-")
+    result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
+    return result
+
+
+def CharginoPlusToEPlusNeutralinoCfg(flags, name="CharginoPlusToEPlusNeutralino", **kwargs):
+    result = ComponentAccumulator()
+    C1ToEBR = 0.0
+    C1ToEleBR = eval(flags.Input.SpecialConfiguration.get("AMSBC1ToEleBR", "-1.0"))
+    if C1ToEleBR > 0.0:
+        C1ToEBR = C1ToEleBR
+    kwargs.setdefault("ParticleName","s_chi_plus_1")
+    kwargs.setdefault("BR",C1ToEBR) #Branching Ratio
+    kwargs.setdefault("Daughters","s_chi_0_1,nu_e,e+")
+    result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
+    return result
+
+
+def CharginoMinusToEMinusNeutralinoCfg(flags, name="CharginoMinusToEMinusNeutralino", **kwargs):
+    result = ComponentAccumulator()
+    C1ToEBR = 0.0
+    C1ToEleBR = eval(flags.Input.SpecialConfiguration.get("AMSBC1ToEleBR", "-1.0"))
+    if C1ToEleBR > 0.0:
+        C1ToEBR = C1ToEleBR
+    kwargs.setdefault("ParticleName","s_chi_minus_1")
+    kwargs.setdefault("BR",C1ToEBR) #Branching Ratio
+    kwargs.setdefault("Daughters","s_chi_0_1,anti_nu_e,e-")
+    result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
+    return result
+
+
+def CharginoPlusToMuPlusNeutralinoCfg(flags, name="CharginoPlusToMuPlusNeutralino", **kwargs):
+    result = ComponentAccumulator()
+    C1ToMuonBR = 0.0
+    C1ToMuBR = eval(flags.Input.SpecialConfiguration.get("AMSBC1ToMuBR", "-1.0"))
+    if C1ToMuBR > 0.0:
+        C1ToMuonBR = C1ToMuBR
+    kwargs.setdefault("ParticleName","s_chi_plus_1")
+    kwargs.setdefault("BR",C1ToMuonBR) #Branching Ratio
+    kwargs.setdefault("Daughters","s_chi_0_1,nu_mu,mu+")
+    result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
+    return result
+
+
+def CharginoMinusToMuMinusNeutralinoCfg(flags, name="CharginoMinusToMuMinusNeutralino", **kwargs):
+    result = ComponentAccumulator()
+    C1ToMuonBR = 0.0
+    C1ToMuBR = eval(flags.Input.SpecialConfiguration.get("AMSBC1ToMuBR", "-1.0"))
+    if C1ToMuBR > 0.0:
+        C1ToMuonBR = C1ToMuBR
+    kwargs.setdefault("ParticleName","s_chi_minus_1")
+    kwargs.setdefault("BR",C1ToMuonBR) #Branching Ratio
+    kwargs.setdefault("Daughters","s_chi_0_1,anti_nu_mu,mu-")
+    result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
+    return result
+
+
+def AMSB_Cfg(flags):
+    result = ComponentAccumulator()
+    C1Mass = eval(flags.Input.SpecialConfiguration["AMSBC1Mass"])
+    N1Mass = eval(flags.Input.SpecialConfiguration["AMSBN1Mass"])
+    # patching PDGTABLE
+    get_and_fix_PDGTABLE_AMSB([(1000022, N1Mass, '~chi(0,1)', '0'), (1000024, C1Mass, '~chi(+,1)', '+')])
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+        result.merge(PhysicsListSvcCfg(flags))
+        physicsOptions = [ result.popToolsAndMerge(CharginosPhysicsToolCfg(flags)) ]
+        # Add Chargino decays if necessary
+        C1Lifetime = eval(flags.Input.SpecialConfiguration.get("AMSBC1Lifetime", "-1.0"))
+        if C1Lifetime > 0.0:
+            physicsOptions += [ result.popToolsAndMerge(CharginoPlusToPiPlusNeutralinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(CharginoMinusToPiMinusNeutralinoCfg(flags)) ]
+            C1ToEleBR = eval(flags.Input.SpecialConfiguration.get("AMSBC1ToEleBR", "-1.0"))
+            if C1ToEleBR > 0.0:
+                physicsOptions += [ result.popToolsAndMerge(CharginoPlusToEPlusNeutralinoCfg(flags)) ]
+                physicsOptions += [ result.popToolsAndMerge(CharginoMinusToEMinusNeutralinoCfg(flags)) ]
+            C1ToMuBR = eval(flags.Input.SpecialConfiguration.get("AMSBC1ToMuBR", "-1.0"))
+            if C1ToMuBR > 0.0:
+                physicsOptions += [ result.popToolsAndMerge(CharginoPlusToMuPlusNeutralinoCfg(flags)) ]
+                physicsOptions += [ result.popToolsAndMerge(CharginoMinusToMuMinusNeutralinoCfg(flags)) ]
+        result.getService("PhysicsListSvc").PhysOption += physicsOptions
+
+    return result
diff --git a/Simulation/G4Extensions/ExtraParticles/python/ExtraParticlesConfigNew.py b/Simulation/G4Extensions/ExtraParticles/python/ExtraParticlesConfigNew.py
new file mode 100644
index 000000000000..1c9f4b004f28
--- /dev/null
+++ b/Simulation/G4Extensions/ExtraParticles/python/ExtraParticlesConfigNew.py
@@ -0,0 +1,16 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from ExtraParticles import PDGHelpers
+
+def ExtraParticlesPhysicsToolCfg(flags, name="ExtraParticlesPhysicsTool", **kwargs):
+    result = ComponentAccumulator()
+    if PDGHelpers.getPDGTABLE('PDGTABLE.MeV'): # FIXME This should be a ConfigFlag
+        parser = PDGHelpers.PDGParser('PDGTABLE.MeV', #flags.ExtraParticlesPDGTABLE,
+                                      '111-556,1112-9090226') #flags.ExtraParticlesRanges) # FIXME need to add these as flags?
+        kwargs.setdefault("ExtraParticlesConfig", parser.createList())
+    else:
+        print ('ERROR Failed to find PDGTABLE.MeV file') # FIXME raise exception here
+    result.setPrivateTools(CompFactory.ExtraParticlesPhysicsTool(name, **kwargs))
+    return result
diff --git a/Simulation/G4Extensions/G4ExtraProcesses/python/G4ExtraProcessesConfigNew.py b/Simulation/G4Extensions/G4ExtraProcesses/python/G4ExtraProcessesConfigNew.py
new file mode 100644
index 000000000000..ac4095802205
--- /dev/null
+++ b/Simulation/G4Extensions/G4ExtraProcesses/python/G4ExtraProcessesConfigNew.py
@@ -0,0 +1,10 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+
+def G4EMProcessesPhysicsToolCfg(flags, name="G4EMProcessesPhysicsTool", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleList", [5132]) # In future this should be made configurable
+    result.setPrivateTools(CompFactory.G4EMProcessesPhysicsTool(name, **kwargs))
+    return result
diff --git a/Simulation/G4Extensions/Gauginos/python/GauginosConfigNew.py b/Simulation/G4Extensions/Gauginos/python/GauginosConfigNew.py
new file mode 100644
index 000000000000..42967cfb8636
--- /dev/null
+++ b/Simulation/G4Extensions/Gauginos/python/GauginosConfigNew.py
@@ -0,0 +1,30 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaCommon.SystemOfUnits import GeV,ns # noqa: F401
+
+
+def GauginosPhysicsToolCfg(flags, name="GauginosPhysicsTool", **kwargs):
+    result = ComponentAccumulator()
+    # Example specialConfiguration {'GMSBSlepton': '100.0*GeV', 'GMSBGravitino': '1e-07*GeV', 'GMSBSleptonTime': '0.01*ns'}
+    GMSBNeutralino = eval(flags.Input.SpecialConfiguration.get("GMSBNeutralino", "0*GeV"))
+    GMSBTime = eval(flags.Input.SpecialConfiguration.get("GMSBLifeTime", "0*GeV"))
+    kwargs.setdefault("NeutralinoMass",        GMSBNeutralino)
+    kwargs.setdefault("NeutralinoStable",      False)
+    kwargs.setdefault("NeutralinoLifetime",    GMSBTime)
+
+    if "GMSBGravitino" in flags.Input.SpecialConfiguration:
+        GMSBGravitino = eval(flags.Input.SpecialConfiguration.get("GMSBGravitino", "0*GeV"))
+        kwargs.setdefault("GravitinoMass",       GMSBGravitino)
+    result.setPrivateTools( CompFactory.GauginosPhysicsTool(name, **kwargs) )
+    return result
+
+
+def NeutralinoToPhotonGravitinoCfg(flags, name="NeutralinoToPhotonGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_chi_0_1")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,gamma")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
diff --git a/Simulation/G4Extensions/Monopole/python/MonopoleConfigNew.py b/Simulation/G4Extensions/Monopole/python/MonopoleConfigNew.py
new file mode 100644
index 000000000000..feaae761e1fc
--- /dev/null
+++ b/Simulation/G4Extensions/Monopole/python/MonopoleConfigNew.py
@@ -0,0 +1,204 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.AccumulatorCache import AccumulatorCache
+import os
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.Enums import ProductionStep
+from G4AtlasServices.G4AtlasServicesConfigNew import PhysicsListSvcCfg
+from ExtraParticles.PDGHelpers import getPDGTABLE
+
+
+@AccumulatorCache
+def load_files_for_monopole_scenario(MASS, GCHARGE):
+    if getPDGTABLE('PDGTABLE.MeV'):
+        ALINE1="M 4110000                         {intmass}.E+03       +0.0E+00 -0.0E+00 Monopole         0".format(intmass=int(MASS))
+        ALINE2="W 4110000                          0.E+00         +0.0E+00 -0.0E+00 Monopole         0"
+        BLINE1="4110000 {intmass}.00 0.0 {gcharge} # Monopole".format(intmass=int(MASS), gcharge=GCHARGE)
+        BLINE2="-4110000 {intmass}.00 0.0 -{gcharge} # MonopoleBar".format(intmass=int(MASS), gcharge=GCHARGE)
+
+        f=open('PDGTABLE.MeV','a')
+        f.writelines(str(ALINE1))
+        f.writelines('\n')
+        f.writelines(str(ALINE2))
+        f.writelines('\n')
+        f.close()
+        partmod = os.path.isfile('particles.txt')
+        if partmod is True:
+            os.remove('particles.txt')
+        f=open('particles.txt','w')
+        f.writelines(str(BLINE1))
+        f.writelines('\n')
+        f.writelines(str(BLINE2))
+        f.writelines('\n')
+        f.close()
+
+        del ALINE1
+        del ALINE2
+        del BLINE1
+        del BLINE2
+
+
+@AccumulatorCache
+def load_files_for_qball_scenario(MASS, CHARGE):
+    if getPDGTABLE('PDGTABLE.MeV'):
+        CODE=10000000+int(float(CHARGE)*100)
+
+        ALINE1="M {code}                         {intmass}.E+03       +0.0E+00 -0.0E+00 Qball           +".format(code=CODE,intmass=int(MASS))
+        ALINE2="W {code}                         0.E+00         +0.0E+00 -0.0E+00 Qball           +".format(code=CODE)
+        BLINE1="{code}  {intmass}.00  {charge}  0.0 # Qball".format(code=CODE,intmass=int(MASS), charge=CHARGE)
+        BLINE2="-{code}  {intmass}.00  -{charge}  0.0 # QballBar".format(code=CODE,intmass=int(MASS), charge=CHARGE)
+
+        f=open('PDGTABLE.MeV','a')
+        f.writelines(str(ALINE1))
+        f.writelines('\n')
+        f.writelines(str(ALINE2))
+        f.writelines('\n')
+        f.close()
+        partmod = os.path.isfile('particles.txt')
+        if partmod is True:
+            os.remove('particles.txt')
+        f=open('particles.txt','w')
+        f.writelines(str(BLINE1))
+        f.writelines('\n')
+        f.writelines(str(BLINE2))
+        f.writelines('\n')
+        f.close()
+
+        del ALINE1
+        del ALINE2
+        del BLINE1
+        del BLINE2
+
+
+@AccumulatorCache
+def load_files_for_fcp_scenario(MASS, CHARGE, X, Y):
+    CODE=int(20000000)+int(X)*1000+int(Y)*10
+    print("Trying to load %s, %s for particle with code %s" % (X, Y, CODE))
+
+    pdgLine1="M {code}                         {intmass}.E+03       +0.0E+00 -0.0E+00 fcp           +\n".format(code=CODE,intmass=int(MASS))
+    pdgLine2="W {code}                         0.E+00         +0.0E+00 -0.0E+00 fcp           +\n".format(code=CODE)
+    particleLine1="{code}  {intmass}.00  {fcharge}  0.0 # fcp\n".format(code=CODE,intmass=int(MASS), fcharge=float(CHARGE))
+    particleLine2="-{code}  {intmass}.00  -{fcharge}  0.0 # fcpBar\n".format(code=CODE,intmass=int(MASS), fcharge=float(CHARGE))
+
+    # retreive the PDGTABLE file
+    if getPDGTABLE('PDGTABLE.MeV'):
+        f=open('PDGTABLE.MeV','a')
+        f.writelines(str(pdgLine1))
+        f.writelines(str(pdgLine2))
+        f.close()
+        partmod = os.path.isfile('particles.txt')
+        if partmod is True:
+            os.remove('particles.txt')
+        f=open('particles.txt','w')
+        f.writelines(str(particleLine1))
+        f.writelines(str(particleLine2))
+        f.close()
+
+    del pdgLine1
+    del pdgLine2
+    del particleLine1
+    del particleLine2
+
+
+def MonopolePhysicsToolCfg(flags, name="MonopolePhysicsTool", **kwargs):
+    result = ComponentAccumulator()
+    result.setPrivateTools( CompFactory.MonopolePhysicsTool(name, **kwargs) )
+    return result
+
+
+def G4mplEqMagElectricFieldToolCfg(flags, name="G4mplEqMagElectricField", **kwargs):
+    result = ComponentAccumulator()
+    result.setPrivateTools( CompFactory.G4mplEqMagElectricFieldTool(name, **kwargs) )
+    return result
+
+
+def fcpPreInclude(flags):
+    simdict = flags.Input.SpecialConfiguration
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+        if "InteractingPDGCodes" not in simdict: #FIXME This code would ideally update the ConfigFlag itself
+            assert "CHARGE" in simdict
+            assert "X" in simdict
+            assert "Y" in simdict
+            CODE=int(20000000)+int(simdict["X"])*1000+int(simdict["Y"])*10
+            simdict['InteractingPDGCodes'] = str([CODE,-1*CODE])
+
+
+def fcpCfg(flags):
+    result = ComponentAccumulator()
+    simdict = flags.Input.SpecialConfiguration
+    load_files_for_fcp_scenario(simdict["MASS"], simdict["CHARGE"], simdict["X"], simdict["Y"])
+
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+        result.merge(PhysicsListSvcCfg(flags))
+        physicsOptions = [ result.popToolsAndMerge(MonopolePhysicsToolCfg(flags)) ]
+        result.getService("PhysicsListSvc").PhysOption += physicsOptions
+        # add monopole-specific configuration for looper killer
+        #simFlags.OptionalUserActionList.addAction('G4UA::MonopoleLooperKillerTool') #FIXME missing functionality
+        # add default HIP killer
+        #simFlags.OptionalUserActionList.addAction('G4UA::HIPKillerTool') #FIXME missing functionality
+
+    return result
+
+
+def QballPreInclude(flags):
+    simdict = flags.Input.SpecialConfiguration
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+            if "InteractingPDGCodes" not in simdict:
+                assert "CHARGE" in simdict
+                CODE=10000000+int(float(simdict["CHARGE"])*100)
+                simdict['InteractingPDGCodes'] = str([CODE,-1*CODE])
+
+
+def QballCfg(flags):
+    result = ComponentAccumulator()
+    simdict = flags.Input.SpecialConfiguration
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+            if "InteractingPDGCodes" not in simdict:
+                assert "CHARGE" in simdict
+                CODE=10000000+int(float(simdict["CHARGE"])*100)
+                simdict['InteractingPDGCodes'] = str([CODE,-1*CODE])
+
+    assert "MASS" in simdict
+    assert "CHARGE" in simdict
+    load_files_for_qball_scenario(simdict["MASS"], simdict["CHARGE"])
+
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+        result.merge(PhysicsListSvcCfg(flags))
+        physicsOptions = [ result.popToolsAndMerge(MonopolePhysicsToolCfg(flags)) ]
+        result.getService("PhysicsListSvc").PhysOption += physicsOptions
+        # add monopole-specific configuration for looper killer
+        #simFlags.OptionalUserActionList.addAction('G4UA::MonopoleLooperKillerTool') #FIXME missing functionality
+        # add default HIP killer
+        #simFlags.OptionalUserActionList.addAction('G4UA::HIPKillerTool') #FIXME missing functionality
+
+    return result
+
+
+def MonopolePreInclude(flags):
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+        flags.Sim.G4Stepper = 'ClassicalRK4'
+        flags.Sim.G4EquationOfMotion = "G4mplEqMagElectricField" #Monopole Equation of Motion
+        flags.Sim.TightMuonStepping = False
+        simdict = flags.Input.SpecialConfiguration
+        if "InteractingPDGCodes" not in simdict:
+            simdict['InteractingPDGCodes'] = str([4110000,-4110000])
+
+
+def MonopoleCfg(flags):
+    result = ComponentAccumulator()
+    simdict = flags.Input.SpecialConfiguration
+
+    assert "MASS" in simdict
+    assert "CHARGE" in simdict
+    load_files_for_qball_scenario(simdict["MASS"], simdict["CHARGE"])
+
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+        result.merge(PhysicsListSvcCfg(flags))
+        physicsOptions = [ result.popToolsAndMerge(MonopolePhysicsToolCfg(flags)) ]
+        result.getService("PhysicsListSvc").PhysOption += physicsOptions
+        # add monopole-specific configuration for looper killer
+        #simFlags.OptionalUserActionList.addAction('G4UA::MonopoleLooperKillerTool') #FIXME missing functionality
+        # add default HIP killer
+        #simFlags.OptionalUserActionList.addAction('G4UA::HIPKillerTool') #FIXME missing functionality
+    return result
diff --git a/Simulation/G4Extensions/Quirks/python/QuirksConfigNew.py b/Simulation/G4Extensions/Quirks/python/QuirksConfigNew.py
new file mode 100644
index 000000000000..5af9618dfcb9
--- /dev/null
+++ b/Simulation/G4Extensions/Quirks/python/QuirksConfigNew.py
@@ -0,0 +1,68 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.AccumulatorCache import AccumulatorCache
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.Enums import ProductionStep
+from G4AtlasServices.G4AtlasServicesConfigNew import PhysicsListSvcCfg
+
+
+@AccumulatorCache
+def load_files_for_quirks_scenario(flags):
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE('PDGTABLE.MeV'):
+        quirk_firststring=1e-6 #mm
+        quirk_maxboost=1e-2
+        quirk_maxmerge=1e-6 #mm
+        quirk_debugenabled=False
+        quirk_debugdist=1000 #mm
+        quirk_debugsteps=1000
+        simdict = flags.Input.SpecialConfiguration
+        quirk_mass = float(simdict["MASS"])
+        quirk_charge = float(simdict["CHARGE"])
+        quirk_pdgid = int(simdict["PDGID"])
+        quirk_stringforce = float(simdict["STRINGFORCE"])
+
+        f = open('PDGTABLE.MeV', 'a')
+        f.write("M%8d                          %.8E +0.0E+00 -0.0E+00 Quirk               +\n" % (quirk_pdgid, quirk_mass))
+        f.write("W%8d                          0.E+00         +0.0E+00 -0.0E+00 Quirk               +\n" % quirk_pdgid)
+        f.close()
+
+        if flags.Common.ProductionStep == ProductionStep.Simulation:
+            f = open('quirks_setup.txt', 'w')
+            for x in [quirk_mass, quirk_charge, quirk_pdgid, quirk_stringforce, quirk_firststring, quirk_maxboost, quirk_maxmerge, quirk_maxmerge]:
+                f.write(repr(x) + "\n")
+            if quirk_debugenabled:
+                f.write("1\n")
+                f.write(repr(quirk_debugdist) + "\n")
+                f.write(repr(quirk_debugsteps) + "\n")
+            else:
+                f.write("0\n")
+            f.close()
+        del quirk_firststring, quirk_maxboost, quirk_maxmerge, quirk_debugenabled, quirk_debugdist, quirk_debugsteps, doG4SimConfig, simdict, f, quirk_mass, quirk_charge, quirk_pdgid, quirk_stringforce
+
+
+def QuirkPhysicsToolCfg(flags, name="QuirkPhysicsTool", **kwargs):
+    result = ComponentAccumulator()
+    result.setPrivateTools( CompFactory.QuirkPhysicsToolTool(name, **kwargs) )
+    return result
+
+
+## def getDebugSteppingActionTool(name="G4UA::DebugSteppingActionTool", **kwargs): # FIXME missing functionality
+##     from Quirks.QuirksConf import G4UA__DebugSteppingActionTool
+##     from G4AtlasApps.SimFlags import simFlags
+##     # use configuration passed through the flags
+##     if name in simFlags.UserActionConfig.get_Value().keys():
+##         for prop,value in simFlags.UserActionConfig.get_Value()[name].iteritems():
+##             kwargs.setdefault(prop,value)
+##
+##     return G4UA__DebugSteppingActionTool(name, **kwargs)
+
+
+def QuirksCfg(flags):
+    result = ComponentAccumulator()
+    load_files_for_quirks_scenario(flags)
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+        result.merge(PhysicsListSvcCfg(flags))
+        result.getService("PhysicsListSvc").PhysOption += [ result.popToolsAndMerge(QuirkPhysicsToolCfg(flags)) ]
+    return result
diff --git a/Simulation/G4Extensions/RHadrons/python/RHadronsConfigNew.py b/Simulation/G4Extensions/RHadrons/python/RHadronsConfigNew.py
new file mode 100644
index 000000000000..109f953f4d1a
--- /dev/null
+++ b/Simulation/G4Extensions/RHadrons/python/RHadronsConfigNew.py
@@ -0,0 +1,67 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaCommon import Logging
+import os
+
+rhlog = Logging.logging.getLogger('RHadronConfig')
+
+def create_rhadron_particles_file(input_param_card='SLHA_INPUT.DAT',spectrum=1):
+    """Create a list of particles for custom particle creation"""
+    # Just use our helper function
+    from RHadrons.RHadronMasses import update_particle_table
+    update_particle_table(input_param_card, 'particles.txt', mass_spectrum=spectrum)
+
+
+def create_rhadron_pdgtable(input_param_card='SLHA_INPUT.DAT',spectrum=1):
+    """Add lines to the PDG table"""
+
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE('PDGTABLE.MeV'): # FIXME make configurable
+        # Update the PDG table using our helper function
+        from RHadrons.RHadronMasses import update_PDG_table
+        update_PDG_table('SLHA_INPUT.DAT','PDGTABLE.MeV',spectrum)
+
+
+def addLineToPhysicsConfiguration(KEY, VALUE):
+    """Add lines to the physics configuration"""
+    os.system('touch PhysicsConfiguration.txt')
+    newphysconfig = "{key} = {value}".format(key=KEY, value=VALUE)
+    os.system('echo "%s" >> PhysicsConfiguration.txt' % newphysconfig)
+
+
+def load_files_for_rhadrons_scenario(input_param_card='SLHA_INPUT.DAT',spectrum=1):
+    """ Load all the files needed for a given scenario"""
+    # Create custom PDGTABLE.MeV file
+    create_rhadron_pdgtable(input_param_card,spectrum)
+    # Create particles.txt file
+    create_rhadron_particles_file(input_param_card,spectrum)
+    from RHadrons.RHadronMasses import get_interaction_list
+    get_interaction_list(input_param_card, interaction_file='ProcessList.txt', mass_spectrum=spectrum)
+    # Remove existing physics configuration file ([MDJ]: FIXME: Is this happening earlier, or is it needed?)
+    if os.path.isfile('PhysicsConfiguration.txt'):
+        rhlog.warning("load_files_for_rhadrons_scenario() Found pre-existing PhysicsConfiguration.txt file - deleting.")
+        os.remove('PhysicsConfiguration.txt')
+
+
+def SG_StepNtupleTool(flags, name="G4UA::SG_StepNtupleTool", **kwargs):
+    result = ComponentAccumulator()
+    if flags.Concurrency.NumThreads >1:
+        log=Logging.logging.getLogger(name)
+        log.fatal(' Attempt to run '+name+' with more than one thread, which is not supported')
+        return False
+    # Get the PDG IDs for RHadrons
+    from RHadronMasses import offset_options
+    kwargs.setdefault('RHadronPDGIDList',offset_options.keys())
+    ## if name in simFlags.UserActionConfig.get_Value().keys(): ## FIXME missing functionality
+    ##     for prop,value in simFlags.UserActionConfig.get_Value()[name].items():
+    ##         kwargs.setdefault(prop,value)
+    result.setPrivateTools( CompFactory.G4UA__SG_StepNtupleTool(name, **kwargs) )
+    return result
+
+
+def RHadronsPhysicsTool(flags, name='RHadronsPhysicsTool', **kwargs):
+    result = ComponentAccumulator()
+    result.setPrivateTools( CompFactory.RHadronsPhysicsTool(name,**kwargs) )
+    return result
diff --git a/Simulation/G4Extensions/Sleptons/python/SleptonsConfigNew.py b/Simulation/G4Extensions/Sleptons/python/SleptonsConfigNew.py
new file mode 100644
index 000000000000..2e68cf3e8473
--- /dev/null
+++ b/Simulation/G4Extensions/Sleptons/python/SleptonsConfigNew.py
@@ -0,0 +1,422 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.AccumulatorCache import AccumulatorCache
+import sys, shutil, re
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaCommon.SystemOfUnits import GeV,ns # noqa: F401
+from AthenaConfiguration.Enums import ProductionStep
+from Gauginos.GauginosConfigNew import GauginosPhysicsToolCfg, NeutralinoToPhotonGravitinoCfg
+from G4AtlasServices.G4AtlasServicesConfigNew import PhysicsListSvcCfg
+
+# Example specialConfiguration {'GMSBSlepton': '100.0*GeV', 'GMSBGravitino': '1e-07*GeV', 'GMSBSleptonTime': '0.01*ns'}
+
+"""
+Defining default settings for slepton/staus. Possible options are:
+G4ParticleMass (default 0.0*GeV)
+G4ParticleWidth (default 0.0*GeV)
+G4ParticleCharge (default +/-1.*eplus)
+G4ParticlePDGCode (default sparticle pdgid)
+G4ParticleStable (default True)
+G4ParticleLifetime (default -1)
+G4ParticleShortlived (default False)
+where Particle = [STau1Minus, STau1Plus, STau2Minus, STau2Plus, SElectronRMinus, SElectronRLinus, SElectronRPlus, SElectronLPlus, SMuonRMinus, SMuonLMinus, SMuonRPlus, SMuonLPlus]
+"""
+
+
+@AccumulatorCache
+def get_and_fix_PDGTABLE_GMSB(replace):
+
+    # Download generic PDGTABLE (overwrite existing one if it exists)
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE('PDGTABLE.MeV'):
+        shutil.move('PDGTABLE.MeV', 'PDGTABLE.MeV.org')
+
+        # an example line to illustrate the fixed format, see PDGTABLE.MeV for more details
+        # M 1000022                          0.E+00         +0.0E+00 -0.0E+00 ~chi(0,1)     0
+
+        lines = open('PDGTABLE.MeV.org').readlines()
+        for pdgid,mass,name,charge in replace:
+            if not re.search(r'[MW]\s+'+str(pdgid)+r'\s+\S+', ''.join(lines)):
+                lines.append('M' + str(pdgid).rjust(8) +''.ljust(26) +
+                             ('%11.5E' % mass).ljust(15) +
+                             '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+                lines.append('W' + str(pdgid).rjust(8) +''.ljust(26) +
+                             '0.E+00'.ljust(15) + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+            else:
+                from past.builtins import xrange # Temporary workaround for python3 compatibility use range in CA-based config
+                for i in xrange(len(lines)):
+                    if re.search(r'M\s+'+str(pdgid)+r'\s+\S+', lines[i]):
+                        l = lines[i]
+                        lines[i] = l[0:35] + ('%11.5E' % mass).ljust(14) + l[49:]
+
+        update = open('PDGTABLE.MeV', 'w')
+        update.write(''.join(lines))
+        update.close()
+
+        print ('modfied PDGTABLE\n%s\n' % ''.join(lines))
+        sys.stdout.flush()
+
+
+@AccumulatorCache
+def load_files_for_GMSB_scenario(simdict):
+
+    GMSBIndex = int(simdict["GMSBIndex"])
+
+    if GMSBIndex == 1:
+        get_and_fix_PDGTABLE_GMSB([
+                              (1000022, eval(simdict["GMSBNeutralino"]), '~chi(0,1)', '0'),
+                              (1000039, eval(simdict.get("GMSBGravitino",'0')), '~G', '0')
+                            ])
+
+    elif GMSBIndex == 2:
+        m_stau    = eval(simdict["GMSBStau"])
+        m_slepton = eval(simdict["GMSBSlepton"])
+        get_and_fix_PDGTABLE_GMSB([
+                              (1000015, m_stau, '~tau(L)', '-'),
+                              (2000011, m_slepton, '~e(R)', '-'),
+                              (2000013, m_slepton, '~mu(R)', '-')
+                            ])
+
+    elif GMSBIndex == 3:
+        m_stau = eval(simdict["GMSBStau"])
+        m_slepton = eval(simdict["GMSBSlepton"])
+        m_squark = eval(simdict["SQUARKMASS"])
+        m_neutralino = eval(simdict["NEUTRALINOMASS"])
+        m_gluino = eval(simdict["GLUINOMASS"])
+        get_and_fix_PDGTABLE_GMSB([
+                              (1000001, m_squark, '~d(L)', '-1/3'), (2000001, m_squark, '~d(R)', '-1/3'),
+                              (1000002, m_squark, '~u(L)', '+2/3'), (2000002, m_squark, '~u(R)', '+2/3'),
+                              (1000003, 1.00E+04, '~s(L)', '-1/3'), (2000003, 1.00E+04, '~s(R)', '-1/3'),
+                              (1000004, 1.00E+04, '~c(L)', '+2/3'), (2000004, 1.00E+04, '~c(R)', '+2/3'),
+                              (1000005, 1.00E+04, '~b(1)', '-1/3'), (2000005, 1.00E+04, '~b(2)', '-1/3'),
+                              (1000006, 1.00E+04, '~t(1)', '+2/3'), (2000006, 1.00E+04, '~t(2)', '+2/3'),
+                              (1000011, 2.50E+02, '~e(L)', '-'), (2000011, m_slepton, '~e(R)', '-'),
+                              (1000012, 1.00E+04, '~nu(e,L)', '0'),
+                              (1000013, 2.50E+02, '~mu(L)', '-'), (2000013, m_slepton, '~mu(R)', '-'),
+                              (1000014, 1.00E+04, '~nu(e,L)', '0'),
+                              (1000015, m_stau, '~tau(L)', '-'), (2000015, 2.50E+02, '~tau(R)', '-'),
+                              (1000016, 1.00E+04, '~nu(tau,L)', '0'),
+                              (1000021, m_gluino, '~g', '0'),
+                              (1000022, m_neutralino, '~chi(0,1)', '0'),
+                              (1000023, 1.00E+04, '~chi(0,2)', '0'),
+                              (1000024, 1.00E+04, '~chi(+,1)', '+'),
+                              (1000025, -1.00E+04, '~chi(0,3)', '0'),
+                              (1000035, 1.00E+04, '~chi(0,4)', '0'),
+                              (1000037, 1.00E+04, '~chi(+,2)', '+')
+                            ])
+
+    elif GMSBIndex == 4:
+        get_and_fix_PDGTABLE_GMSB([
+                              (1000015, m_stau, '~tau(L)', '-')
+                            ])
+
+    else:
+        print ('GMSBIndex %i not supported' % GMSBIndex)
+        raise
+
+
+@AccumulatorCache
+def get_and_fix_PDGTABLE_sleptons(flags, replace):
+
+    # Download generic PDGTABLE (do not overwrite existing one if it exists, use existing one instead)
+    from ExtraParticles.PDGHelpers import getPDGTABLE
+    if getPDGTABLE('PDGTABLE.MeV'):
+        shutil.move('PDGTABLE.MeV', 'PDGTABLE.MeV.org')
+
+    # an example line to illustrate the fixed format, see PDGTABLE.MeV for more details
+        # M 1000022                          0.E+00         +0.0E+00 -0.0E+00 ~chi(0,1)     0
+
+        lines = open('PDGTABLE.MeV.org').readlines()
+        for pdgid,mass,name,charge in replace:
+            if not re.search(r'[MW]\s+'+str(pdgid)+r'\s+\S+', ''.join(lines)):
+                lines.append('M' + str(pdgid).rjust(8) +''.ljust(26) +
+                             ('%11.5E' % mass).ljust(15) +
+                             '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+                lines.append('W' + str(pdgid).rjust(8) +''.ljust(26) +
+                             '0.E+00'.ljust(15) + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) +
+                             name.strip() + ''.ljust(6) + charge.strip()+''.rjust(20-len(name.strip())) + '\n')
+            else:
+                from past.builtins import xrange # Temporary workaround for python3 compatibility use range in CA-based config
+                for i in xrange(len(lines)):
+                    if re.search(r'M\s+'+str(pdgid)+r'\s+\S+', lines[i]):
+                        l = lines[i]
+                        lines[i] = l[0:35] + ('%11.5E' % mass).ljust(14) + l[49:]
+
+        update = open('PDGTABLE.MeV', 'w')
+        update.write(''.join(lines))
+        update.close()
+
+        print('modfied PDGTABLE\n%s\n' % ''.join(lines))
+        sys.stdout.flush()
+
+
+def load_files_for_sleptonLLP_scenario(flags):
+    simdict = flags.Input.SpecialConfiguration
+    if "GMSBSlepton" in simdict:
+        get_and_fix_PDGTABLE_sleptons(flags, [
+                (2000011, eval(simdict.get("GMSBSlepton",'0')), '~e(R)', '-'),
+                (2000013, eval(simdict.get("GMSBSlepton",'0')), '~mu(R)', '-'),
+                (1000011, eval(simdict.get("GMSBSlepton",'0')), '~e(L)', '-'),
+                (1000013, eval(simdict.get("GMSBSlepton",'0')), '~mu(L)', '-'),
+                ])
+    if "GMSBStau" in simdict:
+        get_and_fix_PDGTABLE_sleptons(flags, [
+                (2000015, eval(simdict.get("GMSBStau",'0')), '~tau(R)', '-'),
+                (1000015, eval(simdict.get("GMSBStau",'0')), '~tau(L)', '-'),
+                ])
+    if "GMSBGravitino" in simdict:
+        get_and_fix_PDGTABLE_sleptons(flags, [
+                (1000039, eval(simdict.get("GMSBGravitino",'0')), '~G', '0'),
+                ])
+
+
+def SleptonsPhysicsToolCfg(flags, name="SleptonsPhysicsTool", **kwargs):
+    result = ComponentAccumulator()
+    GMSBStau    = eval(flags.Input.SpecialConfiguration.get("GMSBStau", None))
+    kwargs.setdefault("G4STau1MinusMass",             GMSBStau)
+    kwargs.setdefault("G4STau1PlusMass",              GMSBStau)
+
+    if "GMSBSlepton" in flags.Input.SpecialConfiguration:
+        GMSBSlepton = eval(flags.Input.SpecialConfiguration.get("GMSBSlepton", None))
+
+        kwargs.setdefault("G4SElectronRMinusMass",        GMSBSlepton)
+        kwargs.setdefault("G4SElectronRPlusMass",         GMSBSlepton)
+        kwargs.setdefault("G4SMuonRMinusMass",            GMSBSlepton)
+        kwargs.setdefault("G4SMuonRPlusMass",             GMSBSlepton)
+
+    result.setPrivateTools( CompFactory.SleptonsPhysicsTool(name, **kwargs) )
+    return result
+
+
+def AllSleptonsPhysicsToolCfg(flags, name="AllSleptonsPhysicsTool", **kwargs):
+    result = ComponentAccumulator()
+    if "GMSBStau" in flags.Input.SpecialConfiguration:
+        GMSBStau    = eval(flags.Input.SpecialConfiguration.get("GMSBStau", None))
+        GMSBStauTime    = eval(flags.Input.SpecialConfiguration.get("GMSBStauTime", None))
+        kwargs.setdefault("G4STau1MinusMass",             GMSBStau)
+        kwargs.setdefault("G4STau1MinusPDGCode",          1000015)
+        kwargs.setdefault("G4STau1MinusStable",           False)
+        kwargs.setdefault("G4STau1MinusLifetime",         GMSBStauTime)
+
+        kwargs.setdefault("G4STau1PlusMass",              GMSBStau)
+        kwargs.setdefault("G4STau1PlusPDGCode",           -1000015)
+        kwargs.setdefault("G4STau1PlusStable",            False)
+        kwargs.setdefault("G4STau1PlusLifetime",          GMSBStauTime)
+
+        kwargs.setdefault("G4STau2MinusMass",             GMSBStau)
+        kwargs.setdefault("G4STau2MinusPDGCode",          2000015)
+        kwargs.setdefault("G4STau2MinusStable",           False)
+        kwargs.setdefault("G4STau2MinusLifetime",         GMSBStauTime)
+
+        kwargs.setdefault("G4STau2PlusMass",              GMSBStau)
+        kwargs.setdefault("G4STau2PlusPDGCode",           -2000015)
+        kwargs.setdefault("G4STau2PlusStable",            False)
+        kwargs.setdefault("G4STau2PlusLifetime",          GMSBStauTime)
+
+    if "GMSBSlepton" in flags.Input.SpecialConfiguration:
+        GMSBSlepton = eval(flags.Input.SpecialConfiguration.get("GMSBSlepton", None))
+        GMSBSleptonTime = eval(flags.Input.SpecialConfiguration.get("GMSBSleptonTime", None))
+
+        kwargs.setdefault("G4SElectronLMinusMass",        GMSBSlepton)
+        kwargs.setdefault("G4SElectronLMinusPDGCode",     1000011)
+        kwargs.setdefault("G4SElectronLMinusStable",      False)
+        kwargs.setdefault("G4SElectronLMinusLifetime",    GMSBSleptonTime)
+
+        kwargs.setdefault("G4SElectronLPlusMass",         GMSBSlepton)
+        kwargs.setdefault("G4SElectronLPlusPDGCode",      -1000011)
+        kwargs.setdefault("G4SElectronLPlusStable",       False)
+        kwargs.setdefault("G4SElectronLPlusLifetime",     GMSBSleptonTime)
+
+        kwargs.setdefault("G4SMuonLMinusMass",            GMSBSlepton)
+        kwargs.setdefault("G4SMuonLMinusPDGCode",         1000013)
+        kwargs.setdefault("G4SMuonLMinusStable",          False)
+        kwargs.setdefault("G4SMuonLMinusLifetime",        GMSBSleptonTime)
+
+        kwargs.setdefault("G4SMuonLPlusMass",             GMSBSlepton)
+        kwargs.setdefault("G4SMuonLPlusPDGCode",          -1000013)
+        kwargs.setdefault("G4SMuonLPlusStable",           False)
+        kwargs.setdefault("G4SMuonLPlusLifetime",         GMSBSleptonTime)
+
+        kwargs.setdefault("G4SElectronRMinusMass",        GMSBSlepton)
+        kwargs.setdefault("G4SElectronRMinusPDGCode",     2000011)
+        kwargs.setdefault("G4SElectronRMinusStable",      False)
+        kwargs.setdefault("G4SElectronRMinusLifetime",    GMSBSleptonTime)
+
+        kwargs.setdefault("G4SElectronRPlusMass",         GMSBSlepton)
+        kwargs.setdefault("G4SElectronRPlusPDGCode",      -2000011)
+        kwargs.setdefault("G4SElectronRPlusStable",       False)
+        kwargs.setdefault("G4SElectronRPlusLifetime",     GMSBSleptonTime)
+
+        kwargs.setdefault("G4SMuonRMinusMass",            GMSBSlepton)
+        kwargs.setdefault("G4SMuonRMinusPDGCode",         2000013)
+        kwargs.setdefault("G4SMuonRMinusStable",          False)
+        kwargs.setdefault("G4SMuonRMinusLifetime",        GMSBSleptonTime)
+
+        kwargs.setdefault("G4SMuonRPlusMass",             GMSBSlepton)
+        kwargs.setdefault("G4SMuonRPlusPDGCode",          -2000013)
+        kwargs.setdefault("G4SMuonRPlusStable",           False)
+        kwargs.setdefault("G4SMuonRPlusLifetime",         GMSBSleptonTime)
+    result.setPrivateTools( CompFactory.SleptonsPhysicsTool(name, **kwargs) )
+    return result
+
+
+def SElectronRPlusToElectronGravitinoCfg(flags, name="SElectronRPlusToElectronGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_e_plus_R")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,e+")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def SElectronRMinusToElectronGravitinoCfg(flags, name="SElectronRMinusToElectronGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_e_minus_R")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,e-")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def SMuonRPlusToMuonGravitinoCfg(flags, name="SMuonRPlusToMuonGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_mu_plus_R")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,mu+")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def SMuonRMinusToMuonGravitinoCfg(flags, name="SMuonRMinusToMuonGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_mu_minus_R")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,mu-")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def STauLPlusToTauGravitinoCfg(flags, name="STauLPlusToTauGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_tau_plus_1")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,tau+")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def STauLMinusToTauGravitinoCfg(flags, name="STauLMinusToTauGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_tau_minus_1")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,tau-")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def SElectronLPlusToElectronGravitinoCfg(flags, name="SElectronLPlusToElectronGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_e_plus_L")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,e+")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def SElectronLMinusToElectronGravitinoCfg(flags, name="SElectronLMinusToElectronGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_e_minus_L")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,e-")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def SMuonLPlusToMuonGravitinoCfg(flags, name="SMuonLPlusToMuonGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_mu_plus_L")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,mu+")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def SMuonLMinusToMuonGravitinoCfg(flags, name="SMuonLMinusToMuonGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_mu_minus_L")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,mu-")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def STauRPlusToTauGravitinoCfg(flags, name="STauRPlusToTauGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_tau_plus_2")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,tau+")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+
+def STauRMinusToTauGravitinoCfg(flags, name="STauRMinusToTauGravitino", **kwargs):
+    result = ComponentAccumulator()
+    kwargs.setdefault("ParticleName","s_tau_minus_2")
+    kwargs.setdefault("BR", 1.0) # Branching Ratio
+    kwargs.setdefault("Daughters","s_G,tau-")
+    result.setPrivateTools( CompFactory.AddPhysicsDecayTool(name, **kwargs) )
+    return result
+
+def SleptonsLLPCfg(flags):
+    result = ComponentAccumulator()
+    load_files_for_sleptonLLP_scenario(flags)
+
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+        result.merge(PhysicsListSvcCfg(flags))
+        physicsOptions = [ result.popToolsAndMerge(GauginosPhysicsToolCfg(flags)) ]
+        physicsOptions += [ result.popToolsAndMerge(AllSleptonsPhysicsToolCfg(flags)) ]
+        # Slepton decays from SleptonsConfig
+        if "GMSBSlepton" in flags.Input.SpecialConfiguration:
+            physicsOptions += [ result.popToolsAndMerge(SElectronRPlusToElectronGravitinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(SElectronLPlusToElectronGravitinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(SElectronRMinusToElectronGravitinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(SElectronLMinusToElectronGravitinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(SMuonRPlusToMuonGravitinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(SMuonLPlusToMuonGravitinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(SMuonRMinusToMuonGravitinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(SMuonLMinusToMuonGravitinoCfg(flags)) ]
+        if "GMSBStau" in flags.Input.SpecialConfiguration:
+            physicsOptions += [ result.popToolsAndMerge(STauRPlusToTauGravitinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(STauLPlusToTauGravitinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(STauRMinusToTauGravitinoCfg(flags)) ]
+            physicsOptions += [ result.popToolsAndMerge(STauLMinusToTauGravitinoCfg(flags)) ]
+    result.getService("PhysicsListSvc").PhysOption += physicsOptions
+    return result
+
+
+def GMSB_Cfg(flags):
+    result = ComponentAccumulator()
+    simdict = flags.Input.SpecialConfiguration
+    assert "GMSBIndex" in simdict
+
+    load_files_for_GMSB_scenario(simdict)
+
+    if flags.Common.ProductionStep == ProductionStep.Simulation:
+        GMSBIndex = int(simdict["GMSBIndex"])
+        result.merge(PhysicsListSvcCfg(flags))
+        physicsOptions = []
+        if GMSBIndex == 1: # generic neutralino to photon scenario
+            physicsOptions = [ result.popToolsAndMerge(GauginosPhysicsToolCfg(flags)) ]
+            physicsOptions = [ result.popToolsAndMerge(NeutralinoToPhotonGravitinoCfg(flags)) ]
+        elif GMSBIndex == 2 or GMSBIndex == 3 or GMSBIndex == 4: # generic stau scenario
+            physicsOptions = [ result.popToolsAndMerge(SleptonsPhysicsToolCfg(flags)) ]
+        else:
+            print ('GMSBIndex %i not supported' % GMSBIndex)
+            raise
+        del GMSBIndex
+    result.getService("PhysicsListSvc").PhysOption += physicsOptions
+    return result
diff --git a/Simulation/G4Utilities/G4StepLimitation/python/G4StepLimitationConfigNew.py b/Simulation/G4Utilities/G4StepLimitation/python/G4StepLimitationConfigNew.py
new file mode 100644
index 000000000000..cc211c53c74b
--- /dev/null
+++ b/Simulation/G4Utilities/G4StepLimitation/python/G4StepLimitationConfigNew.py
@@ -0,0 +1,10 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentFactory import CompFactory
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+
+def G4StepLimitationToolCfg(flags, name="G4StepLimitationTool", **kwargs):
+    result = ComponentAccumulator()
+    #Add any future configuration here
+    result.setPrivateTools(CompFactory.G4StepLimitationTool(name, **kwargs))
+    return result
diff --git a/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py b/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
index b655edbd971f..b66193eedf14 100644
--- a/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
+++ b/Simulation/SimuJobTransforms/python/CommonSimulationSteering.py
@@ -14,6 +14,21 @@
 # 3b) CosmicGenerator
 # 4) inputHITSFile (re-simulation)
 
+from PyJobTransforms.TransformUtils import executeFromFragment
+
+
+def specialConfigPreInclude(ConfigFlags):
+    fragment = ConfigFlags.Input.SpecialConfiguration.get("preInclude", None)
+    if fragment and fragment != 'NONE':
+        executeFromFragment(fragment, ConfigFlags) #FIXME assumes only one fragment?
+
+
+def specialConfigPostInclude(ConfigFlags, cfg):
+    fragment = ConfigFlags.Input.SpecialConfiguration.get("postInclude", None)
+    if fragment and fragment != 'NONE':
+        executeFromFragment(fragment, ConfigFlags, cfg) #FIXME assumes only one fragment?
+
+
 def CommonSimulationCfg(ConfigFlags, log):
     # Configure main services and input reading (if required)
     if ConfigFlags.Input.Files == '':
diff --git a/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py b/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py
index 2a196a592e20..478ba793c20b 100644
--- a/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py
+++ b/Simulation/SimuJobTransforms/python/G4AtlasAlg_Skeleton.py
@@ -3,6 +3,8 @@
 import sys
 from PyJobTransforms.CommonRunArgsToFlags import commonRunArgsToFlags
 from PyJobTransforms.TransformUtils import processPreExec, processPreInclude, processPostExec, processPostInclude
+from SimuJobTransforms.CommonSimulationSteering import CommonSimulationCfg, specialConfigPreInclude, specialConfigPostInclude
+
 
 def defaultSimulationFlags(ConfigFlags, detectors):
     """Fill default simulation flags"""
@@ -130,6 +132,9 @@ def fromRunArgs(runArgs):
     if hasattr(runArgs, 'truthStrategy'):
         ConfigFlags.Sim.TruthStrategy = runArgs.truthStrategy
 
+    # Special Configuration preInclude
+    specialConfigPreInclude(ConfigFlags)
+
     # Pre-include
     processPreInclude(runArgs, ConfigFlags)
 
@@ -139,9 +144,11 @@ def fromRunArgs(runArgs):
     # Lock flags
     ConfigFlags.lock()
 
-    from SimuJobTransforms.CommonSimulationSteering import CommonSimulationCfg
     cfg = CommonSimulationCfg(ConfigFlags, log)
 
+    # Special Configuration postInclude
+    specialConfigPostInclude(ConfigFlags, cfg)
+
     # Post-include
     processPostInclude(runArgs, ConfigFlags, cfg)
 
diff --git a/Simulation/SimuJobTransforms/python/ISF_Skeleton.py b/Simulation/SimuJobTransforms/python/ISF_Skeleton.py
index 09ae87185c5b..5c688761190e 100644
--- a/Simulation/SimuJobTransforms/python/ISF_Skeleton.py
+++ b/Simulation/SimuJobTransforms/python/ISF_Skeleton.py
@@ -3,6 +3,8 @@
 import sys
 from PyJobTransforms.CommonRunArgsToFlags import commonRunArgsToFlags
 from PyJobTransforms.TransformUtils import processPreExec, processPreInclude, processPostExec, processPostInclude
+from SimuJobTransforms.CommonSimulationSteering import CommonSimulationCfg, specialConfigPreInclude, specialConfigPostInclude
+
 
 def defaultSimulationFlags(ConfigFlags, detectors):
     """Fill default simulation flags"""
@@ -140,6 +142,9 @@ def fromRunArgs(runArgs):
     if hasattr(runArgs, 'truthStrategy'):
         ConfigFlags.Sim.TruthStrategy = runArgs.truthStrategy
 
+    # Special Configuration preInclude
+    specialConfigPreInclude(ConfigFlags)
+
     # Pre-include
     processPreInclude(runArgs, ConfigFlags)
 
@@ -149,9 +154,11 @@ def fromRunArgs(runArgs):
     # Lock flags
     ConfigFlags.lock()
 
-    from SimuJobTransforms.CommonSimulationSteering import CommonSimulationCfg
     cfg = CommonSimulationCfg(ConfigFlags, log)
 
+    # Special Configuration postInclude
+    specialConfigPostInclude(ConfigFlags, cfg)
+
     # Post-include
     processPostInclude(runArgs, ConfigFlags, cfg)
 
diff --git a/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingCharginos_CGvsCA.sh b/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingCharginos_CGvsCA.sh
new file mode 100755
index 000000000000..982e668e945d
--- /dev/null
+++ b/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingCharginos_CGvsCA.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+# 
+# art-description: MC16-style simulation of decaying Charginos using FullG4 (tests Charginos and Gauginos packages)
+# art-type: grid
+# art-include: master/Athena
+# art-include: master/AthSimulation
+# art-output: *.root
+# art-output: PDGTABLE.MeV.*
+# art-output: *.HITS.pool.root
+# art-output: log.*
+# art-output: Config*.pkl
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+Sim_tf.py \
+--CA \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlusLLP' \
+--simulator 'FullG4MT' \
+--postInclude 'PyJobTransforms.UseFrontier' \
+--preInclude 'SimuJobTransforms.BeamPipeKill,SimuJobTransforms.FrozenShowersFCalOnly,SimuJobTransforms.TightMuonStepping' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.448307.MGPy8EG_A14N23LO_mAMSB_C1C1_5000_208000_LL4p0_MET60.evgen.EVNT.e6962.EVNT.15631425._000001.pool.root.1" \
+--outputHITSFile "CA.HITS.pool.root" \
+--maxEvents 10 \
+--postExec 'with open("ConfigSimCA.pkl", "wb") as f: cfg.store(f)' \
+--imf False
+
+rc=$?
+mv PDGTABLE.MeV PDGTABLE.MeV.CA
+mv log.EVNTtoHITS logEVNTtoHITS.CA
+echo  "art-result: $rc simulation_CA"
+
+rc2=-9999
+if [ $rc -eq 0 ]
+then
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.448307.MGPy8EG_A14N23LO_mAMSB_C1C1_5000_208000_LL4p0_MET60.evgen.EVNT.e6962.EVNT.15631425._000001.pool.root.1" \
+        --outputHITSFile "CA.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False \
+        --athenaopts '"--config-only=ConfigSimCG.pkl"'
+
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.448307.MGPy8EG_A14N23LO_mAMSB_C1C1_5000_208000_LL4p0_MET60.evgen.EVNT.e6962.EVNT.15631425._000001.pool.root.1" \
+        --outputHITSFile "CG.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False
+
+    rc2=$?
+    mv PDGTABLE.MeV PDGTABLE.MeV.CG
+    mv log.EVNTtoHITS logEVNTtoHITS.CG
+fi
+echo  "art-result: $rc2 simulation_CG"
+
+rc3=-9999
+if [ $rc2 -eq 0 ]
+then
+    acmd.py diff-root CG.HITS.pool.root CA.HITS.pool.root --error-mode resilient --mode=semi-detailed --order-trees --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref
+    rc3=$?
+fi
+echo  "art-result: $rc3 FullG4MT_OLDvsCA"
diff --git a/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingCharginos_busy_CGvsCA.sh b/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingCharginos_busy_CGvsCA.sh
new file mode 100755
index 000000000000..ffc88bc6017c
--- /dev/null
+++ b/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingCharginos_busy_CGvsCA.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+# 
+# art-description: MC16-style simulation of decaying Charginos (busy events) using FullG4 (tests Charginos and Gauginos packages)
+# art-type: grid
+# art-include: master/Athena
+# art-include: master/AthSimulation
+# art-output: *.root
+# art-output: PDGTABLE.MeV.*
+# art-output: *.HITS.pool.root
+# art-output: log.*
+# art-output: Config*.pkl
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+Sim_tf.py \
+--CA \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlusLLP' \
+--simulator 'FullG4MT' \
+--postInclude 'PyJobTransforms.UseFrontier' \
+--preInclude 'SimuJobTransforms.BeamPipeKill,SimuJobTransforms.FrozenShowersFCalOnly,SimuJobTransforms.TightMuonStepping' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.448300.MGPy8EG_A14N23LO_GG_mixedC1LLP_0p2_1400_1200.evgen.EVNT.e7183.EVNT.16706750._000001.pool.root.1" \
+--outputHITSFile "CA.HITS.pool.root" \
+--maxEvents 10 \
+--postExec 'with open("ConfigSimCA.pkl", "wb") as f: cfg.store(f)' \
+--imf False
+
+rc=$?
+mv PDGTABLE.MeV PDGTABLE.MeV.CA
+mv log.EVNTtoHITS logEVNTtoHITS.CA
+echo  "art-result: $rc simulation_CA"
+
+rc2=-9999
+if [ $rc -eq 0 ]
+then
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.448300.MGPy8EG_A14N23LO_GG_mixedC1LLP_0p2_1400_1200.evgen.EVNT.e7183.EVNT.16706750._000001.pool.root.1" \
+        --outputHITSFile "CA.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False \
+        --athenaopts '"--config-only=ConfigSimCG.pkl"'
+
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.448300.MGPy8EG_A14N23LO_GG_mixedC1LLP_0p2_1400_1200.evgen.EVNT.e7183.EVNT.16706750._000001.pool.root.1" \
+        --outputHITSFile "CG.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False
+
+    rc2=$?
+    mv PDGTABLE.MeV PDGTABLE.MeV.CG
+    mv log.EVNTtoHITS logEVNTtoHITS.CG
+fi
+echo  "art-result: $rc2 simulation_CG"
+
+rc3=-9999
+if [ $rc2 -eq 0 ]
+then
+    acmd.py diff-root CG.HITS.pool.root CA.HITS.pool.root --error-mode resilient --mode=semi-detailed --order-trees --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref
+    rc3=$?
+fi
+echo  "art-result: $rc3 FullG4MT_OLDvsCA"
diff --git a/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingLightSleptons_CGvsCA.sh b/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingLightSleptons_CGvsCA.sh
new file mode 100755
index 000000000000..ca728e33deb3
--- /dev/null
+++ b/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingLightSleptons_CGvsCA.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+# 
+# art-description: MC16-style simulation of decaying light sleptons using FullG4 (tests Sleptons + Gauginos)
+# art-type: grid
+# art-include: master/Athena
+# art-include: master/AthSimulation
+# art-output: *.root
+# art-output: PDGTABLE.MeV.*
+# art-output: *.HITS.pool.root
+# art-output: log.*
+# art-output: Config*.pkl
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+Sim_tf.py \
+--CA \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlusLLP' \
+--simulator 'FullG4MT' \
+--postInclude 'PyJobTransforms.UseFrontier' \
+--preInclude 'SimuJobTransforms.BeamPipeKill,SimuJobTransforms.FrozenShowersFCalOnly,SimuJobTransforms.TightMuonStepping' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.399030.MGPy8EG_A14NNPDF23LO_SlepSlep_directLLP_100_0_0p01ns.evgen.EVNT.e7067.EVNT.16242732._000001.pool.root.1" \
+--outputHITSFile "CA.HITS.pool.root" \
+--maxEvents 10 \
+--postExec 'with open("ConfigSimCA.pkl", "wb") as f: cfg.store(f)' \
+--imf False
+
+rc=$?
+mv PDGTABLE.MeV PDGTABLE.MeV.CA
+mv log.EVNTtoHITS logEVNTtoHITS.CA
+echo  "art-result: $rc simulation_CA"
+
+rc2=-9999
+if [ $rc -eq 0 ]
+then
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.399030.MGPy8EG_A14NNPDF23LO_SlepSlep_directLLP_100_0_0p01ns.evgen.EVNT.e7067.EVNT.16242732._000001.pool.root.1" \
+        --outputHITSFile "CA.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False \
+        --athenaopts '"--config-only=ConfigSimCG.pkl"'
+
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.399030.MGPy8EG_A14NNPDF23LO_SlepSlep_directLLP_100_0_0p01ns.evgen.EVNT.e7067.EVNT.16242732._000001.pool.root.1" \
+        --outputHITSFile "CG.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False
+
+    rc2=$?
+    mv PDGTABLE.MeV PDGTABLE.MeV.CG
+    mv log.EVNTtoHITS logEVNTtoHITS.CG
+fi
+echo  "art-result: $rc2 simulation_CG"
+
+rc3=-9999
+if [ $rc2 -eq 0 ]
+then
+    acmd.py diff-root CG.HITS.pool.root CA.HITS.pool.root --error-mode resilient --mode=semi-detailed --order-trees --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref
+    rc3=$?
+fi
+echo  "art-result: $rc3 FullG4MT_OLDvsCA"
diff --git a/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingNeutralinos_CGvsCA.sh b/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingNeutralinos_CGvsCA.sh
new file mode 100755
index 000000000000..1dc622778c81
--- /dev/null
+++ b/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingNeutralinos_CGvsCA.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+# 
+# art-description: MC16-style simulation of decaying Neutralinos using FullG4 (tests sim response to many displaced “primary” particles)
+# art-type: grid
+# art-include: master/Athena
+# art-include: master/AthSimulation
+# art-output: *.root
+# art-output: PDGTABLE.MeV.*
+# art-output: *.HITS.pool.root
+# art-output: log.*
+# art-output: Config*.pkl
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+Sim_tf.py \
+--CA \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlusLLP' \
+--simulator 'FullG4MT' \
+--postInclude 'PyJobTransforms.UseFrontier' \
+--preInclude 'SimuJobTransforms.BeamPipeKill,SimuJobTransforms.FrozenShowersFCalOnly,SimuJobTransforms.TightMuonStepping' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.448168.MGPy8EG_A14NNPDF23LO_GG_qqn1_2400_850_rpvLF_p01ns.evgen.EVNT.e7245.EVNT.17092338._000002.pool.root.1" \
+--outputHITSFile "CA.HITS.pool.root" \
+--maxEvents 10 \
+--postExec 'with open("ConfigSimCA.pkl", "wb") as f: cfg.store(f)' \
+--imf False
+
+rc=$?
+mv PDGTABLE.MeV PDGTABLE.MeV.CA
+mv log.EVNTtoHITS logEVNTtoHITS.CA
+echo  "art-result: $rc simulation_CA"
+
+rc2=-9999
+if [ $rc -eq 0 ]
+then
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.448168.MGPy8EG_A14NNPDF23LO_GG_qqn1_2400_850_rpvLF_p01ns.evgen.EVNT.e7245.EVNT.17092338._000002.pool.root.1" \
+        --outputHITSFile "CA.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False \
+        --athenaopts '"--config-only=ConfigSimCG.pkl"'
+
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.448168.MGPy8EG_A14NNPDF23LO_GG_qqn1_2400_850_rpvLF_p01ns.evgen.EVNT.e7245.EVNT.17092338._000002.pool.root.1" \
+        --outputHITSFile "CG.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False
+
+    rc2=$?
+    mv PDGTABLE.MeV PDGTABLE.MeV.CG
+    mv log.EVNTtoHITS logEVNTtoHITS.CG
+fi
+echo  "art-result: $rc2 simulation_CG"
+
+rc3=-9999
+if [ $rc2 -eq 0 ]
+then
+    acmd.py diff-root CG.HITS.pool.root CA.HITS.pool.root --error-mode resilient --mode=semi-detailed --order-trees --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref
+    rc3=$?
+fi
+echo  "art-result: $rc3 FullG4MT_OLDvsCA"
diff --git a/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingStaus_CGvsCA.sh b/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingStaus_CGvsCA.sh
new file mode 100755
index 000000000000..c5513d9f32bc
--- /dev/null
+++ b/Simulation/Tests/SimExoticsTests/test/test_FullG4_DecayingStaus_CGvsCA.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+# 
+# art-description: MC16-style simulation of decaying staus using FullG4 (tests the Sleptons + Gauginos packages)
+# art-type: grid
+# art-include: master/Athena
+# art-include: master/AthSimulation
+# art-output: *.root
+# art-output: PDGTABLE.MeV.*
+# art-output: *.HITS.pool.root
+# art-output: log.*
+# art-output: Config*.pkl
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+Sim_tf.py \
+--CA \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlusLLP' \
+--simulator 'FullG4MT' \
+--postInclude 'PyJobTransforms.UseFrontier' \
+--preInclude 'SimuJobTransforms.BeamPipeKill,SimuJobTransforms.FrozenShowersFCalOnly,SimuJobTransforms.TightMuonStepping' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.399007.MGPy8EG_A14NNPDF23LO_StauStau_directLLP_100_0_1ns.evgen.EVNT.e7067.EVNT.16137672._000001.pool.root.1" \
+--outputHITSFile "CA.HITS.pool.root" \
+--maxEvents 10 \
+--postExec 'with open("ConfigSimCA.pkl", "wb") as f: cfg.store(f)' \
+--imf False
+
+rc=$?
+mv PDGTABLE.MeV PDGTABLE.MeV.CA
+mv log.EVNTtoHITS logEVNTtoHITS.CA
+echo  "art-result: $rc simulation_CA"
+
+rc2=-9999
+if [ $rc -eq 0 ]
+then
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.399007.MGPy8EG_A14NNPDF23LO_StauStau_directLLP_100_0_1ns.evgen.EVNT.e7067.EVNT.16137672._000001.pool.root.1" \
+        --outputHITSFile "CA.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False \
+        --athenaopts '"--config-only=ConfigSimCG.pkl"'
+
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.399007.MGPy8EG_A14NNPDF23LO_StauStau_directLLP_100_0_1ns.evgen.EVNT.e7067.EVNT.16137672._000001.pool.root.1" \
+        --outputHITSFile "CG.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False
+
+    rc2=$?
+    mv PDGTABLE.MeV PDGTABLE.MeV.CG
+    mv log.EVNTtoHITS logEVNTtoHITS.CG
+fi
+echo  "art-result: $rc2 simulation_CG"
+
+rc3=-9999
+if [ $rc2 -eq 0 ]
+then
+    acmd.py diff-root CG.HITS.pool.root CA.HITS.pool.root --error-mode resilient --mode=semi-detailed --order-trees --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref
+    rc3=$?
+fi
+echo  "art-result: $rc3 FullG4MT_OLDvsCA"
diff --git a/Simulation/Tests/SimExoticsTests/test/test_FullG4_StableCharginos_CGvsCA.sh b/Simulation/Tests/SimExoticsTests/test/test_FullG4_StableCharginos_CGvsCA.sh
new file mode 100755
index 000000000000..6f5c772d1c87
--- /dev/null
+++ b/Simulation/Tests/SimExoticsTests/test/test_FullG4_StableCharginos_CGvsCA.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+# 
+# art-description: MC16-style simulation of stable Charginos using FullG4 (tests the Charginos package alone)
+# art-type: grid
+# art-include: master/Athena
+# art-include: master/AthSimulation
+# art-output: *.root
+# art-output: PDGTABLE.MeV.*
+# art-output: *.HITS.pool.root
+# art-output: log.*
+# art-output: Config*.pkl
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+Sim_tf.py \
+--CA \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlusLLP' \
+--simulator 'FullG4MT' \
+--postInclude 'PyJobTransforms.UseFrontier' \
+--preInclude 'SimuJobTransforms.BeamPipeKill,SimuJobTransforms.FrozenShowersFCalOnly,SimuJobTransforms.TightMuonStepping' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.404460.MGPy8EG_A14N23LO_mAMSB_C1C1_5000_68000_Stable.evgen.EVNT.e5654.EVNT.13360885._000001.pool.root.1" \
+--outputHITSFile "CA.HITS.pool.root" \
+--maxEvents 10 \
+--postExec 'with open("ConfigSimCA.pkl", "wb") as f: cfg.store(f)' \
+--imf False
+
+rc=$?
+mv PDGTABLE.MeV PDGTABLE.MeV.CA
+mv log.EVNTtoHITS logEVNTtoHITS.CA
+echo  "art-result: $rc simulation_CA"
+
+rc2=-9999
+if [ $rc -eq 0 ]
+then
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.404460.MGPy8EG_A14N23LO_mAMSB_C1C1_5000_68000_Stable.evgen.EVNT.e5654.EVNT.13360885._000001.pool.root.1" \
+        --outputHITSFile "CA.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False \
+        --athenaopts '"--config-only=ConfigSimCG.pkl"'
+
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.404460.MGPy8EG_A14N23LO_mAMSB_C1C1_5000_68000_Stable.evgen.EVNT.e5654.EVNT.13360885._000001.pool.root.1" \
+        --outputHITSFile "CG.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False
+
+    rc2=$?
+    mv PDGTABLE.MeV PDGTABLE.MeV.CG
+    mv log.EVNTtoHITS logEVNTtoHITS.CG
+fi
+echo  "art-result: $rc2 simulation_CG"
+
+rc3=-9999
+if [ $rc2 -eq 0 ]
+then
+    acmd.py diff-root CG.HITS.pool.root CA.HITS.pool.root --error-mode resilient --mode=semi-detailed --order-trees --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref
+    rc3=$?
+fi
+echo  "art-result: $rc3 FullG4MT_OLDvsCA"
diff --git a/Simulation/Tests/SimExoticsTests/test/test_FullG4_StableSleptons_CGvsCA.sh b/Simulation/Tests/SimExoticsTests/test/test_FullG4_StableSleptons_CGvsCA.sh
new file mode 100755
index 000000000000..a0a86a3e38ee
--- /dev/null
+++ b/Simulation/Tests/SimExoticsTests/test/test_FullG4_StableSleptons_CGvsCA.sh
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# art-description: MC16-style simulation of stable Sleptons using FullG4 (tests Sleptons package alone)
+# art-type: grid
+# art-include: master/Athena
+# art-include: master/AthSimulation
+# art-output: *.root
+# art-output: PDGTABLE.MeV.*
+# art-output: *.HITS.pool.root
+# art-output: log.*
+# art-output: Config*.pkl
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+Sim_tf.py \
+--CA \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlusLLP' \
+--simulator 'FullG4MT' \
+--postInclude 'PyJobTransforms.UseFrontier' \
+--preInclude 'SimuJobTransforms.BeamPipeKill,SimuJobTransforms.FrozenShowersFCalOnly,SimuJobTransforms.TightMuonStepping' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.404510.MGPy8EG_A14N23LO_GMSB_stablestau_lambda_090_tanb_10_dy.evgen.EVNT.e5652.EVNT.13360872._000001.pool.root.1" \
+--outputHITSFile "CA.HITS.pool.root" \
+--maxEvents 10 \
+--postExec 'with open("ConfigSimCA.pkl", "wb") as f: cfg.store(f)' \
+--imf False
+
+rc=$?
+mv PDGTABLE.MeV PDGTABLE.MeV.CA
+mv log.EVNTtoHITS logEVNTtoHITS.CA
+echo  "art-result: $rc simulation_CA"
+
+rc2=-9999
+if [ $rc -eq 0 ]
+then
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.404510.MGPy8EG_A14N23LO_GMSB_stablestau_lambda_090_tanb_10_dy.evgen.EVNT.e5652.EVNT.13360872._000001.pool.root.1" \
+        --outputHITSFile "CA.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False \
+        --athenaopts '"--config-only=ConfigSimCG.pkl"'
+
+    Sim_tf.py \
+        --conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+        --physicsList 'FTFP_BERT_ATL' \
+        --truthStrategy 'MC15aPlusLLP' \
+        --simulator 'FullG4MT' \
+        --postInclude 'default:PyJobTransforms/UseFrontier.py' \
+        --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+        --preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+        --DataRunNumber '284500' \
+        --geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+        --inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/mc15_13TeV.404510.MGPy8EG_A14N23LO_GMSB_stablestau_lambda_090_tanb_10_dy.evgen.EVNT.e5652.EVNT.13360872._000001.pool.root.1" \
+        --outputHITSFile "CG.HITS.pool.root" \
+        --maxEvents 10 \
+        --imf False
+
+    rc2=$?
+    mv PDGTABLE.MeV PDGTABLE.MeV.CG
+    mv log.EVNTtoHITS logEVNTtoHITS.CG
+fi
+echo  "art-result: $rc2 simulation_CG"
+
+rc3=-9999
+if [ $rc2 -eq 0 ]
+then
+    acmd.py diff-root CG.HITS.pool.root CA.HITS.pool.root --error-mode resilient --mode=semi-detailed --order-trees --ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings index_ref
+    rc3=$?
+fi
+echo  "art-result: $rc3 FullG4MT_OLDvsCA"
diff --git a/Tools/PyUtils/python/MetaReader.py b/Tools/PyUtils/python/MetaReader.py
index 0435fbc9087c..37031387ce40 100644
--- a/Tools/PyUtils/python/MetaReader.py
+++ b/Tools/PyUtils/python/MetaReader.py
@@ -813,7 +813,8 @@ def make_peeker(meta_dict):
                 'AMITag',
                 'project_name',
                 'triggerStreamOfFile',
-                'AtlasRelease'
+                'AtlasRelease',
+                'specialConfiguration'
             ]
             for item in list(meta_dict[filename]['/TagInfo']):
                 if item not in keys_to_keep:
-- 
GitLab


From b217cbb481fe17f2e7916d01407871b1d5c065aa Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 27 Sep 2021 14:35:22 +0200
Subject: [PATCH 333/347] TriggerJobOpts: delete unused TriggerOnlineFlags

The `TriggerOnlineFlags` are no longer used. Delete file and remove
remaining references to it.
---
 .../TriggerJobOpts/python/TriggerFlags.py     |  4 --
 .../python/TriggerOnlineFlags.py              | 50 -------------------
 .../TriggerJobOpts/share/runHLT_standalone.py |  7 ---
 3 files changed, 61 deletions(-)
 delete mode 100644 Trigger/TriggerCommon/TriggerJobOpts/python/TriggerOnlineFlags.py

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
index e6123c73b554..5531173f417d 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerFlags.py
@@ -404,10 +404,6 @@ del _flags
 ## make an alias for trigger flags which looks like old TriggerFlags class
 TriggerFlags = rec.Trigger
 
-
-## add online specific flags
-import TriggerJobOpts.TriggerOnlineFlags    # noqa: F401
-
 ## add slices generation flags
 log.info("TriggerFlags importing SliceFlags"  )
 from TriggerJobOpts.SliceFlags import *                             # noqa: F401, F403
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerOnlineFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerOnlineFlags.py
deleted file mode 100644
index 980948ccdb2f..000000000000
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerOnlineFlags.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
-
-################################################################################
-# @file   TriggerOnlineFlags.py
-# @author Frank Winklmeier
-# @brief  Trigger flags for online running
-################################################################################
-
-from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
-from AthenaCommon.JobProperties import jobproperties # noqa: F401
-
-_flags = []
-
-class doDBConfig(JobProperty):
-   """ Flag to extract the trigger configuration """
-   statusOn = True
-   allowedTypes = ['bool']
-   StoredValue = False   
-
-_flags += [doDBConfig]
-
-class doDBConfigBaseName(JobProperty):
-   """ Base name of the file that holds the trigger configuration """
-   statusOn = True
-   allowedTypes = ['str']
-   StoredValue = ''   
-
-_flags += [doDBConfigBaseName]
-
-class partitionName(JobProperty):
-   """ Name of the partition if running in online environment, otherwise empty """
-   statusOn = True
-   allowedTypes = ['str']
-   import os
-   StoredValue = os.getenv('TDAQ_PARTITION') or ''
-
-_flags += [partitionName]
-
-# Create "Online" container
-class Online(JobPropertyContainer):
-   """ Trigger online flags
-   """
-   pass
-
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-TriggerFlags.add_Container(Online)
-
-# Add all flags
-for f in _flags:
-   TriggerFlags.Online.add_JobProperty(f)
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
index c7971f5c7f00..1e67b6fe910f 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py
@@ -29,8 +29,6 @@ class opt:
     doID             = True           # ConfigFlags.Trigger.doID
     doCalo           = True           # ConfigFlags.Trigger.doCalo
     doMuon           = True           # ConfigFlags.Trigger.doMuon
-    doDBConfig       = None           # dump trigger configuration
-    trigBase         = None           # file name for trigger config dump
     doWriteRDOTrigger = False         # Write out RDOTrigger?
     doWriteBS        = True           # Write out BS?
     doL1Unpacking    = True           # decode L1 data in input file if True, else setup emulation
@@ -242,11 +240,6 @@ ConfigFlags.Trigger.enableL1TopoDump = opt.enableL1TopoDump
 # Pass on the option enabling HLT selection algorithms
 ConfigFlags.Trigger.doHLT = TriggerFlags.doHLT = bool(opt.doHLT)
 
-# To extract the Trigger configuration
-TriggerFlags.Online.doDBConfig = bool(opt.doDBConfig)
-if opt.trigBase is not None:
-    TriggerFlags.Online.doDBConfigBaseName = opt.trigBase
-
 # Setup list of modifiers
 # Common modifiers for MC and data
 setModifiers = ['noLArCalibFolders',
-- 
GitLab


From 7aa91943223a44bf81625b8314a17fe2ca0b60bc Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Mon, 27 Sep 2021 14:37:34 +0200
Subject: [PATCH 334/347] New style config of the RTM extraction jobs (LAr
 Electronic calibration)

---
 .../LArCalibUtils/LArRTMParamExtractor.h      |   2 -
 .../src/LArRTMParamExtractor.cxx              |  18 +-
 .../python/LArCalibConfigFlags.py             |  16 +-
 .../python/LArCalib_RTMParamsConfig.py        | 154 ++++++++++++++++++
 .../share/LArCalib_RTMParams_jobOptions.py    |  12 +-
 5 files changed, 175 insertions(+), 27 deletions(-)
 create mode 100644 LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RTMParamsConfig.py

diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h
index d71e33114e83..04abb9bb8d92 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h
@@ -72,11 +72,9 @@ class LArRTMParamExtractor : public AthAlgorithm
   std::string m_groupingType;
 
   // FT selection
-  bool m_FTselection;
   std::vector<int> m_FT;
   int m_PosNeg;
   // Slot selection
-  bool m_Slotselection;
   std::vector<int> m_Slot;
   // Calib line selection
   bool m_Calibselection;
diff --git a/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx b/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx
index 3150e057a28a..64fc3f31123d 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx
@@ -30,7 +30,7 @@ LArRTMParamExtractor::LArRTMParamExtractor (const std::string& name, ISvcLocator
 {
   declareProperty("KeyList"   ,m_keylist);
   declareProperty("TestMode"  ,m_testmode = false);
-  declareProperty("IgnoreDACSelection", m_ignoreDACselection = false);
+  declareProperty("IgnoreDACSelection", m_ignoreDACselection = true);
   declareProperty("isSC", m_isSC = false);
 
   m_DAC.clear();
@@ -61,11 +61,9 @@ LArRTMParamExtractor::LArRTMParamExtractor (const std::string& name, ISvcLocator
   declareProperty("ResOscillKeyAfter",   m_resOscillKeyAfter  = "ResOscillAfter" ) ;  
   declareProperty("GroupingType",  m_groupingType);
   
-  declareProperty("FTSelection",   m_FTselection = false);
+
   declareProperty("FT",            m_FT);
   declareProperty("PosNeg",        m_PosNeg=0);
-
-  declareProperty("SlotSelection", m_Slotselection = false);
   declareProperty("Slot",          m_Slot);
 
   declareProperty("calibLineSelection", m_Calibselection = false);
@@ -140,18 +138,14 @@ StatusCode LArRTMParamExtractor::initialize() {
     m_dumpResOscill = false ;
   }
 
-  if ( m_FTselection && !m_FT.size() )
-    m_FTselection = false;
-  if ( m_FTselection ) {
+  if ( !m_FT.empty() ) {
     msg(MSG::INFO) << "FT selection enabled, will only process data from FT = [ ";
     for(unsigned i=0; i<m_FT.size()-1; ++i)
       msg() <<  m_FT[i] << ", ";
     ATH_MSG_INFO( m_FT[m_FT.size()-1] << " ] at PosNeg = " << m_PosNeg );
   }
 
-  if ( m_Slotselection && !m_Slot.size() )
-    m_Slotselection = false;
-  if ( m_Slotselection ) {
+  if ( !m_Slot.empty() ) {
     msg(MSG::INFO) << "Slot selection enabled, will only process data from Slot = [ ";
     for(unsigned i=0; i<m_Slot.size()-1; ++i)
       msg() << m_Slot[i] << ", ";
@@ -393,7 +387,7 @@ StatusCode LArRTMParamExtractor::stop()
 	}
         
 	// FT selection
-	if ( m_FTselection ) {
+	if ( !m_FT.empty() ) {
           int PosNeg    = onlineHelper->pos_neg(itVec.channelId());
           int FT        = onlineHelper->feedthrough(itVec.channelId());
 	  std::vector<int>::const_iterator selectFT = std::find(m_FT.begin(),m_FT.end(),FT);
@@ -409,7 +403,7 @@ StatusCode LArRTMParamExtractor::stop()
 	}
 	
 	// Slot selection
-	if ( m_Slotselection ) {
+	if ( !m_Slot.empty() ) {
           int Slot = onlineHelper->slot(itVec.channelId());
 	  std::vector<int>::const_iterator selectSlot = std::find(m_Slot.begin(),m_Slot.end(),Slot);
 	  if ( selectSlot==m_Slot.end() ) { 
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
index c937da2da63f..7c6d7dd7381f 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalibConfigFlags.py
@@ -21,11 +21,13 @@ def addLArCalibFlags(flags):
     flags.addFlag("LArCalib.PhysWave.Folder", lambda prevFlags: _prefix(prevFlags)+"PhysWaves/RTM")
     flags.addFlag("LArCalib.Ramp.Folder",     lambda prevFlags: _prefix(prevFlags)+"Ramps/RampLinea")
     flags.addFlag("LArCalib.OFCPhys.Folder",  lambda prevFlags: _prefix(prevFlags)+"OFC/PhysWave/RTM/")
-    flags.addFlag("LArCalib.LArShapeFolder",  lambda prevFlags: _prefix(prevFlags)+"Shape/RTM/")
-
+    flags.addFlag("LArCalib.LArShape.Folder", lambda prevFlags: _prefix(prevFlags)+"Shape/RTM/")
     flags.addFlag("LArCalib.MPhysOverMCal.Folder", lambda prevFlags: _prefix(prevFlags)+"MphysOverMcal/RTM")
 
-    
+
+    flags.addFlag("LArCalib.CaliPulseParams.Folder", lambda prevFlags: _prefix(prevFlags)+"CaliPulseParams/RTM")
+    flags.addFlag("LArCalib.DetCellParams.Folder", lambda prevFlags: _prefix(prevFlags)+"DetCellParams/RTM")
+
     
 
     flags.addFlag("LArCalib.GroupingType",lambda prevFlags: "SuperCells" if prevFlags.LArCalib.isSC else "ExtendedSubDetector")
@@ -51,6 +53,14 @@ def addLArCalibFlags(flags):
     flags.addFlag("LArCalib.Preselection.Side",[])
     flags.addFlag("LArCalib.Preselection.BEC",[])
     flags.addFlag("LArCalib.Preselection.FT",[])
+    flags.addFlag("LArCalib.Preselection.Slot",[])
+
+
+    flags.addFlag("LArCalib.RTM.ExtractAll",True) # False = extract only tauR 
+    flags.addFlag("LArCalib.RTM.DumpOmegaScan",False)
+    flags.addFlag("LArCalib.RTM.DumpResOscill",False)
+
+
 
     flags.addFlag("LArCalib.GlobalTag","LARCALIB-RUN2-00")
 
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RTMParamsConfig.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RTMParamsConfig.py
new file mode 100644
index 000000000000..682c12637da2
--- /dev/null
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RTMParamsConfig.py
@@ -0,0 +1,154 @@
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+
+from AthenaConfiguration.ComponentFactory import CompFactory 
+from AthenaConfiguration.MainServicesConfig import MainServicesCfg
+
+def LArRTMParamsCfg(flags):
+
+    #Get basic services and cond-algos
+    from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg
+    result=LArCalibBaseCfg(flags)
+
+    from LArCalibProcessing.utils import FolderTagResolver
+    FolderTagResolver._globalTag=flags.LArCalib.GlobalTag
+    rs=FolderTagResolver()
+    DetCellParamsTag=rs.getFolderTag(flags.LArCalib.DetCellParams.Folder)
+    CaliPulseParamsTag=rs.getFolderTag(flags.LArCalib.CaliPulseParams.Folder)
+    CaliWaveTag=rs.getFolderTag(flags.LArCalib.CaliWave.Folder)
+    del rs #Close database
+
+    #Retrieve CaliWave: 
+    from IOVDbSvc.IOVDbSvcConfig import addFolders
+    result.merge(addFolders(flags,flags.LArCalib.CaliWave.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliWaveTag))
+
+    if not flags.LArCalib.RTM.ExtractAll:
+        #Get information from database:
+        result.merge(addFolders(flags,flags.LArCalib.DetCellParams.Folder,detDb=flags.LArCalib.Input.Database, tag=DetCellParamsTag))
+        result.merge(addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliPulseParamsTag))
+
+    
+    LArRTMParamExtractor = CompFactory.LArRTMParamExtractor()
+
+    LArRTMParamExtractor.useTBB=True
+
+    LArRTMParamExtractor.KeyList        = ["LArCaliWave"]
+    LArRTMParamExtractor.TestMode       = False
+    LArRTMParamExtractor.GroupingType   = flags.LArCalib.GroupingType
+    LArRTMParamExtractor.IgnoreDACSelection = True
+    LArRTMParamExtractor.isSC           = flags.LArCalib.isSC
+    
+    LArRTMParamExtractor.ExtractTaur    = True
+    LArRTMParamExtractor.ExtractTcal    = flags.LArCalib.RTM.ExtractAll
+    LArRTMParamExtractor.ExtractFstep   = flags.LArCalib.RTM.ExtractAll
+    LArRTMParamExtractor.ExtractOmega0  = flags.LArCalib.RTM.ExtractAll
+
+    LArRTMParamExtractor.FT            = flags.LArCalib.Preselection.FT
+    LArRTMParamExtractor.PosNeg        = 0 if len(flags.LArCalib.Preselection.Side)==0 else flags.LArCalib.Preselection.Side[0]
+    LArRTMParamExtractor.Slot          = flags.LArCalib.Preselection.Slot
+
+    LArRTMParamExtractor.DumpOmegaScan = flags.LArCalib.RTM.DumpOmegaScan
+    LArRTMParamExtractor.DumpResOscill      = flags.LArCalib.RTM.DumpResOscill
+
+
+    theLArWFParamTool = CompFactory.LArWFParamTool()
+    theLArWFParamTool.isSC = flags.LArCalib.isSC
+
+    theLArWFParamTool.UseOmegaScanHelper = True
+    theLArWFParamTool.CosRespScan = [ False ,  True , False , False ] # Strips only
+    theLArWFParamTool.Omega0Min   = [ 0.100 , 0.220 ,  0.060 ,  0.100 ]
+    theLArWFParamTool.Omega0Max   = [ 0.600 , 0.310 ,  0.215 ,  0.700 ]
+    theLArWFParamTool.NpointScan  = [   800 ,   900 ,    310 ,    120 ]
+    theLArWFParamTool.StoreResOscill = [True * 4] if flags.LArCalib.RTM.DumpResOscill else [False *4]
+    
+    result.addPublicTool(theLArWFParamTool)
+
+    result.addEventAlgo(LArRTMParamExtractor)
+
+    rootfile=flags.LArCalib.Output.ROOTFile
+    if rootfile != "":
+        LArWFParams2Ntuple = CompFactory.LArWFParams2Ntuple("LArWFParams2Ntuple")
+        LArWFParams2Ntuple.DumpCaliPulseParams = True
+        LArWFParams2Ntuple.DumpDetCellParams   = True
+        LArWFParams2Ntuple.CaliPulseParamsKey="LArCaliPulseParams_RTM"
+        LArWFParams2Ntuple.DetCellParamsKey="LArDetCellParams_RTM"
+        result.addEventAlgo(LArWFParams2Ntuple)
+   
+        if flags.LArCalib.RTM.DumpOmegaScan:
+            LArOmegaScans2Ntuple = CompFactory.LArCaliWaves2Ntuple("LArOmegaScans2Ntuple")
+            LArOmegaScans2Ntuple.NtupleName = "OMEGASCAN"
+            LArOmegaScans2Ntuple.KeyList = ["OmegaScan"]
+            result.addEventAlgo(LArOmegaScans2Ntuple)
+
+        if ( flags.LArCalib.RTM.DumpResOscill ):
+            LArResOscillsBefore2Ntuple = CompFactory.LArCaliWaves2Ntuple("LArResOscillsBefore2Ntuple")
+            LArResOscillsBefore2Ntuple.NtupleName = "RESOSCILLBEFORE"
+            LArResOscillsBefore2Ntuple.KeyList = ["ResOscillBefore"]
+            result.addEventAlgo(LArResOscillsBefore2Ntuple)
+            
+            LArResOscillsAfter2Ntuple = CompFactory.LArCaliWaves2Ntuple("LArResOscillsAfter2Ntuple")
+            LArResOscillsAfter2Ntuple.NtupleName = "RESOSCILLAFTER"
+            LArResOscillsAfter2Ntuple.KeyList = ["ResOscillAfter"]
+            result.addEventAlgo(LArResOscillsAfter2Ntuple)
+
+        import os
+        if os.path.exists(rootfile):
+            os.remove(rootfile)
+        result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
+        result.setAppProperty("HistogramPersistency","ROOT")
+        pass # end if ROOT ntuple writing
+
+
+
+    from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
+    result.merge(OutputConditionsAlgCfg(flags,
+                                        outputFile=flags.LArCalib.Output.POOLFile,
+                                        ObjectList=["LArCaliPulseParamsComplete#"+"LArCaliPulseParams_RTM#"+flags.LArCalib.CaliPulseParams.Folder,
+                                                    "LArDetCellParamsComplete#"+"LArDetCellParams_RTM#"+flags.LArCalib.DetCellParams.Folder,],
+                                        IOVTagList=[CaliPulseParamsTag,DetCellParamsTag]
+                                    ))
+
+    #RegistrationSvc    
+    result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False))
+    result.getService("IOVDbSvc").DBInstance=""
+
+
+    #MC Event selector since we have no input data file 
+    mcCnvSvc = CompFactory.McCnvSvc()
+    cfg.addService(mcCnvSvc)
+    cfg.addService(CompFactory.EvtPersistencySvc("EventPersistencySvc",CnvServices=[mcCnvSvc.getFullJobOptName(),]))
+    eventSelector=CompFactory.McEventSelector("EventSelector",
+                                              RunNumber = flags.LArCalib.Input.RunNumbers[0],
+                                              EventsPerRun      = 1,
+                                              FirstEvent	       = 0,
+                                              InitialTimeStamp  = 0,
+                                              TimeStampInterval = 1
+                                          )
+
+    result.addService(eventSelector)
+    return result
+
+if __name__ == "__main__":
+
+
+    from AthenaConfiguration.AllConfigFlags import ConfigFlags
+    from LArCalibProcessing.LArCalibConfigFlags import addLArCalibFlags
+    addLArCalibFlags(ConfigFlags)
+
+
+
+    ConfigFlags.LArCalib.Input.RunNumbers=[401351,]
+    ConfigFlags.LArCalib.Input.Database="/home/wlampl/calibTest/00400939_00400943_00400945_Barrel-EMB-EMEC_HIGH_40_21.0.20_1/poolFiles/myDB200_00400939_00400943_00400945_EB-EMBA_one.db_Delay"
+    ConfigFlags.LArCalib.Input.SubDet="EM"
+    ConfigFlags.LArCalib.BadChannelDB="/home/wlampl/calibTest/00400939_00400943_00400945_Barrel-EMB-EMEC_HIGH_40_21.0.20_1/poolFiles/SnapshotBadChannel_00400939_00400943_00400945_EB-EMBA.db"
+    ConfigFlags.LArCalib.BadChannelTag="-RUN2-UPD3-00"
+    ConfigFlags.LArCalib.Output.ROOTFile="larparams.root"
+    ConfigFlags.IOVDb.DatabaseInstance="CONDBR2"
+    ConfigFlags.IOVDb.DBConnection="sqlite://;schema=output.sqlite;dbname=CONDDBR2"
+    ConfigFlags.IOVDb.GlobalTag="LARCALIB-RUN2-02"
+    #ConfigFlags.Exec.OutputLevel=1
+
+    cfg=MainServicesCfg(ConfigFlags)
+    cfg.merge(LArRTMParamsCfg(ConfigFlags))
+
+    print("Start running...")
+    cfg.run(1)
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py
index 7a9ac2630320..637a7a5a9654 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py
@@ -245,20 +245,14 @@ if not 'StoreResOscill' in dir():
 # FT/Slot selection
 #
 
-if not 'FTSelection' in dir():
-   FTSelection   = False
-
 if not 'PosNeg' in dir():
    PosNeg        = 0
 	
 if not 'FT' in dir():
-   FT            = [ 0 ]
-
-if not 'SlotSelection' in dir():
-   SlotSelection = False
+   FT            = []
 
 if not 'Slot' in dir():
-   Slot          = [ 0 ]
+   Slot          = []
 
 #
 # Input wave type
@@ -630,11 +624,9 @@ LArRTMParamExtractor.SuffixRetrievedDetCell   = SuffixRetrievedDetCell
 LArRTMParamExtractor.SuffixExtractedCaliPulse = SuffixExtractedCaliPulse
 LArRTMParamExtractor.SuffixExtractedDetCell   = SuffixExtractedDetCell
 
-LArRTMParamExtractor.FTSelection   = FTSelection
 LArRTMParamExtractor.FT            = FT
 LArRTMParamExtractor.PosNeg        = PosNeg
 
-LArRTMParamExtractor.SlotSelection = SlotSelection
 LArRTMParamExtractor.Slot          = Slot
 	
 LArRTMParamExtractor.DumpOmegaScan = DumpOmegaScan
-- 
GitLab


From 7eef4945ae67530ff0bdbe750f807848939f11f5 Mon Sep 17 00:00:00 2001
From: Lidija Zivkovic <lidija.zivkovic@cern.ch>
Date: Mon, 27 Sep 2021 14:37:53 +0200
Subject: [PATCH 335/347] ATR-24113 - put HLT streamers to one stream only

---
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref                | 6 ++++++
 .../TrigP1Test/share/ref_v1Dev_decodeBS_build.ref         | 6 ++++++
 .../python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py     | 8 ++++++--
 .../python/HLTMenuConfig/Menu/SignatureDicts.py           | 2 +-
 4 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index a1e298695f04..f3e35b7f57a1 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -9887,8 +9887,14 @@ HLT_noalg_idmon_L1RD0_FILLED:
   eventCount: 20
 HLT_noalg_idmon_L1RD0_UNPAIRED_ISO:
   eventCount: 0
+HLT_noalg_l1calo_L1J400:
+  eventCount: 1
 HLT_noalg_laser_TilePEB_L1CALREQ2:
   eventCount: 0
+HLT_noalg_mb_L1RD0_EMPTY:
+  eventCount: 0
+HLT_noalg_mb_L1RD0_FILLED:
+  eventCount: 20
 HLT_tau0_ptonly_L1TAU60:
   eventCount: 7
   stepCounts:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 3a210656b56d..8f90c63c53b2 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -4047,8 +4047,14 @@ HLT_noalg_idmon_L1RD0_FILLED:
   eventCount: 50
 HLT_noalg_idmon_L1RD0_UNPAIRED_ISO:
   eventCount: 0
+HLT_noalg_l1calo_L1J400:
+  eventCount: 0
 HLT_noalg_laser_TilePEB_L1CALREQ2:
   eventCount: 0
+HLT_noalg_mb_L1RD0_EMPTY:
+  eventCount: 0
+HLT_noalg_mb_L1RD0_FILLED:
+  eventCount: 50
 HLT_tau0_ptonly_L1TAU60:
   eventCount: 1
   stepCounts:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
index 65199269b0b5..a309c891b309 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/PhysicsP1_pp_run3_v1.py
@@ -79,7 +79,10 @@ def addP1Signatures():
     ]
     TriggerFlags.StreamingSlice.signatures = TriggerFlags.StreamingSlice.signatures() + [
         ChainProp(name='HLT_noalg_L1RD0_EMPTY',  l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup),
-        ChainProp(name='HLT_noalg_L1RD0_FILLED', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup),  
+        ChainProp(name='HLT_noalg_L1RD0_FILLED', l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=MinBiasGroup),
+
+        ChainProp(name='HLT_noalg_mb_L1RD0_EMPTY',  l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup),
+        ChainProp(name='HLT_noalg_mb_L1RD0_FILLED', l1SeedThresholds=['FSNOSEED'], stream=['MinBias'], groups=MinBiasGroup),  
 
         # ID monitoring
         ChainProp(name='HLT_noalg_idmon_L1RD0_EMPTY', l1SeedThresholds=['FSNOSEED'], stream=['IDMonitoring','express'],groups=['RATE:Monitoring','BW:Detector']),
@@ -118,8 +121,9 @@ def addP1Signatures():
         ChainProp(name='HLT_noalg_L1J75',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
         ChainProp(name='HLT_noalg_L1J85',        l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
         ChainProp(name='HLT_noalg_L1J100',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup),
+        ChainProp(name='HLT_noalg_L1J400',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=JetStreamersGroup+['BW:Other']),
         # Also used for L1Calo overflow detection
-        ChainProp(name='HLT_noalg_L1J400',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream,'L1Calo'], groups=JetStreamersGroup+['BW:Other']),
+        ChainProp(name='HLT_noalg_l1calo_L1J400',       l1SeedThresholds=['FSNOSEED'], stream=['L1Calo'], groups=JetStreamersGroup+['BW:Other']),
         
         ChainProp(name='HLT_noalg_L1XE30',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=SupportLegGroup+METStreamersGroup),
         ChainProp(name='HLT_noalg_L1XE35',       l1SeedThresholds=['FSNOSEED'], stream=[PhysicsStream], groups=SupportLegGroup+METStreamersGroup),
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index f7e26949bbce..449c0e4a48ce 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -783,7 +783,7 @@ StreamingChainParts = {
     # disambiguation or to allow events from the same L1 seed
     # to be written to different streams
     # New cases should be discussed with Menu Coordinators
-    'streamingInfo'  : ['laser', 'CIS','idmon'],
+    'streamingInfo'  : ['laser', 'CIS','idmon','mb','l1calo'],
     'trigType'       : 'streamer',
     'extra'          : '',
     'streamType'     : AllowedStreamingChainIdentifiers,
-- 
GitLab


From d6c3c40787162c2771329c1faed4a7292e01426f Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Mon, 27 Sep 2021 15:21:05 +0200
Subject: [PATCH 336/347] TriggerJobOpts: cleanup BStoESD configuration

- remove `LVL1ConfigSvc` setting for L1Calo tools as this is no longer
  required now that they have been migrated to JSON
- remove unused `RecMuCTPIByteStreamTool`
- remove "resilience", i.e. disabling trigger if one of the "getters"
  fails to import
---
 .../BStoESD_Tier0_HLTConfig_jobOptions.py     | 41 ++++---------------
 1 file changed, 7 insertions(+), 34 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py b/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
index 8f69a71606ef..cee190ed65fb 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/share/BStoESD_Tier0_HLTConfig_jobOptions.py
@@ -5,14 +5,14 @@
 ##############################################################
 
 # Configuration depends on TriggerFlags.configForStartup():
-#   HLToffline       : HLT is ran offline, configuration is read from XML/JSON files
+#   HLToffline       : HLT is ran offline, configuration is read from JSON files
 #   HLTonline        : Normal running, everything is taken from COOL
 
 from RecExConfig.RecAlgsFlags import recAlgs
 from RecExConfig.RecFlags import rec
 from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
 from AthenaConfiguration.AllConfigFlags import ConfigFlags
-from AthenaCommon.AppMgr import ServiceMgr, ToolSvc
+from AthenaCommon.AppMgr import ServiceMgr
 from AthenaCommon.Include import include
 
 from AthenaCommon.Logging import logging
@@ -24,7 +24,7 @@ assert rec.doTrigger(), assertMsg + ' Since rec.doTrigger is disabled, this file
 assert not recAlgs.doTrigger(), assertMsg + \
     ' Trigger selection should not run in offline reconstruction, so recAlgs.doTrigger should be False'
 
-# First check is HLT psk is ok, if not, turn trigger off.
+# First check if HLT psk is ok, if not, turn trigger off.
 if tf.configForStartup() != 'HLToffline':
     include( "TriggerJobOpts/TriggerConfigCheckHLTpsk.py" )
 
@@ -54,39 +54,12 @@ if rec.doTrigger():
         raise RuntimeError("Invalid EDMVersion=%s " % ConfigFlags.Trigger.EDMVersion)
 
 
+    from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
+    cfg = TriggerConfigGetter()
 
-    try:
-        from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
-        cfg=TriggerConfigGetter()
-    except Exception:
-        from AthenaCommon.Resilience import treatException
-        treatException("Could not run TriggerConfigGetter()")
+    from TriggerJobOpts.T0TriggerGetter import T0TriggerGetter
+    triggerGetter = T0TriggerGetter()
 
-    #---------------------------------------------------------------------------
-    if tf.configForStartup()=="HLTonline": # need to talk to clients using LVL1ConfigSvc and add new folders into
-
-        # do not need thresholds but are using LVL1ConfigSvc
-        if not hasattr(ToolSvc,'RecMuCTPIByteStreamTool'):
-            from TrigT1ResultByteStream.TrigT1ResultByteStreamConf import RecMuCTPIByteStreamTool
-            ToolSvc += RecMuCTPIByteStreamTool("RecMuCTPIByteStreamTool")
-
-        import TrigT1CaloTools.TrigT1CaloToolsConf as calotools  # noqa: F401
-        for toolName in ['L1JetCMXTools', 'L1EnergyCMXTools', 'L1TriggerTowerTool', 'L1CPMTools',
-                         'L1CPCMXTools', 'L1JEMJetTools']:
-            if not hasattr(ToolSvc, toolName ):
-                ToolSvc += eval('calotools.LVL1__%s( toolName )' % toolName)
-            theTool = getattr(ToolSvc, toolName)
-            if 'LVL1ConfigSvc' in theTool.getProperties():
-                theTool.LVL1ConfigSvc="TrigConf::TrigConfigSvc/TrigConfigSvc"
-
-    #---------------------------------------------------------------------------
-    try:
-        from TriggerJobOpts.T0TriggerGetter import T0TriggerGetter
-        triggerGetter = T0TriggerGetter()
-    except Exception:
-        from AthenaCommon.Resilience import treatException
-        treatException("Could not import TriggerJobOpts.T0TriggerGetter . Switched off !" )
-        recAlgs.doTrigger=False
     if rec.doWriteBS():
         include( "ByteStreamCnvSvc/RDP_ByteStream_jobOptions.py" )
 
-- 
GitLab


From 39793749ceb419c078efb0b15d1dc70b381efcd4 Mon Sep 17 00:00:00 2001
From: Ke Li <ke.li@cern.ch>
Date: Mon, 27 Sep 2021 16:18:38 +0200
Subject: [PATCH 337/347] update the conditions tags and RDOs for reco jobs and
 fix the issue for...

---
 .../InDetPhysValMonitoring/share/postInclude.RDOAnalysis.py | 2 ++
 .../share/postInclude.SiHitAnalysis.py                      | 2 ++
 .../InDetPhysValMonitoring/test/test_ele5GeV_reco.sh        | 6 +++---
 .../InDetPhysValMonitoring/test/test_mu100GeV_reco.sh       | 6 +++---
 .../InDetPhysValMonitoring/test/test_mu100GeV_simreco.sh    | 3 ++-
 .../InDetPhysValMonitoring/test/test_mu10GeV_reco.sh        | 6 +++---
 .../InDetPhysValMonitoring/test/test_mu1GeV_reco.sh         | 4 ++--
 .../InDetPhysValMonitoring/test/test_mu1GeV_simreco.sh      | 3 ++-
 .../InDetPhysValMonitoring/test/test_mu20GeV_reco.sh        | 4 ++--
 .../InDetPhysValMonitoring/test/test_mu20GeV_simreco.sh     | 3 ++-
 .../InDetPhysValMonitoring/test/test_mu5GeV_simreco.sh      | 3 ++-
 .../InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh     | 6 +++---
 .../InDetPhysValMonitoring/test/test_piplus1GeV_simreco.sh  | 3 ++-
 .../InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh     | 4 ++--
 .../InDetPhysValMonitoring/test/test_piplus5GeV_simreco.sh  | 3 ++-
 Simulation/Tools/RDOAnalysis/src/PixelRDOAnalysis.cxx       | 2 +-
 Simulation/Tools/RDOAnalysis/src/SCT_RDOAnalysis.cxx        | 2 +-
 17 files changed, 36 insertions(+), 26 deletions(-)

diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/postInclude.RDOAnalysis.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/postInclude.RDOAnalysis.py
index 49dad4570c36..a07c28766101 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/postInclude.RDOAnalysis.py
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/postInclude.RDOAnalysis.py
@@ -1,3 +1,5 @@
+from AthenaCommon.AlgSequence import AlgSequence
+topSequence = AlgSequence()
 from RDOAnalysis.RDOAnalysisConf import PixelRDOAnalysis
 topSequence += PixelRDOAnalysis()
 PixelRDOAnalysis = PixelRDOAnalysis()
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/postInclude.SiHitAnalysis.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/postInclude.SiHitAnalysis.py
index c2cd5cca454b..afc0292e9317 100644
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/postInclude.SiHitAnalysis.py
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/postInclude.SiHitAnalysis.py
@@ -1,4 +1,6 @@
 from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags
+from AthenaCommon.AlgSequence import AlgSequence
+topSequence = AlgSequence()
 from HitAnalysis.HitAnalysisConf import SiHitAnalysis
 topSequence += SiHitAnalysis('PixelHitAnalysis')
 topSequence.PixelHitAnalysis.CollectionName='PixelHits'
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh
index 261f7aaaa582..d9bfda9c6662 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_ele5GeV_reco.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 # art-description: art job for InDetPhysValMonitoring, Single ele 5GeV
 # art-type: grid
-# art-input: user.keli.mc16_13TeV.422028.ParticleGun_single_ele_Pt5.recon.RDO.e7967_e5984_s3126_r11774_tid20254991_00
+# art-input: user.keli:user.keli.mc16_13TeV.422028.ParticleGun_single_ele_Pt5GeV
 # art-input-nfiles: 10
 # art-cores: 4
 # art-memory: 4096
@@ -71,7 +71,7 @@ case $ArtProcess in
       --outputNTUP_PHYSVALFile physval.ntuple.root \
       --outputAODFile   physval.AOD.root \
       --steering        doRAWtoALL \
-      --conditionsTag   'CONDBR2-BLKPA-RUN2-06' \
+      --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
       --checkEventCount False \
       --ignoreErrors    True \
       --maxEvents       -1 \
@@ -85,7 +85,7 @@ case $ArtProcess in
       InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
       InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
       InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(True); \
-      InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+      InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
       rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
       rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
       rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh
index 6cf88a31cea1..d4d934494f55 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_reco.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 # art-description: art job for InDetPhysValMonitoring, Single muon 100GeV
 # art-type: grid
-# art-input: user.keli.mc16_13TeV.422036.ParticleGun_single_mu_Pt100.recon.RDO.e7967_e5984_s3126_r11774_tid20254958_00
+# art-input: user.keli:user.keli.mc16_13TeV.422036.ParticleGun_single_mu_Pt100GeV
 # art-input-nfiles: 10
 # art-cores: 4
 # art-memory: 4096
@@ -70,7 +70,7 @@ case $ArtProcess in
       --inputRDOFile $x \
       --outputNTUP_PHYSVALFile physval.ntuple.root \
       --outputAODFile   physval.AOD.root \
-      --conditionsTag   'CONDBR2-BLKPA-RUN2-06' \
+      --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
       --steering        doRAWtoALL \
       --checkEventCount False \
       --ignoreErrors    True \
@@ -85,7 +85,7 @@ case $ArtProcess in
       InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
       InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
       InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-      InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+      InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
       rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
       rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
       rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_simreco.sh
index 708e590e1fe2..8a636f11aab2 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu100GeV_simreco.sh
@@ -90,6 +90,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
  # Reco step based on test InDetPhysValMonitoring ART setup from Josh Moss.
  run Reco_tf.py \
    --inputHITSFile   "$hits" \
+   --outputRDOFile   output.RDO.root \
    --outputAODFile   physval.AOD.root \
    --outputNTUP_PHYSVALFile ${dcubemon_rec} \
    --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
@@ -105,7 +106,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
    InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
    InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
    InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-   InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+   InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
    rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
    rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
    rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh
index 1931963d9b96..0f7831b6167c 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu10GeV_reco.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 # art-description: art job for InDetPhysValMonitoring, Single muon 10GeV
 # art-type: grid
-# art-input: user.keli.mc16_13TeV.422034.ParticleGun_single_mu_Pt10.recon.RDO.e7967_e5984_s3126_r11774_tid20254941_00
+# art-input: user.keli:user.keli.mc16_13TeV.422034.ParticleGun_single_mu_Pt10GeV
 # art-input-nfiles: 10
 # art-cores: 4
 # art-memory: 4096
@@ -70,7 +70,7 @@ case $ArtProcess in
       --inputRDOFile $x \
       --outputNTUP_PHYSVALFile physval.ntuple.root \
       --outputAODFile   physval.AOD.root \
-      --conditionsTag   'CONDBR2-BLKPA-RUN2-06' \
+      --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
       --steering        doRAWtoALL \
       --checkEventCount False \
       --ignoreErrors    True \
@@ -85,7 +85,7 @@ case $ArtProcess in
       InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
       InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
       InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-      InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+      InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
       rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
       rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
       rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh
index b547d02e5023..d95852323a1f 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_reco.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 # art-description: art job for InDetPhysValMonitoring, Single muon 1GeV
 # art-type: grid
-# art-input: user.goblirsc:mcforArt_2021-09-16_sglMu1_RDO
+# art-input: user.keli:user.keli.mc16_13TeV.422032.ParticleGun_single_mu_Pt1GeV
 # art-input-nfiles: 1
 # art-cores: 4
 # art-memory: 4096
@@ -70,7 +70,7 @@ case $ArtProcess in
       --inputRDOFile $x \
       --outputNTUP_PHYSVALFile physval.ntuple.root \
       --outputAODFile   physval.AOD.root \
-      --conditionsTag   'CONDBR2-BLKPA-RUN2-06' \
+      --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
       --steering        doRAWtoALL \
       --checkEventCount False \
       --ignoreErrors    True \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_simreco.sh
index b6970f13056f..116dfb0f1700 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu1GeV_simreco.sh
@@ -90,6 +90,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
  # Reco step based on test InDetPhysValMonitoring ART setup from Josh Moss.
  run Reco_tf.py \
    --inputHITSFile   "$hits" \
+   --outputRDOFile   output.RDO.root \
    --outputAODFile   physval.AOD.root \
    --outputNTUP_PHYSVALFile ${dcubemon_rec} \
    --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
@@ -105,7 +106,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
    InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
    InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
    InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-   InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+   InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
    rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
    rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
    rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh
index 0ef48c0f9fee..ffac501791d8 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_reco.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 # art-description: art job for InDetPhysValMonitoring, Single muon 20GeV
 # art-type: grid
-# art-input: user.goblirsc:mcforArt_2021-09-16_sglMu20_RDO
+# art-input: user.keli:user.keli.mc16_13TeV.422035.ParticleGun_single_mu_Pt20GeV
 # art-input-nfiles: 1
 # art-cores: 4
 # art-memory: 4096
@@ -70,7 +70,7 @@ case $ArtProcess in
       --inputRDOFile $x \
       --outputNTUP_PHYSVALFile physval.ntuple.root \
       --outputAODFile   physval.AOD.root \
-      --conditionsTag   'CONDBR2-BLKPA-RUN2-06' \
+      --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
       --steering        doRAWtoALL \
       --checkEventCount False \
       --ignoreErrors    True \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_simreco.sh
index 3b4e9cea441c..645f1f729d72 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu20GeV_simreco.sh
@@ -90,6 +90,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
  # Reco step based on test InDetPhysValMonitoring ART setup from Josh Moss.
  run Reco_tf.py \
    --inputHITSFile   "$hits" \
+   --outputRDOFile   output.RDO.root \
    --outputAODFile   physval.AOD.root \
    --outputNTUP_PHYSVALFile ${dcubemon_rec} \
    --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
@@ -105,7 +106,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
    InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
    InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
    InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-   InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+   InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
    rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
    rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
    rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu5GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu5GeV_simreco.sh
index c668294e4349..ef22236fb914 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu5GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_mu5GeV_simreco.sh
@@ -90,6 +90,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
  # Reco step based on test InDetPhysValMonitoring ART setup from Josh Moss.
  run Reco_tf.py \
    --inputHITSFile   "$hits" \
+   --outputRDOFile   output.RDO.root \
    --outputAODFile   physval.AOD.root \
    --outputNTUP_PHYSVALFile ${dcubemon_rec} \
    --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
@@ -105,7 +106,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
    InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
    InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
    InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-   InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+   InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
    rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
    rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
    rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh
index 11463572f93c..aa9343d0842a 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_reco.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
-# art-description: art job for InDetPhysValMonitoring, Single ele 10GeV
+# art-description: art job for InDetPhysValMonitoring, Single ele 1GeV
 # art-type: grid
-# art-input: user.goblirsc:mcforArt_2021-09-16_sglpiplus1_RDO
+# art-input: user.keli:user.keli.mc16_13TeV.422047.ParticleGun_single_piplus_Pt1GeV
 # art-input-nfiles: 1
 # art-cores: 4
 # art-memory: 4096
@@ -70,7 +70,7 @@ case $ArtProcess in
       --inputRDOFile $x \
       --outputNTUP_PHYSVALFile physval.ntuple.root \
       --outputAODFile   physval.AOD.root \
-      --conditionsTag   'CONDBR2-BLKPA-RUN2-06' \
+      --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
       --steering        doRAWtoALL \
       --checkEventCount False \
       --ignoreErrors    True \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_simreco.sh
index 4e68361e25d3..65c0bcaee1d5 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus1GeV_simreco.sh
@@ -91,6 +91,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
  # Reco step based on test InDetPhysValMonitoring ART setup from Josh Moss.
  run Reco_tf.py \
    --inputHITSFile   "$hits" \
+   --outputRDOFile   output.RDO.root \
    --outputAODFile   physval.AOD.root \
    --outputNTUP_PHYSVALFile ${dcubemon_rec} \
    --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
@@ -106,7 +107,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
    InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
    InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
    InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-   InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+   InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
    rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
    rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
    rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh
index 4798affc52f2..01557030cca4 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_reco.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 # art-description: art job for InDetPhysValMonitoring, Single ele 10GeV
 # art-type: grid
-# art-input: user.goblirsc:mcforArt_2021-09-16_sglpiplus5_RDO
+# art-input: user.keli:user.keli.mc16_13TeV.422048.ParticleGun_single_piplus_Pt5GeV
 # art-input-nfiles: 1
 # art-cores: 4
 # art-memory: 4096
@@ -70,7 +70,7 @@ case $ArtProcess in
       --inputRDOFile $x \
       --outputNTUP_PHYSVALFile physval.ntuple.root \
       --outputAODFile   physval.AOD.root \
-      --conditionsTag   'CONDBR2-BLKPA-RUN2-06' \
+      --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
       --steering        doRAWtoALL \
       --checkEventCount False \
       --ignoreErrors    True \
diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_simreco.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_simreco.sh
index a22d8156465a..7bb927d95f00 100755
--- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_simreco.sh
+++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/test_piplus5GeV_simreco.sh
@@ -91,6 +91,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
  # Reco step based on test InDetPhysValMonitoring ART setup from Josh Moss.
  run Reco_tf.py \
    --inputHITSFile   "$hits" \
+   --outputRDOFile   output.RDO.root \
    --outputAODFile   physval.AOD.root \
    --outputNTUP_PHYSVALFile ${dcubemon_rec} \
    --conditionsTag   'OFLCOND-MC16-SDR-RUN2-08' \
@@ -106,7 +107,7 @@ if [ $sim_tf_exit_code -eq 0 ]  ;then
    InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True); \
    InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(False); \
    InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False); \
-   InDetPhysValFlags.doPhysValOutput.set_Value_and_Lock(True); \
+   InDetPhysValFlags.doExpertOutput.set_Value_and_Lock(True); \
    rec.doDumpProperties=True; rec.doCalo=True; rec.doEgamma=True; \
    rec.doForwardDet=False; rec.doInDet=True; rec.doJetMissingETTag=True; \
    rec.doLArg=True; rec.doLucid=True; rec.doMuon=True; rec.doMuonCombined=True; \
diff --git a/Simulation/Tools/RDOAnalysis/src/PixelRDOAnalysis.cxx b/Simulation/Tools/RDOAnalysis/src/PixelRDOAnalysis.cxx
index 7143e0ee4164..8e4daa791a5f 100644
--- a/Simulation/Tools/RDOAnalysis/src/PixelRDOAnalysis.cxx
+++ b/Simulation/Tools/RDOAnalysis/src/PixelRDOAnalysis.cxx
@@ -371,7 +371,7 @@ StatusCode PixelRDOAnalysis::execute() {
   bool doTruthMatching = true;
   const HepMC::GenEvent* hardScatterEvent(nullptr);
 
-  if (mcEventCollection->size()==0){
+  if ((!mcEventCollection.isValid())||mcEventCollection->size()==0){
     ATH_MSG_WARNING("Failed to retrieve a nonzero sized truth event collection, disabling truthMatching");
     doTruthMatching = false;
   }
diff --git a/Simulation/Tools/RDOAnalysis/src/SCT_RDOAnalysis.cxx b/Simulation/Tools/RDOAnalysis/src/SCT_RDOAnalysis.cxx
index 383484cdac8b..f6a25b831ef0 100644
--- a/Simulation/Tools/RDOAnalysis/src/SCT_RDOAnalysis.cxx
+++ b/Simulation/Tools/RDOAnalysis/src/SCT_RDOAnalysis.cxx
@@ -334,7 +334,7 @@ StatusCode SCT_RDOAnalysis::execute() {
 
   const HepMC::GenEvent* hardScatterEvent(nullptr);
   bool doTruthMatching = true;
-  if (mcEventCollection->size()==0){
+  if ((!mcEventCollection.isValid())||mcEventCollection->size()==0){
     ATH_MSG_WARNING("Failed to retrieve a nonzero sized truth event collection, disabling truthMatching");
     doTruthMatching = false;
   }
-- 
GitLab


From c6f8f76ecb5cbfe9e90d1ce3cae638f72a3e8873 Mon Sep 17 00:00:00 2001
From: Giulia Gonella <giulia.gonella@cern.ch>
Date: Mon, 27 Sep 2021 16:32:34 +0200
Subject: [PATCH 338/347] ATR-22749 adding BeeX chains and registering
 close-by-electrons chains

---
 .../python/TrigMultiTrkComboHypoConfig.py     |  5 +-
 .../share/ref_RDOtoRDOTrig_v1Dev_build.ref    | 76 +++++++++++++++++--
 .../share/ref_v1Dev_decodeBS_build.ref        | 32 ++++++--
 .../python/HLTMenuConfig/Menu/LS2_v1.py       |  7 +-
 4 files changed, 102 insertions(+), 18 deletions(-)

diff --git a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py
index 2d9e01ea32a3..ba5f279afcde 100644
--- a/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py
+++ b/Trigger/TrigHypothesis/TrigBphysHypo/python/TrigMultiTrkComboHypoConfig.py
@@ -100,6 +100,7 @@ def DiElecPrecisionComboHypoCfg(name):
         trigLevel = 'EF',
         doElectrons = True,
         outputTrigBphysCollection = 'HLT_DiElecPrecision')
+    hypo.mergedElectronChains = ['BPH-0DR3-EM7J15','HLT_e5_lhvloose_bBeeM6000_L1EM22VHI','HLT_e5_lhvloose_bBeeM6000_L14J15']
     return hypo
 
 def NoMuonDiElecPrecisionComboHypoCfg(name):
@@ -112,6 +113,7 @@ def NoMuonDiElecPrecisionComboHypoCfg(name):
         trigLevel = 'EF',
         doElectrons = True,
         outputTrigBphysCollection = 'HLT_NoMuonDiElecPrecision')
+    hypo.mergedElectronChains = ['BPH-0DR3-EM7J15','HLT_e5_lhvloose_bBeeM6000_L1EM22VHI','HLT_e5_lhvloose_bBeeM6000_L14J15']
     return hypo
 
 def BmutrkComboHypoCfg(name):
@@ -217,7 +219,8 @@ class TrigMultiTrkComboHypoConfig(object):
         if 'Lxy0' in chainDict['topo']:
             tool.LxyCut = 0.0
 
-        if 'BPH-0DR3-EM7J15' in chainDict['L1item']:
+        electronMultiplicity = [int(chainPart['multiplicity']) for chainPart in chainDict['chainParts'] if chainPart['signature']=='Electron']
+        if len(electronMultiplicity) == 1 and electronMultiplicity[0] == 1:
             tool.isMergedElectronChain = True
 
         if 'bJpsimutrk' in chainDict['topo']:
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
index a1e298695f04..6c38de37a18d 100644
--- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
+++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref
@@ -79,18 +79,39 @@ HLT_2e5_lhvloose_bBeeM6000_L12EM3:
     2: 14
     3: 25
     4: 3
-HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
+HLT_2e5_lhvloose_bBeeM6000_L14J15:
+  eventCount: 0
+  stepCounts:
+    0: 10
+    1: 4
+    2: 4
+    3: 4
+  stepFeatures:
+    0: 35
+    1: 62
+    2: 12
+    3: 25
+    4: 3
+HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5_MU5VF:
+  eventCount: 0
+  stepCounts:
+    0: 3
+  stepFeatures:
+    0: 8
+    1: 17
+HLT_2e5_lhvloose_bBeeM6000_L1EM22VHI:
   eventCount: 0
   stepCounts:
     0: 6
-    1: 2
-    2: 1
-    3: 1
+    1: 3
+    2: 3
+    3: 3
   stepFeatures:
-    0: 18
-    1: 50
-    2: 4
-    3: 9
+    0: 26
+    1: 33
+    2: 9
+    3: 16
+    4: 3
 HLT_2g10_loose_mu20_L1MU14FCH:
   eventCount: 0
   stepCounts:
@@ -3538,6 +3559,19 @@ HLT_e5_lhtight_noringer_e9_etcut_Jpsiee_L1JPSI-1M5-EM7:
   eventCount: 0
 HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
   eventCount: 0
+HLT_e5_lhvloose_bBeeM6000_L14J15:
+  eventCount: 0
+  stepCounts:
+    0: 13
+    1: 4
+    2: 4
+    3: 4
+  stepFeatures:
+    0: 35
+    1: 64
+    2: 12
+    3: 25
+    4: 3
 HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
   eventCount: 0
   stepCounts:
@@ -3551,6 +3585,32 @@ HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
     2: 18
     3: 41
     4: 9
+HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15_MU5VF:
+  eventCount: 0
+  stepCounts:
+    0: 11
+    1: 10
+    2: 9
+    3: 9
+  stepFeatures:
+    0: 29
+    1: 64
+    2: 16
+    3: 36
+    4: 9
+HLT_e5_lhvloose_bBeeM6000_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 10
+    1: 3
+    2: 3
+    3: 3
+  stepFeatures:
+    0: 26
+    1: 35
+    2: 9
+    3: 16
+    4: 3
 HLT_e5_lhvloose_j70_0eta320_j50_0eta490_j0_DJMASS1000j50_xe50_tcpufit_L1MJJ-500-NFF:
   eventCount: 0
   stepCounts:
diff --git a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
index 3a210656b56d..5814946ce9d9 100644
--- a/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
+++ b/Trigger/TrigValidation/TrigP1Test/share/ref_v1Dev_decodeBS_build.ref
@@ -34,18 +34,17 @@ HLT_2e5_lhvloose_bBeeM6000_L12EM3:
     1: 49
     2: 4
     3: 5
-HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5:
+HLT_2e5_lhvloose_bBeeM6000_L14J15:
+  eventCount: 0
+HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5_MU5VF:
+  eventCount: 0
+HLT_2e5_lhvloose_bBeeM6000_L1EM22VHI:
   eventCount: 0
   stepCounts:
-    0: 1
-    1: 1
-    2: 1
-    3: 1
+    0: 3
   stepFeatures:
-    0: 5
+    0: 9
     1: 9
-    2: 2
-    3: 2
 HLT_2g10_loose_mu20_L1MU14FCH:
   eventCount: 0
 HLT_2g15_loose_25dphiAA_invmAA80_L1DPHI-M70-2eEM12M:
@@ -1142,6 +1141,8 @@ HLT_e5_lhtight_noringer_e9_etcut_probe_1invmAB5_L1JPSI-1M5-EM7:
     1: 8
     2: 2
     3: 8
+HLT_e5_lhvloose_bBeeM6000_L14J15:
+  eventCount: 0
 HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
   eventCount: 0
   stepCounts:
@@ -1154,6 +1155,21 @@ HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15:
     1: 19
     2: 6
     3: 7
+HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15_MU5VF:
+  eventCount: 0
+  stepCounts:
+    0: 1
+    1: 1
+  stepFeatures:
+    0: 2
+    1: 8
+HLT_e5_lhvloose_bBeeM6000_L1EM22VHI:
+  eventCount: 0
+  stepCounts:
+    0: 3
+  stepFeatures:
+    0: 9
+    1: 9
 HLT_e5_lhvloose_j70_0eta320_j50_0eta490_j0_DJMASS1000j50_xe50_tcpufit_L1MJJ-500-NFF:
   eventCount: 0
 HLT_e5_lhvloose_nopix_lrtloose_idperf_probe_g25_medium_L1EM20VH:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index ad3aaa7ab165..d4c5d147dcce 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -193,10 +193,15 @@ def setupMenu():
 
         #ATR-22749
         ChainProp(name='HLT_2e5_lhvloose_bBeeM6000_L12EM3', l1SeedThresholds=['EM3'], groups=BphysElectronGroup),
-        ChainProp(name='HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5', l1SeedThresholds=['EM3'], groups=BphysElectronGroup),
         ChainProp(name='HLT_e9_lhvloose_e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5', l1SeedThresholds=['EM7','EM3'], groups=BphysElectronGroup),
         ChainProp(name='HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15', l1SeedThresholds=['EM7'], groups=BphysElectronGroup),
         ChainProp(name='HLT_e9_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15', l1SeedThresholds=['EM7'], groups=BphysElectronGroup),
+        ChainProp(name='HLT_2e5_lhvloose_bBeeM6000_L1EM22VHI', l1SeedThresholds=['EM3'], groups=BphysElectronGroup),
+        ChainProp(name='HLT_e5_lhvloose_bBeeM6000_L1EM22VHI', l1SeedThresholds=['EM3'], groups=BphysElectronGroup),
+        ChainProp(name='HLT_2e5_lhvloose_bBeeM6000_L1BPH-0M9-EM7-EM5_MU5VF', l1SeedThresholds=['EM3'], groups=BphysElectronGroup),
+        ChainProp(name='HLT_e5_lhvloose_bBeeM6000_L1BPH-0DR3-EM7J15_MU5VF', l1SeedThresholds=['EM3'], groups=BphysElectronGroup),
+        ChainProp(name='HLT_2e5_lhvloose_bBeeM6000_L14J15', l1SeedThresholds=['EM3'], groups=BphysElectronGroup),
+        ChainProp(name='HLT_e5_lhvloose_bBeeM6000_L14J15', l1SeedThresholds=['EM3'], groups=BphysElectronGroup),
 
         #ART-23577
         ChainProp(name='HLT_e20_lhloose_L1EM7_AFP_A_OR_C', l1SeedThresholds=['EM7'], groups=SingleElectronGroup+LowMuGroup),
-- 
GitLab


From fdf4e5854f0c1316ed978943e7fa8ed68935612d Mon Sep 17 00:00:00 2001
From: John Chapman <jchapman@cern.ch>
Date: Mon, 27 Sep 2021 17:08:29 +0200
Subject: [PATCH 339/347] Minor fix for FilterReporterParams member variable
 initialization

---
 .../EventBookkeeperTools/FilterReporterParams.h                 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Event/EventBookkeeperTools/EventBookkeeperTools/FilterReporterParams.h b/Event/EventBookkeeperTools/EventBookkeeperTools/FilterReporterParams.h
index 24cae4167420..90fc1ef37269 100644
--- a/Event/EventBookkeeperTools/EventBookkeeperTools/FilterReporterParams.h
+++ b/Event/EventBookkeeperTools/EventBookkeeperTools/FilterReporterParams.h
@@ -152,7 +152,7 @@ private:
 
   /// \brief the \ref CutIdentifier for this filter algorithm
 private:
-  CutIdentifier m_cutID;
+  CutIdentifier m_cutID{};
 
   /// \brief the handle to the service holding tables of cut-flows
   /// for filtering algs.
-- 
GitLab


From d798be0bc99746292fa4952e156bb7df187d8326 Mon Sep 17 00:00:00 2001
From: Shaun Roe <shaun.roe@cern.ch>
Date: Mon, 27 Sep 2021 17:38:26 +0200
Subject: [PATCH 340/347] 22.0-unique_ptr_TSoS-TrkFitterUtils

---
 .../TrkFitterUtils/DNA_MaterialEffects.h      |   4 +
 .../TrkFitterUtils/ProtoMaterialEffects.h     |   4 +-
 .../TrkFitterUtils/ProtoTrackStateOnSurface.h |  54 +++---
 .../src/DNA_MaterialEffects.cxx               |  11 ++
 .../src/ProtoMaterialEffects.cxx              |  28 +++-
 .../src/ProtoTrackStateOnSurface.cxx          | 158 ++++++++----------
 .../src/ProtoTrajectoryUtility.cxx            | 125 +++++++-------
 .../src/TrackFitInputPreparator.cxx           |   9 +-
 .../src/ForwardKalmanFitter.cxx               |  60 ++++---
 .../TrkKalmanFitter/src/KalmanFitter.cxx      |   7 +-
 .../src/KalmanPiecewiseAnnealingFilter.cxx    |  40 ++---
 .../TrkKalmanFitter/src/KalmanSmoother.cxx    |  77 +++++----
 .../TrkValTools/src/GenParticleJetFinder.cxx  |   8 +-
 .../src/MeasurementVectorNtupleTool.cxx       |   4 +-
 .../TrkValTools/src/TrackDiff.cxx             |   8 +-
 .../src/TrackInformationNtupleTool.cxx        |   4 +-
 16 files changed, 307 insertions(+), 294 deletions(-)

diff --git a/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/DNA_MaterialEffects.h b/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/DNA_MaterialEffects.h
index 351093867368..e56456415abb 100755
--- a/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/DNA_MaterialEffects.h
+++ b/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/DNA_MaterialEffects.h
@@ -14,6 +14,7 @@
 
 #include "TrkEventPrimitives/PropDirection.h"
 #include "TrkSurfaces/SurfaceHolders.h"
+#include <memory>
 
 namespace Trk {
 
@@ -83,6 +84,9 @@ public:
 
   //! make a Mefot class of the official EDM
   const MaterialEffectsBase* makeMEFOT() const;
+  
+    //! make a Mefot class of the official EDM
+  std::unique_ptr<MaterialEffectsBase> makeUniqueMEFOT() const;
 
 private:
   double m_xmin, m_dxmin, m_chi2min, m_thickness, m_sigmaDNA, m_addSigmaQoverP;
diff --git a/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/ProtoMaterialEffects.h b/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/ProtoMaterialEffects.h
index beb0bbcb6ec8..f7a094e225cc 100644
--- a/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/ProtoMaterialEffects.h
+++ b/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/ProtoMaterialEffects.h
@@ -7,6 +7,7 @@
 
 #include <vector>
 #include "CxxUtils/checker_macros.h"
+#include <memory>
 namespace Trk{
 
   class MaterialEffectsOnTrack;
@@ -59,9 +60,9 @@ namespace Trk{
      const Surface *surface() const;
      void setSurface(const Surface*);
      MaterialEffectsBase *makeMEOT ATLAS_NOT_THREAD_SAFE() const;
+     std::unique_ptr<MaterialEffectsBase> makeUniqueMEOT() const;
      const MaterialProperties *materialProperties() const;
      void setMaterialProperties(const MaterialProperties *);
-     //std::vector<double> &momentumJacobians();    
 
     private:
      double m_scatphi;
@@ -82,7 +83,6 @@ namespace Trk{
      bool m_owneloss; //This the main MT issue in this package
      double m_measscatphi; // fudge to stabilize fit in muon system
      double m_sintheta;
-     //std::vector<double> m_pjac;
   };
 
 }
diff --git a/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/ProtoTrackStateOnSurface.h b/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/ProtoTrackStateOnSurface.h
index 4f0b04cfc0ac..6f42a4d5e5cb 100755
--- a/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/ProtoTrackStateOnSurface.h
+++ b/Tracking/TrkFitter/TrkFitterUtils/TrkFitterUtils/ProtoTrackStateOnSurface.h
@@ -21,12 +21,16 @@
 #include "TrkFitterUtils/TrackCalibDefs.h"
 #include <vector>
 #include "CxxUtils/CachedUniquePtr.h"
+#include <memory> //unique_ptr
+//the following can in principle can be fwd declared, but clients need access
+//to destructors of the classes
+#include "TrkFitterUtils/DNA_MaterialEffects.h"
+#include "TrkFitterUtils/ProtoMaterialEffects.h"
 namespace Trk {
 
   class MeasurementBase;
   class TrackStateOnSurface;
-  class DNA_MaterialEffects;
-  class ProtoMaterialEffects;
+
   /** @brief This class is a container to group all fitter internal
   information (input, temp and final results) for each surface.
 
@@ -72,15 +76,17 @@ namespace Trk {
     void swap(ProtoTrackStateOnSurface& rhs) throw (); // No throw exception guarantee
 
     //! checkin for data member: Measurement
-    void checkinMeasurement(const MeasurementBase*,
+    void checkinMeasurement(MeasurementBase*,
                             bool  classShallOwnMbase=true);
 
     //! replace measurement by new, eg recalibrated one
     void replaceMeasurement(const MeasurementBase*,
                             TrackState::CalibrationType=Trk::TrackState::CalibrationNotKnown);
+    void replaceMeasurement(std::unique_ptr<const Trk::MeasurementBase> meas,
+                            TrackState::CalibrationType=Trk::TrackState::CalibrationNotKnown);
 
     //! checkout for data member: Measurement
-    const MeasurementBase* checkoutMeasurement();
+    std::unique_ptr<Trk::MeasurementBase> checkoutMeasurement();
 
     //! read access for data member: Measurement
     const MeasurementBase* measurement() const;
@@ -132,23 +138,23 @@ namespace Trk {
     const AmgSymMatrix(5)* parametersCovariance() const;
 
     //! checkin method for data member: TPs from forward fit
-    void checkinForwardPar(const TrackParameters*);
+    void checkinForwardPar(std::unique_ptr<const Trk::TrackParameters>);
     //! checkout method for data member: TPs from forward fit
-    const TrackParameters* checkoutForwardPar();
+    std::unique_ptr<const Trk::TrackParameters> checkoutForwardPar();
     //! read access method for data member: TPs from forward fit
     const TrackParameters* forwardTrackParameters() const;
 
     //! checkin method for data member: TPs from smoothing
-    void checkinSmoothedPar(const TrackParameters*);
+    void checkinSmoothedPar(std::unique_ptr<const Trk::TrackParameters> );
     //! checkout method for data member: TPs from smoothing
-    const TrackParameters* checkoutSmoothedPar();
+    std::unique_ptr<const Trk::TrackParameters> checkoutSmoothedPar();
     //! read access method for data member: TPs from smoothing
     const TrackParameters* smoothedTrackParameters() const;
 
     //! checkin method for data member: FitQualityOnSurface (smoothed state)
-    void checkinFitQuality(const FitQualityOnSurface*);
+    void checkinFitQuality(std::unique_ptr<const Trk::FitQualityOnSurface> );
     //! checkout method for data member: FitQualityOnSurface (smoothed state)
-    const FitQualityOnSurface* checkoutFitQuality();
+    std::unique_ptr<const Trk::FitQualityOnSurface> checkoutFitQuality();
     //! read access method for data member: FitQualityOnSurface (smoothed state)
     const FitQualityOnSurface* fitQuality() const;
 
@@ -163,16 +169,16 @@ namespace Trk {
     double backwardStateChiSquared() const;
 
     //! checkin method for data member: ProtoMaterialEffects
-    void checkinMaterialEffects(const ProtoMaterialEffects*);
+    void checkinMaterialEffects(std::unique_ptr<const Trk::ProtoMaterialEffects>);
     //! checkout method for data member: ProtoMaterialEffects
-    const ProtoMaterialEffects* checkoutMaterialEffects();
+    std::unique_ptr<const Trk::ProtoMaterialEffects> checkoutMaterialEffects();
     //! read access method for data member: ProtoMaterialEffects
     const ProtoMaterialEffects* materialEffects() const;
 
     //! checkin method for data member: DNA_MaterialEffects
-    void checkinDNA_MaterialEffects(const DNA_MaterialEffects*);
+    void checkinDNA_MaterialEffects(std::unique_ptr<const Trk::DNA_MaterialEffects>);
     //! checkout method for data member: DNA_MaterialEffects
-    const DNA_MaterialEffects* checkoutDNA_MaterialEffects();
+    std::unique_ptr<const Trk::DNA_MaterialEffects> checkoutDNA_MaterialEffects();
     //! read access method for data member: DNA_MaterialEffects
     const DNA_MaterialEffects* dnaMaterialEffects() const;
 
@@ -213,11 +219,11 @@ namespace Trk {
     bool                       m_iOwnMeasurement; //!< flag to decide if the MB may be checked out/deleted
     TrackState::TrackStateType m_tsType;          //!< flag if outlier and which
     int                        m_iterationShowingOutlier; //!< outlier from it #
-    const TrackParameters*     m_forwardState;    //!< track state obtaine during forward filtering
-    const TrackParameters*     m_smoothedState;   //!< possibly final state after smoothing
-    const FitQualityOnSurface* m_fitQuality;      //!< fit quality on this surface
-    const DNA_MaterialEffects* m_dnaMaterialEffects; //!< extended mefot for DNA
-    const ProtoMaterialEffects* m_protoMaterialEffects; //!< material layer and scattering info
+    std::unique_ptr<const TrackParameters>     m_forwardState{};    //!< track state obtaine during forward filtering
+    std::unique_ptr<const TrackParameters>     m_smoothedState{};   //!< possibly final state after smoothing
+    std::unique_ptr<const FitQualityOnSurface> m_fitQuality{};      //!< fit quality on this surface
+    std::unique_ptr<const DNA_MaterialEffects> m_dnaMaterialEffects{}; //!< extended mefot for DNA
+    std::unique_ptr<const ProtoMaterialEffects> m_protoMaterialEffects{}; //!< material layer and scattering info
     int                        m_stateID;         //!< simple counter to ease state numbering in fitter
     Identifier                 m_identifier;      //!< identify measurement for debugging
     TrackState::MeasurementType m_mType;           //!< store result once Meas is identified
@@ -266,15 +272,15 @@ inline const Trk::TrackParameters* Trk::ProtoTrackStateOnSurface::referenceParam
 inline const AmgVector(5)* Trk::ProtoTrackStateOnSurface::parametersDifference() const { return m_parametersDifference; }
 inline const AmgSymMatrix(5)* Trk::ProtoTrackStateOnSurface::parametersCovariance() const { return m_parametersCovariance; }
 inline const Trk::TrackParameters* Trk::ProtoTrackStateOnSurface::forwardTrackParameters() const
-  {return m_forwardState; }
+  {return m_forwardState.get(); }
 inline const Trk::TrackParameters* Trk::ProtoTrackStateOnSurface::smoothedTrackParameters() const
-  {return m_smoothedState; }
+  {return m_smoothedState.get(); }
 inline const Trk::FitQualityOnSurface* Trk::ProtoTrackStateOnSurface::fitQuality() const
-{return m_fitQuality; }
+{return m_fitQuality.get(); }
 inline const Trk::DNA_MaterialEffects* Trk::ProtoTrackStateOnSurface::dnaMaterialEffects() const
-{return m_dnaMaterialEffects; }
+{return m_dnaMaterialEffects.get(); }
 inline const Trk::ProtoMaterialEffects* Trk::ProtoTrackStateOnSurface::materialEffects() const
-{return m_protoMaterialEffects; }
+{return m_protoMaterialEffects.get(); }
 inline const Identifier Trk::ProtoTrackStateOnSurface::identify() const
   {return m_identifier; }
 inline void  Trk::ProtoTrackStateOnSurface::identifier(Identifier id)
diff --git a/Tracking/TrkFitter/TrkFitterUtils/src/DNA_MaterialEffects.cxx b/Tracking/TrkFitter/TrkFitterUtils/src/DNA_MaterialEffects.cxx
index cf097ebe1ba7..053921c91c45 100755
--- a/Tracking/TrkFitter/TrkFitterUtils/src/DNA_MaterialEffects.cxx
+++ b/Tracking/TrkFitter/TrkFitterUtils/src/DNA_MaterialEffects.cxx
@@ -64,6 +64,17 @@ Trk::DNA_MaterialEffects::makeMEFOT() const
                                                               : inside);
 }
 
+std::unique_ptr<Trk::MaterialEffectsBase> 
+Trk::DNA_MaterialEffects::makeUniqueMEFOT() const{
+return std::make_unique<Trk::EstimatedBremOnTrack>(m_thickness,
+                                       1.0,
+                                       0.0,
+                                       m_addSigmaQoverP * m_addSigmaQoverP,
+                                       *m_associatedSurface,
+                                       m_foundByForwardFilter ? outside
+                                                              : inside);
+}
+
 /**Overload of << operator for MsgStream and std::ostream for debug output*/
 MsgStream&
 Trk::operator<<(MsgStream& sl, const Trk::DNA_MaterialEffects& dme)
diff --git a/Tracking/TrkFitter/TrkFitterUtils/src/ProtoMaterialEffects.cxx b/Tracking/TrkFitter/TrkFitterUtils/src/ProtoMaterialEffects.cxx
index f0a710a8e8e1..ac2e1768bc32 100644
--- a/Tracking/TrkFitter/TrkFitterUtils/src/ProtoMaterialEffects.cxx
+++ b/Tracking/TrkFitter/TrkFitterUtils/src/ProtoMaterialEffects.cxx
@@ -61,10 +61,7 @@ ProtoMaterialEffects::ProtoMaterialEffects(const MaterialEffectsOnTrack *meot){
     m_scatphi=scatangles->deltaPhi();
     m_scattheta=scatangles->deltaTheta();
     m_sigmascatphi=scatangles->sigmaDeltaPhi();
-    //m_sigmascatphi=0.001;
     m_sigmascattheta=scatangles->sigmaDeltaTheta();
-    //if (m_sigmascatphi!=0 && std::abs(m_scatphi/m_sigmascatphi)>10) m_scatphi*=(10*m_sigmascatphi/std::abs(m_scatphi));
-    //if (m_sigmascattheta!=0 && std::abs(m_scattheta/m_sigmascattheta)>10) m_scattheta*=(10*m_sigmascattheta/std::abs(m_scattheta));
   }
   else m_scatphi=m_scattheta=m_sigmascatphi=m_sigmascattheta=0;
   m_surf=meot->associatedSurface().associatedDetectorElement() ?
@@ -132,7 +129,6 @@ ProtoMaterialEffects& ProtoMaterialEffects::operator=(const ProtoMaterialEffects
 }
 
 ProtoMaterialEffects::~ProtoMaterialEffects(){
-  //std::cout << "destructing GXFMat" << std::endl;
   if (m_owneloss) delete m_eloss;
   if (m_surf && !m_surf->associatedDetectorElement()) delete m_surf;
 }
@@ -293,6 +289,26 @@ MaterialEffectsBase *ProtoMaterialEffects::makeMEOT() const {
   return meot;  
 }
 
+std::unique_ptr<MaterialEffectsBase> 
+ProtoMaterialEffects::makeUniqueMEOT() const {
+  std::optional<ScatteringAngles> scatangles=std::nullopt;
+  if (m_sigmascattheta!=0) {
+    scatangles=ScatteringAngles(m_scatphi,m_scattheta,m_sigmascatphi,m_sigmascattheta);
+  }
+  std::bitset<MaterialEffectsBase::NumberOfMaterialEffectsTypes> typePattern;
+  typePattern.set(MaterialEffectsBase::FittedMaterialEffects);
+  const Trk::EnergyLoss *neweloss=nullptr;
+  if (m_deltae!=0){
+    if (m_eloss) {
+      neweloss=m_eloss;
+      if (!m_owneloss) neweloss=neweloss->clone();
+    }
+    else neweloss=new Trk::EnergyLoss(m_deltae,m_sigmadeltae,m_sigmadeltaeneg,m_sigmadeltaepos);
+  }
+  const_cast<bool&>(m_owneloss)=false; //Non MT safe function
+  return std::make_unique< MaterialEffectsOnTrack>(m_x0,scatangles,neweloss,*m_surf,typePattern); 
+}
+
 const Trk::MaterialProperties *ProtoMaterialEffects::materialProperties() const{
   return m_matprop;
 }
@@ -301,8 +317,6 @@ void ProtoMaterialEffects::setMaterialProperties(const Trk::MaterialProperties *
   m_matprop=matprop;
 }
 
-/* std::vector<double> &ProtoMaterialEffects::momentumJacobians(){
-  return m_pjac;
-} */
+
 
 }
diff --git a/Tracking/TrkFitter/TrkFitterUtils/src/ProtoTrackStateOnSurface.cxx b/Tracking/TrkFitter/TrkFitterUtils/src/ProtoTrackStateOnSurface.cxx
index 1bd8c2b09d85..4218fdd8a77b 100755
--- a/Tracking/TrkFitter/TrkFitterUtils/src/ProtoTrackStateOnSurface.cxx
+++ b/Tracking/TrkFitter/TrkFitterUtils/src/ProtoTrackStateOnSurface.cxx
@@ -13,10 +13,6 @@
 #include "TrkMaterialOnTrack/MaterialEffectsBase.h"
 #include "TrkSurfaces/PlaneSurface.h"
 #include "TrkSurfaces/StraightLineSurface.h"
-#include "TrkFitterUtils/DNA_MaterialEffects.h"
-#include "TrkFitterUtils/ProtoMaterialEffects.h"
-
-
 #include <algorithm>
 
 Trk::ProtoTrackStateOnSurface::ProtoTrackStateOnSurface()
@@ -25,11 +21,6 @@ Trk::ProtoTrackStateOnSurface::ProtoTrackStateOnSurface()
   m_iOwnMeasurement(false),
   m_tsType(Trk::TrackState::Fittable),
   m_iterationShowingOutlier(0),
-  m_forwardState(nullptr),
-  m_smoothedState(nullptr),
-  m_fitQuality(nullptr),
-  m_dnaMaterialEffects(nullptr),
-  m_protoMaterialEffects(nullptr),
   m_stateID(0),
   m_identifier(),
   m_mType(Trk::TrackState::unidentified),
@@ -99,11 +90,6 @@ Trk::ProtoTrackStateOnSurface::ProtoTrackStateOnSurface
   m_tsType(is_outlier ? Trk::TrackState::ExternalOutlier : 
            Trk::TrackState::Fittable),
   m_iterationShowingOutlier(0),
-  m_forwardState(nullptr),
-  m_smoothedState(nullptr),
-  m_fitQuality(nullptr),
-  m_dnaMaterialEffects(nullptr),
-  m_protoMaterialEffects(nullptr),
   m_stateID(positionOnTrajectory),
   m_identifier(),
   m_mType(Trk::TrackState::unidentified),
@@ -127,11 +113,7 @@ Trk::ProtoTrackStateOnSurface::ProtoTrackStateOnSurface
 Trk::ProtoTrackStateOnSurface::~ProtoTrackStateOnSurface()
 {
   if (m_iOwnMeasurement) delete m_measurement;
-  delete m_forwardState;
-  delete m_smoothedState;
-  delete m_fitQuality;
-  delete m_dnaMaterialEffects;
-  delete m_protoMaterialEffects;
+  
   if ( m_iOwnJacobian ) {
     delete m_transportJacobian;
     m_transportJacobian =nullptr;
@@ -154,9 +136,6 @@ Trk::ProtoTrackStateOnSurface& Trk::ProtoTrackStateOnSurface::operator=(const Tr
 {
   if (this!=&rhs){
     if (m_iOwnMeasurement) delete m_measurement;
-    delete m_forwardState;
-    delete m_smoothedState;
-    delete m_fitQuality;
     if ( m_iOwnJacobian ) delete m_transportJacobian;
     if ( m_iOwnRefPars )  delete m_referenceParameters;
     if ( m_iOwnParametersDifference ) delete m_parametersDifference;
@@ -167,11 +146,11 @@ Trk::ProtoTrackStateOnSurface& Trk::ProtoTrackStateOnSurface::operator=(const Tr
     m_iOwnMeasurement = rhs.m_iOwnMeasurement;
     m_tsType = rhs.m_tsType;
     m_iterationShowingOutlier = rhs.m_iterationShowingOutlier;
-    m_forwardState = rhs.m_forwardState ? rhs.m_forwardState->clone() : nullptr;
-    m_smoothedState = rhs.m_smoothedState ? rhs.m_smoothedState->clone() : nullptr;
-    m_fitQuality = rhs.m_fitQuality ? new Trk::FitQualityOnSurface(*rhs.m_fitQuality) : nullptr ;
-    m_dnaMaterialEffects = rhs.m_dnaMaterialEffects ? new Trk::DNA_MaterialEffects(*rhs.m_dnaMaterialEffects) : nullptr ;
-    m_protoMaterialEffects = rhs.m_protoMaterialEffects ? new Trk::ProtoMaterialEffects(*rhs.m_protoMaterialEffects) : nullptr ;
+    m_forwardState.reset(rhs.m_forwardState ? rhs.m_forwardState->clone() : nullptr);
+    m_smoothedState.reset(rhs.m_smoothedState ? rhs.m_smoothedState->clone() : nullptr);
+    m_fitQuality.reset(rhs.m_fitQuality ? new Trk::FitQualityOnSurface(*rhs.m_fitQuality) : nullptr );
+    m_dnaMaterialEffects.reset(rhs.m_dnaMaterialEffects ? new Trk::DNA_MaterialEffects(*rhs.m_dnaMaterialEffects) : nullptr );
+    m_protoMaterialEffects.reset(rhs.m_protoMaterialEffects ? new Trk::ProtoMaterialEffects(*rhs.m_protoMaterialEffects) : nullptr) ;
     m_stateID          = rhs.m_stateID;
     m_identifier       = rhs.m_identifier;
     m_mType            = rhs.m_mType;
@@ -234,7 +213,7 @@ void Trk::ProtoTrackStateOnSurface::swap(ProtoTrackStateOnSurface& rhs) throw ()
     std::swap(this->m_measurementDifferenceVector, rhs.m_measurementDifferenceVector);
 }
 
-void Trk::ProtoTrackStateOnSurface::checkinMeasurement(const Trk::MeasurementBase* meas,
+void Trk::ProtoTrackStateOnSurface::checkinMeasurement(Trk::MeasurementBase* meas,
                                                        bool classShallOwnMbase) 
 {
   if (m_measurement) {
@@ -247,7 +226,8 @@ void Trk::ProtoTrackStateOnSurface::checkinMeasurement(const Trk::MeasurementBas
   m_measurementDifferenceVector.store(nullptr);
 }
 
-void Trk::ProtoTrackStateOnSurface::replaceMeasurement(const Trk::MeasurementBase* meas,
+void 
+Trk::ProtoTrackStateOnSurface::replaceMeasurement(const Trk::MeasurementBase* meas,
                                                        Trk::TrackState::CalibrationType ct) 
 {
   if (meas!=nullptr && meas != m_measurement) { // chk that there *is* something to replace 
@@ -260,20 +240,35 @@ void Trk::ProtoTrackStateOnSurface::replaceMeasurement(const Trk::MeasurementBas
   }
 }
 
-const Trk::MeasurementBase* Trk::ProtoTrackStateOnSurface::checkoutMeasurement() 
+void 
+Trk::ProtoTrackStateOnSurface::replaceMeasurement(std::unique_ptr<const Trk::MeasurementBase> meas,
+                                                       Trk::TrackState::CalibrationType ct) 
+{
+  if (meas!=nullptr && meas.get() != m_measurement) { // chk that there *is* something to replace 
+    if (m_iOwnMeasurement) delete m_measurement;
+    m_measurement = meas.release();
+    m_iOwnMeasurement = true;
+    m_calib           = ct;
+    m_measurementDifferenceVector.store(nullptr);
+    // assume that replacements are done with the same detector type (recalibration)
+  }
+}
+
+std::unique_ptr<Trk::MeasurementBase> 
+Trk::ProtoTrackStateOnSurface::checkoutMeasurement() 
 {
   if (!m_measurement) {
     std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkoutMeasurement!" << std::endl;
     return nullptr;
   }
-  const Trk::MeasurementBase* helper = m_measurement;
-  m_measurement = nullptr;
+ 
   m_measurementDifferenceVector.store(nullptr);
   if (!m_iOwnMeasurement) {
-    return helper->clone();
+    return m_measurement->uniqueClone();
   } else {
-    //  not needed : m_iOwnMeasurement=false;
-    return helper;
+    //const_cast is safe here, purely for reasons of interface; should be changed to shared_ptr later
+    auto ncMeasurement ATLAS_THREAD_SAFE = const_cast<Trk::MeasurementBase*>(m_measurement);
+    return std::unique_ptr<Trk::MeasurementBase>(ncMeasurement);
   }
 }
 
@@ -340,7 +335,6 @@ void Trk::ProtoTrackStateOnSurface::checkinParametersDifference ( const AmgVecto
   }
   m_parametersDifference     = inParametersDifference;
   m_iOwnParametersDifference = classShallOwnParametersDifference;
-//   m_mType           = Trk::TrackState::unidentified;
 }
 
 const AmgVector(5)* Trk::ProtoTrackStateOnSurface::checkoutParametersDifference()
@@ -388,64 +382,54 @@ const AmgSymMatrix(5)* Trk::ProtoTrackStateOnSurface::checkoutParametersCovarian
 }
 
 
-void Trk::ProtoTrackStateOnSurface::checkinForwardPar(const Trk::TrackParameters* par) 
+void 
+Trk::ProtoTrackStateOnSurface::checkinForwardPar(std::unique_ptr<const Trk::TrackParameters> par) 
 {
   if (m_forwardState) {
     std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkinForwardPar!" << std::endl;
-    delete m_forwardState;
   }
-  m_forwardState = par;
+  m_forwardState = std::move(par);
 }
 
-const Trk::TrackParameters* Trk::ProtoTrackStateOnSurface::checkoutForwardPar() 
-{
+std::unique_ptr<const Trk::TrackParameters>
+Trk::ProtoTrackStateOnSurface::checkoutForwardPar() {
   if (!m_forwardState) {
     std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkoutForwardPar!" << std::endl;
-    return nullptr;
   }
-  const Trk::TrackParameters* helper = m_forwardState;
-  m_forwardState = nullptr;
-  return helper;
+ return std::move(m_forwardState);
 }
 
-void Trk::ProtoTrackStateOnSurface::checkinSmoothedPar(const Trk::TrackParameters* par) 
+void 
+Trk::ProtoTrackStateOnSurface::checkinSmoothedPar(std::unique_ptr<const Trk::TrackParameters> par) 
 {
   if (m_smoothedState) {
     std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkinSmoothedPar!" << std::endl;
-    delete m_smoothedState;
   }
-  m_smoothedState = par;
+  m_smoothedState = std::move(par);
 }
 
-const Trk::TrackParameters* Trk::ProtoTrackStateOnSurface::checkoutSmoothedPar() 
-{
+std::unique_ptr<const Trk::TrackParameters> 
+Trk::ProtoTrackStateOnSurface::checkoutSmoothedPar() {
   if (!m_smoothedState) {
     std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkoutSmoothedPar!" << std::endl;
-    return nullptr;
   }
-  const Trk::TrackParameters* helper = m_smoothedState;
-  m_smoothedState = nullptr;
-  return helper;
+  return std::move(m_smoothedState);
 }
 
-void Trk::ProtoTrackStateOnSurface::checkinFitQuality(const Trk::FitQualityOnSurface* par) 
-{
+void 
+Trk::ProtoTrackStateOnSurface::checkinFitQuality(std::unique_ptr<const Trk::FitQualityOnSurface> par) {
   if (m_fitQuality) {
     std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkinFitQuality!" << std::endl;
-    delete m_fitQuality;
   }
-  m_fitQuality = par;
+  m_fitQuality = std::move(par);
 }
 
-const Trk::FitQualityOnSurface* Trk::ProtoTrackStateOnSurface::checkoutFitQuality() 
-{
+std::unique_ptr<const Trk::FitQualityOnSurface> 
+Trk::ProtoTrackStateOnSurface::checkoutFitQuality() {
   if (!m_fitQuality) {
     std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkoutFitQuality!" << std::endl;
-    return nullptr;
   }
-  const Trk::FitQualityOnSurface* helper = m_fitQuality;
-  m_fitQuality = nullptr;
-  return helper;
+  return std::move(m_fitQuality);
 }
 
 void Trk::ProtoTrackStateOnSurface::setForwardStateFitQuality(const FitQualityOnSurface& fq) 
@@ -464,45 +448,38 @@ void Trk::ProtoTrackStateOnSurface::backwardStateChiSquared(double c2)
 { m_backwardStateChi2 = c2; }
 
 
-void Trk::ProtoTrackStateOnSurface::checkinDNA_MaterialEffects(const Trk::DNA_MaterialEffects* mef) 
-{
+void 
+Trk::ProtoTrackStateOnSurface::checkinDNA_MaterialEffects(std::unique_ptr<const Trk::DNA_MaterialEffects> mef) {
   if (m_dnaMaterialEffects) {
     std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkinDNA_MaterialEffects!" << std::endl;
-    delete m_dnaMaterialEffects;
   }
-  m_dnaMaterialEffects = mef;
+  m_dnaMaterialEffects = std::move(mef);
 }
 
-const Trk::DNA_MaterialEffects* Trk::ProtoTrackStateOnSurface::checkoutDNA_MaterialEffects() 
+std::unique_ptr<const Trk::DNA_MaterialEffects> 
+Trk::ProtoTrackStateOnSurface::checkoutDNA_MaterialEffects() 
 {
   if (!m_dnaMaterialEffects) {
     std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkoutDNA_MaterialEffects!" << std::endl;
-    return nullptr;
   }
-  const Trk::DNA_MaterialEffects* helper = m_dnaMaterialEffects;
-  m_dnaMaterialEffects = nullptr;
-  return helper;
+  return std::move(m_dnaMaterialEffects);
 }
 
 
-void Trk::ProtoTrackStateOnSurface::checkinMaterialEffects(const Trk::ProtoMaterialEffects* mef)
-{
+void 
+Trk::ProtoTrackStateOnSurface::checkinMaterialEffects(std::unique_ptr<const Trk::ProtoMaterialEffects> mef){
   if (m_protoMaterialEffects) {
-    std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkinDNA_MaterialEffects!" << std::endl;
-    delete m_protoMaterialEffects;
+    std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkinMaterialEffects!" << std::endl;
   }
-  m_protoMaterialEffects = mef;
+  m_protoMaterialEffects = std::move(mef);
 }
 
-const Trk::ProtoMaterialEffects* Trk::ProtoTrackStateOnSurface::checkoutMaterialEffects()
-{
+std::unique_ptr<const Trk::ProtoMaterialEffects> 
+Trk::ProtoTrackStateOnSurface::checkoutMaterialEffects(){
   if (!m_protoMaterialEffects) {
-    std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkoutDNA_MaterialEffects!" << std::endl;
-    return nullptr;
+    std::cout << "ProtoTrackStateOnSurface >>> WARNING possibly bad use of ::checkoutMaterialEffects!" << std::endl;
   }
-  const Trk::ProtoMaterialEffects* helper = m_protoMaterialEffects;
-  m_protoMaterialEffects = nullptr;
-  return helper;
+  return std::move(m_protoMaterialEffects);
 }
 
 bool Trk::ProtoTrackStateOnSurface::isCluster() const
@@ -544,21 +521,20 @@ const Trk::TrackStateOnSurface* Trk::ProtoTrackStateOnSurface::createState(bool
   else if (!m_measurement && m_protoMaterialEffects) typePattern.set(TrackStateOnSurface::Scatterer);
   else return nullptr;
 
-  const Trk::MaterialEffectsBase* mefot = nullptr;
+  std::unique_ptr<const Trk::MaterialEffectsBase> mefot;
   if (m_dnaMaterialEffects) {
-    mefot = m_dnaMaterialEffects->makeMEFOT();
+    mefot=m_dnaMaterialEffects->makeUniqueMEFOT();
     typePattern.set(TrackStateOnSurface::BremPoint);
   } else if (m_protoMaterialEffects)
-    mefot = m_protoMaterialEffects->makeMEOT();
+    mefot=m_protoMaterialEffects->makeUniqueMEOT();
   if (isOutlier() && makeSlimOutlier) {
     return new TrackStateOnSurface(m_measurement ? checkoutMeasurement() : nullptr,
-                                   nullptr,nullptr,mefot,typePattern);
+                                   nullptr,nullptr,std::move(mefot),typePattern);
   } else {
     return new TrackStateOnSurface(m_measurement ? checkoutMeasurement() : nullptr,
                                    checkoutSmoothedPar(),
-// for testing                     checkoutForwardPar(),
                                    m_fitQuality ? checkoutFitQuality() : nullptr,
-                                   mefot,typePattern);
+                                   std::move(mefot),typePattern);
   }
 }
 
diff --git a/Tracking/TrkFitter/TrkFitterUtils/src/ProtoTrajectoryUtility.cxx b/Tracking/TrkFitter/TrkFitterUtils/src/ProtoTrajectoryUtility.cxx
index bebd21c6db74..7ab819e8defa 100755
--- a/Tracking/TrkFitter/TrkFitterUtils/src/ProtoTrajectoryUtility.cxx
+++ b/Tracking/TrkFitter/TrkFitterUtils/src/ProtoTrajectoryUtility.cxx
@@ -124,12 +124,12 @@ int Trk::ProtoTrajectoryUtility::numberOfMeasurements(const Trk::Trajectory& T,
 int Trk::ProtoTrajectoryUtility::rankedNumberOfMeasurements(const Trk::Trajectory& T) 
 {
   int number=0;
-  for (Trk::Trajectory::const_iterator it=T.begin(); it!=T.end(); it++)
-    if (!it->isOutlier() && it->measurement()) {
+  for (const auto & meas: T)
+    if (!meas.isOutlier() && meas.measurement()) {
       if ( dynamic_cast<const Trk::TrapezoidBounds*>
-           (&it->measurement()->associatedSurface().bounds()) ) ++number;
+           (&meas.measurement()->associatedSurface().bounds()) ) ++number;
       else
-        number += it->measurement()->localCovariance().cols();
+        number += meas.measurement()->localCovariance().cols();
     }
   return number;
 }
@@ -161,23 +161,23 @@ int Trk::ProtoTrajectoryUtility::numberOfSpecificStates
   using namespace Trk::TrackState;
   int number=0;
   if (ttype == AnyState)
-    for (Trk::Trajectory::const_iterator it=T.begin(); it!=T.end(); it++) {
-      if ( mtype==it->measurementType() ) ++number;
+    for (const auto & it:T) {
+      if ( mtype==it.measurementType() ) ++number;
     }
   else if (ttype == Fittable)
-    for (Trk::Trajectory::const_iterator it=T.begin(); it!=T.end(); it++) {
-      if (it->isOutlier()) continue;
-      if (mtype==unidentified ||  mtype==it->measurementType() ) ++number;
+    for (const auto & it: T) {
+      if (it.isOutlier()) continue;
+      if (mtype==unidentified ||  mtype==it.measurementType() ) ++number;
     }
   else 
-    for (Trk::Trajectory::const_iterator it=T.begin(); it!=T.end(); it++) {
-      if (!it->isNewOutlier()) continue;
+    for (const auto & it: T) {
+      if (!it.isNewOutlier()) continue;
       if ( (iterationNumber==0 
-            || iterationNumber==it->iterationShowingThisOutlier())
+            || iterationNumber==it.iterationShowingThisOutlier())
            &&
-           (mtype==unidentified   ||  mtype==it->measurementType() )
+           (mtype==unidentified   ||  mtype==it.measurementType() )
            &&
-           (ttype==GeneralOutlier ||  ttype==it->trackStateType() ) ) ++number;
+           (ttype==GeneralOutlier ||  ttype==it.trackStateType() ) ) ++number;
     }
   return number;
 }
@@ -204,19 +204,19 @@ void Trk::ProtoTrajectoryUtility::clearFitResultsAfterOutlier(Trk::Trajectory& T
   int c=1;
   for (Trk::Trajectory::iterator it=T.begin(); it!=T.end(); ++it, ++c) {
     // MBase pointer: never touch during outlier iterations.
-
+/*
     if (it->dnaMaterialEffects()) {
       // clear all dna after outlier and backward-dna also before outlier
       if ( ! it->dnaMaterialEffects()->foundByForwardFilter()
            || (c>=firststate) ) delete it->checkoutDNA_MaterialEffects();
-    }
-    if (it->smoothedTrackParameters()) delete it->checkoutSmoothedPar();
+    }*/
+    //if (it->smoothedTrackParameters()) delete it->checkoutSmoothedPar();
     if (c>=firststate) {
-      if (it->forwardTrackParameters()) delete it->checkoutForwardPar();
+      //if (it->forwardTrackParameters()) delete it->checkoutForwardPar();
       if (it->parametersDifference())   delete it->checkoutParametersDifference();
       if (it->parametersCovariance())   delete it->checkoutParametersCovariance();
     }
-    if (it->fitQuality()) delete it->checkoutFitQuality();
+    //if (it->fitQuality()) delete it->checkoutFitQuality();
     if (c>=firststate) it->setForwardStateFitQuality(0.0, 0.0);
     it->backwardStateChiSquared(0.0);
   }
@@ -233,21 +233,21 @@ void Trk::ProtoTrajectoryUtility::clearFitResultsAndReference(Trk::Trajectory& T
   int c=1;
   for (Trk::Trajectory::iterator it=T.begin(); it!=T.end(); ++it, ++c) {
     // MBase pointer: never touch during outlier iterations.
-
+/**
     if (it->dnaMaterialEffects()) {
       // clear all dna after outlier and backward-dna also before outlier
       if ( ! it->dnaMaterialEffects()->foundByForwardFilter()
            || (c>=firststate) ) delete it->checkoutDNA_MaterialEffects();
-    }
+    }**/
     if (c>=firststate) {
-      if (it->forwardTrackParameters()) delete it->checkoutForwardPar();
+      //if (it->forwardTrackParameters()) delete it->checkoutForwardPar();
       if (it->parametersDifference())   delete it->checkoutParametersDifference();
       if (it->parametersCovariance())   delete it->checkoutParametersCovariance();
       if (it->referenceParameters())    delete it->checkoutReferenceParameters();
       if (it->jacobian())               delete it->checkoutTransportJacobian();
     }
-    if (it->smoothedTrackParameters()) delete it->checkoutSmoothedPar();
-    if (it->fitQuality()) delete it->checkoutFitQuality();
+    //if (it->smoothedTrackParameters()) delete it->checkoutSmoothedPar();
+    //if (it->fitQuality()) delete it->checkoutFitQuality();
     if (c>=firststate) it->setForwardStateFitQuality(0.0, 0.0);
     it->backwardStateChiSquared(0.0);
   }
@@ -261,9 +261,9 @@ void Trk::ProtoTrajectoryUtility::clearFitResultsAndReference(Trk::Trajectory& T
 void Trk::ProtoTrajectoryUtility::defineMeasurementsExceptThis(Trk::Trajectory& T,
                                                                int outlierState) 
 {
-  for (Trk::Trajectory::iterator it=T.begin(); it!=T.end(); it++) {
-    if (it->isNewOutlier() && it->positionOnTrajectory()!=outlierState) it->isOutlier(false);
-    if (it->positionOnTrajectory()==outlierState) it->isOutlier(Trk::TrackState::PredictedOutlier,1);
+  for (auto & it: T) {
+    if (it.isNewOutlier() && it.positionOnTrajectory()!=outlierState) it.isOutlier(false);
+    if (it.positionOnTrajectory()==outlierState) it.isOutlier(Trk::TrackState::PredictedOutlier,1);
   }
 }
 
@@ -273,12 +273,12 @@ Trk::ProtoTrajectoryUtility::forwardFilterQuality(const Trk::Trajectory& T,
 {
   double chisquared=0.0;
   double ndof = 0.0;
-  for (Trk::Trajectory::const_iterator it=T.begin(); it!=T.end(); it++) {
-    if (!it->isOutlier()
+  for (const auto & it: T) {
+    if (!it.isOutlier()
         && (select == Trk::TrackState::unidentified
-            || select == it->measurementType())) {
-      if (it->forwardStateChiSquared() >= 0.0) chisquared += it->forwardStateChiSquared();
-      ndof       += it->forwardStateNumberDoF();
+            || select == it.measurementType())) {
+      if (it.forwardStateChiSquared() >= 0.0) chisquared += it.forwardStateChiSquared();
+      ndof       += it.forwardStateNumberDoF();
     }
   }
   int    ndof_int = ndof>5 ? (int)(ndof-5.0) : 0;
@@ -298,45 +298,44 @@ void Trk::ProtoTrajectoryUtility::identifyMeasurements(Trk::Trajectory& T) const
 {
   if (m_idHelper==nullptr) return;
   Trk::MeasurementTypeID helper = MeasurementTypeID(m_idHelper);
-  for( Trk::Trajectory::iterator it = T.begin(); it!=T.end(); it++) {
-    Trk::TrackState::MeasurementType measType = helper.defineType(it->measurement());
-    it->setMeasurementType(measType, Trk::TrackState::CalibrationNotKnown);
+  for( auto & it: T) {
+    Trk::TrackState::MeasurementType measType = helper.defineType(it.measurement());
+    it.setMeasurementType(measType, Trk::TrackState::CalibrationNotKnown);
   }
 }
 
 void Trk::ProtoTrajectoryUtility::dumpTrajectory(const Trk::Trajectory& T, const std::string& name) const
 {
   std::cout << name << "'s internal trajectory:" << std::endl;
-  for (Trk::Trajectory::const_iterator it=T.begin(); it!=T.end(); it++) {
-    std::cout<< (it->positionOnTrajectory()>9?" T":" T0") << it->positionOnTrajectory()
-             << (it->measurement()? (it->isOutlier()?(it->isNewOutlier()? " Ou ":" Ol "):" Ms "):" -- ");
-    if ( it->dnaMaterialEffects() )
-      std::cout << (it->dnaMaterialEffects()->foundByForwardFilter() ? "dnaF " : "dnaB ");
-    else if ( it->materialEffects() )
+  for (const auto & it: T) {
+    std::cout<< (it.positionOnTrajectory()>9?" T":" T0") << it.positionOnTrajectory()
+             << (it.measurement()? (it.isOutlier()?(it.isNewOutlier()? " Ou ":" Ol "):" Ms "):" -- ");
+    if ( it.dnaMaterialEffects() )
+      std::cout << (it.dnaMaterialEffects()->foundByForwardFilter() ? "dnaF " : "dnaB ");
+    else if ( it.materialEffects() )
       std::cout    << "MatL ";
     else std::cout << "--   ";
-    std::cout<< (it->referenceParameters()?"R":"-") << (it->jacobian()?"J ":"- ") ;
-    if (it->forwardTrackParameters()) std::cout<< "fP ";
-    else if (it->parametersDifference()) std::cout << (it->parametersCovariance()?"dC ":"d- ");
+    std::cout<< (it.referenceParameters()?"R":"-") << (it.jacobian()?"J ":"- ") ;
+    if (it.forwardTrackParameters()) std::cout<< "fP ";
+    else if (it.parametersDifference()) std::cout << (it.parametersCovariance()?"dC ":"d- ");
     else std::cout << "-- ";
-    std::cout<< (it->smoothedTrackParameters()? "sP ":"-- ")
-             << (it->fitQuality()? "fQ  ":"--  ");
+    std::cout<< (it.smoothedTrackParameters()? "sP ":"-- ")
+             << (it.fitQuality()? "fQ  ":"--  ");
 
     // FIXME decide if this stays in or not
-    if (it->backwardStateChiSquared() > 0.0)
+    if (it.backwardStateChiSquared() > 0.0)
       std::cout << "% "
                 << std::setiosflags(std::ios::fixed | std::ios::showpoint | std::ios::right )
-                << std::setw(5) << /*std::setprecision(1) <<*/ it->forwardStateChiSquared() << "  "
-                << std::setw(5) << /*std::setprecision(1) <<*/ it->backwardStateChiSquared() << " % ";
-    //                << (it->fitQuality()? it->fitQuality()->chiSquared() : 0.0 ) << "  ";
+                << std::setw(5) << it.forwardStateChiSquared() << "  "
+                << std::setw(5) << it.backwardStateChiSquared() << " % ";
 
     // identify the type of measurement
-    if ( it->identify().is_valid() && m_idHelper!=nullptr) {
-      std::string detIdString = m_idHelper->print_to_string(it->identify());
+    if ( it.identify().is_valid() && m_idHelper!=nullptr) {
+      std::string detIdString = m_idHelper->print_to_string(it.identify());
       int iCutStart = (detIdString.substr(0,10) == "InnerDetec" ) ? 14 : 17;
-      std::cout /*<<it->identify()<<","*/ << detIdString.substr(iCutStart,85) << std::endl;
-    } else if (nullptr != dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(it->measurement())) {
-      const Trk::LocalParameters& P = it->measurement()->localParameters();
+      std::cout << detIdString.substr(iCutStart,85) << std::endl;
+    } else if (nullptr != dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(it.measurement())) {
+      const Trk::LocalParameters& P = it.measurement()->localParameters();
       std::cout << "PseudoMeasurement of dim " << P.dimension() << " containing ( ";
       if (P.contains(Trk::locX)) std::cout << "loc1 ";
       if (P.contains(Trk::locY)) std::cout << "loc2 ";
@@ -344,16 +343,16 @@ void Trk::ProtoTrajectoryUtility::dumpTrajectory(const Trk::Trajectory& T, const
       if (P.contains(Trk::theta)) std::cout << "theta ";
       if (P.contains(Trk::qOverP)) std::cout << "qOvP";
       std::cout << ")" << std::endl;
-    } else if (nullptr != dynamic_cast<const Trk::Segment*>(it->measurement())) {
-      const Trk::Segment* S = dynamic_cast<const Trk::Segment*>(it->measurement());
-      const Trk::LocalParameters& P = it->measurement()->localParameters();
+    } else if (nullptr != dynamic_cast<const Trk::Segment*>(it.measurement())) {
+      const Trk::Segment* S = dynamic_cast<const Trk::Segment*>(it.measurement());
+      const Trk::LocalParameters& P = it.measurement()->localParameters();
       std::cout << "Track Segment with of rank " << P.dimension() << " containing "
                 << S->numberOfMeasurementBases() << " internal meas'ts."<<std::endl;
-    } else if (it->materialEffects()) {
-      std::cout << "Material layer thick="<<it->materialEffects()->x0()<<" with dE="
-                << it->materialEffects()->deltaE()<<" +- "<<it->materialEffects()->sigmaDeltaE()
-                << ", dPhi=" << it->materialEffects()->deltaPhi()<<" +- "<<it->materialEffects()->sigmaDeltaPhi()
-                << ", dTheta="<< it->materialEffects()->deltaTheta()<<" +- "<<it->materialEffects()->sigmaDeltaTheta()<<std::endl;
+    } else if (it.materialEffects()) {
+      std::cout << "Material layer thick="<<it.materialEffects()->x0()<<" with dE="
+                << it.materialEffects()->deltaE()<<" +- "<<it.materialEffects()->sigmaDeltaE()
+                << ", dPhi=" << it.materialEffects()->deltaPhi()<<" +- "<<it.materialEffects()->sigmaDeltaPhi()
+                << ", dTheta="<< it.materialEffects()->deltaTheta()<<" +- "<<it.materialEffects()->sigmaDeltaTheta()<<std::endl;
     } else std::cout << std::endl;
   }
 }
diff --git a/Tracking/TrkFitter/TrkFitterUtils/src/TrackFitInputPreparator.cxx b/Tracking/TrkFitter/TrkFitterUtils/src/TrackFitInputPreparator.cxx
index 41b0512de1f5..1fbe039426a5 100755
--- a/Tracking/TrkFitter/TrkFitterUtils/src/TrackFitInputPreparator.cxx
+++ b/Tracking/TrkFitter/TrkFitterUtils/src/TrackFitInputPreparator.cxx
@@ -18,6 +18,7 @@
 #include "TrkExInterfaces/IExtrapolator.h"
 #include "TrkToolInterfaces/IUpdator.h"
 #include "TrkFitterUtils/ProtoMaterialEffects.h"
+#include "TrkFitterUtils/DNA_MaterialEffects.h"
 
 // using __gnu_cxx::is_sorted;
 
@@ -496,7 +497,7 @@ void Trk::TrackFitInputPreparator::insertStateIntoTrajectory(Trajectory& traject
                             const TrackParameters* initialParameters,
                             const ParticleHypothesis&  partHypo ) const {
     const TrackParameters* trkPar = nullptr;
-    Trk::ProtoMaterialEffects* matEffOnMeasurementSurface = nullptr;
+    std::unique_ptr<Trk::ProtoMaterialEffects> matEffOnMeasurementSurface;
     /// collect material layers between previous state and state to insert:
     if (m_extrapolator) {
         if (!trajectory.empty()) {
@@ -529,7 +530,7 @@ void Trk::TrackFitInputPreparator::insertStateIntoTrajectory(Trajectory& traject
                                                     nullptr,
                                                     tsos->trackParameters()->clone()
                                                   ));
-                            trajectory.back().checkinMaterialEffects(new Trk::ProtoMaterialEffects(meot));
+                            trajectory.back().checkinMaterialEffects(std::make_unique<Trk::ProtoMaterialEffects>(meot));
                             trajectory.back().isOutlier(TrackState::Scatterer);
                         } // end if meot
                     }
@@ -539,7 +540,7 @@ void Trk::TrackFitInputPreparator::insertStateIntoTrajectory(Trajectory& traject
                 if (collectedTSOS->back()->materialEffectsOnTrack()) {
                     const MaterialEffectsOnTrack* meot = dynamic_cast<const MaterialEffectsOnTrack*>(collectedTSOS->back()->materialEffectsOnTrack());
                     if (meot) {
-                        matEffOnMeasurementSurface = new Trk::ProtoMaterialEffects(meot);
+                        matEffOnMeasurementSurface = std::make_unique<Trk::ProtoMaterialEffects>(meot);
                     }
                 } // end if last TSoS has material effects
                 delete collectedTSOS->back();
@@ -570,7 +571,7 @@ void Trk::TrackFitInputPreparator::insertStateIntoTrajectory(Trajectory& traject
                                                   ));
     trajectory.back().identifier(Trk::IdentifierExtractor::extract(measurement));
     if (matEffOnMeasurementSurface) {
-        trajectory.back().checkinMaterialEffects(matEffOnMeasurementSurface);
+        trajectory.back().checkinMaterialEffects(std::move(matEffOnMeasurementSurface));
     }
 
 }
diff --git a/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardKalmanFitter.cxx b/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardKalmanFitter.cxx
index b41d5d61381e..e75d7733f99e 100755
--- a/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardKalmanFitter.cxx
+++ b/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardKalmanFitter.cxx
@@ -294,28 +294,34 @@ Trk::ForwardKalmanFitter::fit(Trk::Trajectory& trajectory,
       return FitterStatusCode::BadInput;
     }
 
-    const Trk::TrackParameters* predPar = it->checkoutForwardPar(); // get ownership right for main loop.
-    if (it->dnaMaterialEffects()) delete it->checkoutDNA_MaterialEffects();
-
+    auto predPar = it->checkoutForwardPar(); // get ownership right for main loop.
+    const Trk::TrackParameters * pTrackParam = predPar.get();
     FitterStatusCode stepFwF =
       this->buildAndAnalyseTrajectory(trajectory,it,updatedPar /*=nullptr pointer*/,
-                                      predPar, controlledMatEffects,itcounter,
+                                      pTrackParam, controlledMatEffects,itcounter,
                                       bremStateIfBremFound,allowRecalibrate);
+    predPar.reset(pTrackParam);
     if (stepFwF.isFailure()) {
       ATH_MSG_INFO ("-F- first buildAndAnalyseTrajectory() failed.");
-      it->checkinForwardPar(predPar);
+      it->checkinForwardPar(std::move(predPar));//predPar dies here and the function returns
       return stepFwF;
     }
-    if (filterStartState == 0 )
-      stepFwF = this->updateOrSkip(it,updatedPar,predPar /* check in again to trajectory*/,
+    if (filterStartState == 0 ){
+      pTrackParam = predPar.get();
+      stepFwF = this->updateOrSkip(it,updatedPar,pTrackParam /* check in again to trajectory*/,
                                    1,runOutlier,bremStateIfBremFound);
-    else
-      stepFwF = this->updateOrSkip(it,updatedPar,predPar /* check in again to trajectory*/,
+      predPar.reset(pTrackParam);
+    } else {
+      pTrackParam = predPar.get();
+      stepFwF = this->updateOrSkip(it,updatedPar,pTrackParam /* check in again to trajectory*/,
                                    filterStartState,runOutlier,bremStateIfBremFound);
+      predPar.reset(pTrackParam);
+    }
     if (stepFwF.isFailure()) {
       ATH_MSG_DEBUG ("-F- first updateOrSkip() failed.");
-      it->checkinForwardPar(predPar);
-      delete updatedPar; return stepFwF;
+      it->checkinForwardPar(std::move(predPar));
+      delete updatedPar; 
+      return stepFwF;
     }
     itcounter = it->positionOnTrajectory()+1;
     ++it;
@@ -534,26 +540,26 @@ Trk::FitterStatusCode Trk::ForwardKalmanFitter::buildAndAnalyseTrajectory
   ////////////////////////////////////////////////////////////////////
   // search for brem and adjust the error according to target measurement (brem fit)
   if (filterCounter>2) {
-    const Trk::DNA_MaterialEffects* updMomNoise = nullptr;
+    std::unique_ptr<const Trk::DNA_MaterialEffects> updMomNoise;
     if (controlledMatEffects.doDNA()) {
       Trk::IDynamicNoiseAdjustor::State state{};
-      updMomNoise = m_dynamicNoiseAdjustor->DNA_Adjust(
+      updMomNoise.reset(m_dynamicNoiseAdjustor->DNA_Adjust(
         state,
         predPar,             // change according to where meas is
         updatedPar,          // re-start from old pars
         fittableMeasurement, // the meas't
         controlledMatEffects,
-        Trk::alongMomentum);
+        Trk::alongMomentum));
     }
     if (updMomNoise) {
       Trk::Trajectory::iterator b = Trk::ProtoTrajectoryUtility::previousFittableState(T, predictedState);
       if (b!=T.end()) {
-        b->checkinDNA_MaterialEffects(updMomNoise);
-        bremEffectsState = &(*b);
         ATH_MSG_VERBOSE ("-F- DNA kicked in at t/X0 of " << updMomNoise->thicknessInX0() <<
                          " with noise " << updMomNoise->addSigmaQoverP());
+        b->checkinDNA_MaterialEffects(std::move(updMomNoise));
+        bremEffectsState = &(*b);
+        
       }
-      else delete updMomNoise;
     }
   }
 
@@ -687,7 +693,9 @@ Trk::FitterStatusCode Trk::ForwardKalmanFitter::updateOrSkip
           );
       fittableMeasurement = predictedState->measurement();
       ATH_MSG_DEBUG ("Broadened TRT hit instead of outlier");
-      delete updatedPar; delete fitQuality; fitQuality=nullptr;
+      delete updatedPar; 
+      delete fitQuality; 
+      fitQuality=nullptr;
       ////////////////////////////////////////////////////////////////////
       // make the update
       updatedPar = m_updator->addToState(*predPar, fittableMeasurement->localParameters(),
@@ -725,13 +733,15 @@ Trk::FitterStatusCode Trk::ForwardKalmanFitter::updateOrSkip
       return FitterStatusCode::BadInput;
     }
     // copy over prePar to updatedPar because we ignore this update
-    if (bremEffectsState!=nullptr) delete bremEffectsState->checkoutDNA_MaterialEffects();
+    if (bremEffectsState!=nullptr){
+      auto p = bremEffectsState->checkoutDNA_MaterialEffects();
+    }
     delete updatedPar;
     updatedPar = predPar->clone();
-    // delete predPar; done by ProtoTrackStateOnSurface
   } // end if fitQuality OK
   if (fitQuality) predictedState->setForwardStateFitQuality(*fitQuality);
-  predictedState->checkinForwardPar(predPar);
+  auto uniquePar = std::unique_ptr<const Trk::TrackParameters>(predPar);
+  predictedState->checkinForwardPar(std::move(uniquePar));
   delete fitQuality;
   return FitterStatusCode::Success;
 }
@@ -753,8 +763,8 @@ Trk::FitterStatusCode Trk::ForwardKalmanFitter::enterSeedIntoTrajectory
   Trk::Trajectory::iterator ffs = Trk::ProtoTrajectoryUtility::firstFittableState(trajectory);
   if (ffs->forwardTrackParameters() || ffs->referenceParameters()) {
     ATH_MSG_WARNING (" wrong input? Dont call enterSeedIntoTrajectory on a full trajectory");
-    if (ffs->forwardTrackParameters()) delete ffs->checkoutForwardPar();
-    if (ffs->referenceParameters()) delete ffs->checkoutReferenceParameters();
+    if (ffs->forwardTrackParameters()) { [[maybe_unused]] auto p = ffs->checkoutForwardPar();}
+    if (ffs->referenceParameters()){ [[maybe_unused]] auto p = ffs->checkoutReferenceParameters();}
   }
   if (ffs->measurement() == nullptr) {
     ATH_MSG_WARNING ("-Fe mess-up in enterSeedIntoTraj: can not find a first measurement!");
@@ -809,9 +819,9 @@ Trk::FitterStatusCode Trk::ForwardKalmanFitter::enterSeedIntoTrajectory
   }
   const AmgVector(5)& par = inputParAtStartSurface->parameters();
   // TODO: check does one need covariance here?
-  const Trk::TrackParameters* seedPar = CREATE_PARAMETERS((*inputParAtStartSurface),par, cov).release();
+  auto seedPar = CREATE_PARAMETERS((*inputParAtStartSurface),par, cov);
   if (inputParAtStartSurface != &inputPar) delete inputParAtStartSurface;
-  ffs->checkinForwardPar(seedPar);
+  ffs->checkinForwardPar(std::move(seedPar));
   ATH_MSG_VERBOSE ("-Fe prepared trajectory with seed parameters on state "<<ffs->positionOnTrajectory());
 
   return FitterStatusCode::Success;
diff --git a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanFitter.cxx b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanFitter.cxx
index 50c95a7b08d5..8e789008fcce 100755
--- a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanFitter.cxx
+++ b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanFitter.cxx
@@ -1233,7 +1233,7 @@ bool Trk::KalmanFitter::prepareNextIteration(const unsigned int& upcomingIterati
                                              int& iFilterBeginState,
                                              const Trk::TrackParameters& backupParams) const
 {
-  const Trk::TrackParameters* newSeedPars = nullptr;
+  std::unique_ptr<Trk::TrackParameters> newSeedPars;
   ATH_MSG_VERBOSE ("In ::prepareNextIteration with filterBeginState = "<<iFilterBeginState);
 
   // get chi2 asymmetry
@@ -1264,7 +1264,7 @@ bool Trk::KalmanFitter::prepareNextIteration(const unsigned int& upcomingIterati
         (covN)(i,i) = (*cov)(i,i) < m_cov0[i] ? (*cov)(i,i)*scale : m_cov0[i];
       }
       newSeedPars = CREATE_PARAMETERS(*resultFromPreviousIter,
-                                      resultFromPreviousIter->parameters(),covN).release();
+                                      resultFromPreviousIter->parameters(),covN);
     }
   }
 
@@ -1276,8 +1276,7 @@ bool Trk::KalmanFitter::prepareNextIteration(const unsigned int& upcomingIterati
       AmgVector(5)* x = new AmgVector(5)(newSeedPars->parameters()-ffs->referenceParameters()->parameters());
       ffs->checkinParametersDifference(x);
       ffs->checkinParametersCovariance(new AmgSymMatrix(5)(*newSeedPars->covariance()));
-      delete newSeedPars; // FIXME can be made without this new/delete.
-    } else ffs->checkinForwardPar(newSeedPars);
+    } else ffs->checkinForwardPar(std::move(newSeedPars));
     ATH_MSG_VERBOSE ("made new seed parameters");
     // FIXME consider remaking the reference here
 
diff --git a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanPiecewiseAnnealingFilter.cxx b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanPiecewiseAnnealingFilter.cxx
index 0e35ce37ad53..493a797efa01 100644
--- a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanPiecewiseAnnealingFilter.cxx
+++ b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanPiecewiseAnnealingFilter.cxx
@@ -6,7 +6,7 @@
 // KalmanPiecewiseAnnealingFilter.cxx, (c) ATLAS Detector software
 ///////////////////////////////////////////////////////////////////
 
-#include <memory>
+
 
 
 
@@ -22,7 +22,7 @@
 #include "TrkFitterUtils/ProtoMaterialEffects.h"
 #include "TrkEventUtils/RoT_Extractor.h"
 #include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
-
+#include <memory>
 //================ Constructor =================================================
 
 Trk::KalmanPiecewiseAnnealingFilter::KalmanPiecewiseAnnealingFilter(const std::string& t,
@@ -368,9 +368,9 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece
   //////////////////////////////////////////////////////////////////////////////
   // step 1: make first loop while turning ROT/PRDs into competing ones
   //////////////////////////////////////////////////////////////////////////////
-  const TrackParameters* predPar     = nullptr;
+  std::unique_ptr<const TrackParameters> predPar;
   std::unique_ptr<const AmgVector(5)> predDiffPar;
-  const TrackParameters* updatedPar  = nullptr;
+  std::unique_ptr<const TrackParameters> updatedPar;
   bool end_reached = false;
   bool hadAnnealingProblemDC = false;
   bool hadAnnealingProblem   = false;
@@ -383,27 +383,27 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece
     if (iDafSteps == 1) {
       if (input_it->referenceParameters()) {
         if (start_predPar) {
-          predPar = start_predPar->clone();
+          predPar = start_predPar->uniqueClone();
           predDiffPar = std::make_unique<AmgVector(5)>(  start_predPar->parameters()
                                                - start->referenceParameters()->parameters() );
         } else {
           predDiffPar.reset(  start->checkoutParametersDifference() );
           predPar = CREATE_PARAMETERS(*start->referenceParameters(),
                                       (start->referenceParameters()->parameters() + (*predDiffPar)),
-                                      AmgSymMatrix(5)(*start->parametersCovariance())).release();
+                                      AmgSymMatrix(5)(*start->parametersCovariance()));
           delete start->checkoutParametersCovariance();
         }
       } else {
-        if (start_predPar) predPar     = start_predPar->clone();
+        if (start_predPar) predPar     = start_predPar->uniqueClone();
         else predPar = start->checkoutForwardPar();
       }
     } else {
       if (!input_it->referenceParameters()) {
         // filter using extrapolator
-        predPar = m_extrapolator->extrapolate(*updatedPar,
+        predPar.reset((m_extrapolator->extrapolate(*updatedPar,
 					      *input_it->surface(),
 					      Trk::alongMomentum,
-					      false, particleType);
+					      false, particleType)));
       } else {
         // filter using differences
         const TransportJacobian& jac = *m_trajPiece.back().jacobian();
@@ -430,12 +430,12 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece
             << input_it->referenceParameters()->parameters()[Trk::qOverP]
             << ", qOverP_diff=" << (*predDiffPar)(Trk::qOverP)
             << ", sigmaDeltaE=" << input_it->materialEffects()->sigmaDeltaE()
-            << ", sigmaDeltaQoverP=" << sqrt(sigmaDeltaQoverPsquared)
+            << ", sigmaDeltaQoverP=" << std::sqrt(sigmaDeltaQoverPsquared)
             << std::fixed); // std::defaultfloat);
           ATH_MSG_VERBOSE ("Added material effects.");
         }
         const AmgVector(5) x = input_it->referenceParameters()->parameters()+(*predDiffPar);
-        predPar = CREATE_PARAMETERS(*input_it->referenceParameters(),x,C).release();
+        predPar = std::move(CREATE_PARAMETERS(*input_it->referenceParameters(),x,C));
         ATH_MSG_DEBUG("used difference to make predpar = " << *predPar);
       }
     }
@@ -443,7 +443,6 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece
     if (!predPar) {
       ATH_MSG_INFO ("lost track piece in filterTrajPiece() annealing "<<beta <<
 		    " and node " << iDafSteps );
-      delete updatedPar;
       m_trajPiece.clear();
       return Trk::FitterStatusCode::ForwardFilterFailure;
     }
@@ -460,7 +459,7 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece
       else {
         m_trajPiece.push_back(ProtoTrackStateOnSurface());
         m_trajPiece.back().checkinMaterialEffects
-              (new Trk::ProtoMaterialEffects(*input_it->materialEffects()));
+              (std::make_unique<Trk::ProtoMaterialEffects>(*input_it->materialEffects()));
         m_trajPiece.back().isOutlier(TrackState::Scatterer);
         m_trajPiece.back().positionOnTrajectory(iDafSteps);
       }
@@ -475,7 +474,6 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece
 	m_compRotTool->createSimpleCompetingROT(*testROT->prepRawData(),*predPar,beta);
       if (!highBetaCluster) {
 	ATH_MSG_DEBUG ("CompROT creation failed in filterTrajPiece() annealing " <<beta);
-	delete updatedPar;
 	m_trajPiece.clear();
 	return Trk::FitterStatusCode::ForwardFilterFailure; // not really... don't have other.
       }
@@ -502,17 +500,14 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece
     }
 
     if (input_it->isOutlier() || !m_trajPiece.back().measurement() ) {
-      delete updatedPar;
-      updatedPar = predPar;
-      predPar    = nullptr;
+      updatedPar = std::move(predPar);
     } else {
-      m_trajPiece.back().checkinForwardPar(predPar);
-      delete updatedPar;
+      m_trajPiece.back().checkinForwardPar(std::move(predPar));
       FitQualityOnSurface* fitQuality=nullptr;
-      updatedPar = m_updator->addToState(*predPar,
+      updatedPar = std::move( m_updator->addToState(*predPar,
 					 m_trajPiece.back().measurement()->localParameters(),
 					 m_trajPiece.back().measurement()->localCovariance(),
-					 fitQuality).release();
+					 fitQuality));
       if (!updatedPar) {
 	ATH_MSG_DEBUG ("addToState failed in filterTrajPiece(), annealing "<<beta);
 	m_trajPiece.clear();
@@ -527,7 +522,6 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece
     end_reached = (iDafSteps >= pieceSize)
       || (input_it+1 == trajectory.end());
   }
-  delete updatedPar;
 
   FitQuality  currForwardFQ = Trk::ProtoTrajectoryUtility::forwardFilterQuality(m_trajPiece);
   m_chi2DuringAnnealing[0] = currForwardFQ.numberDoF()>0 ?
@@ -792,7 +786,7 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece
     }
     if (start_updatedPar) { // only for piecewise-modus
       delete start_updatedPar;
-      start_updatedPar = lastStateOnPiece->checkoutSmoothedPar();
+      start_updatedPar = lastStateOnPiece->checkoutSmoothedPar().release();
     }
     const Trk::RIO_OnTrack* rot;
     Trk::RoT_Extractor::extract(rot,resumeKfState->measurement());
diff --git a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanSmoother.cxx b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanSmoother.cxx
index c65ecd22a656..ac9f55861e1f 100755
--- a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanSmoother.cxx
+++ b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanSmoother.cxx
@@ -194,7 +194,7 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fit(Trk::Trajectory&              tra
 
   // take care of different fit Quality objects in place during smoothing:
   //
-  Trk::FitQualityOnSurface* fitQual = nullptr;               // FQ of a given smoothed state
+  std::unique_ptr<const Trk::FitQualityOnSurface> fitQual;               // FQ of a given smoothed state
   Trk::FitQualityOnSurface* trackQualityIncrement = nullptr; // increment to build total fitQ
   if (trackFitQuality) {                               // object to hold total fit quality
     ATH_MSG_WARNING ("fitQuality pointer is not NULL, cancel Kalman fit to prevent mem leak!");
@@ -218,15 +218,17 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fit(Trk::Trajectory&              tra
   const TrackParameters*     forwardTPar  = lastPredictedState->forwardTrackParameters();
   int    previousStatePosOnTraj = lastPredictedState->positionOnTrajectory();
   ATH_MSG_VERBOSE ("create smoothed state at end of track by adding the last meas't");
-  std::unique_ptr<const TrackParameters> smooPar;
+  std::unique_ptr<TrackParameters> smooPar;
   double smooPar_eta_for_monitoring=1000.;
-  if (!fittableMeasurement || !forwardTPar)
+  if (!fittableMeasurement || !forwardTPar){
     m_utility->dumpTrajectory(trajectory, "DAF-inconsistency");
   // first smoothed TrkParameter is last forward prediction updated with last MBase
-  else smooPar= m_updator->addToState(*forwardTPar,
-					     fittableMeasurement->localParameters(),
-					     fittableMeasurement->localCovariance(),
-                                             fitQual);
+  } else {
+    Trk::FitQualityOnSurface * returnFitQual{};
+    smooPar = m_updator->addToState(*forwardTPar,fittableMeasurement->localParameters(),
+					     fittableMeasurement->localCovariance(), returnFitQual);
+		fitQual.reset(returnFitQual);
+  }
   if (msgLvl(MSG::INFO)) monitorTrackFits( Call, ( forwardTPar ? forwardTPar->eta() : 1000. ) );
   if(!smooPar) {
     ATH_MSG_WARNING ("first smoother update failed, reject track");
@@ -238,8 +240,8 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fit(Trk::Trajectory&              tra
     if (msgLvl(MSG::INFO)) monitorTrackFits( FitQualityFailure, ( forwardTPar ? forwardTPar->eta() : 1000. ) );
     return FitterStatusCode::FitQualityFailure;
   }
-  lastPredictedState->checkinSmoothedPar(smooPar.release());
-  lastPredictedState->checkinFitQuality(fitQual);
+  lastPredictedState->checkinSmoothedPar(std::move(smooPar));
+  lastPredictedState->checkinFitQuality(std::move(fitQual));
   if (!lastPredictedState->smoothedTrackParameters()->covariance()) {
     ATH_MSG_INFO ("forward kalman filter has no error - eject track");
     if (msgLvl(MSG::INFO)) monitorTrackFits( MissingCovariance, ( forwardTPar ? forwardTPar->eta() : 1000. ) );
@@ -343,27 +345,27 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fit(Trk::Trajectory&              tra
 
       ////////////////////////////////////////////////////////////////////
       // adjust the momentum + error according to target measurement (brem fit)
-      const Trk::DNA_MaterialEffects* detectedMomentumNoise = nullptr;
+      std::unique_ptr<const Trk::DNA_MaterialEffects> detectedMomentumNoise;
       Trk::Trajectory::reverse_iterator stateWithNoise
         = Trk::ProtoTrajectoryUtility::previousFittableState(trajectory, rit);
       if (kalMec.doDNA() && stateWithNoise!=trajectory.rend()) {
         const TrackParameters *predPar_temp=predPar.release();
         const TrackParameters *updatedPar_temp=updatedPar.release();
         Trk::IDynamicNoiseAdjustor::State state{};
-        detectedMomentumNoise = m_dynamicNoiseAdjustor->DNA_Adjust(
+        detectedMomentumNoise.reset( m_dynamicNoiseAdjustor->DNA_Adjust(
           state,
           predPar_temp,        // change according to where meas is
           updatedPar_temp,     // previous state's pars (start)
           fittableMeasurement, // the meas't
           kalMec,
           Trk::oppositeMomentum,
-          stateWithNoise->dnaMaterialEffects());
+          stateWithNoise->dnaMaterialEffects()));
         predPar.reset(predPar_temp);
         updatedPar.reset(updatedPar_temp);
       }
       if (msgLvl(MSG::DEBUG))
         printGlobalParams(rit->positionOnTrajectory(), "  pred", predPar.get(),
-                          detectedMomentumNoise );
+                          detectedMomentumNoise.get() );
       // update track parameters (allows for preset LR solution for straws)
       updatedPar = m_updator->addToState(*predPar,
                                          fittableMeasurement->localParameters(),
@@ -391,13 +393,13 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fit(Trk::Trajectory&              tra
         ATH_MSG_VERBOSE ("Identified state" << (rit->positionOnTrajectory()>9? " " : " 0")<<
                          rit->positionOnTrajectory() << " as last fittable state.");
         //clone here, as updatedPar is used on next iteration and would be invalid if moved
-        smooPar.reset( updatedPar->clone() );
+        smooPar=std::move( updatedPar->uniqueClone() );
       } else {
         if (m_doSmoothing) {
           forwardTPar = rit->forwardTrackParameters();
           smooPar = m_updator->combineStates(*forwardTPar, *updatedPar);
         } else {
-          smooPar.reset( updatedPar->clone() );
+          smooPar=std::move(updatedPar->uniqueClone() );
         }
       }
       if (!smooPar) {
@@ -405,7 +407,7 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fit(Trk::Trajectory&              tra
         return FitterStatusCode::CombineStatesFailure;
       }
       // get FitQualityOnSurface
-      fitQual    = const_cast<Trk::FitQualityOnSurface*>(m_updator->fullStateFitQuality
+      fitQual.reset(m_updator->fullStateFitQuality
 							 ( *smooPar, fittableMeasurement->localParameters(),
 							   fittableMeasurement->localCovariance() ));
       if (!fitQual) {
@@ -418,14 +420,12 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fit(Trk::Trajectory&              tra
       // write the smoothed state onto the internal Trajectory data format
       // remember smooPar eta for monitoring
       smooPar_eta_for_monitoring = smooPar->eta();
-      rit->checkinSmoothedPar(smooPar.release() );
-      rit->checkinFitQuality(fitQual);
+      rit->checkinSmoothedPar(std::move(smooPar));
+      rit->checkinFitQuality(std::move(fitQual));
       if (msgLvl(MSG::DEBUG)) printGlobalParams(previousStatePosOnTraj, "  smoo", rit->smoothedTrackParameters() );
       // write also possible material effects onto Trajectory
       if (detectedMomentumNoise) {
-        if (stateWithNoise->dnaMaterialEffects())
-          delete stateWithNoise->checkoutDNA_MaterialEffects();
-        stateWithNoise->checkinDNA_MaterialEffects(detectedMomentumNoise);
+        stateWithNoise->checkinDNA_MaterialEffects(std::move(detectedMomentumNoise));
       }
     } // end if not an outlier
 
@@ -455,7 +455,7 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fitWithReference(Trk::Trajectory&
 
   // take care of different fit Quality objects in place during smoothing:
   //
-  Trk::FitQualityOnSurface* fitQual = nullptr;               // FQ of a given smoothed state
+  std::unique_ptr<Trk::FitQualityOnSurface> fitQual;               // FQ of a given smoothed state
   Trk::FitQualityOnSurface* trackQualityIncrement = nullptr; // increment to build total fitQ
   if (trackFitQuality) {                               // object to hold total fit quality
     ATH_MSG_WARNING ("fitQuality pointer is not NULL, cancel Kalman fit to prevent mem leak!");
@@ -487,12 +487,14 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fitWithReference(Trk::Trajectory&
   ATH_MSG_VERBOSE ("create smoothed state at end of track by adding the last meas't");
   std::unique_ptr<const TrackParameters>  smooPar;
   // first smoothed TrkParameter is last forward prediction updated with last MBase
+  auto pFitQual = fitQual.get(); //in/out pointer parameter below
   std::unique_ptr<std::pair<AmgVector(5),AmgSymMatrix(5)> > updatedDifference (
     m_updator->updateParameterDifference(forwardDiffPar, forwardCov,
                                          *(lastPredictedState->measurementDifference()),
                                          lastMeasurement->localCovariance(),
                                          lastMeasurement->localParameters().parameterKey(),
-                                         fitQual, /*doFQ=*/true ) );
+                                         pFitQual, /*doFQ=*/true ) );
+  fitQual.reset(pFitQual); //explicitly reset unique_ptr
   const AmgVector(5) x = lastPredictedState->referenceParameters()->parameters()
                        + updatedDifference->first;
   smooPar=updatedDifference? CREATE_PARAMETERS(*lastPredictedState->referenceParameters(),
@@ -503,11 +505,10 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fitWithReference(Trk::Trajectory&
     ATH_MSG_WARNING ("first smoother update failed, reject track");
     if (msgLvl(MSG::INFO)) monitorTrackFits( UpdateFailure,
                                              lastPredictedState->referenceParameters()->eta() );
-    delete fitQual;
     return FitterStatusCode::UpdateFailure;
   }
-  lastPredictedState->checkinSmoothedPar(smooPar.release() );
-  lastPredictedState->checkinFitQuality(fitQual);
+  lastPredictedState->checkinSmoothedPar(std::move(smooPar));
+  lastPredictedState->checkinFitQuality(std::move(fitQual));
   if (msgLvl(MSG::DEBUG)) printGlobalParams(previousStatePosOnTraj, "+ init",lastPredictedState->smoothedTrackParameters());
   if (this->straightTrackModel(*(lastPredictedState->smoothedTrackParameters()))) ++ndofIncrement;
 
@@ -627,17 +628,18 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fitWithReference(Trk::Trajectory&
     if (rit == lastSmoothableState) { // at the last don't do state combination.
       ATH_MSG_VERBOSE ("Identified state" << (rit->positionOnTrajectory()>9? " " : " 0")<<
                        rit->positionOnTrajectory() << " as last fittable state.");
-      smooPar = CREATE_PARAMETERS(
-        *rit->referenceParameters(),
+      smooPar = CREATE_PARAMETERS(*rit->referenceParameters(),
         (rit->referenceParameters()->parameters() + updatedDifference->first),
         AmgSymMatrix(5)(updatedDifference->second));
-      rit->checkinSmoothedPar(smooPar.release());
+      rit->checkinSmoothedPar(std::move(smooPar));
     } else if (m_doSmoothing) {
+      auto pFitQual = fitQual.get();//in/out parameter
       std::unique_ptr< std::pair<AmgVector(5),AmgSymMatrix(5)> > smoothedDifference(
         m_updator->updateParameterDifference(*(rit->parametersDifference()),
                                              *(rit->parametersCovariance()),
                                              updatedDifference->first,updatedDifference->second,31,
-                                             fitQual, /*doFQ=*/false ) );
+                                             pFitQual, /*doFQ=*/false ) );
+      fitQual.reset(pFitQual);
       // alternative would be to construct full pars, then call m_updator->combineStates
       if (!smoothedDifference) {
         ATH_MSG_INFO ("could not combine Track Parameters, reject track");
@@ -646,20 +648,17 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fitWithReference(Trk::Trajectory&
       }
       const AmgVector(5) x = rit->referenceParameters()->parameters()
                            + smoothedDifference->first;
-      smooPar =
-        CREATE_PARAMETERS(*rit->referenceParameters(),
-                          x,
-                          AmgSymMatrix(5)(smoothedDifference->second));
-      rit->checkinSmoothedPar(smooPar.release());
+      smooPar = CREATE_PARAMETERS(*rit->referenceParameters(),x,AmgSymMatrix(5)(smoothedDifference->second));
+      rit->checkinSmoothedPar(std::move(smooPar));
     } else {
       smooPar.reset();
       ATH_MSG_VERBOSE ("No fitted track parameters made at this state because doSmoothing is OFF");
     }
     // get FitQualityOnSurface
     if (rit->smoothedTrackParameters() && fittableMeasurement) {
-      fitQual    = const_cast<Trk::FitQualityOnSurface*>
-        ( m_updator->fullStateFitQuality( *(rit->smoothedTrackParameters()), fittableMeasurement->localParameters(),
-                                          fittableMeasurement->localCovariance() ));
+      fitQual.reset(const_cast<Trk::FitQualityOnSurface*>(
+         m_updator->fullStateFitQuality( *(rit->smoothedTrackParameters()), fittableMeasurement->localParameters(),
+                                          fittableMeasurement->localCovariance() )));
       if (!fitQual) {
         // can't allow NULL pointing fitquality with a measurement state,
         // since downstream logics will use fitqualities it all over the place.
@@ -667,7 +666,7 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fitWithReference(Trk::Trajectory&
         if (msgLvl(MSG::INFO)) monitorTrackFits( FitQualityFailure, rit->smoothedTrackParameters()->eta());
         return FitterStatusCode::FitQualityFailure;
       }
-      rit->checkinFitQuality(fitQual);fitQual=nullptr;
+      rit->checkinFitQuality(std::move(fitQual));
     }
     if (rit->smoothedTrackParameters()) {
       smooPar_eta_for_monitoring = rit->smoothedTrackParameters()->eta();
diff --git a/Tracking/TrkValidation/TrkValTools/src/GenParticleJetFinder.cxx b/Tracking/TrkValidation/TrkValTools/src/GenParticleJetFinder.cxx
index a0213b96abc9..8f2227f4f18f 100644
--- a/Tracking/TrkValidation/TrkValTools/src/GenParticleJetFinder.cxx
+++ b/Tracking/TrkValidation/TrkValTools/src/GenParticleJetFinder.cxx
@@ -59,7 +59,7 @@ std::vector< Trk::GenParticleJet >* Trk::GenParticleJetFinder::jetMCFinder(  std
 
   std::vector<Trk::GenParticleJet>::iterator iAtMin, jAtMin;
 
-  for( auto  i = GenStableCharged.begin() ; i < GenStableCharged.end();  i++){
+  for( auto  i = GenStableCharged.begin() ; i < GenStableCharged.end();  ++i){
     totalEnergyFromTracks = totalEnergyFromTracks + (*i)->momentum().e();
     Trk::GenParticleJet tempPJ;
     tempPJ.addParticle( *i, int(i - GenStableCharged.begin()) );
@@ -70,9 +70,9 @@ std::vector< Trk::GenParticleJet >* Trk::GenParticleJetFinder::jetMCFinder(  std
   do {   
     combineParticles = false;
     yijmin=100.;
-    for( std::vector<Trk::GenParticleJet>::iterator i = myJets->begin() ; i<myJets->end(); i++) {
+    for( std::vector<Trk::GenParticleJet>::iterator i = myJets->begin() ; i<myJets->end(); ++i) {
 
-      for( std::vector<Trk::GenParticleJet>::iterator j = myJets->begin() ; j<myJets->end(); j++) {
+      for( std::vector<Trk::GenParticleJet>::iterator j = myJets->begin() ; j<myJets->end(); ++j) {
 
         if (i!=j) {
 
@@ -151,7 +151,7 @@ std::vector< Trk::GenParticleJet >* Trk::GenParticleJetFinder::jetMCFinder(  std
       }
     }
     int currentNumParts = 0;
-    for(std::vector<Trk::GenParticleJet>::iterator k = myJets->begin(); k<myJets->end(); k++)
+    for(std::vector<Trk::GenParticleJet>::iterator k = myJets->begin(); k<myJets->end(); ++k)
       currentNumParts = currentNumParts + k->getNumParticles();
 
     if(numParts != currentNumParts){
diff --git a/Tracking/TrkValidation/TrkValTools/src/MeasurementVectorNtupleTool.cxx b/Tracking/TrkValidation/TrkValTools/src/MeasurementVectorNtupleTool.cxx
index 59bd35f50dc0..5d9cfd7d9cf8 100644
--- a/Tracking/TrkValidation/TrkValTools/src/MeasurementVectorNtupleTool.cxx
+++ b/Tracking/TrkValidation/TrkValTools/src/MeasurementVectorNtupleTool.cxx
@@ -474,7 +474,7 @@ StatusCode Trk::MeasurementVectorNtupleTool::fillTrackData (
   for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it=trackStates->
          begin();
        it!=trackStates->end();
-       it++) {
+       ++it) {
 
 
     if (!(*it)) {
@@ -567,7 +567,7 @@ StatusCode Trk::MeasurementVectorNtupleTool::fillTrackData (
     }
     for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it=holesOnTrack->begin();
          it!=holesOnTrack->end();
-         it++) {
+         ++it) {
       if (!(*it)) {
         msg(MSG::WARNING) << "TrackStateOnSurface from hole search tool == Null" << endmsg;
         continue;
diff --git a/Tracking/TrkValidation/TrkValTools/src/TrackDiff.cxx b/Tracking/TrkValidation/TrkValTools/src/TrackDiff.cxx
index 4fefe006f18e..e04d4621dac8 100755
--- a/Tracking/TrkValidation/TrkValTools/src/TrackDiff.cxx
+++ b/Tracking/TrkValidation/TrkValTools/src/TrackDiff.cxx
@@ -270,7 +270,7 @@ StatusCode Trk::TrackDiff::diff (
     //   comparison track
     DataVector< const Trk::TrackStateData >::iterator refIter = refTrackStateData->begin();
     DataVector< const Trk::TrackStateData >::iterator compIter = compareTrackStateData->begin();
-    for (; refIter != refTrackStateData->end(); refIter++) {
+    for (; refIter != refTrackStateData->end(); ++refIter) {
         // count the reference states by detector type
         //m_nRefStates[ refIter->detType() ]++;
         // loop over trackstates of the comparison track till we find
@@ -283,7 +283,7 @@ StatusCode Trk::TrackDiff::diff (
             refPRD = (*refIter)->rot()->prepRawData();
         }
         compIter = compareTrackStateData->begin();
-        for ( ; compIter != compareTrackStateData->end(); compIter++ ) {
+        for ( ; compIter != compareTrackStateData->end(); ++compIter ) {
             // compare the surfaces of the reference and the compared track state
             if ( (*compIter)->surface() == (*refIter)->surface() ) {
                 // we found a track state on the same surface!
@@ -323,7 +323,7 @@ StatusCode Trk::TrackDiff::diff (
 
     // loop over the remaining compared states: They are fakes
     compIter = compareTrackStateData->begin();
-    for (; compIter != compareTrackStateData->end(); compIter++) {
+    for (; compIter != compareTrackStateData->end(); ++compIter) {
         diffStateInfo(nullptr, (*compIter));
     }
     // -----------------------
@@ -366,7 +366,7 @@ DataVector< const Trk::TrackStateData >* Trk::TrackDiff::extractDataFromTrack( c
     DataVector<const Trk::TrackStateOnSurface>::const_iterator iter = trackStates->begin();
     // Loop over all track states on surfaces
     //    to extract the measurements
-    for (; iter != trackStates->end(); iter++) {
+    for (; iter != trackStates->end(); ++iter) {
         if (!(*iter)) {
           ATH_MSG_WARNING ( "TrackStateOnSurface == Null" );
           continue;
diff --git a/Tracking/TrkValidation/TrkValTools/src/TrackInformationNtupleTool.cxx b/Tracking/TrkValidation/TrkValTools/src/TrackInformationNtupleTool.cxx
index 32e783eac07f..0ed9c728df3f 100644
--- a/Tracking/TrkValidation/TrkValTools/src/TrackInformationNtupleTool.cxx
+++ b/Tracking/TrkValidation/TrkValTools/src/TrackInformationNtupleTool.cxx
@@ -144,7 +144,7 @@ StatusCode Trk::TrackInformationNtupleTool::fillTrackData (
 
     for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it=trackStates->begin();
          it!=trackStates->end();
-         it++) {
+         ++it) {
 
       if (!(*it)) {
         msg(MSG::WARNING) << "TrackStateOnSurface == Null" << endmsg;
@@ -261,7 +261,7 @@ StatusCode Trk::TrackInformationNtupleTool::fillProtoTrajectoryData
 
   // Loop over all proto track states on surfaces
   Trk::ProtoTrajectory::const_iterator it = trajectory.begin();
-  for (; it!=trajectory.end(); it++) {
+  for (; it!=trajectory.end(); ++it) {
     // get the measurement            
     const Trk::MeasurementBase *measurement = it->measurement();
     if (!measurement) {
-- 
GitLab


From 6b1b7718b4132e4d03fa7c5bababfc7a70cdf6f3 Mon Sep 17 00:00:00 2001
From: Scott Snyder <scott.snyder@cern.ch>
Date: Mon, 27 Sep 2021 18:30:56 +0200
Subject: [PATCH 341/347] TrkTrack+TRT_SegmentToTrackTool+TrkMaterialProvider:
 Remove non-const trackStateOnSurfaces.

---
 .../src/TRT_SegmentToTrackTool.cxx            | 20 ++++------
 Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h   | 10 +----
 Tracking/TrkEvent/TrkTrack/TrkTrack/Track.icc |  8 +---
 .../src/TrkMaterialProviderTool.cxx           | 40 ++++++++++++-------
 4 files changed, 35 insertions(+), 43 deletions(-)

diff --git a/InnerDetector/InDetRecTools/TRT_SegmentToTrackTool/src/TRT_SegmentToTrackTool.cxx b/InnerDetector/InDetRecTools/TRT_SegmentToTrackTool/src/TRT_SegmentToTrackTool.cxx
index 2ee58344e1ae..b7db18ec9129 100644
--- a/InnerDetector/InDetRecTools/TRT_SegmentToTrackTool/src/TRT_SegmentToTrackTool.cxx
+++ b/InnerDetector/InDetRecTools/TRT_SegmentToTrackTool/src/TRT_SegmentToTrackTool.cxx
@@ -335,11 +335,8 @@ namespace InDet {
     info.setPatternRecognitionInfo(Trk::TrackInfo::TRTStandalone);
 
     // create new track candidate
-    Trk::Track* newTrack = new Trk::Track(info, std::move(ntsos), fq);
-    // We need to keep the tsos added. As later on we modify them
-    auto newTrackTSOS = newTrack->trackStateOnSurfaces();
     if (!m_doRefit) {
-      return newTrack;
+      return new Trk::Track(info, std::move(ntsos), fq);
     } else {
       //
       // ----------------------------- this is a horrible hack to make the
@@ -369,8 +366,6 @@ namespace InDet {
           m_extrapolator->extrapolateDirectly(*segPar, perigeeSurface));
         if (!tempper) {
           ATH_MSG_DEBUG("Could not produce perigee");
-          delete newTrack;
-          newTrack = nullptr;
           delete segPar;
           segPar = nullptr;
           return nullptr;
@@ -481,7 +476,7 @@ namespace InDet {
 
           // ME: wow this is hacking the vector ...
           const Trk::MeasurementBase* firstmeas =
-            (**newTrackTSOS->begin()).measurementOnTrack();
+            (**ntsos.begin()).measurementOnTrack();
           Amg::MatrixX newcov(2, 2);
           newcov.setZero();
           newcov(0, 0) = (firstmeas->localCovariance())(0, 0);
@@ -492,8 +487,8 @@ namespace InDet {
             new Trk::PseudoMeasurementOnTrack(
               newpar, newcov, firstmeas->associatedSurface());
           // hack replace first measurement with pseudomeasurement
-          newTrackTSOS->erase(newTrackTSOS->begin());
-          newTrackTSOS->insert(newTrackTSOS->begin(),
+          ntsos.erase(ntsos.begin());
+          ntsos.insert(ntsos.begin(),
                         new Trk::TrackStateOnSurface(newpseudo, nullptr));
         }
 
@@ -596,7 +591,7 @@ namespace InDet {
       typePattern.set(Trk::TrackStateOnSurface::Perigee);
       Trk::TrackStateOnSurface* seg_tsos = new Trk::TrackStateOnSurface(
         nullptr, per, nullptr, nullptr, typePattern);
-      newTrackTSOS->insert(newTrackTSOS->begin(), seg_tsos);
+      ntsos.insert(ntsos.begin(), seg_tsos);
 
       ATH_MSG_VERBOSE("Constructed perigee at input to fit : " << (*per));
 
@@ -605,12 +600,11 @@ namespace InDet {
       // track
       //
 
+      Trk::Track newTrack (info, std::move(ntsos), fq);
       Trk::Track* fitTrack =
-        m_fitterTool->fit(*newTrack, true, Trk::nonInteracting);
+        m_fitterTool->fit(newTrack, true, Trk::nonInteracting);
 
       // cleanup
-      delete newTrack;
-      newTrack = nullptr;
       if (segPar) {
         delete segPar;
         segPar = nullptr;
diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h b/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h
index 686762aaa7f5..4f1c8aad8f36 100755
--- a/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h
+++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.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 TRKTRACK_H
@@ -206,14 +206,6 @@ namespace Trk
         */									            
        const DataVector<const TrackStateOnSurface>* trackStateOnSurfaces() const;
 
-       /** 
-        * return a pointer to the non-const DataVector of const TrackStateOnSurfaces
-        * owned by a non-const track 
-        * The pointer will be nullptr if the track was created without   
-        * TrackStateOnSurfaces.			            
-        */				            
-       DataVector<const TrackStateOnSurface>* trackStateOnSurfaces();
-       
         /** 
         * Set the TrackStateOnSurfaces. The Trk::Track takes ownership 		            
         */				            
diff --git a/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.icc b/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.icc
index d527689048b6..8d938091a4ab 100644
--- a/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.icc
+++ b/Tracking/TrkEvent/TrkTrack/TrkTrack/Track.icc
@@ -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
 */
 
 namespace Trk {
@@ -22,12 +22,6 @@ Track::trackStateOnSurfaces() const
   return &m_trackStateVector;
 }
 
-inline DataVector<const TrackStateOnSurface>*
-Track::trackStateOnSurfaces()
-{
-  return &m_trackStateVector;
-}
-
 inline const TrackInfo&
 Track::info() const
 {
diff --git a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
index 67e61f2b7577..3f64b20b4983 100644
--- a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
+++ b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx
@@ -156,7 +156,12 @@ void Trk::TrkMaterialProviderTool::updateCaloTSOS(Trk::Track& track, const Trk::
 
   // back extrapolate to perigee, get pAtCaloEntry from list of TSOSs
   // and update/add calo+ID material to mstrack to be refitted.
-  Trk::TrackStates* inputTSOS = track.trackStateOnSurfaces();
+  const Trk::TrackStates* inputTSOS_orig = track.trackStateOnSurfaces();
+
+  auto inputTSOS = std::make_unique<Trk::TrackStates>();
+  for (const Trk::TrackStateOnSurface* tsos : *inputTSOS_orig) {
+    inputTSOS->push_back (tsos->clone());
+  }
 
   // Iterators
   Trk::TrackStates::iterator lastIDwP  = inputTSOS->end();
@@ -248,9 +253,10 @@ void Trk::TrkMaterialProviderTool::updateCaloTSOS(Trk::Track& track, const Trk::
 #endif
 
   // apply X0 and Eloss scale to MuonSpectrometer
-  this->updateVectorMS(inputTSOS,firstMS,X0ScaleMS,ElossScaleMS);
+  this->updateVectorMS(inputTSOS.get(),firstMS,X0ScaleMS,ElossScaleMS);
   // update the original vector
-  Trk::TrkMaterialProviderTool::updateVector(inputTSOS, firstCALO, firstMS, caloTSOS);
+  Trk::TrkMaterialProviderTool::updateVector(inputTSOS.get(), firstCALO, firstMS, caloTSOS);
+  track.setTrackStateOnSurfaces (std::move (*inputTSOS));
   myLocal_resetTrack(track);
 }
 
@@ -261,7 +267,12 @@ void Trk::TrkMaterialProviderTool::updateCaloTSOS(const Trk::Track& idTrack, Trk
   ATH_MSG_VERBOSE("updateCaloTSOS(Trk::Track& idTrack, Trk::Track& extrapolatedTrack)");
 
   const Trk::TrackStates* inputTSOS_ID = idTrack.trackStateOnSurfaces();
-  Trk::TrackStates* inputTSOS_MS = extrapolatedTrack.trackStateOnSurfaces();
+  const Trk::TrackStates* inputTSOS_MS_orig = extrapolatedTrack.trackStateOnSurfaces();
+
+  auto inputTSOS_MS = std::make_unique<Trk::TrackStates>();
+  for (const Trk::TrackStateOnSurface* tsos : *inputTSOS_MS_orig) {
+    inputTSOS_MS->push_back (tsos->clone());
+  }
 
 
   // find last ID TSOS
@@ -338,14 +349,14 @@ void Trk::TrkMaterialProviderTool::updateCaloTSOS(const Trk::Track& idTrack, Trk
   double ElossScaleMS = 0.;
   // get calorimeter TSOS from TG
   Trk::TrackStates* caloTSOS = this->getCaloTSOS (*(*lastIDwP)->trackParameters(),
-									    extrapolatedTrack,
-									    (*firstMSnotPerigee)->surface(),
-									    Trk::alongMomentum,
-									    Trk::muon,
-                                                                            Eloss, X0ScaleMS, ElossScaleMS,
-									    (firstMSwP == inputTSOS_MS->end()) ? nullptr : (*firstMSwP)->trackParameters(),
-									    false,
-									    true);
+                                                  extrapolatedTrack,
+                                                  (*firstMSnotPerigee)->surface(),
+                                                  Trk::alongMomentum,
+                                                  Trk::muon,
+                                                  Eloss, X0ScaleMS, ElossScaleMS,
+                                                  (firstMSwP == inputTSOS_MS->end()) ? nullptr : (*firstMSwP)->trackParameters(),
+                                                  false,
+                                                  true);
 
 
   if(!caloTSOS || caloTSOS->size()!=3) {
@@ -362,10 +373,11 @@ void Trk::TrkMaterialProviderTool::updateCaloTSOS(const Trk::Track& idTrack, Trk
 #endif
 
   // apply X0 and Eloss scale to MuonSpectrometer
-  this->updateVectorMS(inputTSOS_MS,firstMS,X0ScaleMS,ElossScaleMS);
+  this->updateVectorMS(inputTSOS_MS.get(),firstMS,X0ScaleMS,ElossScaleMS);
   // update the original vector
-  Trk::TrkMaterialProviderTool::updateVector(inputTSOS_MS, firstCALO, firstMS, caloTSOS);
+  Trk::TrkMaterialProviderTool::updateVector(inputTSOS_MS.get(), firstCALO, firstMS, caloTSOS);
 
+  extrapolatedTrack.setTrackStateOnSurfaces (std::move (*inputTSOS_MS));
   myLocal_resetTrack(extrapolatedTrack);
 }
 
-- 
GitLab


From d3dc6080430d91491b6d42cdc2c2c9fa60cbe0d0 Mon Sep 17 00:00:00 2001
From: Walter Lampl <walter.lampl@cern.ch>
Date: Mon, 27 Sep 2021 18:32:21 +0200
Subject: [PATCH 342/347] LAr Calib: Make tools private, use unique_ptr

---
 .../LArCalibUtils/LArCalibUtils/LArOFCAlg.h   | 11 +++---
 .../LArCalibUtils/LArRTMParamExtractor.h      |  4 +-
 .../LArCalibUtils/src/LArOFCAlg.cxx           | 39 +++++++++----------
 .../src/LArRTMParamExtractor.cxx              | 15 +++----
 .../python/LArCalib_Delay_OFCCali.py          |  4 +-
 .../python/LArCalib_RTMParamsConfig.py        |  2 +-
 .../LArCalib_Delay_OFC_Cali_jobOptions.py     |  1 -
 ...LArCalib_OFC_Phys_TwoFolders_jobOptions.py | 19 ++++-----
 ...C_Phys_WithPileup_TwoFolders_jobOptions.py |  4 +-
 .../share/LArCalib_RTMParams_jobOptions.py    |  5 +--
 10 files changed, 48 insertions(+), 56 deletions(-)

diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFCAlg.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFCAlg.h
index 17c25bbe8608..88fd1427d6a5 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFCAlg.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArOFCAlg.h
@@ -23,7 +23,7 @@
 #include "LArRawConditions/LArOFCComplete.h"
 #include "LArRawConditions/LArOFCBinComplete.h"
 #include "LArRawConditions/LArShapeComplete.h"
-
+#include "LArCOOLConditions/LArDSPConfig.h"
 #include "LArCabling/LArOnOffIdMapping.h"
 #include "StoreGate/ReadCondHandleKey.h"
 
@@ -32,10 +32,11 @@
 #include <Eigen/Dense>
 
 #include "tbb/blocked_range.h"
+#include <memory>
 
 class LArOnlineID_Base; 
 class CaloDetDescrManager_Base; 
-class LArDSPConfig;
+
 
 class LArOFCAlg:public AthAlgorithm {
  
@@ -122,8 +123,8 @@ private:
   unsigned int             m_nPoints;
   float                    m_addOffset;
 
-  ToolHandle<ILArAutoCorrDecoderTool> m_AutoCorrDecoder;
-  ToolHandle<ILArAutoCorrDecoderTool> m_AutoCorrDecoderV2;
+  ToolHandle<ILArAutoCorrDecoderTool> m_AutoCorrDecoder{this,"DecoderTool",{} };
+  ToolHandle<ILArAutoCorrDecoderTool> m_AutoCorrDecoderV2{this,"DecoderToolV2", {} };
 
   const CaloDetDescrManager_Base* m_calo_dd_man;
   const LArOnlineID_Base*  m_onlineID; 
@@ -151,7 +152,7 @@ private:
 
   bool                     m_readDSPConfig;
   std::string              m_DSPConfigFolder;
-  LArDSPConfig*            m_DSPConfig;
+  std::unique_ptr<LArDSPConfig>  m_DSPConfig;
 
   bool                     m_forceShift;
 
diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h
index 924c4fae05b5..e70a66e4b9e9 100644
--- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h
+++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRTMParamExtractor.h
@@ -24,9 +24,11 @@
 #include <atomic> 
 
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "GaudiKernel/ToolHandle.h"
 #include "LArCabling/LArOnOffIdMapping.h"
 #include "tbb/blocked_range.h"
 #include "LArRawConditions/LArWFParams.h"
+#include "LArCalibUtils/LArWFParamTool.h" 
 #include "LArRawConditions/LArCaliWave.h"
 #include <memory>
 
@@ -49,7 +51,7 @@ class LArRTMParamExtractor : public AthAlgorithm
  private:
 
   SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
-
+  ToolHandle<LArWFParamTool> m_larWFParamTool{this,"LArWFParamTool","LArWFParamTool"};
   std::vector<std::string> m_keylist;
   bool m_isSC;
   bool m_testmode, m_dumpOmegaScan, m_dumpResOscill;
diff --git a/LArCalorimeter/LArCalibUtils/src/LArOFCAlg.cxx b/LArCalorimeter/LArCalibUtils/src/LArOFCAlg.cxx
index 5decc3ac1341..0a63d5e4dd27 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArOFCAlg.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArOFCAlg.cxx
@@ -13,7 +13,6 @@
 #include "LArRawConditions/LArOFCComplete.h"
 #include "LArRawConditions/LArOFCBinComplete.h"
 #include "LArRawConditions/LArPhysCaliTdiffComplete.h"
-#include "LArCOOLConditions/LArDSPConfig.h"
 #include "CoralBase/Blob.h"
 #include "AthenaPoolUtilities/AthenaAttributeList.h"
 
@@ -36,8 +35,7 @@ LArOFCAlg::LArOFCAlg(const std::string& name, ISvcLocator* pSvcLocator)
           m_calo_dd_man(nullptr),
           m_onlineID(nullptr),
 	  m_larPhysWaveBin(nullptr),
-	  m_groupingType("SubDetector"), // SubDetector, Single, FeedThrough
-          m_DSPConfig(nullptr)
+	  m_groupingType("SubDetector") // SubDetector, Single, FeedThrough
 {
 
   declareProperty("Nsample",m_nSamples = 5);
@@ -76,9 +74,6 @@ LArOFCAlg::LArOFCAlg(const std::string& name, ISvcLocator* pSvcLocator)
   declareProperty("UseDelta",          m_useDelta=0); // 0= not use Delta, 1=only EMECIW/HEC/FCAL, 2=all , 3 = only EMECIW/HEC/FCAL1+high eta FCAL2-3
   declareProperty("UseDeltaV2",        m_useDeltaV2=0); // 0= not use Delta, 1=only EMECIW/HEC/FCAL, 2=all , 3 = only EMECIW/HEC/FCAL1+high eta FCAL2-3
 
-  declareProperty("DecoderTool",       m_AutoCorrDecoder); 
-  declareProperty("DecoderToolV2",       m_AutoCorrDecoderV2); 
-
   declareProperty("RunThreaded",       m_runThreaded=false);
 
   declareProperty("ReadDSPConfig",     m_readDSPConfig=false);
@@ -253,7 +248,7 @@ StatusCode LArOFCAlg::stop()
      if (blob.size()<3) {
         ATH_MSG_INFO( "Found empty blob, nothing to do");
      } else {
-        m_DSPConfig = new LArDSPConfig(attrList);
+        m_DSPConfig = std::make_unique<LArDSPConfig>(attrList);
      }
   }
 
@@ -302,7 +297,7 @@ StatusCode LArOFCAlg::stop()
   /////////////
 
   // OFC persistent object
-  LArOFCComplete *larOFCComplete=new LArOFCComplete();
+  std::unique_ptr<LArOFCComplete> larOFCComplete=std::make_unique<LArOFCComplete>();
   sc = larOFCComplete->setGroupingType(m_groupingType,msg());
   if (sc.isFailure()) {
     ATH_MSG_ERROR( "Failed to set groupingType for LArOFCComplete object" );
@@ -315,7 +310,7 @@ StatusCode LArOFCAlg::stop()
   }
 
 
-  LArOFCComplete *larOFCCompleteV2=new LArOFCComplete();
+  std::unique_ptr<LArOFCComplete> larOFCCompleteV2=std::make_unique<LArOFCComplete>();
   sc = larOFCComplete->setGroupingType(m_groupingType,msg());
   if (sc.isFailure()) {
     ATH_MSG_ERROR( "Failed to set groupingType for LArOFCComplete object" );
@@ -328,9 +323,9 @@ StatusCode LArOFCAlg::stop()
   }
 
 
-  LArOFCBinComplete *larOFCBinComplete=NULL;
+  std::unique_ptr<LArOFCBinComplete> larOFCBinComplete;
   if (m_storeMaxPhase) {
-    larOFCBinComplete=new LArOFCBinComplete();
+    larOFCBinComplete=std::make_unique<LArOFCBinComplete>();
     sc=larOFCBinComplete->setGroupingType(m_groupingType,msg());
     if (sc.isFailure()) {
       ATH_MSG_ERROR( "Failed to set groupingType for LArOFCBinComplete object" );
@@ -344,9 +339,9 @@ StatusCode LArOFCAlg::stop()
   }
 
   // LArShape persistent object
-  LArShapeComplete *larShapeComplete=NULL;
+  std::unique_ptr<LArShapeComplete> larShapeComplete;
   if (m_fillShape) {
-    larShapeComplete = new LArShapeComplete();
+    larShapeComplete = std::make_unique<LArShapeComplete>();
     sc=larShapeComplete->setGroupingType(m_groupingType,msg());
     if (sc.isFailure()) {
       ATH_MSG_ERROR( "Failed to set groupingType for LArShapeComplete object" );
@@ -393,14 +388,15 @@ StatusCode LArOFCAlg::stop()
     ATH_MSG_ERROR( "Number of channels * gains with failed OFC verification: " <<  nFailed );
 
   // record and symlink LArOFCComplete object
-  sc = detStore()->record(larOFCComplete,m_ofcKey);
+  LArOFCComplete* larOFCCompletePtr=larOFCComplete.get();
+  sc = detStore()->record(std::move(larOFCComplete),m_ofcKey);
   if (sc.isFailure()) {
       ATH_MSG_ERROR( "Could not record LArOFCComplete to DetStore with key " << m_ofcKey );
       return StatusCode::FAILURE;
   }
   ATH_MSG_INFO( "LArOFCComplete object recorded with key " << m_ofcKey ) ;
 
-  sc = detStore()->symLink(larOFCComplete,(ILArOFC*)larOFCComplete);
+  sc = detStore()->symLink(larOFCCompletePtr,(ILArOFC*)larOFCCompletePtr);
   if (sc.isFailure()) {
       ATH_MSG_ERROR( "Could not symlink ILArOFC with LArOFCComplete." );
       return StatusCode::FAILURE;
@@ -410,14 +406,15 @@ StatusCode LArOFCAlg::stop()
 
   // record and symlink second version of LArOFCComplete object
   if (m_computeV2) {
-    sc = detStore()->record(larOFCCompleteV2,m_ofcKeyV2);
+    LArOFCComplete* larOFCCompletePtrV2=larOFCCompleteV2.get();
+    sc = detStore()->record(std::move(larOFCCompleteV2),m_ofcKeyV2);
     if (sc.isFailure()) {
       ATH_MSG_ERROR( "Could not record LArOFCComplete to DetStore with key " << m_ofcKeyV2 );
       return StatusCode::FAILURE;
     }
     ATH_MSG_INFO( "LArOFCComplete object recorded with key " << m_ofcKeyV2 ) ;
 
-    sc = detStore()->symLink(larOFCCompleteV2,(ILArOFC*)larOFCCompleteV2);
+    sc = detStore()->symLink(larOFCCompletePtrV2,(ILArOFC*)larOFCCompletePtrV2);
     if (sc.isFailure()) {
       ATH_MSG_ERROR( "Could not symlink ILArOFC with LArOFCComplete." );
       return StatusCode::FAILURE;
@@ -431,7 +428,7 @@ StatusCode LArOFCAlg::stop()
   }
 
   if (larOFCBinComplete) {
-    sc = detStore()->record(larOFCBinComplete,m_ofcBinKey);
+    sc = detStore()->record(std::move(larOFCBinComplete),m_ofcBinKey);
     if (sc.isFailure()) {
        ATH_MSG_ERROR( "Could not record LArOFCBinCompete object" );
        return StatusCode::FAILURE;
@@ -441,15 +438,15 @@ StatusCode LArOFCAlg::stop()
   // record and symlink LArShapeComplete object
   if ( m_fillShape ) {
     ATH_MSG_DEBUG( "Trying to record LArShapeComplete object to detector store, key = " << m_shapeKey);
-    sc = detStore()->record(larShapeComplete,m_shapeKey);
+    sc = detStore()->record(std::move(larShapeComplete),m_shapeKey);
     if (sc.isFailure()) {
        ATH_MSG_ERROR( "Could not record LArShapeComplete to DetStore with key " << m_shapeKey );
        return StatusCode::FAILURE;
     }
     ATH_MSG_INFO( "LArShapeComplete object recorded to DetStore successfully with key " << m_shapeKey ) ;
     ATH_MSG_DEBUG( "Trying to symlink ILArShape with LArShapeComplete");
-    ILArShape* larShape = 0;
-    sc = detStore()->symLink(larShapeComplete,larShape);
+    LArShapeComplete* shapePtr=larShapeComplete.get();
+    sc = detStore()->symLink(shapePtr,(ILArShape*)shapePtr);
     if (sc.isFailure()) {
       ATH_MSG_ERROR( "Could not symlink ILArShape with LArShapeComplete." );
       return StatusCode::FAILURE;
diff --git a/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx b/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx
index 9b0ccbeac84d..0c7c35992b12 100644
--- a/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx
+++ b/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx
@@ -153,6 +153,9 @@ StatusCode LArRTMParamExtractor::initialize() {
 
   ATH_CHECK( m_cablingKey.initialize() );
 
+  // Retrieve LArWFParamTool
+  ATH_CHECK(m_larWFParamTool.retrieve());
+
   return StatusCode::SUCCESS ;
 }
 
@@ -192,13 +195,7 @@ StatusCode LArRTMParamExtractor::stop()
     }
   }
 
-  // Retrieve LArWFParamTool
-  ToolHandle<LArWFParamTool> larWFParamTool("LArWFParamTool");
-  sc=larWFParamTool.retrieve();
-  if (sc!=StatusCode::SUCCESS) {
-    ATH_MSG_ERROR( " Can't get LArWFParamTool" );
-    return sc;
-  }
+  
 
   SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
   const LArOnOffIdMapping* cabling{*cablingHdl};
@@ -557,7 +554,7 @@ StatusCode LArRTMParamExtractor::stop()
 
 
   if (!m_useTBB) { //traditional, serial processing:
-    Looper looper(&inputParams,cabling,larWFParamTool.operator->(),msg(),m_counter);
+    Looper looper(&inputParams,cabling,m_larWFParamTool.operator->(),msg(),m_counter);
     tbb::blocked_range<size_t> r(0,inputParams.size());
     looper(r);
   }
@@ -565,7 +562,7 @@ StatusCode LArRTMParamExtractor::stop()
     ATH_MSG_INFO("Now calling TBB parallel_for");
     // NOW CALL TBB PARALLEL FOR
     tbb::parallel_for(tbb::blocked_range<size_t>(0, inputParams.size()),Looper(&inputParams,cabling,
-									       larWFParamTool.operator->(),
+									       m_larWFParamTool.operator->(),
 									       msg(),m_counter));
 
     ATH_MSG_INFO("Done with parallel_for");
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
index c0e5d5beeb45..cb95e62f54e7 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_Delay_OFCCali.py
@@ -66,8 +66,6 @@ def LArDelay_OFCCaliCfg(flags):
     
     
 
-    result.addPublicTool(CompFactory.LArAutoCorrDecoderTool(isSC=flags.LArCalib.isSC))
-
     LArCaliOFCAlg = CompFactory.LArOFCAlg("LArCaliOFCAlg")
     LArCaliOFCAlg.ReadCaliWave = True
     LArCaliOFCAlg.KeyList   = [ "LArCaliWave" ]
@@ -83,7 +81,7 @@ def LArDelay_OFCCaliCfg(flags):
     #LArCaliOFCAlg.DumpOFCfile = "LArOFCCali.dat"
     LArCaliOFCAlg.GroupingType = flags.LArCalib.GroupingType
     LArCaliOFCAlg.isSC = flags.LArCalib.isSC
-    LArCaliOFCAlg.DecoderTool='LArAutoCorrDecoderTool/LArAutoCorrDecoderTool'
+    LArCaliOFCAlg.DecoderTool=CompFactory.LArAutoCorrDecoderTool(isSC=flags.LArCalib.isSC)
     result.addEventAlgo(LArCaliOFCAlg)
 
 
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RTMParamsConfig.py b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RTMParamsConfig.py
index 682c12637da2..94832a6661e8 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RTMParamsConfig.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/python/LArCalib_RTMParamsConfig.py
@@ -60,7 +60,7 @@ def LArRTMParamsCfg(flags):
     theLArWFParamTool.NpointScan  = [   800 ,   900 ,    310 ,    120 ]
     theLArWFParamTool.StoreResOscill = [True * 4] if flags.LArCalib.RTM.DumpResOscill else [False *4]
     
-    result.addPublicTool(theLArWFParamTool)
+    LArRTMParamExtractor.LArWFParamTool=theLArWFParamTool
 
     result.addEventAlgo(LArRTMParamExtractor)
 
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py
index 62039d934b70..4fdb781cf694 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py
@@ -848,7 +848,6 @@ if doOFC:
   from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool
   theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool()
   theLArAutoCorrDecoderTool.isSC = SuperCells
-  ToolSvc += theLArAutoCorrDecoderTool
 
   from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg
   LArCaliOFCAlg = LArOFCAlg("LArCaliOFCAlg")
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_TwoFolders_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_TwoFolders_jobOptions.py
index ca77cbfacac4..f7ae245e26b6 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_TwoFolders_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_TwoFolders_jobOptions.py
@@ -360,8 +360,8 @@ if ( ReadPhysCaliTdiffFromCOOL ):
    if 'InputPhysCaliTdiffSQLiteFile' in dir():
       InputDBConnectionPhysCaliTdiff = DBConnectionFile(InputPhysCaliTdiffSQLiteFile)
    else:
-      InputDBConnectionPhysCaliTdiff = DBConnectionCOOL
-
+      InputDBConnectionPhysCaliTdiff = "COOLOFL_LAR/COMP200"
+xxx
 ## Bad Channel   
    
 if not 'ReadBadChannelFromCOOL' in dir():
@@ -620,6 +620,12 @@ else:
 #                      OFC computation
 ###########################################################################
 
+from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool
+theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool()
+theLArAutoCorrDecoderTool.UseAlwaysHighGain=True
+if NColl > 0:
+   theLArAutoCorrDecoderTool.DecodeMode=1
+
 from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg
 
 LArPhysOFCAlg = LArOFCAlg("LArPhysOFCAlg")
@@ -643,7 +649,7 @@ LArPhysOFCAlg.LArPhysWaveBinKey = ShiftKey
 LArPhysOFCAlg.UseDelta = UseDelta
 LArPhysOFCAlg.KeyOFC   = OFCKey
 LArPhysOFCAlg.KeyShape = ShapeKey
-
+LArPhysOFCAlg.DecoderTool = theLArAutoCorrDecoderTool
 
 topSequence+=LArPhysOFCAlg
 
@@ -668,15 +674,10 @@ LArPhysOFCAlg2.UseDelta = UseDelta
 
 LArPhysOFCAlg2.KeyOFC   = OFCKey2
 LArPhysOFCAlg2.KeyShape = ShapeKey2
+LArPhysOFCAlg2.DecoderTool = theLArAutoCorrDecoderTool
 
 topSequence+=LArPhysOFCAlg2
 
-from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool
-theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool()
-theLArAutoCorrDecoderTool.UseAlwaysHighGain=True
-if NColl > 0:
-   theLArAutoCorrDecoderTool.DecodeMode=1
-ToolSvc += theLArAutoCorrDecoderTool
 
 ###########################################################################
 
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_WithPileup_TwoFolders_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_WithPileup_TwoFolders_jobOptions.py
index bf3efea986ce..ce43debd2124 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_WithPileup_TwoFolders_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_WithPileup_TwoFolders_jobOptions.py
@@ -390,7 +390,7 @@ if ( ReadPhysCaliTdiffFromCOOL ):
    if 'InputPhysCaliTdiffSQLiteFile' in dir():
       InputDBConnectionPhysCaliTdiff = DBConnectionFile(InputPhysCaliTdiffSQLiteFile)
    else:
-      InputDBConnectionPhysCaliTdiff = "COOLOFL_LAR/CONDBR2"
+      InputDBConnectionPhysCaliTdiff = "COOLOFL_LAR/COMP200"
 
 ## Bad Channel   
    
@@ -636,7 +636,6 @@ from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool
 theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool()
 theLArAutoCorrDecoderTool.UseAlwaysHighGain=True
 theLArAutoCorrDecoderTool.isSC = SuperCells
-ToolSvc += theLArAutoCorrDecoderTool
 
 if NColl > 0:
    theLArPhysAutoCorrDecoderTool = LArAutoCorrDecoderTool("LArPhysAutoCorrDecoderTool")
@@ -644,7 +643,6 @@ if NColl > 0:
    theLArPhysAutoCorrDecoderTool.UseAlwaysHighGain=True
    theLArPhysAutoCorrDecoderTool.isSC = SuperCells
    theLArPhysAutoCorrDecoderTool.KeyAutoCorr="LArPhysAutoCorr"
-   ToolSvc += theLArPhysAutoCorrDecoderTool
 
 from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg
 
diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py
index 252b6921135f..880ff700dc19 100644
--- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py
+++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RTMParams_jobOptions.py
@@ -440,7 +440,7 @@ condSeq = AthSequencer("AthCondSeq")
 
 
 ## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc
-from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc)
+from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr)
 
 include("LArCalibProcessing/LArCalib_MinimalSetup.py")
 if SuperCells:
@@ -672,9 +672,8 @@ if 'NpointScan' in dir():
 if 'StoreResOscill' in dir():
    theLArWFParamTool.StoreResOscill = StoreResOscill
 
-ToolSvc += theLArWFParamTool
+LArRTMParamExtractor.LArWFParamTool=theLArWFParamTool
 
-topSequence += LArRTMParamExtractor
 
 ###########################################################################
 
-- 
GitLab


From 35049e5074f1b53217cdfe9bc6c951a6b0884814 Mon Sep 17 00:00:00 2001
From: Peter van Gemmeren <Peter.van.Gemmeren@cern.ch>
Date: Mon, 27 Sep 2021 13:19:36 -0500
Subject: [PATCH 343/347] Fix reading back of provenance records by fixing self
 reference.

---
 Database/PersistentDataModelTPCnv/src/DataHeaderCnv_p6.cxx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Database/PersistentDataModelTPCnv/src/DataHeaderCnv_p6.cxx b/Database/PersistentDataModelTPCnv/src/DataHeaderCnv_p6.cxx
index 41e807c90284..4a87a9030985 100755
--- a/Database/PersistentDataModelTPCnv/src/DataHeaderCnv_p6.cxx
+++ b/Database/PersistentDataModelTPCnv/src/DataHeaderCnv_p6.cxx
@@ -57,8 +57,7 @@ DataHeader* DataHeaderCnv_p6::createTransient(const DataHeader_p6* pers, const D
    DataHeader* trans = new DataHeader();
    const unsigned int provSize = pers->m_provenanceSize;
    trans->m_inputDataHeader.resize(provSize);
-   trans->m_dataHeader.resize(pers->m_shortElements.size() - provSize);
-
+   trans->m_dataHeader.resize(pers->m_shortElements.size() - provSize - 1); // Take into account self reference
    unsigned i = 0;
    for( auto& elem : trans->m_dataHeader ) {
       persToElem( pers, i++, &elem, form );
@@ -66,6 +65,9 @@ DataHeader* DataHeaderCnv_p6::createTransient(const DataHeader_p6* pers, const D
    for( auto& elem : trans->m_inputDataHeader ) {
       persToElem( pers, i++, &elem, form );
    }
+   trans->m_dataHeader.resize(pers->m_shortElements.size() - provSize); // Add self reference, which was appended to end
+   auto& elem = trans->m_dataHeader.back();
+   persToElem( pers, i++, &elem, form );
    trans->setStatus(DataHeader::Input);
    return trans;
 }
-- 
GitLab


From 8b484305dd9ad63f35d0a1486b6e368ffaa3eb48 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Sat, 18 Sep 2021 14:55:05 -0400
Subject: [PATCH 344/347] AthenaBaseComps: Avoid potential CLID conflict.

Tweak to avoid potential CLID conflict with B1 defined in SGtests.
---
 .../test/AthAlgorithmDHUpdate_test.cxx         | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/Control/AthenaBaseComps/test/AthAlgorithmDHUpdate_test.cxx b/Control/AthenaBaseComps/test/AthAlgorithmDHUpdate_test.cxx
index 416601e27f64..192c1b3b23fe 100644
--- a/Control/AthenaBaseComps/test/AthAlgorithmDHUpdate_test.cxx
+++ b/Control/AthenaBaseComps/test/AthAlgorithmDHUpdate_test.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 AthenaBaseComps/test/AthAlgorithmDHUpdate_test.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -28,11 +26,11 @@ CLASS_DEF (A2, 132102065, 0)
 CLASS_DEF (A3, 132102066, 0)
 SG_BASES2 (A1, A2, A3);
 
-class B2 {};
-class B1 : public B2 {};
-CLASS_DEF (B1, 132102074, 0)
-CLASS_DEF (B2, 132102075, 0)
-SG_BASE (B1, B2);
+class BB2 {};
+class BB1 : public BB2 {};
+CLASS_DEF (BB1, 132102074, 0)
+CLASS_DEF (BB2, 132102075, 0)
+SG_BASE (BB1, BB2);
 
 class C2 {};
 class C1 : public C2 {};
@@ -125,7 +123,7 @@ void test1()
   Gaudi::DataHandle h1 (DataObjID (ClassID_traits<A1>::ID(), "a1"));
   h.handle_ptrs.push_back (&h1);
 
-  h.outDeps.emplace (ClassID_traits<B1>::ID(), "b1");
+  h.outDeps.emplace (ClassID_traits<BB1>::ID(), "b1");
   h.outDeps.emplace (ClassID_traits<C1>::ID(), "c1");
   h.extraOutDeps.emplace (ClassID_traits<C1>::ID(), "c1");
   h.extraOutDeps.emplace (ClassID_traits<C1>::ID(), "d1");
@@ -140,7 +138,7 @@ void test1()
   DataObjIDColl exp = {
     { ClassID_traits<A2>::ID(), "a1" },
     { ClassID_traits<A3>::ID(), "a1" },
-    { ClassID_traits<B2>::ID(), "b1" },
+    { ClassID_traits<BB2>::ID(), "b1" },
     { ClassID_traits<C1>::ID(), "c1" },
     { ClassID_traits<C2>::ID(), "c1" },
     { ClassID_traits<C1>::ID(), "d1" },
-- 
GitLab


From dbcc7127ea0c6897ece0f2498995219e31262ae9 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 10 Sep 2021 16:18:50 -0400
Subject: [PATCH 345/347] VP1Gui: Fix compilation warnings.

A couple missing #includes meant that we weren't using the changes
for newer Qt versions when we should have been.
---
 graphics/VP1/VP1Gui/src/VP1EventFile.cxx        | 1 +
 graphics/VP1/VP1Gui/src/VP1EvtsOnServerInfo.cxx | 1 +
 2 files changed, 2 insertions(+)

diff --git a/graphics/VP1/VP1Gui/src/VP1EventFile.cxx b/graphics/VP1/VP1Gui/src/VP1EventFile.cxx
index 7987add85c98..8affb7ecd42f 100644
--- a/graphics/VP1/VP1Gui/src/VP1EventFile.cxx
+++ b/graphics/VP1/VP1Gui/src/VP1EventFile.cxx
@@ -14,6 +14,7 @@
 
 #include "VP1Gui/VP1EventFile.h"
 #include <QStringList>
+#include <QtCoreVersion>
 
 //____________________________________________________________________
 class VP1EventFile::Imp {
diff --git a/graphics/VP1/VP1Gui/src/VP1EvtsOnServerInfo.cxx b/graphics/VP1/VP1Gui/src/VP1EvtsOnServerInfo.cxx
index 7e2a5ae1e005..e0709024a44c 100644
--- a/graphics/VP1/VP1Gui/src/VP1EvtsOnServerInfo.cxx
+++ b/graphics/VP1/VP1Gui/src/VP1EvtsOnServerInfo.cxx
@@ -16,6 +16,7 @@
 #include "VP1Gui/VP1MD5Sum.h"
 #include <QFileInfo>
 #include <QTextStream>
+#include <QtCoreVersion>
 #include <map>
 
 
-- 
GitLab


From b9d87316092bb2e04fc1a134980ef613b8b4f710 Mon Sep 17 00:00:00 2001
From: Vakho Tsulaia <vakhtang.tsulaia@cern.ch>
Date: Sat, 25 Sep 2021 07:03:22 +0200
Subject: [PATCH 346/347] Switched AthenaPoolTest to reading
 CaloDetDescrManager from Conditions Store

---
 .../src/CaloClusterFakeReader.cxx             | 11 +++++-----
 .../src/CaloClusterFakeReader.h               | 20 +++++++++++-------
 .../src/LArCellContFakeCreator.h              |  6 +++---
 .../src/LArCellContFakeReader.cxx             | 14 ++++++-------
 .../src/LArCellContFakeReader.h               | 21 +++++++++++--------
 .../src/LArCellContFakeWriter.cxx             | 11 +++++-----
 .../src/LArCellContFakeWriter.h               | 20 +++++++++++-------
 7 files changed, 57 insertions(+), 46 deletions(-)

diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/CaloClusterFakeReader.cxx b/AtlasTest/DatabaseTest/AthenaPoolTest/src/CaloClusterFakeReader.cxx
index d70b3d4108ed..582402bc07cf 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/CaloClusterFakeReader.cxx
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/CaloClusterFakeReader.cxx
@@ -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
 */
 
 /**
@@ -21,7 +21,6 @@
 
 // DetDescr includes
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloDetDescr/CaloDetDescrManager.h"
 
 // Gaudi includes
 #include "GaudiKernel/MsgStream.h"
@@ -35,7 +34,6 @@
 CaloClusterFakeReader::CaloClusterFakeReader(const std::string &name, 
 					     ISvcLocator *pSvcLocator) :
     AthAlgorithm(name,pSvcLocator),
-    m_caloMgr(0),
     m_calocellId(0)
 {}
 
@@ -47,7 +45,7 @@ StatusCode CaloClusterFakeReader::initialize()
 {
     ATH_MSG_INFO( "CaloClusterFakeReader::initialize()"  );
     ATH_CHECK( detStore()->retrieve(m_calocellId, "CaloCell_ID") );
-    ATH_CHECK( detStore()->retrieve(m_caloMgr) );
+    ATH_CHECK(m_caloMgrKey.initialize());
     return StatusCode::SUCCESS;
 }
 
@@ -56,6 +54,9 @@ StatusCode CaloClusterFakeReader::execute()
 {
     ATH_MSG_DEBUG( "CaloClusterFakeReader::execute()"  );
 
+    SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
+    ATH_CHECK(caloMgrHandle.isValid());
+
     const CaloClusterContainer* clusCont = nullptr;
     ATH_CHECK( evtStore()->retrieve(clusCont,"LArClusterCont") );
 
@@ -66,7 +67,7 @@ StatusCode CaloClusterFakeReader::execute()
 
     // Create container
     const CaloCellContainer* caloCont1 = creator.createCaloCellContainer(m_calocellId,
-									 m_caloMgr,
+									 *caloMgrHandle,
 									 msg());
 
     CaloCellContainer::const_iterator first1 = caloCont1->begin();
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/CaloClusterFakeReader.h b/AtlasTest/DatabaseTest/AthenaPoolTest/src/CaloClusterFakeReader.h
index c824c9a10677..3f179f625ab3 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/CaloClusterFakeReader.h
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/CaloClusterFakeReader.h
@@ -1,9 +1,9 @@
 /*
-  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 SRC_CALOCLUSTERFAKEREADE_H
-# define SRC_CALOCLUSTERFAKEREADE_H
+#ifndef ATHENAPOOLTEST_CALOCLUSTERFAKEREADER_H
+#define ATHENAPOOLTEST_CALOCLUSTERFAKEREADER_H
 
 /**
  * @file CaloClusterFakeReader.h
@@ -27,9 +27,10 @@
 
 
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
+#include "StoreGate/ReadCondHandleKey.h"
 
 class CaloCell_ID;
-class CaloDetDescrManager;
 class CaloCellContainer;
 class CaloClusterContainer;
 
@@ -44,13 +45,13 @@ public:
     ~CaloClusterFakeReader();
   
     /// Algorithm initialize at begin of job
-    virtual StatusCode initialize();
+    virtual StatusCode initialize() override;
 
     /// Algorithm execute once per event
-    virtual StatusCode execute(); 
+    virtual StatusCode execute() override;
 
     /// Algorithm finalize at end of job
-    virtual StatusCode finalize();
+    virtual StatusCode finalize() override;
   
     ///////////////////////////////////////////////////////////////////
     // Private methods:
@@ -75,7 +76,10 @@ private:
     void printCells(const CaloClusterContainer* clusCont) const;
 
     /// DetDescr mgr for access to the id helper
-    const CaloDetDescrManager* 	m_caloMgr;
+    SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
+	, "CaloDetDescrManager"
+	, "CaloDetDescrManager"
+	, "SG Key for CaloDetDescrManager in the Condition Store" };
 
     /// IDhelper for LAr needed for identifiable container
     const CaloCell_ID*             m_calocellId;
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeCreator.h b/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeCreator.h
index 3f08d28003a8..1ae70265944d 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeCreator.h
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeCreator.h
@@ -1,9 +1,9 @@
 /*
-  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 SRC_LARCELLCONTFAKECREATOR_H
-# define SRC_LARCELLCONTFAKECREATOR_H
+#ifndef ATHENAPOOLTEST_LARCELLCONTFAKECREATOR_H
+#define ATHENAPOOLTEST_LARCELLCONTFAKECREATOR_H
 
 /**
  * @file LArCellContFakeCreator.h
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeReader.cxx b/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeReader.cxx
index 487e1d7b069d..90de7499aa7a 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeReader.cxx
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeReader.cxx
@@ -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
 */
 
 /**
@@ -18,12 +18,8 @@
 
 #include "LArCellContFakeReader.h"
 
-// Event includes
-//#include "LArRecEvent/LArCellContainer.h"
-
 // DetDescr includes
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloDetDescr/CaloDetDescrManager.h"
 
 // test includes
 #include "LArCellContFakeCreator.h"
@@ -33,7 +29,6 @@
 LArCellContFakeReader::LArCellContFakeReader(const std::string &name, 
 					     ISvcLocator *pSvcLocator) :
     AthAlgorithm(name,pSvcLocator),
-    m_caloMgr(nullptr),
     m_calocellId(nullptr)
 {}
 
@@ -42,7 +37,7 @@ StatusCode LArCellContFakeReader::initialize()
 {
     ATH_MSG_INFO( "LArCellContFakeReader::initialize()"  );
     ATH_CHECK( detStore()->retrieve(m_calocellId, "CaloCell_ID") );
-    ATH_CHECK( detStore()->retrieve(m_caloMgr) );
+    ATH_CHECK(m_caloMgrKey.initialize());
     return StatusCode::SUCCESS;
 }
 
@@ -51,6 +46,9 @@ StatusCode LArCellContFakeReader::execute()
 {
     ATH_MSG_DEBUG("LArCellContFakeReader::execute()" );
 
+    SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
+    ATH_CHECK(caloMgrHandle.isValid());
+
     // Retrieve container
     const CaloCellContainer* caloCont = nullptr;
     ATH_CHECK( evtStore()->retrieve(caloCont,"CaloCellCont1") );
@@ -62,7 +60,7 @@ StatusCode LArCellContFakeReader::execute()
     // Create container
     MsgStream log(msgSvc(), name());
     const CaloCellContainer* caloCont1 = creator.createCaloCellContainer(m_calocellId,
-									 m_caloMgr,
+									 *caloMgrHandle,
 									 msg());
 
     CaloCellContainer::const_iterator first = caloCont->begin();
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeReader.h b/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeReader.h
index 981e3e1c466e..0a9e43278aee 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeReader.h
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeReader.h
@@ -1,9 +1,9 @@
 /*
-  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 SRC_LARCELLCONTFAKEREADER_H
-# define SRC_LARCELLCONTFAKEREADER_H
+#ifndef ATHENAPOOLTEST_LARCELLCONTFAKEREADER_H
+#define ATHENAPOOLTEST_LARCELLCONTFAKEREADER_H
 
 /**
  * @file LArCellContFakeReader.h
@@ -27,9 +27,9 @@
 
 
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
+#include "StoreGate/ReadCondHandleKey.h"
 
-
-class CaloDetDescrManager;
 class CaloCell_ID;
 class CaloCellContainer;
 
@@ -41,13 +41,13 @@ public:
     LArCellContFakeReader(const std::string &name,ISvcLocator *pSvcLocator);
   
     /// Algorithm initialize at begin of job
-    virtual StatusCode initialize();
+    virtual StatusCode initialize() override;
 
     /// Algorithm execute once per event
-    virtual StatusCode execute(); 
+    virtual StatusCode execute() override;
 
     /// Algorithm finalize at end of job
-    virtual StatusCode finalize();
+    virtual StatusCode finalize() override;
   
     ///////////////////////////////////////////////////////////////////
     // Private methods:
@@ -72,7 +72,10 @@ private:
     void printCells(const CaloCellContainer* larCont) const;
 
     /// Need DD mgr to create cells
-    const CaloDetDescrManager* 	m_caloMgr;
+    SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
+	, "CaloDetDescrManager"
+	, "CaloDetDescrManager"
+	, "SG Key for CaloDetDescrManager in the Condition Store" };
 
     /// Need id helper to create cells
     const CaloCell_ID*          m_calocellId;
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeWriter.cxx b/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeWriter.cxx
index a666275df3d9..e3f4dab9728d 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeWriter.cxx
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeWriter.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
 */
 
 
@@ -24,7 +24,6 @@
 
 // DetDescr includes
 #include "CaloIdentifier/CaloCell_ID.h"
-#include "CaloDetDescr/CaloDetDescrManager.h"
 
 // Gaudi includes
 #include "GaudiKernel/MsgStream.h"
@@ -38,7 +37,6 @@
 LArCellContFakeWriter::LArCellContFakeWriter(const std::string &name, 
 					     ISvcLocator *pSvcLocator) :
     AthAlgorithm(name,pSvcLocator),
-    m_caloMgr(nullptr),
     m_calocellId(nullptr)
 {}
 
@@ -47,7 +45,7 @@ StatusCode LArCellContFakeWriter::initialize()
 {
     ATH_MSG_INFO( "LArCellContFakeWriter::initialize()"  );
     ATH_CHECK( detStore()->retrieve(m_calocellId, "CaloCell_ID") );
-    ATH_CHECK( detStore()->retrieve(m_caloMgr) );
+    ATH_CHECK(m_caloMgrKey.initialize());
     return StatusCode::SUCCESS;
 }
 
@@ -56,12 +54,15 @@ StatusCode LArCellContFakeWriter::execute()
 {
     ATH_MSG_DEBUG("LArCellContFakeWriter::execute()" );
 
+    SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
+    ATH_CHECK(caloMgrHandle.isValid());
+
     LArCellContFakeCreator creator;
 
     // Create container
     MsgStream log(msgSvc(), name());
     CaloCellContainer* caloCont = creator.createCaloCellContainer(m_calocellId,
-								  m_caloMgr,
+								  *caloMgrHandle,
 								  msg());
         
     if (!caloCont) {
diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeWriter.h b/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeWriter.h
index 7bf92b52be1a..43f49d794a0b 100755
--- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeWriter.h
+++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/LArCellContFakeWriter.h
@@ -1,9 +1,9 @@
 /*
-  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 SRC_LARCELLCONTFAKEWRITER_H
-# define SRC_LARCELLCONTFAKEWRITER_H
+#ifndef ATHENAPOOLTEST_LARCELLCONTFAKEWRITER_H
+#define ATHENAPOOLTEST_LARCELLCONTFAKEWRITER_H
 
 /**
  * @file LArCellContFakeWriter.h
@@ -27,8 +27,9 @@
 
 
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "CaloDetDescr/CaloDetDescrManager.h"
+#include "StoreGate/ReadCondHandleKey.h"
 
-class CaloDetDescrManager;
 class CaloCell_ID;
 class CaloCellContainer;
 
@@ -40,13 +41,13 @@ public:
     LArCellContFakeWriter(const std::string &name,ISvcLocator *pSvcLocator);
   
     /// Algorithm initialize at begin of job
-    virtual StatusCode initialize();
+    virtual StatusCode initialize() override;
 
     /// Algorithm execute once per event
-    virtual StatusCode execute(); 
+    virtual StatusCode execute() override;
 
     /// Algorithm finalize at end of job
-    virtual StatusCode finalize();
+    virtual StatusCode finalize() override;
 
     ///////////////////////////////////////////////////////////////////
     // Private methods:
@@ -71,7 +72,10 @@ private:
     void printCells(const CaloCellContainer* larCont) const;
 
     /// Need DD mgr to create cells
-    const CaloDetDescrManager* 	m_caloMgr;
+    SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
+	, "CaloDetDescrManager"
+	, "CaloDetDescrManager"
+	, "SG Key for CaloDetDescrManager in the Condition Store" };
 
     /// Need id helper to create cells
     const CaloCell_ID*             m_calocellId;
-- 
GitLab


From 805f327f28de4b89ff6c9b79d7152b08021e438d Mon Sep 17 00:00:00 2001
From: Sergi Rodriguez Bosca <serodrig@lxplus718.cern.ch>
Date: Tue, 28 Sep 2021 09:50:42 +0200
Subject: [PATCH 347/347] Changing energy values to et

---
 .../TrigT1/L1CaloFEX/L1CaloFEXSim/src/jSuperCellTowerMapper.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jSuperCellTowerMapper.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jSuperCellTowerMapper.cxx
index fe01f40688e4..b850802488d4 100644
--- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jSuperCellTowerMapper.cxx
+++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/jSuperCellTowerMapper.cxx
@@ -127,7 +127,7 @@ void jSuperCellTowerMapper::reset(){
         int pos_neg = idHelper->pos_neg(ID); // corresponds to 'barrel_ec' for LArEM
         int eta_index = idHelper->eta(ID);
         const int phi_index = idHelper->phi(ID);
-        float et = (cell)->energy();
+        float et = (cell)->energy()/cosh((cell)->eta());
         int prov = (cell)->provenance();
 
         /*
-- 
GitLab